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,189 +1,189 @@
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
- ## Step 1: Install
10
-
11
- ```bash
12
- npm install -g brainclaw
13
- ```
14
-
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
-
17
- ## Step 2: Bootstrap this machine
18
-
19
- ```bash
20
- brainclaw setup-machine --yes
21
- ```
22
-
23
- This configures the agents Brainclaw can see on the current machine and writes the machine-level MCP/user files it manages. It does **not** initialize the current repository yet.
24
-
25
- ## Step 3: Initialize or refresh your project
26
-
27
- ```bash
28
- cd your-project
29
- brainclaw init
30
- ```
31
-
32
- **What happens:**
33
- - Creates `.brainclaw/` when the project is new, or refreshes it safely when it already exists
34
- - Detects your coding agent (Claude Code, Codex, Cursor, Copilot, Cline, Mistral Vibe, etc.)
35
- - Refreshes the detected agent's project and machine integration files when applicable
36
- - Writes instruction files (`CLAUDE.md`, `AGENTS.md`, `.cursor/rules/brainclaw.md`, etc.)
37
- - Installs session hooks (if supported by your agent)
38
- - Adds `.brainclaw/` to `.gitignore`
39
-
40
- If you want the explicit path for a second or late-arriving agent on an already initialized project, use:
41
-
42
- ```bash
43
- brainclaw enable-agent <agent-name>
44
- ```
45
-
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
-
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
-
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
-
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
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
+ ## Step 1: Install
10
+
11
+ ```bash
12
+ npm install -g brainclaw
13
+ ```
14
+
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
+
17
+ ## Step 2: Bootstrap this machine
18
+
19
+ ```bash
20
+ brainclaw setup-machine --yes
21
+ ```
22
+
23
+ This configures the agents Brainclaw can see on the current machine and writes the machine-level MCP/user files it manages. It does **not** initialize the current repository yet.
24
+
25
+ ## Step 3: Initialize or refresh your project
26
+
27
+ ```bash
28
+ cd your-project
29
+ brainclaw init
30
+ ```
31
+
32
+ **What happens:**
33
+ - Creates `.brainclaw/` when the project is new, or refreshes it safely when it already exists
34
+ - Detects your coding agent (Claude Code, Codex, Cursor, Copilot, Cline, Mistral Vibe, etc.)
35
+ - Refreshes the detected agent's project and machine integration files when applicable
36
+ - Writes instruction files (`CLAUDE.md`, `AGENTS.md`, `.cursor/rules/brainclaw.md`, etc.)
37
+ - Installs session hooks (if supported by your agent)
38
+ - Adds `.brainclaw/` to `.gitignore`
39
+
40
+ If you want the explicit path for a second or late-arriving agent on an already initialized project, use:
41
+
42
+ ```bash
43
+ brainclaw enable-agent <agent-name>
44
+ ```
45
+
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
+
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
+
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
+
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
112
  brainclaw plan list
113
113
  brainclaw claim list
114
114
  brainclaw context --for src/auth/routes.ts
115
115
  brainclaw export --detect --write # regenerate the detected agent instruction file
116
116
  brainclaw export --all # regenerate all known instruction files
117
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
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.