Commit Graph
50 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 31de29870b fix(scripts): grep -q is never the reader of a pipe under pipefail (#140)
* 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>
2026-09-24 11:58:34 -07:00
Cato 496f4265f9 fix(currency): update nested pnpm lockfiles (#138)
* fix(currency): rely on PR CI instead of pre-push hooks

* fix(currency): update nested pnpm lockfiles
2026-09-23 16:53:03 -07:00
Cato 62f3bf4951 fix(currency): rely on PR CI instead of pre-push hooks (#137) 2026-09-23 16:48:59 -07:00
Cato e0f7aadda7 fix(currency): push reconciler updates to stable remote branch 2026-09-24 01:39:00 +02:00
Cato 7ddc4d787f ci(currency): reconcile registered unscoped npm packages 2026-09-24 01:31:16 +02:00
Cato 29a50705f7 ci(registry): dispatch Bitbaum site updates (#133) 2026-09-23 15:40:17 -07:00
CatoandClaude Opus 5 f114ea0259 fix(auto-merge): the sweep waited forever for CI that could never run (#123)
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>
2026-09-22 00:31:49 -07:00
CatoandClaude Opus 5 5194a02781 fix(ci): the reconciler workflow was invalid YAML and would never have run (#121)
* 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>
2026-09-21 06:56:02 -07:00
CatoandClaude Opus 5 ab0d407c44 feat(ci): internal packages get a reconciler, not another report (#120)
* 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>
2026-09-21 06:03:42 -07:00
CatoandClaude fbe9cec233 feat(ui-audit): render three widths, because one was never a sample (#119)
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>
2026-09-21 00:46:09 -07:00
CatoandClaude Opus 5 f95aa82945 fix(ci): a workflow that commits to main must re-arm CI, or it stalls the queue (#117)
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>
2026-09-18 09:01:49 -07:00
CatoandClaude Opus 5 890b1ed712 fix(proofs): the shrink guard had no reachable off switch (#115)
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>
2026-09-18 08:13:17 -07:00
CatoandClaude Opus 5 cc87f90d91 feat(security): Rung 5's detector existed for two days and nothing ran it (#113)
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>
2026-09-17 09:06:18 -07:00
CatoandClaude Opus 5 dc3441929f fix(email): the canary checked a domain nobody created (#111)
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>
2026-09-17 08:24:35 -07:00
CatoandClaude Opus 5 6c4e477074 fix(ci): the daily watchdog could not run at all (#109)
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>
2026-09-17 07:41:21 -07:00
CatoandClaude Opus 5 9a9e659110 fix(ci): a check that needs a button pressed is not a gate (#107)
* fix(ci): a check that needs a button pressed is not a gate

audit-health.yml's pull_request runs came back `action_required` every
time — GitHub holding the run for manual approval on a same-repo branch,
reproduced twice, while ci.yml ran normally on the same commit. An
unapproved run reads as "not passing" and blocks the merge queue, so the
PR trigger was worse than no PR trigger.

The PR-time half moves to ci.yml, which runs on pull_request without
asking. That is the better split anyway: ci.yml gates a CHANGE,
audit-health.yml watches the WORLD. They were only in one file because
they share a script, which is not a reason.

audit-health.yml is now schedule + dispatch only, so every failure it
reports is the sweep finding something real, and the Telegram step loses
its event_name guard.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(ci): toJSON(secrets) under pull_request is held for manual approval

The phantom check needs the names of the secrets that exist. The API
listing needs a scope no token here has, so the only source is
${{ toJSON(secrets) }}, whose keys are those names.

A workflow referencing the secrets context under a pull_request trigger is
HELD by GitHub: the run completes action_required with ZERO JOBS and
nothing executes. Measured four times on same-repo branches, and the
factor is exactly that:

  #105 audit-health  pull_request  no toJSON  -> ran
  #106 audit-health  pull_request  toJSON     -> action_required, 0 jobs
  #106 ci.yml        pull_request  no toJSON  -> ran
  #107 ci.yml        pull_request  toJSON     -> action_required, 0 jobs

The last of those is this branch: moving the check into ci.yml did not
escape the gate, it carried the gate along with it. POST
/actions/runs/:id/approve refuses these runs, and an unapproved run reads
as not passing, so it also blocks the merge queue.

So the phantom check goes where the constraint allows a real answer: the
DAILY scheduled audit-health run, which is not gated and which pushes a
Telegram when it bites. A phantom introduced by a PR is caught within a
day rather than at merge. A real gate on a slower clock beats a fake one
on a fast clock.

ci.yml keeps the test suite and carries the reasoning so the next person
does not re-derive it by burning three PRs.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 07:30:39 -07:00
CatoandClaude Opus 5 f29463cabe feat(ci): catch a doc that restates the entity list instead of pointing at it (#108)
An entity is anything that can hold a wallet and is better for holding one.
The list of types has one producer, `orangecat/src/config/entity-registry.ts`.
Measured 2026-09-17: THREE copies of that list lived in orangecat's own
agent-read docs and all three disagreed. One named `organization`, which has
never been an entity type. Another omitted six that are. These are the files a
coding agent reads before it touches anything, so each copy was quietly
teaching a wrong list, and nothing broke loudly enough for anyone to notice.

The copies are gone (bitbaum/orangecat#1071). This is the gate that stops the
fourth one.

## Why it is structural and not a word count

The obvious detector — "a doc naming 4+ type names is restating the list" — was
written, run against all 48 repos, and REJECTED. Its only finding was a false
positive on the sentence that FIXES the problem:

    ... it named `organization`, which has never been an entity type, and
    omitted six that are — `document`, `group`, `investment`, `research`,
    `wallet`, `wishlist`.

A detector whose first finding is its own remedy trains people to ignore it.
The second false positive was a legitimate code example.

So a restatement is the list PRESENTED AS THE LIST — a shape, not a vocabulary.
A fenced block with 4+ lines each naming one type (the `type EntityType = |
'product'` shape), or 4+ consecutive list/table rows each naming one. Prose is
never counted, however many names it holds, because prose that names types is
explaining them rather than defining them.

## Proven in both directions, and by mutation

`test_entity_drift.py` runs on the REAL historical text rather than invented
fixtures — proving a detector against fixtures its author invented proves only
that the author can invent suitable fixtures. All three copies must fire; both
real false positives must not; three list lines must stay under the threshold.
Seven cases, no network, no checkout. Wired into ci.yml beside the other
"still detects, still stays quiet" self-tests.

The audit itself is proven by MUTATION, which is the part a green gate cannot
tell you. `REF_OVERRIDE` pins a repo to a ref, so the sweep can be re-run
against the commit BEFORE the copies were removed:

    orangecat pinned at 55e431ee^
    NEW orangecat/.claude/CLAUDE.md:28    LIST, 10 type lines
    NEW orangecat/.claude/CLAUDE.md:109   LIST, 14 type lines
    NEW orangecat/.claude/rules/domain-specific.md:138  FENCE, 9 type lines
    exit 1

Against today's main: 97 docs across 48 repos, zero findings, exit 0. A gate
that has never fired is indistinguishable from a clean fleet, and this one
would otherwise have gone green forever on its first day.

## Two deliberate details

The baseline ships EMPTY and says why in the file. Three copies existed, all
three were replaced, and a full sweep found no others — so the first line added
there is a regression, not a backlog item.

It reports SKIPPED loudly when it cannot list repos. A vacuous pass reads
exactly like coverage, which is the failure mode already documented for
hosted-supabase-audit.

`audit-health.yml` picks this up with no change: it audits every workflow not
on its own exclusion list.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 07:22:56 -07:00
CatoandClaude Opus 5 14e5a65d3c fix(ci): the phantom check could only ever withhold in CI, which is decoration (#106)
* fix(ci): the phantom check could only ever withhold in CI, which is decoration

#105 shipped the phantom-secret check correctly withholding when it cannot
list secrets — the right fix for reporting 21 secrets as missing when it was
merely unable to read them. But listing secrets needs a scope no token in
these workflows has, so in CI it withheld EVERY time. A check that can only
ever withhold produces no signal and no red, which is the decoration this
whole file exists to delete. It was honest and useless.

Actions can answer the question without that scope: `toJSON(secrets)` hands
a run its own secrets context, and its KEYS are the names available to that
run. The workflow passes them in SECRET_NAMES, one per line, via an env var
— not interpolated into the script body, so no secret material is ever
shell-quoted — and reduced to keys with jq before anything is printed.
Actions masks the values regardless; none is ever echoed.

When SECRET_NAMES is set it is authoritative and the API listings are not
consulted. Unset, the previous behaviour stands: both listings must succeed
or the check withholds out loud. So it bites on a PR, bites locally, and
still refuses to invent a finding from an outage.

Four cases pin it against the same blind stub used for the withhold test:
a secret the context lists is not charged, one it does not list still is,
the run FAILS rather than withholding, and the withheld banner is absent.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* chore: re-trigger checks

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 06:48:54 -07:00
CatoandClaude Opus 5 783207e68b feat(ci): nothing watched the twenty-one audits that watch every repo (#105)
* feat(ci): nothing watched the twenty-one audits that watch every repo

Four of them were not doing their job on 2026-09-17 and no signal existed
anywhere: email-canary RED that day carrying a real finding (the Resend
sender domain every app sends through read unverified), bus-factor and
dependabot-alerts RED for days, and hosted-supabase CANCELLED — so it had
audited nothing since the 14th, and its silence was shaped exactly like a
clean sweep.

Rung 4 says a gate that reports success and means nothing is worse than no
gate. A gate that reports FAILURE and is never read is the same defect
wearing the other colour.

audit-health.sh asks four questions of every audit workflow: has it ever
run (GitHub lists a workflow it REFUSED by path, with zero runs — the
dotfiles duplicate-key incident), was its last run green (cancelled and
timed-out are not), did it run recently enough for its OWN cron, and does
every secrets.NAME it references actually exist.

The staleness threshold is derived from each workflow's cron rather than
tabulated here: a second copy of a fact the workflow already states would
be Ground Truth #2 violated by the script that enforces it.

This is the one audit that pushes. Every other reports into a job summary,
which is right — and is exactly what failed, because nobody looked for
days. One Telegram per run, never per finding, and the alert step goes red
itself if undeliverable.

PHANTOM SECRETS, the mechanism by which an audit goes blind without ever
failing: `${{ secrets.ABSENT || secrets.GITHUB_TOKEN }}` is not an error.
It silently degrades to the repo-scoped default token, and an audit that
sweeps the fleet able to see one repo reports a clean fleet.
FLEET_READ_TOKEN and FLEET_ADMIN_TOKEN were named by seven workflows here
and have never existed; only FLEET_PAT does. That is the proven cause of
the dependabot-alerts red — with the default token,
repos/*/vulnerability-alerts is unreadable for every repo but this one.
All fifteen references repointed at FLEET_PAT.

Secrets absent ON PURPOSE go in audit-health.allow with a reason, because
the property is "its absence silently weakens a gate", not "it is absent".
SWH_TOKEN is the conforming case — optional, only lifts a rate limit.
Flagging it would have been the third false positive of this exact shape
after ivy-portal and aoz-begleitung: the rule encoding the first example
it was written from rather than the property that example illustrated.

Proven by mutation in both directions, and the suite immediately earned
itself: staleness NEVER FIRED, because splitting a cron expression with
`set -- $cron` also globs it — the `*` fields expand against the working
directory, so `17 6 * * 1` was read as a file listing. It passed a live
run against the real fleet, because nothing happened to be stale that day,
and would have shipped as a column that could never go red — the exact
shape this file exists to find, in the file that finds it.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(ci): a PR gate must judge the diff, and the floor follower knew only npm

Two corrections, both found by the work landing in this branch actually
being run.

1. audit-health gated PRs on the state of the WORLD.

Its pull_request run called --check, which renders the live red/stale
verdict — so PR #105's own check failed on four audits that were red
before the branch existed, and every unrelated PR in this repo would have
been blocked on someone else's outage. A gate that goes red for something
its author cannot fix is how a team learns to merge past red, which costs
more than the gate ever returns.

--static answers only what a diff controls: does every secret these
workflows name exist. The live verdict belongs to the scheduled run, which
is the one that pushes. Four new test cases pin both halves — a RED audit
does not fail --static and is not even rendered, while a phantom secret
still bites.

2. The floor audit's sub-package follower matched only npm's --prefix.

Its comment names printcraft as the repo it was written to fix. printcraft
has been charged for all three gates in every sweep since, because its
verify is `pnpm --dir app run verify` and `--dir` is pnpm's spelling of
--prefix. The follower was written for the package manager the fleet does
not use.

printcraft was reported "▲ FIXABLE — verify omits a gate the repo already
has: lint typecheck test" while its CI ran lint, typecheck, vitest, three
Python pipeline tests, a build and a standalone-output contract on every
PR. Nothing was wrong with the repo. Confirmed by extraction both ways:
the old regex does not match that verify at all, the new one resolves it
to app/verify.

A comment claiming a bug is fixed is not evidence that it is.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(ci): the phantom check charged 21 secrets it was merely unable to read

Its first CI run reported FLEET_PAT, TELEGRAM_BOT_TOKEN, TELEGRAM_CHAT_ID
and every other real secret as "does not exist". Listing secrets needs a
scope the workflow token lacks; both listings failed; the empty set that
came back was read as "no secrets exist".

That is the audit's own worst bug — a failed fetch reported as a finding —
committed by the script written to report that class, on its first live
run, against the rule stated three sections above it in the README it
ships with: silence is not data.

Both listings must now SUCCEED before any verdict is drawn, and the check
is withheld out loud when either cannot be read. Never partially: a
half-read listing charges every secret defined in the half you could not
see. Three new cases stub a token that may not list secrets and pin that
nothing is charged, that the withholding is said aloud, and that an outage
does not fail the run.

The tell was arithmetic, not intuition: 21 findings arriving at once
against a fleet that had none the day before.

Also: ci-pnpm.yml carried `version: 11` on pnpm/action-setup@v4, and
action-setup HARD-ERRORS when that is set alongside package.json
`packageManager` — which every fleet repo sets. All seven pnpm repos
checked had quietly dropped the line locally and none fixed the source, so
the golden floor was the one shape nobody could actually copy. It surfaced
because listkit adopted it verbatim and CI died in five seconds.

A template with no adopter that matches it is not a source of truth.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 06:33:24 -07:00
CatoandClaude Opus 5 1bcf33fd9a feat(fleet): find a value copied into code that already has one home (#100)
* feat(fleet): find a value copied into code that already has one home

Renaming aoz-housing took four PRs across three repos and still missed things,
because the name had been copied where nothing connects it: a package name, a
GitHub URL builder, a seed map, a site override key, a JSON key in another repo
entirely. None of it broke loudly. A retired host answers 308, a renamed repo
redirects, a stale slug matches until the day it does not — so every copy looked
healthy right up to the moment it was wrong.

The first sweep found 495 across 16 repos, including a retired product name
serving on loki's public footer and a seed script that would have written two
retired hosts into the database.

A literal is a finding only when it duplicates a source of truth, or is wrong:
retired values (from registers/retired.json), a public IP in a connection (the
box address lives in loki _box-env.sh and in vars.HETZNER_IP), one person's home
directory (DEV_ROOT), a consumer mail address in source, and an arbitrary hex
class (globals.css tokens).

THIS AUDIT CONTAINS NO EXAMPLE OF WHAT IT HUNTS. One that hardcoded the box IP
and the operator's address in order to find them would be the bug it reports,
and in a public repo would publish the address too. The retired strings come
from the register — which is why `maonakamoto` is now a kind:"account" row in
retired.json rather than a literal inside a detector.

Not findings, deliberately: comments, including lines INSIDE block comments,
because the history of an incident is correct under the name it had then;
markdown, which org-drift already polices; registers, *.allow, *.baseline and
lockfiles, which ARE the source; test fixtures, in their own tier and outside
the ratchet; and hardcoded-values.allow, where every exception carries a reason
a reader can judge. An allow entry matching nothing is itself reported: an
allowlist that cannot shrink is a ratchet that cannot fall.

It caught its own bugs three times, which is the part worth trusting. The first
generic rules read CIDR tables as box addresses and import paths like
@/components/home/sections as home directories (ip 66 -> 26, home 84 -> 43).
Tightening the home rule to demand a trailing slash then LOST `default_cwd
"/home/g"`, and the stale-allowlist check surfaced it. And arbitrary-hex
reported 0 across 44 repos — believable only because a raw grep agreed.

25 assertions pin both directions of every rule against fixtures.

Two fixes in fleet itself:

bus-factor-audit.sh kept its own copy of the box IP; it now sources _box-env.sh
when the loki checkout is there and otherwise requires the value, naming where
it lives.

deploy-freshness-audit.mjs NEVER SAW orangecat. It matched deploy workflows on
/deploy/i and orangecat's is cd.yml, so the largest repo in the org has been
outside that audit since the day I wrote it — not reported clean, never looked
at. Found today, while orangecat's main had not reached the box since 483cb9e0.
Coverage 21 -> 22, and the audit now judges it.

Baseline set from the fleet AFTER this sweep's repo cleanups (348 runtime, down
from 495), so it is a floor rather than a comfortable number.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* fix(bus-factor): require the box address where it is USED, not where it is set

Requiring HETZNER_IP at assignment aborted the audit's own offline test suite —
9 of 10 cases failed on a script that had not yet decided to ssh anywhere. The
address is only needed under --box, so that is where the check belongs. Still no
literal default: BOX, else BOX_UBUNTU from _box-env.sh, else HETZNER_IP, else a
clear refusal naming all three. The usage text no longer promises a default that
does not exist.

test-bus-factor-audit.sh: 10 passed, 0 failed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:42:33 -07:00
CatoandClaude Opus 5 144855dea6 chore(aoz): rename the repo to aoz-begleitung, and record why (#94)
* chore(aoz): rename the repo to aoz-begleitung, and record why

`bitbaum/aoz-housing` is now `bitbaum/aoz-begleitung`. It was the last public
place the product was still called Housing: registers/retired.json retired "AOZ
Housing" as the PRODUCT name on 2026-09-10, but the repo kept it, and the repo
is PUBLIC — so the retired name sat on the org page, in every clone URL, and in
~55 references across this repo alone.

The deploy name `aoz-wohnen` is deliberately NOT renamed with it, and that is the
decision, not an omission. It is an infrastructure identifier — systemd unit,
/opt path, database — and nothing on the box keys on the repo name; renaming it
would touch a live site for no visible gain. Two names now instead of three.

The registers are DERIVED and were regenerated, not hand-edited:
origin.json (aoz's `stamped` and `swh` drop to null, correctly and temporarily —
Software Heritage archived the old origin URL and the OpenTimestamps manifest
names the old repo; the nightly origin-proof re-stamps) and packages.json.

proofs/origin/*.json are untouched on purpose. They are hash-chained and
append-only, so a past proof naming bitbaum/aoz-housing is correct history;
rewriting one would both falsify the record and break the chain.

retired.json gains the `repo` row, which is what makes the old name traceable —
and what makes org-drift-audit.sh start flagging documents that still use it.
Three were flagged: this repo's AGENTS.md (fixed here), the renamed repo's
README (fixed in aoz-begleitung#243) and its CLAUDE.md, which is BASELINED with
a reason rather than fixed: `JWT_ISSUER` is still the literal string
`aoz-housing` and must stay so — src/proxy.ts and src/lib/auth/config.ts pass it
as the JWT issuer, and changing it invalidates every live session. A live auth
value, not a name.

Verified across the rename: bitbaum/aoz-housing redirects to the new repo,
https://aoz.orangecat.ch still 200, aoz-wohnen-app still active, and the new
clone URL resolves to 431bae7 — the same tip as before.

Tests green: deploy-freshness 24, deploy-reconciler 34, repo-metadata 17,
model-pin, version-currency, product-identity 45, verify-predicates 29.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

* chore(aoz): defer the retired-name row until the docs it polices have landed

org-drift-audit.sh reads the org's DEFAULT BRANCHES, not the working tree. So
adding the `aoz-housing -> aoz-begleitung` row to retired.json in the same PR
that fixes AGENTS.md is a deadlock by construction: the audit judges main, where
AGENTS.md is still unfixed, so `--check` fails — and the fix cannot merge while
it fails.

The row is a POST-condition, not a co-requisite. Fix the documents first, let
them reach the default branches, then declare the name retired and let the audit
hold the line from there. The row returns in its own PR once this and loki#732
are on main.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

* chore(aoz): the baseline exception belongs with the row that creates it

Same sequencing lesson, mirrored. Without the retired-name row nothing flags
aoz-begleitung/CLAUDE.md, so a baseline entry for it matches no violation — and
org-drift rejects that correctly: "baseline entries with no matching violation —
the ratchet fell". A baseline full of entries that match nothing is a ratchet
that cannot fall, which the file's own header already says.

So the row and its one exception land together, in the PR after this one.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 06:37:48 -07:00
CatoandClaude Opus 5 65e4104ff1 fix(reconciler): put the clock on the box, because GitHub's scheduler is not one (#90)
The reconciler I shipped this morning has never once run on schedule. Neither
has the audit. Measured today:

  deploy-freshness.yml   hourly at :37 since that morning   10:37 missed, 11:37 missed
  deploy-reconciler.yml  twice-hourly                       11:53 missed

Every run either workflow has ever had was a manual dispatch of mine.

That is the same failure that broke the twenty-five per-repo sweeps — loki 19m,
evig 151m, reparaturbonus-zh 244m, vitareba 276m since their last run, against a
stated ten-minute cadence. I diagnosed that correctly and then fixed it by
moving from twenty-five GitHub crons to one GitHub cron, which moved the problem
without fixing it. A reconciler that never fires is not a reconciler; it is a
decoration that makes the fleet look supervised.

The box's timers DO fire, on time, and have for months: security-check every
5m, host-check every 5m, watchdog every 5m, all with no drift. So the clock
moves there and GitHub only does the work.

`fleet-reconciler.timer` ticks every 15 minutes and dispatches this workflow.
The tick script deliberately holds no policy — every guard (green tip, nothing
in flight, the caps, the double read, the CI-re-run rule) stays in the workflow
where it is version-controlled and tested. A clock that also made decisions
would be a second, untested copy of the reconciler living on a box nobody reads.

It also never exits 0 on a failed dispatch, because a tick that reports success
while dispatching nothing is precisely the invisible failure this whole
mechanism exists to end: `systemctl list-timers` would show it firing happily
forever.

Installed and verified on bitbaum. First box-triggered run — and the first --go
run of any kind — proved its guards (24 + 25 assertions), surveyed 21 repos and
dispatched nothing, correctly. Next tick 12:39 UTC.

The workflow keeps its `schedule:` as a free second chance, since the run is
idempotent, but nothing depends on it and the header now says so.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 05:28:26 -07:00
CatoandClaude Opus 5 03d962297c docs(deploy): these are pilots and concepts, not clients (#88)
bitbaum has no clients. `apps.conf`'s `client-app` is a PROVISIONING fact about
how a site was set up, not a commercial relationship: publicly these are Pilots
(real use, no terms) and Concepts (built to apply — SBB, Reparaturbonus).

I wrote "a client site" three times while building the deploy audit and
reconciler, in comments that are the first thing a reader meets. The point
those comments make does not need the word and is not weakened by losing it —
what makes reparaturbonus-zh matter in that story is that real people were
served four hours of stale code, which is true of a concept site too.

No behaviour change.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 05:14:17 -07:00
CatoandClaude Opus 5 c241537655 fix(deploy-freshness): the audit reported a clean fleet it had not fully seen (#87)
Caught by checking the gate's own output against a local run: CI surveyed 20
repos and printed "✓ every deploying repo has its main tip live", while the same
command locally surveyed 21. The missing one is `annushka`, which is PRIVATE.
CI's token could not enumerate it, and a repo a token cannot see is absent from
`gh repo list` in exactly the same way as a repo that does not exist.

So the audit built to catch "something I could not see, reported as something
that was not there" committed that exact error about itself, and the symptom was
a green tick.

Two fixes, and the second is the one that matters.

The token now prefers FLEET_PAT, which can read the private repos.

But a token fix only repairs today's instance: any future scope lapse, any new
private repo, silently shrinks the sweep again and still prints a green tick.
A count with nothing to compare against is not coverage. So the deploying repos
are pinned in a committed baseline and coverage becomes a RATCHET, the same
shape as the duplication ratchet in SHARED.md: it may RISE — a repo that starts
deploying is surfaced as an addition, and the baseline is updated — but a
silent FALL is a finding, and --check exits 1 on it, naming the repos rather
than only counting them. A genuinely retired repo leaves the baseline in the
same PR that retires it, where a human sees the decision instead of the gate
quietly getting smaller.

The coverage check runs BEFORE the verdicts are printed, because the point is
that those rows do not describe the whole fleet.

24 assertions (17 → 24), 5 mutants killed: a ratchet that never reports anything
missing, an unreadable baseline, unstripped comments, a baseline missing the
private repo, and coverage that can never legitimately rise.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 04:50:59 -07:00
CatoandClaude Opus 5 0d3e5b4010 feat(fleet): one clock for the fleet's deploys (#85)
The reconciler logic is neither missing nor broken. auto-merge-sweep.sh already
compares the base tip against the last successful deploy and closes the gap,
with a green guard and an in-flight guard, and it is already centralised as a
reusable workflow. What is broken is its CLOCK.

Each caller repo supplies its own `schedule:`, so the fleet depends on ~25
independent GitHub crons, and GitHub honours them erratically. Time since each
repo's sweep last ran, measured today against a stated ten-minute cadence:

    loki 19m · evig 151m · reparaturbonus-zh 244m · vitareba 276m

Quiet repos are hit worst, which is exactly backwards — GitHub de-prioritises
schedules on low-activity repos, and a client site nobody pushes to all week is
the definition of low-activity. The repos least likely to have a human watching
are the ones whose clock stops first. reparaturbonus-zh sat merged-but-not-live
for four hours today for precisely that reason: its Deploy lost a timing race
and nothing retried it, while CI stayed green and /api/health returned 200.

So: one schedule, in the most active repo in the org, dispatching deploys only
where they are needed. It does not reimplement the sweep and it does not merge
anything — it closes the merged-but-not-live gap and nothing else.

Staleness comes from the audit's own deployFreshness, imported rather than
re-derived, so the thing that REPORTS a stall and the thing that FIXES one
cannot drift into disagreeing.

What it refuses to do is the load-bearing part:

  - never ships a RED tip, however stale;
  - never ships while a deploy is in flight;
  - never ships a tip whose CI has not finished;
  - never ships a tip with no green CI run at all. That is loki right now —
    concurrency cancelled both its CI runs, so no green run exists for the
    chained deploy to fire on. It needs a CI re-run, not a deploy, and the
    output says so instead of papering over it by shipping something unverified;
  - never ships more than MAX_DISPATCHES (5) in one tick. A reconciler holds a
    deploy button for all 21 repos; a whole fleet going stale at once is far
    likelier to be a bug in the predicate than 21 real stalls, so past the cap
    it reports and ships nothing.

Both decisions that can cause a deploy are pure and tested: 18 assertions, and
5 mutants killed — reading a cancelled CI run as green, dropping the in-flight
guard, shipping a red tip, making the tool inert, and raising the cap above the
fleet size. The workflow proves those guards BEFORE the run that can dispatch.

Dry run is the default; the live survey of all 21 repos dispatched nothing and
correctly held loki back.

Also captures gh's stderr instead of forwarding it: probing 21 repos for a
.github/workflows directory printed eight bare 404s above the report, expected
misses indistinguishable from a real failure and noisy enough to hide one.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 04:33:42 -07:00
CatoandClaude Opus 5 d849b430d2 feat(fleet): ask whether what is on main is actually live (#80)
Nothing was asking. uptime-sweep.sh probes /api/health and treats 5xx as DOWN —
that proves a process is UP, not that it is running the code we merged.
CLAUDE.md already says a health check is not a feature check; this is the
missing half.

WHY IT MATTERS HERE SPECIFICALLY

A push made with GITHUB_TOKEN triggers no workflows, so an auto-merged PR fires
no Deploy. Measured on bitbaum/loki: SIX of the last fifteen commits on main had
no Deploy run of their own. They shipped anyway, because the auto-merge sweep
reconciles every ten minutes.

So that reconciler is the single thing standing between "merged" and "live" for
most commits in this fleet — and it had no alarm on it. If it stops, CI stays
green, PRs keep merging, /api/health keeps answering 200, and the box quietly
serves last week's code.

WHAT IT FOUND ON ITS FIRST RUN

  ✗ reparaturbonus-zh — main tip is 212m old and no deploy has run since it

A client site, merged and not live for three and a half hours. Its Deploy at
d1431ca is completed/FAILURE, six Auto-merge sweeps have run since without
recovering it, and the commit carries TWO CI runs — one success, one cancelled
— which is the documented shape where the shared Deploy reads the cancelled
duplicate as a failed gate.

Two more repos report UNKNOWN rather than clean: aoz-housing and sbb-fundbuero
have a deploy.yml but no successful Deploy run on record.

WHAT IT ASKS

Per repo with a deploy workflow: is main's tip covered by a successful Deploy?
A run for that exact SHA counts, and so does any successful run that STARTED
after the tip was committed — because most commits here ride a later
reconciler dispatch rather than firing their own. Requiring an exact-SHA run
would have reported nearly the whole fleet stale while everything was live,
which is how a check earns being muted.

Anything uncovered is only a finding once it is older than the reconciler's
window (45m: the sweep's 10 minutes plus room for a build). Inside that it is
PENDING, not a problem.

WHAT IT DELIBERATELY DOES NOT DO

It does not judge whether the deployed code works. And it does not read the
app's own /api/health `commit` field: exactly one of thirteen live apps
publishes one, so a check built on that would cover a single app while looking
fleet-wide.

12 self-test assertions, no network — including both grace boundaries, the
vacuous-pass guard, and that a failed, cancelled or still-running deploy never
counts as shipped.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 02:35:10 -07:00
CatoandClaude Opus 5 2460085c4b feat(identity): measure all six, and stop skipping the pillars (#79)
Loki now publishes problem, solution, mission, vision, roadmap and changelog on
/api/fleet/map (bitbaum/loki#724), so the six rows this audit carried as
`published: false` are live. Flipping them is the migration the last commit
promised, and it is the whole of it — the FIELDS table was the only thing that
had to change to widen what is checked.

READING THE MAP INSTEAD OF THE REGISTER IS THE OTHER HALF

The register takes `status` from apps.conf, which deliberately omits the
handcrafted 4001-4004 services. So `loki` and `orangecat` — two of the three
pillars — had no register row, and every rule here skipped them while they
served the public internet. The audit reported that as a blind spot it could
not fix. The map resolves a project with a live URL and no hosting row as live,
which is the truth, so reading the map fixes it at the source: both are now
judged like everything else, and `loki` immediately shows "no solon org".

WHAT IT SAYS NOW

63 gaps across the 16 projects that have shipped, and a per-field count so the
shape is visible at a glance instead of buried in a per-project list:

    what        7 missing        roadmap    14 missing
    problem     4 missing        changelog   5 missing
    solution    4 missing        orangecat  10 missing
    mission     4 missing        solon      11 missing
    vision      4 missing

Roadmap is the fleet's worst field by a wide margin — 14 of 16 — and nothing
said so before, because nothing counted it.

Baseline 31 -> 63 is not a regression: the old number counted one field on a
narrower population. It is raised in this commit so the change is a decision
somebody can read in the diff, which is what that rule is for.

45 assertions, both directions. The mutation now runs over the whole table:
un-publishing each field in turn must remove exactly its own check, or the
table is decoration and the rules are hardcoded elsewhere. Gate proven by exit
status — 63 -> 0, 62 -> 1, dead map -> 2, never 0.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 02:18:52 -07:00
CatoandClaude Opus 5 6b364ef561 feat(identity): the six things a product owes a reader, and the number that notices (#78)
Every product is supposed to carry problem, solution, mission, vision, roadmap
and changelog. All six already have a producer — a Loki project profile, where
they are attribute keys, the `goals` table and `user_projects.dev_log`, injected
into every dispatch. Nothing published them, nothing rendered them, and nothing
counted them, so the state of it was invisible.

Measured against the live register on 2026-09-15:

  35 projects; `description`, its only prose field, null on all 35
   7 of 35 have an OrangeCat profile — two of those seven are dead experiments
   1 of 35 has a Solon organisation: OrangeCat itself
  20 of 33 repos ship none of the six on their own site
  loki, orangecat and wild-spirit have no register row at all, so every
    register-derived rule already skipped them while they served the internet

The register's null description is the sharpest one: build.ts reads
user_projects.description through usefulDescription(), which correctly nulls the
site factory's "Website at <url>" boilerplate — so a 100% gap presented exactly
like a working filter. That is this repo's own thesis (a producer with no
consumer looks wired) landing on the register itself.

So: the contract in AGENTS.md, and a ratchet that reports it. The audit judges
only mechanical claims — a field is empty, a profile is absent — never whether
prose is good, for the reason repo-metadata-audit.mjs gives. It reports two
things it deliberately does not count: generated experiment litter, and live
projects with no register row, because folding those in would let a register fix
look like progress on identity.

Baseline 31. Weekly, not per-PR: the register is served by Loki on the box, and
a gate that goes red for reasons the author cannot fix is a gate that gets muted.
The judgement is a pure function of the rows, so its test runs per-PR with no
network — 36 assertions including a mutation: flipping one FIELDS row to
published must turn a previously clean product red, or the table is decoration.
Verified by exit status, not output: 31→0, 30→1, no baseline→2, dead register→2.

Publishing a field into the API is one row in FIELDS. That is the whole migration.

SHARED.md also gains the two chat rows this measurement produced: ai-kit has no
streaming API, which is why six repos hand-roll a provider client and two SSE
readers drop frames on chunk boundaries.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-14 23:24:30 -07:00
CatoandClaude Fable 5.1 bcbc937d67 feat(registers): readings.json — the numbers the bet rests on, nightly (#75)
"We believe our systems will work" earns the word when it is observed. This
reads, from sources that are not us, every number the thesis depends on:
stars and forks (GitHub), npm downloads per shared package, paying clients
and CHF/month (loki's apps.conf plan|price over live rows owned by someone
else), and what Solon's originator_share rule has routed (0, by source).
history[] gains a row only when a reading changes, so a flat month is one
row and one commit. Zero is a reading.

First reading, 2026-09-15: 2 stars, 1 fork, 6812 npm downloads/30d (our own
CI installs included), 0 paying of 4 clients (4 favours), CHF 0/month,
originator share paid 0.


Claude-Session: https://claude.ai/code/session_01DzY8KuwgUM7u95GVTpRL2m

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 21:48:30 -07:00
CatoandClaude Fable 5.1 2ee172e9e8 feat(audit): bus factor — could someone who is not Cato operate each live app? (#74)
loki's deploy-ready check proves each app can be deployed and the watchdog
proves each URL answers. Nothing checked the part that needs a human who
knows things: whether the secrets an app needs are NAMED in its repo, so an
operator can rotate a key or rebuild the box without reading the code. This
reads loki's apps.conf and each repo's default branch, and ratchets the count
of live apps without a committed env example (5 of 11 today: datacat-web,
vitareba, petvity, sink, substrata). With --box it also asks the box whether
each app can roll back, whether its dump is fresh, and whether dumps leave
the disk — first run: evig is a plain directory with no way back, everything
else rolls back, all nine databases dumped 2h ago, off-box configured.

Ten fixture tests, both directions. Weekly workflow.


Claude-Session: https://claude.ai/code/session_01DzY8KuwgUM7u95GVTpRL2m

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 21:45:04 -07:00
CatoandClaude Fable 5.1 71f19264c0 feat(registers): origin.json — the readable form of the origin proofs (#70)
proofs/origin holds the evidence but nobody can read a .ots file. This joins
each public repo's GitHub first-commit date, its newest stamped HEAD, the
oldest anchored manifest naming it (with the Bitcoin block), and its Software
Heritage snapshot into one register, derived nightly by the origin-proof
workflow. Private repos are counted, not listed. generatedAt moves only when
a fact does, so a quiet night is no commit.

First emission: 44 public repos, all proven in block 966918, 19 archived by
Software Heritage so far.


Claude-Session: https://claude.ai/code/session_01DzY8KuwgUM7u95GVTpRL2m

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 04:57:26 -07:00
CatoandClaude Fable 5.1 3a030d1ceb fix(origin-proof): read private repos via FLEET_PAT and refuse a shrinking manifest (#67)
FLEET_READ_TOKEN does not exist; FLEET_PAT is the org PAT the auto-merge sweep
already runs on, so the nightly run can see all 47 repos. And a manifest that
lists fewer repos than the last one is refused: a token that sees less is far
likelier than repos vanishing, and a wrong manifest sits in the chain forever.
ORIGIN_PROOF_ALLOW_SHRINK=1 confirms a real deletion.


Claude-Session: https://claude.ai/code/session_01DzY8KuwgUM7u95GVTpRL2m

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 18:52:34 -07:00
CatoandClaude Fable 5.1 10229a1ec9 feat(fleet): nightly third-party proof of origin for every bitbaum repo (#66)
Git dates are fields the committer sets, so they cannot show that the fleet's
code existed before a fork of it. This stamps one manifest of every repo's
default-branch HEAD through OpenTimestamps (Bitcoin-anchored, verifiable
offline forever), asks Software Heritage to snapshot the public repos, and
commits the proofs to proofs/origin. Each manifest links to the previous one
by sha256, so the series is a chain.

The first manifest is included: 47 repos (the one fork skipped), 3 private
ones named only by sha256(org/name) because this repo is public.

Nightly, with no commit on a quiet day. Anonymous Software Heritage saves are
10/h, so the order rotates by day; an SWH_TOKEN secret would cover the org in
one run.


Claude-Session: https://claude.ai/code/session_01DzY8KuwgUM7u95GVTpRL2m

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 18:50:27 -07:00
CatoandClaude Fable 5.1 231ad50706 chore: rename FleetCrown to Loki (#65)
The product was renamed on 2026-09-14: bitbaum/loki, loki.orangecat.ch,
LOKI_* env keys, loki-* units. This repo referenced the old name in
38 files changed, 119 insertions(+), 119 deletions(-).
Email addresses at the old sending domain stay until the new domain is
verified in Resend.


Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 16:23:38 -07:00
CatoandClaude Opus 5 684096ff99 feat(registry): publish the derived package registry as JSON (#61)
SHARED.md curates — a package has a row because a human decided it should.
This derives everything else from package.json across the org and writes
registers/packages.json, so a renderer never types the list. AGENTS.md already
forbids typing the portfolio; the packages had no derived source to render from
until now.

Each row carries the install line taken from what adopters ACTUALLY write,
which matters more than it sounds: listkit's npm name belongs to a stranger, so
a page that assumed `pnpm add <name>` would tell readers to install someone
else's package. Deriving it from real specifiers produces the git install
instead, and records whether a package comes from npm or a tag — the thing an
outsider most needs to know.

An adopted-but-unlisted package is deliberately NOT published: curation stays
the gate, and the audit already fails when a real adopter has no row.

The weekly workflow refreshes the file and commits only when the derived facts
changed, so a quiet week produces no commit.


Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 11:41:11 -07:00
CatoandClaude Opus 5 c8c0c6077a feat(fleet): make throwaway repos disposable, and point the audits inward (#58)
* feat(fleet): make throwaway repos disposable, and point the audits inward

Six scaffolded repos appeared in two days and nobody created them carelessly —
FleetCrown provisions one per project and agents scaffold sites to test that
path. Together they were 15 of the 26 gaps that were about to turn the
version-currency ratchet red against a committed baseline of 0. That is how a
ratchet dies: not disputed, drowned. A gate whose number is mostly noise gets
muted, and every true finding inside it is muted with it.

The house rule (CLAUDE.md, "Clean up the experiment when the experiment is
over") already says an experiment is torn down in the session that created it,
repo included. This adds the backstop, because that rule covers the session
that creates a repo and nothing covers the session that dies, is interrupted,
or forgets — which is how all six survived.

  scripts/local/prune-ephemeral-repos.sh

A throwaway repo carries the GitHub topic `fleet-ephemeral` from birth: on the
repo, not in a list somebody must remember to update, so a later sweep can find
it without recognising the name. The script lists by default, deletes on
--delete --yes, and refuses anything unmarked — "it is obviously a test repo"
is the reasoning that eventually deletes something real. Deletion is the
intended action, per the house rule; --archive is only a holding position.

Its selector is pinned in both directions on every fixture and its --yes guard
runs through the script itself via an injected repo list, so no assertion is a
re-implementation of the thing it checks. Four mutants were each confirmed to
turn the test red before this shipped: selector ignores the topic, substring
instead of exact match, guard removed, empty result reported silently.

  scripts/ci/shared-registry-audit.mjs

Every audit in this repo sweeps the OTHER repos. None asked whether SHARED.md —
the file whose first line is "check this file, if it is here, install it" —
matches the dependency graph. It did not: bip-kit had eight adopters and no
row. This derives the adopter count from package.json across the org and fails
when a package with 2+ adopters has no registry row. It resolves the npm: and
github: aliases half the fleet installs under, because a key-only reader
reports zero adopters for a package with five, and it counts a row only from
the registry TABLE — bip-kit was mentioned in the prose the whole time, and a
substring search over the file would have called that covered.

It does not judge the content of a row. A gate that guesses at prose gets muted.

  scripts/ci/blessed-versions.json

@bitbaum/ai-kit fell through the seam between `internal_tags` (deleted when it
graduated to npm, correctly) and `majors` (never added — it was 0.x that day).
It shipped 1.0.0 and nothing noticed, because the comment explaining its
absence still described it as a 0.x package. Seven of thirteen consumers sat on
0.x carets while the package was at 1.4.1 and no gate said so. Both it and
design-tokens are now tracked, and the stale exemption is rewritten to say what
actually happened: a version-tracking exemption must be re-read when the
version moves.

  scripts/ci/org-drift-audit.sh

The only org sweep that did not pass --no-archived, so a retired repo still had
its README judged against the org register.

The baseline is raised in the same commit, as the process requires. It covers
real staleness on real repos (causius, diplodoctor, heidi, sbb-fundbuero) plus
the ai-kit gaps that were previously unmeasurable — not the six scaffolds,
which are already deleted.

Known and deliberately not fixed here: version-currency reads only each repo's
ROOT package.json, so kivvi/packages/ai (^0.15.0) and datacat/backend (^0.13.0)
remain invisible to it. Attributing a gap to repo-vs-path changes the report
shape and the fixtures, and folding it in would make this baseline number
un-reviewable.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

* fix(shared-inventory): one red ratchet must not hide the other

Both reports now run before either ratchet, and each ratchet carries
`!cancelled()`. Without it the first failing check ends the job and the second
never runs — reporting green by absence, which is worse than not having the
gate at all.

This was the live case, not a hypothetical: the duplication ratchet was already
red (ai-provider-client 17 -> 19) when the registry gate was added below it, so
the new gate would have been masked from its first scheduled run.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-12 10:03:13 -07:00
CatoandClaude Opus 5 9d572b6abf feat(ci): check that a repo's GitHub metadata agrees with the register (#47)
A repository page is the first thing anyone opens and the surface furthest from
the code, so it drifts first and silently. Measured 2026-09-11 across 44 live
repos: 13 registered apps had NO homepage while the register knew their host,
evig's pointed at revamp-it.ch (not the app), 4 had no description, and one
described a product by a name its own brand file had retired.

None of that breaks anything, which is why it sat there. The register already
knows the canonical host of every deployed app; nothing compared the two.

All of it is fixed, including the four site-factory scaffolds that appeared
during the sweep. Audit now: 49 repos, 25 registered, clean.

CHECKS ONLY THE MECHANICAL CLAIMS — a registered app's homepage is its
canonical host; a live repo has a description. Deliberately NOT whether a name
or description is right: the live <title> is not a reliable product name (a
multi-tenant app serves the TENANT's title; some sites put the brand after a
pipe), and a gate that guesses at prose gets muted. Retirements are enforced
precisely by org-drift-audit.sh against registers/retired.json.

Exceptions are decisions: repo-metadata.allow carries a reason per line. One
entry — hirnli, whose homepage is the PLATFORM's own host while its register
row holds the tenant's, because listing both would make sync-infra emit the
host twice and fail `caddy validate`.

Verified: 17 checks, no network. The judgement is a pure function of
(repos, register, allow) so the fixtures are the shapes that were live today.
Both directions pinned: a clean fleet passes, each defect fails AND is named,
an archived repo is exempt, and a homepage exception does not excuse a missing
description.

The first version of the test printed the live audit and asserted nothing,
because importing the module executed its top-level CLI. The CLI now sits
behind an is-main guard — a test that runs the real thing and checks nothing is
the same shape as a gate that cannot go red.


Claude-Session: https://claude.ai/code/session_01HVudRzEmLqLHvGNqFSpJq6

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-11 04:23:37 -07:00
CatoandClaude Opus 5 82cd576fb5 feat(ci): guard every next-auth app's advertised origin, daily (#40)
Behind Caddy a Next.js app never sees its own public URL, so next-auth builds
sign-in and callback URLs from the INTERNAL origin unless NEXTAUTH_URL (v4) or
AUTH_URL (v5) is pinned in the box env. AUTH_TRUST_HOST=true does NOT cover
this path, which is exactly what makes a broken app look configured.

Nothing 500s when it happens. The site renders, and only Google sign-in and
sign-out are impossible. petvity shipped this, fixed it in petvity#39 around
2026-08-14 with a per-app assertion supposedly added — and on 2026-09-10 was
serving https://localhost:4013/api/auth/callback/google again. The regression
stated itself in public JSON for weeks and nothing read it.

next-auth publishes GET /api/auth/providers unauthenticated, and every entry
carries the app's configured origin, so the detector needs no secret, no login
and no box access: fetch it per site, fail if any signinUrl/callbackUrl origin
is not the origin that served the JSON. 404 is a site without next-auth and
SKIPs; 5xx FAILs, because an auth stack that cannot answer is broken too and
reading "no data" as "no problem" is how this check would certify a dead auth.

Sites come from fleetcrown's footer, the same SSOT ui-defect-audit.mjs reads,
so this adds no second app list and no exclusion list — a repo that is not a
deployment is absent by construction.

Self-tested from captured payloads, both sides pinned: the real localhost
regression is caught, the real repaired payload stays silent. The self-test
runs in this repo's CI and again before each scheduled sweep, because a
detector that has quietly stopped detecting prints a ✓ over a broken fleet.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 16:23:03 -07:00
CatoandClaude Opus 5 ff79e556b5 feat(ci): 17 of 24 repos could not report a CVE, and nothing measured that (#39)
* feat(ci): 17 of 24 repos could not report a CVE, and nothing measured that

surf-your-life.orangecat.ch served Next 16.2.3 — two CRITICAL unauthenticated
RCEs — plus a critical @auth/core flaw and six more high findings. Thirteen in
total, on a live site, for months.

Nothing was ignored. Dependabot alerts were simply OFF for that repo, so GitHub
never raised one and there was no number for anyone to act on. The correlation
across the fleet that day was exact:

  botsmann        alerts ON  -> Dependabot PR #193 took it to 16.3.3 on its own
  orangecat       alerts ON  -> its security job went red, which is how this surfaced
  surf-your-life  alerts OFF -> silence, 1 critical + 6 high

17 of 24 repos were off. The instrument was missing, not the diligence.

WHY THE EXISTING SWEEP COULD NOT SEE IT. version-currency.mjs compares MAJORS
parsed out of package.json ranges: parseMajor("^16.2.12") is 16, blessed is 16,
no gap. Every minor and patch is invisible, and it reads the declared RANGE
while the lockfile decides what ships — a caret that ALLOWS 16.3.4 sits on
16.2.12 forever, because an already-satisfied dependency is never upgraded on
install. Both vulnerable pins returned zero gaps from it. That limit is now
written into its own header rather than left to be rediscovered; the two audits
are complements, not overlaps.

A HARD FLOOR, NOT A RATCHET. Its siblings baseline a count because their
findings have legitimate exceptions. This one has none: a repo with alerts off
cannot report a CVE, so the correct number is zero permanently. A baseline here
would only make "some repos are deaf" an accepted state.

THE POPULATION COMES FROM `gh repo list`. Writing this, I first hand-typed the
repo list from `ls ~/dev` — which invented a repo that does not exist
(~/dev/revamp-info is a checkout whose remote points at bitbaum/hirnli) and
MISSED 17 that do, including every shared package (ai-kit, ai-forms, bip-kit,
limitkit, threadkit, design-tokens) that is published to npm and consumed
fleet-wide. Archived repos and forks are excluded, matching version-currency so
both audits measure the same population.

Ten tests, each a mutation: a repo with alerts off must exit 1, an UNREADABLE
repo must exit 1 rather than pass, and an empty repo list must exit 2 rather
than read as a clean fleet.

All 41 repos now have alerts and automated security-fix PRs enabled; the audit
reports 41/41.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NSLwXsPH8mLYtaM8h3oVto

* chore(ci): the org-drift ratchet fell and its baseline still claimed the violation

`org-drift-audit.sh --check` was failing every PR in this repo — not for
anything in the PR, but because fleetcrown/README.md was fixed and its baseline
line outlived it. The audit is built so that a baseline entry with no matching
violation is itself an error, precisely so the list cannot rot into a claim
about a problem that no longer exists. It did its job; nobody deleted the line.

Unrelated to the Dependabot work on this branch, and separated into its own
commit for that reason. Left alone it blocks everyone.

  46 repos swept, 3 known violations, no new contradictions (was: exit 1).

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NSLwXsPH8mLYtaM8h3oVto

---------

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 15:57:27 -07:00
db9f23c1b4 Add org-drift check to CI (#34)
Gate new contradictions in public docs. The audit scans bitbaum org
repos via gh CLI and fails when a document contradicts registers/org.json.

- Test runs on every PR (same as other audit tests)
- Check runs on every PR (uses GH_TOKEN to scan repos)
- Baseline holds 4 existing violations
- New contradictions fail the build

A new lie cannot merge.

Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Cato <catomean@users.noreply.github.com>
2026-09-09 01:04:40 -07:00
CatoandClaude Opus 5 d950db65e0 ci(auto-merge): fleet's own sweep should use FLEET_PAT too (#31)
Every other repo calls the reusable workflow, whose token line is
`secrets.token || github.token` — so all 30 of them pick up FLEET_PAT now that
the org secret exists. This repo runs the sweep inline, because it IS the
reusable workflow, and so it was the one repo still hardcoded to
secrets.GITHUB_TOKEN.

Left alone, fleet would be the only repo whose queue still drains at the
throttled schedule rather than at CI speed — the exact asymmetry that made the
copies worth deleting in the first place.

Same fallback shape as the callers, so nothing changes if the secret is ever
removed.


Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-08 17:35:25 +00:00
CatoandClaude Opus 5 4d5d5273b8 ci(fleet): audit the shape AROUND the gates, and fix the templates that seed it (#27)
verify-floor-audit.sh asks whether each repo runs the right gates. Nothing asked
whether the pipeline around them was wasteful or unsafe, and on 2026-09-07 that
gap cost real deploys:

  - evig set `cancel-in-progress: true` on a ~13-minute deploy. 4 of its last 10
    deploys were CANCELLED — 40%, against 0% for all seven other repos measured.
    Three cancelled each other in a row and a merged fix needed three attempts
    to reach production.
  - evig's deploy ran `pnpm run verify`: the bundle CI runs, concurrently, on
    the same SHA. The commit was built FOUR times per merge and only the last
    build shipped.
  - Of eight repos measured, exactly ONE restored Next's .next/cache in CI.
    Everyone else recompiled from scratch every run, then the deploy compiled
    again.

Three checks, one per failure, ratcheted like the duplication count: may fall,
may hold, may never rise. Measured now across 32 repos —

  deploy-cancels      0   (was 1; evig fixed today)
  deploy-reverifies   0   (was 1; evig fixed today)
  cold-ci-build      14

The 14 convert as each repo is touched, which is the pattern SHARED.md already
uses for rate-limit adoption; the ratchet holds the line meanwhile. What stops
the number growing again is the other half of this commit: both golden CI
templates now ship the cache step, so a NEW repo is correct by construction
rather than by somebody remembering.

The predicates are deliberately narrow, because a noisy audit gets muted:
  - CI *may* cancel superseded runs — that is correct, and only deploy
    workflows are checked for it.
  - A deploy that is its repo's ONLY verifier is not duplicating anything and
    is not flagged; telling it to stop would delete its gate.
  - A non-Next repo has no .next/cache to restore and is not flagged.
  - Comments are stripped before matching, so a deploy whose comment EXPLAINS
    why it does not cancel is not reported as cancelling.

All four of those negatives are asserted by test-cicd-hygiene-audit.sh, along
with the three positives and both directions of the ratchet — 10 cases against
local fixtures, no network, so it runs on every PR. A predicate that never
matches passes exactly as quietly as one that works; this fleet has shipped
that twice.

templates/ci/README.md gains the reasoning as Rung 5, including the shape worth
copying once a repo earns it: build once, ship the artifact (orangecat, CD 2.5m
against CI 8.0m) — and the warning that the standalone tree must travel as a
TARBALL, because upload-artifact does not reliably preserve the pnpm symlink
farm and a flattened tree dies at boot on @swc/helpers.


Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-07 13:35:52 +00:00
ebef32a482 feat(email): fleet email canary + mail-kit registered as THE email layer (#23)
email-canary.yml: daily key+domain probe against the shared Resend
account, Mondays one REAL delivery to a filtered inbox, Telegram alert
on any failure — the automation that ends the "dead mail cred rots for
months" class (Brevo, found 2026-09-05). SHARED.md registers
@bitbaum/mail-kit (npm, zero deps, never-throwing sendMail) as the one
email layer replacing ~12 bespoke implementations; STACK.md email row
updated to match reality (the 2026-09-02 "Listmonk primary" review
predates discovering the dead SMTP cred) and the AI row closes the
git-pin straggler note (zero remain).


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-05 09:55:14 +00:00
8af048a117 chore(model-pins): install ai-kit from npm — the v0.3.0 git freeze thaws (#21)
The workflow comment said "switch to npm once it has a token"; that day
came 2026-09-04 (@bitbaum/ai-kit@0.6.2). The audit script learns the
scoped node_modules path; the legacy paths stay as fallbacks.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-09-04 16:49:52 +00:00
Mao Nakamoto bc73b2a7e2 chore: remove temporary GROQ_API_KEY hash-debug workflow
Diagnostic served its purpose — the fleet's GROQ_API_KEY secret and
kivvi's dead key share a root but aren't the same value: the secret
looks pasted with its surrounding quote mark included, which breaks
auth on its own regardless of whether the underlying key is valid.
2026-08-31 17:10:20 +02:00
GandMao Nakamoto ae3143cbea debug: temporary workflow to hash GROQ_API_KEY secret (never merged) (#12)
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
2026-08-31 17:09:26 +02:00
3abb6eeeb8 feat(ci): a scheduled source-level nav-contract audit, closing the authed-surface gap (#11)
* feat(ci): a repo-level check for the nav defect the rendered audit can't see

ui-defect-audit.mjs renders each site's PUBLIC entry page — it cannot reach a
sidebar behind a login, which is exactly where the original bug in this
sweep lived. This is the other half: a source sweep run from this repo
against every default branch, the same pattern hosted-supabase-audit.sh
already uses (central, not a copy per repo).

THE RULE IS REPO-LEVEL, DELIBERATELY. A first per-FILE draft — "a file that
renders links and computes an active state must contain aria-current" —
produced 19 findings of which roughly a quarter were wrong, because the
active state and the announcement legitimately live in different files:
evig spreads a helper that supplies the attribute, fleetcrown's parent
passes `current` to a child that announces it, a tab list correctly uses
aria-selected. A gate wrong a quarter of the time gets ignored. The repo-
level assertion — somewhere in this repo, aria-current exists at all — has
no false positive in that class, at the cost of not pinpointing the file. The
rendered audit's job is the per-surface precision a live DOM can give; this
gate's job is coverage no renderer can reach.

Proven live, not just by fixture: on the first real run it named botsmann,
datacat, petvity, printcraft, s-ink and surf-your-life by their genuine
defect (checked against each repo's origin/main before any of them were
fixed), and cleared to green as each was fixed and merged during this same
session.

check:test-nav-contract-audit.sh, the self-test that runs before the sweep,
caught a second real bug in the process: SKIP_FILE's `tabs?\.(tsx|jsx)$` was
unanchored, so it matched any file merely ENDING in "Tabs.tsx" as a
substring — evig's AnalyseTabs.tsx included — and skipped it silently. All
four SKIP_FILE alternatives now anchor to `(^|/)`, matching a whole basename
rather than a suffix. The anchor fix surfaced 7 more nav files across the
fleet that a prior sweep had silently excluded; re-run after fixing, the
fleet is still fully green — the files were skipped, not violating.

Two things a fresh reader would ask, answered in the script itself:

- Two directories are not two repos. fleetcrown/fleetcrown-scripts and
  hirnli/revamp-info are each one repo cloned twice; the loop dedupes by
  origin URL so a finding is not doubled or a merge missed on one clone.
- `set -e` traps: `cmd && continue` is fatal when cmd's grep does not match,
  and `git symbolic-ref -q` on a clone with no default-branch tracking is
  the same trap. Every such probe here is an explicit `if`, not a `&&`.

Baseline file (nav-contract.baseline) ships empty with the ratchet's own
convention: a repo with a genuine no-current-page nav (a single-page tool
whose nav is anchors) gets a line with a reason, decided in a PR, not by
silently going green.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeELB8b3N4JrT2asYL9WvE

* feat(ci): schedule the nav-contract audit — a script alone enforces nothing

nav-contract-audit.sh existed in the previous commit and nothing called it.
A check nothing runs is a suggestion, not a gate — the exact failure mode
SHARED.md already names for the accent-ink and duplication checks.

Mirrors hosted-supabase.yml's established pattern for this shape of audit
exactly: self-test before the sweep, shallow-clone the fleet with
--depth 1 --filter=blob:none (this repo has no package.json on purpose),
FLEET_READ_TOKEN for private repos with the gap stated rather than hidden,
weekly schedule plus workflow_dispatch, findings into the job summary where
a human actually looks.

Proven end-to-end against a real shallow clone, not just asserted: `gh repo
clone --depth 1 --filter=blob:none` sets refs/remotes/origin/HEAD correctly
(verified — some shallow-clone paths do not), and the audit script reads it
and runs clean against the result.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeELB8b3N4JrT2asYL9WvE

* docs(shared): record the nav-contract gate landing, and the discovery gap

The nav contract section described a two-gate plan (rendered audit + a couple
of per-repo checks) as the working state. As of this session there is a
third gate that actually shipped and ran: nav-contract-audit.sh, weekly,
central, self-tested, found and fixed six real repos on its first sweep.
Recorded with the date and the six names, not just "it exists."

Also records a finding the sweep surfaced but should not silently fix:
s-ink, substrata, camille-boulangerie and wild-spirit are all outside
FLEET_SITES, the hand-maintained editorial list that drives the rendered
audit's site discovery. Three of the four are actually on orangecat.ch
subdomains and would match the discovery regex if linked — only s-ink is
genuinely off-pattern (sinktattoo.com). Adding entries to FLEET_SITES is a
product/content decision ("each site's own words," per its own doc comment),
not a mechanical nav fix, so it is written down here for a human rather than
edited as a side effect of this sweep.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XeELB8b3N4JrT2asYL9WvE

---------

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-08-31 12:59:19 +00:00
503f476efa feat(ci): staleness is measured, and the measurement is a ratchet (#10)
The 2026-08-31 fleet audit found the box on an EOL Node, aoz-housing a full
framework generation behind on every axis, and ai-kit pinned at three tags
across seven consumers — one at the pre-org-move OWNER. None of it hidden,
all of it unmeasured. Same lesson shared-inventory encodes for duplication:
writing 'stay current' in a doc is what already failed.

blessed-versions.json is the SSOT (blessed major per key package + the tag
every internal git pin must carry); version-currency.mjs measures every
default branch against it, reports UNCHECKED for anything it could not read
rather than counting it clean, and --check ratchets the total: fall or hold,
never rise. Baseline seeded at the audit's real number: 80.

Self-test pins both sides with the audit's own fixtures (the aoz manifest,
the dead-owner pin) and runs in ci.yml beside the other detector tests.


Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
2026-08-31 08:48:06 +00:00
822297e214 feat(ci): audit the fleet for the Supabase we retired (#4)
The fleet self-hosts Supabase on bitbaum. Two managed-cloud projects are dead —
orangecat's ohkueislstxomdjavyhs, retired 2026-06, and botsmann's
jkjmhtirxwhljpkcfxqe before it. The repos kept describing them in the present
tense.

botsmann's setup doc opened with "Completed Setup" for its dead project and
said to apply migrations by pasting SQL into a supabase.com dashboard. Two
scripts printed the same instruction, one handing out a psql string against
pooler.supabase.com, and the CLI's cache with the old project ref was committed
twice. Nobody pasted anything, its eleven migrations were never applied, and
/api/health served PGRST205 for months while every deploy went green. The docs
were not stale clutter; they were the outage. A wrong pointer to a real-looking
place is worse than no pointer: no pointer makes someone ask, a plausible one
makes them assume it was handled.

The first live sweep found one more of the same shape, which is the argument
for auditing rather than trusting the cleanup: printcraft's seed script
hardcoded the retired host AND omitted `db: { schema }`, so repointing it
naively at the box would have written one customer's rows into orangecat's
`public`. Deleted in bitbaum/printcraft#30.

Central, not a copy per repo — the rule this repo exists to keep. Three repos
use Supabase and thirty do not. botsmann additionally keeps a local
check:selfhost in its own verify, deliberately: it is the repo the outage
happened in, and blocking the commit beats finding it a week later.

Two judgements decide whether this is useful or merely loud, and both are
pinned by 28 tests. It allows supabase.com/docs, because the product
documentation is still correct for us, and your-project.supabase.co, because a
placeholder misleads nobody — a gate that fires on either gets muted. And
legitimate mentions, like a decommission runbook naming what it
decommissioned, live in the baseline WITH A REASON rather than widening the
pattern: a ratchet that may fall or hold, never rise.

Unlike verify-floor-audit.sh this reads local checkouts, because it is a
full-text sweep and GitHub code search returns nothing for these repos — even a
known-present token finds no hit. So the workflow shallow-clones the fleet and
runs the same script unchanged. When it sweeps nothing it says SKIPPED, loudly,
rather than printing a tick: a vacuous pass reads exactly like coverage, which
is the failure this audit exists to prevent.


Claude-Session: https://claude.ai/code/session_018waGt1ieA9TjpscqrbrnGb

Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-08-28 11:00:42 +02:00
Mao NakamotoandClaude Opus 5 f1d5549a36 feat: the fleet's central automation, moved out of dotfiles
The audits, the golden CI templates, the shared-package registry and the
reusable auto-merge sweep now live in a repo whose only job is gating the
fleet. dotfiles goes back to being the environment — a repo holding a .bashrc
is the wrong place for machinery that 16 repos call as a reusable workflow,
and keeping them together made every fleet change look like an environment
change and vice versa (three sessions and the owner collided there in one
week).

Layout is unchanged (SHARED.md, scripts/{ci,fleet,audit}, templates/ci,
.github/workflows), so every script's relative paths still hold. The
reusable sweep now checks out bitbaum/fleet; dotfiles keeps a forwarding
shim so its 16 existing callers keep working unchanged.

All six test suites pass in the new location: shared-inventory 7,
verify-predicates 29, auto-merge-sweep 17, stranded-work 24, worktree-gc 9,
model-pin-audit 102.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01AZCNYHwjEeqxNpYCUk6Yna
2026-08-28 10:10:21 +02:00