How to work
Procedural version of the Daily driver loop — every step, the decision at each fork, and what to do when it breaks. Copy-paste the commands; branch at the decision trees.
mux → dashboard → run → detach/reattach → evolve → drift-check
1. Start the multiplexer
castellan multiplexer ensure
Spawns the in-tree PTY server if it isn’t already running, bound to ~/.config/castellan/castellan.sock (or --socket / a named --session).
Note:
ensureis idempotent — safe to run at the start of every session, scripted or interactive.
Decision — is the mux already up?
- Not sure →
castellan herd status. Exit non-zero or connection error means no server yet. - Working on a second, isolated workspace → add
--session <name>toensure(and to every subsequentherd/dashboardcall) so it gets its own socket and persist directory.
2. Open the dashboard
castellan dashboard
The ratatui control tower: agent list, pressure/pane tree, evolution archive. Writes ~/.config/castellan/statusline.json on every refresh for headless observers.
Keys: j/k select, Enter attach, r refresh, q quit. Full reference: Dashboard.
Warning: the dashboard needs a live mux socket. If it opens but shows nothing, go back to step 1 before debugging further.
3. Run an episode
Decision — do you need panes?
| You want | Command |
|---|---|
| Scheduler-led run through mux panes (daily default) | castellan run --goal "..." --plugin gridworld --mux |
| Offline / CI smoke, no mux required | castellan run --goal "..." --plugin gridworld |
| Headless verify/act loop (no TTY) | castellan run --goal "..." --plugin gridworld --rlm |
| NDJSON event stream for automation | castellan run --goal "..." --plugin gridworld --json |
| LLM/editor wired in | castellan run --goal "..." --plugin shell --mcp |
Every mode writes .castellan/episodes/<goal-id>.json on completion — that file is the input to evolve.
Note: default
castellan runis a deterministic plugin loop — the scheduler wakes agents from substrate signals, not from a manager LLM. Add--mcp/--modelonly on the verify path when you want LLM enrichment.
4. Detach and reattach
You don’t have to babysit a run in the dashboard. Panes and the mux server persist independently of your terminal.
# From inside an attached pane
# Ctrl+Q → detach, leaves the pane running
# From any terminal, later
castellan herd tabs # see what's live
castellan herd attach <pane-or-session>
Decision — dashboard says disconnected after reattach?
- Confirm the server is actually up:
castellan herd status - If not:
castellan multiplexer ensure(orcastellan herd serverfor the foreground form) - Re-open:
castellan dashboard
5. Evolve topology
Once you have a handful of episodes:
castellan evolve --episodes 16 --workspace .castellan/episodes
Decision — how much do you trust the mutation before it lands?
| Mode | Reads corpus | Writes proposals | Writes archive | When |
|---|---|---|---|---|
--plan | yes | no | no | Read-only preview — fitness estimate, drift preview |
--dry-run | yes | yes | no | Persist candidate proposals to .castellan/proposals/, review before applying |
--apply-proposal <UUID> | yes | resolves one | on accept | Apply a specific reviewed proposal (drift gate re-checked) |
| (default) | yes | — | on accept | One-shot generations — fine once the loop is proven |
Same two-phase gate is exposed over MCP as castellan_propose_mutation / castellan_resolve_mutation for agent-driven evolve. See castellan evolve.
6. Drift-check before you trust it
castellan drift-check
Validates the repo (and any pending topology mutation) against the verification manifest. This is the operator gate — contributors use the heavier ./scripts/verify.sh instead (see Verify before PR).
Honest scope:
drift-checkcatches structurally invalid or manifest-violating topology and repo guardrail regressions. It does not grade goal quality or plugin correctness — that’s what episode verdicts andcastellan vitalsare for.
Decision — drift-check failed. Now what?
- Read the reported
drift_violations/ guardrail diff. - Guardrail (repo) failure → fix per governance policies, rerun.
- Topology mutation rejected → the archive was not written; rerun
castellan evolve --dry-runand inspect.castellan/proposals/before retrying--apply-proposal. - Still stuck →
castellan doctor --jsonfor a staged diagnostic (socket, governance manifest, plugin registry, archive, vitals).
Full failure-path table
| Symptom | Likely cause | Fix |
|---|---|---|
castellan herd status errors | No mux server running | castellan multiplexer ensure |
| Dashboard opens blank | Socket up but no panes/agents yet | Run an episode with --mux, then r to refresh |
Episode file missing after run | Plugin exited before verify | Check exit code; rerun with --json for NDJSON trace |
evolve reports 0 accepted | Corpus too small or fitness flat | Run more episodes (--episodes ≥ 10), or check --plan output first |
drift-check rejects a mutation | Structural/manifest violation | Inspect drift_violations; do not force-apply |
| Reattach shows stale pane | Session detached, not killed | castellan herd tabs to confirm it’s still live, then attach again |
Related
- Daily driver — the condensed loop
- Conventions — vocabulary and default paths
- Dashboard — keybindings and headless observability
castellan evolve·castellan herd- Troubleshooting