Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

castellan run

Scheduler-led goal loop with a plugin verifier. Writes episode JSON to .castellan/episodes/<goal-id>.json.

Usage

castellan run --goal <GOAL> [--plugin gridworld] [--resume [<GOAL_ID>]]
          [--rlm] [--max-steps 8]
          [--audit <PATH>] [--json] [--mcp] [--model <URL_OR_NAME>]
          [--genome <ID>] [--seed-archive] [--archive .castellan/topology_archive.json]
          [--write-back] [--no-write-back] [--mux] [--no-mux]

When resuming, --goal is optional (defaults to checkpoint description). Plugin comes from the checkpoint.

Key flags

FlagDefaultNotes
--goalrequired unless --resumeNatural-language goal text
--plugingridworldVerifier plugin (castellan plugin list)
--resumeoffContinue from .castellan/checkpoints/ (optional goal UUID; default latest)
--rlmoffIn-tree RLM verify/act loop
--max-steps8Max RLM steps when --rlm
--jsonoffNDJSON castellan-events on stdout
--mcpoffProcess mcp_tools from observation payload
--muxoff (explicit)Force scheduler-led run via in-process multiplexer panes
--no-muxoffRollback for mux-by-default; also CASTELLAN_MUX_AUTO=0 or CASTELLAN_MUX_DISABLE=1
--seed-archiveoffSeed topology from evolve archive before run
--write-backauto with --seed-archiveMerge fitness into archive after success

--mux runs via MuxHarnessHost; episode JSON includes pane_tree. BL-020 (MOAT Phase 3): mux is the default when the multiplexer socket is healthy — no CASTELLAN_MUX_AUTO=1 required. Rollback with --no-mux, CASTELLAN_MUX_AUTO=0, or CASTELLAN_MUX_DISABLE=1.

--json events

EventSummary
episode_startgoal_id, plugin, goal
scheduler_ticktick, pending
task_dispatchedtick, task_id, zone
verify_resulttick, zone, goal_met
cost_rollupper-tick usd, tokens, session total_usd, total_tokens
depositzone signal deposit
archive_write_backoptional genome merge
episode_endgoal_id, status, fitness, episode_path

See statusline for dashboard consumption.

Recipes

Gridworld smoke (verify.sh default):

castellan run --goal "reach target" --plugin gridworld

RLM verify/act:

castellan run --goal "reach target" --plugin gridworld --rlm --max-steps 4

Resume mid-goal:

castellan run --goal "reach target" --plugin gridworld
castellan run --resume

Mux topology in episode:

castellan run --goal "reach target" --plugin gridworld --mux

Evolve round-trip:

castellan evolve --episodes 5 --workspace .castellan/episodes
castellan run --goal "reach target" --plugin gridworld --seed-archive --write-back