Commit Graph
117 Commits
Author SHA1 Message Date
catomean 348e97a8c8 fix(registers): RevampIT is not a client; Kivvi is a product; business-facts check 2026-10-21 20:30:53 +02:00
CatoandClaude bb795fac0e chore(org-drift): bitbaum/CLAUDE.md no longer needs an exemption (#185)
bitbaum#141 rewrote it against the register; the audit finds nothing in it.
The baseline falls by one.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 19:03:24 +02:00
CatoandClaude 78e10b3bd6 fix(auto-merge): a run's own write-back does not need a second verdict (#184)
A deploy that commits refreshed snapshots back to the base moves the tip with
a commit nothing judges (a GITHUB_TOKEN push triggers no workflow). The sweep
then saw an unjudged tip, dispatched CI, that run committed another snapshot,
and the next sweep saw a newer unjudged tip: on bitbaum/bitbaum 2026-10-19 a
snapshot commit and a redeploy every ~6 minutes, each differing only in
map.json's generatedAt, and a green repair PR that could never merge.

When every commit between a completed run's sha and the tip was authored by
github-actions[bot], that run's verdict is the tip's, and the reconciler
treats the tip as deployed. Any other author still needs its own verdict.
Three new cases; 71 pass.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 18:46:16 +02:00
CatoandClaude 0b36171859 chore(live-claims): baseline is empty — every live site says only what is true (#183)
All 18 live sites in Loki's map check clean: no retired host or name, no
forbidden claim, no stale copyright, no dead same-site link. The last finding
(orangecat.ch/ecosystem naming sink.orangecat.ch) was database content, fixed
by orangecat#1350/#1352 and Loki 0118; orangecat#1353 stops that page freezing
until the next deploy.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 15:55:20 +02:00
CatoandClaude 3d976c05f3 chore(docs-truth): baseline is empty — every repo's docs agree with its tree (#182)
After the cleanup PRs across the fleet, the sweep over all 60 repos finds
zero findings. With an empty baseline any new finding in any repo fails the
daily sweep, and the sweep's PR gate already blocks new ones.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:38:55 +02:00
CatoandClaude 498e0dd13e feat(repo-metadata): write a faulted description from the venture's own words (#181)
The reconciler fixed homepages but only reported descriptions, so
bitbaum/bitbaum kept calling itself an "AI-first product studio" behind
FleetCrown — a forbidden claim and a retired name — with nobody able to edit
it. A description that is missing, names a retired form or makes a forbidden
claim is now replaced by whole sentences of that venture's "what" in Loki's
fleet map, the text the studio site already shows, provided the replacement is
itself clean. A description nobody faulted is never touched.

Also: AGENTS.md said the audit runs on every fleet PR; it has been daily since
#179.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:17:56 +02:00
CatoandClaude 63c94f10f6 fix(docs-truth): templates and 'Next 30 days' are not claims (#180)
Found by the orangecat and evig cleanups: NNN_name.sql and providers/[name].ts
are templates in instructions, and a heading 'Immediate (Next 30 Days)' was read
as Next.js 30. A [slug] segment under app/ or pages/ is still a real path.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:04:42 +02:00
CatoandClaude Opus 5.5 9d2af89bdc feat(audits): hold every doc, page and repo page to what is true — and gate new drift in the sweep (#179)
* docs(agents): Loki is the execution plane, not engineering

The plane was renamed 2026-09-20 (orangecat src/config/ecosystem.ts
ECOSYSTEM_PILLARS); this sentence still carried the old label.

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

* feat(audits): hold every doc and every live page to what is true

Agents read README / CLAUDE.md / AGENTS.md / .claude/ before code and act on
them; visitors read pages rendered from components nobody greps. Both drifted
silently: one pass over nine repos on 2026-10-19 found a merge policy said to
live in a repo that no longer holds it, dozens of paths to deleted files,
scripts not in package.json, "Next 15 / TS 5.8 / Tailwind 3.3" in a repo on
16 / 6 / 4, and a retired host presented as production in forty files.

- docs-truth-audit.mjs: holds each repo's docs to its OWN tree — backticked
  paths, relative links, `pnpm run X`, stack majors vs package.json, retired
  names. Never judges prose; a line saying the thing is gone is history.
  Modes: --dir (working tree), --repo, --repo --pr (only what a PR adds),
  --sweep --check (every repo, ratcheted by docs-truth.baseline).
- auto-merge sweep: the docs gate. A PR that ADDS docs drift — including by
  deleting a file a doc still names — is held with one comment per head
  commit naming each line and the fix. Exit 2 (could not look) never holds a
  merge. The sweep is the one workflow every repo calls, so this needs no
  per-repo copy. DOCS_TRUTH=0 opts a repo out.
- live-claims-audit.mjs: fetches every live site in Loki's map (home + the
  pages it links first) and flags retired names/hosts, forbidden claims, a
  past copyright year and dead same-site links. Daily, ratcheted.
- repo-metadata-audit: a GitHub description may not carry a retired name or
  a forbidden claim.
- registers/org.json gains forbiddenClaims; org-drift-audit.sh reads it, so
  the document and served-page gates share one list.
- Workflows docs-truth.yml and live-claims.yml (daily); both test suites run
  per-PR in ci.yml. AGENTS.md states the four gates once; README lists them.

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

* feat(audits): fewer false positives, and homepages follow the register

docs-truth: a removal stated across a line break is history; `cd sub &&
pnpm run x` reads the sub-package; an example path (e.g. …) is not a claim;
a file that describes other repos by design (dotfiles' global CLAUDE.md)
opts its paths out with <!-- docs-truth: paths-elsewhere -->. All four came
from the first cleanup pass over the fleet.

repo-metadata: --fix writes a homepage the register already holds, and
repo-metadata.yml runs it daily with FLEET_PAT before the report — five
homepages were missing or wrong on 2026-10-19 and every fleet PR inherited
the red. Descriptions are prose and stay reported, never written.

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

* feat(docs-truth): a name kept on purpose is marked on its line

<!-- docs-truth: keep — why --> records a deliberate exception (a JWT issuer
that still carries a retired name because changing it signs everyone out)
instead of leaving it as drift the gate cannot tell apart from a mistake.

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

* fix(docs-truth): links in code spans are markup; /file links resolve under public/

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

* docs(templates): AGENTS.md pointer names the local docs check

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

* ci: judge live repo metadata on its own schedule, not per PR

The per-PR --check reads live GitHub state no PR can change; on 2026-10-19 it
was red on every fleet PR over five untouched repos, including the PR adding
the reconciler that repairs them. repo-metadata.yml (daily) fixes homepages
from the register, then reports; the unit test stays per-PR.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-19 14:01:23 +02:00
Cato 3942c8341c Record the retired evig staff-domain and Vercel claims. (#177)
A rename that is only remembered comes back in the next agent brief. These rows are what org-drift checks, and the sweep now also reads the auth doc the brief points at.
2026-10-14 07:29:05 -07:00
CatoandClaude e821c5058d feat(packages): release a package version from one button, and carry new template files to existing repos (#176)
templates/package gains release.yml: workflow_dispatch with bump
(patch|minor|major) or an exact version. It refuses unless main's CI
finished green on the commit it starts from, raises package.json with
`npm version --no-git-tag-version`, runs the package's own verify
(rebuilding the committed dist/), commits "release vX.Y.Z", tags it,
pushes both atomically with FLEET_PAT (a GITHUB_TOKEN push starts no
workflow, so publish.yml would never fire on the tag), and writes a
GitHub release with generated notes. Loki's package page starts it.

Existing package repos never received files added to the template after
they were created. scripts/packages/sync-package-template.mjs offers each
declared repo the template files it lacks as one non-draft pull request
on fleet/template-sync — never overwriting a file the repo has, never
pushing the same content twice, and never reopening a set a person
closed. package-repos.yml runs it after creation.

create-package-repos.mjs now exports templateFiles()/checkTemplate(), and
both scripts refuse a template missing a required file (release.yml
included). CI checks the template's workflows parse with valid shell and
runs the new self-test.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 03:50:07 -07:00
CatoandClaude 910212065c feat(auto-merge): routine Dependabot updates wait 30 minutes before merging (#175)
Loki lets each project's owner choose how package updates arrive and holds
'ask me' updates with a hold label from a 15-minute timer. The sweep wakes on
CI completion, so a lockfile bump whose CI finished first could merge before
Loki held it. A 30-minute grace (two Loki passes) closes that race;
DEPENDABOT_GRACE_MINUTES=0 turns it off.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 03:01:26 -07:00
CatoandClaude 126cf6d07d fix(inventory): fleet packages and root dist/ are not duplication (#174)
The ratchet counted chatkit's own Composer (src + committed dist) as four
chat composers and bip-kit's slug.ts as a slug helper, so extracting a
package read as more duplication. Fleet packages are now skipped the way the
app starter is, read from the derived register so a new package is excluded
the day it is registered; dist/ is excluded at the repo root too.


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 02:25:39 -07:00
CatoandClaude Opus 5.5 92fc62db83 Duplication ratchet: date-utils stops counting *-updates.ts; a rise names its files (#173)
* fix(inventory): date-utils stops counting *-updates.ts; a rise names its files

The ratchet went red on 2026-10-14 with six concerns up and no way to tell
where. Two fixes:

- date-utils was unanchored, so with grep -i '(dates)\.ts' matched
  ballot-updates.ts, auto-updates.ts and useActivityUpdates.ts. Anchor it to
  a path segment.
- The baseline holds counts only, so a failure now prints every file the
  rising concern counts (repo: path).

Tests cover both.

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

* test(inventory): match patterns with a here-string, not a pipe into grep -q

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-10-14 02:15:25 -07:00
CatoandClaude 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>
2026-10-14 01:17:27 -07:00
CatoandClaude 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>
2026-10-11 13:17:41 -07:00
CatoandClaude Opus 5.5 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>
2026-10-11 13:14:17 -07:00
CatoandClaude 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>
2026-10-11 12:49:22 -07:00
CatoandClaude Opus 5.5 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>
2026-10-08 07:32:08 -07:00
CatoandClaude Opus 5.5 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>
2026-10-08 05:36:07 -07:00
CatoandClaude Opus 5.5 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>
2026-10-08 03:40:03 -07:00
CatoandClaude Opus 5.5 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>
2026-10-02 09:04:05 -07:00
CatoandClaude Opus 5.5 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>
2026-10-02 04:58:46 -07:00
CatoandClaude Opus 5.5 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>
2026-09-26 13:22:28 -07:00
CatoandClaude Opus 5.5 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>
2026-09-26 11:45:54 -07:00
CatoandClaude Opus 5.5 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>
2026-09-26 00:50:50 -07:00
CatoandClaude Opus 5.5 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>
2026-09-25 23:48:55 -07:00
CatoandClaude Opus 5.5 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>
2026-09-25 09:36:05 -07:00
CatoandClaude Opus 5.5 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>
2026-09-25 06:32:55 -07:00
CatoandClaude Opus 5.5 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>
2026-09-25 05:54:07 -07:00
CatoandClaude Opus 5.5 4bc7b51534 docs(shared): chat — the standard every chat meets, and a ratchet on composers (#141)
13 chats in 10 repos (2026-09-25), none packaged, each re-learning or missing
the same fixes — most often the mic. SHARED.md now names the reference (loki
/loki, with its four known gaps), a nine-line checklist where every line cites
the repo that already fixed it, and each chat's gaps. AGENTS.md points to it.
shared-inventory gains chat-composer (baseline 5 repos / 6 files); a mutated
baseline (6 -> 5) makes --check fail on it, so the guard can fail.

Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 22:28:30 -07:00
CatoandClaude Opus 5.5 31de29870b fix(scripts): grep -q is never the reader of a pipe under pipefail (#140)
* fix(scripts): grep -q is never the reader of a pipe under pipefail

`echo "$x" | grep -q PAT` under `set -o pipefail` can report "not found"
for text that IS there: grep -q exits on its first match and closes the
pipe, the writer takes SIGPIPE (141), and pipefail makes the pipeline
status 141, so an `if` takes the else branch on a successful match.

It is not confined to payloads past the ~4KB pipe buffer. Measured in
loki (loki#874) on a real 1,158-byte output, 3,000 calls: 2/3000 false
misses for a phrase near the top, 0/3000 via a here-string. Rare per
call; a suite makes hundreds. loki's retire-site suite went red on
exactly those phrases twice this week.

48 copies in 14 scripts here, rewritten to `grep -q PAT <<<"$x"`,
including:
- auto-merge-sweep.sh: the required-check coverage test. A false miss
  marks a green job "uncovered".
- gc-merged-worktrees.sh: `in_use`. A false miss reads a live session's
  worktree as unused. The pushed / clean / MERGED guards still stand, so
  it cannot lose work, but it can remove a directory from under a live
  session.
- cicd-hygiene, nav-contract, org-drift, verify-floor audits and
  verify-predicates: false passes and false findings.

Checked: all 14 files pass `bash -n`; every file is a 1:1 line swap (48
lines); the 8 line-continuation sites keep the here-string before the
trailing backslash; fleet's 30 CI test scripts pass before and after
(30/30 -> 30/30); workflows still parse.

Gate: scripts/ci/test-no-grep-q-in-a-pipe.sh, wired into ci.yml. Scans
scripts/ and templates/, self-tests its detector both ways, and was
proven by restoring the original auto-merge-sweep.sh line.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>

* fix(ci): main was red on a ratchet that fell, and a sweep test lied

Two failures on fleet main that were blocking every PR, including this
one. Neither was caused by the grep -q rewrite: main (7ed94a2, the base
of this branch) failed CI on the same step for the same reason.

1. org-drift ratchet fell. `org-drift-audit.sh --check` failed on main
   since c43464d with "baseline entries with no matching violation - the
   ratchet fell: bitbaum/README.md". Good news: someone fixed that drift.
   Nobody lowered the baseline, so main stayed red and the auto-merge
   sweep refused everything. Line removed; --check now passes (44 repos
   swept, 3 known violations, no new contradictions).

2. test-auto-merge-sweep.sh lied. Its verdict `[ "$FAIL" -eq 0 ]` sat at
   line 400 of 473, with ~70 lines of tests appended after it. A bash
   script exits with its LAST command's status, so the verdict was
   discarded: the suite exited 0 while printing "27 passed, 1 failed",
   and its later tests were not even counted. Verdict moved to the end;
   the suite now counts 38.

   The hidden failure was real and was mine: test 13 asserted the sweep
   always "waits for CI to catch up" when the newest base run is for an
   older commit. The deadlock fix changed that - it waits only while a
   run is in flight, and otherwise dispatches CI. Test 13 now asserts
   both cases (13a waits and dispatches nothing; 13b dispatches and does
   not merge). `rearms()` moved above its first use.

Proven by mutation: an injected late failure now fails the suite;
reverting the sweep to always-wait fails 13b; making it never wait fails
13a.

Gate: scripts/ci/test-verdict-is-last.sh, wired into ci.yml, requires
every suite's verdict to be its file's last command. Proven by restoring
the old mid-file verdict. All 34 fleet CI commands are now green, and
none exits 0 while reporting a failure.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>

---------

Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
2026-09-24 11:58:34 -07:00
Cato 7ddc4d787f ci(currency): reconcile registered unscoped npm packages 2026-09-24 01:31:16 +02:00
Cato 8682f97a5b fix(registry): use published npm versions (#127) 2026-09-23 13:32:11 -07:00
CatoandClaude Opus 5 f114ea0259 fix(auto-merge): the sweep waited forever for CI that could never run (#123)
The green-base guard asks "is there a CI run for the base tip?". For an
automated merge the answer is permanently no: a push made with GITHUB_TOKEN
emits no workflow events, so every merge this script performs lands on the base
and produces NO CI run. `pick_base_run` then falls through to its last resort —
the newest run of all, belonging to some older commit — the sha comparison
fails, and the sweep exits 0.

The re-arm at the bottom of this file is exactly the cure, and it is
unreachable: it is gated on `merged_any`, and nothing can merge while the guard
holds. The block sits upstream of its own remedy. The guard's own comment
predicted this ("with no CI run ever produced by an automated merge, the very
next sweep would block forever") and the re-arm was placed where it cannot
answer it.

Measured on bitbaum/loki 2026-09-22: base CI history stopped on 09-13, every
sweep since exited in ~7 seconds reporting success, and FOUR non-draft green
PRs sat unmerged for up to fifteen days — the oldest opened 09-07. A human
eventually noticed and merged one by hand. A stall that exits 0 is
indistinguishable from "nothing to merge"; this is the fourth time that shape
has cost this fleet real time, after evig (11 PRs, 14h), aoz-begleitung and
ai-kit (9 days each).

The fix does NOT relax the guard. Merging onto an unverified base stays
refused. It supplies the missing evidence instead: when the tip has no run and
none is in flight, dispatch CI for it so the next sweep has a real verdict.
Self-healing, and it fails safe — a red result is then handled by the red-base
path rather than hidden by this branch.

The "genuinely catching up" case is preserved exactly: if any run is still
in flight, it waits as before and dispatches nothing. Dispatching there is what
caused the concurrency-cancellation storm on loki 2026-09-10.

This logic had no test — fleet CI covered it with `bash -n` alone, which is how
a permanent deadlock shipped. scripts/test/auto-merge-sweep-no-base-ci.sh now
drives the real script against a stubbed gh (which it was already written to
tolerate) across all three paths, and is wired into CI. Mutation-tested:
restoring the unconditional exit fails it.

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-22 00:31:49 -07:00
CatoandClaude 6cfb50832d fix(ci): the cap fired on its first run, and my arithmetic was why (#122)
The reconciler's first live run swept 43 repos, found 13 wanting a bump, and
refused to open any of them because the cap was 12.

The plan was entirely correct. The cap was not.

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

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

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

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

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

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

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

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

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


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

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-21 07:02:01 -07:00
CatoandClaude Opus 5 5194a02781 fix(ci): the reconciler workflow was invalid YAML and would never have run (#121)
* feat(ci): internal packages get a reconciler, not another report

THE HOLE

`version-currency.mjs` judges a dependency by its MAJOR — `blessed-versions
.json` is literally called `majors`. That is the right instrument for `next`
and `react`, where a major is the event, and the wrong one for our own
packages, where we ship features in MINORS.

Measured 2026-09-21, `@bitbaum/ai-kit` was published at 1.10.0 and read:

    heidi ^1.10.0 · loki ^1.8.0 · substrata ^1.7.0 · orangecat ^1.6.0
    aoz-begleitung, botsmann, evig, hirnli, surf-your-life, truthseeker,
    vitareba ^1.4.0
    kivvi (packages/ai) ^0.15.0 · sbb-fundbuero ^0.15.0 · datacat (backend) ^0.13.0

Eleven of fourteen behind. TEN of those on major 1 — so the ratchet reported
zero gaps while the fleet spanned seven minor versions of the package that owns
model ids, failover, the three kinds of 429 and now vision routing. A fix
published for everyone reached two repos.

REPORTING IS WHAT ALREADY FAILED

SHARED.md has said "version spread is the metric to watch" and "getting a repo
current is the cheapest work in this file and nobody schedules it" since before
the spread was measured. Both true. Neither moved a version. This file's own
history is explicit that adoption has only ever moved as a side effect of
repairing an outage.

So the reconciler opens the pull request. Everything downstream already exists:
PR → the repo's CI → auto-merge-sweep → CD → box. A green bump ships itself. A
red bump is the useful outcome — it names the repo that cannot take the new
version, which nothing in the fleet tells a package author today.

WHAT IT WILL NOT DO

`@bitbaum/*` only. Auto-bumping someone else's major across the fleet on a
schedule is a different risk and our CI is not a safety net for it; third-party
majors stay with version-currency.mjs and a human.

It never fails a pipeline for being behind. A gate that FIXES what it measures
has nothing to gain from also going red, and a red nobody can clear by hand is
the dead end this fleet's doctrine forbids.

It does not hand-patch a manifest. Every repo installs frozen, so an
API-patched package.json without its lockfile is a PR that fails CI in every
repo every week for a reason unrelated to the bump — and a bot whose PRs are
always red gets muted, taking the real signal with it. The workflow checks the
repo out and lets pnpm write both files.

Capped at 12 PRs per run: a whole fleet going stale at once is likelier a bug
in the predicate than twelve stale repos.

DOCUMENTATION THAT HAD GONE FALSE

Three claims in SHARED.md were still being read as current:

  - "kivvi, orangecat and evig already own model REGISTRIES ... which ai-kit
    does not model" — it does. src/registry.ts carries contextWindow,
    capabilities incl. vision, inputCostPer1M and a live-probed toolProtocol.
  - "ai-kit has no streaming API" — completeStream() + ai-kit/sse shipped in
    v1.9, and src/stream.ts opens by quoting that very row.
  - the transcription row — transcribe() shipped; heidi migrated.

Three reasons repos gave for keeping their own AI layer, all built into the
package and left unclaimed, because the consumers are pinned below the fix.
Corrected in place with what is genuinely still missing (embeddings, a local
provider, image generation, anything not JavaScript) marked deliberate.

The general lesson is recorded there: a reason a repo gave for not adopting
something becomes a FACT in that file the moment it is written, and nothing
re-reads it when the reason expires. Date a reason, or it outlives its subject.

45 self-test checks, no network, no token, no checkout. Both sides pinned: the
same-major drift is caught, a current repo stays silent, and `workspace:*`, a
git pin and `>=1.2 <2` come back untouched — quietly rewriting a range somebody
chose deliberately is the worst bug this script could have.

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

* ci: run the reconciler's self-test, like every other audit's

Caught reviewing my own diff. This repo's CI names each audit's self-test
explicitly rather than globbing, which is the right call — a glob quietly
covers a file that does not exist yet and quietly stops covering one that is
renamed. It also means a NEW audit is uncovered until someone adds the line,
and I had not.

That matters more here than for most: this is the one audit that WRITES.
A scheduled run pushes a branch and opens a pull request in up to twelve
repositories, so its predicates are the last ones that should reach a schedule
unproven. They are pure precisely so they can be proved without a network, and
the proof has to actually run.

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

* fix(ci): the re-arm gate asked a wider question than its own name

It went red on this PR, correctly as written and wrongly as intended:

    internal-currency.yml pushes to main but never re-arms CI
    internal-currency.yml re-arms CI but lacks 'actions: write'

That workflow pushes a FEATURE branch, to a DIFFERENT repository, with a PAT.
Three independent reasons it cannot strand this repo's merge queue, which is
the invariant the gate is named for. What it was actually keyed on was
`grep -q 'git push'`.

The gate is not wrong and is not weakened here. It indexed more than it was
trusted to cover — this file's own recurring shape, recorded about
version-currency and the hosted-supabase sweep in the same table — and the
remedy is the one this repo keeps arriving at rather than an exemption:
narrow the predicate to the invariant, and put it where fixtures can reach it.

Satisfying it literally was the alternative and would have been worse: adding
`actions: write` and a `gh workflow run ci.yml` to a workflow that has no
business dispatching fleet's CI, purely so a grep would pass. A gate answered
that way stops meaning anything.

WHAT NOW COUNTS AS PUSHING TO MAIN

    git push                       the CURRENT branch — on a scheduled run
                                   here that is main.                 COUNTS
    git push origin main           says so.                           COUNTS
    git push origin HEAD:main      same.                              COUNTS
    git push origin "$BRANCH"      an explicit non-main ref       does not,
                                   UNLESS the file sets that variable to main

That last clause is the doorway, and it is pinned: naming your target $BRANCH
must not buy an exemption while `BRANCH: main` sits ten lines above it. Both
the YAML-env and shell-assignment spellings are fixtures.

A comment is also no longer a push. Without that the gate reported ITSELF —
ci.yml quotes the old predicate in the comment explaining it, and was listed
as a pushing workflow.

MOVED OUT OF ci.yml, because a rule that can only be exercised by editing a
real workflow is a rule nobody re-tests after changing its regex. Same
reasoning that put the verify-contract rules in verify-predicates.sh.

Eleven fixtures, no network, red half written first. And the claim the old
inline comment made — "proven by mutation: deleting any of the three re-arms
turns this red" — re-run against the real readings.yml: deleted, red; restored,
green.

The remaining limit is stated in the script rather than implied: a workflow
pushing to ANOTHER repo's default branch is not covered, because it cannot
strand THIS queue, and a gate for it belongs with whatever owns that queue.

All 27 of this repo's CI self-tests pass locally.

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

* fix(ci): the reconciler workflow was invalid YAML and would never have run

I shipped it broken in #120 and the repo had no way to tell me.

`internal-currency.yml` merged to main unparseable. A `run: |` block is a YAML
block scalar, and the multi-line `git commit -m "…"` inside it continued at
column 0, which ends the scalar mid-command. The `gh pr create --body "$(cat
<<'BODY' …)"` heredoc had the same shape.

THE FAILURE MODE IS THE WHOLE POINT. A workflow GitHub cannot parse does not go
red. It does not warn. It is registered with its FILE PATH where its name
should be, and it never runs — not on dispatch, not on its weekly schedule. The
only symptom was `run_workflow` replying "Workflow does not have
'workflow_dispatch' trigger" about a file that plainly declares one, because
GitHub had not managed to read the `on:` block either. Had I not tried to
dispatch it, the first sign would have been a Tuesday cron that quietly did
nothing, forever.

FIXED: both message bodies now go through INDENTED heredocs into files, read
back with `git commit -F` and `gh pr create --body-file`. YAML strips the
block's common indentation, so the bodies and their terminators reach bash at
column 0 as it requires.

AND THE GAP THAT LET IT SHIP. CI validates `templates/ci/*.yml` — on the
reasoning that a broken template fails in another repo, far from here — and
validated nothing in `.github/workflows/`. The repo's own automation, which
defends every other repo's branch, was the unchecked part.

`scripts/ci/check-workflows.sh` now asserts both halves, because they fail
independently:

  1. every workflow parses, and `name:`/`on:`/`jobs:` survive the parse;
  2. every `run:` block is valid shell, extracted exactly as the runner
     receives it.

The second half is not optional. A file can parse as YAML and still hand the
runner something that cannot execute, and the extraction is the only way to see
a `run:` block the way bash will.

TWO BUGS THIS SCRIPT'S OWN TEST FOUND, both worth naming:

  · `out="$(python3 - <<'PY' … PY)"` — a heredoc inside a command substitution
    is not the same thing. Bash warns "unterminated here-document" and quietly
    runs nothing. The gate was passing because it was doing nothing.
  · `bash -n` EXITS 0 on an unterminated heredoc and only warns. Checking the
    exit code alone would have let this exact defect class through a second
    time. It now fails on any stderr, since a clean script prints nothing.

The second one is the reason the test exists. I would have shipped a checker
that could not catch the bug it was written for.

Ten fixtures, no network, red half first — the real flush-left heredoc, valid
YAML with invalid shell, an unterminated heredoc, a missing `on:`, a missing
`name:`; and quiet for an indented heredoc, a `uses:`-only workflow, and
`${{ }}` expressions, which are not shell and must never be parsed as such.
Plus this repo's real 25 workflows and 101 run blocks.

30 of 31 CI checks pass locally; the exception is org-drift-audit.sh, which
needs the `gh` CLI this sandbox lacks and which CI has.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-21 06:56:02 -07:00
CatoandClaude Opus 5 ab0d407c44 feat(ci): internal packages get a reconciler, not another report (#120)
* feat(ci): internal packages get a reconciler, not another report

THE HOLE

`version-currency.mjs` judges a dependency by its MAJOR — `blessed-versions
.json` is literally called `majors`. That is the right instrument for `next`
and `react`, where a major is the event, and the wrong one for our own
packages, where we ship features in MINORS.

Measured 2026-09-21, `@bitbaum/ai-kit` was published at 1.10.0 and read:

    heidi ^1.10.0 · loki ^1.8.0 · substrata ^1.7.0 · orangecat ^1.6.0
    aoz-begleitung, botsmann, evig, hirnli, surf-your-life, truthseeker,
    vitareba ^1.4.0
    kivvi (packages/ai) ^0.15.0 · sbb-fundbuero ^0.15.0 · datacat (backend) ^0.13.0

Eleven of fourteen behind. TEN of those on major 1 — so the ratchet reported
zero gaps while the fleet spanned seven minor versions of the package that owns
model ids, failover, the three kinds of 429 and now vision routing. A fix
published for everyone reached two repos.

REPORTING IS WHAT ALREADY FAILED

SHARED.md has said "version spread is the metric to watch" and "getting a repo
current is the cheapest work in this file and nobody schedules it" since before
the spread was measured. Both true. Neither moved a version. This file's own
history is explicit that adoption has only ever moved as a side effect of
repairing an outage.

So the reconciler opens the pull request. Everything downstream already exists:
PR → the repo's CI → auto-merge-sweep → CD → box. A green bump ships itself. A
red bump is the useful outcome — it names the repo that cannot take the new
version, which nothing in the fleet tells a package author today.

WHAT IT WILL NOT DO

`@bitbaum/*` only. Auto-bumping someone else's major across the fleet on a
schedule is a different risk and our CI is not a safety net for it; third-party
majors stay with version-currency.mjs and a human.

It never fails a pipeline for being behind. A gate that FIXES what it measures
has nothing to gain from also going red, and a red nobody can clear by hand is
the dead end this fleet's doctrine forbids.

It does not hand-patch a manifest. Every repo installs frozen, so an
API-patched package.json without its lockfile is a PR that fails CI in every
repo every week for a reason unrelated to the bump — and a bot whose PRs are
always red gets muted, taking the real signal with it. The workflow checks the
repo out and lets pnpm write both files.

Capped at 12 PRs per run: a whole fleet going stale at once is likelier a bug
in the predicate than twelve stale repos.

DOCUMENTATION THAT HAD GONE FALSE

Three claims in SHARED.md were still being read as current:

  - "kivvi, orangecat and evig already own model REGISTRIES ... which ai-kit
    does not model" — it does. src/registry.ts carries contextWindow,
    capabilities incl. vision, inputCostPer1M and a live-probed toolProtocol.
  - "ai-kit has no streaming API" — completeStream() + ai-kit/sse shipped in
    v1.9, and src/stream.ts opens by quoting that very row.
  - the transcription row — transcribe() shipped; heidi migrated.

Three reasons repos gave for keeping their own AI layer, all built into the
package and left unclaimed, because the consumers are pinned below the fix.
Corrected in place with what is genuinely still missing (embeddings, a local
provider, image generation, anything not JavaScript) marked deliberate.

The general lesson is recorded there: a reason a repo gave for not adopting
something becomes a FACT in that file the moment it is written, and nothing
re-reads it when the reason expires. Date a reason, or it outlives its subject.

45 self-test checks, no network, no token, no checkout. Both sides pinned: the
same-major drift is caught, a current repo stays silent, and `workspace:*`, a
git pin and `>=1.2 <2` come back untouched — quietly rewriting a range somebody
chose deliberately is the worst bug this script could have.

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

* ci: run the reconciler's self-test, like every other audit's

Caught reviewing my own diff. This repo's CI names each audit's self-test
explicitly rather than globbing, which is the right call — a glob quietly
covers a file that does not exist yet and quietly stops covering one that is
renamed. It also means a NEW audit is uncovered until someone adds the line,
and I had not.

That matters more here than for most: this is the one audit that WRITES.
A scheduled run pushes a branch and opens a pull request in up to twelve
repositories, so its predicates are the last ones that should reach a schedule
unproven. They are pure precisely so they can be proved without a network, and
the proof has to actually run.

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

* fix(ci): the re-arm gate asked a wider question than its own name

It went red on this PR, correctly as written and wrongly as intended:

    internal-currency.yml pushes to main but never re-arms CI
    internal-currency.yml re-arms CI but lacks 'actions: write'

That workflow pushes a FEATURE branch, to a DIFFERENT repository, with a PAT.
Three independent reasons it cannot strand this repo's merge queue, which is
the invariant the gate is named for. What it was actually keyed on was
`grep -q 'git push'`.

The gate is not wrong and is not weakened here. It indexed more than it was
trusted to cover — this file's own recurring shape, recorded about
version-currency and the hosted-supabase sweep in the same table — and the
remedy is the one this repo keeps arriving at rather than an exemption:
narrow the predicate to the invariant, and put it where fixtures can reach it.

Satisfying it literally was the alternative and would have been worse: adding
`actions: write` and a `gh workflow run ci.yml` to a workflow that has no
business dispatching fleet's CI, purely so a grep would pass. A gate answered
that way stops meaning anything.

WHAT NOW COUNTS AS PUSHING TO MAIN

    git push                       the CURRENT branch — on a scheduled run
                                   here that is main.                 COUNTS
    git push origin main           says so.                           COUNTS
    git push origin HEAD:main      same.                              COUNTS
    git push origin "$BRANCH"      an explicit non-main ref       does not,
                                   UNLESS the file sets that variable to main

That last clause is the doorway, and it is pinned: naming your target $BRANCH
must not buy an exemption while `BRANCH: main` sits ten lines above it. Both
the YAML-env and shell-assignment spellings are fixtures.

A comment is also no longer a push. Without that the gate reported ITSELF —
ci.yml quotes the old predicate in the comment explaining it, and was listed
as a pushing workflow.

MOVED OUT OF ci.yml, because a rule that can only be exercised by editing a
real workflow is a rule nobody re-tests after changing its regex. Same
reasoning that put the verify-contract rules in verify-predicates.sh.

Eleven fixtures, no network, red half written first. And the claim the old
inline comment made — "proven by mutation: deleting any of the three re-arms
turns this red" — re-run against the real readings.yml: deleted, red; restored,
green.

The remaining limit is stated in the script rather than implied: a workflow
pushing to ANOTHER repo's default branch is not covered, because it cannot
strand THIS queue, and a gate for it belongs with whatever owns that queue.

All 27 of this repo's CI self-tests pass locally.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>
2026-09-21 06:03:42 -07:00
CatoandClaude fbe9cec233 feat(ui-audit): render three widths, because one was never a sample (#119)
The fleet's rendered-defect gate swept 1440x1000 and nothing else. That was
the hole it could not see through, and it cost substrata a header that was
broken at three widths for months while every gate stayed green.

substrata shipped a mobile menu whose panel was positioned against a button in
the middle of the header, so `right: 0` measured from there put 22rem of panel
off the LEFT edge of a 390px screen — the search field and every link label
painted where nobody could see them. Contract rules 1-6 all passed on it: the
links had boxes, cleared 44px, and marked the current page. They were simply
not on the screen, and nothing rendered the screen they were missing from. The
same header hid its entire nav between 768 and 1099px, so an iPad got a lone
"MENU" in an empty bar.

So: 390 / 834 / 1440, overridable with VIEWPORTS. Each is a different branch of
this fleet's CSS — below every breakpoint, in the gap where `md:` has fired and
`lg:` has not, and the desktop already covered.

Two new detectors, and they are contract rules 7 and 8 because the first sweep
found them live, not because they sounded right:

  surf-your-life  "Jetzt starten" crosses the right edge by 93px at 834
  vitareba        "ANMELDEN" crosses by 19px at 834
  kivvi           "Demo anfragen" crosses by 15px, page scrolls sideways 15px

Every one of those is clean at 1440. Rule 3 moves with width too: petvity is
clean at 390 and has three sub-44px targets at 834; datacat has three at 390
and seven at 834; botsmann is clean at both and has six at 1440.

CROSSING the edge is the defect, not being past it — a closed drawer parked at
translateX(-100%) is entirely outside the viewport and is how a drawer waits.
Requiring part on screen and part off separates the two with no list of
exceptions. The floor is 4px, because the sweep found loki's "Get started" one
pixel over, which is rounding and not a clipped button.

A panel is closed on arrival, so nothing measures it. DISCLOSE opens every
<details> in a nav or header by setting the property — no event fires, so
nothing can navigate — and main() clicks up to six button[aria-expanded=false]
with a URL guard, because a click in this fleet may do anything.

The off-viewport rule gets a WIDER root set than rules 1-4, and that is the
finding rather than a convenience: substrata's mobile menu is not inside a
<nav> at all. It is a <details> beside one in the header, which is where a menu
button usually lives. Scoped to <nav> it would have missed the exact defect it
was written for — the fixture caught that before the fleet did.

Findings merge across widths and print once, annotated with every width they
were seen at, so three renders do not treble a report a human reads. Keys
deliberately ignore absolute coordinates: the same crooked stack sits at a
different x at each width, and keying on edges printed one decision three
times.

Also: a site that could not be rendered at ANY width is no longer folded into
the closing check mark. This script's own header says a clean report from a
detector that never looked is worse than no report at all, and it was doing
exactly that.

SHARED.md: rules 7 and 8 with the evidence above; the enforcement paragraph
now describes what the sweep actually does; and the 2026-08-31 "open gap" note
is corrected — s-ink and substrata are in FLEET_SITES now, camille-boulangerie
and wild-spirit still are not.

Self-tests 20 -> 24, all passing: the off-left panel is caught, the anchored
fix stays silent, a closed drawer stays silent, DISCLOSE is pinned separately
so a regression there cannot masquerade as a clean fleet, and a malformed
VIEWPORTS throws instead of silently skipping.

Verified end to end against a live local site and against all 14 fleet sites.
Job timeout 20 -> 30 minutes; the three-width sweep ran in ~8.


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

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

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

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

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

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

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

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-18 08:56:06 -07:00
CatoandClaude Opus 5 cc87f90d91 feat(security): Rung 5's detector existed for two days and nothing ran it (#113)
scripts/audit/secret-in-response.py reads what actually crossed the wire
and reports credential material in it. It shipped 2026-09-15 with nine
test cases covering both directions, a README ending "Exit code is 1 if
anything CRITICAL or HIGH was found, so it can gate CI", and a real
cross-account disclosure to its name: vitareba's GET /api/admin/patients
returning every patient's bcrypt digest, which the code-level sweep had
missed because that route reads findMany() with no projection and a grep
for json(user) shapes does not match json({ success, data }).

Nothing ran it. Not a workflow, not ci.yml, not even its test. That is the
UNCALLED shape the floor audit exists to report, applied to the gate
templates/ci/README.md calls the one that catches what has actually cost
this fleet money — and it sat that way while the README said Rung 5 was
adopted nowhere, which was true only because nobody had looked in
scripts/audit.

WHAT LANDS

  - secret-in-response-sweep.sh: every LIVE app from
    loki:scripts/hetzner/apps.conf (the SSOT, read from its default branch,
    never a local checkout), unauthenticated, three paths, GET only.
  - secret-in-response.yml: daily, both suites before the verdict, Telegram
    on failure, and fixtures-only on a PR because the live verdict is a
    fact about the apps rather than about the change under review.
  - both test suites into ci.yml, where neither had ever run.

First live sweep: 12/12 apps reached, 0 findings.

WHAT IT PROVES AND WHAT IT DOES NOT

Unauthenticated only. The README is explicit that the authenticated pass
is the real test — most interesting routes 401 without a session — and it
needs a live session cookie per app held as a rotating secret. A gate
needing twelve of those is a gate that stops running, so it stays manual
and the workflow says so rather than letting green imply more than it
proves. What it does cover is strictly the worse class: credential
material reachable with NO LOGIN AT ALL.

Still unbuilt: identity taken from the request body, and a query missing
its tenant filter. Both are per-repo assertions with no fleet-level
detector yet.

AND THE SAME BUG AGAIN, IN THE SWEEP WRITTEN TO CLOSE IT

With every host unreachable the sweep announced a clean fleet, having read
zero responses. Its own fixtures caught it before it ever ran on a bad
day. A verdict may only be claimed over what was actually READ: it now
reports scanned N/M, withholds unreachable hosts instead of counting them
clean, refuses to pass when N is zero, and when some hosts are missing
says "the N app(s) reached" rather than "the fleet".

13 aggregation cases, stubbed gh and stubbed scanner, no network.

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

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

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

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

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

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

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

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

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

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

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

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

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

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

## Why it is structural and not a word count

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

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

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

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

## Proven in both directions, and by mutation

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

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

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

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

## Two deliberate details

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

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

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

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

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

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

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

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

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

* chore: re-trigger checks

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

---------

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

---------

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

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

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

fleet: 0 runtime findings.

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

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

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

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

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

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

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

25 assertions pin both directions of every rule against fixtures.

Two fixes in fleet itself:

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

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

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

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

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

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

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

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

---------

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

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

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

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

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

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

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

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

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


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:27 -07:00