ruvnet-brain 4.3.21 → 4.3.25

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 (141) hide show
  1. package/README.md +5 -5
  2. package/bin/install.mjs +275 -60
  3. package/console/app.js +141 -9
  4. package/console/index.html +51 -24
  5. package/console/scope.css +137 -0
  6. package/console/scope.html +144 -0
  7. package/console/scope.js +209 -0
  8. package/console/tips.html +1 -0
  9. package/kb/corpus-release-identity.mjs +239 -0
  10. package/kb/update-storage-transaction.mjs +20 -3
  11. package/package.json +9 -2
  12. package/plugin/.claude-plugin/plugin.json +2 -2
  13. package/plugin/.codex-plugin/plugin.json +1 -1
  14. package/plugin/commands/checkpoint.md +61 -0
  15. package/plugin/hooks/codex-hooks.json +64 -1
  16. package/plugin/hooks/hook-contracts.json +299 -6
  17. package/plugin/hooks/hooks.json +81 -1
  18. package/plugin/mcp/server.mjs +23 -0
  19. package/plugin/scripts/advocacy-catalog.mjs +245 -0
  20. package/plugin/scripts/advocacy-route.mjs +460 -0
  21. package/plugin/scripts/continuation-gate.mjs +25 -2
  22. package/plugin/scripts/continuation-objective.mjs +7 -1
  23. package/plugin/scripts/continuity-hook-policy.mjs +190 -15
  24. package/plugin/scripts/coverage-integrity.mjs +7 -0
  25. package/plugin/scripts/gates.mjs +113 -10
  26. package/plugin/scripts/grounding-turn-gate.mjs +167 -0
  27. package/plugin/scripts/grounding-turn-mark.mjs +91 -0
  28. package/plugin/scripts/hook-shim.mjs +14 -0
  29. package/plugin/scripts/nightly-scheduler.mjs +37 -4
  30. package/plugin/scripts/project-progression-checkpoint.mjs +145 -0
  31. package/plugin/scripts/project-progression-contract.mjs +16 -0
  32. package/plugin/scripts/project-progression-hook.mjs +3 -0
  33. package/plugin/scripts/project-progression-producer.mjs +252 -0
  34. package/plugin/scripts/project-progression-reader.mjs +271 -0
  35. package/plugin/scripts/project-progression-session-start.mjs +93 -16
  36. package/plugin/scripts/project-progression-sources.mjs +220 -0
  37. package/plugin/scripts/project-progression-store.mjs +106 -13
  38. package/plugin/scripts/ruvnet-gate1-pattern.mjs +29 -0
  39. package/plugin/scripts/session-snapshot-hook.mjs +115 -7
  40. package/plugin/scripts/session-start-budget.mjs +59 -0
  41. package/plugin/scripts/session-start-core.mjs +234 -457
  42. package/plugin/scripts/session-start-fsutil.mjs +61 -0
  43. package/plugin/scripts/session-start-health.mjs +64 -0
  44. package/plugin/scripts/session-start-hook-description.mjs +45 -0
  45. package/plugin/scripts/session-start-issue-alert.mjs +77 -0
  46. package/plugin/scripts/session-start-repo-identity.mjs +54 -0
  47. package/plugin/scripts/session-start-signals.mjs +73 -0
  48. package/plugin/scripts/session-start-trace.mjs +86 -0
  49. package/plugin/scripts/session-start-update-plane.mjs +104 -0
  50. package/plugin/scripts/unprompted-runtime.mjs +32 -2
  51. package/plugin/skills/ruvnet-brain/PLAYBOOK.md +26 -2
  52. package/plugin/skills/ruvnet-brain/SKILL.md +67 -2
  53. package/scripts/adr-072-completion.mjs +1 -1
  54. package/scripts/agentdb-fleet-doctor.mjs +5 -1
  55. package/scripts/approved-runtime.mjs +197 -0
  56. package/scripts/brain-novice-50.mjs +16 -1
  57. package/scripts/brain-score.mjs +23 -5
  58. package/scripts/build-bundle.mjs +971 -530
  59. package/scripts/build-concepts.mjs +36 -116
  60. package/scripts/console-engine.test.mjs +8 -7
  61. package/scripts/console-runtime-identity.mjs +4 -0
  62. package/scripts/corpus-aggregates.mjs +94 -77
  63. package/scripts/corpus-candidate.mjs +475 -222
  64. package/scripts/corpus-next-seed.mjs +225 -0
  65. package/scripts/corpus-promotion.mjs +58 -0
  66. package/scripts/corpus-reconcile.mjs +411 -105
  67. package/scripts/doc-currency.mjs +16 -1
  68. package/scripts/dual-host-deliberation.mjs +25 -2
  69. package/scripts/dual-host-suggest.mjs +17 -1
  70. package/scripts/falsify.mjs +13 -3
  71. package/scripts/gist-receipts.mjs +482 -87
  72. package/scripts/github-health-watch.mjs +12 -2
  73. package/scripts/handoff-asset.mjs +34 -0
  74. package/scripts/hook-retirement-check.mjs +8 -1
  75. package/scripts/host-registry.mjs +1 -1
  76. package/scripts/ingest-gists.mjs +74 -101
  77. package/scripts/job-heartbeat.sh +77 -14
  78. package/scripts/learning-replay-execution.mjs +10 -4
  79. package/scripts/nightly-gists.sh +27 -13
  80. package/scripts/nightly-two-run-proof.mjs +1 -1
  81. package/scripts/nightly-watchdog.mjs +61 -4
  82. package/scripts/onboarding-console.mjs +319 -27
  83. package/scripts/oracle/produce-questions.mjs +293 -0
  84. package/scripts/oracle/producer-hosts.mjs +235 -0
  85. package/scripts/oracle/repo-recall.mjs +448 -0
  86. package/scripts/oracle/retrieval-accuracy.mjs +818 -0
  87. package/scripts/oracle/source-tree.mjs +165 -0
  88. package/scripts/oracle/source-units.mjs +391 -0
  89. package/scripts/oracle/spike-run.mjs +98 -0
  90. package/scripts/oracle/unit-inventory.mjs +141 -0
  91. package/scripts/oracle/unit-sampling.mjs +128 -0
  92. package/scripts/oracle/validate-labels.mjs +250 -0
  93. package/scripts/private-overlay.mjs +248 -0
  94. package/scripts/product-integrity-contract.mjs +1 -1
  95. package/scripts/proxy/claude-proxied.sh +6 -0
  96. package/scripts/proxy/proxy-revert.sh +5 -0
  97. package/scripts/proxy/proxy-up.sh +6 -0
  98. package/scripts/proxy/proxy-verify.mjs +4 -0
  99. package/scripts/public-inputs.mjs +409 -0
  100. package/scripts/public-verification-inputs.mjs +112 -26
  101. package/scripts/public-verification-lane.mjs +1 -1
  102. package/scripts/published-surface-probe.mjs +34 -4
  103. package/scripts/qe/card-lane-gate.mjs +16 -1
  104. package/scripts/qe/session-start-gate.mjs +16 -1
  105. package/scripts/rebuild-gists-from-receipts.mjs +58 -78
  106. package/scripts/record-lesson.mjs +4 -1
  107. package/scripts/rehearse-corpus-pipeline.mjs +994 -0
  108. package/scripts/release-abort-stale.mjs +5 -1
  109. package/scripts/release-authority.mjs +104 -12
  110. package/scripts/release-channel-kind.mjs +86 -0
  111. package/scripts/release-convergence-watchdog.mjs +7 -2
  112. package/scripts/release-projection.mjs +177 -72
  113. package/scripts/release-transaction-provider.mjs +23 -6
  114. package/scripts/release.mjs +252 -17
  115. package/scripts/retrieval-canary.mjs +87 -0
  116. package/scripts/rvf-index-audit.mjs +573 -13
  117. package/scripts/rvf-wire.mjs +269 -0
  118. package/scripts/seal-gist-receipt.mjs +65 -0
  119. package/scripts/selfcheck.mjs +42 -21
  120. package/scripts/source-coverage.mjs +253 -24
  121. package/scripts/status-honesty.mjs +25 -0
  122. package/scripts/sync-census.mjs +0 -0
  123. package/scripts/sync-version.mjs +2 -0
  124. package/scripts/trismart.mjs +42 -0
  125. package/scripts/updater-manifest.mjs +162 -0
  126. package/scripts/verify-channels.mjs +17 -5
  127. package/scripts/wired-check.mjs +48 -10
  128. package/tri-smart-skill/QUICKSTART.md +37 -0
  129. package/tri-smart-skill/README.md +92 -0
  130. package/tri-smart-skill/install.cmd +14 -0
  131. package/tri-smart-skill/install.command +13 -0
  132. package/tri-smart-skill/install.mjs +51 -0
  133. package/tri-smart-skill/install.sh +9 -0
  134. package/tri-smart-skill/tri-smart/SKILL.md +90 -0
  135. package/tri-smart-skill/tri-smart/evals/evals.json +25 -0
  136. package/tri-smart-skill/tri-smart/references/protocol.md +25 -0
  137. package/tri-smart-skill/tri-smart/references/provider-cli.md +18 -0
  138. package/tri-smart-skill/tri-smart/scripts/review.mjs +154 -0
  139. package/tri-smart-skill/tri-smart/scripts/setup.mjs +97 -0
  140. package/tri-smart-skill/tri-smart/scripts/verify-access.mjs +107 -0
  141. package/scripts/corpus-seed-publish.mjs +0 -110
@@ -966,5 +966,20 @@ export function main(argv = process.argv.slice(2)) {
966
966
  return 1;
967
967
  }
968
968
 
969
- const invokedDirectly = process.argv[1] && path.resolve(process.argv[1]) === path.resolve(fileURLToPath(import.meta.url));
969
+ // Entry-point guard. Compares REALPATHS on both sides: path.resolve() normalizes a path but does
970
+ // NOT follow symlinks, while import.meta.url IS symlink-resolved by Node. Through a symlink (npm bin
971
+ // shims, wrapper scripts, and every os.tmpdir() path on macOS) the two sides disagree, so main()
972
+ // never runs -- and because nothing throws, the process exits 0. A silent exit 0 is indistinguishable
973
+ // from "ran, found nothing", which is how prepareCorpusCandidate once reported SUCCESS with no
974
+ // archive on disk. Reproduced live 2026-07-27; pinned by tests/unit/entrypoint-symlink.test.mjs.
975
+ function isDirectInvocation() {
976
+ try {
977
+ if (!process.argv[1]) return false;
978
+ return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
979
+ } catch {
980
+ return false;
981
+ }
982
+ }
983
+
984
+ const invokedDirectly = isDirectInvocation();
970
985
  if (invokedDirectly) process.exit(main());
@@ -1,11 +1,18 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { createHash } from 'node:crypto';
4
+ import fs from 'node:fs';
4
5
  import { spawn } from 'node:child_process';
5
6
  import { fileURLToPath } from 'node:url';
6
7
  import { probeSubscriptionHosts, subscriptionOnlyEnv } from './subscription-hosts.mjs';
7
8
 
8
9
  const HOSTS = Object.freeze(['claude-code', 'codex']);
10
+ // Top subscription models verified on the native hosts on 2026-09-10.
11
+ // Keep these explicit: an implicit host default silently weakens the dual review.
12
+ export const TOP_SUBSCRIPTION_MODELS = Object.freeze({
13
+ 'claude-code': 'claude-fable-5-1',
14
+ codex: 'gpt-6-astra',
15
+ });
9
16
  const HARD_PROBLEM = /\b(adr|architecture|architect|ddd|bounded context|aggregate|agentic[- ]?qe|holistic|security|production|migration|irreversible|threat model|experience)\b/i;
10
17
 
11
18
  export function hardProblem(task) {
@@ -107,13 +114,14 @@ export async function runSubscriptionHost(host, stage, payload, { cwd = process.
107
114
  args: [
108
115
  '-p', '--output-format', 'json', '--permission-mode', 'plan',
109
116
  '--tools', 'Read,Grep,Glob', '--no-session-persistence', '--effort', 'high',
117
+ '--model', TOP_SUBSCRIPTION_MODELS['claude-code'],
110
118
  ],
111
119
  }
112
120
  : {
113
121
  binary: 'codex',
114
122
  args: [
115
123
  'exec', '--ephemeral', '--sandbox', 'read-only', '--color', 'never', '--json',
116
- '-m', 'gpt-5.6-sol', '-c', 'model_reasoning_effort="high"',
124
+ '-m', TOP_SUBSCRIPTION_MODELS.codex, '-c', 'model_reasoning_effort="medium"',
117
125
  ],
118
126
  };
119
127
  const result = await spawnHost(command.binary, command.args, { cwd, env, stdio: ['pipe', 'pipe', 'pipe'] }, prompt);
@@ -313,6 +321,21 @@ export async function main(argv = process.argv.slice(2), {
313
321
  }
314
322
  }
315
323
 
316
- if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
324
+ // Entry-point guard. Compares REALPATHS on both sides: path.resolve() normalizes a path but does
325
+ // NOT follow symlinks, while import.meta.url IS symlink-resolved by Node. Through a symlink (npm bin
326
+ // shims, wrapper scripts, and every os.tmpdir() path on macOS) the two sides disagree, so main()
327
+ // never runs -- and because nothing throws, the process exits 0. A silent exit 0 is indistinguishable
328
+ // from "ran, found nothing", which is how prepareCorpusCandidate once reported SUCCESS with no
329
+ // archive on disk. Reproduced live 2026-07-27; pinned by tests/unit/entrypoint-symlink.test.mjs.
330
+ function isDirectInvocation() {
331
+ try {
332
+ if (!process.argv[1]) return false;
333
+ return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
334
+ } catch {
335
+ return false;
336
+ }
337
+ }
338
+
339
+ if (isDirectInvocation()) {
317
340
  process.exitCode = await main();
318
341
  }
@@ -1,6 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
 
3
3
  import { fileURLToPath } from 'node:url';
4
+ import fs from 'node:fs';
4
5
  import { hardProblem } from './dual-host-deliberation.mjs';
5
6
  import { probeSubscriptionHosts } from './subscription-hosts.mjs';
6
7
 
@@ -53,6 +54,21 @@ export function main(argv = process.argv.slice(2), {
53
54
  return 0;
54
55
  }
55
56
 
56
- if (process.argv[1] && fileURLToPath(import.meta.url) === process.argv[1]) {
57
+ // Entry-point guard. Compares REALPATHS on both sides: path.resolve() normalizes a path but does
58
+ // NOT follow symlinks, while import.meta.url IS symlink-resolved by Node. Through a symlink (npm bin
59
+ // shims, wrapper scripts, and every os.tmpdir() path on macOS) the two sides disagree, so main()
60
+ // never runs -- and because nothing throws, the process exits 0. A silent exit 0 is indistinguishable
61
+ // from "ran, found nothing", which is how prepareCorpusCandidate once reported SUCCESS with no
62
+ // archive on disk. Reproduced live 2026-07-27; pinned by tests/unit/entrypoint-symlink.test.mjs.
63
+ function isDirectInvocation() {
64
+ try {
65
+ if (!process.argv[1]) return false;
66
+ return fs.realpathSync(process.argv[1]) === fs.realpathSync(fileURLToPath(import.meta.url));
67
+ } catch {
68
+ return false;
69
+ }
70
+ }
71
+
72
+ if (isDirectInvocation()) {
57
73
  process.exitCode = main();
58
74
  }
@@ -28,6 +28,7 @@ import { spawnSync } from 'node:child_process';
28
28
  import fs from 'node:fs';
29
29
  import path from 'node:path';
30
30
  import { fileURLToPath, pathToFileURL } from 'node:url';
31
+ import { resolveRuflo, RUFLO_MISSING } from '../plugin/scripts/ruflo-bin.mjs';
31
32
 
32
33
  const ROOT = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '..');
33
34
  const sh = (cmd, args) => spawnSync(cmd, args, { cwd: ROOT, encoding: 'utf8' });
@@ -169,9 +170,18 @@ export const CHECKS = [
169
170
  const end = Number(q("SELECT COUNT(*) FROM memory_entries WHERE key LIKE 'session-sessionend%';"));
170
171
 
171
172
  // 3. Does it RECALL? A real semantic round-trip through the REAL CLI — not a DB peek.
172
- const r = spawnSync('npx', ['ruflo@latest', 'memory', 'search', '-q', 'nightly job supervision heartbeat receipts'], {
173
- cwd: ROOT, encoding: 'utf8', timeout: 120_000,
174
- });
173
+ // `npx ruflo@latest` was here before (Rule 21 violation: it resolves ITS OWN cached copy,
174
+ // masking drift from the global install — see ~/.claude/CLAUDE.md Rule 21) and, separately,
175
+ // ran with no RUFLO_DAEMON_AUTOSTART guard — every `ruflo` invocation auto-starts a project
176
+ // background daemon unless that is set (verified live: ~/.npm-global/lib/node_modules/ruflo/
177
+ // node_modules/@claude-flow/cli/dist/src/services/daemon-autostart.js:85). This falsifier
178
+ // must not itself leave a daemon running as a side effect of checking whether memory works.
179
+ const rufloBin = resolveRuflo();
180
+ const r = rufloBin
181
+ ? spawnSync(rufloBin, ['memory', 'search', '-q', 'nightly job supervision heartbeat receipts'], {
182
+ cwd: ROOT, encoding: 'utf8', timeout: 120_000, env: { ...process.env, RUFLO_DAEMON_AUTOSTART: '0' },
183
+ })
184
+ : { error: new Error(RUFLO_MISSING), stdout: '' };
175
185
  const recalled = /Found\s+\d+\s+results/.test(r.stdout || '') && !/Found\s+0\s+results/.test(r.stdout || '');
176
186
 
177
187
  const problems = [];