Skip to content

fix(ci): the S9 pin policy was enforced by nothing — give it a job - #467

Merged
athvin merged 1 commit into
mainfrom
bm/ci-revive-pin-gate
Nov 5, 2026
Merged

athvin merged 1 commit into
mainfrom
bm/ci-revive-pin-gate

Conversation

@athvin

@athvin athvin commented Nov 4, 2026

Copy link
Copy Markdown
Owner

The policy was enforced by nothing

The ci-and-supply-chain skill says every uses: is SHA-pinned with a # vTAG comment, and that this is "enforced, not just documented: scripts/ci/actionlint.sh". Neither half held.

That script shelled out to uv run python scripts/actionlint.py and imported er.versions for a pinned actionlint-py wheel. The Python/dbt removal took scripts/actionlint.py, the root pyproject.toml and uv.lock with it — so it could not run at all. And grep -rn actionlint .github/workflows finds only a prose comment in infra.yml, so no job ever invoked it. The breakage was invisible: a floating tag could have reached CI unnoticed at any point.

Found while adding merge-bus.yml (#448) and complying with a rule nothing was checking.

What changed

scripts/ci/actionlint.sh is pure bash now, for the precise reason above: a gate with no dependencies cannot be deleted by a dependency cleanup. actionlint doesn't implement S9 anyway — 1.7.7 exits 0 on actions/checkout@v4 — so the pin check was always the part no linter supplies.

Wired up as workflow pins (S9) in rust.yml, ungated like the skills job and for the same reason: detect exempts .claude/**, infra.yml, drift.yml and every *.lock.yml, so a gated pin check would skip on exactly the PRs most likely to introduce an unpinned action — a hand-edited infra.yml, or a regenerated gh-aw lock file whose pins come from a compiler nobody is watching.

Two findings

actionlint must not lint gh aw compile output. It reports 40+ findings across the five generated files and not one is a defect — runs-on: ubuntu-slim, concurrency.queue: max, job.check_run_id, job.workflow_ref, permissions.vulnerability-alerts are all real GitHub features newer than the linter's tables. Linting them would leave this gate permanently red, which teaches people to ignore it — the same defect as a gate that stays green when it matters. Generated-ness is read from each file's own header marker, not a filename pattern, so the next gh-aw workflow is excluded without anyone remembering. The S9 pin check deliberately still covers them: a compiler pinning for you is not the same as anyone checking.

Zero uses: matches is a failure, not a clean run. If the detection pattern ever stops matching, every workflow trivially passes and the policy lapses silently — which is the state this was found in. The script fails closed on that, and on "every file looks generated".

Mutation-tested

A gate nobody has watched fail is the thing being fixed here, so each guard was checked by breaking it:

mutation result
floating tag @v4 caught
SHA with no # vTAG comment caught
abbreviated SHA caught
detection pattern broken (no uses: anywhere) caught
empty workflow directory caught (exit 2)
every file looks generated caught
genuine actionlint error (runs-on: not-a-real-runner) caught
unmutated baseline passes

Worth noting: two mutants appeared to pass on the first attempt. Both of my mutations used BSD-sed syntax that silently didn't apply — a harness bug, not a gate blind spot. Re-run with a mutation that actually applied, both are caught. The lesson generalises: a mutation that changes nothing proves nothing.

Current tree: 420 uses: across 14 workflow files, all S9-pinned; 9 hand-written workflows actionlint-clean.

Not required yet

Per this repo's rule, a gate is trusted only after it has been observed failing — and that cannot be done while the account cannot allocate runners (every job on every branch is still failing with 0 steps executed). Promote workflow pins (S9) after it reports green on main and has been seen to go red, in that order, since a required context for a job not yet on main blocks every PR.

Stacked conceptually on #448 but independent — no shared files beyond the skill and the generated reference, which will need a trivial regen on whichever lands second.

🤖 Generated with Claude Code

The `ci-and-supply-chain` skill says every `uses:` is SHA-pinned with a
`# vTAG` comment and that this is "enforced, not just documented, by
scripts/ci/actionlint.sh". Neither half of that was true.

That script shelled out to `uv run python scripts/actionlint.py` and imported
`er.versions` for a pinned actionlint-py wheel. The Python/dbt removal took
`scripts/actionlint.py`, the root `pyproject.toml` and `uv.lock` with it, so the
script could not run at all — and `grep -rn actionlint .github/workflows` finds
only a prose comment, so no job ever invoked it. The breakage was therefore
invisible: a floating tag could have reached CI unnoticed at any point.

Rewritten in pure bash, for that exact reason: a gate with no dependencies
cannot be removed by a dependency cleanup. actionlint does not implement S9
anyway (1.7.7 exits 0 on `actions/checkout@v4`), so the pin check was always the
part no linter could supply.

Wired up as `workflow pins (S9)` in rust.yml, UNGATED like the `skills` job and
for the same reason: `detect` exempts `.claude/**`, `infra.yml`, `drift.yml` and
every `*.lock.yml`, so a gated pin check would skip on exactly the PRs most
likely to introduce an unpinned action — a hand-edited `infra.yml`, or a
regenerated gh-aw lock file whose pins come from a compiler nobody watches.

Two findings worth recording:

actionlint must NOT lint `gh aw compile` output. It reports 40+ findings across
the five generated files and not one is a defect — `runs-on: ubuntu-slim`,
`concurrency.queue: max`, `job.check_run_id`, `job.workflow_ref` and
`permissions.vulnerability-alerts` are real GitHub features newer than the
linter's tables. Linting them would leave the gate permanently red, which
teaches people to ignore it. Generated-ness comes from each file's own header
marker, not a filename pattern, so the next gh-aw workflow is excluded without
anyone remembering. The S9 pin check still covers them: a compiler pinning for
you is not the same as anyone checking.

Zero `uses:` matches across the tree is a FAILURE, not a clean run. If the
pattern stops matching, every workflow trivially passes and the policy lapses
silently — which is precisely the state this was found in.

Mutation-tested, since a gate nobody has watched fail is the thing being fixed
here. Caught: a floating `@v4`, a SHA with no `# vTAG`, an abbreviated SHA, a
broken detection pattern, an empty workflow directory, every-file-looks-
generated, and a genuine actionlint error. Current tree: 420 `uses:` across 14
workflow files, all pinned; 9 hand-written workflows actionlint-clean.

Not a required check yet — the repo's rule is that a gate is trusted only after
it has been observed failing, and that cannot be done while the account cannot
allocate runners. Promote after it reports green on `main`.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin force-pushed the bm/ci-revive-pin-gate branch from a253a53 to f149724 Compare November 5, 2026 00:09
@athvin athvin added the merge-bus eligible for the merge bus label Nov 5, 2026
athvin added a commit that referenced this pull request Nov 5, 2026
Second live run. Pre-flight passed, the batch merged cleanly, the tree was
computed — and the push was rejected:

    ! [remote rejected] HEAD -> merge-bus/41954654344
      (refusing to allow a GitHub App to create or update workflow
       `.github/workflows/rust.yml` without `workflows` permission)

GitHub will not accept a push from an App-authenticated token that creates or
updates anything under `.github/workflows/`. And `workflows` is NOT a grantable
`GITHUB_TOKEN` scope — verified, not assumed: actionlint rejects it as an
unknown permission and lists the fourteen that exist, none of which is
`workflows`. So no `permissions:` line can fix this. Only a PAT carrying the
`workflow` scope could, and that would hand a long-lived credential push rights
over CI itself, which is a worse trade than hand-merging the occasional PR.

So the bus now skips such candidates at selection and says exactly why, with
what to do instead ("merge it by hand") — because a bare skip would read as the
bus being broken. Detection is `gh pr view --json files` filtered in jq, so
there is no `grep -q` to SIGPIPE.

Worth recording that the failure was clean: the rejection happens before the
remote branch exists, so nothing was left behind — no branch, no bus PR, no
merges. The push-verification step never even got to run.

Also worth recording the irony, since it is a useful warning: the PR chosen to
demonstrate the bus (#467, which adds the `workflow pins (S9)` job) is itself
exactly the class of PR the bus structurally cannot carry. The first two live
runs were spent on a candidate that could never have worked.

Simulator covers it as `workflow-touching`, asserting the skip reason, that the
other members still ride, that the excluded PR is never merged, and that the
batch still lands. Mutation-tested by deleting the exclusion. Suite now 62
assertions.

Co-authored-by: bmoore813 <[email protected]>
Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
@athvin
athvin merged commit 578a697 into main Nov 5, 2026
36 checks passed
@athvin
athvin deleted the bm/ci-revive-pin-gate branch November 5, 2026 10:53
athvin pushed a commit that referenced this pull request Nov 7, 2026
#549's acceptance check was a count — `aws_iam_access_key` blocks under
infra/terraform/ drop from 2 to 1, survivor `builder`. A count in a closed
issue protects nothing, so this is that check as a gate, plus a bar on
re-plumbing the ER_S3_* pair the previous commit removed (the engine has no
reader for it, so re-adding it could only recreate a credential nothing uses).

The gate carries a FLOOR, which is the part worth reviewing: against the real
tree, finding ZERO access-key blocks exits 2 rather than reporting success,
because builder.tf is known to declare one. A detector breaks by noticing
nothing, and that failure reads exactly like a clean tree — the shape that let
the S9 pin gate enforce nothing until #467. Its self-test asserts both
directions of both rules, proves the floor fires, and fails if it asserted
fewer than nine cases.

Both findings the self-test produced on first run were real: the gate flagged
its own REJECT fixtures (now exempted by exact path, not a *-test.sh glob), and
the harness was pointing rule 2 at a directory the terraform fixture was not in,
so that case had been asserting nothing.

Wired into `make check` and rust.yml's ungated `workflow pins (S9)` job, beside
its siblings — a new access key arrives on an infra-only PR, which is precisely
what a Rust path filter skips.

Generated artifacts regenerated, two of them load-bearing as corroboration:
footprint.md's AWS inventory now independently reads 1 aws_iam_access_key,
1 aws_iam_user, 1 aws_iam_user_policy and 4 secretsmanager entries. CLAUDE.md's
skill table is also regenerated here, which is NOT this PR's subject: a241585
("enable skill") edited claim-ticket's frontmatter without regenerating it, so
main was already failing `make skills-check` before this branch existed. One
generated line, carried because this branch cannot go green without it.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
athvin pushed a commit that referenced this pull request Nov 7, 2026
#549's acceptance check was a count — `aws_iam_access_key` blocks under
infra/terraform/ drop from 2 to 1, survivor `builder`. A count in a closed
issue protects nothing, so this is that check as a gate, plus a bar on
re-plumbing the ER_S3_* pair the previous commit removed (the engine has no
reader for it, so re-adding it could only recreate a credential nothing uses).

The gate carries a FLOOR, which is the part worth reviewing: against the real
tree, finding ZERO access-key blocks exits 2 rather than reporting success,
because builder.tf is known to declare one. A detector breaks by noticing
nothing, and that failure reads exactly like a clean tree — the shape that let
the S9 pin gate enforce nothing until #467. Its self-test asserts both
directions of both rules, proves the floor fires, and fails if it asserted
fewer than nine cases.

Both findings the self-test produced on first run were real: the gate flagged
its own REJECT fixtures (now exempted by exact path, not a *-test.sh glob), and
the harness was pointing rule 2 at a directory the terraform fixture was not in,
so that case had been asserting nothing.

Wired into `make check` and rust.yml's ungated `workflow pins (S9)` job, beside
its siblings — a new access key arrives on an infra-only PR, which is precisely
what a Rust path filter skips.

footprint.md's AWS inventory is regenerated here and is load-bearing as
corroboration: it now independently reads 1 aws_iam_access_key, 1 aws_iam_user,
1 aws_iam_user_policy and 4 aws_secretsmanager_secret — each down one — from a
generator that knows nothing about this ticket.

An earlier revision of this commit also carried a CLAUDE.md skill-table regen,
because a241585 ("enable skill") had edited claim-ticket's frontmatter without
regenerating it and `main` was failing `make skills-check` independently of this
branch. 6d04e4b has since landed that same regen, so the rebase dropped it and
this commit no longer touches CLAUDE.md.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-bus eligible for the merge bus

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants