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.
This commit is contained in:
Pavlo Ratushnyi
2026-10-01 15:16:19 +02:00
parent 42d4af9a76
commit bf1129a8d8
3 changed files with 30 additions and 6 deletions
+4 -2
View File
@@ -17,7 +17,9 @@
# scripts/ci-linux-rehearsal.sh runs the source-tree gates (restore, build, unit,
# integration, smoke) inside mcr.microsoft.com/dotnet/sdk:10.0 — Ubuntu 24.04.5,
# SDK 10.0.401 resolving the pinned global.json, 54/54 + 28/28 + 19/19 on
# 2026-10-01, first try. The image and compose gates already run a Linux image;
# 2026-10-01, first try, 1:02.81 wall with a cold container and a cold NuGet
# cache — evidence that the 25-minute timeout below is not near. The image and compose
# gates already run a Linux image;
# the console gate needs a Chromium and stays macOS-verified until this file
# actually executes.
@@ -117,7 +119,7 @@ jobs:
#
# Honest status: this job has never run on a runner, like the rest of the
# file. What was verified is the gate it calls — scripts/ci-gates.sh console
# passed locally (24 assertions, playwright-core 1.61.1), and its negative
# passed locally (26 assertions, playwright-core 1.61.1), and its negative
# control (a wrong token) exits 1 rather than reporting success. The step
# calls the gate by name rather than retyping the script, so the CI definition
# and the operator command cannot drift.
+10 -4
View File
@@ -224,7 +224,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, drives `/admin` in a real Chromium, and
asserts 24 things. The read side: it authenticated, listed the streak as
asserts 26 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, kept the token out of the markup, and threw no javascript.
@@ -235,8 +235,12 @@ then refused (301 with the policy's redirect Location — the probe uses
comes back 200, which is how this assertion first read as a failure while the
edge was refusing the client the whole time), the per-row delete removes that one
ban and the address reaches the upstream again, an allow entry appears with an
expiry and can be removed, and a country rule can be set and put back. Then the
pass repeats at 375 px in dark mode, where the document must not scroll sideways
expiry and can be removed, and a country rule can be set and put back. The quiet
failure mode is asserted too: typing `not-an-ip` into the block form has to come
back as the API's own error (`not an IP address: not-an-ip`) with no new row,
because an operator who believes they blocked an address and did not is worse
than an operator with no console at all. Then the pass repeats at 375 px in dark
mode, where the document must not scroll sideways
and the status line must clear WCAG AA (measured 11.85:1). It needs `playwright-core`
(`PLAYWRIGHT_CORE=/path/to/it`) and exits 2 when that is missing — a gate that
reports success having asserted nothing is worse than no gate. Its negative
@@ -253,7 +257,9 @@ and smoke inside `mcr.microsoft.com/dotnet/sdk:10.0`. Rehearsed 2026-10-01:
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 **54/54**, integration
**28/28**, smoke **19/19**, first try, nothing to fix.
**28/28**, smoke **19/19**, first try, nothing to fix. Wall clock for the whole
rehearsal with a cold container and a cold NuGet cache: **1:02.81** — the source
job's 25-minute timeout is not close, even allowing for a runner's slower CPU.
It does not cover `compose-smoke` (needs a docker daemon inside the container) or
the console gate (needs a real Chromium). Both of those already drive a Linux
+16
View File
@@ -174,6 +174,22 @@ const rgb = (s) => s.match(/\d+/g).slice(0, 3).map(Number);
(await page.$$eval('#allow tbody tr', (r) => r.map((tr) => tr.children[0].textContent))).indexOf(WRITE_CIDR) === -1,
JSON.stringify(await page.$$eval('#allow tbody tr', (r) => r.map((tr) => tr.children[0].textContent))));
// The failure mode worth asserting on a write form is the quiet one: the
// operator believes they blocked an address and did not. A typo in the field
// must come back as the API's own error, not as a status line that says
// nothing and a table that gains no row.
await page.fill('#blockIp', 'not-an-ip');
await page.click('#addBlock');
await page.waitForFunction(
() => /not an IP address/.test(document.getElementById('status').textContent),
null, { timeout: 10000 }).catch(() => {});
const errStatus = (await page.textContent('#status')).replace(/\s+/g, ' ').trim();
const rowsAfterBad = await cells('#blocks tbody tr');
check('a bad address in the block form surfaces the API error instead of looking like success',
/not an IP address/.test(errStatus), errStatus);
check('and no phantom row appears for the address that was rejected',
!rowsAfterBad.some((r) => r[0] === 'not-an-ip'), JSON.stringify(rowsAfterBad.map((r) => r[0])));
// The country rule toggle is the one control here that changes policy for
// everyone, so the gate turns it and turns it back. There is no DELETE for a
// country rule — PUT allowed=true is as close to "back to how it was" as the