mirror of
https://github.com/bitbaum/fleet.git
synced 2026-12-04 17:57:59 +01:00
* 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>
36 lines
3.6 KiB
Plaintext
36 lines
3.6 KiB
Plaintext
# Literals that look copied and are deliberate. repo|path|category|REASON
|
|
#
|
|
# Every entry needs a reason a reader can judge, not a label. An entry that
|
|
# matches nothing is reported by the audit and must be deleted: an allowlist
|
|
# that cannot shrink is a ratchet that cannot fall.
|
|
#
|
|
# `path` may be a glob. Categories: retired-value, public-ip, home-path,
|
|
# consumer-email, arbitrary-hex.
|
|
|
|
# ── the mechanisms that make a rename survivable ─────────────────────────────
|
|
loki|src/lib/register/build.ts|retired-value|the alias map that translates retired slugs into current ones — the mechanism that makes a rename safe, not an instance of drift
|
|
loki|scripts/ci/fleet-refs-audit.mjs|retired-value|the detector for retired GitHub handles has to name the handle it hunts
|
|
loki|.github/workflows/fleet-refs-audit.yml|retired-value|configuration of that same detector
|
|
loki|scripts/hetzner/install-fleet-refs-audit.sh|retired-value|installs that detector with its handle list
|
|
|
|
# ── infrastructure identifiers, deliberately not renamed ─────────────────────
|
|
loki|scripts/hetzner/apps.conf|retired-value|revampit.orangecat.ch is still SERVED as an alias domain of evig, and `revampit` is the database identifier — infrastructure names, like aoz_wohnen, never published copy
|
|
aoz-begleitung|src/lib/auth/constants.ts|retired-value|JWT_ISSUER is a live auth value, not a name: changing it invalidates every signed-in session
|
|
|
|
# ── records of what was true when they were written ──────────────────────────
|
|
fleet|proofs/origin/*.json|retired-value|hash-chained, append-only origin proofs: a past proof naming the old repo is correct history, and rewriting one breaks the chain
|
|
loki|scripts/db/retire-stale-projects.ts|retired-value|an executed migration; its data row records the project names the database actually held when it ran
|
|
evig|src/config/changelog.ts|retired-value|changelog entries describe the site as it stood when they shipped
|
|
evig|public/presentations/*|retired-value|stakeholder presentations preserved as they were delivered, under the name the organisation had then
|
|
hirnli|src/lib/db/migrations/*.sql|consumer-email|an executed migration: the value lives in the database now, and a migration must not change after it has run
|
|
bitbaum|site/map.snapshot.json|retired-value|a cached fetch of loki.orangecat.ch/api/fleet/map, refreshed by the build — editing the cache is overwritten and the fix belongs at the source
|
|
|
|
# ── correct today, and the audit would make it worse ─────────────────────────
|
|
bitbaum|site/overrides.json|retired-value|keyed by the slug Loki's map currently emits for that project; changing the key would silently drop the card's name, stage, tags and ordering
|
|
evig|src/config/org.ts|consumer-email|a documented live decision: evig.ch is not registered and publishes no MX, so the previous address bounced for every would-be buyer. The comment above it says to change this ONE line when the domain is registered and authenticated
|
|
|
|
# ── one machine on purpose ───────────────────────────────────────────────────
|
|
loki|home/projects.ts|home-path|inline selfTest() fixture modelling a laptop dispatch path; not reachable at runtime
|
|
loki|home/render.ts|home-path|inline selfTest() fixture; not reachable at runtime
|
|
dotfiles|.config/zellij/config.kdl|home-path|zellij's KDL config does not expand environment variables; personal machine config
|