After a PC restart, Fleet Runner now brings zellij + every agent back
without the user opening a terminal or typing CLI names. The last
runtime_snapshot.panes (extended with {tab, paneIndex, agentCli, cwd})
acts as SSOT for "what should be running" — Fleet Runner generates a KDL
layout with embedded `bash -c "cd … && claude"` per pane and spawns
`zellij --session fleet --layout`, bypassing zellij's press-ENTER
resurrection prompt entirely.
Injection is now self-healing end-to-end. Pre-flight ensureZellijReady
re-spawns the session if it died mid-day. /tmp/fc-cmd-<id>.done sentinels
make commands actually idempotent so a PATCH-ack retry can't fire the
same prompt twice. Post-flight watches ~/.claude/sessions/<tab>.md mtime
for 5s after inject and reports verified=false if the agent didn't pick
up — surfaced in AttentionBar via getRecentFailedCommands. The legacy
"No Zellij session found — start Zellij first" throw is replaced with a
synchronous spawn-default-session path so /api/agent/launch on
self-hosted servers self-heals too.
Settings → Agent gets a new Fleet Lifecycle section (auto-restore on/off,
fresh-spawn vs leave-alone for exited zellij sessions, session name,
auto-start at login). Stored as users.fleet_settings jsonb so future
knobs don't need a migration each time.
Bundled binary version-aware (Fleet Runner ≥0.4.0 ships zellij in
resources/bin and prepends to PATH). Inline tests for the KDL generator
run as a 9th suite under `npm run test:home` — 8/8 cases pass.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Each home/ module ships an inline test suite (state/decide/projects/
render/emit/log/watcher/worker — 76 tests total as of 00058f9), but
running them required eight separate npx tsx invocations. Added
scripts/test-home.sh that chains them in a stable order, captures
each suite's output, parses the N/M passed footer, and aggregates a
total at the end. Wired as 'npm run test:home' alongside the existing
smoke and check:design scripts.
The footer regex matches '^N/M' rather than 'N/M passed' specifically
because render.ts prints '12/12 intents render' — most suites use
'passed' but the loose anchor catches both shapes. Exits non-zero on
the first suite that fails (set -euo pipefail + a tracked total_fail
counter for the summary line).
Output of npm run test:home ends with:
✓ 76 total tests passed across 8 home/ self-test suites
No code change in home/. tsc unaffected.