mirror of
https://github.com/bitbaum/fleet.git
synced 2026-12-04 14:18:27 +01:00
011106513da5c2eb10befd25261aa00ea4afdbbe
104
Commits
| Author | SHA1 | Message | Date | |
|---|---|---|---|---|
|
|
011106513d |
feat(packages): a package repo is created by declaring it (#170)
registers/package-repos.json lists the package repos that must exist. On merge (and daily as a retry) .github/workflows/package-repos.yml creates each missing one with FLEET_PAT: it copies the declared source folder, makes it standalone from templates/package (CI, auto-merge, publish, Dependabot, licence), runs the package's own verify, and only then creates bitbaum/<name> and tags v<version>. An existing repo is never touched. An agent session's GitHub integration may not create org repos, which kept searchkit inside orangecat's packages/ folder: consumers pinned to commits, no Dependabot, every release hand-edited into five lockfiles. The first declaration is searchkit. The self-test pins the refusals (bad names, a path that escapes its repo, a package with no verify or no version) and that existing repos are never targets. Rehearsed locally: the standalone searchkit installs, passes its own 32 tests, and builds a byte-identical dist/. Claude-Session: https://claude.ai/code/session_01M6u11m24oVkG98wAVbN7nf Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
0afa30b653 |
templates/app: patched esbuild for drizzle-kit's legacy loader; drizzle/ drift check (#167)
GHSA-67mh-4wv8-2f99 reached the starter's lockfile through drizzle-kit's @esbuild-kit loader and showed as a standing Dependabot alert here. An override gives the loader esbuild ^0.25. The full template check now runs drizzle-kit generate and fails when lib/db/schema.ts and drizzle/ disagree. Claude-Session: https://claude.ai/code/session_01W7K2Gm5wcbfCi7THtmV1Hy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
6c2a700a43 |
templates/app: gitleaks allowance for NEXT_PUBLIC_*, deploy.yml actions: read (#166)
* templates/app: gitleaks allows NEXT_PUBLIC_* values, which every page prints A kickoff writes the Loki widget token to .env.production; it is public by design (data-fc-project in the HTML) and gitleaks' generic-api-key rule would otherwise turn every seeded repo's secret scan red. Default rules stay on. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W7K2Gm5wcbfCi7THtmV1Hy * templates/app: deploy.yml grants actions: read, as Loki's register shim does On a private repo the shared deploy's CI gate cannot read Actions without it and passes every deploy unverified. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01W7K2Gm5wcbfCi7THtmV1Hy --------- Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
131bac3475 |
templates/app: the one starter every new product is created from (#165)
A complete, tested Next.js 16 app — next-intl (en/de/fr, localePrefix "always", parity test, Swiss spelling), better-auth accounts on Drizzle + pg (email+password with verification, magic link via mail-kit, passkeys, TOTP 2FA, the shared bitbaum sign-in and OrangeCat as env-gated OIDC with client_secret_post + PKCE, roles in the app's own users table), nonce CSP with strict-dynamic and connect-src 'self', limitkit on every auth path keyed on the proxy's hop, secrets sealed with ai-kit seal, ai-kit complete() example route, own-model settings, bip-kit roadmap/changelog, /api/health asserting the app can read its own tables, and CI/deploy/live-check/CodeQL/gitleaks/audit workflows. scripts/templates/render-app.sh fills the placeholders; scripts/templates/test-app-template.sh holds the render to the fleet's own judges (version-currency gapsFor, verify-floor predicates, cicd-hygiene audit) on every PR, and the new app-template CI job installs it, runs verify and drives sign-up/sign-in against a real Postgres. STACK.md records the owner's 2026-10-11 sign-in decision: every app owns its accounts and offers every method; it supersedes the 2026-09-11 federate-only rule. SHARED.md and README point new products at templates/app. The duplication ratchet skips the starter itself (the one canonical copy). Claude-Session: https://claude.ai/code/session_01W7K2Gm5wcbfCi7THtmV1Hy Co-authored-by: Claude <noreply@anthropic.com> |
||
|
|
5530931989 |
fix(sweep): re-run a base run marked failure in which no job failed (#162)
On orangecat (2026-10-07, 2 of 45 merges) GitHub never created CI's post-main
job: every real job was green, the run still concluded failure. The guard
refused every merge ('no failing job could be identified') and nothing re-ran
CI, so main sat un-deployed ~25 min until something unrelated did.
A failure with jobs listed and none failed is a non-verdict, like a failure
confined to 'Set up job': re-run it, bounded by MAX_RUN_ATTEMPTS. An empty
job list still is NOT treated as one (case 4: absence of evidence). The jq was
checked against the real stalled run (NO_FAILED_JOB), a real failure (its
steps) and an empty list (nothing). New case 2b, 61/61; mutation-proved.
Claude-Session: https://claude.ai/code/session_01Nx1u7uUWsgi3MagxbmQmPN
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
02c1bd2c5c |
feat(sweep): Dependabot's routine updates merge on green, majors still wait (#161)
Every Dependabot PR was an "outside PR" needing a maintainer's approving
review, so none ever merged on its own: orangecat sat on 26 alerts (2
critical) whose fixes were waiting for a review nobody gives. The owner asked
for that toil to go away.
The review rule is about a stranger's CODE reaching production unread.
Dependabot writes no code, only version numbers, so it is trusted — narrowly
— when all hold:
- the author is the bot itself (login dependabot[bot] AND type Bot);
- only dependency manifests/lockfiles change (a workflow file runs with
the repo's secrets, so Actions bumps still wait);
- no update crosses a major (for 0.x, a minor), read from the
"Bumps/Updates X from A to B" lines, grouped PRs included.
Majors, unreadable PRs and lookalike authors still need a person.
DEPENDABOT_AUTOMERGE=0 opts a repo out. pnpm's minimum release age remains
the guard against a too-new upstream release.
Harness: 8 new cases (60/60). Mutation-proved: dropping the major check fails
the 3 hold cases; trusting any author fails the lookalike case.
Claude-Session: https://claude.ai/code/session_01Nx1u7uUWsgi3MagxbmQmPN
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
3e5b952b6c |
fix(sweep): look for the push-triggered CI run before re-arming (#159)
The re-arm guard checked once, seconds after the merge, before GitHub had listed the run the PAT merge's push had already started. Finding nothing, it dispatched a second run for the same commit, and the CI concurrency group cancelled the first. On orangecat that was 28 of 45 merges (2026-10-02..07): a cancelled run per merge, and the bare deploy reconcilers then found "no green CI for the tip" and left a red CD run behind. It now looks for up to REARM_WAIT_SECONDS (45) every REARM_POLL_SECONDS (5). A GITHUB_TOKEN merge, which triggers nothing, is still re-armed — 45s later. New harness case 19b: the run appears on the second look → no dispatch; mutation-proved (looking once fails it). 52/52. Claude-Session: https://claude.ai/code/session_01Nx1u7uUWsgi3MagxbmQmPN Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
672b0e32c5 |
revert(auth): remove the OrangeCat-only sign-in gate — it enforced the wrong rule (#156)
fleet#139 shipped a daily check that treated every sign-in method other than OrangeCat on our own products as a deviation, built from STACK.md's 2026-09-01 row. George's actual requirement (2026-10-02): every app offers working sign-up and sign-in with email + password, Google, GitHub, X, Facebook/Meta AND OrangeCat. The gate would have raised a Telegram alert the moment an app ADDED Google or GitHub — fighting exactly what he wants. Removed: the audit, its baseline, its self-test, both workflow steps, the SHARED.md row. The origin audit in the same workflow is untouched and its alert text is back to describing only itself. STACK.md's auth row no longer claims enforcement and records the new requirement as under revision; the mechanism (methods hosted once at OrangeCat, or per app) is George's call and is being decided. check-workflows: 26 workflows parse; origin self-test passes. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
792c2d2731 |
ci(auth): own products may only sign in via OrangeCat — enforced, not just written (#139)
STACK.md decided on 2026-09-01 that our own products federate to
OrangeCat and keep no users, passwords or reset flows. The rule lived in
prose, and prose does not stop drift. Measured 2026-09-24 from each
product's live /api/auth/providers:
loki OrangeCat + email-password, github, google, local,
user-password, x-1a (seven ways in)
datacat + credentials
evig + credentials
petvity + credentials, google
surf-your-life + credentials, google
solon, heidi, substrata OrangeCat only
Each extra path is a second identity for the same person, a second reset
flow to secure, and a second place for a sign-out to miss.
own-product-signin-audit.mjs reads the same public endpoint the origin
audit already probes, so it judges what is DEPLOYED — no source parsing,
no secret, no quota. Who counts as ours comes from loki's /api/fleet/map
(owner = org, live, not a demo, not OrangeCat itself). The first draft
read apps.conf and could not see Loki at all: apps.conf omits the
handcrafted services, which is the same reason product-identity-audit
moved to the map. Client apps are never judged — their users belong to
the client, and STACK.md gives them their own auth.
Today's deviations are a RATCHET (own-product-signin.baseline):
- HELD rows print on every run, never read as a pass;
- a NEW provider fails even beside a baselined one;
- a baselined provider that is gone fails until its row is deleted;
- a row for something no longer an own product fails too.
Non-next-auth products SKIP and say this check cannot see them (today:
revamp-info, wild-spirit) — a stated blind spot, not a pass. A 5xx SKIPs
here because nextauth-origin-audit already fails it; paging twice for one
fault teaches people to ignore one of the two.
Runs daily as two steps in nextauth-origin.yml (if: !cancelled(), so a
red origin audit cannot hide it); its self-test also runs in ci.yml.
The Telegram alert text now names both findings.
Self-test: 17 checks, no network. Proved by mutation — tolerating every
extra provider turns three of them red. check-workflows.sh: 25 workflows
parse, 105 run blocks are shell.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
|
||
|
|
b34e61915b |
feat(ci): every npm-installed package must release from a tag (#153)
shared-registry-audit --check now fails when a registered package that consumers install from npm has no .github/workflows/publish.yml. Five packages were released from a laptop npm login; when it went (2026-09-26) none could ship. Adds templates/ci/publish.yml (tag-driven OIDC Trusted Publishing) and the README steps. 62/62 self-tests; live run found paykit, since fixed (paykit#1). Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
272011b004 |
fix(auto-merge): an author with write access is not an outside PR (#151)
* fix(auto-merge): an author with write access is not an outside PR A private repo on the Free plan gets no org secrets, so the sweep runs on the default token, which cannot see PRIVATE org membership: the owner's own agent read as CONTRIBUTOR and every agent PR was held for a maintainer review of itself (bitbaum/farmhouse#2). Ask what the association stands in for: the author's permission on the repo. admin/maintain/write = inside; bots, strangers and an unreadable answer stay outside. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * fix(auto-merge): an author with write access is not an outside PR A private repo on the Free plan gets no org secrets, so the sweep runs on the default token, which cannot see PRIVATE org membership: the owner's own agent read as CONTRIBUTOR and every agent PR was held for a maintainer review of itself (bitbaum/farmhouse#2). Ask what the association stands in for: the author's permission on the repo. admin/maintain/write = inside; bots, strangers and an unreadable answer stay outside. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
2c7ec422de |
fix(ci): render sweep survives a lost browser; baseline lowered to client sites only (#150)
* fix(ci): render sweep survives a lost browser instead of losing the whole run
Twice on 2026-09-26 one crashed renderer ("Target page, context or browser
has been closed") threw out of main() from ctx.newPage and discarded every
site already measured - no report at all. renderWithRecovery rebuilds the
context (and relaunches the browser if it disconnected) and retries the
page once; a second loss is recorded as unmeasured, never clean. Pinned
with a fake context in test-render-sweep.mjs and mutation-checked.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
* chore(ci): lower render-sweep baseline - every own site at 0
Live sweep 2026-09-26 of all 13 own sites at 390/834/1440 after the fixes
deployed: rule3-small-target 0 on botsmann (was 18, botsmann#207),
datacat-web (21, datacat#274), evig (87, evig#510), heidi (12, heidi#139),
loki (24, loki#934), petvity (9, petvity#100), revamp-info (9, hirnli#124),
sbb-fundbuero (18, sbb-fundbuero#89), skif (1, skif#33), solon (16,
solon#193), surf-your-life (18, surf-your-life#82); evig fixed-overlap 3 -> 0
(cookie banner over the Hirn button, evig#510). Only client sites remain.
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>
|
||
|
|
b11dfab519 |
fix(ci): rule 7 spares a link clipped by an on-screen nav scroller; lower bitbaum + camille (#149)
* fix(ci): rule 7 spares a link clipped by an on-screen nav scroller; lower bitbaum + camille MEASURE reported camille-boulangerie's sitekit masthead nav "95px off the right edge" at 390: the link ran past the screen but was clipped by its own overflow-x:auto nav, which ends at 378px. A swipe reaches it and nothing paints past the edge - the exemption render-sweep's offscreen-control already gives a carousel. It holds only while the scroller itself is on screen, and never for overflow:hidden. Both sides pinned in test-ui-defect-audit.mjs and mutation-checked (removing the exemption fails the silent fixture; exempting every scroller fails the off-edge one). What was real on camille - its third section painting as a lone "Ü" - is fixed upstream in sitekit#25. Baseline (live sweep 2026-09-26): bitbaum rule3 44 -> 0 (bitbaum#86), camille-boulangerie rule7 3 -> 0. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> * fix(ci): repo-metadata accepts any host a repo serves, not only its last row aoz-begleitung serves two apps.conf rows since loki#922 (aoz-wohnen in production, aoz-demo). parseRegister let the last row overwrite the first, so the audit demanded the demo host as the product repo's homepage and turned every fleet PR red. The first row is kept for the message; the homepage may be any row's host. Pinned in test-repo-metadata-audit.mjs. 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> |
||
|
|
621878300b |
feat(ci): render sweep — painted layout defects on every live site, ratcheted (#147)
* feat(ci): render sweep - painted layout defects on every live site, ratcheted scripts/ci/render-sweep.mjs renders home + key pages of every served site (loki apps.conf + extraSites; pages in render-sweep.pages.json) at 390/834/1440 and counts per site: nav contract rules 3/7/8 (reusing ui-defect-audit's MEASURE - openButtonMenus is now exported for it), other controls crossing the viewport, fixed/sticky controls on top of each other (incl. the Loki launcher, clip-aware), empty headings and orphan caps labels, numbers split across lines in cells/stats, and uncaught page errors (console errors counted, not ratcheted). Markdown + JSON report. render-sweep.baseline is a ratchet (site x check may fall, never rise), seeded from the first full run 2026-09-25 with substrata at 0 after bitbaum/substrata#112. Public GET pages only: DENY refuses api/admin/auth/cron/job paths before any request; auth walls are reported as not measured. No AI calls. test-render-sweep.mjs pins every check firing AND silent (48 assertions); each core condition was mutated out and failed its fixture. It runs before the sweep in render-sweep.yml (weekly + dispatch). SHARED.md: new section with the sweep and the widget's host contract. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Signed-off-by: Cato <41178744+catomean@users.noreply.github.com> * ci(org-drift): baseline bip-kit README's link to Solon (a reference, not a door claim) bip-kit#40 (merged 14:57 today) links https://solon.orangecat.ch as where bitbaum products take votes; the door check reads any README mention of another app's host as a claim to be it, which turned fleet main's CI red for every open PR. Baselined with the reason, per the audit's own instruction. 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> |
||
|
|
62595ceb84 |
fix(sweep): never ask GitHub for branch-filtered run lists (#146)
GitHub answers `gh run list --branch` from an index that is intermittently weeks stale. On bitbaum/loki 2026-09-25 the same call returned a run from 08-31 on one request and today's on the next. Every stale answer read as "no CI run for the tip and none in flight", so each sweep dispatched CI, which cancelled the run in flight, whose completion woke the next sweep through FLEET_PAT: CI and Deploy re-ran every ~3 minutes on an unchanged main. All three run queries (base CI, deploy label, re-arm guard) now list unfiltered and select headBranch locally. A window holding runs but none on the base is not "no CI history" (that would merge onto an unjudged base): it dispatches CI and defers instead. Tests: 13c (a run for the tip on a PR branch is not the base's verdict) caught that hazard before the guard existed; 13d asserts no run list passes --branch. Mutation: restoring --branch on the base query fails 13d. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
809e2bae03 |
fix(sweep): reconcile against the LIVE commit, not a run label (opt-in) (#145)
GitHub labels a workflow_run-triggered run with the default branch's CURRENT tip. On loki 2026-09-25, Deploy run 36135832127 shipped f2f6206 (the box served it) but its headSha read 4622869 (#913, merged meanwhile). The reconciler read that label as the truth, believed 4622869 was live and never dispatched: merged-but-not-live, invisible to the one mechanism meant to catch it. New optional LIVE_COMMIT_URL (reusable input live_commit_url): a URL answering JSON with a 40-char `commit`. When set, the reconciler compares the base tip against that. Missing, malformed or unreachable is UNKNOWN, treated as not deployed: dispatch, still behind the in-flight and green-base guards. Unset keeps the run-label behaviour exactly. The source used is logged (live vs last run label). Tests: 7 new sweep cases (live == tip, the incident, unreachable, short sha, unknown + in-flight, unknown + red base, unset). Mutation: making the live branch read the label's value fails 4 of them, the incident included. Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com> |
||
|
|
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> |
||
|
|
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 ( |
||
|
|
7ddc4d787f | ci(currency): reconcile registered unscoped npm packages | ||
|
|
8682f97a5b | fix(registry): use published npm versions (#127) | ||
|
|
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>
|
||
|
|
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>
|
||
|
|
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>
|
||
|
|
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>
|
||
|
|
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> |
||
|
|
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>
|
||
|
|
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>
|
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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>
|
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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>
|
||
|
|
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>
|
||
|
|
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> |
||
|
|
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>
|
||
|
|
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> |
||
|
|
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> |
||
|
|
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> |
||
|
|
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>
|
||
|
|
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> |
||
|
|
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> |