ruvnet-brain 4.3.9 → 4.3.10

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 (83) hide show
  1. package/README.md +26 -9
  2. package/bin/install.mjs +646 -366
  3. package/bin/nightly-refresh.mjs +115 -0
  4. package/kb/brain-profile.mjs +118 -32
  5. package/kb/lifecycle-evidence-retention.mjs +237 -0
  6. package/kb/refresh-run.mjs +367 -0
  7. package/kb/retrieval-result.mjs +39 -0
  8. package/kb/update-storage-transaction.mjs +439 -0
  9. package/package.json +11 -2
  10. package/plugin/.claude-plugin/plugin.json +1 -1
  11. package/plugin/.codex-plugin/plugin.json +1 -1
  12. package/plugin/hooks/codex-hooks.json +2 -165
  13. package/plugin/hooks/hook-contracts.json +4 -65
  14. package/plugin/hooks/hooks.json +2 -208
  15. package/plugin/scripts/adr-currency-gate.mjs +29 -19
  16. package/plugin/scripts/capability-registry.mjs +10 -83
  17. package/plugin/scripts/codex-hook-adapter.mjs +62 -9
  18. package/plugin/scripts/codex-hook-wrapper.mjs +19 -1
  19. package/plugin/scripts/continuation-gate.mjs +30 -28
  20. package/plugin/scripts/continuation-objective.mjs +34 -0
  21. package/plugin/scripts/development-maintenance.mjs +49 -0
  22. package/plugin/scripts/hook-shim.mjs +3 -0
  23. package/plugin/scripts/learn-flush.mjs +6 -1
  24. package/plugin/scripts/lesson-gate.mjs +5 -2
  25. package/plugin/scripts/lesson-presentation.mjs +5 -0
  26. package/plugin/scripts/md-stamp.mjs +109 -6
  27. package/plugin/scripts/memory-doctor.mjs +3 -7
  28. package/plugin/scripts/nightly-controller.mjs +9 -27
  29. package/plugin/scripts/nightly-scheduler.mjs +472 -0
  30. package/plugin/scripts/project-progression-contract.mjs +4 -4
  31. package/plugin/scripts/project-progression-store.mjs +35 -6
  32. package/plugin/scripts/ruflo-bin.mjs +20 -0
  33. package/plugin/scripts/session-snapshot-contract.mjs +6 -1
  34. package/plugin/scripts/version-bump-gate.sh +14 -2
  35. package/plugin/skills/ruvnet-brain/PLAYBOOK.md +15 -23
  36. package/scripts/build-bundle.mjs +8 -0
  37. package/scripts/build-primer.mjs +2 -3
  38. package/scripts/candidate-host-evidence.mjs +59 -41
  39. package/scripts/ci/build-fixture-kb.mjs +59 -2
  40. package/scripts/ci/mutate-hook-timeout.mjs +24 -47
  41. package/scripts/ci/stranger-scenario.mjs +13 -28
  42. package/scripts/claims-verify.mjs +219 -21
  43. package/scripts/console-engine.mjs +4 -18
  44. package/scripts/console-runtime-identity.mjs +6 -0
  45. package/scripts/development-maintenance.mjs +47 -0
  46. package/scripts/development-push-check.mjs +35 -0
  47. package/scripts/distill-project.mjs +24 -47
  48. package/scripts/doc-currency.mjs +91 -19
  49. package/scripts/git-hooks/pre-push +4 -162
  50. package/scripts/health-repair.mjs +22 -4
  51. package/scripts/hook-retirement-check.mjs +22 -0
  52. package/scripts/host-install-matrix.mjs +125 -61
  53. package/scripts/integration-evidence.mjs +11 -6
  54. package/scripts/learning-replay-fixture.mjs +23 -2
  55. package/scripts/nightly-two-run-proof.mjs +415 -0
  56. package/scripts/nightly-watchdog.mjs +17 -2
  57. package/scripts/npm-invocation.mjs +20 -0
  58. package/scripts/prepublication-evidence.mjs +42 -6
  59. package/scripts/primer-grounding.mjs +20 -0
  60. package/scripts/product-integrity-contract.mjs +22 -2
  61. package/scripts/public-verification-abandon.mjs +101 -0
  62. package/scripts/public-verification-aggregate.mjs +53 -19
  63. package/scripts/public-verification-finalizer.mjs +8 -2
  64. package/scripts/public-verification-lane.mjs +63 -8
  65. package/scripts/publication-receipt.mjs +109 -45
  66. package/scripts/published-surface-probe.mjs +10 -2
  67. package/scripts/qa-contract.mjs +57 -0
  68. package/scripts/qa-lanes.mjs +40 -0
  69. package/scripts/qa-runner.mjs +54 -64
  70. package/scripts/qe/ux-suite.mjs +10 -34
  71. package/scripts/qualified-candidate-check.mjs +124 -0
  72. package/scripts/release-abort-stale.mjs +2 -2
  73. package/scripts/release-projection.mjs +20 -1
  74. package/scripts/release-qualification-contract.mjs +87 -0
  75. package/scripts/release-qualification.mjs +135 -0
  76. package/scripts/release-transaction.mjs +81 -1
  77. package/scripts/remedy-registry.mjs +6 -13
  78. package/scripts/retrieval-canary.mjs +91 -18
  79. package/scripts/selfcheck.mjs +12 -4
  80. package/scripts/snapshot-freshness.mjs +58 -0
  81. package/scripts/stack-sync.mjs +41 -43
  82. package/scripts/staged-host-verifier.mjs +63 -14
  83. package/scripts/wired-check.mjs +31 -2
@@ -69,6 +69,8 @@ const argv = process.argv.slice(2);
69
69
  * every entry on every run, below, so they cannot rot unseen.
70
70
  */
71
71
  const STANDALONE = [
72
+ ['gate', 'retired automatic-hook helper retained for explicit use and tests'],
73
+ ['version-bump-gate', 'retired automatic interceptor; explicit version checks own release validation'],
72
74
  ['lesson-seed', 'one-shot seeding, run deliberately by a human'],
73
75
  ['lesson-ratify', 'the human control surface — a CLI is its entire purpose'],
74
76
  ['stamp-sweep', 'ADR-056 §2 — the ONE-TIME backfill half of the stamp rule. A human runs it once '
@@ -95,6 +97,12 @@ const STANDALONE = [
95
97
  + 'RVFs to RVF-GENERATIONS.json and optionally prunes legacy sidecars; build-bundle.mjs consumes '
96
98
  + 'and validates the resulting manifest, so scheduling this destructive migration would be wrong'],
97
99
  ['release', 'the ship path, run by a human'],
100
+ ['corpus-seed-publish', 'privileged manual corpus publication wrapper; corpus-seed.yml explicitly '
101
+ + 'stops at sealed preparation with contents:read. This entry validates receipt/archive inputs '
102
+ + 'and delegates mutation to release.mjs protected authority. No operational caller is registered; '
103
+ + 'classification does not claim publication works or has occurred'],
104
+ ['gate', 'manual benchmark harness: rebuilds concepts and runs three routing proof batteries; '
105
+ + 'no workflow or scheduler invokes this expensive command'],
98
106
  ['execution-preflight', 'external orchestration boundary — invoked by the host before consequential Ruflo/Codex execution; no in-repo caller exists because the host supplies the live Brain and AgentDB receipts'],
99
107
  ['fix-workstream', 'session-supervised coordination CLI run explicitly by the integration owner or an '
100
108
  + 'isolated writing agent to start and hand off a fix lane. Scheduling it would violate its safety '
@@ -375,8 +383,11 @@ function callerFiles(repo = REPO) {
375
383
  */
376
384
  export function callerPattern(fileName) {
377
385
  const q = fileName.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
386
+ // Filenames must be complete tokens: gates.mjs is not corpus-aggregates.mjs,
387
+ // and version.mjs.map is not a caller of version.mjs.
388
+ const bounded = `(?<![\\w.-])${q}(?![\\w.-])`;
378
389
  // eslint-disable-next-line no-useless-escape
379
- return new RegExp(`["'\`][^"'\`\\n]*${q}|(?:node|bash|sh|exec|spawn\\w*)\\s+[^\\n]*${q}`);
390
+ return new RegExp(`["'\`][^"'\`\\n]*${bounded}|(?:node|bash|sh|exec|spawn\\w*)\\s+[^\\n]*${bounded}`);
380
391
  }
381
392
 
382
393
  /**
@@ -765,6 +776,16 @@ export function hookWiringAudit({
765
776
  homeSettingsFile = path.join(os.homedir(), '.claude', 'settings.json'),
766
777
  held = HOOK_HELD,
767
778
  } = {}) {
779
+ const retirementFiles = [
780
+ path.join(repo, 'plugin/hooks/hooks.json'),
781
+ path.join(repo, 'plugin/hooks/codex-hooks.json'),
782
+ path.join(repo, '.claude/settings.json'),
783
+ path.join(repo, '.codex/hooks.json'),
784
+ ];
785
+ const automaticHooksRetired = retirementFiles.every((file) => {
786
+ const doc = readJsonSafe(file);
787
+ return doc && doc.hooks && commandStrings(doc.hooks).length === 0;
788
+ });
768
789
  const table = hookShimTable(repo);
769
790
  const codexWrapper = installedCodexHookWrapper(repo);
770
791
  const reached = new Map(); // basename -> Set(reason)
@@ -818,6 +839,11 @@ export function hookWiringAudit({
818
839
  const isReached = reached.has(f);
819
840
  if (!declared && !isReached) continue; // not hook-intended at all — outside the census
820
841
  if (isReached) rows.push({ file: f, state: 'wired', sources: [...reached.get(f)] });
842
+ else if (automaticHooksRetired && declared) rows.push({
843
+ file: f,
844
+ state: 'retired',
845
+ why: 'automatic Brain hook registries are intentionally empty; body retained for audit or explicit-command reuse',
846
+ });
821
847
  else if (held[f]) rows.push({ file: f, state: 'held', why: held[f] });
822
848
  else rows.push({ file: f, state: 'unwired' });
823
849
  }
@@ -872,6 +898,7 @@ if (invokedDirectly) {
872
898
  const hookAudit = hookWiringAudit();
873
899
  const hookBy = (s) => hookAudit.rows.filter((r) => r.state === s);
874
900
  const hookUnwired = hookBy('unwired');
901
+ const hookRetired = hookBy('retired');
875
902
 
876
903
  const lessonAudit = lessonTriggerAudit();
877
904
 
@@ -915,7 +942,7 @@ if (invokedDirectly) {
915
942
  console.log(`\n ── HOOK WIRING — plugin/scripts/*.sh|*.mjs vs plugin/hooks/{hooks,codex-hooks}.json, `
916
943
  + `.claude/settings.json, ~/.claude/settings.json ──\n`);
917
944
  console.log(` ${hookAudit.rows.length} hook-intended script(s) in the census`);
918
- console.log(` ${hookBy('wired').length} wired · ${hookBy('held').length} held · `
945
+ console.log(` ${hookBy('wired').length} wired · ${hookRetired.length} retired · ${hookBy('held').length} held · `
919
946
  + `${hookUnwired.length} UNWIRED\n`);
920
947
 
921
948
  for (const u of hookUnwired) {
@@ -928,6 +955,8 @@ if (invokedDirectly) {
928
955
 
929
956
  for (const h of hookBy('held')) console.log(` ⏸ plugin/scripts/${h.file}\n ${h.why}\n`);
930
957
 
958
+ for (const r of hookRetired) console.log(` ○ plugin/scripts/${r.file}\n ${r.why}\n`);
959
+
931
960
  for (const w of hookBy('wired')) {
932
961
  console.log(` ✓ plugin/scripts/${w.file}\n via ${w.sources.join('; ')}`);
933
962
  }