main
3
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
8082e6a598 |
The alerting pillar had an endpoint and nobody reading it
`GET /admin-api/alerts` appeared in **zero** gate scripts. Both alert kinds were proven in-process, against `FakeUpstream`, at the database level — and the half that matters for an alert, the half where a human sees it, had nothing on the other end. The console read six endpoints and this was not one of them. The page now renders them: kind, source, count, last status and path, when. The kind an operator has to act on is marked rather than only printed, and the note above the table says what each kind means in words, because `server_error_streak` and `candidate_ban` are different sentences: your upstream is failing (and the edge will not ban the visitor who saw it) versus the rule would have banned and the mode is Observe. `scripts/console-smoke.sh` seeds four 502s from an address chosen for this run (`/boom`, added last commit), and `scripts/console-check.cjs` asserts the row by **source and count**, the note text, the marking, and that the table survives the phone pass: 26 → **30 assertions**. The wiring was the interesting part. The seeding runs in one container and the browser in another, so the address chosen at seed time cannot be inherited — an empty `SEED_ERROR` on the driver side would have quietly turned "the alert this run wrote" into "some alert exists somewhere". The seed now writes its values to `console-seed.env` (gitignored) and the rehearsal passes them to the browser container. `AdminConsoleTests` got the fast half: the markup contains the alerts table and fetches the endpoint. A static check cannot assert the row is there — that is what the browser gate is for — but it can notice the table disappearing without waiting for Chromium. 28 → **29 integration tests**. Numbers. Host: build 0 warnings, unit 54/54, integration 29/29. Linux rehearsal, one invocation on this tree, EXIT=0: source gates 54/54 + 29/29 + smoke 19/19, compose **35/35**, console **30/30** in a real Chromium. actionlint 1.7.12 over both workflow files: 0 problems; shellcheck, `bash -n` and `node --check` clean. Two things said plainly. The console number above is the Linux one: this laptop's browser cache has chromium-1223/1228/1234 and the pinned Playwright wants 1243, so the darwin console gate was not re-run for this change. And during the run the table's own note read "Newest 25" — the endpoint is capped and residue from earlier runs fills the page. That is OPEN-18's amplification showing up where an operator would see it, and the note states the cap instead of pretending the table is everything. |
||
|
|
66df999cdf |
The country table got a shape, and the page caught me colliding with itself
The console's country view was a column of numbers. "Where is this traffic
coming from" is a comparison, so each row now carries a bar sized against the
busiest country, and the table says what it counted. No tiles, no CDN, no asset
file: the runtime image is distroless and the page has to work at the moment the
site in front of it is being attacked. A geographic map is still not here and
the README now says why plainly — the admin API exposes counts per ISO code, not
coordinates, and an outline drawn from memory would be decoration that misleads.
The first run after the change failed, for a real reason: the class I added was
`.bar`, and the page already had a `.bar` — the toolbar. The toolbar collapsed
to 0.55em tall, `div#summary` started intercepting pointer events, and every
assertion after the token click died on a click timeout. Renamed to
`.sharebar`.
The gate itself got the same treatment as the page. It used to leave a reviewer
with nothing but a stack trace; now it writes a screenshot both when the page
cannot be driven at all and when it is driven and wrong. That path was checked
by making it red on purpose: with seeds that do not match the stack it exits 1
naming 3 failed assertions and writes a 105078-byte picture.
Measured, not assumed, in the same pass:
- `ci-gates.sh` gained a `console` gate and the workflow calls it by that name
instead of retyping the script: one definition, two callers. It is
deliberately NOT in `all` — without a Chromium the gate exits 2 ("cannot
run"), which is a different answer from 1 ("the page is wrong"), and folding
it in would make the one-command entry point unrunnable off a CI runner.
- `ci-gates.sh all` no longer stops at the last gate for want of an admin
token: it was dying at compose-smoke with `OPENWAF_ADMIN_TOKEN: set …` before
it could print a verdict. The throwaway for the stack the gate starts and
tears down itself is defaulted there; the standalone scripts still refuse to
invent one, because run by hand they can be pointed at a real deployment.
- The console job publishes the desktop and phone screenshots as artifacts,
with `if: always()` so the failure case is the one you can look at. The
relative SCREENSHOT path and the `console-evidence*.png` glob were verified
locally: 107935 and 86179 bytes written.
- DBIP_VERSION 2026-09 -> 2026-10. Not a cache hit: 8348509 bytes fetched,
image 261 MB, compose smoke 27/27 afterwards.
- The trap that bump exposes, measured rather than reasoned about: the same
rebuilt image reported `geoBuiltAt: 2026-09-01T01:32:45Z` against the
existing `openwaf_openwaf-geoip` volume and `2026-10-01T01:36:12Z` after
removing it. Docker seeds a named volume from the image only when the volume
is first created, so a rebuild alone never replaces the geo database.
Gates on this commit: build 0 warnings / 0 errors, unit 54/54, integration
27/27, smoke 19/19, image 261 MB, compose-smoke 27/27, console 16/16 (desktop
bar 513 px inside a 529 px cell; phone pass at 375 px in dark mode: scrollWidth
375, status contrast 11.85:1, bars 67 px), actionlint 0, shellcheck 0. Still
true, and unchanged by any of the above: not one of these jobs has run on a
runner, because the repository has no remote.
|
||
|
|
a3d0777492 |
openwaf: edge WAF with one decision point and a streak ban
Initial implementation of the OPEN-2 epic: a .NET 10 YARP edge that decides from what the upstream answered. Design (docs/ARCHITECTURE.md, tracker authority 4c9de3f6): - one short-circuit point, ordered: always-pass prefixes -> allowlist -> operator block (301) -> engine ban (403 + Retry-After) -> geo (451) - a post-response observer feeds a consecutive-refusal streak; N refusals in M minutes ban for BanDuration; 5xx alerts and never bans - provenance on the block row, so clearing engine bans cannot touch an operator's entries; the toggle is Off/Observe/Enforce and changes no rows - inherited protections from the reference deployment: one durable write per source per 30s, LRU-bounded streak map, no DB on the request path Verification: 36 unit + 14 integration tests, plus scripts/smoke.sh (19 assertions against a running edge and a real upstream, including the distroless --healthcheck mode). Findings worth keeping (documented in docs/ARCHITECTURE.md): - ctx.RequestAborted silently cancelled the ban write, because the observer runs after the response is written - SQLite cannot translate DateTimeOffset comparisons; timestamps are stored as integers there and stay timestamptz on PostgreSQL - CIDR masking order silently widened prefixes (198.51.100.24/19 -> /16) - an empty string in appsettings.json defeats the env fallback (?? on "") - concurrent ban writes raced into the unique index and lost evidence Also moves the unrelated 2026-09-30 inference benchmarks out of the project root into research/. |