@mindrian_os/install 1.13.0-beta.11

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 (597) hide show
  1. package/.claude-plugin/plugin.json +21 -0
  2. package/.mcp.json +9 -0
  3. package/CHANGELOG.md +3333 -0
  4. package/LICENSE +123 -0
  5. package/README.md +673 -0
  6. package/agents/brain-query.md +80 -0
  7. package/agents/framework-runner.md +237 -0
  8. package/agents/grading.md +188 -0
  9. package/agents/investor.md +128 -0
  10. package/agents/larry-extended.md +135 -0
  11. package/agents/opportunity-scanner.md +91 -0
  12. package/agents/persona-analyst.md +132 -0
  13. package/agents/research.md +89 -0
  14. package/agents/reverse-salient-agent.md +27 -0
  15. package/bin/cli.js +142 -0
  16. package/bin/mindrian-mcp-server.cjs +182 -0
  17. package/bin/mindrian-tools.cjs +765 -0
  18. package/commands/act.md +439 -0
  19. package/commands/admin.md +404 -0
  20. package/commands/analyze-needs.md +42 -0
  21. package/commands/analyze-systems.md +39 -0
  22. package/commands/analyze-timing.md +42 -0
  23. package/commands/auto-explore.md +64 -0
  24. package/commands/beautiful-question.md +40 -0
  25. package/commands/brain-derive.md +78 -0
  26. package/commands/build-knowledge.md +42 -0
  27. package/commands/build-thesis.md +46 -0
  28. package/commands/causal.md +234 -0
  29. package/commands/challenge-assumptions.md +33 -0
  30. package/commands/compare-ventures.md +83 -0
  31. package/commands/dashboard.md +110 -0
  32. package/commands/deep-grade.md +82 -0
  33. package/commands/diagnose.md +58 -0
  34. package/commands/diagnostics.md +151 -0
  35. package/commands/doctor.md +151 -0
  36. package/commands/dominant-designs.md +40 -0
  37. package/commands/explain-decision.md +87 -0
  38. package/commands/explore-domains.md +42 -0
  39. package/commands/explore-futures.md +40 -0
  40. package/commands/explore-trends.md +42 -0
  41. package/commands/export.md +103 -0
  42. package/commands/file-meeting.md +724 -0
  43. package/commands/find-analogies.md +188 -0
  44. package/commands/find-bottlenecks.md +62 -0
  45. package/commands/find-connections.md +76 -0
  46. package/commands/funding.md +81 -0
  47. package/commands/grade.md +203 -0
  48. package/commands/graph.md +128 -0
  49. package/commands/hat-briefing.md +125 -0
  50. package/commands/heal.md +196 -0
  51. package/commands/help.md +399 -0
  52. package/commands/hmi-status.md +172 -0
  53. package/commands/jtbd.md +241 -0
  54. package/commands/leadership.md +73 -0
  55. package/commands/lean-canvas.md +40 -0
  56. package/commands/macro-trends.md +40 -0
  57. package/commands/map-unknowns.md +40 -0
  58. package/commands/memory.md +173 -0
  59. package/commands/models.md +175 -0
  60. package/commands/mos-reason.md +285 -0
  61. package/commands/mullins.md +120 -0
  62. package/commands/new-project.md +481 -0
  63. package/commands/onboard.md +434 -0
  64. package/commands/operator.md +149 -0
  65. package/commands/opportunities.md +144 -0
  66. package/commands/organize.md +497 -0
  67. package/commands/persona.md +198 -0
  68. package/commands/pipeline.md +112 -0
  69. package/commands/present.md +91 -0
  70. package/commands/publish.md +201 -0
  71. package/commands/query.md +124 -0
  72. package/commands/radar.md +72 -0
  73. package/commands/reanalyze.md +91 -0
  74. package/commands/research.md +196 -0
  75. package/commands/room.md +352 -0
  76. package/commands/rooms.md +598 -0
  77. package/commands/root-cause.md +40 -0
  78. package/commands/rs-experts.md +85 -0
  79. package/commands/rs-explain.md +100 -0
  80. package/commands/rs-fetch.md +94 -0
  81. package/commands/rs-thesis.md +85 -0
  82. package/commands/scenario-plan.md +40 -0
  83. package/commands/scheduled-tasks.md +285 -0
  84. package/commands/score-innovation.md +43 -0
  85. package/commands/scout.md +239 -0
  86. package/commands/setup.md +618 -0
  87. package/commands/snapshot.md +147 -0
  88. package/commands/speakers.md +84 -0
  89. package/commands/splash.md +28 -0
  90. package/commands/status.md +75 -0
  91. package/commands/structure-argument.md +42 -0
  92. package/commands/suggest-next.md +80 -0
  93. package/commands/systems-thinking.md +40 -0
  94. package/commands/think-hats.md +42 -0
  95. package/commands/update.md +181 -0
  96. package/commands/user-needs.md +40 -0
  97. package/commands/validate.md +40 -0
  98. package/commands/value-proposition.md +61 -0
  99. package/commands/vault.md +180 -0
  100. package/commands/visualize.md +52 -0
  101. package/commands/whitespace.md +507 -0
  102. package/commands/wiki.md +69 -0
  103. package/hooks/hooks.json +381 -0
  104. package/hooks/run-hook.cmd +64 -0
  105. package/lib/__init__.py +0 -0
  106. package/lib/__pycache__/__init__.cpython-312.pyc +0 -0
  107. package/lib/agents/auto-explore-agent.cjs +1043 -0
  108. package/lib/agents/reverse-salient-agent.cjs +679 -0
  109. package/lib/agents/tension-hook-agent.cjs +544 -0
  110. package/lib/brain/ROOM.md +44 -0
  111. package/lib/brain/chain-recommender.cjs +301 -0
  112. package/lib/chat/chat-context.js +185 -0
  113. package/lib/chat/chat-panel.js +721 -0
  114. package/lib/chat/fabric-chat.cjs +288 -0
  115. package/lib/chat/generative-tools.js +219 -0
  116. package/lib/conversation/ROOM.md +39 -0
  117. package/lib/conversation/classifier-rules.json +38 -0
  118. package/lib/conversation/classifier.cjs +264 -0
  119. package/lib/conversation/operator.cjs +287 -0
  120. package/lib/copy/115-spec-strings.cjs +55 -0
  121. package/lib/core/__init__.py +0 -0
  122. package/lib/core/__nav-stub.cjs +14 -0
  123. package/lib/core/__pycache__/__init__.cpython-312.pyc +0 -0
  124. package/lib/core/__pycache__/rs-math.cpython-312.pyc +0 -0
  125. package/lib/core/__pycache__/rs_cache.cpython-312.pyc +0 -0
  126. package/lib/core/__pycache__/rs_corpus.cpython-312.pyc +0 -0
  127. package/lib/core/__pycache__/rs_hybrid.cpython-312.pyc +0 -0
  128. package/lib/core/__pycache__/rs_math.cpython-312.pyc +0 -0
  129. package/lib/core/__pycache__/rs_rooms.cpython-312.pyc +0 -0
  130. package/lib/core/artifact-id.cjs +148 -0
  131. package/lib/core/asset-ops.cjs +151 -0
  132. package/lib/core/auto-commit-throttle.cjs +129 -0
  133. package/lib/core/bearer-token.cjs +199 -0
  134. package/lib/core/brain-client.cjs +865 -0
  135. package/lib/core/brain-derivation-prompts.cjs +326 -0
  136. package/lib/core/brain-derivation-queue.cjs +431 -0
  137. package/lib/core/brain-derivation.cjs +580 -0
  138. package/lib/core/brain-md-schema.cjs +528 -0
  139. package/lib/core/brain-md-staleness.cjs +357 -0
  140. package/lib/core/brain-response-sanitize.cjs +188 -0
  141. package/lib/core/bridge-writer.cjs +477 -0
  142. package/lib/core/chat-context-builder.cjs +253 -0
  143. package/lib/core/cross-room-aggregator.cjs +762 -0
  144. package/lib/core/daily-briefing.cjs +438 -0
  145. package/lib/core/decision-capture.cjs +618 -0
  146. package/lib/core/deep-links.cjs +82 -0
  147. package/lib/core/dispatch-optimizer.cjs +354 -0
  148. package/lib/core/dual-path-detector.cjs +84 -0
  149. package/lib/core/dual-path-detector.test.cjs +334 -0
  150. package/lib/core/exports-log.cjs +79 -0
  151. package/lib/core/feynman-minto-invariants.cjs +605 -0
  152. package/lib/core/folder-memory-async.cjs +338 -0
  153. package/lib/core/folder-memory-shared.cjs +890 -0
  154. package/lib/core/folder-memory.cjs +416 -0
  155. package/lib/core/framework-chain-composer.cjs +411 -0
  156. package/lib/core/frontmatter-schemas.cjs +330 -0
  157. package/lib/core/git-ops.cjs +141 -0
  158. package/lib/core/graph-ops.cjs +258 -0
  159. package/lib/core/hat-persistence.cjs +362 -0
  160. package/lib/core/index.cjs +60 -0
  161. package/lib/core/integration-registry.cjs +232 -0
  162. package/lib/core/intelligence-cascade.cjs +661 -0
  163. package/lib/core/lazygraph-ops.cjs +1057 -0
  164. package/lib/core/lru-cache.cjs +139 -0
  165. package/lib/core/mcp-profiles.cjs +182 -0
  166. package/lib/core/meeting-ops.cjs +54 -0
  167. package/lib/core/memory-ops.cjs +600 -0
  168. package/lib/core/migrations/ROOM.md +33 -0
  169. package/lib/core/migrations/phase-109-nodes-provenance.cjs +339 -0
  170. package/lib/core/migrations/phase-109-session-focus.cjs +99 -0
  171. package/lib/core/model-profiles.cjs +246 -0
  172. package/lib/core/mullins-scaffold.cjs +160 -0
  173. package/lib/core/nav-dial.cjs +316 -0
  174. package/lib/core/navigation/ROOM.md +15 -0
  175. package/lib/core/navigation/explanation.cjs +43 -0
  176. package/lib/core/navigation/focus.cjs +135 -0
  177. package/lib/core/navigation/ingestion.cjs +82 -0
  178. package/lib/core/navigation/insights.cjs +350 -0
  179. package/lib/core/navigation/memory-events.cjs +118 -0
  180. package/lib/core/navigation/neighborhood.cjs +78 -0
  181. package/lib/core/navigation/packet.cjs +182 -0
  182. package/lib/core/navigation/room-home.cjs +127 -0
  183. package/lib/core/navigation/transitions.cjs +82 -0
  184. package/lib/core/navigation-engine-shared.cjs +242 -0
  185. package/lib/core/navigation-engine.cjs +664 -0
  186. package/lib/core/navigation.cjs +60 -0
  187. package/lib/core/nl-graph-queries.cjs +164 -0
  188. package/lib/core/offer-presenter.cjs +406 -0
  189. package/lib/core/opportunity-extractor.cjs +183 -0
  190. package/lib/core/opportunity-ops.cjs +1371 -0
  191. package/lib/core/persona-ops.cjs +537 -0
  192. package/lib/core/persona-taxonomy.cjs +190 -0
  193. package/lib/core/platform-gates.cjs +120 -0
  194. package/lib/core/platform.cjs +257 -0
  195. package/lib/core/proactive-intelligence.cjs +528 -0
  196. package/lib/core/problem-type-router.cjs +315 -0
  197. package/lib/core/reasoning-ops.cjs +639 -0
  198. package/lib/core/reverse-salient-persona-suffix.cjs +115 -0
  199. package/lib/core/room-classifier-strict-mode.cjs +229 -0
  200. package/lib/core/room-db.cjs +127 -0
  201. package/lib/core/room-ops-async.cjs +92 -0
  202. package/lib/core/room-ops-shared.cjs +64 -0
  203. package/lib/core/room-ops-sync.cjs +70 -0
  204. package/lib/core/room-ops.cjs +32 -0
  205. package/lib/core/room-type-detector.cjs +386 -0
  206. package/lib/core/rs-brain-substrate-prompts.cjs +129 -0
  207. package/lib/core/rs-brain-substrate.cjs +570 -0
  208. package/lib/core/rs-breakthrough-scorer.cjs +255 -0
  209. package/lib/core/rs-canon-violations.cjs +82 -0
  210. package/lib/core/rs-chain-feeder.cjs +343 -0
  211. package/lib/core/rs-commercial-assessor.cjs +280 -0
  212. package/lib/core/rs-differential-scorer.cjs +376 -0
  213. package/lib/core/rs-domain-analyzer.cjs +385 -0
  214. package/lib/core/rs-egress-prompts.cjs +113 -0
  215. package/lib/core/rs-egress-telemetry.cjs +225 -0
  216. package/lib/core/rs-egress-violations.cjs +53 -0
  217. package/lib/core/rs-expert-mapper.cjs +467 -0
  218. package/lib/core/rs-fetcher-academic.cjs +697 -0
  219. package/lib/core/rs-fetcher-experts.cjs +314 -0
  220. package/lib/core/rs-fetcher-industry.cjs +731 -0
  221. package/lib/core/rs-fetcher-patents.cjs +564 -0
  222. package/lib/core/rs-innovation-classifier.cjs +194 -0
  223. package/lib/core/rs-mind-map.cjs +656 -0
  224. package/lib/core/rs-neo4j-writer.cjs +388 -0
  225. package/lib/core/rs-nl-to-query.cjs +425 -0
  226. package/lib/core/rs-pinecone-bridge.cjs +303 -0
  227. package/lib/core/rs-preprocessor.cjs +350 -0
  228. package/lib/core/rs-query-matrix.cjs +316 -0
  229. package/lib/core/rs-query-to-text.cjs +438 -0
  230. package/lib/core/rs-sqlite-mirror.cjs +443 -0
  231. package/lib/core/rs-thesis-generator.cjs +188 -0
  232. package/lib/core/rs_cache.py +479 -0
  233. package/lib/core/rs_corpus.py +468 -0
  234. package/lib/core/rs_hybrid.py +586 -0
  235. package/lib/core/rs_math.py +287 -0
  236. package/lib/core/rs_rooms.py +193 -0
  237. package/lib/core/scheduled-scanner.cjs +463 -0
  238. package/lib/core/scratchpad-ops.cjs +201 -0
  239. package/lib/core/section-8-trace-schema.cjs +138 -0
  240. package/lib/core/section-registry.cjs +111 -0
  241. package/lib/core/session-state.cjs +144 -0
  242. package/lib/core/shallow-doc-parser.cjs +174 -0
  243. package/lib/core/shallow-doc-parser.test.cjs +226 -0
  244. package/lib/core/skill-activation-router.cjs +284 -0
  245. package/lib/core/state-ops.cjs +46 -0
  246. package/lib/core/statusline-cache.cjs +266 -0
  247. package/lib/core/token-estimator.cjs +348 -0
  248. package/lib/core/user-archetype.cjs +239 -0
  249. package/lib/core/user-md-ops.cjs +524 -0
  250. package/lib/core/visual-ops.cjs +624 -0
  251. package/lib/core/write-lock.cjs +149 -0
  252. package/lib/graph/canvas-graph.js +467 -0
  253. package/lib/graph/constellation-config.cjs +299 -0
  254. package/lib/graph/graph-detail-panel.js +165 -0
  255. package/lib/hmi/ROOM.md +47 -0
  256. package/lib/hmi/across-session-memory.cjs +604 -0
  257. package/lib/hmi/cross-room-memory.cjs +575 -0
  258. package/lib/hmi/decoy-tier.cjs +395 -0
  259. package/lib/hmi/jtbd-classifier.cjs +219 -0
  260. package/lib/hmi/jtbd-state.cjs +199 -0
  261. package/lib/hmi/jtbd-taxonomy.json +392 -0
  262. package/lib/hmi/selector-dispatcher.cjs +546 -0
  263. package/lib/hmi/selector-telemetry.cjs +263 -0
  264. package/lib/hmi/shape-f0-renderer.cjs +139 -0
  265. package/lib/hmi/shape-f1-fallback.cjs +80 -0
  266. package/lib/hmi/shape-f1-renderer.cjs +138 -0
  267. package/lib/hmi/shape-f2-renderer.cjs +132 -0
  268. package/lib/hmi/shape-f3-renderer.cjs +66 -0
  269. package/lib/hmi/shape-f4-renderer.cjs +72 -0
  270. package/lib/hmi/shape-f5-renderer.cjs +155 -0
  271. package/lib/hmi/shape-f6-plan-review-renderer.cjs +312 -0
  272. package/lib/hmi/shape-f6-renderer.cjs +144 -0
  273. package/lib/hmi/shape-g-renderer.cjs +219 -0
  274. package/lib/hmi/shape-h-renderer.cjs +222 -0
  275. package/lib/hmi/tier-check.cjs +63 -0
  276. package/lib/import/PRECONDITIONS.md +41 -0
  277. package/lib/import/branding.cjs +210 -0
  278. package/lib/import/branding.test.cjs +235 -0
  279. package/lib/import/classifications-sync.cjs +104 -0
  280. package/lib/import/classifications-sync.test.cjs +129 -0
  281. package/lib/import/enricher.cjs +296 -0
  282. package/lib/import/enricher.test.cjs +273 -0
  283. package/lib/import/integration.test.cjs +376 -0
  284. package/lib/import/manifest.cjs +129 -0
  285. package/lib/import/manifest.schema.json +185 -0
  286. package/lib/import/manifest.test.cjs +123 -0
  287. package/lib/import/meeting-detector.cjs +92 -0
  288. package/lib/import/meeting-detector.test.cjs +100 -0
  289. package/lib/import/person-detector.cjs +229 -0
  290. package/lib/import/person-detector.test.cjs +149 -0
  291. package/lib/import/report.cjs +186 -0
  292. package/lib/import/report.test.cjs +186 -0
  293. package/lib/import/room-md-scaffolder.cjs +49 -0
  294. package/lib/import/router.cjs +224 -0
  295. package/lib/import/router.test.cjs +356 -0
  296. package/lib/import/run-all-tests.cjs +36 -0
  297. package/lib/import/smoke-test.cjs +213 -0
  298. package/lib/import/smoke-test.test.cjs +148 -0
  299. package/lib/import/test-fixtures/collision-vault/preexisting-room/STATE.md +8 -0
  300. package/lib/import/test-fixtures/collision-vault/preexisting-room/problem-definition/onboarding/onboarding.md +7 -0
  301. package/lib/import/test-fixtures/collision-vault/source/onboarding.md +5 -0
  302. package/lib/import/test-fixtures/obsidian-vault/.obsidian/workspace.json +1 -0
  303. package/lib/import/test-fixtures/obsidian-vault/notes/with-wikilinks.md +4 -0
  304. package/lib/import/test-fixtures/tiny-vault/notes/2026-01-15-team-sync.md +9 -0
  305. package/lib/import/test-fixtures/tiny-vault/notes/empty.md +3 -0
  306. package/lib/import/test-fixtures/tiny-vault/notes/onboarding.md +5 -0
  307. package/lib/import/test-fixtures/tiny-vault/notes/pricing.md +5 -0
  308. package/lib/import/test-fixtures/tiny-vault/notes/random.md +4 -0
  309. package/lib/import/undo.test.cjs +199 -0
  310. package/lib/import/vault-scanner.cjs +105 -0
  311. package/lib/import/vault-scanner.test.cjs +67 -0
  312. package/lib/mcp/app-html/dashboard.html +316 -0
  313. package/lib/mcp/app-html/graph.html +428 -0
  314. package/lib/mcp/app-html/mindrian-platform.html +1841 -0
  315. package/lib/mcp/app-html/wiki.html +383 -0
  316. package/lib/mcp/app-views.cjs +322 -0
  317. package/lib/mcp/brain-router.cjs +418 -0
  318. package/lib/mcp/capability-registry.cjs +62 -0
  319. package/lib/mcp/larry-context.cjs +46 -0
  320. package/lib/mcp/larry-server-instructions.md +114 -0
  321. package/lib/mcp/pipeline-state.cjs +275 -0
  322. package/lib/mcp/prompts.cjs +302 -0
  323. package/lib/mcp/resources.cjs +227 -0
  324. package/lib/mcp/session-catchup.cjs +327 -0
  325. package/lib/mcp/surface-detect.cjs +75 -0
  326. package/lib/mcp/tool-router.cjs +1034 -0
  327. package/lib/memory/aaak-compress.cjs +403 -0
  328. package/lib/memory/aaak-compress.test.cjs +288 -0
  329. package/lib/memory/async-artifact-auto-commit.test.cjs +223 -0
  330. package/lib/memory/bearer-token.test.cjs +315 -0
  331. package/lib/memory/brain-cache-lru.test.cjs +259 -0
  332. package/lib/memory/brain-client-query-shape.test.cjs +160 -0
  333. package/lib/memory/brain-derivation-graceful-degradation.test.cjs +1019 -0
  334. package/lib/memory/brain-derivation-queue.test.cjs +539 -0
  335. package/lib/memory/brain-derivation.test.cjs +634 -0
  336. package/lib/memory/brain-derive-command.test.cjs +534 -0
  337. package/lib/memory/brain-md-invariants-validator.test.cjs +704 -0
  338. package/lib/memory/brain-md-schema.test.cjs +467 -0
  339. package/lib/memory/brain-md-staleness.test.cjs +525 -0
  340. package/lib/memory/brain-server-resolution.test.cjs +314 -0
  341. package/lib/memory/chain-recommender.test.cjs +233 -0
  342. package/lib/memory/chat-context.test.cjs +128 -0
  343. package/lib/memory/command-registry.test.cjs +220 -0
  344. package/lib/memory/cross-room-aggregator.test.cjs +909 -0
  345. package/lib/memory/dashboard-server.test.cjs +256 -0
  346. package/lib/memory/debouncer-drain-at-prompt.test.cjs +389 -0
  347. package/lib/memory/decision-capture.test.cjs +632 -0
  348. package/lib/memory/decision-capture.worker.cjs +70 -0
  349. package/lib/memory/explain-decision-command.test.cjs +521 -0
  350. package/lib/memory/explain-decision-footer.test.cjs +316 -0
  351. package/lib/memory/explored-materials-store.cjs +392 -0
  352. package/lib/memory/feynman-minto-guardian.test.cjs +736 -0
  353. package/lib/memory/feynman-minto-invariants.test.cjs +511 -0
  354. package/lib/memory/feynman-prompts-drift.test.cjs +144 -0
  355. package/lib/memory/feynman-prompts.cjs +151 -0
  356. package/lib/memory/feynman-prompts.test.cjs +96 -0
  357. package/lib/memory/folder-memory-quadruple.test.cjs +548 -0
  358. package/lib/memory/folder-memory.test.cjs +503 -0
  359. package/lib/memory/framework-chain-composer.test.cjs +515 -0
  360. package/lib/memory/frontmatter-schema-validator.test.cjs +290 -0
  361. package/lib/memory/heal-command.test.cjs +604 -0
  362. package/lib/memory/index-artifact-transaction.test.cjs +333 -0
  363. package/lib/memory/lazygraph-rs-discoveries-view.test.cjs +122 -0
  364. package/lib/memory/mcp-input-validation.test.cjs +240 -0
  365. package/lib/memory/mcp-server-brain-deps.test.cjs +270 -0
  366. package/lib/memory/mcp-stack-fallback.test.cjs +433 -0
  367. package/lib/memory/minto-debouncer.test.cjs +407 -0
  368. package/lib/memory/minto-debouncer.worker.cjs +46 -0
  369. package/lib/memory/minto-migration-v88.test.cjs +265 -0
  370. package/lib/memory/minto-schema-v88.test.cjs +390 -0
  371. package/lib/memory/mos-status-renderer.test.cjs +631 -0
  372. package/lib/memory/narrative-schema.cjs +376 -0
  373. package/lib/memory/narrative-schema.test.cjs +209 -0
  374. package/lib/memory/nav-dial.test.cjs +414 -0
  375. package/lib/memory/navigation-engine-core.test.cjs +722 -0
  376. package/lib/memory/navigation-invariants.test.cjs +483 -0
  377. package/lib/memory/offer-presenter.test.cjs +554 -0
  378. package/lib/memory/on-stop-snapshot.test.cjs +404 -0
  379. package/lib/memory/pending-tension-store.cjs +373 -0
  380. package/lib/memory/post-compact-reinjection.test.cjs +854 -0
  381. package/lib/memory/post-write-triple.test.cjs +317 -0
  382. package/lib/memory/pre-compact-snapshot.test.cjs +495 -0
  383. package/lib/memory/problem-type-router.test.cjs +656 -0
  384. package/lib/memory/query-efficiency-telemetry.test.cjs +370 -0
  385. package/lib/memory/recompile-room-references.test.cjs +392 -0
  386. package/lib/memory/recompile-room-references.worker.cjs +42 -0
  387. package/lib/memory/record-decision-dual-write.test.cjs +454 -0
  388. package/lib/memory/room-classifier-strict-mode.test.cjs +417 -0
  389. package/lib/memory/room-minto-hook.test.cjs +398 -0
  390. package/lib/memory/rs-discovery-engine.test.cjs +323 -0
  391. package/lib/memory/run-feynman-tests.cjs +1247 -0
  392. package/lib/memory/security-trifecta.test.cjs +312 -0
  393. package/lib/memory/session-start-brain-staleness.test.cjs +363 -0
  394. package/lib/memory/session-start-triple-injection.test.cjs +514 -0
  395. package/lib/memory/sessionstart-banner-formatter.cjs +318 -0
  396. package/lib/memory/sessionstart-minto-banner.test.cjs +373 -0
  397. package/lib/memory/skill-activation-router.test.cjs +419 -0
  398. package/lib/memory/stamp-artifact-write.test.cjs +304 -0
  399. package/lib/memory/statusline-active-room.test.cjs +315 -0
  400. package/lib/memory/statusline-minto-segment.test.cjs +292 -0
  401. package/lib/memory/sync-async-entry-points.test.cjs +204 -0
  402. package/lib/memory/test-bridge-writer-enhanced.cjs +452 -0
  403. package/lib/memory/test-rs-brain-substrate-shape.cjs +529 -0
  404. package/lib/memory/test-rs-brain-substrate.cjs +636 -0
  405. package/lib/memory/test-rs-breakthrough-scorer.cjs +375 -0
  406. package/lib/memory/test-rs-canon-violations.cjs +218 -0
  407. package/lib/memory/test-rs-chain-feeder-core.cjs +344 -0
  408. package/lib/memory/test-rs-chain-feeder-skill-spawn.cjs +297 -0
  409. package/lib/memory/test-rs-commercial-assessor.cjs +385 -0
  410. package/lib/memory/test-rs-differential-scorer.cjs +480 -0
  411. package/lib/memory/test-rs-discovery-engine.cjs +603 -0
  412. package/lib/memory/test-rs-domain-analyzer.cjs +492 -0
  413. package/lib/memory/test-rs-egress-primitives.cjs +420 -0
  414. package/lib/memory/test-rs-expert-mapper.cjs +547 -0
  415. package/lib/memory/test-rs-explain-command.cjs +443 -0
  416. package/lib/memory/test-rs-fetcher-academic.cjs +848 -0
  417. package/lib/memory/test-rs-fetcher-experts.cjs +496 -0
  418. package/lib/memory/test-rs-fetcher-industry.cjs +702 -0
  419. package/lib/memory/test-rs-fetcher-patents.cjs +674 -0
  420. package/lib/memory/test-rs-innovation-classifier.cjs +301 -0
  421. package/lib/memory/test-rs-mind-map.cjs +646 -0
  422. package/lib/memory/test-rs-neo4j-writer.cjs +518 -0
  423. package/lib/memory/test-rs-nl-to-query.cjs +449 -0
  424. package/lib/memory/test-rs-pinecone-bridge.cjs +277 -0
  425. package/lib/memory/test-rs-preprocessor.cjs +433 -0
  426. package/lib/memory/test-rs-query-matrix.cjs +391 -0
  427. package/lib/memory/test-rs-query-to-text.cjs +551 -0
  428. package/lib/memory/test-rs-sqlite-mirror.cjs +649 -0
  429. package/lib/memory/test-rs-thesis-generator.cjs +360 -0
  430. package/lib/memory/triple-context-formatter.cjs +473 -0
  431. package/lib/memory/triple-context-formatter.test.cjs +442 -0
  432. package/lib/memory/user-md-persona.test.cjs +565 -0
  433. package/lib/memory/userpromptsubmit-integration.test.cjs +690 -0
  434. package/lib/memory/validators/README.md +157 -0
  435. package/lib/memory/validators/brain-md-invariants.cjs +475 -0
  436. package/lib/memory/validators/brain-substrate-invariants.cjs +285 -0
  437. package/lib/memory/validators/external-academic-invariants.cjs +249 -0
  438. package/lib/memory/validators/external-industry-invariants.cjs +271 -0
  439. package/lib/memory/validators/external-patents-invariants.cjs +266 -0
  440. package/lib/memory/validators/minto-invariants.cjs +62 -0
  441. package/lib/memory/validators/navigation-invariants.cjs +340 -0
  442. package/lib/memory/validators/queue-health.cjs +95 -0
  443. package/lib/memory/validators/snapshot-integrity.cjs +129 -0
  444. package/lib/memory/validators/stale-lifecycle.cjs +116 -0
  445. package/lib/memory/vault-section-minto-generator-atomic.test.cjs +556 -0
  446. package/lib/memory/vault-section-minto-generator-atomic.worker.cjs +73 -0
  447. package/lib/memory/write-lock-atomic.test.cjs +137 -0
  448. package/lib/memory/write-lock-atomic.worker.cjs +55 -0
  449. package/lib/parity/check-parity.cjs +83 -0
  450. package/lib/presentation/presentation-server.cjs +101 -0
  451. package/lib/presentation/presentation-watcher.cjs +123 -0
  452. package/lib/quickview/hub-server.cjs +719 -0
  453. package/lib/quickview/server.cjs +533 -0
  454. package/lib/render/JTBD-PALETTES.md +145 -0
  455. package/lib/render/ROOM.md +59 -0
  456. package/lib/render/render-v2.cjs +486 -0
  457. package/lib/render/render-v2.test.cjs +267 -0
  458. package/lib/render/render.cjs +65 -0
  459. package/lib/state/ROOM.md +46 -0
  460. package/lib/state/state-md-parser.cjs +215 -0
  461. package/lib/statusline/ROOM.md +38 -0
  462. package/lib/statusline/banner-suppression.cjs +50 -0
  463. package/lib/statusline/surface-detect.cjs +85 -0
  464. package/lib/update-bootstrap.sh.template +145 -0
  465. package/lib/vault/frontmatter-schema.cjs +297 -0
  466. package/lib/vault/room-scanner.cjs +352 -0
  467. package/lib/vault/wikilink-builder.cjs +231 -0
  468. package/lib/vault/wikilink-builder.test.cjs +182 -0
  469. package/lib/wiki/graph-links.cjs +281 -0
  470. package/lib/wiki/page-renderer.cjs +229 -0
  471. package/lib/wiki/wiki-chat.cjs +81 -0
  472. package/lib/wiki/wiki-layout.cjs +1459 -0
  473. package/lib/wiki/wiki-search.cjs +142 -0
  474. package/lib/wiki/wiki-server.cjs +678 -0
  475. package/lib/wiki/wiki-watcher.cjs +105 -0
  476. package/lib/workflow/ROOM.md +47 -0
  477. package/lib/workflow/command-resolver.cjs +155 -0
  478. package/lib/workflow/command-resolver.test.cjs +235 -0
  479. package/package.json +44 -0
  480. package/pipelines/analogy/01-decompose.md +80 -0
  481. package/pipelines/analogy/02-abstract.md +87 -0
  482. package/pipelines/analogy/03-search.md +135 -0
  483. package/pipelines/analogy/04-transfer.md +101 -0
  484. package/pipelines/analogy/05-validate.md +106 -0
  485. package/pipelines/analogy/CHAIN.md +56 -0
  486. package/pipelines/discovery/01-explore-domains.md +44 -0
  487. package/pipelines/discovery/02-think-hats.md +50 -0
  488. package/pipelines/discovery/03-analyze-needs.md +54 -0
  489. package/pipelines/discovery/CHAIN.md +37 -0
  490. package/pipelines/thesis/01-structure-argument.md +45 -0
  491. package/pipelines/thesis/02-challenge-assumptions.md +48 -0
  492. package/pipelines/thesis/03-build-thesis.md +54 -0
  493. package/pipelines/thesis/CHAIN.md +37 -0
  494. package/references/brain/causal-directives.md +91 -0
  495. package/references/brain/causal-enrichment.cypher +165 -0
  496. package/references/brain/command-triggers-schema.md +226 -0
  497. package/references/brain/graph-architecture.md +317 -0
  498. package/references/brain/query-patterns.md +460 -0
  499. package/references/brain/room-hierarchy-schema.md +218 -0
  500. package/references/brain/schema.md +76 -0
  501. package/references/capability-radar/capabilities-index.md +241 -0
  502. package/references/capability-radar/changelog-cache.md +81 -0
  503. package/references/causal/causal-schema.md +103 -0
  504. package/references/design/email-template-standard.md +155 -0
  505. package/references/design/graph-visualization-standard.md +178 -0
  506. package/references/document-generation.md +179 -0
  507. package/references/hsi/HSI-TOOLS-REFERENCE.md +222 -0
  508. package/references/import-config.md +141 -0
  509. package/references/integrations/detection-patterns.md +101 -0
  510. package/references/meeting/artifact-template.md +377 -0
  511. package/references/meeting/cross-meeting-intelligence.md +216 -0
  512. package/references/meeting/cross-relationship-patterns.md +202 -0
  513. package/references/meeting/live-join-interface.md +244 -0
  514. package/references/meeting/section-mapping.md +192 -0
  515. package/references/meeting/segment-classification.md +258 -0
  516. package/references/meeting/speaker-profile-template.md +219 -0
  517. package/references/meeting/summary-template.md +348 -0
  518. package/references/meeting/transcript-patterns.md +226 -0
  519. package/references/methodology/analyze-needs.md +135 -0
  520. package/references/methodology/analyze-systems.md +121 -0
  521. package/references/methodology/analyze-timing.md +149 -0
  522. package/references/methodology/beautiful-question.md +109 -0
  523. package/references/methodology/build-knowledge.md +161 -0
  524. package/references/methodology/build-thesis.md +237 -0
  525. package/references/methodology/challenge-assumptions.md +127 -0
  526. package/references/methodology/diagnose.md +169 -0
  527. package/references/methodology/dominant-designs.md +212 -0
  528. package/references/methodology/explore-domains.md +147 -0
  529. package/references/methodology/explore-futures.md +163 -0
  530. package/references/methodology/explore-trends.md +129 -0
  531. package/references/methodology/find-bottlenecks.md +131 -0
  532. package/references/methodology/grade.md +211 -0
  533. package/references/methodology/index.md +97 -0
  534. package/references/methodology/leadership.md +200 -0
  535. package/references/methodology/lean-canvas.md +116 -0
  536. package/references/methodology/macro-trends.md +192 -0
  537. package/references/methodology/map-unknowns.md +137 -0
  538. package/references/methodology/mullins-7-domains.md +104 -0
  539. package/references/methodology/problem-types.md +65 -0
  540. package/references/methodology/root-cause.md +178 -0
  541. package/references/methodology/sapphire-encoding.md +355 -0
  542. package/references/methodology/scenario-plan.md +178 -0
  543. package/references/methodology/score-innovation.md +154 -0
  544. package/references/methodology/structure-argument.md +158 -0
  545. package/references/methodology/systems-thinking.md +159 -0
  546. package/references/methodology/think-hats.md +147 -0
  547. package/references/methodology/triz-matrix.json +751 -0
  548. package/references/methodology/triz-principles.md +501 -0
  549. package/references/methodology/user-needs.md +199 -0
  550. package/references/methodology/validate.md +163 -0
  551. package/references/methodology/value-proposition.md +244 -0
  552. package/references/opportunities/funding-lifecycle.md +103 -0
  553. package/references/opportunities/grant-api-patterns.md +99 -0
  554. package/references/opportunities/opportunity-template.md +84 -0
  555. package/references/personality/assessment-philosophy.md +72 -0
  556. package/references/personality/lexicon.md +100 -0
  557. package/references/personality/persona-chains.md +56 -0
  558. package/references/personality/pws-lexicon-full.md +499 -0
  559. package/references/personality/voice-dna.md +156 -0
  560. package/references/personas/hat-perspectives.md +76 -0
  561. package/references/personas/persona-template.md +63 -0
  562. package/references/pipeline/act-output-contract.md +88 -0
  563. package/references/pipeline/chains-index.md +39 -0
  564. package/references/pws-profile-generation.md +79 -0
  565. package/references/reasoning/reasoning-schema.md +143 -0
  566. package/references/reasoning/reasoning-template.md +68 -0
  567. package/references/reasoning/run-template.md +38 -0
  568. package/references/research/RESEARCH_14_CLAUDE_CODE_SOURCE_ARCHITECTURE.md +209 -0
  569. package/references/research/RESEARCH_15_V1.8_OPTIMIZATION_JTBD.md +375 -0
  570. package/references/research/RESEARCH_16_NATIVE_FIRST_PLUGIN_ARCHITECTURE.md +575 -0
  571. package/references/research/RESEARCH_17_MCP_UI_FRAMEWORKS.md +272 -0
  572. package/references/taxonomy/TAXONOMY.md +192 -0
  573. package/references/templates/MINTO.md +36 -0
  574. package/references/user-research/2026-04-05-leah-lawrence-session.md +202 -0
  575. package/references/vault-kit/README.md +35 -0
  576. package/references/vault-kit/app.json +12 -0
  577. package/references/vault-kit/appearance.json +12 -0
  578. package/references/vault-kit/graph.json +35 -0
  579. package/references/vault-kit/snippets/mindrian-destijl.css +297 -0
  580. package/references/vault-kit/templates/new-artifact.md +37 -0
  581. package/references/vault-kit/templates/new-meeting-note.md +35 -0
  582. package/references/vault-kit/templates/new-team-profile.md +29 -0
  583. package/references/vault-kit/templates/new-xref.md +35 -0
  584. package/references/visual/symbol-system.md +151 -0
  585. package/skills/MOSDeckEngine/SKILL.md +325 -0
  586. package/skills/brain-connector/SKILL.md +114 -0
  587. package/skills/context-engine/SKILL.md +147 -0
  588. package/skills/conversation-mode/SKILL.md +102 -0
  589. package/skills/larry-personality/SKILL.md +219 -0
  590. package/skills/larry-personality/framework-chains.md +92 -0
  591. package/skills/larry-personality/mode-engine.md +185 -0
  592. package/skills/mullins-scaffold/SKILL.md +61 -0
  593. package/skills/mullins-scaffold/scaffold.json +146 -0
  594. package/skills/pws-methodology/SKILL.md +49 -0
  595. package/skills/room-passive/SKILL.md +165 -0
  596. package/skills/room-proactive/SKILL.md +250 -0
  597. package/skills/ui-system/SKILL.md +277 -0
@@ -0,0 +1,1247 @@
1
+ #!/usr/bin/env node
2
+ 'use strict';
3
+
4
+ /**
5
+ * Phase 81-01 test runner for the Feynman-MINTO foundation work.
6
+ *
7
+ * Discovers and runs test files that belong to the Feynman-MINTO pipeline:
8
+ * - lib/memory/feynman-prompts.test.cjs
9
+ * - lib/memory/narrative-schema.test.cjs
10
+ * - scripts/vault-section-minto-generator.test.cjs
11
+ *
12
+ * Runs each in a child process so a module-level assertion failure in one
13
+ * file does not short-circuit the rest of the suite. Exits 0 on all pass,
14
+ * 1 on any failure. Mirrors the lib/import/run-all-tests.cjs pattern.
15
+ *
16
+ * Usage:
17
+ * MINTO_FROZEN_DATE=2026-04-14 node lib/memory/run-feynman-tests.cjs
18
+ */
19
+
20
+ const fs = require('node:fs');
21
+ const path = require('node:path');
22
+ const { spawnSync } = require('node:child_process');
23
+
24
+ // Defense-in-depth against browser-hijack during suite runs. Any test that
25
+ // ends up calling platform.openBrowser() will honor this and skip the real
26
+ // spawn while still exercising the localhost URL guard. Individual tests
27
+ // (e.g. dashboard-server.test.cjs) also set this locally; setting it at
28
+ // runner scope protects future tests that forget.
29
+ process.env.MINDRIAN_OPEN_BROWSER_DISABLE = '1';
30
+
31
+ const REPO_ROOT = path.resolve(__dirname, '..', '..');
32
+
33
+ const TEST_FILES = [
34
+ path.join(REPO_ROOT, 'lib', 'memory', 'feynman-prompts.test.cjs'),
35
+ path.join(REPO_ROOT, 'lib', 'memory', 'narrative-schema.test.cjs'),
36
+ path.join(REPO_ROOT, 'scripts', 'vault-section-minto-generator.test.cjs'),
37
+ // Phase 81-02 additions:
38
+ path.join(REPO_ROOT, 'lib', 'memory', 'feynman-prompts-drift.test.cjs'),
39
+ path.join(
40
+ REPO_ROOT,
41
+ 'scripts',
42
+ 'vault-section-minto-generator.integration.test.cjs'
43
+ ),
44
+ // Phase 81-04:
45
+ path.join(REPO_ROOT, 'scripts', 'vault-regenerate-all.test.cjs'),
46
+ // Phase 82-04: wiki artifact injection fixture-based tests.
47
+ path.join(REPO_ROOT, 'scripts', 'generate-presentation.test.cjs'),
48
+ // Phase 83-04: cross-session scope injection Tier 1 tests.
49
+ path.join(REPO_ROOT, 'scripts', '83-scope-injection.test.cjs'),
50
+ // Phase 83-05: hook dispatch scaffold smoke tests.
51
+ path.join(REPO_ROOT, 'test', '83-hook-dispatch.test.cjs'),
52
+ // Phase 83-06: filesystem write interception (Tier 1.5) tests.
53
+ path.join(REPO_ROOT, 'test', '83-write-scope-check.test.cjs'),
54
+ // Phase 83-07: mid-session intent classifier (Tier 2) tests.
55
+ path.join(REPO_ROOT, 'test', '83-intent-classifier.test.cjs'),
56
+ // Phase 83-08: honesty layer markdown test.
57
+ path.join(REPO_ROOT, 'test', '83-honesty-layer.test.cjs'),
58
+ // Phase 84-08: smart notebook co-pilot fixture-based test suite (15 live + 3 skip-gated).
59
+ path.join(REPO_ROOT, 'test', '84-smart-notebook-copilot.test.cjs'),
60
+ // Phase 85-04 (WIN-FIX-F-02): run-hook.cmd exit-code propagation regression fence.
61
+ path.join(REPO_ROOT, 'tests', 'test-run-hook-cmd.cjs'),
62
+ // Phase 85-08 (WIN-FIX-I): brain-client param schema regression (Finding I, v1.10.9).
63
+ path.join(REPO_ROOT, 'tests', 'test-brain-client-params.cjs'),
64
+ // Phase 85-09 (Finding J / LASZLO-001): self-update Windows failure family regression fence.
65
+ path.join(REPO_ROOT, 'tests', 'test-self-update-platform.cjs'),
66
+ // Phase 85-06 (WIN-FIX-H-02/H-03): cross-platform banner rendering regression fence.
67
+ path.join(REPO_ROOT, 'tests', 'test-session-start-banner.cjs'),
68
+ // Phase 87-00: cascade e2e acceptance gate fixture (exits 77 when env
69
+ // degraded; the runner below treats 77 as SKIPPED, not FAILED).
70
+ path.join(REPO_ROOT, 'test', 'fixtures', 'cascade-e2e', 'cascade-e2e.test.cjs'),
71
+ // Phase 87-02: atomic write-lock concurrency fence (20 forked workers,
72
+ // exactly 1 winner) -- proves fs.openSync('wx') TOCTOU fix.
73
+ path.join(REPO_ROOT, 'lib', 'memory', 'write-lock-atomic.test.cjs'),
74
+ // Phase 87-01: security trifecta (SEC-01 Cypher sanitization + SEC-02
75
+ // API key file permissions + SEC-03 HSI timeout 5000 -> 30000).
76
+ path.join(REPO_ROOT, 'lib', 'memory', 'security-trifecta.test.cjs'),
77
+ // Phase 87-01a: ROOM.md + MINTO.md pre-commit hook (SEC-04). Worktree-safe
78
+ // installer + .room-root sentinel scoping + symlink-safe walker + Windows
79
+ // .cmd companion + session-start self-heal.
80
+ path.join(REPO_ROOT, 'lib', 'memory', 'room-minto-hook.test.cjs'),
81
+ // Phase 87-08: live dashboard Node server (scripts/serve-dashboard-live).
82
+ // Covers openBrowser localhost guard, Stream-A chat-hide, MOS_BIND_ALL
83
+ // refusal, and /api/room/* endpoint integration.
84
+ path.join(REPO_ROOT, 'lib', 'memory', 'dashboard-server.test.cjs'),
85
+ // Phase 87-05: MCP input validation (CASCADE-03 + CASCADE-05). Proves
86
+ // SECTION_RE regex, safeResolveSection traversal guard, and
87
+ // opportunitySchema JSON-structure validation.
88
+ path.join(REPO_ROOT, 'lib', 'memory', 'mcp-input-validation.test.cjs'),
89
+ // Phase 87-06: indexArtifact transaction wrap (CASCADE-04). Proves
90
+ // BEGIN/COMMIT semantics via REAL mid-transaction rollback injection +
91
+ // distinct testLockReleaseAfterCommit (enqueueWrite finally).
92
+ path.join(REPO_ROOT, 'lib', 'memory', 'index-artifact-transaction.test.cjs'),
93
+ // Phase 87-04: sync/async entry-point split (CASCADE-06). Proves three
94
+ // new files exist, key-set parity between sync and async, every async
95
+ // export is an AsyncFunction, legacy shim emits MOS_DEP_ROOM_OPS_LEGACY,
96
+ // expanded-scope caller audit (scripts/ lib/ bin/ commands/ pipelines/
97
+ // agents/ skills/) finds zero bare room-ops imports.
98
+ path.join(REPO_ROOT, 'lib', 'memory', 'sync-async-entry-points.test.cjs'),
99
+ // Phase 87-07: Brain session cache (5-min TTL + pending-promise pattern
100
+ // for R-87-07-RACE concurrent-init guard, sha256 key hashing) + bounded
101
+ // LRU for 3 intelligence-cascade caches (CASCADE-06). Includes load-time
102
+ // smoke test that catches missing-method errors after the Map->LRU swap.
103
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-cache-lru.test.cjs'),
104
+ // Phase 87-09: BYO API chat Bearer + CSRF double-submit + Origin-bound
105
+ // tokens + Host DNS-rebinding guard + security headers + safeLogError
106
+ // zero-log (R-87-09-CSRF gaps 1-6). Spawns serve-dashboard-live on
107
+ // :3192 and exercises every guard via HTTP.
108
+ path.join(REPO_ROOT, 'lib', 'memory', 'bearer-token.test.cjs'),
109
+ // Phase 87-09: chat context builder -- 5 intent patterns (contradicts,
110
+ // converges, stakeholders, gaps, briefing) stay under the 5K token
111
+ // budget; empty stakeholders early-returns gracefully (R6 / Phase 84-05).
112
+ path.join(REPO_ROOT, 'lib', 'memory', 'chat-context.test.cjs'),
113
+ // Phase 88-00-B: Feynman-MINTO invariants validator (lib/core/
114
+ // feynman-minto-invariants.cjs). 21 fixture tests across 5 violation
115
+ // categories (existence, schema, freshness, coherence, atomicity).
116
+ // Single source of truth consumed by every Phase 88 downstream plan.
117
+ path.join(REPO_ROOT, 'lib', 'memory', 'feynman-minto-invariants.test.cjs'),
118
+ // Phase 88-00: frontmatter schema v88 extension (last_generated_at,
119
+ // last_artifact_write_seen_at, reasoning_health_score, flagged_weaknesses,
120
+ // decision_log). Tests generator populates them, preserves decision_log
121
+ // across regen, and narrative-schema validator accepts both old and new
122
+ // structural payload shapes plus validateDecisionLogEntry helper.
123
+ path.join(REPO_ROOT, 'lib', 'memory', 'minto-schema-v88.test.cjs'),
124
+ // Phase 88-00 Task 2: idempotent migration script that backfills the five
125
+ // v88 fields on existing Phase 81 MINTO files. Walks room tree, atomic
126
+ // openSync wx + rename writes, --dry-run, already-v88 skip.
127
+ path.join(REPO_ROOT, 'lib', 'memory', 'minto-migration-v88.test.cjs'),
128
+ // Phase 88-01: folder-memory.cjs unified read contract (readTriple +
129
+ // readDecisionLog + computeHealthScore) with sync + async entry points
130
+ // mirroring Phase 87-04. 15 fixture tests: fresh triple, partial-missing,
131
+ // invariant-violation stale, missing-timestamps stale, artifacts-newer
132
+ // stale, parse-failed stale, references extracted, identity-text strip,
133
+ // empty-dir graceful, decision-log 20-entry read, decision-log 21-entry
134
+ // permissive read, health-score perfect 1.0, health-score zero, async
135
+ // parity, key-set parity + AsyncFunction assertion.
136
+ path.join(REPO_ROOT, 'lib', 'memory', 'folder-memory.test.cjs'),
137
+ // Phase 88-02: minto-debouncer queue (10s coalesce window + atomic
138
+ // tmp+rename writes + write-lock composition). 12 tests: enqueue,
139
+ // coalesce (earliest-wins), distinct sections, window-expired append,
140
+ // drain olderThanMs, atomic write safety, 5-fork concurrent same-section,
141
+ // 5-fork concurrent distinct sections, peek idempotent, malformed JSON
142
+ // self-heal with stderr warning, CLI subcommand, drain wall-clock timeout.
143
+ path.join(REPO_ROOT, 'lib', 'memory', 'minto-debouncer.test.cjs'),
144
+ // Phase 88-03: ROOM.md references recompiler (deterministic, atomic,
145
+ // delimiter-preserving + mtime conflict detection). 10 tests: no
146
+ // markers + artifacts append, existing block replaced byte-identically
147
+ // outside markers, cross-section wikilinks deduped under Section links,
148
+ // prose wikilinks NOT stripped into auto-block, system files filtered,
149
+ // mtime conflict skip, 3-fork concurrent same-section, 20-artifact
150
+ // sub-200ms budget, empty-section placeholder, no-ROOM.md exit 2.
151
+ path.join(REPO_ROOT, 'lib', 'memory', 'recompile-room-references.test.cjs'),
152
+ // Phase 88-04-B: atomic write contract for vault-section-minto-generator
153
+ // (openSync 'wx' + fsync + invariants validate + acquireLock + rename).
154
+ // 7 tests: happy path JSON envelope, 5-fork concurrent race, mid-write
155
+ // crash preservation, invariant ERROR rejection with preservation,
156
+ // WARNING passthrough, reader safety under interleaved writes,
157
+ // fsync-before-rename ordering trace.
158
+ path.join(REPO_ROOT, 'lib', 'memory', 'vault-section-minto-generator-atomic.test.cjs'),
159
+ // Phase 88-04 Task 1: stamp-artifact-write helper. Stamps
160
+ // last_artifact_write_seen_at into the section's MINTO.md frontmatter,
161
+ // falls back to .mindrian/pending-stamps/<section>.json when MINTO is
162
+ // absent or malformed. 6 tests: happy-path stamp + key preservation,
163
+ // pending-stamps fallback, byte-identical body preservation, concurrent
164
+ // stamp race with single final timestamp, malformed frontmatter -> pending
165
+ // fallback, soft-fail on missing section dir.
166
+ path.join(REPO_ROOT, 'lib', 'memory', 'stamp-artifact-write.test.cjs'),
167
+ // Phase 88-04 Task 3: post-write triple-fire wiring. 9 tests covering
168
+ // section .md write -> queue+recompile+stamp, non-room write no-op,
169
+ // system files skip enqueue, .txt files skip, foreground wall-clock
170
+ // bound, soft-fail exit 0, backgrounded spawn visible in source, and
171
+ // Edit + MultiEdit tool-name matchers.
172
+ path.join(REPO_ROOT, 'lib', 'memory', 'post-write-triple.test.cjs'),
173
+ // Phase 88-05: UserPromptSubmit drain block in scripts/intent-classifier.
174
+ // 7 tests: all-old drains + pending-tier1 file, all-new no-op, mixed
175
+ // partition, empty queue no-op, 20-entry wall-clock bound, pending file
176
+ // append across drains, session-crash recovery on next hook.
177
+ path.join(REPO_ROOT, 'lib', 'memory', 'debouncer-drain-at-prompt.test.cjs'),
178
+ // Phase 88-06: on-stop close-out triple snapshot. 8 tests covering
179
+ // 3-section snapshot shape, readTriple-parity entry shape, queue drain
180
+ // + stale surfacing, sentinel last_generated_at -> stale list, rapid
181
+ // single-section exit under 3000ms hook budget, Phase 84 STATE.md write
182
+ // preserved, atomic writes (no .tmp. leakage), and soft-fail on degraded
183
+ // fixture with no MINTO files.
184
+ path.join(REPO_ROOT, 'lib', 'memory', 'on-stop-snapshot.test.cjs'),
185
+ // Phase 88-07 Task 1: TRIPLE_CONTEXT formatter pure unit tests. 12 tests
186
+ // covering per-section block shape, empty/overflow decision_log rendering,
187
+ // null governing_thought placeholder, references overflow, budget cap with
188
+ // weakest-first elision (null score sorts first), token estimator,
189
+ // stale annotation, pending-tier1 footer, zero sections, env-override
190
+ // for SESSION_START_BUDGET_TOKENS, and SUMMARY baseline-measurement fence.
191
+ path.join(REPO_ROOT, 'lib', 'memory', 'triple-context-formatter.test.cjs'),
192
+ // Phase 88-07 Task 2: session-start TRIPLE_CONTEXT injection. 9 tests
193
+ // covering snapshot-present render, snapshot-missing readTriple fallback,
194
+ // no-active-room no-op, pending-tier1 footer, minto-stale footer,
195
+ // wall-clock budget, Phase 83 ordering (TRIPLE_CONTEXT after ACTIVE ROOM
196
+ // CONTEXT), soft-fail on degraded input, and env-override propagation to
197
+ // the subshell node invocation.
198
+ path.join(REPO_ROOT, 'lib', 'memory', 'session-start-triple-injection.test.cjs'),
199
+ // Phase 88-08: pre-compact triple snapshot. 8 tests covering 3-section
200
+ // snapshot shape, kind:"pre-compact" marker (distinguishes from 88-06
201
+ // session-snapshot.json), 25-section truncation to MAX_SECTIONS=20 with
202
+ // truncated:true + truncated_count:5, weakest-first ordering (highest
203
+ // reasoning_health_score elided first), atomic tmp+rename (no .tmp.
204
+ // leftovers), empty-room no-op (sections:{}), soft-fail on no-MINTO
205
+ // fixture, and 20-section wall-clock under 1800ms inside 2000ms hook
206
+ // budget.
207
+ path.join(REPO_ROOT, 'lib', 'memory', 'pre-compact-snapshot.test.cjs'),
208
+ // Phase 88-09: post-compact TRIPLE_CONTEXT re-injection. 9 tests
209
+ // covering snapshot-present render, snapshot-missing fallback to live
210
+ // readTriple (+ stderr "snapshot missing" log), malformed snapshot
211
+ // fallback, empty-snapshot no-block emission, minto-stale.json +
212
+ // pending-tier1-regen.json footers, 20-section wall-clock < 2500ms,
213
+ // soft-fail on degraded input (exit 0), and content byte-identity vs
214
+ // session-start emission given the same fixture inputs (same formatter
215
+ // contract).
216
+ path.join(REPO_ROOT, 'lib', 'memory', 'post-compact-reinjection.test.cjs'),
217
+ // Phase 88-10: decision-capture module. 12 fixture tests covering
218
+ // first write, append preservation, 20-entry cap + JSONL archive,
219
+ // archive partitioned by archived-entry YYYY-MM (not today), invalid
220
+ // entry rejection with MINTO unchanged, readDecisionLog on no-MINTO
221
+ // and no-field shapes, 3-fork concurrent race, post-write invariants
222
+ // validation, preserve-on-regen composition with 88-00 schema
223
+ // contract, and special-char section names.
224
+ path.join(REPO_ROOT, 'lib', 'memory', 'decision-capture.test.cjs'),
225
+ // Phase 88-11: record-decision dual-write. 8 fixture tests proving
226
+ // bin/mindrian-tools.cjs record-decision fires BOTH primary
227
+ // (proactive-intelligence .proactive-intelligence.json write; pre-88,
228
+ // unchanged) AND additive decision_log write (decision-capture.cjs;
229
+ // 88-10). Covers derivable section happy path, missing source-artifact
230
+ // skip, MINTO missing mismatch logging to decision-dual-write-errors.jsonl,
231
+ // both-succeed clean exit, per-call idempotency append, error log
232
+ // structural format, absolute-path source-artifact inside room, and
233
+ // outside-room artifact skip with stderr warning. Primary write is
234
+ // authoritative; dual-write never blocks or regresses primary behavior.
235
+ path.join(REPO_ROOT, 'lib', 'memory', 'record-decision-dual-write.test.cjs'),
236
+ // Phase 88-13: Feynman-MINTO guardian (scripts/feynman-minto-guardian.cjs)
237
+ // with validator registry + four seed validators (minto-invariants,
238
+ // snapshot-integrity, queue-health, stale-lifecycle). 16 tests: 10 core
239
+ // modes (session-start, on-stop, pre-commit, clean-tmp) + 3 registry
240
+ // (load + fail-open + id-collision) + 3 lifecycle validators
241
+ // (snapshot-integrity partial/empty/healthy, queue-health 500/1000
242
+ // ceilings, stale-lifecycle ghost pruning atomically from stale.json).
243
+ path.join(REPO_ROOT, 'lib', 'memory', 'feynman-minto-guardian.test.cjs'),
244
+ // Phase 88.1-07: frontmatter schema validator (lib/core/frontmatter-
245
+ // schemas.cjs pure function + scripts/frontmatter-schema-validator.cjs
246
+ // PostToolUse hook). 10 fixture tests covering valid artifact, missing
247
+ // single required field, all required missing -> critical, malformed
248
+ // YAML (null) -> critical, ROOM.md missing name, STATE.md missing
249
+ // artifact_count, MINTO.md delegation to feynman-minto-invariants,
250
+ // unknown field -> warning, purity (no fs + BSL header + no dashes),
251
+ // empty {} frontmatter -> critical. Advisory not blocking (R2).
252
+ path.join(REPO_ROOT, 'lib', 'memory', 'frontmatter-schema-validator.test.cjs'),
253
+ // Phase 88.1-08: async artifact auto-commit throttle (lib/core/auto-
254
+ // commit-throttle.cjs pure module). 10 fixture tests covering empty
255
+ // ledger, recent entry throttle, stale entry no-throttle, per-path
256
+ // scope, updateLedger immutability, pruneOldEntries drop/keep
257
+ // semantics, THROTTLE_WINDOW_MS = 5000, purity (no fs), and 1000-
258
+ // entry prune performance < 5ms.
259
+ path.join(REPO_ROOT, 'lib', 'memory', 'async-artifact-auto-commit.test.cjs'),
260
+ // Phase 88.1-16: query-efficiency telemetry pure module
261
+ // (lib/core/token-estimator.cjs). 12 fixture tests covering estimateTokens
262
+ // (chars/4 ceil + graceful null/non-string), estimateRoomTokens (valid
263
+ // room, session cache, invalid-room null, non-.md skip), clearCache,
264
+ // ratio sanity, validateEventShape (8-field contract), classifyRatio
265
+ // (10x threshold), aggregateEvents (median/mean/top5 per-command).
266
+ // Defends the Canon Part 6 57x-efficiency claim by making it measurable.
267
+ path.join(REPO_ROOT, 'lib', 'memory', 'query-efficiency-telemetry.test.cjs'),
268
+ // v1.11.2: PostToolUse hook envelope shape regression fence
269
+ // (tests/test-hook-envelope-shape.cjs). 5 scenarios covering both .cjs
270
+ // PostToolUse hooks patched in v1.11.2 (frontmatter-schema-validator +
271
+ // async-artifact-auto-commit) plus a fence over the v1.10.19 reference
272
+ // fix (query-efficiency-telemetry). For each hook: silent path emits
273
+ // zero stdout bytes; message path either silent or emits a Claude Code
274
+ // 2.x compliant envelope (top-level keys subset of {continue, stopReason,
275
+ // suppressOutput, systemMessage, decision, reason, hookSpecificOutput};
276
+ // additionalContext NOT at root; if hookSpecificOutput present,
277
+ // hookEventName === 'PostToolUse'). Soft-fail invariant preserved (always
278
+ // exit 0). Bash post-write hook deferred to follow-up patch.
279
+ path.join(REPO_ROOT, 'tests', 'test-hook-envelope-shape.cjs'),
280
+ // Phase 95-02: bash post-write envelope shape + cascade side-channel
281
+ // (<roomDir>/.mindrian/last-cascade.json) atomic write fence. Mirrors the
282
+ // PostToolUse envelope contract from tests/test-hook-envelope-shape.cjs
283
+ // applied to the bash post-write hook (which v1.11.2 deferred). Stdout
284
+ // emits hookSpecificOutput.additionalContext one-liner only; cascade
285
+ // payload moves to LOCAL side-channel JSON per Canon Part 8.
286
+ path.join(REPO_ROOT, 'tests', 'test-cascade-side-channel.cjs'),
287
+ // Phase 95-03: room-proactive SKILL.md side-channel-reader contract +
288
+ // synthetic dry-run. Text-level fence catching accidental rollback to
289
+ // the OLD additionalContext-only detection contract that was load-
290
+ // bearing-broken since Phase 88.1-03 shipped. Negative-string list
291
+ // covers ALL 5 OLD framings (not just the line-80-92 literal); current
292
+ // lines 102-113 of pre-95-03 SKILL.md were ALSO carrying the OLD
293
+ // framing and are part of the rewrite scope, not the preserved range.
294
+ // Asserts the cool-UI render directive is present (cascade-finding
295
+ // render must NOT fall back to raw prose) and that the prose APPROVE/
296
+ // REJECT/DEFER flow at SKILL.md (current) lines 114-160 is preserved
297
+ // (F.0 selector deferred to Phase 88.2 / 97 per
298
+ // room/decisions/decision-phase-95-sequencing.md).
299
+ path.join(REPO_ROOT, 'tests', 'test-room-proactive-side-channel.cjs'),
300
+ // Phase 95.1-02: 7 RED test skeletons for the 6 new drift classes (B/C/
301
+ // D/E/F) plus the section-intelligence generator and the doctor self-
302
+ // compliance retrofit. Validation-architecture-first wave per 95.1-
303
+ // VALIDATION.md: tests land BEFORE production code (Wave 1) so each
304
+ // implementation lands as a RED -> GREEN transition, never as blind
305
+ // shipping. Existing bash post-write hook + Plan 95.1-01 fixture +
306
+ // Plan 95.1-03 generator make tests 3 + 6 GREEN today; tests 1, 2, 4,
307
+ // 5, 7 stay RED until Wave 1 plans 95.1-04..95.1-08 land.
308
+ // Per Pitfall 2 from 95.1-RESEARCH.md: every spawnSync sets
309
+ // MINDRIAN_ROOMS_HOME to a scratch dir so no test can leak into the
310
+ // user's real active room.
311
+ path.join(REPO_ROOT, 'tests', 'test-doctor-class-b.cjs'),
312
+ path.join(REPO_ROOT, 'tests', 'test-doctor-class-c.cjs'),
313
+ path.join(REPO_ROOT, 'tests', 'test-cascade-surface-e2e.cjs'),
314
+ path.join(REPO_ROOT, 'tests', 'test-doctor-class-e.cjs'),
315
+ path.join(REPO_ROOT, 'tests', 'test-doctor-class-f.cjs'),
316
+ // Phase 95.2-00: hermetic regression for atomic-swap install-cache recovery
317
+ // (DOCTOR-95.2-01..05, -08). 9 scenarios exercise all 4 MOS_TEST_FORCE_FAIL
318
+ // injection points (copy/verify/rename-old/commit) plus the missing-install
319
+ // class A eligibility renderer auto-fire (s7 spawns doctor in human-render
320
+ // mode and asserts [F.1 Next Move] + /mos:doctor --fix appear in stdout).
321
+ // Hermetic via MINDRIAN_PLUGIN_HOME env override.
322
+ path.join(REPO_ROOT, 'tests', 'test-doctor-atomic-swap.cjs'),
323
+ path.join(REPO_ROOT, 'tests', 'test-generate-section-intelligence.cjs'),
324
+ path.join(REPO_ROOT, 'tests', 'test-doctor-ui-self-compliant.cjs'),
325
+ // Phase 88.1-04: statusline MINTO segment cache + format helpers
326
+ // (lib/core/statusline-cache.cjs). 10 fixture tests covering getCached
327
+ // on absent cache, setCached+getCached fresh hit, TTL expiry, graceful
328
+ // fallback on permission-denied, distinct-key isolation, atomic write
329
+ // (no partial observer), cache location contract, truncateGoverningThought
330
+ // short / long variants, and classifyHealth Canon Part 2 thresholds.
331
+ // Backs the 300ms render budget (CONTEXT R1) by keeping the warm path
332
+ // a single JSON parse.
333
+ path.join(REPO_ROOT, 'lib', 'memory', 'statusline-minto-segment.test.cjs'),
334
+ // Phase 88.1-05: /mos:status Shape E renderer (scripts/mos-status.cjs).
335
+ // 12 fixture tests covering healthy 3-section render, stale suffix,
336
+ // empty (no MINTO yet) placeholder, 80-char truncation, 10-section
337
+ // summary counts (filled/stale/median), --stale-only filter, <section>
338
+ // full-detail argument, missing-room graceful exit, Canon Part 8 no-
339
+ // network surface, Shape E zones (header/rows/summary/actions), and
340
+ // warm-cache vs cold-cache paths sharing the Plan 88.1-04 5s TTL cache.
341
+ path.join(REPO_ROOT, 'lib', 'memory', 'mos-status-renderer.test.cjs'),
342
+ // Phase 88.1-06: SessionStart MINTO banner formatter (lib/memory/
343
+ // sessionstart-banner-formatter.cjs). 10 fixture tests covering top-3
344
+ // by-mtime selection on a 5-section room, 2-section no-padding render,
345
+ // 0-section brand-only render, no-active-room silent empty, stale
346
+ // (stale: reason) suffix, empty governing_thought (no MINTO yet)
347
+ // placeholder, 60-char truncation with Unicode ellipsis, tight 200-
348
+ // token budget drops to 2 rows, very tight 50-token budget drops all
349
+ // rows, and dynamic version read from .claude-plugin/plugin.json
350
+ // (no hardcoded semver) so banner brand never drifts on release.
351
+ path.join(REPO_ROOT, 'lib', 'memory', 'sessionstart-minto-banner.test.cjs'),
352
+ // Phase 90-00: BRAIN.md schema validator (lib/core/brain-md-schema.cjs).
353
+ // 18 fixture tests across 5 violation categories (existence, schema,
354
+ // staleness, attribution, canon_boundary). Mirrors Phase 88-00-B
355
+ // invariants pattern: hand-written narrow-dialect YAML parser, frozen
356
+ // SEVERITY + CATEGORIES + STALENESS + STALE_REASON + REQUIRED_
357
+ // FRONTMATTER_FIELDS + OPTIONAL_SECTION_HEADINGS enums, parse-error
358
+ // fast return. Canon Part 8 boundary baked in at schema layer via
359
+ // conservative regex set (email / currency / quoted-person / meeting
360
+ // / SSN) with action_hint "canon_part8_review". Load-bearing contract
361
+ // for Plans 90-01 (derivation writer), 90-04 (readQuadruple), 90-05
362
+ // (registry-discoverable invariants), 90-09 (Phase 91 Navigation
363
+ // Engine interface spec).
364
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-md-schema.test.cjs'),
365
+ // Phase 90-01: Brain derivation core (lib/core/brain-derivation.cjs +
366
+ // lib/core/brain-derivation-prompts.cjs). 18 fixture tests across
367
+ // happy path, offline/timeout/rate-limit failure modes, schema gate
368
+ // rejection, concurrent writes, triple absent, null governing_thought
369
+ // sha256 sentinel, only_sections/dry_run options, schema()
370
+ // call-count invariant, atomic write tmpfile naming pattern, crash
371
+ // cleanup, deriveSection never-throws contract, three-surface CJS
372
+ // purity, and the LOAD-BEARING Canon Part 8 payload audits (Tests
373
+ // 13 + 14) that capture every outbound Brain cypher + pinecone
374
+ // search and assert every payload against the frozen allow-list
375
+ // regex set AND that dangerous user content ("Lawrence / 5M /
376
+ // revenue") NEVER leaks into any Brain call.
377
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-derivation.test.cjs'),
378
+ // Phase 90-02: Brain derivation queue (lib/core/brain-derivation-queue.cjs).
379
+ // 15 fixture tests covering enqueue (idempotent dedupe, replace on hash
380
+ // change, cross-section isolation, .mindrian dir autocreate), readQueue
381
+ // (missing file + malformed JSON self-heal), writeQueueAtomic (tmpfile +
382
+ // rename), concurrent write race (no corruption), SOFT_CAP=500 warning,
383
+ // HARD_CAP=1000 rejection, Canon Part 8 invariant audit (queue carries
384
+ // ONLY section + hash pairs + reason + timestamp; never governing_thought
385
+ // text), and drain (stale-queue-race guard via current-triple-hash
386
+ // comparison, brain-offline re-enqueue, maxEntries partition).
387
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-derivation-queue.test.cjs'),
388
+ // Phase 90-03 Task 1: BRAIN.md staleness computation (lib/core/brain-md-
389
+ // staleness.cjs). 13 fixture tests covering the 4 staleness signals
390
+ // (hash mismatch, age_exceeded, brain_graph_version_mismatch,
391
+ // brain_offline), precedence rules (hash-mismatch > age > version),
392
+ // recommended_action demotion when Brain offline (enqueue_regen ->
393
+ // enqueue_when_brain_online), BRAIN_STALE_AGE_DAYS env override with
394
+ // fallback on garbage, malformed-frontmatter -> parse_failed stale
395
+ // reason, and the LOAD-BEARING Canon Part 8 audit (Test 13) that runs
396
+ // 10 sections through computeBrainStaleness and asserts ZERO
397
+ // brain-client.query/search/smartSearch calls; isAvailable + schema
398
+ // are the ONLY allowed Brain touches during the scan.
399
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-md-staleness.test.cjs'),
400
+ // Phase 90-03 Task 2: scripts/session-start Phase 90-03 integration
401
+ // tests. 5 fixture tests spawning real bash session-start with BRAIN.md
402
+ // fixtures: mixed fresh/stale/absent annotation render, Brain-offline
403
+ // stale annotation with empty queue (no enqueue when we cannot drain),
404
+ // Brain-online stale -> enqueue lands + wall-clock < 5000ms,
405
+ // BRAIN_STALENESS_SKIP=1 feature flag suppression, and backward-compat
406
+ // for rooms with zero BRAIN.md (no "Brain derivation" noise lines).
407
+ path.join(REPO_ROOT, 'lib', 'memory', 'session-start-brain-staleness.test.cjs'),
408
+ // Phase 90-04: readQuadruple extends Phase 88-01 readTriple additively
409
+ // with a brain field parsed from BRAIN.md (lib/core/folder-memory.cjs +
410
+ // lib/core/folder-memory-async.cjs + lib/core/folder-memory-shared.cjs
411
+ // additive surface). 17 fixture tests: 5 parser-isolation cases for
412
+ // parseBrainMd (valid full struct, absent->null literal, malformed->
413
+ // emptyBrain parse_failed:true, 3-of-9 sections populated + 6 absent,
414
+ // unknown heading ignored for future-compat) + 12 integration cases
415
+ // (sync readQuadruple happy-path + brain absent + malformed + nonexistent
416
+ // path no-throw, async AsyncFunction constructor parity, sync/async deep
417
+ // equality, key-set parity with readTriple back-compat preserved,
418
+ // isQuadrupleFresh 5 cases covering brain null/fresh/stale plus
419
+ // brain_offline exemption and derivation-stale). Backward-compat
420
+ // critical: readTriple signature/return unchanged. OPTIONAL_SECTION_
421
+ // HEADINGS parity with brain-md-schema also asserted.
422
+ path.join(REPO_ROOT, 'lib', 'memory', 'folder-memory-quadruple.test.cjs'),
423
+ // Phase 90-05: BRAIN.md invariants validator (lib/memory/validators/
424
+ // brain-md-invariants.cjs). Phase 88-13 registry-compatible drop-in:
425
+ // {id, severity_map, validate, scope:'section'} + auto-discovered by
426
+ // guardian's validator loader. Wraps Plan 90-00 validateSchema as the
427
+ // schema check and adds three runtime checks: (A) staleness vs live
428
+ // triple (governing_thought_hash mismatch -> staleness/warning with
429
+ // action_hint 'enqueue_regen'), (B) brain_graph_version drift vs
430
+ // .mindrian/brain-schema-cache.json (-> staleness/warning), (C)
431
+ // cross-file Canon Part 8 body-text scan with 5-violation cap
432
+ // (canon_boundary/warning + action_hint 'canon_part8_review'). 15
433
+ // fixture tests + 1 shape test cover absence-is-valid, schema
434
+ // wrapping, attribution, staleness, drift, 4 canon leak patterns,
435
+ // cap, aggregation, parse-failure short-circuit, non-BRAIN.md not
436
+ // scanned, and Phase 88-13 guardian auto-discovery integration (real
437
+ // guardian on-stop spawn, invariant-report.json assertion). Zero
438
+ // guardian.cjs changes; zero new runtime deps; BSL 1.1.
439
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-md-invariants-validator.test.cjs'),
440
+ // Phase 90-07: /mos:brain-derive command dispatcher (scripts/brain-derive-
441
+ // command.cjs). 12 fixture tests covering the 4 invocation modes (single
442
+ // section, --all, --cross-room, --dry-run) plus graceful degradation
443
+ // paths (Brain offline from start, rate-limit mid-batch, invalid section,
444
+ // no active room, schema-gate rejection on one section) plus streaming
445
+ // progress on --all runs > 3 sections and the Shape E Action Report
446
+ // rendering contract (header/counts/per-section/NEXT). Mocks brain-
447
+ // client + brain-derivation via require.cache overrides (same pattern
448
+ // as Plan 90-01 and 90-02). Canon Part 8: dispatcher is a thin wrapper
449
+ // over deriveSection; all Canon boundaries enforced inside deriveSection
450
+ // + cross-room-aggregator; dispatcher adds zero net new Brain surface.
451
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-derive-command.test.cjs'),
452
+ // Phase 90-06: cross-room aggregator (lib/core/cross-room-aggregator.cjs).
453
+ // 18 fixture tests covering Phase 83 registry discovery, GUARDRAIL.md
454
+ // sealed-room skip (byte-for-byte reuse of Phase 83 contract), per-room
455
+ // brain_cross_room:false opt-out, out-of-scope absolute-path rejection
456
+ // (ALLOWED_ROOT under ~/MindrianRooms/), unreadable/timeout/self-
457
+ // exclusion skip reasons, three contradiction types (hash_divergence,
458
+ // framework_contradiction, problem_type_mismatch), max_rooms cap,
459
+ // registry-less and malformed-registry graceful fallback, 10-room
460
+ // wall-clock < 500ms, and the LOAD-BEARING Canon Part 8 payload audits
461
+ // (Tests 16-18): adversarial fixture with dangerous content ('Lawrence
462
+ // said $5M', emails, SSN, phone, 'meeting with') across 3 rooms; assert
463
+ // JSON.stringify(result) contains ZERO forbidden substrings, every
464
+ // detail_scalar field is primitive with strings <=40 chars and matching
465
+ // no forbidden regex, and brain-derivation.cjs cross_room_scan
466
+ // integration populates 'Flagged Contradictions (cross-room)' with
467
+ // slug-based entries only. Fourth Canon Part 8 tripwire (schema doc +
468
+ // prompt-builder allow-list + invariants body scan + this plan's
469
+ // sanitizeDetailScalar + JSON.stringify output audit).
470
+ path.join(REPO_ROOT, 'lib', 'memory', 'cross-room-aggregator.test.cjs'),
471
+ // Phase 90-08: graceful degradation end-to-end suite (third-line
472
+ // defense for Phase 90). 14 failure scenarios + 2 cross-cutting audits,
473
+ // four invariants per scenario: A no crash, B no partial/orphaned
474
+ // BRAIN.md, C user-visible status (reason or stderr), D retry path
475
+ // correct. Scenarios span Brain-offline permanent + intermittent,
476
+ // API quota exhaustion, mid-derivation timeout, schema drift mid-
477
+ // session, malformed Brain response, network partition, filesystem
478
+ // EACCES, ENOSPC on atomic rename, concurrent deriveSection race,
479
+ // Canon Part 8 regression under ordinary + timeout operation
480
+ // (dangerous fixture: Lawrence + 5M + revenue + emails + SSN + phone),
481
+ // cross-room aggregator under corrupt peer room, and concurrent
482
+ // session-start staleness scans (Plan 90-02 idempotency). Audit A1
483
+ // scans every BRAIN.md written during the suite against the frozen
484
+ // forbidden regex set (email / currency / quoted-person / meeting /
485
+ // SSN / phone); any match hard-fails the suite. Audit A2 sweeps
486
+ // every tmp root for BRAIN.md.tmp.*.brain orphans; any found hard-
487
+ // fails. Proves Canon Part 8 holds AS A FAILURE-MODE GUARANTEE.
488
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-derivation-graceful-degradation.test.cjs'),
489
+ // Phase 89.1a-03: Brain methodology substrate loader fixture suite.
490
+ // 14 scenarios: 6 adversarial (Canon Part 8 boundary), 3 happy-path
491
+ // (Mode A1/A2/A3), 3 cache/persistence (TTL + validator), 2 graceful
492
+ // degradation (Mode B1/B3). A1 cross-scenario cache sweep + A2 orphan
493
+ // tmpfile sweep at suite end. Inherits Phase 90-08 mock-via-require.cache
494
+ // + runScenario pattern byte-for-byte.
495
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-brain-substrate.cjs'),
496
+ // Phase 89.1-01: brain-client shape adapter + validator Check E
497
+ // embedding-or-score relaxation. 14 fixture scenarios:
498
+ // T1-9 (Task 1): pullFromBrain.adaptBrainSearchResponse translates
499
+ // live MCP {result:{hits:[]}} into legacy {matches:[]} with
500
+ // score-bearing entries (Pinecone searchRecords returns no values).
501
+ // Tests cover live shape, empty hits, legacy back-compat, malformed
502
+ // shape, sparse hit, loadSubstrate Mode A3 + cache landing,
503
+ // Canon Part 8 audit chokepoint preservation, Pitfall 1 quota
504
+ // fallback rejection, and graceful degradation on null response.
505
+ // T10-14 (Task 2): validator Check E embedding-or-score relaxation.
506
+ // Score-only valid, score-out-of-range critical, neither critical,
507
+ // legacy 1024-dim back-compat, canon_boundary on forbidden regex
508
+ // in score-only entry metadata.
509
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-brain-substrate-shape.cjs'),
510
+ // Phase 89.1-02: Domain analyzer fixture suite. 11 scenarios
511
+ // (1 happy + 4 edge + 4 adversarial + 2 determinism) + suite-end
512
+ // A1 sweep over every analyzer output against FORBIDDEN_PATTERNS +
513
+ // DANGEROUS_SUBSTRINGS. Asserts ExternalEgressViolation fires on
514
+ // adversarial substrate metadata. Inherits 89.1a-03 mock-via-
515
+ // require.cache pattern byte-for-byte.
516
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-domain-analyzer.cjs'),
517
+ // Phase 89.1-03: Query matrix fixture suite. 11 scenarios
518
+ // (1 happy + 4 edge + 4 adversarial + 2 determinism) + suite-end
519
+ // A1 sweep over every generated query string. Determinism fence:
520
+ // 5 invocations of identical input produce identical JSON.
521
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-query-matrix.cjs'),
522
+ // Phase 89.2-01: Shared egress primitives fixture suite. 8 scenarios
523
+ // + A1 forbidden-pattern sweep + A2 orphan tmpfile sweep. Covers the
524
+ // ExternalEgressViolation extracted class, FORBIDDEN_PATTERNS byte-for-byte
525
+ // re-export with require-time drift guard, auditQueryString +
526
+ // auditQueryObject chokepoint helpers, atomic telemetry ledger with
527
+ // sha256-hashed query_text (literal NEVER persists), per-source budget
528
+ // math over rolling 24h window, and graceful fs-error degradation.
529
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-egress-primitives.cjs'),
530
+ // Phase 89.2-02: Academic fetcher fixture suite. 20 scenarios total
531
+ // (12 fetcher + 6 validator + A1 forbidden-pattern sweep + A2
532
+ // FORBIDDEN_PATTERNS parity gate). Covers OpenAlex + arXiv + PubMed
533
+ // + Scopus + IEEE + Nature dispatch, dedup determinism, API-key
534
+ // graceful degradation, 429 rate-limit graceful, timeout graceful,
535
+ // malformed response graceful, per-source budget exhausted, 4
536
+ // adversarial Canon Part 8 scenarios proving ZERO captured URLs +
537
+ // ZERO telemetry on adversarial input, chokepoint exclusivity static
538
+ // grep (exactly 1 fetch( call site).
539
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-fetcher-academic.cjs'),
540
+ // Phase 89.2-03: Patents fetcher fixture suite. 17 scenarios total
541
+ // (11 fetcher + 6 validator + A1 sweep + A2 parity). Covers Google
542
+ // Patents + USPTO dispatch with pre-flight Canon Part 8 audit
543
+ // (Pattern 6 -- walks every query through chokepoint BEFORE source
544
+ // loop runs so adversarial inputs at any position produce ZERO
545
+ // captured URLs). PATENTS_SOURCES validator gate (Pattern 7) scopes
546
+ // Checks B/C/E/F to google_patents + uspto entries on the shared
547
+ // global ledger.
548
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-fetcher-patents.cjs'),
549
+ // Phase 89.2-04: Industry fetcher fixture suite. 17 scenarios total
550
+ // (11 fetcher + 6 validator + A1 sweep + A2 parity). Covers Tavily
551
+ // orchestration with TWO-LAYER auditQueryString chokepoint (Layer 1
552
+ // on user query, Layer 2 on each refined sub-query AFTER template
553
+ // substitution). 4 adversarial scenarios including 2 second-layer
554
+ // template-override attacks proving defense-in-depth. POST + body
555
+ // capture for body-payload audit. INDUSTRY_SOURCES = {tavily}
556
+ // validator gate.
557
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-fetcher-industry.cjs'),
558
+ // Phase 89.2-05: Experts post-processor fixture suite. 12 scenarios
559
+ // + A1 sweep. Post-processor (NO new egress surface); extracts
560
+ // deduped author records from academic fetcher papers[] output with
561
+ // composite-key dedup (name|orcid), standard h-index, and 3-layer
562
+ // public-email gate (PUBLIC_EMAIL_SOURCES allow-list = openalex only
563
+ // per kickoff section 15 Q4 + strict regex + FORBIDDEN_PATTERNS scan).
564
+ // 4 adversarial scenarios verify auditQueryObject defense-in-depth
565
+ // pre-return scrub.
566
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-fetcher-experts.cjs'),
567
+ // Phase 89.2-06 Task 1: Pinecone bridge standalone fixture suite. 4
568
+ // scenarios + A1 sweep. Covers strict 1024-dim Pinecone-direct vector
569
+ // retrieval via thin JSON-over-stdio CJS shim around existing
570
+ // rs_cache.py::fetch_all_from_namespace (resolves deferred-from-89.1
571
+ // strict-1024-dim item without touching Brain MCP). Mocks spawnSync
572
+ // via require.cache override. Cosine similarity identity (1.0) +
573
+ // anti-parallel (-1.0) + orthogonal (0.0) corner cases.
574
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-pinecone-bridge.cjs'),
575
+ // Phase 89.2-06 Task 2: Preprocessor fixture suite. 10 scenarios +
576
+ // A1 sweep. Phase 2 deterministic 5-field-per-document preprocessor
577
+ // (document_id + technical_terms[] + concepts[] + methods[] +
578
+ // relevance_score + boundary_flag). Covers source-aware text
579
+ // extraction (papers/patents abstract; industry signals signal),
580
+ // determinism (5 invocations byte-identical), boundary-flag
581
+ // heuristic, and 3 adversarial Canon Part 8 scenarios.
582
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-preprocessor.cjs'),
583
+ // Phase 89.2-06 Task 3: Differential scorer fixture suite. 10
584
+ // scenarios + A1 sweep. Phase 3 dual-floor filter
585
+ // (passes IFF diff > 0.3 AND lsa > 0.2 AND bert > 0.2; strict
586
+ // comparisons). LSA via embedded sklearn TfidfVectorizer + TruncatedSVD
587
+ // (DELIBERATE Canon Part 7 carve-out, documented in 3 locations);
588
+ // BERT via Pinecone-direct bridge. Two-mock pattern (spawnSync +
589
+ // rs-pinecone-bridge require.cache override) covers 4-cell graceful
590
+ // degradation matrix. 2 adversarial scenarios verify bridges are
591
+ // NEVER called when Layer 1 audit fires.
592
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-differential-scorer.cjs'),
593
+ // Phase 89.2-07 Task 1: Innovation classifier fixture suite. 8
594
+ // scenarios + A1 sweep. Phase 3 deterministic 3-enum classifier
595
+ // (structural_transfer / semantic_implementation / hybrid) on
596
+ // {diff, lsa, bert, passes} pair output. Strict > thresholds
597
+ // (lsa=0.3, bert=0.3); boundary at exact threshold falls to default
598
+ // fallback. Classification independent of passes. 2 adversarial
599
+ // Canon Part 8 scenarios.
600
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-innovation-classifier.cjs'),
601
+ // Phase 89.2-07 Task 2: Breakthrough scorer fixture suite. 10
602
+ // scenarios + A1 sweep. Phase 3 5-dimension 0-10 rubric
603
+ // (feasibility + market + magnitude + advantage + impact). Frozen
604
+ // DIMENSIONS array enforces deterministic dominant_dimension
605
+ // tie-break. Each dimension is a pure step function (no continuous
606
+ // interpolation). 2 adversarial Canon Part 8 scenarios.
607
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-breakthrough-scorer.cjs'),
608
+ // Phase 89.2-07 Task 3: Thesis generator fixture suite. 9 scenarios
609
+ // + A1 sweep. Phase 4 pure-template-fill (string concat, NOT
610
+ // template-literal interpolation) producing
611
+ // 'By applying X to Y, achieve Z because mechanism bridge_concept.'
612
+ // NO runtime LLM. Z-fallback ('novel insight') and bridge_concept
613
+ // fallback ('domain analogy') as frozen constants. 2 adversarial
614
+ // Canon Part 8 scenarios verify pre-input throw OR pre-return scrub.
615
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-thesis-generator.cjs'),
616
+ // Phase 89.3-01: rs-neo4j-writer (Aura Cypher writer; idempotent MERGE; rollback Cypher; Canon Part 8 defense)
617
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-neo4j-writer.cjs'),
618
+ // Phase 89.3-02: rs-sqlite-mirror (Tier 0 SQLite writer; INSERT OR REPLACE; rollback SQL; Canon Part 8 defense)
619
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-sqlite-mirror.cjs'),
620
+ // Phase 89.3-03: rs-mind-map (5-branch Cytoscape; Tier 0/1 read paths; Canon Part 8 audit on HTML)
621
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-mind-map.cjs'),
622
+ // Phase 89.3-04: rs-expert-mapper (Cypher MATCH+MERGE; Tier 0 graceful degradation; Canon Part 8 2-seam defense)
623
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-expert-mapper.cjs'),
624
+ // Phase 89.3-05: bridge-writer-enhanced (regression-tested; thesis + breakthrough_score frontmatter; Canon Part 8 audit on rendered output)
625
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-bridge-writer-enhanced.cjs'),
626
+ // Phase 89.4-01: rs-canon-violations (Canon Part 3 closed-vocabulary enforcement; CanonVerbViolation + CANONICAL_VERBS + validateVerb)
627
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-canon-violations.cjs'),
628
+ // Phase 89.4-02: rs-chain-feeder-core (lookupUpstream + emitChainMetadata; Brain FEEDS_INTO topology via existing chokepoint; Canon Part 8 audit at both entry points)
629
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-chain-feeder-core.cjs'),
630
+ // Phase 89.4-03: rs-chain-feeder-skill-spawn (5-rule deterministic table per kickoff section 6.4; first-match-wins; recommendSkillSpawn body wired in place)
631
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-chain-feeder-skill-spawn.cjs'),
632
+ // Phase 89.5-01: rs-commercial-assessor (deterministic 3-field commercial layer; frozen tables + Canon Part 8 input audit; NO runtime LLM)
633
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-commercial-assessor.cjs'),
634
+ // Phase 89.5-02: rs-nl-to-query (HARDEST Canon Part 8 surface in v1.11.0; buildBrainQueryFromNL chokepoint + 3-seam audit + 6+ adversarial fixtures)
635
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-nl-to-query.cjs'),
636
+ // Phase 89.5-03: rs-query-to-text (Larry-voiced NL explanation; frozen VOICE_TEMPLATES + deterministic FNV-1a kind detection + 2-seam audit)
637
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-query-to-text.cjs'),
638
+ // Phase 89.5-04: rs-discovery-engine (top-level orchestrator; chains 17 phase modules; Tier 0/Mode B graceful; Canon Part 8 input audit at gate)
639
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-discovery-engine.cjs'),
640
+ // Phase 89.5-05: rs-explain-command (end-to-end CLI smoke; bidirectional NL-Graph; 4 e2e scenarios + BSL header check + A1 sweep)
641
+ path.join(REPO_ROOT, 'lib', 'memory', 'test-rs-explain-command.cjs'),
642
+ // Phase 91-00: navigation-engine core (L5 Decision layer; decide(turn, ctx) composes 5 signals; tier-mode + RECOMMENDED gate + Section 4 staleness + Section 8 trace; 33 fixtures across shared helpers + decide() orchestration)
643
+ path.join(REPO_ROOT, 'lib', 'memory', 'navigation-engine-core.test.cjs'),
644
+ // Phase 91-01: USER.md persona durability (lib/core/persona-taxonomy.cjs
645
+ // frozen tables + Larry-to-Brain D-03 translation; lib/core/user-md-ops.cjs
646
+ // readUserMd / writeUserMdAtomic / detectPersonaUpdate / emptyUser; 22
647
+ // fixtures covering taxonomy invariants, atomic write under load,
648
+ // graceful malformed-fallback, update threshold + consecutive-turn rule,
649
+ // user_override bypass, cross-session persistence subprocess, and Canon
650
+ // Part 8 grep guard).
651
+ path.join(REPO_ROOT, 'lib', 'memory', 'user-md-persona.test.cjs'),
652
+ // Phase 91-02: UserPromptSubmit hook integration (scripts/intent-
653
+ // classifier.cjs Phase 91 navigation engine block). 12 fixture tests:
654
+ // happy path NAVIGATION DECISION emission, full injection shape with 6
655
+ // labeled fields + Why line on null values, 1200ms hard timeout
656
+ // fallback under MOS_NAV_TEST_SLEEP=5000ms, engine throw fallback
657
+ // (classifier byte-stable), atomic decision_trace persistence under 10
658
+ // rapid runs, 50-entry rotation (drop oldest 10 -> 41 on disk), session
659
+ // ID scoping (CLAUDE_SESSION_ID + sha256 fallback), Phase 83 mismatch
660
+ // warning preserved when engine returns Tier 0, per-turn quadruple
661
+ // cache observable via MOS_NAV_TEST_COUNTER, USER.md persona ->
662
+ // intent_persona.archetype mapping with absent-USER.md graceful path,
663
+ // Canon Part 8 source-scan (zero brain-client.query/search/smartSearch
664
+ // + zero fetch + zero shell-out curl), and cold/warm wall-clock budget
665
+ // with elapsed_ms field on every persisted trace entry.
666
+ path.join(REPO_ROOT, 'lib', 'memory', 'userpromptsubmit-integration.test.cjs'),
667
+ // Phase 91-03: skill-activation-router (lib/core/skill-activation-
668
+ // router.cjs). Composes navigation-engine.decide() output with legacy
669
+ // file-state + env activation. Engine precedence when fire_skill is
670
+ // set; legacy fallback when engine silent; mixed when only
671
+ // suppress_skills is populated. Canon Part 3 closed 10-verb
672
+ // vocabulary enforced (validateVerb + canonicalizeVerb); unknown
673
+ // verbs rejected with canon_part_3_unknown_verb_rejected trace note.
674
+ // Contradictory fire-vs-suppress resolved deterministically (fire
675
+ // wins; suppress entry for the fired skill is dropped). 15 router
676
+ // unit tests + 2 integration tests against scripts/intent-classifier.cjs
677
+ // end-to-end.
678
+ path.join(REPO_ROOT, 'lib', 'memory', 'skill-activation-router.test.cjs'),
679
+ // Phase 91-04: offer-presenter (lib/core/offer-presenter.cjs). Converts
680
+ // navigation-engine.decide() offer_next_step into a one-line grounded
681
+ // suggestion ("Offer: Because <reason>, try <command>.") with optional
682
+ // RECOMMENDED marker per Canon Part 3 Section 6 (Mode A + confidence
683
+ // >= 0.7 + verb match -- evaluated by the engine, respected here).
684
+ // Noise gates: max 1 offer per turn (one_offer_per_turn), suppress
685
+ // after 2 consecutive ignores (consecutive_ignores_threshold), grounding
686
+ // rule rejects empty/short/generic reasons (ungrounded_reason /
687
+ // generic_reason). Outcomes persist atomically to .mindrian/offer-
688
+ // history.json (Canon Part 4: every choice is graph data; LOCAL-only
689
+ // per Canon Part 8). 15 presenter unit tests + 2 integration tests
690
+ // through scripts/intent-classifier.cjs (engine offer rendered;
691
+ // ignore-loop reclassifies prior 'shown' to 'ignored' on next turn).
692
+ path.join(REPO_ROOT, 'lib', 'memory', 'offer-presenter.test.cjs'),
693
+ // Phase 91-05: /mos:explain-decision command (commands/explain-decision.md
694
+ // + scripts/explain-decision-command.cjs). User-facing audit surface for
695
+ // the Navigation Engine. Reads .mindrian/decision-traces/<session>.json
696
+ // (written by Plan 91-02) and renders human-readable trace output --
697
+ // header + body covering all 8 Section 8 brain_md_* fields plus all 5
698
+ // structural trace fields plus chosen_rationale. Default renders last
699
+ // 1 trace; --last N renders the N most recent (clamped to available);
700
+ // --session SESSIONID overrides default resolution. Default resolution
701
+ // chain: CLAUDE_SESSION_ID env -> .mindrian/current-session.json
702
+ // pointer -> most-recent trace file by mtime. Graceful fallbacks:
703
+ // absent file -> "No decisions recorded" advisory; malformed file ->
704
+ // "could not be parsed" advisory; both exit 0 so the command never
705
+ // throws on a fresh room. De Stijl glyph classifier maps tier_mode +
706
+ // weight_applied to check/warn/low. Canon Part 8 LOCAL-only: zero
707
+ // network surface (Test 11 source-scan parity with Plans 91-02 + 91-04).
708
+ path.join(REPO_ROOT, 'lib', 'memory', 'explain-decision-command.test.cjs'),
709
+ // Phase 94-09: /mos:explain-decision Action Footer (scripts/explain-
710
+ // decision-command.cjs renderTrace + empty-path emitter). Per QA
711
+ // handoff Section 3 FIX-8: pre-94-09 the rendered output ended with
712
+ // `---` separator and no Next: footer, violating the skills/ui-system/
713
+ // SKILL.md 4-zone Action Footer rule (Section 1 Zone 4 "NEVER omitted").
714
+ // 4 fixture tests: T1 last 5 lines contain literal 'Next:'; T2 footer
715
+ // contains at least 2 /mos: command refs (status / act / suggest-next
716
+ // per QA handoff verbatim suggestion); T3 non-regression -- the 9
717
+ // existing renderTrace markers (Tier Mode / BRAIN.md signal / Five-
718
+ // Signal Triangulation / Chosen rationale + closing `---` separator)
719
+ // are preserved before the footer; T4 graceful empty path -- the
720
+ // footer renders even when traces array is empty, so the user always
721
+ // gets a navigable next step. Canon Part 7 (Reuse Before Build):
722
+ // extends existing renderTrace + empty-path emitter with a tail
723
+ // append; no new module. Canon Part 3 (Tri-Context Decision Gate):
724
+ // footer offers verbs from the canonical 10-verb vocabulary
725
+ // (status -> Synthesize, act -> Run Methodology, suggest-next ->
726
+ // Free-Text / Spawn Sub-Agent); no new verbs introduced.
727
+ path.join(REPO_ROOT, 'lib', 'memory', 'explain-decision-footer.test.cjs'),
728
+ // Phase 91-07: problem-type-router (lib/core/problem-type-router.cjs).
729
+ // Parses BRAIN.md problemtype_classification + wicked_indicators bodies
730
+ // and returns 4-type routing recommendations (UDP / IDP / WDP /
731
+ // unknown) per locked decision D-08. Wicked escalation per Canon
732
+ // Appendix E rule R4 (wicked_score >= 8 -> soft-systems family).
733
+ // 24 fixture tests: parser (1-5), 4-type routing tables + verb
734
+ // traceability (6-10, 16-18), wicked detection + override (11-15),
735
+ // decide() integration (19-21), brain-client.isAvailable() upgrade
736
+ // from hard-coded false (Plan 91-02) to real scalar lookup (22-24).
737
+ // Canon Part 8 Section 9.3: only isAvailable allowed; query/search/
738
+ // smartSearch FORBIDDEN.
739
+ path.join(REPO_ROOT, 'lib', 'memory', 'problem-type-router.test.cjs'),
740
+ // Phase 91-08: framework-chain-composer (lib/core/framework-chain-
741
+ // composer.cjs). Parses BRAIN.md framework_chain_predictions section
742
+ // body (FEEDS_INTO edges authored by Phase 90-01 deriveSection),
743
+ // detects when the user just completed framework A (via reasoning
744
+ // governing_thought primary; mtime fallback), and proposes framework
745
+ // B as engine.offer_next_step with command = /mos:<slug>. Confidence
746
+ // gate: < 0.5 -> null (noise floor); >= 0.7 -> recommended_eligible
747
+ // flag set so offer-presenter can render RECOMMENDED marker per Plan
748
+ // 91-04 + Canon Part 3 Section 6. User override (turn 2 invokes
749
+ // different /mos: command) recorded as REJECTED chain suggestion in
750
+ // decision_trace + offer-history outcome=ignored (Canon Part 4: every
751
+ // choice is graph data). Canon Part 8: composer reads only LOCAL
752
+ // BRAIN.md body via readQuadruple.brain.sections; never queries Brain
753
+ // at engine time. 18 fixture tests: 15 pure-module (parser + completion
754
+ // detection + proposal + grounding + RECOMMENDED eligibility + tie-
755
+ // breaking) + 3 decide() integration (chain offer rendered, recommended
756
+ // eligibility surfaced, user override recorded).
757
+ path.join(REPO_ROOT, 'lib', 'memory', 'framework-chain-composer.test.cjs'),
758
+ // Phase 91-06: Larry dial (lib/core/nav-dial.cjs pure resolver +
759
+ // formatter; scripts/context-monitor integration). Statusline navigation
760
+ // indicator that renders three positions (Investigate | Blend | Insight)
761
+ // with the active position highlighted per Navigation Engine decision.
762
+ // 17 fixture tests: 12 pure-module (resolveDialPosition mapping across
763
+ // tier_0 / mode_b / mode_a weight bands, insight rationale detection,
764
+ // null + malformed graceful default, formatDialSegment Larry: prefix +
765
+ // 3-label render + < 60-char visible byte-budget, classifyHealth
766
+ // byte-identity with Plan 88.1-04 thresholds, sub-2ms warm-path perf)
767
+ // + 5 integration / canon audit (context-monitor renders dial when
768
+ // trace exists, context-monitor pre-91 byte-stable when no trace,
769
+ // spawned context-monitor wall-clock under cold-path budget, BSL 1.1
770
+ // header in nav-dial.cjs, Canon Part 8 source scan -- zero brain-client
771
+ // / fetch / curl / https references in dial source).
772
+ path.join(REPO_ROOT, 'lib', 'memory', 'nav-dial.test.cjs'),
773
+ // Phase 91-09: navigation-invariants validator (lib/memory/validators/
774
+ // navigation-invariants.cjs). Drop-in registry-compatible validator for
775
+ // the Phase 88-13 Feynman-MINTO guardian. Converts five silent Phase 91
776
+ // failure modes into first-class health signals at session-start /
777
+ // on-stop / pre-commit:
778
+ // INV-1 trace_missing_field any of 8 Section 8 brain_md_*
779
+ // fields absent from a persisted
780
+ // decision_trace -> error.
781
+ // INV-2 recommended_in_wrong_mode RECOMMENDED rendered in mode_b
782
+ // or tier_0 (Canon Part 3 Section 6
783
+ // requires mode_a) -> error.
784
+ // INV-3 weight_clamp_breach brain_md_weight_applied outside
785
+ // [0.0, 1.0] -> error.
786
+ // INV-4 trace_file_malformed decision-traces/*.json that fails
787
+ // JSON.parse -> error; sibling files
788
+ // continue to be scanned.
789
+ // INV-5 unknown_verb_passed fire_skill not in CANONICAL_VERBS
790
+ // (Canon Part 3 frozen 10-verb
791
+ // vocabulary) -> warning. Graceful
792
+ // when shared module unavailable.
793
+ // 16 tests: validator shape contract, severity_map coverage, INV-1..
794
+ // INV-5 positive + negative paths, session_file_absent info, registry
795
+ // integration via guardian on-stop + GUARDIAN_VALIDATORS_DIR, fail-open
796
+ // inheritance from Phase 88-13 (malformed sibling does NOT prevent
797
+ // navigation-invariants), Canon Part 8 source scan (zero network
798
+ // surface; brain-client / fetch / smartSearch all forbidden), BSL 1.1
799
+ // header. scope='room' per Phase 88-13 scope-mode dispatch (navigation
800
+ // is cross-section). Zero guardian.cjs edits required (extensibility
801
+ // promise of the Phase 88-13 registry contract is honored).
802
+ path.join(REPO_ROOT, 'lib', 'memory', 'navigation-invariants.test.cjs'),
803
+ // Phase 94-01: statusline active-room read contract. lib/core/folder-
804
+ // memory.cjs getCurrentRoom() reads STATE.md frontmatter current_room
805
+ // field; scripts/context-monitor consumes it as the canonical source so
806
+ // /mos:rooms switches propagate to the bottom-of-screen indicator on
807
+ // the next prompt cycle (Lawrence reproducer fence). 8 fixture tests:
808
+ // missing STATE.md null path, STATE.md without frontmatter null path,
809
+ // frontmatter without current_room null path, happy-path triple shape,
810
+ // malformed YAML graceful null path, no-caching switch reproducer,
811
+ // quote / whitespace stripping across 5 variants, end-to-end context-
812
+ // monitor stdout substring contains the switched-room slug. Canon
813
+ // Part 7 (reuse readQuadruple's frontmatter parser; no new YAML lib).
814
+ // Canon Part 4 (statusline is read-only derived view; STATE.md
815
+ // frontmatter remains canonical write surface).
816
+ path.join(REPO_ROOT, 'lib', 'memory', 'statusline-active-room.test.cjs'),
817
+ // Phase 94-02: rs-discovery-engine thesis-merge handoff fence. Producer
818
+ // scripts/rs-discovery-engine.cjs Phase 4 Synthesis loop folds theses[i]
819
+ // into breakthroughs[i] before writerPayload selection (success branch),
820
+ // and the empty-fallback envelope carries thesis: 'no_thesis' sentinel
821
+ // (deviation from plan locked-decision object stub; consumer
822
+ // validateRequiredFields requires non-empty string per rs-sqlite-mirror
823
+ // line 121-130). 3 fixture tests: success-path merge, empty-path stub,
824
+ // E2E tier 0 sqlite row write. Canon Part 7 (compose existing
825
+ // thesisGenerator output without touching consumer schema authority).
826
+ // Canon Part 4 (RSDiscovery write surface unblocked).
827
+ path.join(REPO_ROOT, 'lib', 'memory', 'rs-discovery-engine.test.cjs'),
828
+ // Phase 94-03: canonical Brain MCP server-name resolution fence. v1.11.0
829
+ // QA found Brain unreachable from /mos:* commands because plugin command
830
+ // frontmatter declared 3 inconsistent server-name prefixes (mcp__neo4j-
831
+ // brain__, mcp__mindrian-brain__, mcp__pinecone-brain__) while .mcp.json
832
+ // declared only `mindrian-os`. Plan 94-03 selects QA Option A: standardize
833
+ // on `mindrian-brain` across all 10 affected commands + document the
834
+ // user-side .mcp.json snippet in docs/install/BRAIN-SETUP.md. 5 fixture
835
+ // tests: T1 every brain reference in allowed-tools uses canonical
836
+ // prefix, T2 zero mcp__neo4j-brain__ references remain, T3 zero
837
+ // mcp__pinecone-brain__ references remain, T4 BRAIN-SETUP.md exists
838
+ // with mindrian-brain + mcpServers substrings, T5 frontmatter-schema-
839
+ // validator runnable smoke. Canon Part 7 (cheapest sweep; no alias
840
+ // system, no auto-detect). Canon Part 8 (Brain query chokepoint
841
+ // unchanged; only the resolved server name standardizes).
842
+ path.join(REPO_ROOT, 'lib', 'memory', 'brain-server-resolution.test.cjs'),
843
+ // Phase 94-04: mcp-server-brain dependency + drift fence. v1.11.0 P0
844
+ // ship-blocker: bundled mcp-server-brain/ cannot start because npm
845
+ // install never runs in that subdirectory and required env vars
846
+ // (SUPABASE_URL, MINDRIAN_BRAIN_KEY, etc.) are silently absent. Plan
847
+ // 94-04 ships three layers of safety: T1 install.sh post-install hook
848
+ // (cd mcp-server-brain && npm install) wrapped in package.json
849
+ // existence guard for Tier 0 graceful skip; T2 .env.brain.template
850
+ // lists all 7 required env vars (SUPABASE_URL / SUPABASE_KEY /
851
+ // MINDRIAN_BRAIN_KEY / NEO4J_URI / NEO4J_USERNAME / NEO4J_PASSWORD /
852
+ // PINECONE_API_KEY) one per line with comments; T3 scripts/session-
853
+ // start emits a yellow WARN line when MINDRIAN_BRAIN_KEY is set but
854
+ // canonical 'mindrian-brain' is absent from .mcp.json (this repo) OR
855
+ // the user's personal .mcp.json (loud yellow signal beats silent
856
+ // tier_0 fallback); T4 docs/install/BRAIN-SETUP.md gains a
857
+ // 'Bundled mcp-server-brain (optional/legacy)' section noting that
858
+ // v1.11.2 deprecates the bundled server in favor of users pointing
859
+ // 'mindrian-brain' at their own Neo4j MCP (Plan 94-03 Option A).
860
+ // Canon Part 7 (extends existing chokepoints install.sh + session-
861
+ // start; no new orchestration). Canon Part 8 (drift check is LOCAL-
862
+ // only: env var existence + .mcp.json file inspection; zero network
863
+ // surface added).
864
+ path.join(REPO_ROOT, 'lib', 'memory', 'mcp-server-brain-deps.test.cjs'),
865
+ // Phase 94-05: mcp-stack fallback chain fixture suite. v1.11.0 P0
866
+ // architectural ship-blocker: per the user-approved plan amendment
867
+ // (commit 66a1a34), rs-fetcher-industry is the TRUE Tavily-only gap
868
+ // (one source, TAVILY_API_KEY required). T1 industry happy paid path
869
+ // (opts.tavily injection seam returns paid envelope); T2 native
870
+ // fallback (no key, opts.webSearch returns native envelope); T3
871
+ // cache fallback (no key, no webSearch, opts.cacheReader returns
872
+ // cache envelope); T4 all-tiers-down empty results, never throws;
873
+ // T5 envelope shape uniformity across academic + patents + experts
874
+ // with backward-compat domain keys (papers / patents / experts)
875
+ // preserved alongside results; T6 lib/core/section-8-trace-schema.cjs
876
+ // exports web_research_tier per Phase 91 forward-additive invariant;
877
+ // T7 commands/research.md body removes the "Requires Brain MCP"
878
+ // hard-stop and "Then stop." directive that blocks fresh installs.
879
+ // Canon Part 4 (tier transitions become graph data via web_research_
880
+ // tier edge); Part 7 (extends Phase 89.2 fetchers with envelope
881
+ // wrap; reuses Anthropic native WebSearch + WebFetch instead of
882
+ // building a new client); Part 8 (WebSearch + WebFetch are public-
883
+ // domain SIGNAL queries; existing brain-client chokepoint untouched;
884
+ // no new Brain endpoints).
885
+ path.join(REPO_ROOT, 'lib', 'memory', 'mcp-stack-fallback.test.cjs'),
886
+ // Phase 94-06: room classifier strict-mode fence. Lawrence Aronhime's
887
+ // 2026-04-28 38-min live test with 2 rooms loaded
888
+ // (core-power-isolation + curriculum-redesign-fall-2026) had four
889
+ // utterances resolve to the WRONG room because the classifier ran a
890
+ // similarity heuristic only and core-power-isolation had high token
891
+ // overlap with everything. Plan 94-06 inserts a strict-mode override
892
+ // at the top of the room-resolution path: numeric ('8', 'switch to 2')
893
+ // -> registry position; explicit slug ('curriculum-redesign-fall-2026',
894
+ // '/mos:rooms <slug>') -> exact slug match; quoted exact name
895
+ // ('"Beta"', '"Curriculum Redesign Fall 2026"') -> name OR slug exact.
896
+ // Each match emits a Section-8 trace edge `routing_source: 'strict_mode'`
897
+ // per Canon Part 4. 6 fixture tests: T1 numeric, T2 explicit slug,
898
+ // T3 quoted name, T4 routing_source assertion + STRICT_MODE_ROUTING_
899
+ // SOURCE constant export, T5 fallthrough regression fence (no strict-
900
+ // mode pattern -> null, similarity heuristic unchanged), T6 Lawrence
901
+ // reproducer (3 strict + 1 known-deferred to v1.11.3 for natural-
902
+ // language 'the curriculum room'). Canon Part 3 (10-verb vocabulary
903
+ // preserved; strict-mode is a routing override, not a new verb).
904
+ // Canon Part 4 (override emits graph edge). Canon Part 7 (extends
905
+ // existing scripts/intent-classifier.cjs without introducing a new
906
+ // classifier file).
907
+ path.join(REPO_ROOT, 'lib', 'memory', 'room-classifier-strict-mode.test.cjs'),
908
+ // Phase 94.1-01: /mos:heal command orchestrator fence. The /mos:heal
909
+ // command wraps the 10-step room wiring heal recipe dog-fooded on the
910
+ // mindrianOS room on 2026-04-29 (recipe at ~/MindrianRooms/mindrianOS/
911
+ // methodology/2026-04-29-v1-11-0-room-wiring-heal-process.md). This
912
+ // fixture is the v1.11.1 GA closing artifact: any user upgrading from
913
+ // v1.10.x to v1.11.x can self-heal their room without manual
914
+ // intervention. 6 fixture tests: T1 dry-run on degraded fixture
915
+ // (10-step plan, zero mutation), T2 full heal post-conformance
916
+ // (8 canonical sections + every section ROOM.md + STATE.md +
917
+ // .mindrian/room.db nodes COUNT > 0 + root STATE.md regenerated +
918
+ // backup populated), T3 heal-log envelope shape (one entry per step;
919
+ // 10 keys per entry; summary present), T4 backup created (timestamp
920
+ // YYYYMMDD-HHMMSS pattern + pre-heal STATE.md verbatim), T5
921
+ // mega-section graceful degradation (FEYNMINTO-01 budget rejection
922
+ // logged not thrown; tier-0 fallback + continue), T6 idempotence
923
+ // (heal twice; second run zero error_* statuses). Canon Part 7
924
+ // (Reuse Before Build): wraps existing scripts/migrate-lazygraph.cjs
925
+ // + scripts/vault-section-state-generator.cjs + scripts/vault-section-
926
+ // minto-generator.cjs + scripts/compute-state without net-new
927
+ // methodology. Canon Part 4 (Every Choice Is Graph Data): heal-log.json
928
+ // captures the full cascade. Canon Part 8 (Graph Boundary): heal is
929
+ // LOCAL-only; brain-derivation-queue is read but NEVER drained inside
930
+ // heal (drain deferred to v1.12 candidate plan).
931
+ path.join(REPO_ROOT, 'lib', 'memory', 'heal-command.test.cjs'),
932
+ // Phase 99-01: conversation operator state machine (lib/conversation/
933
+ // operator.cjs). Foundational deliverable for Phase 99 conversation
934
+ // operator state machine + downstream consumers (Phase 100 JTBD
935
+ // classifier, Phase 102 renderer, Phase 95.1 polling, Sprites
936
+ // Workspace v2.0). 12 scenarios covering the validation architecture
937
+ // dimensions from 99-RESEARCH.md: cold-start default (D-04), resume
938
+ // from disk (D-05/D-06), schema_version-first ordering (D-06), valid
939
+ // transitions (D-08), invalid-transition rejection without partial
940
+ // write (D-09), DECISION_GATE -> previous (D-08), history bounded at
941
+ // 50 with drop-oldest (D-26), atomic write rollback when rename
942
+ // throws (D-07), frame budget getCurrent < 2ms / transition < 10ms
943
+ // (D-23/D-24), Canon Part 8 grep audit on operator.cjs source
944
+ // (D-22), OPERATOR_TRANSITION edge graceful skip when graph absent,
945
+ // and OPERATOR_TRANSITION edge written when graph exists with
946
+ // properties.trigger + timestamp + methodology (Canon Part 4 + D-21).
947
+ // Self-contained: copies fixtures from test/fixtures/conversation-
948
+ // operator/ to os.tmpdir() so committed fixtures are never mutated.
949
+ // Zero new runtime dependencies (Phase 87 invariant).
950
+ path.join(REPO_ROOT, 'tests', 'test-operator-state.cjs'),
951
+ // Phase 102-01: renderer contract regression fence. 12 IIFE
952
+ // assertions covering the 5-operator round-trip via the v2
953
+ // destructured API (JUST_TALK is the explicit suppress case via
954
+ // operator gate; the other 4 compose normally), undefined / null
955
+ // operator do not crash, unknown operator strings are tolerated
956
+ // (Phase 102 deliberately drops the 99-03 throw so upstream callers
957
+ // can route arbitrary strings without try/catch wrappers), envelope
958
+ // shape stable (exactly 2 keys: rendered + contract; no _stub leak),
959
+ // mode passthrough (A / B / tier-0 + arbitrary unchanged), tier
960
+ // passthrough (0 / 1 / 2 / 3 + arbitrary unchanged), and OPERATORS
961
+ // export frozen + equals 5 canonical names. Replaces the Phase 99-03
962
+ // stub fence at the same registration slot; Plan 102-01 evolves the
963
+ // renderer signature from positional 4-arg to a destructured single-
964
+ // arg API per CONTEXT D-10 and RESEARCH §2.
965
+ path.join(REPO_ROOT, 'lib', 'render', 'render-v2.test.cjs'),
966
+ // Phase 99-05: /mos:operator command. Tests show/history/set/reset
967
+ // subcommands, --json paths, Tier 0 fallback, UI Ruling System self-
968
+ // compliance (12-glyph + 5-color + 4-zone + Shape E + Shape F.1 + Shape
969
+ // F.4), Canon Part 8 audit (zero Brain queries), frame budget (50
970
+ // invocations < 500ms mean), and commands/operator.md frontmatter scan.
971
+ // Depends on Phase 99-01 lib/conversation/operator.cjs at runtime;
972
+ // integration tests skip-as-fail until 99-01 lands in the merged tree.
973
+ path.join(REPO_ROOT, 'tests', 'test-operator-command.cjs'),
974
+ // Phase 99-02: heuristic NL classifier for the conversation operator state
975
+ // machine. Five gates: T1 corpus accuracy >= 80% on the 50-message hand-
976
+ // labeled fixture under test/fixtures/conversation-operator/classifier-
977
+ // corpus.json (D-25); T2 frame budget mean < 8ms on a 200-char benchmark
978
+ // (D-23 corollary, 5ms target with CI headroom); T3 tier-0 fallback when
979
+ // classifier-rules.json is missing (Decision #8 -- spawn fresh node child
980
+ // because module cache hides reload); T4 validate-cross-check between
981
+ // classifier candidate_op + suggested_trigger and operator.cjs validate()
982
+ // (every classifier output is operationally consistent with the state
983
+ // machine); T5 boundary conditions (empty input, /mos:operator and
984
+ // /mos:status target_op:null markers, /mos:room beats general /mos:
985
+ // METHODOLOGY due to JSON-array ordering, AskUserQuestion -> DECISION_GATE
986
+ // 1.0, EXPLORE_CAPTURE + "let's file this" -> BUILD_ROOM per D-08, null
987
+ // input -> tier-0). Canon Part 8 (LOCAL only): zero Brain queries, zero
988
+ // external requires, pure local string matching. Canon Part 7 (Reuse
989
+ // Before Build): externalized lexicon JSON tunable without code edits.
990
+ path.join(REPO_ROOT, 'tests', 'test-operator-classifier.cjs'),
991
+ // Phase 99-04: operator-aware hooks integration. 12 scenarios covering
992
+ // SessionStart resume hint when state.current === 'BUILD_ROOM' AND
993
+ // state.context.active_section is set (D-18); UserPromptSubmit
994
+ // classifier-driven transitions per D-11/D-12 (heuristic threshold 0.6);
995
+ // PostToolUse AskUserQuestion -> DECISION_GATE with decision_gate_pending
996
+ // set (D-20); active-room guard mirroring Phase 95 cascade-side-channel
997
+ // pattern (D-22 + Decision #15); sealed-room invariant (Phase 84-07 /
998
+ // Decision #15); envelope schema strict per Phase 95 BASH-95-01
999
+ // (top-level allowlist; additionalContext only inside hookSpecificOutput);
1000
+ // frame budget < 250ms mean per spawnSync invocation (50ms script + spawn
1001
+ // cost); hook never blocks on malformed stdin / missing hook_event_name /
1002
+ // missing registry / throwing classifier (defensive catch-all). Canon
1003
+ // Part 8: zero Brain queries. Self-contained: each test creates its own
1004
+ // tmp dir and tears it down via fs.rmSync in finally. Zero new runtime
1005
+ // dependencies (Phase 87 invariant).
1006
+ path.join(REPO_ROOT, 'tests', 'test-operator-hooks.cjs'),
1007
+ // Phase 100-03: per-room JTBD state I/O at .mindrian/jtbd-state.json.
1008
+ // 9 assertion classes covering round-trip identity, atomic tmp+rename
1009
+ // (no orphans across many writes), history bounded at 50 with FIFO
1010
+ // drop-oldest, 24h staleness rule (entered_at + expires_at branches),
1011
+ // manual override expires_at = entered_at + 24h, manual block on auto
1012
+ // write (auto_blocked_by_manual history row, current unchanged), per-
1013
+ // room isolation (two tmpdirs, zero cross-leakage on jtbd + history +
1014
+ // path), graceful errors (missing dir + corrupt JSON + bad opts return
1015
+ // null/no-op without throw), and Canon Part 8 source audit (zero
1016
+ // forbidden tokens in lib/hmi/jtbd-state.cjs). Self-contained: every
1017
+ // test makes a fresh tmp room and tears it down in finally. Zero new
1018
+ // runtime dependencies (Phase 87 invariant).
1019
+ path.join(REPO_ROOT, 'tests', 'test-jtbd-state-io.cjs'),
1020
+ // Phase 100-01: JTBD taxonomy schema validation. 13 canonical entries
1021
+ // (12 first-class + explore fallback), each with detector + verb table
1022
+ // per RESEARCH §2.
1023
+ path.join(REPO_ROOT, 'tests', 'test-jtbd-taxonomy.cjs'),
1024
+ // Phase 100-02: heuristic JTBD classifier (no LLM). Three weighted strata
1025
+ // (token cues 0.5, operator affinity 0.3, recency 0.2). Confidence
1026
+ // threshold 0.6 mirrors Phase 99 classifier. Frame budget < 5ms.
1027
+ path.join(REPO_ROOT, 'tests', 'test-jtbd-classifier.cjs'),
1028
+ // Phase 100-04 (wave 2 stub): /mos:jtbd command. Filled when 100-04 ships.
1029
+ path.join(REPO_ROOT, 'tests', 'test-jtbd-command.cjs'),
1030
+ // Phase 103-04: /mos:memory command (HMI-103-03). 12 assertion classes
1031
+ // covering 6 subcommands (overview / query / cross-room / resume / park /
1032
+ // complete) + opt-out gate + Cowork warning + 95.1 UI compliance + Zone 1
1033
+ // header pattern. Hermetic via MINDRIAN_ROOMS_HOME tmp root + Brain stub
1034
+ // injected via cross-room-memory __setBrainClient seam. Tests Mode A/B
1035
+ // tier-awareness + Phase 101 graceful fallback (Shape G -> Shape E note,
1036
+ // Shape F.6 -> F.1 fallback).
1037
+ path.join(REPO_ROOT, 'tests', 'test-memory-command.cjs'),
1038
+ // Phase 100-04 (wave 2 stub): UI Ruling System self-compliance. Filled when 100-04 ships.
1039
+ path.join(REPO_ROOT, 'tests', 'test-jtbd-ui-self-compliant.cjs'),
1040
+ // Phase 100-05 (wave 2 stub): hook integration. Filled when 100-05 ships.
1041
+ path.join(REPO_ROOT, 'tests', 'test-jtbd-hook-integration.cjs'),
1042
+ // Phase 101-01: Shape F.6 (JTBD-aware Next Move) renderer. JTBD signal
1043
+ // selects which verbs render; F.1's keyboard layer is reused. 7-assertion
1044
+ // IIFE harness covers happy path, fallthrough (jtbd null/unknown/<3 verbs),
1045
+ // taxonomy missing graceful, and 12-glyph audit.
1046
+ path.join(REPO_ROOT, 'tests', 'test-shape-f6.cjs'),
1047
+ // Phase 101-02: Shape G (Comparison Matrix) renderer. Render-only in v1;
1048
+ // interactive table picking deferred to v1.15.x. 7-assertion suite covers
1049
+ // valid_matrix, degenerate_fallthrough, cell_clamping, criterion_clamping,
1050
+ // glyph_audit, zone4_present, zone1_dimensions.
1051
+ path.join(REPO_ROOT, 'tests', 'test-shape-g.cjs'),
1052
+ // Phase 101-03: Shape H (Timeline / Roadmap) renderer. Horizontal time
1053
+ // axis + ■ milestone markers + label rows. ASCII-art only, 12-glyph
1054
+ // compliance, Canon Part 3 Rule 2 error envelope on empty/reversed dates.
1055
+ path.join(REPO_ROOT, 'tests', 'test-shape-h.cjs'),
1056
+ // Phase 101-04: selector-dispatcher single integration point. Discriminates
1057
+ // F.6 returns ({ zones, contract } | { fallthrough } | { error }) and routes
1058
+ // fallthroughs to F.1 fallback. 9 assertions cover happy paths, fallthroughs,
1059
+ // pass-through shapes, malformed payload no-throw, and Free-Text defense.
1060
+ path.join(REPO_ROOT, 'tests', 'test-selector-dispatcher.cjs'),
1061
+ // Phase 101-05: Mode A/B/Tier 0 graceful degradation across F.6 + G + H.
1062
+ // Mode A renders RECOMMENDED markers (Brain reachable, confidence >= 0.7);
1063
+ // Mode B suppresses markers + renders "Brain unreachable" warning; Tier 0
1064
+ // renders hardcoded minimal option set.
1065
+ path.join(REPO_ROOT, 'tests', 'test-shape-f6-mode-b.cjs'),
1066
+ // Phase 88.2 Wave-0: 6 selector-block stubs (5 sub-shapes F.1-F.5 +
1067
+ // telemetry). Filled by 88.2-01..03 plans which replace stubs with real
1068
+ // bodies WITHOUT changing registered paths below.
1069
+ path.join(REPO_ROOT, 'tests', 'test-shape-f1.cjs'),
1070
+ path.join(REPO_ROOT, 'tests', 'test-shape-f2.cjs'),
1071
+ path.join(REPO_ROOT, 'tests', 'test-shape-f3.cjs'),
1072
+ path.join(REPO_ROOT, 'tests', 'test-shape-f4.cjs'),
1073
+ path.join(REPO_ROOT, 'tests', 'test-shape-f5.cjs'),
1074
+ path.join(REPO_ROOT, 'tests', 'test-selector-telemetry.cjs'),
1075
+ // Phase 88.2-04: operator-aware dispatcher integration. F.1..F.5 sub-shape
1076
+ // dispatch + JUST_TALK refuse (render_v2_compaction_violation) + telemetry
1077
+ // emission opt-in (Canon Part 8 fs_scope guard) + AskUserQuestion structural-
1078
+ // marker trailer. 19 assertions; sits beside Phase 101-04's 9-test contract.
1079
+ path.join(REPO_ROOT, 'tests', 'test-selector-dispatcher-88-2-04.cjs'),
1080
+ // Phase 88.2-00 Wave-0: telemetry dual-surface stub. Plan 88.2-03 populates with
1081
+ // real assertions (JSONL primary + memory_event mirror via 4 new EVENT_TYPES).
1082
+ path.join(REPO_ROOT, 'tests', 'test-selector-telemetry-dual-surface.cjs'),
1083
+ // Phase 88.2-05: F.0 Mini Decision Gate renderer + REJECTED_BECAUSE edge contract.
1084
+ // 16 node:test assertions covering 3-verb closed-vocab, persona-AGNOSTIC,
1085
+ // border_style:'single', parent_decision_id pass-through, and graceful-fail
1086
+ // edge helper writing eventType 'selector_rejection_captured' via Phase 109.
1087
+ path.join(REPO_ROOT, 'tests', 'test-shape-f0.cjs'),
1088
+ // Phase 88.2-05: dispatcher F.0 integration. F_SUBSHAPES extended with 'F.0';
1089
+ // dispatch case routes to renderShapeF0; JUST_TALK refuse inheritance verified;
1090
+ // closed-vocab carve-out preserved; AskUserQuestion trailer attached.
1091
+ path.join(REPO_ROOT, 'tests', 'test-selector-dispatcher-88-2-05.cjs'),
1092
+ // Phase 88.2-06: decoy-tier dispatcher (Tier 0/1/2 + 5 perturbation axes
1093
+ // round-robin + topic-coverage backstop + decoy_opt_out preference) plus
1094
+ // F.6 Plan Review Round renderer at the collision-safe path
1095
+ // lib/hmi/shape-f6-plan-review-renderer.cjs (R1 invariant -- Phase 101-01
1096
+ // shape-f6-renderer.cjs sha256 byte-equal pre/post). Dispatcher F_SUBSHAPES
1097
+ // extended with 'F.6'; explicit requestedShape:'F.6' routes to the new
1098
+ // plan-review renderer; umbrella 'F' branch unchanged.
1099
+ path.join(REPO_ROOT, 'tests', 'test-decoy-tier.cjs'),
1100
+ path.join(REPO_ROOT, 'tests', 'test-shape-f6-plan-review.cjs'),
1101
+ path.join(REPO_ROOT, 'tests', 'test-selector-dispatcher-88-2-06.cjs'),
1102
+ // Phase 104 Wave-0: 3 per-command JTBD declaration stubs. Filled by
1103
+ // plans 104-02 (declarations + coverage) + 104-03 (backward-compat fence).
1104
+ path.join(REPO_ROOT, 'tests', 'test-command-jtbd-declarations.cjs'),
1105
+ path.join(REPO_ROOT, 'tests', 'test-command-jtbd-coverage.cjs'),
1106
+ path.join(REPO_ROOT, 'tests', 'test-command-jtbd-backward-compat.cjs'),
1107
+ // Phase 102-00 Wave-0: 5 render-v2 contract stubs. Plan 102-01 swaps in
1108
+ // the assertion bodies WITHOUT changing the registered paths below.
1109
+ // Mapping to RENDER-102-* requirement IDs:
1110
+ // test-render-v2-signature.cjs -> RENDER-102-01 import surface
1111
+ // test-render-v2-compaction.cjs -> RENDER-102-02 operator-aware compaction
1112
+ // test-render-v2-jtbd-zone4.cjs -> RENDER-102-03 JTBD-aware Zone 4
1113
+ // test-render-v2-provenance.cjs -> RENDER-102-04 _provenance envelope
1114
+ // test-render-v2-color-overlay.cjs -> RENDER-102-05 5-color overlay
1115
+ // Phase 99-03 import surface (lib/render/render-v2.test.cjs above) remains
1116
+ // the byte-stability fence per RENDER-102-06.
1117
+ path.join(REPO_ROOT, 'tests', 'test-render-v2-signature.cjs'),
1118
+ path.join(REPO_ROOT, 'tests', 'test-render-v2-compaction.cjs'),
1119
+ path.join(REPO_ROOT, 'tests', 'test-render-v2-jtbd-zone4.cjs'),
1120
+ path.join(REPO_ROOT, 'tests', 'test-render-v2-provenance.cjs'),
1121
+ path.join(REPO_ROOT, 'tests', 'test-render-v2-color-overlay.cjs'),
1122
+ // Phase 103 — Memory Continuity Layer (within-session + across-session + cross-room)
1123
+ path.join(REPO_ROOT, 'tests', 'test-across-session-memory.cjs'),
1124
+ path.join(REPO_ROOT, 'tests', 'test-cross-room-memory.cjs'),
1125
+ path.join(REPO_ROOT, 'tests', 'test-cross-room-memory-schema-leak.cjs'),
1126
+ path.join(REPO_ROOT, 'tests', 'test-memory-command.cjs'),
1127
+ path.join(REPO_ROOT, 'tests', 'test-memory-hook-integration.cjs'),
1128
+ // Phase 105 — HMI Compliance Polling
1129
+ path.join(REPO_ROOT, 'tests', 'test-hmi-poll-primitive.cjs'),
1130
+ path.join(REPO_ROOT, 'tests', 'test-hmi-status-command.cjs'),
1131
+ path.join(REPO_ROOT, 'tests', 'test-hmi-poll-hook.cjs'),
1132
+ path.join(REPO_ROOT, 'tests', 'test-hmi-compliance-e2e.cjs'),
1133
+ // Phase 106-00: Wave 0 statusline visibility test stubs (10 stubs).
1134
+ // Each stub exits 0 with the canonical Wave 0 message; downstream plans
1135
+ // (106-01..106-05) replace stubs with real tests as their owning plan
1136
+ // lands. Registry membership ensures the full suite always sees Phase 106
1137
+ // tests from Wave 0 onward.
1138
+ path.join(REPO_ROOT, 'tests', 'test-stale-settings-migration.cjs'),
1139
+ path.join(REPO_ROOT, 'tests', 'test-context-monitor-d02-broadcast.cjs'),
1140
+ path.join(REPO_ROOT, 'tests', 'test-statusline-glyph-isolation.cjs'),
1141
+ path.join(REPO_ROOT, 'tests', 'test-doctor-class-g.cjs'),
1142
+ path.join(REPO_ROOT, 'tests', 'test-doctor-class-g-fix.cjs'),
1143
+ path.join(REPO_ROOT, 'tests', 'test-statusline-banner-suppression.cjs'),
1144
+ path.join(REPO_ROOT, 'tests', 'test-fallback-echo-compose.cjs'),
1145
+ path.join(REPO_ROOT, 'tests', 'test-fallback-echo-30day.cjs'),
1146
+ path.join(REPO_ROOT, 'tests', 'test-onboarding-gate.cjs'),
1147
+ path.join(REPO_ROOT, 'tests', 'test-surface-detect.cjs'),
1148
+ // Phase 108-00: Wave 0 graph-memory-schema-reconciliation test stubs (7 stubs).
1149
+ // Each stub exits 0 with the canonical Wave 0 message; downstream plans
1150
+ // (108-01..108-06) replace stubs with real tests as their owning plan
1151
+ // lands. test-part-9-invariant.cjs is a CROSS-PHASE dependency - remains
1152
+ // a stub through all of Phase 108; lights up only after Phase 109 ships
1153
+ // the nodes.review_status column. Registry membership ensures the full
1154
+ // suite always sees Phase 108 tests from Wave 0 onward. Mapping:
1155
+ // test-reconciliation-table-completeness.cjs -> 108-01 (D-01 nodes + edges)
1156
+ // test-provenance-contract-schema.cjs -> 108-02 (D-02 contract)
1157
+ // test-truth-state-taxonomy.cjs -> 108-03 (D-03 8 states)
1158
+ // test-aliases-yaml-schema.cjs -> 108-04 (D-04 YAML)
1159
+ // test-precommit-hook-aliases.cjs -> 108-05 (D-05 hook)
1160
+ // test-canon-crossref-completeness.cjs -> 108-06 (D-06 cross-refs)
1161
+ // test-part-9-invariant.cjs -> 108-09 (Phase 109 dep)
1162
+ path.join(REPO_ROOT, 'tests', 'test-reconciliation-table-completeness.cjs'),
1163
+ path.join(REPO_ROOT, 'tests', 'test-provenance-contract-schema.cjs'),
1164
+ path.join(REPO_ROOT, 'tests', 'test-truth-state-taxonomy.cjs'),
1165
+ path.join(REPO_ROOT, 'tests', 'test-aliases-yaml-schema.cjs'),
1166
+ path.join(REPO_ROOT, 'tests', 'test-precommit-hook-aliases.cjs'),
1167
+ path.join(REPO_ROOT, 'tests', 'test-canon-crossref-completeness.cjs'),
1168
+ path.join(REPO_ROOT, 'tests', 'test-part-9-invariant.cjs'),
1169
+ // Phase 89-07 Wave 0 (graph-native HARD RULE; ReverseSalientAgent dual-surface).
1170
+ path.join(REPO_ROOT, 'tests', 'test-reverse-salient-agent.cjs'),
1171
+ path.join(REPO_ROOT, 'tests', 'test-reverse-salient-cascade-emit.cjs'),
1172
+ path.join(REPO_ROOT, 'tests', 'test-reverse-salient-f0-integration.cjs'),
1173
+ path.join(REPO_ROOT, 'tests', 'test-reverse-salient-persona.cjs'),
1174
+ path.join(REPO_ROOT, 'tests', 'test-reverse-salient-telemetry.cjs'),
1175
+ // Phase 116-00 Wave 0 (graph-native HARD RULE; unresolved-tension-hook dual-surface
1176
+ // telemetry mirror per memory feedback_reverse_salient_agent_graph_native.md rule 3).
1177
+ // 5 stubs RED in Wave 0; flip GREEN as 116-01 (detection), 116-02 (F.1 surface),
1178
+ // 116-03 (decay state machine), 116-04 (telemetry + release) modules land.
1179
+ path.join(REPO_ROOT, 'tests', 'test-tension-hook-detection.cjs'),
1180
+ path.join(REPO_ROOT, 'tests', 'test-tension-hook-f1-integration.cjs'),
1181
+ path.join(REPO_ROOT, 'tests', 'test-tension-hook-decay.cjs'),
1182
+ path.join(REPO_ROOT, 'tests', 'test-tension-hook-telemetry.cjs'),
1183
+ path.join(REPO_ROOT, 'tests', 'test-tension-hook-rendering.cjs'),
1184
+ // Phase 117-00 Wave 0 (graph-native HARD RULE; auto-explore-domains dual-surface
1185
+ // telemetry mirror per memory feedback_reverse_salient_agent_graph_native.md rule 3).
1186
+ // 12 stubs RED in Wave 0; flip GREEN as 117-01 (detection), 117-02 (compose),
1187
+ // 117-03 (F.1 surface + HSI schema + BQ template), 117-04 (sanitizer + LOCAL-only routing),
1188
+ // 117-05 (telemetry + brain-canon-drift + release) modules land.
1189
+ // Section 5 Validation Architecture (6 stubs):
1190
+ path.join(REPO_ROOT, 'tests', 'test-auto-explore-event-types.cjs'),
1191
+ path.join(REPO_ROOT, 'tests', 'test-auto-explore-fingerprint.cjs'),
1192
+ path.join(REPO_ROOT, 'tests', 'test-explored-materials-store.cjs'),
1193
+ path.join(REPO_ROOT, 'tests', 'test-auto-explore-fire.cjs'),
1194
+ path.join(REPO_ROOT, 'tests', 'test-auto-explore-compose.cjs'),
1195
+ path.join(REPO_ROOT, 'tests', 'test-auto-explore-f1-integration.cjs'),
1196
+ // Section 8 Brain Substrate enrichment (6 net-new stubs from Brain Cypher 2026-05-06):
1197
+ path.join(REPO_ROOT, 'tests', 'test-auto-explore-canonical-order.cjs'),
1198
+ path.join(REPO_ROOT, 'tests', 'test-cross-domain-formula.cjs'),
1199
+ path.join(REPO_ROOT, 'tests', 'test-finding-hsi-schema.cjs'),
1200
+ path.join(REPO_ROOT, 'tests', 'test-f1-bq-template.cjs'),
1201
+ path.join(REPO_ROOT, 'tests', 'test-detection-routing-local-only.cjs'),
1202
+ path.join(REPO_ROOT, 'tests', 'test-brain-canon-drift-event.cjs'),
1203
+ // Phase 122-01 Wave 0 (workflow layer -- framework <-> command registry).
1204
+ // Stubs RED-of-design until their owning plan lands: command-resolver fills
1205
+ // in 122-03; command-registry fills in 122-02. Both stay at this registered
1206
+ // path; the downstream plan swaps the implementation in without moving it.
1207
+ path.join(REPO_ROOT, 'lib', 'workflow', 'command-resolver.test.cjs'),
1208
+ path.join(REPO_ROOT, 'lib', 'memory', 'command-registry.test.cjs'),
1209
+ // Phase 122-03: the chain recommender (recommendFrameworkChain via FEEDS_INTO).
1210
+ path.join(REPO_ROOT, 'lib', 'memory', 'chain-recommender.test.cjs'),
1211
+ ];
1212
+
1213
+ // Exit code convention for child tests:
1214
+ // 0 -> PASS
1215
+ // 77 -> SKIPPED (POSIX test-infra-broken; e.g. missing python3, missing
1216
+ // scripts/classify-insight). Must NOT count as failure.
1217
+ // other (including 1) -> FAIL.
1218
+ let failed = 0;
1219
+ let skipped = 0;
1220
+ for (const t of TEST_FILES) {
1221
+ const rel = path.relative(REPO_ROOT, t);
1222
+ if (!fs.existsSync(t)) {
1223
+ process.stderr.write('MISS ' + rel + ' (file does not exist)\n');
1224
+ failed += 1;
1225
+ continue;
1226
+ }
1227
+ const res = spawnSync(process.execPath, [t], { stdio: 'inherit' });
1228
+ if (res.status === 0) {
1229
+ process.stdout.write('PASS ' + rel + '\n');
1230
+ } else if (res.status === 77) {
1231
+ process.stdout.write('SKIP ' + rel + ' (exit 77, env degraded)\n');
1232
+ skipped += 1;
1233
+ } else {
1234
+ process.stderr.write('FAIL ' + rel + ' (exit ' + res.status + ')\n');
1235
+ failed += 1;
1236
+ }
1237
+ }
1238
+
1239
+ const total = TEST_FILES.length;
1240
+ const passed = total - failed - skipped;
1241
+ process.stdout.write(
1242
+ '\nFeynman test runner: ' +
1243
+ passed + '/' + total + ' passed, ' +
1244
+ skipped + ' skipped, ' +
1245
+ failed + ' failed\n'
1246
+ );
1247
+ process.exit(failed === 0 ? 0 : 1);