brainclaw 1.8.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 (178) hide show
  1. package/README.md +592 -505
  2. package/dist/brainclaw-vscode.vsix +0 -0
  3. package/dist/cli.js +138 -13
  4. package/dist/commands/add-step.js +1 -1
  5. package/dist/commands/bootstrap.js +2 -26
  6. package/dist/commands/check-security-mcp.js +50 -33
  7. package/dist/commands/check-security.js +86 -43
  8. package/dist/commands/claim.js +22 -21
  9. package/dist/commands/confirm.js +26 -0
  10. package/dist/commands/context-diff.js +1 -1
  11. package/dist/commands/dispatch-watch.js +142 -0
  12. package/dist/commands/doctor.js +113 -2
  13. package/dist/commands/estimation-report.js +115 -16
  14. package/dist/commands/harvest.js +286 -23
  15. package/dist/commands/hooks.js +73 -73
  16. package/dist/commands/init.js +124 -22
  17. package/dist/commands/install-hooks.js +78 -78
  18. package/dist/commands/loops-handlers.js +4 -0
  19. package/dist/commands/mcp-read-handlers.js +253 -41
  20. package/dist/commands/mcp.js +664 -102
  21. package/dist/commands/memory.js +21 -17
  22. package/dist/commands/migrate.js +81 -17
  23. package/dist/commands/prune.js +78 -4
  24. package/dist/commands/reflect.js +26 -20
  25. package/dist/commands/register-agent.js +57 -1
  26. package/dist/commands/repair.js +20 -0
  27. package/dist/commands/session-end.js +15 -6
  28. package/dist/commands/session-start.js +18 -1
  29. package/dist/commands/setup-security.js +39 -18
  30. package/dist/commands/setup.js +26 -27
  31. package/dist/commands/stale.js +16 -2
  32. package/dist/commands/switch.js +26 -5
  33. package/dist/commands/uninstall.js +126 -34
  34. package/dist/commands/update-step.js +6 -0
  35. package/dist/commands/version.js +1 -1
  36. package/dist/commands/worktree.js +60 -0
  37. package/dist/core/actions.js +12 -3
  38. package/dist/core/agent-capability.js +30 -17
  39. package/dist/core/agent-files.js +963 -666
  40. package/dist/core/agent-integrations.js +0 -3
  41. package/dist/core/agent-inventory.js +67 -0
  42. package/dist/core/agent-registry.js +163 -29
  43. package/dist/core/agentrun-reconciler.js +33 -2
  44. package/dist/core/agentruns.js +7 -1
  45. package/dist/core/ai-agent-detection.js +31 -44
  46. package/dist/core/archival.js +15 -9
  47. package/dist/core/assignment-reconciler.js +56 -0
  48. package/dist/core/assignment-sweeper.js +127 -4
  49. package/dist/core/assignments.js +69 -11
  50. package/dist/core/bootstrap.js +233 -67
  51. package/dist/core/brainclaw-version.js +22 -0
  52. package/dist/core/candidates.js +21 -1
  53. package/dist/core/claims.js +313 -150
  54. package/dist/core/codev-prompts.js +38 -38
  55. package/dist/core/config.js +6 -1
  56. package/dist/core/context-diff.js +148 -20
  57. package/dist/core/context.js +129 -8
  58. package/dist/core/coordination.js +22 -3
  59. package/dist/core/default-profiles/doctor.yaml +11 -11
  60. package/dist/core/default-profiles/janitor.yaml +11 -11
  61. package/dist/core/default-profiles/onboarder.yaml +11 -11
  62. package/dist/core/default-profiles/reviewer.yaml +13 -13
  63. package/dist/core/dispatch-status.js +79 -5
  64. package/dist/core/dispatcher.js +65 -12
  65. package/dist/core/entity-operations.js +74 -27
  66. package/dist/core/entity-registry.js +31 -5
  67. package/dist/core/event-log.js +138 -21
  68. package/dist/core/events/checkpoint.js +258 -0
  69. package/dist/core/events/genesis.js +220 -0
  70. package/dist/core/events/journal.js +507 -0
  71. package/dist/core/events/materialize.js +126 -0
  72. package/dist/core/events/registry-post-image.js +110 -0
  73. package/dist/core/events/verify.js +109 -0
  74. package/dist/core/execution-adapters.js +23 -0
  75. package/dist/core/execution.js +1 -1
  76. package/dist/core/facade-schema.js +38 -0
  77. package/dist/core/gc-semantic.js +130 -5
  78. package/dist/core/handoff-snapshot.js +68 -0
  79. package/dist/core/ids.js +19 -8
  80. package/dist/core/instruction-templates.js +34 -115
  81. package/dist/core/io.js +39 -3
  82. package/dist/core/json-store.js +10 -1
  83. package/dist/core/lock.js +153 -28
  84. package/dist/core/loops/bootstrap-acquire.js +25 -1
  85. package/dist/core/loops/facade-schema.js +2 -0
  86. package/dist/core/loops/hooks/survey-signals-baseline.js +36 -0
  87. package/dist/core/loops/index.js +1 -0
  88. package/dist/core/loops/presets/bootstrap.js +7 -0
  89. package/dist/core/loops/store.js +17 -0
  90. package/dist/core/loops/verbs.js +24 -2
  91. package/dist/core/markdown.js +8 -76
  92. package/dist/core/mcp-command-resolution.js +245 -0
  93. package/dist/core/memory-compactor.js +5 -3
  94. package/dist/core/memory-lifecycle.js +282 -0
  95. package/dist/core/merge-risk.js +150 -0
  96. package/dist/core/messaging.js +10 -3
  97. package/dist/core/migration.js +11 -1
  98. package/dist/core/observer-mode.js +26 -0
  99. package/dist/core/operations/memory-mutation.js +90 -65
  100. package/dist/core/operations/plan.js +27 -1
  101. package/dist/core/protocol-skills.js +210 -0
  102. package/dist/core/reflection-safety.js +6 -7
  103. package/dist/core/reputation.js +84 -2
  104. package/dist/core/runtime-signals.js +72 -10
  105. package/dist/core/runtime.js +84 -1
  106. package/dist/core/schema.js +114 -0
  107. package/dist/core/search.js +19 -2
  108. package/dist/core/security-detectors.js +125 -0
  109. package/dist/core/security-extract.js +189 -0
  110. package/dist/core/security-guard.js +217 -139
  111. package/dist/core/security-packages.js +121 -0
  112. package/dist/core/security-scoring.js +76 -9
  113. package/dist/core/security.js +34 -2
  114. package/dist/core/sequence.js +11 -2
  115. package/dist/core/setup-flow.js +141 -13
  116. package/dist/core/spawn-check.js +16 -2
  117. package/dist/core/staleness.js +73 -2
  118. package/dist/core/state.js +250 -54
  119. package/dist/core/store-resolution.js +45 -12
  120. package/dist/core/worktree.js +90 -26
  121. package/dist/facts.js +8 -8
  122. package/dist/facts.json +7 -7
  123. package/docs/PROTOCOL.md +223 -0
  124. package/docs/adapters/openclaw.md +43 -43
  125. package/docs/architecture/project-refs.md +328 -328
  126. package/docs/cli.md +2097 -2096
  127. package/docs/concepts/coordination.md +52 -52
  128. package/docs/concepts/coordinator-runbook.md +129 -0
  129. package/docs/concepts/dispatch-lifecycle.md +245 -245
  130. package/docs/concepts/event-log-store.md +928 -0
  131. package/docs/concepts/ideation-loop.md +317 -317
  132. package/docs/concepts/loop-engine.md +520 -511
  133. package/docs/concepts/mcp-governance.md +268 -268
  134. package/docs/concepts/memory.md +89 -88
  135. package/docs/concepts/multi-agent-workflows.md +167 -167
  136. package/docs/concepts/observer-protocol.md +361 -0
  137. package/docs/concepts/parallel-merge-protocol.md +71 -0
  138. package/docs/concepts/plans-and-claims.md +217 -174
  139. package/docs/concepts/project-md-convention.md +35 -35
  140. package/docs/concepts/runtime-notes.md +38 -38
  141. package/docs/concepts/skills.md +78 -0
  142. package/docs/concepts/troubleshooting.md +254 -254
  143. package/docs/concepts/workspace-bootstrapping.md +142 -81
  144. package/docs/context-format-changelog.md +35 -35
  145. package/docs/context-format.md +48 -48
  146. package/docs/index.md +65 -65
  147. package/docs/integrations/agents.md +162 -162
  148. package/docs/integrations/claude-code.md +23 -23
  149. package/docs/integrations/cline.md +87 -88
  150. package/docs/integrations/codex.md +2 -2
  151. package/docs/integrations/continue.md +60 -60
  152. package/docs/integrations/copilot.md +82 -80
  153. package/docs/integrations/cursor.md +23 -23
  154. package/docs/integrations/kilocode.md +72 -72
  155. package/docs/integrations/mcp.md +377 -377
  156. package/docs/integrations/mistral-vibe.md +122 -122
  157. package/docs/integrations/openclaw.md +99 -98
  158. package/docs/integrations/opencode.md +84 -84
  159. package/docs/integrations/overview.md +122 -122
  160. package/docs/integrations/roo.md +74 -74
  161. package/docs/integrations/windsurf.md +83 -83
  162. package/docs/mcp-schema-changelog.md +360 -329
  163. package/docs/playbooks/integration/index.md +121 -121
  164. package/docs/playbooks/orchestration.md +37 -0
  165. package/docs/playbooks/productivity/index.md +99 -99
  166. package/docs/playbooks/team/index.md +117 -117
  167. package/docs/product/agent-first-model.md +184 -184
  168. package/docs/product/entity-model-audit.md +462 -462
  169. package/docs/product/positioning.md +86 -86
  170. package/docs/quickstart-existing-project.md +107 -107
  171. package/docs/quickstart.md +148 -147
  172. package/docs/release-maintenance.md +79 -79
  173. package/docs/reputation.md +52 -52
  174. package/docs/review.md +45 -45
  175. package/docs/security.md +212 -53
  176. package/docs/server-operations.md +118 -118
  177. package/docs/storage.md +110 -108
  178. package/package.json +86 -69
@@ -1,18 +1,18 @@
1
- # Quickstart
2
-
3
- Get brainclaw running in your project in under 5 minutes.
4
-
5
- > **Joining a project that already has `.brainclaw/`?** Use [quickstart-existing-project.md](quickstart-existing-project.md) instead — this page is for setting up a new project from scratch.
6
-
7
- If you're about to cut a release that changes the CLI, MCP, or context surface, run the checklist in [release-maintenance.md](release-maintenance.md) before publishing a local pack or npm build.
8
-
1
+ # Quickstart
2
+
3
+ Get brainclaw running in your project in under 5 minutes.
4
+
5
+ > **Joining a project that already has `.brainclaw/`?** Use [quickstart-existing-project.md](quickstart-existing-project.md) instead — this page is for setting up a new project from scratch.
6
+
7
+ If you're about to cut a release that changes the CLI, MCP, or context surface, run the checklist in [release-maintenance.md](release-maintenance.md) before publishing a local pack or npm build.
8
+
9
9
  ## Step 1: Install
10
10
 
11
11
  ```bash
12
12
  npm install -g brainclaw
13
13
  ```
14
14
 
15
- Requires Node.js 20+. Verify with `brainclaw --version`.
15
+ Requires Node.js 20+ (`engines.node = ">=20.0.0"`). CI exercises Node 22 (Active LTS) and Node 24 (current LTS) — Node 22 or 24 is the recommended runtime; Node 20 still installs but is no longer CI-verified since its April 2026 EOL. Verify with `brainclaw --version`.
16
16
 
17
17
  ## Step 2: Bootstrap this machine
18
18
 
@@ -46,143 +46,144 @@ brainclaw enable-agent <agent-name>
46
46
  If you have multiple repos, use `brainclaw setup --yes` instead — it bootstraps the machine, scans your project directories, and initializes everything at once.
47
47
 
48
48
  ## Step 4: Restart your agent
49
-
50
- Your coding agent needs to reload to pick up the new MCP configuration.
51
-
52
- | Agent | How to reload |
53
- |-------|---------------|
54
- | **Claude Code** | Restart the CLI session or VS Code window |
55
- | **Cursor** | Cmd/Ctrl+Shift+P → "Reload Window" |
56
- | **Codex** | Start a new `codex` session |
57
- | **Cline** | Reload VS Code window |
58
- | **Windsurf** | Reload the editor |
59
- | **Copilot** | Reload VS Code window (uses instruction file, not MCP) |
60
-
49
+
50
+ Your coding agent needs to reload to pick up the new MCP configuration.
51
+
52
+ | Agent | How to reload |
53
+ |-------|---------------|
54
+ | **Claude Code** | Restart the CLI session or VS Code window |
55
+ | **Cursor** | Cmd/Ctrl+Shift+P → "Reload Window" |
56
+ | **Codex** | Start a new `codex` session |
57
+ | **Cline** | Reload VS Code window |
58
+ | **Windsurf** | Reload the editor |
59
+ | **Copilot** | Reload VS Code window (uses instruction file, not MCP) |
60
+
61
61
  ## Step 5: Verify it works
62
-
63
- After reloading, tell your agent:
64
-
65
- ```text
66
- Call bclaw_work with intent "resume" to check that brainclaw is connected.
67
- ```
68
-
69
- The agent should respond with session info, project context, and available tools. If it does, brainclaw is connected.
70
-
71
- From the CLI, you can also verify:
72
-
73
- ```bash
74
- brainclaw status # active sessions, claims, plans
75
- brainclaw agent-board # what each agent sees
76
- brainclaw context # current project memory
77
- ```
78
-
62
+
63
+ After reloading, tell your agent:
64
+
65
+ ```text
66
+ Call bclaw_work with intent "resume" to check that brainclaw is connected.
67
+ ```
68
+
69
+ The agent should respond with session info, project context, and available tools. If it does, brainclaw is connected.
70
+
71
+ From the CLI, you can also verify:
72
+
73
+ ```bash
74
+ brainclaw status # active sessions, claims, plans
75
+ brainclaw agent-board # what each agent sees
76
+ brainclaw context # current project memory
77
+ ```
78
+
79
79
  ## Step 6: Start using brainclaw
80
-
81
- ### For agents with MCP (most agents)
82
-
83
- This is the primary path. Your agent calls brainclaw tools directly during work:
84
-
85
- | Tool | What it does |
86
- |------|-------------|
87
- | `bclaw_work(intent)` | Start a session, load context, claim scope — all in one call |
88
- | `bclaw_coordinate(intent, agents)` | Assign work, consult, request review, open an ideation loop, reroute, or summarize |
89
- | `bclaw_context(kind, path?)` | Read memory / execution / board / delta — narrow to a path when given |
90
- | `bclaw_claim(scope)` | Claim a file/directory before editing (prevents conflicts) |
91
- | `bclaw_write_note(text)` | Record an observation, decision, or trap during work |
92
- | `bclaw_session_end(narrative)` | Close session, release claims, hand off cleanly |
93
-
94
- The facades `bclaw_work` and `bclaw_coordinate` are the recommended entry points — they handle session setup, context loading, and claim management automatically. For entity reads and writes (plans, decisions, traps, handoffs, candidates, etc.), use the canonical grammar: `bclaw_find` / `bclaw_get` / `bclaw_create` / `bclaw_update` / `bclaw_remove` / `bclaw_transition`.
95
-
96
- ### For autonomous agents (no MCP)
97
-
98
- Autonomous agents (OpenClaw, NanoClaw, NemoClaw, PicoClaw, ZeroClaw) operate from a SKILL.md file generated by brainclaw. For Tier B/C agents that have MCP but no hooks (Cursor, Cline, Windsurf, Copilot, Continue, Kilocode, Mistral Vibe, etc.), an opt-in `.live.md` companion (regenerated on session-end and handoff) carries plans, claims, traps, candidates, and handoffs as a parity backstop.
99
-
100
- Regenerate when project memory changes:
101
-
102
- ```bash
103
- brainclaw export --detect --write
104
- ```
105
-
106
- ### Human operators (CLI)
107
-
108
- The CLI is for inspection, scripting, and fallback:
109
-
110
- ```bash
111
- brainclaw plan create "Implement auth module" --priority high
112
- brainclaw plan list
113
- brainclaw claim list
114
- brainclaw context --for src/auth/routes.ts
115
- brainclaw export --detect --write # regenerate all instruction files
116
- ```
117
-
118
- ## Onboarding an existing project
119
-
120
- If the repo already has code, brainclaw can extract context from it:
121
-
122
- ```bash
123
- brainclaw bootstrap --json # preview: CI patterns, ADRs, Docker, branches, tags
124
- brainclaw bootstrap --apply # import detected signals into memory
125
- ```
126
-
127
- Or let your agent drive it:
128
-
129
- ```text
130
- Call bclaw_bootstrap to detect project signals, then review what was found.
131
- ```
132
-
133
- ## Common scenarios
134
-
135
- The same primitives serve multiple workflows. Pick the one that matches what you're doing — full walkthroughs in [`concepts/multi-agent-workflows.md`](concepts/multi-agent-workflows.md).
136
-
137
- ### Active orchestration — parallel lanes across agent instances
138
-
139
- ```text
140
- brainclaw sequence create "feature-cycle" --items '[…]' --status active
141
- bclaw_dispatch(intent="execute", agents=[…])
142
- ```
143
-
144
- The dispatcher creates one worktree + claim per lane and routes inbox messages by `claim_id`. Lanes with `hard_after` unblock as predecessors finish.
145
-
146
- ### Agent switching — when an agent runs out of credits mid-task
147
-
148
- ```text
149
- # On the outgoing agent:
150
- bclaw_session_end(narrative="Did X. Need to finish Y.")
151
-
152
- # On the next agent (same or different):
153
- bclaw_work(intent="resume")
154
- ```
155
-
156
- The new agent picks up the open plans, the latest handoff narrative, and the unfinished claims it can adopt. No re-explanation needed.
157
-
158
- ### Project recovery — returning after weeks away
159
-
160
- ```text
161
- bclaw_work(intent="resume")
162
- ```
163
-
164
- Returns active plans, decisions taken since you left, active constraints, known traps, and where the last session stopped. Use `bclaw_context(kind="memory", profile="briefing")` for a narrower scope-focused view.
165
-
166
- ### Team async — humans and agents sharing the same project
167
-
168
- Capture decisions, constraints, and traps as you discover them — they propagate to every teammate's agent on the next context read:
169
-
170
- ```text
171
- bclaw_create(entity="decision", data={ text: "…", outcome: "approved" })
172
- bclaw_create(entity="constraint", data={ text: "…", category: "security" })
173
- bclaw_create(entity="trap", data={ text: "…", severity: "high" })
174
- ```
175
-
176
- Hand off work for review with `bclaw_coordinate(intent="review", scope="…")`. Reviewers pick it up via `bclaw_read_inbox()`.
177
-
178
- ### One rule across all four
179
-
180
- Scope-level claim isolation is strict — only one active claim per scope at a time, regardless of agent type. That's how parallel work stays safe and async handoffs stay clean.
181
-
182
- ## Next reads
183
-
184
- - [integrations/overview.md](integrations/overview.md) — how brainclaw adapts to each agent
185
- - [integrations/mcp.md](integrations/mcp.md) — the MCP runtime path in detail
186
- - [concepts/memory.md](concepts/memory.md) — what project memory includes
187
- - [concepts/plans-and-claims.md](concepts/plans-and-claims.md) — coordination layer
188
- - [cli.md](cli.md) — full CLI reference
80
+
81
+ ### For agents with MCP (most agents)
82
+
83
+ This is the primary path. Your agent calls brainclaw tools directly during work:
84
+
85
+ | Tool | What it does |
86
+ |------|-------------|
87
+ | `bclaw_work(intent)` | Start a session, load context, claim scope — all in one call |
88
+ | `bclaw_coordinate(intent, agents)` | Assign work, consult, request review, open an ideation loop, reroute, or summarize |
89
+ | `bclaw_context(kind, path?)` | Read memory / execution / board / delta — narrow to a path when given |
90
+ | `bclaw_claim(scope)` | Claim a file/directory before editing (prevents conflicts) |
91
+ | `bclaw_write_note(text)` | Record an observation, decision, or trap during work |
92
+ | `bclaw_session_end(narrative)` | Close session, release claims, hand off cleanly |
93
+
94
+ The facades `bclaw_work` and `bclaw_coordinate` are the recommended entry points — they handle session setup, context loading, and claim management automatically. For entity reads and writes (plans, decisions, traps, handoffs, candidates, etc.), use the canonical grammar: `bclaw_find` / `bclaw_get` / `bclaw_create` / `bclaw_update` / `bclaw_remove` / `bclaw_transition`.
95
+
96
+ ### For autonomous agents (no MCP)
97
+
98
+ Autonomous agents (OpenClaw, NanoClaw, NemoClaw, PicoClaw, ZeroClaw) operate from a SKILL.md file generated by brainclaw. For Tier B/C agents that have MCP but no hooks (Cursor, Cline, Windsurf, Copilot, Continue, Kilocode, Mistral Vibe, etc.), an opt-in `.live.md` companion (regenerated on session-end and handoff) carries plans, claims, traps, candidates, and handoffs as a parity backstop.
99
+
100
+ Regenerate when project memory changes:
101
+
102
+ ```bash
103
+ brainclaw export --detect --write
104
+ ```
105
+
106
+ ### Human operators (CLI)
107
+
108
+ The CLI is for inspection, scripting, and fallback:
109
+
110
+ ```bash
111
+ brainclaw plan create "Implement auth module" --priority high
112
+ brainclaw plan list
113
+ brainclaw claim list
114
+ brainclaw context --for src/auth/routes.ts
115
+ brainclaw export --detect --write # regenerate the detected agent instruction file
116
+ brainclaw export --all # regenerate all known instruction files
117
+ ```
118
+
119
+ ## Onboarding an existing project
120
+
121
+ If the repo already has code, brainclaw can extract context from it:
122
+
123
+ ```bash
124
+ brainclaw bootstrap --json # preview: CI patterns, ADRs, Docker, branches, tags
125
+ brainclaw bootstrap --apply # import detected signals into memory
126
+ ```
127
+
128
+ Or let your agent drive it:
129
+
130
+ ```text
131
+ Call bclaw_bootstrap to detect project signals, then review what was found.
132
+ ```
133
+
134
+ ## Common scenarios
135
+
136
+ The same primitives serve multiple workflows. Pick the one that matches what you're doing — full walkthroughs in [`concepts/multi-agent-workflows.md`](concepts/multi-agent-workflows.md).
137
+
138
+ ### Active orchestration — parallel lanes across agent instances
139
+
140
+ ```text
141
+ brainclaw sequence create "feature-cycle" --items '[…]' --status active
142
+ bclaw_dispatch(intent="execute", agents=[…])
143
+ ```
144
+
145
+ The dispatcher creates one worktree + claim per lane and routes inbox messages by `claim_id`. Lanes with `hard_after` unblock as predecessors finish.
146
+
147
+ ### Agent switching — when an agent runs out of credits mid-task
148
+
149
+ ```text
150
+ # On the outgoing agent:
151
+ bclaw_session_end(narrative="Did X. Need to finish Y.")
152
+
153
+ # On the next agent (same or different):
154
+ bclaw_work(intent="resume")
155
+ ```
156
+
157
+ The new agent picks up the open plans, the latest handoff narrative, and the unfinished claims it can adopt. No re-explanation needed.
158
+
159
+ ### Project recovery — returning after weeks away
160
+
161
+ ```text
162
+ bclaw_work(intent="resume")
163
+ ```
164
+
165
+ Returns active plans, decisions taken since you left, active constraints, known traps, and where the last session stopped. Use `bclaw_context(kind="memory", profile="briefing")` for a narrower scope-focused view.
166
+
167
+ ### Team async — humans and agents sharing the same project
168
+
169
+ Capture decisions, constraints, and traps as you discover them — they propagate to every teammate's agent on the next context read:
170
+
171
+ ```text
172
+ bclaw_create(entity="decision", data={ text: "…", outcome: "approved" })
173
+ bclaw_create(entity="constraint", data={ text: "…", category: "security" })
174
+ bclaw_create(entity="trap", data={ text: "…", severity: "high" })
175
+ ```
176
+
177
+ Hand off work for review with `bclaw_coordinate(intent="review", scope="…")`. Reviewers pick it up via `bclaw_read_inbox()`.
178
+
179
+ ### One rule across all four
180
+
181
+ Scope-level claim isolation is strict — only one active claim per scope at a time, regardless of agent type. That's how parallel work stays safe and async handoffs stay clean.
182
+
183
+ ## Next reads
184
+
185
+ - [integrations/overview.md](integrations/overview.md) — how brainclaw adapts to each agent
186
+ - [integrations/mcp.md](integrations/mcp.md) — the MCP runtime path in detail
187
+ - [concepts/memory.md](concepts/memory.md) — what project memory includes
188
+ - [concepts/plans-and-claims.md](concepts/plans-and-claims.md) — coordination layer
189
+ - [cli.md](cli.md) — full CLI reference
@@ -1,79 +1,79 @@
1
- # Release Maintenance
2
-
3
- Use this guide when a Brainclaw release changes the shipped CLI, MCP surface, context schema, or other operator-facing behavior.
4
-
5
- The goal is simple: if the product surface changed, the packaged docs and the anti-drift checks must change in the same branch before publishing.
6
-
7
- ## When to run this checklist
8
-
9
- Run it before:
10
-
11
- - `brainclaw version --publish-local`
12
- - a merge that changes operator-visible behavior
13
- - a release candidate or local tarball build used for real agent testing
14
-
15
- Run it whenever a change affects one of these surfaces:
16
-
17
- - CLI commands, aliases, flags, help text, or examples
18
- - MCP tools, argument semantics, or read/write classification
19
- - context schema version or documented fields
20
- - packaged workflows such as worktrees, notes, plans, claims, bootstrap, or upgrade/reconcile flows
21
-
22
- ## Release checklist
23
-
24
- 1. Confirm the runtime surface that changed.
25
- Check the relevant source files first, typically `src/cli.ts`, `src/commands/mcp.ts`, `src/commands/mcp-read-handlers.ts`, and `src/core/context.ts`.
26
- 2. Update the packaged docs in the same branch.
27
- At minimum touch the matching reference page in `docs/`, and update `README.md` if the change affects the product story or the primary entry path.
28
- 3. Reconcile CLI and MCP wording.
29
- If a concept exists on both surfaces, document the mapping explicitly. Example: `bclaw_write_note` ↔ `brainclaw runtime-note` / `brainclaw note create`.
30
- 4. Re-check proposal versus shipped surface.
31
- If a change is still design-only, keep it out of stable reference pages or mark it clearly as a proposal.
32
- 5. Run the doc/reference verification before publishing.
33
-
34
- ```bash
35
- npm run build:test
36
- node --test dist-test/tests/unit/docs-reference.test.js
37
- ```
38
-
39
- 6. Run targeted command tests for the changed surface.
40
- Prefer focused tests over broad slow suites when the behavior is small and operator-facing.
41
-
42
- Examples from the current repo:
43
-
44
- ```bash
45
- node --test dist-test/tests/unit/plan-resource-command.test.js
46
- node --test --test-name-pattern "accepts note create as an alias for runtime-note" dist-test/tests/collaboration.test.js
47
- ```
48
-
49
- 7. Only then publish or pack a local release.
50
-
51
- ```bash
52
- brainclaw version --publish-local --release-notes "..."
53
- ```
54
-
55
- ## Minimum files to review
56
-
57
- This is the smallest practical review set for release-visible drift:
58
-
59
- - `README.md`
60
- - `docs/index.md`
61
- - `docs/cli.md`
62
- - `docs/integrations/mcp.md`
63
- - `docs/context-format.md`
64
- - `docs/context-format-changelog.md`
65
- - `tests/unit/docs-reference.test.ts`
66
-
67
- Add workflow-specific docs when needed, for example:
68
-
69
- - `docs/server-operations.md`
70
- - `docs/quickstart.md`
71
- - `docs/concepts/plans-and-claims.md`
72
-
73
- ## What this checklist is trying to prevent
74
-
75
- - shipping a command that exists in code but not in `docs/cli.md`
76
- - claiming a feature is unavailable when the code already ships it
77
- - documenting a proposal as if it were stable product behavior
78
- - leaving MCP and CLI with different names for the same operator workflow
79
- - publishing a local tarball that agents test against while bundled docs still describe the previous surface
1
+ # Release Maintenance
2
+
3
+ Use this guide when a Brainclaw release changes the shipped CLI, MCP surface, context schema, or other operator-facing behavior.
4
+
5
+ The goal is simple: if the product surface changed, the packaged docs and the anti-drift checks must change in the same branch before publishing.
6
+
7
+ ## When to run this checklist
8
+
9
+ Run it before:
10
+
11
+ - `brainclaw version --publish-local`
12
+ - a merge that changes operator-visible behavior
13
+ - a release candidate or local tarball build used for real agent testing
14
+
15
+ Run it whenever a change affects one of these surfaces:
16
+
17
+ - CLI commands, aliases, flags, help text, or examples
18
+ - MCP tools, argument semantics, or read/write classification
19
+ - context schema version or documented fields
20
+ - packaged workflows such as worktrees, notes, plans, claims, bootstrap, or upgrade/reconcile flows
21
+
22
+ ## Release checklist
23
+
24
+ 1. Confirm the runtime surface that changed.
25
+ Check the relevant source files first, typically `src/cli.ts`, `src/commands/mcp.ts`, `src/commands/mcp-read-handlers.ts`, and `src/core/context.ts`.
26
+ 2. Update the packaged docs in the same branch.
27
+ At minimum touch the matching reference page in `docs/`, and update `README.md` if the change affects the product story or the primary entry path.
28
+ 3. Reconcile CLI and MCP wording.
29
+ If a concept exists on both surfaces, document the mapping explicitly. Example: `bclaw_write_note` ↔ `brainclaw runtime-note` / `brainclaw note create`.
30
+ 4. Re-check proposal versus shipped surface.
31
+ If a change is still design-only, keep it out of stable reference pages or mark it clearly as a proposal.
32
+ 5. Run the doc/reference verification before publishing.
33
+
34
+ ```bash
35
+ npm run build:test
36
+ node --test dist-test/tests/unit/docs-reference.test.js
37
+ ```
38
+
39
+ 6. Run targeted command tests for the changed surface.
40
+ Prefer focused tests over broad slow suites when the behavior is small and operator-facing.
41
+
42
+ Examples from the current repo:
43
+
44
+ ```bash
45
+ node --test dist-test/tests/unit/plan-resource-command.test.js
46
+ node --test --test-name-pattern "accepts note create as an alias for runtime-note" dist-test/tests/collaboration.test.js
47
+ ```
48
+
49
+ 7. Only then publish or pack a local release.
50
+
51
+ ```bash
52
+ brainclaw version --publish-local --release-notes "..."
53
+ ```
54
+
55
+ ## Minimum files to review
56
+
57
+ This is the smallest practical review set for release-visible drift:
58
+
59
+ - `README.md`
60
+ - `docs/index.md`
61
+ - `docs/cli.md`
62
+ - `docs/integrations/mcp.md`
63
+ - `docs/context-format.md`
64
+ - `docs/context-format-changelog.md`
65
+ - `tests/unit/docs-reference.test.ts`
66
+
67
+ Add workflow-specific docs when needed, for example:
68
+
69
+ - `docs/server-operations.md`
70
+ - `docs/quickstart.md`
71
+ - `docs/concepts/plans-and-claims.md`
72
+
73
+ ## What this checklist is trying to prevent
74
+
75
+ - shipping a command that exists in code but not in `docs/cli.md`
76
+ - claiming a feature is unavailable when the code already ships it
77
+ - documenting a proposal as if it were stable product behavior
78
+ - leaving MCP and CLI with different names for the same operator workflow
79
+ - publishing a local tarball that agents test against while bundled docs still describe the previous surface
@@ -1,52 +1,52 @@
1
- # Reputation
2
-
3
- Reputation in brainclaw is a bounded trust signal, not a gamified score system.
4
-
5
- ## Purpose
6
-
7
- Its role is to support:
8
-
9
- - review routing
10
- - context ranking tie-breakers
11
- - continuity summaries
12
-
13
- It is **not** a leaderboard or a mutable points ledger.
14
-
15
- ## How it works
16
-
17
- Three subscores are tracked:
18
-
19
- | Subscore | What it measures |
20
- |---|---|
21
- | `contribution_quality` | Quality and adoption of contributed items |
22
- | `review_reliability` | Consistency of review participation |
23
- | `continuity_hygiene` | Session and claim hygiene behaviour |
24
-
25
- These feed an internal bounded score named `internal_trust` computed from a rolling window of recent observable behavior.
26
-
27
- ## Configuration
28
-
29
- ```yaml
30
- reputation:
31
- enabled: true
32
- visibility: summary # 'summary' or 'internal-only'
33
- decay_days: 30
34
- ranking_weight: 0.15
35
- resume_weight: 0.35
36
- mcp_exposure: true
37
- ```
38
-
39
- ## Where reputation surfaces
40
-
41
- - `status --json` — internal snapshot (when enabled)
42
- - `context` — compact `resume_summary` + small ranking bonus
43
- - `list-agents --with-reputation` — bounded public summaries
44
- - `agent-board --with-reputation` — aggregate + selected agent summary
45
- - `doctor --json` — high-level metrics only
46
- - MCP board consumers — opt-in with `includeReputation`
47
-
48
- ## Product caution
49
-
50
- This feature is advanced and should stay secondary to the core product story.
51
- The primary value of brainclaw is shared workspace coordination, not reputation mechanics.
52
- Quality matters more than volume. Semantic relevance still dominates ranking.
1
+ # Reputation
2
+
3
+ Reputation in brainclaw is a bounded trust signal, not a gamified score system.
4
+
5
+ ## Purpose
6
+
7
+ Its role is to support:
8
+
9
+ - review routing
10
+ - context ranking tie-breakers
11
+ - continuity summaries
12
+
13
+ It is **not** a leaderboard or a mutable points ledger.
14
+
15
+ ## How it works
16
+
17
+ Three subscores are tracked:
18
+
19
+ | Subscore | What it measures |
20
+ |---|---|
21
+ | `contribution_quality` | Quality and adoption of contributed items |
22
+ | `review_reliability` | Consistency of review participation |
23
+ | `continuity_hygiene` | Session and claim hygiene behaviour |
24
+
25
+ These feed an internal bounded score named `internal_trust` computed from a rolling window of recent observable behavior.
26
+
27
+ ## Configuration
28
+
29
+ ```yaml
30
+ reputation:
31
+ enabled: true
32
+ visibility: summary # 'summary' or 'internal-only'
33
+ decay_days: 30
34
+ ranking_weight: 0.15
35
+ resume_weight: 0.35
36
+ mcp_exposure: true
37
+ ```
38
+
39
+ ## Where reputation surfaces
40
+
41
+ - `status --json` — internal snapshot (when enabled)
42
+ - `context` — compact `resume_summary` + small ranking bonus
43
+ - `list-agents --with-reputation` — bounded public summaries
44
+ - `agent-board --with-reputation` — aggregate + selected agent summary
45
+ - `doctor --json` — high-level metrics only
46
+ - MCP board consumers — opt-in with `includeReputation`
47
+
48
+ ## Product caution
49
+
50
+ This feature is advanced and should stay secondary to the core product story.
51
+ The primary value of brainclaw is shared workspace coordination, not reputation mechanics.
52
+ Quality matters more than volume. Semantic relevance still dominates ranking.