Files
loki/scripts/ci
CatoandClaude Opus 5 fefdc64320 fix(register): name the host that actually serves, and stop calling a box path drift (#567)
Three defects, all the same shape: the register recorded an address that was
true once, and something downstream believed it.

1. aoz-wohnen's domain was a REDIRECT, not the canonical host

   The row said `aoz-wohnen.orangecat.ch`. That host only 301s to
   `aoz.orangecat.ch`, which is where AOZ Begleitung actually serves — the box's
   own vhost comment says so ("One product, one URL"), and George settled it
   months ago: "it should consistently be aoz. not wg, not aoz-wohnen."

   This was not cosmetic. sync-infra.sh rewrites /etc/caddy/apps.d/<name>.caddy
   from this field with an unconditional `tee`, so the next sync would have
   emitted a block for the redirect host only and DELETED the aoz.orangecat.ch
   site block — taking a live client's real URL off the air. Fixed by naming the
   canonical host.

2. revamp-info listed a domain that must NOT be generated

   `hirnli.orangecat.ch` is the same app, but it is served by a hand-maintained
   hirnli.caddy (the middleware reads the Host header for tenant chrome). Listing
   it here meant a sync would emit it a SECOND time inside revamp-info.caddy, and
   two site blocks for one address fails `caddy validate` — which sync-infra runs
   immediately before `systemctl reload`, so the reload aborts and every other
   app's pending vhost change silently fails with it.

3. A repo_path on the box was reported as drift, and blocked everyone

   dogfood-site-sep10-1201 was scaffolded directly onto the box, so its
   repo_path is /home/ubuntu/dev/... — a path that cannot exist on the laptop
   however healthy the fleet is. check-deploy-ready.sh called that drift and
   exited 1, failing pre-push for every laptop push, on a register row that was
   correct and a site serving 200. That is the category error this file's own
   header warns about: judging state that is not in front of you.

   Now split by DEV_ROOT: missing under DEV_ROOT is still drift and still fails;
   anywhere else is announced ("not checkable here — repo_path lives on another
   host") and does not fail.

   The CI/CD verdicts were also fixed to count what was INSPECTED, not every
   register row. With one app uninspected they said "all 16 deployed apps have
   it" — absence reading as success, one level up, in the number itself.

The register's `domains` field is provisioning input, not documentation: it must
name the host that serves, and must not name a host that must not be generated.
The register NAME (`aoz-wohnen`), the systemd unit, /opt path and `aoz_wohnen`
database keep the housing-era name on purpose — they are addresses nobody reads,
and renaming them is a migration. The product is AOZ Begleitung; its SSOT is the
app's own brand.ts. Comments now say all of this in the file itself.

Verified: deploy-ready gate 20 passed (2 new cases — a box-side path is
announced and does not fail; the verdict counts only inspected apps),
client-ledger 12, uptime-sweep 66, apply-schema 34.

NOT done here, needs a box change: aoz-wohnen.orangecat.ch's 301 still lives
INSIDE the generated vhost, so a sync drops it (bookmarks break, canonical
survives). It belongs in its own aoz-legacy-redirect.caddy, the way
sink-legacy-redirect.caddy already does it.


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

Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
2026-09-10 12:18:42 -07:00
..