diff --git a/docs/specification.md b/docs/specification.md index 5115f6fd..f37fb48c 100644 --- a/docs/specification.md +++ b/docs/specification.md @@ -60,160 +60,161 @@ While CleverAgents leverages LangGraph and LangChain for the underlying LLM runt ### Command Synopsis -```text -agents|cleveragents [--data-dir ] [--config-path ] - [--format (rich|color|table|plain|json|yaml)] - [--help|-h] [--version] - [--install-completion []] [--show-completion []] - [-v...] [...] +

+agents|cleveragents [--data-dir <DATA_PATH>] [--config-path <CONFIG_PATH>]
+                     [--format (rich|color|table|plain|json|yaml)]
+                     [--help|-h] [--version]
+                     [--install-completion [<INST_SHELL>]] [--show-completion [<SHOW_SHELL>]]
+                     [-v...] <COMMAND> [<ARGS>...]
 
-agents version
-agents info
-agents diagnostics
-agents init [--yes|-y]
+agents version
+agents info
+agents diagnostics
+agents init [--yes|-y]
 
-agents session create [--actor ]
-agents session list
-agents session show 
-agents session delete [--yes|-y] 
-agents session export [(--output|-o) ] 
-agents session import (--input|-i) 
-agents session tell --session  [--actor ] [--stream] 
+agents session create [--actor <ACTOR>]
+agents session list
+agents session show <SESSION_ID>
+agents session delete [--yes|-y] <SESSION_ID>
+agents session export [(--output|-o) <FILE>] <SESSION_ID>
+agents session import (--input|-i) <FILE>
+agents session tell --session <SESSION_ID> [--actor <ACTOR>] [--stream] <PROMPT>
 
-agents project create [(--description|-d) ] [--resource ]...
-                     [--invariant ]... [--invariant-actor ] 
-agents project link-resource [--read-only]  
-agents project unlink-resource [--yes|-y]  
-agents project list [(--namespace|-n) NS] []
-agents project show 
-agents project validation add [(--description|-d) ] [--required|--informational]
-                              [--timeout ] [--resource ]  
-agents project validation remove [--yes|-y]  
-agents project validation list 
-agents project delete [--force|-f] [--yes|-y] 
-agents project context set[--view (strategize|execute|apply|default)]
-                          [--include-resource ]...
-                          [--exclude-resource ]...
-                          [--include-path ]...
-                          [--exclude-path ]...
-                          [--hot-max-tokens ]
-                          [--warm-max-decisions ]
-                          [--cold-max-decisions ]
-                          [--query-limit ]
-                          [--max-file-size ]
-                          [--max-total-size ]
-                          [--summarize|--no-summarize]
-                          [--summary-max-tokens ]
-                          [--clear] 
-agents project context show [--view (strategize|execute|apply|default)]
-                            
+agents project create [(--description|-d) <DESC>] [--resource <RESOURCE>]...
+                     [--invariant <INVARIANT>]... [--invariant-actor <ACTOR>] <NAME>
+agents project link-resource [--read-only] <PROJECT> <RESOURCE>
+agents project unlink-resource [--yes|-y] <PROJECT> <RESOURCE>
+agents project list [(--namespace|-n) NS] [<REGEX>]
+agents project show <PROJECT>
+agents project validation add [(--description|-d) <DESC>] [--required|--informational]
+                              [--timeout <SECONDS>] [--resource <RESOURCE>] <PROJECT> <COMMAND>
+agents project validation remove [--yes|-y] <PROJECT> <VALIDATION_ID>
+agents project validation list <PROJECT>
+agents project delete [--force|-f] [--yes|-y] <NAME>
+agents project context set[--view (strategize|execute|apply|default)]
+                          [--include-resource <INCLUDE_RESOURCE>]...
+                          [--exclude-resource <EXCLUDE_RESOURCE>]...
+                          [--include-path <INCLUDE_GLOB>]...
+                          [--exclude-path <EXCLUDE_GLOB>]...
+                          [--hot-max-tokens <N>]
+                          [--warm-max-decisions <N_WARM_MAX>]
+                          [--cold-max-decisions <N_COLD_MAX>]
+                          [--query-limit <N>]
+                          [--max-file-size <MAX_FILE_BYTES>]
+                          [--max-total-size <MAX_TOTAL_BYTES>]
+                          [--summarize|--no-summarize]
+                          [--summary-max-tokens <N>]
+                          [--clear] <PROJECT>
+agents project context show [--view (strategize|execute|apply|default)]
+                            <PROJECT>
 
-agents actor run [(--output|-o) ]
-                 [-v...] [--unsafe|-u] [--context ]
-                 [--context-dir ] [--load-context ]
-                 [(--temperature|-t) ] [--allow-rxpy-in-run-mode]
-                 [--skill ]...  
-agents actor add (--config|-c)  [--unsafe] [(--option|-o) =]...
-                [--type (graph|agent)] [--update]
-                [--skill ]... [(--description|-d) ] []
-agents actor remove 
-agents actor list
-agents actor show 
-agents actor context rm [--yes|-y] (--all|-a|)
-agents actor context list []
-agents actor context show 
-agents actor context export (--output|-o)  
-agents actor context import [--update] (--input|-i)  []
-agents actor context delete [--yes|-y] (--all|-a|)
-agents actor context clear [--yes|-y] (--all|-a|)
+agents actor run [(--output|-o) <OUTPUT_FILE>]
+                 [-v...] [--unsafe|-u] [--context <CONTEXT_NAME>]
+                 [--context-dir <CONTEXT_PATH>] [--load-context <LOAD_CONTEXT_NAME>]
+                 [(--temperature|-t) <TEMP>] [--allow-rxpy-in-run-mode]
+                 [--skill <SKILL>]... <NAME> <PROMPT>
+agents actor add (--config|-c) <FILE> [--unsafe] [(--option|-o) <key>=<value>]...
+                [--type (graph|agent)] [--update]
+                [--skill <SKILL>]... [(--description|-d) <DESC>] [<NAME>]
+agents actor remove <NAME>
+agents actor list
+agents actor show <NAME>
+agents actor context rm [--yes|-y] (--all|-a|<NAME>)
+agents actor context list [<REGEX>]
+agents actor context show <NAME>
+agents actor context export (--output|-o) <FILE> <NAME>
+agents actor context import [--update] (--input|-i) <FILE> [<NAME>]
+agents actor context delete [--yes|-y] (--all|-a|<NAME>)
+agents actor context clear [--yes|-y] (--all|-a|<NAME>)
 
-agents skill add (--config|-c)  [(--description|-d) ] [--update]
-                [--tool ]... [--include-skill ]... [--mcp-server ]... []
-agents skill remove [--yes|-y] 
-agents skill list [(--namespace|-n) ] [--source ]
-agents skill show  
-agents skill tools 
+agents skill add (--config|-c) <FILE> [(--description|-d) <DESC>] [--update]
+                [--tool <TOOL>]... [--include-skill <INCLUDE_SKILL>]... [--mcp-server <SPEC>]... [<NAME>]
+agents skill remove [--yes|-y] <NAME>
+agents skill list [(--namespace|-n) <NS>] [--source <SOURCE>]
+agents skill show  <NAME>
+agents skill tools <NAME>
 
-agents tool add (--config|-c)  [(--description|-d) ] [--update]
-               [--source ] [--input-schema ] [--code ]
-               [--writes|--no-writes] [--checkpointable|--no-checkpointable] []
-agents tool remove [--yes|-y] 
-agents tool list [(--namespace|-n) ] [--source ] []
-agents tool show 
+agents tool add (--config|-c) <FILE> [(--description|-d) <DESC>] [--update]
+               [--source <SOURCE>] [--input-schema <JSON>] [--code <CODE>]
+               [--writes|--no-writes] [--checkpointable|--no-checkpointable] [<NAME>]
+agents tool remove [--yes|-y] <NAME>
+agents tool list [(--namespace|-n) <NS>] [--source <SOURCE>] [<REGEX>]
+agents tool show <NAME>
 
-agents resource type add (--config|-c)  [--update]
-                       [--physical|--virtual] [--user-addable|--no-user-addable]
-                       [--sandbox-strategy ] [--handler ]
-                       [--child-type spec]... [--cli-arg spec]... []
-agents resource type remove [--yes|-y] 
-agents resource type list []
-agents resource type show 
+agents resource type add (--config|-c) <FILE> [--update]
+                       [--physical|--virtual] [--user-addable|--no-user-addable]
+                       [--sandbox-strategy <STRATEGY>] [--handler <NAME>]
+                       [--child-type spec]... [--cli-arg spec]... [<NAME>]
+agents resource type remove [--yes|-y] <NAME>
+agents resource type list [<REGEX>]
+agents resource type show <NAME>
 
-agents resource add [(--description|-d) ] [--update]   [type-specific-flags...]
-agents resource remove [--yes|-y] 
-agents resource list [(--namespace|-n) ] [(--type|-t) ] []
-agents resource show 
-agents resource tree [(--depth|-d) ] [(--type|-t) ] 
-agents resource link-child  
-agents resource unlink-child [--yes|-y]  
+agents resource add [(--description|-d) <DESC>] [--update] <TYPE> <NAME> [type-specific-flags...]
+agents resource remove [--yes|-y] <NAME>
+agents resource list [(--namespace|-n) <NS>] [(--type|-t) <TYPE>] [<REGEX>]
+agents resource show <NAME>
+agents resource tree [(--depth|-d) <N>] [(--type|-t) <TYPE>] <NAME>
+agents resource link-child <PARENT> <CHILD>
+agents resource unlink-child [--yes|-y] <PARENT> <CHILD>
 
-agents plan list [--phase ] [--state ] [--project ]
-                [--action ] []
-agents plan use [--automation-profile ]
-                [--invariant ]...
-                [--strategy-actor ]
-                [--execution-actor ]
-                [--estimation-actor ]
-                [--invariant-actor ]
-                [--arg/-a name=value]...
-                 ...
-agents plan execute 
-agents plan apply [--yes|-y] 
-agents plan status 
-agents plan cancel [(--reason|-r) ] 
-agents plan tree [--show-superseded] 
-agents plan explain [--show-context] [--show-reasoning] 
-agents plan correct --mode (revert|append) (--guidance|-g) 
-                   [--dry-run] [--yes|-y] 
-agents plan diff (--correction |)
-agents plan artifacts 
-agents plan prompt  
-agents plan rollback [--yes|-y]  
+agents plan list [--phase <PHASE>] [--state <STATE>] [--project <PROJECT>]
+                [--action <ACTION>] [<REGEX>]
+agents plan use [--automation-profile <PROFILE>]
+                [--invariant <INVARIANT>]...
+                [--strategy-actor <STRATEGY_ACTOR>]
+                [--execution-actor <EXEC_ACTOR>]
+                [--estimation-actor <EST_ACTOR>]
+                [--invariant-actor <INV_ACTOR>]
+                [--arg/-a name=value]...
+                <ACTION> <PROJECT>...
+agents plan execute <PLAN_ID>
+agents plan apply [--yes|-y] <PLAN_ID>
+agents plan status <PLAN_ID>
+agents plan cancel [(--reason|-r) <REASON>] <PLAN_ID>
+agents plan tree [--show-superseded] <PLAN_ID>
+agents plan explain [--show-context] [--show-reasoning] <DECISION_ID>
+agents plan correct --mode (revert|append) (--guidance|-g) <GUIDANCE>
+                   [--dry-run] [--yes|-y] <DECISION_ID>
+agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>)
+agents plan artifacts <PLAN_ID>
+agents plan prompt <PLAN_ID> <GUIDANCE>
+agents plan rollback [--yes|-y] <PLAN_ID> <CHECKPOINT_ID>
 
-agents action create (--config|-c) 
-                     [--strategy-actor ]
-                     [--execution-actor ]
-                     [--definition-of-done ]
-                     [(--description|-d) ]
-                     [--long-description ]
-                     [--reusable|--no-reusable]
-                     [--read-only]
-                     [--available]
-                     [--estimation-actor ]
-                     [--invariant-actor ]
-                     [--automation-profile ]
-                     [--invariant ]...
-                     [--arg ]...
-                     []
-agents action list [(--namespace|-n) ] [(--state|-s) ] [--available] []
-agents action show 
-agents action available 
-agents action archive 
+agents action create (--config|-c) <CFG_FILE>
+                     [--strategy-actor <STRATEGY_ACTOR>]
+                     [--execution-actor <EXEC_ACTOR>]
+                     [--definition-of-done <DOD>]
+                     [(--description|-d) <DESC>]
+                     [--long-description <LONG_DESC>]
+                     [--reusable|--no-reusable]
+                     [--read-only]
+                     [--available]
+                     [--estimation-actor <EST_ACTOR>]
+                     [--invariant-actor <INV_ACTOR>]
+                     [--automation-profile <PROFILE>]
+                     [--invariant <INVARIANT>]...
+                     [--arg <ARG_SPEC>]...
+                     [<NAME>]
+agents action list [(--namespace|-n) <NS>] [(--state|-s) <STATE>] [--available] [<REGEX>]
+agents action show <ACTION_NAME>
+agents action available <ACTION_NAME>
+agents action archive <ACTION_NAME>
 
-agents automation-profile add (--config|-c)  [--update] []
-agents automation-profile remove [--yes|-y] 
-agents automation-profile list []
-agents automation-profile show 
+agents automation-profile add (--config|-c) <FILE> [--update] [<NAME>]
+agents automation-profile remove [--yes|-y] <NAME>
+agents automation-profile list [<REGEX>]
+agents automation-profile show <NAME>
 
-agents config set  
-agents config get 
-agents config list [--filter-values ] []
+agents config set <key> <value>
+agents config get <key>
+agents config list [--filter-values <REGEX>] [<REGEX>]
 
-agents invariant add [--global] [--project/-p PROJECT] [--plan PLAN_ID]... [--action ACTION]... 
-agents invariant list [--global] [--project/-p PROJECT] [--plan PLAN_ID] [--action ACTION]
-                     [--effective] []
-agents invariant remove [--yes|-y] 
-```
+agents invariant add [--global] [(--project|-p) PROJECT] [--plan PLAN_ID]...
+                     [--action ACTION]... <INVARIANT_TEXT>
+agents invariant list [--global] [(--project|-p) PROJECT] [--plan PLAN_ID] [--action ACTION]
+                     [--effective] [<REGEX>]
+agents invariant remove [--yes|-y] <INVARIANT_ID>
+
### Command Reference @@ -241,39 +242,39 @@ Configure global state locations and shell integration for every command. **Examples**

-$ agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info
+$ agents --data-dir /srv/cleveragents --config-path /srv/cleveragents/config.toml info
 
 ╭─ System Snapshot ─────────────────╮
 │ CleverAgents 1.0.0                │
-│ Mode: local                       │
+│ Mode: local                       │
 │ Automation: review                │
-│ Status: ready                     │
+│ Status: ready                     │
 ╰───────────────────────────────────╯
 
 ╭─ Paths ───────────────────────────────╮
-│ Data Dir: /srv/cleveragents           │
-│ Config: /srv/cleveragents/config.toml │
-│ Logs: /srv/cleveragents/logs          │
-│ Cache: /srv/cleveragents/cache        │
-│ Database: /srv/cleveragents/agents.db │
+│ Data Dir: /srv/cleveragents           │
+│ Config: /srv/cleveragents/config.toml │
+│ Logs: /srv/cleveragents/logs          │
+│ Cache: /srv/cleveragents/cache        │
+│ Database: /srv/cleveragents/agents.db │
 ╰───────────────────────────────────────╯
 
 ╭─ Runtime ──────────╮
 │ PID: 4127          │
-│ Uptime: 00:14:32   │
-│ Python: 3.13.1     │
-│ Host: devbox.local │
-│ Platform: linux    │
+│ Uptime: 00:14:32   │
+│ Python: 3.13.1     │
+│ Host: devbox.local │
+│ Platform: linux    │
 ╰────────────────────╯
 
 ╭─ Projects & Sessions ─╮
-│ Projects: 2          │
-│ Sessions: 1 active  │
-│ Active Plans: 0     │
-│ Actors: 3           │
+│ Projects: 2          │
+│ Sessions: 1 active  │
+│ Active Plans: 0     │
+│ Actors: 3           │
 ╰───────────────────────╯
 
-✓ OK Environment loaded
+✓ OK Environment loaded
 
#### agents version @@ -288,30 +289,30 @@ None. **Examples**

-$ agents version
+$ agents version
 
 ╭─ CLI Version ────╮
 │ CleverAgents CLI │
-│ Version: 1.0.0   │
-│ Channel: stable  │
-│ Python: 3.13     │
+│ Version: 1.0.0   │
+│ Channel: stable  │
+│ Python: 3.13     │
 ╰──────────────────╯
 
 ╭─ Build ────────────────╮
-│ Build Date: 2026-02-08 │
+│ Build Date: 2026-02-08 │
 │ Commit: a17c3f9        │
-│ Schema: v3             │
-│ Platform: linux-x86_64 │
+│ Schema: v3             │
+│ Platform: linux-x86_64 │
 ╰────────────────────────╯
 
 ╭─ Dependencies ─────────────────╮
-│ LangGraph: 0.2.60           │
-│ LangChain: 0.3.18          │
-│ MCP SDK: 1.4.0             │
-│ Pydantic: 2.10.4           │
+│ LangGraph: 0.2.60           │
+│ LangChain: 0.3.18          │
+│ MCP SDK: 1.4.0             │
+│ Pydantic: 2.10.4           │
 ╰────────────────────────────────╯
 
-✓ OK Version reported
+✓ OK Version reported
 
#### agents info @@ -326,38 +327,38 @@ None. **Examples**

-$ agents info
+$ agents info
 
 ╭─ Environment ───────────────────────────────────────────────╮
-│ Data Dir: /home/alex/.cleveragents                          │
-│ Config: /home/alex/.cleveragents/config.toml                │
-│ Database: sqlite:///home/alex/.cleveragents/cleveragents.db │
+│ Data Dir: /home/alex/.cleveragents                          │
+│ Config: /home/alex/.cleveragents/config.toml                │
+│ Database: sqlite:///home/alex/.cleveragents/cleveragents.db │
 │ Server Mode: disabled                                       │
-│ Platform: Linux 6.8.0 (x86_64)                              │
+│ Platform: Linux 6.8.0 (x86_64)                              │
 ╰─────────────────────────────────────────────────────────────╯
 
 ╭─ Runtime ─────────────────────────╮
 │ Automation: review                │
-│ Providers: 3 configured           │
+│ Providers: 3 configured           │
 │ Sessions: 2 active                │
-│ Active Plans: 1                   │
+│ Active Plans: 1                   │
 ╰───────────────────────────────────╯
 
 ╭─ Storage ─────╮
-│ Cache: 118 MB │
-│ Logs: 42 MB   │
+│ Cache: 118 MB │
+│ Logs: 42 MB   │
 │ Backups: 3    │
-│ DB Size: 8 MB │
+│ DB Size: 8 MB │
 ╰───────────────╯
 
 ╭─ Indexing ─────────────╮
-│ Text Index: ready     │
-│ Vector Index: ready   │
+│ Text Index: ready     │
+│ Vector Index: ready   │
 │ Graph Store: disabled │
-│ Indexed Files: 1,247  │
+│ Indexed Files: 1,247  │
 ╰────────────────────────╯
 
-✓ OK Environment details ready
+✓ OK Environment details ready
 
#### agents diagnostics @@ -372,28 +373,28 @@ None. **Examples**

-$ agents diagnostics
+$ agents diagnostics
 
 ╭─ Checks ────────────────────────────────╮
 │ Check            Status  Details        │
 │ ───────────────  ──────  ────────────── │
-│ Config file      OK      readable       │
-│ Database         OK      writable       │
+│ Config file      OK      readable       │
+│ Database         OK      writable       │
 │ OPENAI_API_KEY   WARN    missing        │
-│ Anthropic key    OK      configured     │
-│ Disk space       OK      2.1 GB free    │
-│ Text index       OK      tantivy 0.22   │
-│ Vector index     OK      faiss (CPU)    │
+│ Anthropic key    OK      configured     │
+│ Disk space       OK      2.1 GB free    │
+│ Text index       OK      tantivy 0.22   │
+│ Vector index     OK      faiss (CPU)    │
 │ Graph store      WARN    not configured │
-│ File permissions OK      data dir r/w   │
-│ Git              OK      git 2.43.0     │
+│ File permissions OK      data dir r/w   │
+│ Git              OK      git 2.43.0     │
 ╰────────────────────────────────────────╯
 
 ╭─ Summary ────────╮
-│ Checks: 10 total │
+│ Checks: 10 total │
 │ Warnings: 2      │
-│ Errors: 0         │
-│ Duration: 0.6s   │
+│ Errors: 0         │
+│ Duration: 0.6s   │
 ╰──────────────────╯
 
 ╭─ Recommendations ─────────────────────────────────────────────╮
@@ -417,38 +418,38 @@ Initialize or reset the global CleverAgents environment. This wipes any existing
 **Examples**
 
 

-$ agents init
+$ agents init
 
 Warning: This will remove all data in /home/alex/.cleveragents
 Continue? [y/N]: y
 
 ╭─ Environment Reset ────────────────────────────────╮
-│ Config: /home/alex/.cleveragents/config.toml       │
-│ Database: /home/alex/.cleveragents/cleveragents.db │
+│ Config: /home/alex/.cleveragents/config.toml       │
+│ Database: /home/alex/.cleveragents/cleveragents.db │
 │ Backup: /home/alex/.cleveragents.backup-2026-02-08 │
-│ Status: ready                                      │
+│ Status: ready                                      │
 ╰────────────────────────────────────────────────────╯
 
 ╭─ Defaults ──────────────────────────────────╮
 │ Automation Profile: supervised              │
-│ Built-in Profiles: 6 loaded                 │
+│ Built-in Profiles: 6 loaded                 │
 ╰─────────────────────────────────────────────╯
 
 ╭─ Created ─────────────────╮
-│ Config: config.toml       │
-│ Database: cleveragents.db │
-│ Logs: logs/               │
-│ Cache: cache/             │
-│ Backups: backups/         │
+│ Config: config.toml       │
+│ Database: cleveragents.db │
+│ Logs: logs/               │
+│ Cache: cache/             │
+│ Backups: backups/         │
 ╰───────────────────────────╯
 
 ╭─ Schema ───────────────────────╮
-│ Version: v3                   │
-│ Tables: 12 created            │
-│ Migrations: up to date        │
+│ Version: v3                   │
+│ Tables: 12 created            │
+│ Migrations: up to date        │
 ╰────────────────────────────────╯
 
-✓ OK Environment initialized
+✓ OK Environment initialized
 
#### agents session @@ -468,31 +469,31 @@ Create a new session for interactive work. **Examples**

-$ agents session create --actor local/orchestrator
+$ agents session create --actor local/orchestrator
 
 ╭─ Session ──────────────────────╮
-│ ID: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
+│ ID: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
 │ Actor: local/orchestrator      │
-│ Created: 2026-02-08 12:44      │
-│ Namespace: local                │
+│ Created: 2026-02-08 12:44      │
+│ Namespace: local                │
 ╰────────────────────────────────╯
 
 ╭─ Settings ─────────────╮
 │ Automation: review     │
-│ Streaming: off         │
-│ Context: default       │
-│ Memory: enabled        │
+│ Streaming: off         │
+│ Context: default       │
+│ Memory: enabled        │
 │ Max History: 50 turns │
 ╰────────────────────────╯
 
 ╭─ Actor Details ───────────────────╮
-│ Provider: anthropic              │
+│ Provider: anthropic              │
 │ Model: claude-3.5                │
-│ Temperature: 0.7                 │
-│ Context Window: 200K tokens      │
+│ Temperature: 0.7                 │
+│ Context Window: 200K tokens      │
 ╰───────────────────────────────────╯
 
-✓ OK Session created
+✓ OK Session created
 
##### agents session list @@ -507,7 +508,7 @@ None. **Examples**

-$ agents session list --format table
+$ agents --format table session list
 
 ╭─ Sessions ───────────────────────────────────────────────────────────────────╮
 │ ID        Name             Actor               Messages  Updated          │
@@ -518,13 +519,13 @@ $ agents session list --format table
 
 ╭─ Summary ────────────────────╮
 │ Total: 2                     │
-│ Most Recent: weekly-planning │
-│ Oldest: refactor-sprint      │
-│ Total Messages: 20           │
-│ Storage: 42 KB               │
+│ Most Recent: weekly-planning │
+│ Oldest: refactor-sprint      │
+│ Total Messages: 20           │
+│ Storage: 42 KB               │
 ╰──────────────────────────────╯
 
-✓ OK 2 sessions listed
+✓ OK 2 sessions listed
 
##### agents session show @@ -539,15 +540,15 @@ Show details and recent messages for a session. **Examples**

-$ agents session show 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
+$ agents session show 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
 
 ╭─ Session Summary ──────────────╮
-│ ID: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
+│ ID: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
 │ Actor: local/orchestrator      │
 │ Messages: 6                    │
-│ Created: 2026-02-08 12:30      │
-│ Updated: 2026-02-08 12:44      │
-│ Automation: review              │
+│ Created: 2026-02-08 12:30      │
+│ Updated: 2026-02-08 12:44      │
+│ Automation: review              │
 ╰────────────────────────────────╯
 
 ╭─ Recent Messages ──────────────────────────────────╮
@@ -563,12 +564,12 @@ $ agents session show 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
 ╰─────────────────────────────────────────────╯
 
 ╭─ Token Usage ──────────────╮
-│ Input Tokens: 3,420       │
-│ Output Tokens: 1,185     │
+│ Input Tokens: 3,420       │
+│ Output Tokens: 1,185     │
 │ Estimated Cost: $0.0184  │
 ╰────────────────────────────╯
 
-✓ OK Session details loaded
+✓ OK Session details loaded
 
##### agents session delete @@ -584,26 +585,26 @@ Delete a session and its stored conversation history. **Examples**

-$ agents session delete 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
+$ agents session delete 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
 
 Delete session 01HXM2A6K1P2E9Q9D4GQ7J4S7Z? [y/N]: y
 
 ╭─ Deletion Summary ─────────────╮
 │ Session: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
-│ ID: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
+│ ID: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
 │ Messages: 6 removed            │
-│ Storage: 18 KB freed           │
-│ Plans Orphaned: 0              │
+│ Storage: 18 KB freed           │
+│ Plans Orphaned: 0              │
 ╰────────────────────────────────╯
 
 ╭─ Cleanup ───────────╮
-│ Backups: none       │
-│ Logs: preserved     │
-│ Context: cleared    │
-│ Checkpoints: none  │
+│ Backups: none       │
+│ Logs: preserved     │
+│ Context: cleared    │
+│ Checkpoints: none  │
 ╰─────────────────────╯
 
-✓ OK Session deleted
+✓ OK Session deleted
 
##### agents session export @@ -619,22 +620,22 @@ Export a session as a portable JSON file. **Examples**

-$ agents session export --output /tmp/weekly-planning.json 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
+$ agents session export --output /tmp/weekly-planning.json 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
 
 ╭─ Session Export ──────────────────╮
 │ Session: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z │
-│ Output: /tmp/weekly-planning.json │
+│ Output: /tmp/weekly-planning.json │
 │ Messages: 6                       │
-│ Size: 24 KB                       │
-│ Format: JSON                      │
+│ Size: 24 KB                       │
+│ Format: JSON                      │
 ╰───────────────────────────────────╯
 
 ╭─ Contents ─────────────────╮
-│ Messages: 6               │
-│ Plan References: 1       │
-│ Metadata Keys: 2         │
+│ Messages: 6               │
+│ Plan References: 1       │
+│ Metadata Keys: 2         │
 │ Actor Config: included   │
-│ Schema Version: v3       │
+│ Schema Version: v3       │
 ╰────────────────────────────╯
 
 ╭─ Integrity ──────────────────╮
@@ -642,7 +643,7 @@ $ agents session export --output /tmp/weekly-planning.json 01HXM2A6K1P2E9Q9D4GQ7
 │ Encrypted: no                │
 ╰──────────────────────────────╯
 
-✓ OK Export completed
+✓ OK Export completed
 
##### agents session import @@ -657,27 +658,27 @@ Import a session JSON file. **Examples**

-$ agents session import --input /tmp/weekly-planning.json
+$ agents session import --input /tmp/weekly-planning.json
 
 ╭─ Session Import ───────────────────────╮
-│ Input: /tmp/weekly-planning.json       │
-│ Session ID: 01HXM3D3B2W4CQYQ3P4ZB8A5T1 │
+│ Input: /tmp/weekly-planning.json       │
+│ Session ID: 01HXM3D3B2W4CQYQ3P4ZB8A5T1 │
 │ Messages: 6                            │
-│ Schema: v3                              │
+│ Schema: v3                              │
 ╰────────────────────────────────────────╯
 
 ╭─ Validation ────────────╮
-│ Checksum: verified     │
-│ Schema: compatible     │
-│ Actor Ref: resolved    │
+│ Checksum: verified     │
+│ Schema: compatible     │
+│ Actor Ref: resolved    │
 ╰─────────────────────────╯
 
 ╭─ Merge ──────────────╮
-│ Existing: none       │
-│ Strategy: create new │
+│ Existing: none       │
+│ Strategy: create new │
 ╰──────────────────────╯
 
-✓ OK Import completed
+✓ OK Import completed
 
##### agents session tell @@ -695,14 +696,14 @@ Send a natural-language request to the orchestrator. The orchestrator can create **Examples**

-$ agents session tell "Create an action to refresh dependency locks and add it to the platform project" \
-  --session 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
+$ agents session tell "Create an action to refresh dependency locks and add it to the platform project" \
+  --session 01HXM2A6K1P2E9Q9D4GQ7J4S7Z
 
 ╭─ Plan Request ──────────────────────────────────────────╮
 │ Actor: local/orchestrator                               │
 │ Session: 01HXM2A6K1P2E9Q9D4GQ7J4S7Z                     │
 │ Automation: review                                      │
-│ Prompt: Create an action to refresh dependency locks... │
+│ Prompt: Create an action to refresh dependency locks... │
 ╰─────────────────────────────────────────────────────────╯
 
 ╭─ Commands Executed ────────────────────────────────────────────────────────────────────────────────────────╮
@@ -712,20 +713,20 @@ $ agents session tell "Create an action to refresh dependency locks and add it t
 ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Result ────────────────────────────╮
-│ Action: local/refresh-locks (draft) │
-│ Project: local/platform             │
+│ Action: local/refresh-locks (draft) │
+│ Project: local/platform             │
 │ Resource: repo                      │
 ╰─────────────────────────────────────╯
 
 ╭─ Usage ─────────────────────╮
-│ Input Tokens: 1,842       │
-│ Output Tokens: 624       │
+│ Input Tokens: 1,842       │
+│ Output Tokens: 624       │
 │ Cost: $0.0094             │
-│ Duration: 3.2s             │
-│ Tool Calls: 3             │
+│ Duration: 3.2s             │
+│ Tool Calls: 3             │
 ╰─────────────────────────────╯
 
-✓ OK Orchestrator completed 3 commands
+✓ OK Orchestrator completed 3 commands
 
#### agents project @@ -749,35 +750,35 @@ Create a new project record. **Examples**

-$ agents project create --description "Backend API" local/api-service
+$ agents project create --description "Backend API" local/api-service
 
 ╭─ Project ──────────────────────╮
 │ Name: local/api-service        │
-│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
-│ Description: Backend API       │
-│ Type: local                    │
-│ Created: 2026-02-08 12:46      │
+│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
+│ Description: Backend API       │
+│ Type: local                    │
+│ Created: 2026-02-08 12:46      │
 ╰────────────────────────────────╯
 
 ╭─ Paths ────────────────────────────────────╮
-│ Root: /repos/api-service                   │
-│ Data Dir: /repos/api-service/.cleveragents │
+│ Root: /repos/api-service                   │
+│ Data Dir: /repos/api-service/.cleveragents │
 ╰────────────────────────────────────────────╯
 
 ╭─ Defaults ──────────────────────────────╮
-│ Sandbox: git_worktree                   │
-│ Validations: 0                         │
+│ Sandbox: git_worktree                   │
+│ Validations: 0                         │
 │ Context Filters: none                   │
 │ Automation Profile: (inherits global)  │
 ╰─────────────────────────────────────────╯
 
 ╭─ Resources ──────╮
 │ Total: 0        │
-│ Indexed: 0      │
-│ Sandboxable: 0 │
+│ Indexed: 0      │
+│ Sandboxable: 0 │
 ╰──────────────────╯
 
-✓ OK Project created
+✓ OK Project created
 
##### agents project link-resource @@ -794,30 +795,30 @@ Link a registered resource to a project. The resource must already be registered **Examples**

-$ agents resource add git-checkout local/api-repo --path /repos/api --branch main
-$ agents project link-resource local/api-service local/api-repo
+$ agents resource add git-checkout local/api-repo --path /repos/api --branch main
+$ agents project link-resource local/api-service local/api-repo
 
 ╭─ Resource Linked ──────────────────────╮
 │ Project: local/api-service            │
-│ Resource: local/api-repo               │
-│ Type: git-checkout                     │
-│ Read-Only: no                           │
+│ Resource: local/api-repo               │
+│ Type: git-checkout                     │
+│ Read-Only: no                           │
 ╰────────────────────────────────────────╯
 
 ╭─ Permissions ────────────╮
-│ Read: allowed            │
+│ Read: allowed            │
 │ Write: allowed           │
-│ Apply: requires approval │
+│ Apply: requires approval │
 ╰──────────────────────────╯
 
 ╭─ Indexing ─────────────────────╮
 │ Status: indexing...          │
-│ Files Found: 347             │
-│ Language: Python (primary)   │
-│ Estimated Time: ~20 seconds  │
+│ Files Found: 347             │
+│ Language: Python (primary)   │
+│ Estimated Time: ~20 seconds  │
 ╰────────────────────────────────╯
 
-✓ OK Resource linked to project
+✓ OK Resource linked to project
 
##### agents project unlink-resource @@ -834,30 +835,30 @@ Unlink a resource from a project. The resource itself remains registered in the **Examples**

-$ agents project unlink-resource local/api-service local/api-repo
+$ agents project unlink-resource local/api-service local/api-repo
 
 Unlink local/api-repo from local/api-service? [y/N]: y
 
 ╭─ Resource Unlinked ────────────────────╮
 │ Project: local/api-service            │
-│ Resource: local/api-repo               │
-│ Type: git-checkout                     │
+│ Resource: local/api-repo               │
+│ Type: git-checkout                     │
 ╰────────────────────────────────────────╯
 
 ╭─ Index Cleanup ──────────╮
 │ Text Index: 347 removed │
 │ Vectors: 892 removed    │
 │ Graph Triples: cleared  │
-│ Duration: 0.3s          │
+│ Duration: 0.3s          │
 ╰──────────────────────────╯
 
 ╭─ Project Summary ──────────────╮
 │ Linked Resources: 1 remaining  │
-│ Last Updated: 2026-02-09 10:30 │
-│ Active Plans: 0                │
+│ Last Updated: 2026-02-09 10:30 │
+│ Active Plans: 0                │
 ╰────────────────────────────────╯
 
-✓ OK Resource unlinked from project
+✓ OK Resource unlinked from project
 
##### agents project list @@ -872,7 +873,7 @@ List projects with optional filters. **Examples**

-$ agents project list --format table
+$ agents --format table project list
 
 ╭─ Projects ────────────────────────────────────────────────────────╮
 │ ID        Name               Resources  Remote  Active Plans │
@@ -883,14 +884,14 @@ $ agents project list --format table
 
 ╭─ Summary ──────────────────╮
 │ Total: 2                   │
-│ With Resources: 2          │
-│ Remote: 0                  │
-│ Total Resources: 3         │
-│ Indexed Files: 1,247       │
+│ With Resources: 2          │
+│ Remote: 0                  │
+│ Total Resources: 3         │
+│ Indexed Files: 1,247       │
 │ Active Plans: 1            │
 ╰────────────────────────────╯
 
-✓ OK 2 projects listed
+✓ OK 2 projects listed
 
##### agents project show @@ -905,15 +906,15 @@ Show full project details. **Examples**

-$ agents project show local/api-service
+$ agents project show local/api-service
 
 ╭─ Project Details ──────────────╮
 │ Name: local/api-service        │
-│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
-│ Description: Backend API       │
+│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
+│ Description: Backend API       │
 │ Resources: 2                   │
-│ Remote: no                     │
-│ Created: 2026-02-08 12:46      │
+│ Remote: no                     │
+│ Created: 2026-02-08 12:46      │
 ╰────────────────────────────────╯
 
 ╭─ Linked Resources ──────────────────────────────────────────────────────╮
@@ -924,23 +925,23 @@ $ agents project show local/api-service
 ╰─────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Validations (3) ───────────────────────────────────────────╮
-│ val_01HXM5A  pytest --cov=src --cov-fail-under=80  required │
-│ val_01HXM5B  ruff check .                          required │
+│ val_01HXM5A  pytest --cov=src --cov-fail-under=80  required │
+│ val_01HXM5B  ruff check .                          required │
 │ val_01HXM5C  node scripts/check-bundle-size.js     info     │
 ╰─────────────────────────────────────────────────────────────╯
 
 ╭─ Context ───────────────────╮
-│ Include: repo               │
+│ Include: repo               │
 │ Exclude: **/node_modules/** │
-│ Max File Size: 1 MB        │
+│ Max File Size: 1 MB        │
 ╰─────────────────────────────╯
 
 ╭─ Indexing Status ──────────╮
-│ Text Index: ready         │
-│ Vector Index: ready       │
+│ Text Index: ready         │
+│ Vector Index: ready       │
 │ Graph Store: disabled     │
-│ Indexed Files: 347        │
-│ Last Indexed: 12:48       │
+│ Indexed Files: 347        │
+│ Last Indexed: 12:48       │
 ╰────────────────────────────╯
 
 ╭─ Active Plans ──────────────────────────╮
@@ -949,7 +950,7 @@ $ agents project show local/api-service
 │ 01HXM7A9  local/code-coverage  execute │
 ╰─────────────────────────────────────────╯
 
-✓ OK Project loaded
+✓ OK Project loaded
 
##### agents project validation @@ -974,52 +975,52 @@ Add a validation to a project. **Examples**

-$ agents project validation add --description "Run unit tests with coverage" \
-  --required --timeout 600 --resource repo local/api-service "pytest --cov=src --cov-fail-under=80"
+$ agents project validation add --description "Run unit tests with coverage" \
+  --required --timeout 600 --resource repo local/api-service "pytest --cov=src --cov-fail-under=80"
 
 ╭─ Validation Added ──────────────────────────────────────────╮
 │ ID: val_01HXM5A                                            │
-│ Project: local/api-service                                │
-│ Command: pytest --cov=src --cov-fail-under=80             │
-│ Description: Run unit tests with coverage                  │
-│ Mode: required                                            │
-│ Resource: repo                                            │
+│ Project: local/api-service                                │
+│ Command: pytest --cov=src --cov-fail-under=80             │
+│ Description: Run unit tests with coverage                  │
+│ Mode: required                                            │
+│ Resource: repo                                            │
 │ Timeout: 600s                                             │
 ╰─────────────────────────────────────────────────────────────╯
 
-✓ OK Validation added
+✓ OK Validation added
 

-$ agents project validation add --description "Lint check" \
-  --required local/api-service "ruff check ."
+$ agents project validation add --description "Lint check" \
+  --required local/api-service "ruff check ."
 
 ╭─ Validation Added ───────────────────╮
 │ ID: val_01HXM5B                     │
-│ Project: local/api-service          │
-│ Command: ruff check .               │
-│ Description: Lint check              │
-│ Mode: required                      │
+│ Project: local/api-service          │
+│ Command: ruff check .               │
+│ Description: Lint check              │
+│ Mode: required                      │
 │ Timeout: 300s                       │
 ╰──────────────────────────────────────╯
 
-✓ OK Validation added
+✓ OK Validation added
 

-$ agents project validation add --description "Check bundle size (advisory)" \
-  --informational local/api-service "node scripts/check-bundle-size.js"
+$ agents project validation add --description "Check bundle size (advisory)" \
+  --informational local/api-service "node scripts/check-bundle-size.js"
 
 ╭─ Validation Added ──────────────────────────────╮
 │ ID: val_01HXM5C                                  │
-│ Project: local/api-service                      │
-│ Command: node scripts/check-bundle-size.js       │
-│ Description: Check bundle size (advisory)        │
+│ Project: local/api-service                      │
+│ Command: node scripts/check-bundle-size.js       │
+│ Description: Check bundle size (advisory)        │
 │ Mode: informational                              │
 │ Timeout: 300s                                    │
 ╰─────────────────────────────────────────────────╯
 
-✓ OK Validation added
+✓ OK Validation added
 
###### agents project validation remove @@ -1036,17 +1037,17 @@ Remove a validation from a project. **Examples**

-$ agents project validation remove local/api-service val_01HXM5C
+$ agents project validation remove local/api-service val_01HXM5C
 
 Remove validation val_01HXM5C from local/api-service? [y/N]: y
 
 ╭─ Validation Removed ─────────────────────────────╮
 │ ID: val_01HXM5C                                   │
-│ Command: node scripts/check-bundle-size.js        │
-│ Description: Check bundle size (advisory)         │
+│ Command: node scripts/check-bundle-size.js        │
+│ Description: Check bundle size (advisory)         │
 ╰──────────────────────────────────────────────────╯
 
-✓ OK Validation removed
+✓ OK Validation removed
 
###### agents project validation list @@ -1061,7 +1062,7 @@ List all validations for a project. **Examples**

-$ agents project validation list local/api-service
+$ agents project validation list local/api-service
 
 ╭─ Validations ─────────────────────────────────────────────────────────────────────────╮
 │ ID           Command                              Mode          Timeout  Resource │
@@ -1072,12 +1073,12 @@ $ agents project validation list local/api-service
 ╰───────────────────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Summary ──────────────╮
-│ Total: 3               │
-│ Required: 2            │
+│ Total: 3               │
+│ Required: 2            │
 │ Informational: 1      │
 ╰────────────────────────╯
 
-✓ OK 3 validations listed
+✓ OK 3 validations listed
 
##### agents project delete @@ -1094,30 +1095,30 @@ Delete a project and all associated resources. **Examples**

-$ agents project delete local/docs
+$ agents project delete local/docs
 
 Delete project local/docs? This cannot be undone. [y/N]: y
 
 ╭─ Deletion Summary ──────────────────╮
 │ Project: local/docs                 │
-│ ID: 01HXM4B9F2C1V8X2N6Q7K9L0M1      │
+│ ID: 01HXM4B9F2C1V8X2N6Q7K9L0M1      │
 │ Resources: 1 removed                │
-│ Data Dir: /repos/docs/.cleveragents │
+│ Data Dir: /repos/docs/.cleveragents │
 ╰─────────────────────────────────────╯
 
 ╭─ Index Cleanup ────────╮
 │ Text Index: cleared   │
 │ Vectors: 240 removed  │
 │ Graph Triples: none  │
-│ Storage Freed: 12 MB │
+│ Storage Freed: 12 MB │
 ╰────────────────────────╯
 
 ╭─ Backups ────────────────────────────────────╮
-│ Snapshot: /backups/local-docs-2026-02-08.tgz │
+│ Snapshot: /backups/local-docs-2026-02-08.tgz │
 │ Retention: 7 days                            │
 ╰──────────────────────────────────────────────╯
 
-✓ OK Project deleted
+✓ OK Project deleted
 
##### agents project context @@ -1151,15 +1152,15 @@ Set the context policy for a project and (optionally) a specific view. **Examples**

-$ agents project context set --view strategize \
-  --include-resource repo --exclude-path "**/node_modules/**" \
-  --hot-max-tokens 12000 --warm-max-decisions 50 --cold-max-decisions 200 \
-  --summarize --summary-max-tokens 800 local/api-service
+$ agents project context set --view strategize \
+  --include-resource repo --exclude-path "**/node_modules/**" \
+  --hot-max-tokens 12000 --warm-max-decisions 50 --cold-max-decisions 200 \
+  --summarize --summary-max-tokens 800 local/api-service
 
 ╭─ Context Policy ────────────╮
 │ Project: local/api-service  │
-│ View: strategize            │
-│ Include: repo               │
+│ View: strategize            │
+│ Include: repo               │
 │ Exclude: **/node_modules/** │
 ╰─────────────────────────────╯
 
@@ -1167,23 +1168,23 @@ $ agents project context set --view strategize \
 │ Hot Tokens: 12000 (soft cap) │
 │ Warm Decisions: 50           │
 │ Cold Decisions: 200          │
-│ Query Limit: 20              │
-│ Max File Size: 1 MB          │
-│ Max Total Size: 50 MB        │
+│ Query Limit: 20              │
+│ Max File Size: 1 MB          │
+│ Max Total Size: 50 MB        │
 ╰──────────────────────────────╯
 
 ╭─ Summarization ─╮
-│ Enabled: yes    │
-│ Max Tokens: 800 │
+│ Enabled: yes    │
+│ Max Tokens: 800 │
 ╰─────────────────╯
 
 ╭─ Other Views ────────╮
-│ execute: (default) │
-│ apply: (default)   │
-│ default: (unset)   │
+│ execute: (default) │
+│ apply: (default)   │
+│ default: (unset)   │
 ╰──────────────────────╯
 
-✓ OK Context policy updated
+✓ OK Context policy updated
 
###### agents project context show @@ -1199,12 +1200,12 @@ Show the active context policy for a project. **Examples**

-$ agents project context show --view strategize local/api-service
+$ agents project context show --view strategize local/api-service
 
 ╭─ Context Policy ────────────╮
 │ Project: local/api-service  │
-│ View: strategize            │
-│ Include: repo               │
+│ View: strategize            │
+│ Include: repo               │
 │ Exclude: **/node_modules/** │
 ╰─────────────────────────────╯
 
@@ -1212,24 +1213,24 @@ $ agents project context show --view strategize local/api-service
 │ Hot Tokens: 12000 (soft cap) │
 │ Warm Decisions: 50           │
 │ Cold Decisions: 200          │
-│ Query Limit: 20              │
-│ Max File Size: 1 MB          │
-│ Max Total Size: 50 MB        │
+│ Query Limit: 20              │
+│ Max File Size: 1 MB          │
+│ Max Total Size: 50 MB        │
 ╰──────────────────────────────╯
 
 ╭─ Summarization ─╮
-│ Enabled: yes    │
-│ Max Tokens: 800 │
+│ Enabled: yes    │
+│ Max Tokens: 800 │
 ╰─────────────────╯
 
 ╭─ Current Usage ──────────────╮
-│ Hot Context: 8,420 / 12,000  │
-│ Warm Entries: 12 / 50        │
-│ Cold Entries: 47 / 200       │
-│ Indexed Resources: 1        │
+│ Hot Context: 8,420 / 12,000  │
+│ Warm Entries: 12 / 50        │
+│ Cold Entries: 47 / 200       │
+│ Indexed Resources: 1        │
 ╰──────────────────────────────╯
 
-✓ OK Context policy loaded
+✓ OK Context policy loaded
 
#### agents actor @@ -1259,32 +1260,32 @@ Run a named actor in isolation with simple, manual context. **Examples**

-$ agents actor run --context docs local/code_reader "Summarize the README"
+$ agents actor run --context docs local/code_reader "Summarize the README"
 
 ╭─ Run Summary ────────────────╮
 │ Actor: local/code_reader     │
-│ Context: docs                │
+│ Context: docs                │
 │ Temperature: 0.2             │
-│ Provider: anthropic          │
-│ Model: claude-3.5             │
+│ Provider: anthropic          │
+│ Model: claude-3.5             │
 ╰──────────────────────────────╯
 
 ╭─ Inputs ─────────────────────╮
-│ Prompt: Summarize the README │
-│ Context Files: 3             │
-│ Context Size: 12.4 KB       │
+│ Prompt: Summarize the README │
+│ Context Files: 3             │
+│ Context Size: 12.4 KB       │
 ╰──────────────────────────────╯
 
 ╭─ Result Metrics ──────╮
-│ Output: stdout         │
-│ Input Tokens: 1,524   │
-│ Output Tokens: 842    │
-│ Duration: 1.8s         │
+│ Output: stdout         │
+│ Input Tokens: 1,524   │
+│ Output Tokens: 842    │
+│ Duration: 1.8s         │
 │ Cost: $0.0021          │
-│ Tool Calls: 0          │
+│ Tool Calls: 0          │
 ╰───────────────────────╯
 
-✓ OK Summary generated
+✓ OK Summary generated
 
##### agents actor add @@ -1308,23 +1309,23 @@ When `--config` is provided alongside CLI options, the CLI options override the **Examples**

-$ agents actor add --config ./actors/reviewer.yaml local/reviewer
+$ agents actor add --config ./actors/reviewer.yaml local/reviewer
 
 ╭─ Actor Added ────────╮
 │ Name: local/reviewer │
-│ Provider: openai     │
+│ Provider: openai     │
 │ Model: gpt-4         │
 │ Default: yes         │
-│ Unsafe: no           │
-│ Type: graph          │
+│ Unsafe: no           │
+│ Type: graph          │
 ╰──────────────────────╯
 
 ╭─ Config ─────────────────────╮
-│ Path: ./actors/reviewer.yaml │
+│ Path: ./actors/reviewer.yaml │
 │ Hash: 8b3f3d2                │
-│ Options: 4                   │
-│ Nodes: 3                     │
-│ Edges: 4                     │
+│ Options: 4                   │
+│ Nodes: 3                     │
+│ Edges: 4                     │
 ╰──────────────────────────────╯
 
 ╭─ Capabilities ───────╮
@@ -1341,7 +1342,7 @@ $ agents actor add --config ./actors/reviewer.yaml local/reviewer
 │ git_diff      yes        yes  │
 ╰────────────────────────────────╯
 
-✓ OK Actor added
+✓ OK Actor added
 
##### agents actor remove @@ -1356,26 +1357,26 @@ Remove a custom actor. **Examples**

-$ agents actor remove local/reviewer
+$ agents actor remove local/reviewer
 
 ╭─ Actor Removed ──────╮
 │ Name: local/reviewer │
-│ Provider: openai     │
+│ Provider: openai     │
 │ Model: gpt-4         │
 ╰──────────────────────╯
 
 ╭─ Impact ───────────────────────────────────╮
-│ Sessions: 0 affected                       │
-│ Active Plans: 0 affected                   │
-│ Actions Referencing: 0                     │
+│ Sessions: 0 affected                       │
+│ Active Plans: 0 affected                   │
+│ Actions Referencing: 0                     │
 ╰────────────────────────────────────────────╯
 
 ╭─ Cleanup ──────────────╮
-│ Config: kept on disk  │
+│ Config: kept on disk  │
 │ Contexts: 1 orphaned  │
 ╰────────────────────────╯
 
-✓ OK Actor removed
+✓ OK Actor removed
 
##### agents actor list @@ -1390,7 +1391,7 @@ None. **Examples**

-$ agents actor list
+$ agents actor list
 
 ╭─ Actors ──────────────────────────────────────────────────────────────╮
 │ Name            Provider   Model       Default  Built-in  Unsafe │
@@ -1402,13 +1403,13 @@ $ agents actor list
 
 ╭─ Summary ──────────────╮
 │ Total: 3               │
-│ Built-in: 2            │
-│ Custom: 1              │
-│ Unsafe: 0              │
-│ Providers Used: 2     │
+│ Built-in: 2            │
+│ Custom: 1              │
+│ Unsafe: 0              │
+│ Providers Used: 2     │
 ╰────────────────────────╯
 
-✓ OK 3 actors listed
+✓ OK 3 actors listed
 
##### agents actor show @@ -1423,19 +1424,19 @@ Show details for a single actor. **Examples**

-$ agents actor show local/reviewer
+$ agents actor show local/reviewer
 
 ╭─ Actor Details ────────────────────╮
 │ Name: local/reviewer               │
-│ Provider: openai                   │
+│ Provider: openai                   │
 │ Model: gpt-4                       │
 │ Default: yes                       │
-│ Built-in: no                       │
-│ Unsafe: no                         │
-│ Type: graph                        │
-│ Created: 2026-02-08 12:35          │
-│ Updated: 2026-02-08 12:40          │
-│ Config: ./actors/reviewer.yaml     │
+│ Built-in: no                       │
+│ Unsafe: no                         │
+│ Type: graph                        │
+│ Created: 2026-02-08 12:35          │
+│ Updated: 2026-02-08 12:40          │
+│ Config: ./actors/reviewer.yaml     │
 │ Config Hash: 9c4e2a1              │
 ╰────────────────────────────────────╯
 
@@ -1446,10 +1447,10 @@ $ agents actor show local/reviewer
 ╰────────────────────╯
 
 ╭─ Graph Structure ─╮
-│ Nodes: 3          │
-│ Edges: 4          │
-│ Entry: analyze    │
-│ Exit: report      │
+│ Nodes: 3          │
+│ Edges: 4          │
+│ Entry: analyze    │
+│ Exit: report      │
 ╰───────────────────╯
 
 ╭─ Tools ────────────────────────╮
@@ -1461,19 +1462,19 @@ $ agents actor show local/reviewer
 ╰────────────────────────────────╯
 
 ╭─ Permissions ───────╮
-│ Unsafe: no          │
-│ Filesystem: allowed │
+│ Unsafe: no          │
+│ Filesystem: allowed │
 │ Network: restricted │
 ╰─────────────────────╯
 
 ╭─ Usage ─────────────────────────────────────────╮
-│ Referenced by Actions: 1 (local/code-coverage) │
-│ Active in Sessions: 0                          │
-│ Total Runs: 14                                 │
-│ Avg Cost/Run: $0.0032                          │
+│ Referenced by Actions: 1 (local/code-coverage) │
+│ Active in Sessions: 0                          │
+│ Total Runs: 14                                 │
+│ Avg Cost/Run: $0.0032                          │
 ╰─────────────────────────────────────────────────╯
 
-✓ OK Actor loaded
+✓ OK Actor loaded
 
##### agents actor context @@ -1495,19 +1496,19 @@ Remove files or directories from an actor context. **Examples**

-$ agents actor context rm docs
+$ agents actor context rm docs
 
 ╭─ Context Removed ───────────╮
 │ Context: docs              │
-│ Status: removed            │
+│ Status: removed            │
 ╰─────────────────────────────╯
 
 ╭─ Stats ───────────────────╮
-│ Remaining Size: 48 KB     │
-│ Updated: 2026-02-08 13:06 │
+│ Remaining Size: 48 KB     │
+│ Updated: 2026-02-08 13:06 │
 ╰───────────────────────────╯
 
-✓ OK Context updated
+✓ OK Context updated
 
###### agents actor context list @@ -1522,7 +1523,7 @@ List files stored in an actor context. **Examples**

-$ agents actor context list docs
+$ agents actor context list docs
 
 ╭─ Context Files ──────────────────────────────╮
 │ Name              Type  Size     Added      │
@@ -1534,12 +1535,12 @@ $ agents actor context list docs
 
 ╭─ Stats ───────────────────────╮
 │ Total Files: 3               │
-│ Total Size: 26.5 KB          │
-│ Estimated Tokens: ~6,600    │
-│ Languages: Markdown          │
+│ Total Size: 26.5 KB          │
+│ Estimated Tokens: ~6,600    │
+│ Languages: Markdown          │
 ╰───────────────────────────────╯
 
-✓ OK 3 files listed
+✓ OK 3 files listed
 
###### agents actor context show @@ -1554,17 +1555,17 @@ Show content of a file in an actor context. **Examples**

-$ agents actor context show docs
+$ agents actor context show docs
 
 ╭─ Context Summary ───────────╮
 │ Context: docs               │
-│ Files: 3                    │
+│ Files: 3                    │
 │ Total Size: 26.5 KB        │
-│ Estimated Tokens: ~6,600  │
-│ Created: 2026-02-08 12:10  │
+│ Estimated Tokens: ~6,600  │
+│ Created: 2026-02-08 12:10  │
 ╰─────────────────────────────╯
 
-✓ OK Context displayed
+✓ OK Context displayed
 
###### agents actor context export @@ -1580,21 +1581,21 @@ Export a context as JSON. **Examples**

-$ agents actor context export --output /tmp/docs-context.json docs
+$ agents actor context export --output /tmp/docs-context.json docs
 
 ╭─ Context Export ───────────────╮
 │ Context: docs                  │
-│ Output: /tmp/docs-context.json │
+│ Output: /tmp/docs-context.json │
 │ Items: 12                      │
-│ Size: 48 KB                    │
+│ Size: 48 KB                    │
 ╰────────────────────────────────╯
 
 ╭─ Integrity ──────────────────╮
 │ Checksum: sha256:19b2...a7d0 │
-│ Compressed: no               │
+│ Compressed: no               │
 ╰──────────────────────────────╯
 
-✓ OK Export completed
+✓ OK Export completed
 
###### agents actor context import @@ -1611,20 +1612,20 @@ Import a context from JSON. **Examples**

-$ agents actor context import --input /tmp/docs-context.json docs
+$ agents actor context import --input /tmp/docs-context.json docs
 
 ╭─ Context Import ──────────────╮
 │ Context: docs                 │
-│ Input: /tmp/docs-context.json │
+│ Input: /tmp/docs-context.json │
 │ Items: 12                     │
 ╰───────────────────────────────╯
 
 ╭─ Merge ───────────╮
-│ Strategy: replace │
+│ Strategy: replace │
 │ Conflicts: 0      │
 ╰───────────────────╯
 
-✓ OK Import completed
+✓ OK Import completed
 
###### agents actor context delete @@ -1641,22 +1642,22 @@ Delete an entire context. **Examples**

-$ agents actor context delete docs
+$ agents actor context delete docs
 
 Delete context docs? [y/N]: y
 
 ╭─ Context Deleted ────╮
 │ Context: docs        │
 │ Items: 12 removed    │
-│ Storage: 48 KB freed │
+│ Storage: 48 KB freed │
 ╰──────────────────────╯
 
 ╭─ Cleanup ───────╮
-│ Backups: none   │
-│ Logs: preserved │
+│ Backups: none   │
+│ Logs: preserved │
 ╰─────────────────╯
 
-✓ OK Context deleted
+✓ OK Context deleted
 
###### agents actor context clear @@ -1673,22 +1674,22 @@ Clear all files from a context but keep the context itself. **Examples**

-$ agents actor context clear docs
+$ agents actor context clear docs
 
 Clear context docs? [y/N]: y
 
 ╭─ Context Cleared ────╮
 │ Context: docs        │
 │ Items: 12 removed    │
-│ Storage: 48 KB freed │
+│ Storage: 48 KB freed │
 ╰──────────────────────╯
 
 ╭─ Retention ────────╮
-│ Context: preserved │
+│ Context: preserved │
 │ Files: removed     │
 ╰────────────────────╯
 
-✓ OK Context cleared
+✓ OK Context cleared
 
#### agents skill @@ -1718,20 +1719,20 @@ When `--config` is provided alongside CLI options (`--tool`, `--include-skill`, Registering a new skill:

-$ agents skill add --config ./skills/devops-toolkit.yaml local/devops-toolkit
+$ agents skill add --config ./skills/devops-toolkit.yaml local/devops-toolkit
 
 ╭─ Skill Registered ──────────────────────╮
 │ Name: local/devops-toolkit              │
-│ ID: 01HXMC4T08Y0N5R9VZ4QX4BPTZ1        │
-│ Description: Full-stack development tools │
-│ Config: ./skills/devops-toolkit.yaml      │
-│ Created: 2026-02-08 13:10                 │
+│ ID: 01HXMC4T08Y0N5R9VZ4QX4BPTZ1        │
+│ Description: Full-stack development tools │
+│ Config: ./skills/devops-toolkit.yaml      │
+│ Created: 2026-02-08 13:10                 │
 ╰─────────────────────────────────────────╯
 
 ╭─ Includes ────────────────────╮
-│ local/file-ops (registered) │
-│ local/git-ops (registered)  │
-│ local/github (registered)   │
+│ local/file-ops (registered) │
+│ local/git-ops (registered)  │
+│ local/github (registered)   │
 ╰───────────────────────────────╯
 
 ╭─ Tool Sources ─────────────────────────────╮
@@ -1746,18 +1747,18 @@ $ agents skill add --config ./skills/devops-toolkit.yaml local/devops-toolkit
 ╰────────────────────────────────────────────╯
 
 ╭─ MCP Servers ────────────────────╮
-│ linear: validated (2 tools)    │
+│ linear: validated (2 tools)    │
 ╰──────────────────────────────────╯
 
-✓ OK Skill registered with 23 tools
+✓ OK Skill registered with 23 tools
 
Attempting to add a skill that already exists (without `--update`):

-$ agents skill add --config ./skills/devops-toolkit-v2.yaml local/devops-toolkit
+$ agents skill add --config ./skills/devops-toolkit-v2.yaml local/devops-toolkit
 
-✗ Error: Skill 'local/devops-toolkit' is already registered.
+✗ Error: Skill 'local/devops-toolkit' is already registered.
 
 To overwrite the existing configuration, re-run with --update:
 
@@ -1767,20 +1768,20 @@ To overwrite the existing configuration, re-run with --update:
 Updating an existing skill with `--update`:
 
 

-$ agents skill add --config ./skills/devops-toolkit-v2.yaml --update local/devops-toolkit
+$ agents skill add --config ./skills/devops-toolkit-v2.yaml --update local/devops-toolkit
 
 ╭─ Skill Updated ──────────────────────────╮
 │ Name: local/devops-toolkit              │
-│ Description: Full-stack development tools │
-│ Updated: 2026-02-08 14:22               │
+│ Description: Full-stack development tools │
+│ Updated: 2026-02-08 14:22               │
 ╰─────────────────────────────────────────╯
 
 ╭─ Changes ─────────────────────╮
-│ Tools Added: 2              │
+│ Tools Added: 2              │
 │ Tools Removed: 0           │
-│ Tools Modified: 1          │
-│ Includes Changed: no      │
-│ MCP Servers Changed: no   │
+│ Tools Modified: 1          │
+│ Includes Changed: no      │
+│ MCP Servers Changed: no   │
 ╰───────────────────────────────╯
 
 ╭─ Affected Actors ────────────────────────────╮
@@ -1790,7 +1791,7 @@ $ agents skill add --config ./skills/devops-toolkit-v2.yaml --update local/devop
 │ These actors will pick up changes on next use │
 ╰──────────────────────────────────────────────╯
 
-✓ OK Skill updated (23 → 25 tools)
+✓ OK Skill updated (23 → 25 tools)
 
##### agents skill remove @@ -1806,14 +1807,14 @@ Remove a registered skill. **Examples**

-$ agents skill remove local/devops-toolkit
+$ agents skill remove local/devops-toolkit
 
 Remove skill local/devops-toolkit? [y/N]: y
 
 ╭─ Skill Removed ──────────────────────╮
 │ Name: local/devops-toolkit           │
 │ Tools: 23 removed from registry      │
-│ MCP Servers: 1 connection closed     │
+│ MCP Servers: 1 connection closed     │
 ╰──────────────────────────────────────╯
 
 ╭─ Dependency Check ───────────────────────────────╮
@@ -1824,7 +1825,7 @@ Remove skill local/devops-toolkit? [y/N]: y
 │ - local/full-stack-assistant                       │
 ╰──────────────────────────────────────────────────╯
 
-✓ OK Skill removed
+✓ OK Skill removed
 
##### agents skill list @@ -1840,7 +1841,7 @@ List registered skills with optional filters. **Examples**

-$ agents skill list
+$ agents skill list
 
 ╭─ Skills ────────────────────────────────────────────────────────────╮
 │ Name                    Tools  Includes  Sources                │
@@ -1854,12 +1855,12 @@ $ agents skill list
 
 ╭─ Summary ─────────╮
 │ Total: 5          │
-│ Local: 5          │
-│ Server: 0         │
-│ Total Tools: 28  │
+│ Local: 5          │
+│ Server: 0         │
+│ Total Tools: 28  │
 ╰───────────────────╯
 
-✓ OK 5 skills listed
+✓ OK 5 skills listed
 
##### agents skill show @@ -1874,21 +1875,21 @@ Show full details for a registered skill, including its includes, tool sources, **Examples**

-$ agents skill show local/devops-toolkit
+$ agents skill show local/devops-toolkit
 
 ╭─ Skill Details ─────────────────────────────╮
 │ Name: local/devops-toolkit                 │
-│ ID: 01HXMC4T08Y0N5R9VZ4QX4BPTZ1           │
-│ Description: Full-stack development tools    │
-│ Config: ./skills/devops-toolkit.yaml         │
-│ Created: 2026-02-08 13:10                    │
-│ Updated: 2026-02-08 14:22                    │
+│ ID: 01HXMC4T08Y0N5R9VZ4QX4BPTZ1           │
+│ Description: Full-stack development tools    │
+│ Config: ./skills/devops-toolkit.yaml         │
+│ Created: 2026-02-08 13:10                    │
+│ Updated: 2026-02-08 14:22                    │
 ╰─────────────────────────────────────────────╯
 
 ╭─ Includes (3) ────────────────────────────╮
-│ local/file-ops  → 9 tools (builtin)     │
-│ local/git-ops   → 4 tools (builtin)     │
-│ local/github    → 4 tools (mcp)          │
+│ local/file-ops  → 9 tools (builtin)     │
+│ local/git-ops   → 4 tools (builtin)     │
+│ local/github    → 4 tools (mcp)          │
 ╰───────────────────────────────────────────╯
 
 ╭─ Direct Tools (6) ────────────────────────────────────────╮
@@ -1903,24 +1904,24 @@ $ agents skill show local/devops-toolkit
 ╰───────────────────────────────────────────────────────────╯
 
 ╭─ MCP Servers (1) ───────────────────╮
-│ linear: stdio, 2 tools, connected │
+│ linear: stdio, 2 tools, connected │
 ╰─────────────────────────────────────╯
 
 ╭─ Capability Summary ──────────╮
-│ Total Tools: 23              │
-│ Read-Only: 10               │
+│ Total Tools: 23              │
+│ Read-Only: 10               │
 │ Writes: 13                  │
-│ Checkpointable: 10         │
+│ Checkpointable: 10         │
 │ Has Side Effects: 3        │
-│ Requires Approval: 1       │
+│ Requires Approval: 1       │
 ╰───────────────────────────────╯
 
 ╭─ Referenced By ───────────────────╮
-│ Actors: local/code-assistant    │
-│ Skills: local/full-stack-dev    │
+│ Actors: local/code-assistant    │
+│ Skills: local/full-stack-dev    │
 ╰───────────────────────────────────╯
 
-✓ OK Skill loaded
+✓ OK Skill loaded
 
##### agents skill tools @@ -1935,7 +1936,7 @@ List all tools provided by a skill, including those inherited from included skil **Examples**

-$ agents skill tools local/devops-toolkit
+$ agents skill tools local/devops-toolkit
 
 ╭─ Tools for local/devops-toolkit ─────────────────────────────────────────────────────────╮
 │ Tool               Source       From Skill      Read-Only  Writes  Checkpoint │
@@ -1966,15 +1967,15 @@ $ agents skill tools local/devops-toolkit
 ╰──────────────────────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Summary ──────────────────╮
-│ Total: 23                 │
-│ From Includes: 17        │
-│ Direct: 6                │
-│ Read-Only: 10            │
+│ Total: 23                 │
+│ From Includes: 17        │
+│ Direct: 6                │
+│ Read-Only: 10            │
 │ Writes: 13               │
-│ Checkpointable: 10      │
+│ Checkpointable: 10      │
 ╰────────────────────────────╯
 
-✓ OK 23 tools listed
+✓ OK 23 tools listed
 
#### agents tool @@ -2006,34 +2007,34 @@ When `--config` is provided alongside CLI options, the CLI options override the Registering a new tool:

-$ agents tool add --config ./tools/run-migrations.yaml local/run-migrations
+$ agents tool add --config ./tools/run-migrations.yaml local/run-migrations
 
 ╭─ Tool Registered ───────────────────────────╮
 │ Name: local/run-migrations                  │
-│ ID: 01HXMC5T09Z1N6S0WZ5RY5CQUZ2          │
-│ Description: Run database migrations         │
-│ Source: custom                               │
-│ Config: ./tools/run-migrations.yaml          │
-│ Created: 2026-02-09 10:15                   │
+│ ID: 01HXMC5T09Z1N6S0WZ5RY5CQUZ2          │
+│ Description: Run database migrations         │
+│ Source: custom                               │
+│ Config: ./tools/run-migrations.yaml          │
+│ Created: 2026-02-09 10:15                   │
 ╰─────────────────────────────────────────────╯
 
 ╭─ Capability ──────────────────╮
 │ Writes: true                 │
-│ Write Scope: database:migrations │
-│ Checkpointable: true        │
-│ Checkpoint Scope: transaction │
+│ Write Scope: database:migrations │
+│ Checkpointable: true        │
+│ Checkpoint Scope: transaction │
 │ Side Effects: schema_mutation  │
 ╰───────────────────────────────╯
 
-✓ OK Tool registered
+✓ OK Tool registered
 
Attempting to add a tool that already exists (without `--update`):

-$ agents tool add --config ./tools/run-migrations-v2.yaml local/run-migrations
+$ agents tool add --config ./tools/run-migrations-v2.yaml local/run-migrations
 
-✗ Error: Tool 'local/run-migrations' is already registered.
+✗ Error: Tool 'local/run-migrations' is already registered.
 
 To overwrite the existing configuration, re-run with --update:
 
@@ -2053,13 +2054,13 @@ Remove a registered tool.
 **Examples**
 
 

-$ agents tool remove local/run-migrations
+$ agents tool remove local/run-migrations
 
 Remove tool local/run-migrations? [y/N]: y
 
 ╭─ Tool Removed ────────────────────╮
 │ Name: local/run-migrations       │
-│ Source: custom                    │
+│ Source: custom                    │
 ╰───────────────────────────────────╯
 
 ╭─ References ──────────────────────────────────────╮
@@ -2069,7 +2070,7 @@ Remove tool local/run-migrations? [y/N]: y
 │ These references will break until resolved.       │
 ╰───────────────────────────────────────────────────╯
 
-✓ OK Tool removed
+✓ OK Tool removed
 
##### agents tool list @@ -2085,7 +2086,7 @@ List registered tools with optional filters. **Examples**

-$ agents tool list --namespace local
+$ agents tool list --namespace local
 
 ╭─ Tools ──────────────────────────────────────────────────╮
 │ Name                       Source   Read-Only  Writes │
@@ -2097,12 +2098,12 @@ $ agents tool list --namespace local
 ╰──────────────────────────────────────────────────────────╯
 
 ╭─ Summary ────────╮
-│ Total: 4        │
-│ Read-Only: 0    │
+│ Total: 4        │
+│ Read-Only: 0    │
 │ Writes: 4       │
 ╰──────────────────╯
 
-✓ OK 4 tools listed
+✓ OK 4 tools listed
 
##### agents tool show @@ -2117,39 +2118,39 @@ Show full details for a registered tool, including its schema, capability metada **Examples**

-$ agents tool show local/run-migrations
+$ agents tool show local/run-migrations
 
 ╭─ Tool Details ──────────────────────────────╮
 │ Name: local/run-migrations                  │
-│ Description: Run database migrations         │
-│ Source: custom                               │
-│ Config: ./tools/run-migrations.yaml          │
-│ Registered: 2026-02-09 10:15                 │
+│ Description: Run database migrations         │
+│ Source: custom                               │
+│ Config: ./tools/run-migrations.yaml          │
+│ Registered: 2026-02-09 10:15                 │
 ╰─────────────────────────────────────────────╯
 
 ╭─ Input Schema ────────────────────────────────╮
-│ direction: string (required) enum: [up, down] │
-│ count: integer (default: 1)                    │
+│ direction: string (required) enum: [up, down] │
+│ count: integer (default: 1)                    │
 ╰───────────────────────────────────────────────╯
 
 ╭─ Capability ──────────────────────╮
-│ Read-Only: false                  │
+│ Read-Only: false                  │
 │ Writes: true                     │
-│ Write Scope: database:migrations  │
-│ Checkpointable: true             │
-│ Checkpoint Scope: transaction    │
+│ Write Scope: database:migrations  │
+│ Checkpointable: true             │
+│ Checkpoint Scope: transaction    │
 │ Side Effects: schema_mutation     │
-│ Idempotent: false                │
+│ Idempotent: false                │
 ╰───────────────────────────────────╯
 
 ╭─ Referenced By ───────────────────────╮
-│ Skills:                             │
+│ Skills:                             │
 │   - local/devops-toolkit              │
-│ Actor Graph Nodes:                  │
+│ Actor Graph Nodes:                  │
 │   - code_executor.run_db_migrate      │
 ╰───────────────────────────────────────╯
 
-✓ OK Tool details loaded
+✓ OK Tool details loaded
 
#### agents resource type @@ -2179,13 +2180,13 @@ When `--config` is provided alongside CLI options, the CLI options override the **Examples**

-$ agents resource type add --config ./resource-types/svn.yaml local/svn
+$ agents resource type add --config ./resource-types/svn.yaml local/svn
 
 ╭─ Resource Type ────────────────────╮
 │ Name: local/svn                    │
-│ Physical/Virtual: physical         │
-│ User Addable: yes                  │
-│ Registered: 2026-02-09 10:15       │
+│ Physical/Virtual: physical         │
+│ User Addable: yes                  │
+│ Registered: 2026-02-09 10:15       │
 ╰────────────────────────────────────╯
 
 ╭─ CLI Arguments ────────────────────────╮
@@ -2196,16 +2197,16 @@ $ agents resource type add --config ./resource-types/svn.yaml local/svn
 ╰────────────────────────────────────────╯
 
 ╭─ Child Types ──────────────────────────╮
-│ Auto-discover: svn-revision, svn-file │
-│ Manual link: fs-mount                 │
+│ Auto-discover: svn-revision, svn-file │
+│ Manual link: fs-mount                 │
 ╰────────────────────────────────────────╯
 
 ╭─ Sandbox ──────────────────────╮
-│ Strategy: copy_on_write        │
-│ Handler: SVNHandler (custom)   │
+│ Strategy: copy_on_write        │
+│ Handler: SVNHandler (custom)   │
 ╰────────────────────────────────╯
 
-✓ OK Resource type registered
+✓ OK Resource type registered
  New subcommand available: agents resource add local/svn
 
@@ -2222,17 +2223,17 @@ Remove a custom resource type. Built-in types cannot be removed. Fails if any re **Examples**

-$ agents resource type remove local/svn
+$ agents resource type remove local/svn
 
 Remove resource type local/svn? [y/N]: y
 
 ╭─ Resource Type Removed ───────╮
 │ Name: local/svn               │
 │ Resources Using: 0           │
-│ Subcommand Removed: yes      │
+│ Subcommand Removed: yes      │
 ╰───────────────────────────────╯
 
-✓ OK Resource type removed
+✓ OK Resource type removed
 
##### agents resource type list @@ -2247,7 +2248,7 @@ None (use the global `--format` option to control output format). **Examples**

-$ agents resource type list
+$ agents resource type list
 
 ╭─ Resource Types ──────────────────────────────────────────────────────────────────────────────────╮
 │ Name                 Source    Phys/Virt  Addable  Auto-children                          │
@@ -2282,12 +2283,12 @@ $ agents resource type list
 ╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Summary ─────────────────╮
-│ Built-in: 24            │
-│ Custom: 1               │
-│ User Addable: 4        │
+│ Built-in: 24            │
+│ Custom: 1               │
+│ User Addable: 4        │
 ╰───────────────────────────╯
 
-✓ OK 25 resource types listed
+✓ OK 25 resource types listed
 
##### agents resource type show @@ -2302,14 +2303,14 @@ Show detailed information about a resource type, including its full schema. **Examples**

-$ agents resource type show git-checkout
+$ agents resource type show git-checkout
 
 ╭─ Resource Type ──────────────────────────────────────────────────────╮
 │ Name: git-checkout                                                  │
-│ Source: built-in                                                    │
-│ Description: A locally checked-out git repository with worktree      │
-│ Physical/Virtual: physical                                          │
-│ User Addable: yes                                                  │
+│ Source: built-in                                                    │
+│ Description: A locally checked-out git repository with worktree      │
+│ Physical/Virtual: physical                                          │
+│ User Addable: yes                                                  │
 ╰──────────────────────────────────────────────────────────────────────╯
 
 ╭─ CLI Arguments (agents resource add git-checkout) ─────────────────╮
@@ -2331,12 +2332,12 @@ $ agents resource type show git-checkout
 ╰──────────────────────────────────────────────────────────────────╯
 
 ╭─ Sandbox ──────────────────────╮
-│ Strategy: git_worktree         │
-│ Checkpointable: yes           │
-│ Handler: GitCheckoutHandler   │
+│ Strategy: git_worktree         │
+│ Checkpointable: yes           │
+│ Handler: GitCheckoutHandler   │
 ╰────────────────────────────────╯
 
-✓ OK Resource type details loaded
+✓ OK Resource type details loaded
 
#### agents resource @@ -2361,50 +2362,50 @@ Type-specific flags depend on the resource type. See `agents resource type show **Examples**

-$ agents resource add git-checkout local/api-repo --path /home/user/projects/api-service --branch main
+$ agents resource add git-checkout local/api-repo --path /home/user/projects/api-service --branch main
 
 ╭─ Resource ────────────────────────────╮
 │ Name: local/api-repo                 │
-│ Type: git-checkout                    │
-│ Physical/Virtual: physical            │
-│ Path: /home/user/projects/api-service  │
-│ Branch: main                          │
-│ Created: 2026-02-09 10:20             │
+│ Type: git-checkout                    │
+│ Physical/Virtual: physical            │
+│ Path: /home/user/projects/api-service  │
+│ Branch: main                          │
+│ Created: 2026-02-09 10:20             │
 ╰───────────────────────────────────────╯
 
 ╭─ Auto-discovered Children ───────────────────────────────────────╮
 │ Name                         Type            Status             │
 │ ───────────────────────────  ──────────────  ───────────────── │
-│ local/api-repo:repo        git             created            │
-│ local/api-repo:repo:origin git-remote      created            │
-│ local/api-repo:repo:main   git-branch      created            │
-│ local/api-repo:repo:dev    git-branch      created            │
-│ local/api-repo:worktree    fs-directory    created            │
+│ local/api-repo:repo        git             created            │
+│ local/api-repo:repo:origin git-remote      created            │
+│ local/api-repo:repo:main   git-branch      created            │
+│ local/api-repo:repo:dev    git-branch      created            │
+│ local/api-repo:worktree    fs-directory    created            │
 │   + 47 git-commit resources                                    │
 │   + 312 git-tree-entry resources                               │
 │   + 3 fs-directory + 28 fs-file                                │
 ╰──────────────────────────────────────────────────────────────────╯
 
 ╭─ Capabilities ─────────────────╮
-│ Readable: yes                 │
+│ Readable: yes                 │
 │ Writable: yes                 │
-│ Sandboxable: yes              │
-│ Checkpointable: yes           │
-│ Sandbox Strategy: git_worktree │
+│ Sandboxable: yes              │
+│ Checkpointable: yes           │
+│ Sandbox Strategy: git_worktree │
 ╰────────────────────────────────╯
 
-✓ OK Resource registered (395 child resources discovered)
+✓ OK Resource registered (395 child resources discovered)
 

-$ agents resource add fs-mount local/docs --mount-path /docs/api-reference
+$ agents resource add fs-mount local/docs --mount-path /docs/api-reference
 
 ╭─ Resource ──────────────────────────╮
 │ Name: local/docs                    │
-│ Type: fs-mount                      │
-│ Physical/Virtual: physical          │
-│ Mount Path: /docs/api-reference      │
-│ Created: 2026-02-09 10:22           │
+│ Type: fs-mount                      │
+│ Physical/Virtual: physical          │
+│ Mount Path: /docs/api-reference      │
+│ Created: 2026-02-09 10:22           │
 ╰─────────────────────────────────────╯
 
 ╭─ Auto-discovered Children ────────────────────╮
@@ -2414,22 +2415,22 @@ $ agents resource add fs-mount local/docs --mount-path /docs/api-reference
 ╰───────────────────────────────────────────────╯
 
 ╭─ Capabilities ──────────────────────╮
-│ Readable: yes                      │
+│ Readable: yes                      │
 │ Writable: yes                      │
-│ Sandboxable: yes                   │
-│ Checkpointable: yes                │
-│ Sandbox Strategy: copy_on_write     │
+│ Sandboxable: yes                   │
+│ Checkpointable: yes                │
+│ Sandbox Strategy: copy_on_write     │
 ╰─────────────────────────────────────╯
 
-✓ OK Resource registered (31 child resources discovered)
+✓ OK Resource registered (31 child resources discovered)
 
**Duplicate name error:**

-$ agents resource add git-checkout local/api-repo --path /repos/api-service
+$ agents resource add git-checkout local/api-repo --path /repos/api-service
 
-✗ Error: Resource local/api-repo already exists.
+✗ Error: Resource local/api-repo already exists.
   Use --update to replace: agents resource add --update git-checkout local/api-repo --path /repos/api-service
 
@@ -2446,18 +2447,18 @@ Remove a registered resource and all its auto-discovered child resources. Fails **Examples**

-$ agents resource remove local/api-repo
+$ agents resource remove local/api-repo
 
 Remove resource local/api-repo and 395 child resources? [y/N]: y
 
 ╭─ Resource Removed ────────────────╮
 │ Name: local/api-repo              │
-│ Type: git-checkout                  │
+│ Type: git-checkout                  │
 │ Children Removed: 395             │
-│ Projects Unlinked: 0              │
+│ Projects Unlinked: 0              │
 ╰───────────────────────────────────╯
 
-✓ OK Resource removed
+✓ OK Resource removed
 
##### agents resource list @@ -2473,7 +2474,7 @@ List registered resources with optional filters. **Examples**

-$ agents resource list
+$ agents resource list
 
 ╭─ Resources ──────────────────────────────────────────────────────────────────╮
 │ Name                Type        Phys/Virt  Children  Projects       │
@@ -2485,13 +2486,13 @@ $ agents resource list
 ╰──────────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Summary ───────────╮
-│ Total: 3            │
-│ Physical: 3        │
-│ Virtual: 0         │
-│ Total Children: 405 │
+│ Total: 3            │
+│ Physical: 3        │
+│ Virtual: 0         │
+│ Total Children: 405 │
 ╰─────────────────────╯
 
-✓ OK 3 resources listed
+✓ OK 3 resources listed
 
##### agents resource show @@ -2506,23 +2507,23 @@ Show detailed information about a registered resource including its type, capabi **Examples**

-$ agents resource show local/api-repo
+$ agents resource show local/api-repo
 
 ╭─ Resource ──────────────────────────────╮
 │ Name: local/api-repo                   │
-│ Type: git-checkout                      │
-│ Physical/Virtual: physical              │
-│ Path: /home/user/projects/api-service    │
-│ Branch: main                            │
-│ Created: 2026-02-09 10:20               │
+│ Type: git-checkout                      │
+│ Physical/Virtual: physical              │
+│ Path: /home/user/projects/api-service    │
+│ Branch: main                            │
+│ Created: 2026-02-09 10:20               │
 ╰─────────────────────────────────────────╯
 
 ╭─ Capabilities ──────────────────╮
-│ Readable: yes                    │
+│ Readable: yes                    │
 │ Writable: yes                    │
-│ Sandboxable: yes                 │
-│ Checkpointable: yes              │
-│ Sandbox Strategy: git_worktree    │
+│ Sandboxable: yes                 │
+│ Checkpointable: yes              │
+│ Sandbox Strategy: git_worktree    │
 ╰─────────────────────────────────╯
 
 ╭─ Parents ────╮
@@ -2549,7 +2550,7 @@ $ agents resource show local/api-repo
 │ local/run-migrations     db     (not bound)   │
 ╰────────────────────────────────────────────────╯
 
-✓ OK Resource details loaded
+✓ OK Resource details loaded
 
##### agents resource tree @@ -2566,32 +2567,32 @@ Display the resource DAG as a tree starting from a given resource, showing paren **Examples**

-$ agents resource tree local/api-repo --depth 2
+$ agents resource tree local/api-repo --depth 2
 
 ╭─ Resource Tree: local/api-repo ──────────────────────────────╮
 │                                                               │
 │ local/api-repo (git-checkout, physical)                      │
-│ ├── local/api-repo:repo (git, physical)                       │
-│ │   ├── local/api-repo:repo:origin (git-remote)               │
+│ ├── local/api-repo:repo (git, physical)                       │
+│ │   ├── local/api-repo:repo:origin (git-remote)               │
 │ │   ├── local/api-repo:repo:main (git-branch)                 │
-│ │   │   ├── ...repo:main:a1b2c3d (git-commit)                 │
+│ │   │   ├── ...repo:main:a1b2c3d (git-commit)                 │
 │ │   │   └── ... 22 more git-commit resources                 │
 │ │   └── local/api-repo:repo:dev (git-branch)                  │
 │ │       └── ... 26 git-commit resources                       │
-│ └── local/api-repo:worktree (fs-directory, physical)          │
-│     ├── ...worktree:src/ (fs-directory)                         │
-│     ├── ...worktree:tests/ (fs-directory)                       │
+│ └── local/api-repo:worktree (fs-directory, physical)          │
+│     ├── ...worktree:src/ (fs-directory)                         │
+│     ├── ...worktree:tests/ (fs-directory)                       │
 │     └── ... 28 more fs-file resources                          │
 │                                                               │
 ╰───────────────────────────────────────────────────────────────╯
 
 ╭─ Summary ──────────────╮
-│ Total shown: 14       │
-│ Total in subtree: 395 │
-│ Max depth: 2          │
+│ Total shown: 14       │
+│ Total in subtree: 395 │
+│ Max depth: 2          │
 ╰────────────────────────╯
 
-✓ OK Resource tree displayed
+✓ OK Resource tree displayed
 
##### agents resource link-child @@ -2607,16 +2608,16 @@ Manually link one resource as a child of another. The child resource must alread **Examples**

-$ agents resource link-child --parent local/api-repo --child local/docs
+$ agents resource link-child --parent local/api-repo --child local/docs
 
 ╭─ Child Linked ────────────────────────╮
 │ Parent: local/api-repo              │
-│ Child: local/docs                    │
-│ Child Type: fs-mount                 │
-│ Status: linked                       │
+│ Child: local/docs                    │
+│ Child Type: fs-mount                 │
+│ Status: linked                       │
 ╰───────────────────────────────────────╯
 
-✓ OK Child resource linked
+✓ OK Child resource linked
 
##### agents resource unlink-child @@ -2633,17 +2634,17 @@ Remove a manual parent/child link between two resources. Auto-discovered links c **Examples**

-$ agents resource unlink-child --parent local/api-repo --child local/docs
+$ agents resource unlink-child --parent local/api-repo --child local/docs
 
 Unlink local/docs from parent local/api-repo? [y/N]: y
 
 ╭─ Child Unlinked ──────────────────────╮
 │ Parent: local/api-repo              │
-│ Child: local/docs                    │
-│ Status: unlinked                     │
+│ Child: local/docs                    │
+│ Status: unlinked                     │
 ╰───────────────────────────────────────╯
 
-✓ OK Child resource unlinked
+✓ OK Child resource unlinked
 
#### agents plan @@ -2666,7 +2667,7 @@ List plans with optional filtering. **Examples**

-$ agents plan list --phase execute --format table
+$ agents --format table plan list --phase execute
 
 ╭─ Plans ──────────────────────────────────────────────────────────────────────────────╮
 │ ID        Phase    State       Action               Project            Elapsed  │
@@ -2677,18 +2678,18 @@ $ agents plan list --phase execute --format table
 ╭─ Filters ──────╮
 │ Phase: execute │
 │ State: (any)   │
-│ Project: (any) │
-│ Action: (any)  │
+│ Project: (any) │
+│ Action: (any)  │
 ╰────────────────╯
 
 ╭─ Summary ─────────╮
 │ Total: 1          │
 │ Processing: 1    │
-│ Completed: 0     │
-│ Errored: 0        │
+│ Completed: 0     │
+│ Errored: 0        │
 ╰───────────────────╯
 
-✓ OK 1 plan listed
+✓ OK 1 plan listed
 
##### agents plan use @@ -2713,16 +2714,16 @@ All actor arguments (`--strategy-actor`, `--execution-actor`, `--estimation-acto **Examples**

-$ agents plan use local/code-coverage local/api-service \
-  --arg target_coverage_percent=85 --automation-profile trusted
+$ agents plan use local/code-coverage local/api-service \
+  --arg target_coverage_percent=85 --automation-profile trusted
 
 ╭─ Plan Created ──────────────────────╮
 │ Plan ID: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
 │ Phase: strategize                   │
 │ Action: local/code-coverage         │
-│ Project: local/api-service          │
-│ Automation: review                  │
-│ Attempt: 1                          │
+│ Project: local/api-service          │
+│ Automation: review                  │
+│ Attempt: 1                          │
 ╰─────────────────────────────────────╯
 
 ╭─ Inputs ─────────────────────╮
@@ -2733,20 +2734,20 @@ $ agents plan use local/code-coverage local/api-service \
 ╭─ Actors ────────────────────────╮
 │ Strategy: local/strategist      │
 │ Execution: local/executor       │
-│ Estimation: (none)              │
+│ Estimation: (none)              │
 ╰─────────────────────────────────╯
 
 ╭─ Automation ─────────────────────────╮
 │ Profile: supervised                  │
-│ Source: project default              │
-│ Read-Only: no                        │
+│ Source: project default              │
+│ Read-Only: no                        │
 ╰──────────────────────────────────────╯
 
 ╭─ Context ───────────────────────╮
-│ Resources: 2 (repo, db)        │
-│ Indexed Files: 347             │
-│ View: strategize               │
-│ Hot Token Budget: 12,000       │
+│ Resources: 2 (repo, db)        │
+│ Indexed Files: 347             │
+│ View: strategize               │
+│ Hot Token Budget: 12,000       │
 ╰─────────────────────────────────╯
 
 ╭─ Next Steps ─────────────────────────────────────╮
@@ -2755,7 +2756,7 @@ $ agents plan use local/code-coverage local/api-service \
 │ - agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J    │
 ╰──────────────────────────────────────────────────╯
 
-✓ OK Plan created
+✓ OK Plan created
 
##### agents plan execute @@ -2770,30 +2771,30 @@ Start or resume execution for a plan. **Examples**

-$ agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J
+$ agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 
 ╭─ Execution ──────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
 │ Phase: execute                   │
 │ Sandbox: git_worktree            │
-│ Worker: local/executor           │
-│ Started: 12:58:10                │
-│ Attempt: 1                       │
+│ Worker: local/executor           │
+│ Started: 12:58:10                │
+│ Attempt: 1                       │
 ╰──────────────────────────────────╯
 
 ╭─ Sandbox ──────────────────────────────────╮
-│ Strategy: git_worktree                   │
-│ Path: /repos/api/.worktrees/plan-01HXM8 │
-│ Branch: cleveragents/plan-01HXM8C2      │
-│ Status: active                           │
+│ Strategy: git_worktree                   │
+│ Path: /repos/api/.worktrees/plan-01HXM8 │
+│ Branch: cleveragents/plan-01HXM8C2      │
+│ Status: active                           │
 ╰────────────────────────────────────────────╯
 
 ╭─ Strategy Summary ─────────────────────╮
-│ Decisions: 8                          │
+│ Decisions: 8                          │
 │ Invariants: 2                         │
-│ Planned Child Plans: 2+               │
-│ Estimated Files: ~12                  │
-│ Risk: low                              │
+│ Planned Child Plans: 2+               │
+│ Estimated Files: ~12                  │
+│ Risk: low                              │
 ╰────────────────────────────────────────╯
 
 ╭─ Progress ────────╮
@@ -2803,7 +2804,7 @@ $ agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 │  Validate        │
 ╰───────────────────╯
 
-✓ OK Execution started
+✓ OK Execution started
 
##### agents plan apply @@ -2819,38 +2820,38 @@ Apply sandboxed changes to real resources. **Examples**

-$ agents plan apply 01HXM8C2ZK4Q7C2B3F2R4VYV6J
+$ agents plan apply 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 
 Apply changes for plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J? [y/N]: y
 
 ╭─ Apply Summary ─────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J    │
-│ Artifacts: 6 files updated          │
+│ Artifacts: 6 files updated          │
 │ Changes: 42 insertions, 9 deletions │
-│ Project: local/api-service          │
-│ Applied At: 2026-02-08 13:04        │
+│ Project: local/api-service          │
+│ Applied At: 2026-02-08 13:04        │
 ╰─────────────────────────────────────╯
 
 ╭─ Validation ───────────────────╮
-│ Tests: passed (24/24)          │
-│ Lint: passed (0 warnings)      │
-│ Type Check: passed (0 errors)  │
-│ Duration: 12.4s                │
+│ Tests: passed (24/24)          │
+│ Lint: passed (0 warnings)      │
+│ Type Check: passed (0 errors)  │
+│ Duration: 12.4s                │
 ╰────────────────────────────────╯
 
 ╭─ Sandbox Cleanup ─────────╮
-│ Worktree: removed        │
-│ Branch: merged to main   │
-│ Checkpoint: archived     │
+│ Worktree: removed        │
+│ Branch: merged to main   │
+│ Checkpoint: archived     │
 ╰───────────────────────────╯
 
 ╭─ Plan Lifecycle ────────────────────────╮
-│ Phase: applied                         │
-│ State: complete                        │
-│ Total Duration: 00:06:14              │
+│ Phase: applied                         │
+│ State: complete                        │
+│ Total Duration: 00:06:14              │
 │ Total Cost: $0.0847                    │
-│ Decisions Made: 8                     │
-│ Child Plans: 2 (completed)              │
+│ Decisions Made: 8                     │
+│ Child Plans: 2 (completed)              │
 ╰─────────────────────────────────────────╯
 
 ╭─ Next Steps ──────╮
@@ -2858,7 +2859,7 @@ Apply changes for plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J? [y/N]: y
 │ - Commit changes  │
 ╰───────────────────╯
 
-✓ OK Changes applied
+✓ OK Changes applied
 
##### agents plan status @@ -2873,45 +2874,45 @@ Show detailed status for a plan. **Examples**

-$ agents plan status 01HXM8C2ZK4Q7C2B3F2R4VYV6J
+$ agents plan status 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 
 ╭─ Plan Status ────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
 │ Phase: execute                   │
 │ State: processing                │
-│ Action: local/code-coverage      │
-│ Project: local/api-service       │
-│ Automation: review               │
-│ Attempt: 1                       │
+│ Action: local/code-coverage      │
+│ Project: local/api-service       │
+│ Automation: review               │
+│ Attempt: 1                       │
 ╰──────────────────────────────────╯
 
 ╭─ Progress ───────╮
-│  Strategize     │
+│  Strategize     │
 │  Execute        │
 │  Apply (queued) │
 ╰──────────────────╯
 
 ╭─ Timing ──────────╮
-│ Started: 12:57:01 │
+│ Started: 12:57:01 │
 │ Elapsed: 00:01:12 │
-│ ETA: 00:03:45     │
+│ ETA: 00:03:45     │
 ╰───────────────────╯
 
 ╭─ Execution Detail ──────────╮
-│ Sandbox: git_worktree       │
-│ Tool Calls: 8              │
-│ Files Modified: 3          │
-│ Child Plans: 1/2 complete  │
-│ Checkpoints: 2 created     │
+│ Sandbox: git_worktree       │
+│ Tool Calls: 8              │
+│ Files Modified: 3          │
+│ Child Plans: 1/2 complete  │
+│ Checkpoints: 2 created     │
 ╰─────────────────────────────╯
 
 ╭─ Cost ───────────────╮
-│ Tokens Used: 12,420 │
+│ Tokens Used: 12,420 │
 │ Cost So Far: $0.041 │
-│ Estimated: $0.085   │
+│ Estimated: $0.085   │
 ╰──────────────────────╯
 
-✓ OK Status refreshed
+✓ OK Status refreshed
 
##### agents plan cancel @@ -2927,26 +2928,26 @@ Cancel a plan that is not terminal. **Examples**

-$ agents plan cancel 01HXM8C2ZK4Q7C2B3F2R4VYV6J --reason "blocked on credentials"
+$ agents plan cancel 01HXM8C2ZK4Q7C2B3F2R4VYV6J --reason "blocked on credentials"
 
 ╭─ Plan Cancelled ─────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
 │ Phase: execute                   │
 │ Reason: blocked on credentials   │
-│ State: cancelled                 │
-│ Cancelled At: 13:02:15          │
+│ State: cancelled                 │
+│ Cancelled At: 13:02:15          │
 ╰──────────────────────────────────╯
 
 ╭─ Sandbox ────────────────╮
 │ Status: preserved        │
-│ Files Modified: 3       │
-│ Checkpoints: 2          │
+│ Files Modified: 3       │
+│ Checkpoints: 2          │
 ╰──────────────────────────╯
 
 ╭─ Child Plans ─────────────╮
-│ Completed: 1             │
+│ Completed: 1             │
 │ Cancelled: 1             │
-│ Artifacts Preserved: yes │
+│ Artifacts Preserved: yes │
 ╰───────────────────────────╯
 
 ╭─ Recovery ────────────────────────────────────────╮
@@ -2954,7 +2955,7 @@ $ agents plan cancel 01HXM8C2ZK4Q7C2B3F2R4VYV6J --reason "blocked on credentials
 │ - Run agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
 ╰───────────────────────────────────────────────────╯
 
-✓ OK Plan cancelled
+✓ OK Plan cancelled
 
##### agents plan tree @@ -2970,27 +2971,27 @@ Render the decision tree for a plan. **Examples**

-$ agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J
+$ agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 
 ╭─ Decision Tree ──────────────────────────────────────────────────────────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J                                                       │
 │ ├─ [prompt_definition] "Increase test coverage to 85%"                                │
 │ ├─ [invariant_enforced] "Prioritize financial transaction and user mgmt code"       │
 │ ├─ [invariant_enforced] "All API calls over TCP must be mocked"                     │
-│ ├─ [strategy_choice] "Prioritize auth and payments" (confidence: 0.82)           │
-│ ├─ [subplan_parallel_spawn] "Implement auth and payment modules, in parallel"        │
-│ │  ├─ [subplan_spawn] "Write auth tests" → Plan: 01HXM9F1A                          │
-│ │  └─ [subplan_spawn] "Write payment tests" → Plan: 01HXM9F2B                       │
-│ └─ [subplan_parallel_spawn] "Write tests for remaining modules"                      │
+│ ├─ [strategy_choice] "Prioritize auth and payments" (confidence: 0.82)           │
+│ ├─ [subplan_parallel_spawn] "Implement auth and payment modules, in parallel"        │
+│ │  ├─ [subplan_spawn] "Write auth tests" → Plan: 01HXM9F1A                          │
+│ │  └─ [subplan_spawn] "Write payment tests" → Plan: 01HXM9F2B                       │
+│ └─ [subplan_parallel_spawn] "Write tests for remaining modules"                      │
 │    └─ ...                                                                                │
 ╰──────────────────────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Tree Summary ─────────────╮
 │ Nodes: 9                  │
-│ Depth: 3                  │
-│ Child Plans: 2+           │
+│ Depth: 3                  │
+│ Child Plans: 2+           │
 │ Invariants: 2            │
-│ Superseded: 0 (hidden)     │
+│ Superseded: 0 (hidden)     │
 ╰────────────────────────────╯
 
 ╭─ Child Plans ──────────────────────────────────────╮
@@ -3001,17 +3002,17 @@ $ agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 ╰────────────────────────────────────────────────────╯
 
 ╭─ Decision IDs (for correction) ──────────────────╮
-│ Root: 01HXM9A0B1Q2W3R5G8Z0P4Q1X8             │
+│ Root: 01HXM9A0B1Q2W3R5G8Z0P4Q1X8             │
 │ Invariant 1: 01HXM9A0C1R3X4S6G9Z1P5Q2Y9    │
 │ Invariant 2: 01HXM9A0D2S4Y5T7H0Z2P6Q3Z0    │
-│ Strategy: 01HXM9A1C2Q7W3R5G8Z0P4Q1X9         │
-│ Parallel 1: 01HXM9A1D3R8X5S7H1Z2P5Q2Y0     │
-│ Spawn Auth: 01HXM9A2D3Q8W4R6H9Z1P5Q2X0      │
-│ Spawn Payment: 01HXM9A3E4Q9W5R7I0Z2P6Q3X1   │
-│ Parallel 2: 01HXM9A4F5Q0W6R8J1Z3P7Q4X2     │
+│ Strategy: 01HXM9A1C2Q7W3R5G8Z0P4Q1X9         │
+│ Parallel 1: 01HXM9A1D3R8X5S7H1Z2P5Q2Y0     │
+│ Spawn Auth: 01HXM9A2D3Q8W4R6H9Z1P5Q2X0      │
+│ Spawn Payment: 01HXM9A3E4Q9W5R7I0Z2P6Q3X1   │
+│ Parallel 2: 01HXM9A4F5Q0W6R8J1Z3P7Q4X2     │
 ╰──────────────────────────────────────────────────╯
 
-✓ OK Decision tree rendered
+✓ OK Decision tree rendered
 
##### agents plan explain @@ -3028,29 +3029,29 @@ Show a detailed explanation for a decision. **Examples**

-$ agents plan explain 01HXM9A1C2Q7W3R5G8Z0P4Q1X9 --show-context
+$ agents plan explain 01HXM9A1C2Q7W3R5G8Z0P4Q1X9 --show-context
 
 ╭─ Decision ─────────────────────────────────────╮
 │ ID: 01HXM9A1C2Q7W3R5G8Z0P4Q1X9                 │
-│ Type: strategy_choice                          │
+│ Type: strategy_choice                          │
 │ Question: Which modules should be prioritized? │
-│ Chosen: Auth and payments                      │
+│ Chosen: Auth and payments                      │
 │ Confidence: 0.82                               │
-│ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J              │
-│ Sequence: 2 of 5                               │
-│ Created: 2026-02-08 12:58                     │
+│ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J              │
+│ Sequence: 2 of 5                               │
+│ Created: 2026-02-08 12:58                     │
 ╰────────────────────────────────────────────────╯
 
 ╭─ Alternatives Considered ──────────────────────╮
-│ 1. Auth and payments (chosen)                 │
+│ 1. Auth and payments (chosen)                 │
 │ 2. User module first (coverage 71%, med risk) │
 │ 3. All modules equally (spread thin)          │
 ╰────────────────────────────────────────────────╯
 
 ╭─ Impact ──────────────────────╮
-│ Downstream Decisions: 3     │
-│ Downstream Child Plans: 2  │
-│ Artifacts Produced: 5      │
+│ Downstream Decisions: 3     │
+│ Downstream Child Plans: 2  │
+│ Artifacts Produced: 5      │
 │ Correction Impact: medium  │
 ╰───────────────────────────────╯
 
@@ -3059,7 +3060,7 @@ $ agents plan explain 01HXM9A1C2Q7W3R5G8Z0P4Q1X9 --show-context
 │ - Payments failures last release │
 │ - Auth: 12 files, 45% coverage   │
 │ - Payments: 8 files, 52% cover.  │
-│ Hot Context Hash: sha256:4b2e... │
+│ Hot Context Hash: sha256:4b2e... │
 ╰──────────────────────────────────╯
 
 ╭─ Rationale ───────────────────────────────────────╮
@@ -3074,7 +3075,7 @@ $ agents plan explain 01HXM9A1C2Q7W3R5G8Z0P4Q1X9 --show-context
 │   --mode revert --guidance "Prioritize payments first..." │
 ╰───────────────────────────────────────────────────────────╯
 
-✓ OK Decision explained
+✓ OK Decision explained
 
##### agents plan correct @@ -3093,33 +3094,33 @@ Correct a decision either by reverting and re-executing or by appending a fix. **Examples**

-$ agents plan correct 01HXM9A1C2Q7W3R5G8Z0P4Q1X9 --mode revert \
-  --guidance "Prioritize payments first" --yes
+$ agents plan correct 01HXM9A1C2Q7W3R5G8Z0P4Q1X9 --mode revert \
+  --guidance "Prioritize payments first" --yes
 
 ╭─ Correction ─────────────────────────────────────╮
-│ Mode: revert                                     │
+│ Mode: revert                                     │
 │ Impact: 3 decisions, 2 child plans, 5 artifacts     │
-│ New Decision: 01HXM9B7Z3Q1Q8K2E9H7K3W2M8         │
+│ New Decision: 01HXM9B7Z3Q1Q8K2E9H7K3W2M8         │
 │ Corrects: 01HXM9A1C2Q7W3R5G8Z0P4Q1X9            │
-│ Attempt: 2                                       │
+│ Attempt: 2                                       │
 ╰──────────────────────────────────────────────────╯
 
 ╭─ Affected Subtree ──────────────╮
 │ Decisions Invalidated: 3      │
 │ Child Plans Rolled Back: 2   │
 │ Artifacts Archived: 5        │
-│ Unaffected Decisions: 2      │
+│ Unaffected Decisions: 2      │
 ╰─────────────────────────────────╯
 
 ╭─ Sandbox Rollback ─────────────╮
-│ Checkpoint: cp_01HXM8C2       │
-│ Files Reverted: 5             │
-│ Status: restored              │
+│ Checkpoint: cp_01HXM8C2       │
+│ Files Reverted: 5             │
+│ Status: restored              │
 ╰────────────────────────────────╯
 
 ╭─ Recompute ──────────────╮
 │ Queued: 2 child plans   │
-│ ETA: 4m                  │
+│ ETA: 4m                  │
 ╰──────────────────────────╯
 
 ╭─ History ──────────────────────────────────────────╮
@@ -3128,7 +3129,7 @@ $ agents plan correct 01HXM9A1C2Q7W3R5G8Z0P4Q1X9 --mode revert \
 │ - agents plan diff --correction 01HXM9B7Z3Q1Q8K2.. │
 ╰─────────────────────────────────────────────────────╯
 
-✓ OK Correction applied
+✓ OK Correction applied
 
##### agents plan diff @@ -3144,46 +3145,46 @@ Show diffs for a plan or a correction attempt. **Examples**

-$ agents plan diff 01HXM8C2ZK4Q7C2B3F2R4VYV6J
+$ agents plan diff 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 
 ╭─ Diff Summary ─────────────────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J            │
 │ Project: local/api-service                  │
 │ Files Changed: 2                             │
-│ Insertions: 12                               │
-│ Deletions: 4                                 │
-│ Net Change: +8 lines                         │
+│ Insertions: 12                               │
+│ Deletions: 4                                 │
+│ Net Change: +8 lines                         │
 ╰────────────────────────────────────────────────╯
 
 ╭─ Files ───────────────────────────────╮
 │ Path                 Change  Status   │
 │ ───────────────────  ──────  ──────── │
-│ src/auth/session.py  +8 -2   modified │
-│ src/auth/tokens.py   +4 -2   modified │
+│ src/auth/session.py  +8 -2   modified │
+│ src/auth/tokens.py   +4 -2   modified │
 ╰───────────────────────────────────────╯
 
 ╭─ Patch Preview ─────────────────────────╮
 │ --- a/src/auth/session.py              │
 │ +++ b/src/auth/session.py              │
 │ @@ -12,4 +12,10 @@                      │
-│ - import jwt                            │
-│ + import sessionlib                     │
-│ - def validate_token(...)               │
-│ + def validate_session(...)             │
+│ - import jwt                            │
+│ + import sessionlib                     │
+│ - def validate_token(...)               │
+│ + def validate_session(...)             │
 │ --- a/src/auth/tokens.py               │
 │ +++ b/src/auth/tokens.py               │
 │ @@ -5,3 +5,7 @@                         │
-│ - TOKEN_EXPIRY = 3600                    │
-│ + TOKEN_EXPIRY = 7200                    │
+│ - TOKEN_EXPIRY = 3600                    │
+│ + TOKEN_EXPIRY = 7200                    │
 ╰─────────────────────────────────────────╯
 
 ╭─ Risk Assessment ────────────────╮
-│ API Compatibility: preserved    │
-│ Test Coverage: maintained       │
+│ API Compatibility: preserved    │
+│ Test Coverage: maintained       │
 │ Breaking Changes: none detected │
 ╰──────────────────────────────────╯
 
-✓ OK Diff generated
+✓ OK Diff generated
 
##### agents plan artifacts @@ -3198,32 +3199,32 @@ List artifacts produced by a plan. **Examples**

-$ agents plan artifacts 01HXM8C2ZK4Q7C2B3F2R4VYV6J
+$ agents plan artifacts 01HXM8C2ZK4Q7C2B3F2R4VYV6J
 
 ╭─ Artifacts ──────────────────────────────────────────────╮
 │ Path                   Type   Size    Change     Child Plan │
 │ ─────────────────────  ─────  ──────  ─────────  ─────── │
-│ src/auth/session.py    write  2.1 KB  +8 -2      root    │
-│ tests/test_session.py  write  4.7 KB  +47 -0     root    │
-│ src/auth/tokens.py     edit   1.8 KB  +4 -2      root    │
-│ tests/test_tokens.py   write  3.2 KB  +32 -0     auth    │
+│ src/auth/session.py    write  2.1 KB  +8 -2      root    │
+│ tests/test_session.py  write  4.7 KB  +47 -0     root    │
+│ src/auth/tokens.py     edit   1.8 KB  +4 -2      root    │
+│ tests/test_tokens.py   write  3.2 KB  +32 -0     auth    │
 ╰──────────────────────────────────────────────────────────╯
 
 ╭─ Summary ──────────╮
 │ Total: 4           │
-│ Writes: 2 (new)    │
-│ Edits: 2 (modified) │
-│ Deletes: 0         │
-│ Total Size: 11.8 KB │
+│ Writes: 2 (new)    │
+│ Edits: 2 (modified) │
+│ Deletes: 0         │
+│ Total Size: 11.8 KB │
 ╰────────────────────╯
 
 ╭─ By Plan ─────────────────╮
-│ Root Plan: 3 artifacts    │
-│ auth-tests: 1 artifact   │
-│ payment-tests: (pending) │
+│ Root Plan: 3 artifacts    │
+│ auth-tests: 1 artifact   │
+│ payment-tests: (pending) │
 ╰───────────────────────────╯
 
-✓ OK 4 artifacts listed
+✓ OK 4 artifacts listed
 
##### agents plan prompt @@ -3239,28 +3240,28 @@ Provide additional guidance to a plan, typically when it is errored or awaiting **Examples**

-$ agents plan prompt 01HXM8C2ZK4Q7C2B3F2R4VYV6J "Use mocks for database tests"
+$ agents plan prompt 01HXM8C2ZK4Q7C2B3F2R4VYV6J "Use mocks for database tests"
 
 ╭─ Guidance Added ───────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J       │
 │ Guidance: Use mocks for database tests │
-│ Scope: next execution step             │
-│ Phase: execute                          │
-│ State: errored → processing            │
+│ Scope: next execution step             │
+│ Phase: execute                          │
+│ State: errored → processing            │
 ╰────────────────────────────────────────╯
 
 ╭─ Decision Created ────────────────────────╮
-│ Type: user_intervention                 │
-│ ID: 01HXM9C5G7R2X8S3K4Z5Q8R6Y3        │
-│ Parent: 01HXM9A1C2Q7W3R5G8Z0P4Q1X9     │
+│ Type: user_intervention                 │
+│ ID: 01HXM9C5G7R2X8S3K4Z5Q8R6Y3        │
+│ Parent: 01HXM9A1C2Q7W3R5G8Z0P4Q1X9     │
 ╰───────────────────────────────────────────╯
 
 ╭─ Queue ────╮
 │ Pending: 1 │
-│ Applied: 0 │
+│ Applied: 0 │
 ╰────────────╯
 
-✓ OK Guidance queued
+✓ OK Guidance queued
 
##### agents plan rollback @@ -3277,7 +3278,7 @@ Rollback a plan sandbox to a checkpoint. **Examples**

-$ agents plan rollback 01HXM8C2ZK4Q7C2B3F2R4VYV6J cp_01HXM8C2
+$ agents plan rollback 01HXM8C2ZK4Q7C2B3F2R4VYV6J cp_01HXM8C2
 
 Rollback plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J to cp_01HXM8C2? [y/N]: y
 
@@ -3301,18 +3302,18 @@ Rollback plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J to cp_01HXM8C2? [y/N]: y
 
 ╭─ Impact ──────────────────────────────╮
 │ Child Plans Invalidated: 2          │
-│ Sandbox: restored to cp_01HXM8C2   │
-│ Decisions After CP: 2 discarded     │
-│ Tool Calls After CP: 5 undone      │
+│ Sandbox: restored to cp_01HXM8C2   │
+│ Decisions After CP: 2 discarded     │
+│ Tool Calls After CP: 5 undone      │
 ╰───────────────────────────────────────╯
 
 ╭─ Post-Rollback State ─────────╮
 │ Phase: execute                │
-│ State: queued (awaiting input) │
-│ Checkpoints Remaining: 2     │
+│ State: queued (awaiting input) │
+│ Checkpoints Remaining: 2     │
 ╰───────────────────────────────╯
 
-✓ OK Rollback complete
+✓ OK Rollback complete
 
#### agents action @@ -3348,18 +3349,18 @@ The `--config` file must define `strategy-actor`, `execution-actor`, and `defini **Examples**

-$ agents action create --config ./actions/code-coverage.yaml \
-  --available local/code-coverage
+$ agents action create --config ./actions/code-coverage.yaml \
+  --available local/code-coverage
 
 ╭─ Action Created ──────────────────────╮
 │ Name: local/code-coverage             │
-│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
+│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
 │ State: available                      │
 │ Strategy Actor: local/strategist      │
 │ Execution Actor: local/executor       │
-│ Reusable: yes                         │
-│ Read Only: no                         │
-│ Created: 2026-02-08 12:20             │
+│ Reusable: yes                         │
+│ Read Only: no                         │
+│ Created: 2026-02-08 12:20             │
 ╰───────────────────────────────────────╯
 
 ╭─ Definition of Done ─╮
@@ -3375,7 +3376,7 @@ $ agents action create --config ./actions/code-coverage.yaml \
 
 ╭─ Automation ─────────────────────────╮
 │ Profile: supervised                  │
-│ Source: default                       │
+│ Source: default                       │
 ╰──────────────────────────────────────╯
 
 ╭─ Usage ─────────────────────────────────────────────────────────────────╮
@@ -3383,24 +3384,24 @@ $ agents action create --config ./actions/code-coverage.yaml \
 │   --arg target_coverage_percent=85                                      │
 ╰─────────────────────────────────────────────────────────────────────────╯
 
-✓ OK Action created
+✓ OK Action created
 
Creating an action entirely from a YAML configuration file:

-$ agents action create local/code-coverage --config ./actions/code-coverage.yaml
+$ agents action create local/code-coverage --config ./actions/code-coverage.yaml
 
 ╭─ Action Created ──────────────────────╮
 │ Name: local/code-coverage             │
-│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
+│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
 │ State: draft                          │
 │ Strategy Actor: local/strategist      │
 │ Execution Actor: local/executor       │
-│ Reusable: yes                         │
-│ Read Only: no                         │
-│ Config: ./actions/code-coverage.yaml    │
-│ Created: 2026-02-08 12:20             │
+│ Reusable: yes                         │
+│ Read Only: no                         │
+│ Config: ./actions/code-coverage.yaml    │
+│ Created: 2026-02-08 12:20             │
 ╰───────────────────────────────────────╯
 
 ╭─ Definition of Done ─╮
@@ -3416,30 +3417,30 @@ $ agents action create local/code-coverage --config ./actions/code-coverage.yaml
 
 ╭─ Automation ─────────────────────────╮
 │ Profile: supervised                  │
-│ Source: default                       │
+│ Source: default                       │
 ╰──────────────────────────────────────╯
 
-✓ OK Action created
+✓ OK Action created
 
Creating an action from a config file with CLI overrides (the `--execution-actor` overrides the value from the YAML, and `--available` is added):

-$ agents action create local/code-coverage \
-  --config ./actions/code-coverage.yaml \
-  --execution-actor local/fast-executor \
-  --available
+$ agents action create local/code-coverage \
+  --config ./actions/code-coverage.yaml \
+  --execution-actor local/fast-executor \
+  --available
 
 ╭─ Action Created ──────────────────────╮
 │ Name: local/code-coverage             │
-│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
+│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
 │ State: available                      │
 │ Strategy Actor: local/strategist      │
 │ Execution Actor: local/fast-executor  │
-│ Reusable: yes                         │
-│ Read Only: no                         │
-│ Config: ./actions/code-coverage.yaml    │
-│ Created: 2026-02-08 12:20             │
+│ Reusable: yes                         │
+│ Read Only: no                         │
+│ Config: ./actions/code-coverage.yaml    │
+│ Created: 2026-02-08 12:20             │
 ╰───────────────────────────────────────╯
 
 ╭─ Overrides Applied ──────────────────────────────────────╮
@@ -3451,7 +3452,7 @@ $ agents action create local/code-coverage \
 │ Coverage reaches 85% │
 ╰──────────────────────╯
 
-✓ OK Action created
+✓ OK Action created
 
##### agents action list @@ -3468,7 +3469,7 @@ List actions with optional filters. **Examples**

-$ agents action list --available
+$ agents action list --available
 
 ╭─ Actions ──────────────────────────────────────────────────────────────────────────────────╮
 │ Name                 State      Strategy Actor    Execution Actor  Reusable  Plans │
@@ -3478,18 +3479,18 @@ $ agents action list --available
 
 ╭─ Filters ────────╮
 │ State: available │
-│ Namespace: (any) │
+│ Namespace: (any) │
 ╰──────────────────╯
 
 ╭─ Summary ────────────╮
 │ Total: 1             │
-│ Available: 1         │
-│ Draft: 0              │
+│ Available: 1         │
+│ Draft: 0              │
 │ Archived: 0          │
-│ Total Plans Created: 3 │
+│ Total Plans Created: 3 │
 ╰──────────────────────╯
 
-✓ OK 1 action listed
+✓ OK 1 action listed
 
##### agents action show @@ -3504,17 +3505,17 @@ Show details for an action. **Examples**

-$ agents action show local/code-coverage
+$ agents action show local/code-coverage
 
 ╭─ Action Details ──────────────────────╮
 │ Name: local/code-coverage             │
-│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
+│ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M        │
 │ State: available                      │
 │ Strategy Actor: local/strategist      │
 │ Execution Actor: local/executor       │
-│ Reusable: yes                         │
-│ Read Only: no                         │
-│ Created: 2026-02-08 12:20             │
+│ Reusable: yes                         │
+│ Read Only: no                         │
+│ Created: 2026-02-08 12:20             │
 ╰───────────────────────────────────────╯
 
 ╭─ Definition of Done ─╮
@@ -3530,15 +3531,15 @@ $ agents action show local/code-coverage
 
 ╭─ Automation ─────────────────────────╮
 │ Profile: supervised                  │
-│ Source: default                       │
+│ Source: default                       │
 ╰──────────────────────────────────────╯
 
 ╭─ History ────────────────────╮
-│ Plans Created: 3           │
-│ Plans Completed: 2        │
-│ Plans Failed: 0            │
+│ Plans Created: 3           │
+│ Plans Completed: 2        │
+│ Plans Failed: 0            │
 │ Avg Duration: 00:04:30    │
-│ Avg Cost: $0.072           │
+│ Avg Cost: $0.072           │
 ╰──────────────────────────────╯
 
 ╭─ Usage ───────────────────────────────────────────────────────────╮
@@ -3546,7 +3547,7 @@ $ agents action show local/code-coverage
 │     --arg target_coverage_percent=85                              │
 ╰───────────────────────────────────────────────────────────────────╯
 
-✓ OK Action loaded
+✓ OK Action loaded
 
##### agents action available @@ -3561,28 +3562,28 @@ Mark a draft action as available. **Examples**

-$ agents action available 01HXMAY3D1JQ0C3G1H0Q7B2W7M
+$ agents action available 01HXMAY3D1JQ0C3G1H0Q7B2W7M
 
 ╭─ Action Available ─────────────╮
 │ ID: 01HXMAY3D1JQ0C3G1H0Q7B2W7M │
 │ State: draft → available       │
-│ Name: local/code-coverage      │
+│ Name: local/code-coverage      │
 ╰────────────────────────────────╯
 
 ╭─ Visibility ─────╮
-│ Namespace: local │
-│ Listed: yes      │
-│ Usable: yes      │
+│ Namespace: local │
+│ Listed: yes      │
+│ Usable: yes      │
 ╰──────────────────╯
 
 ╭─ Validation ────────────────────────╮
-│ Strategy Actor: resolved           │
-│ Execution Actor: resolved          │
-│ Definition of Done: present        │
-│ Arguments: valid schema            │
+│ Strategy Actor: resolved           │
+│ Execution Actor: resolved          │
+│ Definition of Done: present        │
+│ Arguments: valid schema            │
 ╰─────────────────────────────────────╯
 
-✓ OK Action marked available
+✓ OK Action marked available
 
##### agents action archive @@ -3597,28 +3598,28 @@ Archive an action. **Examples**

-$ agents action archive local/old-action
+$ agents action archive local/old-action
 
 ╭─ Action Archived ──────────╮
 │ Name: local/old-action     │
 │ State: available → archived │
-│ Archived: 2026-02-08 12:22 │
+│ Archived: 2026-02-08 12:22 │
 ╰────────────────────────────╯
 
 ╭─ Impact ───────────────────────╮
 │ Availability: hidden from list │
-│ Existing Plans: unchanged      │
-│ Active Plans: 0 affected       │
+│ Existing Plans: unchanged      │
+│ Active Plans: 0 affected       │
 ╰────────────────────────────────╯
 
 ╭─ History ─────────────────╮
-│ Total Plans: 5          │
-│ Completed: 4            │
-│ Failed: 1               │
-│ Last Used: 2026-02-06  │
+│ Total Plans: 5          │
+│ Completed: 4            │
+│ Failed: 1               │
+│ Last Used: 2026-02-06  │
 ╰───────────────────────────╯
 
-✓ OK Action archived
+✓ OK Action archived
 
#### agents automation-profile @@ -3640,32 +3641,32 @@ Register a new custom automation profile from a YAML configuration file. If a pr **Examples**

-$ agents automation-profile add --config ./profiles/careful-auto.yaml
+$ agents automation-profile add --config ./profiles/careful-auto.yaml
 
 ╭─ Profile Registered ─────────────────────────────────────────────╮
 │ Name: local/careful-auto                                       │
-│ Description: Autonomous execution with mandatory sandbox       │
+│ Description: Autonomous execution with mandatory sandbox       │
 │              and manual apply                                    │
-│ Created: 2026-02-08 14:30                                      │
+│ Created: 2026-02-08 14:30                                      │
 ╰──────────────────────────────────────────────────────────────────╯
 
 ╭─ Flags ────────────────────────────────╮
-│ auto_strategize: true               │
-│ auto_execute: true                  │
-│ auto_apply: false                    │
-│ auto_decisions_strategize: true     │
-│ auto_decisions_execute: true        │
-│ auto_validation_fix: true           │
-│ auto_strategy_revision: false        │
-│ auto_child_plans: true              │
-│ auto_retry_transient: true          │
-│ auto_checkpoint_restore: true       │
-│ require_sandbox: true               │
-│ require_checkpoints: true           │
-│ allow_unsafe_tools: false            │
+│ auto_strategize: true               │
+│ auto_execute: true                  │
+│ auto_apply: false                    │
+│ auto_decisions_strategize: true     │
+│ auto_decisions_execute: true        │
+│ auto_validation_fix: true           │
+│ auto_strategy_revision: false        │
+│ auto_child_plans: true              │
+│ auto_retry_transient: true          │
+│ auto_checkpoint_restore: true       │
+│ require_sandbox: true               │
+│ require_checkpoints: true           │
+│ allow_unsafe_tools: false            │
 ╰────────────────────────────────────────╯
 
-✓ OK Profile registered
+✓ OK Profile registered
 
##### agents automation-profile remove @@ -3681,7 +3682,7 @@ Remove a custom automation profile. Built-in profiles cannot be removed. **Examples**

-$ agents automation-profile remove local/careful-auto
+$ agents automation-profile remove local/careful-auto
 
 Remove automation profile local/careful-auto? [y/N]: y
 
@@ -3689,7 +3690,7 @@ Remove automation profile local/careful-auto? [y/N]: y
 │ Name: local/careful-auto │
 ╰────────────────────────────╯
 
-✓ OK Profile removed
+✓ OK Profile removed
 
##### agents automation-profile list @@ -3704,7 +3705,7 @@ List all available automation profiles (built-in and custom). **Examples**

-$ agents automation-profile list
+$ agents automation-profile list
 
 ╭─ Automation Profiles ─────────────────────────────────────────────────────────╮
 │ Name                Source    Auto-Apply  Sandbox  Description              │
@@ -3719,12 +3720,12 @@ $ agents automation-profile list
 ╰───────────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Summary ───────────╮
-│ Built-in: 6        │
-│ Custom: 1          │
-│ Total: 7           │
+│ Built-in: 6        │
+│ Custom: 1          │
+│ Total: 7           │
 ╰─────────────────────╯
 
-✓ OK 7 profiles listed
+✓ OK 7 profiles listed
 
##### agents automation-profile show @@ -3739,40 +3740,40 @@ Show full details for an automation profile, including all flag values. **Examples**

-$ agents automation-profile show trusted
+$ agents automation-profile show trusted
 
 ╭─ Automation Profile ───────────────────────────────────────────╮
 │ Name: trusted                                                 │
-│ Source: built-in                                              │
-│ Description: Auto-exec, manual apply. Day-to-day development │
+│ Source: built-in                                              │
+│ Description: Auto-exec, manual apply. Day-to-day development │
 ╰────────────────────────────────────────────────────────────────╯
 
 ╭─ Phase Transitions ──────────────────╮
-│ auto_strategize: true              │
-│ auto_execute: true                 │
-│ auto_apply: false                   │
+│ auto_strategize: true              │
+│ auto_execute: true                 │
+│ auto_apply: false                   │
 ╰──────────────────────────────────────╯
 
 ╭─ Decision Automation ────────────────╮
-│ auto_decisions_strategize: true    │
-│ auto_decisions_execute: true       │
+│ auto_decisions_strategize: true    │
+│ auto_decisions_execute: true       │
 ╰──────────────────────────────────────╯
 
 ╭─ Self-Repair ────────────────────────╮
-│ auto_validation_fix: true          │
-│ auto_strategy_revision: false       │
-│ auto_retry_transient: true         │
-│ auto_checkpoint_restore: false      │
+│ auto_validation_fix: true          │
+│ auto_strategy_revision: false       │
+│ auto_retry_transient: true         │
+│ auto_checkpoint_restore: false      │
 ╰──────────────────────────────────────╯
 
 ╭─ Execution Controls ────────────────╮
-│ auto_child_plans: true             │
-│ require_sandbox: true              │
-│ require_checkpoints: true          │
-│ allow_unsafe_tools: false           │
+│ auto_child_plans: true             │
+│ require_sandbox: true              │
+│ require_checkpoints: true          │
+│ allow_unsafe_tools: false           │
 ╰──────────────────────────────────────╯
 
-✓ OK Profile loaded
+✓ OK Profile loaded
 
#### agents config @@ -3797,28 +3798,28 @@ The `format` key sets the default output rendering format used by all commands. **Examples**

-$ agents config set automation-profile trusted
+$ agents config set automation-profile trusted
 
 ╭─ Config Updated ──────────────╮
 │ Key: automation-profile        │
-│ Value: trusted                │
+│ Value: trusted                │
 │ Previous: manual              │
-│ Source: config                │
+│ Source: config                │
 │ Scope: global                 │
 ╰──────────────────────────────╯
 
 ╭─ Effective ────────────────────────╮
-│ Sessions: new sessions           │
+│ Sessions: new sessions           │
 │ Plans: future plans (unless set) │
-│ Existing: unchanged              │
+│ Existing: unchanged              │
 ╰────────────────────────────────────╯
 
 ╭─ Saved To ──────────────────────────╮
-│ File: ~/.cleveragents/config.toml │
-│ Line: 8                           │
+│ File: ~/.cleveragents/config.toml │
+│ Line: 8                           │
 ╰─────────────────────────────────────╯
 
-✓ OK Config updated
+✓ OK Config updated
 
##### agents config get @@ -3833,20 +3834,20 @@ Get a configuration value. **Examples**

-$ agents config get automation-profile
+$ agents config get automation-profile
 
 ╭─ Config ──────────────────╮
 │ Key: automation-profile    │
-│ Value: trusted            │
-│ Source: config            │
+│ Value: trusted            │
+│ Source: config            │
 │ Overridden: no            │
-│ Type: string              │
+│ Type: string              │
 ╰───────────────────────────╯
 
 ╭─ Origin ──────────────────────────╮
-│ File: ~/.cleveragents/config.toml │
-│ Line: 8                           │
-│ Default: full                     │
+│ File: ~/.cleveragents/config.toml │
+│ Line: 8                           │
+│ Default: full                     │
 ╰───────────────────────────────────╯
 
 ╭─ Resolution Chain ──────────────╮
@@ -3854,10 +3855,10 @@ $ agents config get automation-profile
 │ 2. Env var: (not set)           │
 │ 3. Config file: review          │
 │ 4. Default: full                │
-│ Winner: config file (level 3)   │
+│ Winner: config file (level 3)   │
 ╰─────────────────────────────────╯
 
-✓ OK Config read
+✓ OK Config read
 
##### agents config list @@ -3872,7 +3873,7 @@ None. **Examples**

-$ agents config list
+$ agents config list
 
 ╭─ Config ───────────────────────────────────────────────╮
 │ Key               Value               Source   Modified  │
@@ -3884,16 +3885,16 @@ $ agents config list
 
 ╭─ Overrides ─────╮
 │ Env: none       │
-│ CLI Flags: none │
+│ CLI Flags: none │
 ╰─────────────────╯
 
 ╭─ Config File ───────────────────────╮
-│ Path: ~/.cleveragents/config.toml │
-│ Size: 284 bytes                   │
-│ Valid: yes                        │
+│ Path: ~/.cleveragents/config.toml │
+│ Size: 284 bytes                   │
+│ Valid: yes                        │
 ╰─────────────────────────────────────╯
 
-✓ OK 6 settings listed
+✓ OK 6 settings listed
 
#### agents invariant @@ -3919,48 +3920,48 @@ At least one scope flag (`--global`, `--project`, `--plan`, or `--action`) must **Examples**

-$ agents invariant add --global "All public APIs must maintain backward compatibility"
+$ agents invariant add --global "All public APIs must maintain backward compatibility"
 
 ╭─ Invariant Added ──────────────────────────────────────────────────────╮
-│ Invariant: All public APIs must maintain backward compatibility      │
-│ Scope: global                                                       │
-│ ID: inv_01HXM9A1B                                                  │
+│ Invariant: All public APIs must maintain backward compatibility      │
+│ Scope: global                                                       │
+│ ID: inv_01HXM9A1B                                                  │
 ╰────────────────────────────────────────────────────────────────────────╯
 
-✓ OK Invariant added
+✓ OK Invariant added
 
-$ agents invariant add --project local/api-service "All endpoints must validate auth tokens"
+$ agents invariant add --project local/api-service "All endpoints must validate auth tokens"
 
 ╭─ Invariant Added ──────────────────────────────────────────────╮
 │ Project: local/api-service                                   │
-│ Invariant: All endpoints must validate auth tokens           │
-│ Scope: project                                              │
-│ ID: inv_01HXM9A2C                                           │
+│ Invariant: All endpoints must validate auth tokens           │
+│ Scope: project                                              │
+│ ID: inv_01HXM9A2C                                           │
 ╰────────────────────────────────────────────────────────────────╯
 
-✓ OK Invariant added
+✓ OK Invariant added
 
-$ agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J "All database queries must use parameterized statements"
+$ agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J "All database queries must use parameterized statements"
 
 ╭─ Invariant Added ─────────────────────────────────────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J                                    │
-│ Invariant: All database queries must use parameterized statements    │
-│ Scope: plan                                                        │
-│ ID: inv_01HXM9G3A                                                  │
+│ Invariant: All database queries must use parameterized statements    │
+│ Scope: plan                                                        │
+│ ID: inv_01HXM9G3A                                                  │
 ╰───────────────────────────────────────────────────────────────────────╯
 
-✓ OK Invariant added
+✓ OK Invariant added
 
-$ agents invariant add --action local/code-coverage "Test files must not import production secrets"
+$ agents invariant add --action local/code-coverage "Test files must not import production secrets"
 
 ╭─ Invariant Added ──────────────────────────────────────────────────────╮
 │ Action: local/code-coverage                                        │
-│ Invariant: Test files must not import production secrets             │
-│ Scope: action                                                      │
-│ ID: inv_01HXM9H4B                                                  │
+│ Invariant: Test files must not import production secrets             │
+│ Scope: action                                                      │
+│ ID: inv_01HXM9H4B                                                  │
 ╰────────────────────────────────────────────────────────────────────────╯
 
-✓ OK Invariant added
+✓ OK Invariant added
 
##### agents invariant list @@ -3979,7 +3980,7 @@ List invariants at a given scope. Use `--effective` with `--plan` to show the fi **Examples**

-$ agents invariant list --global
+$ agents invariant list --global
 
 ╭─ Global Invariants ──────────────────────────────────────────────────────╮
 │ ID              Text                                                  │
@@ -3988,9 +3989,9 @@ $ agents invariant list --global
 │ inv_01HXM9A1C  Payment processing must be idempotent                    │
 ╰──────────────────────────────────────────────────────────────────────────╯
 
-✓ OK 2 invariants
+✓ OK 2 invariants
 
-$ agents invariant list --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J --effective
+$ agents invariant list --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J --effective
 
 ╭─ Effective Invariants (Plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J) ─────────────────────────────────╮
 │ ID              Source   Text                                                   │
@@ -4004,7 +4005,7 @@ $ agents invariant list --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J --effective
 │   Global "Use shared DB pool" overridden by plan "All database queries must use    │
 │   parameterized statements"                                                         │
 
-✓ OK 3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved)
+✓ OK 3 effective invariants (1 global, 1 project, 1 plan; 1 conflict resolved)
 
##### agents invariant remove @@ -4020,17 +4021,17 @@ Remove an invariant by ID. The invariant is removed from whichever scope it was **Examples**

-$ agents invariant remove inv_01HXM9A1C
+$ agents invariant remove inv_01HXM9A1C
 
 Remove invariant inv_01HXM9A1C ("Payment processing must be idempotent", scope: global)? [y/N]: y
 
 ╭─ Invariant Removed ──────────────────────────────────────────────╮
 │ Removed: Payment processing must be idempotent                 │
-│ Scope: global                                                  │
-│ ID: inv_01HXM9A1C                                             │
+│ Scope: global                                                  │
+│ ID: inv_01HXM9A1C                                             │
 ╰──────────────────────────────────────────────────────────────────╯
 
-✓ OK Invariant removed
+✓ OK Invariant removed
 
## Output Rendering Framework @@ -4049,10 +4050,10 @@ This architecture is designed for modularity, extensibility, and future-proofing All CLI output flows through a five-stage reactive pipeline: -```text +

 Command Logic ──► OutputSession ──► ElementHandles ──► MaterializationStrategy ──► Terminal/Pipe
                   (lifecycle)       (typed producers)   (format-driven policy)      (stdout/stderr)
-```
+
1. **Command Logic** opens an `OutputSession` and creates typed **element handles** — `PanelHandle`, `TableHandle`, `ProgressHandle`, etc. — for each piece of output the command will produce. Handles are created in **declaration order**, which determines the canonical order in which elements appear in sequential formats. @@ -4068,642 +4069,642 @@ Command Logic ──► OutputSession ──► ElementHandles ──► Materia The `OutputSession` is the core abstraction that replaces direct construction of static output objects. Commands receive a session (typically injected by the CLI framework) and interact with it throughout their execution: -```python -class OutputSession: - """A live output document that coordinates element production and materialization. +

+class OutputSession:
+    """A live output document that coordinates element production and materialization.
+    
+    The session manages the lifecycle of all output elements for a single command
+    invocation. It is the bridge between format-agnostic producer code and the
+    format-specific materialization strategy.
+    
+    Thread Safety:
+        The session is thread-safe. Multiple producers may create and write to
+        handles concurrently. The session serializes event delivery to the
+        materialization strategy using an internal event queue.
+    
+    Lifecycle:
+        session = OutputSession.open(command, strategy)
+        handle_a = session.panel("Title")       # create handles
+        handle_b = session.table("Results", ...) 
+        handle_a.set_entry(...)                  # write to handles (concurrent OK)
+        handle_b.add_row(...)
+        handle_a.close()                         # close handles when done
+        handle_b.close()
+        session.close()                          # finalize the session
+    """
     
-    The session manages the lifecycle of all output elements for a single command
-    invocation. It is the bridge between format-agnostic producer code and the
-    format-specific materialization strategy.
+    # --- Session lifecycle ---
     
-    Thread Safety:
-        The session is thread-safe. Multiple producers may create and write to
-        handles concurrently. The session serializes event delivery to the
-        materialization strategy using an internal event queue.
+    command: str                                  # The command that owns this session
+    session_id: str                               # Unique session identifier (ULID)
+    created_at: datetime                          # Session creation timestamp
     
-    Lifecycle:
-        session = OutputSession.open(command, strategy)
-        handle_a = session.panel("Title")       # create handles
-        handle_b = session.table("Results", ...) 
-        handle_a.set_entry(...)                  # write to handles (concurrent OK)
-        handle_b.add_row(...)
-        handle_a.close()                         # close handles when done
-        handle_b.close()
-        session.close()                          # finalize the session
-    """
+    _strategy: MaterializationStrategy            # The active materialization strategy
+    _handles: OrderedDict[str, ElementHandle]     # handle_id → handle, in declaration order
+    _event_queue: asyncio.Queue[ElementEvent]     # Internal event queue for serialization
+    _state: SessionState                          # "open" | "closing" | "closed"
+    _lock: threading.Lock                         # Protects handle creation/removal
     
-    # --- Session lifecycle ---
-    
-    command: str                                  # The command that owns this session
-    session_id: str                               # Unique session identifier (ULID)
-    created_at: datetime                          # Session creation timestamp
-    
-    _strategy: MaterializationStrategy            # The active materialization strategy
-    _handles: OrderedDict[str, ElementHandle]     # handle_id → handle, in declaration order
-    _event_queue: asyncio.Queue[ElementEvent]     # Internal event queue for serialization
-    _state: SessionState                          # "open" | "closing" | "closed"
-    _lock: threading.Lock                         # Protects handle creation/removal
-    
-    @classmethod
-    def open(cls, command: str, strategy: MaterializationStrategy,
-             metadata: dict | None = None) -> "OutputSession":
-        """Open a new output session.
-        
-        Called by the CLI framework before command execution. The strategy is
-        selected based on the resolved format (see Format Resolution).
-        
-        Args:
-            command: The command string (e.g., "project show").
-            strategy: The materialization strategy for the active format.
-            metadata: Optional command metadata (user, timestamp, etc.).
-        
-        Returns:
-            A new OutputSession ready for element creation.
-        """
+    @classmethod
+    def open(cls, command: str, strategy: MaterializationStrategy,
+             metadata: dict | None = None) -> "OutputSession":
+        """Open a new output session.
+        
+        Called by the CLI framework before command execution. The strategy is
+        selected based on the resolved format (see Format Resolution).
+        
+        Args:
+            command: The command string (e.g., "project show").
+            strategy: The materialization strategy for the active format.
+            metadata: Optional command metadata (user, timestamp, etc.).
+        
+        Returns:
+            A new OutputSession ready for element creation.
+        """
         ...
     
-    # --- Element handle factories ---
-    # Each factory creates a typed handle, registers it with the session in
-    # declaration order, and emits an ElementCreated event to the strategy.
+    # --- Element handle factories ---
+    # Each factory creates a typed handle, registers it with the session in
+    # declaration order, and emits an ElementCreated event to the strategy.
     
-    def panel(self, title: str, *,
-              border_style: str = "rounded",
-              priority: str = "normal",
-              collapse_hint: str = "auto",
-              metadata: dict | None = None) -> "PanelHandle":
-        """Create a panel element handle for key-value pair output."""
+    def panel(self, title: str, *,
+              border_style: str = "rounded",
+              priority: str = "normal",
+              collapse_hint: str = "auto",
+              metadata: dict | None = None) -> "PanelHandle":
+        """Create a panel element handle for key-value pair output."""
         ...
     
-    def table(self, title: str | None, *,
-              columns: list["ColumnDef"],
-              summary: dict | None = None,
-              max_rows_hint: int | None = None,
-              sort_key: str | None = None,
-              priority: str = "normal",
-              collapse_hint: str = "auto",
-              metadata: dict | None = None) -> "TableHandle":
-        """Create a table element handle for tabular data."""
+    def table(self, title: str | None, *,
+              columns: list["ColumnDef"],
+              summary: dict | None = None,
+              max_rows_hint: int | None = None,
+              sort_key: str | None = None,
+              priority: str = "normal",
+              collapse_hint: str = "auto",
+              metadata: dict | None = None) -> "TableHandle":
+        """Create a table element handle for tabular data."""
         ...
     
-    def tree(self, root_label: str, *,
-             root_style: str | None = None,
-             max_depth_hint: int | None = None,
-             show_guides: bool = True,
-             priority: str = "normal",
-             collapse_hint: str = "auto",
-             metadata: dict | None = None) -> "TreeHandle":
-        """Create a tree element handle for hierarchical data."""
+    def tree(self, root_label: str, *,
+             root_style: str | None = None,
+             max_depth_hint: int | None = None,
+             show_guides: bool = True,
+             priority: str = "normal",
+             collapse_hint: str = "auto",
+             metadata: dict | None = None) -> "TreeHandle":
+        """Create a tree element handle for hierarchical data."""
         ...
     
-    def progress(self, label: str, *,
-                 total: int | None = None,
-                 indeterminate: bool = False,
-                 steps: list[str] | None = None,
-                 priority: str = "normal",
-                 metadata: dict | None = None) -> "ProgressHandle":
-        """Create a progress indicator handle.
-        
-        Args:
-            label: Display label for the progress indicator.
-            total: Total units of work (None for indeterminate).
-            indeterminate: If True, show a spinner instead of a progress bar.
-            steps: Named steps to track (creates ProgressStep objects with
-                   initial status "pending").
-        """
+    def progress(self, label: str, *,
+                 total: int | None = None,
+                 indeterminate: bool = False,
+                 steps: list[str] | None = None,
+                 priority: str = "normal",
+                 metadata: dict | None = None) -> "ProgressHandle":
+        """Create a progress indicator handle.
+        
+        Args:
+            label: Display label for the progress indicator.
+            total: Total units of work (None for indeterminate).
+            indeterminate: If True, show a spinner instead of a progress bar.
+            steps: Named steps to track (creates ProgressStep objects with
+                   initial status "pending").
+        """
         ...
     
-    def status(self, message: str, *,
-               level: str = "info",
-               detail: str | None = None,
-               priority: str = "normal",
-               metadata: dict | None = None) -> "StatusHandle":
-        """Create a status message handle."""
+    def status(self, message: str, *,
+               level: str = "info",
+               detail: str | None = None,
+               priority: str = "normal",
+               metadata: dict | None = None) -> "StatusHandle":
+        """Create a status message handle."""
         ...
     
-    def text(self, content: str = "", *,
-             wrap: bool = True,
-             indent: int = 0,
-             priority: str = "normal",
-             metadata: dict | None = None) -> "TextHandle":
-        """Create a text block handle."""
+    def text(self, content: str = "", *,
+             wrap: bool = True,
+             indent: int = 0,
+             priority: str = "normal",
+             metadata: dict | None = None) -> "TextHandle":
+        """Create a text block handle."""
         ...
     
-    def code(self, content: str = "", *,
-             language: str | None = None,
-             line_numbers: bool = False,
-             highlight_lines: list[int] | None = None,
-             priority: str = "normal",
-             metadata: dict | None = None) -> "CodeHandle":
-        """Create a code block handle."""
+    def code(self, content: str = "", *,
+             language: str | None = None,
+             line_numbers: bool = False,
+             highlight_lines: list[int] | None = None,
+             priority: str = "normal",
+             metadata: dict | None = None) -> "CodeHandle":
+        """Create a code block handle."""
         ...
     
-    def diff(self, *,
-             file_a: str | None = None,
-             file_b: str | None = None,
-             priority: str = "normal",
-             metadata: dict | None = None) -> "DiffHandle":
-        """Create a diff block handle."""
+    def diff(self, *,
+             file_a: str | None = None,
+             file_b: str | None = None,
+             priority: str = "normal",
+             metadata: dict | None = None) -> "DiffHandle":
+        """Create a diff block handle."""
         ...
     
-    def separator(self, style: str = "line") -> "SeparatorHandle":
-        """Create a visual separator. Separators are auto-closed on creation."""
+    def separator(self, style: str = "line") -> "SeparatorHandle":
+        """Create a visual separator. Separators are auto-closed on creation."""
         ...
     
-    def action_hint(self, commands: list[str],
-                    description: str | None = None) -> "ActionHintHandle":
-        """Create an action hint. Action hints are auto-closed on creation."""
+    def action_hint(self, commands: list[str],
+                    description: str | None = None) -> "ActionHintHandle":
+        """Create an action hint. Action hints are auto-closed on creation."""
         ...
     
-    # --- Session operations ---
+    # --- Session operations ---
     
-    def snapshot(self) -> "StructuredOutput":
-        """Return a static snapshot of all elements accumulated so far.
-        
-        The snapshot captures the current state of every handle (open or closed)
-        as a StructuredOutput object. This is used by accumulate-mode strategies
-        (json/yaml) at session end, and is available at any time for logging,
-        debugging, or programmatic inspection.
-        """
+    def snapshot(self) -> "StructuredOutput":
+        """Return a static snapshot of all elements accumulated so far.
+        
+        The snapshot captures the current state of every handle (open or closed)
+        as a StructuredOutput object. This is used by accumulate-mode strategies
+        (json/yaml) at session end, and is available at any time for logging,
+        debugging, or programmatic inspection.
+        """
         ...
     
-    def close(self, *, exit_code: int = 0) -> "StructuredOutput":
-        """Close the session and finalize all output.
-        
-        Any handles still open are force-closed (with a warning logged).
-        Emits a SessionEnd event to the strategy. Returns the final
-        StructuredOutput snapshot.
-        
-        Args:
-            exit_code: The command's exit code (included in the snapshot).
-        
-        Returns:
-            The final StructuredOutput snapshot.
-        """
+    def close(self, *, exit_code: int = 0) -> "StructuredOutput":
+        """Close the session and finalize all output.
+        
+        Any handles still open are force-closed (with a warning logged).
+        Emits a SessionEnd event to the strategy. Returns the final
+        StructuredOutput snapshot.
+        
+        Args:
+            exit_code: The command's exit code (included in the snapshot).
+        
+        Returns:
+            The final StructuredOutput snapshot.
+        """
         ...
     
-    # --- Context manager support ---
+    # --- Context manager support ---
     
-    def __enter__(self) -> "OutputSession":
-        return self
+    def __enter__(self) -> "OutputSession":
+        return self
     
-    def __exit__(self, exc_type, exc_val, exc_tb) -> None:
-        """Auto-close session on context exit.
-        
-        If exiting due to an exception, sets exit_code to 1 and emits an
-        error status element before closing.
-        """
+    def __exit__(self, exc_type, exc_val, exc_tb) -> None:
+        """Auto-close session on context exit.
+        
+        If exiting due to an exception, sets exit_code to 1 and emits an
+        error status element before closing.
+        """
         ...
-```
+
#### Element Handles Element handles are the producer-facing API. Each handle type wraps a specific element kind and provides methods appropriate to that kind. All handles share a common base: -```python -class ElementHandle(Generic[E]): - """Base class for all element handles. +

+class ElementHandle(Generic[E]):
+    """Base class for all element handles.
+    
+    An element handle is a write-only view of an output element. Producers use
+    handles to incrementally build element content without knowledge of the
+    active format or materialization strategy.
+    
+    Type Parameter:
+        E: The OutputElement subclass this handle wraps (e.g., Panel, Table).
+    
+    Thread Safety:
+        Individual handle methods are thread-safe. Multiple threads may call
+        methods on *different* handles concurrently. Concurrent writes to the
+        *same* handle are serialized via an internal lock.
+    
+    Lifecycle:
+        handle = session.table(...)    # Created by session factory
+        handle.add_row(...)            # Write operations (zero or more)
+        handle.close()                 # Finalize (required unless auto-closed)
+    
+    Closed Handle Behavior:
+        Calling any write method on a closed handle raises ElementClosedError.
+    """
     
-    An element handle is a write-only view of an output element. Producers use
-    handles to incrementally build element content without knowledge of the
-    active format or materialization strategy.
+    handle_id: str                       # Unique handle identifier (ULID)
+    element_type: str                    # Semantic type ("panel", "table", etc.)
+    declaration_index: int               # Position in session's declaration order
     
-    Type Parameter:
-        E: The OutputElement subclass this handle wraps (e.g., Panel, Table).
+    _session: OutputSession              # Owning session (for event emission)
+    _element: E                          # The accumulated element state
+    _state: HandleState                  # "open" | "closed"
+    _lock: threading.Lock                # Serializes writes to this handle
     
-    Thread Safety:
-        Individual handle methods are thread-safe. Multiple threads may call
-        methods on *different* handles concurrently. Concurrent writes to the
-        *same* handle are serialized via an internal lock.
-    
-    Lifecycle:
-        handle = session.table(...)    # Created by session factory
-        handle.add_row(...)            # Write operations (zero or more)
-        handle.close()                 # Finalize (required unless auto-closed)
-    
-    Closed Handle Behavior:
-        Calling any write method on a closed handle raises ElementClosedError.
-    """
-    
-    handle_id: str                       # Unique handle identifier (ULID)
-    element_type: str                    # Semantic type ("panel", "table", etc.)
-    declaration_index: int               # Position in session's declaration order
-    
-    _session: OutputSession              # Owning session (for event emission)
-    _element: E                          # The accumulated element state
-    _state: HandleState                  # "open" | "closed"
-    _lock: threading.Lock                # Serializes writes to this handle
-    
-    def close(self) -> None:
-        """Close this handle, signaling that no more data will be written.
-        
-        Emits an ElementClosed event to the materialization strategy.
-        For buffered strategies, this triggers rendering of the element.
-        """
+    def close(self) -> None:
+        """Close this handle, signaling that no more data will be written.
+        
+        Emits an ElementClosed event to the materialization strategy.
+        For buffered strategies, this triggers rendering of the element.
+        """
         ...
     
-    @property
-    def is_open(self) -> bool:
-        """Whether this handle is still accepting writes."""
+    @property
+    def is_open(self) -> bool:
+        """Whether this handle is still accepting writes."""
         ...
     
-    @property
-    def element(self) -> E:
-        """The accumulated element state (read-only snapshot)."""
+    @property
+    def element(self) -> E:
+        """The accumulated element state (read-only snapshot)."""
         ...
     
-    def __enter__(self) -> Self:
-        return self
+    def __enter__(self) -> Self:
+        return self
     
-    def __exit__(self, exc_type, exc_val, exc_tb) -> None:
-        """Auto-close handle on context exit."""
-        if self.is_open:
+    def __exit__(self, exc_type, exc_val, exc_tb) -> None:
+        """Auto-close handle on context exit."""
+        if self.is_open:
             self.close()
 
 
-class PanelHandle(ElementHandle[Panel]):
-    """Handle for building a Panel element incrementally.
+class PanelHandle(ElementHandle[Panel]):
+    """Handle for building a Panel element incrementally.
+    
+    Panels are titled groups of key-value pairs. Entries can be added,
+    updated, or removed after creation.
+    """
     
-    Panels are titled groups of key-value pairs. Entries can be added,
-    updated, or removed after creation.
-    """
-    
-    def set_entry(self, key: str, value: str, *,
-                  style_hint: str | None = None,
-                  icon: str | None = None) -> None:
-        """Set or update a key-value entry in the panel.
-        
-        If an entry with the given key already exists, it is updated.
-        Otherwise, a new entry is appended.
-        
-        Emits an ElementUpdated event.
-        """
+    def set_entry(self, key: str, value: str, *,
+                  style_hint: str | None = None,
+                  icon: str | None = None) -> None:
+        """Set or update a key-value entry in the panel.
+        
+        If an entry with the given key already exists, it is updated.
+        Otherwise, a new entry is appended.
+        
+        Emits an ElementUpdated event.
+        """
         ...
     
-    def set_entries(self, entries: dict[str, str], *,
-                    style_hints: dict[str, str] | None = None) -> None:
-        """Set multiple entries at once (batch update). Emits a single event."""
+    def set_entries(self, entries: dict[str, str], *,
+                    style_hints: dict[str, str] | None = None) -> None:
+        """Set multiple entries at once (batch update). Emits a single event."""
         ...
     
-    def remove_entry(self, key: str) -> None:
-        """Remove an entry by key. Emits an ElementUpdated event."""
+    def remove_entry(self, key: str) -> None:
+        """Remove an entry by key. Emits an ElementUpdated event."""
         ...
 
 
-class TableHandle(ElementHandle[Table]):
-    """Handle for building a Table element incrementally.
+class TableHandle(ElementHandle[Table]):
+    """Handle for building a Table element incrementally.
+    
+    Tables are the primary element for streamed data. Rows can be added
+    one at a time or in batches as data becomes available from queries,
+    API calls, or concurrent operations.
+    """
     
-    Tables are the primary element for streamed data. Rows can be added
-    one at a time or in batches as data becomes available from queries,
-    API calls, or concurrent operations.
-    """
-    
-    def add_row(self, row: dict) -> None:
-        """Append a single row to the table.
-        
-        The row dict maps column names to cell values. Missing columns
-        are filled with None. Extra columns not in the schema are ignored.
-        
-        Emits an ElementUpdated event (type=row_added).
-        """
+    def add_row(self, row: dict) -> None:
+        """Append a single row to the table.
+        
+        The row dict maps column names to cell values. Missing columns
+        are filled with None. Extra columns not in the schema are ignored.
+        
+        Emits an ElementUpdated event (type=row_added).
+        """
         ...
     
-    def add_rows(self, rows: list[dict]) -> None:
-        """Append multiple rows in a batch. Emits a single ElementUpdated event."""
+    def add_rows(self, rows: list[dict]) -> None:
+        """Append multiple rows in a batch. Emits a single ElementUpdated event."""
         ...
     
-    def set_summary(self, summary: dict) -> None:
-        """Set or update the summary/aggregation row. Emits an ElementUpdated event."""
+    def set_summary(self, summary: dict) -> None:
+        """Set or update the summary/aggregation row. Emits an ElementUpdated event."""
         ...
     
-    def set_sort_key(self, column: str, *, descending: bool = False) -> None:
-        """Change the sort key. Emits an ElementUpdated event."""
+    def set_sort_key(self, column: str, *, descending: bool = False) -> None:
+        """Change the sort key. Emits an ElementUpdated event."""
         ...
 
 
-class TreeHandle(ElementHandle[Tree]):
-    """Handle for building a Tree element incrementally.
+class TreeHandle(ElementHandle[Tree]):
+    """Handle for building a Tree element incrementally.
+    
+    Trees are built by adding child nodes to existing nodes. The root node
+    is created with the handle. Subtrees can be constructed incrementally
+    as hierarchical data is discovered.
+    """
     
-    Trees are built by adding child nodes to existing nodes. The root node
-    is created with the handle. Subtrees can be constructed incrementally
-    as hierarchical data is discovered.
-    """
-    
-    def add_child(self, parent_path: str | None, label: str, *,
-                  style_hint: str | None = None,
-                  collapsed: bool = False,
-                  metadata: dict | None = None) -> str:
-        """Add a child node to the tree.
-        
-        Args:
-            parent_path: Slash-separated path to the parent node (None = root).
-            label: Display label for the new node.
-            style_hint: Optional color/style hint.
-            collapsed: Whether this node starts collapsed in interactive renderers.
-            metadata: Arbitrary data attached to the node.
-        
-        Returns:
-            The full path to the newly created node (for use as parent_path
-            in subsequent add_child calls).
-        
-        Emits an ElementUpdated event.
-        """
+    def add_child(self, parent_path: str | None, label: str, *,
+                  style_hint: str | None = None,
+                  collapsed: bool = False,
+                  metadata: dict | None = None) -> str:
+        """Add a child node to the tree.
+        
+        Args:
+            parent_path: Slash-separated path to the parent node (None = root).
+            label: Display label for the new node.
+            style_hint: Optional color/style hint.
+            collapsed: Whether this node starts collapsed in interactive renderers.
+            metadata: Arbitrary data attached to the node.
+        
+        Returns:
+            The full path to the newly created node (for use as parent_path
+            in subsequent add_child calls).
+        
+        Emits an ElementUpdated event.
+        """
         ...
     
-    def set_node_style(self, path: str, style_hint: str) -> None:
-        """Update the style of an existing node. Emits an ElementUpdated event."""
+    def set_node_style(self, path: str, style_hint: str) -> None:
+        """Update the style of an existing node. Emits an ElementUpdated event."""
         ...
 
 
-class ProgressHandle(ElementHandle[ProgressIndicator]):
-    """Handle for updating a ProgressIndicator element.
+class ProgressHandle(ElementHandle[ProgressIndicator]):
+    """Handle for updating a ProgressIndicator element.
+    
+    Progress handles are unique in that they are expected to receive many
+    rapid updates. The materialization strategy may throttle update events
+    to avoid overwhelming the terminal (e.g., limiting redraws to 10/sec).
+    """
     
-    Progress handles are unique in that they are expected to receive many
-    rapid updates. The materialization strategy may throttle update events
-    to avoid overwhelming the terminal (e.g., limiting redraws to 10/sec).
-    """
-    
-    def set_progress(self, current: int, total: int | None = None) -> None:
-        """Update the progress counter.
-        
-        Args:
-            current: Current progress value.
-            total: Total value (can change, e.g., when total is discovered late).
-        
-        Emits an ElementUpdated event (may be throttled by the strategy).
-        """
+    def set_progress(self, current: int, total: int | None = None) -> None:
+        """Update the progress counter.
+        
+        Args:
+            current: Current progress value.
+            total: Total value (can change, e.g., when total is discovered late).
+        
+        Emits an ElementUpdated event (may be throttled by the strategy).
+        """
         ...
     
-    def set_step_status(self, step_label: str, status: str) -> None:
-        """Update the status of a named step.
-        
-        Args:
-            step_label: The label of the step to update.
-            status: New status — "pending" | "active" | "done" | "error" | "skipped".
-        
-        Emits an ElementUpdated event.
-        """
+    def set_step_status(self, step_label: str, status: str) -> None:
+        """Update the status of a named step.
+        
+        Args:
+            step_label: The label of the step to update.
+            status: New status — "pending" | "active" | "done" | "error" | "skipped".
+        
+        Emits an ElementUpdated event.
+        """
         ...
     
-    def set_label(self, label: str) -> None:
-        """Update the progress label text. Emits an ElementUpdated event."""
+    def set_label(self, label: str) -> None:
+        """Update the progress label text. Emits an ElementUpdated event."""
         ...
     
-    def increment(self, delta: int = 1) -> None:
-        """Increment progress by delta. Convenience wrapper around set_progress."""
+    def increment(self, delta: int = 1) -> None:
+        """Increment progress by delta. Convenience wrapper around set_progress."""
         ...
 
 
-class StatusHandle(ElementHandle[StatusMessage]):
-    """Handle for a status message.
+class StatusHandle(ElementHandle[StatusMessage]):
+    """Handle for a status message.
+    
+    Status handles are typically created and immediately closed (fire-and-forget
+    messages). However, they can be kept open for messages that may be revised
+    (e.g., a "Working..." status that becomes "Done" or "Failed").
+    """
     
-    Status handles are typically created and immediately closed (fire-and-forget
-    messages). However, they can be kept open for messages that may be revised
-    (e.g., a "Working..." status that becomes "Done" or "Failed").
-    """
-    
-    def set_message(self, message: str) -> None:
-        """Update the status message text. Emits an ElementUpdated event."""
+    def set_message(self, message: str) -> None:
+        """Update the status message text. Emits an ElementUpdated event."""
         ...
     
-    def set_level(self, level: str) -> None:
-        """Change the status level. Emits an ElementUpdated event."""
+    def set_level(self, level: str) -> None:
+        """Change the status level. Emits an ElementUpdated event."""
         ...
     
-    def set_detail(self, detail: str | None) -> None:
-        """Set or clear the detail text. Emits an ElementUpdated event."""
+    def set_detail(self, detail: str | None) -> None:
+        """Set or clear the detail text. Emits an ElementUpdated event."""
         ...
 
 
-class TextHandle(ElementHandle[TextBlock]):
-    """Handle for a text block. Supports appending text incrementally."""
+class TextHandle(ElementHandle[TextBlock]):
+    """Handle for a text block. Supports appending text incrementally."""
     
-    def append(self, text: str) -> None:
-        """Append text to the block. Emits an ElementUpdated event."""
+    def append(self, text: str) -> None:
+        """Append text to the block. Emits an ElementUpdated event."""
         ...
     
-    def set_content(self, content: str) -> None:
-        """Replace the entire content. Emits an ElementUpdated event."""
+    def set_content(self, content: str) -> None:
+        """Replace the entire content. Emits an ElementUpdated event."""
         ...
 
 
-class CodeHandle(ElementHandle[CodeBlock]):
-    """Handle for a code block."""
+class CodeHandle(ElementHandle[CodeBlock]):
+    """Handle for a code block."""
     
-    def set_content(self, content: str) -> None:
-        """Set the code content. Emits an ElementUpdated event."""
+    def set_content(self, content: str) -> None:
+        """Set the code content. Emits an ElementUpdated event."""
         ...
     
-    def set_language(self, language: str) -> None:
-        """Set the language for syntax highlighting. Emits an ElementUpdated event."""
+    def set_language(self, language: str) -> None:
+        """Set the language for syntax highlighting. Emits an ElementUpdated event."""
         ...
     
-    def set_highlight_lines(self, lines: list[int]) -> None:
-        """Set lines to highlight. Emits an ElementUpdated event."""
+    def set_highlight_lines(self, lines: list[int]) -> None:
+        """Set lines to highlight. Emits an ElementUpdated event."""
         ...
 
 
-class DiffHandle(ElementHandle[DiffBlock]):
-    """Handle for a diff block. Hunks can be added incrementally."""
+class DiffHandle(ElementHandle[DiffBlock]):
+    """Handle for a diff block. Hunks can be added incrementally."""
     
-    def add_hunk(self, header: str, lines: list["DiffLine"]) -> None:
-        """Add a diff hunk. Emits an ElementUpdated event."""
+    def add_hunk(self, header: str, lines: list["DiffLine"]) -> None:
+        """Add a diff hunk. Emits an ElementUpdated event."""
         ...
     
-    def set_stats(self, insertions: int, deletions: int, **extra: int) -> None:
-        """Set diff statistics. Emits an ElementUpdated event."""
+    def set_stats(self, insertions: int, deletions: int, **extra: int) -> None:
+        """Set diff statistics. Emits an ElementUpdated event."""
         ...
-```
+
#### Element Events Element handles communicate with the materialization strategy through a typed event system. Events are the sole interface between production (handles) and consumption (strategy) — this indirection is what enables format-agnostic producer code: -```python -class ElementEvent: - """Base class for all events emitted by element handles.""" - event_type: str # "created" | "updated" | "closed" - handle_id: str # The handle that emitted this event - element_type: str # The element kind ("panel", "table", etc.) - timestamp: datetime # When the event occurred - session_id: str # The owning session +

+class ElementEvent:
+    """Base class for all events emitted by element handles."""
+    event_type: str                      # "created" | "updated" | "closed"
+    handle_id: str                       # The handle that emitted this event
+    element_type: str                    # The element kind ("panel", "table", etc.)
+    timestamp: datetime                  # When the event occurred
+    session_id: str                      # The owning session
 
 
-class ElementCreated(ElementEvent):
-    """Emitted when a new element handle is created via a session factory."""
-    event_type = "created"
-    declaration_index: int               # Position in session declaration order
-    initial_state: OutputElement         # The element's initial state
+class ElementCreated(ElementEvent):
+    """Emitted when a new element handle is created via a session factory."""
+    event_type = "created"
+    declaration_index: int               # Position in session declaration order
+    initial_state: OutputElement         # The element's initial state
 
 
-class ElementUpdated(ElementEvent):
-    """Emitted when data is written to an element handle."""
-    event_type = "updated"
-    update_type: str                     # Kind-specific: "entry_set", "row_added",
-                                         #   "progress_changed", "step_status_changed", etc.
-    delta: dict                          # The change payload (what was added/modified)
-    element_snapshot: OutputElement      # The full element state after this update
+class ElementUpdated(ElementEvent):
+    """Emitted when data is written to an element handle."""
+    event_type = "updated"
+    update_type: str                     # Kind-specific: "entry_set", "row_added",
+                                         #   "progress_changed", "step_status_changed", etc.
+    delta: dict                          # The change payload (what was added/modified)
+    element_snapshot: OutputElement      # The full element state after this update
 
 
-class ElementClosed(ElementEvent):
-    """Emitted when an element handle is closed (no more data will arrive)."""
-    event_type = "closed"
-    final_state: OutputElement           # The element's final accumulated state
+class ElementClosed(ElementEvent):
+    """Emitted when an element handle is closed (no more data will arrive)."""
+    event_type = "closed"
+    final_state: OutputElement           # The element's final accumulated state
 
 
-class SessionEnd(ElementEvent):
-    """Emitted when the session itself is closed."""
-    event_type = "session_end"
-    exit_code: int
-    snapshot: "StructuredOutput"         # The complete accumulated output
-```
+class SessionEnd(ElementEvent):
+    """Emitted when the session itself is closed."""
+    event_type = "session_end"
+    exit_code: int
+    snapshot: "StructuredOutput"         # The complete accumulated output
+
#### Element Data Model (Snapshot Types) Each element handle accumulates state into a typed **snapshot object**. These are the data classes that represent a fully-built element — they are what the `ElementRenderer` receives when it is time to paint. They are also the building blocks of the `StructuredOutput` returned by `session.snapshot()`: -```python -class OutputElement: - """Base class for all output element snapshot types.""" - element_type: str # Semantic type identifier - metadata: dict # Arbitrary metadata (timestamps, IDs, etc.) - priority: str = "normal" # "critical" | "normal" | "supplementary" - collapse_hint: str = "auto" # "always" | "auto" | "never" — guidance for renderers - # on whether this element can be collapsed/hidden +

+class OutputElement:
+    """Base class for all output element snapshot types."""
+    element_type: str                    # Semantic type identifier
+    metadata: dict                       # Arbitrary metadata (timestamps, IDs, etc.)
+    priority: str = "normal"             # "critical" | "normal" | "supplementary"
+    collapse_hint: str = "auto"          # "always" | "auto" | "never" — guidance for renderers
+                                         #   on whether this element can be collapsed/hidden
 
-class Panel(OutputElement):
-    """A titled group of key-value pairs."""
-    element_type = "panel"
-    title: str
-    entries: list[PanelEntry]            # Each entry: key, value, style_hint (color, icon, etc.)
-    border_style: str = "rounded"        # "rounded" | "square" | "heavy" | "none"
+class Panel(OutputElement):
+    """A titled group of key-value pairs."""
+    element_type = "panel"
+    title: str
+    entries: list[PanelEntry]            # Each entry: key, value, style_hint (color, icon, etc.)
+    border_style: str = "rounded"        # "rounded" | "square" | "heavy" | "none"
 
-class PanelEntry:
-    """A single key-value pair within a Panel."""
-    key: str
-    value: str
-    style_hint: str | None = None        # Color/style for the value (e.g., "success", "warning")
-    icon: str | None = None              # Optional icon/prefix character
+class PanelEntry:
+    """A single key-value pair within a Panel."""
+    key: str
+    value: str
+    style_hint: str | None = None        # Color/style for the value (e.g., "success", "warning")
+    icon: str | None = None              # Optional icon/prefix character
 
-class Table(OutputElement):
-    """A tabular data set with typed columns."""
-    element_type = "table"
-    title: str | None
-    columns: list[ColumnDef]             # name, type, alignment, width_hint, sortable
-    rows: list[dict]                     # Column name → cell value
-    summary: dict | None                 # Optional aggregation row (totals, counts)
-    max_rows_hint: int | None            # Suggest truncation for large datasets
-    sort_key: str | None                 # Default sort column
+class Table(OutputElement):
+    """A tabular data set with typed columns."""
+    element_type = "table"
+    title: str | None
+    columns: list[ColumnDef]             # name, type, alignment, width_hint, sortable
+    rows: list[dict]                     # Column name → cell value
+    summary: dict | None                 # Optional aggregation row (totals, counts)
+    max_rows_hint: int | None            # Suggest truncation for large datasets
+    sort_key: str | None                 # Default sort column
 
-class ColumnDef:
-    """Schema for a single table column."""
-    name: str                            # Column display name
-    type: str = "string"                 # "string" | "number" | "boolean" | "datetime" | "id"
-    alignment: str = "left"              # "left" | "right" | "center"
-    width_hint: int | None = None        # Suggested character width (None = auto)
-    sortable: bool = False               # Whether this column can be sorted
-    style_hint: str | None = None        # Default style for cells in this column
+class ColumnDef:
+    """Schema for a single table column."""
+    name: str                            # Column display name
+    type: str = "string"                 # "string" | "number" | "boolean" | "datetime" | "id"
+    alignment: str = "left"              # "left" | "right" | "center"
+    width_hint: int | None = None        # Suggested character width (None = auto)
+    sortable: bool = False               # Whether this column can be sorted
+    style_hint: str | None = None        # Default style for cells in this column
 
-class Tree(OutputElement):
-    """A hierarchical tree structure."""
-    element_type = "tree"
-    root: TreeNode                       # Recursive node structure
-    max_depth_hint: int | None           # Suggest depth truncation
-    show_guides: bool = True             # Whether to show tree guide lines
+class Tree(OutputElement):
+    """A hierarchical tree structure."""
+    element_type = "tree"
+    root: TreeNode                       # Recursive node structure
+    max_depth_hint: int | None           # Suggest depth truncation
+    show_guides: bool = True             # Whether to show tree guide lines
 
-class TreeNode:
-    """A node in a tree structure."""
-    label: str
-    style_hint: str | None               # Color/style for this node
-    children: list["TreeNode"]
-    collapsed: bool = False              # Hint: start collapsed in interactive renderers
-    metadata: dict                       # Arbitrary data attached to the node
+class TreeNode:
+    """A node in a tree structure."""
+    label: str
+    style_hint: str | None               # Color/style for this node
+    children: list["TreeNode"]
+    collapsed: bool = False              # Hint: start collapsed in interactive renderers
+    metadata: dict                       # Arbitrary data attached to the node
 
-class StatusMessage(OutputElement):
-    """A status line (success, warning, error, info)."""
-    element_type = "status"
-    level: str                           # "ok" | "warn" | "error" | "info"
-    message: str
-    detail: str | None                   # Optional detail text
+class StatusMessage(OutputElement):
+    """A status line (success, warning, error, info)."""
+    element_type = "status"
+    level: str                           # "ok" | "warn" | "error" | "info"
+    message: str
+    detail: str | None                   # Optional detail text
 
-class ProgressIndicator(OutputElement):
-    """A progress bar or spinner for long-running operations."""
-    element_type = "progress"
-    label: str
-    current: int | None
-    total: int | None
-    indeterminate: bool = False          # Spinner mode vs. progress bar mode
-    steps: list[ProgressStep] | None     # Named steps with status (pending/active/done)
+class ProgressIndicator(OutputElement):
+    """A progress bar or spinner for long-running operations."""
+    element_type = "progress"
+    label: str
+    current: int | None
+    total: int | None
+    indeterminate: bool = False          # Spinner mode vs. progress bar mode
+    steps: list[ProgressStep] | None     # Named steps with status (pending/active/done)
 
-class ProgressStep:
-    """A named step within a progress indicator."""
-    label: str
-    status: str                          # "pending" | "active" | "done" | "error" | "skipped"
+class ProgressStep:
+    """A named step within a progress indicator."""
+    label: str
+    status: str                          # "pending" | "active" | "done" | "error" | "skipped"
 
-class CodeBlock(OutputElement):
-    """A block of source code with optional syntax highlighting."""
-    element_type = "code"
-    content: str
-    language: str | None                 # For syntax highlighting
-    line_numbers: bool = False
-    highlight_lines: list[int] | None    # Lines to emphasize
+class CodeBlock(OutputElement):
+    """A block of source code with optional syntax highlighting."""
+    element_type = "code"
+    content: str
+    language: str | None                 # For syntax highlighting
+    line_numbers: bool = False
+    highlight_lines: list[int] | None    # Lines to emphasize
 
-class DiffBlock(OutputElement):
-    """A unified diff display."""
-    element_type = "diff"
-    hunks: list[DiffHunk]
-    file_a: str | None
-    file_b: str | None
-    stats: dict | None                   # insertions, deletions, etc.
+class DiffBlock(OutputElement):
+    """A unified diff display."""
+    element_type = "diff"
+    hunks: list[DiffHunk]
+    file_a: str | None
+    file_b: str | None
+    stats: dict | None                   # insertions, deletions, etc.
 
-class DiffHunk:
-    """A single hunk within a diff."""
-    header: str                          # @@ line range @@
-    lines: list[DiffLine]
+class DiffHunk:
+    """A single hunk within a diff."""
+    header: str                          # @@ line range @@
+    lines: list[DiffLine]
 
-class DiffLine:
-    """A single line in a diff hunk."""
-    type: str                            # "context" | "add" | "remove"
-    content: str
-    line_number_old: int | None
-    line_number_new: int | None
+class DiffLine:
+    """A single line in a diff hunk."""
+    type: str                            # "context" | "add" | "remove"
+    content: str
+    line_number_old: int | None
+    line_number_new: int | None
 
-class TextBlock(OutputElement):
-    """A free-form text block (descriptions, rationale, etc.)."""
-    element_type = "text"
-    content: str
-    wrap: bool = True
-    indent: int = 0
+class TextBlock(OutputElement):
+    """A free-form text block (descriptions, rationale, etc.)."""
+    element_type = "text"
+    content: str
+    wrap: bool = True
+    indent: int = 0
 
-class Separator(OutputElement):
-    """A visual separator between logical groups."""
-    element_type = "separator"
-    style: str = "line"                  # "line" | "blank" | "double"
+class Separator(OutputElement):
+    """A visual separator between logical groups."""
+    element_type = "separator"
+    style: str = "line"                  # "line" | "blank" | "double"
 
-class ActionHint(OutputElement):
-    """A suggested next-step action for the user."""
-    element_type = "action_hint"
-    commands: list[str]                  # Suggested CLI commands
-    description: str | None
+class ActionHint(OutputElement):
+    """A suggested next-step action for the user."""
+    element_type = "action_hint"
+    commands: list[str]                  # Suggested CLI commands
+    description: str | None
 
-class StructuredOutput:
-    """Static snapshot of a complete command output.
-    
-    This is the accumulated state of all elements at a point in time.
-    It is produced by OutputSession.snapshot() and OutputSession.close().
-    
-    Uses:
-    - Final serialization for json/yaml formats
-    - Logging and audit trails
-    - Programmatic inspection and testing
-    - TUI widget data binding (initial state)
-    """
-    command: str                         # The command that produced this output
-    session_id: str                      # The session that produced this output
-    elements: list[OutputElement]        # Ordered list of element snapshots
-    exit_code: int = 0
-    timing: dict | None                  # start_time, end_time, duration
-    metadata: dict                       # command-specific metadata
-```
+class StructuredOutput:
+    """Static snapshot of a complete command output.
+    
+    This is the accumulated state of all elements at a point in time.
+    It is produced by OutputSession.snapshot() and OutputSession.close().
+    
+    Uses:
+    - Final serialization for json/yaml formats
+    - Logging and audit trails
+    - Programmatic inspection and testing
+    - TUI widget data binding (initial state)
+    """
+    command: str                         # The command that produced this output
+    session_id: str                      # The session that produced this output
+    elements: list[OutputElement]        # Ordered list of element snapshots
+    exit_code: int = 0
+    timing: dict | None                  # start_time, end_time, duration
+    metadata: dict                       # command-specific metadata
+
#### Materialization Strategies @@ -4711,254 +4712,254 @@ The materialization strategy is the format-side counterpart to the output sessio The strategy pattern creates a clean separation between **timing/ordering policy** (when to render) and **visual formatting** (how to render). This means the same `PlainElementRenderer` can be used whether elements arrive all-at-once or are streamed concurrently — the strategy handles the coordination. -```python -class MaterializationStrategy(Protocol): - """Interface for format-driven output materialization. +

+class MaterializationStrategy(Protocol):
+    """Interface for format-driven output materialization.
+    
+    A materialization strategy receives element lifecycle events from the
+    OutputSession and decides when to render element content to the output
+    stream. Strategies do not render elements themselves — they delegate
+    to a paired ElementRenderer at the appropriate time.
+    
+    The strategy is the mechanism by which format-agnostic producer code
+    produces correct output regardless of format. The producer writes to
+    handles; the strategy decides what reaches the terminal and when.
+    """
     
-    A materialization strategy receives element lifecycle events from the
-    OutputSession and decides when to render element content to the output
-    stream. Strategies do not render elements themselves — they delegate
-    to a paired ElementRenderer at the appropriate time.
+    strategy_name: str                   # "live" | "sequential_buffer" | "accumulate"
     
-    The strategy is the mechanism by which format-agnostic producer code
-    produces correct output regardless of format. The producer writes to
-    handles; the strategy decides what reaches the terminal and when.
-    """
-    
-    strategy_name: str                   # "live" | "sequential_buffer" | "accumulate"
-    
-    def bind(self, renderer: "ElementRenderer",
-             terminal_caps: "TerminalCapabilities") -> None:
-        """Bind this strategy to a renderer and terminal capabilities.
-        
-        Called once during format resolution, before the session opens.
-        The strategy retains a reference to the renderer for use during
-        event handling. The output stream is provided separately via
-        on_session_begin, since the session owns the stream.
-        """
+    def bind(self, renderer: "ElementRenderer",
+             terminal_caps: "TerminalCapabilities") -> None:
+        """Bind this strategy to a renderer and terminal capabilities.
+        
+        Called once during format resolution, before the session opens.
+        The strategy retains a reference to the renderer for use during
+        event handling. The output stream is provided separately via
+        on_session_begin, since the session owns the stream.
+        """
         ...
     
-    def on_session_begin(self, session: OutputSession, stream: IO) -> None:
-        """Called when the session opens. The strategy receives the output
-        stream and may write preamble (e.g., opening JSON bracket)."""
+    def on_session_begin(self, session: OutputSession, stream: IO) -> None:
+        """Called when the session opens. The strategy receives the output
+        stream and may write preamble (e.g., opening JSON bracket)."""
         ...
     
-    def on_element_created(self, event: ElementCreated) -> None:
-        """Called when a new element handle is created."""
+    def on_element_created(self, event: ElementCreated) -> None:
+        """Called when a new element handle is created."""
         ...
     
-    def on_element_updated(self, event: ElementUpdated) -> None:
-        """Called when data is written to an element handle."""
+    def on_element_updated(self, event: ElementUpdated) -> None:
+        """Called when data is written to an element handle."""
         ...
     
-    def on_element_closed(self, event: ElementClosed) -> None:
-        """Called when an element handle is closed."""
+    def on_element_closed(self, event: ElementClosed) -> None:
+        """Called when an element handle is closed."""
         ...
     
-    def on_session_end(self, event: SessionEnd) -> None:
-        """Called when the session closes. The strategy may write epilogue."""
+    def on_session_end(self, event: SessionEnd) -> None:
+        """Called when the session closes. The strategy may write epilogue."""
         ...
 
 
-class LiveMaterializer(MaterializationStrategy):
-    """Materialization strategy for the `rich` format.
+class LiveMaterializer(MaterializationStrategy):
+    """Materialization strategy for the `rich` format.
+    
+    Renders element updates in real-time using terminal cursor movement.
+    Multiple elements can be visually active and updating simultaneously.
+    The terminal display is a live document that is rewritten in place.
+    
+    Behavior:
+    - on_element_created: Allocates screen region for the element, renders
+      initial (possibly empty) visual state.
+    - on_element_updated: Re-renders the element in place using cursor
+      movement. For progress indicators, updates may be throttled to a
+      maximum refresh rate (default: 15 fps) to avoid terminal flooding.
+    - on_element_closed: Renders the final state and freezes the screen
+      region (no further updates). May apply a visual transition (e.g.,
+      spinner resolves to a checkmark).
+    - on_session_end: Finalizes the display, moves cursor to end, and
+      restores normal terminal scrolling.
+    
+    Screen Layout:
+    Elements are arranged vertically in declaration order. Each element
+    occupies a contiguous block of terminal lines. The materializer tracks
+    the line offset and height of each element's region. When an element's
+    height changes (e.g., a table gains rows), subsequent elements are
+    shifted down.
+    
+    Concurrent Updates:
+    Updates from multiple handles are coalesced into a single frame refresh
+    at the target frame rate. The materializer maintains a dirty-element set
+    and redraws all dirty elements in a single pass per frame.
+    """
+    strategy_name = "live"
     
-    Renders element updates in real-time using terminal cursor movement.
-    Multiple elements can be visually active and updating simultaneously.
-    The terminal display is a live document that is rewritten in place.
-    
-    Behavior:
-    - on_element_created: Allocates screen region for the element, renders
-      initial (possibly empty) visual state.
-    - on_element_updated: Re-renders the element in place using cursor
-      movement. For progress indicators, updates may be throttled to a
-      maximum refresh rate (default: 15 fps) to avoid terminal flooding.
-    - on_element_closed: Renders the final state and freezes the screen
-      region (no further updates). May apply a visual transition (e.g.,
-      spinner resolves to a checkmark).
-    - on_session_end: Finalizes the display, moves cursor to end, and
-      restores normal terminal scrolling.
-    
-    Screen Layout:
-    Elements are arranged vertically in declaration order. Each element
-    occupies a contiguous block of terminal lines. The materializer tracks
-    the line offset and height of each element's region. When an element's
-    height changes (e.g., a table gains rows), subsequent elements are
-    shifted down.
-    
-    Concurrent Updates:
-    Updates from multiple handles are coalesced into a single frame refresh
-    at the target frame rate. The materializer maintains a dirty-element set
-    and redraws all dirty elements in a single pass per frame.
-    """
-    strategy_name = "live"
-    
-    _frame_rate: float = 15.0            # Maximum redraws per second
-    _element_regions: OrderedDict[str, ScreenRegion]  # handle_id → screen region
-    _dirty_set: set[str]                 # handle_ids that need redraw
-    _frame_timer: asyncio.TimerHandle    # Coalescing timer for frame redraws
+    _frame_rate: float = 15.0            # Maximum redraws per second
+    _element_regions: OrderedDict[str, ScreenRegion]  # handle_id → screen region
+    _dirty_set: set[str]                 # handle_ids that need redraw
+    _frame_timer: asyncio.TimerHandle    # Coalescing timer for frame redraws
 
 
-class SequentialBufferMaterializer(MaterializationStrategy):
-    """Materialization strategy for `plain`, `color`, and `table` formats.
+class SequentialBufferMaterializer(MaterializationStrategy):
+    """Materialization strategy for `plain`, `color`, and `table` formats.
+    
+    Buffers element content and renders elements sequentially in declaration
+    order. An element's content is rendered to the output stream only when
+    its handle is closed. If handles are closed out of declaration order,
+    the out-of-order element's rendered content is held in a buffer until
+    all preceding elements have been rendered.
+    
+    This strategy ensures that static, scrolling output formats produce
+    coherent sequential output even when producers write to handles
+    concurrently and close them in arbitrary order.
+    
+    Behavior:
+    - on_element_created: Records the element's declaration index. No output.
+    - on_element_updated: Buffers the update internally. No output.
+    - on_element_closed: If this element is the next in declaration order,
+      renders it immediately (and any buffered subsequent elements that are
+      also closed). Otherwise, buffers the rendered content.
+    - on_session_end: Force-renders any remaining buffered elements (handles
+      that were never closed, in declaration order).
+    
+    Example (two tables populated concurrently):
+    1. Handle A (index 0) created — table "Resources"
+    2. Handle B (index 1) created — table "Validations"
+    3. Handle B receives rows, Handle A receives rows (interleaved)
+    4. Handle B closes (index 1) — rendered content buffered (waiting for A)
+    5. Handle A closes (index 0) — A is rendered to stream, then buffered B
+       is rendered to stream
+    
+    Result: Output shows table A followed by table B, regardless of the
+    order in which data arrived or handles closed.
+    """
+    strategy_name = "sequential_buffer"
     
-    Buffers element content and renders elements sequentially in declaration
-    order. An element's content is rendered to the output stream only when
-    its handle is closed. If handles are closed out of declaration order,
-    the out-of-order element's rendered content is held in a buffer until
-    all preceding elements have been rendered.
-    
-    This strategy ensures that static, scrolling output formats produce
-    coherent sequential output even when producers write to handles
-    concurrently and close them in arbitrary order.
-    
-    Behavior:
-    - on_element_created: Records the element's declaration index. No output.
-    - on_element_updated: Buffers the update internally. No output.
-    - on_element_closed: If this element is the next in declaration order,
-      renders it immediately (and any buffered subsequent elements that are
-      also closed). Otherwise, buffers the rendered content.
-    - on_session_end: Force-renders any remaining buffered elements (handles
-      that were never closed, in declaration order).
-    
-    Example (two tables populated concurrently):
-    1. Handle A (index 0) created — table "Resources"
-    2. Handle B (index 1) created — table "Validations"
-    3. Handle B receives rows, Handle A receives rows (interleaved)
-    4. Handle B closes (index 1) — rendered content buffered (waiting for A)
-    5. Handle A closes (index 0) — A is rendered to stream, then buffered B
-       is rendered to stream
-    
-    Result: Output shows table A followed by table B, regardless of the
-    order in which data arrived or handles closed.
-    """
-    strategy_name = "sequential_buffer"
-    
-    _next_render_index: int = 0          # The declaration index to render next
-    _rendered_buffers: dict[int, str]     # index → pre-rendered content (waiting)
-    _closed_set: set[int]                # Declaration indices of closed elements
+    _next_render_index: int = 0          # The declaration index to render next
+    _rendered_buffers: dict[int, str]     # index → pre-rendered content (waiting)
+    _closed_set: set[int]                # Declaration indices of closed elements
 
 
-class AccumulateMaterializer(MaterializationStrategy):
-    """Materialization strategy for `json` and `yaml` formats.
-    
-    Accumulates all element data silently until the session ends, then
-    serializes the complete StructuredOutput as a single JSON or YAML
-    document.
-    
-    Behavior:
-    - on_element_created: No output.
-    - on_element_updated: No output.
-    - on_element_closed: No output.
-    - on_session_end: Calls session.snapshot() to get the final
-      StructuredOutput, then delegates to the ElementRenderer's
-      serialize() method for complete document serialization.
-    
-    This strategy is the simplest — it ignores all intermediate events and
-    only acts on session_end. It exists as a distinct strategy (rather than
-    a special case) to maintain the uniform strategy interface.
-    """
-    strategy_name = "accumulate"
-```
+class AccumulateMaterializer(MaterializationStrategy):
+    """Materialization strategy for `json` and `yaml` formats.
+    
+    Accumulates all element data silently until the session ends, then
+    serializes the complete StructuredOutput as a single JSON or YAML
+    document.
+    
+    Behavior:
+    - on_element_created: No output.
+    - on_element_updated: No output.
+    - on_element_closed: No output.
+    - on_session_end: Calls session.snapshot() to get the final
+      StructuredOutput, then delegates to the ElementRenderer's
+      serialize() method for complete document serialization.
+    
+    This strategy is the simplest — it ignores all intermediate events and
+    only acts on session_end. It exists as a distinct strategy (rather than
+    a special case) to maintain the uniform strategy interface.
+    """
+    strategy_name = "accumulate"
+
#### ElementRenderer Protocol While the `MaterializationStrategy` controls *when* elements are rendered, the `ElementRenderer` controls *how* each element type is visually formatted. Each format has a paired `ElementRenderer` implementation: -```python -class ElementRenderer(Protocol): - """Interface for format-specific element rendering. +

+class ElementRenderer(Protocol):
+    """Interface for format-specific element rendering.
+    
+    An ElementRenderer knows how to paint each element type for a specific
+    output format. It is called by the MaterializationStrategy when it is
+    time to render an element.
+    
+    Implementations:
+    - PlainElementRenderer: ASCII text, no escapes
+    - ColorElementRenderer: ANSI-colored text, same layout as plain
+    - TableElementRenderer: Unicode box-drawing with color
+    - RichElementRenderer: Advanced terminal features (cursor, animation)
+    - JsonElementRenderer: JSON serialization
+    - YamlElementRenderer: YAML serialization
+    """
     
-    An ElementRenderer knows how to paint each element type for a specific
-    output format. It is called by the MaterializationStrategy when it is
-    time to render an element.
+    format_name: str                     # "plain", "color", "table", "rich", "json", "yaml"
     
-    Implementations:
-    - PlainElementRenderer: ASCII text, no escapes
-    - ColorElementRenderer: ANSI-colored text, same layout as plain
-    - TableElementRenderer: Unicode box-drawing with color
-    - RichElementRenderer: Advanced terminal features (cursor, animation)
-    - JsonElementRenderer: JSON serialization
-    - YamlElementRenderer: YAML serialization
-    """
-    
-    format_name: str                     # "plain", "color", "table", "rich", "json", "yaml"
-    
-    def render_panel(self, panel: Panel, stream: IO) -> None:
-        """Render a panel element to the stream."""
+    def render_panel(self, panel: Panel, stream: IO) -> None:
+        """Render a panel element to the stream."""
         ...
     
-    def render_table(self, table: Table, stream: IO) -> None:
-        """Render a table element to the stream."""
+    def render_table(self, table: Table, stream: IO) -> None:
+        """Render a table element to the stream."""
         ...
     
-    def render_tree(self, tree: Tree, stream: IO) -> None:
-        """Render a tree element to the stream."""
+    def render_tree(self, tree: Tree, stream: IO) -> None:
+        """Render a tree element to the stream."""
         ...
     
-    def render_status(self, status: StatusMessage, stream: IO) -> None:
-        """Render a status message to the stream."""
+    def render_status(self, status: StatusMessage, stream: IO) -> None:
+        """Render a status message to the stream."""
         ...
     
-    def render_progress(self, progress: ProgressIndicator, stream: IO) -> None:
-        """Render a progress indicator to the stream."""
+    def render_progress(self, progress: ProgressIndicator, stream: IO) -> None:
+        """Render a progress indicator to the stream."""
         ...
     
-    def render_code(self, code: CodeBlock, stream: IO) -> None:
-        """Render a code block to the stream."""
+    def render_code(self, code: CodeBlock, stream: IO) -> None:
+        """Render a code block to the stream."""
         ...
     
-    def render_diff(self, diff: DiffBlock, stream: IO) -> None:
-        """Render a diff block to the stream."""
+    def render_diff(self, diff: DiffBlock, stream: IO) -> None:
+        """Render a diff block to the stream."""
         ...
     
-    def render_text(self, text: TextBlock, stream: IO) -> None:
-        """Render a text block to the stream."""
+    def render_text(self, text: TextBlock, stream: IO) -> None:
+        """Render a text block to the stream."""
         ...
     
-    def render_separator(self, separator: Separator, stream: IO) -> None:
-        """Render a visual separator to the stream."""
+    def render_separator(self, separator: Separator, stream: IO) -> None:
+        """Render a visual separator to the stream."""
         ...
     
-    def render_action_hint(self, hint: ActionHint, stream: IO) -> None:
-        """Render an action hint to the stream."""
+    def render_action_hint(self, hint: ActionHint, stream: IO) -> None:
+        """Render an action hint to the stream."""
         ...
     
-    def render_element(self, element: OutputElement, stream: IO) -> None:
-        """Dispatch to the appropriate render method based on element type.
-        
-        This is the primary entry point used by materialization strategies.
-        It uses a dispatch table to route to the correct typed method.
-        """
+    def render_element(self, element: OutputElement, stream: IO) -> None:
+        """Dispatch to the appropriate render method based on element type.
+        
+        This is the primary entry point used by materialization strategies.
+        It uses a dispatch table to route to the correct typed method.
+        """
         dispatch = {
-            "panel": self.render_panel,
-            "table": self.render_table,
-            "tree": self.render_tree,
-            "status": self.render_status,
-            "progress": self.render_progress,
-            "code": self.render_code,
-            "diff": self.render_diff,
-            "text": self.render_text,
-            "separator": self.render_separator,
-            "action_hint": self.render_action_hint,
+            "panel": self.render_panel,
+            "table": self.render_table,
+            "tree": self.render_tree,
+            "status": self.render_status,
+            "progress": self.render_progress,
+            "code": self.render_code,
+            "diff": self.render_diff,
+            "text": self.render_text,
+            "separator": self.render_separator,
+            "action_hint": self.render_action_hint,
         }
         handler = dispatch.get(element.element_type)
-        if handler:
+        if handler:
             handler(element, stream)
     
-    def serialize(self, output: StructuredOutput, stream: IO) -> None:
-        """Serialize a complete StructuredOutput to the stream.
-        
-        Used by AccumulateMaterializer for json/yaml formats. For visual
-        formats (plain/color/table/rich), this method iterates over
-        output.elements and calls render_element for each.
-        """
+    def serialize(self, output: StructuredOutput, stream: IO) -> None:
+        """Serialize a complete StructuredOutput to the stream.
+        
+        Used by AccumulateMaterializer for json/yaml formats. For visual
+        formats (plain/color/table/rich), this method iterates over
+        output.elements and calls render_element for each.
+        """
         ...
     
-    def can_render(self, terminal_caps: "TerminalCapabilities") -> bool:
-        """Whether this renderer can operate in the given terminal environment."""
+    def can_render(self, terminal_caps: "TerminalCapabilities") -> bool:
+        """Whether this renderer can operate in the given terminal environment."""
         ...
-```
+
#### Format Resolution @@ -4990,10 +4991,10 @@ Once the format is resolved, the CLI framework selects the corresponding `(Mater - **No ANSI escape codes** of any kind. - **No Unicode characters** beyond basic ASCII (no box drawing, no checkmarks, no arrows). -**Example** (`agents project show local/api-service --format plain`): +**Example** (`agents --format plain project show local/api-service`): -```text -$ agents project show local/api-service --format plain +

+$ agents --format plain project show local/api-service
 
 Project Details
   Name: local/api-service
@@ -5010,7 +5011,7 @@ Linked Resources
   local/staging-db  local/database  transaction_rollback  yes
 
 Validations (3)
-  val_01HXM5A  pytest --cov=src --cov-fail-under=80  required
+  val_01HXM5A  pytest --cov=src --cov-fail-under=80  required
   val_01HXM5B  ruff check .                          required
   val_01HXM5C  node scripts/check-bundle-size.js     info
 
@@ -5027,20 +5028,20 @@ Indexing Status
   Last Indexed: 12:48
 
 Active Plans
-  Plan ID   Action               Phase
+  Plan ID   Action               Phase
   --------  -------------------  -------
   01HXM7A9  local/code-coverage  execute
 
-[OK] Project loaded
-```
+[OK] Project loaded
+
-**Example** (`agents plan list --format plain`): +**Example** (`agents --format plain plan list`): -```text -$ agents plan list --phase execute --format plain +

+$ agents --format plain plan list --phase execute
 
 Plans
-  ID        Phase    State       Action               Project            Elapsed
+  ID        Phase    State       Action               Project            Elapsed
   --------  -------  ----------  -------------------  -----------------  ---------
   01HXM7A9  execute  processing  local/code-coverage  local/api-service  00:01:12
 
@@ -5048,7 +5049,7 @@ Filters
   Phase: execute
   State: (any)
   Project: (any)
-  Action: (any)
+  Action: (any)
 
 Summary
   Total: 1
@@ -5056,8 +5057,8 @@ Summary
   Completed: 0
   Errored: 0
 
-[OK] 1 plan listed
-```
+[OK] 1 plan listed
+
#### `color` — Colored Plain Text @@ -5081,18 +5082,18 @@ Summary - **No cursor movement or animation** — pure scrolling output. - **Respects `NO_COLOR` environment variable**: If `NO_COLOR` is set, `color` format falls back to `plain`. -**Example** (`agents project show local/api-service --format color`): +**Example** (`agents --format color project show local/api-service`):

-$ agents project show local/api-service --format color
+$ agents --format color project show local/api-service
 
 Project Details
-  Name: local/api-service
-  ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1
-  Description: Backend API
-  Resources: 2
-  Remote: no
-  Created: 2026-02-08 12:46
+  Name: local/api-service
+  ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1
+  Description: Backend API
+  Resources: 2
+  Remote: no
+  Created: 2026-02-08 12:46
 
 Linked Resources
   Resource          Type            Sandbox              Read-Only
@@ -5101,28 +5102,28 @@ $ agents project show local/api-service --format color
   local/staging-db  local/database  transaction_rollback  yes
 
 Validations (3)
-  val_01HXM5A  pytest --cov=src --cov-fail-under=80  required
-  val_01HXM5B  ruff check .                          required
+  val_01HXM5A  pytest --cov=src --cov-fail-under=80  required
+  val_01HXM5B  ruff check .                          required
   val_01HXM5C  node scripts/check-bundle-size.js     info
 
 Context
-  Include: repo
-  Exclude: **/node_modules/**
-  Max File Size: 1 MB
+  Include: repo
+  Exclude: **/node_modules/**
+  Max File Size: 1 MB
 
 Indexing Status
-  Text Index: ready
-  Vector Index: ready
-  Graph Store: disabled
-  Indexed Files: 347
-  Last Indexed: 12:48
+  Text Index: ready
+  Vector Index: ready
+  Graph Store: disabled
+  Indexed Files: 347
+  Last Indexed: 12:48
 
 Active Plans
   Plan ID   Action               Phase
   --------  -------------------  -------
   01HXM7A9  local/code-coverage  execute
 
-[OK] Project loaded
+[OK] Project loaded
 
#### `table` — ASCII Box-Drawing Tables @@ -5141,18 +5142,18 @@ $ agents project show local/api-service --format color **Distinction from `rich`**: The `table` format uses the same box-drawing panels and color as `rich` for static content, but it does **not** use any dynamic or interactive terminal features. There are no animated spinners, no live-updating progress bars, no cursor movement, and no in-place redraws. All output is static and scrolls sequentially. Where `rich` would show a spinning `⠋` and a live progress bar, `table` renders a static snapshot using fixed markers (`✓`, `⏳`, `•`). This makes `table` suitable for terminals without advanced capabilities, and for output that will be reviewed after the fact (e.g., scrollback buffers). -**Example** (`agents project show local/api-service --format table`): +**Example** (`agents --format table project show local/api-service`):

-$ agents project show local/api-service --format table
+$ agents --format table project show local/api-service
 
 ╭─ Project Details ──────────────╮
 │ Name: local/api-service        │
-│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
-│ Description: Backend API       │
+│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
+│ Description: Backend API       │
 │ Resources: 2                   │
-│ Remote: no                     │
-│ Created: 2026-02-08 12:46      │
+│ Remote: no                     │
+│ Created: 2026-02-08 12:46      │
 ╰────────────────────────────────╯
 
 ╭─ Linked Resources ──────────────────────────────────────────────────────╮
@@ -5163,23 +5164,23 @@ $ agents project show local/api-service --format table
 ╰─────────────────────────────────────────────────────────────────────────╯
 
 ╭─ Validations (3) ───────────────────────────────────────────╮
-│ val_01HXM5A  pytest --cov=src --cov-fail-under=80  required │
-│ val_01HXM5B  ruff check .                          required │
+│ val_01HXM5A  pytest --cov=src --cov-fail-under=80  required │
+│ val_01HXM5B  ruff check .                          required │
 │ val_01HXM5C  node scripts/check-bundle-size.js     info     │
 ╰─────────────────────────────────────────────────────────────╯
 
 ╭─ Context ───────────────────╮
-│ Include: repo               │
+│ Include: repo               │
 │ Exclude: **/node_modules/** │
-│ Max File Size: 1 MB        │
+│ Max File Size: 1 MB        │
 ╰─────────────────────────────╯
 
 ╭─ Indexing Status ──────────╮
-│ Text Index: ready         │
-│ Vector Index: ready       │
+│ Text Index: ready         │
+│ Vector Index: ready       │
 │ Graph Store: disabled     │
-│ Indexed Files: 347        │
-│ Last Indexed: 12:48       │
+│ Indexed Files: 347        │
+│ Last Indexed: 12:48       │
 ╰────────────────────────────╯
 
 ╭─ Active Plans ──────────────────────────╮
@@ -5188,41 +5189,41 @@ $ agents project show local/api-service --format table
 │ 01HXM7A9  local/code-coverage  execute │
 ╰─────────────────────────────────────────╯
 
-✓ OK Project loaded
+✓ OK Project loaded
 
-**Example** (`agents plan execute 01HXM8C2ZK --format table`): +**Example** (`agents --format table plan execute 01HXM8C2ZK`): Unlike `rich` mode which would show animated spinners and a live progress bar, the `table` format renders a static snapshot of execution state:

-$ agents plan execute 01HXM8C2ZK --format table
+$ agents --format table plan execute 01HXM8C2ZK
 
 ╭─ Execution ──────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
 │ Phase: execute                   │
 │ Sandbox: git_worktree            │
-│ Worker: local/executor           │
-│ Started: 12:58:10                │
-│ Attempt: 1                       │
+│ Worker: local/executor           │
+│ Started: 12:58:10                │
+│ Attempt: 1                       │
 ╰──────────────────────────────────╯
 
 ╭─ Strategy Summary ─────────────────────╮
-│ Decisions: 8                          │
+│ Decisions: 8                          │
 │ Invariants: 2                         │
-│ Planned Child Plans: 2+               │
-│ Estimated Files: ~12                  │
-│ Risk: low                              │
+│ Planned Child Plans: 2+               │
+│ Estimated Files: ~12                  │
+│ Risk: low                              │
 ╰────────────────────────────────────────╯
 
 ╭─ Progress ────────╮
-│  Collect context │
-│  Run tools       │
+│  Collect context │
+│  Run tools       │
 │  Build changeset │
 │  Validate        │
 ╰───────────────────╯
 
-✓ OK Execution started
+✓ OK Execution started
 
#### `rich` — Modern Rich CLI Elements @@ -5246,39 +5247,39 @@ $ agents plan execute 01HXM8C2ZK --format table - **Live updates**: Long-running commands (plan execute, plan status) use live-updating displays that redraw in place rather than scrolling. - **Graceful degradation**: If the terminal does not support required capabilities (e.g., no truecolor, no cursor movement), the renderer automatically falls back to `table` rendering for those elements. -**Example** (`agents plan execute 01HXM8C2ZK --format rich`): +**Example** (`agents --format rich plan execute 01HXM8C2ZK`): The `rich` format produces output that cannot be fully represented in static documentation — animated spinners cycle in place, progress bars fill smoothly, and elements update without scrolling. The rendering below is a static snapshot of what the terminal would display at a given moment:

-$ agents plan execute 01HXM8C2ZK --format rich
+$ agents --format rich plan execute 01HXM8C2ZK
 
 ╭─ Execution ──────────────────────╮
 │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │
 │ Phase: execute                   │
 │ Sandbox: git_worktree            │
-│ Worker: local/executor           │
-│ Started: 12:58:10                │
+│ Worker: local/executor           │
+│ Started: 12:58:10                │
 ╰──────────────────────────────────╯
 
  Collecting context...                      (⠋⠙⠹⠸⠼⠴⠦⠧⠇⠏ animates in place)
-  ├── repo: local/api-repo 
-  └── db: local/staging-db 
+  ├── repo: local/api-repo 
+  └── db: local/staging-db 
 
 ╭─ Strategy Summary ──────────────────────────────────────────────────────╮
-│ 8 decisions │ 2 invariants │ 2+ child plans │ ~12 files │ risk: low │
+│ 8 decisions │ 2 invariants │ 2+ child plans │ ~12 files │ risk: low │
 ╰─────────────────────────────────────────────────────────────────────────╯
 
-Progress ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  42%  elapsed 0:01:12  ETA 0:01:40
-   Collect context .................. 0.8s
-   Run tools (8 calls) ............. 12.4s
+Progress ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━  42%  elapsed 0:01:12  ETA 0:01:40
+   Collect context .................. 0.8s
+   Run tools (8 calls) ............. 12.4s
    Build changeset ................. (running)     (animates in place)
    Validate ........................ (pending)
 
 ╭─ Live Tool Calls ───────────────────────────────────────╮
-│ #6 read_file   src/auth/__init__.py     0.1s │
-│ #7 write_file  tests/test_auth.py       0.2s │
-│ #8 edit_file   src/auth/session.py      ...  │
+│ #6 read_file   src/auth/__init__.py     0.1s │
+│ #7 write_file  tests/test_auth.py       0.2s │
+│ #8 edit_file   src/auth/session.py      ...  │
 ╰─────────────────────────────────────────────────────────╯
 
@@ -5289,29 +5290,29 @@ In `rich` mode: - The "Live Tool Calls" panel scrolls its content internally, showing only the most recent N calls. - The terminal is not flooded with scrolling text — elements update in place using cursor movement. -**Example** (`agents version --format rich`): +**Example** (`agents --format rich version`):

-$ agents version --format rich
+$ agents --format rich version
 
 ╭─────────────────────────────────────╮
-│  CleverAgents CLI  v1.0.0           │
+│  CleverAgents CLI  v1.0.0           │
 │  channel: stable                    │
 ╰─────────────────────────────────────╯
 
 ╭─ Build ────────────────────────────╮
-│ Build Date: 2026-02-08              │
+│ Build Date: 2026-02-08              │
 │ Commit: a17c3f9                    │
-│ Schema: v3                          │
-│ Platform: linux-x86_64              │
-│ Python: 3.13.1                      │
+│ Schema: v3                          │
+│ Platform: linux-x86_64              │
+│ Python: 3.13.1                      │
 ╰────────────────────────────────────╯
 
 ╭─ Dependencies ─────────────────────────────────────────────────────────╮
-│ LangGraph 0.2.60 │ LangChain 0.3.18 │ MCP SDK 1.4.0 │ Pydantic 2.10.4 │
+│ LangGraph 0.2.60 │ LangChain 0.3.18 │ MCP SDK 1.4.0 │ Pydantic 2.10.4 │
 ╰────────────────────────────────────────────────────────────────────────╯
 
-✓ OK Version reported
+✓ OK Version reported
 
In `rich` mode, the version card may use background colors, bold gradients, or subtle box shadows (depending on terminal truecolor support). Elements may animate into view with a brief slide or fade transition. @@ -5323,16 +5324,16 @@ In `rich` mode, the version card may use background colors, bold gradients, or s **Rendering rules**: - **Top-level structure**: Always a JSON object with a standard envelope: - ```json +

   {
-    "command": "project show",
-    "status": "ok",
-    "exit_code": 0,
-    "data": { ... },
-    "timing": { "duration_ms": 42 },
-    "metadata": { ... }
+    "command": "project show",
+    "status": "ok",
+    "exit_code": 0,
+    "data": { ... },
+    "timing": { "duration_ms": 42 },
+    "metadata": { ... }
   }
-  ```
+  
- **Panels**: Rendered as nested objects within `data`. - **Tables**: Rendered as arrays of objects within `data`. - **Trees**: Rendered as nested objects with `children` arrays. @@ -5343,127 +5344,127 @@ In `rich` mode, the version card may use background colors, bold gradients, or s - **Pretty-printed** by default (indented). Compact mode available via `--json-compact` (future option). - **Consistent schema per command**: Each command's JSON schema is stable and documented, enabling reliable programmatic parsing. -**Example** (`agents project show local/api-service --format json`): +**Example** (`agents --format json project show local/api-service`): -```json +

 {
-  "command": "project show",
-  "status": "ok",
-  "exit_code": 0,
-  "data": {
-    "project": {
-      "name": "local/api-service",
-      "id": "01HXM4T08Y0N5R9VZ4QX4BPTZ1",
-      "description": "Backend API",
-      "type": "local",
-      "remote": false,
-      "created_at": "2026-02-08T12:46:00Z"
+  "command": "project show",
+  "status": "ok",
+  "exit_code": 0,
+  "data": {
+    "project": {
+      "name": "local/api-service",
+      "id": "01HXM4T08Y0N5R9VZ4QX4BPTZ1",
+      "description": "Backend API",
+      "type": "local",
+      "remote": false,
+      "created_at": "2026-02-08T12:46:00Z"
     },
-    "linked_resources": [
+    "linked_resources": [
       {
-        "name": "local/api-repo",
-        "type": "git-checkout",
-        "sandbox_strategy": "git_worktree",
-        "read_only": false
+        "name": "local/api-repo",
+        "type": "git-checkout",
+        "sandbox_strategy": "git_worktree",
+        "read_only": false
       },
       {
-        "name": "local/staging-db",
-        "type": "local/database",
-        "sandbox_strategy": "transaction_rollback",
-        "read_only": true
+        "name": "local/staging-db",
+        "type": "local/database",
+        "sandbox_strategy": "transaction_rollback",
+        "read_only": true
       }
     ],
-    "validations": [
+    "validations": [
       {
-        "id": "val_01HXM5A",
-        "command": "pytest --cov=src --cov-fail-under=80",
-        "mode": "required",
-        "timeout": 600,
-        "resource": "repo"
+        "id": "val_01HXM5A",
+        "command": "pytest --cov=src --cov-fail-under=80",
+        "mode": "required",
+        "timeout": 600,
+        "resource": "repo"
       },
       {
-        "id": "val_01HXM5B",
-        "command": "ruff check .",
-        "mode": "required",
-        "timeout": 300,
-        "resource": null
+        "id": "val_01HXM5B",
+        "command": "ruff check .",
+        "mode": "required",
+        "timeout": 300,
+        "resource": null
       },
       {
-        "id": "val_01HXM5C",
-        "command": "node scripts/check-bundle-size.js",
-        "mode": "informational",
-        "timeout": 300,
-        "resource": null
+        "id": "val_01HXM5C",
+        "command": "node scripts/check-bundle-size.js",
+        "mode": "informational",
+        "timeout": 300,
+        "resource": null
       }
     ],
-    "context": {
-      "include_resources": ["repo"],
-      "exclude_paths": ["**/node_modules/**"],
-      "max_file_size_bytes": 1048576
+    "context": {
+      "include_resources": ["repo"],
+      "exclude_paths": ["**/node_modules/**"],
+      "max_file_size_bytes": 1048576
     },
-    "indexing": {
-      "text_index": "ready",
-      "vector_index": "ready",
-      "graph_store": "disabled",
-      "indexed_files": 347,
-      "last_indexed_at": "2026-02-08T12:48:00Z"
+    "indexing": {
+      "text_index": "ready",
+      "vector_index": "ready",
+      "graph_store": "disabled",
+      "indexed_files": 347,
+      "last_indexed_at": "2026-02-08T12:48:00Z"
     },
-    "active_plans": [
+    "active_plans": [
       {
-        "plan_id": "01HXM7A9",
-        "action": "local/code-coverage",
-        "phase": "execute"
+        "plan_id": "01HXM7A9",
+        "action": "local/code-coverage",
+        "phase": "execute"
       }
     ]
   },
-  "timing": {
-    "duration_ms": 42
+  "timing": {
+    "duration_ms": 42
   },
-  "messages": [
-    { "level": "ok", "text": "Project loaded" }
+  "messages": [
+    { "level": "ok", "text": "Project loaded" }
   ]
 }
-```
+
-**Example** (`agents plan list --phase execute --format json`): +**Example** (`agents --format json plan list --phase execute`): -```json +

 {
-  "command": "plan list",
-  "status": "ok",
-  "exit_code": 0,
-  "data": {
-    "plans": [
+  "command": "plan list",
+  "status": "ok",
+  "exit_code": 0,
+  "data": {
+    "plans": [
       {
-        "id": "01HXM7A9",
-        "phase": "execute",
-        "state": "processing",
-        "action": "local/code-coverage",
-        "project": "local/api-service",
-        "elapsed": "00:01:12"
+        "id": "01HXM7A9",
+        "phase": "execute",
+        "state": "processing",
+        "action": "local/code-coverage",
+        "project": "local/api-service",
+        "elapsed": "00:01:12"
       }
     ],
-    "filters": {
-      "phase": "execute",
-      "state": null,
-      "project": null,
-      "action": null
+    "filters": {
+      "phase": "execute",
+      "state": null,
+      "project": null,
+      "action": null
     },
-    "summary": {
-      "total": 1,
-      "processing": 1,
-      "completed": 0,
-      "errored": 0
+    "summary": {
+      "total": 1,
+      "processing": 1,
+      "completed": 0,
+      "errored": 0
     }
   },
-  "timing": {
-    "duration_ms": 18
+  "timing": {
+    "duration_ms": 18
   },
-  "messages": [
-    { "level": "ok", "text": "1 plan listed" }
+  "messages": [
+    { "level": "ok", "text": "1 plan listed" }
   ]
 }
-```
+
#### `yaml` — YAML Data Structure @@ -5477,67 +5478,67 @@ In `rich` mode, the version card may use background colors, bold gradients, or s - **No ANSI codes** in structural elements (same rule as JSON). - **Sorted keys** for deterministic output. -**Example** (`agents project show local/api-service --format yaml`): +**Example** (`agents --format yaml project show local/api-service`): -```yaml -command: project show -status: ok -exit_code: 0 -data: - project: - name: local/api-service - id: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 - description: Backend API - type: local - remote: false - created_at: "2026-02-08T12:46:00Z" - linked_resources: - - name: local/api-repo - type: git-checkout - sandbox_strategy: git_worktree - read_only: false - - name: local/staging-db - type: local/database - sandbox_strategy: transaction_rollback - read_only: true - validations: - - id: val_01HXM5A - command: "pytest --cov=src --cov-fail-under=80" - mode: required - timeout: 600 - resource: repo - - id: val_01HXM5B - command: "ruff check ." - mode: required - timeout: 300 - resource: null - - id: val_01HXM5C - command: "node scripts/check-bundle-size.js" - mode: informational - timeout: 300 - resource: null - context: - include_resources: +

+command: project show
+status: ok
+exit_code: 0
+data:
+  project:
+    name: local/api-service
+    id: 01HXM4T08Y0N5R9VZ4QX4BPTZ1
+    description: Backend API
+    type: local
+    remote: false
+    created_at: "2026-02-08T12:46:00Z"
+  linked_resources:
+    - name: local/api-repo
+      type: git-checkout
+      sandbox_strategy: git_worktree
+      read_only: false
+    - name: local/staging-db
+      type: local/database
+      sandbox_strategy: transaction_rollback
+      read_only: true
+  validations:
+    - id: val_01HXM5A
+      command: "pytest --cov=src --cov-fail-under=80"
+      mode: required
+      timeout: 600
+      resource: repo
+    - id: val_01HXM5B
+      command: "ruff check ."
+      mode: required
+      timeout: 300
+      resource: null
+    - id: val_01HXM5C
+      command: "node scripts/check-bundle-size.js"
+      mode: informational
+      timeout: 300
+      resource: null
+  context:
+    include_resources:
       - repo
-    exclude_paths:
-      - "**/node_modules/**"
-    max_file_size_bytes: 1048576
-  indexing:
-    text_index: ready
-    vector_index: ready
-    graph_store: disabled
-    indexed_files: 347
-    last_indexed_at: "2026-02-08T12:48:00Z"
-  active_plans:
-    - plan_id: 01HXM7A9
-      action: local/code-coverage
-      phase: execute
-timing:
-  duration_ms: 42
-messages:
-  - level: ok
-    text: Project loaded
-```
+    exclude_paths:
+      - "**/node_modules/**"
+    max_file_size_bytes: 1048576
+  indexing:
+    text_index: ready
+    vector_index: ready
+    graph_store: disabled
+    indexed_files: 347
+    last_indexed_at: "2026-02-08T12:48:00Z"
+  active_plans:
+    - plan_id: 01HXM7A9
+      action: local/code-coverage
+      phase: execute
+timing:
+  duration_ms: 42
+messages:
+  - level: ok
+    text: Project loaded
+
### Format Comparison Matrix @@ -5562,180 +5563,180 @@ messages: The framework uses a **registry pattern** for format renderers, enabling third-party or plugin renderers. Each format is registered as a `(MaterializationStrategy, ElementRenderer)` pair — the strategy controls timing/ordering, and the renderer controls visual formatting: -```python -@dataclass -class FormatRegistration: - """A registered format: its strategy factory, renderer factory, and fallback.""" - strategy_factory: Callable[[TerminalCapabilities], MaterializationStrategy] - renderer_factory: Callable[[TerminalCapabilities], ElementRenderer] - fallback: str | None # Format name to fall back to, or None +

+@dataclass
+class FormatRegistration:
+    """A registered format: its strategy factory, renderer factory, and fallback."""
+    strategy_factory: Callable[[TerminalCapabilities], MaterializationStrategy]
+    renderer_factory: Callable[[TerminalCapabilities], ElementRenderer]
+    fallback: str | None                 # Format name to fall back to, or None
 
 
-class RendererRegistry:
-    """Central registry for format (strategy, renderer) pairs.
+class RendererRegistry:
+    """Central registry for format (strategy, renderer) pairs.
+    
+    Formats are registered by name and resolved at runtime based on the
+    active format and terminal capabilities. The registry supports dynamic
+    registration, enabling plugins to add custom formats (e.g., 'html',
+    'csv', 'markdown').
+    
+    Built-in registrations:
+        "rich"  → (LiveMaterializer, RichElementRenderer), fallback="table"
+        "table" → (SequentialBufferMaterializer, TableElementRenderer), fallback="color"
+        "color" → (SequentialBufferMaterializer, ColorElementRenderer), fallback="plain"
+        "plain" → (SequentialBufferMaterializer, PlainElementRenderer), fallback=None
+        "json"  → (AccumulateMaterializer, JsonElementRenderer), fallback=None
+        "yaml"  → (AccumulateMaterializer, YamlElementRenderer), fallback=None
+    """
     
-    Formats are registered by name and resolved at runtime based on the
-    active format and terminal capabilities. The registry supports dynamic
-    registration, enabling plugins to add custom formats (e.g., 'html',
-    'csv', 'markdown').
+    _formats: dict[str, FormatRegistration] = {}
     
-    Built-in registrations:
-        "rich"  → (LiveMaterializer, RichElementRenderer), fallback="table"
-        "table" → (SequentialBufferMaterializer, TableElementRenderer), fallback="color"
-        "color" → (SequentialBufferMaterializer, ColorElementRenderer), fallback="plain"
-        "plain" → (SequentialBufferMaterializer, PlainElementRenderer), fallback=None
-        "json"  → (AccumulateMaterializer, JsonElementRenderer), fallback=None
-        "yaml"  → (AccumulateMaterializer, YamlElementRenderer), fallback=None
-    """
-    
-    _formats: dict[str, FormatRegistration] = {}
-    
-    @classmethod
-    def register(cls, format_name: str,
-                 strategy_factory: Callable[[TerminalCapabilities], MaterializationStrategy],
-                 renderer_factory: Callable[[TerminalCapabilities], ElementRenderer],
-                 fallback: str | None = None) -> None:
-        """Register a format.
-        
-        Args:
-            format_name: The format identifier (e.g., 'rich', 'json').
-            strategy_factory: Callable that creates a MaterializationStrategy,
-                given terminal capabilities.
-            renderer_factory: Callable that creates an ElementRenderer,
-                given terminal capabilities.
-            fallback: Optional fallback format name if this format cannot
-                operate in the current terminal environment.
-        """
+    @classmethod
+    def register(cls, format_name: str,
+                 strategy_factory: Callable[[TerminalCapabilities], MaterializationStrategy],
+                 renderer_factory: Callable[[TerminalCapabilities], ElementRenderer],
+                 fallback: str | None = None) -> None:
+        """Register a format.
+        
+        Args:
+            format_name: The format identifier (e.g., 'rich', 'json').
+            strategy_factory: Callable that creates a MaterializationStrategy,
+                given terminal capabilities.
+            renderer_factory: Callable that creates an ElementRenderer,
+                given terminal capabilities.
+            fallback: Optional fallback format name if this format cannot
+                operate in the current terminal environment.
+        """
         cls._formats[format_name] = FormatRegistration(
             strategy_factory=strategy_factory,
             renderer_factory=renderer_factory,
             fallback=fallback,
         )
     
-    @classmethod
-    def resolve(cls, format_name: str,
+    @classmethod
+    def resolve(cls, format_name: str,
                 terminal_caps: TerminalCapabilities
-                ) -> tuple[MaterializationStrategy, ElementRenderer]:
-        """Resolve the best (strategy, renderer) pair for the given format.
-        
-        Walks the fallback chain if the requested format's renderer cannot
-        operate in the current terminal environment. Returns the first pair
-        where the renderer reports can_render(terminal_caps) == True.
-        
-        Raises:
-            ValueError: If no usable format is found (should never happen
-                since 'plain' has no fallback and always works).
-        """
+                ) -> tuple[MaterializationStrategy, ElementRenderer]:
+        """Resolve the best (strategy, renderer) pair for the given format.
+        
+        Walks the fallback chain if the requested format's renderer cannot
+        operate in the current terminal environment. Returns the first pair
+        where the renderer reports can_render(terminal_caps) == True.
+        
+        Raises:
+            ValueError: If no usable format is found (should never happen
+                since 'plain' has no fallback and always works).
+        """
         current = format_name
-        visited: set[str] = set()
+        visited: set[str] = set()
         
-        while current and current not in visited:
+        while current and current not in visited:
             visited.add(current)
             registration = cls._formats.get(current)
-            if registration is None:
-                break
+            if registration is None:
+                break
             
             renderer = registration.renderer_factory(terminal_caps)
-            if renderer.can_render(terminal_caps):
+            if renderer.can_render(terminal_caps):
                 strategy = registration.strategy_factory(terminal_caps)
                 strategy.bind(renderer, terminal_caps=terminal_caps)
-                return strategy, renderer
+                return strategy, renderer
             
             current = registration.fallback
         
-        # Ultimate fallback is always plain
-        plain = cls._formats["plain"]
+        # Ultimate fallback is always plain
+        plain = cls._formats["plain"]
         renderer = plain.renderer_factory(terminal_caps)
         strategy = plain.strategy_factory(terminal_caps)
         strategy.bind(renderer, terminal_caps=terminal_caps)
-        return strategy, renderer
+        return strategy, renderer
     
-    @classmethod
-    def available_formats(cls) -> list[str]:
-        """Return all registered format names."""
-        return sorted(cls._formats.keys())
+    @classmethod
+    def available_formats(cls) -> list[str]:
+        """Return all registered format names."""
+        return sorted(cls._formats.keys())
     
-    @classmethod
-    def is_registered(cls, format_name: str) -> bool:
-        """Check if a format is registered."""
-        return format_name in cls._formats
-```
+    @classmethod
+    def is_registered(cls, format_name: str) -> bool:
+        """Check if a format is registered."""
+        return format_name in cls._formats
+
#### Terminal Capability Detection The framework detects terminal capabilities to guide format resolution, strategy selection, and renderer fallback: -```python -@dataclass -class TerminalCapabilities: - """Detected capabilities of the output terminal. +

+@dataclass
+class TerminalCapabilities:
+    """Detected capabilities of the output terminal.
+    
+    This dataclass is populated once at CLI startup and passed to the
+    RendererRegistry for format resolution. It is also available to
+    individual strategies and renderers for fine-grained adaptation
+    (e.g., adjusting column widths to terminal width, choosing between
+    256-color and truecolor palettes).
+    """
+    is_tty: bool                         # Is stdout a TTY?
+    width: int                           # Terminal width in columns
+    height: int                          # Terminal height in rows
+    supports_ansi: bool                  # Supports basic ANSI escape codes?
+    supports_256_color: bool             # Supports 256-color palette?
+    supports_truecolor: bool             # Supports 24-bit truecolor?
+    supports_unicode: bool               # Supports Unicode (box-drawing, etc.)?
+    supports_cursor_movement: bool       # Supports cursor repositioning?
+    supports_alternate_screen: bool      # Supports alternate screen buffer?
+    no_color: bool                       # Is NO_COLOR environment variable set?
+    term_program: str | None             # TERM_PROGRAM value (e.g., "iTerm2", "vscode")
     
-    This dataclass is populated once at CLI startup and passed to the
-    RendererRegistry for format resolution. It is also available to
-    individual strategies and renderers for fine-grained adaptation
-    (e.g., adjusting column widths to terminal width, choosing between
-    256-color and truecolor palettes).
-    """
-    is_tty: bool                         # Is stdout a TTY?
-    width: int                           # Terminal width in columns
-    height: int                          # Terminal height in rows
-    supports_ansi: bool                  # Supports basic ANSI escape codes?
-    supports_256_color: bool             # Supports 256-color palette?
-    supports_truecolor: bool             # Supports 24-bit truecolor?
-    supports_unicode: bool               # Supports Unicode (box-drawing, etc.)?
-    supports_cursor_movement: bool       # Supports cursor repositioning?
-    supports_alternate_screen: bool      # Supports alternate screen buffer?
-    no_color: bool                       # Is NO_COLOR environment variable set?
-    term_program: str | None             # TERM_PROGRAM value (e.g., "iTerm2", "vscode")
-    
-    @classmethod
-    def detect(cls) -> "TerminalCapabilities":
-        """Auto-detect terminal capabilities from the environment.
-        
-        Detection logic:
-        - is_tty: os.isatty(sys.stdout.fileno())
-        - width/height: os.get_terminal_size() with fallback to (80, 24)
-        - supports_ansi: True if is_tty and not Windows legacy console
-        - supports_256_color: True if TERM contains "256color" or COLORTERM is set
-        - supports_truecolor: True if COLORTERM is "truecolor" or "24bit"
-        - supports_unicode: True if locale encoding is UTF-8
-        - supports_cursor_movement: True if is_tty and TERM is not "dumb"
-        - supports_alternate_screen: True if supports_cursor_movement
-        - no_color: True if NO_COLOR environment variable is set (any value)
-        - term_program: Value of TERM_PROGRAM environment variable
-        """
+    @classmethod
+    def detect(cls) -> "TerminalCapabilities":
+        """Auto-detect terminal capabilities from the environment.
+        
+        Detection logic:
+        - is_tty: os.isatty(sys.stdout.fileno())
+        - width/height: os.get_terminal_size() with fallback to (80, 24)
+        - supports_ansi: True if is_tty and not Windows legacy console
+        - supports_256_color: True if TERM contains "256color" or COLORTERM is set
+        - supports_truecolor: True if COLORTERM is "truecolor" or "24bit"
+        - supports_unicode: True if locale encoding is UTF-8
+        - supports_cursor_movement: True if is_tty and TERM is not "dumb"
+        - supports_alternate_screen: True if supports_cursor_movement
+        - no_color: True if NO_COLOR environment variable is set (any value)
+        - term_program: Value of TERM_PROGRAM environment variable
+        """
         ...
-```
+
#### Plugin Format Registration Third-party plugins can register custom formats using the registry: -```python -# Example: Registering a custom 'csv' format plugin -from cleveragents.output import RendererRegistry, SequentialBufferMaterializer +

+# Example: Registering a custom 'csv' format plugin
+from cleveragents.output import RendererRegistry, SequentialBufferMaterializer
 
-class CsvElementRenderer(ElementRenderer):
-    """Renders tables as CSV, other elements as plain text."""
-    format_name = "csv"
+class CsvElementRenderer(ElementRenderer):
+    """Renders tables as CSV, other elements as plain text."""
+    format_name = "csv"
     
-    def render_table(self, table: Table, stream: IO) -> None:
+    def render_table(self, table: Table, stream: IO) -> None:
         writer = csv.writer(stream)
-        writer.writerow([col.name for col in table.columns])
-        for row in table.rows:
-            writer.writerow([row.get(col.name, "") for col in table.columns])
+        writer.writerow([col.name for col in table.columns])
+        for row in table.rows:
+            writer.writerow([row.get(col.name, "") for col in table.columns])
     
-    def can_render(self, terminal_caps: TerminalCapabilities) -> bool:
-        return True  # CSV works everywhere
+    def can_render(self, terminal_caps: TerminalCapabilities) -> bool:
+        return True  # CSV works everywhere
 
-# Register at plugin load time
+# Register at plugin load time
 RendererRegistry.register(
-    format_name="csv",
-    strategy_factory=lambda caps: SequentialBufferMaterializer(),
-    renderer_factory=lambda caps: CsvElementRenderer(),
-    fallback="plain",
+    format_name="csv",
+    strategy_factory=lambda caps: SequentialBufferMaterializer(),
+    renderer_factory=lambda caps: CsvElementRenderer(),
+    fallback="plain",
 )
-```
+
### Edge Cases and Special Behaviors @@ -5743,23 +5744,23 @@ RendererRegistry.register( Errors are rendered through the same framework. When a command raises an exception or signals an error, the session's context manager (`__exit__`) catches the exception, creates a `StatusMessage` with `level="error"` and an optional `TextBlock` with details, and closes the session with `exit_code=1`. In `json`/`yaml` formats, errors produce: -```json +

 {
-  "command": "project show",
-  "status": "error",
-  "exit_code": 1,
-  "error": {
-    "code": "NOT_FOUND",
-    "message": "Project 'local/nonexistent' not found",
-    "detail": "No project with name 'local/nonexistent' exists. Run 'agents project list' to see available projects.",
-    "suggestions": [
-      "agents project list",
-      "agents project create local/nonexistent"
+  "command": "project show",
+  "status": "error",
+  "exit_code": 1,
+  "error": {
+    "code": "NOT_FOUND",
+    "message": "Project 'local/nonexistent' not found",
+    "detail": "No project with name 'local/nonexistent' exists. Run 'agents project list' to see available projects.",
+    "suggestions": [
+      "agents project list",
+      "agents project create local/nonexistent"
     ]
   },
-  "timing": { "duration_ms": 5 }
+  "timing": { "duration_ms": 5 }
 }
-```
+
#### Empty Results @@ -5805,27 +5806,27 @@ When a producer encounters an error while writing to a handle (e.g., an API call Example of producer error handling: -```python -async def list_resources(session: OutputSession, client: ApiClient) -> None: - table = session.table("Resources", columns=[ - ColumnDef(name="Name"), ColumnDef(name="Type"), ColumnDef(name="Status"), +

+async def list_resources(session: OutputSession, client: ApiClient) -> None:
+    table = session.table("Resources", columns=[
+        ColumnDef(name="Name"), ColumnDef(name="Type"), ColumnDef(name="Status"),
     ])
     
-    try:
-        async for resource in client.list_resources():
+    try:
+        async for resource in client.list_resources():
             table.add_row({
-                "Name": resource.name,
-                "Type": resource.type,
-                "Status": resource.status,
+                "Name": resource.name,
+                "Type": resource.type,
+                "Status": resource.status,
             })
-    except ApiError as e:
-        table.close()  # Close with partial data
-        session.status(f"Error fetching resources: {e}", level="error")
-        return
+    except ApiError as e:
+        table.close()  # Close with partial data
+        session.status(f"Error fetching resources: {e}", level="error")
+        return
     
     table.close()
-    session.status(f"{table.element.row_count} resources listed", level="ok")
-```
+    session.status(f"{table.element.row_count} resources listed", level="ok")
+
#### Abandoned Handles @@ -5900,66 +5901,66 @@ The simplest usage — a command that creates elements, populates them synchrono **Producer code** (`agents project show`): -```python -async def cmd_project_show(session: OutputSession, project_name: str) -> None: - """Implementation of 'agents project show '.""" - project = await api.get_project(project_name) - resources = await api.list_project_resources(project.id) - validations = await api.list_project_validations(project.id) +

+async def cmd_project_show(session: OutputSession, project_name: str) -> None:
+    """Implementation of 'agents project show <project>'."""
+    project = await api.get_project(project_name)
+    resources = await api.list_project_resources(project.id)
+    validations = await api.list_project_validations(project.id)
     
-    # --- Build output elements ---
+    # --- Build output elements ---
     
-    # Panel: Project details
-    with session.panel("Project Details") as panel:
+    # Panel: Project details
+    with session.panel("Project Details") as panel:
         panel.set_entries({
-            "Name": project.name,
-            "ID": project.id,
-            "Description": project.description,
-            "Resources": str(len(resources)),
-            "Remote": "yes" if project.remote else "no",
-            "Created": project.created_at.strftime("%Y-%m-%d %H:%M"),
+            "Name": project.name,
+            "ID": project.id,
+            "Description": project.description,
+            "Resources": str(len(resources)),
+            "Remote": "yes" if project.remote else "no",
+            "Created": project.created_at.strftime("%Y-%m-%d %H:%M"),
         }, style_hints={
-            "Name": "identifier",
-            "Resources": "number",
-            "Remote": "success" if not project.remote else "info",
-            "Created": "success",
+            "Name": "identifier",
+            "Resources": "number",
+            "Remote": "success" if not project.remote else "info",
+            "Created": "success",
         })
     
-    # Table: Linked resources
-    with session.table("Linked Resources", columns=[
-        ColumnDef(name="Resource", type="string", style_hint="identifier"),
-        ColumnDef(name="Type"),
-        ColumnDef(name="Sandbox"),
-        ColumnDef(name="Read-Only"),
-    ]) as table:
-        for r in resources:
+    # Table: Linked resources
+    with session.table("Linked Resources", columns=[
+        ColumnDef(name="Resource", type="string", style_hint="identifier"),
+        ColumnDef(name="Type"),
+        ColumnDef(name="Sandbox"),
+        ColumnDef(name="Read-Only"),
+    ]) as table:
+        for r in resources:
             table.add_row({
-                "Resource": r.name,
-                "Type": r.type,
-                "Sandbox": r.sandbox_strategy,
-                "Read-Only": "yes" if r.read_only else "no",
+                "Resource": r.name,
+                "Type": r.type,
+                "Sandbox": r.sandbox_strategy,
+                "Read-Only": "yes" if r.read_only else "no",
             })
     
-    # Table: Validations
-    with session.table(f"Validations ({len(validations)})", columns=[
-        ColumnDef(name="ID", type="id", style_hint="identifier"),
-        ColumnDef(name="Command"),
-        ColumnDef(name="Mode"),
-    ]) as table:
-        for v in validations:
+    # Table: Validations
+    with session.table(f"Validations ({len(validations)})", columns=[
+        ColumnDef(name="ID", type="id", style_hint="identifier"),
+        ColumnDef(name="Command"),
+        ColumnDef(name="Mode"),
+    ]) as table:
+        for v in validations:
             table.add_row({
-                "ID": v.id,
-                "Command": v.command,
-                "Mode": v.mode,
+                "ID": v.id,
+                "Command": v.command,
+                "Mode": v.mode,
             })
     
-    # Status: Final message
-    session.status("Project loaded", level="ok")
-```
+    # Status: Final message
+    session.status("Project loaded", level="ok")
+
**What this produces in `plain` format:** -```text +

 Project Details
   Name: local/api-service
   ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1
@@ -5977,23 +5978,23 @@ Linked Resources
 Validations (3)
   ID           Command                                Mode
   -----------  -------------------------------------  -----------
-  val_01HXM5A  pytest --cov=src --cov-fail-under=80   required
+  val_01HXM5A  pytest --cov=src --cov-fail-under=80   required
   val_01HXM5B  ruff check .                           required
   val_01HXM5C  node scripts/check-bundle-size.js      informational
 
-[OK] Project loaded
-```
+[OK] Project loaded
+
**What this produces in `rich` format:**

 ╭─ Project Details ──────────────╮
 │ Name: local/api-service        │
-│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
-│ Description: Backend API       │
+│ ID: 01HXM4T08Y0N5R9VZ4QX4BPTZ1 │
+│ Description: Backend API       │
 │ Resources: 2                   │
-│ Remote: no                     │
-│ Created: 2026-02-08 12:46      │
+│ Remote: no                     │
+│ Created: 2026-02-08 12:46      │
 ╰────────────────────────────────╯
 
 ╭─ Linked Resources ──────────────────────────────────────────────────────╮
@@ -6006,68 +6007,68 @@ Validations (3)
 ╭─ Validations (3) ───────────────────────────────────────────────────╮
 │ ID           Command                                Mode           │
 │ ───────────  ─────────────────────────────────────  ───────────  │
-│ val_01HXM5A  pytest --cov=src --cov-fail-under=80   required     │
-│ val_01HXM5B  ruff check .                           required     │
+│ val_01HXM5A  pytest --cov=src --cov-fail-under=80   required     │
+│ val_01HXM5B  ruff check .                           required     │
 │ val_01HXM5C  node scripts/check-bundle-size.js      informational│
 ╰─────────────────────────────────────────────────────────────────────╯
 
-✓ OK Project loaded
+✓ OK Project loaded
 
**What this produces in `json` format:** -```json +

 {
-  "command": "project show",
-  "status": "ok",
-  "exit_code": 0,
-  "data": {
-    "project_details": {
-      "Name": "local/api-service",
-      "ID": "01HXM4T08Y0N5R9VZ4QX4BPTZ1",
-      "Description": "Backend API",
-      "Resources": "2",
-      "Remote": "no",
-      "Created": "2026-02-08 12:46"
+  "command": "project show",
+  "status": "ok",
+  "exit_code": 0,
+  "data": {
+    "project_details": {
+      "Name": "local/api-service",
+      "ID": "01HXM4T08Y0N5R9VZ4QX4BPTZ1",
+      "Description": "Backend API",
+      "Resources": "2",
+      "Remote": "no",
+      "Created": "2026-02-08 12:46"
     },
-    "linked_resources": [
+    "linked_resources": [
       {
-        "Resource": "local/api-repo",
-        "Type": "git-checkout",
-        "Sandbox": "git_worktree",
-        "Read-Only": "no"
+        "Resource": "local/api-repo",
+        "Type": "git-checkout",
+        "Sandbox": "git_worktree",
+        "Read-Only": "no"
       },
       {
-        "Resource": "local/staging-db",
-        "Type": "local/database",
-        "Sandbox": "transaction_rollback",
-        "Read-Only": "yes"
+        "Resource": "local/staging-db",
+        "Type": "local/database",
+        "Sandbox": "transaction_rollback",
+        "Read-Only": "yes"
       }
     ],
-    "validations": [
+    "validations": [
       {
-        "ID": "val_01HXM5A",
-        "Command": "pytest --cov=src --cov-fail-under=80",
-        "Mode": "required"
+        "ID": "val_01HXM5A",
+        "Command": "pytest --cov=src --cov-fail-under=80",
+        "Mode": "required"
       },
       {
-        "ID": "val_01HXM5B",
-        "Command": "ruff check .",
-        "Mode": "required"
+        "ID": "val_01HXM5B",
+        "Command": "ruff check .",
+        "Mode": "required"
       },
       {
-        "ID": "val_01HXM5C",
-        "Command": "node scripts/check-bundle-size.js",
-        "Mode": "informational"
+        "ID": "val_01HXM5C",
+        "Command": "node scripts/check-bundle-size.js",
+        "Mode": "informational"
       }
     ]
   },
-  "timing": { "duration_ms": 42 },
-  "messages": [
-    { "level": "ok", "text": "Project loaded" }
+  "timing": { "duration_ms": 42 },
+  "messages": [
+    { "level": "ok", "text": "Project loaded" }
   ]
 }
-```
+
In all three formats, the producer code is **identical**. The `OutputSession` and its materialization strategy handle the differences transparently. @@ -6077,54 +6078,54 @@ A command that streams rows into a table as results arrive from a paginated API. **Producer code** (`agents resource list`): -```python -async def cmd_resource_list(session: OutputSession, project: str | None) -> None: - """Implementation of 'agents resource list'.""" +

+async def cmd_resource_list(session: OutputSession, project: str | None) -> None:
+    """Implementation of 'agents resource list'."""
     
-    # Create the table handle — it will accumulate rows as we stream them
-    table = session.table("Resources", columns=[
-        ColumnDef(name="Name", type="string", style_hint="identifier"),
-        ColumnDef(name="Type"),
-        ColumnDef(name="Project"),
-        ColumnDef(name="Sandbox"),
-        ColumnDef(name="Status"),
-    ], sort_key="Name")
+    # Create the table handle — it will accumulate rows as we stream them
+    table = session.table("Resources", columns=[
+        ColumnDef(name="Name", type="string", style_hint="identifier"),
+        ColumnDef(name="Type"),
+        ColumnDef(name="Project"),
+        ColumnDef(name="Sandbox"),
+        ColumnDef(name="Status"),
+    ], sort_key="Name")
     
-    # Create a progress indicator for the fetch operation
-    progress = session.progress("Fetching resources...", indeterminate=True)
+    # Create a progress indicator for the fetch operation
+    progress = session.progress("Fetching resources...", indeterminate=True)
     
-    # Stream pages from the API
+    # Stream pages from the API
     count = 0
-    async for page in api.list_resources_paginated(project=project):
-        for resource in page.items:
+    async for page in api.list_resources_paginated(project=project):
+        for resource in page.items:
             table.add_row({
-                "Name": resource.name,
-                "Type": resource.type,
-                "Project": resource.project,
-                "Sandbox": resource.sandbox_strategy,
-                "Status": resource.status,
+                "Name": resource.name,
+                "Type": resource.type,
+                "Project": resource.project,
+                "Sandbox": resource.sandbox_strategy,
+                "Status": resource.status,
             })
             count += 1
         
-        # Update progress label with count so far
-        progress.set_label(f"Fetching resources... ({count} found)")
+        # Update progress label with count so far
+        progress.set_label(f"Fetching resources... ({count} found)")
     
-    # Close the progress indicator (it has served its purpose)
+    # Close the progress indicator (it has served its purpose)
     progress.close()
     
-    # Set summary and close the table
-    table.set_summary({"total": count})
+    # Set summary and close the table
+    table.set_summary({"total": count})
     table.close()
     
-    # Final status
-    session.status(f"{count} resources listed", level="ok")
-```
+    # Final status
+    session.status(f"{count} resources listed", level="ok")
+
**What this looks like in `plain` format** (SequentialBufferMaterializer): The progress indicator is rendered as a static line. The table is buffered until `table.close()` is called, then rendered in full. The user sees nothing until the fetch is complete — then the entire result appears at once: -```text +

 Fetching resources... (47 found) [done]
 
 Resources
@@ -6137,8 +6138,8 @@ Resources
 
   Total: 47
 
-[OK] 47 resources listed
-```
+[OK] 47 resources listed
+
**What this looks like in `rich` format** (LiveMaterializer): @@ -6150,11 +6151,11 @@ The progress spinner animates in real-time. The table updates in-place as rows a ╭─ Resources ─────────────────────────────────────────────────────────────────╮ │ Name Type Project Sandbox Status │ │ ──────────────────── ────────────── ───────────────── ──────────────────── ────── │ -│ local/api-repo git-checkout local/api-service git_worktree active │ -│ local/staging-db local/database local/api-service transaction_rollback active │ -│ local/docs-repo git-checkout local/docs-site git_worktree active │ +│ local/api-repo git-checkout local/api-service git_worktree active │ +│ local/staging-db local/database local/api-service transaction_rollback active │ +│ local/docs-repo git-checkout local/docs-site git_worktree active │ │ ... │ -│ local/test-fixtures git-checkout local/api-service git_worktree active │ +│ local/test-fixtures git-checkout local/api-service git_worktree active │ │ │ │ Showing 1-23 of 23 (fetching...) │ ╰───────────────────────────────────────────────────────────────────────────────────────╯ @@ -6168,94 +6169,94 @@ This is the key motivating example for the reactive architecture. Two tables are **Producer code** (`agents plan status` — showing resources and active tool calls concurrently): -```python -async def cmd_plan_status(session: OutputSession, plan_id: str) -> None: - """Implementation of 'agents plan status '. +

+async def cmd_plan_status(session: OutputSession, plan_id: str) -> None:
+    """Implementation of 'agents plan status <plan_id>'.
+    
+    This command fetches plan metadata, then concurrently streams two data
+    sources: resource statuses and active tool call logs. Both data sources
+    are long-running — they produce results over several seconds as the
+    backend resolves each item.
+    """
+    plan = await api.get_plan(plan_id)
     
-    This command fetches plan metadata, then concurrently streams two data
-    sources: resource statuses and active tool call logs. Both data sources
-    are long-running — they produce results over several seconds as the
-    backend resolves each item.
-    """
-    plan = await api.get_plan(plan_id)
-    
-    # Panel: Plan metadata (created and closed synchronously)
-    with session.panel("Plan") as panel:
+    # Panel: Plan metadata (created and closed synchronously)
+    with session.panel("Plan") as panel:
         panel.set_entries({
-            "Plan ID": plan.id,
-            "Phase": plan.phase,
-            "State": plan.state,
-            "Action": plan.action,
-            "Project": plan.project,
-            "Started": plan.started_at.strftime("%H:%M:%S"),
+            "Plan ID": plan.id,
+            "Phase": plan.phase,
+            "State": plan.state,
+            "Action": plan.action,
+            "Project": plan.project,
+            "Started": plan.started_at.strftime("%H:%M:%S"),
         }, style_hints={
-            "Plan ID": "identifier",
-            "Phase": "info",
-            "State": "warning" if plan.state == "processing" else "success",
+            "Plan ID": "identifier",
+            "Phase": "info",
+            "State": "warning" if plan.state == "processing" else "success",
         })
     
-    # Create both table handles BEFORE starting concurrent producers.
-    # Declaration order determines rendering order in sequential formats.
-    resource_table = session.table("Resource Status", columns=[
-        ColumnDef(name="Resource", style_hint="identifier"),
-        ColumnDef(name="Type"),
-        ColumnDef(name="Status"),
-        ColumnDef(name="Latency", type="string", alignment="right"),
+    # Create both table handles BEFORE starting concurrent producers.
+    # Declaration order determines rendering order in sequential formats.
+    resource_table = session.table("Resource Status", columns=[
+        ColumnDef(name="Resource", style_hint="identifier"),
+        ColumnDef(name="Type"),
+        ColumnDef(name="Status"),
+        ColumnDef(name="Latency", type="string", alignment="right"),
     ])
     
-    tool_table = session.table("Tool Call Log", columns=[
-        ColumnDef(name="#", type="number", alignment="right"),
-        ColumnDef(name="Tool"),
-        ColumnDef(name="Target"),
-        ColumnDef(name="Result"),
-        ColumnDef(name="Duration", type="string", alignment="right"),
+    tool_table = session.table("Tool Call Log", columns=[
+        ColumnDef(name="#", type="number", alignment="right"),
+        ColumnDef(name="Tool"),
+        ColumnDef(name="Target"),
+        ColumnDef(name="Result"),
+        ColumnDef(name="Duration", type="string", alignment="right"),
     ])
     
-    # --- Run two producers concurrently ---
-    # Each producer writes to its own handle. Neither producer knows
-    # which format is active. The materialization strategy handles
-    # the coordination.
+    # --- Run two producers concurrently ---
+    # Each producer writes to its own handle. Neither producer knows
+    # which format is active. The materialization strategy handles
+    # the coordination.
     
-    async def stream_resources():
-        """Producer A: streams resource status checks."""
-        async for status in api.stream_resource_statuses(plan.id):
+    async def stream_resources():
+        """Producer A: streams resource status checks."""
+        async for status in api.stream_resource_statuses(plan.id):
             resource_table.add_row({
-                "Resource": status.resource_name,
-                "Type": status.resource_type,
-                "Status": status.status,
-                "Latency": f"{status.latency_ms}ms",
+                "Resource": status.resource_name,
+                "Type": status.resource_type,
+                "Status": status.status,
+                "Latency": f"{status.latency_ms}ms",
             })
         resource_table.close()
     
-    async def stream_tool_calls():
-        """Producer B: streams tool call results."""
-        async for call in api.stream_tool_calls(plan.id):
+    async def stream_tool_calls():
+        """Producer B: streams tool call results."""
+        async for call in api.stream_tool_calls(plan.id):
             tool_table.add_row({
-                "#": call.sequence_number,
-                "Tool": call.tool_name,
-                "Target": call.target,
-                "Result": call.result_summary,
-                "Duration": f"{call.duration_ms}ms",
+                "#": call.sequence_number,
+                "Tool": call.tool_name,
+                "Target": call.target,
+                "Result": call.result_summary,
+                "Duration": f"{call.duration_ms}ms",
             })
         tool_table.close()
     
-    # Launch both producers concurrently
-    await asyncio.gather(stream_resources(), stream_tool_calls())
+    # Launch both producers concurrently
+    await asyncio.gather(stream_resources(), stream_tool_calls())
     
-    # Final status
-    session.status(f"Plan {plan_id} status retrieved", level="ok")
-```
+    # Final status
+    session.status(f"Plan {plan_id} status retrieved", level="ok")
+
**What this produces in `plain` format** (SequentialBufferMaterializer): Both tables are populated concurrently, but the materializer buffers each one and renders them in **declaration order** when their handles close. The user sees nothing until the first-declared table (Resource Status) closes, then it prints. Then when the second table (Tool Call Log) closes, it prints. Data may have arrived interleaved across both tables, but the output is perfectly sequential: -```text +

 Plan
   Plan ID: 01HXM7A9
   Phase: execute
   State: processing
-  Action: local/code-coverage
+  Action: local/code-coverage
   Project: local/api-service
   Started: 12:58:10
 
@@ -6274,8 +6275,8 @@ Tool Call Log
    4  edit_file   src/auth/session.py     12 lines +/-   0.3s
    5  run_tests   pytest tests/test_auth  3 passed       2.1s
 
-[OK] Plan 01HXM7A9 status retrieved
-```
+[OK] Plan 01HXM7A9 status retrieved
+
**What this produces in `rich` format** (LiveMaterializer): @@ -6284,18 +6285,18 @@ Both tables are visible simultaneously and update in-place as data arrives. This

 ╭─ Plan ──────────────────────────────╮
 │ Plan ID: 01HXM7A9                   │
-│ Phase: execute                     │
+│ Phase: execute                     │
 │ State: processing                  │
-│ Action: local/code-coverage         │
-│ Project: local/api-service          │
-│ Started: 12:58:10                   │
+│ Action: local/code-coverage         │
+│ Project: local/api-service          │
+│ Started: 12:58:10                   │
 ╰─────────────────────────────────────╯
 
 ╭─ Resource Status  ───────────────────────────────────────────╮
 │ Resource          Type            Status   Latency        │
 │ ────────────────  ──────────────  ───────  ───────        │
-│ local/api-repo    git-checkout    ready    42ms           │
-│ local/staging-db  local/database  ready    128ms          │
+│ local/api-repo    git-checkout    ready    42ms           │
+│ local/staging-db  local/database  ready    128ms          │
 │                                                              │
 │ 2 resources (streaming...)                                  │
 ╰──────────────────────────────────────────────────────────────╯
@@ -6303,9 +6304,9 @@ Both tables are visible simultaneously and update in-place as data arrives. This
 ╭─ Tool Call Log  ────────────────────────────────────────────────────╮
 │ #   Tool        Target                  Result         Duration   │
 │ ──  ──────────  ──────────────────────  ─────────────  ────────   │
-│  1  read_file   src/auth/__init__.py    200 lines      0.1s       │
-│  2  read_file   src/auth/session.py     340 lines      0.1s       │
-│  3  write_file  tests/test_auth.py      created        0.2s       │
+│  1  read_file   src/auth/__init__.py    200 lines      0.1s       │
+│  2  read_file   src/auth/session.py     340 lines      0.1s       │
+│  3  write_file  tests/test_auth.py      created        0.2s       │
 │                                                                      │
 │ 3 calls (streaming...)                                              │
 ╰──────────────────────────────────────────────────────────────────────╯
@@ -6317,38 +6318,38 @@ In `rich` mode, both tables have animated spinners in their titles indicating ac
 
 Nothing is printed until the session closes. Then the complete accumulated state is serialized:
 
-```json
+

 {
-  "command": "plan status",
-  "status": "ok",
-  "exit_code": 0,
-  "data": {
-    "plan": {
-      "Plan ID": "01HXM7A9",
-      "Phase": "execute",
-      "State": "processing",
-      "Action": "local/code-coverage",
-      "Project": "local/api-service",
-      "Started": "12:58:10"
+  "command": "plan status",
+  "status": "ok",
+  "exit_code": 0,
+  "data": {
+    "plan": {
+      "Plan ID": "01HXM7A9",
+      "Phase": "execute",
+      "State": "processing",
+      "Action": "local/code-coverage",
+      "Project": "local/api-service",
+      "Started": "12:58:10"
     },
-    "resource_status": [
-      { "Resource": "local/api-repo", "Type": "git-checkout", "Status": "ready", "Latency": "42ms" },
-      { "Resource": "local/staging-db", "Type": "local/database", "Status": "ready", "Latency": "128ms" }
+    "resource_status": [
+      { "Resource": "local/api-repo", "Type": "git-checkout", "Status": "ready", "Latency": "42ms" },
+      { "Resource": "local/staging-db", "Type": "local/database", "Status": "ready", "Latency": "128ms" }
     ],
-    "tool_call_log": [
-      { "#": 1, "Tool": "read_file", "Target": "src/auth/__init__.py", "Result": "200 lines", "Duration": "0.1s" },
-      { "#": 2, "Tool": "read_file", "Target": "src/auth/session.py", "Result": "340 lines", "Duration": "0.1s" },
-      { "#": 3, "Tool": "write_file", "Target": "tests/test_auth.py", "Result": "created", "Duration": "0.2s" },
-      { "#": 4, "Tool": "edit_file", "Target": "src/auth/session.py", "Result": "12 lines +/-", "Duration": "0.3s" },
-      { "#": 5, "Tool": "run_tests", "Target": "pytest tests/test_auth", "Result": "3 passed", "Duration": "2.1s" }
+    "tool_call_log": [
+      { "#": 1, "Tool": "read_file", "Target": "src/auth/__init__.py", "Result": "200 lines", "Duration": "0.1s" },
+      { "#": 2, "Tool": "read_file", "Target": "src/auth/session.py", "Result": "340 lines", "Duration": "0.1s" },
+      { "#": 3, "Tool": "write_file", "Target": "tests/test_auth.py", "Result": "created", "Duration": "0.2s" },
+      { "#": 4, "Tool": "edit_file", "Target": "src/auth/session.py", "Result": "12 lines +/-", "Duration": "0.3s" },
+      { "#": 5, "Tool": "run_tests", "Target": "pytest tests/test_auth", "Result": "3 passed", "Duration": "2.1s" }
     ]
   },
-  "timing": { "duration_ms": 3200 },
-  "messages": [
-    { "level": "ok", "text": "Plan 01HXM7A9 status retrieved" }
+  "timing": { "duration_ms": 3200 },
+  "messages": [
+    { "level": "ok", "text": "Plan 01HXM7A9 status retrieved" }
   ]
 }
-```
+
The critical point: **the producer code in all three formats is exactly the same**. The `asyncio.gather` call runs both producers concurrently regardless of format. The materialization strategy — `LiveMaterializer`, `SequentialBufferMaterializer`, or `AccumulateMaterializer` — transparently decides how that concurrent data reaches the user. @@ -6358,81 +6359,81 @@ A command that executes a multi-step process with a progress indicator, where so **Producer code** (`agents plan execute`): -```python -async def cmd_plan_execute(session: OutputSession, plan_id: str) -> None: - """Implementation of 'agents plan execute '.""" - plan = await api.get_plan(plan_id) +

+async def cmd_plan_execute(session: OutputSession, plan_id: str) -> None:
+    """Implementation of 'agents plan execute <plan_id>'."""
+    plan = await api.get_plan(plan_id)
     
-    # Panel: Execution metadata
-    with session.panel("Execution") as panel:
+    # Panel: Execution metadata
+    with session.panel("Execution") as panel:
         panel.set_entries({
-            "Plan": plan.id,
-            "Phase": "execute",
-            "Sandbox": plan.sandbox_strategy,
-            "Worker": plan.worker,
-            "Started": datetime.now().strftime("%H:%M:%S"),
+            "Plan": plan.id,
+            "Phase": "execute",
+            "Sandbox": plan.sandbox_strategy,
+            "Worker": plan.worker,
+            "Started": datetime.now().strftime("%H:%M:%S"),
         })
     
-    # Progress indicator with named steps
-    progress = session.progress("Executing plan", total=4, steps=[
-        "Collect context",
-        "Run tools",
-        "Build changeset",
-        "Validate",
+    # Progress indicator with named steps
+    progress = session.progress("Executing plan", total=4, steps=[
+        "Collect context",
+        "Run tools",
+        "Build changeset",
+        "Validate",
     ])
     
-    # Step 1: Collect context
-    progress.set_step_status("Collect context", "active")
-    context = await api.collect_context(plan.id)
-    progress.set_step_status("Collect context", "done")
+    # Step 1: Collect context
+    progress.set_step_status("Collect context", "active")
+    context = await api.collect_context(plan.id)
+    progress.set_step_status("Collect context", "done")
     progress.set_progress(1, 4)
     
-    # Step 2: Run tools (parallel sub-operations)
-    progress.set_step_status("Run tools", "active")
-    tool_results = await api.run_tools(plan.id, context)
-    progress.set_step_status("Run tools", "done")
+    # Step 2: Run tools (parallel sub-operations)
+    progress.set_step_status("Run tools", "active")
+    tool_results = await api.run_tools(plan.id, context)
+    progress.set_step_status("Run tools", "done")
     progress.set_progress(2, 4)
     
-    # Step 3: Build changeset
-    progress.set_step_status("Build changeset", "active")
-    changeset = await api.build_changeset(plan.id, tool_results)
-    progress.set_step_status("Build changeset", "done")
+    # Step 3: Build changeset
+    progress.set_step_status("Build changeset", "active")
+    changeset = await api.build_changeset(plan.id, tool_results)
+    progress.set_step_status("Build changeset", "done")
     progress.set_progress(3, 4)
     
-    # Step 4: Validate
-    progress.set_step_status("Validate", "active")
-    validation = await api.validate_changeset(plan.id, changeset)
-    progress.set_step_status("Validate", "done")
+    # Step 4: Validate
+    progress.set_step_status("Validate", "active")
+    validation = await api.validate_changeset(plan.id, changeset)
+    progress.set_step_status("Validate", "done")
     progress.set_progress(4, 4)
     
     progress.close()
     
-    # Summary panel
-    with session.panel("Strategy Summary") as panel:
+    # Summary panel
+    with session.panel("Strategy Summary") as panel:
         panel.set_entries({
-            "Decisions": str(changeset.decision_count),
-            "Invariants": str(changeset.invariant_count),
-            "Planned Child Plans": f"{changeset.child_plan_count}+",
-            "Estimated Files": f"~{changeset.file_count}",
-            "Risk": changeset.risk_level,
+            "Decisions": str(changeset.decision_count),
+            "Invariants": str(changeset.invariant_count),
+            "Planned Child Plans": f"{changeset.child_plan_count}+",
+            "Estimated Files": f"~{changeset.file_count}",
+            "Risk": changeset.risk_level,
         })
     
-    # Final status
-    if validation.passed:
-        session.status("Execution complete — all validations passed", level="ok")
-    else:
+    # Final status
+    if validation.passed:
+        session.status("Execution complete — all validations passed", level="ok")
+    else:
         session.status(
-            f"Execution complete — {validation.failure_count} validation(s) failed",
-            level="warn",
+            f"Execution complete — {validation.failure_count} validation(s) failed",
+            level="warn",
             detail=validation.summary,
         )
-```
+
**What this looks like in `plain` format:** The progress indicator renders as a static step list. Since `SequentialBufferMaterializer` buffers each element until its handle closes, the progress indicator is not visible during execution — it appears as a completed snapshot after the fact: -```text +

 Execution
   Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J
   Phase: execute
@@ -6453,8 +6454,8 @@ Strategy Summary
   Estimated Files: ~12
   Risk: low
 
-[OK] Execution complete — all validations passed
-```
+[OK] Execution complete — all validations passed
+
**What this looks like in `rich` format:** @@ -6465,13 +6466,13 @@ The progress indicator is live — the spinner animates, the progress bar fills, │ Plan: 01HXM8C2ZK4Q7C2B3F2R4VYV6J │ │ Phase: execute │ │ Sandbox: git_worktree │ -│ Worker: local/executor │ -│ Started: 12:58:10 │ +│ Worker: local/executor │ +│ Started: 12:58:10 │ ╰──────────────────────────────────╯ -Executing plan ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50% elapsed 0:00:13 - Collect context .................. 0.8s - Run tools ...................... 12.4s +Executing plan ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 50% elapsed 0:00:13 + Collect context .................. 0.8s + Run tools ...................... 12.4s Build changeset ................. (running) Validate ........................ (pending)
@@ -6484,80 +6485,80 @@ A command where one of multiple concurrent producers fails, demonstrating gracef **Producer code** (hypothetical `agents resource verify`): -```python -async def cmd_resource_verify(session: OutputSession, project: str) -> None: - """Verify all resources in a project. Some verifications may fail.""" - resources = await api.list_project_resources(project) +

+async def cmd_resource_verify(session: OutputSession, project: str) -> None:
+    """Verify all resources in a project. Some verifications may fail."""
+    resources = await api.list_project_resources(project)
     
-    # Create a table that will be populated concurrently
-    results_table = session.table("Verification Results", columns=[
-        ColumnDef(name="Resource", style_hint="identifier"),
-        ColumnDef(name="Type"),
-        ColumnDef(name="Check"),
-        ColumnDef(name="Status"),
-        ColumnDef(name="Detail"),
+    # Create a table that will be populated concurrently
+    results_table = session.table("Verification Results", columns=[
+        ColumnDef(name="Resource", style_hint="identifier"),
+        ColumnDef(name="Type"),
+        ColumnDef(name="Check"),
+        ColumnDef(name="Status"),
+        ColumnDef(name="Detail"),
     ])
     
-    # Progress indicator
+    # Progress indicator
     progress = session.progress(
-        "Verifying resources",
+        "Verifying resources",
         total=len(resources),
-        steps=[r.name for r in resources],
+        steps=[r.name for r in resources],
     )
     
-    # Verify each resource concurrently
-    async def verify_one(resource):
-        progress.set_step_status(resource.name, "active")
-        try:
-            result = await api.verify_resource(resource.id)
+    # Verify each resource concurrently
+    async def verify_one(resource):
+        progress.set_step_status(resource.name, "active")
+        try:
+            result = await api.verify_resource(resource.id)
             results_table.add_row({
-                "Resource": resource.name,
-                "Type": resource.type,
-                "Check": result.check_name,
-                "Status": "pass" if result.passed else "fail",
-                "Detail": result.detail,
+                "Resource": resource.name,
+                "Type": resource.type,
+                "Check": result.check_name,
+                "Status": "pass" if result.passed else "fail",
+                "Detail": result.detail,
             })
             progress.set_step_status(
                 resource.name,
-                "done" if result.passed else "error",
+                "done" if result.passed else "error",
             )
-        except ApiError as e:
+        except ApiError as e:
             results_table.add_row({
-                "Resource": resource.name,
-                "Type": resource.type,
-                "Check": "connection",
-                "Status": "error",
-                "Detail": str(e),
+                "Resource": resource.name,
+                "Type": resource.type,
+                "Check": "connection",
+                "Status": "error",
+                "Detail": str(e),
             })
-            progress.set_step_status(resource.name, "error")
+            progress.set_step_status(resource.name, "error")
         progress.increment()
     
-    # Launch all verifications concurrently
-    await asyncio.gather(
-        *[verify_one(r) for r in resources],
-        return_exceptions=True,  # Don't fail fast — collect all results
+    # Launch all verifications concurrently
+    await asyncio.gather(
+        *[verify_one(r) for r in resources],
+        return_exceptions=True,  # Don't fail fast — collect all results
     )
     
     progress.close()
     results_table.close()
     
-    # Summarize
+    # Summarize
     snapshot = results_table.element
-    pass_count = sum(1 for r in snapshot.rows if r["Status"] == "pass")
-    fail_count = sum(1 for r in snapshot.rows if r["Status"] in ("fail", "error"))
+    pass_count = sum(1 for r in snapshot.rows if r["Status"] == "pass")
+    fail_count = sum(1 for r in snapshot.rows if r["Status"] in ("fail", "error"))
     
-    if fail_count == 0:
-        session.status(f"All {pass_count} resources verified", level="ok")
-    else:
+    if fail_count == 0:
+        session.status(f"All {pass_count} resources verified", level="ok")
+    else:
         session.status(
-            f"{fail_count} of {pass_count + fail_count} resources failed verification",
-            level="error",
+            f"{fail_count} of {pass_count + fail_count} resources failed verification",
+            level="error",
         )
-```
+
**What this produces in `plain` format** (after all concurrent verifications complete): -```text +

 Verifying resources  [3/3]
   [x] local/api-repo
   [!] local/staging-db
@@ -6570,56 +6571,56 @@ Verification Results
   local/staging-db  local/database  connection  error   Connection refused (port 5432)
   local/docs-repo   git-checkout    integrity   pass    All refs valid
 
-[ERROR] 1 of 3 resources failed verification
-```
+[ERROR] 1 of 3 resources failed verification
+
**What this produces in `color` format:**

 Verifying resources  [3/3]
-  [x] local/api-repo
-  [!] local/staging-db
-  [x] local/docs-repo
+  [x] local/api-repo
+  [!] local/staging-db
+  [x] local/docs-repo
 
 Verification Results
   Resource          Type            Check       Status  Detail
   ----------------  --------------  ----------  ------  ----------------------------------
-  local/api-repo    git-checkout    integrity   pass    All refs valid
-  local/staging-db  local/database  connection  error   Connection refused (port 5432)
-  local/docs-repo   git-checkout    integrity   pass    All refs valid
+  local/api-repo    git-checkout    integrity   pass    All refs valid
+  local/staging-db  local/database  connection  error   Connection refused (port 5432)
+  local/docs-repo   git-checkout    integrity   pass    All refs valid
 
-[ERROR] 1 of 3 resources failed verification
+[ERROR] 1 of 3 resources failed verification
 
**What this produces in `yaml` format:** -```yaml -command: resource verify -status: error -exit_code: 1 -data: - verification_results: - - Resource: local/api-repo - Type: git-checkout - Check: integrity - Status: pass - Detail: All refs valid - - Resource: local/staging-db - Type: local/database - Check: connection - Status: error - Detail: "Connection refused (port 5432)" - - Resource: local/docs-repo - Type: git-checkout - Check: integrity - Status: pass - Detail: All refs valid -timing: - duration_ms: 2840 -messages: - - level: error - text: "1 of 3 resources failed verification" -``` +

+command: resource verify
+status: error
+exit_code: 1
+data:
+  verification_results:
+    - Resource: local/api-repo
+      Type: git-checkout
+      Check: integrity
+      Status: pass
+      Detail: All refs valid
+    - Resource: local/staging-db
+      Type: local/database
+      Check: connection
+      Status: error
+      Detail: "Connection refused (port 5432)"
+    - Resource: local/docs-repo
+      Type: git-checkout
+      Check: integrity
+      Status: pass
+      Detail: All refs valid
+timing:
+  duration_ms: 2840
+messages:
+  - level: error
+    text: "1 of 3 resources failed verification"
+
In all formats, the concurrent verification produces a complete result set with partial failures clearly visible. The producer code uses `return_exceptions=True` on `asyncio.gather` to ensure all verifications complete even if some fail, and the error handling within each `verify_one` coroutine ensures that failures are recorded as table rows rather than causing the entire command to abort. @@ -6731,67 +6732,67 @@ At each level, only the relevant context is loaded. The persistent decision grap In the actor definition for the execution actor, tool nodes can directly invoke registered tools to trigger child plans. The `local/create-subplan` tool is independently registered and referenced by name in the actor graph node. During execution, `subplan_spawn` decisions are realized as actual child plans, and `subplan_parallel_spawn` groups trigger concurrent spawning of all enclosed child plans. -```yaml -# Example: Execution actor with subplan spawning capability. -# The graph uses a tool node referencing a named registered tool. -actors: - code_executor: - type: graph - config: - actor: anthropic/claude-3-opus - skills: +

+# Example: Execution actor with subplan spawning capability.
+# The graph uses a tool node referencing a named registered tool.
+actors:
+  code_executor:
+    type: graph
+    config:
+      actor: anthropic/claude-3-opus
+    skills:
       - local/plan-tools          # Skill containing create_subplan for LLM tool-calling
       - local/file-ops
-    routes:
-      execute_workflow:
-        nodes:
-          - name: spawn_test_subplan
-            type: tool
-            tool: local/create-subplan   # Named tool from Tool Registry
-```
+    routes:
+      execute_workflow:
+        nodes:
+          - name: spawn_test_subplan
+            type: tool
+            tool: local/create-subplan # Named tool from Tool Registry
+
The `local/create-subplan` tool is independently registered via its own YAML configuration file: -```yaml -# File: tools/create-subplan.yaml -cleveragents: - version: "3.0" +

+# File: tools/create-subplan.yaml
+cleveragents:
+  version: "3.0"
 
-tool:
-  name: local/create-subplan
-  description: "Spawn a subplan for a given action"
-  source: custom
+tool:
+  name: local/create-subplan
+  description: "Spawn a subplan for a given action"
+  source: custom
 
-  input_schema:
-    type: object
-    properties:
-      action: { type: string }
-      target_files: { type: array, items: { type: string } }
-    required: [action]
+  input_schema:
+    type: object
+    properties:
+      action: { type: string }
+      target_files: { type: array, items: { type: string } }
+    required: [action]
 
-  capability:
-    writes: true
-    checkpointable: false
-    side_effects: [spawn_subplan]
+  capability:
+    writes: true
+    checkpointable: false
+    side_effects: [spawn_subplan]
 
-  code: |
+  code: |
     subplan = ctx.spawn_subplan(
-        action=params["action"],
-        target_files=params.get("target_files", [])
+        action=params["action"],
+        target_files=params.get("target_files", [])
     )
-    return {"subplan_id": subplan.id}
-```
+    return {"subplan_id": subplan.id}
+
The `local/plan-tools` skill references this tool (and others) by name: -```yaml -# File: skills/plan-tools.yaml -skill: - name: local/plan-tools - description: "Tools for spawning and managing subplans" - tools: +

+# File: skills/plan-tools.yaml
+skill:
+  name: local/plan-tools
+  description: "Tools for spawning and managing subplans"
+  tools:
     - local/create-subplan
-```
+
##### Child Plan Execution Modes @@ -6859,7 +6860,7 @@ When **automation allows automatic decisions**, the strategy actor uses its best When **user input is required**, the system pauses and prompts the user: -``` +

 Decision required: Which modules should be prioritized for test coverage?
 
 Options identified by the strategy actor:
@@ -6868,7 +6869,7 @@ Options identified by the strategy actor:
   3. user module (currently 71% coverage, medium risk)
 
 Your choice (or provide custom guidance): _
-```
+
##### The Prompt as the Root Decision @@ -6884,33 +6885,33 @@ This is important because: 4. **Unified correction mechanism**: Since the prompt, invariants, and all other decisions are part of the same tree, correcting any of them uses the same `agents plan correct` command. -```text +

 Plan: 01KH29QDEE6DZTXKWNKCV8VP0F
-├── [prompt_definition] "Increase test coverage to 85% for the whole project."
-├── [invariant_enforced] "Prioritize all functionality related to financial transactions and user management"
-├── [invariant_enforced] "All API calls over TCP must be mocked"
-├── [strategy_choice] "Prioritize auth and payment modules, implement them in parallel before the rest"
-├── [subplan_parallel_spawn] "Implement auth and payment modules, in parallel"
-│   ├── [subplan_spawn] "Write tests for auth module"
+├── [prompt_definition] "Increase test coverage to 85% for the whole project."
+├── [invariant_enforced] "Prioritize all functionality related to financial transactions and user management"
+├── [invariant_enforced] "All API calls over TCP must be mocked"
+├── [strategy_choice] "Prioritize auth and payment modules, implement them in parallel before the rest"
+├── [subplan_parallel_spawn] "Implement auth and payment modules, in parallel"
+│   ├── [subplan_spawn] "Write tests for auth module"
 │   │   └── Plan: 01KH29R8WPKPBHRY7Q0NA9XW86
-│   │       ├── [prompt_definition] "Write unit tests for auth module using mocks for the remote API calls"
-│   │       ├── [implementation_choice] "Test login flow first"
+│   │       ├── [prompt_definition] "Write unit tests for auth module using mocks for the remote API calls"
+│   │       ├── [implementation_choice] "Test login flow first"
 │   │       └── ...
-│   └── [subplan_spawn] "Write tests for payment module"
+│   └── [subplan_spawn] "Write tests for payment module"
 │       └── Plan: 01KH29RN2YKSXMTBDG82AKRHRA
-│           ├── [prompt_definition] "Write unit tests for payment module using"
+│           ├── [prompt_definition] "Write unit tests for payment module using"
 │           └── ...
-└── [subplan_parallel_spawn] "Write tests for all modules except the auth and payment modules"
+└── [subplan_parallel_spawn] "Write tests for all modules except the auth and payment modules"
     └──  ...
-```
+
##### Correcting Decisions (Including Prompts) All corrections use the same unified command: -```bash -agents plan correct --mode= --guidance "" -``` +

+agents plan correct <decision_id> --mode=<mode> --guidance "<corrected decision text>"
+
**Parameters:** * ``: The ULID of the decision to correct @@ -6919,33 +6920,33 @@ agents plan correct --mode= --guidance "

+# Correct a strategy choice
+agents plan correct 01ARZ3NDEKTSV4RRFFQ69G5FAV --mode=revert \
+  --guidance "Prioritize the payment module first, not auth, due to upcoming deadline"
 
-# Correct the root prompt to be more specific
-agents plan tree 
-# Shows: [prompt_definition] id=01ARZ3NDEKTSV4RRFFQ69G5FAV "Increase test coverage to 85%"
+# Correct the root prompt to be more specific
+agents plan tree <plan_id>
+# Shows: [prompt_definition] id=01ARZ3NDEKTSV4RRFFQ69G5FAV "Increase test coverage to 85%"
 
-agents plan correct 01ARZ3NDEKTSV4RRFFQ69G5FAV --mode=revert \
-  --guidance "Increase test coverage to 85%, prioritizing auth and payment modules. Use mocks for database tests, not integration tests."
+agents plan correct 01ARZ3NDEKTSV4RRFFQ69G5FAV --mode=revert \
+  --guidance "Increase test coverage to 85%, prioritizing auth and payment modules. Use mocks for database tests, not integration tests."
 
-# Correct a subplan's prompt (originally created by parent plan)
-agents plan correct 01BRZ4PDFLUTW5SSGR70H6GBW --mode=revert \
-  --guidance "Write unit tests for auth module, focusing on edge cases for token expiration"
+# Correct a subplan's prompt (originally created by parent plan)
+agents plan correct 01BRZ4PDFLUTW5SSGR70H6GBW --mode=revert \
+  --guidance "Write unit tests for auth module, focusing on edge cases for token expiration"
 
-# Append a fix rather than rewriting history
-agents plan correct 01ARZ3NDEKTSV4RRFFQ69G5FAV --mode=append \
-  --guidance "The previous approach missed error handling tests - add comprehensive error path coverage"
+# Append a fix rather than rewriting history
+agents plan correct 01ARZ3NDEKTSV4RRFFQ69G5FAV --mode=append \
+  --guidance "The previous approach missed error handling tests - add comprehensive error path coverage"
 
-# Remove an invariant that shouldn't apply
-agents plan correct 01CRZ5QEHMVUX6TTHR81I7HCX --mode=revert \
-  --guidance "Remove this invariant - TCP mocking is not needed for this module since it has no network calls"
+# Remove an invariant that shouldn't apply
+agents plan correct 01CRZ5QEHMVUX6TTHR81I7HCX --mode=revert \
+  --guidance "Remove this invariant - TCP mocking is not needed for this module since it has no network calls"
 
-# Add a missing invariant to the plan
-agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J "All database queries must use parameterized statements"
-```
+# Add a missing invariant to the plan
+agents invariant add --plan 01HXM8C2ZK4Q7C2B3F2R4VYV6J "All database queries must use parameterized statements"
+
**Note:** CLI commands should not require interactive input. The `--guidance` parameter provides the correction inline. @@ -6966,16 +6967,16 @@ Because the prompt is part of the decision tree, the system automatically knows ##### Decision Record Structure -```yaml -Decision: - # Identity - decision_id: ULID # Unique identifier - plan_id: ULID # Parent plan this decision belongs to - parent_decision_id: ULID | null # Parent decision (for tree structure) - sequence_number: int # Order within the plan's decisions +

+Decision:
+  # Identity
+  decision_id: ULID # Unique identifier
+  plan_id: ULID # Parent plan this decision belongs to
+  parent_decision_id: ULID | null # Parent decision (for tree structure)
+  sequence_number: int # Order within the plan's decisions
   
-  # Classification
-  decision_type: enum
+  # Classification
+  decision_type: enum
     - prompt_definition         # The prompt/description for this plan (root decision)
     - invariant_enforced        # An invariant (from global, project, action, or plan scope) applicable to this plan, added as a constraint
     - strategy_choice           # High-level approach decision during Strategize
@@ -6988,45 +6989,45 @@ Decision:
     - validation_response       # Response to validation failure
     - user_intervention         # User provided guidance/correction
   
-  # The Decision Itself
-  question: str                        # What question was being answered
-  chosen_option: str                   # What was decided
-  alternatives_considered: list[str]   # Other options that were evaluated
-  confidence_score: float | null       # 0.0-1.0 if the actor provided confidence
+  # The Decision Itself
+  question: str # What question was being answered
+  chosen_option: str # What was decided
+  alternatives_considered: list[str] # Other options that were evaluated
+  confidence_score: float | null # 0.0-1.0 if the actor provided confidence
   
-  # Context Snapshot (for replay)
-  context_snapshot:
-    hot_context_hash: str              # Cryptographic hash of the exact context
-    hot_context_ref: str               # Pointer to the full stored snapshot
-    relevant_resources: list[ResourceRef]  # Every file/symbol that influenced this decision
-    actor_state_ref: str               # Complete LangGraph checkpoint
+  # Context Snapshot (for replay)
+  context_snapshot:
+    hot_context_hash: str # Cryptographic hash of the exact context
+    hot_context_ref: str # Pointer to the full stored snapshot
+    relevant_resources: list[ResourceRef] # Every file/symbol that influenced this decision
+    actor_state_ref: str # Complete LangGraph checkpoint
     
-  # When the system decides "refactor the authentication module to use async patterns," 
-  # it permanently records:
-  # - Which files were examined to make that decision
-  # - What symbols and dependencies were traced
-  # - The exact code state that was analyzed
-  # - The reasoning chain that led to this choice
-  # - Alternative approaches that were considered but rejected
+  # When the system decides "refactor the authentication module to use async patterns," 
+  # it permanently records:
+  # - Which files were examined to make that decision
+  # - What symbols and dependencies were traced
+  # - The exact code state that was analyzed
+  # - The reasoning chain that led to this choice
+  # - Alternative approaches that were considered but rejected
   
-  # Rationale
-  rationale: str                       # Why this option was chosen
-  actor_reasoning: str | null          # Raw LLM reasoning if available
+  # Rationale
+  rationale: str # Why this option was chosen
+  actor_reasoning: str | null # Raw LLM reasoning if available
   
-  # Downstream Impact (populated during Execute phase)
-  downstream_decision_ids: list[ULID]  # Decisions that depend on this one
-  downstream_plan_ids: list[ULID]      # Child plans spawned because of this decision
-  artifacts_produced: list[ArtifactRef] # Files/outputs created under this decision
+  # Downstream Impact (populated during Execute phase)
+  downstream_decision_ids: list[ULID] # Decisions that depend on this one
+  downstream_plan_ids: list[ULID] # Child plans spawned because of this decision
+  artifacts_produced: list[ArtifactRef] # Files/outputs created under this decision
   
-  # Timestamps
-  created_at: datetime
+  # Timestamps
+  created_at: datetime
   
-  # Correction Metadata
-  is_correction: bool                  # Was this decision a correction of another?
-  corrects_decision_id: ULID | null    # If correction, which decision was replaced
-  correction_reason: str | null        # Why the correction was made
-  superseded_by: ULID | null           # If this decision was later corrected
-```
+  # Correction Metadata
+  is_correction: bool # Was this decision a correction of another?
+  corrects_decision_id: ULID | null # If correction, which decision was replaced
+  correction_reason: str | null # Why the correction was made
+  superseded_by: ULID | null # If this decision was later corrected
+
##### Decision Timing @@ -7038,64 +7039,64 @@ Decision: ##### Decision Tree Storage Schema -```sql --- Core decision table -CREATE TABLE decisions ( - decision_id TEXT PRIMARY KEY, -- ULID - plan_id TEXT NOT NULL, - parent_decision_id TEXT, - sequence_number INTEGER NOT NULL, - decision_type TEXT NOT NULL, -- prompt_definition, invariant_enforced, strategy_choice, - -- implementation_choice, resource_selection, subplan_spawn, - -- subplan_parallel_spawn, tool_invocation, error_recovery, - -- validation_response, user_intervention - question TEXT, - chosen_option TEXT NOT NULL, - alternatives_considered TEXT, -- JSON array - confidence_score REAL, - rationale TEXT, - actor_reasoning TEXT, - context_snapshot TEXT NOT NULL, -- JSON blob - is_correction BOOLEAN DEFAULT FALSE, - corrects_decision_id TEXT, - correction_reason TEXT, - superseded_by TEXT, - created_at TEXT NOT NULL, +

+-- Core decision table
+CREATE TABLE decisions (
+    decision_id TEXT PRIMARY KEY,      -- ULID
+    plan_id TEXT NOT NULL,
+    parent_decision_id TEXT,
+    sequence_number INTEGER NOT NULL,
+    decision_type TEXT NOT NULL,        -- prompt_definition, invariant_enforced, strategy_choice,
+                                       -- implementation_choice, resource_selection, subplan_spawn,
+                                       -- subplan_parallel_spawn, tool_invocation, error_recovery,
+                                       -- validation_response, user_intervention
+    question TEXT,
+    chosen_option TEXT NOT NULL,
+    alternatives_considered TEXT,      -- JSON array
+    confidence_score REAL,
+    rationale TEXT,
+    actor_reasoning TEXT,
+    context_snapshot TEXT NOT NULL,    -- JSON blob
+    is_correction BOOLEAN DEFAULT FALSE,
+    corrects_decision_id TEXT,
+    correction_reason TEXT,
+    superseded_by TEXT,
+    created_at TEXT NOT NULL,
     
-    FOREIGN KEY (plan_id) REFERENCES plans(plan_id),
-    FOREIGN KEY (parent_decision_id) REFERENCES decisions(decision_id),
-    FOREIGN KEY (corrects_decision_id) REFERENCES decisions(decision_id),
-    FOREIGN KEY (superseded_by) REFERENCES decisions(decision_id)
+    FOREIGN KEY (plan_id) REFERENCES plans(plan_id),
+    FOREIGN KEY (parent_decision_id) REFERENCES decisions(decision_id),
+    FOREIGN KEY (corrects_decision_id) REFERENCES decisions(decision_id),
+    FOREIGN KEY (superseded_by) REFERENCES decisions(decision_id)
 );
 
--- Downstream relationships (many-to-many for DAG)
-CREATE TABLE decision_dependencies (
-    upstream_decision_id TEXT NOT NULL,
-    downstream_decision_id TEXT NOT NULL,
-    dependency_type TEXT NOT NULL,     -- 'decision', 'plan', 'artifact'
-    downstream_ref TEXT NOT NULL,      -- The actual ID of decision/plan/artifact
+-- Downstream relationships (many-to-many for DAG)
+CREATE TABLE decision_dependencies (
+    upstream_decision_id TEXT NOT NULL,
+    downstream_decision_id TEXT NOT NULL,
+    dependency_type TEXT NOT NULL,     -- 'decision', 'plan', 'artifact'
+    downstream_ref TEXT NOT NULL,      -- The actual ID of decision/plan/artifact
     
-    PRIMARY KEY (upstream_decision_id, downstream_decision_id, downstream_ref),
-    FOREIGN KEY (upstream_decision_id) REFERENCES decisions(decision_id)
+    PRIMARY KEY (upstream_decision_id, downstream_decision_id, downstream_ref),
+    FOREIGN KEY (upstream_decision_id) REFERENCES decisions(decision_id)
 );
 
--- Correction history
-CREATE TABLE correction_attempts (
-    attempt_id TEXT PRIMARY KEY,       -- ULID
-    plan_id TEXT NOT NULL,
-    original_decision_id TEXT NOT NULL,
-    new_decision_id TEXT,
-    original_subtree_snapshot TEXT,    -- Reference to archived state
-    correction_reason TEXT,
-    status TEXT NOT NULL,              -- 'pending', 'executing', 'completed', 'failed'
-    created_at TEXT NOT NULL,
-    completed_at TEXT,
+-- Correction history
+CREATE TABLE correction_attempts (
+    attempt_id TEXT PRIMARY KEY,       -- ULID
+    plan_id TEXT NOT NULL,
+    original_decision_id TEXT NOT NULL,
+    new_decision_id TEXT,
+    original_subtree_snapshot TEXT,    -- Reference to archived state
+    correction_reason TEXT,
+    status TEXT NOT NULL,              -- 'pending', 'executing', 'completed', 'failed'
+    created_at TEXT NOT NULL,
+    completed_at TEXT,
     
-    FOREIGN KEY (plan_id) REFERENCES plans(plan_id),
-    FOREIGN KEY (original_decision_id) REFERENCES decisions(decision_id),
-    FOREIGN KEY (new_decision_id) REFERENCES decisions(decision_id)
+    FOREIGN KEY (plan_id) REFERENCES plans(plan_id),
+    FOREIGN KEY (original_decision_id) REFERENCES decisions(decision_id),
+    FOREIGN KEY (new_decision_id) REFERENCES decisions(decision_id)
 );
-```
+
### Action @@ -7122,19 +7123,19 @@ Actions are created using the CLI. There are two modes of creation: **1. Config-only (all values from YAML):** -```bash -agents action create "local/code-coverage" \ - --config ./actions/code-coverage.yaml -``` +

+agents action create "local/code-coverage" \
+  --config ./actions/code-coverage.yaml
+
**2. Config with CLI overrides:** -```bash -agents action create "local/code-coverage" \ - --config ./actions/code-coverage.yaml \ - --execution-actor "local/fast-executor" \ - --available -``` +

+agents action create "local/code-coverage" \
+  --config ./actions/code-coverage.yaml \
+  --execution-actor "local/fast-executor" \
+  --available
+
In both modes, the YAML file provides the full action definition. Any CLI options provided alongside `--config` override the corresponding values from the file. @@ -7247,34 +7248,34 @@ The resolved automation profile name for this plan (e.g., `trusted`, `autonomous The `use` command transitions an Action into the Strategize phase by applying it to one or more projects: -```bash -# Basic usage +

+# Basic usage
 agents plan use local/code-coverage my-api-service
 
-# Multiple projects
-agents plan use local/schema-update \
-  api-service \
-  web-frontend \
+# Multiple projects
+agents plan use local/schema-update \
+  api-service \
+  web-frontend \
   mobile-app
 
-# With action arguments
-agents plan use local/code-coverage \
-  my-api-service \
-  --arg target_coverage_percent=85 \
-  --arg test_framework=pytest
+# With action arguments
+agents plan use local/code-coverage \
+  my-api-service \
+  --arg target_coverage_percent=85 \
+  --arg test_framework=pytest
 
-# With explicit automation profile
-agents plan use local/deploy-action \
-  staging-env \
-  --automation-profile manual
+# With explicit automation profile
+agents plan use local/deploy-action \
+  staging-env \
+  --automation-profile manual
 
-# With invariants attached at use time
-agents plan use local/code-coverage \
-  my-api-service \
-  --arg target_coverage_percent=85 \
-  --invariant "All API calls over TCP must be mocked" \
-  --invariant "Do not modify the payments module"
-```
+# With invariants attached at use time
+agents plan use local/code-coverage \
+  my-api-service \
+  --arg target_coverage_percent=85 \
+  --invariant "All API calls over TCP must be mocked" \
+  --invariant "Do not modify the payments module"
+
**Parameters:** * ``: Project to apply the action to (positional, can be repeated for multi-project plans) @@ -7307,27 +7308,27 @@ This "architect vs coder" separation is explicitly described as a core motivatio **Resource-aware dependency analysis**: During the Strategize phase, the strategy actor employs specialized mechanisms to compute precise dependency closures: -```python -# Pseudocode of what happens inside a strategy actor -def compute_closure_for_refactoring(target_module): +

+# Pseudocode of what happens inside a strategy actor
+def compute_closure_for_refactoring(target_module):
     closure = ResourceClosure()
     
-    # Direct file dependencies
+    # Direct file dependencies
     closure.add_files(find_imports(target_module))
     closure.add_files(find_includes(target_module))
     
-    # Symbol dependencies
-    for symbol in extract_exported_symbols(target_module):
-        closure.add_files(find_symbol_usage(symbol, scope='project'))
+    # Symbol dependencies
+    for symbol in extract_exported_symbols(target_module):
+        closure.add_files(find_symbol_usage(symbol, scope='project'))
     
-    # Test dependencies
+    # Test dependencies
     closure.add_files(find_tests_for_module(target_module))
     
-    # Build system dependencies
+    # Build system dependencies
     closure.add_files(find_build_references(target_module))
     
-    return closure
-```
+    return closure
+
The system leverages several key insights: - **Modular boundaries exist**: Even in legacy codebases, there are natural boundaries @@ -7404,12 +7405,12 @@ And produces estimates for: **Implementation**: Similar to how there's a `strategy_actor` and `execution_actor` for each action, there can be an optional `estimation_actor` whose entire job is cost/risk estimation. This actor runs after Strategize completes (before Execute) and its output is informational only. -```bash -# Example: Action with estimation actor (estimation-actor overrides config) -agents action create --config ./actions/expensive-refactor.yaml \ - --estimation-actor "local/cost-estimator" \ - "local/expensive-refactor" -``` +

+# Example: Action with estimation actor (estimation-actor overrides config)
+agents action create --config ./actions/expensive-refactor.yaml \
+  --estimation-actor "local/cost-estimator" \
+  "local/expensive-refactor"
+
This becomes critical in server/multi-user usage and cost controls. @@ -7518,37 +7519,37 @@ When a plan accesses multiple resources: **Complete isolation during execution prevents compound errors**: Each plan executes in its own sandbox, which means: -``` +

 Plan A (refactoring auth module):
 - Sandbox A1: Contains only auth/*.cpp, auth_tests/*.cpp
-- Cannot see Plan B's intermediate states
-- Cannot accidentally depend on Plan B's half-done work
+- Cannot see Plan B's intermediate states
+- Cannot accidentally depend on Plan B's half-done work
 
 Plan B (updating API endpoints):
 - Sandbox B1: Contains only api/*.cpp, api_tests/*.cpp  
 - Makes changes assuming current auth interface
-- Protected from Plan A's intermediate refactoring
-```
+- Protected from Plan A's intermediate refactoring
+
**Hierarchical merge resolution**: When child plans complete, the parent plan performs intelligent merging: -```python -def merge_subplan_results(subplan_results): - # Group by resource type +

+def merge_subplan_results(subplan_results):
+    # Group by resource type
     by_resource = group_by_resource_type(subplan_results)
     
-    # Apply resource-specific merge strategies
-    for resource_type, changes in by_resource:
-        if resource_type == 'git-checkout':
-            merge_git_changes(changes)  # Three-way merge
-        elif resource_type == 'fs-mount':
-            merge_fs_changes(changes)   # Copy-on-write reconciliation
-        elif resource_type.startswith('database'):
-            merge_db_changes(changes)   # Sequential application
+    # Apply resource-specific merge strategies
+    for resource_type, changes in by_resource:
+        if resource_type == 'git-checkout':
+            merge_git_changes(changes)  # Three-way merge
+        elif resource_type == 'fs-mount':
+            merge_fs_changes(changes)   # Copy-on-write reconciliation
+        elif resource_type.startswith('database'):
+            merge_db_changes(changes)   # Sequential application
     
-    # Validate merged state
+    # Validate merged state
     run_integration_tests()
-```
+
#### Execution Data Model @@ -7725,54 +7726,54 @@ CleverAgents provides multiple layers of proactive error prevention that catch s #### Layer 1: Decision-time Validation During Strategize Every decision includes semantic validation: -```yaml -Decision: Refactor payment module to async -alternatives_considered: - - "Convert to async/await patterns" (chosen) - - "Use thread pool with channels" (rejected: doesn't integrate with async ecosystem) - - "Keep synchronous with timeout" (rejected: doesn't solve core latency issue) -confidence_score: 0.85 -validation_performed: +

+Decision: Refactor payment module to async
+alternatives_considered:
+  - "Convert to async/await patterns" (chosen)
+  - "Use thread pool with channels" (rejected: doesn't integrate with async ecosystem)
+  - "Keep synchronous with timeout" (rejected: doesn't solve core latency issue)
+confidence_score: 0.85
+validation_performed:
   - Checked all payment API consumers can handle async
   - Verified database driver supports async operations
   - Confirmed no regulatory requirement for sync processing
-```
+
#### Layer 2: Execution-time Semantic Guards The execution actor uses a tool node that references the independently registered `local/validate-api-compat` tool: -```yaml -# Actor graph uses a named tool node for semantic validation -actors: - code_executor: - type: graph - skills: +

+# Actor graph uses a named tool node for semantic validation
+actors:
+  code_executor:
+    type: graph
+    skills:
       - local/semantic-validators    # Skill containing validation tools for LLM tool-calling
-    nodes:
-      - name: semantic_validator
-        type: tool
-        tool: local/validate-api-compat   # Named tool from Tool Registry
-```
+    nodes:
+      - name: semantic_validator
+        type: tool
+        tool: local/validate-api-compat # Named tool from Tool Registry
+
The `local/validate-api-compat` tool is independently registered via its own YAML: -```yaml -# File: tools/validate-api-compat.yaml -cleveragents: - version: "3.0" +

+# File: tools/validate-api-compat.yaml
+cleveragents:
+  version: "3.0"
 
-tool:
-  name: local/validate-api-compat
-  description: "Check for breaking API changes and attempt auto-migration"
-  source: custom
+tool:
+  name: local/validate-api-compat
+  description: "Check for breaking API changes and attempt auto-migration"
+  source: custom
 
-  capability:
-    writes: true
-    checkpointable: true
+  capability:
+    writes: true
+    checkpointable: true
 
-  code: |
-    # Not just syntax checking - semantic validation
+  code: |
+    # Not just syntax checking - semantic validation
     old_api = extract_api_signature(previous_version)
     new_api = extract_api_signature(current_version)
     
@@ -7783,24 +7784,24 @@ tool:
         
         if can_auto_migrate(affected_consumers, migration_plan):
             apply_migration(migration_plan)
-        else:
+        else:
             raise SemanticError(
-                "Breaking API changes require manual review",
+                "Breaking API changes require manual review",
                 changes=breaking_changes,
                 affected=affected_consumers
             )
-```
+
The `local/semantic-validators` skill references this tool by name: -```yaml -# File: skills/semantic-validators.yaml -skill: - name: local/semantic-validators - description: "Semantic validation tools for API compatibility and code invariants" - tools: +

+# File: skills/semantic-validators.yaml
+skill:
+  name: local/semantic-validators
+  description: "Semantic validation tools for API compatibility and code invariants"
+  tools:
     - local/validate-api-compat
-```
+
#### Layer 3: Invariant Enforcement @@ -7839,86 +7840,86 @@ Each effective invariant is then recorded as an `invariant_enforced` decision in * **Remove**: Remove an existing invariant from the plan's decision tree (the invariant remains defined at its scope but is no longer enforced for this plan). * **Add**: Add a new invariant to the plan. When adding, the user can select from invariants already accessible to the plan (those defined at the plan, action, project, or global scope), or provide free-form text to create a new ad-hoc invariant. -```bash -# Add invariants at different scopes -agents invariant add --global "All public APIs must maintain backward compatibility" -agents invariant add --global "Payment processing must be idempotent" -agents invariant add --project local/api-service \ - "Database transactions must complete within 5 seconds" -agents invariant add --project local/api-service \ - "Authentication must always use OAuth2" -agents invariant add --plan "All API calls over TCP must be mocked" -agents invariant add --action local/code-coverage "Test files must not import production secrets" +

+# Add invariants at different scopes
+agents invariant add --global "All public APIs must maintain backward compatibility"
+agents invariant add --global "Payment processing must be idempotent"
+agents invariant add --project local/api-service \
+  "Database transactions must complete within 5 seconds"
+agents invariant add --project local/api-service \
+  "Authentication must always use OAuth2"
+agents invariant add --plan <PLAN_ID> "All API calls over TCP must be mocked"
+agents invariant add --action local/code-coverage "Test files must not import production secrets"
 
-# List invariants
-agents invariant list --global
-agents invariant list --project local/api-service
-agents invariant list --plan  --effective   # Shows reconciled view
+# List invariants
+agents invariant list --global
+agents invariant list --project local/api-service
+agents invariant list --plan <PLAN_ID> --effective   # Shows reconciled view
 
-# Remove an invariant
-agents invariant remove 
+# Remove an invariant
+agents invariant remove <INVARIANT_ID>
 
-# Attach invariants at creation time (convenience)
-agents project create --invariant "All endpoints must validate auth tokens" local/api-service
-agents action create --config ./actions/code-coverage.yaml --invariant "Test files must not import production secrets" local/code-coverage
-agents plan use local/code-coverage local/api-service --invariant "Mock all network calls"
+# Attach invariants at creation time (convenience)
+agents project create --invariant "All endpoints must validate auth tokens" local/api-service
+agents action create --config ./actions/code-coverage.yaml --invariant "Test files must not import production secrets" local/code-coverage
+agents plan use local/code-coverage local/api-service --invariant "Mock all network calls"
 
-# Correct an invariant decision (remove or replace via standard correction)
-agents plan correct  --mode=revert \
-  --guidance "Remove this invariant - it does not apply to this module"
-```
+# Correct an invariant decision (remove or replace via standard correction)
+agents plan correct <DECISION_ID> --mode=revert \
+  --guidance "Remove this invariant - it does not apply to this module"
+
The system collects, reconciles, and checks invariants: -```python -class InvariantEnforcer: - def compute_effective_invariants(self, plan): - """Compute the effective invariant view for a plan using the Invariant Reconciliation Actor.""" - # 1. Collect raw invariants from all scopes +

+class InvariantEnforcer:
+    def compute_effective_invariants(self, plan):
+        """Compute the effective invariant view for a plan using the Invariant Reconciliation Actor."""
+        # 1. Collect raw invariants from all scopes
         raw = self.collect_all_invariants(plan)
         
-        # 2. Find the Invariant Reconciliation Actor (plan -> project -> global config)
+        # 2. Find the Invariant Reconciliation Actor (plan -> project -> global config)
         reconciler = (
             self.get_plan_invariant_actor(plan)
-            or self.get_project_invariant_actor(plan)
-            or self.get_global_invariant_actor()
+            or self.get_project_invariant_actor(plan)
+            or self.get_global_invariant_actor()
         )
         
-        # 3. Reconcile: apply precedence (plan > project > global), resolve conflicts
-        effective = reconciler.reconcile(raw, precedence=['plan', 'project', 'global'])
-        return effective
+        # 3. Reconcile: apply precedence (plan > project > global), resolve conflicts
+        effective = reconciler.reconcile(raw, precedence=['plan', 'project', 'global'])
+        return effective
     
-    def collect_all_invariants(self, plan):
-        """Collect invariants from all scopes accessible to this plan."""
+    def collect_all_invariants(self, plan):
+        """Collect invariants from all scopes accessible to this plan."""
         invariants = []
         invariants.extend(self.get_global_invariants())
-        for project in plan.projects:
+        for project in plan.projects:
             invariants.extend(self.get_project_invariants(project))
         invariants.extend(self.get_action_invariants(plan.action))
         invariants.extend(self.get_plan_invariants(plan))
-        return invariants
+        return invariants
     
-    def check_invariant_preservation(self, changes, enforced_invariants):
-        """Check that changes respect all enforced invariants."""
-        for invariant in enforced_invariants:
-            if not self.verify_invariant(invariant, changes):
-                return InvariantViolation(invariant, changes)
-        return Success()
-```
+    def check_invariant_preservation(self, changes, enforced_invariants):
+        """Check that changes respect all enforced invariants."""
+        for invariant in enforced_invariants:
+            if not self.verify_invariant(invariant, changes):
+                return InvariantViolation(invariant, changes)
+        return Success()
+
#### Layer 4: Predictive Error Prevention The system learns from past failures: -```yaml +

 Error Pattern Database:
-  - pattern: "Async conversion in payment module"
-    historical_failures:
-      - "Race condition in payment confirmation"
-      - "Timeout handling breaks idempotency"
-    preventive_checks:
-      - "Add explicit transaction boundaries"
-      - "Verify idempotency keys are preserved"
-      - "Check distributed lock acquisition"
-```
+  - pattern: "Async conversion in payment module"
+    historical_failures:
+      - "Race condition in payment confirmation"
+      - "Timeout handling breaks idempotency"
+    preventive_checks:
+      - "Add explicit transaction boundaries"
+      - "Verify idempotency keys are preserved"
+      - "Check distributed lock acquisition"
+
### Applied (Apply Phase) @@ -7970,19 +7971,19 @@ Validation is **defined by the actor configuration and project settings**, not h **Project-defined validation**: Each project defines its validations via `agents project validation add`: -```bash -# Add required validations -agents project validation add --description "Run unit tests with coverage" \ - --required --resource repo local/api-service "pytest --cov=src --cov-fail-under=80" -agents project validation add --description "Lint check" \ - --required local/api-service "ruff check ." -agents project validation add --description "Type checking" \ - --required local/api-service "pyright" +

+# Add required validations
+agents project validation add --description "Run unit tests with coverage" \
+  --required --resource repo local/api-service "pytest --cov=src --cov-fail-under=80"
+agents project validation add --description "Lint check" \
+  --required local/api-service "ruff check ."
+agents project validation add --description "Type checking" \
+  --required local/api-service "pyright"
 
-# Add informational (non-blocking) validations
-agents project validation add --description "Check bundle size (advisory)" \
-  --informational local/api-service "node scripts/check-bundle-size.js"
-```
+# Add informational (non-blocking) validations
+agents project validation add --description "Check bundle size (advisory)" \
+  --informational local/api-service "node scripts/check-bundle-size.js"
+
This information is passed into the actor's context, allowing generic actors (not specific to any project) to execute appropriate validation. Each validation is run independently, and results are collected into the plan's validation summary. @@ -8000,9 +8001,9 @@ When an **informational** validation fails, the result is recorded in the plan's The user can prompt the plan with additional instructions when stuck: -```bash -agents plan prompt "Try using mock objects for the database tests" -``` +

+agents plan prompt <plan_id> "Try using mock objects for the database tests"
+
#### Apply Data Model @@ -8054,24 +8055,24 @@ This distinction matters for server mode: the server can only execute plans on * #### Project Creation (CLI) -```bash -# Step 1: Register resources independently -agents resource add git-checkout local/api-repo \ - --path /repos/api-service \ - --branch main +

+# Step 1: Register resources independently
+agents resource add git-checkout local/api-repo \
+  --path /repos/api-service \
+  --branch main
 
-agents resource add local/database local/staging-db \
-  --connection-string "postgresql://staging.example.com/mydb" \
-  --read-only
+agents resource add local/database local/staging-db \
+  --connection-string "postgresql://staging.example.com/mydb" \
+  --read-only
 
-# Step 2: Create the project
-agents project create "my-api-service"
+# Step 2: Create the project
+agents project create "my-api-service"
 
-# Step 3: Link resources to the project
-agents project link-resource "my-api-service" local/api-repo
+# Step 3: Link resources to the project
+agents project link-resource "my-api-service" local/api-repo
 
-agents project link-resource "my-api-service" local/staging-db --read-only
-```
+agents project link-resource "my-api-service" local/staging-db --read-only
+
Resources are registered once and can be linked to multiple projects. The resource's type, sandbox strategy, and capabilities are defined by its resource type in the Resource Registry — not by the project. @@ -8218,69 +8219,69 @@ Actors are defined via **YAML configuration files**. Tools and skills are also d Example actor configuration (see `examples/` directory for full examples): -```yaml -cleveragents: - version: "3.0" - default_actor: workflow_controller +

+cleveragents:
+  version: "3.0"
+  default_actor: workflow_controller
 
-actors:
-  # Simple LLM actor with skills referenced by name
-  my_assistant:
-    type: llm
-    config:
-      actor: openai/gpt-4           # Reference to built-in actor
-      temperature: 0.7
-      system_prompt: |
+actors:
+  # Simple LLM actor with skills referenced by name
+  my_assistant:
+    type: llm
+    config:
+      actor: openai/gpt-4 # Reference to built-in actor
+      temperature: 0.7
+      system_prompt: |
         You are a helpful assistant.
         Current task: {{ context.task_description }}
-    skills:
+    skills:
       - local/file-ops               # Grants access to all tools in this skill
       - local/git-ops
 
-  # LLM actor with a composite skill (includes many sub-skills)
-  data_processor:
-    type: llm
-    config:
-      actor: anthropic/claude-3-opus
-      system_prompt: |
+  # LLM actor with a composite skill (includes many sub-skills)
+  data_processor:
+    type: llm
+    config:
+      actor: anthropic/claude-3-opus
+      system_prompt: |
         You are a data processing assistant.
-    skills:
+    skills:
       - local/data-toolkit           # A skill containing analysis + transformation tools
 
-  # Actor referencing another actor
-  reviewer:
-    type: llm
-    config:
-      actor: local/code-reviewer    # Reference to another custom actor
-      memory_enabled: true
-      max_history: 20
-    skills:
+  # Actor referencing another actor
+  reviewer:
+    type: llm
+    config:
+      actor: local/code-reviewer # Reference to another custom actor
+      memory_enabled: true
+      max_history: 20
+    skills:
       - local/file-ops
       - local/git-ops
 
-routes:
-  main_workflow:
-    type: graph
-    entry_point: start
-    nodes:
-      - name: analyze
-        type: agent
-        agent: my_assistant
-      - name: process
-        type: agent
-        agent: data_processor
-    edges:
-      - source: start
-        target: analyze
-      - source: analyze
-        target: process
-      - source: process
-        target: end
+routes:
+  main_workflow:
+    type: graph
+    entry_point: start
+    nodes:
+      - name: analyze
+        type: agent
+        agent: my_assistant
+      - name: process
+        type: agent
+        agent: data_processor
+    edges:
+      - source: start
+        target: analyze
+      - source: analyze
+        target: process
+      - source: process
+        target: end
 
-context:
-  global:
-    task_description: "Default task"
-```
+context:
+  global:
+    task_description: "Default task"
+
#### Actor Arguments @@ -8300,13 +8301,13 @@ For built-in actors (like `openai/gpt-4`), common arguments include: Actors can reference other actors **by name**: -```yaml -actors: - complex_workflow: - type: llm - config: - actor: local/base-analyzer # References another actor -``` +

+actors:
+  complex_workflow:
+    type: llm
+    config:
+      actor: local/base-analyzer # References another actor
+
**Load order matters**: Referenced actors must be loaded/defined before actors that depend on them. @@ -8366,40 +8367,40 @@ This is a powerful simplification: actors provide intelligence, tools provide ca **Tool node with named tool reference:** -```yaml -nodes: - - name: run_db_migrate - type: tool - tool: local/run-migrations # Named tool from Tool Registry - override: # Optional metadata override - capability: - human_approval_required: true +

+nodes:
+  - name: run_db_migrate
+    type: tool
+    tool: local/run-migrations # Named tool from Tool Registry
+    override:                           # Optional metadata override
+      capability:
+        human_approval_required: true
 
-  - name: spawn_tests
-    type: tool
-    tool: local/create-subplan          # Another named tool
-```
+  - name: spawn_tests
+    type: tool
+    tool: local/create-subplan # Another named tool
+
**Tool node with anonymous inline tool:** -```yaml -nodes: - - name: custom_validation - type: tool - anonymous: true - description: "Validate output format before proceeding" - input_schema: - type: object - properties: - data: { type: object } - capability: - read_only: true - code: | - # Inline Python — same format as a named tool YAML body - if not params["data"].get("status"): - raise ValueError("Missing status field") - return {"valid": True} -``` +

+nodes:
+  - name: custom_validation
+    type: tool
+    anonymous: true
+    description: "Validate output format before proceeding"
+    input_schema:
+      type: object
+      properties:
+        data: { type: object }
+    capability:
+      read_only: true
+    code: |
+      # Inline Python — same format as a named tool YAML body
+      if not params["data"].get("status"):
+          raise ValueError("Missing status field")
+      return {"valid": True}
+
### Agent @@ -8479,123 +8480,123 @@ block-beta Tools are defined in their own YAML configuration files, separate from skills and actors. A tool YAML file declares the tool's identity, schema, capability metadata, and implementation: -```yaml -# File: tools/run-migrations.yaml -cleveragents: - version: "3.0" +

+# File: tools/run-migrations.yaml
+cleveragents:
+  version: "3.0"
 
-tool:
-  name: local/run-migrations
-  description: "Run database migrations for the API service"
+tool:
+  name: local/run-migrations
+  description: "Run database migrations for the API service"
 
-  source: custom     # mcp | agent_skill | builtin | custom
+  source: custom # mcp | agent_skill | builtin | custom
 
-  # Resource bindings — what resources this tool needs access to
-  resources:
-    db:
-      type: local/database
-      access: read_write
-      required: true
-      description: "Target database for migrations"
+  # Resource bindings — what resources this tool needs access to
+  resources:
+    db:
+      type: local/database
+      access: read_write
+      required: true
+      description: "Target database for migrations"
 
-  input_schema:
-    type: object
-    properties:
-      direction:
-        type: string
-        enum: [up, down]
-      count:
-        type: integer
-        default: 1
-    required: [direction]
+  input_schema:
+    type: object
+    properties:
+      direction:
+        type: string
+        enum: [up, down]
+      count:
+        type: integer
+        default: 1
+    required: [direction]
 
-  capability:
-    writes: true
-    write_scope:
-      resource_slots: [db]           # References the "db" resource slot
-    checkpointable: true
-    checkpoint_scope: transaction
-    side_effects: [schema_mutation]
+  capability:
+    writes: true
+    write_scope:
+      resource_slots: [db] # References the "db" resource slot
+    checkpointable: true
+    checkpoint_scope: transaction
+    side_effects: [schema_mutation]
 
-  code: |
+  code: |
     import subprocess
-    direction = params["direction"]
-    count = params.get("count", 1)
-    db = ctx.resources["db"]          # Access the bound database resource
+    direction = params["direction"]
+    count = params.get("count", 1)
+    db = ctx.resources["db"]          # Access the bound database resource
     result = subprocess.run(
-        ["alembic", direction, str(count)],
+        ["alembic", direction, str(count)],
         capture_output=True, text=True, cwd=db.sandbox.root
     )
-    return {"stdout": result.stdout, "returncode": result.returncode}
-```
+    return {"stdout": result.stdout, "returncode": result.returncode}
+
Another example — a tool that wraps an MCP server endpoint: -```yaml -# File: tools/create-github-issue.yaml -cleveragents: - version: "3.0" +

+# File: tools/create-github-issue.yaml
+cleveragents:
+  version: "3.0"
 
-tool:
-  name: local/create-github-issue
-  description: "Create a GitHub issue via MCP"
+tool:
+  name: local/create-github-issue
+  description: "Create a GitHub issue via MCP"
 
-  source: mcp
-  mcp_server:
-    command: "npx @anthropic/mcp-github"
-    env:
-      GITHUB_TOKEN: "${GITHUB_TOKEN}"
-    tool_name: create_issue   # The tool name as exposed by the MCP server
+  source: mcp
+  mcp_server:
+    command: "npx @anthropic/mcp-github"
+    env:
+      GITHUB_TOKEN: "${GITHUB_TOKEN}"
+    tool_name: create_issue # The tool name as exposed by the MCP server
 
-  capability:
-    writes: true
-    write_scope: [github:issues]
-    checkpointable: false
-```
+  capability:
+    writes: true
+    write_scope: [github:issues]
+    checkpointable: false
+
And an Agent Skill tool: -```yaml -# File: tools/deploy-staging.yaml -cleveragents: - version: "3.0" +

+# File: tools/deploy-staging.yaml
+cleveragents:
+  version: "3.0"
 
-tool:
-  name: local/deploy-staging
-  description: "Deploy the current branch to the staging environment"
+tool:
+  name: local/deploy-staging
+  description: "Deploy the current branch to the staging environment"
 
-  source: agent_skill
-  agent_skill:
-    path: ./skills/deploy-to-staging
-    sandbox_policy: container
-    allowed_tools: ["Bash(docker:*)", "Bash(kubectl:*)", "Read"]
+  source: agent_skill
+  agent_skill:
+    path: ./skills/deploy-to-staging
+    sandbox_policy: container
+    allowed_tools: ["Bash(docker:*)", "Bash(kubectl:*)", "Read"]
 
-  capability:
-    writes: true
-    checkpointable: false
-    side_effects: [deploy, infrastructure]
-```
+  capability:
+    writes: true
+    checkpointable: false
+    side_effects: [deploy, infrastructure]
+
#### Tool Registration and Management Tools are managed through the `agents tool` CLI commands: -```bash -# Register a new tool from its YAML configuration -agents tool add --config ./tools/run-migrations.yaml local/run-migrations +

+# Register a new tool from its YAML configuration
+agents tool add --config ./tools/run-migrations.yaml local/run-migrations
 
-# Update an existing tool (re-reads the config file, overwrites registration)
-agents tool add --config ./tools/run-migrations.yaml --update local/run-migrations
+# Update an existing tool (re-reads the config file, overwrites registration)
+agents tool add --config ./tools/run-migrations.yaml --update local/run-migrations
 
-# List all registered tools
+# List all registered tools
 agents tool list
 
-# Show details for a tool (schema, capability, references)
+# Show details for a tool (schema, capability, references)
 agents tool show local/run-migrations
 
-# Remove a tool
+# Remove a tool
 agents tool remove local/run-migrations
-```
+
Once registered, a tool is available to be referenced by skills (in their `tools` list) and by actor graphs (as `type: tool` nodes). Tools persist in the database (local or server) and follow the same namespace rules as actors and skills. @@ -8609,45 +8610,45 @@ An **anonymous tool** is an inline tool definition that appears directly in a sk Anonymous tools in a skill YAML: -```yaml -skill: - name: local/my-skill - tools: +

+skill:
+  name: local/my-skill
+  tools:
     - local/run-migrations          # Named tool reference
     - local/validate-api-compat     # Named tool reference
 
-  anonymous_tools:                  # Inline definitions, same format as tool YAML
-    - description: "One-off data cleanup for this project"
-      input_schema:
-        type: object
-        properties:
-          table: { type: string }
-      capability:
-        writes: true
-        checkpointable: true
-      code: |
-        # ... Python code ...
-        return {"cleaned": count}
-```
+  anonymous_tools:                  # Inline definitions, same format as tool YAML
+    - description: "One-off data cleanup for this project"
+      input_schema:
+        type: object
+        properties:
+          table: { type: string }
+      capability:
+        writes: true
+        checkpointable: true
+      code: |
+        # ... Python code ...
+        return {"cleaned": count}
+
Anonymous tools in an actor graph node: -```yaml -nodes: - - name: custom_step - type: tool - anonymous: true - description: "Inline validation specific to this workflow" - input_schema: - type: object - properties: - data: { type: object } - capability: - read_only: true - code: | - # ... Python code ... - return {"valid": True} -``` +

+nodes:
+  - name: custom_step
+    type: tool
+    anonymous: true
+    description: "Inline validation specific to this workflow"
+    input_schema:
+      type: object
+      properties:
+        data: { type: object }
+    capability:
+      read_only: true
+    code: |
+      # ... Python code ...
+      return {"valid": True}
+
The anonymous tool format is intentionally identical to the body of a named tool YAML — this means promoting an anonymous tool to a named, registered tool is a simple copy-paste into its own YAML file and `agents tool add`. @@ -8657,52 +8658,52 @@ When referencing a named tool in a skill or actor graph, its registered metadata **Overriding tool metadata in a skill:** -```yaml -skill: - name: local/strict-devops - tools: - - name: local/run-migrations - override: - capability: - human_approval_required: true # Override: require approval in this skill - write_scope: [database:staging] # Override: restrict scope for this context +

+skill:
+  name: local/strict-devops
+  tools:
+    - name: local/run-migrations
+      override:
+        capability:
+          human_approval_required: true # Override: require approval in this skill
+          write_scope: [database:staging] # Override: restrict scope for this context
 
     - local/validate-api-compat            # No overrides, use as registered
-```
+
**Overriding tool metadata in an actor graph node:** -```yaml -nodes: - - name: safe_migrate - type: tool - tool: local/run-migrations - override: - capability: - human_approval_required: true -``` +

+nodes:
+  - name: safe_migrate
+    type: tool
+    tool: local/run-migrations
+    override:
+      capability:
+        human_approval_required: true
+
**Overriding tool metadata when including a sub-skill:** When a skill includes another skill (importing all its tools), individual tools from the included skill can have their metadata overridden: -```yaml -skill: - name: local/production-ops - includes: - - name: local/devops-toolkit - tool_overrides: - - tool: local/run-migrations - override: - capability: - human_approval_required: true # In this context, require human approval - write_scope: [database:production] +

+skill:
+  name: local/production-ops
+  includes:
+    - name: local/devops-toolkit
+      tool_overrides:
+        - tool: local/run-migrations
+          override:
+            capability:
+              human_approval_required: true # In this context, require human approval
+              write_scope: [database:production]
 
-        - tool: local/create-github-issue
-          override:
-            capability:
-              required_permissions: [org:write]  # Stricter permissions in this context
-```
+        - tool: local/create-github-issue
+          override:
+            capability:
+              required_permissions: [org:write] # Stricter permissions in this context
+
Override rules: 1. Overrides are **shallow-merged** — only the specified fields are replaced; unspecified fields retain their registered values. @@ -8726,59 +8727,59 @@ A tool declares one or more **resource slots** in its YAML configuration. Each s Example tool YAML with resource slots: -```yaml -tool: - name: local/run-migrations - description: "Run database migrations" - source: custom +

+tool:
+  name: local/run-migrations
+  description: "Run database migrations"
+  source: custom
 
-  resources:
-    db:
-      type: local/database
-      access: read_write
-      required: true
-      description: "Target database for migrations"
+  resources:
+    db:
+      type: local/database
+      access: read_write
+      required: true
+      description: "Target database for migrations"
 
-  capability:
-    writes: true
-    write_scope: [db:migrations]     # References the "db" slot
-    checkpointable: true
+  capability:
+    writes: true
+    write_scope: [db:migrations] # References the "db" slot
+    checkpointable: true
 
-  code: |
-    direction = params["direction"]
-    db_resource = ctx.resources["db"]   # Access the bound resource
+  code: |
+    direction = params["direction"]
+    db_resource = ctx.resources["db"]   # Access the bound resource
     result = db_resource.handler.execute_migration(direction, db_resource.sandbox)
-    return {"status": "ok"}
-```
+    return {"status": "ok"}
+
A tool that works with multiple resources: -```yaml -tool: - name: local/cross-repo-diff - description: "Compare files across two git repositories" - source: custom +

+tool:
+  name: local/cross-repo-diff
+  description: "Compare files across two git repositories"
+  source: custom
 
-  resources:
-    source_repo:
-      type: git-checkout
-      access: read_only
-      required: true
-      description: "Source repository to compare from"
-    target_repo:
-      type: git-checkout
-      access: read_only
-      required: true
-      description: "Target repository to compare against"
+  resources:
+    source_repo:
+      type: git-checkout
+      access: read_only
+      required: true
+      description: "Source repository to compare from"
+    target_repo:
+      type: git-checkout
+      access: read_only
+      required: true
+      description: "Target repository to compare against"
 
-  capability:
-    read_only: true
+  capability:
+    read_only: true
 
-  code: |
-    source = ctx.resources["source_repo"]
-    target = ctx.resources["target_repo"]
-    # ... compare files across repos ...
-```
+  code: |
+    source = ctx.resources["source_repo"]
+    target = ctx.resources["target_repo"]
+    # ... compare files across repos ...
+
##### Three Binding Modes @@ -8788,13 +8789,13 @@ Resource slots are resolved to actual resources through one of three binding mod The slot declares a resource type requirement, and the system resolves it from the plan's project context at activation time. This is the most common mode — the tool says "I need a git-checkout resource" and the system finds one among the project's linked resources. -```yaml -resources: - repo: - type: git-checkout - access: read_write - # No `bind` field → contextual binding -``` +

+resources:
+  repo:
+    type: git-checkout
+    access: read_write
+    # No `bind` field → contextual binding
+
Resolution rules for contextual binding: * The system searches the plan's project for linked resources matching the slot's type. @@ -8806,14 +8807,14 @@ Resolution rules for contextual binding: The slot is hardcoded to a specific registered resource by name. This is useful for tools that always operate on the same resource, regardless of project context. -```yaml -resources: - docs: - type: fs-mount - access: read_only - bind: local/company-docs # Static: always this resource - description: "Company documentation corpus" -``` +

+resources:
+  docs:
+    type: fs-mount
+    access: read_only
+    bind: local/company-docs # Static: always this resource
+    description: "Company documentation corpus"
+
Static bindings are resolved at registration time and validated — the named resource must exist and be of the correct type. @@ -8821,22 +8822,22 @@ Static bindings are resolved at registration time and validated — the named re The resource reference is passed as a tool argument at invocation time. This is useful for tools that operate on user-specified resources. -```yaml -resources: - target: - type: git-checkout - access: read_only - from_param: repository # Bound from the "repository" input parameter - description: "Repository to analyze" +

+resources:
+  target:
+    type: git-checkout
+    access: read_only
+    from_param: repository # Bound from the "repository" input parameter
+    description: "Repository to analyze"
 
-input_schema:
-  type: object
-  properties:
-    repository:
-      type: string
-      description: "Name of the registered resource to analyze"
-  required: [repository]
-```
+input_schema:
+  type: object
+  properties:
+    repository:
+      type: string
+      description: "Name of the registered resource to analyze"
+  required: [repository]
+
The `from_param` field links a resource slot to an input parameter. At invocation time, the system resolves the parameter value as a resource name from the Resource Registry and validates type compatibility. @@ -9139,15 +9140,15 @@ Bridges Agent Skills Standard (`SKILL.md` folders) into the tool model. Agent Sk 1. **discover()**: Scans the configured skill directory for a `SKILL.md` file. Parses only the YAML frontmatter (`name`, `description`, optional `compatibility`, `metadata`, `allowed-tools`) to produce a lightweight `ToolDescriptor`. This metadata is injected into the agent's system prompt in a structured format so the LLM can decide when the skill is relevant: - ```xml - - - deploy-to-staging - Deploy the current branch to the staging environment. - local/deploy-staging - - - ``` +

+   <style="color: cyan; font-weight: 600;">available_agent_skills>
+     <style="color: cyan; font-weight: 600;">agent_skill>
+       <style="color: cyan; font-weight: 600;">name>deploy-to-staging</style="color: cyan; font-weight: 600;">name>
+       <style="color: cyan; font-weight: 600;">description>Deploy the current branch to the staging environment.</style="color: cyan; font-weight: 600;">description>
+       <style="color: cyan; font-weight: 600;">tool>local/deploy-staging</style="color: cyan; font-weight: 600;">tool>
+     </style="color: cyan; font-weight: 600;">agent_skill>
+   </style="color: cyan; font-weight: 600;">available_agent_skills>
+   
Discovery is **low-cost** — only ~50–100 tokens per Agent Skill for metadata. The full instructions are not loaded until activation. @@ -9182,36 +9183,36 @@ Wraps CleverAgents' native resource operations as tools: **Built-in tool groups:** **File Operations (`file_operations`):** -```python -read_file(path: str) -> str -write_file(path: str, content: str) -> None -edit_file(path: str, edits: list[Edit]) -> None -delete_file(path: str) -> None -move_file(source: str, destination: str) -> None -copy_file(source: str, destination: str) -> None -``` +

+read_file(path: str) -> str
+write_file(path: str, content: str) -> None
+edit_file(path: str, edits: list[Edit]) -> None
+delete_file(path: str) -> None
+move_file(source: str, destination: str) -> None
+copy_file(source: str, destination: str) -> None
+
**Directory Operations (`directory_operations`):** -```python -create_directory(path: str) -> None -list_directory(path: str, pattern: str = "*") -> list[str] -delete_directory(path: str, recursive: bool = False) -> None -``` +

+create_directory(path: str) -> None
+list_directory(path: str, pattern: str = "*") -> list[str]
+delete_directory(path: str, recursive: bool = False) -> None
+
**Search Operations (`search_operations`):** -```python -search_files(pattern: str, content_pattern: str = None) -> list[Match] -find_definition(symbol: str) -> list[Location] -find_references(symbol: str) -> list[Location] -``` +

+search_files(pattern: str, content_pattern: str = None) -> list[Match]
+find_definition(symbol: str) -> list[Location]
+find_references(symbol: str) -> list[Location]
+
**Git Operations (`git_operations`, when resource is a git repository):** -```python -git_status() -> GitStatus -git_diff(path: str = None) -> str -git_log(count: int = 10) -> list[Commit] -git_blame(path: str) -> list[BlameLine] -``` +

+git_status() -> GitStatus
+git_diff(path: str = None) -> str
+git_log(count: int = 10) -> list[Commit]
+git_blame(path: str) -> list[BlameLine]
+
Each built-in tool: * Has fully defined capability metadata @@ -9223,29 +9224,29 @@ Each built-in tool: MCP's metadata is not sufficient (read-only/idempotent is not enough; write scope is unclear). CleverAgents extends every tool — regardless of source — with a uniform capability metadata schema: -```yaml -capability: - read_only: bool # Whether tool only performs read operations - writes: bool # Whether tool can modify resources - write_scope: # What the tool is allowed to mutate - - file_paths: ["src/**", "tests/**"] # Path patterns within bound resources - - resource_slots: ["repo", "db"] # Resource slot names (from resource bindings) - - environment: container | host - idempotent: bool # Whether repeated calls produce same result - checkpointable: bool # Whether tool supports checkpoint/rollback - checkpoint_scope: str # What can be rolled back (file, transaction, commit, snapshot) - side_effects: # Non-reversible effects +

+capability:
+  read_only: bool # Whether tool only performs read operations
+  writes: bool # Whether tool can modify resources
+  write_scope:             # What the tool is allowed to mutate
+    - file_paths: ["src/**", "tests/**"]     # Path patterns within bound resources
+    - resource_slots: ["repo", "db"]         # Resource slot names (from resource bindings)
+    - environment: container | host
+  idempotent: bool # Whether repeated calls produce same result
+  checkpointable: bool # Whether tool supports checkpoint/rollback
+  checkpoint_scope: str # What can be rolled back (file, transaction, commit, snapshot)
+  side_effects:            # Non-reversible effects
     - install_packages
     - mutate_infra
     - send_email
-  required_permissions:    # Permissions needed to invoke
-    - resource:write
-    - sandbox:shell
-  cost_profile:            # Usage constraints
-    rate_limit: "10/min"
-    estimated_cost: "$0.01/call"
-  human_approval_required: bool  # Whether a human must approve invocation
-```
+  required_permissions:    # Permissions needed to invoke
+    - resource:write
+    - sandbox:shell
+  cost_profile:            # Usage constraints
+    rate_limit: "10/min"
+    estimated_cost: "$0.01/call"
+  human_approval_required: bool # Whether a human must approve invocation
+
**Where metadata comes from per source:** @@ -9264,25 +9265,25 @@ When an action is marked `read_only: true`, it can **only use tools that have `r When an LLM agent decides to use a tool (regardless of source), the following flow occurs through the unified execution pipeline: -``` +

 1. LLM generates tool call
-   e.g., edit_file(path="src/main.py", changes=[...])
-   or:   local/github.create_issue(title="Bug fix", body="...")
-   or:   (activates Agent Skill "deploy-to-staging" via instructions)
+   e.g., edit_file(path="src/main.py", changes=[...])
+   or:   local/github.create_issue(title="Bug fix", body="...")
+   or:   (activates Agent Skill "deploy-to-staging" via instructions)
                                 ↓
 2. Tool Router receives call
-   - Resolves tool by name from the Tool Registry or actor's skill tool sets
+   - Resolves tool by name from the Tool Registry or actor's skill tool sets
    - Validates parameters against inputSchema
-   - Checks capability metadata against plan's permission policy:
+   - Checks capability metadata against plan's permission policy:
      • Is this tool in allowed skill categories?
      • Does the plan allow writes?
      • Is human approval required?
    - If denied → return PermissionDeniedError to LLM
                                 ↓
-3. Resource Binding Resolution & Sandbox Context
+3. Resource Binding Resolution & Sandbox Context
    - Resolve resource bindings for this tool:
      • Static bindings: already resolved at registration
-     • Contextual bindings: resolve from plan's project resources
+     • Contextual bindings: resolve from plan's project resources
      • Parameter bindings: resolve from invocation arguments
    - Validate resource type compatibility for each slot
    - Validate access mode (e.g., read_write tool on read_only resource → error)
@@ -9300,44 +9301,44 @@ When an LLM agent decides to use a tool (regardless of source), the following fl
                                 ↓
 5. Change Recording
    - If tool modified resources → create Change record(s)
-   - Append Change(s) to plan's ChangeSet
+   - Append Change(s) to plan's ChangeSet
    - Update sandbox state
    - If checkpointable → record checkpoint for rollback
                                 ↓
 6. Result Return
    - Normalize result to uniform Result type
    - Return to LLM agent for continued reasoning
-```
+
#### Change Tracking from Tool Invocations **Critical Architecture Point:** The ChangeSet is NOT built by parsing LLM output. It is built by recording the effects of tool invocations: -```python -class ToolExecutionContext: - """Context provided to every tool execution, regardless of source.""" +

+class ToolExecutionContext:
+    """Context provided to every tool execution, regardless of source."""
     
-    def __init__(self, plan: Plan, sandbox: Sandbox,
-                 resources: dict[str, BoundResource]):
+    def __init__(self, plan: Plan, sandbox: Sandbox,
+                 resources: dict[str, BoundResource]):
         self.plan = plan
         self.sandbox = sandbox
-        self.resources = resources    # slot_name → BoundResource
-        self.changes: list[Change] = []
+        self.resources = resources    # slot_name → BoundResource
+        self.changes: list[Change] = []
     
-    def record_change(self, change: Change) -> None:
-        """Record a change made by a tool."""
+    def record_change(self, change: Change) -> None:
+        """Record a change made by a tool."""
         self.changes.append(change)
         self.plan.changeset.add_change(change)
 
 
-class WriteFileTool:
-    """Example: built-in tool for writing files."""
+class WriteFileTool:
+    """Example: built-in tool for writing files."""
     
-    def execute(self, path: str, content: str, ctx: ToolExecutionContext) -> None:
+    def execute(self, path: str, content: str, ctx: ToolExecutionContext) -> None:
         handler = ctx.sandbox.get_handler(path)
         change = handler.write(path, content, ctx.sandbox)
         ctx.record_change(change)
-```
+
This approach means: * Every resource modification is explicit and tracked @@ -9398,13 +9399,13 @@ sequenceDiagram MCP servers operate on real filesystem paths, but CleverAgents executes plans in sandboxes. The MCPToolAdapter transparently rewrites paths: -```python -# Before sending to MCP server: -# Logical path: "src/main.py" -# Sandbox path: "/tmp/sandbox-01HXM/worktree/src/main.py" -# The adapter rewrites the tool arguments so the MCP server -# operates on sandboxed state without knowing about the sandbox. -``` +

+# Before sending to MCP server:
+# Logical path: "src/main.py"
+# Sandbox path: "/tmp/sandbox-01HXM/worktree/src/main.py"
+# The adapter rewrites the tool arguments so the MCP server
+# operates on sandboxed state without knowing about the sandbox.
+
This ensures MCP tools respect sandbox boundaries even though they have no awareness of the CleverAgents sandbox model. @@ -9435,15 +9436,15 @@ This means an actor can have dozens of Agent Skill tools available but only pay Both can coexist in the same skill. A common pattern is an Agent Skill tool that teaches the agent a workflow which involves calling multiple MCP tools: -``` -Agent Skill Tool: "local/deploy-staging" +

+Agent Skill Tool: "local/deploy-staging"
   SKILL.md instructions:
     1. Run tests using the built-in shell tool
     2. Create a PR using the GitHub MCP tool (create_pull_request)
     3. Wait for CI using the GitHub MCP tool (get_check_runs)
     4. Deploy using the AWS MCP tool (ecs_update_service)
     5. Verify deployment using the HTTP MCP tool (fetch_url)
-```
+
#### Tool-Level Checkpointability @@ -9537,146 +9538,146 @@ When an actor references a skill, it gains access to the **flattened set of all Skills are defined in their own YAML configuration files, separate from tool and actor configurations. A skill YAML file declares which registered tools it includes (by name), which other skills it includes, and optionally defines anonymous inline tools: -```yaml -# File: skills/devops-toolkit.yaml -cleveragents: - version: "3.0" +

+# File: skills/devops-toolkit.yaml
+cleveragents:
+  version: "3.0"
 
-skill:
-  name: local/devops-toolkit
-  description: "Full-stack development tools for file ops, git, GitHub, and deployment"
+skill:
+  name: local/devops-toolkit
+  description: "Full-stack development tools for file ops, git, GitHub, and deployment"
 
-  # ── Named Tool References ───────────────────────────────
-  # Reference independently registered tools by name.
-  # These tools must already be registered via `agents tool add`.
-  # Optional metadata overrides can be applied per tool.
-  tools:
+  # ── Named Tool References ───────────────────────────────
+  # Reference independently registered tools by name.
+  # These tools must already be registered via `agents tool add`.
+  # Optional metadata overrides can be applied per tool.
+  tools:
     - local/run-migrations                  # Simple reference, use as registered
-    - name: local/deploy-staging            # Reference with metadata override
-      override:
-        capability:
-          human_approval_required: true     # Require approval in this skill context
+    - name: local/deploy-staging            # Reference with metadata override
+      override:
+        capability:
+          human_approval_required: true # Require approval in this skill context
 
-  # ── Include other skills ─────────────────────────────────
-  # All tools from included skills become part of this skill.
-  # Included skills must already be registered in the system.
-  # Individual tools from included skills can have metadata overridden.
-  includes:
+  # ── Include other skills ─────────────────────────────────
+  # All tools from included skills become part of this skill.
+  # Included skills must already be registered in the system.
+  # Individual tools from included skills can have metadata overridden.
+  includes:
     - local/file-ops           # built-in file + directory + search tools
     - local/git-ops            # built-in git tools
-    - name: local/github       # MCP-based GitHub tools, with per-tool overrides
-      tool_overrides:
-        - tool: local/create-github-issue
-          override:
-            capability:
-              write_scope: [github:issues:org-only]
+    - name: local/github       # MCP-based GitHub tools, with per-tool overrides
+      tool_overrides:
+        - tool: local/create-github-issue
+          override:
+            capability:
+              write_scope: [github:issues:org-only]
 
-  # ── MCP Server Tools ─────────────────────────────────────
-  # Connect to MCP servers and expose their tools.
-  # Tools discovered from MCP servers are auto-registered in the
-  # Tool Registry if not already present.
-  mcp_servers:
-    - name: linear
-      command: "npx @anthropic/mcp-linear"
-      env:
-        LINEAR_API_KEY: "${LINEAR_API_KEY}"
-      # Optional: override inferred capability metadata per tool
-      overrides:
-        - tool: create_issue
-          writes: true
-          write_scope: [linear:issues]
-        - tool: list_issues
-          read_only: true
+  # ── MCP Server Tools ─────────────────────────────────────
+  # Connect to MCP servers and expose their tools.
+  # Tools discovered from MCP servers are auto-registered in the
+  # Tool Registry if not already present.
+  mcp_servers:
+    - name: linear
+      command: "npx @anthropic/mcp-linear"
+      env:
+        LINEAR_API_KEY: "${LINEAR_API_KEY}"
+      # Optional: override inferred capability metadata per tool
+      overrides:
+        - tool: create_issue
+          writes: true
+          write_scope: [linear:issues]
+        - tool: list_issues
+          read_only: true
 
-  # ── Agent Skills (SKILL.md folders) ──────────────────────
-  # Each Agent Skill folder is loaded as a composite tool.
-  # The agent discovers it via metadata, activates it by
-  # loading SKILL.md instructions, and follows them.
-  agent_skills:
-    - path: ./skills/code-review-checklist
-      sandbox_policy: none
+  # ── Agent Skills (SKILL.md folders) ──────────────────────
+  # Each Agent Skill folder is loaded as a composite tool.
+  # The agent discovers it via metadata, activates it by
+  # loading SKILL.md instructions, and follows them.
+  agent_skills:
+    - path: ./skills/code-review-checklist
+      sandbox_policy: none
 
-  # ── Built-in Tool Groups ─────────────────────────────────
-  # Opt-in to built-in tool groups provided by CleverAgents.
-  builtins:
-    - group: shell_operations
+  # ── Built-in Tool Groups ─────────────────────────────────
+  # Opt-in to built-in tool groups provided by CleverAgents.
+  builtins:
+    - group: shell_operations
 
-  # ── Anonymous Tools ──────────────────────────────────────
-  # Inline tool definitions for one-off, skill-specific operations.
-  # Same format as a named tool YAML body but without a name.
-  # These are NOT registered in the Tool Registry and are NOT reusable.
-  anonymous_tools:
-    - description: "One-off cleanup for legacy migration artifacts"
-      input_schema:
-        type: object
-        properties:
-          directory: { type: string }
-      capability:
-        writes: true
-        checkpointable: true
-        checkpoint_scope: file
-      code: |
+  # ── Anonymous Tools ──────────────────────────────────────
+  # Inline tool definitions for one-off, skill-specific operations.
+  # Same format as a named tool YAML body but without a name.
+  # These are NOT registered in the Tool Registry and are NOT reusable.
+  anonymous_tools:
+    - description: "One-off cleanup for legacy migration artifacts"
+      input_schema:
+        type: object
+        properties:
+          directory: { type: string }
+      capability:
+        writes: true
+        checkpointable: true
+        checkpoint_scope: file
+      code: |
         import os, glob
-        directory = params["directory"]
+        directory = params["directory"]
         removed = []
-        for f in glob.glob(os.path.join(ctx.sandbox.root, directory, "*.legacy")):
+        for f in glob.glob(os.path.join(ctx.sandbox.root, directory, "*.legacy")):
             os.remove(f)
             removed.append(f)
-        return {"removed": removed, "count": len(removed)}
-```
+        return {"removed": removed, "count": len(removed)}
+
Here is an example of a simpler skill that wraps only built-in tools, suitable for common reuse: -```yaml -# File: skills/file-ops.yaml -cleveragents: - version: "3.0" +

+# File: skills/file-ops.yaml
+cleveragents:
+  version: "3.0"
 
-skill:
-  name: local/file-ops
-  description: "File and directory operations"
+skill:
+  name: local/file-ops
+  description: "File and directory operations"
 
-  builtins:
-    - group: file_operations      # read, write, edit, delete, move, copy
-    - group: directory_operations  # create, list, delete dirs
-```
+  builtins:
+    - group: file_operations      # read, write, edit, delete, move, copy
+    - group: directory_operations  # create, list, delete dirs
+
And an example of a skill that is purely MCP-based: -```yaml -# File: skills/github.yaml -cleveragents: - version: "3.0" +

+# File: skills/github.yaml
+cleveragents:
+  version: "3.0"
 
-skill:
-  name: local/github
-  description: "GitHub operations via MCP"
+skill:
+  name: local/github
+  description: "GitHub operations via MCP"
 
-  mcp_servers:
-    - name: github
-      command: "npx @anthropic/mcp-github"
-      env:
-        GITHUB_TOKEN: "${GITHUB_TOKEN}"
-      overrides:
-        - tool: create_issue
-          writes: true
-          write_scope: [github:issues]
-          checkpointable: false
-        - tool: create_pull_request
-          writes: true
-          write_scope: [github:pulls]
-          checkpointable: false
-        - tool: list_repos
-          read_only: true
-        - tool: get_file_contents
-          read_only: true
-```
+  mcp_servers:
+    - name: github
+      command: "npx @anthropic/mcp-github"
+      env:
+        GITHUB_TOKEN: "${GITHUB_TOKEN}"
+      overrides:
+        - tool: create_issue
+          writes: true
+          write_scope: [github:issues]
+          checkpointable: false
+        - tool: create_pull_request
+          writes: true
+          write_scope: [github:pulls]
+          checkpointable: false
+        - tool: list_repos
+          read_only: true
+        - tool: get_file_contents
+          read_only: true
+
#### Skill Hierarchy and Composition Skills can include other skills via the `includes` field. When a skill includes another, all tools from the child skill (and transitively, all tools from any skills *it* includes) become part of the parent skill's flattened tool set. -``` +

 local/full-stack-dev
   ├── includes: local/file-ops
   │     └── builtins: file_operations, directory_operations
@@ -9694,7 +9695,7 @@ local/full-stack-dev
     create_issue, create_pr, list_repos, get_file_contents,
     code-review-checklist (agent skill),
     local/run-migrations, local/deploy-staging (named tools)
-```
+
**Rules for skill composition:** @@ -9707,29 +9708,29 @@ local/full-stack-dev Skills are managed through the `agents skill` CLI commands. Named tools referenced by skills must first be registered via `agents tool add` (see the **Tools** section): -```bash -# First, register any named tools the skill will reference -agents tool add --config ./tools/run-migrations.yaml local/run-migrations -agents tool add --config ./tools/deploy-staging.yaml local/deploy-staging +

+# First, register any named tools the skill will reference
+agents tool add --config ./tools/run-migrations.yaml local/run-migrations
+agents tool add --config ./tools/deploy-staging.yaml local/deploy-staging
 
-# Then register the skill (which references those tools by name)
-agents skill add --config ./skills/devops-toolkit.yaml local/devops-toolkit
+# Then register the skill (which references those tools by name)
+agents skill add --config ./skills/devops-toolkit.yaml local/devops-toolkit
 
-# Update an existing skill (re-reads the config file, overwrites registration)
-agents skill add --config ./skills/devops-toolkit.yaml --update local/devops-toolkit
+# Update an existing skill (re-reads the config file, overwrites registration)
+agents skill add --config ./skills/devops-toolkit.yaml --update local/devops-toolkit
 
-# List all registered skills
+# List all registered skills
 agents skill list
 
-# Show details for a skill (tools, includes, metadata)
+# Show details for a skill (tools, includes, metadata)
 agents skill show local/devops-toolkit
 
-# List all tools provided by a skill (flattened, including from child skills)
+# List all tools provided by a skill (flattened, including from child skills)
 agents skill tools local/devops-toolkit
 
-# Remove a skill
+# Remove a skill
 agents skill remove local/devops-toolkit
-```
+
Once registered, a skill is available to be referenced by any actor configuration. Skills persist in the database (local or server) and follow the same namespace rules as actors, tools, and actions. @@ -9739,49 +9740,49 @@ Actors reference skills **by name** to make collections of tools available for L The actor's configuration lists which skills it should have access to: -```yaml -# File: actors/code-assistant.yaml -cleveragents: - version: "3.0" - default_actor: code_assistant +

+# File: actors/code-assistant.yaml
+cleveragents:
+  version: "3.0"
+  default_actor: code_assistant
 
-actors:
-  code_assistant:
-    type: llm
-    config:
-      actor: anthropic/claude-3-opus
-      temperature: 0.3
-      system_prompt: |
+actors:
+  code_assistant:
+    type: llm
+    config:
+      actor: anthropic/claude-3-opus
+      temperature: 0.3
+      system_prompt: |
         You are a code assistant with access to file, git, and GitHub tools.
         Current task: {{ context.task_description }}
 
-    # Reference skills by fully-qualified name.
-    # All tools from these skills become available to this actor.
-    skills:
+    # Reference skills by fully-qualified name.
+    # All tools from these skills become available to this actor.
+    skills:
       - local/file-ops
       - local/git-ops
       - local/github
 
-  # Or reference a single composite skill that includes all of the above
-  full_stack_assistant:
-    type: llm
-    config:
-      actor: anthropic/claude-3-opus
-      system_prompt: |
+  # Or reference a single composite skill that includes all of the above
+  full_stack_assistant:
+    type: llm
+    config:
+      actor: anthropic/claude-3-opus
+      system_prompt: |
         You are a full-stack development assistant.
 
-    skills:
+    skills:
       - local/full-stack-dev    # includes file-ops, git-ops, github, etc.
-```
+
**Server-qualified skill references**: When connected to multiple servers, skills can be disambiguated with a server prefix, same as actors: -```yaml -skills: - - dev:freemo/custom-analysis # from dev server, personal namespace - - prod:cleverthis/deploy-tools # from prod server, org namespace +

+skills:
+  - dev:freemo/custom-analysis     # from dev server, personal namespace
+  - prod:cleverthis/deploy-tools   # from prod server, org namespace
   - local/file-ops                 # local skill
-```
+
#### Skill Registry @@ -10272,19 +10273,19 @@ Consider a web application called "Acme Dashboard" with three registered resourc **Registration:** -```bash -# 1) Checked-out git repo (has local files on disk) -agents resource add git-checkout local/acme-app \ - --path /home/alice/projects/acme-dashboard --branch main +

+# 1) Checked-out git repo (has local files on disk)
+agents resource add git-checkout local/acme-app \
+  --path /home/alice/projects/acme-dashboard --branch main
 
-# 2) Git repo via remote URL (no local checkout — metadata only)
-agents resource add git local/acme-upstream \
-  --url git@github.com:acmecorp/dashboard.git
+# 2) Git repo via remote URL (no local checkout — metadata only)
+agents resource add git local/acme-upstream \
+  --url git@github.com:acmecorp/dashboard.git
 
-# 3) Standalone directory (not a git repo — just files on disk)
-agents resource add fs-directory local/acme-deploy \
-  --path /opt/deploy/acme-dashboard
-```
+# 3) Standalone directory (not a git repo — just files on disk)
+agents resource add fs-directory local/acme-deploy \
+  --path /opt/deploy/acme-dashboard
+
**What gets auto-discovered for each:** @@ -10566,67 +10567,67 @@ Additional resource types (databases, APIs, cloud infrastructure, etc.) can be a Custom resource types are defined in YAML configuration files and registered via `agents resource type add`. Once registered, a custom type automatically becomes available as a new subcommand under `agents resource add`. -```yaml -# File: resource-types/database.yaml -cleveragents: - version: "3.0" +

+# File: resource-types/database.yaml
+cleveragents:
+  version: "3.0"
 
-resource_type:
-  name: local/database
-  description: "A SQL database (PostgreSQL, MySQL, SQLite, etc.)"
-  physical_or_virtual: physical
-  user_addable: true
+resource_type:
+  name: local/database
+  description: "A SQL database (PostgreSQL, MySQL, SQLite, etc.)"
+  physical_or_virtual: physical
+  user_addable: true
 
-  # CLI arguments for `agents resource add local/database`
-  cli_arguments:
-    - name: connection-string
-      type: string
-      required: true
-      description: "Database connection string (e.g., postgresql://host/dbname)"
-      validation:
-        pattern: "^(postgresql|mysql|sqlite)://"
-    - name: schema
-      type: string
-      required: false
-      description: "Default schema to use"
-    - name: read-only
-      type: boolean
-      required: false
-      default: false
-      description: "Whether the database should be treated as read-only"
+  # CLI arguments for `agents resource add local/database`
+  cli_arguments:
+    - name: connection-string
+      type: string
+      required: true
+      description: "Database connection string (e.g., postgresql://host/dbname)"
+      validation:
+        pattern: "^(postgresql|mysql|sqlite)://"
+    - name: schema
+      type: string
+      required: false
+      description: "Default schema to use"
+    - name: read-only
+      type: boolean
+      required: false
+      default: false
+      description: "Whether the database should be treated as read-only"
 
-  # Sandbox and handler
-  sandbox_strategy: transaction_rollback
-  handler: DatabaseHandler
-  checkpointable: true
+  # Sandbox and handler
+  sandbox_strategy: transaction_rollback
+  handler: DatabaseHandler
+  checkpointable: true
 
-  # Allowed parent types (empty means can be top-level)
-  allowed_parent_types: []
+  # Allowed parent types (empty means can be top-level)
+  allowed_parent_types: []
 
-  # Child types
-  child_types:
-    - type: local/db-schema
-      auto_discover: true
-      manual_link: false
-      description: "Discovered database schemas"
-    - type: local/db-table
-      auto_discover: true
-      manual_link: false
-      description: "Discovered tables within schemas"
+  # Child types
+  child_types:
+    - type: local/db-schema
+      auto_discover: true
+      manual_link: false
+      description: "Discovered database schemas"
+    - type: local/db-table
+      auto_discover: true
+      manual_link: false
+      description: "Discovered tables within schemas"
 
-  # Capabilities
-  capabilities:
-    readable: true
-    writable: true
-    sandboxable: true
-    checkpointable: true
-```
+  # Capabilities
+  capabilities:
+    readable: true
+    writable: true
+    sandboxable: true
+    checkpointable: true
+
When this type is registered: -```bash -agents resource type add --config ./resource-types/database.yaml local/database -# Now available: agents resource add local/database --connection-string CONN [--schema SCHEMA] [--read-only] -``` +

+agents resource type add --config ./resource-types/database.yaml local/database
+# Now available: agents resource add local/database <NAME> --connection-string CONN [--schema SCHEMA] [--read-only]
+
The `user_addable` field determines whether the type appears as a subcommand. Types with `user_addable: false` are only auto-generated as children — for example, `git-remote`, `git-branch`, `git-commit`, and `git-tree-entry` are never created directly by users but are discovered when a `git` (or `git-checkout`) resource is registered. @@ -10885,29 +10886,29 @@ This enables powerful queries like: Resources are created via `agents resource add ` with type-specific arguments. Auto-discovered children are created automatically: -```bash -# Register a checked-out git repository (most common) -agents resource add git-checkout local/api-repo --path /home/user/projects/api-service --branch main -# Auto-discovers: git child (repo metadata, remotes, branches, commits, tree entries) -# + fs-directory child (worktree root directory, subdirectories, files) +

+# Register a checked-out git repository (most common)
+agents resource add git-checkout local/api-repo --path /home/user/projects/api-service --branch main
+# Auto-discovers: git child (repo metadata, remotes, branches, commits, tree entries)
+#                 + fs-directory child (worktree root directory, subdirectories, files)
 
-# Register a git repo via remote URL (no local checkout — exists on remote server)
-agents resource add git local/upstream --url git@github.com:org/upstream.git
-# Auto-discovers: remotes, branches, tags, commits, trees, tree entries, stashes, submodules
-#                 (no fs-directory — not checked out locally)
+# Register a git repo via remote URL (no local checkout — exists on remote server)
+agents resource add git local/upstream --url git@github.com:org/upstream.git
+# Auto-discovers: remotes, branches, tags, commits, trees, tree entries, stashes, submodules
+#                 (no fs-directory — not checked out locally)
 
-# Register a standalone directory (not a git repo — just files on disk)
-agents resource add fs-directory local/docs --path /opt/docs/api-reference
-# Auto-discovers: subdirectories, files, symlinks, hardlinks
+# Register a standalone directory (not a git repo — just files on disk)
+agents resource add fs-directory local/docs --path /opt/docs/api-reference
+# Auto-discovers: subdirectories, files, symlinks, hardlinks
 
-# Register a standalone filesystem mount (entire volume)
-agents resource add fs-mount local/data-volume --mount-path /mnt/data
-# Auto-discovers: root fs-directory, subdirectories, files, symlinks, hardlinks
+# Register a standalone filesystem mount (entire volume)
+agents resource add fs-mount local/data-volume --mount-path /mnt/data
+# Auto-discovers: root fs-directory, subdirectories, files, symlinks, hardlinks
 
-# Link resources to projects (resources must be registered first)
+# Link resources to projects (resources must be registered first)
 agents project link-resource local/api-service local/api-repo
-agents project link-resource local/api-service local/docs --read-only
-```
+agents project link-resource local/api-service local/docs --read-only
+
#### Auto-Discovery @@ -11081,54 +11082,54 @@ CleverAgents provides a unified abstraction that allows tools to work with any r Every resource type provides a handler that implements this interface: -```python -class ResourceHandler(Protocol): - """Handler for a specific resource type.""" +

+class ResourceHandler(Protocol):
+    """Handler for a specific resource type."""
     
-    def read(self, path: str, sandbox: Sandbox) -> Content:
-        """Read content from the sandboxed resource."""
+    def read(self, path: str, sandbox: Sandbox) -> Content:
+        """Read content from the sandboxed resource."""
         ...
     
-    def write(self, path: str, content: Content, sandbox: Sandbox) -> Change:
-        """Write content and return the Change record."""
+    def write(self, path: str, content: Content, sandbox: Sandbox) -> Change:
+        """Write content and return the Change record."""
         ...
     
-    def delete(self, path: str, sandbox: Sandbox) -> Change:
-        """Delete resource and return the Change record."""
+    def delete(self, path: str, sandbox: Sandbox) -> Change:
+        """Delete resource and return the Change record."""
         ...
     
-    def list(self, pattern: str, sandbox: Sandbox) -> list[str]:
-        """List paths matching pattern."""
+    def list(self, pattern: str, sandbox: Sandbox) -> list[str]:
+        """List paths matching pattern."""
         ...
     
-    def diff(self, path: str, sandbox: Sandbox) -> str:
-        """Generate diff between sandbox and original state."""
+    def diff(self, path: str, sandbox: Sandbox) -> str:
+        """Generate diff between sandbox and original state."""
         ...
     
-    def supports_operation(self, operation: OperationType) -> bool:
-        """Check if this resource supports the given operation."""
+    def supports_operation(self, operation: OperationType) -> bool:
+        """Check if this resource supports the given operation."""
         ...
     
-    def discover_children(self, resource: ResourceRecord) -> list[ResourceRecord]:
-        """Auto-discover child resources (called at registration and refresh)."""
+    def discover_children(self, resource: ResourceRecord) -> list[ResourceRecord]:
+        """Auto-discover child resources (called at registration and refresh)."""
         ...
     
-    def content_hash(self, path: str, sandbox: Sandbox) -> str:
-        """Compute content hash for identity tracking."""
+    def content_hash(self, path: str, sandbox: Sandbox) -> str:
+        """Compute content hash for identity tracking."""
         ...
     
-    def create_sandbox(self, resource: ResourceRecord) -> Sandbox:
-        """Create a sandbox for this resource using its type's strategy."""
+    def create_sandbox(self, resource: ResourceRecord) -> Sandbox:
+        """Create a sandbox for this resource using its type's strategy."""
         ...
     
-    def create_checkpoint(self, sandbox: Sandbox) -> Checkpoint:
-        """Create a checkpoint within the sandbox."""
+    def create_checkpoint(self, sandbox: Sandbox) -> Checkpoint:
+        """Create a checkpoint within the sandbox."""
         ...
     
-    def rollback_to(self, sandbox: Sandbox, checkpoint: Checkpoint) -> None:
-        """Roll back sandbox state to a checkpoint."""
+    def rollback_to(self, sandbox: Sandbox, checkpoint: Checkpoint) -> None:
+        """Roll back sandbox state to a checkpoint."""
         ...
-```
+
##### Built-in Resource Handlers @@ -11168,14 +11169,14 @@ sequenceDiagram When a tool has multiple resource slots bound, the path scheme or slot name disambiguates: -``` +

 # Explicit slot reference
-path://repo/src/main.py      → routes to the "repo" slot's bound resource
-path://docs/api/readme.md    → routes to the "docs" slot's bound resource
+path://repo/src/main.py      → routes to the "repo" slot's bound resource
+path://docs/api/readme.md    → routes to the "docs" slot's bound resource
 
-# Default: unqualified paths route to the tool's primary resource slot
+# Default: unqualified paths route to the tool's primary resource slot
 src/main.py                  → routes to the first (or only) resource slot
-```
+
### Code Intelligence & Context Discovery @@ -11199,46 +11200,46 @@ CleverAgents employs a sophisticated multi-layered indexing and discovery system The indexing engine operates across three complementary modalities: -```yaml -IndexingEngine: - modalities: - # Traditional text-based indexing - text_index: - type: "full_text_search" - backend: "tantivy" | "elasticsearch" | "sqlite_fts" - features: +

+IndexingEngine:
+  modalities:
+    # Traditional text-based indexing
+    text_index:
+      type: "full_text_search"
+      backend: "tantivy" | "elasticsearch" | "sqlite_fts"
+      features:
         - Token-based search
         - Regex patterns
         - Language-aware tokenization
         - File path indexing
     
-    # Semantic understanding via embeddings
-    vector_index:
-      type: "embedding_search"
-      backend: "faiss" | "qdrant" | "weaviate" | "pgvector"
-      models:
-        - code: "codegen-6B-multi"
-        - docs: "instructor-xl"
-        - cross-modal: "clip-code"
-      features:
+    # Semantic understanding via embeddings
+    vector_index:
+      type: "embedding_search"
+      backend: "faiss" | "qdrant" | "weaviate" | "pgvector"
+      models:
+        - code: "codegen-6B-multi"
+        - docs: "instructor-xl"
+        - cross-modal: "clip-code"
+      features:
         - Function-level embeddings
         - Class-level embeddings
         - Module-level embeddings
         - Documentation embeddings
         - Cross-language similarity
     
-    # Structural understanding via graph
-    graph_index:
-      type: "rdf_knowledge_graph"
-      backend: "blazegraph" | "stardog" | "apache_jena" | "neo4j"
-      ontology: "CodeOntology"
-      features:
+    # Structural understanding via graph
+    graph_index:
+      type: "rdf_knowledge_graph"
+      backend: "blazegraph" | "stardog" | "apache_jena" | "neo4j"
+      ontology: "CodeOntology"
+      features:
         - AST-based relationships
         - Dependency graphs
         - Call graphs
         - Inheritance hierarchies
         - Data flow analysis
-```
+
##### 2. RDF-Based Code Knowledge Graph @@ -11246,179 +11247,179 @@ The graph store represents code as a rich semantic network using RDF (Resource D **Core Ontology Design:** -```turtle -# CodeOntology - Core vocabulary for code representation -@prefix code: . -@prefix rdfs: . -@prefix xsd: . +

+# CodeOntology - Core vocabulary for code representation
+@prefix code: <https://cleveragents.ai/ontology/code#> .
+@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
+@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
 
-# Core Classes
-code:Module a rdfs:Class ;
-    rdfs:comment "A code module (file, package, namespace)" .
+# Core Classes
+code:Module a rdfs:Class ;
+    rdfs:comment "A code module (file, package, namespace)" .
 
-code:Class a rdfs:Class ;
-    rdfs:comment "A class or similar construct" .
+code:Class a rdfs:Class ;
+    rdfs:comment "A class or similar construct" .
 
-code:Function a rdfs:Class ;
-    rdfs:comment "A function, method, or procedure" .
+code:Function a rdfs:Class ;
+    rdfs:comment "A function, method, or procedure" .
 
-code:Variable a rdfs:Class ;
-    rdfs:comment "A variable, constant, or field" .
+code:Variable a rdfs:Class ;
+    rdfs:comment "A variable, constant, or field" .
 
-code:Type a rdfs:Class ;
-    rdfs:comment "A type definition" .
+code:Type a rdfs:Class ;
+    rdfs:comment "A type definition" .
 
-# Core Properties
-code:contains a rdf:Property ;
-    rdfs:domain code:Module ;
-    rdfs:range code:Entity ;
-    rdfs:comment "Module contains entity" .
+# Core Properties
+code:contains a rdf:Property ;
+    rdfs:domain code:Module ;
+    rdfs:range code:Entity ;
+    rdfs:comment "Module contains entity" .
 
-code:imports a rdf:Property ;
-    rdfs:domain code:Module ;
-    rdfs:range code:Module ;
-    rdfs:comment "Module imports another module" .
+code:imports a rdf:Property ;
+    rdfs:domain code:Module ;
+    rdfs:range code:Module ;
+    rdfs:comment "Module imports another module" .
 
-code:extends a rdf:Property ;
-    rdfs:domain code:Class ;
-    rdfs:range code:Class ;
-    rdfs:comment "Class inheritance relationship" .
+code:extends a rdf:Property ;
+    rdfs:domain code:Class ;
+    rdfs:range code:Class ;
+    rdfs:comment "Class inheritance relationship" .
 
-code:calls a rdf:Property ;
-    rdfs:domain code:Function ;
-    rdfs:range code:Function ;
-    rdfs:comment "Function calls another function" .
+code:calls a rdf:Property ;
+    rdfs:domain code:Function ;
+    rdfs:range code:Function ;
+    rdfs:comment "Function calls another function" .
 
-code:references a rdf:Property ;
-    rdfs:domain code:Entity ;
-    rdfs:range code:Entity ;
-    rdfs:comment "Entity references another entity" .
+code:references a rdf:Property ;
+    rdfs:domain code:Entity ;
+    rdfs:range code:Entity ;
+    rdfs:comment "Entity references another entity" .
 
-code:hasParameter a rdf:Property ;
-    rdfs:domain code:Function ;
-    rdfs:range code:Parameter ;
-    rdfs:comment "Function has parameter" .
+code:hasParameter a rdf:Property ;
+    rdfs:domain code:Function ;
+    rdfs:range code:Parameter ;
+    rdfs:comment "Function has parameter" .
 
-code:returns a rdf:Property ;
-    rdfs:domain code:Function ;
-    rdfs:range code:Type ;
-    rdfs:comment "Function return type" .
+code:returns a rdf:Property ;
+    rdfs:domain code:Function ;
+    rdfs:range code:Type ;
+    rdfs:comment "Function return type" .
 
-# Annotations
-code:hasDocstring a rdf:Property ;
-    rdfs:domain code:Entity ;
-    rdfs:range xsd:string .
+# Annotations
+code:hasDocstring a rdf:Property ;
+    rdfs:domain code:Entity ;
+    rdfs:range xsd:string .
 
-code:hasComplexity a rdf:Property ;
-    rdfs:domain code:Function ;
-    rdfs:range xsd:integer ;
-    rdfs:comment "Cyclomatic complexity" .
+code:hasComplexity a rdf:Property ;
+    rdfs:domain code:Function ;
+    rdfs:range xsd:integer ;
+    rdfs:comment "Cyclomatic complexity" .
 
-code:hasTestCoverage a rdf:Property ;
-    rdfs:domain code:Entity ;
-    rdfs:range xsd:decimal ;
-    rdfs:comment "Test coverage percentage" .
-```
+code:hasTestCoverage a rdf:Property ;
+    rdfs:domain code:Entity ;
+    rdfs:range xsd:decimal ;
+    rdfs:comment "Test coverage percentage" .
+
**Example Knowledge Graph Fragment:** -```turtle -# Concrete example: Authentication module - a code:Module ; - code:imports ; - code:imports ; - code:contains . +

+# Concrete example: Authentication module
+<file:///src/auth/auth_manager.py> a code:Module ;
+    code:imports <file:///src/core/user.py> ;
+    code:imports <file:///src/utils/crypto.py> ;
+    code:contains <class://AuthManager> .
 
- a code:Class ;
-    code:hasMethod  ;
-    code:hasMethod  ;
-    code:extends  ;
-    code:hasDocstring "Manages user authentication and session tokens" .
+<class://AuthManager> a code:Class ;
+    code:hasMethod <method://AuthManager.authenticate> ;
+    code:hasMethod <method://AuthManager.validate_token> ;
+    code:extends <class://BaseManager> ;
+    code:hasDocstring "Manages user authentication and session tokens" .
 
- a code:Function ;
-    code:hasParameter  ;
-    code:hasParameter  ;
-    code:returns  ;
-    code:calls  ;
-    code:calls  ;
-    code:hasComplexity 8 ;
-    code:hasTestCoverage 0.95 .
-```
+<method://AuthManager.authenticate> a code:Function ;
+    code:hasParameter <param://username> ;
+    code:hasParameter <param://password> ;
+    code:returns <type://AuthToken> ;
+    code:calls <method://CryptoUtils.hash_password> ;
+    code:calls <method://UserDB.find_user> ;
+    code:hasComplexity 8 ;
+    code:hasTestCoverage 0.95 .
+
**Advanced Graph Queries:** -```sparql -# Find all functions that manipulate user authentication -PREFIX code: -SELECT ?function ?module -WHERE { - ?function a code:Function ; - code:calls*/code:references ?entity . - ?entity rdfs:label ?label . - FILTER(CONTAINS(LCASE(?label), "auth") || CONTAINS(LCASE(?label), "user")) - ?module code:contains ?function . +

+# Find all functions that manipulate user authentication
+PREFIX code: <https://cleveragents.ai/ontology/code#>
+SELECT ?function ?module
+WHERE {
+    ?function a code:Function ;
+              code:calls*/code:references ?entity .
+    ?entity rdfs:label ?label .
+    FILTER(CONTAINS(LCASE(?label), "auth") || CONTAINS(LCASE(?label), "user"))
+    ?module code:contains ?function .
 }
 
-# Find circular dependencies
-SELECT ?module1 ?module2
-WHERE {
-    ?module1 code:imports+ ?module2 .
-    ?module2 code:imports+ ?module1 .
-    FILTER(?module1 != ?module2)
+# Find circular dependencies
+SELECT ?module1 ?module2
+WHERE {
+    ?module1 code:imports+ ?module2 .
+    ?module2 code:imports+ ?module1 .
+    FILTER(?module1 != ?module2)
 }
 
-# Find most complex untested functions
-SELECT ?function ?complexity
-WHERE {
-    ?function a code:Function ;
-              code:hasComplexity ?complexity ;
-              code:hasTestCoverage ?coverage .
-    FILTER(?complexity > 10 && ?coverage < 0.5)
+# Find most complex untested functions
+SELECT ?function ?complexity
+WHERE {
+    ?function a code:Function ;
+              code:hasComplexity ?complexity ;
+              code:hasTestCoverage ?coverage .
+    FILTER(?complexity > 10 && ?coverage < 0.5)
 }
-ORDER BY DESC(?complexity)
-LIMIT 10
-```
+ORDER BY DESC(?complexity)
+LIMIT 10
+
##### 3. Intelligent Context Assembly Pipeline The context assembly pipeline leverages all three indices to build optimal context for each agent: -```python -class ContextAssemblyPipeline: - def assemble_context(self, - query: str, - actor_type: str, - resource_scope: List[Resource], - max_tokens: int) -> Context: +

+class ContextAssemblyPipeline:
+    def assemble_context(self, 
+                        query: str, 
+                        actor_type: str,
+                        resource_scope: List[Resource],
+                        max_tokens: int) -> Context:
         
-        # Stage 1: Query Understanding
+        # Stage 1: Query Understanding
         intent = self.analyze_query_intent(query)
-        entities = self.extract_entities(query)  # Classes, functions, concepts
+        entities = self.extract_entities(query)  # Classes, functions, concepts
         
-        # Stage 2: Multi-Modal Search
+        # Stage 2: Multi-Modal Search
         results = SearchResults()
         
-        # Text search for exact matches
-        if intent.needs_exact_match:
+        # Text search for exact matches
+        if intent.needs_exact_match:
             text_results = self.text_index.search(
                 query=query,
-                filters={"resources": resource_scope},
+                filters={"resources": resource_scope},
                 limit=100
             )
             results.add(text_results)
         
-        # Vector search for semantic similarity
-        if intent.needs_semantic_match:
+        # Vector search for semantic similarity
+        if intent.needs_semantic_match:
             query_embedding = self.embed_query(query, actor_type)
             vector_results = self.vector_index.search(
                 embedding=query_embedding,
-                filters={"resources": resource_scope},
+                filters={"resources": resource_scope},
                 limit=50
             )
             results.add(vector_results)
         
-        # Graph traversal for structural relationships
-        if entities:
+        # Graph traversal for structural relationships
+        if entities:
             graph_results = self.graph_index.traverse(
                 start_nodes=entities,
                 patterns=self.get_patterns_for_actor(actor_type),
@@ -11427,168 +11428,168 @@ class ContextAssemblyPipeline:
             )
             results.add(graph_results)
         
-        # Stage 3: Relevance Ranking
+        # Stage 3: Relevance Ranking
         ranked_results = self.rank_by_relevance(
             results=results,
             actor_type=actor_type,
             query_intent=intent
         )
         
-        # Stage 4: Context Optimization
+        # Stage 4: Context Optimization
         context = self.optimize_context(
             ranked_results=ranked_results,
             max_tokens=max_tokens,
             strategy=self.get_strategy_for_actor(actor_type)
         )
         
-        return context
+        return context
     
-    def get_patterns_for_actor(self, actor_type: str) -> List[GraphPattern]:
-        """Different actors need different traversal patterns"""
+    def get_patterns_for_actor(self, actor_type: str) -> List[GraphPattern]:
+        """Different actors need different traversal patterns"""
         patterns = {
-            "strategist": [
-                "module_dependencies",      # Understand architecture
-                "interface_boundaries",     # Find API surfaces
-                "test_coverage_gaps"        # Identify risks
+            "strategist": [
+                "module_dependencies",      # Understand architecture
+                "interface_boundaries",     # Find API surfaces
+                "test_coverage_gaps"        # Identify risks
             ],
-            "executor": [
-                "implementation_details",   # Get full function bodies
-                "local_dependencies",       # Find what to change
-                "usage_patterns"           # Understand call sites
+            "executor": [
+                "implementation_details",   # Get full function bodies
+                "local_dependencies",       # Find what to change
+                "usage_patterns"           # Understand call sites
             ],
-            "reviewer": [
-                "change_impact_analysis",   # What could break
-                "similar_patterns",        # Consistency checks
-                "test_relationships"       # Verification paths
+            "reviewer": [
+                "change_impact_analysis",   # What could break
+                "similar_patterns",        # Consistency checks
+                "test_relationships"       # Verification paths
             ]
         }
-        return patterns.get(actor_type, ["general_traversal"])
-```
+        return patterns.get(actor_type, ["general_traversal"])
+
##### 4. Plugin Architecture for Extensibility The system is designed for extensibility at every level: -```yaml -PluginSystem: - # Language-specific analyzers - analyzers: - python: - class: "PythonAnalyzer" - features: +

+PluginSystem:
+  # Language-specific analyzers
+  analyzers:
+    python:
+      class: "PythonAnalyzer"
+      features:
         - AST parsing via ast module
         - Type inference via mypy
         - Import resolution
         - Docstring extraction
     
-    typescript:
-      class: "TypeScriptAnalyzer"
-      features:
+    typescript:
+      class: "TypeScriptAnalyzer"
+      features:
         - TSC-based parsing
         - Type extraction
         - Module resolution
         - JSDoc parsing
     
-    rust:
-      class: "RustAnalyzer"
-      features:
+    rust:
+      class: "RustAnalyzer"
+      features:
         - rust-analyzer integration
         - Lifetime analysis
         - Trait resolution
         - Macro expansion
     
-    # Custom analyzer example
-    custom_dsl:
-      class: "CustomDSLAnalyzer"
-      config:
-        grammar: "path/to/grammar.peg"
-        semantic_rules: "path/to/rules.yaml"
+    # Custom analyzer example
+    custom_dsl:
+      class: "CustomDSLAnalyzer"
+      config:
+        grammar: "path/to/grammar.peg"
+        semantic_rules: "path/to/rules.yaml"
   
-  # Index backend providers
-  backends:
-    graph:
-      - name: "blazegraph"
-        class: "BlazegraphBackend"
-        scalability: "billions of triples"
-        features: ["SPARQL", "reasoning", "geospatial"]
+  # Index backend providers
+  backends:
+    graph:
+      - name: "blazegraph"
+        class: "BlazegraphBackend"
+        scalability: "billions of triples"
+        features: ["SPARQL", "reasoning", "geospatial"]
       
-      - name: "neo4j"
-        class: "Neo4jBackend"
-        scalability: "enterprise"
-        features: ["Cypher", "APOC", "GDS"]
+      - name: "neo4j"
+        class: "Neo4jBackend"
+        scalability: "enterprise"
+        features: ["Cypher", "APOC", "GDS"]
       
-      - name: "custom_graph"
-        class: "MyCustomGraphDB"
-        config:
-          connection: "custom://localhost:7687"
+      - name: "custom_graph"
+        class: "MyCustomGraphDB"
+        config:
+          connection: "custom://localhost:7687"
     
-    vector:
-      - name: "faiss"
-        class: "FaissBackend"
-        scalability: "100M vectors"
-        features: ["GPU acceleration", "HNSW"]
+    vector:
+      - name: "faiss"
+        class: "FaissBackend"
+        scalability: "100M vectors"
+        features: ["GPU acceleration", "HNSW"]
       
-      - name: "qdrant"
-        class: "QdrantBackend"
-        scalability: "distributed"
-        features: ["filtering", "payloads", "snapshots"]
+      - name: "qdrant"
+        class: "QdrantBackend"
+        scalability: "distributed"
+        features: ["filtering", "payloads", "snapshots"]
   
-  # Embedding model providers
-  embedders:
-    - name: "openai"
-      class: "OpenAIEmbedder"
-      models: ["text-embedding-3-large", "text-embedding-3-small"]
+  # Embedding model providers
+  embedders:
+    - name: "openai"
+      class: "OpenAIEmbedder"
+      models: ["text-embedding-3-large", "text-embedding-3-small"]
     
-    - name: "local"
-      class: "LocalEmbedder"
-      models: ["all-MiniLM-L6-v2", "instructor-xl"]
+    - name: "local"
+      class: "LocalEmbedder"
+      models: ["all-MiniLM-L6-v2", "instructor-xl"]
     
-    - name: "custom"
-      class: "MyFineTunedEmbedder"
-      model_path: "path/to/model"
-```
+    - name: "custom"
+      class: "MyFineTunedEmbedder"
+      model_path: "path/to/model"
+
##### 5. Agent Skills for Code Intelligence Agents interact with the code intelligence system through a specialized skill (`local/code-intelligence`) that contains tools for semantic search, dependency analysis, and refactoring: -```yaml -# Actor references the code intelligence skill -actors: - code_explorer: - type: llm - config: - actor: anthropic/claude-3-opus - skills: +

+# Actor references the code intelligence skill
+actors:
+  code_explorer:
+    type: llm
+    config:
+      actor: anthropic/claude-3-opus
+    skills:
       - local/code-intelligence   # Provides search_code_semantically,
-                                  # analyze_dependencies, suggest_refactoring_targets
-```
+                                  # analyze_dependencies, suggest_refactoring_targets
+
The `local/code-intelligence` skill uses anonymous inline tools to wrap the code intelligence subsystem. These tools are defined inline because they are tightly coupled to the skill's specific implementation and not reused elsewhere (if any were needed in multiple contexts, they would be registered independently via `agents tool add` and referenced by name): -```yaml -# File: skills/code-intelligence.yaml -skill: - name: local/code-intelligence - description: "Semantic code search, dependency analysis, and refactoring recommendations" +

+# File: skills/code-intelligence.yaml
+skill:
+  name: local/code-intelligence
+  description: "Semantic code search, dependency analysis, and refactoring recommendations"
 
-  anonymous_tools:
-    - name: search_code_semantically
-      description: "Find code similar to a concept using vector search, enriched with dependency context"
-      input_schema:
-        type: object
-        properties:
-          query: { type: string }
-          scope: { type: string, default: "all" }
-          limit: { type: integer, default: 10 }
-        required: [query]
-      capability:
-        read_only: true
-      code: |
+  anonymous_tools:
+    - name: search_code_semantically
+      description: "Find code similar to a concept using vector search, enriched with dependency context"
+      input_schema:
+        type: object
+        properties:
+          query: { type: string }
+          scope: { type: string, default: "all" }
+          limit: { type: integer, default: 10 }
+        required: [query]
+      capability:
+        read_only: true
+      code: |
         results = ctx.code_intelligence.vector_search(
-            query=params["query"],
-            scope=params.get("scope", "all"),
-            limit=params.get("limit", 10)
+            query=params["query"],
+            scope=params.get("scope", "all"),
+            limit=params.get("limit", 10)
         )
         for result in results:
             result.context = ctx.code_intelligence.get_dependencies(
@@ -11596,366 +11597,366 @@ skill:
             )
         return results
 
-    - name: analyze_dependencies
-      description: "Analyze module dependencies using graph store"
-      input_schema:
-        type: object
-        properties:
-          module_path: { type: string }
-        required: [module_path]
-      capability:
-        read_only: true
-      code: |
-        module = params["module_path"]
-        deps = ctx.code_intelligence.graph_query(f'''
-            PREFIX code: 
+    - name: analyze_dependencies
+      description: "Analyze module dependencies using graph store"
+      input_schema:
+        type: object
+        properties:
+          module_path: { type: string }
+        required: [module_path]
+      capability:
+        read_only: true
+      code: |
+        module = params["module_path"]
+        deps = ctx.code_intelligence.graph_query(f'''
+            PREFIX code: <https://cleveragents.ai/ontology/code#>
             SELECT ?dep ?type WHERE {{
-                <{module}> code:imports* ?dep . ?dep a ?type .
+                <{module}> code:imports* ?dep . ?dep a ?type .
             }}
-        ''')
+        ''')
         return {
-            "direct_deps": len([d for d in deps if d.distance == 1]),
-            "transitive_deps": len(deps),
-            "circular_deps": ctx.code_intelligence.find_circular_deps(module),
-            "dependency_graph": deps
+            "direct_deps": len([d for d in deps if d.distance == 1]),
+            "transitive_deps": len(deps),
+            "circular_deps": ctx.code_intelligence.find_circular_deps(module),
+            "dependency_graph": deps
         }
 
-    - name: suggest_refactoring_targets
-      description: "Combine text, graph, and vector search to find refactoring targets"
-      input_schema:
-        type: object
-        properties:
-          scope: { type: string }
-        required: [scope]
-      capability:
-        read_only: true
-      code: |
+    - name: suggest_refactoring_targets
+      description: "Combine text, graph, and vector search to find refactoring targets"
+      input_schema:
+        type: object
+        properties:
+          scope: { type: string }
+        required: [scope]
+      capability:
+        read_only: true
+      code: |
         todos = ctx.code_intelligence.text_search(
-            pattern="(TODO|FIXME|HACK):", scope=params["scope"]
+            pattern="(TODO|FIXME|HACK):", scope=params["scope"]
         )
-        complex_functions = ctx.code_intelligence.graph_query('''
+        complex_functions = ctx.code_intelligence.graph_query('''
             SELECT ?func ?complexity ?coverage WHERE {
                 ?func a code:Function ;
-                      code:hasComplexity ?complexity ;
-                      code:hasTestCoverage ?coverage .
-                FILTER(?complexity > 15 || ?coverage < 0.3)
+                      code:hasComplexity ?complexity ;
+                      code:hasTestCoverage ?coverage .
+                FILTER(?complexity > 15 || ?coverage < 0.3)
             } ORDER BY DESC(?complexity)
-        ''')
+        ''')
         smells = []
-        for pattern in ["duplicate code", "long method", "large class"]:
+        for pattern in ["duplicate code", "long method", "large class"]:
             smells.extend(ctx.code_intelligence.find_similar_code(
                 pattern=pattern, threshold=0.8
             ))
         return {
-            "high_priority": complex_functions[:5],
-            "technical_debt": todos,
-            "code_smells": smells,
-            "suggested_order": ctx.code_intelligence.rank_by_impact(
+            "high_priority": complex_functions[:5],
+            "technical_debt": todos,
+            "code_smells": smells,
+            "suggested_order": ctx.code_intelligence.rank_by_impact(
                 complex_functions + todos + smells
             )
         }
-```
+
##### 6. Real-time Index Synchronization The system maintains index freshness through immediate, proactive updates: -```python -class IndexSynchronizer: - def __init__(self): +

+class IndexSynchronizer:
+    def __init__(self):
         self.file_watcher = FileSystemWatcher()
         self.git_monitor = GitChangeMonitor()
         self.incremental_indexer = IncrementalIndexer()
     
-    def on_resource_added(self, resource: Resource, project: Project):
-        """When a resource is added to a project, index it immediately"""
-        # Full initial indexing - happens once when resource is added
-        with self.progress_reporter(f"Indexing {resource.name}") as progress:
+    def on_resource_added(self, resource: Resource, project: Project):
+        """When a resource is added to a project, index it immediately"""
+        # Full initial indexing - happens once when resource is added
+        with self.progress_reporter(f"Indexing {resource.name}") as progress:
             files = self.scan_resource(resource)
             total = len(files)
             
-            # Parallel indexing for performance
-            with ThreadPoolExecutor(max_workers=cpu_count()) as executor:
+            # Parallel indexing for performance
+            with ThreadPoolExecutor(max_workers=cpu_count()) as executor:
                 futures = []
                 
-                for i, file in enumerate(files):
+                for i, file in enumerate(files):
                     future = executor.submit(self.index_file_complete, file)
                     futures.append(future)
                     progress.update(i / total)
                 
-                # Wait for all indexing to complete
-                for future in futures:
+                # Wait for all indexing to complete
+                for future in futures:
                     future.result()
         
-        # Now set up watchers for incremental updates
+        # Now set up watchers for incremental updates
         self.setup_watchers(resource)
         
-        # Mark resource as indexed and ready
-        resource.indexing_status = "ready"
+        # Mark resource as indexed and ready
+        resource.indexing_status = "ready"
         self.notify_agents_index_ready(resource)
         
-        # CRITICAL: Agents can now immediately search this resource
-        # No "warming up" period - indices are complete and ready
+        # CRITICAL: Agents can now immediately search this resource
+        # No "warming up" period - indices are complete and ready
     
-    def index_file_complete(self, file_path: str):
-        """Comprehensive initial indexing of a file"""
-        # Parse file once
+    def index_file_complete(self, file_path: str):
+        """Comprehensive initial indexing of a file"""
+        # Parse file once
         ast = self.parse_file(file_path)
         
-        # Update all indices immediately
+        # Update all indices immediately
         self.update_text_index(file_path, ast)
         self.update_vector_embeddings(file_path, ast)
         self.update_graph_triples(file_path, ast)
         
-        # Extract and index all metadata
+        # Extract and index all metadata
         self.index_symbols(file_path, ast)
         self.index_dependencies(file_path, ast)
         self.index_complexity_metrics(file_path, ast)
     
-    def setup_watchers(self, project: Project):
-        # File system watching for immediate updates
+    def setup_watchers(self, project: Project):
+        # File system watching for immediate updates
         self.file_watcher.watch(
             path=project.root_path,
-            events=["create", "modify", "delete"],
+            events=["create", "modify", "delete"],
             callback=self.on_file_change
         )
         
-        # Git monitoring for batch updates (using linked git resource)
-        git_resource = project.get_linked_resource(type="git-checkout")
+        # Git monitoring for batch updates (using linked git resource)
+        git_resource = project.get_linked_resource(type="git-checkout")
         self.git_monitor.watch(
             repo=git_resource,
-            events=["commit", "merge", "rebase"],
+            events=["commit", "merge", "rebase"],
             callback=self.on_git_change
         )
     
-    def on_file_change(self, event: FileEvent):
-        # Quick incremental update
-        if event.type in ["create", "modify"]:
-            # Parse changed file
+    def on_file_change(self, event: FileEvent):
+        # Quick incremental update
+        if event.type in ["create", "modify"]:
+            # Parse changed file
             ast = self.parse_file(event.path)
             
-            # Update indices
+            # Update indices
             self.update_text_index(event.path, ast)
             self.update_vector_embeddings(event.path, ast)
             self.update_graph_triples(event.path, ast)
         
-        elif event.type == "delete":
+        elif event.type == "delete":
             self.remove_from_indices(event.path)
     
-    def on_git_change(self, event: GitEvent):
-        # Batch update for git operations
+    def on_git_change(self, event: GitEvent):
+        # Batch update for git operations
         changed_files = event.get_changed_files()
         
-        # Optimize batch processing
-        with self.batch_updater() as updater:
-            for file in changed_files:
+        # Optimize batch processing
+        with self.batch_updater() as updater:
+            for file in changed_files:
                 updater.queue_update(file)
             
-            # Process in parallel
-            updater.execute(parallel=True)
+            # Process in parallel
+            updater.execute(parallel=True)
     
-    def update_graph_triples(self, file_path: str, ast: AST):
-        # Generate RDF triples from AST
+    def update_graph_triples(self, file_path: str, ast: AST):
+        # Generate RDF triples from AST
         triples = []
         
-        # Module-level triples
+        # Module-level triples
         module_uri = self.uri_for_file(file_path)
-        for import_stmt in ast.imports:
+        for import_stmt in ast.imports:
             imported_uri = self.resolve_import(import_stmt)
-            triples.append((module_uri, "code:imports", imported_uri))
+            triples.append((module_uri, "code:imports", imported_uri))
         
-        # Function-level triples
-        for func in ast.functions:
+        # Function-level triples
+        for func in ast.functions:
             func_uri = self.uri_for_function(func)
-            triples.append((module_uri, "code:contains", func_uri))
-            triples.append((func_uri, "a", "code:Function"))
-            triples.append((func_uri, "code:hasComplexity", func.complexity))
+            triples.append((module_uri, "code:contains", func_uri))
+            triples.append((func_uri, "a", "code:Function"))
+            triples.append((func_uri, "code:hasComplexity", func.complexity))
             
-            # Call relationships
-            for call in func.calls:
+            # Call relationships
+            for call in func.calls:
                 called_uri = self.resolve_call(call)
-                triples.append((func_uri, "code:calls", called_uri))
+                triples.append((func_uri, "code:calls", called_uri))
         
-        # Update graph store
+        # Update graph store
         self.graph_store.update_triples(triples)
-```
+
##### 7. Fallback to Traditional Search When advanced features are unavailable, the system gracefully degrades: -```python -class FallbackSearchProvider: - def search(self, query: str, resources: List[Resource]) -> SearchResults: - # Try advanced search first - try: - if self.vector_index.is_available(): - return self.vector_search(query, resources) - except ServiceUnavailable: - pass +

+class FallbackSearchProvider:
+    def search(self, query: str, resources: List[Resource]) -> SearchResults:
+        # Try advanced search first
+        try:
+            if self.vector_index.is_available():
+                return self.vector_search(query, resources)
+        except ServiceUnavailable:
+            pass
         
-        # Fallback to graph search
-        try:
-            if self.graph_index.is_available():
-                return self.graph_search(query, resources)
-        except ServiceUnavailable:
-            pass
+        # Fallback to graph search
+        try:
+            if self.graph_index.is_available():
+                return self.graph_search(query, resources)
+        except ServiceUnavailable:
+            pass
         
-        # Ultimate fallback: grep-like text search
-        return self.basic_text_search(query, resources)
+        # Ultimate fallback: grep-like text search
+        return self.basic_text_search(query, resources)
     
-    def basic_text_search(self, query: str, resources: List[Resource]):
-        # Use ripgrep or similar for fast text search
+    def basic_text_search(self, query: str, resources: List[Resource]):
+        # Use ripgrep or similar for fast text search
         results = []
         
-        for resource in resources:
+        for resource in resources:
             matches = ripgrep.search(
                 pattern=query,
                 path=resource.path,
                 context_lines=3
             )
             
-            for match in matches:
+            for match in matches:
                 results.append(SearchResult(
                     file=match.file,
                     line=match.line,
                     content=match.content,
-                    score=1.0  # Basic scoring
+                    score=1.0  # Basic scoring
                 ))
         
-        return results
-```
+        return results
+
#### Index Lifecycle The system follows a clear lifecycle for index management: -```yaml +

 Index Lifecycle:
-  1_resource_added:
-    trigger: "agents resource add / agents project link-resource"
-    action: "Immediate full indexing"
-    duration: "Depends on size (10K files ~1 minute)"
-    result: "All indices ready for instant search"
+  1_resource_added:
+    trigger: "agents resource add / agents project link-resource"
+    action: "Immediate full indexing"
+    duration: "Depends on size (10K files ~1 minute)"
+    result: "All indices ready for instant search"
     
-  2_code_changed:
-    trigger: "File modification detected"
-    action: "Immediate incremental update"
-    duration: "Milliseconds per file"
-    result: "Indices stay synchronized"
+  2_code_changed:
+    trigger: "File modification detected"
+    action: "Immediate incremental update"
+    duration: "Milliseconds per file"
+    result: "Indices stay synchronized"
     
-  3_resource_removed:
-    trigger: "agents project unlink-resource / agents resource remove"
-    action: "Immediate index cleanup"
-    duration: "Seconds"
-    result: "No stale data in indices"
+  3_resource_removed:
+    trigger: "agents project unlink-resource / agents resource remove"
+    action: "Immediate index cleanup"
+    duration: "Seconds"
+    result: "No stale data in indices"
     
-  4_maintenance:
-    trigger: "Scheduled or manual"
-    action: "Reindex for consistency"
-    duration: "Background process"
-    result: "Indices optimized and verified"
+  4_maintenance:
+    trigger: "Scheduled or manual"
+    action: "Reindex for consistency"
+    duration: "Background process"
+    result: "Indices optimized and verified"
 
 Key Guarantees:
-  - "No search happens on stale data"
-  - "No 'index building' delays during agent execution"
-  - "Changes visible in search immediately"
-  - "Initial indexing is a one-time cost per resource"
-```
+  - "No search happens on stale data"
+  - "No 'index building' delays during agent execution"
+  - "Changes visible in search immediately"
+  - "Initial indexing is a one-time cost per resource"
+
#### Integration with Context Tiers The Code Intelligence system directly feeds into the three-tier context architecture: -```yaml +

 Context Tier Integration:
-  hot_tier:
-    source: "Real-time results from code intelligence"
-    content:
+  hot_tier:
+    source: "Real-time results from code intelligence"
+    content:
       - Currently edited files
       - Direct dependencies
       - Immediately relevant functions
     
-  warm_tier:
-    source: "Indexed embeddings and graph queries"
-    content:
+  warm_tier:
+    source: "Indexed embeddings and graph queries"
+    content:
       - Recent search results
       - Cached graph traversals
       - Vector similarity matches
       - Active decision contexts
     
-  cold_tier:
-    source: "Historical indices and compressed data"
-    content:
+  cold_tier:
+    source: "Historical indices and compressed data"
+    content:
       - Previous plan analyses
       - Archived dependency graphs
       - Historical refactoring patterns
       - Learned codebase conventions
-```
+
#### Performance Characteristics The system maintains pre-computed indices for instant search performance: -```yaml +

 Performance Metrics:
-  initial_indexing_speed:
-    text_index: "10,000 files/minute"
-    vector_index: "1,000 files/minute (with GPU)"
-    graph_index: "5,000 files/minute"
+  initial_indexing_speed:
+    text_index: "10,000 files/minute"
+    vector_index: "1,000 files/minute (with GPU)"
+    graph_index: "5,000 files/minute"
   
-  query_performance:
-    text_search: "< 100ms for 1M files"
-    vector_search: "< 200ms for 10M embeddings"
-    graph_traversal: "< 500ms for 3-hop queries"
+  query_performance:
+    text_search: "< 100ms for 1M files"
+    vector_search: "< 200ms for 10M embeddings"
+    graph_traversal: "< 500ms for 3-hop queries"
     
-  storage_requirements:
-    text_index: "~10% of source size"
-    vector_index: "~1GB per 100K functions"
-    graph_store: "~100MB per 10K files"
+  storage_requirements:
+    text_index: "~10% of source size"
+    vector_index: "~1GB per 100K functions"
+    graph_store: "~100MB per 10K files"
     
-  scalability:
-    max_files: "No hard limit (tested to 10M files)"
-    max_graph_size: "1B+ triples"
-    max_vectors: "100M+ embeddings"
-```
+  scalability:
+    max_files: "No hard limit (tested to 10M files)"
+    max_graph_size: "1B+ triples"
+    max_vectors: "100M+ embeddings"
+
#### Progressive Enhancement Path Organizations can adopt Code Intelligence features progressively. At each stage, existing resources are reindexed to take advantage of new capabilities: -```yaml -adoption_stages: - stage_1_basic: - features: ["text search", "file watching"] - requirements: ["ripgrep", "sqlite"] - initial_setup: "Index all text content on resource add" - benefit: "Instant exact-match search" +

+adoption_stages:
+  stage_1_basic:
+    features: ["text search", "file watching"]
+    requirements: ["ripgrep", "sqlite"]
+    initial_setup: "Index all text content on resource add"
+    benefit: "Instant exact-match search"
     
-  stage_2_semantic:
-    features: ["vector embeddings", "similarity search"]
-    requirements: ["embedding model", "vector DB"]
-    initial_setup: "Generate embeddings for all code (one-time cost)"
-    benefit: "Instant semantic similarity search"
+  stage_2_semantic:
+    features: ["vector embeddings", "similarity search"]
+    requirements: ["embedding model", "vector DB"]
+    initial_setup: "Generate embeddings for all code (one-time cost)"
+    benefit: "Instant semantic similarity search"
     
-  stage_3_structural:
-    features: ["RDF graph", "relationship queries"]
-    requirements: ["graph database", "language analyzers"]
-    initial_setup: "Parse and build complete knowledge graph"
-    benefit: "Instant relationship queries"
+  stage_3_structural:
+    features: ["RDF graph", "relationship queries"]
+    requirements: ["graph database", "language analyzers"]
+    initial_setup: "Parse and build complete knowledge graph"
+    benefit: "Instant relationship queries"
     
-  stage_4_intelligent:
-    features: ["ML-driven ranking", "automated analysis"]
-    requirements: ["GPU", "training data"]
-    initial_setup: "Pre-compute ML features and rankings"
-    benefit: "Instant intelligent suggestions"
+  stage_4_intelligent:
+    features: ["ML-driven ranking", "automated analysis"]
+    requirements: ["GPU", "training data"]
+    initial_setup: "Pre-compute ML features and rankings"
+    benefit: "Instant intelligent suggestions"
     
-  stage_5_custom:
-    features: ["Domain-specific ontologies", "Custom analyzers"]
-    requirements: ["Domain expertise", "Custom development"]
-    initial_setup: "Build domain-specific indices"
-    benefit: "Instant domain-aware intelligence"
-```
+  stage_5_custom:
+    features: ["Domain-specific ontologies", "Custom analyzers"]
+    requirements: ["Domain expertise", "Custom development"]
+    initial_setup: "Build domain-specific indices"
+    benefit: "Instant domain-aware intelligence"
+
This Code Intelligence & Context Discovery system ensures that CleverAgents can efficiently work with codebases of any size, providing agents with the contextual understanding they need to make intelligent decisions about code changes, refactoring, and feature development. @@ -12119,52 +12120,52 @@ Child plans inherit the parent plan's effective automation profile. If the paren Custom profiles are created via YAML configuration files and registered with `agents automation-profile add`: -```yaml -# File: profiles/careful-auto.yaml -name: local/careful-auto -description: "Autonomous execution with mandatory sandbox and manual apply" -flags: - auto_strategize: true - auto_execute: true - auto_apply: false - auto_decisions_strategize: true - auto_decisions_execute: true - auto_validation_fix: true - auto_strategy_revision: false - auto_child_plans: true - auto_retry_transient: true - auto_checkpoint_restore: true - require_sandbox: true - require_checkpoints: true - allow_unsafe_tools: false -``` +

+# File: profiles/careful-auto.yaml
+name: local/careful-auto
+description: "Autonomous execution with mandatory sandbox and manual apply"
+flags:
+  auto_strategize: true
+  auto_execute: true
+  auto_apply: false
+  auto_decisions_strategize: true
+  auto_decisions_execute: true
+  auto_validation_fix: true
+  auto_strategy_revision: false
+  auto_child_plans: true
+  auto_retry_transient: true
+  auto_checkpoint_restore: true
+  require_sandbox: true
+  require_checkpoints: true
+  allow_unsafe_tools: false
+
-```bash -agents automation-profile add --config ./profiles/careful-auto.yaml -``` +

+agents automation-profile add --config ./profiles/careful-auto.yaml
+
##### Semantic Escalation Even when a profile sets a task to automatic, the system may still escalate to the user when confidence is low. Semantic escalation is orthogonal to automation profiles — it provides a safety net that works within any profile: -```python -class AutonomyController: - def assess_decision_confidence(self, decision, context): +

+class AutonomyController:
+    def assess_decision_confidence(self, decision, context):
         factors = {
-            'past_success_rate': self.get_historical_success(decision.type),
-            'codebase_familiarity': self.get_familiarity_score(context.project),
-            'risk_assessment': self.evaluate_risk(decision),
-            'invariant_complexity': self.analyze_invariants(decision)
+            'past_success_rate': self.get_historical_success(decision.type),
+            'codebase_familiarity': self.get_familiarity_score(context.project),
+            'risk_assessment': self.evaluate_risk(decision),
+            'invariant_complexity': self.analyze_invariants(decision)
         }
         
         confidence = self.compute_confidence(factors)
         
-        if confidence < self.threshold:
-            # Even in autonomous profiles, critical decisions escalate
-            return RequestHumanGuidance(decision, factors)
+        if confidence < self.threshold:
+            # Even in autonomous profiles, critical decisions escalate
+            return RequestHumanGuidance(decision, factors)
         
-        return ProceedAutonomously(decision)
-```
+        return ProceedAutonomously(decision)
+
##### Progressive Trust Building @@ -12251,9 +12252,9 @@ This makes plan runs auditable and correctable. When user requests correction at Decision B: 1. **Mark for Correction** - ``` +

    Decision B.superseded_by = new_decision_id
-   ```
+   
2. **Identify Downstream Impact** - Recursively collect all decisions that depend on Decision B (including `invariant_enforced`, `subplan_spawn`, and `subplan_parallel_spawn` decisions) @@ -12291,26 +12292,26 @@ Once a plan is applied: #### CLI Commands for Correction -```bash -# View decision tree -agents plan tree -agents plan tree --format=json # For visualization tools +

+# View decision tree
+agents plan tree <plan_id>
+agents --format=json plan tree <plan_id>  # For visualization tools
 
-# Inspect a specific decision
-agents plan explain 
-# Shows: question, chosen option, alternatives, rationale, downstream impact
+# Inspect a specific decision
+agents plan explain <decision_id>
+# Shows: question, chosen option, alternatives, rationale, downstream impact
 
-# Correct via revert-and-replay
-agents plan correct  --mode=revert --guidance ""
-# Re-executes from that point with the new guidance
+# Correct via revert-and-replay
+agents plan correct <decision_id> --mode=revert --guidance "<what the decision should be>"
+# Re-executes from that point with the new guidance
 
-# Correct via append (add fix at end)  
-agents plan correct  --mode=append --guidance ""
-# Creates a new child plan to fix the outcome without rewriting history
+# Correct via append (add fix at end)  
+agents plan correct <decision_id> --mode=append --guidance "<description of the fix>"
+# Creates a new child plan to fix the outcome without rewriting history
 
-# Compare old vs new after correction
-agents plan diff --correction 
-```
+# Compare old vs new after correction
+agents plan diff --correction <correction_attempt_id>
+
#### Correction Safety @@ -12468,25 +12469,25 @@ The current system generates code as a single text blob that gets written to one #### Implementation Steps 1. **Create Resource Abstraction Layer** - ```python - # New modules needed: +

+   # New modules needed:
    src/cleveragents/domain/models/resources.py
    src/cleveragents/domain/resources/handlers.py
    src/cleveragents/domain/resources/sandbox.py
-   ```
+   
2. **Implement Built-in Tools (via built-in skills)** - ```python - # Core file operations (provided by built-in skill groups) - read_file(path: str) -> str - write_file(path: str, content: str) -> None - edit_file(path: str, changes: list[Edit]) -> None - delete_file(path: str) -> None - move_file(src: str, dst: str) -> None - create_directory(path: str) -> None - list_files(pattern: str) -> list[str] - search_files(pattern: str, content_pattern: str) -> list[Match] - ``` +

+   # Core file operations (provided by built-in skill groups)
+   read_file(path: str) -> str
+   write_file(path: str, content: str) -> None
+   edit_file(path: str, changes: list[Edit]) -> None
+   delete_file(path: str) -> None
+   move_file(src: str, dst: str) -> None
+   create_directory(path: str) -> None
+   list_files(pattern: str) -> list[str]
+   search_files(pattern: str, content_pattern: str) -> list[Match]
+   
3. **Connect Tools to ChangeSet** - Each tool invocation that modifies resources creates a `Change` record @@ -12503,15 +12504,15 @@ Execute phase currently writes directly to the project. The specification requir #### Implementation Steps 1. **Define Sandbox Interface** - ```python - class Sandbox(Protocol): - def create() -> SandboxRef - def read(path: str) -> Content - def write(path: str, content: Content) -> Change - def diff() -> DiffView - def commit() -> None - def rollback() -> None - ``` +

+   class Sandbox(Protocol):
+       def create() -> SandboxRef
+       def read(path: str) -> Content
+       def write(path: str, content: Content) -> Change
+       def diff() -> DiffView
+       def commit() -> None
+       def rollback() -> None
+   
2. **Implement Sandbox Strategies** - `GitWorktreeSandbox` - For git repositories (preferred) @@ -12533,20 +12534,20 @@ No decision tracking exists. The specification's key innovation is recording eve #### Implementation Steps 1. **Create Decision Models** - ```sql - -- New tables needed - CREATE TABLE decisions ( - decision_id TEXT PRIMARY KEY, -- ULID - plan_id TEXT NOT NULL, - parent_decision_id TEXT, - decision_type TEXT NOT NULL, - question TEXT NOT NULL, - chosen_option TEXT NOT NULL, - alternatives_considered TEXT, -- JSON array - context_snapshot TEXT NOT NULL, -- JSON - created_at TEXT NOT NULL +

+   -- New tables needed
+   CREATE TABLE decisions (
+       decision_id TEXT PRIMARY KEY,  -- ULID
+       plan_id TEXT NOT NULL,
+       parent_decision_id TEXT,
+       decision_type TEXT NOT NULL,
+       question TEXT NOT NULL,
+       chosen_option TEXT NOT NULL,
+       alternatives_considered TEXT,  -- JSON array
+       context_snapshot TEXT NOT NULL,  -- JSON
+       created_at TEXT NOT NULL
    );
-   ```
+   
2. **Implement Decision Recording** - Every choice during Strategize creates a Decision record @@ -12554,9 +12555,9 @@ No decision tracking exists. The specification's key innovation is recording eve - Track downstream dependencies 3. **Build Correction Mechanism** - ```bash - agents plan correct --mode=revert --guidance "" - ``` +

+   agents plan correct <decision_id> --mode=revert --guidance "<new decision>"
+   
- Mark decision as superseded - Recompute only affected subtree - Preserve unaffected work @@ -12571,13 +12572,13 @@ Current context is limited to a few hundred characters from a few files. Large c #### Implementation Steps 1. **Eager Indexing on Resource Add** - ```python - def on_resource_added(resource: Resource): - # Index immediately when resource added to project - index_text_content(resource) # Full-text search - generate_embeddings(resource) # Vector embeddings - build_knowledge_graph(resource) # RDF triples - ``` +

+   def on_resource_added(resource: Resource):
+       # Index immediately when resource added to project
+       index_text_content(resource)      # Full-text search
+       generate_embeddings(resource)     # Vector embeddings
+       build_knowledge_graph(resource)   # RDF triples
+   
2. **Three-Index Architecture** - **Text Index**: Tantivy/SQLite FTS for exact matches @@ -12599,27 +12600,27 @@ Actors exist but don't define behavior beyond model selection. The specification #### Implementation Steps 1. **Extend Actor Configuration** - ```yaml - actors: - my_strategist: - type: graph - config: - provider: anthropic - model: claude-3-opus - memory_policy: per_plan - context_view: architect # High-level view - skills: +

+   actors:
+     my_strategist:
+       type: graph
+       config:
+         provider: anthropic
+         model: claude-3-opus
+         memory_policy: per_plan
+         context_view: architect # High-level view
+       skills:
          - local/file-ops             # provides read_file
          - local/code-intelligence    # provides search_code, analyze_dependencies
-       routes:
-         strategize:
-           entry_point: analyze
-           nodes:
-             - name: analyze
-               type: llm
-             - name: plan
-               type: llm
-   ```
+       routes:
+         strategize:
+           entry_point: analyze
+           nodes:
+             - name: analyze
+               type: llm
+             - name: plan
+               type: llm
+   
2. **Implement Tool Access Policies** - Strategy actors: read-only tools @@ -12707,33 +12708,33 @@ No tool or skill abstraction exists. The specification defines tools as independ - Inject bound resources into `ToolExecutionContext.resources` 4. **MCP Tool Adapter** - ```python - class MCPToolAdapter: - def wrap_mcp_tool(self, tool) -> Tool: - # Add sandbox interception - # Add change tracking - # Add capability metadata - # Add resource binding support - ``` +

+   class MCPToolAdapter:
+       def wrap_mcp_tool(self, tool) -> Tool:
+           # Add sandbox interception
+           # Add change tracking
+           # Add capability metadata
+           # Add resource binding support
+   
5. **Tool Capability Metadata** - ```python - class ToolCapability: - read_only: bool - write_scope: list[str] # References resource slot names - checkpointable: bool - idempotent: bool - side_effects: list[str] - ``` +

+   class ToolCapability:
+       read_only: bool
+       write_scope: list[str]       # References resource slot names
+       checkpointable: bool
+       idempotent: bool
+       side_effects: list[str]
+   
6. **External MCP Server Support** - ```yaml - # In tool or skill YAML configuration - mcp_servers: - - name: github - command: "npx @anthropic/mcp-github" - env: {GITHUB_TOKEN: "${GITHUB_TOKEN}"} - ``` +

+   # In tool or skill YAML configuration
+   mcp_servers:
+     - name: github
+       command: "npx @anthropic/mcp-github"
+       env: {GITHUB_TOKEN: "${GITHUB_TOKEN}"}
+   
7. **Agent Skills Adapter** - Implement SKILL.md frontmatter parsing for discovery @@ -12760,18 +12761,18 @@ Current validation is a stub. The specification requires multi-layer semantic va - Record validation in decision metadata 2. **Execution-Time Guards** - ```yaml - # Actor references a skill containing validation tools - skills: +

+   # Actor references a skill containing validation tools
+   skills:
      - local/semantic-validators   # validate_api_compatibility,
-                                   # check_invariants, verify_test_coverage
-   ```
+                                   # check_invariants, verify_test_coverage
+   
3. **Project-Specific Validation** - ```bash - agents project validation add --description "Run tests" --required my-api "pytest" - agents project validation add --description "Lint check" --required my-api "ruff check ." - ``` +

+   agents project validation add --description "Run tests" --required my-api "pytest"
+   agents project validation add --description "Lint check" --required my-api "ruff check ."
+   
#### Estimated Effort: 2 weeks @@ -12783,12 +12784,12 @@ The reactive/LangGraph infrastructure exists but isn't connected to the main pla #### Implementation Steps 1. **Create Unified Plan Graph** - ```python - class PlanLifecycleGraph: - def strategize_subgraph(self) -> StateGraph - def execute_subgraph(self) -> StateGraph - def apply_subgraph(self) -> StateGraph - ``` +

+   class PlanLifecycleGraph:
+       def strategize_subgraph(self) -> StateGraph
+       def execute_subgraph(self) -> StateGraph
+       def apply_subgraph(self) -> StateGraph
+   
2. **Wire Phase Transitions** - `use` command triggers strategize graph @@ -12855,13 +12856,13 @@ This allows the system to remain functional during development while progressive When a strategy actor analyzes a codebase during the Strategize phase, it doesn't just make decisions in isolation. Each decision creates a comprehensive Decision record that includes: -```yaml -context_snapshot: - hot_context_hash: str # Cryptographic hash of the exact context - hot_context_ref: str # Pointer to the full stored snapshot - relevant_resources: list[ResourceRef] # Every file/symbol that influenced this decision - actor_state_ref: str # Complete LangGraph checkpoint -``` +

+context_snapshot:
+  hot_context_hash: str # Cryptographic hash of the exact context
+  hot_context_ref: str # Pointer to the full stored snapshot
+  relevant_resources: list[ResourceRef] # Every file/symbol that influenced this decision
+  actor_state_ref: str # Complete LangGraph checkpoint
+
This means when the system decides "refactor the authentication module to use async patterns," it permanently records: - Which files were examined to make that decision @@ -12894,25 +12895,25 @@ At each level, only the relevant context is loaded. The persistent decision grap **Concrete example of persistence in action**: -``` +

 Plan: Convert Firefox Renderer to Rust
-├── [invariant_enforced] "Maintain API compatibility with existing C++ callers"
-├── [invariant_enforced] "All converted modules must pass existing C++ test suites"
-├── [strategy_choice] Architecture approach: Start with leaf modules, work inward
+├── [invariant_enforced] "Maintain API compatibility with existing C++ callers"
+├── [invariant_enforced] "All converted modules must pass existing C++ test suites"
+├── [strategy_choice] Architecture approach: Start with leaf modules, work inward
 │   Context: Analyzed module dependency graph, 2,847 modules total
 │   Resources: module_graph.json, architecture_docs.md
 │   
-├── [subplan_parallel_spawn] Phase 1: Convert utility libraries (no external deps)
-│   └── [subplan_spawn] Convert string_utils module
+├── [subplan_parallel_spawn] Phase 1: Convert utility libraries (no external deps)
+│   └── [subplan_spawn] Convert string_utils module
 │       └── Plan: 01KH29R8WPKPBHRY7Q0NA9XW86
-│           ├── [prompt_definition] "Convert string_utils module to Rust"
-│           ├── [invariant_enforced] "Maintain API compatibility with existing C++ callers"
-│           ├── [implementation_choice] Use Rust's String type, not custom implementation
+│           ├── [prompt_definition] "Convert string_utils module to Rust"
+│           ├── [invariant_enforced] "Maintain API compatibility with existing C++ callers"
+│           ├── [implementation_choice] Use Rust's String type, not custom implementation
 │           │   Context: Analyzed 47 string_utils.cpp functions
 │           │   Resources: string_utils.cpp, string_utils.h, 12 dependent files
-│           │   Rationale: Rust's String provides same guarantees with better ergonomics
+│           │   Rationale: Rust's String provides same guarantees with better ergonomics
 │           └── ...
-```
+
Even months later, we can query: "Why did we use Rust's String type?" and get the exact context and reasoning, without reprocessing the entire codebase. @@ -12925,27 +12926,27 @@ Even months later, we can query: "Why did we use Rust's String type?" and get th During the Strategize phase, the strategy actor employs several mechanisms to compute precise dependency closures: 1. **Resource-aware analysis**: The actor uses specialized skills to trace dependencies: - ```python - # Pseudocode of what happens inside a strategy actor - def compute_closure_for_refactoring(target_module): +

+   # Pseudocode of what happens inside a strategy actor
+   def compute_closure_for_refactoring(target_module):
        closure = ResourceClosure()
        
-       # Direct file dependencies
+       # Direct file dependencies
        closure.add_files(find_imports(target_module))
        closure.add_files(find_includes(target_module))
        
-       # Symbol dependencies
-       for symbol in extract_exported_symbols(target_module):
-           closure.add_files(find_symbol_usage(symbol, scope='project'))
+       # Symbol dependencies
+       for symbol in extract_exported_symbols(target_module):
+           closure.add_files(find_symbol_usage(symbol, scope='project'))
        
-       # Test dependencies
+       # Test dependencies
        closure.add_files(find_tests_for_module(target_module))
        
-       # Build system dependencies
+       # Build system dependencies
        closure.add_files(find_build_references(target_module))
        
-       return closure
-   ```
+       return closure
+   
2. **Hierarchical scoping**: When spawning child plans (via `subplan_spawn` or `subplan_parallel_spawn`), each child plan receives: - An explicit `relevant_resources` list @@ -12954,26 +12955,26 @@ During the Strategize phase, the strategy actor employs several mechanisms to co - The parent plan's effective invariant view (already reconciled from action, project, and global scopes) 3. **Decision-based tracking**: Each `subplan_spawn` decision records the child plan it creates, and `subplan_parallel_spawn` decisions group parallel child plans: - ```yaml - # Individual child plan spawn - decision_type: subplan_spawn - chosen_option: "Refactor authentication module" - downstream_plan_ids: ["plan-auth-refactor-123"] - artifacts_produced: - - auth_module_files: ["auth.rs", "auth_test.rs", "auth_types.rs"] - - api_updates: ["api/v2/login.rs", "api/v2/logout.rs"] +

+   # Individual child plan spawn
+   decision_type: subplan_spawn
+   chosen_option: "Refactor authentication module"
+   downstream_plan_ids: ["plan-auth-refactor-123"]
+   artifacts_produced: 
+     - auth_module_files: ["auth.rs", "auth_test.rs", "auth_types.rs"]
+     - api_updates: ["api/v2/login.rs", "api/v2/logout.rs"]
    
-   # Parallel group of child plans
-   decision_type: subplan_parallel_spawn
-   chosen_option: "Convert utility libraries in parallel"
-   # Contains subplan_spawn children, each with their own downstream_plan_ids
-   ```
+   # Parallel group of child plans
+   decision_type: subplan_parallel_spawn
+   chosen_option: "Convert utility libraries in parallel"
+   # Contains subplan_spawn children, each with their own downstream_plan_ids
+   
**Concrete example - Converting a subsystem to Rust**: Let's trace how the system handles "Convert Firefox's Network Stack to Rust": -``` +

 STRATEGIZE PHASE:
 1. Analyze network stack structure
    - Identifies 847 C++ files in netwerk/ directory
@@ -12988,11 +12989,11 @@ STRATEGIZE PHASE:
    - Total closure: 25 files (not 847!)
    
 3. Generate execution blueprint with child plans:
-   - [subplan_parallel_spawn] DNS module conversions:
+   - [subplan_parallel_spawn] DNS module conversions:
      - convert-dns-types: Closure of 5 files (type definitions)
      - convert-dns-cache: Closure of 8 files (cache + tests)  
      - convert-dns-resolver: Closure of 12 files (resolver + integration)
-```
+
**Why this is tractable even for massive codebases**: @@ -13020,64 +13021,64 @@ The Firefox example would decompose into ~1,000 bounded child plans (grouped via 1. **Complete isolation during execution**: Each plan executes in its own sandbox, which means: - ``` +

    Plan A (refactoring auth module):
    - Sandbox A1: Contains only auth/*.cpp, auth_tests/*.cpp
-   - Cannot see Plan B's intermediate states
-   - Cannot accidentally depend on Plan B's half-done work
+   - Cannot see Plan B's intermediate states
+   - Cannot accidentally depend on Plan B's half-done work
    
    Plan B (updating API endpoints):
    - Sandbox B1: Contains only api/*.cpp, api_tests/*.cpp  
    - Makes changes assuming current auth interface
-   - Protected from Plan A's intermediate refactoring
-   ```
+   - Protected from Plan A's intermediate refactoring
+   
2. **Resource-specific sandbox strategies provide natural coordination**: - ```yaml +

    Git repositories:
-     - Strategy: git worktrees
-     - Coordination: Git's three-way merge algorithm
+     - Strategy: git worktrees
+     - Coordination: Git's three-way merge algorithm
      - Conflict detection: Built into Git
-     - Rollback: git reset/checkout
+     - Rollback: git reset/checkout
    
-   Databases:
-     - Strategy: Transaction isolation  
-     - Coordination: MVCC (multi-version concurrency control)
+   Databases:
+     - Strategy: Transaction isolation  
+     - Coordination: MVCC (multi-version concurrency control)
      - Conflict detection: Serialization failures
-     - Rollback: Transaction abort
+     - Rollback: Transaction abort
    
    Cloud Infrastructure:
-     - Strategy: Terraform workspaces
-     - Coordination: State locking
+     - Strategy: Terraform workspaces
+     - Coordination: State locking
      - Conflict detection: Resource conflicts in plan
-     - Rollback: Previous state restoration
-   ```
+     - Rollback: Previous state restoration
+   
3. **Hierarchical merge resolution**: When child plans complete, the parent plan performs intelligent merging: - ```python - def merge_subplan_results(subplan_results): - # Group by resource type +

+   def merge_subplan_results(subplan_results):
+       # Group by resource type
        by_resource = group_by_resource_type(subplan_results)
        
-       # Apply resource-specific merge strategies
-        for resource_type, changes in by_resource:
-            if resource_type == 'git-checkout':
-                merge_git_changes(changes)  # Three-way merge
-            elif resource_type == 'fs-mount':
-                merge_fs_changes(changes)   # Copy-on-write reconciliation
-            elif resource_type.startswith('database'):
-                merge_db_changes(changes)   # Sequential application
+       # Apply resource-specific merge strategies
+        for resource_type, changes in by_resource:
+            if resource_type == 'git-checkout':
+                merge_git_changes(changes)  # Three-way merge
+            elif resource_type == 'fs-mount':
+                merge_fs_changes(changes)   # Copy-on-write reconciliation
+            elif resource_type.startswith('database'):
+                merge_db_changes(changes)   # Sequential application
        
-       # Validate merged state
+       # Validate merged state
        run_integration_tests()
-   ```
+   
**Concrete example - Preventing cascading failures**: Consider refactoring a shared authentication library used by 15 services: -``` +

 PARALLEL EXECUTION WITHOUT COORDINATION (what we prevent):
 - Service A refactors to async auth → breaks Service B
 - Service B compensates with workaround → breaks Service C  
@@ -13086,29 +13087,29 @@ PARALLEL EXECUTION WITHOUT COORDINATION (what we prevent):
 
 CLEVERAGENTS COORDINATED EXECUTION:
 Parent Plan: Refactor auth library
-├── [invariant_enforced] "Auth library public API must remain backward compatible during transition"
-├── [subplan_spawn] Plan 1: Update auth library interface
+├── [invariant_enforced] "Auth library public API must remain backward compatible during transition"
+├── [subplan_spawn] Plan 1: Update auth library interface
 │   Sandbox: Only auth library files
 │   Output: New interface definition
 │   
 ├── Barrier: Wait for Plan 1 completion
 │   
-├── [subplan_parallel_spawn] Plans 2-16: Update each service (in parallel)
-│   Each sandbox: Only that service's files
+├── [subplan_parallel_spawn] Plans 2-16: Update each service (in parallel)
+│   Each sandbox: Only that service's files
 │   Each uses: New interface from Plan 1
 │   No inter-service dependencies during execution
 │   
 └── Merge Phase:
     - Collect all service updates
-    - Apply to main branch in order
+    - Apply to main branch in order
     - Run integration tests
     - If conflicts: Parent plan resolves using semantic understanding
-```
+
**Advanced coordination patterns**: 1. **Optimistic concurrency with semantic conflict resolution**: - ```yaml +

    Two child plans both modify api/user.rs:
    - Plan A: Adds async fn get_user_profile()
    - Plan B: Adds fn validate_user_permissions()
@@ -13117,26 +13118,26 @@ Parent Plan: Refactor auth library
    - Git merge succeeds (different functions)
    - Semantic validation ensures both functions work together
    - Parent plan adds integration glue if needed
-   ```
+   
2. **Checkpoint-based coordination**: - ``` +

    Execution timeline:
    T1: Plan A creates checkpoint before major refactor
    T2: Plan B creates checkpoint before API changes
    T3: Plan A encounters error, rolls back to T1
    T4: Plan B completes successfully
-   T5: Plan A retries with knowledge of B's success
-   ```
+   T5: Plan A retries with knowledge of B's success
+   
3. **Resource locking for critical sections**: - ```yaml +

    When modifying shared schema files:
    - Acquire exclusive lock on schema resources
    - Make changes atomically
    - Release lock with new version
    - Other plans rebase on new schema
-   ```
+   
### Q: How does the system proactively prevent semantic errors before they propagate? @@ -13145,34 +13146,34 @@ Parent Plan: Refactor auth library **Layer 1: Decision-time validation during Strategize**: Every decision includes semantic validation: -```yaml -Decision: Refactor payment module to async -alternatives_considered: - - "Convert to async/await patterns" (chosen) - - "Use thread pool with channels" (rejected: doesn't integrate with async ecosystem) - - "Keep synchronous with timeout" (rejected: doesn't solve core latency issue) -confidence_score: 0.85 -validation_performed: +

+Decision: Refactor payment module to async
+alternatives_considered:
+  - "Convert to async/await patterns" (chosen)
+  - "Use thread pool with channels" (rejected: doesn't integrate with async ecosystem)
+  - "Keep synchronous with timeout" (rejected: doesn't solve core latency issue)
+confidence_score: 0.85
+validation_performed:
   - Checked all payment API consumers can handle async
   - Verified database driver supports async operations
   - Confirmed no regulatory requirement for sync processing
-```
+
**Layer 2: Execution-time semantic guards**: The execution actor uses a tool node that references the independently registered `local/validate-api-compat` tool: -```yaml -actors: - code_executor: - type: graph - skills: +

+actors:
+  code_executor:
+    type: graph
+    skills:
       - local/semantic-validators    # Contains validation tools for LLM tool-calling
-    nodes:
-      - name: semantic_validator
-        type: tool
-        tool: local/validate-api-compat   # Named tool from Tool Registry
-```
+    nodes:
+      - name: semantic_validator
+        type: tool
+        tool: local/validate-api-compat # Named tool from Tool Registry
+
The `local/validate-api-compat` tool (independently registered via `agents tool add`) performs semantic validation — not just syntax checking. It extracts API signatures, finds breaking changes, checks affected consumers, and either auto-migrates or raises a `SemanticError` for manual review. @@ -13180,70 +13181,70 @@ The `local/validate-api-compat` tool (independently registered via `agents tool Invariants are attached at four scopes (global, project, action, plan) and managed via the unified `agents invariant` command or `--invariant` flags on creation commands. When a plan enters Strategize, the **Invariant Reconciliation Actor** (set via `--invariant-actor` on actions/plans/projects, or globally via `agents config set invariant-actor`) computes the effective invariant view by applying precedence rules (plan > project > global) to resolve conflicts. Each effective invariant is recorded as an `invariant_enforced` decision, making them visible, correctable, and auditable: -```python -# The system collects, reconciles, and enforces semantic invariants -class InvariantEnforcer: - def compute_effective_invariants(self, plan): - """Compute the effective invariant view using the Invariant Reconciliation Actor.""" +

+# The system collects, reconciles, and enforces semantic invariants
+class InvariantEnforcer:
+    def compute_effective_invariants(self, plan):
+        """Compute the effective invariant view using the Invariant Reconciliation Actor."""
         raw = self.collect_all_invariants(plan)
         reconciler = (
             self.get_plan_invariant_actor(plan)
-            or self.get_project_invariant_actor(plan)
-            or self.get_global_invariant_actor()
+            or self.get_project_invariant_actor(plan)
+            or self.get_global_invariant_actor()
         )
-        # Apply precedence: plan > project > global
-        return reconciler.reconcile(raw, precedence=['plan', 'project', 'global'])
+        # Apply precedence: plan > project > global
+        return reconciler.reconcile(raw, precedence=['plan', 'project', 'global'])
     
-    def collect_all_invariants(self, plan):
-        """Collect invariants from all scopes accessible to this plan."""
+    def collect_all_invariants(self, plan):
+        """Collect invariants from all scopes accessible to this plan."""
         invariants = []
         invariants.extend(self.get_global_invariants())
-        for project in plan.projects:
+        for project in plan.projects:
             invariants.extend(self.get_project_invariants(project))
         invariants.extend(self.get_action_invariants(plan.action))
         invariants.extend(self.get_plan_invariants(plan))
-        return invariants
+        return invariants
     
-    # Example invariants at different scopes:
-    # Global:  "Payment processing must be idempotent"
-    # Project: "Database transactions must complete within 5 seconds"
-    # Action:  "Test files must not import production secrets"
-    # Plan:    "All API calls over TCP must be mocked"
+    # Example invariants at different scopes:
+    # Global:  "Payment processing must be idempotent"
+    # Project: "Database transactions must complete within 5 seconds"
+    # Action:  "Test files must not import production secrets"
+    # Plan:    "All API calls over TCP must be mocked"
     
-    def check_invariant_preservation(self, changes, enforced_invariants):
-        for invariant in enforced_invariants:
-            if not self.verify_invariant(invariant, changes):
-                return InvariantViolation(invariant, changes)
-        return Success()
-```
+    def check_invariant_preservation(self, changes, enforced_invariants):
+        for invariant in enforced_invariants:
+            if not self.verify_invariant(invariant, changes):
+                return InvariantViolation(invariant, changes)
+        return Success()
+
**Layer 4: Predictive error prevention through pattern matching**: The system learns from past failures: -```yaml +

 Error Pattern Database:
-  - pattern: "Async conversion in payment module"
-    historical_failures:
-      - "Race condition in payment confirmation"
-      - "Timeout handling breaks idempotency"
-    preventive_checks:
-      - "Add explicit transaction boundaries"
-      - "Verify idempotency keys are preserved"
-      - "Check distributed lock acquisition"
-```
+  - pattern: "Async conversion in payment module"
+    historical_failures:
+      - "Race condition in payment confirmation"
+      - "Timeout handling breaks idempotency"
+    preventive_checks:
+      - "Add explicit transaction boundaries"
+      - "Verify idempotency keys are preserved"
+      - "Check distributed lock acquisition"
+
**Concrete example - Preventing a subtle distributed systems bug**: Scenario: Refactoring a service to use event sourcing: -``` +

 PROACTIVE CONTAINMENT IN ACTION:
 
 1. Strategy Phase Semantic Analysis:
-   - Decision: "Convert order service to event sourcing"
-   - Semantic check: "Event sourcing requires eventual consistency"
+   - Decision: "Convert order service to event sourcing"
+   - Semantic check: "Event sourcing requires eventual consistency"
    - Identifies: 3 services assume immediate consistency
-   - Adds decision: "Update dependent services for eventual consistency"
+   - Adds decision: "Update dependent services for eventual consistency"
 
 2. Execution Phase Invariant Checking:
    - Detects: PaymentService.chargeCard() called after OrderCreated event
@@ -13255,11 +13256,11 @@ PROACTIVE CONTAINMENT IN ACTION:
    - Impact: Async events break compliance reporting
    - Resolution: Add audit event buffer with guaranteed ordering
    
-4. Pre-Apply Semantic Verification:
+4. Pre-Apply Semantic Verification:
    - Simulates production event flow
    - Detects: Under high load, events can arrive out of order
    - Adds: Event ordering guarantees via vector clocks
-```
+
**Why this prevents issues that traditional testing misses**: @@ -13272,18 +13273,18 @@ Traditional tests check "does the code work?" Our semantic containment asks: **Integration with Definition of Done (DoD)**: Each plan's DoD includes semantic requirements: -```yaml -definition_of_done: - must: - - "All API changes maintain backward compatibility" - - "No increase in p99 latency" - - "Audit trail remains complete" - should: - - "Improve code coverage by 10%" - - "Reduce cyclomatic complexity" - may: - - "Optimize for memory usage" -``` +

+definition_of_done:
+  must:
+    - "All API changes maintain backward compatibility"
+    - "No increase in p99 latency"
+    - "Audit trail remains complete"
+  should:
+    - "Improve code coverage by 10%"
+    - "Reduce cyclomatic complexity"
+  may:
+    - "Optimize for memory usage"
+
The validation nodes enforce these semantics, not just test passage. @@ -13293,7 +13294,7 @@ The validation nodes enforce these semantics, not just test passage. **How the automation profiles work in practice**: -```yaml +

 locked-down Profile:
   - Every phase transition pauses for human action
   - Every decision point pauses for human input
@@ -13325,29 +13326,29 @@ full-auto Profile:
   - No sandbox or checkpoint requirements
   - Unsafe tools allowed
   - Use case: Routine updates, CI/CD integration
-```
+
**The decision correction mechanism enables progressive automation**: The `agents plan correct` command is crucial for building trust: -```bash -# User observes AI made suboptimal choice -agents plan tree -# Sees: [Decision] "Use REST API for service communication" +

+# User observes AI made suboptimal choice
+agents plan tree <plan_id>
+# Sees: [Decision] "Use REST API for service communication"
 
-# User knows gRPC would be better for this use case
-agents plan correct  --mode=revert \
-  --guidance "Use gRPC instead of REST. This service requires streaming 
+# User knows gRPC would be better for this use case
+agents plan correct <decision_id> --mode=revert \
+  --guidance "Use gRPC instead of REST. This service requires streaming 
              updates and binary protocol efficiency. Set up protocol 
-             buffer definitions and generate client/server stubs."
+             buffer definitions and generate client/server stubs."
 
-# System:
-# 1. Marks original decision as superseded
-# 2. Creates new decision with user guidance
-# 3. Recomputes ONLY affected downstream decisions
-# 4. Preserves all unrelated work
-```
+# System:
+# 1. Marks original decision as superseded
+# 2. Creates new decision with user guidance
+# 3. Recomputes ONLY affected downstream decisions
+# 4. Preserves all unrelated work
+
**Progressive trust building through automation profiles**: @@ -13362,30 +13363,30 @@ New users typically follow this progression: True autonomy isn't about removing humans - it's about the system understanding when it needs help: -```python -class AutonomyController: - def assess_decision_confidence(self, decision, context): +

+class AutonomyController:
+    def assess_decision_confidence(self, decision, context):
         factors = {
-            'past_success_rate': self.get_historical_success(decision.type),
-            'codebase_familiarity': self.get_familiarity_score(context.project),
-            'risk_assessment': self.evaluate_risk(decision),
-            'invariant_complexity': self.analyze_invariants(decision)
+            'past_success_rate': self.get_historical_success(decision.type),
+            'codebase_familiarity': self.get_familiarity_score(context.project),
+            'risk_assessment': self.evaluate_risk(decision),
+            'invariant_complexity': self.analyze_invariants(decision)
         }
         
         confidence = self.compute_confidence(factors)
         
-        if confidence < self.threshold:
-             if self.profile.auto_decisions_strategize:
-                # Even in full automation, critical decisions escalate
-                return RequestHumanGuidance(decision, factors)
+        if confidence < self.threshold:
+             if self.profile.auto_decisions_strategize:
+                # Even in full automation, critical decisions escalate
+                return RequestHumanGuidance(decision, factors)
         
-        return ProceedAutonomously(decision)
-```
+        return ProceedAutonomously(decision)
+
**Concrete example - Autonomous handling of a complex refactoring**: -``` -Scenario: "Modernize legacy e-commerce system" +

+Scenario: "Modernize legacy e-commerce system"
 
 INITIAL PLAN (Full Automation Mode):
 1. System analyzes 50,000 line codebase
@@ -13394,29 +13395,29 @@ INITIAL PLAN (Full Automation Mode):
 
 AUTONOMOUS EXECUTION WITH SMART ESCALATION:
 
-[subplan_parallel_spawn] Plans 1-15: Update utility functions (executes autonomously)
+[subplan_parallel_spawn] Plans 1-15: Update utility functions (executes autonomously)
 - Confidence: 0.95 (straightforward transformations)
 - Result: Success
 
-[subplan_spawn] Plan 16: Refactor payment processing
+[subplan_spawn] Plan 16: Refactor payment processing
 - Confidence: 0.4 (critical business logic)
-- [invariant_enforced] "Preserve exact penny rounding behavior"
-- Action: ESCALATES to human
-- Human provides: "Preserve exact penny rounding behavior"
+- [invariant_enforced] "Preserve exact penny rounding behavior"
+- Action: ESCALATES to human
+- Human provides: "Preserve exact penny rounding behavior"
 - Continues autonomously with constraint
 
-[subplan_parallel_spawn] Plans 17-30: UI component updates (executes autonomously)
+[subplan_parallel_spawn] Plans 17-30: UI component updates (executes autonomously)
 - Confidence: 0.9 (isolated changes)
 - Result: Success
 
-[subplan_spawn] Plan 31: Database schema migration
+[subplan_spawn] Plan 31: Database schema migration
 - Detects: Would require 6-hour downtime
-- Action: ESCALATES to human
-- Human provides: "Use online migration with feature flags"
+- Action: ESCALATES to human
+- Human provides: "Use online migration with feature flags"
 - Re-plans with zero-downtime approach
 
-[subplan_parallel_spawn] Plans 32-47: Complete autonomously
-```
+[subplan_parallel_spawn] Plans 32-47: Complete autonomously
+
**The path to greater autonomy**: