JSON contract
When --json is set:
- stdout is exactly one JSON object
- extra logs and errors are written to stderr
- envelope keys are always present:
tool(musketeer)version(1)status(okorerror)replay_id(string or null)errors(array)
Commands
musketeer init
Bootstraps .small/ if it does not exist, creates .musketeer/ with default configuration. In a SMALL-native workspace, init attaches to the existing .small/ directory.
musketeer run new
Creates a new execution run. In SMALL-native mode, creates .musketeer/runs/<replayId>/ only. No shadow artifacts are written to .small/.
musketeer run status [—replay \]
Shows run state. Workspace-mode-aware: reads canonical state from .small/ and execution state from .musketeer/.
musketeer check [—replay \]
Validates SMALL state and Musketeer execution state as separate concerns:
- SMALL: required files exist, replay ID consistency, progress sequence integrity, plan task uniqueness
- Musketeer: verdict status, run directory structure
musketeer packet —role planner|executor|auditor [—replay \][--max-bytes N]
Reads canonical state from .small/, generates Musketeer role context packets in .musketeer/packets/.
musketeer log —role planner|executor|auditor —kind note|decision|evidence —message \[—replay \]
Reads SMALL progress state, writes execution-log.yml in .musketeer/runs/<replayId>/.
musketeer verdict —role auditor —value approve|reject —reason \[—replay \]
Writes auditor verdict to .musketeer/verdicts/<replayId>.verdict.yml.
musketeer migrate [—dry-run][--force]
Converts legacy workspaces to SMALL-native layout. Archives legacy artifacts to .musketeer/legacy/<timestamp>/, creates .small/ with converted canonical state. See migrate for full details.
Example packet JSON
Key example values from a packet response:
tool:musketeerversion:1status:okreplay_id:<id>errors:[]role:plannerplan_slice:[]progress_slice:[]next_expected_action:review_or_close
Verdict reject and check behavior
musketeer verdict --role auditor --value reject --reason "missing evidence" --replay <id> --json
musketeer check --replay <id> --jsoncheck returns exit 23 and errors includes E_VERDICT_REJECTED until an approve verdict is written.
Exit codes
| Code | Meaning |
|---|---|
| 0 | success |
| 20 | invariant failed |
| 21 | role violation |
| 22 | invalid or missing handoff material |
| 23 | auditor rejected (E_VERDICT_REJECTED) |
| 30 | workspace invalid or missing |
| 40 | invalid input |
| 50 | internal error |