Commit Graph
88 Commits
Author SHA1 Message Date
CatoandClaude Opus 5.5 4bc7b51534 docs(shared): chat — the standard every chat meets, and a ratchet on composers (#141)
13 chats in 10 repos (2026-09-25), none packaged, each re-learning or missing
the same fixes — most often the mic. SHARED.md now names the reference (loki
/loki, with its four known gaps), a nine-line checklist where every line cites
the repo that already fixed it, and each chat's gaps. AGENTS.md points to it.
shared-inventory gains chat-composer (baseline 5 repos / 6 files); a mutated
baseline (6 -> 5) makes --check fail on it, so the guard can fail.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:28:30 -07:00
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 7ddc4d787f ci(currency): reconcile registered unscoped npm packages 2026-09-24 01:31:16 +02:00
Cato 8682f97a5b fix(registry): use published npm versions (#127) 2026-09-23 13:32:11 -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 6cfb50832d fix(ci): the cap fired on its first run, and my arithmetic was why (#122)
The reconciler's first live run swept 43 repos, found 13 wanting a bump, and
refused to open any of them because the cap was 12.

The plan was entirely correct. The cap was not.

`MAX_PRS = 12` came from this script's own docblock, which said "Eleven of
fourteen are behind" — arithmetic that contradicted its very next sentence,
since ten on major 1 plus three stranded on 0.x is thirteen. So the guard went
off on a first run it should have passed: the right behaviour for the wrong
reason, and exactly the false positive that teaches someone to raise a cap
without reading the plan under it.

Corrected against the run rather than re-derived by hand:

    13 of 14 consumers behind (only heidi current)
    10 of those 13 on major 1  — invisible to a major-only audit
     3 stranded on 0.x         — datacat backend/, kivvi packages/ai/,
                                 sbb-fundbuero

Note the figure that was NOT wrong: "ten of its fourteen consumers sat on
major 1 with an older minor", in SHARED.md and blessed-versions.json, is
correct and stays. Only the script's own count was off, and only by conflating
"behind on major 1" with "behind".

CAP 12 -> 20, and the test now pins it against reality rather than taste: it
must clear the 13 a real run found, and must stay well under the 43 repos
swept so "the whole fleet at once" still refuses. Raising it again requires
another run's output, and the comment says to name which run.

THE RUN ALSO FOUND DRIFT NOBODY HAD MEASURED. `@bitbaum/mail-kit` 0.1.0 ->
0.1.1 in botsmann, evig, kivvi (apps/web/), loki and surf-your-life. I had only
ever counted ai-kit; the `@bitbaum/*` scope caught the rest, which is the
argument for scoping by owner rather than by package.

And the monorepo paths resolved correctly on the first try — datacat backend/,
kivvi packages/ai/ AND kivvi apps/web/ as three separate manifests. That was
the blind spot SHARED.md recorded about this class of audit, and it is closed.

Still report-only. This change does not open the 13 PRs; it makes the next
`go=true` dispatch able to.

All CI self-tests green locally (org-drift and repo-metadata excepted: they
need the gh CLI this sandbox lacks).


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-21 07:02:01 -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 ad3e76681a fix(ci): audit-health claimed "every audit" over audits it never read (#116)
It printed "✓ every fleet audit ran recently, went green" regardless of how
many it had failed to read. Observed 2026-09-18 announcing exactly that
with two workflows listed under UNREADABLE three lines above it.

Withheld is correctly not a finding — an outage must never be charged to
the thing it obscured — but it is not a pass either, and one sentence was
claiming both the audits it had read and the ones it had not.

This is the same overstatement fixed the day before in
secret-in-response-sweep.sh, which now says "the N app(s) reached" rather
than "the fleet". Writing the rule in one script did not apply it to its
sibling, which is worth noting on its own: the lesson travels by being
re-applied, not by being written down once.

  - some unreadable -> "the N audit(s) READ ran recently, went green" plus
    "M could not be read — this verdict says nothing about them". Still
    exit 0: what was read is still worth reporting.
  - NOTHING readable -> exit 2. A blind watchdog reporting green is the
    exact failure this script exists to end, so it is neither a finding
    nor a pass.

The blind case is guarded on `ok_count == 0 AND unreadable > 0`, because
ok_count is also 0 in a repo whose every workflow is excluded as a
non-audit. "Nothing to audit" and "I was blind" must not share a verdict —
caught by the existing fixture that feeds this script nothing but ci.yml,
which my first version turned red.

Proven by mutation: collapsing the scoped branch turns exactly three cases
red, restoring returns 45 green. Live run confirms it — 17 read and green,
2 named as unread.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 08:56:06 -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 b0f9fd963a fix(automerge): a superseded run is not an un-judged one (#112)
The sweep re-runs a base CI run that "produced no verdict". A cancelled
run with a LIVE SIBLING on the same commit was superseded by that sibling,
not left un-judged, and re-running it is actively harmful: both runs share
the workflow's concurrency group, so the re-run cancels the sibling, the
next sweep sees the sibling as un-judged and re-runs it, cancelling the
first. They take turns until MAX_RUN_ATTEMPTS stops them. It terminates by
exhaustion, not by resolving.

Measured on bitbaum/solon 2026-09-17 across two merges. Six sweeps a
minute apart alternated between the same two ci.yml runs on 2667beb — one
push, one workflow_dispatch — ending at n=341 attempt 3 cancelled and
n=342 attempt 3 success. The Deploy gate failed on a docs-only change each
time because it sampled a cancelled tip and took its terminal branch.

Found by the loki session, whose sweep logs named the path. Worth
recording that the two obvious suspects were both innocent: the post-merge
re-arm block is double-gated (merged_any AND a tip-run-exists skip) and
had re-armed nothing, and the deploy reconciler dispatches Deploy, which
no workflow_run trigger listens for. ci-gate.sh, one directory away,
already draws this cancelled-vs-superseded distinction as its exit 3 — the
correct behaviour was written down before the bug was found.

Narrow by construction: while a sibling is in flight the sweep waits
instead of re-running, and every other path is untouched. A LONE cancelled
run is still re-run, which is what the rerun path exists for.

Proven by mutation: flipping the in-flight test to `== completed` turns
exactly two cases red, and restoring it returns them green.

NOT fixed here, and it is the bigger story: FLEET_PAT is a live bitbaum ORG
secret, so PAT-created dispatches DO emit workflow_run and the no-cascade
invariant the CD design rests on is false fleet-wide. That is what gives
this its once-a-minute clock. loki CLAUDE.md still documents the invariant
as true.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 08:39:21 -07:00
CatoandClaude Opus 5 eea5382065 fix(ci): a workflow younger than its cadence has not 'never run' (#110)
The first real scheduled run of audit-health reported two problems. One
was genuine (email-canary). The other was entity-drift.yml, added by #108
at 07:22 that morning on a '41 6 * * *' cron — the day's tick had already
passed — and this rule charged it seven hours later for failing to do
something the calendar made impossible.

A new rule's first finding deserves more suspicion than its hundredth, and
this is the third time in this file's short life that a rule encoded the
example it was written from rather than the property that example
illustrated: ivy-portal, aoz-begleitung, now this.

A workflow whose FILE is younger than its own cadence is therefore not
counted; it prints 'too new to have run' so the reason is visible rather
than silently skipped. The add date comes from git log --diff-filter=A,
the same file the threshold is already derived from.

Two exceptions keep it from becoming a blanket excuse, both pinned:

  - an OLD workflow that has never run is still a finding;
  - a REFUSED file — the one GitHub lists by PATH — gets no grace at any
    age, because that is a defect and not a calendar.

Verified against the live fleet: 2 problems -> 1, and the one that remains
is the real one.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 07:58:04 -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 350bcebf74 fix(hardcoded): a container's service user is not one person's machine (#103)
The sweep reported orangecat's production Dockerfile for `/home/nextjs/.npm`.
That is the image's own unprivileged user, the same kind of account as ubuntu or
root — not a laptop path baked into shared code, which is what this rule is for.
Added nextjs and app to the service accounts.

Also extends the bitbaum map.snapshot.json entry to consumer-email: the address
sits inside a run summary Loki recorded, in a file the next build overwrites, so
the fix belongs at the source either way — the reason the retired-value entry
already gives.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 02:02:56 -07:00
CatoandClaude Opus 5 8266d46dc5 chore(hardcoded): the audit flags its own docstring, and that is fine (#102)
A Python docstring is a runtime string, not a comment, so the rule sees the
module docstring — which names the rename that motivated the audit. The
explanation is worth more than the silence, so it is allowlisted WITH that
reason rather than reworded into vagueness or exempted by a special case in the
matcher.

fleet: 0 runtime findings.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:55:11 -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 4d80e0de2a chore(identity): baseline 65 -> 36, locking in a win nobody was watching (#98)
Two days of other people's work moved this and nothing recorded it. Measured
2026-09-17 against the live map:

    roadmap     0 missing  (was 14 of 16 — the worst field in the fleet)
    changelog   0 missing
    what/problem/solution/mission/vision   3 each
    orangecat   9 missing
    solon      12 missing

Every product that has shipped now publishes a roadmap and a changelog. That is
the whole reason the audit prints a per-field count rather than one number: the
number moved from 65 to 36 and the shape says where.

Lowering the baseline is what makes it a ratchet rather than a high-water mark —
the audit asks for exactly this every time it runs under budget. Proven by
mutation: 36 passes, 35 fails.

What is left is almost entirely the two platform columns, and the Solon half
stopped being a dead end today: bitbaum/solon#166 gave Solon a way to create an
organization that is not a SQL migration.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-17 01:10:23 -07:00
CatoandClaude Opus 5 6e802338aa fix(sweep): an outside pull request needs a maintainer's review, not only a sign-off (#97)
The contributor gate held an outside PR to one thing: every commit signed off.
That is a statement about licensing. It says nothing about whether the code is
safe to run, and every repository this sweep serves deploys on merge — so a
signed-off, green pull request from a stranger could reach production without a
human reading it.

An outside PR (author not an owner, member or collaborator) now also needs an
APPROVED review, from an owner, member or collaborator, on the commit actually
being merged. The head check matters: an approval on an earlier commit does not
cover a later push. An association the API cannot report is treated as outside,
and a failed reviews lookup counts as no approval — both fail closed.

The two properties get separate switches on purpose. REQUIRE_DCO=0 is for a
repository with its own licence terms and must never also switch off review;
REQUIRE_OUTSIDE_REVIEW=0 exists only so a repository with no deploy can opt out
deliberately. Members are unaffected.

Four tests, mutation-proven: with the review switch defaulted off, exactly
those four fail and the other 24 still pass. Suite: 28 passed.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:27 -07:00
CatoandClaude Opus 5 227fbad30b chore(retired): record aoz-housing -> aoz-begleitung, now that the docs agree (#96)
The last step of the rename, and it had to be last.

The `repo` row makes the old name traceable, and it is also what makes
org-drift-audit.sh police it: from here, any public document on a default
branch that says `aoz-housing` fails the build. That audit judges REMOTE
default branches, so landing the row alongside the doc fixes was unsatisfiable
— it would have judged main, where the docs were not yet fixed, and the fixes
could not merge while it failed. The row is a post-condition on the documents,
not a co-requisite. They are all on their default branches now: fleet#94,
aoz-begleitung#243, loki#732.

It lands with its one baseline exception, and only now, for the mirror-image
reason: without the row nothing flags aoz-begleitung/CLAUDE.md, so an entry for
it would match no violation and org-drift rejects that correctly.

The exception is real, not a shortcut. `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.

Checked before opening, with this row in place: org-drift --check swept 45
repos, 5 known violations, no new contradictions, no unmatched baseline entry.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 13:34:06 -07:00
CatoandClaude Opus 5 28fc7de4ae fix(deploy-freshness): cross-check a stale verdict here too, from one definition (#95)
I put the commit-index cross-check in the reconciler only, reasoning that a
wrong STALE there costs a real deploy while this gate merely reports. That was
the wrong call, and it took about an hour to prove: the first audit run after
the aoz rename went RED on evig, whose tip had a successful deploy-selfhost.yml
run sitting in `actions/runs?head_sha=...` the entire time.

A gate that cries wolf gets muted, and this one guards the single mechanism
between "merged" and "live". "It only reports" is not a reason to tolerate a
false positive in it — reporting is the whole job.

So `deployedByShaIndex` and `runsForSha` move OUT of the reconciler and into
this module, and the reconciler imports them. One definition, not two: the
thing that reports a stall and the thing that repairs one already share
deployFreshness, and splitting the confirmation across both files is exactly
the drift those imports exist to prevent. Their eight assertions move with them.

The audit now asks the commit index before calling anything stale, and says
which index answered when they disagree.

Live run after the change: 21 repos, all deployed, exit 0 — evig included.
Worth being precise: evig resolved through the NORMAL path this time, because
the flake is intermittent, so this run did not exercise the new branch. What
covers it is the moved unit tests and the reconciler's own evig incident.

33 + 25 assertions, none lost in the move (was 24 + 34).


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 06:46:45 -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 083aadc130 fix(reconciler): the clock reported healthy and would never have ticked again (#93)
The timer I installed an hour ago was active, enabled, and dead.

    systemctl is-active   -> active
    systemctl is-enabled  -> enabled
    NextElapseUSecMonotonic -> infinity

OnBootSec=5min and OnUnitActiveSec=15min are MONOTONIC. It ran fine while it
was left alone, but I stopped it to investigate a false dispatch, and on
restart systemd had no next elapse to compute: OnBootSec's trigger point was
hours in the past, and OnUnitActiveSec re-arms from an activation the restarted
timer no longer had. Persistent=true does nothing for a monotonic timer, so it
did not save it either.

So the mechanism built to end "reports healthy, does nothing" failures was
itself one, and would have gone on saying `active` indefinitely while the fleet
stopped being reconciled. Caught only because I read NextElapse instead of
trusting the word `active`.

OnCalendar=*:0/15 is absolute — :00, :15, :30, :45, computable without
reference to boot time or to any previous run, and unaffected by stop/start.
Persistent=true is now meaningful and catches up a tick missed to downtime.
RandomizedDelaySec=45 keeps it off the exact quarter hour.

And the installer no longer reports success without proving the thing will
tick: it reads NextElapseUSecRealtime and fails if there is none. It caught this
class on its first run. The check retries briefly, because the property is not
populated the instant `enable --now` returns and a guard that false-alarms is a
guard that gets ignored.

Verified on bitbaum: next elapse 13:00:44 UTC, and the 12:54 tick dispatched a
run that proved its guards (24 + 34 assertions), surveyed 21 repos and correctly
dispatched nothing.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 05:57:10 -07:00
CatoandClaude Opus 5 ad9b7f57b0 fix(reconciler): confirm against a different index, not the same flaky one twice (#92)
The reconciler dispatched a real, redundant deploy of a repo that was already
live. The box timer's second tick ran it for real, it decided evig was stale,
and it shipped `deploy-selfhost.yml @ main (e2c67d8)` — a tip that had TWO
successful deploys at 05:42:17 that morning, for that exact SHA.

No harm done: the run shipped the identical commit and evig stayed up. But left
running it would have re-fired every fifteen minutes.

I had already seen this flake on datacat and had already added a guard for it,
and the guard was the wrong shape. `actions/workflows/{file}/runs?branch=main`
intermittently returns a page that omits its own newest runs — datacat twice and
evig once inside ninety minutes, each confirmed by a direct probe moments later
returning exactly the runs that had been missing. My guard re-read THE SAME
ENDPOINT. Reading a flaky endpoint twice mostly gives you the same flake twice;
that is repetition, not independent evidence, and I should have seen it when I
wrote it.

`actions/runs?head_sha=<sha>` is a different index — keyed by commit rather than
by workflow and branch — and answers the question actually being asked: has this
commit had a successful deploy run? On evig's tip it returned the
deploy-selfhost.yml success the other endpoint had just denied. confirmedStale
now consults it first, matching runs by workflow path basename so a green CI run
is never mistaken for a deploy.

34 assertions, 4 mutants killed: counting any successful run as a deploy,
accepting a non-success conclusion, accepting a run still in flight, and making
the confirmation inert.

The third is worth recording. My first version of that assertion SURVIVED its
mutation: `status === "completed"` was never exercised, because a non-terminal
run reports `conclusion: null` and failed the conclusion check anyway — an
untested branch that looked covered. It now uses a run that is unfinished but
already claims success, which is the anomaly the check exists for.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 05:52:49 -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 5bbdd66625 feat(reconciler): re-run CI for a tip that can never go green (#89)
* fix(reconciler): make a stale verdict survive being asked twice

Two dry runs twenty-five minutes apart disagreed about datacat. The second
called it STALE and would have dispatched a deploy; the same code path, re-run
immediately afterwards against the same unchanged tip, said DEPLOYED — and the
tip did have a successful Deploy run for its exact SHA, from 05:22 that
morning. Nothing about the repo changed across the three reads.

The likeliest mechanism is the one behind every other bug in these two files:
`actions/workflows/{file}/runs` is eventually consistent, and a reply from a
lagging replica that omits the newest run is indistinguishable from a repo that
never deployed. A window is not an absence; neither is a stale replica.

A wrong STALE is not a wrong report here — it is a redundant deploy of a repo
that is already live, which on a client site is a real production event
triggered by a phantom. So the verdict is re-read immediately before acting and
must still be STALE. Two reads is not a proof, since a replica can lag twice,
but it converts a common transient into a rare one for one API call per repo
actually being shipped. A re-check that cannot be read is not a confirmation
and so is not a deploy.

Dry run after the change: 21 surveyed, 0 to ship, datacat no longer flagged.

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

* feat(reconciler): re-run CI for a tip that can never go green

loki today: concurrency cancelled BOTH CI runs for main's tip, so all SIX of
its Deploy runs `skipped` — the chained trigger requires
`workflow_run.conclusion == 'success'`, and that green run could never appear,
because nothing in the fleet re-runs a cancelled CI. The tip sat unshipped for
over two hours and would have sat there indefinitely.

shouldDispatch refuses to deploy that, and the refusal is right: shipping an
unverified tip to clear a stalled deploy turns a stall into a bad release. But
refusing is not repairing. A reconciler that only ever declines leaves the repo
exactly as stuck as it found it.

Re-running CI is the remedy that matches the fault, and it is a categorically
cheaper action than deploying: it publishes nothing, changes nothing on the box,
and is idempotent. If it goes green the ordinary chain ships the tip; if it goes
red, the tip SHOULD be stuck and now says so out loud.

It fires only on the no-green-run case. Not on a RED tip — a broken build is not
repaired by running it again, and retrying red every half hour is a CI
amplifier, not a fix. Not while a run is in flight. Not on a repo that is live
or still inside the window. Capped at 3, deliberately tighter than the deploy
cap of 5: a stalled deploy is self-limiting, an org-wide CI re-run loop is not.

The CI workflow filename is discovered per repo (ci.yml, else the workflow whose
`name:` is CI) rather than assumed — hardcoding it would silently re-run nothing
in the repos that spell it differently, the same shape as hardcoding `main` as
the default branch, which reported two repos as never deployed.

25 assertions, 4 mutants killed: re-running a red tip, ignoring the in-flight
guard, making the repair inert, and re-running already-deployed repos. The live
path is not exercised by the dry run because no repo is currently stuck that
way — loki was repaired by hand before this existed.

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 05:21:53 -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 3b2661350c chore(identity): baseline 63 -> 65, because heidi became visible (#86)
heidi serves 200 and its register row said `prospect`, so every rule in this
audit skipped it. Corrected in loki#727, and heidi is now one of 17 shipped
projects rather than 16 — which is the ratchet working exactly as intended: it
went red on its own before anyone raised it.

It costs 2 gaps, not 8. heidi had NONE of the four identity attributes; they
were written to its Loki profile from HEIDI.md through the sanctioned
scripts/apply-project-attrs.ts and are live on /api/fleet/map, so what is left
is a roadmap and a Solon organisation.

That is the point of raising a baseline in a commit rather than a config sweep:
the number moved because a product stopped being invisible, and filling four of
its six fields first is the reason it moved by 2.

Roadmap is now missing on 15 of 17 and Solon on 12 — still the two that matter,
and still for the same reason: there is a publishProjectToOrangeCat() path and
no Solon equivalent.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 04:47:52 -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 5960621749 chore(ratchet): rate-limit 13 → 11, and stop counting a repo we could not read as progress (#84)
The 2026-09-15 cleanup campaign moved seven repos off hand-rolled rate
limiters. Verified on each repo's DEFAULT BRANCH, merged only:

  botsmann        #198 merged 08:24Z  2 limiter files → 1 (lib/middleware/rate-limit.ts deleted)
  evig            #488 merged 05:42Z  3 → 2 (src/lib/auth/rate-limiter.ts deleted)
  petvity          #95 merged 09:09Z  1 → 1 (hand-rolled body replaced by limitkit)
  surf-your-life   #70 merged 06:33Z  1 → 1 (same)
  truthseeker      #54 merged 06:46Z  1 → 1 (same)
  kivvi            #96 OPEN (draft, client)     — NOT counted
  aoz-housing     #242 OPEN (client)            — NOT counted

rate-limit 13 → 11 files. Only two files left because five adopters keep a
thin local module holding their own limit values and call limitkit from it —
the intended shape. The row was lowered by hand rather than by --update,
because --update would also have absorbed the logger rise below.

logger is LEFT RED at 6 while the fleet sits at 7, deliberately. The extra
file is datacat's backend/lib/logger.js, created the same day by datacat #271
("one logger") — a repo with no matching file now has exactly one, so a
consolidation scores as a rise. The offsetting fix exists and is unmerged:
kivvi #96 takes kivvi from two loggers to one, which returns the count to 6
on its own. Raising the baseline now would retire the only pressure on it.

The counting half was also lying. `gh api .../git/trees` was `|| continue`,
so any transient failure dropped a repo silently and that repo contributed
zero files — indistinguishable from a repo that deleted its duplicate. One
sweep over 43 repos dropped NINE and showed phantom falls in email-send
(7 → 4), health-route (13 → 11) and slug-util (4 → 3); none had happened.
Now it retries with backoff, names what it could not read, and refuses to
judge OR to write a baseline from an incomplete read — the same guard the
truncation case already had. Six new self-test cases pin both directions.

SHARED.md, next to the limitkit row:

  - install is `pnpm add limitkit@^0.2.0` (npm, verified 0.2.0), not the
    `github:` form: under pnpm 11 a git dep's `prepare` build is refused
    without an allowBuilds entry, so the package installs with no build
    output and the adopter's CI fails on an import resolving to nothing.
    heidi is still pinned to the github: form and will hit this next rebuild.
  - the security finding, because it recurred SEVEN for seven: every
    hand-rolled limiter keyed its bucket on the FIRST X-Forwarded-For hop.
    That hop is written by the caller, so a client sending a fresh value per
    request got a fresh bucket per request and was never limited — the
    limiter was decorative. The last hop is the one the trusted proxy
    appended; limitkit's clientIp() reads that. vitareba has no IP-derived
    limiter at all. botsmann's additionally FAILED OPEN on any database
    error, switching itself off under exactly the load it existed for.
  - adopter count from registers/packages.json, not by hand: eight
    (botsmann, evig, heidi, loki, orangecat, petvity, surf-your-life,
    truthseeker). The prose claiming orangecat unified "without limitkit" is
    now contradicted by its own package.json — corrected in place.

Also corrected: SHARED.md and README both claimed the ratchet "runs on every
PR here". It does not — a PR runs only the network-free self-test; --check
runs weekly. A gate described in the wrong place is a gate nobody checks.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 04:18:49 -07:00
CatoandClaude Opus 5 9c34c592b8 fix(deploy-freshness): three ways this audit reported a blind spot as a verdict (#83)
Merged an hour ago and already wrong in three places, each the same shape:
something it could not SEE, reported as something that was not THERE. A gate
that cries wolf gets muted, and this one guards the single mechanism standing
between "merged" and "live" for most commits here.

1. A WINDOW is not an absence. It read `actions/runs?per_page=40` and filtered
   by name; on a busy repo that window is all CI and auto-merge, so a healthy
   Deploy from two days ago falls off the end. aoz-housing was flagged with its
   newest Deploy green. Now each deploy workflow is asked for its OWN runs.

2. `main` is not every repo's default branch. aoz-housing and sbb-fundbuero are
   on `master`, so it asked for runs on a branch that does not exist there, got
   none, and called both never-deployed. Branch now comes from the repo.

3. An ERROR is not an empty list. A single `unexpected EOF` was swallowed into
   zero runs, which reads as "no successful Deploy run on record". `gh` now
   retries transport failures only — a 404 is an answer — and a repo that truly
   could not be read says COULD NOT READ (not a verdict), never a clean row.

And the deployer predicate, which I got wrong twice in OPPOSITE directions:
matching the filename alone caught this audit's own deploy-freshness.yml, so
fleet — which deploys nothing — was a deploying repo with no deploy; requiring
the body to name selfhost-deploy.yml or deploy.sh then excluded loki, whose
deploy.yml ships inline, dropping the control plane out of its own audit while
it held seven successful deploys. A false negative is the worse direction, so
the rule is now include-by-name, exclude-only-what-is-proven-not-to-deploy, and
it lives in a pure exported `isDeployerSource` with both directions pinned by
the real files that fooled each version. Three mutants killed.

Fleet-wide result: 21 repos judged, zero unknown, and one true finding it would
otherwise have missed — loki's tip 56m undeployed, every chained Deploy skipped
because both of its CI runs were cancelled by concurrency.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-15 04:12:48 -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 97da8a75d9 feat(ci): the auto-merge caller is a template, and a miswired caller turns hygiene red (#77)
## What the inventory showed

Read every bitbaum repo's `.github/workflows/auto-merge.yml` from its default branch via the API (not local checkouts): 33 repos carry one. **32 are already callers of `auto-merge-sweep.yml` (`workflow_call`)**; the 33rd is this repo, which runs the script inline because it *is* the reusable workflow. The ratchet in `shared-inventory.baseline` already reads `automerge-script 1 1`. So the consolidation the SHARED.md row still described as "6 remaining, datacat/petvity/solon convert when clear" finished a while ago — that row was stale, and the caller was documented nowhere in `templates/ci/`.

Eight repos across six caller shapes (heidi, ai-kit, sbb-fundbuero, datacat, petvity, solon, evig, orangecat) were checked to actually *run* the reusable job today: each latest Auto-merge run has the nested `sweep / sweep` job checking out `bitbaum/fleet` and executing `Sweep`.

## What it also turned up

- **dotfiles** declared `secrets:` twice under the same job. GitHub refused the file: the workflow is listed by its *path*, every run since 2026-09-13 is a zero-job failure, and the repo has merged nothing — silently. Fixed in bitbaum/dotfiles#69.
- **substrata** and **camille-boulangerie** re-armed a `publish.yml` neither repo has; the sweep dispatched it after every merge and logged an error. Fixed in bitbaum/substrata#36 and bitbaum/camille-boulangerie#34.

## What this PR does (all additive)

- `templates/ci/auto-merge.yml` — the caller, with `CHANGEME` lines, so the next repo copies a template instead of a neighbour.
- `templates/ci/README.md` — "Auto-merge: call it, never copy it": the snippet, an inputs table with what each wrong value looks like, and the findings above.
- `scripts/ci/cicd-hygiene-audit.sh` — a fourth ratcheted check, `automerge-miswired`: a duplicate mapping key, a job that neither calls the reusable workflow nor runs the canonical script, or an input naming a workflow file the repo does not have. Baseline `0` (the three findings have PRs open; see below).
- `scripts/ci/test-cicd-hygiene-audit.sh` — six new mutation cases, both directions: fires on the dotfiles shape, the substrata shape and a hand-rolled job; stays quiet on a sound caller (including two `- cron:` list items, which a naive key counter would flag), on fleet's own inline run, and on a repo with no caller at all. 16/16 pass. Run over the real 33-repo inventory it reports exactly the three known cases and nothing else.
- `SHARED.md` — the row now says 1, and why.

If `--check` runs before the three repo PRs merge it will report `0 → 3`; they are green one-liners and should be in before Monday's scheduled run.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 22:49:48 -07:00
CatoandClaude Fable 5.1 6c1bfd2f01 feat(registers): origin.json names the originator the share rule pays (#76)
Solon's originator_share v1 pays "the first-commit author recorded in the
origin register", so the register now carries it: firstCommit.author is what
GitHub reports (login, or the commit's author name when unlinked) and
firstCommit.originator resolves it through registers/org.json's new
originatorAliases. The first live read showed why the map is needed — five
author strings across 45 repos (catomean, Mao Nakamoto, George, Cato, and
one unconfigured git default "Your Name"), all one person. Without the map
the rule would have paid five originators for one. An unmapped author is
their own originator, pinned by test; that is the point of the rule.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 22:12:27 -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 cae2df179d chore(ratchet): raise health-route 12 → 13 and ai-provider-client 17 → 19, investigated (#73)
`shared-inventory.sh --check` has been red since the rises landed through
repos the gate cannot reach. The first hypothesis — that the FleetCrown →
Loki rename double-counted a repo — is wrong: GitHub renames in place, and
the repo list holds `loki` alone (no `fleetcrown`).

What actually rose, dated by first commit on each path:
- health-route 12 → 13: substrata added app/api/health/route.ts on
  2026-09-14 11:23 UTC (heidi's, 2026-09-10, was the 12th and already in
  the baseline). Its assertion is the research meter; per SHARED.md the
  health-route envelope is deliberately not extracted, so raised, not
  absorbed.
- ai-provider-client 17 → 19: both files in heidi, after the 2026-09-11
  baseline — lib/auth/provider.ts (an OIDC config) and
  lib/domain/model/providers.ts (a BYOK vendor allowlist that uses ai-kit,
  which heidi installs). Neither is a hand-rolled caller; the path pattern
  cannot tell an auth provider from an AI one. Raised knowingly and said
  so in SHARED.md rather than narrowing the pattern in the same PR.

--check is green again: "duplication did not increase (inspected 44 repos)".


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 05:42:41 -07:00
CatoandClaude Fable 5.1 96e702a384 docs(contributing): the terms live in bitbaum/.github; the template is a pointer (#71)
GitHub shows an org's .github/CONTRIBUTING.md on the PR form of every repo
without its own, so one file there covers the fleet and a copy per repo would
be exactly the drift this repo exists to prevent. The template now says so
instead of carrying the text.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 05:09:44 -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 6bbbe143a9 feat(sweep): the contributor gate — outside PRs merge only with a DCO sign-off (#69)
"Open for as long as it makes sense" is a relicensing option, and it stays
open only while every contribution carries a licence grant. The auto-merge
sweep is the one place every repo's PRs pass through, so the terms are
enforced there: a PR from outside the org merges only when every commit is
Signed-off-by, which under templates/CONTRIBUTING.md certifies the Developer
Certificate of Origin and a grant to relicense. Members are exempt — agents
commit under Cato's own identity. REQUIRE_DCO=0 turns it off per repo.

Five tests against the fake gh pin both directions; the fake's commits
fixture also had to learn that `${VAR:-{...}}` closes at the first brace.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-14 04:51:58 -07:00
CatoandClaude Fable 5.1 c637b0bd23 fix(origin-proof): two stamps in one second must not share a filename (#68)
Manifest names are second-resolution and the chain is ordered by name. On
CI's faster runner the shrink test's second stamp landed in the same second
as the one before it, overwrote it, and broke the chain link — the suite went
red on #67 after it had merged. The script now waits for a free name; the test
no longer sleeps before that run so the collision path is exercised.


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

Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
2026-09-13 18:55:24 -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 89d631e2f9 feat(fleet): find local branches that exist only on this disk (#64)
stranded-work.sh examines each checkout's CURRENT branch. A branch that was
never pushed and is not checked out is invisible to it — which is exactly the
work GitHub cannot see, the thing that guard exists to find.

First run: 243 such branches across 24 repos, 564 commits. Most are old and
superseded. Some were not. A 1.1 GB clone nested inside fleetcrown looked
entirely redundant — clean tree, nothing unpushed on its checked-out branch —
and held three commits from the previous day on a DIFFERENT branch with no
remote ref. It was one `rm -rf` from gone.

  A clean tree is a statement about one branch. It says nothing about the
  other forty in the same repository.

Three filters, all needed. Commits absent from the default branch, by patch id.
No remote-tracking ref. And no PR ever opened from the branch name — because
`git cherry` cannot see a squash-merge, which rewrites several commits into one
with a different patch id, so a merged branch scores "absent" forever. Without
that third filter the report is mostly work that shipped weeks ago. The
converse is not covered: a PR opened from a different branch name still reads
as orphaned, so the count is an upper bound and the output is a list to look
at, not a verdict.

--days narrows to recent work, and --push preserves it without opening a PR, so
nothing merges and nothing deploys. --push without --days is refused: pushing
every orphan would put hundreds of stale refs across the remotes.

Fixture branch names (stale, other, main, master) are never reported and never
pushed. Publishing a fixture is how a pre-push hook once force-pushed test data
over main.

15 tests against real git repos with real remotes. Two of them are a regression
guard with a story: while being written, this suite ran `git -C "" add -A` and
`commit` inside the real fleet checkout, because make_repo aborted on a `local
name="$1" dir="$TMP/$name"` that is not reliably in scope under `set -u`, and
returned an empty path. It swept two untracked files into a fixture commit,
created six junk branches and pushed one to the remote. All cleaned up. git_q
now refuses any path that is not under $TMP, and the EXIT trap — inherited by
every $(...) subshell — only fires in the process that made the directory.


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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-13 05:25:50 -07:00