fix(767): gate the release path on the delimiter ban with a prerequisite job #770

Merged
timothy merged 1 commits from fix/767-delimiter-ban-fail-closed into main 2026-08-13 20:04:53 +02:00
1 Commits
Author SHA1 Message Date
timothyandClaude Opus 5 f420c668e6 fix(767): gate the release path on the delimiter ban with a prerequisite job
review-verdict/h10 Review-verdict: MERGEABLE @ f420c66 (base: main)
Build ErsatzTV Image / Delimiter ban (release path) (pull_request) Successful in 19s
PR Gates / Docs update reminder (pull_request) Successful in 17s
PR Gates / CI image pin matches docker/ci (pull_request) Successful in 18s
PR Gates / decisions lifecycle (pull_request) Successful in 26s
Review verdict / Set review-verdict status (pull_request_target) Successful in 10s
PR Gates / Script tests (pytest) (pull_request) Successful in 2m6s
Build ErsatzTV Image / Build & test (.NET) (pull_request) Successful in 9m25s
Build ErsatzTV Image / EF migration integrity (SQLite + MySql) (pull_request) Successful in 7m2s
Build ErsatzTV Image / Build & push image (amd64) (pull_request) Skipped
Build ErsatzTV Image / Functional E2E (curl + UI contracts) (pull_request) Successful in 6m30s
Build ErsatzTV Image / API docs in sync (OpenAPI + endpoint index) (pull_request) Successful in 9s
Build ErsatzTV Image / Formatting (changed .cs conform to .editorconfig) (pull_request) Successful in 5s
The ban that keeps `build`'s `Smoke + IPTV E2E` from being silently dropped was enforced
only by a pytest in `script-tests` — `on: pull_request`, and not a required context. Nothing
re-checked it on a `v*` tag push, which is exactly when the candidate image is published and
`DeployStack jazz-media` promotes it. A delimiter that reached `main` would drop `Smoke` on
the tag build, publish an unsmoked candidate, and report green.

A `scan` job now runs the PyYAML-based ban test, and `build` lists it in `needs:`. A red
`scan` skips `build` outright, so the image is never built.

MEASURED, both directions, without cutting a release: two `workflow_dispatch` runs on scratch
branches. Poisoned `Smoke` (run 1928) -> `scan` FAILED on the ban test, naming the payload,
and `Build & push` was SKIPPED. Clean control (run 1929) -> `scan` green (`65 passed`, guard
reported `All 2 expected step(s) executed`) and `build` RAN to success. "No image was
published" is deliberately NOT cited as evidence: on a scratch ref `push:` is false anyway,
so that conjunct could not have come out the other way.

SEVEN REVIEW ROUNDS, each finding a real defect in the one before. They rhyme, and that is the
reusable part: every fix was right about its instance and wrong about its class.

  * A bespoke stdlib scanner as a step inside `build`. A guard STEP cannot protect the job it
    lives in, and "my body has no opener so I cannot be dropped" is circular when only the
    PR-only test enforces that. Its hand parser also had ~10 false NEGATIVES. Deleted.
  * Shape assertions about the invocation — disarmed by `echo`ing the command, flags past a
    `\` continuation, `exit 0`, `if false; then .. fi`, `set +e`, `PYTEST_ADDOPTS` in the step
    `env:`, and mutations in the sibling module no shape check could reach.
  * Reconstructing only the STEP env tier; the same disarm one tier up still worked.
  * Trusting `needs:` as the gate — `always()` in `build`'s `if:` downgrades it to ordering.
  * `$GITHUB_ENV` writes inject into later steps at RUNTIME, invisible to static checks.
  * A repo-root `pytest.ini`/`conftest.py` deselects the ban test AND every test guarding it.

So the gate rests on three different KINDS of check, so that no single channel takes all three
down: the ban test; an execution probe running that command against a poisoned COPY with the
workflow/job/step `env:` tiers layered; and `scripts/ci-prove-ban-detects.sh`, which is NOT a
test — it poisons the workflow in the REAL checkout, re-runs the ban test, and vouches ONLY
for that test's `build` parametrisation failing. Any other outcome is a refusal, not a pass:
"non-zero means it noticed" reported OK on a collection error, and the deselection disarm this
exists to catch exits 5 rather than 1. Both weaker readings were live bugs here.

The two refusal branches a disarm actually lands on each have their own positive control,
because for a while the proof script was the one guard exercised only on the happy path — the
exact failure it argues about everything else. The third (pytest passing outright) has none:
neutering it is still fail-CLOSED, since the run then falls through to the exit-code branch and
refuses, so it only buys a better message. Recorded rather than claimed away — an earlier draft
of this very paragraph said all three were controlled, which was false.

Two disarms review reported are NOT real and are recorded as such: `--ignore=` and
`collect_ignore` do not suppress a file pytest is given explicitly. But refuting two variants
of a channel did not clear the channel; the working attacks through that same pytest-config
channel were simply never tried, which is what a later round found.

Also corrected: three stale citations of `build`'s `needs:` including one in a decision record;
a header claim that the docs-only path still builds an image (it does not); the `small` lane's
10g cap attributed to `build` alone where the record names two heavy jobs; a corroboration
from `script-tests` that cannot hold since it is `on: pull_request` and has never run on the
tag path; an "only job that installs from the network" claim ignoring `test`'s cache misses;
and "an interrupted run cannot leave a poisoned tree behind", which SIGKILL falsifies. The
marker-path rationale is carved out for `scan`, which has no `container:` and so keeps the
rerun residual the container jobs no longer have.

Refs: #767
Decisions-Edit: yes
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-13 19:18:49 +02:00