OPEN-12's option (b) — share the block list and shorten the TTL — was not a
deployment decision, it was a rebuild: EdgeStateStore.RefreshTtl was a
property initialised to 30 s with no configuration binding anywhere in the
tree. The measurement in research/2026-10-01-multi-instance/ showed why that
matters: the TTL is not a tuning knob, it is the propagation delay between
edges (23.7 s under ~36 req/s, 1.7 s on an idle one), so an operator who
runs more than one instance is choosing a staleness bound they cannot set
and cannot see.
The key is OpenWaf:State:RefreshTtlSeconds, default 30, and the default is
unchanged so nothing moves for anyone who does not touch it. A value outside
1-300 aborts startup instead of falling back silently, because a typo in the
staleness bound is a security setting failing quietly. /healthz now reports
snapshotTtlSeconds, so an operator can read the TTL they actually got.
Verified on this commit: 49 unit and 23 integration tests pass (13 new unit
cases on the parser; 3 new integration tests that write a ban the way another
instance would — straight into the database, no InvalidateAsync — and show a
1 s TTL closing the window inside 5 s while a 300 s TTL keeps serving a
source the database has already banned); scripts/smoke.sh 19/19;
scripts/compose-smoke.sh 27/27 against the rebuilt image; in a container
RefreshTtlSeconds=5 reports snapshotTtlSeconds:5 on /healthz, and =0 aborts
the process with the key named in the log.
One thing the check taught and the README now says instead of hiding: when
startup aborts inside the image, the container stays Up with nothing
listening until the HEALTHCHECK goes unhealthy. That is how every startup
failure in this image looks, not something this change introduces.
The admin API has been complete since a3d0777 and an operator still has to
drive it with curl. GET /admin now serves one page: mode and snapshot age, live
bans with their reasons, the sources being watched, and the countries seen.
Every control on it is one call to an existing endpoint — the page decides
nothing, which is the only reason it is safe to put on an edge.
Inherited properties, tested rather than asserted in a comment:
* /admin is on the always-pass list, so a blocked operator can still reach the
page that unblocks them (integration test + compose-smoke assertion);
* the always-pass surface is never observed, so fumbling it builds no streak;
* the token is typed into the page and sent as a header — never in a URL, where
it would sit in proxy logs, history and Referer — and the markup is checked
not to contain it, in the fixture and against the built image.
No external assets: a console that needs a CDN fails exactly when the site
behind the edge is under attack.
One new read endpoint, /admin-api/countries/summary, counting sources and
refusals per country from the observation aggregates — there is no request log
to count, by design.
Two bugs the new tests caught before this was true:
* "/admin" and "/admin/" are the same route to the matcher — registering both
is an AmbiguousMatchException, i.e. a 500 on the page; now one endpoint with
a catch-all, so a mistyped subpath shows the page instead of being proxied to
an upstream that has never heard of it.
* the country query compiled and failed at translation time with a record
constructor; an anonymous projection translates.
Gates on this commit: 36 unit + 19 integration, 0 failed; scripts/smoke.sh
19/19; docker build ok (261 MB); scripts/compose-smoke.sh 27/27, the three new
assertions included.
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/.