Deploy (every fleet site, via selfhost-deploy.yml):
- page-check.mjs gets one 90s deadline for the whole look. On a host that
accepts and never answers, goto gave up at 45s and the next call waited
on the pending navigation forever; farmaciadelparco's deploys #3 and #4
sat in "Look at the live page before the deploy" until the job's 45m
limit. Verified against a never-answering socket: records "did not load"
at 90s and exits 0; a normal page still checks in ~3s.
- timeout-minutes on both page-check steps as the backstop.
Project page:
- deriveBuildStatus: agent_running=t is a live process, not a live build.
After a run closes Claude Code idles at its prompt, so the page said
"Building now · An agent is working" beside "Finished · PR #1 merged".
Building now needs an open run, or a prompt given after the last close.
Claude-Session: https://claude.ai/code/session_014d9r6dNr1vW789Q75hPcHF
Co-authored-by: Claude <noreply@anthropic.com>
* wip(sites): sleep-when-idle building blocks (not wired in yet)
Adds the status list and idle time (_box-env.sh) and the pure generators
(lib.sh: sleeps_when_idle, wake_inner_port, sleep_app_unit, wake_socket_unit,
wake_proxy_unit). Nothing calls them yet: sync-infra.sh is unchanged, so no
site's units change. Wiring them in waits on the owner's go-ahead.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191FbipnTCBDKHiKftp9W7B
* feat(sites): sites that are not live yet sleep when idle
Every site ran around the clock with up to 1 GB, which capped the 16 GB box at
roughly 50 sites however rarely they were visited. A site whose register status
is prospect, demo, validating or unverified now sleeps: systemd listens on its
port, the first request starts it (a second or two), and it stops after 15
idle minutes. Live sites (clients, products, evig, the 4001-4004 services) are
untouched; a row that becomes live is switched back to always on on its next
sync.
- sync-infra.sh: for a sleeping row, the app listens on port+20000 and is bound
to <name>-wake.service (systemd-socket-proxyd --exit-idle-time) behind
<name>-wake.socket on the public port. Caddy and deploy.sh keep talking to
127.0.0.1:$PORT, so neither changes; a deploy's restart pulls the proxy up.
Falls back to always on, out loud, if the box's proxyd lacks idle exit.
- install-watchdog.sh: a sleeping site is checked by its socket, not by a
request every 5 minutes (which would keep it awake forever).
- uptime-sweep.sh: sleeping sites are health-probed on the first sweep of
00/06/12/18 UTC instead of every 15 minutes, so botsmann's kind of outage
is still caught within hours; certificates are still checked daily.
- Sync sites workflow: re-applies sync-infra.sh to named sites and checks each
one answers — the rollout for sites already on the box.
Tests: test-sleep-when-idle.sh runs sync-infra and the watchdog installer end
to end against a recording ssh; test-uptime-sweep.sh covers the 6-hourly probe.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0191FbipnTCBDKHiKftp9W7B
---------
Co-authored-by: Claude <noreply@anthropic.com>
Moves chatkit from the f9f906b commit to the merged 0.4.1 commit, which adds
@bitbaum/chatkit/attach and the chatkit-check-file-inputs bin. `verify` now
runs `check:file-inputs` over src and widget: any file input whose accept
mixes image and document families (the shape that hid screenshots behind
Android's capture-app chooser) fails CI. Dependabot groups @bitbaum/*
releases into one PR.
Pinned to the commit until 0.4.1 is on npm (trusted publisher not configured
yet); then it becomes ^0.4.1.
Claude-Session: https://claude.ai/code/session_01BWXjqiHm8jFta4FXuc7Tck
Co-authored-by: Claude <noreply@anthropic.com>
* feat(selfhost): a copy of Loki is a copy — own hostname, own OrangeCat, a complete env contract
- APP_DOMAIN reads NEXT_PUBLIC_APP_DOMAIN (fallback loki.orangecat.ch), so
callbacks, emails and copy carry a fork's own name; brand-sync still
holds the shell mirror to the fallback.
- orangeCatProjectUrl() in config/orangecat.ts replaces the literal
https://orangecat.ch/projects/… in three components, built on
NEXT_PUBLIC_ORANGECAT_URL.
- .env.example names every variable src/ reads — 68 were not named, so a
fork found Google sign-in, embeddings, the Telegram bot or the daemon
token only by grepping process.env — each with the file that reads it,
and scripts/test/env-example-covers-src.ts (picked up by test:unit) fails
when one is missing. A comment that mentions a variable is not a read.
- README: "Run your own copy" — docker compose up, /setup, hostname,
optional OrangeCat, agents on your own machine, the env contract; the
name and identity are not part of the licence.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TtBnGxwf5ddXTzRNyjHVP7
* fix(deploy): hand the newly declared NEXT_PUBLIC_* to the build, readers treat "" as unset
public-env-inlined on 070f951b: declaring NEXT_PUBLIC_APP_DOMAIN,
NEXT_PUBLIC_LOKI_BRIDGE_URL and the two ecosystem addresses in
.env.example made them "something an operator may set" — and none reached
the build, so a box that set one would render a different tree than the
browser (the production-only hydration failure that check exists for).
deploy.yml's build step now inlines all four from repo variables. An unset
variable arrives as "", so the readers use || rather than ??: an empty
inlined value falls back to the same default on both sides.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01TtBnGxwf5ddXTzRNyjHVP7
---------
Co-authored-by: Claude <noreply@anthropic.com>
loki.orangecat.ch was down ~06:00-07:53 UTC on 2026-10-01 (next-server
alive, no listening socket; Caddy 502 after 20s) and nobody was paged. The
watchdog's curl times out at 15s, prints 000 itself, and the fallback
'|| echo 000' appended another: "000000" is neither "000" nor a number, so
check() kept the site UP. Any app that hangs rather than refuses was invisible.
check() now counts UP only on a proven 2xx/3xx; test-watchdog-check.sh runs the
shipped check() against a fake curl (old code fails timeout/refused/garbage).
The deploy verifiers had the same append (failing closed) and are normalised.
Also from the same journal: closeStaleAgentTurns threw ERR_INVALID_ARG_TYPE
every hour — postgres-js cannot serialise a Date in a raw sql fragment. Same
shape in the calendar overlap, the digest previous window and two more;
all now use lt/gt/gte, and no-raw-sql-comparisons.ts keeps it that way.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* feat(openclaw): the Telegram agent reads screenshots, photos and videos
The Telegram agent is OpenClaw on bitbaum, and OpenClaw already describes
inbound media before the chat model reads the turn — but on defaults that
cut every description at 500 characters and read one attachment per
message. A screenshot lost most of its text; an album was read as its
first picture; video had a one-line "Describe the video." prompt.
- scripts/openclaw/media-understanding.json: versioned tools.media.image
and tools.media.video blocks (Gemini; screenshots transcribed verbatim,
albums read whole; videos returned as transcript + visuals + claims +
authenticity signs so the agent can argue about whether a clip holds up).
tools.media.audio is deliberately untouched — voice notes already work.
- scripts/openclaw/install-media-understanding.sh: the only way it reaches
the box. Refuses without a Gemini key, writes through OpenClaw's own
schema-validating `config set`, restarts the gateway, then proves an
image (and, where ffmpeg exists, a video) is actually described.
- scripts/test/openclaw-media-config.ts: pins the limits and the audio
hands-off rule.
Validated against openclaw@2026.4.23's schema locally. Not yet applied to
the box.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD
* refactor(actions): share the decision and the enqueue report; let a turn be read-only
Groundwork for the MCP server, so it calls the same code the chat seams do
instead of a copy of it:
- lib/actions/decide-action.ts: approve/reject one draft, lifted out of
POST /api/actions/[id]/decision (which now calls it; wire shape unchanged).
- lib/actions/enqueue-report.ts: what an enqueue outcome may truthfully be
called (auto-approved / awaiting-approval / deduped), lifted out of
POST /api/actions/propose (wire shape unchanged).
- config/orangecat.ts: the OrangeCat origin and OAuth issuer in a DB-free
module; Auth.js and the identity bridge read the issuer from here instead
of each re-deriving it.
- askLoki / runLokiTurn take `readOnly`: the tool loop drops its propose
tools and the OpenClaw gateway fallback is skipped, so a caller granted
conversation but not action cannot get Loki to act by asking.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD
* feat(mcp): a remote MCP server so AI apps can message Loki and have it act
POST /api/mcp speaks MCP Streamable HTTP (stateless JSON-RPC 2.0; protocol
2025-11-25 / 2025-06-18 / 2025-03-26). claude.ai and ChatGPT connectors,
Claude Code and Cursor can ask Loki, list the approval queue and projects,
dispatch work, book appointments and decide queued actions.
Auth: a ck_* agent token (both scopes), or an OrangeCat RS256 access token
verified with node:crypto against the issuer's JWKS — iss, aud (must be the
Loki resource URL, never a client id), exp. `sub` maps to the Loki user via
orangecatActorId; an unlinked actor gets the sign-in step, not a 500. A
missing or bad token is a 401 whose WWW-Authenticate points at the RFC 9728
metadata served at /.well-known/oauth-protected-resource(/api/mcp).
Scopes loki.chat / loki.act and the tool map are SSOT in src/config/mcp.ts.
Act tools go through injectPrompt, enqueueAction and decideAction — the
functions the Telegram skill's routes call — so the approval queue gates
them exactly as it does there. Both paths are excluded from the session
middleware (proxy.ts, with the reason), registered in api-route-auth and
the demo sandbox. Docs: docs/development/mcp.md.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD
* fix(openclaw): match the installer's smoke output with a here-string, not a pipe
printf | grep -q can report a miss on a match under pipefail (grep exits,
the writer takes SIGPIPE). no-grep-q-in-a-pipe caught it.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD
* feat(openclaw): a workflow that installs media understanding on the box
install-media-understanding.sh needs SSH to bitbaum and a Gemini key, which
a sandboxed agent session has neither of. This workflow_dispatch job has
both: it reuses deploy.yml's HETZNER_SSH_KEY / HETZNER_IP, takes the key
from the GEMINI_API_KEY repo secret or, failing that, from OrangeCat's env
already on the box, writes it into the openclaw user's ~/.openclaw/.env only
when none is there, and runs the installer, which proves a describe.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_018tsc8Yu7TQR9a6Y5xNYkeD
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(sites): a new private site's CI can ship it; registration clears every message it wrote
The site template's ship job granted its token only actions:write. A
job-level permissions block switches everything else off, so on a PRIVATE repo
checkout answered "Repository not found": CI went red on main, the fleet
sweep never ships a red main, and a brand-new site stopped one step before
going live (probe-loop, 2026-09-26). contents:read added to the template and
to loki's own ship job; ci-jobs-can-read-their-repo.ts fails any job that
checks out without it.
isRegistrationNextStep missed the deployment verdicts from
site-cd-deployment.ts, so Farmhouse kept telling its owner "Deployment
failed" after it was live. The test now collects every reason sentence from
the source and requires the matcher to know it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* test(cron-runner): free ports and a subshell that always records its exit
Several sessions run verify on one machine at once; two runs on the fixed
ports 4997/4998 answered each other's jobs, and the retry subshell inherited
errexit so a failing job never wrote its rc file. The retry case failed
twice in one day. Four parallel runs: old test 1/4 pass, this one 4/4.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
A green deploy proved only that the site answered 200: an agent's change could
pass its checks and still leave the page scrolling sideways on a phone,
throwing in the browser, with broken images or most of its text gone, and on
autopilot nobody looks. The shared self-host deploy now reads the live page in
headless Chrome at 390px before and after shipping (page-check.mjs); if the
change ADDED any of those problems (page-check-compare.mjs), it rolls back to
the previous release and fails with the reasons. No baseline is never a
regression, and a checker that cannot run warns instead of blocking.
Screenshots are kept as an artifact for 14 days.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The launcher knew its corner, an offset, a global data-fc-bottom and one
foreign fixed launcher. Everything else it could miss: any layer wider than
90% of the viewport was ignored, so on substrata /atlas at 390px it parked on
the country bottom sheet; and it re-measured only on load, resize, window
scroll and URL change, so a sheet mounted later was never seen.
One engine now, for every width and obstacle:
- placement.slotOrder: preferred corner up its near band, the mirrored
corner, then the rest of each edge (pure, unit-tested).
- host-scan: hit-tests each slot (launcher + 12px gap) with
elementsFromPoint and judges free / surface / layer / blocked. Controls
(incl. [tabindex], iframes, cursor:pointer) block; fixed/sticky bars and
inner scroll panels are layers; a control >=25% of the viewport (a
pannable map) is a surface.
- placement.chooseSlot: first free, else least-bad, else HIDE - never sit
on a control.
- Re-measures on DOM mutation (throttled 1/s) and on inner-panel scroll.
- Host contract: data-fc-avoid (never overlap), data-fc-place=
left|right|hidden on <html> or a page region. Documented in
widget/README.md.
Also fixes a latent bug the browser test caught: clearing inline edges to ""
let the shadow stylesheet's right:16px survive a move to a LEFT corner, so
"Move to other corner" stretched the launcher across the page.
Tests: widget-placement.ts (pure) and widget-host-avoid-browser.ts (real
Chromium, 9 fixtures). Against the pre-fix bundle 7 assertions fail; each
new rule (layer, surface) fails its fixture when mutated out. CI installs
chromium-headless-shell so the browser test runs rather than skips.
Signed-off-by: Cato <41178744+catomean@users.noreply.github.com>
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
The fleet sweep compared main's tip against the last successful Deploy
run's headSha. GitHub labels a workflow_run-triggered run with main's
CURRENT tip, so on 2026-09-25 run 36135832127 shipped f2f6206 while
labelled 4622869, and the sweep believed 4622869 was live and never
dispatched it. bitbaum/fleet#145 added live_commit_url; this opts in.
Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
* fix(hardcoded): give every duplicated constant one home
A sweep of all 44 repos' default branches for literals that duplicate an
existing source of truth. Loki's share, in four groups.
WRONG, and live on the public footer. src/config/fleet-site-copy.ts still
called the Zürich clinic "VitaReBa", a name retired on 2026-09-10 — its own
title says "Vita · Metabolische Psychiatrie & Systemische Longevity". The
generated fleet-sites.ts carried it onto loki.orangecat.ch, where it was
serving until this commit. Fixed at the copy file, which is the one place that
owns a site's own words, and the footer regenerated from it.
WOULD HAVE WRITTEN STALE DATA. scripts/seed-fleet-site-urls.ts kept a hand-typed
slug → URL map "read 2026-08-06". Two of its fifteen entries pointed at hosts
retired since (aoz-wohnen.orangecat.ch, revampit.orangecat.ch), so running it
would have filled empty live_url columns with addresses that only 308. It now
derives the map from apps.conf — the same register the footer is generated from
— which also fixes the six live sites the hand list never had. Verified: 19
sites, zero retired hosts.
THE BOX ADDRESS, in seven places. scripts/hetzner/_box-env.sh has been the SSOT
for it all along and sixteen scripts source it; four did not, and the shared
deploy workflow — reused by ~20 repos — had the IP inline twice, so moving the
box meant twenty edits. The workflow now reads the org-level Actions variable
HETZNER_IP and fails loudly if it is unset, rather than ssh-ing to an empty
string. loki's own deploy.yml had `vars.HETZNER_IP || '<literal>'`, a fallback
that guaranteed the variable was never needed and so never noticed if wrong.
ONE LAPTOP, baked into shipped code. site-cd-local.ts listed /home/g/.ssh and
/home/ubuntu/.ssh as deploy-key candidates beside os.homedir() — which already
IS those paths, since loki-app runs as `ubuntu` and a laptop runs as its owner;
both spelled one homedir for one named person. install-push-deploy.sh wired
hooks to /home/g/dev/loki, link-prod-runtime.ts to /home/g/dev/bitbaum, and
scripts/fleet printed an install line only true on one machine: all now DEV_ROOT
or the script's own resolved path.
The two scripts in scripts/local are INSTALLED BY COPY into ~/.local/bin and run
there by systemd timers, so they resolve _box-env.sh beside the real file first,
then under DEV_ROOT, and exit loudly if neither exists — a security check that
cannot find its target must not look like one that found nothing.
Deliberately unchanged: the slug alias map (the mechanism that makes a rename
safe), an executed migration's data row, the retired-handle detector's own
handle list, and test fixtures reproducing past incidents.
Verified: fleet-sites-derived in sync (14 sites), bash -n on every edited
script, and the branch's only remaining literals are in scripts/test fixtures.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(push-deploy): the generated hook must not bake one laptop's path
install-push-deploy.sh writes the hook body through an UNQUOTED heredoc, so
$HERE expanded at generation time and the absolute path of one machine was
committed into every repo's .husky/pre-push. kivvi and botsmann both carried it;
anyone cloning those repos got a hook pointing into a stranger's home directory,
and re-running the installer would have put it straight back after those repos
were cleaned.
The hook now resolves ${DEV_ROOT:-$HOME/dev}/loki/... at RUN time, so the
generator stops re-introducing what the cleanup just removed.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Full pnpm verify is ~60m. Squash merges already paid that cost on the PR;
re-running it on main doubled merge→live. Main tips whose subject contains
(#N) now run verify:main (format/tsc/lint/design/gates). PRs and manual
main pushes still get full verify. Docs: docs/infrastructure/merge-to-live.md
The repo was renamed today. It was the last place the product was still called
Housing: the name row in fleet's registers/retired.json retired "AOZ Housing" as
the PRODUCT name on 2026-09-10, but the repo kept it, and the repo is public.
The deploy name `aoz-wohnen` is deliberately NOT renamed with it. It is an
infrastructure identifier — systemd unit, /opt path, database — nothing on the
box keys on the repo name, and moving it would touch a live site for no visible
gain. apps.conf's comment block already said as much and still does.
The load-bearing change is apps.conf's fourth field. repo-metadata-audit.mjs
keys the register on that path's BASENAME, so while it read /home/g/dev/
aoz-housing the join against GitHub missed and every metadata check for this
repo was silently skipped — the audit went green by not looking at it. The local
checkout was moved to match and its three worktrees repaired (`git worktree
repair`), not pruned: they hold branches.
Two test failures worth keeping, because both were the rename telling the truth:
- project-mention asserted that "the AOZ housing rebuild" resolves to the
project. With the slug renamed it does not, and should not. The case exists
to prove "a slug with a hyphen, typed with a space" matches, so the INPUT
moved to the current name rather than the expectation being loosened.
- tab-match asserted a terminal tab literally named "AOZ Housing" matches the
slug. Same thing: the fixture now uses the name the tab would actually have.
Consequence worth naming: someone who types "aoz housing" at Loki will no longer
be understood. There is an alias mechanism for exactly this shape
(register/build.ts maps the deploy name to the repo), but wiring the retired
name into mention-matching is a product decision, not a rename chore.
Left alone on purpose: scripts/db/retire-stale-projects.ts, whose data row
records the project names the database actually held when that migration ran;
and content/thoughts/*.md, published essays — one of which quotes a filesystem
path observed during a debugging session, so rewriting it would falsify the
anecdote.
The production user_projects row was updated too (name and git_url), because the
database is a second copy of the repo identity and a past rename left 21 rows
pointing at a dead account. New URL proven to resolve: 431bae7.
Tests green: fleet-register 44, project-mention 28, tab-match 10, fleet-map 7,
loki-project-ranking all.
Claude-Session: https://claude.ai/code/session_01NLZ6vs1jsWw2kKbpWTZHf2
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
The product, its assistant, the repo, the host and every unit on the box now
share one name. 638 files, ~3,000 mentions: UI copy, config, env keys
(FLEETCROWN_* -> LOKI_*), systemd units (fleetcrown-* -> loki-*), docs,
articles, the deploy workflow other repos reuse, and nine file names.
- Three article slugs carried the old name and had been shared; permanent
redirects keep those links alive (next.config.ts).
- test-no-retired-name.sh now also forbids the old product name across the
whole repo, so the rename cannot creep back through templates and examples.
- ASSISTANT_STACK collapses the product and the assistant into one entry,
because they are now the same name.
Infra was cut over ahead of this merge: /opt/loki, loki-* units, the `loki`
database and role, loki.orangecat.ch (old host 308s to it; /api, /widget,
/embed keep proxying), GitHub repos bitbaum/loki and bitbaum/loki-releases.
The Resend sending domain stays fleetcrown.orangecat.ch until the new domain
is verified in DNS.
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
Making main's runs stop cancelling each other exposed the duplicate they
were hiding. Both paths now survive, so both fire: d5c83e66 was built,
rsynced and restarted twice — once from the push chaining through
workflow_run, once from ci.yml's own ship job.
The ship job is the fallback. A merge made with GITHUB_TOKEN triggers no
workflows at all, so nothing else would carry it; that is why the job
exists and why it must stay. But the sweep now merges with a PAT, which
DOES produce a push-triggered run, and that run reaches Deploy on its own.
So the job asks the one question that distinguishes the two cases: has a
push-triggered CI run for THIS commit already succeeded? If yes, Deploy is
already on its way and the dispatch declines. If no, this dispatch is the
only path to the box and it goes.
The check is on the commit, not on a timer or a guess about which merge
mechanism was used, so it stays correct if the PAT is ever removed and
merges go back to producing no push run.
Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Four merges reached main on 2026-09-11 and never left the repository.
Every check was green, no job was red, nothing anywhere was marked failed.
Each one needed a Deploy dispatched by hand, and the only way to notice was
to compare the box's build stamp against main's tip.
Two paths ship a commit, and exactly one fires per commit by design: a push
to main chains through workflow_run, and a dispatch runs ci.yml's own ship
job. Under a concurrency group keyed only by branch, auto-merge's re-armed
dispatch cancels the push run for the same commit — which is intended, and
the comment on the ship job says so.
What was never intended is the NEXT merge cancelling the surviving run of
the previous one. That kills both paths at once. For the stranded commit,
gh run list showed a cancelled push run AND a cancelled dispatch run, with
a clean success five minutes later belonging to a different commit.
So main is now keyed per commit. Same-commit cancellation is preserved, so
a commit still ships exactly once; cross-commit cancellation is gone, so it
ships at all. Branch behaviour is unchanged.
The gate that comes with it states the property narrowly — on main, one
commit's CI must never cancel another's — and also pins the five premises
that make it matter, because if the chain is ever rewired the gate must
fail loudly rather than guard a ghost.
Both were proved by mutation on a copy, six mutations, each asserted to
have actually applied. That assertion earned its keep immediately: the
first draft of this gate checked for `workflow_dispatch` with a plain
substring, which matched a comment and an `if:` elsewhere in the file, so
removing the actual trigger left it green. A mutation that silently no-ops
makes a gate look proven when nothing was tested.
Claude-Session: https://claude.ai/code/session_018Z7YRpgsEtNjRqr1usHMQY
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(cold-start): the starter ships a lockfile, so its first Deploy can install
selfhost-deploy.yml refuses to install without a lockfile and installs with
--frozen-lockfile; the Next starter declared pnpm and shipped no lock, so every
fresh site failed before building. The lock is resolved once by
scripts/templates/refresh-starter-lock.ts into a generated asset and seeded
with the starter (one Git tree call, no pnpm on the app box).
scripts/test/starter-lock.ts fails on drift, missing standalone output, a
missing packageManager, or starter docs that point at npm.
Seeding failures are recoverable: provision on a linked but bare repo re-seeds
it instead of refusing with 409. The starter embeds the project-scoped
feedback widget from its first commit.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w
* fix(cold-start): liveUrl means a Deploy on the current commit and a public 200
Registration persisted liveUrl because register-site.sh exited 0 with
--no-deploy. Now: strict setup, then a workflow dispatch; GET reports
pending/failed/live and the UI polls it. describeSiteDeployment (pure, tested)
treats a queued run or a just-sent dispatch as starting, closing the race where
the first poll after dispatch read as "no deployment exists". A status the
client cannot read is shown as a failure, not swallowed.
The deploy workflow resolves a freshly registered slug from the box register
and proves the checkout belongs to the caller; deploy.sh builds with the same
package manager that installed; register-site.sh runs release siblings, locks
the register, fails without a deploy secret, and seeds a runtime env.
check:deploy-ready no longer reads a box-registered checkout as laptop drift.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w
* fix(feedback): Implement addresses the project id, never a same-named tab
Feedback and kickoff dispatch resolve user_projects by stable entity id; a
renamed project or a same-named sibling can no longer redirect a run, and the
hosted fallback is off for actions tied to a tracked run. Batch Implement only
advances when a run was accepted. Fix prompts require the normal ship path and
live evidence; Resolve stays with the operator.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w
* docs: FleetCrown builds independently; tab names are transport, not identity
Product copy and agent docs describe FleetCrown as an independent product with
optional OrangeCat linking that is not publication consent. Control drops the
Focus terminal chip (Open terminal stays). Adds the cold-start handoff.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0118cLNxoB3dt2w74vU1PH6w
---------
Co-authored-by: Claude Fable 5.1 <noreply@anthropic.com>
ubuntu CI deploy key does not authenticate from GHA. Use the working root
deploy key: authorize it for ubuntu, set dogfood's secret, sync unit/Caddy,
build the starter on-box, atomic release swap, set liveUrl.
Co-authored-by: Cato <catomean@users.noreply.github.com>
Register no longer dies when Contents API already landed the secrets fix.
Bootstrap resets the dogfood checkout, treats register push races as
non-fatal, and always runs deploy.sh for the slug.
Co-authored-by: Cato <catomean@users.noreply.github.com>
* ci: fix dogfood bootstrap — reset dirty apps.conf, prefer /opt scripts
Durable checkout had an uncommitted apps.conf that blocked pull. Hard-reset
to origin/main and run register/deploy from the just-shipped /opt release.
* ci: pass register/deploy paths into ubuntu env correctly
---------
Co-authored-by: Cato <catomean@users.noreply.github.com>
Temporary workflow_dispatch to finish dogfood-site-sep10-1201 after cross-owner
secrets: inherit left Deploy unable to SSH. Installs the CI deploy pubkey for
ubuntu, runs idempotent register-site + deploy.sh for this slug only, sets
liveUrl. Remove after dogfood returns 200.
Co-authored-by: Cato <catomean@users.noreply.github.com>
GITHUB_TOKEN cannot merge a PR that touches .github/workflows. The sweep tries,
the merge API refuses, it logs "leaving for the next sweep", and repeats — while
still exiting 0. So the failure is invisible: every run reports success and the
PR simply never merges.
That is not hypothetical. ai-kit #11 (bump actions/checkout) sat green, CLEAN
and MERGEABLE for nine days; aoz-housing #122 (bump actions/upload-artifact)
for nine more. Both had to be merged by hand today. Every Dependabot
`github_actions` bump in the fleet is in this class, permanently.
A PAT fixes a second thing that costs more: THROUGHPUT. A dispatch made with
GITHUB_TOKEN emits no workflow_run, so after each merge nothing wakes the sweep
to take the next PR — it waits for the cron, and GitHub throttles scheduled
workflows to roughly hourly regardless of what the cron says. Observed in
fleetcrown: sweeps ~50-65 minutes apart against a */10 schedule. A PAT-created
dispatch does emit workflow_run, so the queue drains at CI speed instead.
The reusable workflow has always supported this — GH_TOKEN is
`secrets.token || github.token`. This just passes it.
SAFE BEFORE THE SECRET EXISTS: an undefined secret resolves to empty, and the
fallback picks github.token. So this changes nothing until FLEET_PAT is created
as an organisation secret, and needs no second pass afterwards.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
This workflow runs a full `npm run build` on the runner (deploy.sh) for every
repo that calls it, and nothing restored `.next/cache`. So the same compile CI
just did was repeated from scratch, every deploy, in every consumer repo.
Measured across 8 repos on 2026-09-07: not one deploy cached this, and only
orangecat's CI did. Deploy medians ran 2.9m (fleetcrown) to 12.7m (evig)
against CI medians of 1.9m to 10.7m on the same commits — two cold builds of
one commit.
One change here reaches kivvi, botsmann, vitareba, hirnli and every other
consumer, which is the reason to fix it at this layer rather than in each repo.
Keyed by app so two apps in one repo cannot evict each other, and by lockfile
so a dependency change invalidates it. The bare restore-key comes last on
purpose: a stale cache is still much cheaper than no cache, and Next validates
its own entries rather than trusting them blindly.
Claude-Session: https://claude.ai/code/session_01G2LBioUzJP4oBL9LeH9qAe
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
#488 stopped the hydration failure by rendering nothing until past the server
render. It could not restore the feature: the browser still received an empty
NEXT_PUBLIC_VAPID_PUBLIC_KEY, so subscribe() had no application server key and
push notifications were dead in production regardless.
The missing half was never in the code. deploy.yml's build step declared no
`env:` at all, so every NEXT_PUBLIC_* was inlined empty while the box ran with
this one set. Fixed by creating the repo variable and passing it to the build.
A variable, not a secret: the value is compiled into the client bundle and
handed to every browser that subscribes. Hiding it would be theatre, and a
secret's log masking would only obscure the verification.
Verified before trusting the value, because a wrong key fails silently at send
time and this one gets baked into every future bundle:
- decodes to 65 bytes, first byte 0x04 — a valid uncompressed P-256 point
- the public key is the MATE of VAPID_PRIVATE_KEY on the box (derived the
point from the private scalar and compared; no secret printed)
- VAPID_SUBJECT is a valid mailto:/https: scheme
One trap on the way: the box stores the value quote-wrapped (len 89 = 87 + 2).
dotenv strips those when the server loads them, so runtime was fine — but
copying it verbatim into the variable would have inlined literal quotes and
produced a broken key that looks correct in every listing.
The gate's KNOWN_GAPS entry is deleted rather than edited, so removing either
the variable or the env: line now fails the check instead of silently killing
push again. Mutation-proven both ways: line removed -> 4 passed, 1 failed
naming the var; restored -> 5 passed, 0 failed.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
aoz-housing's vitest merge deployed red: CI (Node 24, npm 11) wrote the
lockfile, the shared deploy fell back to Node 20 (npm 10) for the .nvmrc-less
repo and npm ci rejected it — 'Missing: esbuild from lock file' — stranding
two merged commits until a hand-regenerated npm-10 lockfile landed. The box
has been on Node 24 since 2026-08-31 and fleet CI defaults to 24; a 20
fallback here re-arms that npm-major split for every .nvmrc-less repo.
Claude-Session: https://claude.ai/code/session_01WqKqMnHQHSmkGFfc5t7Rxn
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
* chore: add a formatter, matching the style this repo already writes
singleQuote=false was chosen by counting this repo's own
imports, not by fleet decree. The fleet is genuinely split and the two repos
that already had a .prettierrc disagreed with each other, so there was no
standard to restore. Quote style does not cross repo boundaries; having a
gate does.
Markdown is ignored for now — prettier rewraps prose, which would bury the
real diff.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* style: format with prettier (1062 files)
Mechanical. No behaviour change. This SHA is listed in
.git-blame-ignore-revs so `git blame` skips it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* chore: teach git blame to skip the reformat
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
* fix(lint): reattach two guards the reformat detached
Both effects were one-liners, so a trailing eslint-disable-line covered the
setState call:
useEffect(() => { setSelected(new Set()); }, [q.length]); // eslint-disable-line ...
prettier expanded the block. The comment stayed on the closing line while the
call moved above it, so the guard protected nothing and the rule its author had
deliberately silenced failed the build.
This is the second shape of the same defect — hirnli had the eslint-disable-NEXT-line
variant. Both come from the same fact: an eslint directive binds to a line
number, so reformatting can silently unbind it, which makes 'mechanical, no
behaviour change' false for any bulk reformat.
* chore(desktop): bump the runner version the reformat requires
desktop-release-drift enforces that anything built into Fleet Runner which
differs from the last released tag must carry a version ahead of that tag —
main read 0.8.15 and fleet-runner-v0.8.15 already shipped.
A whole-repo reformat changes bytes under desktop/, so the gate fires. The
alternative was adding desktop/ to .prettierignore, which would buy a quiet PR
by carving a permanent hole in the formatter's coverage — the precise shape of
silent drift this test was written to catch. Bumping is what the rule asks for
and costs one patch release whose only content is whitespace.
* chore: merge main and re-format
A whole-repo reformat conflicts with any concurrent commit, and a conflicting PR
runs no checks at all while reporting nothing. Conflicts resolved to main,
which is correct because this branch changes formatting and nothing else.
* chore: leave desktop/ out of this reformat
desktop-release-drift is right to refuse this. Everything under desktop/ is
built into Fleet Runner, so changing it means shipping: bump the version AND add
a FLEET_RUNNER_RELEASES entry, whose stated audience is 'person who installed
Fleet Runner and wants to know what changed'. For a whitespace-only build the
honest answer is 'nothing', so that release should not exist — and I should not
write release notes claiming otherwise.
I had bumped to 0.8.16 to get the gate green. That was the wrong direction:
publishing a build to three OS runners to keep a formatting PR quiet. Reverted.
desktop/ is excluded in .prettierignore with the reasoning recorded there, to be
formatted alongside the next real runner change, where the bump and the notes are
true anyway.
---------
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
George, 2026-08-29, pasting his Telegram: 'refactor whatever is sending this
abomination.' The morning read as: identical FAILED triples at 08:01, 08:31,
09:01, 09:32, 10:02, 10:33; a six-pack of FAILED+RECOVERED for a 5-minute
deploy blip; closures naming state keys ('RECOVERED:
rtc_revampit_configured_host_does_not_resolve__typing_static_nvi',
'agentwork_reparaturbonus-zh'); UNIT DOWN bodies that repeat the unit name
four times in systemd boilerplate while burying the app's actual error; and
two URL monitors speaking two dialects.
One rule set, all in lib-alert.sh and its callers:
- Reminders BACK OFF: the claim stamp holds 'ts count'; each claim quadruples
the next wait (30m, 2h, 8h, capped at a day). alert_clear resets the
ladder. claim_once is the decision without the delivery, so callers can
digest.
- The sweep gets ONE-TICK GRACE: first sighting watches, never pages — the
OnFailure notifier owns the instant page and already declines deploy blips.
A blip inside the grace produces zero messages, failure or closure.
- DIGESTS: N failures on one tick are one 'STILL FAILING: a; b' message; same
for recoveries.
- Recovery names the SUBJECT, never the key: alert_transition remembers the
human subject at bad-time (explicit arg, else text-to-first-colon, else
key) — fixes every alert_transition caller fleet-wide at one seam.
- The notifier page shows the APP's error: systemd liturgy filtered from the
journal tail; '🔴 DOWN: appcron-kivvi-dunning — curl: (22) … HTTP 500'.
- fleet-uptime.yml speaks the same dialect ('🔴 DOWN: app (…)',
'✅ RECOVERED: app', no ISO timestamp — Telegram stamps messages).
92 tests green; mutation-verified per area: no-grace → 8 red, key-recovery →
3 red, flat-backoff → 1 red.
Claude-Session: https://claude.ai/code/session_018RmMktaYn8MuJdEqjp5gWU
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>
Nothing watched TLS expiry. Caddy renews at 30 days remaining and has never
missed, which is exactly why: the check felt unnecessary because it had never
been needed. But renewal breaks for reasons no app ever sees — an ACME rate
limit, port 80 closed by a firewall change, a DNS record moved — and the first
symptom is every site on the box going dark at once. Twenty domains, one
failure. The warning exists for weeks; nobody was reading it.
Measured today, all twenty are fine: 65-88 days, staggered. That is the moment
to add the check, not after the outage that proves it was needed.
Reuses the uptime sweep's target list rather than taking a copy — verified
identical, 20 targets and 20 certificates. A second list of domains is the gap
that hid botsmann for weeks, and it would open here in exactly the same way: a
new app registered in apps.conf would be probed for HTTP and silently
unprotected against expiry.
Thresholds are Caddy's, not arbitrary. ok at 21+ days, because Caddy renews at
30 and has therefore had nine days of attempts; warn from 7 to 20, when renewal
should have happened and did not; critical under a week. Unreadable is CRITICAL,
never ok: "we could not check the certificate" and "the certificate is fine"
must not share an outcome — that conflation is how botsmann's 503 read as
healthy for weeks.
Daily, not every fifteen minutes. A certificate does not change between sweeps,
and twenty TLS handshakes a quarter-hour to relearn the same number is noise
that earns nothing — and noise gets muted.
No issue/Telegram machinery: fleet-uptime.yml owns that, and a second alerting
path to keep in step is not worth it for a check with three weeks of slack.
Stated in the workflow rather than left to be discovered.
Claude-Session: https://claude.ai/code/session_018waGt1ieA9TjpscqrbrnGb
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The `uses:` line is already correct. What was stale is the prose next to
it, which told the reader the policy lives in bitbaum/dotfiles and to go
change it THERE. That file no longer exists in dotfiles — the sweep moved
to bitbaum/fleet on 2026-08-28, because a repo holding someone's .bashrc
is not where a fleet's deploy policy belongs.
A comment that misroutes a fix is worse than a missing one: it sends the
next person to edit a repo where the change would reach nobody, which is
the precise failure the shared sweep exists to prevent.
Files: .github/workflows/auto-merge.yml, CLAUDE.md
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The audit landed on an Actions schedule, which closed detection and left
notification wide open — a red Actions run is a channel nobody watches, so it
had the same "green everywhere and nothing ships" shape it exists to catch.
Moves the schedule to the Hetzner box as fleetcrown-fleet-refs.timer (every 6h)
and alerts through the watchdog Telegram channel that host-check and the
OnFailure notifier already use.
NO NEW SECRETS. The GitHub token comes from root gh on the box; Telegram comes
from /opt/monitoring/telegram.env. Nothing was copied into GitHub secrets.
ONE IMPLEMENTATION. The timer runs the same scripts/ci/fleet-refs-audit.mjs the
deploy already rsyncs to /opt/fleetcrown/app. A shell reimplementation would
have drifted from the CI one the moment either changed. Actions keeps the same
job as a manual button (workflow_dispatch), so there is no second schedule.
Three failure modes are alerted rather than assumed:
- script missing or no GitHub token -> its OWN state key, so "could not look"
can never overwrite a real finding or read as "checked and clean"
- the audit failing -> transition-only, so it pages on change, not every 6h
- the UNIT failing -> OnFailure=notify-failure@%n, because a script that
cannot start is otherwise exactly as quiet as a clean fleet
The check is `set -u`, deliberately not `set -e`: its whole job is to run a
command expected to exit non-zero, and -e would kill it before it could alert.
It uses if/else rather than `check && alert || alert` — that shape read the
alert branch exit status as the check result and caused the 2026-08-05 storm,
40 alert/RECOVERED pairs in 3h.
Verified end to end, not assumed: Telegram API returned ok:true, message_id
3402, private chat. Forced-failure run through the identical code path produced
the alert; the clean run produced silence.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Three times in three days a rename or a transfer stopped every merge and every
deploy across the fleet, and all three times nothing looked wrong. GitHub
follows a rename for REST and for git; the Actions `uses:` resolver does not.
The run dies before any job exists — zero jobs, no log — so the workflow that
would report the failure is the one that cannot start, and pull requests stay
green and mergeable while nothing ships.
That is why this cannot be a per-repo check. A copy inside each repo only
protects repos that already have CI, and petvity and solon and datacat each had
a dead deploy with no auto-merge.yml to notice it. This asks GitHub, from
outside, what every referenced repo is really called and compares that to what
the workflow says.
Found on its first run, before this was even committed: datacat and solon both
called catomean/fleetcrown and had been unable to deploy since the org move.
Two deliberate details:
- Comment lines are stripped before the retired-handle check. Workflows that
EXPLAIN this outage name the old account on purpose, and a gate that fires
on its own documentation is one people learn to ignore.
- MIN_REPOS is a floor. "0 problems" across 0 repos is not a pass; if the
token stops seeing the fleet that must fail, not report clean.
Not closed by this: it fails red in Actions, which nobody watches. It closes
detection, not notification. Routing it through FleetCrown alerts is the
follow-up.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The fleet automation moved out of dotfiles on 2026-08-28; the dotfiles path
is now a forwarding shim. This points the caller at the sweep's real home.
One line; the reusable workflow's interface is unchanged.
Claude-Session: https://claude.ai/code/session_01AZCNYHwjEeqxNpYCUk6Yna
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
The account was renamed to `catomean` and the repos then moved to the
`bitbaum` org, so `maonakamoto` now names nothing: github.com/maonakamoto
and maonakamoto.github.io both return 404, and @maonakamoto no longer
resolves as a user.
Three different targets, because these are not the same reference:
repo links -> bitbaum/<repo> (the repos live in the org)
the person -> catomean (profile links, @mentions, CODEOWNERS)
pages site -> bitbaum.github.io
Deliberately NOT changed:
.mailmap keeps the old noreply address as an ALIAS. It is what maps
historical commits onto the current identity; deleting it would
silently unmap them. Only the canonical side moved to catomean.
Files that explain the outage by naming the old account keep it,
since the name is the content.
Files: .github/CODEOWNERS
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* chore(ci): GitHub owner catomean -> bitbaum
* docs(hetzner): update _box-env.sh comments for the completed org migration
The GH_OWNER/WORKFLOW_OWNER comments described a future state (repos moving
to bitbaum while fleetcrown stayed personal) that sweep-gh-owner.sh just
made true, then obsolete: fleetcrown itself is in bitbaum now too. Comments
describing a plan that already happened are worse than no comment — they
send the next reader looking for a divergence that isn't there.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN
* chore(desktop): release 0.8.15 — the org-migration owner literals
Same shape as 0.8.14: desktop/ carries two literal owner references (issue
link, updater feed owner) that a fleet-wide rename touches, and
desktop-release-drift.ts correctly refuses to let that ship without a
version bump — a repo whose desktop app silently points at a dead update
feed is worse than one that fails the gate.
This should be the last time it's an account name: the org is the stable
home from here.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN
---------
Co-authored-by: Mao Nakamoto <41178744+maonakamoto@users.noreply.github.com>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
* refactor(infra): studio constants get one home, and the rename gets a command
Fair criticism: I spent the day arguing for SSOT and then wrote new-site.sh with
its own copies of GH_OWNER, BASE_DOMAIN and DEV_ROOT, and hardcoded
'maonakamoto' again in provision-widget.ts. Worse, the pattern already existed —
_box-env.sh is literally labelled 'SSOT' for the box address. I did not extend
it, I duplicated around it.
_box-env.sh now owns GH_OWNER, SITES_BASE_DOMAIN and DEV_ROOT alongside the box
address, and new-site.sh and provision-widget.ts read them instead of carrying
their own.
The 41 workflow files are a different case and worth being precise about:
GitHub Actions requires a LITERAL owner/repo in and will not accept a
variable, so that duplication cannot be removed. But a duplication you cannot
remove is one you have to OWN — leaving it as 'remember to edit 41 files' is
exactly the shape of step that gets skipped, the same shape as the git
repository Camille never got. So sweep-gh-owner.sh is committed: one command,
dry-runnable, optionally self-committing.
Dry run against the fleet: 24 repos, all detected correctly. Renaming to an org
is now plus one line in _box-env.sh.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(infra): split WORKFLOW_OWNER from GH_OWNER before they diverge
Same bug as the last commit, one layer down. The site template hardcoded
maonakamoto/fleetcrown in its deploy.yml uses: line, derived from nothing — so
every new site would bake in a literal that follows neither an account rename
nor a move to an org.
And GH_OWNER was quietly doing two jobs: where new site repos are CREATED, and
where fleetcrown LIVES. They look identical today and are about to diverge —
sites go to an org while fleetcrown stays on the personal account. One name for
two values is how a rename half-works.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(ci): GitHub owner maonakamoto -> catomean
* chore(infra): owner is catomean
Account renamed maonakamoto -> catomean. sweep-gh-owner.sh swept 24 repos and
the SSOT now agrees; 32 local remotes repointed. This is the commit the sweep
script exists for.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* chore(ci): GitHub owner maonakamoto -> catomean
* chore(ci): GitHub owner maonakamoto -> catomean
* fix(desktop): cut 0.8.14 — the owner rename touched desktop code
My owner sweep changed two files in desktop/ (an update URL and a package
reference) without bumping the version. That is precisely the failure #370
existed to prevent: desktop code that changes without a release ships to the
server and to no machine at all, silently.
The gate caught it, four commits after it was written. Working as intended, and
worth saying plainly — I was the one it caught.
GitHub redirects repository URLs after a rename, but only until somebody claims
the freed name. An auto-updater should not depend on a redirect.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(ci): the gate fails on your diff, not on your laptop
Three things in this hook blocked pushes for reasons unrelated to the change
being pushed, and together they are why --no-verify became reflex here. I passed
it eight times in one day and blamed the hook; the hook was reporting real
problems with misleading attribution.
1. STALE INSTALL. An unresolvable dependency surfaced as 'Cannot find module' —
indistinguishable from a type error in your code. Now a precondition that
fails first, loudly, naming npm ci. A day was spent on this exact confusion.
2. AGENT-CORE DRIFT. Drift arises either because you changed canonical without
syncing, or because somebody changed the mirror in the other repo. Only the
first is yours. It now checks whether this branch touched
src/lib/agent/core/ and warns instead of blocking when it did not.
3. SCHEMA DRIFT. The guard already skipped an unreachable database but not a
reachable stale one, so a local scratch DB missing someone else's columns
blocked pushes touching no schema. Now scoped: if the branch changes schema a
mismatch is yours and blocks; otherwise it reports and continues.
The pattern is taken from desktop-release-drift, which self-scopes to files
changed since the last release and is the only check here that has never blocked
an unrelated push. It caught me correctly today, four commits after it was
written.
Where scope cannot be established the checks still fail closed — a gate that
cannot establish innocence should not grant it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* fix(ci): resolve the default branch, never assume main
The diff-scoping added in the previous commit compares against origin/main. 28
repos here use main — but aoz-housing, dotfiles and sbb-lost-found use master,
and six had no origin/HEAD set at all.
On those, merge-base fails, the scoping falls through to 'cannot tell', and
every check treats every change as in-scope. The gate I had just fixed would
have gone back to blocking unrelated pushes on a fifth of the fleet, for a
reason nobody would have connected to a branch name.
default_branch() now lives in lib.sh and resolves in order: the remote's own
origin/HEAD, then whichever of main/master exists, then fail. Never a guess. The
pre-push hook and agent-core-drift both use it.
Also ran 'origin/HEAD' is unchanged and points to 'main' on the six repos missing origin/HEAD.
32 of 33 now resolve; wild-spirit has no remote at all, which is a separate
finding and the same shape as camille this morning.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(scaffold): every new site is born with CI
ci-gate.sh cannot tell 'CI green' from 'no CI configured' — both exit 0. So a
scaffolded site without a workflow deployed every push unverified while looking
identical to one that passed. Substrata shipped to production that way for a day.
The template now emits ci.yml alongside deploy.yml: npm ci, type-check, lint,
build — the same bundle verify runs locally.
Plus eslint.config.mjs, because ESLint 9 without a flat config exits non-zero on
a migration notice and a new site's FIRST CI run would be red for reasons
unrelated to its code. A red first run teaches people to ignore the light.
Config copied from the fleet's working Next 16 apps, not invented.
postcss.config.mjs assigns before exporting — the anonymous default export is a
lint warning, and a scaffold should not emit its own warnings.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(ci): no deployed app ships without CI, ratcheted to zero
ci-gate.sh exits 0 for 'CI green' AND for 'no CI configured'. Absence is
indistinguishable from success, so an app with no workflow deploys every push
unverified while looking exactly like one that passed. Nothing reported it,
because nothing was looking.
The audit found two: camille-boulangerie, and sink — which is sinktattoo.com, a
real client's site.
sink turned out to be a FALSE POSITIVE, and that is the more useful finding:
apps.conf pointed at /home/g/dev/s-ink, a path that does not exist, so the gate
reasoned about an absent repository and reported the wrong fault. It sent me to
add a workflow to a repo that already had one. The register was the bug.
So the gate now distinguishes a stale register entry from a missing workflow and
fails loudly on the former — a gate that lies about what to fix is worse than no
gate. apps.conf repointed at /home/g/dev/aslan-tattoo.
Camille genuinely had none and now does. Baseline is 0: a new deployed app
without CI is a build failure.
Tested in all four directions — over baseline fails, at baseline passes, under
baseline passes and prompts, stale path fails. The first version could never
fail at all: it set HERE before sourcing lib.sh, which overwrites HERE, so
BASELINE_FILE pointed at a missing file and silently fell back to the current
count. Found by testing the gate rather than trusting it.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(scaffold): template ships .nvmrc
Every new site now pins Node once, and both CI and the deploy read it. Without
it the deploy warns and the two pipelines pick a version independently — the
kind of difference that surfaces as 'green in CI, broken on the box'.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
* feat(hetzner): scaffold sets the deploy key itself, from one configured path
new-site.sh printed `gh secret set ...` and called that operator hygiene.
What it actually produced was substrata live in production deploying only
from a laptop, because a printed instruction is a step that gets skipped.
The key is piped from DEPLOY_KEY_PATH straight into `gh secret set` — never
read into a variable, a log, or an agent's context — so the safety argument
that motivated the manual step is kept while the step disappears.
Per-repo on purpose: GitHub Free does not expose org-level secrets to PRIVATE
repositories, so an org secret alone would silently cover only part of the
fleet. DEPLOY_KEY_PATH joins the other constants in _box-env.sh so there is
one path, not one per script.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN
* fix(ci): make the deploy-ready gate judge the diff, not the workstation
The gate inspected the sibling checkouts under DEV_ROOT and nothing else.
All 15 are cloned on the workstation, so it printed "all 15 deployed apps
have CI"; CI clones this repo only, so the same commit printed fifteen
missing repos and exited 1 — red on a diff that touched none of them.
Third instance of one class: a gate judging state outside the commit. Its
real cost is not the red run, it is that everyone learns the gate is noise
and reaches for --no-verify.
Split into the two halves that were tangled:
REGISTER INTEGRITY — apps.conf lives in this repo, so it is in the diff,
so CI must judge it. Now actually checked: field count, unique names,
unique numeric ports. Previously nothing validated the register at all.
FLEET INSPECTION — needs the checkouts. Where none exist it is announced
as NOT RUN and exits 0. Announced, because "no output" and "all clear"
looking identical is the bug this file was written to fix. Where some
exist, a bad path is still drift and still fails.
test:deploy-ready-gate locks it shut from both sides: a malformed register
must fail even with no checkouts present, and a bare environment must never
claim the fleet passed. Added to verify, so CI runs it in exactly the
environment that used to break it.
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9rKLxddothnXEtY6KDziN
---------
Co-authored-by: Mao Nakamoto <georgy.butaev@revamp-it.ch>
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
Co-authored-by: t <t@t.t>
botsmann answered 503 from /api/health for weeks and nobody knew. Not
because a check failed — because there was no check. Nineteen services run
on bitbaum and the fleet's only uptime monitor probes orangecat.ch.
Targets come from scripts/hetzner/apps.conf, the same manifest deploy.sh
reads, so registering an app for deployment is what enrols it in
monitoring. A hand-maintained copy of "what is deployed" is how the gap
that hid botsmann opens again.
Two decisions carry the whole thing, and both are pinned by tests:
- Probe /api/health, not `/`. botsmann's homepage served 200 throughout
the outage — Next renders marketing pages from disk with no database in
the path. A monitor pointed at `/` would have been green the entire time.
- An app with no health route reports LIMITED, never UP. Eleven apps are
in that state today; calling their homepage check a pass would put a
green tick beside eleven apps whose database could be on fire.
Two defects found by running it against production rather than trusting it:
- `curl ... || echo 000` emits "000000" on a connection failure — curl
prints its own 000 and the fallback adds another. That matched no
verdict, fell through to "no health route", and re-probed `/`. For an
app that serves static pages without its database (botsmann's exact
shape) it would have downgraded a hard outage to a soft LIMITED. A
monitor whose failure mode is to soften failures is worse than none.
- bridge is an SSE fan-out service, not a Next app: it answers /healthz
and 404s on `/` by design. The first run reported a perfectly healthy
service as DOWN, which is how a monitor teaches people to mute it.
Targets may now declare their own health path.
Current sweep: up=7 limited=11 down=1 (botsmann — the real outage).
Does not replace orangecat's uptime.yml, which also reports box-level
disk, backup freshness and auth — properties of the machine, not of an app.
Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>
Shipping has been down since 18:14 UTC. Every auto-merge sweep since then
failed before starting a job — "this run likely failed because of a
workflow file issue" — and the last success was 17:07.
Nothing in this repo changed. The GitHub org was renamed
maonakamoto -> catomean, and a reusable-workflow reference does NOT follow
that rename. `gh api repos/maonakamoto/dotfiles` redirects to
catomean/dotfiles, and `git clone` of the old URL still works, so the
rename looks complete from every angle except the one that matters:
Actions resolves `uses: owner/repo/...` against the literal owner at parse
time, and the workflow is invalid the moment it cannot.
That failure mode is quiet in the worst way. A broken sweep does not mark
any PR red — the PRs simply sit at MERGEABLE/CLEAN forever, which is
indistinguishable from waiting for a slot. Three PRs were queued behind it.
catomean/dotfiles has the sweep workflow at .github/workflows/
auto-merge-sweep.yml@master (verified via the API before this change).
Deliberately minimal: only the `uses:` reference and its two adjacent
comments. The wider maonakamoto -> catomean rename is in flight in another
change set and this must not collide with it — this is the one line that
has to land now, because nothing else can merge until it does.
Claude-Session: https://claude.ai/code/session_01UvjGNAS9CMfEGNW26tUR4P
Co-authored-by: t <t@t.t>
Co-authored-by: Claude Opus 5 <noreply@anthropic.com>