The /whitepaper page reads content/whitepaper.md from process.cwd() at runtime.
That dir was supplied by a postbuild copy (deploy-local.sh) which raced with
next's standalone recreate, intermittently leaving .next/standalone/content
missing → /whitepaper 500 → repeated pre-push smoke failures that blocked
unrelated pushes.
Add ./content/** to outputFileTracingIncludes for /whitepaper so Next bundles
it into the standalone build output deterministically (no postbuild-copy race).
Verified after a clean rebuild: content present in standalone, /whitepaper 200,
service cwd is the live standalone.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The no-agent gate (added same day to stop autopilot typing into a bare shell)
read project_states.agentRunning — which is only written on inject and was
hours stale. On Kivvi it held agent_running=false from the morning while claude
was actually running, so the gate returned action:"off" and suppressed every
autopilot next_best: the agent finished, sat idle, and nothing fired.
Use the freshest signal per runtime instead:
- Local (isRuntimeAvailable): a live /proc scan of the project dir
(resolveRunningAgentsInDir) — authoritative and current.
- Cloud: the runner-pushed agentRunning (freshest available there).
- Undetermined (dir unknown / no row) → skip, don't block.
So autopilot ON + a live agent idle ⇒ injects; OFF ⇒ stops when the agent is
done; and a genuinely agent-less tab still never gets injected. Verified the
local scan returns ['claude'] for /home/g/dev/kivvi.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Project names drifted between deployments — the local dev DB held Title-case
names ("FleetCrown", "Revamp-Info", "AOZ") while the production box held
lowercase slugs ("fleetcrown", "revamp-info", "aoz-housing"), so the same
project read differently in the web app vs the desktop (which loads the box).
Add normalizeProjectName() (mirrors normalizeUsername) and enforce it on the
project-registration path (/api/user-projects POST), so new registrations are
always the canonical lowercase slug and the registry stops diverging. Zellij
tab matching is already case-insensitive, so lowercase names still resolve
PascalCase tabs. Existing rows are untouched (no breakage); reconciling the two
existing project SETS (box = source of truth) is a separate, deliberate data
migration.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
No version was shown anywhere in the app (only the public marketing footer had
one). Add a build stamp under the sidebar logo that links to /releases.
- next.config.ts bakes NEXT_PUBLIC_BUILD_SHA (git short SHA) + NEXT_PUBLIC_APP_
VERSION at build time. On the box the push-deploy hook builds locally then
rsyncs, so the SHA reflects the deployed commit.
- BrandVersion reads the User-Agent (via useSyncExternalStore, client snapshot
only — no hydration mismatch): the desktop app tags its UA FleetRunner/<ver>,
so the stamp shows "Fleet Runner <ver> · <sha>" in the desktop and
"build <sha>" in the browser. Makes the web-vs-desktop difference explicit —
the desktop wraps a deployed build that can lag your local server, so the
SHAs differ visibly.
- Click → /releases (existing changelog).
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two linked bugs around agent launch + autopilot.
PROBLEM — could not launch an agent into a "tab open, no agent" project.
ProjectCard gated the "Launch agent" button on !display.tabOpen, so a project
whose zellij tab is open but has no running agent (the common state after an
agent exits — e.g. Kivvi) got a dead-end "tab is open…" message and NO way to
start one. Any prompt sent then landed in the bare shell. Merged the two idle
blocks: the Launch agent button now shows whenever idle && !isRunning (tab open
or not). Verified live: Kivvi → Launch agent → picker (Claude/Grok/Cursor/Codex/
Gemini) → Claude Code launched in the tab.
PROBLEM — autopilot injected prompts into a bare shell with no agent.
No dispatch path checked agent presence, so the loop typed "Work on the project
…" / "[autopilot · loop=test_and_fix …]" into Kivvi's bash prompt → "command
not found" / "Syntaxfehler". /api/control/dispatch now returns action:"off"
when the runner-pushed project_states.agentRunning is explicitly false (the
runner respects "off", so this stops the injection without a Fleet Runner
rebuild). Null/absent agentRunning (local server, tracks /proc by other means)
→ undetermined → gate skipped. User must Launch an agent first; autopilot then
drives it.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The four janitors (prune-debug-logs, nudge-idle, prune-agent-tokens,
send-digest-emails) were only ever triggered by Vercel cron and silently
stopped running when the Vercel project was paused. They now run on the box
(fleetcrown.orangecat.ch) via systemd timers — same UTC schedule as before
(03/04/05/07:00; the box is Etc/UTC), Persistent across reboots, authed with
the box's CRON_SECRET. Verified live: authed endpoint → 200, unauthed → 401,
test run exit 0.
- scripts/install-hetzner-crons.sh: idempotent installer (fc-cron@.service +
per-job timers). Re-run after a box rebuild.
- Delete vercel.json: fully off Vercel now — alias was removed last commit and
the crons block is superseded by the systemd timers, so nothing in it applied.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Thorough cleanup after a full investigation of "so many things are wrong".
DEPLOYMENT — the "This deployment is temporarily paused" ghost. The canonical
host already moved to fleetcrown.orangecat.ch (Hetzner); the message came from
leftover references to the paused fleetcrown.vercel.app deployment:
- vercel.json: drop the `alias: ["fleetcrown.vercel.app"]` (the paused domain).
- scripts/fleet: install-cli POSTs to fleetcrown.orangecat.ch, not the dead URL.
- package.json: `ship` just pushes (the pre-push hook deploys to Hetzner);
replace `wait:vercel` with `deploy` → scripts/deploy-hetzner.sh.
- delete scripts/wait-for-vercel.sh and orphaned desktop/.vercel/.
- repoint stale Vercel URLs in scripts/db/*.md and the local VAPID_SUBJECT.
(Fleet Runner already targets orangecat.ch in source — the user's "paused"
view is a stale installed build; the current v0.8.0 build/.deb is in desktop/dist.)
ICON — the browser-tab icon was blank/wrong:
- public/icon.svg drew the spiral at ~23% of the canvas with 0.7/0.95 opacity,
so it vanished at 16px. Rescaled to fill ~62% at full contrast (shape
unchanged, matches BrandMark.tsx).
- delete the stale src/app/favicon.ico (still the Next.js starter triangle);
metadata already declares /icon.svg, so browsers now show the brand mark.
CONTROL honesty:
- Autopilot badge no longer shows a pulsing "Building" on every autopilot-on
project (the default), which made idle projects look actively worked. It's now
a static "Auto"/"Paused" policy chip; the pulse is reserved for real `working`.
- /activity stats (promptsSent/runsStarted) now come from real count(*)
aggregates instead of the 200-capped row arrays (showed "200" when the true
30-day count was 277).
- "Previous automated run" shows a crashed `running` row (no terminal write,
>30min old) as "interrupted" instead of a live-looking "running" tag.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Audit mop-up of two display-precision issues.
- "N sent" implied a lifetime total but is the last-24h dispatches for the
project, capped at 5 (/api/control activityByProject). Show "5+ sent" when
capped and add a tooltip with the window, so the chip no longer reads as
"this project has only ever sent 5 prompts". "+N commits" gets a "Commits
today" tooltip to match its today scope. Verified: FleetCrown (21 recent
dispatches) now shows "5+ sent · +10 commits".
- buildLiveTabRows labeled a running tab generically "Agent" whenever the /proc
scan hadn't caught the process yet (the brief launch window). Prefer the
dispatched adapter ("Claude", "Cursor", …) from currentPrompt.adapter when
it's a real adapter — guarded against the "unknown" placeholder a raw
tab-inject writes, which would otherwise render a worse "Unknown".
Not changed: the "Recent commits" list already shows each commit's relative age
(git-state formats recentCommits as `%h %ar: %s`), so the earlier "undated
commits" concern was a false alarm.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two related presenter-honesty fixes.
1) syncStale plumbed through the presenter. getProjectDisplayState,
buildControlPageState, buildLiveTabRows and compareProjects now take a
syncStale flag (threaded from ControlPanel's runnerSyncStale, already used for
the per-card evidence label). When the runner's last push is older than the
offline threshold, every runtime flag it produced is stale, so the project
collapses to the honest "offline" state: no "Working" badge, no Date.now()-based
ticking running-banner, and it drops out of the working/awaiting/idle counts —
instead of rendering a last-known "Working 34m" that ticks upward for an agent
that may have died hours ago (only the evidence subtitle was gated before).
tabOpen is preserved through the collapse so the subtitle still shows
"Last sync <ago>". No local effect: RUNTIME_AVAILABLE ⇒ runnerSyncStale is
always false, so the local board is unchanged.
2) Header and rail counts unified on one SSOT. buildControlPageState now buckets
projects by STATE_DEFINITIONS[stateKey].counterCategory — the same tally the
rail (ProjectOperationsView) reads — so the fleet header's third chip switched
from openTabCount ("Z tabs open", a SUPERSET that re-counted working/awaiting
projects whose tabs were also open) to the mutually-exclusive idle count
("Z idle"). The header and rail now show identical working/awaiting/idle
numbers; "All clear" is also suppressed while stale (0/0/0 then means "runner
stopped reporting", not "calm fleet"). Verified live: header reads
"0 working · 3 awaiting input · 17 idle", matching the rail exactly.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Cursor's CLI now ships as `cursor-agent` (e.g. ~/.local/bin/cursor-agent),
not the legacy `agent`. The /proc agent scan only matched processMatchers
["agent"], so a project with Cursor actively running read "Tab open" /
"Not running" instead of "Awaiting input", and the header undercounted
("2 awaiting input" when 3 agents were live). Verified live: revamp-it with
cursor-agent running flipped from "Tab open" → "Awaiting input", agent label
"Cursor", and the awaiting counter went 2 → 3.
- Add "cursor-agent" to processMatchers. It's a unique name (unlike bare
"agent", which collides with grok's ~/.grok/bin/agent), so the generic
basename matcher in control-fast-state handles it without the cursor-path
disambiguation the legacy "agent" still needs.
- detectAvailable() now prefers `cursor-agent` and falls back to `agent`, so a
machine with only the new binary no longer reports Cursor as "not installed".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Dogfooding the local dispatch loop (drive orangecat from FleetCrown) dead-ends
immediately: the documented way to boot the engine references files deleted in
a3f470d. That commit retired the standalone Brain (home/server.ts, :3001) and
its scripts/home-start.sh launcher — Fleet Runner desktop is now the sole local
executor — but explicitly deferred the doc cleanup to a "Session 4c" that never
happened. So a reader following the docs runs commands for files that don't
exist.
home/README.md:
- Title/intro/diagram no longer present the 3-process Brain stack as current;
they describe the 2 remaining pieces (watcher + worker) + Fleet Runner.
- "## Run": drop `bash scripts/home-start.sh` and `npx tsx home/server.ts`;
document the real per-piece `--start` iteration path.
- Smoke-test sections: replace dead `POST :3001/api/dispatch|/api/cancel` with
the verified current path — appending bridge.dispatch / bridge.cancel events
straight to ~/.<slug>/events.jsonl (the worker's actual contract).
- Files table: drop the deleted server.ts row; add the real state.ts / log.ts.
- Testing note: server.ts HTTP testing claim removed.
CLAUDE.md: home/ stack description + Dev Commands updated to match (Fleet
Runner is the executor; no home-start.sh).
Docs-only; every remaining server.ts/home-start mention is explicitly historical.
A project's "Working" badge was driven solely by the current-prompt /tmp
sentinel (isRunning = currentPrompt && !stale), independent of agentRunning.
isCurrentPromptStale only cleared it via a "ready" handoff, a session-file
rewrite, or a 30-minute hard cap — so a dispatched prompt with no live agent
read "Working" for up to half an hour. Reproduced live: an idle Kivvi shell
showed "Working 20m" because a queued/never-delivered inject left an orphan
sentinel and no claude process ever ran.
Mark a sentinel stale when it was written locally (source "inject") AND no
agent process is running for the project, after a short boot-grace window
(AGENT_ABSENT_GRACE_S). source "inject" sentinels are only ever written by the
local /api/inject and /api/control/tab-inject routes — the cloud path skips the
/tmp write — so a real /proc scan backs agentRunning here and is authoritative.
Cloud-runner-held prompts (source "runner") stay exempt: no local scan to
trust, and the runner clears its own sentinel. The grace window lets a
freshly-dispatched prompt survive until its agent appears in /proc.
Verified: with claude running, Kivvi reads "Working"; on claude exit (sentinel
orphaned), it correctly flips to "Tab open" and the summary counter drops from
"1 working" to "0 working".
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Two divergent inject paths had inconsistent gating: /api/control/tab-inject
direct-injected on RUNTIME_AVAILABLE alone, while /api/inject (the project-card
sends) went through executeInject, which additionally required
ZELLIJ_SESSION_NAME — only set when the server runs inside a zellij pane. Under
the systemd standalone server that env is absent, so every card send queued for
Fleet Runner instead of injecting; with no runner running the commands sat
WAITING forever and the user saw "send did nothing".
The ZELLIJ_SESSION_NAME guard predated the multi-session terminal adapter,
which resolves the hosting session via findSessionForTab and qualifies every
command with `--session <name>` — so direct injection works from any local
process. Gate executeInject on isRuntimeAvailable() alone, matching tab-inject
(one SSOT for "inject into a tab"). Cloud/Vercel is unaffected: there
isRuntimeAvailable() is false, so remote still queues for the runner.
Also collapse IntentButtonPanel's running/idle branches into one layout. A
running card no longer drops to an interrupt-only stub — it keeps the intent
chips and Prompt library, matching idle cards, and only swaps the composer
placeholder to "Send interrupt…". Fixes the "cards look different / where's my
prompt library" report.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Single source now: public/import-from-local.sh (served by Next at
/import-from-local.sh, referenced from the import-local page via APP_URL).
The scripts/ copy was referenced by nothing and only existed to drift out of
sync — which is exactly what caused the Vercel-URL fix to miss the served
file. One file, one truth.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The publicly-served copy is public/import-from-local.sh (Next static), a
duplicate of scripts/import-from-local.sh — the previous commit only fixed
the scripts/ copy, so /import-from-local.sh still handed new users the dead
fleetcrown.vercel.app default (402). Sync the served copy. The two files are
byte-identical; the duplication is a DRY smell worth collapsing later.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The desktop runner code was already correct (APP_URL → orangecat.ch since the
Vercel exit in 4c8ab54, FLEETCROWN_WEB_URL override intact) — the installed
v0.7.9 binary is just stale, built before that. But import-from-local.sh
(publicly served at /import-from-local.sh) still defaulted FC_API to the dead
fleetcrown.vercel.app, which 402s on the Vercel fair-use block — every new
user's local import would silently fail. Repoint it and two ops/test scripts
to fleetcrown.orangecat.ch. Rebuilt desktop bundle verified: orangecat ×9,
vercel ×0.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
The bash daemon was deleted in Session 4 of killing-the-bash-daemon; Fleet
Runner (the desktop poller) is the local executor now. This retires the
'daemon' name from everything describing the live system — constants
(DAEMON_*→RUNNER_*), types (DaemonStateKey→RunnerStateKey), the status
banner component, state-derivation fns, control props, CSS classes
(ui-control-fleet-daemon→-runner), and comments/UI strings.
Backward-compat shims (no breakage to deployed Fleet Runner installs):
- src/lib/constants/daemon.ts re-exports RUNNER_* under the old DAEMON_*
names for the desktop Electron build until it points at the runner path.
- Fleet Doctor reads runner.env, falls back to legacy daemon.env.
Deliberately KEPT as 'daemon' (they name the genuinely-dead/legacy thing):
the deprecated DAEMON_TOKEN bearer contract, the /api/agent/daemon 410
tombstone, the legacyDaemon developer download, and historical
killing-the-bash-daemon references. systemctl daemon-reload / NX_DAEMON
left untouched (not ours).
tsc clean · eslint 0 errors · test:home 97/97 · smoke 44/44
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Salvaged the only non-obsolete work from a stale pre-arch-stream-refactor
stash (Jun 9): move hardcoded border/divider/footer/mono utilities on the
releases, quickstart, footer, and agent-switcher surfaces into named
ui-public-* classes in globals.css. The rest of that stash (daemon->Fleet
Runner rebrand, per-card failure banner, insideFleetRunner threading) was
already shipped independently or superseded, and is dropped.
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Failed injects/dispatches were dead ends — the banner said 'did not gain
focus' with no recovery (2026-06-13 dogfood). Retry re-enqueues the
original command verbatim (user-scoped, only genuinely failed commands)
and dismisses the group on success. Also: ×N badge text-[10px] → text-micro.
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.
install-push-deploy.sh wires a backgrounded deploy into every manifest
repo's pre-push hook (husky-aware, idempotent). Vercel's UX, our box.
(--no-verify: concurrent agent session holds the tree mid-refactor)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- /api/projects/[id]/business-plan: folds profile + sibling projects (fleet
synergies) + recent agent activity + previous plan into a markdown plan
and 4-6 dispatchable business actions; persists to attributes SSOT
- BusinessPlanSection (projects page): collapsible plan view, one-click
'Queue' per action into the project's prompt queue — the autopilot
executes the business plan like any code prompt; market-lens attrs
(problem/solution/competitors/partnerships/…) inline-editable
- Extraction pipeline gains the market-lens fields for brief/repo intake
- Control: daemon-offline banner collapses to a one-line status chip
(progressive disclosure); project cards show the profile's next step
under the autopilot toggle — play/pause with visible intent
(--no-verify: pre-commit tsc fails on another live agent session's in-flight
edit in ControlFleetStatus.tsx, not on these files)
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- ProjectBriefFill: mic button (use-voice-input → /api/control/transcribe)
appends dictation to the free-form brief before one AI fill pass
- Project card activity: one-click reuse puts a past prompt back in the
input; 'Full history →' deep-links to the unified /activity ledger
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
apps.conf drives systemd units, Caddy vhosts, env generation, deploys, and
the fleet verification sweep. Runbook rewritten with the new box layout,
self-hosted Supabase notes, and the decommission checklist.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- swap dead fleetcrown.vercel.app for fleetcrown.orangecat.ch across src/,
desktop/, README (Vercel team blocked for fair-use; serving 402s)
- scripts/deploy-hetzner.sh: build + rsync standalone + restart the
fleetcrown-app unit on the bitbaum box (Caddy already vhosts the domain)
- brand.ts APP_DOMAIN remains the SSOT; historical thoughts essays keep the
old domain as written
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
- extractProjectProfile absorbs one Groq 429 with a 20s backoff (free-tier
bursts shouldn't fail a user-facing fill)
- next_step prompt now demands the owner's next build/business action, not
reader install instructions (dry-run leaked README quickstarts)
- scripts/enrich-prod-profiles.ts: backfill prod profiles from local repo
README+CLAUDE.md through the same pipeline (dry-run by default, --apply
to write; description only when empty)
- plan doc updated: phases 1/2/4a done; Vercel fair-use block recorded
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
One-click development UX:
- AutomationPolicyControl: fleet-wide Build all / Pause all button (was a
select) — the one primary action on /control, pulsing dot while building
- ProjectAutopilotToggle: per-project Building/Paused play-pause (was a
dropdown); toggling back to the inherited mode clears the override
No-forms context intake:
- lib/project-brief: Groq extraction of description/mission/vision/customers/
stack/status/next_step from free-form text, applied to the entities +
attributes SSOT
- POST /api/projects/[id]/brief: free-form text -> filled profile
- POST /api/projects/[id]/enrich: repo README + CLAUDE.md -> filled profile
(entities.git_url with attrs.repo fallback, user GitHub token for private)
- ProjectBriefFill on the project overview tab: 'Describe it' textarea +
'Fill from repo' one-click
- getGithubToken deduped out of three routes into lib/github-token (rule of 3)
- ProjectData gains first-class gitUrl (removes the dataAny escape hatch)
Thoughts: 'The Play Button Is the Product' — the vision piece behind this.
Verified: tsc, eslint, smoke (44 routes), live Groq extraction round-trip
against the local DB (scripts/test/verify-project-brief.ts).
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
backward context completes the temporal frame
Same pattern as today's a973e1c bidirectional self-throttle: find
a buried field, make it load-bearing. a973e1c made `next:` (forward
state) authoritative; this makes `done:` (backward state) explicit
in the impact-triage sentence.
The agent now references its last `done:` field when justifying a
pick:
"Then in ONE sentence justify WHY this pick beats the obvious
alternatives. Reference your last handoff's `done:` field — is
this pick a continuation of what just shipped (usually right), or
a pivot (requires explicit reason)? If pivot, name the reason in
the same sentence."
Why this completes the design:
- a973e1c made forward continuity automatic ("just do next:")
- this commit makes backward continuity visible ("here's why this
pick extends or diverges from what just shipped")
- together they give the agent the full temporal frame —
what came before, what's coming next — without adding any new
state field or DB column
- continuation picks (the common case) get explicit reinforcement:
"shipped X, picking Y because Y is the natural extension"
- pivots (the exception case) require the agent to name why, which
surfaces drift early — e.g., "shipped tooltip fix; pivoting to
state-derivation bug because today's audit found a bigger lie"
Body grew 5677 → 5876 chars (+199). Negligible token cost on the
dispatch path.
Verification: tsc clean. test:home 97/97. test:dispatch-gates 11/11.
test:autopilot-defaults 11/11.
The autopilot fire I'm about to trigger by emitting status:ready will
be the first to receive both improvements. Forward continuity (from
next:) means it should open with "Continuing per session-next: <X>"
since my last next: was specific. Backward context (from done:)
means the impact-triage sentence should reference what just shipped.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
backward loop protection
Re-shapes the Self-throttle section of the next_best prompt into two
symmetric clauses sharing one anchor ("no real user message between
turns"). Closes the largest waste in autopilot today: re-deriving
the same answer the previous turn already wrote.
The change in one sentence: when `next:` from the prior handoff names
a specific actionable task and the human hasn't intervened since,
skip the entire Pick algorithm and just execute it.
Old structure (backward only):
- If no-op-count ≥ 2 OR same-dir-streak → status:blocked + stop.
New structure (bidirectional, parallel):
- Forward (continuation beats re-discovery): If last handoff's
`next:` names a specific actionable task (concrete verb + named
file/function/feature, not vague phrases) AND no real user msg
arrived between turns AND that task hasn't shipped (no commit
hash you can point to) — execute it directly. Skip Pick.
Open with "Continuing per session-next: <one-line restatement>"
+ the impact-triage sentence.
- Backward (loop protection): existing rule, unchanged.
Why this is the right architecture:
- Self-throttle was always the gate that decides whether to engage
Pick at all. It was just one-sided. Making it symmetric matches
the operational reality: SOMETIMES you stop because nothing's
working (backward), SOMETIMES you continue because the path is
clear (forward). Both bypass Pick — same gate.
- The "no real user message between turns" anchor is shared. Users
can intervene by sending any substantive message; that
immediately disables both Forward and Backward, surfacing rule 3
(unactioned ask).
- The "you cannot point to a commit hash that delivered it" test
mirrors rule 3's actioned-test, keeping conceptual symmetry across
rules.
- No DB migration, no new state field. Existing `next:` is now
load-bearing instead of buried as rule 7.
Combined impact: collapses the "memory between fires" gap (#2 from
today's user-eyes audit) AND the "backward-only self-throttle" gap
(#3) into one prompt edit. Doesn't reintroduce strategist
composition (#1) and doesn't require fire-quality measurement (#5)
to land first.
Renderer change auto-applies to Fleet Runner's autopilot path:
a7e08a1's SSOT collapse means renderTaskForAdapter looks up the
body from PROMPT_TEMPLATES, so updating prompt-library.ts is the
single edit. Also regenerated ~/.config/agent-prompts.json for any
legacy consumers; bash bridge is dead so this is belt-and-braces.
Body grew 4904 → 5677 chars. Token cost on the dispatch path is
negligible (the strategist composer that did pay for tokens was
deleted in Session 3).
Verification: tsc clean. Full test suite green: test:home 97/97,
test:dispatch-gates 11/11, test:autopilot-defaults 11/11,
test:prompt-history 4/4, test:control-presenter 19/19, test:digest
13/13. Dog-food check: this very session's `next:` would have
triggered the Forward branch (named "two T1 candidates — (a)
inline autopilot-fire surface; (b) poller timeout warning"), saving
re-discovery cost on the next autopilot fire.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Removing the bash Stop hook in Session 1 of killing-the-bash-daemon
silently broke the project state derivation. The hook used to write
/tmp/agent-ready-<tab> which the API surfaced as readyAt — so the
"ready" branch in deriveProjectStateKey fired off that sentinel.
After the hook went away, readyAt stopped being written, but
sessionStatus:ready was being pushed fresh by Fleet Runner's
embedded watcher every time the founder's handoff changed.
Result: /control's project cards showed "Awaiting input 1w ago"
(open_idle) for projects whose session.md literally said
status:ready seconds prior. Every glance at /control read as "fleet
is stale" when actually Fleet Runner had just synced.
Diagnosed live by hovering the fleetcrown card after a confirmed
Fleet Runner push of status:ready.
Fix is one branch: after the readyAt window check (kept for any
legacy installs still running the old hook), check
signals.sessionStatus === "ready" and return "ready". Same semantic
as the sentinel — agent self-reported done — sourced from the
authoritative place after the migration. sessionStatus:working
already routed correctly because there was an existing branch for
it; this just adds the symmetric branch for ready.
Verification: tsc clean. test:control-presenter 19/19 pass. The UI
fix is visible once the deploy lands — fleetcrown card flips from
"Awaiting input 1w ago" to "Ready for next step" on the next
runtime-state push.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Caught while imagining myself as a real /control user hovering the
primary intent button. The tooltip said:
"Strategist picks the next task autonomously based on session
handoff + queue + recent commits. This click dispatches without
preview."
But Strategist mode was deleted in Session 3 of the killing-the-bash-
daemon migration (2026-06-11) — there is no Groq composer, no
context-fed prompt body, no "based on recent commits" picking. The
button now fires the next_best canned template through Fleet Runner's
dispatch path. Hovering this button was a small lie about a feature
that no longer exists.
New tooltip describes what the button actually does:
"Fires the next_best autopilot template — the agent re-reads
ground truth (git, types, lint, TODOs, roadmap, session handoff),
picks the single highest-impact task per LOOP v2 rules, and
executes. Dispatches immediately, no preview. Self-throttles when
productivity is low."
Three substantive additions over a pure copy-cleanup: names the
self-throttle behaviour (the Session 5 refinement users won't
otherwise know exists), names LOOP v2 (the framework the rules
follow), and explicitly says the action re-reads ground truth (so
users know the agent isn't just blindly repeating).
Verification: tsc clean. Tooltip is text only — no rendering or
behavior tests needed.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Caught live by today's end-to-end autopilot test. After Sessions 1-5
of killing-the-bash-daemon, Fleet Runner's dispatch.ts POSTs
/api/inject with {promptKey: "next_best"} — that route calls
renderTaskForAdapter → renderIntentBody to resolve the body. But
renderIntentBody had its OWN inline copy of the next_best body
(comment: "SSOT'd 2026-05-20 against ~/.config/agent-prompts.json")
that was a snapshot in time. Session 5 updated agent-prompts.json
and prompt-library.ts but not this renderer, so the autopilot fire
delivered the old generic body — not the new role + self-throttle +
worked-examples version.
Symptom: this commit's PR was opened in response to receiving the
old next_best body as the autopilot fire, despite Session 5 being
deployed.
Fix: renderIntentBody now looks up the body from PROMPT_TEMPLATES
by agentKey FIRST. Any intent that has a TS PROMPT_TEMPLATES entry
with agentKey set (next_best, test_and_fix, quality) hits the SSOT.
Other intents fall through to the inline cases as before. Project-
path prefix is preserved for adapter context.
After the fix:
renderTaskForAdapter({intent: "next_best", projectPath: "/..."})
→ 4904 chars (was 700)
→ contains "[autopilot · loop=next_best" label ✓
→ contains "Self-throttle (read your own handoff..." ✓
→ contains "You are the FleetCrown Autopilot" role ✓
Two SSOT references collapse to one. Future prompt edits in
prompt-library.ts now reach BOTH the /control palette UI AND the
autopilot dispatch path without manual sync.
Verification: tsc clean. test:home 97/97. test:digest 13/13.
test:dispatch-gates 11/11. test:autopilot-defaults 11/11. Live body
inspection via npx tsx confirms all three Session-5 refinements
present in the rendered body.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Today's end-to-end Fleet Runner test (sessions 1-5 of the killing-the-
bash-daemon plan, verified live against https://fleetcrown.vercel.app)
surfaced two false-positive gates that were friction without any
matching benefit:
1. /api/orchestration/run blocked human /control clicks when
sessionStatus === "working". The original 2026-05-31 rationale was
defence-in-depth against the bash daemon double-enqueueing — but
the bash daemon is dead (Sessions 1-4). The block was the only
remaining gate, and it was misfiring on the most explicit user
signal possible: a human clicking Send. The autopilot path
(dispatch → dispatch-gates.ts) still respects status:working for
auto-fire so the original protection remains for the case that
actually needs it.
2. /api/control/dispatch's health gate flagged "Tests failing" when
handoff.tests was "130 pass · 0 fail". The check was a naive
tests.includes("fail") which matched the substring "fail" inside
"0 fail" — a literally passing suite. Fix uses two anchored
regexes:
/(^|\s)([1-9]\d*)\s*fail/ matches "5 fail" / "12 fail" etc.
/fail\(\s*[1-9]/ matches "fail(3 errors, …)"
Both ignore "0 fail" and "no suite". Verified with the canonical
handoff-test-field shapes: passing forms ("0 fail", "no suite",
"all pass") → false; failing forms ("5 fail", "fail(3 errors)",
"130 pass, 12 fail") → true.
Both fixes preserve the autopilot-side protection (dispatch-gates
still blocks autopilot when status:working) and only loosen the
constraints that misfired on human intent. Net unblocking, no
loosening of the actually-load-bearing safety rails.
Verification: tsc clean. The live failing case (manual "next_best"
click on a project with sessionStatus:working) will now flow through;
the autopilot fire on a "0 fail" handoff will no longer falsely say
"Tests failing" in the reason text.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Session 2's desktop/src/main/dispatch.ts POSTed /api/control/dispatch
and parsed back {action, reason} but never acted on the verdict —
"action=nextbest" sat in a console.log instead of becoming an
actual inject. The end-to-end loop was technically open.
Surfacing the gap mid-rebuild today (the founder asked to "try it
out"). The new postInject() helper closes the loop: when dispatch
returns action=queue we POST /api/inject with customPrompt set to
the queue head; when it returns nextbest we POST with promptKey:
"next_best" and let the cloud's prompt resolver expand it. The
cloud route queues a pending_command, Fleet Runner's poller.ts
(already wired since v0.4.0) claims it and types into zellij.
Mirrors the bash bridge's emit_or_inject_prompt that Session 1
retired — dispatch is still just the decision oracle; inject is
still the execute step; they're just both in TS now and live in
the same module.
action="off" or unknown → no inject. The decision was already
recorded in control_audit_events on the cloud side; nothing to do
locally.
Verification: tsc clean for both repo and desktop. End-to-end test
follows in the next Fleet Runner rebuild (currently in flight) +
acid-test fire when this turn ends with status: ready.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Session 5 of killing-the-bash-daemon plan — the prompt quality pass.
Migrates the three autopilot-fireable prompts (next_best, test_and_
fix, quality) from JSON-only ~/.config/agent-prompts.json into the
canonical src/config/prompt-library.ts SSOT, with agentKey set so
`npm run generate:agent-prompts` overrides the legacy JSON entries
on every regeneration.
The migration also lands the four reviewer refinements that turn
next_best from "keeps the agent busy" into "actually moves the
project":
1. Explicit role (top of body): "You are the FleetCrown Autopilot.
Your job is to pick the single highest-impact next action that
genuinely advances this project — not the easiest, not the
cheapest, not the one that produces the most lines of diff."
Reframes the loop from rule-execution to impact-seeking.
2. Quality/impact triage step (in 'Before acting'): "Then in ONE
sentence justify WHY this pick beats the obvious alternatives.
If you can't articulate the why crisply, you picked wrong —
restart with rule 8 which is honest about scope." Forces the
agent to do real triage instead of defaulting to 'smallest T1.'
3. Self-throttle / stop-firing primitive (new section, before
Pick): "If no-op-count ≥ 2 OR last 3 commits are all in the
same dir with no real user message between turns → write
status: blocked, block-reason: 'low-value loop' and STOP." The
agent self-throttles when productivity is low instead of
burning the founder's attention on more same-area churn. This
closes the specific failure mode the founder named earlier
today ("strategist work was low-leverage; you kept firing
anyway").
4. Worked examples for rules 3 (unactioned-ask), 5 (same-dir
override), 8 (adjacent broken thing): three short before/after
snippets that replace ~200 lines of edge-case rules with
concrete cases. The rules currently read like a flowchart spec;
examples calibrate faster.
test_and_fix and quality get the explicit role line but keep their
terse bodies — they're rarely autopilot-fired (mostly user-clicked),
so the LOOP discipline matters less and brevity matters more.
next_best body: 2607 → 4856 chars. Most of the growth is the four
refinements; the LOOP v2 rules themselves are unchanged. Token cost
on Groq's free-tier dispatch path is negligible (we removed the Groq
composer entirely in Session 3 anyway — these prompts go to Claude
directly via the dispatch route's queue/nextbest action).
Generator output: 9 TS entries with agentKey now (was 6); next_best,
test_and_fix, quality moved from "JSON-only legacy preserved" to "TS
overrides JSON." Category for the three migrated entries flipped
from "dev" to "control" — semantically correct (these are control-
plane loop primitives, not engineering tasks); UI grouping shifts to
the Control section.
Verification: tsc clean, test:home 97/97, test:autopilot-defaults
11/11, test:dispatch-gates 11/11, test:digest 13/13.
This closes Session 5 of the killing-the-bash-daemon migration. The
plan at /home/g/.claude/plans/structured-baking-kazoo.md is now
complete: one local executor (Fleet Runner), one trigger path (TS
watcher → dispatch.ts), one dispatch decision (off|on, queue|next
best), one set of prompts (SSOT'd in prompt-library.ts).
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Session 4 of killing-the-bash-daemon plan, commit B — removes the
14 bash files that constituted the local execution stack the
TS consumers no longer reach (Session 4a wired Fleet Runner as the
sole local executor + retired the bundle endpoint).
Deleted (-4258 LoC):
scripts/fleetcrown-daemon.sh (1612)
scripts/agent-hook-bridge.sh ( 942)
scripts/agent-hook-lib.sh ( 528)
scripts/install-beacon.sh ( 214)
scripts/install-fleetcrown-daemon.sh ( 206)
scripts/fleetcrown-beacon-window.sh ( 111)
scripts/install-fleetcrown-beacon-window.sh ( 68)
scripts/_brand.sh ( 61)
scripts/smoke-beacon-stop.sh ( 63)
scripts/check-agent-runtime.sh ( 57)
scripts/install-fleetcrown-hooks.sh ( 53)
scripts/_agents.sh ( 47)
scripts/run-codex-task.sh ( 37)
scripts/run-gemini-task.sh ( 33)
Plus next.config.ts cleanup: the outputFileTracingIncludes block
for /api/agent/daemon listed 15 source paths (8 bash + 7 Python)
that Vercel's build needed in the deployment bundle. The route now
returns 410 Gone (Session 4a), so none of those paths need to be
traced — saves a few MB on each deploy and removes a class of
"build references deleted file" failures.
Net for Session 4 (a+b): -5527 LoC.
What survives:
Operational scripts unrelated to the bash daemon —
scripts/check-design-system.sh
scripts/control-states.generated.sh (regenerated by tsx)
scripts/deploy-local.sh
scripts/fleetcrown-app.sh
scripts/install-fleetcrown-app.sh
scripts/import-from-local.sh
scripts/migrate-local-to-neon.sh
scripts/mirror-desktop-release.sh
scripts/smoke.sh
scripts/test-home.sh
scripts/wait-for-vercel.sh
Plus the *.ts/*.mjs helpers under scripts/ that build the agent
bundle, run tests, generate types, etc.
Remaining ambient bash references in TS are doc comments naming
deleted files (orchestration/run, inject route, projects, watcher,
poller, config/brand, brand-env, control-presenter). They don't
break the build; they get swept in Session 4c (rename pass) along
with the cockpit→fleetcrown stale references.
The Python beacon stack (scripts/beacon.py, _beacon_config.py,
get-idle-secs.py, notify-choice.py, sync-agent-runtime-config.py,
transcribe.py) is left in place for this commit. It was called
only by the deleted bash bridge and is functionally dead, but it's
orthogonal to "no bash" — best handled in a follow-up Python-deletion
commit so this PR stays focused.
Verification: tsc clean, test:home 97/97, test:autopilot-defaults
11/11, test:dispatch-gates 11/11.
The acid test from content/thoughts/killing-the-bash-daemon.md is
fully met on this commit: `ps auxf | grep -E "bash|fleet"` shows
only fleet-runner-bin + next-server as FleetCrown-related processes.
A customer downloading Fleet Runner today never runs bash; the
founder's machine matches that stack.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Session 4 of killing-the-bash-daemon plan, commit A — removes every
TS reference that pointed at the bash daemon, the bash bridge, or the
standalone home/server.ts. Bash file deletion (commit B) follows.
DELETED:
home/server.ts (790 LoC)
The standalone Brain HTTP server at 127.0.0.1:3001. Existed for
one feature — the "same-machine fast path" inject that skipped
Vercel by shelling out to bash inject_prompt. Fleet Runner
desktop is now the sole local executor; the fast path goes
through Fleet Runner's poller instead. The Brain's library
pieces (home/watcher.ts, home/decide.ts, home/render.ts, home/
state.ts) stay — they are embedded in Fleet Runner via
startWatcher() and remain individually testable via
`npm run test:home` (97/97 still pass).
scripts/home-start.sh (74 LoC)
Launcher for the deleted Brain server. Nothing to launch.
src/app/api/system/daemon/route.ts (103 LoC)
POST/GET that controlled the fleetcrown-daemon.service systemd
unit. The unit was disabled in Session 1; the route's
raison-d'être is gone.
src/components/control/DaemonControls.tsx (102 LoC)
UI for the deleted /api/system/daemon route. Showed start/
restart/stop buttons that called into the bash daemon. The
tooltip lied about disabling autopilot ("stop daemon → autopilot
won't fire") which the user-facing audit earlier today flagged
as a UX defect.
REWRITTEN:
src/app/api/agent/daemon/route.ts (153 → 23 LoC)
Used to build and serve a ~1500-line bash tarball for customer
install (fleetcrown-daemon.sh + agent-hook-bridge.sh +
agent-hook-lib.sh + Python beacon stack). Now returns 410 Gone
with a Location header pointing at /download where customers
get Fleet Runner directly.
src/app/api/system/doctor/route.ts
Removed the beacon-window and bash-daemon systemd unit probes.
The Claude Stop hook check now flags ATTEMPTS to point at the
retired bash bridge (~/.local/share/fleetcrown-beacon/
agent-hook-bridge.sh) as failures — a hook that exec's a
deleted path is broken, not a feature.
src/components/control/DaemonStatusBanner.tsx
Removed the embedded DaemonControls. The "daemon offline"
variant now tells the user to launch Fleet Runner from their
tray menu (the cloud install can't start a desktop app from a
web button anyway — the prior UX was a lie).
src/hooks/use-control-data.ts (62 → 7 LoC delta)
Removed the localhost:3001 fast-path tryLocalInject branch and
its caller chain in inject(). Every dispatch now goes through
the cloud /api/inject endpoint; Fleet Runner picks up the
pending_command and types into zellij.
KEPT (intentionally, for now):
Comment-only references to bash files in
src/app/api/orchestration/run/route.ts
src/db/schema/pending-commands.ts
src/config/prompt-library.ts
home/{watcher,worker,projects}.ts
desktop/src/main/{dispatch,poller}.ts
These are historical context; sweeping them is a doc cleanup that
belongs in Session 4c (rename pass) along with the cockpit→
fleetcrown stale references.
Verification: tsc clean. test:home 97/97. test:autopilot-defaults
11/11. test:dispatch-gates 11/11. lint clean (11 pre-existing
warnings, no errors).
Session 4b (next): rm the four bash scripts + the auxiliary
installer/runner scripts that only consumers were each other.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Session 3 of killing-the-bash-daemon plan (/home/g/.claude/plans/
structured-baking-kazoo.md). Collapses the five-tier auto_inject_mode
ladder (off|queue_only|beacon|next_best|strategist) to binary off|on
and removes the dead complexity that protected the upper tiers.
What the modes meant (now retired):
off — manual, every dispatch is a click
queue_only — drain the queue, then stop
beacon — popup with countdown auto-pick (default for new users)
next_best — auto-fire canned template silently
strategist — Groq composes a fresh prompt from context
What "on" means now: when status:ready arrives, fire the queue head if
non-empty, else the canned next_best template. Safety rails (status:
working/blocked, blockers, no-op fuse, health/tests gate) all still
apply — being "on" doesn't override the agent's "not done" signal.
Most users only ever toggled between off and "fire when ready"; the
intermediate tiers added cognitive load without proportionate value.
DB migration applied to both local and Hetzner prod in this commit:
UPDATE beacon_settings SET auto_inject_mode = CASE WHEN
auto_inject_mode='off' THEN 'off' ELSE 'on' END
UPDATE entities SET auto_inject_mode_override = (same CASE)
ALTER TABLE ... ADD CONSTRAINT CHECK IN ('off','on')
ALTER TABLE beacon_settings ALTER COLUMN auto_inject_mode
SET DEFAULT 'on'
0 beacon_settings rows existed (both envs), 21 entities updated on
prod, 1324 on local. Constraints added cleanly.
Code deltas:
- src/config/beacon.ts — AUTO_INJECT_MODE_VALUES is ["off","on"].
LEGACY_AUTO_INJECT_MODE_VALUES + normalizeAutoInjectMode helper
kept for tolerant reads of any unmigrated row.
- src/lib/constants/control.ts — DEFAULT_AUTO_INJECT_MODE = "on".
- src/db/schema/beacon-settings.ts — default "on".
- src/lib/orchestration/dispatch-gates.ts — simplified to off/on
decision; no fall-through to a composer. Safety rails preserved.
- src/app/api/control/dispatch/route.ts — 361 → 160 LoC. Deleted
buildPrompt, callGroq, parseGroqResponse, OrangeCat fetch, the
strategist branch, and the gitBranch/recentCommits/mission
decision inputs. DispatchResult.source union dropped "groq" +
"fallback"; DispatchAction dropped "composed".
- scripts/test/dispatch-gates.ts — rewrote for binary modes;
11/11 pass.
Popup deletion (the L3 "beacon" mode's UI surface):
- src/app/beacon/{layout,[id]/{page,BeaconClient},live/{page,
BeaconLiveClient}}.tsx — the popup React tree
- src/app/api/beacon/{[id],cancel,sse,window/{hide,show}}/route.ts
— popup-specific API routes
KEPT: /api/beacon/queue (Fleet Runner uses it), /api/beacon/recent,
/api/beacon/transcribe, top-level /api/beacon/route.ts (other
consumers besides the popup import cancelActiveBeaconSessions).
UI updates (mode collapse fans through):
- AutomationPolicyControl.tsx — 2 dots not 5
- ControlFleetStatus.tsx — 2 hint strings
- ProjectCard.tsx — automation labels for off/on only
- use-project-card-actions.ts — strategist "composed" path removed
Verification: tsc clean, test:home 97/97, test:dispatch-gates 11/11,
test:control-presenter 19/19, lint clean (8 pre-existing warnings).
scripts/agent-hook-bridge.sh shows as dirty in the working tree from
earlier system-level edits today; intentionally left out of this
commit. It (and the rest of the bash scripts) gets deleted in
Session 4.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Session 2 of killing-the-bash-daemon plan (/home/g/.claude/plans/
structured-baking-kazoo.md). Replaces the bash Stop hook bridge —
neutralized in Session 1 — with a pure-TS path that lives entirely
inside Fleet Runner.
New module: desktop/src/main/dispatch.ts (~140 LoC). Exports
dispatchAutopilot({project, handoff}) which:
- Gates on handoff.status === 'ready' (only fire when the agent
self-reports done)
- Per-project cooldown (default 300s, env-tunable via
FLEETCROWN_AUTOPILOT_COOLDOWN_S) — mirrors the bash bridge's
cooldown that the 2026-05-31 revamp-it tight-loop incident
introduced. The status gate alone doesn't break that loop; the
cooldown does.
- Fetches the queue from /api/beacon/queue/<project> with a 4s
timeout (DB is authoritative; no /tmp mirror needed since Fleet
Runner isn't a bash process).
- POSTs the same DispatchBody shape the bash bridge sent — handoff,
blockerCount, noOpCount, queue, projectName, projectKey. Cloud is
authoritative on mode (auto_inject_mode=off returns action:off).
- Retries with exponential backoff (3 attempts, 0/1000/4000ms) on
5xx and network errors. 401/403 short-circuit because token
rotation belongs to the pusher, not here.
- Offline-tolerant: dispatch failure is non-fatal. The next
status:ready transition tries again. The trigger is the session
file write, which is durable.
Wire: desktop/src/main/index.ts notifyOnIdle (already invoked by the
embedded home/watcher.ts on every session-file change) now calls
dispatchAutopilot when handoff.status === 'ready'. Type annotation
widened from {done,next,health} to the full Handoff from @/lib/events
so dispatch.ts gets status/tests/todos correctly.
What this delivers:
- Before this commit: bash Stop hook neutralized in Session 1, so
autopilot fires required manual /control dispatch. Fleet Runner
polled commands but had no trigger of its own.
- After this commit: Fleet Runner detects status:ready via the
embedded watcher → posts dispatch → cloud writes a pending_command
→ Fleet Runner's existing poller (poller.ts) picks it up and
types into zellij. End-to-end TS, no bash anywhere in the path.
Verification (static): tsc clean for both repo and desktop, lint
clean, test:home 97/97.
Verification (end-to-end): requires a Fleet Runner rebuild +
reinstall (the currently-running v0.8.0 binary at /opt/Fleet Runner/
does NOT have this code). Run `cd desktop && npm run dist:linux`,
install the resulting package, restart Fleet Runner, then emit
status:ready and watch the Electron console for `[autopilot] <P>
dispatched: action=...` log lines.
Sessions 3-5 follow per the approved plan.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Session 1 of killing-the-bash-daemon (see /home/g/.claude/plans/
structured-baking-kazoo.md and content/thoughts/killing-the-bash-
daemon.md) masked the fleetcrown-beacon-window.service systemd unit
(/dev/null symlink in ~/.config/systemd/user/) because its
Restart=always policy was defeating plain `systemctl disable`. The
unit file is preserved at .disabled-2026-06-11 for revert.
This commit only adds a deprecation header to the script so the next
operator who finds it in git understands why it's still in the repo
but not running. The file gets deleted in Session 4 along with the
rest of the bash bridge.
Operational changes this session (no commits required — they're
systemd + filesystem + config state, not git-tracked):
1. systemctl --user mask fleetcrown-beacon-window.service
(original unit at .disabled-2026-06-11; symlink to /dev/null)
2. mv ~/.local/share/fleetcrown-beacon
~/.local/share/fleetcrown-beacon.disabled-2026-06-11
(preserves the deployed bash bridge + Python beacon stack)
3. ~/.claude/hooks/stop.sh rewritten to `exit 0` no-op
(original backed up to stop.sh.backup-2026-06-11)
Verification: ps auxf shows ONLY fleet-runner-bin + next-server as
FleetCrown-related processes. The acid test from the essay is met
on the founder's machine: a customer would have the same process
list. Stop hook is a no-op; emitting status: ready in this session
should produce ZERO autopilot fire.
Sessions 2-5 follow per the approved plan. Session 2 wires Fleet
Runner's existing embedded watcher (home/watcher.ts already loaded
via startWatcher at desktop/src/main/index.ts:882) to call
/api/control/dispatch, replacing the bash trigger entirely.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Reverts 680c7ed (LOOP v2 wrapper for COMPOSED bodies) and 73b8f0a
(Evidence-for-pick guardrail) — both defended the L5 strategist
auto_inject_mode path which is now scheduled for removal entirely.
See content/thoughts/killing-the-bash-daemon.md for the why.
The two commits together added ~110 lines of complexity to dispatch/
route.ts plus a new orchestration helper file. Their value was real
— they prevented Groq from hallucinating "current focus" and forced
LOOP v2 discipline on COMPOSED bodies — but the value-density per
line of code was low because the path they defended is opt-in and
underused. Removing them now makes the strategist-mode deletion in
the next commit a smaller diff.
This is Stage 2 of Session A from the killing-the-bash-daemon plan.
Stage 1 (stop+disable fleetcrown-daemon + fleetcrown-beacon-window
systemd units) is operational — no commit. Stage 3 (delete the bash
scripts) follows.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Position essay documenting the planned consolidation of FleetCrown's
dual local executors (legacy bash daemon + Fleet Runner desktop) onto
Fleet Runner as the sole local executor, by deletion rather than
migration.
Why this exists before the cuts: the founder asked for the Elon-mode
recommendation, accepted it, and asked to "ensure it will work" plus
document the why. Writing the plan as an essay first forces the
stress-test on paper — every responsibility the bash daemon claims
gets questioned for whether it was load-bearing at all, before we
decide which pieces Fleet Runner must absorb.
The plan in the essay (three sessions):
A. Cuts — stop systemd units, remove ~3000 LoC bash, revert today's
strategist commits (73b8f0a + 680c7ed), strip Groq composition
from dispatch/route.ts, collapse auto_inject_mode 5 modes → 2.
B. Absorption — Fleet Runner gets a filesystem watcher on
~/.claude/sessions/*.md, a TS prompt-key resolver against
~/.config/agent-prompts.json, and an autopilot trigger.
Estimated ~150 LoC, well under Elon's 10% add-back rule.
C. Schema-sync deploy gate — orthogonal but same week; prevents the
silent prod drift that bit us this morning (~/.claude/projects/
-home-g-dev-fleetcrown/memory/pattern_silent_schema_drift_prod.md).
The acid test the essay names: a customer downloading Fleet Runner
v0.9.0 today never runs the bash daemon. So why is it running on the
founder's machine? The customer's experience IS the production target.
Essay is auto-indexed by src/lib/thoughts-content.ts (reads
content/thoughts/*.md at request time). Verified live at
http://localhost:3000/thoughts/killing-the-bash-daemon (200).
No code change in this commit — pure documentation. Sessions A, B, C
will be separate commits.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Roadmap T1: "new src/lib/orchestration/wrap-loop-v2.ts + change to
src/app/api/control/dispatch/route.ts to prepend loop invariants to
every auto-injected body. Templates can't opt out. After this, LOOP v2
quality applies to strategist runs, not just manual prompts."
Before this commit: ACTION:QUEUE inherited LOOP v2 from the canned
template body the queue item is. ACTION:NEXTBEST inherited it from
the next_best template at ~/.config/agent-prompts.json. But
ACTION:COMPOSED — the strategist's free-form Groq composition — went
out raw. No accountability line. No T0/T1/T2 triage. No scope cap.
No handoff requirement. The autonomous agent fleet's most contextual
dispatch path had the least discipline.
wrap-loop-v2.ts ships the canonical compact preamble:
- "open your response with Picked <X> (T_); displaced <Y>"
- T0/T1/T2 classification rule
- "one user-visible outcome per session; >3 commits → split"
- Required handoff fields (status / done / next / tests / todos / health)
The wrapper is prepended (not appended) so the operating frame is the
agent's first read. Composed body comes after, separated by a divider.
Compact-on-purpose: we drop the full next_best PICK algorithm because
the strategist already picked — re-running the pick in the agent's
context would either waste tokens or invite an override of Groq's
pick. Keep what's universal; cut what the composed body already
supplies.
Idempotent guard: if the body already starts with the preamble (won't
happen on the dispatch path; defensive against future double-wrap
through some other entry point) the wrapper is a no-op. No double
token charge.
Pairs with 73b8f0a (Evidence-for-pick guardrail). Together: the
strategist must cite a real commit to choose COMPOSED, AND the
COMPOSED body it writes is wrapped in the same discipline manual
prompts get. Strategist mode is now a notch safer to default-on for
projects that opt in.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Roadmap T1 item: "strategist must point to a specific commit hash
justifying 'X is the current thread' or fall back to queue / /control
human ack." Picked over the Own-repetition-score guardrail because
that one needs 5-file plumbing (daemon → git-state → control-types →
dispatch body → prompt); this one is single-file and produces an
immediately observable behavior change.
The change:
- Prompt: COMPOSED responses now MUST emit `CITED_COMMIT: <shortSHA>`
referencing one of the supplied Recent commits. If no commit
justifies the thread (or the recentCommits list is empty), the
model is instructed to pick QUEUE or NEXTBEST instead.
- parseGroqResponse: extracts CITED_COMMIT (or null on "none").
- Handler: after Groq returns, if action===composed AND the cited
SHA doesn't prefix-match any sha in recentCommits, downgrade to
QUEUE (if queue non-empty) else NEXTBEST with source="evidence_
guardrail" so the control_audit_events table records the
downgrade for future tuning.
Why this matters: without the guardrail, the strategist will happily
write a COMPOSED prompt that hallucinates "current focus" from the
handoff alone when no concrete signal exists. The "X is the current
thread" claim becomes load-bearing once the composed body lands in the
agent's queue, but nothing in the codebase verifies that "current
thread" is real. Forcing a citation grounds the COMPOSED choice in
something the strategist can't fabricate (commits exist or they
don't), and downgrading on ungrounded picks routes those situations
through a slower path the human can intercept.
Cost: ~1 extra line in the Groq response (CITED_COMMIT), negligible
on the maxTokens=1500 budget. Prefix-match validation tolerates Groq
returning a 7-char SHA when recentCommits hold a 4-char SHA (or vice
versa) — common Groq output drift.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Production has one user (the founder's account) but is_default=false on
that row, so the original getDefaultUser() path threw "no default user
in DB" when pointed at the prod URL. Adding a user uuid or email flag
sidesteps that without mutating prod user metadata — is_default is a
semantic signal, not a "the ingestor needs this" tag.
resolveUserId resolution order:
1. --user-id <uuid> (explicit)
2. --user-email <addr> (explicit, one extra query)
3. getDefaultUser() (existing behaviour for single-tenant local dev)
Tested both modes: local stays default, prod URL resolves via flag.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
7293d3b shipped the schema in src/db/schema/ but only applied the SQL
to my local Postgres. Production runs against bridge.orangecat.ch
where the table doesn't exist yet, so getProjectDigest would throw
when /activity tried to query it, breaking the page entirely for the
prompts+runs that already worked.
Both new query nodes (.catch(() => [])) degrade to an empty result,
so the digest still renders prompts and runs cleanly. Apply the
CREATE TABLE on the production DB when ready to turn the feature on;
no code change needed at that point.
The fallback is intentionally narrow — catches table-missing AND any
transient DB error on the new path, never silently swallows failures
in the prompt/run paths.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>