* 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>