brainclaw 1.9.0 → 1.9.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (91) hide show
  1. package/README.md +585 -499
  2. package/dist/brainclaw-vscode.vsix +0 -0
  3. package/dist/commands/harvest.js +1 -1
  4. package/dist/commands/hooks.js +73 -73
  5. package/dist/commands/init.js +1 -1
  6. package/dist/commands/install-hooks.js +78 -78
  7. package/dist/commands/mcp-read-handlers.js +57 -14
  8. package/dist/commands/mcp.js +79 -13
  9. package/dist/commands/switch.js +26 -5
  10. package/dist/commands/version.js +1 -1
  11. package/dist/core/agent-capability.js +19 -4
  12. package/dist/core/agent-files.js +119 -119
  13. package/dist/core/codev-prompts.js +38 -38
  14. package/dist/core/default-profiles/doctor.yaml +11 -11
  15. package/dist/core/default-profiles/janitor.yaml +11 -11
  16. package/dist/core/default-profiles/onboarder.yaml +11 -11
  17. package/dist/core/default-profiles/reviewer.yaml +13 -13
  18. package/dist/core/dispatcher.js +1 -1
  19. package/dist/core/entity-operations.js +29 -3
  20. package/dist/core/execution.js +1 -1
  21. package/dist/core/loops/verbs.js +0 -1
  22. package/dist/core/messaging.js +2 -2
  23. package/dist/core/protocol-skills.js +164 -164
  24. package/dist/core/runtime-signals.js +1 -1
  25. package/dist/core/search.js +19 -2
  26. package/dist/core/security-guard.js +207 -207
  27. package/dist/core/spawn-check.js +16 -2
  28. package/dist/core/staleness.js +1 -1
  29. package/dist/core/store-resolution.js +26 -7
  30. package/dist/core/worktree.js +18 -18
  31. package/dist/facts.js +3 -3
  32. package/dist/facts.json +2 -2
  33. package/docs/PROTOCOL.md +1 -1
  34. package/docs/adapters/openclaw.md +43 -43
  35. package/docs/architecture/project-refs.md +328 -328
  36. package/docs/cli.md +2093 -2093
  37. package/docs/concepts/coordination.md +52 -52
  38. package/docs/concepts/coordinator-runbook.md +129 -129
  39. package/docs/concepts/dispatch-lifecycle.md +245 -245
  40. package/docs/concepts/event-log-store.md +928 -928
  41. package/docs/concepts/ideation-loop.md +317 -317
  42. package/docs/concepts/loop-engine.md +520 -511
  43. package/docs/concepts/mcp-governance.md +268 -268
  44. package/docs/concepts/memory.md +84 -84
  45. package/docs/concepts/multi-agent-workflows.md +167 -167
  46. package/docs/concepts/observer-protocol.md +361 -361
  47. package/docs/concepts/plans-and-claims.md +217 -217
  48. package/docs/concepts/project-md-convention.md +35 -35
  49. package/docs/concepts/runtime-notes.md +38 -38
  50. package/docs/concepts/troubleshooting.md +254 -254
  51. package/docs/concepts/workspace-bootstrapping.md +142 -142
  52. package/docs/context-format-changelog.md +35 -35
  53. package/docs/context-format.md +48 -48
  54. package/docs/index.md +65 -65
  55. package/docs/integrations/agents.md +158 -158
  56. package/docs/integrations/claude-code.md +23 -23
  57. package/docs/integrations/cline.md +77 -77
  58. package/docs/integrations/continue.md +55 -55
  59. package/docs/integrations/copilot.md +68 -68
  60. package/docs/integrations/cursor.md +23 -23
  61. package/docs/integrations/kilocode.md +72 -72
  62. package/docs/integrations/mcp.md +377 -377
  63. package/docs/integrations/mistral-vibe.md +122 -122
  64. package/docs/integrations/openclaw.md +92 -92
  65. package/docs/integrations/opencode.md +84 -84
  66. package/docs/integrations/overview.md +115 -115
  67. package/docs/integrations/roo.md +71 -71
  68. package/docs/integrations/windsurf.md +77 -77
  69. package/docs/mcp-schema-changelog.md +360 -356
  70. package/docs/playbooks/integration/index.md +121 -121
  71. package/docs/playbooks/orchestration.md +37 -0
  72. package/docs/playbooks/productivity/index.md +99 -99
  73. package/docs/playbooks/team/index.md +117 -117
  74. package/docs/product/agent-first-model.md +184 -184
  75. package/docs/product/entity-model-audit.md +462 -462
  76. package/docs/product/positioning.md +86 -86
  77. package/docs/quickstart-existing-project.md +107 -107
  78. package/docs/quickstart.md +183 -183
  79. package/docs/release-maintenance.md +79 -79
  80. package/docs/reputation.md +52 -52
  81. package/docs/review.md +45 -45
  82. package/docs/security.md +212 -212
  83. package/docs/server-operations.md +118 -118
  84. package/docs/storage.md +106 -106
  85. package/package.json +80 -65
  86. package/docs/concepts/event-log-store-critique-A.md +0 -333
  87. package/docs/concepts/event-log-store-critique-B.md +0 -353
  88. package/docs/concepts/event-log-store-phase0-measurements.md +0 -58
  89. package/docs/concepts/event-log-store-proposal-A.md +0 -365
  90. package/docs/concepts/event-log-store-proposal-B.md +0 -404
  91. package/docs/concepts/identity-model-proposal.md +0 -371
@@ -1,95 +1,95 @@
1
- # MCP Integration
2
-
3
- MCP is the primary Brainclaw integration path for capable coding agents.
4
-
5
- Use it whenever the agent can retrieve or mutate shared state directly instead of relying only on static files.
6
-
7
- ## Why MCP Is The Nominal Path
8
-
9
- MCP matters because Brainclaw's value is mostly in dynamic state:
10
-
11
- - fresh context for the exact path being edited
12
- - current board state
13
- - active plans and claims
14
- - runtime observations
15
- - handoffs and review queues
16
-
17
- Static files still help, but they age immediately. MCP is the stronger path for live coordination.
18
-
19
- That now also includes Brainclaw's own install channel state: `bclaw_context({ kind: "execution" })` surfaces whether a newer npm or local-pack build is available, so the agent can notice upgrades without relying on a human to run `brainclaw version --check`.
20
-
21
- ## Recommended Agent Pattern
22
-
23
- The default dynamic workflow is:
24
-
25
- 1. `bclaw_work` to start the session and load the relevant context in one call (returns compact payload by default — pass `compact: false` for the full context result)
26
- 2. `bclaw_context({ kind: "execution" })` early when the agent needs local tooling signals or package update visibility
27
- 3. `bclaw_context({ kind: "memory" })`, `bclaw_context({ kind: "board" })`, or `bclaw_context({ kind: "delta" })` when the target path changes or full memory is needed beyond the compact summary
28
- 4. `bclaw_find` / `bclaw_get` / `bclaw_create` / `bclaw_update` / `bclaw_remove` / `bclaw_transition` for entity reads and writes
29
- 5. `bclaw_coordinate`, `bclaw_dispatch`, or `bclaw_loop` for assign, consult, review, reroute, summarize, dispatch, or multi-turn loop flows
30
- 6. `bclaw_read_inbox` when resuming delegated work
31
- 7. `bclaw_write_note`, `bclaw_quick_capture`, or `bclaw_create({ entity: "candidate", ... })` when the result should become runtime or durable shared memory
32
-
33
- This keeps session continuity inside Brainclaw instead of pushing the agent back to manual CLI usage.
34
-
35
- When a human operator needs the CLI equivalent of `bclaw_write_note`, use `brainclaw runtime-note <text>`.
36
-
37
- ## Available Tools
38
-
39
- All 59 published MCP tools are discoverable via `tools/list`. Each tool carries an `annotations` object with `tier` and `category` metadata so clients can filter or group tools without server-side hiding.
40
-
41
- ### Tool tiers
42
-
43
- Every tool has one of three tiers in its `annotations.tier` field:
44
-
45
- - **facade** — High-level entry points for agents that don't need granular access. Start here.
1
+ # MCP Integration
2
+
3
+ MCP is the primary Brainclaw integration path for capable coding agents.
4
+
5
+ Use it whenever the agent can retrieve or mutate shared state directly instead of relying only on static files.
6
+
7
+ ## Why MCP Is The Nominal Path
8
+
9
+ MCP matters because Brainclaw's value is mostly in dynamic state:
10
+
11
+ - fresh context for the exact path being edited
12
+ - current board state
13
+ - active plans and claims
14
+ - runtime observations
15
+ - handoffs and review queues
16
+
17
+ Static files still help, but they age immediately. MCP is the stronger path for live coordination.
18
+
19
+ That now also includes Brainclaw's own install channel state: `bclaw_context({ kind: "execution" })` surfaces whether a newer npm or local-pack build is available, so the agent can notice upgrades without relying on a human to run `brainclaw version --check`.
20
+
21
+ ## Recommended Agent Pattern
22
+
23
+ The default dynamic workflow is:
24
+
25
+ 1. `bclaw_work` to start the session and load the relevant context in one call (returns compact payload by default — pass `compact: false` for the full context result)
26
+ 2. `bclaw_context({ kind: "execution" })` early when the agent needs local tooling signals or package update visibility
27
+ 3. `bclaw_context({ kind: "memory" })`, `bclaw_context({ kind: "board" })`, or `bclaw_context({ kind: "delta" })` when the target path changes or full memory is needed beyond the compact summary
28
+ 4. `bclaw_find` / `bclaw_get` / `bclaw_create` / `bclaw_update` / `bclaw_remove` / `bclaw_transition` for entity reads and writes
29
+ 5. `bclaw_coordinate`, `bclaw_dispatch`, or `bclaw_loop` for assign, consult, review, reroute, summarize, dispatch, or multi-turn loop flows
30
+ 6. `bclaw_read_inbox` when resuming delegated work
31
+ 7. `bclaw_write_note`, `bclaw_quick_capture`, or `bclaw_create({ entity: "candidate", ... })` when the result should become runtime or durable shared memory
32
+
33
+ This keeps session continuity inside Brainclaw instead of pushing the agent back to manual CLI usage.
34
+
35
+ When a human operator needs the CLI equivalent of `bclaw_write_note`, use `brainclaw runtime-note <text>`.
36
+
37
+ ## Available Tools
38
+
39
+ All 59 published MCP tools are discoverable via `tools/list`. Each tool carries an `annotations` object with `tier` and `category` metadata so clients can filter or group tools without server-side hiding.
40
+
41
+ ### Tool tiers
42
+
43
+ Every tool has one of three tiers in its `annotations.tier` field:
44
+
45
+ - **facade** — High-level entry points for agents that don't need granular access. Start here.
46
46
  - **standard** — Day-to-day coordination tools: plans, claims, messaging, sequences, dispatch, review, memory. Returned by default alongside facades.
47
47
  - **advanced** — Specialized governance, audit, registry, and power tools.
48
48
 
49
49
  By default, `tools/list` returns **facade + standard** tools (38 tools). To get all tools including advanced, pass `{ "catalog": "all" }`, `{ "include": "all" }`, or `{ "advanced": true }`. To filter by a single tier, pass `{ "tier": "facade" }`, `{ "tier": "standard" }`, or `{ "tier": "advanced" }`.
50
-
51
- Published tools remain callable regardless of catalog filtering — the tier only affects discovery via `tools/list`.
52
-
53
- See [docs/concepts/mcp-governance.md](../concepts/mcp-governance.md) for
54
- the stability contract of each tier (what counts as a breaking change,
55
- deprecation window, schema versioning rules). Changelog entries for
56
- every version live in [docs/mcp-schema-changelog.md](../mcp-schema-changelog.md).
57
-
58
- ### Tool categories
59
-
60
- Each tool also has an `annotations.category` field: `session`, `context`, `memory`, `coordination`, `loops`, `governance`, or `discovery`.
61
-
62
- ### Facade tools
63
-
64
- | Tool | Category | Purpose |
65
- |---|---|---|
66
- | `bclaw_work` | session | Start session + load context + optionally claim a scope in one call (compact payload by default) |
67
- | `bclaw_context` | context | Unified context read for memory, execution, board, board summary, and deltas |
68
- | `bclaw_coordinate` | coordination | Assign, consult, review, ideate, reroute, or summarize across agents |
69
- | `bclaw_dispatch` | coordination | Analyze, execute, or review dispatch work through one intent-based entry point |
70
- | `bclaw_loop` | loops | Drive multi-turn review, ideation, implementation, research, or debug loops |
71
- | `bclaw_setup` | session | Agent-driven onboarding wizard |
72
-
73
- ### Standard tools
74
-
75
- | Tool | Category | Purpose |
76
- |---|---|---|
77
- | `bclaw_bootstrap` | context | Brownfield bootstrap signals, interview prompts, selective import |
78
- | `bclaw_release_notes` | context | Agent-first release notes with breaking risk assessment |
79
- | `bclaw_search` | memory | Full-text search across memory items |
80
- | `bclaw_assignment_events` | coordination | List correlated runtime events for assignments and runs |
81
- | `bclaw_switch` | session | Switch active project in a multi-project workspace |
82
- | `bclaw_read_inbox` | coordination | Read messages from an agent inbox |
83
- | `bclaw_send_message` | coordination | Send assignments, review requests, RFCs, notifications, or threaded replies |
84
- | `bclaw_ack_message` | coordination | Acknowledge a processed inbox message |
85
- | `bclaw_write_note` | memory | Record a runtime note |
86
- | `bclaw_quick_capture` | memory | Capture text and classify it locally as a decision, trap, or runtime note |
87
- | `bclaw_claim` | coordination | Claim a work scope (advisory lock, auto-worktree) |
88
- | `bclaw_release_claim` | coordination | Release a claim, optionally updating linked plan status |
89
- | `bclaw_session_start` | session | Start a session explicitly (granular workflow) |
90
- | `bclaw_session_end` | session | End session, optionally auto-reflect notes or handoffs |
91
- | `bclaw_add_step` | coordination | Add a sub-step to a plan item |
92
- | `bclaw_complete_step` | coordination | Mark a plan sub-step as done |
50
+
51
+ Published tools remain callable regardless of catalog filtering — the tier only affects discovery via `tools/list`.
52
+
53
+ See [docs/concepts/mcp-governance.md](../concepts/mcp-governance.md) for
54
+ the stability contract of each tier (what counts as a breaking change,
55
+ deprecation window, schema versioning rules). Changelog entries for
56
+ every version live in [docs/mcp-schema-changelog.md](../mcp-schema-changelog.md).
57
+
58
+ ### Tool categories
59
+
60
+ Each tool also has an `annotations.category` field: `session`, `context`, `memory`, `coordination`, `loops`, `governance`, or `discovery`.
61
+
62
+ ### Facade tools
63
+
64
+ | Tool | Category | Purpose |
65
+ |---|---|---|
66
+ | `bclaw_work` | session | Start session + load context + optionally claim a scope in one call (compact payload by default) |
67
+ | `bclaw_context` | context | Unified context read for memory, execution, board, board summary, and deltas |
68
+ | `bclaw_coordinate` | coordination | Assign, consult, review, ideate, reroute, or summarize across agents |
69
+ | `bclaw_dispatch` | coordination | Analyze, execute, or review dispatch work through one intent-based entry point |
70
+ | `bclaw_loop` | loops | Drive multi-turn review, ideation, implementation, research, or debug loops |
71
+ | `bclaw_setup` | session | Agent-driven onboarding wizard |
72
+
73
+ ### Standard tools
74
+
75
+ | Tool | Category | Purpose |
76
+ |---|---|---|
77
+ | `bclaw_bootstrap` | context | Brownfield bootstrap signals, interview prompts, selective import |
78
+ | `bclaw_release_notes` | context | Agent-first release notes with breaking risk assessment |
79
+ | `bclaw_search` | memory | Full-text search across memory items |
80
+ | `bclaw_assignment_events` | coordination | List correlated runtime events for assignments and runs |
81
+ | `bclaw_switch` | session | Switch active project in a multi-project workspace |
82
+ | `bclaw_read_inbox` | coordination | Read messages from an agent inbox |
83
+ | `bclaw_send_message` | coordination | Send assignments, review requests, RFCs, notifications, or threaded replies |
84
+ | `bclaw_ack_message` | coordination | Acknowledge a processed inbox message |
85
+ | `bclaw_write_note` | memory | Record a runtime note |
86
+ | `bclaw_quick_capture` | memory | Capture text and classify it locally as a decision, trap, or runtime note |
87
+ | `bclaw_claim` | coordination | Claim a work scope (advisory lock, auto-worktree) |
88
+ | `bclaw_release_claim` | coordination | Release a claim, optionally updating linked plan status |
89
+ | `bclaw_session_start` | session | Start a session explicitly (granular workflow) |
90
+ | `bclaw_session_end` | session | End session, optionally auto-reflect notes or handoffs |
91
+ | `bclaw_add_step` | coordination | Add a sub-step to a plan item |
92
+ | `bclaw_complete_step` | coordination | Mark a plan sub-step as done |
93
93
  | `bclaw_update_step` | coordination | Update a plan sub-step's status, text, or assignee |
94
94
  | `bclaw_delete_step` | coordination | Remove a sub-step from a plan |
95
95
  | `bclaw_list_sequences` | coordination | Coordination sequence listing |
@@ -97,65 +97,65 @@ Each tool also has an `annotations.category` field: `session`, `context`, `memor
97
97
  | `bclaw_update_sequence` | coordination | Update a sequence's status, metadata, or items |
98
98
  | `bclaw_delete_sequence` | coordination | Delete a sequence by ID |
99
99
  | `bclaw_correct_handoff` | coordination | Write an immutable correction handoff that supersedes an earlier one |
100
- | `bclaw_assignment_update` | coordination | Report assignment lifecycle status |
101
- | `bclaw_assignment_action` | coordination | Resolve or reject a pending ActionRequired item |
102
- | `bclaw_harvest_candidates` | coordination | Harvest sandboxed worktree candidate files into the main project store |
103
- | `bclaw_find` | memory | List canonical entities with filters |
104
- | `bclaw_get` | memory | Fetch a canonical entity by id or short label |
105
- | `bclaw_create` | memory | Create a canonical entity |
106
- | `bclaw_update` | memory | Partially update mutable fields on a canonical entity |
107
- | `bclaw_remove` | memory | Archive or purge a canonical entity |
108
- | `bclaw_transition` | memory | Move an entity through its validated state machine |
109
-
110
- ### Advanced tools
111
-
112
- | Tool | Category | Purpose |
113
- |---|---|---|
114
- | `bclaw_audit` | governance | Audit log or governance posture report |
115
- | `bclaw_check_policy` | governance | Pre-execution policy check for a scope |
116
- | `bclaw_check_security` | governance | Supply chain security scores via Socket.dev |
117
- | `bclaw_conflict_check` | governance | Check for overlapping claims between agents |
118
- | `bclaw_doctor` | governance | Health checks on the memory store |
119
- | `bclaw_history` | governance | Full mutation history of a memory item |
120
- | `bclaw_estimation_report` | governance | Estimation accuracy report for completed plans |
121
- | `bclaw_list_agents` | discovery | Registered agent inventory with reputation |
122
- | `bclaw_list_instructions` | discovery | Raw or resolved instruction listing |
123
- | `bclaw_get_capabilities` | discovery | List registered project capabilities |
124
- | `bclaw_list_tools` | discovery | List registered project tools |
125
- | `bclaw_search_tools` | discovery | Search tools by name or description |
126
- | `bclaw_get_discovery` | discovery | Scan workspace for MCP configs, skills, hooks |
127
- | `bclaw_who` | discovery | List active agent sessions on workspace |
128
- | `bclaw_add_capability` | discovery | Register a project capability |
129
- | `bclaw_add_tool` | discovery | Register a project tool |
100
+ | `bclaw_assignment_update` | coordination | Report assignment lifecycle status |
101
+ | `bclaw_assignment_action` | coordination | Resolve or reject a pending ActionRequired item |
102
+ | `bclaw_harvest_candidates` | coordination | Harvest sandboxed worktree candidate files into the main project store |
103
+ | `bclaw_find` | memory | List canonical entities with filters |
104
+ | `bclaw_get` | memory | Fetch a canonical entity by id or short label |
105
+ | `bclaw_create` | memory | Create a canonical entity |
106
+ | `bclaw_update` | memory | Partially update mutable fields on a canonical entity |
107
+ | `bclaw_remove` | memory | Archive or purge a canonical entity |
108
+ | `bclaw_transition` | memory | Move an entity through its validated state machine |
109
+
110
+ ### Advanced tools
111
+
112
+ | Tool | Category | Purpose |
113
+ |---|---|---|
114
+ | `bclaw_audit` | governance | Audit log or governance posture report |
115
+ | `bclaw_check_policy` | governance | Pre-execution policy check for a scope |
116
+ | `bclaw_check_security` | governance | Supply chain security scores via Socket.dev |
117
+ | `bclaw_conflict_check` | governance | Check for overlapping claims between agents |
118
+ | `bclaw_doctor` | governance | Health checks on the memory store |
119
+ | `bclaw_history` | governance | Full mutation history of a memory item |
120
+ | `bclaw_estimation_report` | governance | Estimation accuracy report for completed plans |
121
+ | `bclaw_list_agents` | discovery | Registered agent inventory with reputation |
122
+ | `bclaw_list_instructions` | discovery | Raw or resolved instruction listing |
123
+ | `bclaw_get_capabilities` | discovery | List registered project capabilities |
124
+ | `bclaw_list_tools` | discovery | List registered project tools |
125
+ | `bclaw_search_tools` | discovery | Search tools by name or description |
126
+ | `bclaw_get_discovery` | discovery | Scan workspace for MCP configs, skills, hooks |
127
+ | `bclaw_who` | discovery | List active agent sessions on workspace |
128
+ | `bclaw_add_capability` | discovery | Register a project capability |
129
+ | `bclaw_add_tool` | discovery | Register a project tool |
130
130
  | `bclaw_get_thread` | coordination | Get all messages in a thread across inboxes |
131
131
  | `bclaw_delete_plan` | coordination | Delete a plan item by ID |
132
132
  | `bclaw_delete_memory` | memory | Delete a memory item by ID |
133
- | `bclaw_update_memory` | memory | Update a memory item's text or metadata |
134
- | `bclaw_compact` | memory | LLM-driven semantic memory compaction (two-phase) |
135
-
136
- ### Canonical grammar (standard tier, v1.0+)
137
-
138
- Phase 3 shipped a unified grammar that replaces the per-entity tools
139
- listed above. All canonical verbs are in the default `standard` tier
140
- as of v1.0. The legacy per-entity tools have been removed from the
141
- catalog (still callable as a migration escape hatch — see the redirect
142
- warnings they emit).
143
-
144
- See [docs/concepts/mcp-governance.md](../concepts/mcp-governance.md)
145
- for the stability contract and [docs/mcp-schema-changelog.md](../mcp-schema-changelog.md)
146
- for the full 1.0.0 changelog.
147
-
148
- #### Six CRUD verbs
149
-
150
- | Verb | Purpose | Replaces |
151
- |---|---|---|
152
- | `bclaw_find(entity, filter?)` | List query (default: hides `legacy` + `auto_reflect<0.6`) | `bclaw_list_plans/candidates/claims/actions/assignments/runs` |
153
- | `bclaw_get(entity, id)` | Fetch one by id or short_label | `bclaw_read_handoff` |
154
- | `bclaw_create(entity, data)` | Create with auto-stamped provenance | `bclaw_create_plan/candidate` |
155
- | `bclaw_update(entity, id, patch)` | Partial merge (updatable fields only) | `bclaw_update_plan`, `bclaw_update_memory` |
156
- | `bclaw_remove(entity, id, purge?)` | Archive (default) or hard-delete | `bclaw_delete_memory`, `bclaw_delete_plan` |
157
- | `bclaw_transition(entity, id, to, reason?)` | State machine transition with side-effect tags | `bclaw_accept`, `bclaw_reject`, status-update flows |
158
-
133
+ | `bclaw_update_memory` | memory | Update a memory item's text or metadata |
134
+ | `bclaw_compact` | memory | LLM-driven semantic memory compaction (two-phase) |
135
+
136
+ ### Canonical grammar (standard tier, v1.0+)
137
+
138
+ Phase 3 shipped a unified grammar that replaces the per-entity tools
139
+ listed above. All canonical verbs are in the default `standard` tier
140
+ as of v1.0. The legacy per-entity tools have been removed from the
141
+ catalog (still callable as a migration escape hatch — see the redirect
142
+ warnings they emit).
143
+
144
+ See [docs/concepts/mcp-governance.md](../concepts/mcp-governance.md)
145
+ for the stability contract and [docs/mcp-schema-changelog.md](../mcp-schema-changelog.md)
146
+ for the full 1.0.0 changelog.
147
+
148
+ #### Six CRUD verbs
149
+
150
+ | Verb | Purpose | Replaces |
151
+ |---|---|---|
152
+ | `bclaw_find(entity, filter?)` | List query (default: hides `legacy` + `auto_reflect<0.6`) | `bclaw_list_plans/candidates/claims/actions/assignments/runs` |
153
+ | `bclaw_get(entity, id)` | Fetch one by id or short_label | `bclaw_read_handoff` |
154
+ | `bclaw_create(entity, data)` | Create with auto-stamped provenance | `bclaw_create_plan/candidate` |
155
+ | `bclaw_update(entity, id, patch)` | Partial merge (updatable fields only) | `bclaw_update_plan`, `bclaw_update_memory` |
156
+ | `bclaw_remove(entity, id, purge?)` | Archive (default) or hard-delete | `bclaw_delete_memory`, `bclaw_delete_plan` |
157
+ | `bclaw_transition(entity, id, to, reason?)` | State machine transition with side-effect tags | `bclaw_accept`, `bclaw_reject`, status-update flows |
158
+
159
159
  Supported entities: plan, decision, constraint, trap, handoff,
160
160
  runtime_note, candidate, sequence, claim, action, assignment, agent_run
161
161
  (with assignment lifecycle now writable through `bclaw_transition` and
@@ -199,236 +199,236 @@ For assignments specifically:
199
199
  - `bclaw_transition(entity="assignment", id=..., to="cancelled", reason=...)` is the canonical supervisor/admin cancel path.
200
200
  - `bclaw_remove(entity="assignment", id=...)` archives by cancelling the assignment.
201
201
  - `bclaw_remove(entity="assignment", id=..., purge=true)` hard-deletes the assignment record.
202
-
203
- ##### `bclaw_find` filter keys
204
-
205
- The `filter` object accepts the following keys. **Unknown keys are
206
- rejected with `validation_error`** (pln#460) — a typo like
207
- `{staus:'todo'}` fails fast instead of silently returning unfiltered
208
- results.
209
-
210
- | Key | Type | Applies to | Effect |
211
- |---|---|---|---|
212
- | `status` | string | all entities with a `status` field | Exact match on the entity's lifecycle status |
213
- | `tag` | string | entities with `tags[]` | Returns items where `tags` contains the value |
214
- | `author` | string | entities with an `author` field | Exact match |
215
- | `plan_id` | string | handoff, candidate, runtime_note, claim, action, assignment, agent_run | Filter to items linked to a given plan |
216
- | `source` | string (`auto` / `agent` / `human`) | candidate | Provenance source filter |
217
- | `auto_generated` | boolean | candidate | `true` keeps only auto-generated candidates, `false` excludes them (matches `source === 'auto'` OR legacy `origin` starting with `session-end`) |
218
- | `limit` | number (default 50) | all | Max items returned (paging) |
219
- | `offset` | number (default 0) | all | Paging offset |
220
- | `includeLegacy` | boolean (default false) | all | Include records with `provenance.kind='legacy'` |
221
- | `minAutoReflectConfidence` | number 0-1 (default 0.6) | all | Threshold below which `auto_reflect` records are hidden |
222
-
223
- Notes:
224
- - `candidate` has an active bucket of `pending` only; accepted / rejected
225
- candidates are archived on transition and don't appear in `bclaw_find`.
226
- - Combining filters intersects them (AND, not OR).
227
- - Filters that don't apply to a given entity (e.g. `plan_id` on `plan`)
228
- are currently no-ops — they don't error, but they don't match either.
229
-
230
- #### Cross-project access (pln#359)
231
-
232
- The canonical grammar (`bclaw_find` / `bclaw_get` / `bclaw_create` /
233
- `bclaw_update` / `bclaw_remove` / `bclaw_transition`), the read
234
- dispatcher `bclaw_context`, and the coordination facade `bclaw_coordinate`
235
- accept an optional `project` parameter that routes the operation to a
236
- **linked project** instead of the current one. The CLI exposes the same
237
- parameter as a global `--project <name>` flag.
238
-
239
- Two link kinds are accepted:
240
- - `cross_project_links` (sibling/peer projects in `config.yaml`, managed
241
- via `brainclaw link add/list/remove`).
242
- - Workspace store-chain children (monorepo-style nested projects).
243
-
244
- Arbitrary directory paths are rejected — adoption requires an explicit
245
- link, which gives the user a single point of control over what an agent
246
- can reach.
247
-
248
- **Read / write on canonical entities (phase 1a):**
249
-
250
- ```jsonc
251
- // Read a trap from a sibling project linked as 'brainclaw-site'
252
- bclaw_get({ entity: 'trap', id: 'trp_795bbfb5', project: 'brainclaw-site' })
253
-
254
- // Update a plan in the linked site repo
255
- bclaw_update({ entity: 'plan', id: 'pln_abc', patch: { priority: 'high' }, project: 'brainclaw-site' })
256
-
257
- // Capture context from a child project in a monorepo
258
- bclaw_context({ kind: 'memory', project: 'web-app' })
259
- ```
260
-
261
- Identity (`author` / `agent`) is resolved from the **source** project's
262
- agent registry — an agent does not need to be registered in the target
263
- to write into it. Audit log entries land in the **target** project.
264
- Unknown project arguments throw `validation_error` with a hint listing
265
- the configured links — no silent fallback.
266
-
267
- **Coordinate / dispatch into a linked project (phase 1b-α):**
268
-
269
- ```jsonc
270
- // Dispatch the brainclaw-site claude-code agent without leaving brainclaw
271
- bclaw_coordinate({
272
- intent: 'assign',
273
- task: 'Refactor the homepage hero variant',
274
- scope: 'src/pages/index.astro',
275
- targetAgents: ['claude-code'],
276
- project: 'brainclaw-site',
277
- agent: 'claude-code', // self-attribution from the source side
278
- })
279
- ```
280
-
281
- Cross-project dispatch is **inbox-only**: the target agent picks up the
282
- brief async via its own `bclaw_work`. Auto-spawn from the source process
283
- is force-disabled when `project` is set, because spawn cwd / worktree
284
- semantics are tied to the target's git repo. A warning surfaces in
285
- `FacadeResponse.warnings` so the caller knows auto-spawn was downgraded.
286
- The same logic applies to `intent=consult|review|reroute|ideate`.
287
-
288
- **CLI parity (phase 1c):**
289
-
290
- ```bash
291
- # Read the linked project's plans without leaving the current dir
292
- brainclaw --project=brainclaw-site list-plans
293
-
294
- # Write a decision into the linked project
295
- brainclaw --project=brainclaw-site decision "Switch hero variant to v3"
296
-
297
- # Scoped variants: --project works on every subcommand. Mutually exclusive
298
- # with --cwd; use one or the other.
299
- ```
300
-
301
- #### Unified intent dispatchers
302
-
303
- | Tool | Consolidates | Example |
304
- |---|---|---|
305
- | `bclaw_context(kind, since?)` | `bclaw_get_context` / `bclaw_get_execution_context` / `bclaw_get_agent_board` / `bclaw_get_agent_board_summary` + new `kind='delta'` (P6.4) | `bclaw_context({ kind: 'delta', since: 'sess_abc' })` |
306
- | `bclaw_dispatch(intent, …)` | `bclaw_dispatch_analysis` / `bclaw_dispatch` / `bclaw_dispatch_review` | `bclaw_dispatch({ intent: 'review', openLoop: true })` |
307
-
308
- #### Handoff correction (tombstone)
309
-
310
- | Tool | Purpose |
311
- |---|---|
312
- | `bclaw_correct_handoff(originalId, text?, narrative?, tags?, reason?)` | Write a new handoff that supersedes an earlier, incorrect one. Original becomes immutable with `superseded_by` back at the correction; correction carries `supersedes`. Federation-safe (both records stay on disk). |
313
-
314
- Use `bclaw_correct_handoff` instead of `bclaw_update_handoff` — the
315
- latter was removed from the catalog at v1.0 (direct calls still succeed
316
- as a migration escape hatch but emit a redirect warning).
317
-
318
- #### Example gallery
319
-
320
- ```jsonc
321
- // List all recent high-priority plans (legacy provenance hidden by default)
322
- bclaw_find({ entity: 'plan', filter: { status: 'in_progress', limit: 10 } })
323
-
324
- // Include legacy records + lower auto_reflect confidence threshold
325
- bclaw_find({ entity: 'decision', filter: { includeLegacy: true, minAutoReflectConfidence: 0.3 } })
326
-
327
- // Fetch a specific handoff by short_label
328
- bclaw_get({ entity: 'handoff', id: 'hnd#42' })
329
-
330
- // Create a decision (provenance auto-stamped as kind:user)
331
- bclaw_create({ entity: 'decision', data: { text: 'switch to postgres', author: 'jberdah' } })
332
-
333
- // Transition a candidate (validated against transition matrix)
334
- bclaw_transition({ entity: 'candidate', id: 'cnd_abc', to: 'accepted' })
335
-
336
- // Get memory delta since a previous session
337
- bclaw_context({ kind: 'delta', since: 'sess_07c...' })
338
-
339
- // Compact board summary (replaces bclaw_get_agent_board_summary)
340
- bclaw_context({ kind: 'board_summary' })
341
-
342
- // Review dispatch with structured loop
343
- bclaw_dispatch({ intent: 'review', openLoop: true, reviewMode: 'symmetric' })
344
-
345
- // Open a memory-confrontation ideation loop (single-agent: champion drives manually)
346
- bclaw_coordinate({ intent: 'ideate', task: 'Should we extract the dispatcher into a separate package?' })
347
-
348
- // Multi-agent ideation: critic gets a context-filtered, BM25-ranked brief auto-dispatched
349
- bclaw_coordinate({
350
- intent: 'ideate',
351
- task: 'Should we adopt approach A or approach B?',
352
- targetAgents: ['codex'],
353
- })
354
-
355
- // Correct a handoff instead of mutating it
356
- bclaw_correct_handoff({ originalId: 'hnd_xyz', reason: 'wrong contract', text: '...' })
357
- ```
358
-
359
- For the full ideation_loop design (phases, context_filter, iteration
360
- block, advance_gate, brief assembly, single vs multi-agent UX), see
361
- [docs/concepts/ideation-loop.md](../concepts/ideation-loop.md). For
362
- the underlying loop engine, see
363
- [docs/concepts/loop-engine.md](../concepts/loop-engine.md).
364
-
365
- #### Deprecation status
366
-
367
- The v1.0-removed legacy tools named in the changelog emit a
368
- deprecation warning server-side on each direct call. The warning names
369
- the canonical replacement. Warnings fired during the 0.8.x window. As
370
- of v1.0 those tools are removed from every `tools/list` catalog,
371
- including `{ catalog: "all" }`, but direct calls still succeed as a
372
- migration escape hatch and keep emitting redirect warnings.
373
-
374
- ## When To Use MCP Versus Other Surfaces
375
-
376
- | Need | Best surface |
377
- |---|---|
378
- | Fresh path-scoped context | MCP |
379
- | Current plans, claims, board state | MCP |
380
- | Runtime writes with session continuity | MCP |
381
- | Local behavioral reminders inside the agent UI | native agent files |
382
- | Human inspection or scripting | CLI |
383
- | Simple readable fallback | `.brainclaw/project.md` (derived view, may be stale) |
384
-
385
- ## Starting The Server
386
-
387
- ```bash
388
- brainclaw mcp
389
- ```
390
-
391
- In practice, most agents pick this up through generated MCP config such as `.mcp.json`, `~/.cursor/mcp.json`, or other agent-specific config files written by `brainclaw setup`, `brainclaw init`, or `brainclaw export`.
392
-
393
- By default, installable update checks use the public npm channel `brainclaw@latest`. Projects that need a different channel can override `brainclaw_update_source`, for example with `type: npm` and `dist_tag: prelaunch`, or with `type: local-pack` for local tarball workflows.
394
-
395
- ## Bootstrap Through MCP
396
-
397
- For agent-first onboarding, `bclaw_bootstrap` is the nominal path:
398
-
399
- 1. call `bclaw_bootstrap` to get the current `import_plan` and adaptive interview questions
400
- 2. collect answers in the agent surface
401
- 3. call `bclaw_bootstrap` again with `interviewAnswers` to preview confirmed `decision`, `constraint`, `instruction`, or `trap` suggestions
402
- 4. call `bclaw_bootstrap` with `apply: true` to create canonical memory
403
- 5. call `bclaw_bootstrap` with `uninstall: true` to revert the last bootstrap-managed import
404
-
405
- Interview answers are keyed by question ID and may contain:
406
-
407
- - `response_text`
408
- - `response_items`
409
- - `response_boolean`
410
- - optional explicit `suggestions` when the agent wants to confirm exact canonical memory items
411
-
412
- ## Mutation Safety
413
-
414
- The MCP server serializes all mutations through a single-writer queue (`McpTaskRunner`). When an agent calls a write tool (e.g. `bclaw_claim`, `bclaw_write_note`, `bclaw_create({ entity: "plan", ... })`), the request is enqueued and executed one at a time. This guarantees:
415
-
416
- - no concurrent writes from the same MCP connection
417
- - no partial state from interleaved mutations
418
- - deterministic ordering of operations
419
-
420
- A secondary file-based lock (`mutate()`) provides cross-process safety in case CLI commands run alongside MCP. But for agents, MCP is the safe path by design — no extra precautions needed.
421
-
422
- ## Important Rule
423
-
424
- If the agent has MCP available, do not treat the CLI as the primary runtime interface. All agent mutations MUST go through MCP tools.
425
-
426
- The CLI remains valuable for:
427
-
428
- - setup and initialization
429
- - bootstrap by a human operator
430
- - scripting and automation
431
- - release and packaging
432
- - debugging and fallback access
433
-
434
- But for capable agents, MCP is the first-class path for both reads and writes.
202
+
203
+ ##### `bclaw_find` filter keys
204
+
205
+ The `filter` object accepts the following keys. **Unknown keys are
206
+ rejected with `validation_error`** (pln#460) — a typo like
207
+ `{staus:'todo'}` fails fast instead of silently returning unfiltered
208
+ results.
209
+
210
+ | Key | Type | Applies to | Effect |
211
+ |---|---|---|---|
212
+ | `status` | string | all entities with a `status` field | Exact match on the entity's lifecycle status |
213
+ | `tag` | string | entities with `tags[]` | Returns items where `tags` contains the value |
214
+ | `author` | string | entities with an `author` field | Exact match |
215
+ | `plan_id` | string | handoff, candidate, runtime_note, claim, action, assignment, agent_run | Filter to items linked to a given plan |
216
+ | `source` | string (`auto` / `agent` / `human`) | candidate | Provenance source filter |
217
+ | `auto_generated` | boolean | candidate | `true` keeps only auto-generated candidates, `false` excludes them (matches `source === 'auto'` OR legacy `origin` starting with `session-end`) |
218
+ | `limit` | number (default 50) | all | Max items returned (paging) |
219
+ | `offset` | number (default 0) | all | Paging offset |
220
+ | `includeLegacy` | boolean (default false) | all | Include records with `provenance.kind='legacy'` |
221
+ | `minAutoReflectConfidence` | number 0-1 (default 0.6) | all | Threshold below which `auto_reflect` records are hidden |
222
+
223
+ Notes:
224
+ - `candidate` has an active bucket of `pending` only; accepted / rejected
225
+ candidates are archived on transition and don't appear in `bclaw_find`.
226
+ - Combining filters intersects them (AND, not OR).
227
+ - Filters that don't apply to a given entity (e.g. `plan_id` on `plan`)
228
+ are currently no-ops — they don't error, but they don't match either.
229
+
230
+ #### Cross-project access (pln#359)
231
+
232
+ The canonical grammar (`bclaw_find` / `bclaw_get` / `bclaw_create` /
233
+ `bclaw_update` / `bclaw_remove` / `bclaw_transition`), the read
234
+ dispatcher `bclaw_context`, and the coordination facade `bclaw_coordinate`
235
+ accept an optional `project` parameter that routes the operation to a
236
+ **linked project** instead of the current one. The CLI exposes the same
237
+ parameter as a global `--project <name>` flag.
238
+
239
+ Two link kinds are accepted:
240
+ - `cross_project_links` (sibling/peer projects in `config.yaml`, managed
241
+ via `brainclaw link add/list/remove`).
242
+ - Workspace store-chain children (monorepo-style nested projects).
243
+
244
+ Arbitrary directory paths are rejected — adoption requires an explicit
245
+ link, which gives the user a single point of control over what an agent
246
+ can reach.
247
+
248
+ **Read / write on canonical entities (phase 1a):**
249
+
250
+ ```jsonc
251
+ // Read a trap from a sibling project linked as 'brainclaw-site'
252
+ bclaw_get({ entity: 'trap', id: 'trp_795bbfb5', project: 'brainclaw-site' })
253
+
254
+ // Update a plan in the linked site repo
255
+ bclaw_update({ entity: 'plan', id: 'pln_abc', patch: { priority: 'high' }, project: 'brainclaw-site' })
256
+
257
+ // Capture context from a child project in a monorepo
258
+ bclaw_context({ kind: 'memory', project: 'web-app' })
259
+ ```
260
+
261
+ Identity (`author` / `agent`) is resolved from the **source** project's
262
+ agent registry — an agent does not need to be registered in the target
263
+ to write into it. Audit log entries land in the **target** project.
264
+ Unknown project arguments throw `validation_error` with a hint listing
265
+ the configured links — no silent fallback.
266
+
267
+ **Coordinate / dispatch into a linked project (phase 1b-α):**
268
+
269
+ ```jsonc
270
+ // Dispatch the brainclaw-site claude-code agent without leaving brainclaw
271
+ bclaw_coordinate({
272
+ intent: 'assign',
273
+ task: 'Refactor the homepage hero variant',
274
+ scope: 'src/pages/index.astro',
275
+ targetAgents: ['claude-code'],
276
+ project: 'brainclaw-site',
277
+ agent: 'claude-code', // self-attribution from the source side
278
+ })
279
+ ```
280
+
281
+ Cross-project dispatch is **inbox-only**: the target agent picks up the
282
+ brief async via its own `bclaw_work`. Auto-spawn from the source process
283
+ is force-disabled when `project` is set, because spawn cwd / worktree
284
+ semantics are tied to the target's git repo. A warning surfaces in
285
+ `FacadeResponse.warnings` so the caller knows auto-spawn was downgraded.
286
+ The same logic applies to `intent=consult|review|reroute|ideate`.
287
+
288
+ **CLI parity (phase 1c):**
289
+
290
+ ```bash
291
+ # Read the linked project's plans without leaving the current dir
292
+ brainclaw --project=brainclaw-site list-plans
293
+
294
+ # Write a decision into the linked project
295
+ brainclaw --project=brainclaw-site decision "Switch hero variant to v3"
296
+
297
+ # Scoped variants: --project works on every subcommand. Mutually exclusive
298
+ # with --cwd; use one or the other.
299
+ ```
300
+
301
+ #### Unified intent dispatchers
302
+
303
+ | Tool | Consolidates | Example |
304
+ |---|---|---|
305
+ | `bclaw_context(kind, since?)` | `bclaw_get_context` / `bclaw_get_execution_context` / `bclaw_get_agent_board` / `bclaw_get_agent_board_summary` + new `kind='delta'` (P6.4) | `bclaw_context({ kind: 'delta', since: 'sess_abc' })` |
306
+ | `bclaw_dispatch(intent, …)` | `bclaw_dispatch_analysis` / `bclaw_dispatch` / `bclaw_dispatch_review` | `bclaw_dispatch({ intent: 'review', openLoop: true })` |
307
+
308
+ #### Handoff correction (tombstone)
309
+
310
+ | Tool | Purpose |
311
+ |---|---|
312
+ | `bclaw_correct_handoff(originalId, text?, narrative?, tags?, reason?)` | Write a new handoff that supersedes an earlier, incorrect one. Original becomes immutable with `superseded_by` back at the correction; correction carries `supersedes`. Federation-safe (both records stay on disk). |
313
+
314
+ Use `bclaw_correct_handoff` instead of `bclaw_update_handoff` — the
315
+ latter was removed from the catalog at v1.0 (direct calls still succeed
316
+ as a migration escape hatch but emit a redirect warning).
317
+
318
+ #### Example gallery
319
+
320
+ ```jsonc
321
+ // List all recent high-priority plans (legacy provenance hidden by default)
322
+ bclaw_find({ entity: 'plan', filter: { status: 'in_progress', limit: 10 } })
323
+
324
+ // Include legacy records + lower auto_reflect confidence threshold
325
+ bclaw_find({ entity: 'decision', filter: { includeLegacy: true, minAutoReflectConfidence: 0.3 } })
326
+
327
+ // Fetch a specific handoff by short_label
328
+ bclaw_get({ entity: 'handoff', id: 'hnd#42' })
329
+
330
+ // Create a decision (provenance auto-stamped as kind:user)
331
+ bclaw_create({ entity: 'decision', data: { text: 'switch to postgres', author: 'jberdah' } })
332
+
333
+ // Transition a candidate (validated against transition matrix)
334
+ bclaw_transition({ entity: 'candidate', id: 'cnd_abc', to: 'accepted' })
335
+
336
+ // Get memory delta since a previous session
337
+ bclaw_context({ kind: 'delta', since: 'sess_07c...' })
338
+
339
+ // Compact board summary (replaces bclaw_get_agent_board_summary)
340
+ bclaw_context({ kind: 'board_summary' })
341
+
342
+ // Review dispatch with structured loop
343
+ bclaw_dispatch({ intent: 'review', openLoop: true, reviewMode: 'symmetric' })
344
+
345
+ // Open a memory-confrontation ideation loop (single-agent: champion drives manually)
346
+ bclaw_coordinate({ intent: 'ideate', task: 'Should we extract the dispatcher into a separate package?' })
347
+
348
+ // Multi-agent ideation: critic gets a context-filtered, BM25-ranked brief auto-dispatched
349
+ bclaw_coordinate({
350
+ intent: 'ideate',
351
+ task: 'Should we adopt approach A or approach B?',
352
+ targetAgents: ['codex'],
353
+ })
354
+
355
+ // Correct a handoff instead of mutating it
356
+ bclaw_correct_handoff({ originalId: 'hnd_xyz', reason: 'wrong contract', text: '...' })
357
+ ```
358
+
359
+ For the full ideation_loop design (phases, context_filter, iteration
360
+ block, advance_gate, brief assembly, single vs multi-agent UX), see
361
+ [docs/concepts/ideation-loop.md](../concepts/ideation-loop.md). For
362
+ the underlying loop engine, see
363
+ [docs/concepts/loop-engine.md](../concepts/loop-engine.md).
364
+
365
+ #### Deprecation status
366
+
367
+ The v1.0-removed legacy tools named in the changelog emit a
368
+ deprecation warning server-side on each direct call. The warning names
369
+ the canonical replacement. Warnings fired during the 0.8.x window. As
370
+ of v1.0 those tools are removed from every `tools/list` catalog,
371
+ including `{ catalog: "all" }`, but direct calls still succeed as a
372
+ migration escape hatch and keep emitting redirect warnings.
373
+
374
+ ## When To Use MCP Versus Other Surfaces
375
+
376
+ | Need | Best surface |
377
+ |---|---|
378
+ | Fresh path-scoped context | MCP |
379
+ | Current plans, claims, board state | MCP |
380
+ | Runtime writes with session continuity | MCP |
381
+ | Local behavioral reminders inside the agent UI | native agent files |
382
+ | Human inspection or scripting | CLI |
383
+ | Simple readable fallback | `.brainclaw/project.md` (derived view, may be stale) |
384
+
385
+ ## Starting The Server
386
+
387
+ ```bash
388
+ brainclaw mcp
389
+ ```
390
+
391
+ In practice, most agents pick this up through generated MCP config such as `.mcp.json`, `~/.cursor/mcp.json`, or other agent-specific config files written by `brainclaw setup`, `brainclaw init`, or `brainclaw export`.
392
+
393
+ By default, installable update checks use the public npm channel `brainclaw@latest`. Projects that need a different channel can override `brainclaw_update_source`, for example with `type: npm` and `dist_tag: prelaunch`, or with `type: local-pack` for local tarball workflows.
394
+
395
+ ## Bootstrap Through MCP
396
+
397
+ For agent-first onboarding, `bclaw_bootstrap` is the nominal path:
398
+
399
+ 1. call `bclaw_bootstrap` to get the current `import_plan` and adaptive interview questions
400
+ 2. collect answers in the agent surface
401
+ 3. call `bclaw_bootstrap` again with `interviewAnswers` to preview confirmed `decision`, `constraint`, `instruction`, or `trap` suggestions
402
+ 4. call `bclaw_bootstrap` with `apply: true` to create canonical memory
403
+ 5. call `bclaw_bootstrap` with `uninstall: true` to revert the last bootstrap-managed import
404
+
405
+ Interview answers are keyed by question ID and may contain:
406
+
407
+ - `response_text`
408
+ - `response_items`
409
+ - `response_boolean`
410
+ - optional explicit `suggestions` when the agent wants to confirm exact canonical memory items
411
+
412
+ ## Mutation Safety
413
+
414
+ The MCP server serializes all mutations through a single-writer queue (`McpTaskRunner`). When an agent calls a write tool (e.g. `bclaw_claim`, `bclaw_write_note`, `bclaw_create({ entity: "plan", ... })`), the request is enqueued and executed one at a time. This guarantees:
415
+
416
+ - no concurrent writes from the same MCP connection
417
+ - no partial state from interleaved mutations
418
+ - deterministic ordering of operations
419
+
420
+ A secondary file-based lock (`mutate()`) provides cross-process safety in case CLI commands run alongside MCP. But for agents, MCP is the safe path by design — no extra precautions needed.
421
+
422
+ ## Important Rule
423
+
424
+ If the agent has MCP available, do not treat the CLI as the primary runtime interface. All agent mutations MUST go through MCP tools.
425
+
426
+ The CLI remains valuable for:
427
+
428
+ - setup and initialization
429
+ - bootstrap by a human operator
430
+ - scripting and automation
431
+ - release and packaging
432
+ - debugging and fallback access
433
+
434
+ But for capable agents, MCP is the first-class path for both reads and writes.