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,81 +1,142 @@
1
- # Workspace Bootstrapping
2
-
3
- brainclaw is workspace-aware.
4
- Shared memory is not assumed to exist everywhere by default.
5
-
6
- ## Why bootstrap exists
7
-
8
- A workspace may be:
9
-
10
- - already initialized
11
- - known to the agent integration layer but not initialized locally
12
- - entirely new
13
-
14
- Bootstrap is the process that turns a workspace into a brainclaw-aware workspace.
15
-
16
- ## What bootstrap does
17
-
18
- Bootstrap is more than creating a folder.
19
- It establishes the first shared memory foundation for the workspace:
20
-
21
- - inspects the repository structure
22
- - detects the AI coding agent environment
23
- - seeds stable workspace identity (`project_id`, `agent_id`)
24
- - creates the initial storage structure
25
- - writes to the detected agent's native instruction file (Cursor, Claude Code, Windsurf, etc.)
26
- - creates `AGENTS.md` and `.github/copilot-instructions.md`
27
-
28
- ## Good integration pattern
29
-
30
- 1. check whether the workspace is initialized
31
- 2. if yes, retrieve fresh memory
32
- 3. if not, bootstrap when allowed
33
- 4. then use shared memory normally
34
-
35
- ## Why this matters for agents
36
-
37
- If shared memory is absent, that should not always be interpreted as "there is no relevant context".
38
- It may simply mean the workspace has not been onboarded yet.
39
-
40
- This lets a single machine support multiple very different workspaces without forcing one static instruction layer to fit all of them equally well.
41
-
42
- ## Multi-project workspaces
43
-
44
- A workspace may contain multiple brainclaw-initialized child projects (each with its own `.brainclaw/` store). In this topology:
45
-
46
- - The workspace root holds shared instructions, constraints, and coordination state
47
- - Each child project holds project-specific memory (decisions, traps, plans)
48
- - The store chain walks upward: child → repo → workspace → user
49
-
50
- ### Working with child projects
51
-
52
- Agents and operators can address child projects without `cd`:
53
-
54
- ```bash
55
- brainclaw switch apps/lodestar # set active project
56
- brainclaw plan list # now targets lodestar's store
57
- brainclaw switch --clear # back to workspace root
58
- ```
59
-
60
- Or use environment variables:
61
-
62
- ```bash
63
- export BRAINCLAW_PROJECT=lodestar
64
- brainclaw context # resolves lodestar's store
65
- ```
66
-
67
- Or one-off overrides:
68
-
69
- ```bash
70
- brainclaw --cwd apps/lodestar plan list
71
- ```
72
-
73
- ### Project discovery
74
-
75
- `brainclaw switch --list` discovers child projects via:
76
-
77
- 1. Global project registry
78
- 2. Workspace config `projects.known`
79
- 3. Filesystem scan for subdirectories containing `.brainclaw/`
80
-
81
- The bootstrap analysis (`analyzeRepository`) also detects brainclaw-native workspace complexity (child stores, folder strategy, known projects) alongside classic monorepo markers.
1
+ # Workspace Bootstrapping
2
+
3
+ brainclaw is workspace-aware.
4
+ Shared memory is not assumed to exist everywhere by default.
5
+
6
+ ## Why bootstrap exists
7
+
8
+ A workspace may be:
9
+
10
+ - already initialized
11
+ - known to the agent integration layer but not initialized locally
12
+ - entirely new
13
+
14
+ Bootstrap is the process that turns a workspace into a brainclaw-aware workspace.
15
+
16
+ ## What bootstrap does
17
+
18
+ Bootstrap is more than creating a folder.
19
+ It establishes the first shared memory foundation for the workspace:
20
+
21
+ - inspects the repository structure
22
+ - detects the AI coding agent environment
23
+ - seeds stable workspace identity (`project_id`, `agent_id`)
24
+ - creates the initial storage structure
25
+ - writes to the detected agent's native instruction file (Cursor, Claude Code, Windsurf, etc.)
26
+ - creates `AGENTS.md` and `.github/copilot-instructions.md`
27
+
28
+ ## Empty memory: one rule
29
+
30
+ "Bootstrap" historically named three different systems (init scaffolding, the
31
+ `bclaw_bootstrap` brownfield extractor, and the bootstrap ideation loop). When
32
+ the memory store is empty, every surface — the `bclaw_work` hint, the
33
+ `bclaw_setup` quick-init preview, and the `brainclaw init` preflight — now
34
+ emits the same decision rule (`resolveEmptyMemoryRecommendation`):
35
+
36
+ - **Repo with existing content** → run `bclaw_bootstrap` (CLI: `brainclaw bootstrap`)
37
+ to extract initial context from docs, manifests, native agent files, and git
38
+ history.
39
+ - **Greenfield repo** (nothing to extract) → open a bootstrap loop to ideate
40
+ the project vision: `bclaw_coordinate(intent='ideate', preset='bootstrap')`
41
+ (CLI: `brainclaw bootstrap-loop`).
42
+
43
+ The two routes are chainable in either order: extract first, then open a loop
44
+ for whatever vision the docs could not provide or ideate first, then extract
45
+ once content exists. On greenfield, the brownfield preflight scan is skipped
46
+ entirely (there is nothing to harvest yet).
47
+
48
+ ## Good integration pattern
49
+
50
+ 1. check whether the workspace is initialized
51
+ 2. if yes, retrieve fresh memory
52
+ 3. if not, bootstrap when allowed
53
+ 4. then use shared memory normally
54
+
55
+ ## Why this matters for agents
56
+
57
+ If shared memory is absent, that should not always be interpreted as "there is no relevant context".
58
+ It may simply mean the workspace has not been onboarded yet.
59
+
60
+ This lets a single machine support multiple very different workspaces without forcing one static instruction layer to fit all of them equally well.
61
+
62
+ ## init = single project entry point
63
+
64
+ `brainclaw init` is the single code path for turning a project into a
65
+ brainclaw-aware workspace, whether invoked from a terminal, from the
66
+ `bclaw_setup` MCP tool's quick-init step, or from a multi-repo
67
+ `brainclaw setup`. After detecting the local AI agent, init runs the
68
+ per-agent slice of the machine prerequisites (the same writes `setup`
69
+ performs at machine scope, scoped to the detected agent) so an agent
70
+ landing in the carte-blanche / fresh-repo case does not need a separate
71
+ shell-out + session reload. The slice is idempotent — each `ensure*`
72
+ function returns "skipped" when the agent's user-scope config doesn't
73
+ exist, and the writes are short-circuited in `BRAINCLAW_TEST_MODE` or
74
+ when `--skip-agent-bootstrap` is passed. `setup` is rescoped to
75
+ multi-repo / machine-bootstrap; `setup-machine` is the explicit
76
+ machine-only path.
77
+
78
+ ### `init --force`
79
+
80
+ `--force` rebuilds managed identity fields (project_id, current_agent,
81
+ storage_dir, topology) but **merges through the existing config** so
82
+ curator personalisations (redaction patterns, sensitive paths,
83
+ governance overrides, claim TTL, cross-project links, custom markdown
84
+ caps) survive the reset. Before any write, a sibling backup is taken at
85
+ `.brainclaw.bak-<timestamp>/` — the standard recovery-backups pattern
86
+ used by `brainclaw upgrade`. Recovery: `brainclaw upgrade --rollback`.
87
+
88
+ ## Solo-agent fresh defaults
89
+
90
+ A fresh `brainclaw init` seeds `governance.curators` with the human
91
+ running init. Without this, the default `approval_policy: 'review'`
92
+ combined with `curators: []` trapped every reflective note in pending
93
+ forever — a surprise that doesn't show up until enough memory has
94
+ accumulated to notice. The merge logic preserves any explicit curator
95
+ list on an existing store, so this only takes effect on fresh installs.
96
+
97
+ On an empty store, `bclaw_work` carries an explicit
98
+ `bclaw_create(entity='plan')` hint in `next_actions` alongside the
99
+ bootstrap recommendation: the bootstrap covers *vision*, the plan
100
+ affordance covers *work* itself. The two are independent — both can
101
+ appear simultaneously.
102
+
103
+ ## Multi-project workspaces
104
+
105
+ A workspace may contain multiple brainclaw-initialized child projects (each with its own `.brainclaw/` store). In this topology:
106
+
107
+ - The workspace root holds shared instructions, constraints, and coordination state
108
+ - Each child project holds project-specific memory (decisions, traps, plans)
109
+ - The store chain walks upward: child → repo → workspace → user
110
+
111
+ ### Working with child projects
112
+
113
+ Agents and operators can address child projects without `cd`:
114
+
115
+ ```bash
116
+ brainclaw switch apps/lodestar # set active project
117
+ brainclaw plan list # now targets lodestar's store
118
+ brainclaw switch --clear # back to workspace root
119
+ ```
120
+
121
+ Or use environment variables:
122
+
123
+ ```bash
124
+ export BRAINCLAW_PROJECT=lodestar
125
+ brainclaw context # resolves lodestar's store
126
+ ```
127
+
128
+ Or one-off overrides:
129
+
130
+ ```bash
131
+ brainclaw --cwd apps/lodestar plan list
132
+ ```
133
+
134
+ ### Project discovery
135
+
136
+ `brainclaw switch --list` discovers child projects via:
137
+
138
+ 1. Global project registry
139
+ 2. Workspace config `projects.known`
140
+ 3. Filesystem scan for subdirectories containing `.brainclaw/`
141
+
142
+ The bootstrap analysis (`analyzeRepository`) also detects brainclaw-native workspace complexity (child stores, folder strategy, known projects) alongside classic monorepo markers.
@@ -1,35 +1,35 @@
1
- # Context Format Changelog
2
-
3
- ## 1.3 (planned / not yet emitted as `context_schema`)
4
-
5
- - Added `available_capabilities` field to structured context containing registered project capabilities with metadata (id, name, category)
6
- - Added `available_tools` field to structured context containing registered project tools with metadata (id, name, type)
7
- - Enhanced text output to include "Available Capabilities" and "Available Tools" sections when metadata is present
8
- - Added discovery hints pointing users to `bclaw_get_capabilities`, `bclaw_list_tools`, and `bclaw_search_tools` MCP tools
9
- - These fields are currently additive enrichments around the `1.2` contract; update `CONTEXT_SCHEMA_VERSION` before treating this section as the shipped schema version
10
-
11
- ## 1.2
12
-
13
- - Added `context_diff` to expose compact memory deltas since a session started.
14
- - Clarified the public contract for contradiction-aware session context refreshes.
15
- - Kept the contract additive and backward-compatible with `1.1`.
16
-
17
- ## 1.1
18
-
19
- - Added explicit `context_schema` rendering in markdown and template outputs.
20
- - Added `agent_tooling.agents_rules`.
21
- - Added skill metadata flags: `scripts_present`, `references_present`, `assets_present`.
22
- - Added MCP inventory metadata: `availability`, `source`.
23
- - Kept the contract additive and backward-compatible with `1.0`.
24
-
25
- ## 1.0
26
-
27
- - Baseline contract introduced with:
28
- - `digest`
29
- - `memory_density`
30
- - `bootstrap_available`
31
- - `derived_signals`
32
- - `execution_context`
33
- - `agent_tooling`
34
- - `scoped_activity`
35
- - `selected`
1
+ # Context Format Changelog
2
+
3
+ ## 1.3 (planned / not yet emitted as `context_schema`)
4
+
5
+ - Added `available_capabilities` field to structured context containing registered project capabilities with metadata (id, name, category)
6
+ - Added `available_tools` field to structured context containing registered project tools with metadata (id, name, type)
7
+ - Enhanced text output to include "Available Capabilities" and "Available Tools" sections when metadata is present
8
+ - Added discovery hints pointing users to `bclaw_get_capabilities`, `bclaw_list_tools`, and `bclaw_search_tools` MCP tools
9
+ - These fields are currently additive enrichments around the `1.2` contract; update `CONTEXT_SCHEMA_VERSION` before treating this section as the shipped schema version
10
+
11
+ ## 1.2
12
+
13
+ - Added `context_diff` to expose compact memory deltas since a session started.
14
+ - Clarified the public contract for contradiction-aware session context refreshes.
15
+ - Kept the contract additive and backward-compatible with `1.1`.
16
+
17
+ ## 1.1
18
+
19
+ - Added explicit `context_schema` rendering in markdown and template outputs.
20
+ - Added `agent_tooling.agents_rules`.
21
+ - Added skill metadata flags: `scripts_present`, `references_present`, `assets_present`.
22
+ - Added MCP inventory metadata: `availability`, `source`.
23
+ - Kept the contract additive and backward-compatible with `1.0`.
24
+
25
+ ## 1.0
26
+
27
+ - Baseline contract introduced with:
28
+ - `digest`
29
+ - `memory_density`
30
+ - `bootstrap_available`
31
+ - `derived_signals`
32
+ - `execution_context`
33
+ - `agent_tooling`
34
+ - `scoped_activity`
35
+ - `selected`
@@ -1,48 +1,48 @@
1
- # Context Format
2
-
3
- `brainclaw context` (CLI) and `bclaw_context` (MCP) expose a versioned public contract for agent consumers.
4
-
5
- Current version: `1.2`
6
-
7
- ## Stable top-level fields
8
-
9
- - `context_schema`
10
- - `digest`
11
- - `memory_density`
12
- - `bootstrap_available`
13
- - `derived_signals`
14
- - `execution_context`
15
- - `agent_tooling`
16
- - `scoped_activity`
17
- - `context_diff`
18
- - `selected`
19
-
20
- ## Compatibility policy
21
-
22
- - Additive changes bump the minor version.
23
- - Breaking changes bump the major version.
24
- - Fields listed above are treated as public and stable for agent consumers.
25
- - Future enrichments should prefer optional fields over reshaping existing ones.
26
-
27
- ## `1.2` additions over `1.1`
28
-
29
- - `context_diff` is available for session-aware deltas through `brainclaw context --since-session` (CLI) and `bclaw_context(kind="delta", since=<session_id>)` (MCP).
30
- - `context_schema: 1.2` is emitted across JSON, markdown, template, and MCP structured content.
31
-
32
- ## `1.1` additions over `1.0`
33
-
34
- - `context_schema` is now explicitly surfaced in markdown and template renders.
35
- - `agent_tooling` includes `agents_rules`.
36
- - `agent_tooling.skills[]` includes bounded capability markers:
37
- - `scripts_present`
38
- - `references_present`
39
- - `assets_present`
40
- - `agent_tooling.mcp_servers[]` includes:
41
- - `availability`
42
- - `source`
43
-
44
- ## Semantics
45
-
46
- - `execution_context` and `agent_tooling` are opportunistic and may be omitted when not useful.
47
- - `derived_signals` are non-canonical bootstrap hints, not accepted project memory.
48
- - `agent_tooling` inventories local capabilities and constraints; it does not imply project decisions.
1
+ # Context Format
2
+
3
+ `brainclaw context` (CLI) and `bclaw_context` (MCP) expose a versioned public contract for agent consumers.
4
+
5
+ Current version: `1.2`
6
+
7
+ ## Stable top-level fields
8
+
9
+ - `context_schema`
10
+ - `digest`
11
+ - `memory_density`
12
+ - `bootstrap_available`
13
+ - `derived_signals`
14
+ - `execution_context`
15
+ - `agent_tooling`
16
+ - `scoped_activity`
17
+ - `context_diff`
18
+ - `selected`
19
+
20
+ ## Compatibility policy
21
+
22
+ - Additive changes bump the minor version.
23
+ - Breaking changes bump the major version.
24
+ - Fields listed above are treated as public and stable for agent consumers.
25
+ - Future enrichments should prefer optional fields over reshaping existing ones.
26
+
27
+ ## `1.2` additions over `1.1`
28
+
29
+ - `context_diff` is available for session-aware deltas through `brainclaw context --since-session` (CLI) and `bclaw_context(kind="delta", since=<session_id>)` (MCP).
30
+ - `context_schema: 1.2` is emitted across JSON, markdown, template, and MCP structured content.
31
+
32
+ ## `1.1` additions over `1.0`
33
+
34
+ - `context_schema` is now explicitly surfaced in markdown and template renders.
35
+ - `agent_tooling` includes `agents_rules`.
36
+ - `agent_tooling.skills[]` includes bounded capability markers:
37
+ - `scripts_present`
38
+ - `references_present`
39
+ - `assets_present`
40
+ - `agent_tooling.mcp_servers[]` includes:
41
+ - `availability`
42
+ - `source`
43
+
44
+ ## Semantics
45
+
46
+ - `execution_context` and `agent_tooling` are opportunistic and may be omitted when not useful.
47
+ - `derived_signals` are non-canonical bootstrap hints, not accepted project memory.
48
+ - `agent_tooling` inventories local capabilities and constraints; it does not imply project decisions.
package/docs/index.md CHANGED
@@ -1,69 +1,69 @@
1
- # Documentation Index
2
-
3
- Use this page as the entry point into the packaged Markdown documentation.
4
-
5
- ## Getting Started
6
-
7
- - [quickstart.md](quickstart.md) — fastest onboarding path for a new project (greenfield)
8
- - [quickstart-existing-project.md](quickstart-existing-project.md) — joining a project that already has `.brainclaw/`
9
- - [server-operations.md](server-operations.md) — remote server, DGX, SSH, and multi-project operator workflow
10
- - [integrations/overview.md](integrations/overview.md) — integration model by agent surface
11
-
12
- ## Guides
13
-
14
- - [integrations/mcp.md](integrations/mcp.md) — recommended runtime path for MCP-capable agents
15
- - [integrations/agents.md](integrations/agents.md) — agent integration principles and setup details
16
- - [release-maintenance.md](release-maintenance.md) — release checklist for CLI/MCP/context-schema changes
17
- - [review.md](review.md) — reflective workflow and candidate promotion
18
- - [storage.md](storage.md) — storage model and canonical vs derived state
19
- - [security.md](security.md) — security model and guardrails
20
-
21
- ## Concepts
22
-
23
- - [concepts/memory.md](concepts/memory.md)
24
- - [concepts/plans-and-claims.md](concepts/plans-and-claims.md)
25
- - [concepts/runtime-notes.md](concepts/runtime-notes.md)
26
- - [concepts/coordination.md](concepts/coordination.md)
27
- - [concepts/multi-agent-workflows.md](concepts/multi-agent-workflows.md)
28
- - [concepts/workspace-bootstrapping.md](concepts/workspace-bootstrapping.md)
29
- - [concepts/troubleshooting.md](concepts/troubleshooting.md) — runbook for degraded coordination state
30
- - [concepts/memory-staleness.md](concepts/memory-staleness.md)
31
- - [concepts/loop-engine.md](concepts/loop-engine.md)
32
- - [concepts/ideation-loop.md](concepts/ideation-loop.md) — memory-confrontation ideation loop (v1.5.0+)
33
- - [concepts/mcp-governance.md](concepts/mcp-governance.md)
34
-
35
- ## Reference
36
-
37
- - [cli.md](cli.md) — CLI reference
38
- - [context-format.md](context-format.md) — public context contract
39
- - [context-format-changelog.md](context-format-changelog.md)
40
- - [mcp-schema-changelog.md](mcp-schema-changelog.md)
41
-
42
- ## Agent-Specific Notes
43
-
44
- - [integrations/claude-code.md](integrations/claude-code.md)
45
- - [integrations/codex.md](integrations/codex.md)
46
- - [integrations/cursor.md](integrations/cursor.md)
47
- - [integrations/copilot.md](integrations/copilot.md)
48
- - [integrations/continue.md](integrations/continue.md)
49
- - [integrations/roo.md](integrations/roo.md)
50
- - [integrations/windsurf.md](integrations/windsurf.md)
51
- - [integrations/opencode.md](integrations/opencode.md)
1
+ # Documentation Index
2
+
3
+ Use this page as the entry point into the packaged Markdown documentation.
4
+
5
+ ## Getting Started
6
+
7
+ - [quickstart.md](quickstart.md) — fastest onboarding path for a new project (greenfield)
8
+ - [quickstart-existing-project.md](quickstart-existing-project.md) — joining a project that already has `.brainclaw/`
9
+ - [server-operations.md](server-operations.md) — remote server, DGX, SSH, and multi-project operator workflow
10
+ - [integrations/overview.md](integrations/overview.md) — integration model by agent surface
11
+
12
+ ## Guides
13
+
14
+ - [integrations/mcp.md](integrations/mcp.md) — recommended runtime path for MCP-capable agents
15
+ - [integrations/agents.md](integrations/agents.md) — agent integration principles and setup details
16
+ - [release-maintenance.md](release-maintenance.md) — release checklist for CLI/MCP/context-schema changes
17
+ - [review.md](review.md) — reflective workflow and candidate promotion
18
+ - [storage.md](storage.md) — storage model and canonical vs derived state
19
+ - [security.md](security.md) — security model and guardrails
20
+
21
+ ## Concepts
22
+
23
+ - [concepts/memory.md](concepts/memory.md)
24
+ - [concepts/plans-and-claims.md](concepts/plans-and-claims.md)
25
+ - [concepts/runtime-notes.md](concepts/runtime-notes.md)
26
+ - [concepts/coordination.md](concepts/coordination.md)
27
+ - [concepts/multi-agent-workflows.md](concepts/multi-agent-workflows.md)
28
+ - [concepts/workspace-bootstrapping.md](concepts/workspace-bootstrapping.md)
29
+ - [concepts/troubleshooting.md](concepts/troubleshooting.md) — runbook for degraded coordination state
30
+ - [concepts/memory-staleness.md](concepts/memory-staleness.md)
31
+ - [concepts/loop-engine.md](concepts/loop-engine.md)
32
+ - [concepts/ideation-loop.md](concepts/ideation-loop.md) — memory-confrontation ideation loop (v1.5.0+)
33
+ - [concepts/mcp-governance.md](concepts/mcp-governance.md)
34
+
35
+ ## Reference
36
+
37
+ - [cli.md](cli.md) — CLI reference
38
+ - [context-format.md](context-format.md) — public context contract
39
+ - [context-format-changelog.md](context-format-changelog.md)
40
+ - [mcp-schema-changelog.md](mcp-schema-changelog.md)
41
+
42
+ ## Agent-Specific Notes
43
+
44
+ - [integrations/claude-code.md](integrations/claude-code.md)
45
+ - [integrations/codex.md](integrations/codex.md)
46
+ - [integrations/cursor.md](integrations/cursor.md)
47
+ - [integrations/copilot.md](integrations/copilot.md)
48
+ - [integrations/continue.md](integrations/continue.md)
49
+ - [integrations/roo.md](integrations/roo.md)
50
+ - [integrations/windsurf.md](integrations/windsurf.md)
51
+ - [integrations/opencode.md](integrations/opencode.md)
52
52
  - [integrations/kilocode.md](integrations/kilocode.md)
53
53
  - [integrations/mistral-vibe.md](integrations/mistral-vibe.md)
54
54
  - [integrations/hermes.md](integrations/hermes.md)
55
55
  - [integrations/openclaw.md](integrations/openclaw.md)
56
-
57
- ## Audience Design Constraints
58
-
59
- Internal design reference — constraints that guide brainclaw development per target audience.
60
-
61
- - [playbooks/productivity/](playbooks/productivity/index.md) — end-users & solo devs
62
- - [playbooks/team/](playbooks/team/index.md) — teams & ops
63
- - [playbooks/integration/](playbooks/integration/index.md) — AI builders
64
-
65
- ## Design And Proposals
66
-
67
- - [architecture/project-refs.md](architecture/project-refs.md) — target navigation model, not the fully shipped surface
68
- - [product/positioning.md](product/positioning.md)
69
- - [adapters/openclaw.md](adapters/openclaw.md)
56
+
57
+ ## Audience Design Constraints
58
+
59
+ Internal design reference — constraints that guide brainclaw development per target audience.
60
+
61
+ - [playbooks/productivity/](playbooks/productivity/index.md) — end-users & solo devs
62
+ - [playbooks/team/](playbooks/team/index.md) — teams & ops
63
+ - [playbooks/integration/](playbooks/integration/index.md) — AI builders
64
+
65
+ ## Design And Proposals
66
+
67
+ - [architecture/project-refs.md](architecture/project-refs.md) — target navigation model, not the fully shipped surface
68
+ - [product/positioning.md](product/positioning.md)
69
+ - [adapters/openclaw.md](adapters/openclaw.md)