@monoes/monomindcli 1.10.56 → 1.11.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (569) hide show
  1. package/.claude/agents/core/coordinator.md +71 -0
  2. package/.claude/agents/generated/case-analyst.md +50 -0
  3. package/.claude/agents/generated/copy-editor.md +45 -0
  4. package/.claude/agents/generated/court-reporter.md +50 -0
  5. package/.claude/agents/generated/defender.md +51 -0
  6. package/.claude/agents/generated/editor-in-chief.md +45 -0
  7. package/.claude/agents/generated/fact-checker.md +45 -0
  8. package/.claude/agents/generated/judge.md +51 -0
  9. package/.claude/agents/generated/prosecutor.md +51 -0
  10. package/.claude/agents/generated/reporter.md +45 -0
  11. package/.claude/commands/hooks/README.md +1 -1
  12. package/.claude/commands/hooks/overview.md +1 -1
  13. package/.claude/commands/mastermind/_repeat.md +1 -1
  14. package/.claude/commands/mastermind/do.md +3 -1
  15. package/.claude/commands/mastermind/help.md +2 -2
  16. package/.claude/commands/mastermind/master.md +39 -6
  17. package/.claude/commands/mastermind/memory.md +1 -1
  18. package/.claude/commands/memory/memory-search.md +2 -2
  19. package/.claude/commands/monitoring/status.md +1 -1
  20. package/.claude/commands/{browse.md → monobrowse.md} +2 -2
  21. package/.claude/commands/sparc.md +1 -1
  22. package/.claude/helpers/handlers/graph-status-handler.cjs +1 -1
  23. package/.claude/helpers/loop-tracker.cjs +1 -1
  24. package/.claude/skills/agent-browser-testing/SKILL.md +1 -1
  25. package/.claude/skills/hooks-automation/SKILL.md +0 -3
  26. package/.claude/skills/mastermind/build.md +1 -1
  27. package/.claude/skills/mastermind/code-quality-reviewer-prompt.md +60 -0
  28. package/.claude/skills/mastermind/content.md +1 -1
  29. package/.claude/skills/mastermind/createorg.md +79 -2
  30. package/.claude/skills/mastermind/design.md +3 -1
  31. package/.claude/skills/mastermind/finance.md +1 -1
  32. package/.claude/skills/mastermind/implementer-prompt.md +109 -0
  33. package/.claude/skills/mastermind/marketing.md +1 -1
  34. package/.claude/skills/mastermind/ops.md +1 -1
  35. package/.claude/skills/mastermind/plan.md +20 -2
  36. package/.claude/skills/mastermind/release.md +1 -1
  37. package/.claude/skills/mastermind/research.md +1 -1
  38. package/.claude/skills/mastermind/review.md +1 -1
  39. package/.claude/skills/mastermind/sales.md +1 -1
  40. package/.claude/skills/mastermind/spec-reviewer-prompt.md +63 -0
  41. package/.claude/skills/sparc-methodology/SKILL.md +3 -3
  42. package/.claude/skills/swarm-advanced/SKILL.md +1 -4
  43. package/README.md +18 -32
  44. package/dist/src/agents/registry-builder.d.ts +1 -7
  45. package/dist/src/agents/registry-builder.d.ts.map +1 -1
  46. package/dist/src/agents/registry-builder.js +10 -6
  47. package/dist/src/agents/registry-builder.js.map +1 -1
  48. package/dist/src/benchmarks/benchmark-runner.d.ts +59 -12
  49. package/dist/src/benchmarks/benchmark-runner.d.ts.map +1 -1
  50. package/dist/src/benchmarks/benchmark-runner.js +67 -13
  51. package/dist/src/benchmarks/benchmark-runner.js.map +1 -1
  52. package/dist/src/benchmarks/metric-evaluators.d.ts.map +1 -1
  53. package/dist/src/benchmarks/metric-evaluators.js.map +1 -1
  54. package/dist/src/benchmarks/pretrain/index.d.ts +0 -13
  55. package/dist/src/benchmarks/pretrain/index.d.ts.map +1 -1
  56. package/dist/src/benchmarks/pretrain/index.js.map +1 -1
  57. package/dist/src/commands/agent-wasm.d.ts +2 -2
  58. package/dist/src/commands/agent-wasm.js +5 -5
  59. package/dist/src/commands/agent.d.ts.map +1 -1
  60. package/dist/src/commands/agent.js +1 -6
  61. package/dist/src/commands/agent.js.map +1 -1
  62. package/dist/src/commands/analyze.d.ts +1 -1
  63. package/dist/src/commands/analyze.d.ts.map +1 -1
  64. package/dist/src/commands/analyze.js +8 -18
  65. package/dist/src/commands/analyze.js.map +1 -1
  66. package/dist/src/commands/doctor.d.ts.map +1 -1
  67. package/dist/src/commands/doctor.js +53 -3
  68. package/dist/src/commands/doctor.js.map +1 -1
  69. package/dist/src/commands/embeddings.d.ts.map +1 -1
  70. package/dist/src/commands/embeddings.js +9 -33
  71. package/dist/src/commands/embeddings.js.map +1 -1
  72. package/dist/src/commands/hooks.d.ts.map +1 -1
  73. package/dist/src/commands/hooks.js +24 -76
  74. package/dist/src/commands/hooks.js.map +1 -1
  75. package/dist/src/commands/index.d.ts +4 -6
  76. package/dist/src/commands/index.d.ts.map +1 -1
  77. package/dist/src/commands/index.js +8 -15
  78. package/dist/src/commands/index.js.map +1 -1
  79. package/dist/src/commands/init.js +2 -2
  80. package/dist/src/commands/init.js.map +1 -1
  81. package/dist/src/commands/issues.d.ts.map +1 -1
  82. package/dist/src/commands/issues.js +16 -11
  83. package/dist/src/commands/issues.js.map +1 -1
  84. package/dist/src/commands/mcp.d.ts +1 -1
  85. package/dist/src/commands/memory.js +6 -6
  86. package/dist/src/commands/memory.js.map +1 -1
  87. package/dist/src/commands/migrate.d.ts.map +1 -1
  88. package/dist/src/commands/migrate.js +1 -2
  89. package/dist/src/commands/migrate.js.map +1 -1
  90. package/dist/src/commands/monograph.d.ts.map +1 -1
  91. package/dist/src/commands/monograph.js +18 -11
  92. package/dist/src/commands/monograph.js.map +1 -1
  93. package/dist/src/commands/monovector/backup.d.ts +11 -0
  94. package/dist/src/commands/monovector/backup.d.ts.map +1 -0
  95. package/dist/src/commands/{ruvector → monovector}/backup.js +25 -25
  96. package/dist/src/commands/monovector/backup.js.map +1 -0
  97. package/dist/src/commands/monovector/benchmark.d.ts +11 -0
  98. package/dist/src/commands/monovector/benchmark.d.ts.map +1 -0
  99. package/dist/src/commands/{ruvector → monovector}/benchmark.js +14 -14
  100. package/dist/src/commands/monovector/benchmark.js.map +1 -0
  101. package/dist/src/commands/monovector/import.d.ts +18 -0
  102. package/dist/src/commands/monovector/import.d.ts.map +1 -0
  103. package/dist/src/commands/{ruvector → monovector}/import.js +21 -21
  104. package/dist/src/commands/monovector/import.js.map +1 -0
  105. package/dist/src/commands/{ruvector → monovector}/index.d.ts +6 -6
  106. package/dist/src/commands/monovector/index.d.ts.map +1 -0
  107. package/dist/src/commands/{ruvector → monovector}/index.js +22 -22
  108. package/dist/src/commands/monovector/index.js.map +1 -0
  109. package/dist/src/commands/monovector/init.d.ts +11 -0
  110. package/dist/src/commands/monovector/init.d.ts.map +1 -0
  111. package/dist/src/commands/{ruvector → monovector}/init.js +36 -36
  112. package/dist/src/commands/monovector/init.js.map +1 -0
  113. package/dist/src/commands/monovector/migrate.d.ts +11 -0
  114. package/dist/src/commands/monovector/migrate.d.ts.map +1 -0
  115. package/dist/src/commands/{ruvector → monovector}/migrate.js +16 -16
  116. package/dist/src/commands/monovector/migrate.js.map +1 -0
  117. package/dist/src/commands/{ruvector → monovector}/optimize.d.ts +2 -2
  118. package/dist/src/commands/monovector/optimize.d.ts.map +1 -0
  119. package/dist/src/commands/{ruvector → monovector}/optimize.js +10 -10
  120. package/dist/src/commands/monovector/optimize.js.map +1 -0
  121. package/dist/src/commands/monovector/setup.d.ts +18 -0
  122. package/dist/src/commands/monovector/setup.d.ts.map +1 -0
  123. package/dist/src/commands/{ruvector → monovector}/setup.js +77 -77
  124. package/dist/src/commands/monovector/setup.js.map +1 -0
  125. package/dist/src/commands/{ruvector → monovector}/status.d.ts +2 -2
  126. package/dist/src/commands/monovector/status.d.ts.map +1 -0
  127. package/dist/src/commands/{ruvector → monovector}/status.js +34 -34
  128. package/dist/src/commands/monovector/status.js.map +1 -0
  129. package/dist/src/commands/neural.d.ts +1 -1
  130. package/dist/src/commands/neural.d.ts.map +1 -1
  131. package/dist/src/commands/neural.js +31 -608
  132. package/dist/src/commands/neural.js.map +1 -1
  133. package/dist/src/commands/performance.d.ts.map +1 -1
  134. package/dist/src/commands/performance.js +7 -10
  135. package/dist/src/commands/performance.js.map +1 -1
  136. package/dist/src/commands/plugins.d.ts.map +1 -1
  137. package/dist/src/commands/plugins.js +3 -4
  138. package/dist/src/commands/plugins.js.map +1 -1
  139. package/dist/src/commands/process.d.ts.map +1 -1
  140. package/dist/src/commands/process.js +5 -12
  141. package/dist/src/commands/process.js.map +1 -1
  142. package/dist/src/commands/progress.d.ts.map +1 -1
  143. package/dist/src/commands/progress.js +16 -16
  144. package/dist/src/commands/progress.js.map +1 -1
  145. package/dist/src/commands/replay.d.ts.map +1 -1
  146. package/dist/src/commands/replay.js.map +1 -1
  147. package/dist/src/commands/route.d.ts +2 -2
  148. package/dist/src/commands/route.js +23 -23
  149. package/dist/src/commands/route.js.map +1 -1
  150. package/dist/src/commands/status.d.ts.map +1 -1
  151. package/dist/src/commands/status.js +0 -3
  152. package/dist/src/commands/status.js.map +1 -1
  153. package/dist/src/commands/swarm.d.ts.map +1 -1
  154. package/dist/src/commands/swarm.js +2 -3
  155. package/dist/src/commands/swarm.js.map +1 -1
  156. package/dist/src/commands/update.d.ts +1 -1
  157. package/dist/src/config-adapter.d.ts.map +1 -1
  158. package/dist/src/config-adapter.js +27 -0
  159. package/dist/src/config-adapter.js.map +1 -1
  160. package/dist/src/consensus/audit-writer.d.ts +44 -17
  161. package/dist/src/consensus/audit-writer.d.ts.map +1 -1
  162. package/dist/src/consensus/audit-writer.js.map +1 -1
  163. package/dist/src/dlq/dlq-replayer.d.ts +1 -1
  164. package/dist/src/dlq/dlq-replayer.d.ts.map +1 -1
  165. package/dist/src/index.d.ts +1 -1
  166. package/dist/src/index.js +5 -5
  167. package/dist/src/index.js.map +1 -1
  168. package/dist/src/init/claudemd-generator.d.ts.map +1 -1
  169. package/dist/src/init/claudemd-generator.js +10 -14
  170. package/dist/src/init/claudemd-generator.js.map +1 -1
  171. package/dist/src/init/executor.d.ts.map +1 -1
  172. package/dist/src/init/executor.js +17 -27
  173. package/dist/src/init/executor.js.map +1 -1
  174. package/dist/src/init/helpers-generator.d.ts +1 -1
  175. package/dist/src/init/helpers-generator.js +2 -2
  176. package/dist/src/init/types.d.ts +1 -1
  177. package/dist/src/init/types.d.ts.map +1 -1
  178. package/dist/src/mcp-client.d.ts.map +1 -1
  179. package/dist/src/mcp-client.js +1 -7
  180. package/dist/src/mcp-client.js.map +1 -1
  181. package/dist/src/mcp-server.d.ts.map +1 -1
  182. package/dist/src/mcp-server.js +9 -1
  183. package/dist/src/mcp-server.js.map +1 -1
  184. package/dist/src/mcp-tools/agent-tools.d.ts.map +1 -1
  185. package/dist/src/mcp-tools/agent-tools.js +1 -52
  186. package/dist/src/mcp-tools/agent-tools.js.map +1 -1
  187. package/dist/src/mcp-tools/analyze-tools.js +5 -5
  188. package/dist/src/mcp-tools/analyze-tools.js.map +1 -1
  189. package/dist/src/mcp-tools/auto-install.d.ts +4 -4
  190. package/dist/src/mcp-tools/autopilot-tools.d.ts +1 -1
  191. package/dist/src/mcp-tools/browser-tools.d.ts +1 -1
  192. package/dist/src/mcp-tools/browser-tools.d.ts.map +1 -1
  193. package/dist/src/mcp-tools/browser-tools.js +6 -5
  194. package/dist/src/mcp-tools/browser-tools.js.map +1 -1
  195. package/dist/src/mcp-tools/claims-tools.d.ts +1 -1
  196. package/dist/src/mcp-tools/coordination-tools.d.ts +1 -1
  197. package/dist/src/mcp-tools/coordination-tools.d.ts.map +1 -1
  198. package/dist/src/mcp-tools/coordination-tools.js +51 -54
  199. package/dist/src/mcp-tools/coordination-tools.js.map +1 -1
  200. package/dist/src/mcp-tools/daa-tools.d.ts +1 -1
  201. package/dist/src/mcp-tools/daa-tools.d.ts.map +1 -1
  202. package/dist/src/mcp-tools/daa-tools.js.map +1 -1
  203. package/dist/src/mcp-tools/embeddings-tools.js +10 -10
  204. package/dist/src/mcp-tools/embeddings-tools.js.map +1 -1
  205. package/dist/src/mcp-tools/guidance-tools.d.ts +1 -1
  206. package/dist/src/mcp-tools/guidance-tools.d.ts.map +1 -1
  207. package/dist/src/mcp-tools/guidance-tools.js +0 -24
  208. package/dist/src/mcp-tools/guidance-tools.js.map +1 -1
  209. package/dist/src/mcp-tools/hive-mind-tools.js.map +1 -1
  210. package/dist/src/mcp-tools/hooks-tools.d.ts.map +1 -1
  211. package/dist/src/mcp-tools/hooks-tools.js +189 -446
  212. package/dist/src/mcp-tools/hooks-tools.js.map +1 -1
  213. package/dist/src/mcp-tools/index.d.ts +0 -2
  214. package/dist/src/mcp-tools/index.d.ts.map +1 -1
  215. package/dist/src/mcp-tools/index.js +0 -2
  216. package/dist/src/mcp-tools/index.js.map +1 -1
  217. package/dist/src/mcp-tools/monograph-compat.d.ts +334 -0
  218. package/dist/src/mcp-tools/monograph-compat.d.ts.map +1 -0
  219. package/dist/src/mcp-tools/monograph-compat.js +1108 -0
  220. package/dist/src/mcp-tools/monograph-compat.js.map +1 -0
  221. package/dist/src/mcp-tools/monograph-tools.d.ts.map +1 -1
  222. package/dist/src/mcp-tools/monograph-tools.js +76 -34
  223. package/dist/src/mcp-tools/monograph-tools.js.map +1 -1
  224. package/dist/src/mcp-tools/neural-tools.d.ts +2 -2
  225. package/dist/src/mcp-tools/neural-tools.js +2 -2
  226. package/dist/src/mcp-tools/neural-tools.js.map +1 -1
  227. package/dist/src/mcp-tools/progress-tools.d.ts +1 -1
  228. package/dist/src/mcp-tools/ruvllm-tools.d.ts +2 -2
  229. package/dist/src/mcp-tools/ruvllm-tools.js +3 -3
  230. package/dist/src/mcp-tools/terminal-tools.d.ts +1 -1
  231. package/dist/src/mcp-tools/terminal-tools.d.ts.map +1 -1
  232. package/dist/src/mcp-tools/terminal-tools.js +29 -19
  233. package/dist/src/mcp-tools/terminal-tools.js.map +1 -1
  234. package/dist/src/mcp-tools/transfer-tools.d.ts +1 -1
  235. package/dist/src/mcp-tools/wasm-agent-tools.d.ts +1 -1
  236. package/dist/src/mcp-tools/wasm-agent-tools.js +2 -2
  237. package/dist/src/memory/intelligence.d.ts.map +1 -1
  238. package/dist/src/memory/intelligence.js +14 -8
  239. package/dist/src/memory/intelligence.js.map +1 -1
  240. package/dist/src/memory/memory-bridge.d.ts +17 -2
  241. package/dist/src/memory/memory-bridge.d.ts.map +1 -1
  242. package/dist/src/memory/memory-bridge.js +76 -23
  243. package/dist/src/memory/memory-bridge.js.map +1 -1
  244. package/dist/src/memory/memory-initializer.d.ts +2 -2
  245. package/dist/src/memory/memory-initializer.d.ts.map +1 -1
  246. package/dist/src/memory/memory-initializer.js +37 -39
  247. package/dist/src/memory/memory-initializer.js.map +1 -1
  248. package/dist/src/monovector/capabilities.d.ts +34 -0
  249. package/dist/src/monovector/capabilities.d.ts.map +1 -0
  250. package/dist/src/monovector/capabilities.js +37 -0
  251. package/dist/src/monovector/capabilities.js.map +1 -0
  252. package/dist/src/monovector/command-outcomes.d.ts +37 -0
  253. package/dist/src/monovector/command-outcomes.d.ts.map +1 -0
  254. package/dist/src/monovector/command-outcomes.js +87 -0
  255. package/dist/src/monovector/command-outcomes.js.map +1 -0
  256. package/dist/src/monovector/coverage-router.d.ts +103 -0
  257. package/dist/src/monovector/coverage-router.d.ts.map +1 -0
  258. package/dist/src/monovector/coverage-router.js +337 -0
  259. package/dist/src/monovector/coverage-router.js.map +1 -0
  260. package/dist/src/monovector/coverage-tools.d.ts +14 -0
  261. package/dist/src/monovector/coverage-tools.d.ts.map +1 -0
  262. package/dist/src/monovector/coverage-tools.js +112 -0
  263. package/dist/src/monovector/coverage-tools.js.map +1 -0
  264. package/dist/src/{ruvector → monovector}/diff-classifier.d.ts +2 -2
  265. package/dist/src/monovector/diff-classifier.d.ts.map +1 -0
  266. package/dist/src/monovector/diff-classifier.js.map +1 -0
  267. package/dist/src/monovector/index.d.ts +61 -0
  268. package/dist/src/monovector/index.d.ts.map +1 -0
  269. package/dist/src/monovector/index.js +67 -0
  270. package/dist/src/monovector/index.js.map +1 -0
  271. package/dist/src/monovector/init-state.d.ts +35 -0
  272. package/dist/src/monovector/init-state.d.ts.map +1 -0
  273. package/dist/src/monovector/init-state.js +36 -0
  274. package/dist/src/monovector/init-state.js.map +1 -0
  275. package/dist/src/monovector/route-outcomes.d.ts +55 -0
  276. package/dist/src/monovector/route-outcomes.d.ts.map +1 -0
  277. package/dist/src/monovector/route-outcomes.js +137 -0
  278. package/dist/src/monovector/route-outcomes.js.map +1 -0
  279. package/dist/src/parser.js +3 -3
  280. package/dist/src/parser.js.map +1 -1
  281. package/dist/src/plugins/store/discovery.d.ts.map +1 -1
  282. package/dist/src/plugins/store/discovery.js +0 -31
  283. package/dist/src/plugins/store/discovery.js.map +1 -1
  284. package/dist/src/production/circuit-breaker.d.ts +26 -6
  285. package/dist/src/production/circuit-breaker.d.ts.map +1 -1
  286. package/dist/src/production/circuit-breaker.js.map +1 -1
  287. package/dist/src/production/error-handler.d.ts +55 -30
  288. package/dist/src/production/error-handler.d.ts.map +1 -1
  289. package/dist/src/production/error-handler.js.map +1 -1
  290. package/dist/src/production/index.d.ts +3 -20
  291. package/dist/src/production/index.d.ts.map +1 -1
  292. package/dist/src/production/index.js +3 -15
  293. package/dist/src/production/index.js.map +1 -1
  294. package/dist/src/production/monitoring.d.ts +54 -34
  295. package/dist/src/production/monitoring.d.ts.map +1 -1
  296. package/dist/src/production/monitoring.js +12 -14
  297. package/dist/src/production/monitoring.js.map +1 -1
  298. package/dist/src/production/rate-limiter.d.ts +64 -19
  299. package/dist/src/production/rate-limiter.d.ts.map +1 -1
  300. package/dist/src/production/rate-limiter.js +5 -5
  301. package/dist/src/production/rate-limiter.js.map +1 -1
  302. package/dist/src/production/retry.d.ts.map +1 -1
  303. package/dist/src/production/retry.js +4 -2
  304. package/dist/src/production/retry.js.map +1 -1
  305. package/dist/src/runtime/headless.d.ts +3 -3
  306. package/dist/src/services/claim-service.d.ts +50 -59
  307. package/dist/src/services/claim-service.d.ts.map +1 -1
  308. package/dist/src/services/claim-service.js +83 -50
  309. package/dist/src/services/claim-service.js.map +1 -1
  310. package/dist/src/services/config-file-manager.d.ts.map +1 -1
  311. package/dist/src/services/config-file-manager.js +8 -1
  312. package/dist/src/services/config-file-manager.js.map +1 -1
  313. package/dist/src/services/worker-daemon.d.ts.map +1 -1
  314. package/dist/src/services/worker-daemon.js +4 -0
  315. package/dist/src/services/worker-daemon.js.map +1 -1
  316. package/dist/src/transfer/ipfs/upload.d.ts +1 -1
  317. package/dist/src/transfer/storage/gcs.d.ts +1 -1
  318. package/dist/src/types.d.ts +13 -0
  319. package/dist/src/types.d.ts.map +1 -1
  320. package/dist/src/types.js.map +1 -1
  321. package/dist/src/ui/collector.mjs +51 -11
  322. package/dist/src/ui/dashboard.html +313 -88
  323. package/dist/src/ui/server.mjs +163 -8
  324. package/dist/src/update/checker.d.ts +1 -1
  325. package/dist/src/update/index.d.ts +1 -1
  326. package/dist/tsconfig.tsbuildinfo +1 -1
  327. package/package.json +13 -13
  328. package/scripts/publish-registry.ts +0 -1
  329. package/.claude/commands/monomind/adr.md +0 -11
  330. package/.claude/commands/monomind/budget.md +0 -7
  331. package/.claude/commands/monomind/createtask.md +0 -277
  332. package/.claude/commands/monomind/do.md +0 -498
  333. package/.claude/commands/monomind/graph-status.md +0 -7
  334. package/.claude/commands/monomind/help.md +0 -118
  335. package/.claude/commands/monomind/idea.md +0 -273
  336. package/.claude/commands/monomind/improve.md +0 -352
  337. package/.claude/commands/monomind/loops.md +0 -7
  338. package/.claude/commands/monomind/memory.md +0 -230
  339. package/.claude/commands/monomind/repeat.md +0 -257
  340. package/.claude/commands/monomind/review.md +0 -317
  341. package/.claude/commands/monomind/specialagents.md +0 -125
  342. package/.claude/commands/monomind/swarm.md +0 -161
  343. package/.claude/commands/monomind/understand.md +0 -139
  344. package/.claude/commands/training/README.md +0 -39
  345. package/.claude/commands/training/neural-patterns.md +0 -73
  346. package/.claude/commands/training/neural-train.md +0 -79
  347. package/dist/src/commands/appliance-advanced.d.ts +0 -9
  348. package/dist/src/commands/appliance-advanced.d.ts.map +0 -1
  349. package/dist/src/commands/appliance-advanced.js +0 -238
  350. package/dist/src/commands/appliance-advanced.js.map +0 -1
  351. package/dist/src/commands/appliance.d.ts +0 -8
  352. package/dist/src/commands/appliance.d.ts.map +0 -1
  353. package/dist/src/commands/appliance.js +0 -406
  354. package/dist/src/commands/appliance.js.map +0 -1
  355. package/dist/src/commands/ruvector/backup.d.ts +0 -11
  356. package/dist/src/commands/ruvector/backup.d.ts.map +0 -1
  357. package/dist/src/commands/ruvector/backup.js.map +0 -1
  358. package/dist/src/commands/ruvector/benchmark.d.ts +0 -11
  359. package/dist/src/commands/ruvector/benchmark.d.ts.map +0 -1
  360. package/dist/src/commands/ruvector/benchmark.js.map +0 -1
  361. package/dist/src/commands/ruvector/import.d.ts +0 -18
  362. package/dist/src/commands/ruvector/import.d.ts.map +0 -1
  363. package/dist/src/commands/ruvector/import.js.map +0 -1
  364. package/dist/src/commands/ruvector/index.d.ts.map +0 -1
  365. package/dist/src/commands/ruvector/index.js.map +0 -1
  366. package/dist/src/commands/ruvector/init.d.ts +0 -11
  367. package/dist/src/commands/ruvector/init.d.ts.map +0 -1
  368. package/dist/src/commands/ruvector/init.js.map +0 -1
  369. package/dist/src/commands/ruvector/migrate.d.ts +0 -11
  370. package/dist/src/commands/ruvector/migrate.d.ts.map +0 -1
  371. package/dist/src/commands/ruvector/migrate.js.map +0 -1
  372. package/dist/src/commands/ruvector/optimize.d.ts.map +0 -1
  373. package/dist/src/commands/ruvector/optimize.js.map +0 -1
  374. package/dist/src/commands/ruvector/setup.d.ts +0 -18
  375. package/dist/src/commands/ruvector/setup.d.ts.map +0 -1
  376. package/dist/src/commands/ruvector/setup.js.map +0 -1
  377. package/dist/src/commands/ruvector/status.d.ts.map +0 -1
  378. package/dist/src/commands/ruvector/status.js.map +0 -1
  379. package/dist/src/ruvector/agent-wasm.d.ts +0 -182
  380. package/dist/src/ruvector/agent-wasm.d.ts.map +0 -1
  381. package/dist/src/ruvector/agent-wasm.js +0 -316
  382. package/dist/src/ruvector/agent-wasm.js.map +0 -1
  383. package/dist/src/ruvector/ast-analyzer.d.ts +0 -67
  384. package/dist/src/ruvector/ast-analyzer.d.ts.map +0 -1
  385. package/dist/src/ruvector/ast-analyzer.js +0 -277
  386. package/dist/src/ruvector/ast-analyzer.js.map +0 -1
  387. package/dist/src/ruvector/coverage-router.d.ts +0 -160
  388. package/dist/src/ruvector/coverage-router.d.ts.map +0 -1
  389. package/dist/src/ruvector/coverage-router.js +0 -539
  390. package/dist/src/ruvector/coverage-router.js.map +0 -1
  391. package/dist/src/ruvector/coverage-tools.d.ts +0 -33
  392. package/dist/src/ruvector/coverage-tools.d.ts.map +0 -1
  393. package/dist/src/ruvector/coverage-tools.js +0 -157
  394. package/dist/src/ruvector/coverage-tools.js.map +0 -1
  395. package/dist/src/ruvector/diff-classifier.d.ts.map +0 -1
  396. package/dist/src/ruvector/diff-classifier.js.map +0 -1
  397. package/dist/src/ruvector/enhanced-model-router.d.ts +0 -146
  398. package/dist/src/ruvector/enhanced-model-router.d.ts.map +0 -1
  399. package/dist/src/ruvector/enhanced-model-router.js +0 -551
  400. package/dist/src/ruvector/enhanced-model-router.js.map +0 -1
  401. package/dist/src/ruvector/flash-attention.d.ts +0 -195
  402. package/dist/src/ruvector/flash-attention.d.ts.map +0 -1
  403. package/dist/src/ruvector/flash-attention.js +0 -643
  404. package/dist/src/ruvector/flash-attention.js.map +0 -1
  405. package/dist/src/ruvector/graph-analyzer.d.ts +0 -187
  406. package/dist/src/ruvector/graph-analyzer.d.ts.map +0 -1
  407. package/dist/src/ruvector/graph-analyzer.js +0 -929
  408. package/dist/src/ruvector/graph-analyzer.js.map +0 -1
  409. package/dist/src/ruvector/index.d.ts +0 -56
  410. package/dist/src/ruvector/index.d.ts.map +0 -1
  411. package/dist/src/ruvector/index.js +0 -58
  412. package/dist/src/ruvector/index.js.map +0 -1
  413. package/dist/src/ruvector/lora-adapter.d.ts +0 -218
  414. package/dist/src/ruvector/lora-adapter.d.ts.map +0 -1
  415. package/dist/src/ruvector/lora-adapter.js +0 -455
  416. package/dist/src/ruvector/lora-adapter.js.map +0 -1
  417. package/dist/src/ruvector/model-router.d.ts +0 -222
  418. package/dist/src/ruvector/model-router.d.ts.map +0 -1
  419. package/dist/src/ruvector/model-router.js +0 -512
  420. package/dist/src/ruvector/model-router.js.map +0 -1
  421. package/dist/src/ruvector/moe-router.d.ts +0 -213
  422. package/dist/src/ruvector/moe-router.d.ts.map +0 -1
  423. package/dist/src/ruvector/moe-router.js +0 -649
  424. package/dist/src/ruvector/moe-router.js.map +0 -1
  425. package/dist/src/ruvector/q-learning-router.d.ts +0 -217
  426. package/dist/src/ruvector/q-learning-router.d.ts.map +0 -1
  427. package/dist/src/ruvector/q-learning-router.js +0 -712
  428. package/dist/src/ruvector/q-learning-router.js.map +0 -1
  429. package/dist/src/ruvector/ruvllm-wasm.d.ts +0 -179
  430. package/dist/src/ruvector/ruvllm-wasm.d.ts.map +0 -1
  431. package/dist/src/ruvector/ruvllm-wasm.js +0 -363
  432. package/dist/src/ruvector/ruvllm-wasm.js.map +0 -1
  433. package/dist/src/ruvector/semantic-router.d.ts +0 -77
  434. package/dist/src/ruvector/semantic-router.d.ts.map +0 -1
  435. package/dist/src/ruvector/semantic-router.js +0 -178
  436. package/dist/src/ruvector/semantic-router.js.map +0 -1
  437. package/dist/src/ruvector/vector-db.d.ts +0 -69
  438. package/dist/src/ruvector/vector-db.d.ts.map +0 -1
  439. package/dist/src/ruvector/vector-db.js +0 -243
  440. package/dist/src/ruvector/vector-db.js.map +0 -1
  441. package/dist/src/services/ruvector-training.d.ts +0 -222
  442. package/dist/src/services/ruvector-training.d.ts.map +0 -1
  443. package/dist/src/services/ruvector-training.js +0 -696
  444. package/dist/src/services/ruvector-training.js.map +0 -1
  445. package/dist/src/ui/.monomind/loops/loop-1779095996252-mdjpp.json +0 -11
  446. package/dist/src/ui/data/agent-avatars.html +0 -763
  447. package/dist/src/ui/data/agent-avatars.json +0 -966
  448. package/dist/src/ui/data/avatars/account-strategist.svg +0 -58
  449. package/dist/src/ui/data/avatars/accounts-payable.svg +0 -54
  450. package/dist/src/ui/data/avatars/adaptive-coordinator.svg +0 -55
  451. package/dist/src/ui/data/avatars/adaptive-coordinator2.svg +0 -54
  452. package/dist/src/ui/data/avatars/ai-citation.svg +0 -57
  453. package/dist/src/ui/data/avatars/ai-engineer.svg +0 -61
  454. package/dist/src/ui/data/avatars/analytics-reporter.svg +0 -53
  455. package/dist/src/ui/data/avatars/api-tester.svg +0 -53
  456. package/dist/src/ui/data/avatars/architecture.svg +0 -54
  457. package/dist/src/ui/data/avatars/automation-governance.svg +0 -55
  458. package/dist/src/ui/data/avatars/backend-dev.svg +0 -53
  459. package/dist/src/ui/data/avatars/benchmarker.svg +0 -54
  460. package/dist/src/ui/data/avatars/blockchain-auditor.svg +0 -53
  461. package/dist/src/ui/data/avatars/byzantine-coord.svg +0 -57
  462. package/dist/src/ui/data/avatars/case-analyst.svg +0 -57
  463. package/dist/src/ui/data/avatars/cicd-engineer.svg +0 -55
  464. package/dist/src/ui/data/avatars/cloud-architect.svg +0 -54
  465. package/dist/src/ui/data/avatars/code-review-swarm.svg +0 -57
  466. package/dist/src/ui/data/avatars/coder-v119.svg +0 -57
  467. package/dist/src/ui/data/avatars/coder.svg +0 -58
  468. package/dist/src/ui/data/avatars/collective-coord.svg +0 -54
  469. package/dist/src/ui/data/avatars/compliance-auditor.svg +0 -58
  470. package/dist/src/ui/data/avatars/consensus-coordinator.svg +0 -54
  471. package/dist/src/ui/data/avatars/content-creator.svg +0 -54
  472. package/dist/src/ui/data/avatars/crdt-synchronizer.svg +0 -53
  473. package/dist/src/ui/data/avatars/cro-specialist.svg +0 -58
  474. package/dist/src/ui/data/avatars/data-consolidator.svg +0 -54
  475. package/dist/src/ui/data/avatars/data-engineer.svg +0 -53
  476. package/dist/src/ui/data/avatars/database-optimizer.svg +0 -61
  477. package/dist/src/ui/data/avatars/deal-strategist.svg +0 -54
  478. package/dist/src/ui/data/avatars/defender.svg +0 -53
  479. package/dist/src/ui/data/avatars/devops-automator.svg +0 -56
  480. package/dist/src/ui/data/avatars/discovery-coach.svg +0 -54
  481. package/dist/src/ui/data/avatars/email-marketing.svg +0 -57
  482. package/dist/src/ui/data/avatars/embedded-firmware.svg +0 -61
  483. package/dist/src/ui/data/avatars/evidence-collector.svg +0 -57
  484. package/dist/src/ui/data/avatars/experiment-tracker.svg +0 -53
  485. package/dist/src/ui/data/avatars/feedback-synthesizer.svg +0 -54
  486. package/dist/src/ui/data/avatars/finance-tracker.svg +0 -54
  487. package/dist/src/ui/data/avatars/frontend-developer.svg +0 -54
  488. package/dist/src/ui/data/avatars/game-audio-engineer.svg +0 -59
  489. package/dist/src/ui/data/avatars/game-designer.svg +0 -54
  490. package/dist/src/ui/data/avatars/gossip-coordinator.svg +0 -54
  491. package/dist/src/ui/data/avatars/hierarchical-coord.svg +0 -54
  492. package/dist/src/ui/data/avatars/incident-commander.svg +0 -57
  493. package/dist/src/ui/data/avatars/infrastructure.svg +0 -54
  494. package/dist/src/ui/data/avatars/input-validator.svg +0 -53
  495. package/dist/src/ui/data/avatars/ios-developer.svg +0 -54
  496. package/dist/src/ui/data/avatars/issue-tracker.svg +0 -53
  497. package/dist/src/ui/data/avatars/judge.svg +0 -55
  498. package/dist/src/ui/data/avatars/launch-strategist.svg +0 -54
  499. package/dist/src/ui/data/avatars/legal-compliance.svg +0 -53
  500. package/dist/src/ui/data/avatars/level-designer.svg +0 -53
  501. package/dist/src/ui/data/avatars/load-balancer.svg +0 -57
  502. package/dist/src/ui/data/avatars/mcp-builder.svg +0 -53
  503. package/dist/src/ui/data/avatars/memory-coordinator.svg +0 -55
  504. package/dist/src/ui/data/avatars/mesh-coordinator.svg +0 -55
  505. package/dist/src/ui/data/avatars/ml-developer.svg +0 -58
  506. package/dist/src/ui/data/avatars/mobile-app-builder.svg +0 -53
  507. package/dist/src/ui/data/avatars/mobile-dev.svg +0 -54
  508. package/dist/src/ui/data/avatars/model-qa.svg +0 -58
  509. package/dist/src/ui/data/avatars/narrative-designer.svg +0 -58
  510. package/dist/src/ui/data/avatars/outbound-strategist.svg +0 -55
  511. package/dist/src/ui/data/avatars/path-validator.svg +0 -54
  512. package/dist/src/ui/data/avatars/payment-agent.svg +0 -53
  513. package/dist/src/ui/data/avatars/perf-analyzer.svg +0 -58
  514. package/dist/src/ui/data/avatars/pipeline-analyst.svg +0 -54
  515. package/dist/src/ui/data/avatars/planner.svg +0 -55
  516. package/dist/src/ui/data/avatars/pr-manager.svg +0 -54
  517. package/dist/src/ui/data/avatars/pricing-strategist.svg +0 -54
  518. package/dist/src/ui/data/avatars/product-manager.svg +0 -54
  519. package/dist/src/ui/data/avatars/production-validator.svg +0 -54
  520. package/dist/src/ui/data/avatars/project-shepherd.svg +0 -54
  521. package/dist/src/ui/data/avatars/proposal-strategist.svg +0 -54
  522. package/dist/src/ui/data/avatars/prosecutor.svg +0 -57
  523. package/dist/src/ui/data/avatars/pseudocode.svg +0 -53
  524. package/dist/src/ui/data/avatars/queen-coordinator.svg +0 -55
  525. package/dist/src/ui/data/avatars/quorum-manager.svg +0 -53
  526. package/dist/src/ui/data/avatars/raft-manager.svg +0 -53
  527. package/dist/src/ui/data/avatars/reality-checker.svg +0 -58
  528. package/dist/src/ui/data/avatars/recruitment.svg +0 -58
  529. package/dist/src/ui/data/avatars/refinement.svg +0 -53
  530. package/dist/src/ui/data/avatars/release-manager.svg +0 -54
  531. package/dist/src/ui/data/avatars/repo-architect.svg +0 -54
  532. package/dist/src/ui/data/avatars/researcher.svg +0 -58
  533. package/dist/src/ui/data/avatars/resource-allocator.svg +0 -53
  534. package/dist/src/ui/data/avatars/reviewer.svg +0 -53
  535. package/dist/src/ui/data/avatars/safe-executor.svg +0 -53
  536. package/dist/src/ui/data/avatars/sales-coach.svg +0 -53
  537. package/dist/src/ui/data/avatars/sales-engineer.svg +0 -58
  538. package/dist/src/ui/data/avatars/scout-explorer.svg +0 -58
  539. package/dist/src/ui/data/avatars/security-architect.svg +0 -54
  540. package/dist/src/ui/data/avatars/security-auditor.svg +0 -55
  541. package/dist/src/ui/data/avatars/senior-developer.svg +0 -58
  542. package/dist/src/ui/data/avatars/senior-pm.svg +0 -58
  543. package/dist/src/ui/data/avatars/seo-specialist.svg +0 -57
  544. package/dist/src/ui/data/avatars/social-media.svg +0 -54
  545. package/dist/src/ui/data/avatars/solidity-engineer.svg +0 -58
  546. package/dist/src/ui/data/avatars/sparc-coder.svg +0 -58
  547. package/dist/src/ui/data/avatars/sparc-coord.svg +0 -56
  548. package/dist/src/ui/data/avatars/specification.svg +0 -57
  549. package/dist/src/ui/data/avatars/sprint-prioritizer.svg +0 -53
  550. package/dist/src/ui/data/avatars/sre.svg +0 -54
  551. package/dist/src/ui/data/avatars/studio-operations.svg +0 -53
  552. package/dist/src/ui/data/avatars/studio-producer.svg +0 -55
  553. package/dist/src/ui/data/avatars/support-responder.svg +0 -56
  554. package/dist/src/ui/data/avatars/system-architect.svg +0 -54
  555. package/dist/src/ui/data/avatars/task-orchestrator.svg +0 -56
  556. package/dist/src/ui/data/avatars/technical-artist.svg +0 -53
  557. package/dist/src/ui/data/avatars/technical-writer.svg +0 -59
  558. package/dist/src/ui/data/avatars/tester.svg +0 -53
  559. package/dist/src/ui/data/avatars/threat-detection.svg +0 -61
  560. package/dist/src/ui/data/avatars/trend-researcher.svg +0 -54
  561. package/dist/src/ui/data/avatars/trial-director.svg +0 -55
  562. package/dist/src/ui/data/avatars/unity-architect.svg +0 -54
  563. package/dist/src/ui/data/avatars/visionos-engineer.svg +0 -57
  564. package/dist/src/ui/data/avatars/worker-specialist.svg +0 -55
  565. package/dist/src/ui/data/avatars/workflow-architect.svg +0 -57
  566. package/dist/src/ui/data/avatars/workflow-automation.svg +0 -54
  567. package/dist/src/ui/data/avatars/zk-steward.svg +0 -54
  568. package/dist/src/ui/data/known-projects.json +0 -1
  569. /package/dist/src/{ruvector → monovector}/diff-classifier.js +0 -0
@@ -5,6 +5,14 @@
5
5
  import { mkdirSync, writeFileSync, renameSync, existsSync, readFileSync, statSync, unlinkSync, readdirSync } from 'fs';
6
6
  import { dirname, join, resolve, sep } from 'path';
7
7
  import { getProjectCwd } from './types.js';
8
+ import { getCapabilities } from '../monovector/capabilities.js';
9
+ import { randomUUID } from 'node:crypto';
10
+ import { recordRoute, joinOutcome, joinLatestUnresolved } from '../monovector/route-outcomes.js';
11
+ import { recordCommand, deriveRecentSuccess } from '../monovector/command-outcomes.js';
12
+ // Base dir for per-route outcome records — sits alongside routing-outcomes.json
13
+ function getRouteOutcomesBaseDir() {
14
+ return join(getProjectCwd(), '.monomind');
15
+ }
8
16
  // Real vector search functions - lazy loaded to avoid circular imports
9
17
  let searchEntriesFn = null;
10
18
  async function getRealSearchFunction() {
@@ -64,29 +72,6 @@ async function getEWCConsolidator() {
64
72
  }
65
73
  return ewcConsolidator;
66
74
  }
67
- // MoE Router - lazy loaded
68
- let moeRouter = null;
69
- async function getMoERouter() {
70
- if (!moeRouter) {
71
- try {
72
- const { getMoERouter: getMoE } = await import('../ruvector/moe-router.js');
73
- moeRouter = await getMoE();
74
- }
75
- catch {
76
- moeRouter = null;
77
- }
78
- }
79
- return moeRouter;
80
- }
81
- // Semantic Router - lazy loaded
82
- // Tries native VectorDb first (16k+ routes/s HNSW), falls back to pure JS (47k routes/s cosine)
83
- let semanticRouter = null;
84
- let nativeVectorDb = null;
85
- let semanticRouterInitialized = false;
86
- let routerBackend = 'none';
87
- // Pre-computed embeddings for common task patterns (cached, capped to prevent unbounded growth)
88
- const MAX_PATTERN_EMBEDDINGS = 2000;
89
- const TASK_PATTERN_EMBEDDINGS = new Map();
90
75
  function generateSimpleEmbedding(text, dimension = 384) {
91
76
  // Simple deterministic embedding based on character codes
92
77
  // This is for routing purposes where we need consistent, fast embeddings
@@ -125,7 +110,10 @@ function generateSimpleEmbedding(text, dimension = 384) {
125
110
  }
126
111
  // ── Runtime routing outcome persistence ──────────────────────────────
127
112
  // Closes the learning loop: post-task records outcomes → route loads them.
128
- const ROUTING_OUTCOMES_PATH = join(resolve('.'), '.monomind/routing-outcomes.json');
113
+ // Evaluated lazily via getter so it uses runtime CWD, not import-time CWD
114
+ function getRoutingOutcomesPath() {
115
+ return join(getProjectCwd(), '.monomind', 'routing-outcomes.json');
116
+ }
129
117
  const ROUTING_STOPWORDS = new Set([
130
118
  'the', 'a', 'an', 'is', 'are', 'was', 'were', 'be', 'been', 'being', 'have', 'has', 'had',
131
119
  'do', 'does', 'did', 'will', 'would', 'could', 'should', 'may', 'might', 'shall', 'can',
@@ -146,8 +134,8 @@ function extractKeywords(text) {
146
134
  }
147
135
  function loadRoutingOutcomes() {
148
136
  try {
149
- if (existsSync(ROUTING_OUTCOMES_PATH)) {
150
- const data = JSON.parse(readFileSync(ROUTING_OUTCOMES_PATH, 'utf-8'));
137
+ if (existsSync(getRoutingOutcomesPath())) {
138
+ const data = JSON.parse(readFileSync(getRoutingOutcomesPath(), 'utf-8'));
151
139
  return data.outcomes || [];
152
140
  }
153
141
  }
@@ -156,14 +144,14 @@ function loadRoutingOutcomes() {
156
144
  }
157
145
  function saveRoutingOutcomes(outcomes) {
158
146
  try {
159
- const dir = dirname(ROUTING_OUTCOMES_PATH);
147
+ const dir = dirname(getRoutingOutcomesPath());
160
148
  if (!existsSync(dir))
161
149
  mkdirSync(dir, { recursive: true });
162
150
  // Cap at 500 entries to bound file size
163
151
  const capped = outcomes.slice(-500);
164
- const tmp = ROUTING_OUTCOMES_PATH + '.tmp';
152
+ const tmp = getRoutingOutcomesPath() + '.tmp';
165
153
  writeFileSync(tmp, JSON.stringify({ outcomes: capped }, null, 2));
166
- renameSync(tmp, ROUTING_OUTCOMES_PATH);
154
+ renameSync(tmp, getRoutingOutcomesPath());
167
155
  }
168
156
  catch { /* non-critical */ }
169
157
  }
@@ -257,107 +245,6 @@ const TASK_PATTERNS = {
257
245
  agents: ['memory-specialist', 'architect', 'coder'],
258
246
  },
259
247
  };
260
- /**
261
- * Get the semantic router with environment detection.
262
- * Tries native VectorDb first (HNSW, 16k routes/s), falls back to pure JS (47k routes/s cosine).
263
- */
264
- async function getSemanticRouter() {
265
- if (semanticRouterInitialized) {
266
- return { router: semanticRouter, backend: routerBackend, native: nativeVectorDb };
267
- }
268
- semanticRouterInitialized = true;
269
- // STEP 1: Try native VectorDb from @ruvector/router (HNSW-backed)
270
- // Note: Native VectorDb uses a persistent database file which can have lock issues
271
- // in concurrent environments. We try it first but fall back gracefully to pure JS.
272
- try {
273
- // Use createRequire for ESM compatibility with native modules
274
- const { createRequire } = await import('module');
275
- const require = createRequire(import.meta.url);
276
- const router = require('@ruvector/router');
277
- if (router.VectorDb && router.DistanceMetric) {
278
- // Try to create VectorDb - may fail with lock error in concurrent envs
279
- const db = new router.VectorDb({
280
- dimensions: 384,
281
- distanceMetric: router.DistanceMetric.Cosine,
282
- hnswM: 16,
283
- hnswEfConstruction: 200,
284
- hnswEfSearch: 100,
285
- });
286
- // Initialize with static + runtime-learned task patterns
287
- for (const [patternName, { keywords }] of Object.entries(getMergedTaskPatterns())) {
288
- for (const keyword of keywords) {
289
- const embedding = generateSimpleEmbedding(keyword);
290
- db.insert(`${patternName}:${keyword}`, embedding);
291
- if (TASK_PATTERN_EMBEDDINGS.size < MAX_PATTERN_EMBEDDINGS) {
292
- TASK_PATTERN_EMBEDDINGS.set(`${patternName}:${keyword}`, embedding);
293
- }
294
- }
295
- }
296
- nativeVectorDb = db;
297
- routerBackend = 'native';
298
- return { router: null, backend: routerBackend, native: nativeVectorDb };
299
- }
300
- }
301
- catch (err) {
302
- // Native not available or database locked - fall back to pure JS
303
- // Common errors: "Database already open. Cannot acquire lock." or "MODULE_NOT_FOUND"
304
- // This is expected in concurrent environments or when binary isn't installed
305
- }
306
- // STEP 2: Fall back to pure JS SemanticRouter
307
- try {
308
- const { SemanticRouter } = await import('../ruvector/semantic-router.js');
309
- semanticRouter = new SemanticRouter({ dimension: 384 });
310
- for (const [patternName, { keywords, agents }] of Object.entries(getMergedTaskPatterns())) {
311
- const embeddings = keywords.map(kw => generateSimpleEmbedding(kw));
312
- semanticRouter.addIntentWithEmbeddings(patternName, embeddings, { agents, keywords });
313
- // Cache embeddings for keywords (capped)
314
- keywords.forEach((kw, i) => {
315
- if (TASK_PATTERN_EMBEDDINGS.size < MAX_PATTERN_EMBEDDINGS) {
316
- TASK_PATTERN_EMBEDDINGS.set(kw, embeddings[i]);
317
- }
318
- });
319
- }
320
- routerBackend = 'pure-js';
321
- }
322
- catch {
323
- semanticRouter = null;
324
- routerBackend = 'none';
325
- }
326
- return { router: semanticRouter, backend: routerBackend, native: nativeVectorDb };
327
- }
328
- /**
329
- * Get router backend info for status display.
330
- */
331
- function getRouterBackendInfo() {
332
- switch (routerBackend) {
333
- case 'native':
334
- return { backend: 'native VectorDb (HNSW)', speed: '16k+ routes/s' };
335
- case 'pure-js':
336
- return { backend: 'pure JS (cosine)', speed: '47k routes/s' };
337
- default:
338
- return { backend: 'none', speed: 'N/A' };
339
- }
340
- }
341
- // Flash Attention - lazy loaded
342
- let flashAttention = null;
343
- async function getFlashAttention() {
344
- if (!flashAttention) {
345
- try {
346
- const { getFlashAttention: getFlash } = await import('../ruvector/flash-attention.js');
347
- flashAttention = await getFlash();
348
- }
349
- catch {
350
- flashAttention = null;
351
- }
352
- }
353
- return flashAttention;
354
- }
355
- // LoRA Adapter removed — superseded by SONA instant adaptation
356
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
357
- let loraAdapter = null;
358
- async function getLoRAAdapter() {
359
- return loraAdapter;
360
- }
361
248
  // In-memory trajectory tracking (persisted on end)
362
249
  const activeTrajectories = new Map();
363
250
  const MEMORY_DIR = '.monomind/memory';
@@ -533,6 +420,12 @@ function suggestAgentsForTask(task) {
533
420
  // Canonical set of valid monomind agent type strings.
534
421
  // Patterns whose type is not in this set (e.g. 'action', 'observation', 'routing')
535
422
  // are structural labels, not agent names, and must be excluded from routing.
423
+ //
424
+ // Lean teardown: the SONA neural LoRA routing adaptation (applyNeuralAdaptation +
425
+ // the @monomind/neural NeuralLearningSystem singleton) has been removed. Routing now
426
+ // uses the pure keyword path plus the deterministic generateSimpleEmbedding query
427
+ // against the pattern index, with outcomes recorded via route-outcomes. No ONNX /
428
+ // LoRA inference happens on the routing hot path anymore.
536
429
  const VALID_AGENT_TYPES = new Set([
537
430
  'coder', 'reviewer', 'tester', 'planner', 'researcher',
538
431
  'architect', 'security-architect', 'security-auditor',
@@ -668,6 +561,9 @@ export const hooksPostEdit = {
668
561
  success,
669
562
  quality: success ? 0.85 : 0.3,
670
563
  agent,
564
+ // B1.2: give the SONA embedder real semantics (the edited file) instead of
565
+ // the opaque task ID.
566
+ task: `edit ${filePath}`,
671
567
  });
672
568
  }
673
569
  catch {
@@ -735,6 +631,14 @@ export const hooksPostCommand = {
735
631
  const command = params.command;
736
632
  const exitCode = params.exitCode || 0;
737
633
  const success = exitCode === 0;
634
+ // Record the real exit code in the time-windowed command-outcome store so
635
+ // post-task can derive a MEASURED success signal (grounded in actual exit
636
+ // codes) when the caller does not explicitly assert --success. Non-fatal.
637
+ await recordCommand(getRouteOutcomesBaseDir(), {
638
+ ts: Date.now(),
639
+ command: typeof command === 'string' ? command.slice(0, 200) : String(command).slice(0, 200),
640
+ exitCode,
641
+ });
738
642
  // Persist command outcome via AgentDB
739
643
  let _storedIn = 'none';
740
644
  try {
@@ -798,10 +702,26 @@ export const hooksRoute = {
798
702
  if (agentdbRoute && agentdbRoute.confidence > 0.5) {
799
703
  const agents = agentdbRoute.agents.length > 0 ? agentdbRoute.agents : ['coder', 'researcher'];
800
704
  const complexity = task.length > 200 ? 'high' : task.length < 50 ? 'low' : 'medium';
705
+ const agentdbMethod = `agentdb-${agentdbRoute.controller}`;
706
+ const agentdbConfidence = Math.round(agentdbRoute.confidence * 100) / 100;
707
+ // Record the route recommendation so post-task can join the actual outcome
708
+ const routeId = randomUUID();
709
+ const caps = await getCapabilities();
710
+ const learningMode = (caps.sona || caps.router === 'native' || caps.attention) ? 'native' : 'js';
711
+ await recordRoute(getRouteOutcomesBaseDir(), {
712
+ routeId,
713
+ ts: Date.now(),
714
+ task,
715
+ recommendedAgent: agents[0],
716
+ routingMethod: agentdbMethod,
717
+ confidence: agentdbConfidence,
718
+ learningMode,
719
+ });
801
720
  return {
721
+ routeId,
802
722
  task,
803
723
  routing: {
804
- method: `agentdb-${agentdbRoute.controller}`,
724
+ method: agentdbMethod,
805
725
  backend: agentdbRoute.controller,
806
726
  latencyMs: 0,
807
727
  throughput: 'N/A',
@@ -831,81 +751,16 @@ export const hooksRoute = {
831
751
  // AgentDB router not available — fall through to local routing
832
752
  }
833
753
  }
834
- // Get router (tries native VectorDb first, falls back to pure JS)
835
- const { router, backend, native } = useSemanticRouter
836
- ? await getSemanticRouter()
837
- : { router: null, backend: 'none', native: null };
838
- let semanticResult = [];
754
+ // Deterministic keyword routing is the baseline (and only) local path.
755
+ const semanticResult = [];
839
756
  let routingMethod = 'keyword';
840
- let routingLatencyMs = 0;
757
+ const routingLatencyMs = 0;
841
758
  let backendInfo = '';
842
- const queryText = context ? `${task} ${context}` : task;
843
- // Apply LoRA adaptations from the neural system when available.
844
- // This is the path where learned weights actually influence routing:
845
- // the query embedding is transformed by the session-trained LoRA before
846
- // being compared against the semantic router's pattern embeddings.
847
- let queryEmbedding = generateSimpleEmbedding(queryText);
848
- try {
849
- const neural = await import('@monomind/neural').catch(() => null);
850
- if (neural?.createNeuralLearningSystem) {
851
- const sys = neural.createNeuralLearningSystem('balanced');
852
- await sys.initialize();
853
- // applyAdaptations uses the LoRA weights from learned-state.json
854
- // (loaded during initialize()) to transform the query embedding.
855
- const base = generateSimpleEmbedding(queryText, 768);
856
- const adapted = await sys.getSONAManager().applyAdaptations(base);
857
- // Down-project to 384 to match the semantic router's expected dimension
858
- queryEmbedding = adapted.slice(0, 384);
859
- await sys.cleanup();
860
- }
861
- }
862
- catch { /* fall through to hash embedding */ }
863
- // Try native VectorDb (HNSW-backed)
864
- if (native && backend === 'native') {
865
- const routeStart = performance.now();
866
- try {
867
- // eslint-disable-next-line @typescript-eslint/no-explicit-any
868
- const results = native.search(queryEmbedding, 5);
869
- routingLatencyMs = performance.now() - routeStart;
870
- routingMethod = 'semantic-native';
871
- backendInfo = 'native VectorDb (HNSW)';
872
- // Convert results to semantic format
873
- const mergedPatterns = getMergedTaskPatterns();
874
- semanticResult = results.map((r) => {
875
- const [patternName] = r.id.split(':');
876
- const pattern = mergedPatterns[patternName];
877
- return {
878
- intent: patternName,
879
- score: 1 - r.score, // Native uses distance (lower is better), convert to similarity
880
- metadata: {
881
- agents: pattern?.agents || (patternName.startsWith('learned-') ? [patternName.slice(8)] : ['coder']),
882
- },
883
- };
884
- });
885
- }
886
- catch {
887
- // Native failed, try pure JS fallback
888
- }
889
- }
890
- // Try pure JS SemanticRouter fallback
891
- if (router && backend === 'pure-js' && semanticResult.length === 0) {
892
- const routeStart = performance.now();
893
- semanticResult = router.routeWithEmbedding(queryEmbedding, 3);
894
- routingLatencyMs = performance.now() - routeStart;
895
- routingMethod = 'semantic-pure-js';
896
- backendInfo = 'pure JS (cosine similarity)';
897
- }
898
- // Get agents from semantic routing or fall back to keyword
759
+ // Get agents from keyword routing
899
760
  let agents;
900
761
  let confidence;
901
762
  let matchedPattern = '';
902
- if (semanticResult.length > 0 && semanticResult[0].score > 0.4) {
903
- const topMatch = semanticResult[0];
904
- agents = topMatch.metadata.agents || ['coder', 'researcher'];
905
- confidence = topMatch.score;
906
- matchedPattern = topMatch.intent;
907
- }
908
- else {
763
+ {
909
764
  // Keyword fallback is the baseline
910
765
  const keywordSuggestion = suggestAgentsForTask(task);
911
766
  agents = keywordSuggestion.agents;
@@ -939,7 +794,22 @@ export const hooksRoute = {
939
794
  : taskLower.includes('simple') || taskLower.includes('fix') || task.length < 50
940
795
  ? 'low'
941
796
  : 'medium';
797
+ const primaryConfidence = Math.round(confidence * 100) / 100;
798
+ // Record the route recommendation so post-task can join the actual outcome
799
+ const routeId = randomUUID();
800
+ const caps = await getCapabilities();
801
+ const learningMode = (caps.sona || caps.router === 'native' || caps.attention) ? 'native' : 'js';
802
+ await recordRoute(getRouteOutcomesBaseDir(), {
803
+ routeId,
804
+ ts: Date.now(),
805
+ task,
806
+ recommendedAgent: agents[0],
807
+ routingMethod,
808
+ confidence: primaryConfidence,
809
+ learningMode,
810
+ });
942
811
  return {
812
+ routeId,
943
813
  task,
944
814
  routing: {
945
815
  method: routingMethod,
@@ -1102,43 +972,8 @@ export const hooksPreTask = {
1102
972
  : descLower.includes('simple') || descLower.includes('fix') || description.length < 50
1103
973
  ? 'low'
1104
974
  : 'medium';
1105
- // Enhanced model routing with Agent Booster AST (ADR-026)
1106
- let modelRouting;
1107
- try {
1108
- const { getEnhancedModelRouter } = await import('../ruvector/enhanced-model-router.js');
1109
- const router = getEnhancedModelRouter();
1110
- const routeResult = await router.route(description, { filePath });
1111
- if (routeResult.tier === 1) {
1112
- // Agent Booster can handle this task
1113
- modelRouting = {
1114
- tier: 1,
1115
- handler: 'agent-booster',
1116
- canSkipLLM: true,
1117
- agentBoosterIntent: routeResult.agentBoosterIntent?.type,
1118
- intentDescription: routeResult.agentBoosterIntent?.description,
1119
- confidence: routeResult.confidence,
1120
- estimatedLatencyMs: routeResult.estimatedLatencyMs,
1121
- estimatedCost: routeResult.estimatedCost,
1122
- recommendation: `[AGENT_BOOSTER_AVAILABLE] Skip LLM - use Agent Booster for "${routeResult.agentBoosterIntent?.type}"`,
1123
- };
1124
- }
1125
- else {
1126
- // LLM required
1127
- modelRouting = {
1128
- tier: routeResult.tier,
1129
- handler: routeResult.handler,
1130
- model: routeResult.model,
1131
- complexity: routeResult.complexity,
1132
- confidence: routeResult.confidence,
1133
- estimatedLatencyMs: routeResult.estimatedLatencyMs,
1134
- estimatedCost: routeResult.estimatedCost,
1135
- recommendation: `[TASK_MODEL_RECOMMENDATION] Use model="${routeResult.model}" for this task`,
1136
- };
1137
- }
1138
- }
1139
- catch {
1140
- // Enhanced router not available
1141
- }
975
+ // Enhanced model routing module was never shipped — modelRouting stays undefined.
976
+ const modelRouting = undefined;
1142
977
  // ERL: Retrieve past heuristics to inject into recommendations
1143
978
  // Source: https://arxiv.org/abs/2603.24639
1144
979
  const erlHints = [];
@@ -1212,12 +1047,37 @@ export const hooksPostTask = {
1212
1047
  quality: { type: 'number', description: 'Quality score (0-1)' },
1213
1048
  task: { type: 'string', description: 'Task description text (used for learning keyword extraction)' },
1214
1049
  storeDecisions: { type: 'boolean', description: 'Also store routing decision in memory DB' },
1050
+ routeId: { type: 'string', description: 'Route ID from a prior hooks_route call — joins the recommendation to this outcome' },
1215
1051
  },
1216
1052
  required: ['taskId'],
1217
1053
  },
1218
1054
  handler: async (params) => {
1219
1055
  const taskId = params.taskId;
1220
- const success = params.success !== false;
1056
+ // The success flag, when the caller asserts it (--success true), is taken as
1057
+ // ground truth. But callers usually do NOT pass it. Rather than treating every
1058
+ // unverified task as "unknown" (and thus excluding it from learning), we now
1059
+ // derive a MEASURED success signal from the real command exit codes recorded by
1060
+ // post-command within a recent time window. post-command appends each exit code
1061
+ // to the command-outcome store keyed by timestamp; deriveRecentSuccess returns:
1062
+ // true → recent commands exist and ALL exited 0
1063
+ // false → recent commands exist and ANY exited non-zero
1064
+ // null → no recent commands (genuinely no signal → stays unknown)
1065
+ // Precedence: an explicit --success ALWAYS wins; the derived signal only fills
1066
+ // in when no explicit flag is given; only when there is also no recent command
1067
+ // signal does the outcome stay unknown (and excluded from SONA + route join,
1068
+ // per the existing "unknown ≠ success" principle).
1069
+ const explicitSuccess = typeof params.success === 'boolean';
1070
+ let outcomeKnown = explicitSuccess;
1071
+ let success = params.success !== false;
1072
+ let successSource = explicitSuccess ? 'explicit' : 'unknown';
1073
+ if (!explicitSuccess) {
1074
+ const derived = await deriveRecentSuccess(getRouteOutcomesBaseDir());
1075
+ if (derived !== null) {
1076
+ outcomeKnown = true;
1077
+ success = derived;
1078
+ successSource = 'derived-commands';
1079
+ }
1080
+ }
1221
1081
  const agent = params.agent;
1222
1082
  const quality = params.quality || (success ? 0.85 : 0.3);
1223
1083
  const startTime = Date.now();
@@ -1230,6 +1090,11 @@ export const hooksPostTask = {
1230
1090
  success,
1231
1091
  quality,
1232
1092
  agent,
1093
+ // B1.2: thread the real task description into the SONA trajectory so the
1094
+ // embedder encodes meaning, not the opaque task ID.
1095
+ task: params.task || undefined,
1096
+ // B1.3: only feed the SONA LoRA update when the outcome is actually known.
1097
+ outcomeKnown,
1233
1098
  duration: params.duration || undefined,
1234
1099
  patterns: params.patterns || undefined,
1235
1100
  });
@@ -1250,11 +1115,14 @@ export const hooksPostTask = {
1250
1115
  catch {
1251
1116
  // Non-fatal
1252
1117
  }
1253
- // Persist routing outcome for runtime learning (file-based, always reliable)
1118
+ // Persist routing outcome for runtime learning (file-based, always reliable).
1119
+ // B1.3: also gate this sibling learning sink on a known outcome — an unverified
1120
+ // task must not train the router as a success either. When the caller did not
1121
+ // assert success, the outcome is unknown and we skip persisting a labeled sample.
1254
1122
  const taskText = params.task || '';
1255
1123
  const outcomeKeywords = extractKeywords(taskText);
1256
1124
  let outcomePersisted = false;
1257
- if (taskText && agent && agent.length <= 100 && /^[a-zA-Z0-9_-]+$/.test(agent)) {
1125
+ if (outcomeKnown && taskText && agent && agent.length <= 100 && /^[a-zA-Z0-9_-]+$/.test(agent)) {
1258
1126
  try {
1259
1127
  const outcomes = loadRoutingOutcomes();
1260
1128
  outcomes.push({
@@ -1270,6 +1138,26 @@ export const hooksPostTask = {
1270
1138
  }
1271
1139
  catch { /* non-critical */ }
1272
1140
  }
1141
+ // Join this outcome back onto the original route recommendation. This is the
1142
+ // recommendation→actual→success link that routing-accuracy metrics and SONA
1143
+ // labels depend on. When the caller threads an explicit routeId we join that
1144
+ // record; otherwise we auto-correlate to the most recent unresolved route
1145
+ // (within a 10-min window) so the loop closes without the LLM manually
1146
+ // threading the routeId. Only join when the outcome is actually measured —
1147
+ // per "unknown ≠ success", an unverified task must not pollute the metric.
1148
+ if (outcomeKnown) {
1149
+ const outcome = {
1150
+ agentActuallyUsed: agent,
1151
+ measuredSuccess: success,
1152
+ quality: typeof params.quality === 'number' ? params.quality : undefined,
1153
+ };
1154
+ if (params.routeId) {
1155
+ await joinOutcome(getRouteOutcomesBaseDir(), params.routeId, outcome);
1156
+ }
1157
+ else {
1158
+ await joinLatestUnresolved(getRouteOutcomesBaseDir(), outcome);
1159
+ }
1160
+ }
1273
1161
  // ERL: Extract and persist structured heuristic for future pre-task injection
1274
1162
  // Source: https://arxiv.org/abs/2603.24639
1275
1163
  if (taskText && agent && success !== undefined) {
@@ -1342,6 +1230,8 @@ export const hooksPostTask = {
1342
1230
  return {
1343
1231
  taskId,
1344
1232
  success,
1233
+ outcomeKnown,
1234
+ successSource,
1345
1235
  duration,
1346
1236
  learningUpdates: {
1347
1237
  patternsUpdated: feedbackResult?.updated || (success ? 2 : 1),
@@ -1393,7 +1283,7 @@ export const hooksExplain = {
1393
1283
  let historicalSuccess = null;
1394
1284
  let historicalNote = 'No historical data yet';
1395
1285
  try {
1396
- const outcomesPath = join(resolve('.'), '.monomind/routing-outcomes.json');
1286
+ const outcomesPath = getRoutingOutcomesPath();
1397
1287
  if (existsSync(outcomesPath)) {
1398
1288
  const data = JSON.parse(readFileSync(outcomesPath, 'utf-8'));
1399
1289
  const outcomes = data.outcomes || [];
@@ -1809,7 +1699,11 @@ export const hooksSessionEnd = {
1809
1699
  handler: async (params) => {
1810
1700
  const saveState = params.saveState !== false;
1811
1701
  const shouldStopDaemon = params.stopDaemon !== false;
1812
- const sessionId = `session-${Date.now() - 3600000}`; // Default session (1 hour ago)
1702
+ // Use caller-supplied sessionId if provided, otherwise generate a current-time ID.
1703
+ // The -3600000 offset was incorrect — it prevented matching session-start IDs.
1704
+ const sessionId = typeof params.sessionId === 'string' && params.sessionId
1705
+ ? params.sessionId
1706
+ : `session-${Date.now()}`;
1813
1707
  // Stop daemon if enabled
1814
1708
  let daemonStopped = false;
1815
1709
  if (shouldStopDaemon) {
@@ -1832,7 +1726,7 @@ export const hooksSessionEnd = {
1832
1726
  // Check for pending-insights.jsonl
1833
1727
  let insightCount = 0;
1834
1728
  try {
1835
- const insightsPath = resolve(join('.monomind', 'data', 'pending-insights.jsonl'));
1729
+ const insightsPath = join(getProjectCwd(), '.monomind', 'data', 'pending-insights.jsonl');
1836
1730
  if (existsSync(insightsPath)) {
1837
1731
  const content = readFileSync(insightsPath, 'utf-8').trim();
1838
1732
  insightCount = content ? content.split('\n').length : 0;
@@ -1985,10 +1879,10 @@ export const hooksInit = {
1985
1879
  };
1986
1880
  },
1987
1881
  };
1988
- // Intelligence hook - RuVector intelligence system
1882
+ // Intelligence hook - JS pattern/trajectory logging
1989
1883
  export const hooksIntelligence = {
1990
1884
  name: 'hooks_intelligence',
1991
- description: 'RuVector intelligence system status (shows REAL metrics from memory store)',
1885
+ description: 'Intelligence status: pattern/trajectory logging metrics from the memory store',
1992
1886
  inputSchema: {
1993
1887
  type: 'object',
1994
1888
  properties: {
@@ -2009,29 +1903,25 @@ export const hooksIntelligence = {
2009
1903
  const realStats = getIntelligenceStatsFromMemory();
2010
1904
  // Check actual implementation availability
2011
1905
  const sonaAvailable = (await getSONAOptimizer()) !== null;
2012
- const moeAvailable = (await getMoERouter()) !== null;
2013
- const flashAvailable = (await getFlashAttention()) !== null;
2014
- const ewcAvailable = (await getEWCConsolidator()) !== null;
2015
- const loraAvailable = (await getLoRAAdapter()) !== null;
2016
1906
  return {
2017
1907
  mode,
2018
1908
  status: 'active',
2019
1909
  components: {
2020
1910
  sona: {
2021
1911
  enabled: enableSona,
2022
- status: sonaAvailable ? 'active' : 'loading',
2023
- implemented: true, // NOW IMPLEMENTED in alpha.102
1912
+ status: sonaAvailable ? 'active' : 'idle',
1913
+ implemented: true,
2024
1914
  trajectoriesRecorded: realStats.trajectories.total,
2025
1915
  trajectoriesSuccessful: realStats.trajectories.successful,
2026
1916
  patternsLearned: realStats.patterns.learned,
2027
- note: sonaAvailable ? 'SONA optimizer active - learning from trajectories' : 'SONA loading...',
1917
+ note: 'Trajectory + pattern logging (no neural training in the lean build)',
2028
1918
  },
2029
1919
  moe: {
2030
- enabled: enableMoe,
2031
- status: moeAvailable ? 'active' : 'loading',
2032
- implemented: true, // NOW IMPLEMENTED in alpha.102
1920
+ enabled: false,
1921
+ status: 'removed',
1922
+ implemented: false,
2033
1923
  routingDecisions: realStats.routing.decisions,
2034
- note: moeAvailable ? 'MoE router with 8 experts (coder, tester, reviewer, architect, security, performance, researcher, coordinator)' : 'MoE loading...',
1924
+ note: 'MoE removed in lean build; keyword routing is used instead (see monoes-full-loop)',
2035
1925
  },
2036
1926
  hnsw: {
2037
1927
  enabled: enableHnsw,
@@ -2039,25 +1929,25 @@ export const hooksIntelligence = {
2039
1929
  implemented: true,
2040
1930
  indexSize: realStats.memory.indexSize,
2041
1931
  memorySizeBytes: realStats.memory.memorySizeBytes,
2042
- note: 'HNSW vector indexing with 150x-12,500x speedup',
1932
+ note: 'Pure-JS HNSW vector indexing (O(log n) vs O(n))',
2043
1933
  },
2044
1934
  flashAttention: {
2045
- enabled: true,
2046
- status: flashAvailable ? 'active' : 'loading',
2047
- implemented: true, // NOW IMPLEMENTED in alpha.102
2048
- note: flashAvailable ? 'Flash Attention with O(N) memory (2.49x-7.47x speedup)' : 'Flash Attention loading...',
1935
+ enabled: false,
1936
+ status: 'removed',
1937
+ implemented: false,
1938
+ note: 'Flash Attention removed in lean build; lives on monoes-full-loop branch',
2049
1939
  },
2050
1940
  ewc: {
2051
- enabled: true,
2052
- status: ewcAvailable ? 'active' : 'loading',
2053
- implemented: true, // NOW IMPLEMENTED in alpha.102
2054
- note: ewcAvailable ? 'EWC++ consolidation prevents catastrophic forgetting' : 'EWC++ loading...',
1941
+ enabled: false,
1942
+ status: 'removed',
1943
+ implemented: false,
1944
+ note: 'EWC++ removed in lean build; lives on monoes-full-loop branch',
2055
1945
  },
2056
1946
  lora: {
2057
- enabled: true,
2058
- status: loraAvailable ? 'active' : 'loading',
2059
- implemented: true, // NOW IMPLEMENTED in alpha.102
2060
- note: loraAvailable ? 'LoRA adapter with 128x memory compression (rank=8)' : 'LoRA loading...',
1947
+ enabled: false,
1948
+ status: 'removed',
1949
+ implemented: false,
1950
+ note: 'LoRA removed in lean build; lives on monoes-full-loop branch',
2061
1951
  },
2062
1952
  embeddings: {
2063
1953
  provider: 'transformers',
@@ -2076,11 +1966,13 @@ export const hooksIntelligence = {
2076
1966
  implementationStatus: {
2077
1967
  working: [
2078
1968
  'memory-store', 'embeddings', 'trajectory-recording', 'claims', 'swarm-coordination',
2079
- 'hnsw-index', 'pattern-storage', 'sona-optimizer', 'ewc-consolidation', 'moe-routing',
2080
- 'flash-attention', 'lora-adapter'
1969
+ 'hnsw-index', 'pattern-storage', 'keyword-routing'
2081
1970
  ],
2082
1971
  partial: [],
2083
1972
  notImplemented: [],
1973
+ removed: [
1974
+ 'sona-optimizer', 'ewc-consolidation', 'moe-routing', 'flash-attention', 'lora-adapter'
1975
+ ],
2084
1976
  },
2085
1977
  version: '3.0.0-alpha.102',
2086
1978
  };
@@ -2541,7 +2433,7 @@ export const hooksPatternSearch = {
2541
2433
  // Intelligence stats hook
2542
2434
  export const hooksIntelligenceStats = {
2543
2435
  name: 'hooks_intelligence_stats',
2544
- description: 'Get RuVector intelligence layer statistics',
2436
+ description: 'Get intelligence-layer statistics (pattern/trajectory logging)',
2545
2437
  inputSchema: {
2546
2438
  type: 'object',
2547
2439
  properties: {
@@ -2553,9 +2445,6 @@ export const hooksIntelligenceStats = {
2553
2445
  // Get REAL statistics from actual implementations
2554
2446
  const sona = await getSONAOptimizer();
2555
2447
  const ewc = await getEWCConsolidator();
2556
- const moe = await getMoERouter();
2557
- const flash = await getFlashAttention();
2558
- const lora = await getLoRAAdapter();
2559
2448
  // Fallback to memory store for legacy data
2560
2449
  const memoryStats = getIntelligenceStatsFromMemory();
2561
2450
  // SONA stats from real implementation
@@ -2613,59 +2502,21 @@ export const hooksIntelligenceStats = {
2613
2502
  loadBalance: null,
2614
2503
  implementation: 'not-loaded',
2615
2504
  };
2616
- if (moe) {
2617
- const loadBalance = moe.getLoadBalance();
2618
- const activeExperts = Object.values(loadBalance.routingCounts).filter((u) => u > 0).length;
2619
- // Calculate average utilization as proxy for confidence
2620
- const utilValues = Object.values(loadBalance.utilization);
2621
- const avgUtil = utilValues.length > 0 ? utilValues.reduce((a, b) => a + b, 0) / utilValues.length : 0;
2622
- moeStats = {
2623
- expertsTotal: 8,
2624
- expertsActive: activeExperts,
2625
- routingDecisions: loadBalance.totalRoutings,
2626
- avgRoutingTimeMs: 0.15, // Theoretical performance
2627
- avgConfidence: Math.round(avgUtil * 100) / 100,
2628
- loadBalance: {
2629
- giniCoefficient: Math.round(loadBalance.giniCoefficient * 1000) / 1000,
2630
- coefficientOfVariation: Math.round(loadBalance.coefficientOfVariation * 1000) / 1000,
2631
- expertUsage: loadBalance.routingCounts,
2632
- },
2633
- implementation: 'real-moe',
2634
- };
2635
- }
2636
- // Flash Attention stats from real implementation
2637
- let flashStats = {
2505
+ // Flash Attention stats (native MoE/Flash removed in lean build — defaults only)
2506
+ const flashStats = {
2638
2507
  speedup: 1.0,
2639
2508
  avgComputeTimeMs: 0,
2640
2509
  blockSize: 64,
2641
2510
  implementation: 'not-loaded',
2642
2511
  };
2643
- if (flash) {
2644
- flashStats = {
2645
- speedup: Math.round(flash.getSpeedup() * 100) / 100,
2646
- avgComputeTimeMs: 0, // Would need benchmarking
2647
- blockSize: 64,
2648
- implementation: 'real-flash-attention',
2649
- };
2650
- }
2651
- // LoRA stats from real implementation
2652
- let loraStats = {
2512
+ // LoRA Adapter removed — superseded by SONA instant adaptation
2513
+ const loraStats = {
2653
2514
  rank: 8,
2654
2515
  alpha: 16,
2655
2516
  adaptations: 0,
2656
2517
  avgLoss: 0,
2657
2518
  implementation: 'not-loaded',
2658
2519
  };
2659
- if (lora) {
2660
- const realLora = lora.getStats();
2661
- loraStats = {
2662
- rank: realLora.rank,
2663
- alpha: 16, // Default alpha from config
2664
- adaptations: realLora.totalAdaptations,
2665
- avgLoss: Math.round(realLora.avgAdaptationNorm * 10000) / 10000,
2666
- implementation: 'real-lora',
2667
- };
2668
- }
2669
2520
  const stats = {
2670
2521
  sona: sonaStats,
2671
2522
  moe: moeStats,
@@ -2689,9 +2540,9 @@ export const hooksIntelligenceStats = {
2689
2540
  implementationStatus: {
2690
2541
  sona: sona ? 'loaded' : 'not-loaded',
2691
2542
  ewc: ewc ? 'loaded' : 'not-loaded',
2692
- moe: moe ? 'loaded' : 'not-loaded',
2693
- flash: flash ? 'loaded' : 'not-loaded',
2694
- lora: lora ? 'loaded' : 'not-loaded',
2543
+ moe: 'not-loaded',
2544
+ flash: 'not-loaded',
2545
+ lora: 'not-loaded',
2695
2546
  },
2696
2547
  performance: {
2697
2548
  sonaLearningMs: sonaStats.avgLearningTimeMs,
@@ -2778,7 +2629,7 @@ export const hooksIntelligenceLearn = {
2778
2629
  // Intelligence attention hook
2779
2630
  export const hooksIntelligenceAttention = {
2780
2631
  name: 'hooks_intelligence_attention',
2781
- description: 'Compute attention-weighted similarity using MoE/Flash/Hyperbolic',
2632
+ description: 'Compute attention-weighted similarity (pure-JS cosine/hyperbolic)',
2782
2633
  inputSchema: {
2783
2634
  type: 'object',
2784
2635
  properties: {
@@ -2795,76 +2646,9 @@ export const hooksIntelligenceAttention = {
2795
2646
  const startTime = performance.now();
2796
2647
  let implementation = 'placeholder';
2797
2648
  const results = [];
2798
- if (mode === 'moe') {
2799
- // Try MoE routing
2800
- const moe = await getMoERouter();
2801
- if (moe) {
2802
- try {
2803
- // Generate a simple embedding from query (hash-based for demo)
2804
- const embedding = new Float32Array(384);
2805
- for (let i = 0; i < 384; i++) {
2806
- embedding[i] = Math.sin(query.charCodeAt(i % query.length) * (i + 1) * 0.01);
2807
- }
2808
- const routingResult = moe.route(embedding);
2809
- for (let i = 0; i < Math.min(topK, routingResult.experts.length); i++) {
2810
- const expert = routingResult.experts[i];
2811
- results.push({
2812
- index: i,
2813
- weight: expert.weight,
2814
- pattern: `Expert: ${expert.name}`,
2815
- expert: expert.name,
2816
- });
2817
- }
2818
- implementation = 'real-moe-router';
2819
- }
2820
- catch {
2821
- // Fall back to placeholder
2822
- }
2823
- }
2824
- }
2825
- else if (mode === 'flash') {
2826
- // Try Flash Attention
2827
- const flash = await getFlashAttention();
2828
- if (flash) {
2829
- try {
2830
- // Generate query/key/value embeddings
2831
- const q = new Float32Array(384);
2832
- const keys = [];
2833
- const values = [];
2834
- for (let i = 0; i < 384; i++) {
2835
- q[i] = Math.sin(query.charCodeAt(i % query.length) * (i + 1) * 0.01);
2836
- }
2837
- // Generate some keys/values
2838
- for (let k = 0; k < topK; k++) {
2839
- const key = new Float32Array(384);
2840
- const value = new Float32Array(384);
2841
- for (let i = 0; i < 384; i++) {
2842
- key[i] = Math.cos((k + 1) * (i + 1) * 0.01);
2843
- value[i] = k + 1;
2844
- }
2845
- keys.push(key);
2846
- values.push(value);
2847
- }
2848
- const attentionResult = flash.attention([q], keys, values);
2849
- // Compute softmax weights from output magnitudes
2850
- const outputMags = attentionResult.output[0]
2851
- ? Array.from(attentionResult.output[0]).slice(0, topK).map(v => Math.abs(v))
2852
- : new Array(topK).fill(1);
2853
- const sumMags = outputMags.reduce((a, b) => a + b, 0) || 1;
2854
- for (let i = 0; i < topK; i++) {
2855
- results.push({
2856
- index: i,
2857
- weight: outputMags[i] / sumMags,
2858
- pattern: `Flash attention target #${i + 1}`,
2859
- });
2860
- }
2861
- implementation = 'real-flash-attention';
2862
- }
2863
- catch {
2864
- // Fall back to placeholder
2865
- }
2866
- }
2867
- }
2649
+ // Native MoE-router / Flash-attention backends were removed in the lean build.
2650
+ // Both modes degrade to the honest empty result handled below.
2651
+ void mode;
2868
2652
  // If no real implementation worked, return empty with honest marker
2869
2653
  if (results.length === 0) {
2870
2654
  implementation = 'none';
@@ -2876,10 +2660,8 @@ export const hooksIntelligenceAttention = {
2876
2660
  results,
2877
2661
  stats: {
2878
2662
  computeTimeMs,
2879
- speedup: implementation.startsWith('real-') ? (mode === 'flash' ? '2.49x-7.47x' : '1.5x-3x') : null,
2880
- memoryReduction: implementation.startsWith('real-') ? (mode === 'flash' ? '50-75%' : '25-40%') : null,
2881
2663
  _stub: implementation === 'none',
2882
- _note: implementation === 'none' ? 'No attention backend available. Install @ruvector/attention for real computation.' : undefined,
2664
+ _note: implementation === 'none' ? 'Pure-JS similarity only; native attention backends are not part of the lean build.' : undefined,
2883
2665
  },
2884
2666
  implementation,
2885
2667
  };
@@ -3327,20 +3109,6 @@ export const hooksWorkerDetect = {
3327
3109
  return result;
3328
3110
  },
3329
3111
  };
3330
- // Model router - lazy loaded
3331
- let modelRouterInstance = null;
3332
- async function getModelRouterInstance() {
3333
- if (!modelRouterInstance) {
3334
- try {
3335
- const { getModelRouter } = await import('../ruvector/model-router.js');
3336
- modelRouterInstance = getModelRouter();
3337
- }
3338
- catch {
3339
- modelRouterInstance = null;
3340
- }
3341
- }
3342
- return modelRouterInstance;
3343
- }
3344
3112
  // Model route tool - intelligent model selection
3345
3113
  export const hooksModelRoute = {
3346
3114
  name: 'hooks_model-route',
@@ -3356,29 +3124,14 @@ export const hooksModelRoute = {
3356
3124
  },
3357
3125
  handler: async (params) => {
3358
3126
  const task = params.task;
3359
- const router = await getModelRouterInstance();
3360
- if (!router) {
3361
- // Fallback to simple heuristic
3362
- const complexity = analyzeComplexityFallback(task);
3363
- return {
3364
- model: complexity > 0.7 ? 'opus' : complexity > 0.4 ? 'sonnet' : 'haiku',
3365
- confidence: 0.7,
3366
- complexity,
3367
- reasoning: 'Fallback heuristic (model router not available)',
3368
- implementation: 'fallback',
3369
- };
3370
- }
3371
- const result = await router.route(task);
3127
+ // Native neural model-router removed in the lean build — keyword complexity heuristic.
3128
+ const complexity = analyzeComplexityFallback(task);
3372
3129
  return {
3373
- model: result.model,
3374
- confidence: result.confidence,
3375
- uncertainty: result.uncertainty,
3376
- complexity: result.complexity,
3377
- reasoning: result.reasoning,
3378
- alternatives: result.alternatives,
3379
- inferenceTimeUs: result.inferenceTimeUs,
3380
- costMultiplier: result.costMultiplier,
3381
- implementation: 'tiny-dancer-neural',
3130
+ model: complexity > 0.7 ? 'opus' : complexity > 0.4 ? 'sonnet' : 'haiku',
3131
+ confidence: 0.7,
3132
+ complexity,
3133
+ reasoning: 'Keyword complexity heuristic',
3134
+ implementation: 'heuristic',
3382
3135
  };
3383
3136
  },
3384
3137
  };
@@ -3408,10 +3161,8 @@ export const hooksModelOutcome = {
3408
3161
  ? (exitCode === 0 ? 'success' : 'failure')
3409
3162
  : params.outcome;
3410
3163
  const outcome = effectiveOutcome;
3411
- const router = await getModelRouterInstance();
3412
- if (router) {
3413
- router.recordOutcome(task, model, outcome);
3414
- }
3164
+ // Native model-router removed in the lean build — outcome is acknowledged but not
3165
+ // fed to a neural learner (keyword routing has no online-learning store).
3415
3166
  return {
3416
3167
  recorded: true,
3417
3168
  task: task.slice(0, 50),
@@ -3430,18 +3181,10 @@ export const hooksModelStats = {
3430
3181
  properties: {},
3431
3182
  },
3432
3183
  handler: async () => {
3433
- const router = await getModelRouterInstance();
3434
- if (!router) {
3435
- return {
3436
- available: false,
3437
- message: 'Model router not initialized',
3438
- };
3439
- }
3440
- const stats = router.getStats();
3184
+ // Native model-router removed in the lean build — no neural routing stats to report.
3441
3185
  return {
3442
- available: true,
3443
- ...stats,
3444
- timestamp: new Date().toISOString(),
3186
+ available: false,
3187
+ message: 'Model router not available in the lean build (keyword routing has no stats)',
3445
3188
  };
3446
3189
  },
3447
3190
  };