56 Commits
Author SHA1 Message Date
Pavlo Ratushnyi 925fc62d4b the gate's claim about its own writes was false, and the gate now counts it
ci / lint the workflow and the shell (push) Successful in 8s
ci / build, test, smoke (push) Successful in 1m45s
ci / the operator page in a real browser (push) Successful in 2m12s
ci / the same smoke on an image with no base (push) Successful in 4m20s
ci / build the image and smoke it (push) Successful in 4m20s
a8f440b wrote that the gate's admin writes go through `admin_write`. Measured
against the same file an hour later: of its 60 writes that do not go through
`admin`, 34 did — 25 still answered through the un-retried `code` and one went
straight to `curl`. The other 91 writes and 157 reads went through `admin`, which
carried no part of OPEN-39's rule at all: a read that reached nothing answered
NO_JSON_BODY and the log said nothing about why, because the sentinel names the
missing body, not the missing request. The dead-edge scene asserted the opposite
of the fix — that those dead reads write no line to stderr — so the gate was not
only un-instrumented there, it was guarding the missing instrument.

Call sites, counted on this file with comment lines excluded: 261 `admin` (91
writes, 157 reads, 8 carrying -D/-o/-w), 59 `admin_write`, 139 `code`.

What changed:

  * `curl_retry` puts OPEN-39's rule under the body-returning helpers. A transport
    failure is retried three times and each retry prints the container it sampled;
    an HTTP answer — 400, 403, 500 — is an answer and comes back after one attempt.
    `admin` and a new `body`, for the scenes that carry their own token, sit on it.
  * the body comes back byte for byte. `$(curl ...)` strips trailing newlines and
    the six-parallel-POSTs scene writes six `%{http_code}` lines into one shared
    file; a wrapper that re-printed carelessly would have turned that assertion
    into "204204204204204204". The exit status rides in on a marker suffix instead
    of riding on the output.
  * the 25 and the 1 joined `admin_write`.
  * the dead-edge assertion asks for the nine diagnosis lines and for the absence
    of a traceback instead of for silence. It also carried the bug that hid the gap
    for one run: `a | b 2>f` captures only b's stderr, so the first version read
    back an empty file while the nine lines went to the terminal.
  * the claim is now a gate: the file greps its own source and goes red, printing
    the count, if any write answers through the un-retried status helper or goes
    straight to curl — and fails closed when it cannot read itself.

Three assertions added, one removed: 375 -> 379.

Measured. compose-smoke 379 passed / 0 failed at load average 12 (21:07,
/tmp/compose-retry2.log); that run is one comment rewrap away from this text, and
the two self-audit greps were re-run against the committed file and answer 0 and 0.
readme-counts agrees against that run's totals (379=379, exit 0). shellcheck 0.11.0
and bash -n clean. The retry was again proved against a stub rather than a caught
flake: unreachable twice then a body -> two diagnosis lines and the body's trailing
newline intact (xxd: 610a 620a); always unreachable -> three lines and an empty
body; a 400 -> none; a body ending in `x` -> returned unchanged.

Not measured green: this text against the scratch image. The shared host has held
load average 26-72 since 21:10 and four runs of this tree went red on it — 375/4
at load 31, 377/2 at load 39, 378/1 at load 48 — with every failure in a scene that
reads a projection right after a write that was answered: the two alert-escalation
scenes, and once "the shipped story names the block, the covering range and the
exemption, oldest first" in a run where both alert scenes were green. No `000` near
any of them, and the same tree at load 10-12 was 379/0. That is OPEN-78, filed
today; the README's Gates section now carries those red numbers instead of a green
one it does not have.
2026-10-06 21:49:08 +02:00
Pavlo Ratushnyi a8f440b933 a write that never reached the edge stops taking four assertions down with it
ci / lint the workflow and the shell (push) Successful in 10s
ci / build, test, smoke (push) Successful in 2m17s
ci / the operator page in a real browser (push) Successful in 2m41s
ci / build the image and smoke it (push) Successful in 4m48s
ci / the same smoke on an image with no base (push) Successful in 4m43s
Measured 2026-10-06 (/tmp/compose-diag.log, recorded in the README's Gates
section): one POST of a /29 answered 000 while the edge container reported
running/healthy — the gate could not reach a live edge, with another project's
dotnet suite running on the same daemon — and four assertions about a range went
red about a row that was never written. One of those four was worse than red: a
bare `next()` over the block listing raised StopIteration into the log, the
OPEN-48 shape again in a third place.

OPEN-77 asked which rule the gate should have here. The rule it has now: a write
whose request got no answer at all is retried, three times, and each retry prints
the container's own state; a refusal is an answer, so 400 and 403 come back after
one attempt untouched; and the retry is bounded, so a surface that is really
closed still goes red rather than spinning. Retrying a write that got no response
is safe on this surface because every write it takes is keyed and idempotent —
the six-parallel-POSTs scene asserts that one address lands as one row, the
transfer scene asserts that importing the same document twice adds nothing — and
both of those are assertions, not assumptions.

All 33 admin writes in the gate now go through admin_write; the three bare
next() reads answer no-pillar / no-record / no-such-row instead of tracebacks;
and the dead-edge scene asserts the retry against a container that is really
stopped: the write still answers 000, and it says so three times. Two assertions,
373 -> 375.

Measured here: compose-smoke 375 passed / 0 failed against the chiseled image and
375 / 0 against the scratch image, same arm64 host; readme-counts agrees
(375=375); shellcheck 0.11.0 clean over scripts/*.sh. Against a stubbed `code`
that answers 000 twice and then 204, admin_write returns 204 after three attempts
with two retry lines; a 400 comes back after one attempt with none. Neither green
run printed a retry line — the host was quiet — which is why the rule is asserted
by a scene that stops the edge rather than by waiting to catch another flake.
2026-10-06 20:43:53 +02:00
Pavlo Ratushnyi 179e0f51a0 two compose-gate assertions reported a pass about an edge that had never started
ci / build, test, smoke (push) Successful in 3m54s
ci / the same smoke on an image with no base (push) Successful in 4m2s
ci / lint the workflow and the shell (push) Successful in 7s
ci / the operator page in a real browser (push) Successful in 2m23s
ci / build the image and smoke it (push) Successful in 4m1s
The NativeAOT measurement run of 2026-10-06 (/tmp/aot-smoke.log, the tree that
became d08ec30) is a run against an edge that dies at start-up, and the gate
answered it with 125 Python tracebacks, 32 `integer expression expected` shell
errors, `docker: volumes-from specification cannot be an empty string` 6 times
and `invalid container name or ID: value is empty` 121 times. Two assertions came
back `ok` in that run — `the state counts a policy pillar that cannot read its
table yes`, printed directly under `policy reload failures counted after the
table went away: NO_JSON_BODY`, and the same pair for the observation pillar —
because the comparison was `!= "0"` and a value that was never read is not the
string `0`. OPEN-48 fixed exactly this shape for jval; jcount and jget never got
it, and the `!= 0` sites were worse than the tracebacks: a green assertion about a
dead process.

jcount now answers -1 for a body it cannot read — the sentinel streaks_where has
used since it was written — and jget answers the NO_JSON_BODY jval prints. Every
count comparison goes through is_count/count_ge/count_gt/count_moved/count_sub,
so a value that is not a run of digits is "not read" rather than a number or the
shell's problem, and a delta whose either side was not read prints -1 where a
misleading 0 used to sit. The sidecar names the edge container it cannot share a
volume with instead of handing docker an empty --volumes-from, and the health wait
answers `no-container` instead of asking docker about an empty id once per
half-second. The dead-edge scene asserts all of it against a container that is
really stopped rather than a canned string: the three helpers answer their
sentinels, a comparison on a value that was never read answers no, and none of
those reads or comparisons wrote a line to stderr. Five assertions, 368 -> 373.

Measured here: compose-smoke 373 passed / 0 failed against the chiseled image and
373 / 0 against the scratch image, same arm64 host; the five new assertions were
green in all four runs of the gate today, including the two that went red
elsewhere. `readme-counts` agrees (373=373). shellcheck 0.11.0 clean over
scripts/*.sh; actionlint cannot run on darwin and the lint gate says so with exit
2 — the ci.yml change is a comment.

Two of those red runs are recorded in the README rather than smoothed: one lost
four alert assertions, the other five range assertions, and the second names its
own cause (`curl answered 000 … the edge container reports running/healthy`,
another project's dotnet suite running on the same daemon, load average 11). The
new arithmetic separates the two shapes a red alert scene can mean — a read that
did not parse prints -1, a row that is not there yet prints 0 — and both runs
printed 0.
2026-10-06 19:55:25 +02:00
Pavlo Ratushnyi be6c608ada the edge ships on an image with no base, and the 368 assertions agree it behaves
ci / the operator page in a real browser (push) Successful in 2m38s
ci / lint the workflow and the shell (push) Successful in 13s
geo-freshness / the pinned geo database vs the vendor (push) Successful in 4s
ci / build, test, smoke (push) Successful in 2m48s
ci / build the image and smoke it (push) Successful in 4m23s
ci / the same smoke on an image with no base (push) Successful in 5m3s
Dockerfile.scratch builds the same program self-contained and puts it on
scratch: 12 shared objects and the CA bundle — 18.7 MB — carried at their
absolute paths, because a scratch layer has nothing to borrow them from, and the
dynamic loader has to land at the path recorded inside the binary or the kernel
refuses to start the process. Measured on one arm64 host: chiseled 262 MB,
scratch 222 MB. scripts/compose-smoke.sh runs against it unchanged through
docker-compose.scratch.yml: 368 passed, 0 failed, and 368/0 again when the same
gate is called as scripts/ci-gates.sh scratch-smoke.

The first scratch image built here is why that second run matters. It started,
its own HEALTHCHECK reported healthy, and it still failed 7 of the 368. A
self-contained apphost takes its content root from the process's working
directory, a scratch image has no WORKDIR, so the process began in /, never found
the appsettings.json next to it, the reverse proxy had no routes, and every
request that should have reached the upstream answered the edge's own 404 —
including /boom's 502, which turned the "server errors alert, they never ban"
scene into a streak ban. The edge said it in its own log: "Request reached the
end of the middleware pipeline without being handled by application code."

The schema-script gate was red on the runner at 7c5e1ef (run 2462, exit 2):
`dotnet tool restore` from the repo root finds no manifest, prints "No tools were
restored." and exits 0, so the gate's own restore check passed vacuously and
`dotnet ef` then died. It now restores dotnet/dotnet-tools.json by path and asks
the tool for its version before trusting it.

NativeAOT, measured further: with the two alert-queue queries taken out,
`dotnet ef dbcontext optimize --precompile-queries` on EF 10.0.12 reports 0
precompilation errors and writes 8 interceptor files — 14 of whose declarations
have dots in the identifier, because the local is named from the entity type's
full name. The 4 refusals that remain are four shapes the generator cannot
translate at all: Contains over a captured collection, any method parameter
referenced inside a query (down to the CancellationToken), an ExecuteUpdate
set-list, and a literal whose type is not the column's. docs/ARCHITECTURE.md
carries the exception for each. No C# changed in this commit: the experiments
that produced those numbers were reverted, and the query rewrites kept at
7c5e1ef are the ones that made 40 refusals into 4.

Gates: scratch-image and scratch-smoke in scripts/ci-gates.sh and in `all`, and a
fifth CI job that runs the 368 against the scratch image on the runner.
2026-10-06 06:38:07 +02:00
Pavlo Ratushnyi 7c5e1ef230 the edge gains a schema step a compiled binary can run, and NativeAOT gets a measured verdict
ci / lint the workflow and the shell (push) Successful in 10s
geo-freshness / the pinned geo database vs the vendor (push) Successful in 5s
ci / the operator page in a real browser (push) Successful in 3m42s
ci / build, test, smoke (push) Failing after 2m6s
ci / build the image and smoke it (push) Successful in 5m7s
The Dockerfile said "why not NativeAOT" on the authority of another repo's
Dockerfile. That claim is now this repo's own, and it is a measurement.

What was built to find out:

* Persistence/Schema/schema.sqlite.sql — the model's DDL, generated by
  `dotnet ef dbcontext script`, embedded in the binary and read by
  Persistence/EmbeddedSchema.cs. A NativeAOT build cannot ask EF to build a
  model at run time, and EnsureCreated and GenerateCreateScript both go through
  the design-time model, so the schema step has nowhere to get its SQL from.
  OPENWAF_SCHEMA=script is the fourth strategy: same provider-shaped
  statements, produced at build time instead of at start-up. The schema-script
  CI step regenerates the file and fails the run when the committed copy is not
  what the current model produces (5652 bytes today).
* SchemaUpgrader.ModelTables asks the runtime model, per entity type. The
  design-time one is refused outright under NativeAOT, and GetRelationalModel()
  on the runtime model of a compiled model throws
  "The annotation 'Relational:DefaultMappings' cannot be added because an
  annotation with the same name already exists on the object EntityType:
  CountryRule" — building a compiled model's relational model a second time
  collides with itself.
* The persistence layer's queries were rewritten into the shape EF's query
  precompiler accepts: captured parameters copied to locals, conditional
  IQueryable composition written as literal chains, aggregates that take a
  predicate given their own Where. 40 of them were refused before that.
* dotnet-ef and EF Core moved 10.0.0 -> 10.0.12, because 10.0.0's design package
  ships no build host and `--precompile-queries` cannot load a project without it.

What the measurement says, from scripts/aot-probe.sh on osx-arm64: the AOT build
compiles (48,797,072-byte native binary, 10 IL warnings, 0 errors), starts, and
creates all 12 tables from the DDL it carries. Then it never serves. EF refuses
every query at run time ("Query wasn't precompiled and dynamic code isn't
supported with NativeAOT"), and the precompiler that would fix that is not
usable on this model: after all 40 refusals were cleared it emitted 14
declarations with dots in the identifier
(`var openWaf.Domain.Security.BlockEntryPrimaryKeyProperties = …`) — 28 CS1002
and CS1003 errors, one per entity materialisation — with or without --nativeaot.
The refusals themselves trace to dotnet/efcore#35887, #38030 and #35494; the fix
landed in the 12.0-preview1 milestone, not in any 10.0.x.

Two things were not kept, and why:

* The atomic alert-queue claim and the claim release were rewritten as raw SQL
  to dodge the precompiler's ExecuteUpdate failures. Reverted: with the
  statement written as SQL, DateTimeOffset reaches sqlite as a provider
  parameter instead of through the property's own mapping, the reclaim
  comparison stops matching, and
  AlertPushQueueTests.A_delivery_owed_by_a_process_that_stopped_is_owed_by_the_next_one
  fails with the row still owed. A correctness risk here buys nothing when the
  AOT build is blocked further along anyway.
* --nativeaot on the compiled model: its unsafe accessors do not compile
  (CS1503 in BlockEntryEntityType.cs). The plain compiled model is what is
  committed.

The compose gate's two escalation-count scenes also stopped being a coin toss.
They slept a fixed 2 s and then counted; on a loaded host the same tree read 3
rows once and 1 the next, and the assertion is about a settled number either
way. They now wait for three equal reads, bounded. The scene count is unchanged
at 368.

Gates at this commit: build 0 warnings / 0 errors, unit 378/378, integration
405/405, schema-script ok, smoke 256/0, compose-smoke 368/0, README counts
match (256, 368), lint clean (actionlint 1.7.12, shellcheck 0.11.0).

Not verified: the AOT image on linux-x64 — the probe ran on osx-arm64, and the
ILC failure mode that ends the attempt is a codegen bug in EF, not a
platform-specific one, but that is an inference rather than a measurement.
2026-10-06 05:20:28 +02:00
Pavlo Ratushnyi cd5935b28e the gates gain the proof their own claims were missing, and the README has to pay for its numbers
ci / lint the workflow and the shell (push) Successful in 13s
ci / build, test, smoke (push) Successful in 1m59s
ci / the operator page in a real browser (push) Successful in 2m45s
ci / build the image and smoke it (push) Successful in 4m25s
compose-smoke.sh: the read-side redirect guard is proven on the shipped image at
last — a good target is written through the API, the stored column is rewritten
underneath a running edge through the sidecar, and the edge is asked what it
sends once the snapshot rebuilds. javascript:alert(1) answers 301 to the policy
default and never to the stored value; a CRLF-bearing row answers 301 rather than
the 500 Kestrel used to produce, and injects nothing. A curl 000 now samples the
container it was aimed at and prints what it reports, and the gate ends by making
the dead case happen on purpose: compose stop, 000 beside exited/unhealthy,
compose start, running/healthy again.

console-check.cjs: the observation table is waited for rather than read at one
instant (an act run saw X-Total-Count: 0 where the same head a minute earlier had
11 rows), and the page's own request paths are pinned — the 14 admin-api calls it
issues, their query strings, no others, none answered 404. A wrong URL on a page
never looks like a wrong URL; it looks like an empty table.

ci-gates.sh gains readme-counts: each gate records the total it actually ran into
GATE_TOTALS_DIR and the README's claimed number is compared with it. Its first
verdict was that the README claimed 229 assertions for a gate printing 368 — a
139-assertion gap nothing could see. The README now says 368 and 168, both
measured in this run, and the run-by-run table gains 2405.

Verified locally: compose smoke 368/0, console 168/0, smoke 256/0, lint green at
actionlint 1.7.12 and shellcheck 0.11.0.
2026-10-06 01:16:20 +02:00
Pavlo Ratushnyi 249e3f93b5 the gates gain the assertions they were missing, and lint gains a local caller
ci / lint the workflow and the shell (push) Successful in 9s
ci / build, test, smoke (push) Successful in 2m23s
ci / the operator page in a real browser (push) Successful in 2m47s
ci / build the image and smoke it (push) Successful in 4m0s
Four gaps named on the board, each closed by making the shipped image answer the
question instead of an in-process test:

OPEN-45 - three pagination bounds were proven only in-process. On the image now:
the block listing's ceiling at its UPPER end (limit=2001 -> 400 naming
"limit must be 1..2000; got 2001" - only the lower end was on the image), a
negative offset on the streak map (checked on observations, blocks and alerts,
never here), and that an offset on the alert listing moves to a different row -
the scene used to assert only the truncation arithmetic.

OPEN-49 - DELETE /admin-api/countries/{code} validates the code the same way the
write does, and nothing on the image had ever asked. Three checks added: "12" and
"USA" are refused with the write's own sentence, not answered as if a row existed.

OPEN-48 - jval piped the body straight into json.load, so a request that produced
no body printed a Python traceback into the middle of an assertion and the
assertion compared an empty string. "the counter is 0", "the field is missing"
and "there was no answer at all" were the same word in the log. Three states,
three answers now: NO_JSON_BODY, empty, the value.

OPEN-41 - the markup-path assertion read the observation table once. That row is
written by the coalesced observation writer, so its arrival is on a timer: two
runs of one head at 9383362, one failed with `[]` and the next passed, and the
`[]` could not tell "not persisted yet" from "never persisted". The row is waited
for with a 10 s budget, the wait is printed either way, and a failure names what
was waited for and every path cell the table did hold.

OPEN-44 - the workflow files and the smoke scripts were linted by exactly one
caller, a CI job, so `ci-gates.sh all` could be green on a tree CI would refuse.
The pinned actionlint 1.7.12 and shellcheck 0.11.0 (same checksums) move into
scripts/ci-gates.sh as a `lint` gate and the CI job calls it: one definition, two
callers. A host with neither tool and no supported platform exits 2 - "cannot
run" - rather than reporting a pass, the console gate's convention.

Measured on this tree: scripts/ci-gates.sh lint green locally (actionlint 1.7.12,
shellcheck 0.11.0); compose smoke 356 passed / 0 failed, up from 348 by exactly
the eight assertions added above; the console check passed all its assertions
locally against the built image.
2026-10-06 00:32:28 +02:00
Pavlo Ratushnyi 992a7b795b the console job stops owing the runner an artifact it cannot accept, and the snapshot-age test gets a bound start-up cannot blow
ci / lint the workflow and the shell (push) Successful in 10s
ci / build, test, smoke (push) Successful in 2m11s
ci / the operator page in a real browser (push) Successful in 2m16s
ci / build the image and smoke it (push) Successful in 3m33s
actions/upload-artifact@v4 is not a step this runner can run. Run 2370
(head 36d9338) drove the page through every assertion — console check: all
assertions passed — and the job went red one step later on
`@actions/artifact v2.0.0+ … not currently supported on GHES`. The step now
names each screenshot with its size and sha256 in the log, which is what the
gate's own output already describes assertion by assertion.

PillarFailureVisibilityTests.The_snapshot_age_is_measured_against_the_ttl_it_is_supposed_to_respect
asked whether a snapshot was older than a one-second TTL, and the age at the
first read already includes however long the fixture took to come up. On a
loaded machine that bound is blown before the assertion runs (OPEN-76). The TTL
is now 10 with a 13 s wait: the bound is one the fixture controls, and the
assertion still says stale and failing are different claims.

README: the blast-radius preview had no section — /admin-api/impact was the only
admin surface with none — and the Shape counts had drifted (unit 256 -> 378,
integration 245 -> 405, smoke 52 -> 256, console 90 -> 164), measured on this
tree: unit 378/378, integration 405/405, smoke 256/0, compose 348/0, console
164/0.
2026-10-05 22:08:28 +02:00
Pavlo Ratushnyi 63cc575eb9 the two volume-fill steps are block scalars, so their comments are comments
ci / lint the workflow and the shell (push) Successful in 10s
ci / build the image and smoke it (push) Successful in 3m25s
ci / the operator page in a real browser (push) Failing after 2m49s
ci / build, test, smoke (push) Failing after 1m37s
2026-10-05 21:35:27 +02:00
Pavlo Ratushnyi 223b8d6100 the gateway is read from the kernel table, because this job image has no ip command
ci / lint the workflow and the shell (push) Successful in 11s
ci / build, test, smoke (push) Failing after 1m27s
ci / the operator page in a real browser (push) Failing after 2m37s
ci / build the image and smoke it (push) Failing after 3m59s
Run 2355, image job: `ip: command not found`, exit 127 — the step that names the
address died one line in, before the gate ever ran. /proc/net/route carries the
same default route; its gateway is hex little-endian, and bash turns it back into
a dotted quad with no helper at all (0100110A → 10.17.0.1).
2026-10-05 21:26:23 +02:00
Pavlo Ratushnyi fb491a4041 the compose gates are pointed at the host address, because the job's own loopback is not where the ports are published
ci / lint the workflow and the shell (push) Successful in 8s
ci / build the image and smoke it (push) Failing after 20s
ci / the operator page in a real browser (push) Failing after 49s
ci / build, test, smoke (push) Successful in 1m45s
Run 2350 (b402ec4) got past the mount: the stack came up, the edge container
reached `healthy`, and the console gate died 8s later with curl exit 7 — a
connection refused to http://127.0.0.1:8090. The image job was further along but
showing the same face of it (empty curl bodies reaching a json decoder).

compose publishes the edge's port on the host. The job that curls it is a
container with its own network namespace, so 127.0.0.1:<published port> is not the
same place. The fix is the address the job's own default route names — the host's
address on that network — and compose publishes on 0.0.0.0, so the published port
is listening there. The step prints it into the log so the next run says which
address it asked.

Cross-reference for the platform, not invented here: ~/work/tskr documents the
same asymmetry from the other side in docker/test/workspace-mount.sh — the job
workspace is a named volume at /workspace/<owner>/<repo> that the host daemon
cannot see, `docker build` survives it because the context streams from the
client, and only `-v` is resolved daemon-side. tskr's answer is to run its gates
in sibling containers; openwaf's gates are shell + curl + node, so the smaller
answer is the volume for the file mount (previous commit) and the host address
for the port.
2026-10-05 21:18:58 +02:00
Pavlo Ratushnyi b402ec4cc9 the CI stack mounts its nginx config through a volume, because the daemon cannot see the job's workspace
ci / lint the workflow and the shell (push) Successful in 9s
ci / the operator page in a real browser (push) Failing after 53s
ci / build, test, smoke (push) Successful in 1m33s
ci / build the image and smoke it (push) Failing after 13m18s
Run 2346 named the cause, and it was not Docker and not the stack:

  error mounting "/workspace/para/openwaf/deploy/upstream.conf" to rootfs at
  "/etc/nginx/conf.d/default.conf": not a directory: Are you trying to mount a
  directory onto a file (or vice-versa)?

The job's workspace lives inside the runner's job container; the docker daemon is
the host's, reached through /var/run/docker.sock. A relative bind mount written in
docker-compose.yml is resolved by the daemon on the host, where that path does not
exist, so Docker turns it into a directory and the mount dies. deploy/upstream.conf
is tracked (b6126c2) — this was never a checkout problem.

docker-compose.ci.yml is the overlay: the upstream service gets its config from a
named volume at /etc/nginx/conf.d, filled by a step that pipes the tracked file
into the volume. `!override` replaces the base volumes list, otherwise the broken
mount would still sit next to the working one. Compose reads the overlay through
COMPOSE_FILE, which only the workflow sets — a laptop and the README demo keep the
plain file mount, and the gate scripts stay the scripts an operator runs.

Verified before pushing, on this tree: `docker compose config` shows the upstream
volumes as the named volume at /etc/nginx/conf.d with the bind mount gone; the
fill step writes 1209 bytes, exactly deploy/upstream.conf; scripts/compose-smoke.sh
under COMPOSE_FILE=docker-compose.yml:docker-compose.ci.yml reports 348 passed /
0 failed, including the 502-upstream scenes that need that config to be read.
2026-10-05 21:11:33 +02:00
Pavlo Ratushnyi 1ada35486f a stack that will not come up now says what compose said, and the runner gets buildx
ci / lint the workflow and the shell (push) Successful in 14s
ci / build the image and smoke it (push) Failing after 24s
ci / the operator page in a real browser (push) Failing after 1m0s
ci / build, test, smoke (push) Successful in 1m58s
Run 2344 on 4e303cd: lint green (the two SC2086 findings are gone), source green,
image and console still red — both at `- starting the stack / compose up failed`.
In the image job the docker install worked and `docker build` produced
openwaf:ci 258MB, so the CLI cause is closed; what fails now is compose, and the
gate threw compose's own output away at the one moment that decides whether the
rest of the run means anything. Both gates now write it to a temp log and print
it on failure.

The stack itself is not the suspect: scripts/compose-smoke.sh on this tree, on a
daemon of its own (COMPOSE_PROJECT_NAME=openwaflocal, EDGE_PORT=18085), reports
348 passed / 0 failed — including the shipped-image preview scenes. So the
remaining difference is the runner's client side, and `docker compose up --build`
reaches the daemon through buildx, which the install step did not put in. Added,
with `docker buildx version` printed next to `docker compose version` so the next
log names all three versions that actually ran.

shellcheck 0.11.0 clean over scripts/*.sh.
2026-10-05 20:57:35 +02:00
Pavlo Ratushnyi 4e303cd0ad the two docker jobs install the CLI the runner image never shipped
ci / build the image and smoke it (push) Failing after 57s
ci / lint the workflow and the shell (push) Successful in 12s
ci / build, test, smoke (push) Successful in 2m39s
ci / the operator page in a real browser (push) Failing after 1m38s
First real run of this workflow: Gitea Actions run 2316 on 6f92d37. Three jobs
red, each with a cause that names itself in the log:

  lint    — shellcheck 0.11.0: 2x SC2086 in scripts/smoke.sh (835, 837)
  image   — ./scripts/ci-gates.sh:44: docker: command not found (exit 127)
  console — - starting the stack / compose up failed (exit 7)
  source  — success, 1m53s

The runner's job image ships no docker CLI while /var/run/docker.sock is mounted
from the host, so the image and console jobs now install docker-ce-cli and
docker-compose-plugin themselves and then fail loudly, at that step, if the
socket is not there — an infrastructure answer should read as infrastructure
rather than as a broken product three steps later. Same install the
neemle-landing pipeline on this instance already uses.

The two SC2086 findings are the string-concatenation trick inside a single-quoted
python -c: '$EDGE_PORT' expands unquoted. Now '"$EDGE_PORT"', which is what
shellcheck proposed and what the scene was already meaning.

Gate evidence on this tree: shellcheck 0.11.0 (the pinned version, same command
as the gate: shellcheck -s bash scripts/*.sh) clean; scripts/smoke.sh 256 passed
/ 0 failed on EDGE_PORT=18411. build and unit were green at ddddfc8 and nothing
here touches C# — integration was not re-run locally, its two host-specific
races are OPEN-47 and OPEN-76.

The header comments that said this file had never executed on a runner are now
wrong and say what happened instead.
2026-10-05 20:46:22 +02:00
Pavlo Ratushnyi bd1b8a4e86 185 compose assertions now, and the numbers describe the tree that has them
The gate grew by 20 assertions across two commits (19 for the country rule on
the image, 1 for the ban pillar's wait budget) and the file still said 165 in
six places, including the line that names the script's own size. Same failure
as the last two sweeps: the numbers drift away from the tree that runs them.

Swept to dc88f36, each stage re-run on this head rather than quoted from the
previous one:
  host   unit 132/132, integration 173/173, smoke 28/0, image 261 MB,
         compose 185/0, console 70/0                       (/tmp/c25_host_all.log,
                                                            /tmp/c25_host_console.log)
  linux  source gates PASS, compose 185/0, console 70/0,
         enforcement lag 20 ms, 0 containers left behind    (/tmp/c25_rehearsal.log)
  act    5 jobs succeeded, 0 failed - lint, source, image
         (261 MB, compose 185/0), console (70, 685,222-byte zip), freshness
                                                            (/tmp/c25_act.log)

The assertion history gained its two links: 165 before the image refused a
country code that is not a code, 184 before the ban scene stopped reading the
pillar at one instant.

Two paragraphs say which layer proves what, because that is the question this
cycle kept asking:
 - the country rule was proven in-process while the shipped image carried four
   country assertions, all about a rule already written correctly. Both halves
   of the teeth were measured on the image: length-only validation answers
   179/6, moving the DELETE route answers 179/6, against 5 and 2 in-process.
 - OPEN-42's read side is closed (the scene polls the pillar, prints the
   trajectory, and asserts its own wait budget; breaking it answers 178/7 with
   that assertion first). The ticket stays open for the product half: the
   pillar is only updated on the request path, so a quiet edge reports a stale
   failure count for as long as it stays quiet.
2026-10-03 01:38:03 +02:00
Pavlo Ratushnyi 75ee8221de 165 compose assertions now, and the numbers describe the tree that has them
Every gate was re-run on this tree and the README and the ci.yml header were
rewritten from what those runs printed, not from the last time someone wrote a
number down: host all (unit 132/132, integration 173/173, smoke 28/0, image
261 MB, compose 165/0), host console (70/0), Linux rehearsal (source PASS,
compose 165/0 with 44 ms enforcement lag, console 70/0), and act (5 jobs
succeeded, 0 failed, console-evidence.zip 685,878 bytes).

Two numbers were stale in ways a reader could not see. The console paragraph
said the gate "asserts 58 things" while the gate itself printed 70; and the
paging paragraph described behaviour that had only recently become an
image-level measurement, so it now says which layer proves it and how the
scene proves it.

The failures found on the way are written down rather than dropped. Two act
runs failed before the green one: lint refused three SC2086 findings that a
local `shellcheck -S warning` had passed over — the workflow pins 0.11.0 with
no severity filter and no local gate runs lint at all, filed as OPEN-44 — and
in the run after the fix, image died on a TLS timeout to auth.docker.io while
console read an empty observation listing in a run where the same table had
shown 11 rows a minute earlier, filed as OPEN-43. A host console run at the
previous commit answered 68/2 for the same reason OPEN-41 already describes,
and one compose run read banWriteFailures as 0 while the same scene's log and
readyz said otherwise, filed as OPEN-42.
2026-10-02 23:04:24 +02:00
Pavlo Ratushnyi bb9ac0d927 132 compose assertions now, and the numbers describe the tree that has them
Re-measured at 9383362 rather than carried forward from 5c44b7c:

  host ci-gates.sh all      unit 132/132, integration 173/173, smoke 28/0,
                            image 261 MB, compose 132/0
  host console              70 ok, 0 failed
  Linux rehearsal           source PASS, compose 132/0 at 15 ms,
                            console PASS 70/0 on the second run
  act                       5 jobs succeeded, 0 failed; compose smoke 132/0;
                            console 70; console-evidence.zip 682,072 bytes

The Linux console stage failed once at this head — the markup-path row was not in
the observation table when the driver looked, and the driver looks once. That is
filed as OPEN-41 with both logs named; the stage was re-run and passed, and the
pass is quoted together with the failure, not instead of it.
2026-10-02 20:59:48 +02:00
Pavlo Ratushnyi 7faf37a246 70 console assertions now, and each number says where it was measured
Re-measured at 5c44b7c rather than carried forward from d871d57:

  host ci-gates.sh all      unit 132/132, integration 173/173, smoke 28/0,
                            image 261 MB, compose 113/0
  host console              70 ok, 0 failed
  Linux rehearsal (all)     source PASS, compose 113/0 at 18 ms, console 70/0
  act                       5 jobs succeeded, 0 failed; console 70;
                            console-evidence.zip 692,364 bytes

The console count moved 69 -> 70 by one check: the driver now fails when the
markup seed never reached it instead of stepping around four assertions and
printing "all assertions passed".

The flake sentence is attributed to the commit it happened at, not to whichever
head this file happens to describe: it was one Linux run at d871d57, and the
three Linux compose runs since — including this one — were 113/0.
2026-10-02 19:50:48 +02:00
Pavlo Ratushnyi 5add3be06b 113 compose assertions now, and the measured numbers describe the tree that has them
Every gate was re-run at d871d57 rather than carried forward from 24e329d: the
host gives unit 132/132, integration 173/173, smoke 28/0, image 261 MB, compose
113/0 and console 69/0; the Linux rehearsal gives the same source counts, compose
113/0 and console 69/0; the local Actions runner gives 5 jobs succeeded, 0 failed
with compose smoke 113/0 and a 691,696-byte console artifact.

One Linux run of this same head answered 112 passed, 1 failed: the geo-restore
assertion got 000. The run after it was 113/0. That is recorded here instead of
quietly re-run until green, because the gate prints 000 for a stalled request, an
exited container and every other curl error as the same three characters, so a
reader cannot tell which of the three happened. Filed as OPEN-39.
2026-10-02 19:06:16 +02:00
Pavlo Ratushnyi e5f4ff041d 107 compose assertions now, and the rehearsal numbers describe the tree that has them 2026-10-02 18:09:49 +02:00
Pavlo Ratushnyi fe9b09f683 The numbers follow the tree: 173 integration tests, 100 compose assertions, 69 console assertions, and a contract line for the streak-map filter 2026-10-02 17:07:24 +02:00
openwaf-agent bce6657150 The unit count moved because a criterion gained a test, and the numbers follow the tree
cfe47d1 added DurabilityHealthTests (4), so unit is 132/132 wherever the
README and ci.yml said 128/128, and the rehearsal/act sentences name the
commit they were measured at. Re-measured at cfe47d1 rather than carried
forward:

  host      ci-gates all: unit 132/132, integration 170/170, smoke 28/0,
            image 261 MB, compose 94/0, exit 0; console 58/0
  linux     rehearsal all: source PASS (132/132, 170/170, 28/28), compose
            PASS 94/0 with enforcement lag 12 ms, console PASS
  act       5 jobs succeeded, 0 failed; console-evidence.zip 547,433 bytes
2026-10-02 13:36:42 +02:00
openwaf-agent 5280e24a94 The rehearsal and act numbers describe the tree that carries the renamed tests
17b764e renamed two tests without touching an assertion, so the counts did
not move — but the README and ci.yml tie their Linux and act numbers to a
commit, and after a commit those sentences point one commit behind the
head. Re-measured rather than carried forward:

  host      ci-gates all: unit 128/128, integration 170/170, smoke 28/0,
            image 261 MB, compose 94/0, exit 0; console 58/0
  linux     rehearsal all: source PASS, compose PASS 94/0 (enforcement lag
            17 ms), console PASS
  act       5 jobs succeeded, 0 failed; console-evidence.zip 543,009 bytes
2026-10-02 13:03:57 +02:00
openwaf-agent 5430ed0b6f The README carries the write-side query contract, and the numbers describe that tree
The contract section said the unknown-parameter guard refuses on the list
endpoints. It now refuses on every endpoint under /admin-api, and the
interesting part is not the coverage: it is that the guard itself had the
bug. It assumed limit/offset were legal everywhere, so GET
/admin-api/countries?limit=2 was answered with the whole table by the
image that already carried the guard.

Numbers re-measured on ac672d9, not carried forward:
  host      unit 128/128, integration 170/170, smoke 28/0,
            compose 94/0, console 58/0, image 261 MB, 0 containers
  linux     source PASS (128/128, 170/170, 28/28), compose 94/0 with
            enforcement lag 11 ms, console 58/0
  act       5 jobs succeeded, 0 failed; console-evidence.zip 534,721 bytes
  compose assertion history: ... 81 before the retry loop, 86 before the
            write-endpoint guard, 94 now
2026-10-02 12:10:09 +02:00
Pavlo Ratushnyi b90b647474 The README carries the pending-ban contract, and the numbers describe that tree
Numbers re-measured at dcf8a73: macOS host unit 128/128, integration 141/141,
smoke 28/0, compose 86/0, console 58/0, image 261 MB, 0 containers left behind.
Linux rehearsal, all three stages in one run: PASS — source (128/128, 141/141,
28/0), compose 86/0 with enforcement lag 13 ms, console 58/0, 0 containers left
behind. act at dcf8a73: 5 jobs succeeded, 0 failed — source (128/128, 141/141,
28/0), image (261 MB, compose 86/0), console (58 assertions, 524,624-byte
screenshot artifact), lint, freshness.

Prose: the cost of "readiness returns on a write, not on a timer" when the only
thing that produces that write is the attacker coming back — the t+30/60/90/120
measurement, the retry loop, and the statement that the readiness gate was not
loosened to get this.
2026-10-02 11:39:31 +02:00
Pavlo Ratushnyi db146271c8 The README carries the query-surface contract, and the numbers describe that tree
Numbers re-measured at 336c2f7 rather than carried from the previous sweep:
macOS host unit 128/128, integration 138/138, smoke 28/0, compose 81/0, console
58/0, image 261 MB. Linux rehearsal source PASS (128/128, 138/138, 28/0),
compose 81/0 with enforcement lag 12 ms, console 58/0 with 0 containers left
behind. act at 336c2f7: 5 jobs succeeded, 0 failed — source (128/128, 138/138,
28/0), image (261 MB, compose 81/0), console (58 assertions, 498,801-byte
screenshot artifact), lint, freshness.

Prose: a paragraph on the query surface — a parameter the endpoint never
implemented used to be dropped without a trace, the answer kept its shape, and
the guard's first run broke three tests that were right to send ?token=.
2026-10-02 10:52:34 +02:00
Pavlo Ratushnyi 858fd0148c The README carries the ban-write contract, and the numbers describe that tree
Numbers re-measured at this head rather than carried forward from the commit
the last README sweep was written against:

macOS host — unit 128/128, integration 125/125, smoke 28 passed / 0 failed,
compose 74 passed / 0 failed, console 58 assertions / 0 failed, image 261 MB.
Linux rehearsal — compose 74 passed / 0 failed (enforcement lag 14 ms), console
58 assertions / 0 failed, 0 containers left behind. act (nektos/act 0.2.89,
catthehacker/ubuntu:act-latest) — 5 jobs succeeded, 0 failed: lint, source
(128/128, 125/125, 28/0), image (261 MB, compose 74/0), console (58 assertions,
480,636-byte screenshot artifact), freshness.

Prose changes, not just digits:

- The compose write scene no longer asserts `/readyz` 503 for a reporting-path
  failure, and the README said it did. The sentence is rewritten to the boundary
  that is actually asserted now, with the measurement that moved it: one lost
  alert held `/readyz` at 503 for 120 s of idle time over a healthy write path,
  because an alert pillar writes only when an alert is raised.
- Both broken-pillar scenes are now eleven assertions, not ten: each proves the
  sources it claims were seen are really in the live streak map, so the scene
  cannot pass by counting one docker bridge address three times.
- The honest log line is described as polled and counted (3 lines), because the
  grep run immediately after the burst answers 0 and the same grep two seconds
  later answers 3.
- The compose history line now says where 74 came from: 63 before the ban-write
  scene, 72 before the scenes were made non-vacuous.
2026-10-02 10:11:50 +02:00
Pavlo Ratushnyi 68bec5b6be The README carries the write-health contract, and the numbers describe the tree that has it
Re-measured at 7b57c56, every stage on its own: macOS host unit 128/128,
integration 122/122, smoke 28/0, compose 63/0, console 57/0, image 261 MB;
Linux rehearsal source (Ubuntu 24.04.5, SDK 10.0.401) 128/128 + 122/122 + 28/0,
compose 63/0 with a 12 ms enforcement lag, console 57/0 leaving 0 containers;
act 5 jobs succeeded, 0 failed, console-evidence.zip 452,153 bytes.
shellcheck 0.11.0 clean over scripts/*.sh.
2026-10-02 08:49:05 +02:00
Pavlo Ratushnyi 058e68be7e The README carries the pillar-health contract, and the numbers describe the tree that has it
Re-measured at 7e081da, every stage on its own: macOS host unit 128/128,
integration 117/117, smoke 25/0, compose 53/0, console 53/0, image 261 MB;
Linux rehearsal source (Ubuntu 24.04.5, SDK 10.0.401) 128/128 + 117/117 + 25/0,
compose 53/0 with a 12 ms enforcement lag, console 53/0; act 5 jobs succeeded, 0
failed, console-evidence.zip 429,592 bytes. shellcheck 0.11.0 clean over
scripts/*.sh.
2026-10-02 07:46:16 +02:00
Pavlo Ratushnyi ea68b550e2 Two CI jobs sharing one compose project: one job's teardown was the other's connection refused
The full local runner pass (act 0.2.89, catthehacker/ubuntu:act-latest) on this
tree went 4 jobs succeeded, 1 failed: the console job died 33 s in, at the
seeding curl of scripts/console-smoke.sh, with curl exit 7 — nothing listening on
127.0.0.1:8080 any more.

Not a product failure and not flakiness. The image job and the console job each
run `docker compose up -d` and each tear the stack down on exit, and both take the
project name from the repository directory and the host port from a literal 8080
in docker-compose.yml. On any machine where two jobs share one docker daemon — a
self-hosted runner, or act — they are the same stack, so the image job's
`compose down` removes the containers the console job is seeding into. Run alone,
the same console job passes (act -j console: 1 job succeeded, 53 assertions). On
GitHub's hosted runners each job gets its own machine, which is exactly why this
has never been seen there and why "the workflow has never run on GitHub" is still
a gap this repository carries rather than a solved problem.

Fix: the published port is ${EDGE_PORT:-8080}, and each job names its own compose
project (openwafci-image on 8080, openwafci-console on 8090). Separate projects
means separate containers, separate volumes and separate ports, so neither job can
see the other's stack. scripts/ci-linux-rehearsal.sh passes COMPOSE_PROJECT_NAME
and EDGE_PORT through to the seeding container so an operator can isolate a
rehearsal the same way.

Measured after: the same full act pass is 5 jobs succeeded, 0 failed — lint,
source (128/128, 117/117, smoke 25/0), image (261 MB, compose smoke 53/0),
console (53 assertions / 0 failed, screenshot artifact), freshness. Locally:
compose gate 53/0 with the default project and port unchanged, and the console
gate 53/0 driven through the CI configuration (COMPOSE_PROJECT_NAME=openwafci-console,
EDGE_PORT=8090).
2026-10-02 07:21:13 +02:00
Pavlo Ratushnyi 73872ceda1 The README carries the exemption contract, and the numbers describe the tree that has it
The Admin API section now says what GET /admin-api/allow answers — live by
default, live=false meaning "do not filter", limit 1..2000 and offset,
X-Total-Count and X-Truncated, and a live flag on each row computed from the same
AllowEntry.IsLive the engine applies — and records the measurement that made it
so: the entry written at 03:58:16 for one minute, the address through at 03:58:20
(502) and blocked again at 03:59:38 (301), the row still listed unmarked at
03:59:39 with /state still saying allowEntries:1, and 1,101 rows in 130,386 bytes
with every paging parameter ignored.

Numbers moved to the tree that has the fix (c97c7a1), host and Linux: unit
128/128, integration 113/113 (was 109), smoke 22/0 (was 19), compose 47/0 (was
43), console 50/0 (was 47), image 261 MB; Linux enforcement lag 11 ms. act 0.2.89
on catthehacker/ubuntu:act-latest at c97c7a1: 5 jobs succeeded, 0 failed, console
screenshot artifact 606,514 bytes. The workflow's own header comment carries the
same numbers, since it is the file a reader trusts when the README is one commit
ahead of the run it describes.
2026-10-02 06:24:51 +02:00
Pavlo Ratushnyi 72d37ad3f1 The Linux numbers describe the head tree again
The rehearsal had been quoted from 8fba844 while the tree had moved three fixes
past it. All three stages were re-run separately at fc90f50, in containers:
source gates in mcr.microsoft.com/dotnet/sdk:10.0 (Ubuntu 24.04.5, SDK 10.0.401
resolving the pinned global.json) - unit 128/128, integration 99/99, smoke
passed 19 failed 0, build 0 warnings 0 errors; compose gate in docker:cli
against the host daemon - 43 passed, 0 failed; console gate in
mcr.microsoft.com/playwright:v1.63.0-noble with chromium-1243 - 44 assertions, 0
failed. The same suite on the macOS host at fc90f50 gives the same counts.

The workflow was also executed by the local Actions-compatible runner at this
commit: nektos/act 0.2.89 on catthehacker/ubuntu:act-latest, 5 jobs succeeded, 0
failed (lint, source, image, console with the screenshot artifact, freshness).
That is still not a GitHub-hosted runner - the repository has no remote - and
the README says so in the same sentence.

The admin API section gains the country-rule paragraph: PUT
/admin-api/countries/{code} checked only the length, so "12" and "U." were
stored, listed to the operator as denied, and obeyed by nobody, with no DELETE
to undo them.

Shape block: 89 -> 99 integration tests, 39 -> 44 console assertions.

actionlint exit 0; shellcheck 0.11.0 exit 0; node --check ok.
2026-10-02 03:25:17 +02:00
Pavlo Ratushnyi 53947516b2 The README says which run it describes, and which commit that run was on
The listing-completeness fix (0e2aee6) is documented in the admin API section:
?limit= clamped instead of refusing (1000 rows of 1103 recorded sources with no
total and no flag; limit=0 and limit=-1 each returning one row), X-Total-Count
and X-Truncated now on /observations and /alerts as well as /blocks, an offset
that reaches the rest, and /streaks measuring truncation against standing
streaks instead of the size of the map.

The rehearsal paragraph is the part that was at risk of becoming a lie. The
Linux rehearsal has not been re-run past 8fba844 - the approval step for
scripts/ci-linux-rehearsal.sh failed three times this cycle and the run was not
attempted any other way - so the paragraph now says so in the open and names the
commit its numbers belong to. What was measured at 0e2aee6 is the same suite on
the macOS host: unit 128/128, integration 89/89, smoke passed 19 failed 0,
compose 43 passed 0 failed, console 42 assertions 0 failed, image 261 MB. The
same sentence was added to the header comment of .github/workflows/ci.yml, which
quoted 126/73/39 as if it described the current tree.

Shape block: 126 -> 128 unit tests, 73 -> 89 integration tests.

actionlint exit 0; shellcheck 0.11.0 exit 0.
2026-10-02 02:25:52 +02:00
Pavlo Ratushnyi e1f7456629 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.
2026-10-02 01:33:55 +02:00
Pavlo Ratushnyi 870db6b97e The numbers now describe a run of the tree that has the redirect guard
Rehearsal and the local Actions runner were both re-run at 00f6dd9:

  scripts/ci-linux-rehearsal.sh: exit 0 — unit 126/126, integration 62/62,
    smoke 19/19, compose 43/0, console 37/0
  act push: exit 0 — all five jobs succeeded (lint, source, image, console
    in ci.yml, plus freshness in geo-freshness.yml), source job unit 126/126 +
    integration 62/62 + smoke 19/19, image job compose 43/0, console 37/0
  actionlint exit 0; shellcheck 0.11.0 exit 0

So every place that quotes a number was moved: unit 105 -> 126, integration
55 -> 62, console 33 -> 37. The header of ci.yml also stops claiming four jobs
are five: ci.yml has four, geo-freshness.yml has the fifth, and the act run
reported all five. The console paragraph now names the escaping assertions and
what it costs to break them — esc() reduced to the identity function turns the
gate red with 6 failures and the page title into "XSS".
2026-10-02 00:44:24 +02:00
Pavlo Ratushnyi 5e16e7e28c The README numbers now describe a run of the tree that has the policy ranges
Rehearsal and the local Actions runner were both re-run at 52f4167, so the
numbers in the two places that quote them changed with them: unit 59/59 ->
105/105, integration 37/37 -> 55/55. Smoke 19/19, compose 43/0 and console
33/0 are unchanged.

  scripts/ci-linux-rehearsal.sh at 52f4167: exit 0 — unit 105/105,
    integration 55/55, smoke 19/19, compose 43/0, console 33/0
  act push at 52f4167: exit 0 — all five jobs succeeded (lint, source,
    image, console, freshness), source job unit 105/105 + integration 55/55 +
    smoke 19/19, image job compose smoke 43/0, console 33/0
  actionlint and shellcheck 0.11.0: exit 0

The configuration section now states the accepted range of every policy field,
because the endpoint now refuses anything outside it and an operator reading
this page should get the same answer the API gives.
2026-10-01 23:59:10 +02:00
Pavlo Ratushnyi 0a6520eeba Every number that describes a run now describes a run of this tree
The retention tests changed the integration count from 34 to 37, and three
places quoted the old count as if it were current:

- README, Linux rehearsal paragraph: re-ran the whole rehearsal at c7dae28 —
  unit 59/59, integration 37/37, smoke 19/19, compose 43 passed / 0 failed,
  console 33 assertions / 0 failed, build 0 warnings, exit 0.
- README, act paragraph: re-ran all five jobs at c7dae28 — lint, source, image,
  console, freshness all Job succeeded (unit 59/59, integration 37/37, smoke
  19/19, compose 43/0, console 33/0, openwaf:ci 261 MB, geo pin current).
- ci.yml header: the same rehearsal line.

actionlint exits 0 over both workflow files after the edit.
2026-10-01 22:47:30 +02:00
Pavlo Ratushnyi a9c49236b7 Two pushes in a row no longer queue two full gate runs
The workflow triggers on every push with no concurrency group, so pushing twice
in a minute runs the whole gate set twice, in series, and the second run's
numbers are the ones a reviewer reads while the first is still scrolling.

concurrency is now set per workflow+ref with cancel-in-progress: false. The
false is the considered half: a finished run is the evidence a merge decision
gets read later, so cancelling the run that is already executing throws away
proof to save nothing. GitHub still drops the runs that were only queued.

Verified by executing the file again rather than trusting the schema: actionlint
1.7.12 exits 0, and act (0.2.89, catthehacker/ubuntu:act-latest) plays all five
jobs green on this commit - lint (shellcheck 0.11.0, pinned), source (unit
59/59, integration 34/34, smoke 19/19), image (openwaf:ci 261 MB, compose smoke
43 passed / 0 failed), console (33 assertions, 0 failed), freshness (pin
2026-10 current). 95 assertion lines across the three live gates, same as before
the change.
2026-10-01 22:27:25 +02:00
Pavlo Ratushnyi bef197ec83 The honest-status comments now say what actually ran, and at what level
Three files said "this has never run". After executing the workflows with
nektos/act 0.2.89 on catthehacker/ubuntu:act-latest, that sentence was too
broad, and a status note that is too broad is the same mistake as one that is
too narrow. What is true, per file:

- ci.yml: all four jobs executed start to finish and reported success —
  lint (actionlint 1.7.12 and shellcheck 0.11.0 both download, verify their
  sha256 and find nothing), source (unit 59/59, integration 34/34, smoke 19/19),
  image (openwaf:ci 261 MB, compose smoke 43 passed / 0 failed), console (33
  assertions / 0 failed with playwright@1.63.0 and chromium-1243; the screenshot
  step published console-evidence.png 335998 B and console-evidence.phone.png
  264597 B).
- geo-freshness.yml: the job executed ("pin 2026-10 / newest 2026-10 / the pin
  is current", exit 0). The schedule has still never fired, and that is the part
  the file is for.
- README: the same numbers, plus the point the run bought — ubuntu-latest ships
  shellcheck 0.9.0-1, developers run 0.11.0, and the two disagree about one line
  of scripts/geo-db-bump.sh. Fixed in the previous commit.

The distinction each file keeps saying out loud: a local Actions-compatible
runner proves the YAML plays and the pinned tools resolve. It does not prove a
GitHub-hosted run is green, and the repository still has no remote.
2026-10-01 22:16:56 +02:00
Pavlo Ratushnyi a48ebd650d Running the workflow, not just linting it, turned the lint job red
The workflow file had never been executed anywhere. It was linted, and its
steps were run by hand through scripts/ci-gates.sh, but nothing had ever taken
the YAML and played it start to finish. nektos/act (0.2.89, sha256
48ae218af96725f7635a66de2b87e1e346893b02add0f16b92f560296b2151fc) does that in a
Docker container, so the file itself got executed.

It found a defect on the first run. The lint job called `shellcheck` expecting
the copy baked into ubuntu-latest - 0.9.0-1, per the runner image's own package
list. Local shellcheck is 0.11.0 and says nothing about
scripts/geo-db-bump.sh:42; 0.9.0 flags it (SC2015: `A && B || C` is not
if-then-else). So the gate's verdict depended on which tool version the image
happened to ship, and the first push to a real runner would have gone red on a
pattern that is legal, just ambiguous.

Two changes, both version-independent:
- geo-db-bump.sh: the guard is now an explicit `if [ -z "$newest" ] || [
  "$newest" = unknown ]`. Verified with the version that found it: shellcheck
  0.9.0 in a Linux container now exits 0 over scripts/*.sh, and 0.11.0 on the
  host exits 0. The script's behaviour is unchanged: DRY_RUN with a current pin
  exits 0 ("nothing to do"), and an edition the vendor does not serve exits 2
  ("REFUSED - the freshness check could not name a newer release").
- ci.yml: shellcheck is pinned to 0.11.0 with a checksum per architecture, the
  same way actionlint already is, and the step prints the version so the log
  says which version did the linting.

Executed end to end in act on catthehacker/ubuntu:act-latest, arm64:
  lint    - Job succeeded (checkout, actionlint 1.7.12 sha256 OK, shellcheck
            0.11.0 sha256 OK, 0 findings over scripts/*.sh)
  source  - Job succeeded (setup-dotnet, restore, build, unit, integration
            34/34, smoke 19/19)
  image   - Job succeeded (docker build -> openwaf:ci 261 MB, compose smoke
            43 passed / 0 failed)
This is not GitHub: it is a local Actions-compatible runner, so it proves the
file executes and the pinned tools resolve, not that a GitHub-hosted run is
green. The console job is the remaining one and is reported separately.
2026-10-01 22:13:46 +02:00
Pavlo Ratushnyi 5722d64529 The lint job linted one workflow file while the repo has two
actionlint in ci.yml was invoked on .github/workflows/ci.yml only, so
geo-freshness.yml — the scheduled geo gate — was linted by whoever happened to
run it locally, not by the pipeline. A workflow added later would have been
unlinted by default, which is how a gate quietly stops covering the thing it is
for.

Fixed by globbing the workflows directory, so the step covers whatever is there
instead of a list someone has to remember.

Verified on this commit: actionlint 1.7.12 -no-color .github/workflows/*.yml
exits 0 with no findings over both files (ci.yml, geo-freshness.yml).
2026-10-01 21:25:28 +02:00
Pavlo Ratushnyi 3f39029c22 The rehearsal numbers in the docs were one commit behind the tree
README quoted unit 58/58 and integration 32/32 for the Linux rehearsal, and
ci.yml's header quoted 32/32. Both were true when written; the tree has 59 unit
and 34 integration tests now, so the docs were quoting a run that no longer
matches the code they describe.

Re-ran every gate this head had not been run on, on 842b705:
  host:    smoke 19/19, image 261 MB, compose-smoke 43 passed / 0 failed
  Linux:   unit 59/59, integration 34/34, smoke 19/19, compose 43/43,
           console 33 assertions / 0 failed (sdk:10.0 = Ubuntu 24.04.5,
           SDK 10.0.401)
The 1:02.81 wall clock stays quoted as measured-once, because this rehearsal was
not timed either.
2026-10-01 20:39:15 +02:00
Pavlo Ratushnyi 842b70566f The query-string token is kept, but it no longer happens silently
?token= on the admin API is an affordance for an operator typing curl; the
console never uses it and none of the gates do (0 occurrences of token= in
scripts/). Refusing it is how an operator ends up switching auth off instead of
learning the header. What was wrong was the silence.

Measured on the shipped image before deciding: a container hit with
/admin-api/state?token=<secret> logged 0 lines containing the token at the
shipped level (Microsoft.AspNetCore: Warning), and 2 lines at
Microsoft.AspNetCore=Information, including the full URL. Raising that level is
the ordinary next move while debugging, so the leak is one environment variable
away, not a hypothetical.

Now a request authenticated by the query string logs a warning naming the path
and never the token. Two tests: the query form is served and named; the header
form produces no such warning and no token anywhere in the captured logs. Teeth:
delete the warning and exactly the query test fails (1 failed, 33 passed).

Also refreshed the ci.yml header, whose Linux numbers had gone stale (54/54 +
30/30 + 41/41 -> 59/59 + 32/32 + 43/43 + 33/33), and kept the wall clock quoted
as measured once rather than current.

Gates: build 0 warnings, unit 59/59, integration 34/34, actionlint 0 problems.
2026-10-01 20:27:06 +02:00
Pavlo Ratushnyi cbee0e4208 The geo endpoint gets asserted as an endpoint, not only as a pill
Last commit covered `/admin-api/geo` behaviourally: the page fetches it and the
summary pill fails if the value is missing. That is coverage of the page, not of
the contract { if a field were renamed, or `loaded` started answering for
something else, the pill could still render and the assertion would still be
satisfied by the shape it happens to look for.

Three direct assertions in `compose-smoke.sh`: the endpoint says a database is
loaded, names what it loaded (`DBIP-Country-Lite`), and reports an age in days as
a number. 38 → **41 assertions**.

The helper that reads scalar fields caught itself: `jval` printed Python's `True`
where the assertion expected JSON's `true`, so the first run failed on spelling
rather than on the product. It emits JSON spellings now.

Numbers: host **41 passed, 0 failed**; the same script in the Linux rehearsal
(`docker:cli`, host daemon) **41 passed, 0 failed**. actionlint 1.7.12 over both
workflow files: 0 problems; shellcheck and `bash -n` clean.
2026-10-01 17:06:34 +02:00
Pavlo Ratushnyi 208b04290b Two endpoints the console read and no gate had ever called
An audit of the admin surface by gate coverage turned up two endpoints with zero
appearances in any gate: `/admin-api/state` and `/admin-api/geo`. The first is
the one the console's entire summary line is built from — the page could have
been reporting a mode the edge is not in, or a ban count that is not the count,
and every assertion in every script would have stayed green.

`/admin-api/state` also lacked one field the summary needs. It reported the age
of the in-memory snapshot and not the TTL that age is measured against, so
"snapshot 0.4s" was half a number. On a single edge the TTL is invisible; behind
a load balancer it *is* the delay a ban has, which is the whole subject of the
multi-instance question. `/healthz` already reported it — the endpoint the page
actually reads did not.

The summary line now says, in one place an operator looks at:

    mode Enforce · snapshot 0.1s / ttl 30s · tracked 3 · engine bans 0
    operator blocks 0 · allow entries 0 · geo DBIP-Country-Lite · built 2026-10-01 · 0.6d

The geo pill is marked past 90 days, the same rule `/healthz` reports as
`geoStale`, and the assertion checks it is *not* marked while the database is
inside the alarm — an always-green warning is a warning nobody reads.

Gates: `compose-smoke.sh` asserts `/state` at the moment a ban exists, so the
numbers have known values rather than "some number" — mode `Enforce`, TTL `30`,
`engineBans` 1 — 35 → **38 assertions**. `console-check.cjs` asserts the TTL in
the summary, the geo database with its build date and age, and the marking: 30 →
**33** assertions. `SnapshotStalenessTests` got the
fast half for the new field.

That test caught the test, not the product: the first version read `/state` with
a bare client and got a 401, because the admin surface is token-gated while
`/healthz` deliberately is not. The endpoint was right and the test was wrong.

Numbers on this tree. Host: build 0 warnings, unit 54/54, integration **30/30**,
compose-smoke **38/38**. Linux rehearsal, one invocation, EXIT=0: source gates
54/54 + 30/30 + smoke 19/19, compose **38/38**, console **33/33** in a real
Chromium. actionlint 1.7.12 over both workflow files: 0 problems; shellcheck,
`bash -n`, `node --check` clean.

Still the same boundary as every other commit here: none of it has executed on a
runner, because the repository has no remote (OPEN-15).
2026-10-01 17:01:54 +02:00
Pavlo Ratushnyi 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.
2026-10-01 16:40:37 +02:00
Pavlo Ratushnyi 7afa7541a2 The geo pin has a shelf life now, and a gate that checks it
The Dockerfile pins `ARG DBIP_VERSION=YYYY-MM`, and moving that pin was a habit
someone kept by hand: 2026-10 on 2026-10-01, 2026-09 the month before that. The
runtime answer was not better. `/healthz`'s `geoStale` is a 90-day alarm, and a
month behind is not 90 days. Measured on this tree: a container whose named
volume held `dbip-country-lite-2026-09` while the Dockerfile asked for `2026-10`
reported `geoBuiltAt: 2026-09-01T01:32:45+00:00` and `geoStale: false` — and
every geo assertion in `compose-smoke.sh` stayed green, the country deny list
still refusing 8.8.8.8 with 451. The policy was being enforced on a database
nobody chose, reported as healthy.

Three pieces:

- `scripts/geo-db-freshness.sh` compares the pin with the newest release the
  vendor actually serves (14 HEAD probes, newest first). Three exit codes, not
  two: 0 current, 1 the vendor has something newer, 2 could not tell — no
  network, or a pin the vendor has never served, which would make the image
  build fail on a 404. `MACHINE=1` prints one line for the bump script.
- `scripts/geo-db-bump.sh` rewrites the ARG and prints the two commands that
  make the new database actually land. It refuses to write anything when the
  check could not run: a pin moved on the strength of a check that did not run
  is worse than a pin left alone.
- `.github/workflows/geo-freshness.yml` runs the check on the 1st and the 8th
  (dbip publishes on the 1st; the second date catches a late publish or one
  failed run). It deliberately does not open a PR — a bot that cannot run the
  geo assertions bumping a data dependency is a worse default than a red job.

`scripts/compose-smoke.sh` grew the assertion that ties the pin to the running
container: `the loaded geo database is the pinned one`. Its teeth were checked,
not assumed — the stale volume above produced exactly one failure:

    FAIL the loaded geo database is the pinned one   Dockerfile pins 2026-10, the container loaded 2026-09
         a named volume is seeded once: docker volume rm openwaf_openwaf-geoip
    compose smoke: 27 passed, 1 failed

and after `docker volume rm`, **28 passed, 0 failed**.

Numbers on this tree. Host, `scripts/ci-gates.sh all`, EXIT=0: build 0 warnings,
unit 54/54, integration 28/28, smoke 19/19, image 261 MB, compose-smoke 28/28.
Linux rehearsal (third run today), EXIT=0: source PASS (54/54, 28/28, 19/19),
compose 28/28 with enforcement lag 36 ms, console 26/26. The freshness script
itself in `mcr.microsoft.com/dotnet/sdk:10.0`: current pin exits 0, a forced
`PIN=2026-05` exits 1 with the bump command. actionlint 1.7.12 over both
workflow files: 0 problems; shellcheck and `bash -n` clean.

Honest edges. The scheduled job has never run, because the repository has no
remote; and GitHub disables schedules on a repository with no push for 60 days,
so a cron is a nudge with a failure mode. A red freshness job can mean "no
network" rather than "stale" — the message names which, and exit 2 is not exit 0.
2026-10-01 16:09:11 +02:00
Pavlo Ratushnyi e02e442ae2 The console gate has a Linux number now, in a real Chromium
The rehearsal covered the dotnet suites, smoke.sh and compose-smoke.sh, and
then printed "console gate: not covered here (needs a real Chromium)". That was
the one honest line in the summary, and it was also the last hole: the console
job in `.github/workflows/ci.yml` runs on ubuntu-latest, so its gate was
verified only on darwin.

`scripts/ci-linux-rehearsal.sh console` closes it. `scripts/console-smoke.sh`
grew `SEED_ONLY=1` (start the stack, seed the streaks/bans/allow entries the
page must show, then stop before driving the page) and an `EDGE` override, so
the seeding half runs in `docker:cli` against the host daemon and the browser
half runs in `mcr.microsoft.com/playwright:v1.63.0-noble` — the Playwright
version pinned there is the version the CI console job pins, or the rehearsal
is rehearsing something else. The stack is torn down either way.

Two facts about that image, both now comments in the script:

- It ships the browsers (`/ms-playwright`: chromium-1243) but **not** the npm
  package — there is no playwright-core anywhere in it. So the stage installs
  `playwright@1.63.0` into `/tmp` and points `PLAYWRIGHT_CORE` at
  `/tmp/node_modules/playwright-core`.
- The repo is mounted read-only for this stage. Writable, the install would
  have dropped `node_modules` into the working tree of the checkout.

The summary line also stopped lying by accident: `verdict()` now separates a
stage the caller never asked for ("not run") from a stage that could not run
("skipped (no docker socket)"), and the exit code includes the console stage.

Two full rehearsals on this tree, one invocation each, both EXIT=0:

    source gates (restore/build/unit/integration/smoke): PASS   54/54, 28/28, 19/19
    compose gate: PASS                                          27 passed, 0 failed
    console gate: PASS                                          26 assertions, 0 failed
    wall: 2:14.33 (cold containers, cold NuGet cache)

72 assertions pass from inside Linux, and the console half includes the
round-trip a page cannot fake: a ban drawn on the page answers 301 on the next
request from that address, and the address passes again once the row is
deleted. actionlint 1.7.12 (same pinned checksum as CI): 0 problems. shellcheck
and `bash -n` clean.

Still true: none of this has executed on a runner, because the repository has
no remote. The Linux numbers narrow what a first run can discover; they do not
replace one.
2026-10-01 15:50:51 +02:00
Pavlo Ratushnyi c290aa06f6 Every gate this workflow runs now has a Linux number except one
`scripts/ci-linux-rehearsal.sh` (added in `42d4af9`) covered the dotnet suites
and `smoke.sh`. The third thing the objective asks CI to run — `scripts/
compose-smoke.sh` — did not have a Linux number, and "we run it on macOS against
a Linux image" is only half a proof: the script itself is the part that could be
a darwin habit.

It now runs in `docker:cli` against the host daemon, so the image build, the
stack and the asserting shell are all Linux. Full rehearsal, one invocation:

    source gates (restore/build/unit/integration/smoke): PASS   54/54, 28/28, 19/19
    compose gate: PASS                                          27 passed, 0 failed
    console gate: not covered here (needs a real Chromium)
    wall: 47.61 s

Getting it green surfaced two facts about the harness, not the product, and both
are now comments in the script where the next person will hit them:

- `compose-smoke.sh` asserts over JSON with **python3** (`jcount`/`jget`) and
  reads the clock with it. A bare container failed **23 of 27** assertions for
  nothing else. The runner image has python3; `docker:cli` does not, so the
  stage installs bash, curl and python3 itself.
- The stack is created by the host daemon, so its published port lives in the
  host's network namespace. Without `EDGE=http://host.docker.internal:8080`,
  every HTTP assertion returns curl code `000` **while the image's own
  HEALTHCHECK reports healthy** — a green stack with red assertions, the most
  confusing failure this gate can produce. The gate already had an `EDGE`
  override; this is what it is for.

The compose stage also printed its own instrumentation again: enforcement lag
**12 ms** between writing a ban and the edge refusing the source — the snapshot
invalidation path, measured on Linux this time.

Still true and still said plainly: none of these jobs has executed on a runner,
because the repository has no remote. The Linux numbers narrow what a first run
could still discover; they do not replace one.
2026-10-01 15:31:16 +02:00
Pavlo Ratushnyi bf1129a8d8 The failure mode on a write form is the one nobody demos
The console now writes, so the question stopped being "does the table show the
ban" and became "what happens when the operator types the wrong thing". A form
that accepts `not-an-ip`, says nothing, and adds no row leaves an operator
believing an address is blocked when it is not — which is worse than giving them
no console at all.

Two assertions added to the browser gate. The API already rejected the value
(`BlockStore.AddOperatorAsync` returns `not an IP address: not-an-ip`, the
endpoint answers 400, the page already surfaces `body.error` in its status line);
what is new is that a gate now proves that chain instead of assuming it. The run
prints the actual string: `not an IP address: not-an-ip`, and no phantom row in
the bans table. Console gate: **26/26**.

Also measured, because a timeout written at a desk is a guess: the Linux
rehearsal (`scripts/ci-linux-rehearsal.sh`, added in `42d4af9`) was re-run with
`time`. Cold container, cold NuGet cache, Ubuntu 24.04.5, SDK 10.0.401:
**1:02.81** wall for restore + build + unit + integration + smoke. The source
job's `timeout-minutes: 25` is not close, even allowing for a runner's slower
CPU. Before this, the number in the workflow was folklore from a build that once
stalled ~12 minutes on a single apt-get step.

No source-tree change in this commit: gate assertions and the numbers written
down where the next reader will look for them. Unchanged and still said plainly:
no job of this workflow has executed on a runner — the repository has no remote.
2026-10-01 15:16:19 +02:00