* fix(build): regenerate control-states.generated.sh after the runner rename
#1482 changed a description in src/lib/control-states.ts but not the
shell vocabulary generated from it. The deploy's prebuild regenerates the
file, the checkout is then dirty, and "Stage verified public package
receipt" refuses it, so #1482 never shipped (runs 41132450661,
41132869424, 41133549171).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmw5m9WhdN77N2YeqDm
* test(build): fail CI when the generated shell vocabulary is stale
generate-bash-state-vocab.ts gains --check, and scripts/test/
control-states-vocab.ts runs it in the unit suite. A change to
control-states.ts without the regenerated file now fails CI before
merge, instead of every deploy after it (#1482).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_019MDtmw5m9WhdN77N2YeqDm
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(deploy): install Chromium with the app's own Playwright; /api/health says whether pictures work
Every picture on the box answered no-browser. The deploy installed Chromium
with the runner's Playwright, which npm resolves from package.json's ranges
(there is no package-lock.json), while the app is built from pnpm's lockfile:
two versions, two Chromium revisions, and the app never found the one that
was installed. The install now runs the Playwright the standalone ships, as
the app user, and a failure's output stays in the deploy log.
/api/health carries `pictures` (Playwright present, the browser path, ok), so
a server that cannot photograph a page says so on the one line everyone
reads. A missing Playwright is its own reason (no-playwright); the two places
that word a missing browser treat it the same.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9KbVEpxKLC9nhKhpWncU1
* fix(build): the standalone carries Playwright, so the box can take pictures at all
/api/health read pictures.playwright=false after #1285: the standalone build
never contained Playwright. Being in serverExternalPackages makes the bundler
leave it alone; it does not make the tracer copy it. outputFileTracingIncludes
now names it (and pnpm's real files under node_modules/.pnpm) for every route,
and playwright moves from devDependencies to dependencies, which is what it
is: a runtime need of the server.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9KbVEpxKLC9nhKhpWncU1
* chore(control): regenerate control-states.generated.sh (awaiting_you was added to the source, not the output)
The build's prebuild regenerates this file from the TypeScript states; main's
copy lacked the awaiting_you state, so every local build left the tree dirty.
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Y9KbVEpxKLC9nhKhpWncU1
---------
Co-authored-by: Claude <noreply@anthropic.com>
* fix(build): keep fs out of the browser bundle — the exit-contract matcher gets a Node-free home
loki#900 made activity-status.ts import EXIT_CONTRACT_PATTERN from
agent-config.ts. activity-status is shared with client components (the
Activity feed strips the contract from a dispatch before showing it), and
agent-config imports `fs` — so `fs` landed in the browser bundle and
`next build` failed: "Module not found: Can't resolve 'fs'". Four deploys of
main were refused; production kept serving the previous release, but nothing
merged after #900 could ship either.
`verify` could not see it: CI deliberately does not run `next build`, so a
client/server boundary break only surfaces at deploy.
The heading and the matcher move to src/lib/exit-contract.ts, which imports
nothing. agent-config builds the full contract from that heading; the client
and the lane prompt read the matcher from the Node-free module.
Proved by the step that failed: `pnpm run build` against a schema-only
Postgres, exactly as the deploy runs it.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
* test(build): catch a Node builtin in the browser bundle before the deploy does
verify does not run `next build`, so a client/server boundary break only
surfaces when the deploy builds — after the PR has merged. That is how #900
reached main and blocked every deploy.
client-bundle-node-free.ts walks the client graph the way Turbopack does,
without building: from every "use client" module through static value
imports, stopping at "use server" modules (RPC stubs on the client), and
fails on any builtin Next does not polyfill for the browser.
Proved against the real break: with #900's activity-status.ts it reports
exactly the two errors the deploy printed — `fs` in agent-config.ts and in
session-paths.ts via activity-status.ts <- project-intent-panel.tsx — and on
this branch it reports none.
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_016YJVAanfj8keVSXyZnTemh
* style: format
---------
Co-authored-by: Claude Opus 5.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>
Cloud inject always queues even when box-runner is connected; distinguish
runnerConnected in Loki footer, Control toasts, and dispatch-status SSOT.
Add prod dogfood script and dispatch-status tests.
Co-authored-by: Cursor <cursoragent@cursor.com>
User-facing copy now says Fleet Runner everywhere (the bash daemon and
scripts/home-start.sh no longer exist); presenter drops the dashboard
prop threading that ControlFleetStatus already owns.
Phase B + C + D of /home/g/.claude/plans/ethereal-crunching-clover.md.
B1. Generate bash state vocabulary from the TS SSOT
- scripts/generate-bash-state-vocab.ts reads STATE_DEFINITIONS from
src/lib/control-states.ts and emits scripts/control-states.generated.sh
with FC_LABEL_<KEY>, FC_DESCRIPTION_<KEY>, FC_COUNTER_CATEGORY_<KEY>
for every state.
- Wired into package.json's prebuild step so every `npm run build`
refreshes the file. Daemon sources it; new states propagate without
hand-editing any bash.
B2. Agent prompt context reads STATE_DEFINITIONS[k].description
- buildPromptWithSession(base, tab, projectStateDescription?) gained
a third optional argument. When passed, prepends
"Project state: <description>" before the session-state block — the
same one-line WHY the human sees on the badge hover tooltip.
- deriveProjectStateKey() in control-states.ts maps the raw signal
set (agentRunning / tabOpen / sessionStatus / readyAt / lockAt /
closingAt / closedAt) to a ProjectStateKey without dragging in the
full presenter machinery.
- Threaded into /api/inject (promptKey path) and the Claude +
Codex/Gemini paths in /api/orchestration/run. The agent now reads
the same words the user reads.
C. ControlFleetStatus migrated to DAEMON_STATE_DEFINITIONS
- lib/control-states.ts gains a sibling SSOT for daemon-side states
(setup_needed / offline / state_unknown / connected). Same shape:
label, description, dotClass, problem hint.
- ControlFleetStatus reads from it for the banner label + tooltip +
problem CTA, dropping the hand-rolled `daemonNeverSeen ? "Setup
needed" : daemonOffline ? "Daemon offline" : ...` tree.
- "Setup needed" surfaces an "Install Fleet Runner" action chip
linking to /download with the longer how-to on hover — same
pattern the per-project badge uses.
- DaemonStatusBanner (the rich 320-line install/recovery card) is
left alone — its UX is distinct from the status indicator.
D. Cleanup
- fleetcrown-daemon.sh now traps EXIT in addition to INT/TERM and
kills its forked sibling daemons (the multi-source polling forks
spawned for each FLEETCROWN_BASE_URLS entry). Was a defensive
improvement; the observed "12+ stale daemons" turned out to be
normal subshell tree.
- .env.vercel.production renamed to .OLD so an accidental
`vercel --prod` from CLI doesn't reupload the stale Neon URLs over
the live Hetzner Postgres (memory/pattern_vercel_cli_env_local_override.md).
.gitignore extended to keep the .OLD file out of git too.
- DATABASE_URL + DATABASE_POOL_URL moved from a single-branch preview
scope to all-preview, so future PRs build without the
"DATABASE_URL is required" build crash we hit on the
arch/control-stream-no-poll branch.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>