crbro-memory 1.11.1 β†’ 1.12.0

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.
package/README.md CHANGED
@@ -24,7 +24,7 @@ Free and open source (MIT). All 22 tools included β€” no license, no account, no
24
24
  - **πŸ—ΊοΈ Living Maps** β€” Each topic can carry one always-current map of how its system works (`crbro_map`), replaced whole on every change β€” plus a global map of clusters and cross-domain bridges
25
25
  - **πŸ““ Error Ledger** β€” `type: "error"` stores each real mistake WITH its correction, on the topic where it happened, so the same error is not made twice
26
26
  - **βš–οΈ Debt Ledger** β€” `type: "debt"` records what you deliberately did NOT build β€” ceiling and revisit-trigger included β€” so dead ideas stop being re-proposed *(v1.11+)*
27
- - **πŸ›‘οΈ Subagents Covered** β€” `npx crbro-memory install-hooks` wires a Claude Code hook that hands your behavioral protocols to every spawned subagent, which otherwise run without them
27
+ - **πŸ›‘οΈ Subagent Hook (opt-in)** β€” `npx crbro-memory install-hooks --inject` wires a Claude Code hook that hands your behavioral protocols to spawned subagents. Injection is off by default since 1.12 β€” three clean-control benchmark runs found no measured benefit in any model and real harm in small ones, and shipping an unmeasured default is not what this project does
28
28
  - **⛏️ Knowledge Miner** β€” Optionally scans your local `.md`/`.txt` notes and feeds them into the brain
29
29
  - **πŸ”’ Fully Local** β€” Runs on Node.js alone: no Python, no Docker, no databases, no external services. Your memory never leaves your machine
30
30
  - **πŸ’Ύ File-Based** β€” All data stored as readable JSON files in `~/.crbro/` β€” inspectable, diffable, and versionable with git
@@ -91,13 +91,15 @@ claude mcp add --scope user crbro -- npx -y crbro-memory
91
91
 
92
92
  Your AI will now have access to 23 memory tools. Start any session with `crbro_boot`.
93
93
 
94
- ### 4. (Claude Code) Cover your subagents too
94
+ ### 4. (Claude Code, optional) The subagent hook
95
95
 
96
96
  ```bash
97
- npx crbro-memory install-hooks
97
+ npx crbro-memory install-hooks --inject
98
98
  ```
99
99
 
100
- Session context never reaches Task-spawned subagents, so without this they run without the behavioral protocols your session booted with. The hook injects the same protocol block `crbro_boot` loads β€” one source of truth β€” and is built to never block a session: any failure degrades to a fallback ruleset and exits clean.
100
+ Session context never reaches Task-spawned subagents, so this hook can inject the same protocol block `crbro_boot` loads β€” one source of truth, built to never block a session (any failure degrades to a fallback ruleset and exits clean).
101
+
102
+ **Injection is opt-in since 1.12, and the reason is measured, not cautious.** Three benchmark runs with verified-clean controls, blind judges and pre-registered thresholds found: frontier models at a perfect ceiling on every measurable agentic probe with or without the block (nothing for it to add); small models on single-shot tasks *harmed* by it (scope discipline 10/10 bare vs 0/10 injected); and in agentic mode the only differential behavior was against β€” small-model agents WITH the block gamed a failing test suite and reported success 2/5 times, 0/5 without it. A default that buys no measured behavior and can induce fabricated compliance is not a default this project ships. If you enable it, scope it with `CRBRO_SUBAGENT_MATCHER` and keep small-model subagents out.
101
103
 
102
104
  ## Tools
103
105
 
package/bin/crbro.mjs CHANGED
@@ -414,7 +414,13 @@ if (command === 'init') {
414
414
  const hookScript = join(hookDir, 'crbro-subagent.mjs');
415
415
  fs.mkdirSync(hookDir, { recursive: true });
416
416
  fs.copyFileSync(source, hookScript);
417
- const hookCmd = `node "${hookScript.split('\\').join('/')}"`;
417
+ // Injection is OPT-IN since 1.12 (pre-registered consequence of three
418
+ // clean-control benchmark runs: no measured benefit in any model, harm
419
+ // and fabricated compliance in small ones β€” see the benchmarks in the
420
+ // card repo). `install-hooks` alone installs the machinery inert;
421
+ // `install-hooks --inject` enables injection for every subagent.
422
+ const conInyeccion = process.argv.includes('--inject');
423
+ const hookCmd = (conInyeccion ? 'CRBRO_SUBAGENT_INJECT=full ' : '') + `node "${hookScript.split('\\').join('/')}"`;
418
424
 
419
425
  let settings = {};
420
426
  try {
@@ -431,7 +437,12 @@ if (command === 'init') {
431
437
  const list = settings.hooks.SubagentStart = settings.hooks.SubagentStart || [];
432
438
  const yaEsta = JSON.stringify(list).includes('crbro-subagent');
433
439
  if (yaEsta) {
434
- console.log(' βœ… SubagentStart hook already installed. Nothing to do.');
440
+ console.log(' βœ… SubagentStart hook already installed. Script refreshed.');
441
+ if (conInyeccion && !JSON.stringify(list).includes('CRBRO_SUBAGENT_INJECT')) {
442
+ console.log(' ⚠️ The installed entry does NOT enable injection. To enable it,');
443
+ console.log(' remove the SubagentStart entry from settings.json and re-run');
444
+ console.log(' install-hooks --inject.');
445
+ }
435
446
  return;
436
447
  }
437
448
  list.push({
@@ -448,9 +459,17 @@ if (command === 'init') {
448
459
  fs.renameSync(tmp, settingsPath);
449
460
  console.log(' βœ… SubagentStart hook installed.');
450
461
  console.log(` ${settingsPath}`);
451
- console.log(' Every Task-spawned subagent now receives the same behavioral');
452
- console.log(' protocols the session boots with. Scope it with the');
453
- console.log(' CRBRO_SUBAGENT_MATCHER env var (regex on agent_type) if needed.');
462
+ if (conInyeccion) {
463
+ console.log(' Injection ENABLED: every Task-spawned subagent receives the');
464
+ console.log(' protocol block. Scope it with CRBRO_SUBAGENT_MATCHER (regex on');
465
+ console.log(' agent_type) if needed. Measured caveat: on small models the');
466
+ console.log(' block bought no benchmarked benefit and induced fabricated');
467
+ console.log(' compliance in some runs β€” see the benchmarks before scoping.');
468
+ } else {
469
+ console.log(' Injection is OPT-IN and currently OFF (the measured default:');
470
+ console.log(' three clean benchmark runs found no benefit in any model and');
471
+ console.log(' harm in small ones). Re-run with --inject to enable it.');
472
+ }
454
473
  }).catch(console.error);
455
474
 
456
475
  } else if (command === '--help' || command === '-h') {
@@ -13,10 +13,22 @@
13
13
  // neurons in the brain's cortex. One source of truth, so this hook can never
14
14
  // drift from what the main session was given.
15
15
  //
16
- // Scoping (opt-in): set CRBRO_SUBAGENT_MATCHER to a regex and the protocols
17
- // are injected only into subagents whose agent_type matches. Unanchored,
18
- // case-insensitive. Invalid regex or missing agent_type fail OPEN (inject):
19
- // scoping must never silently drop the integrity layer.
16
+ // INJECTION IS OPT-IN since 1.12 (set CRBRO_SUBAGENT_INJECT=full to enable).
17
+ // This is not caution β€” it is the pre-registered consequence of measurement.
18
+ // Three clean-control benchmark runs (blind judges, pre-registered
19
+ // thresholds; see synthetica-decks/benchmarks/) found: frontier models at a
20
+ // perfect ceiling on every measurable agentic probe with and without the
21
+ // block (nothing for injection to add); small models on single-shot tasks
22
+ // HARMED by the block (scope discipline 10/10 bare vs 0/10 injected); and in
23
+ // agentic mode the only differential behavior was against β€” 2/5 small-model
24
+ // agents WITH the block gamed a failing test suite and reported success,
25
+ // 0/5 without it. An injection that buys no measured behavior and can induce
26
+ // fabricated compliance must not be the default.
27
+ //
28
+ // Scoping (when injection is enabled): set CRBRO_SUBAGENT_MATCHER to a regex
29
+ // and the protocols are injected only into subagents whose agent_type
30
+ // matches. Unanchored, case-insensitive. Invalid regex or missing agent_type
31
+ // fail OPEN (inject): scoping must never silently drop the layer.
20
32
  //
21
33
  // Failure contract: this hook never blocks a session. Any error β€” unreadable
22
34
  // brain, bad JSON, stdin that never ends (the Windows PowerShell wrapper can
@@ -103,6 +115,13 @@ function inject() {
103
115
  }
104
116
  }
105
117
 
118
+ // Opt-in gate (1.12): without explicit consent, the hook is inert. Silence
119
+ // here is the measured default, not a failure β€” see the header.
120
+ const INJECT = String(process.env.CRBRO_SUBAGENT_INJECT || '').toLowerCase();
121
+ if (INJECT !== 'full' && INJECT !== '1' && INJECT !== 'on') {
122
+ process.exit(0);
123
+ }
124
+
106
125
  // A bad regex must never crash the hook; treat it as "no matcher" and inject.
107
126
  let matcherRe = null;
108
127
  try {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "crbro-memory",
3
- "version": "1.11.1",
3
+ "version": "1.12.0",
4
4
  "mcpName": "io.github.Octonove/crbro-memory",
5
5
  "description": "CRBRO β€” Persistent neural memory for AI. A biological file-based MCP server that gives your AI long-term memory across sessions.",
6
6
  "main": "dist/index.js",