13 chats in 10 repos (2026-09-25), none packaged, each re-learning or missing
the same fixes — most often the mic. SHARED.md now names the reference (loki
/loki, with its four known gaps), a nine-line checklist where every line cites
the repo that already fixed it, and each chat's gaps. AGENTS.md points to it.
shared-inventory gains chat-composer (baseline 5 repos / 6 files); a mutated
baseline (6 -> 5) makes --check fail on it, so the guard can fail.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(scripts): grep -q is never the reader of a pipe under pipefail
`echo "$x" | grep -q PAT` under `set -o pipefail` can report "not found"
for text that IS there: grep -q exits on its first match and closes the
pipe, the writer takes SIGPIPE (141), and pipefail makes the pipeline
status 141, so an `if` takes the else branch on a successful match.
It is not confined to payloads past the ~4KB pipe buffer. Measured in
loki (loki#874) on a real 1,158-byte output, 3,000 calls: 2/3000 false
misses for a phrase near the top, 0/3000 via a here-string. Rare per
call; a suite makes hundreds. loki's retire-site suite went red on
exactly those phrases twice this week.
48 copies in 14 scripts here, rewritten to `grep -q PAT <<<"$x"`,
including:
- auto-merge-sweep.sh: the required-check coverage test. A false miss
marks a green job "uncovered".
- gc-merged-worktrees.sh: `in_use`. A false miss reads a live session's
worktree as unused. The pushed / clean / MERGED guards still stand, so
it cannot lose work, but it can remove a directory from under a live
session.
- cicd-hygiene, nav-contract, org-drift, verify-floor audits and
verify-predicates: false passes and false findings.
Checked: all 14 files pass `bash -n`; every file is a 1:1 line swap (48
lines); the 8 line-continuation sites keep the here-string before the
trailing backslash; fleet's 30 CI test scripts pass before and after
(30/30 -> 30/30); workflows still parse.
Gate: scripts/ci/test-no-grep-q-in-a-pipe.sh, wired into ci.yml. Scans
scripts/ and templates/, self-tests its detector both ways, and was
proven by restoring the original auto-merge-sweep.sh line.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
* fix(ci): main was red on a ratchet that fell, and a sweep test lied
Two failures on fleet main that were blocking every PR, including this
one. Neither was caused by the grep -q rewrite: main (7ed94a2, the base
of this branch) failed CI on the same step for the same reason.
1. org-drift ratchet fell. `org-drift-audit.sh --check` failed on main
since c43464d with "baseline entries with no matching violation - the
ratchet fell: bitbaum/README.md". Good news: someone fixed that drift.
Nobody lowered the baseline, so main stayed red and the auto-merge
sweep refused everything. Line removed; --check now passes (44 repos
swept, 3 known violations, no new contradictions).
2. test-auto-merge-sweep.sh lied. Its verdict `[ "$FAIL" -eq 0 ]` sat at
line 400 of 473, with ~70 lines of tests appended after it. A bash
script exits with its LAST command's status, so the verdict was
discarded: the suite exited 0 while printing "27 passed, 1 failed",
and its later tests were not even counted. Verdict moved to the end;
the suite now counts 38.
The hidden failure was real and was mine: test 13 asserted the sweep
always "waits for CI to catch up" when the newest base run is for an
older commit. The deadlock fix changed that - it waits only while a
run is in flight, and otherwise dispatches CI. Test 13 now asserts
both cases (13a waits and dispatches nothing; 13b dispatches and does
not merge). `rearms()` moved above its first use.
Proven by mutation: an injected late failure now fails the suite;
reverting the sweep to always-wait fails 13b; making it never wait fails
13a.
Gate: scripts/ci/test-verdict-is-last.sh, wired into ci.yml, requires
every suite's verdict to be its file's last command. Proven by restoring
the old mid-file verdict. All 34 fleet CI commands are now green, and
none exits 0 while reporting a failure.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
---------
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The green-base guard asks "is there a CI run for the base tip?". For an
automated merge the answer is permanently no: a push made with GITHUB_TOKEN
emits no workflow events, so every merge this script performs lands on the base
and produces NO CI run. `pick_base_run` then falls through to its last resort —
the newest run of all, belonging to some older commit — the sha comparison
fails, and the sweep exits 0.
The re-arm at the bottom of this file is exactly the cure, and it is
unreachable: it is gated on `merged_any`, and nothing can merge while the guard
holds. The block sits upstream of its own remedy. The guard's own comment
predicted this ("with no CI run ever produced by an automated merge, the very
next sweep would block forever") and the re-arm was placed where it cannot
answer it.
Measured on bitbaum/loki 2026-09-22: base CI history stopped on 09-13, every
sweep since exited in ~7 seconds reporting success, and FOUR non-draft green
PRs sat unmerged for up to fifteen days — the oldest opened 09-07. A human
eventually noticed and merged one by hand. A stall that exits 0 is
indistinguishable from "nothing to merge"; this is the fourth time that shape
has cost this fleet real time, after evig (11 PRs, 14h), aoz-begleitung and
ai-kit (9 days each).
The fix does NOT relax the guard. Merging onto an unverified base stays
refused. It supplies the missing evidence instead: when the tip has no run and
none is in flight, dispatch CI for it so the next sweep has a real verdict.
Self-healing, and it fails safe — a red result is then handled by the red-base
path rather than hidden by this branch.
The "genuinely catching up" case is preserved exactly: if any run is still
in flight, it waits as before and dispatches nothing. Dispatching there is what
caused the concurrency-cancellation storm on loki 2026-09-10.
This logic had no test — fleet CI covered it with `bash -n` alone, which is how
a permanent deadlock shipped. scripts/test/auto-merge-sweep-no-base-ci.sh now
drives the real script against a stubbed gh (which it was already written to
tolerate) across all three paths, and is wired into CI. Mutation-tested:
restoring the unconditional exit fails it.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The reconciler's first live run swept 43 repos, found 13 wanting a bump, and
refused to open any of them because the cap was 12.
The plan was entirely correct. The cap was not.
`MAX_PRS = 12` came from this script's own docblock, which said "Eleven of
fourteen are behind" — arithmetic that contradicted its very next sentence,
since ten on major 1 plus three stranded on 0.x is thirteen. So the guard went
off on a first run it should have passed: the right behaviour for the wrong
reason, and exactly the false positive that teaches someone to raise a cap
without reading the plan under it.
Corrected against the run rather than re-derived by hand:
13 of 14 consumers behind (only heidi current)
10 of those 13 on major 1 — invisible to a major-only audit
3 stranded on 0.x — datacat backend/, kivvi packages/ai/,
sbb-fundbuero
Note the figure that was NOT wrong: "ten of its fourteen consumers sat on
major 1 with an older minor", in SHARED.md and blessed-versions.json, is
correct and stays. Only the script's own count was off, and only by conflating
"behind on major 1" with "behind".
CAP 12 -> 20, and the test now pins it against reality rather than taste: it
must clear the 13 a real run found, and must stay well under the 43 repos
swept so "the whole fleet at once" still refuses. Raising it again requires
another run's output, and the comment says to name which run.
THE RUN ALSO FOUND DRIFT NOBODY HAD MEASURED. `@bitbaum/mail-kit` 0.1.0 ->
0.1.1 in botsmann, evig, kivvi (apps/web/), loki and surf-your-life. I had only
ever counted ai-kit; the `@bitbaum/*` scope caught the rest, which is the
argument for scoping by owner rather than by package.
And the monorepo paths resolved correctly on the first try — datacat backend/,
kivvi packages/ai/ AND kivvi apps/web/ as three separate manifests. That was
the blind spot SHARED.md recorded about this class of audit, and it is closed.
Still report-only. This change does not open the 13 PRs; it makes the next
`go=true` dispatch able to.
All CI self-tests green locally (org-drift and repo-metadata excepted: they
need the gh CLI this sandbox lacks).
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
Co-authored-by: Claude <noreply@anthropic.com>
* feat(ci): internal packages get a reconciler, not another report
THE HOLE
`version-currency.mjs` judges a dependency by its MAJOR — `blessed-versions
.json` is literally called `majors`. That is the right instrument for `next`
and `react`, where a major is the event, and the wrong one for our own
packages, where we ship features in MINORS.
Measured 2026-09-21, `@bitbaum/ai-kit` was published at 1.10.0 and read:
heidi ^1.10.0 · loki ^1.8.0 · substrata ^1.7.0 · orangecat ^1.6.0
aoz-begleitung, botsmann, evig, hirnli, surf-your-life, truthseeker,
vitareba ^1.4.0
kivvi (packages/ai) ^0.15.0 · sbb-fundbuero ^0.15.0 · datacat (backend) ^0.13.0
Eleven of fourteen behind. TEN of those on major 1 — so the ratchet reported
zero gaps while the fleet spanned seven minor versions of the package that owns
model ids, failover, the three kinds of 429 and now vision routing. A fix
published for everyone reached two repos.
REPORTING IS WHAT ALREADY FAILED
SHARED.md has said "version spread is the metric to watch" and "getting a repo
current is the cheapest work in this file and nobody schedules it" since before
the spread was measured. Both true. Neither moved a version. This file's own
history is explicit that adoption has only ever moved as a side effect of
repairing an outage.
So the reconciler opens the pull request. Everything downstream already exists:
PR → the repo's CI → auto-merge-sweep → CD → box. A green bump ships itself. A
red bump is the useful outcome — it names the repo that cannot take the new
version, which nothing in the fleet tells a package author today.
WHAT IT WILL NOT DO
`@bitbaum/*` only. Auto-bumping someone else's major across the fleet on a
schedule is a different risk and our CI is not a safety net for it; third-party
majors stay with version-currency.mjs and a human.
It never fails a pipeline for being behind. A gate that FIXES what it measures
has nothing to gain from also going red, and a red nobody can clear by hand is
the dead end this fleet's doctrine forbids.
It does not hand-patch a manifest. Every repo installs frozen, so an
API-patched package.json without its lockfile is a PR that fails CI in every
repo every week for a reason unrelated to the bump — and a bot whose PRs are
always red gets muted, taking the real signal with it. The workflow checks the
repo out and lets pnpm write both files.
Capped at 12 PRs per run: a whole fleet going stale at once is likelier a bug
in the predicate than twelve stale repos.
DOCUMENTATION THAT HAD GONE FALSE
Three claims in SHARED.md were still being read as current:
- "kivvi, orangecat and evig already own model REGISTRIES ... which ai-kit
does not model" — it does. src/registry.ts carries contextWindow,
capabilities incl. vision, inputCostPer1M and a live-probed toolProtocol.
- "ai-kit has no streaming API" — completeStream() + ai-kit/sse shipped in
v1.9, and src/stream.ts opens by quoting that very row.
- the transcription row — transcribe() shipped; heidi migrated.
Three reasons repos gave for keeping their own AI layer, all built into the
package and left unclaimed, because the consumers are pinned below the fix.
Corrected in place with what is genuinely still missing (embeddings, a local
provider, image generation, anything not JavaScript) marked deliberate.
The general lesson is recorded there: a reason a repo gave for not adopting
something becomes a FACT in that file the moment it is written, and nothing
re-reads it when the reason expires. Date a reason, or it outlives its subject.
45 self-test checks, no network, no token, no checkout. Both sides pinned: the
same-major drift is caught, a current repo stays silent, and `workspace:*`, a
git pin and `>=1.2 <2` come back untouched — quietly rewriting a range somebody
chose deliberately is the worst bug this script could have.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
* ci: run the reconciler's self-test, like every other audit's
Caught reviewing my own diff. This repo's CI names each audit's self-test
explicitly rather than globbing, which is the right call — a glob quietly
covers a file that does not exist yet and quietly stops covering one that is
renamed. It also means a NEW audit is uncovered until someone adds the line,
and I had not.
That matters more here than for most: this is the one audit that WRITES.
A scheduled run pushes a branch and opens a pull request in up to twelve
repositories, so its predicates are the last ones that should reach a schedule
unproven. They are pure precisely so they can be proved without a network, and
the proof has to actually run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
* fix(ci): the re-arm gate asked a wider question than its own name
It went red on this PR, correctly as written and wrongly as intended:
internal-currency.yml pushes to main but never re-arms CI
internal-currency.yml re-arms CI but lacks 'actions: write'
That workflow pushes a FEATURE branch, to a DIFFERENT repository, with a PAT.
Three independent reasons it cannot strand this repo's merge queue, which is
the invariant the gate is named for. What it was actually keyed on was
`grep -q 'git push'`.
The gate is not wrong and is not weakened here. It indexed more than it was
trusted to cover — this file's own recurring shape, recorded about
version-currency and the hosted-supabase sweep in the same table — and the
remedy is the one this repo keeps arriving at rather than an exemption:
narrow the predicate to the invariant, and put it where fixtures can reach it.
Satisfying it literally was the alternative and would have been worse: adding
`actions: write` and a `gh workflow run ci.yml` to a workflow that has no
business dispatching fleet's CI, purely so a grep would pass. A gate answered
that way stops meaning anything.
WHAT NOW COUNTS AS PUSHING TO MAIN
git push the CURRENT branch — on a scheduled run
here that is main. COUNTS
git push origin main says so. COUNTS
git push origin HEAD:main same. COUNTS
git push origin "$BRANCH" an explicit non-main ref does not,
UNLESS the file sets that variable to main
That last clause is the doorway, and it is pinned: naming your target $BRANCH
must not buy an exemption while `BRANCH: main` sits ten lines above it. Both
the YAML-env and shell-assignment spellings are fixtures.
A comment is also no longer a push. Without that the gate reported ITSELF —
ci.yml quotes the old predicate in the comment explaining it, and was listed
as a pushing workflow.
MOVED OUT OF ci.yml, because a rule that can only be exercised by editing a
real workflow is a rule nobody re-tests after changing its regex. Same
reasoning that put the verify-contract rules in verify-predicates.sh.
Eleven fixtures, no network, red half written first. And the claim the old
inline comment made — "proven by mutation: deleting any of the three re-arms
turns this red" — re-run against the real readings.yml: deleted, red; restored,
green.
The remaining limit is stated in the script rather than implied: a workflow
pushing to ANOTHER repo's default branch is not covered, because it cannot
strand THIS queue, and a gate for it belongs with whatever owns that queue.
All 27 of this repo's CI self-tests pass locally.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
* fix(ci): the reconciler workflow was invalid YAML and would never have run
I shipped it broken in #120 and the repo had no way to tell me.
`internal-currency.yml` merged to main unparseable. A `run: |` block is a YAML
block scalar, and the multi-line `git commit -m "…"` inside it continued at
column 0, which ends the scalar mid-command. The `gh pr create --body "$(cat
<<'BODY' …)"` heredoc had the same shape.
THE FAILURE MODE IS THE WHOLE POINT. A workflow GitHub cannot parse does not go
red. It does not warn. It is registered with its FILE PATH where its name
should be, and it never runs — not on dispatch, not on its weekly schedule. The
only symptom was `run_workflow` replying "Workflow does not have
'workflow_dispatch' trigger" about a file that plainly declares one, because
GitHub had not managed to read the `on:` block either. Had I not tried to
dispatch it, the first sign would have been a Tuesday cron that quietly did
nothing, forever.
FIXED: both message bodies now go through INDENTED heredocs into files, read
back with `git commit -F` and `gh pr create --body-file`. YAML strips the
block's common indentation, so the bodies and their terminators reach bash at
column 0 as it requires.
AND THE GAP THAT LET IT SHIP. CI validates `templates/ci/*.yml` — on the
reasoning that a broken template fails in another repo, far from here — and
validated nothing in `.github/workflows/`. The repo's own automation, which
defends every other repo's branch, was the unchecked part.
`scripts/ci/check-workflows.sh` now asserts both halves, because they fail
independently:
1. every workflow parses, and `name:`/`on:`/`jobs:` survive the parse;
2. every `run:` block is valid shell, extracted exactly as the runner
receives it.
The second half is not optional. A file can parse as YAML and still hand the
runner something that cannot execute, and the extraction is the only way to see
a `run:` block the way bash will.
TWO BUGS THIS SCRIPT'S OWN TEST FOUND, both worth naming:
· `out="$(python3 - <<'PY' … PY)"` — a heredoc inside a command substitution
is not the same thing. Bash warns "unterminated here-document" and quietly
runs nothing. The gate was passing because it was doing nothing.
· `bash -n` EXITS 0 on an unterminated heredoc and only warns. Checking the
exit code alone would have let this exact defect class through a second
time. It now fails on any stderr, since a clean script prints nothing.
The second one is the reason the test exists. I would have shipped a checker
that could not catch the bug it was written for.
Ten fixtures, no network, red half first — the real flush-left heredoc, valid
YAML with invalid shell, an unterminated heredoc, a missing `on:`, a missing
`name:`; and quiet for an indented heredoc, a `uses:`-only workflow, and
`${{ }}` expressions, which are not shell and must never be parsed as such.
Plus this repo's real 25 workflows and 101 run blocks.
30 of 31 CI checks pass locally; the exception is org-drift-audit.sh, which
needs the `gh` CLI this sandbox lacks and which CI has.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
---------
Co-authored-by: Claude <noreply@anthropic.com>
* feat(ci): internal packages get a reconciler, not another report
THE HOLE
`version-currency.mjs` judges a dependency by its MAJOR — `blessed-versions
.json` is literally called `majors`. That is the right instrument for `next`
and `react`, where a major is the event, and the wrong one for our own
packages, where we ship features in MINORS.
Measured 2026-09-21, `@bitbaum/ai-kit` was published at 1.10.0 and read:
heidi ^1.10.0 · loki ^1.8.0 · substrata ^1.7.0 · orangecat ^1.6.0
aoz-begleitung, botsmann, evig, hirnli, surf-your-life, truthseeker,
vitareba ^1.4.0
kivvi (packages/ai) ^0.15.0 · sbb-fundbuero ^0.15.0 · datacat (backend) ^0.13.0
Eleven of fourteen behind. TEN of those on major 1 — so the ratchet reported
zero gaps while the fleet spanned seven minor versions of the package that owns
model ids, failover, the three kinds of 429 and now vision routing. A fix
published for everyone reached two repos.
REPORTING IS WHAT ALREADY FAILED
SHARED.md has said "version spread is the metric to watch" and "getting a repo
current is the cheapest work in this file and nobody schedules it" since before
the spread was measured. Both true. Neither moved a version. This file's own
history is explicit that adoption has only ever moved as a side effect of
repairing an outage.
So the reconciler opens the pull request. Everything downstream already exists:
PR → the repo's CI → auto-merge-sweep → CD → box. A green bump ships itself. A
red bump is the useful outcome — it names the repo that cannot take the new
version, which nothing in the fleet tells a package author today.
WHAT IT WILL NOT DO
`@bitbaum/*` only. Auto-bumping someone else's major across the fleet on a
schedule is a different risk and our CI is not a safety net for it; third-party
majors stay with version-currency.mjs and a human.
It never fails a pipeline for being behind. A gate that FIXES what it measures
has nothing to gain from also going red, and a red nobody can clear by hand is
the dead end this fleet's doctrine forbids.
It does not hand-patch a manifest. Every repo installs frozen, so an
API-patched package.json without its lockfile is a PR that fails CI in every
repo every week for a reason unrelated to the bump — and a bot whose PRs are
always red gets muted, taking the real signal with it. The workflow checks the
repo out and lets pnpm write both files.
Capped at 12 PRs per run: a whole fleet going stale at once is likelier a bug
in the predicate than twelve stale repos.
DOCUMENTATION THAT HAD GONE FALSE
Three claims in SHARED.md were still being read as current:
- "kivvi, orangecat and evig already own model REGISTRIES ... which ai-kit
does not model" — it does. src/registry.ts carries contextWindow,
capabilities incl. vision, inputCostPer1M and a live-probed toolProtocol.
- "ai-kit has no streaming API" — completeStream() + ai-kit/sse shipped in
v1.9, and src/stream.ts opens by quoting that very row.
- the transcription row — transcribe() shipped; heidi migrated.
Three reasons repos gave for keeping their own AI layer, all built into the
package and left unclaimed, because the consumers are pinned below the fix.
Corrected in place with what is genuinely still missing (embeddings, a local
provider, image generation, anything not JavaScript) marked deliberate.
The general lesson is recorded there: a reason a repo gave for not adopting
something becomes a FACT in that file the moment it is written, and nothing
re-reads it when the reason expires. Date a reason, or it outlives its subject.
45 self-test checks, no network, no token, no checkout. Both sides pinned: the
same-major drift is caught, a current repo stays silent, and `workspace:*`, a
git pin and `>=1.2 <2` come back untouched — quietly rewriting a range somebody
chose deliberately is the worst bug this script could have.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
* ci: run the reconciler's self-test, like every other audit's
Caught reviewing my own diff. This repo's CI names each audit's self-test
explicitly rather than globbing, which is the right call — a glob quietly
covers a file that does not exist yet and quietly stops covering one that is
renamed. It also means a NEW audit is uncovered until someone adds the line,
and I had not.
That matters more here than for most: this is the one audit that WRITES.
A scheduled run pushes a branch and opens a pull request in up to twelve
repositories, so its predicates are the last ones that should reach a schedule
unproven. They are pure precisely so they can be proved without a network, and
the proof has to actually run.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
* fix(ci): the re-arm gate asked a wider question than its own name
It went red on this PR, correctly as written and wrongly as intended:
internal-currency.yml pushes to main but never re-arms CI
internal-currency.yml re-arms CI but lacks 'actions: write'
That workflow pushes a FEATURE branch, to a DIFFERENT repository, with a PAT.
Three independent reasons it cannot strand this repo's merge queue, which is
the invariant the gate is named for. What it was actually keyed on was
`grep -q 'git push'`.
The gate is not wrong and is not weakened here. It indexed more than it was
trusted to cover — this file's own recurring shape, recorded about
version-currency and the hosted-supabase sweep in the same table — and the
remedy is the one this repo keeps arriving at rather than an exemption:
narrow the predicate to the invariant, and put it where fixtures can reach it.
Satisfying it literally was the alternative and would have been worse: adding
`actions: write` and a `gh workflow run ci.yml` to a workflow that has no
business dispatching fleet's CI, purely so a grep would pass. A gate answered
that way stops meaning anything.
WHAT NOW COUNTS AS PUSHING TO MAIN
git push the CURRENT branch — on a scheduled run
here that is main. COUNTS
git push origin main says so. COUNTS
git push origin HEAD:main same. COUNTS
git push origin "$BRANCH" an explicit non-main ref does not,
UNLESS the file sets that variable to main
That last clause is the doorway, and it is pinned: naming your target $BRANCH
must not buy an exemption while `BRANCH: main` sits ten lines above it. Both
the YAML-env and shell-assignment spellings are fixtures.
A comment is also no longer a push. Without that the gate reported ITSELF —
ci.yml quotes the old predicate in the comment explaining it, and was listed
as a pushing workflow.
MOVED OUT OF ci.yml, because a rule that can only be exercised by editing a
real workflow is a rule nobody re-tests after changing its regex. Same
reasoning that put the verify-contract rules in verify-predicates.sh.
Eleven fixtures, no network, red half written first. And the claim the old
inline comment made — "proven by mutation: deleting any of the three re-arms
turns this red" — re-run against the real readings.yml: deleted, red; restored,
green.
The remaining limit is stated in the script rather than implied: a workflow
pushing to ANOTHER repo's default branch is not covered, because it cannot
strand THIS queue, and a gate for it belongs with whatever owns that queue.
All 27 of this repo's CI self-tests pass locally.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014RpRyAd15YvFmQ1c1p1Rsk
---------
Co-authored-by: Claude <noreply@anthropic.com>
The fleet's rendered-defect gate swept 1440x1000 and nothing else. That was
the hole it could not see through, and it cost substrata a header that was
broken at three widths for months while every gate stayed green.
substrata shipped a mobile menu whose panel was positioned against a button in
the middle of the header, so `right: 0` measured from there put 22rem of panel
off the LEFT edge of a 390px screen — the search field and every link label
painted where nobody could see them. Contract rules 1-6 all passed on it: the
links had boxes, cleared 44px, and marked the current page. They were simply
not on the screen, and nothing rendered the screen they were missing from. The
same header hid its entire nav between 768 and 1099px, so an iPad got a lone
"MENU" in an empty bar.
So: 390 / 834 / 1440, overridable with VIEWPORTS. Each is a different branch of
this fleet's CSS — below every breakpoint, in the gap where `md:` has fired and
`lg:` has not, and the desktop already covered.
Two new detectors, and they are contract rules 7 and 8 because the first sweep
found them live, not because they sounded right:
surf-your-life "Jetzt starten" crosses the right edge by 93px at 834
vitareba "ANMELDEN" crosses by 19px at 834
kivvi "Demo anfragen" crosses by 15px, page scrolls sideways 15px
Every one of those is clean at 1440. Rule 3 moves with width too: petvity is
clean at 390 and has three sub-44px targets at 834; datacat has three at 390
and seven at 834; botsmann is clean at both and has six at 1440.
CROSSING the edge is the defect, not being past it — a closed drawer parked at
translateX(-100%) is entirely outside the viewport and is how a drawer waits.
Requiring part on screen and part off separates the two with no list of
exceptions. The floor is 4px, because the sweep found loki's "Get started" one
pixel over, which is rounding and not a clipped button.
A panel is closed on arrival, so nothing measures it. DISCLOSE opens every
<details> in a nav or header by setting the property — no event fires, so
nothing can navigate — and main() clicks up to six button[aria-expanded=false]
with a URL guard, because a click in this fleet may do anything.
The off-viewport rule gets a WIDER root set than rules 1-4, and that is the
finding rather than a convenience: substrata's mobile menu is not inside a
<nav> at all. It is a <details> beside one in the header, which is where a menu
button usually lives. Scoped to <nav> it would have missed the exact defect it
was written for — the fixture caught that before the fleet did.
Findings merge across widths and print once, annotated with every width they
were seen at, so three renders do not treble a report a human reads. Keys
deliberately ignore absolute coordinates: the same crooked stack sits at a
different x at each width, and keying on edges printed one decision three
times.
Also: a site that could not be rendered at ANY width is no longer folded into
the closing check mark. This script's own header says a clean report from a
detector that never looked is worse than no report at all, and it was doing
exactly that.
SHARED.md: rules 7 and 8 with the evidence above; the enforcement paragraph
now describes what the sweep actually does; and the 2026-08-31 "open gap" note
is corrected — s-ink and substrata are in FLEET_SITES now, camille-boulangerie
and wild-spirit still are not.
Self-tests 20 -> 24, all passing: the off-left panel is caught, the anchored
fix stays silent, a closed drawer stays silent, DISCLOSE is pinned separately
so a regression there cannot masquerade as a clean fleet, and a malformed
VIEWPORTS throws instead of silently skipping.
Verified end to end against a live local site and against all 14 fleet sites.
Job timeout 20 -> 30 minutes; the three-width sweep ran in ~8.
Claude-Session: https://claude.ai/code/session_01NkjZ1jJPhHzxAPvbSSG3wH
Co-authored-by: Claude <noreply@anthropic.com>
The rule now has one statement. Solon's and Loki's agent files each carry
their own instances (the pre-filled proposal that survives sign-in, the
skippable interview, the CI check that warns with a ratification link
instead of failing) and point here for the rule itself, per "How docs stay
current": a fact has one producer, a doc may point at it, the copies are the
bug.
The measured case that made it a rule: OrangeCat's "Govern it with Solon"
button sent the entity in the query to Solon's dashboard, and nothing on the
far side read it. Pressing the right button landed somewhere that had
forgotten why. Found 2026-09-20; fixed in bitbaum/solon#172 and
bitbaum/orangecat#1096.
Claude-Session: https://claude.ai/code/session_01RU7EqR1TPicrJGv46cLDaH
Co-authored-by: Claude <noreply@anthropic.com>
A push made with GITHUB_TOKEN triggers no workflows. So when readings,
origin-proof or shared-inventory commit to main, main gets NO CI run for
that commit, and the auto-merge sweep then refuses every open PR with:
main is at <tip> but the newest CI run is for <older> — waiting for CI
until somebody dispatches ci.yml by hand. Nothing tells them to. The queue
simply stops, and each workflow looks perfectly healthy in isolation.
Hit FOUR times in two days — after the readings commit, then after the
origin proof commit — each time silently holding every open PR in the repo
while the cause looked like a different bug every time.
The sweep already re-arms after its OWN merges for precisely this reason,
and says so in a comment. The three workflows that commit to main never
got the same line.
All three now dispatch ci.yml after a successful push, with the
`actions: write` that dispatch needs.
- GITHUB_TOKEN deliberately, not FLEET_PAT. This only needs a CI run to
EXIST for the tip; the sweep's schedule picks it up. A PAT dispatch
would additionally emit workflow_run and wake the sweep immediately —
the cascade documented in loki CLAUDE.md, which is not wanted here.
- Never fatal. The commit is already pushed; failing the step after that
would report a proof as unwritten when it is written.
AND THE RATCHET, because this is well past the second time.
ci.yml now fails if any workflow containing `git push` lacks either the
re-arm or `actions: write`, and refuses to pass if it finds no pushing
workflows at all (a check that silently stops checking is the shape this
repo exists to delete). Inline, like the other one-invariant gates here.
Proven by mutation: deleting readings' re-arm turns it red and names the
file; restoring returns green.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
It printed "✓ every fleet audit ran recently, went green" regardless of how
many it had failed to read. Observed 2026-09-18 announcing exactly that
with two workflows listed under UNREADABLE three lines above it.
Withheld is correctly not a finding — an outage must never be charged to
the thing it obscured — but it is not a pass either, and one sentence was
claiming both the audits it had read and the ones it had not.
This is the same overstatement fixed the day before in
secret-in-response-sweep.sh, which now says "the N app(s) reached" rather
than "the fleet". Writing the rule in one script did not apply it to its
sibling, which is worth noting on its own: the lesson travels by being
re-applied, not by being written down once.
- some unreadable -> "the N audit(s) READ ran recently, went green" plus
"M could not be read — this verdict says nothing about them". Still
exit 0: what was read is still worth reporting.
- NOTHING readable -> exit 2. A blind watchdog reporting green is the
exact failure this script exists to end, so it is neither a finding
nor a pass.
The blind case is guarded on `ok_count == 0 AND unreadable > 0`, because
ok_count is also 0 in a repo whose every workflow is excluded as a
non-audit. "Nothing to audit" and "I was blind" must not share a verdict —
caught by the existing fixture that feeds this script nothing but ci.yml,
which my first version turned red.
Proven by mutation: collapsing the scoped branch turns exactly three cases
red, restoring returns 45 green. Live run confirms it — 17 read and green,
2 named as unread.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
origin-proof.sh refuses to write a manifest listing FEWER repos than the
last one — a token that sees less is far likelier than repos vanishing,
and a wrong manifest is in the proof chain forever. It then tells you to
set ORIGIN_PROOF_ALLOW_SHRINK=1 if the deletion was real.
That env var had nowhere to be set. The workflow passes no such variable
and takes no inputs, so the only way to clear the guard was to run the
script on a laptop and push the manifest by hand — which nothing tells
you, and which leaves the scheduled run red until somebody happens to
look at the Actions tab.
2026-09-18 is the first time it mattered. The count fell 48 -> 47 because
a FleetCrown scaffold repo was deliberately deleted the day before, and
origin-proof went red on its overnight tick. The guard was correct; it
simply could not be answered from where it fires.
Found by audit-health's first unattended scheduled run, which is the
whole point of that workflow: a red audit that would previously have sat
unread for days was on Telegram within hours of appearing.
The input is dispatch-only and defaults to false. A shrink must stay a
human decision taken once, never something a scheduled run can do to
itself, so `inputs.allow_shrink` is empty on every cron tick and only a
deliberate dispatch sets it, for that one run.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
scripts/audit/secret-in-response.py reads what actually crossed the wire
and reports credential material in it. It shipped 2026-09-15 with nine
test cases covering both directions, a README ending "Exit code is 1 if
anything CRITICAL or HIGH was found, so it can gate CI", and a real
cross-account disclosure to its name: vitareba's GET /api/admin/patients
returning every patient's bcrypt digest, which the code-level sweep had
missed because that route reads findMany() with no projection and a grep
for json(user) shapes does not match json({ success, data }).
Nothing ran it. Not a workflow, not ci.yml, not even its test. That is the
UNCALLED shape the floor audit exists to report, applied to the gate
templates/ci/README.md calls the one that catches what has actually cost
this fleet money — and it sat that way while the README said Rung 5 was
adopted nowhere, which was true only because nobody had looked in
scripts/audit.
WHAT LANDS
- secret-in-response-sweep.sh: every LIVE app from
loki:scripts/hetzner/apps.conf (the SSOT, read from its default branch,
never a local checkout), unauthenticated, three paths, GET only.
- secret-in-response.yml: daily, both suites before the verdict, Telegram
on failure, and fixtures-only on a PR because the live verdict is a
fact about the apps rather than about the change under review.
- both test suites into ci.yml, where neither had ever run.
First live sweep: 12/12 apps reached, 0 findings.
WHAT IT PROVES AND WHAT IT DOES NOT
Unauthenticated only. The README is explicit that the authenticated pass
is the real test — most interesting routes 401 without a session — and it
needs a live session cookie per app held as a rotating secret. A gate
needing twelve of those is a gate that stops running, so it stays manual
and the workflow says so rather than letting green imply more than it
proves. What it does cover is strictly the worse class: credential
material reachable with NO LOGIN AT ALL.
Still unbuilt: identity taken from the request body, and a query missing
its tenant filter. Both are per-repo assertions with no fleet-level
detector yet.
AND THE SAME BUG AGAIN, IN THE SWEEP WRITTEN TO CLOSE IT
With every host unreachable the sweep announced a clean fleet, having read
zero responses. Its own fixtures caught it before it ever ran on a bad
day. A verdict may only be claimed over what was actually READ: it now
reports scanned N/M, withholds unreachable hosts instead of counting them
clean, refuses to pass when N is zero, and when some hosts are missing
says "the N app(s) reached" rather than "the fleet".
13 aggregation cases, stubbed gh and stubbed scanner, no network.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The sweep re-runs a base CI run that "produced no verdict". A cancelled
run with a LIVE SIBLING on the same commit was superseded by that sibling,
not left un-judged, and re-running it is actively harmful: both runs share
the workflow's concurrency group, so the re-run cancels the sibling, the
next sweep sees the sibling as un-judged and re-runs it, cancelling the
first. They take turns until MAX_RUN_ATTEMPTS stops them. It terminates by
exhaustion, not by resolving.
Measured on bitbaum/solon 2026-09-17 across two merges. Six sweeps a
minute apart alternated between the same two ci.yml runs on 2667beb — one
push, one workflow_dispatch — ending at n=341 attempt 3 cancelled and
n=342 attempt 3 success. The Deploy gate failed on a docs-only change each
time because it sampled a cancelled tip and took its terminal branch.
Found by the loki session, whose sweep logs named the path. Worth
recording that the two obvious suspects were both innocent: the post-merge
re-arm block is double-gated (merged_any AND a tip-run-exists skip) and
had re-armed nothing, and the deploy reconciler dispatches Deploy, which
no workflow_run trigger listens for. ci-gate.sh, one directory away,
already draws this cancelled-vs-superseded distinction as its exit 3 — the
correct behaviour was written down before the bug was found.
Narrow by construction: while a sibling is in flight the sweep waits
instead of re-running, and every other path is untouched. A LONE cancelled
run is still re-run, which is what the rerun path exists for.
Proven by mutation: flipping the in-flight test to `== completed` turns
exactly two cases red, and restoring it returns them green.
NOT fixed here, and it is the bigger story: FLEET_PAT is a live bitbaum ORG
secret, so PAT-created dispatches DO emit workflow_run and the no-cascade
invariant the CD design rests on is false fleet-wide. That is what gives
this its once-a-minute clock. loki CLAUDE.md still documents the invariant
as true.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The FleetCrown->Loki rename (#65) changed the sender domain in ONE of the
two places it was written. Since then the canary asserted
loki.orangecat.ch was verified and then sent from
@fleetcrown.orangecat.ch — checking a domain that does not exist in Resend
while using one that does.
So it went red every day saying 'every app's sender just broke' when
nothing had broken. Measured 2026-09-17: Resend holds
fleetcrown.orangecat.ch (verified) and no loki.orangecat.ch, and all
twelve apps on the box send from @fleetcrown.orangecat.ch. Mail was fine
the whole time; the check was wrong.
A canary that cries wolf is worse than no canary, because the next real
outage arrives in a channel everyone has learned to ignore.
The domain is now written ONCE as a job-level env var and read by both the
/domains assertion and the From address, so a rename cannot half-apply
again. The file states the order the rename must follow: create and verify
the new domain in Resend, move the apps' MAIL_FROM, THEN change this line.
Two smaller things the same bug exposed:
- ABSENT is now distinguished from UNVERIFIED. An empty status means the
domain is not in the account at all, which is 'this canary points at
nothing' — a different fault from DNS breaking, and the one that
actually happened. It prints the domains that ARE present.
- The send payload is built with jq instead of string-spliced into a
JSON literal, because the From address now carries a variable.
Verdict logic exercised against the real /domains response shape in all
three states, plus a quoted value that would malform a hand-built payload.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The first real scheduled run of audit-health reported two problems. One
was genuine (email-canary). The other was entity-drift.yml, added by #108
at 07:22 that morning on a '41 6 * * *' cron — the day's tick had already
passed — and this rule charged it seven hours later for failing to do
something the calendar made impossible.
A new rule's first finding deserves more suspicion than its hundredth, and
this is the third time in this file's short life that a rule encoded the
example it was written from rather than the property that example
illustrated: ivy-portal, aoz-begleitung, now this.
A workflow whose FILE is younger than its own cadence is therefore not
counted; it prints 'too new to have run' so the reason is visible rather
than silently skipped. The add date comes from git log --diff-filter=A,
the same file the threshold is already derived from.
Two exceptions keep it from becoming a blanket excuse, both pinned:
- an OLD workflow that has never run is still a finding;
- a REFUSED file — the one GitHub lists by PATH — gets no grace at any
age, because that is a defect and not a calendar.
Verified against the live fleet: 2 problems -> 1, and the one that remains
is the real one.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
audit-health.yml on main referenced toJSON(secrets), and the dispatch
meant to CONFIRM the previous fix is what disproved it:
pull_request + toJSON -> action_required, 0 jobs
workflow_dispatch + toJSON -> action_required, 0 JOBS
The trigger was never the variable. A run referencing the secrets context
is held for manual approval under ANY trigger here, so as merged the
workflow could never execute — a daily watchdog that does not run, which
is a worse failure than the four red audits it was built to catch, and
invisible until something dispatched it.
toJSON(secrets) removed. Consequence stated in the file rather than
dressed up: the phantom-secret check WITHHOLDS in CI, because listing
secrets needs a scope no token here has and the only other source is
gated. It bites locally with a token that can list them. It has already
earned its keep by finding the fifteen phantoms once, and the red/stale
verdict — the reason this workflow exists — needs no secrets and is
unaffected.
Three things worth keeping:
- the ZERO-JOBS signature (action_required or failure with jobs: []) is
GitHub declining to run the workflow, the same tell as a file it
refuses to parse. Read the job count before the logs; there are none.
- a fix is not verified until the fixed thing has actually RUN. Two PRs
merged on a theory one dispatch destroyed.
- run it on the branch it will live on. Every wrong conclusion in this
sequence came from reasoning about a run instead of triggering one.
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>