Files
openwaf/scripts
Pavlo Ratushnyi dcf8a733a9 A healed storage failure returned the edge to ready without waiting for traffic
OPEN-34, measured on the shipped image before this change. With writes to
block_entries aborted, five refusals produced counted write failures and
/readyz 503. The triggers were then REMOVED — write path healthy, zero triggers
left — and no further request was sent from that source:

  t+30 s  /readyz 503   /state: banWriteFailures 3, bansNotWritten 3
  t+60 s  /readyz 503   unchanged
  t+90 s  /readyz 503   unchanged
  t+120 s /readyz 503   unchanged

The ban pillar clears only on a successful ban write, and the only thing that
produced one was the source crossing the threshold again. Readiness — the
signal an orchestrator uses to keep an edge in rotation — was therefore coupled
to attack traffic: the quieter the site, the longer a repaired edge sat out of
service, enforcing everything except one ban nobody had written.

The fix is on the write side, not on the gate. A ban the engine decided and
could not write is kept as a PendingBan and re-attempted by a hosted loop on the
same 15 s cadence the other writers use; the sentence still runs from the moment
the ban was decided, so a retry that lands late cannot quietly lengthen it, and a
pending ban whose sentence expired before it could be written is counted
(bansNeverEnforced) and reported rather than rewritten as a fresh, longer ban.
/state gained bansPendingRetry and bansNeverEnforced, because without the first
a healed storage failure is indistinguishable from a quiet site.

Teeth: PendingBanRetryTests (3) — the retry landing with no further request, the
hosted loop doing it on its own (nobody calls it in that test), and an expired
pending ban reported rather than written late. Compose gate gained a 5-assertion
scene against the shipped image: the failed ban is queued, readiness returns
after the repair with no traffic from that source, the ban reaches storage, the
queue empties, and the source that was never banned during the break answers 403
afterwards.

Gates at this commit — macOS host: unit 128/128, integration 141/141, smoke
28/0, compose 86/0, console 58/0, 0 containers left behind. Linux rehearsal,
all three stages: PASS — source (128/128, 141/141, 28/0), compose 86/0 with
enforcement lag 13 ms, console 58/0, 0 containers left behind.
2026-10-02 11:34:44 +02:00
..