The numbers now describe a run of the tree that has the provenance fix

README.md and .github/workflows/ci.yml quoted counts measured at 00f6dd9,
before the source filter was made strict. Both now say 8fba844 and carry the
counts from a run of this tree: unit 126/126, integration 73/73, smoke 19/19,
compose 43 passed / 0 failed, console 39 assertions / 0 failed.

The Shape block was stale in a way the prose was not: it still said 54 unit
tests, 30 integration tests and 41 compose assertions. Those three lines are
the first place a reader goes to size the test suite, and they were 72, 43 and
2 assertions short of what actually runs.

The README also gains the provenance section: ?source= used to map any
unrecognised value to operator, so GET ?source=enigne hid the engine bans and
DELETE ?source=enigne answered {"deleted":1} and left operator=0 engine=3 on a
stack holding 2 operator blocks and 3 engine bans. It now answers 400 naming
what was sent. The same family is documented: expiresInMinutes must be
1-5,256,000 when present, and reason/note are bounded at 512 characters after
both accepted a 1 MB payload and made the listings return ~1 MB each.
This commit is contained in:
Pavlo Ratushnyi
2026-10-02 01:33:55 +02:00
parent 8fba8447e9
commit e1f7456629
2 changed files with 29 additions and 14 deletions
+2 -2
View File
@@ -25,10 +25,10 @@
# scripts/ci-linux-rehearsal.sh runs the gates in containers. Source gates
# (restore, build, unit, integration, smoke) in mcr.microsoft.com/dotnet/sdk:10.0
# - Ubuntu 24.04.5, SDK 10.0.401 resolving the pinned global.json: unit 126/126,
# integration 62/62, smoke 19/19, first try (at 00f6dd9). Compose gate in docker:cli against
# integration 73/73, smoke 19/19, first try (at 8fba844). Compose gate in docker:cli against
# the host daemon: 43/43 on Linux. Console gate in
# mcr.microsoft.com/playwright:v1.63.0-noble - the stack seeded by docker:cli,
# the same console-check.cjs driving it in a real Linux Chromium: 37/37. The
# the same console-check.cjs driving it in a real Linux Chromium: 39/39. The
# only wall clock ever measured for the source job is 1:02.81 cold (first
# rehearsal); later rehearsals were not re-timed, so that number is quoted as
# measured once, not as current. So every gate this file runs has a Linux
+27 -12
View File
@@ -275,6 +275,21 @@ GET /admin-api/geo which database is loaded and how old it is
GET /admin-api/state snapshot age, tracked sources, counts
```
`?source=` on `/admin-api/blocks` is a provenance filter, and it used to accept
anything: an unrecognised value meant `operator`. With two operator blocks and
three engine bans live, `GET ?source=enigne` returned the operator list and hid
the engine bans, and `DELETE ?source=enigne` answered `{"deleted":1}` and left
`operator=0 engine=3` — a typo in the parameter that exists precisely so that
"clear the automatic bans" can never erase a human's list erased the human's
list. `source` is now `operator|engine|all` or a 400 naming what was sent; a
missing source is still "all", and the delete guard for a missing source is
unchanged. Two more of the same family: `expiresInMinutes` must be 1–5,256,000
when present (0 and −5 used to mean "never expires", silently, on the one
control that outranks every ban — leaving it out is now the only way to say
never), and `reason`/`note` are bounded at 512 characters, the budget the
attacker-written path field already gets, after a 1 MB note and a 1 MB reason
were both accepted and made the listings return ~1 MB each.
`redirectTo` on a block is the one field that ends up in a response header, and
the shipped image used to accept any string in it — `POST /admin-api/blocks`
answered 204 for all of these, and the next request from that source paid:
@@ -349,7 +364,7 @@ deployment.
The console gate starts the stack, seeds a source sitting at 2 of a threshold of
3 and an operator block with a reason, four 502s from an address chosen for this
run (`/boom`, see the alerting note above), drives `/admin` in a real Chromium,
and asserts 37 things. The read side: it authenticated, listed the streak as
and asserts 39 things. The read side: it authenticated, listed the streak as
current-over-threshold rather than as a historical maximum, listed the operator
block with its reason, listed observations and countries with bars that have
real pixel widths, listed the alert this run's seeding wrote (by source and
@@ -392,17 +407,17 @@ macOS working tree make the next `--no-build` try to exec an ELF file — inside
`mcr.microsoft.com/dotnet/sdk:10.0`. The compose gate runs in `docker:cli`
against the host daemon, so the image build and the stack are Linux.
Rehearsed 2026-10-02, most recently at `00f6dd9`. Source gates: Ubuntu
Rehearsed 2026-10-02, most recently at `8fba844`. Source gates: Ubuntu
24.04.5, SDK **10.0.401** resolving `dotnet/global.json` (pinned `10.0.100`,
`rollForward: latestFeature` — which is also the answer to whether
`setup-dotnet` with `10.0.x` satisfies the pin), unit **126/126**, integration
**62/62**, smoke **19/19**, first try, nothing to fix. The first
**73/73**, smoke **19/19**, first try, nothing to fix. The first
rehearsal of this pipeline timed a cold container and a cold NuGet cache at
**1:02.81**; the runs after it were not re-timed, so that is the only wall clock
measured here, and the source job's 25-minute timeout is not close either way.
Compose gate on Linux: **43 passed, 0 failed** (27 before the geo-pin and
alerting assertions, 41 before the alert-edge ones), enforcement lag 0 ms, 12 ms
and 36 ms in three runs. Console gate on Linux: **37 assertions, 0 failed** —
and 36 ms in three runs. Console gate on Linux: **39 assertions, 0 failed** —
described below. `scripts/geo-db-freshness.sh` was run
in `mcr.microsoft.com/dotnet/sdk:10.0` too: current pin answers 0, and a forced
`PIN=2026-05` answers 1 with the bump command, so the gate that decides whether
@@ -424,7 +439,7 @@ and the stack is torn down afterwards. That image ships the browsers but not the
npm package, so the script installs `playwright-core` into `/tmp` and points
`PLAYWRIGHT_CORE` at it, mounting the repository read-only so the install never
lands in the working tree. Rehearsed the same day on Linux 7.0.12-linuxkit
aarch64, node v24.20.0, `chromium-1243`: **37 assertions, 0 failed**, including
aarch64, node v24.20.0, `chromium-1243`: **39 assertions, 0 failed**, including
the round-trip the page alone cannot fake — a ban drawn on the page answers 301
on the next request from that address. All three scenes in one cold run:
**2:14.33**.
@@ -433,11 +448,11 @@ on the next request from that address. All three scenes in one cold run:
Honest status of the workflow itself: it has never executed on a GitHub-hosted
runner, because the repository has no remote. It *has* been executed start to
finish by a local Actions-compatible runner — `nektos/act` 0.2.89 on
`catthehacker/ubuntu:act-latest`, most recently at `00f6dd9` — and every job
`catthehacker/ubuntu:act-latest`, most recently at `8fba844` — and every job
reported success: `lint` (both pinned tools download, verify their checksums
and find nothing), `source` (unit 126/126, integration 62/62, smoke 19/19),
and find nothing), `source` (unit 126/126, integration 73/73, smoke 19/19),
`image` (`openwaf:ci` 261 MB, compose smoke 43 passed / 0 failed), `console`
(37 assertions / 0 failed with `playwright@1.63.0` and `chromium-1243`,
(39 assertions / 0 failed with `playwright@1.63.0` and `chromium-1243`,
screenshot artifact published) and the `freshness` job (pin 2026-10 = newest
2026-10). That is a stronger claim than
"the steps were run by hand", and a weaker one than "CI is green": it proves the
@@ -480,11 +495,11 @@ dotnet/
OpenWaf.Domain/ pure decision core: source key, streak, ordered decision
OpenWaf.Infrastructure/ EF Core (sqlite/postgres), snapshot store, writers, MMDB geo
OpenWaf.Edge/ the deployable: guard, observer, admin API, healthcheck mode
OpenWaf.Tests.Unit/ 54 tests over the decision logic
OpenWaf.Tests.Integration/ 30 tests driving the real pipeline against a fake upstream
OpenWaf.Tests.Unit/ 126 tests over the decision logic
OpenWaf.Tests.Integration/ 73 tests driving the real pipeline against a fake upstream
scripts/smoke.sh 19 assertions against a running edge + a real upstream
scripts/compose-smoke.sh 41 assertions against the built image (compose + nginx)
scripts/console-check.cjs 37 assertions against the page, in a real Chromium
scripts/compose-smoke.sh 43 assertions against the built image (compose + nginx)
scripts/console-check.cjs 39 assertions against the page, in a real Chromium
scripts/geo-db-freshness.sh the pinned geo database vs the vendor (0/1/2)
.github/workflows/ci.yml runs the gates on every push
.github/workflows/geo-freshness.yml the same check on a schedule