monomind 1.18.13 → 1.19.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 (218) hide show
  1. package/.claude/agents/core/researcher.md +29 -24
  2. package/.claude/agents/github/code-review-swarm.md +1 -1
  3. package/.claude/agents/github/github-modes.md +1 -1
  4. package/.claude/agents/github/issue-tracker.md +1 -1
  5. package/.claude/agents/github/multi-repo-swarm.md +1 -1
  6. package/.claude/agents/github/pr-manager.md +1 -1
  7. package/.claude/agents/github/project-board-sync.md +1 -1
  8. package/.claude/agents/github/release-manager.md +1 -1
  9. package/.claude/agents/github/repo-architect.md +1 -1
  10. package/.claude/agents/github/swarm-issue.md +1 -1
  11. package/.claude/agents/github/swarm-pr.md +1 -1
  12. package/.claude/agents/github/sync-coordinator.md +1 -1
  13. package/.claude/agents/github/workflow-automation.md +1 -1
  14. package/.claude/agents/goal/goal-planner.md +1 -1
  15. package/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
  16. package/.claude/agents/testing/production-validator.md +8 -7
  17. package/.claude/agents/testing/testing-evidence-collector.md +3 -1
  18. package/.claude/commands/mastermind/_repeat.md +22 -3
  19. package/.claude/commands/mastermind/architect.md +1 -1
  20. package/.claude/commands/mastermind/autodev.md +1 -1
  21. package/.claude/commands/mastermind/build.md +1 -1
  22. package/.claude/commands/mastermind/code-review.md +5 -5
  23. package/.claude/commands/mastermind/debug.md +1 -1
  24. package/.claude/commands/mastermind/help.md +2 -2
  25. package/.claude/commands/mastermind/idea.md +1 -1
  26. package/.claude/commands/mastermind/improve.md +1 -1
  27. package/.claude/commands/mastermind/okf-export.md +14 -0
  28. package/.claude/commands/mastermind/okf-import.md +15 -0
  29. package/.claude/commands/mastermind/plan.md +1 -1
  30. package/.claude/commands/mastermind/research.md +1 -1
  31. package/.claude/commands/mastermind/review.md +12 -1
  32. package/.claude/commands/mastermind/runorg.md +1 -1
  33. package/.claude/commands/mastermind/taskdev.md +1 -1
  34. package/.claude/commands/mastermind/tdd.md +1 -1
  35. package/.claude/commands/mastermind/verify.md +1 -1
  36. package/.claude/helpers/graphify-freshen.cjs +16 -20
  37. package/.claude/helpers/handlers/agent-start-handler.cjs +11 -36
  38. package/.claude/helpers/handlers/capture-handler.cjs +110 -0
  39. package/.claude/helpers/handlers/route-handler.cjs +180 -256
  40. package/.claude/helpers/handlers/session-handler.cjs +139 -142
  41. package/.claude/helpers/handlers/session-restore-handler.cjs +15 -10
  42. package/.claude/helpers/handlers/task-handler.cjs +8 -155
  43. package/.claude/helpers/hook-handler.cjs +89 -5
  44. package/.claude/helpers/intelligence.cjs +164 -15
  45. package/.claude/helpers/learning-service.mjs +1 -0
  46. package/.claude/helpers/mastermind-activate.cjs +33 -51
  47. package/.claude/helpers/monolean-activate.cjs +13 -3
  48. package/.claude/helpers/monolean-propagate.cjs +7 -3
  49. package/.claude/helpers/router.cjs +47 -9
  50. package/.claude/helpers/utils/monograph.cjs +37 -20
  51. package/.claude/settings.json +0 -20
  52. package/.claude/skills/mastermind-skills/_repeat.md +29 -4
  53. package/.claude/skills/mastermind-skills/architect.md +5 -6
  54. package/.claude/skills/mastermind-skills/autodev.md +8 -5
  55. package/.claude/skills/mastermind-skills/review.md +25 -11
  56. package/.claude/skills/mastermind-skills/techport.md +37 -3
  57. package/.claude/skills/monodesign/document.md +9 -6
  58. package/.claude/skills/monodesign/extract.md +1 -1
  59. package/.claude/skills/monodesign/reference/document.md +1 -1
  60. package/.claude/skills/monodesign/reference/live.md +1 -1
  61. package/.claude/skills/monolean/SKILL.md +1 -1
  62. package/package.json +1 -1
  63. package/packages/@monomind/cli/.claude/agents/core/researcher.md +29 -24
  64. package/packages/@monomind/cli/.claude/agents/github/code-review-swarm.md +1 -1
  65. package/packages/@monomind/cli/.claude/agents/github/github-modes.md +1 -1
  66. package/packages/@monomind/cli/.claude/agents/github/issue-tracker.md +1 -1
  67. package/packages/@monomind/cli/.claude/agents/github/multi-repo-swarm.md +1 -1
  68. package/packages/@monomind/cli/.claude/agents/github/pr-manager.md +1 -1
  69. package/packages/@monomind/cli/.claude/agents/github/project-board-sync.md +1 -1
  70. package/packages/@monomind/cli/.claude/agents/github/release-manager.md +1 -1
  71. package/packages/@monomind/cli/.claude/agents/github/repo-architect.md +1 -1
  72. package/packages/@monomind/cli/.claude/agents/github/swarm-issue.md +1 -1
  73. package/packages/@monomind/cli/.claude/agents/github/swarm-pr.md +1 -1
  74. package/packages/@monomind/cli/.claude/agents/github/sync-coordinator.md +1 -1
  75. package/packages/@monomind/cli/.claude/agents/github/workflow-automation.md +1 -1
  76. package/packages/@monomind/cli/.claude/agents/goal/goal-planner.md +1 -1
  77. package/packages/@monomind/cli/.claude/agents/specialized/specialized-workflow-architect.md +11 -14
  78. package/packages/@monomind/cli/.claude/agents/testing/production-validator.md +8 -7
  79. package/packages/@monomind/cli/.claude/agents/testing/testing-evidence-collector.md +3 -1
  80. package/packages/@monomind/cli/.claude/commands/mastermind/_repeat.md +22 -3
  81. package/packages/@monomind/cli/.claude/commands/mastermind/architect.md +1 -1
  82. package/packages/@monomind/cli/.claude/commands/mastermind/autodev.md +1 -1
  83. package/packages/@monomind/cli/.claude/commands/mastermind/build.md +1 -1
  84. package/packages/@monomind/cli/.claude/commands/mastermind/code-review.md +5 -5
  85. package/packages/@monomind/cli/.claude/commands/mastermind/debug.md +1 -1
  86. package/packages/@monomind/cli/.claude/commands/mastermind/help.md +2 -2
  87. package/packages/@monomind/cli/.claude/commands/mastermind/idea.md +1 -1
  88. package/packages/@monomind/cli/.claude/commands/mastermind/improve.md +1 -1
  89. package/packages/@monomind/cli/.claude/commands/mastermind/okf-export.md +14 -0
  90. package/packages/@monomind/cli/.claude/commands/mastermind/okf-import.md +15 -0
  91. package/packages/@monomind/cli/.claude/commands/mastermind/plan.md +1 -1
  92. package/packages/@monomind/cli/.claude/commands/mastermind/research.md +1 -1
  93. package/packages/@monomind/cli/.claude/commands/mastermind/review.md +12 -1
  94. package/packages/@monomind/cli/.claude/commands/mastermind/runorg.md +1 -1
  95. package/packages/@monomind/cli/.claude/commands/mastermind/taskdev.md +1 -1
  96. package/packages/@monomind/cli/.claude/commands/mastermind/tdd.md +1 -1
  97. package/packages/@monomind/cli/.claude/commands/mastermind/verify.md +1 -1
  98. package/packages/@monomind/cli/.claude/helpers/graphify-freshen.cjs +16 -20
  99. package/packages/@monomind/cli/.claude/helpers/handlers/agent-start-handler.cjs +11 -36
  100. package/packages/@monomind/cli/.claude/helpers/handlers/capture-handler.cjs +110 -0
  101. package/packages/@monomind/cli/.claude/helpers/handlers/route-handler.cjs +180 -256
  102. package/packages/@monomind/cli/.claude/helpers/handlers/session-handler.cjs +139 -142
  103. package/packages/@monomind/cli/.claude/helpers/handlers/session-restore-handler.cjs +15 -10
  104. package/packages/@monomind/cli/.claude/helpers/handlers/task-handler.cjs +8 -155
  105. package/packages/@monomind/cli/.claude/helpers/hook-handler.cjs +89 -5
  106. package/packages/@monomind/cli/.claude/helpers/intelligence.cjs +164 -15
  107. package/packages/@monomind/cli/.claude/helpers/learning-service.mjs +1 -0
  108. package/packages/@monomind/cli/.claude/helpers/mastermind-activate.cjs +33 -51
  109. package/packages/@monomind/cli/.claude/helpers/monolean-activate.cjs +13 -3
  110. package/packages/@monomind/cli/.claude/helpers/monolean-propagate.cjs +7 -3
  111. package/packages/@monomind/cli/.claude/helpers/router.cjs +47 -9
  112. package/packages/@monomind/cli/.claude/helpers/utils/monograph.cjs +37 -20
  113. package/packages/@monomind/cli/.claude/skills/mastermind-skills/_repeat.md +29 -4
  114. package/packages/@monomind/cli/.claude/skills/mastermind-skills/architect.md +5 -6
  115. package/packages/@monomind/cli/.claude/skills/mastermind-skills/autodev.md +8 -5
  116. package/packages/@monomind/cli/.claude/skills/mastermind-skills/review.md +25 -11
  117. package/packages/@monomind/cli/.claude/skills/mastermind-skills/techport.md +37 -3
  118. package/packages/@monomind/cli/.claude/skills/monodesign/document.md +9 -6
  119. package/packages/@monomind/cli/.claude/skills/monodesign/extract.md +1 -1
  120. package/packages/@monomind/cli/.claude/skills/monodesign/reference/document.md +1 -1
  121. package/packages/@monomind/cli/.claude/skills/monodesign/reference/live.md +1 -1
  122. package/packages/@monomind/cli/.claude/skills/monolean/SKILL.md +1 -1
  123. package/packages/@monomind/cli/bin/mcp-server.js +11 -1
  124. package/packages/@monomind/cli/dist/src/commands/agent-ops.d.ts +1 -2
  125. package/packages/@monomind/cli/dist/src/commands/agent-ops.js +1 -59
  126. package/packages/@monomind/cli/dist/src/commands/agent.js +2 -3
  127. package/packages/@monomind/cli/dist/src/commands/analyze-diff.js +1 -1
  128. package/packages/@monomind/cli/dist/src/commands/browse-action.js +94 -2
  129. package/packages/@monomind/cli/dist/src/commands/completions.js +11 -56
  130. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.d.ts +1 -1
  131. package/packages/@monomind/cli/dist/src/commands/doctor-project-checks.js +1 -1
  132. package/packages/@monomind/cli/dist/src/commands/hive-mind-helpers.js +2 -2
  133. package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.d.ts +1 -3
  134. package/packages/@monomind/cli/dist/src/commands/hive-mind-ops.js +2 -116
  135. package/packages/@monomind/cli/dist/src/commands/hive-mind.js +2 -5
  136. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-commands.js +8 -7
  137. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-gaps.js +1 -1
  138. package/packages/@monomind/cli/dist/src/commands/hooks-coverage-routing.js +2 -2
  139. package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.d.ts +0 -3
  140. package/packages/@monomind/cli/dist/src/commands/hooks-extended-commands.js +0 -307
  141. package/packages/@monomind/cli/dist/src/commands/hooks.js +1 -12
  142. package/packages/@monomind/cli/dist/src/commands/index.d.ts +3 -51
  143. package/packages/@monomind/cli/dist/src/commands/index.js +36 -184
  144. package/packages/@monomind/cli/dist/src/commands/init-wizard.js +2 -4
  145. package/packages/@monomind/cli/dist/src/commands/mcp.js +32 -4
  146. package/packages/@monomind/cli/dist/src/commands/memory-admin.d.ts +1 -2
  147. package/packages/@monomind/cli/dist/src/commands/memory-admin.js +1 -118
  148. package/packages/@monomind/cli/dist/src/commands/memory-transfer.d.ts +1 -2
  149. package/packages/@monomind/cli/dist/src/commands/memory-transfer.js +5 -171
  150. package/packages/@monomind/cli/dist/src/commands/memory.js +3 -6
  151. package/packages/@monomind/cli/dist/src/commands/neural-core.d.ts +3 -1
  152. package/packages/@monomind/cli/dist/src/commands/neural-core.js +145 -6
  153. package/packages/@monomind/cli/dist/src/commands/neural-optimize.js +4 -4
  154. package/packages/@monomind/cli/dist/src/commands/neural-registry.d.ts +1 -1
  155. package/packages/@monomind/cli/dist/src/commands/neural-registry.js +4 -4
  156. package/packages/@monomind/cli/dist/src/commands/neural.d.ts +1 -1
  157. package/packages/@monomind/cli/dist/src/commands/neural.js +6 -6
  158. package/packages/@monomind/cli/dist/src/commands/performance.js +68 -58
  159. package/packages/@monomind/cli/dist/src/commands/providers.js +2 -131
  160. package/packages/@monomind/cli/dist/src/commands/security-misc.d.ts +0 -1
  161. package/packages/@monomind/cli/dist/src/commands/security-misc.js +69 -45
  162. package/packages/@monomind/cli/dist/src/commands/security.js +2 -4
  163. package/packages/@monomind/cli/dist/src/commands/session.js +1 -285
  164. package/packages/@monomind/cli/dist/src/commands/start.js +2 -41
  165. package/packages/@monomind/cli/dist/src/commands/status.js +18 -29
  166. package/packages/@monomind/cli/dist/src/commands/swarm.js +1 -1
  167. package/packages/@monomind/cli/dist/src/commands/task.js +2 -49
  168. package/packages/@monomind/cli/dist/src/commands/workflow.js +2 -104
  169. package/packages/@monomind/cli/dist/src/index.js +7 -0
  170. package/packages/@monomind/cli/dist/src/init/executor.js +3 -14
  171. package/packages/@monomind/cli/dist/src/init/helpers-generator.js +2 -22
  172. package/packages/@monomind/cli/dist/src/init/settings-generator.js +0 -1
  173. package/packages/@monomind/cli/dist/src/init/types.d.ts +1 -3
  174. package/packages/@monomind/cli/dist/src/init/types.js +0 -2
  175. package/packages/@monomind/cli/dist/src/mcp-client.js +0 -6
  176. package/packages/@monomind/cli/dist/src/mcp-server.js +16 -0
  177. package/packages/@monomind/cli/dist/src/mcp-tools/agent-tools.js +0 -17
  178. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/causal-infer.d.ts +5 -5
  179. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/causal-infer.js +32 -46
  180. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/consensus-verify.d.ts +2 -3
  181. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/consensus-verify.js +22 -20
  182. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/memory-gate.d.ts +3 -2
  183. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/memory-gate.js +32 -19
  184. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/quantum-topology.d.ts +4 -4
  185. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/quantum-topology.js +11 -17
  186. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/spectral-analyze.d.ts +2 -3
  187. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/spectral-analyze.js +51 -32
  188. package/packages/@monomind/cli/dist/src/mcp-tools/coherence/types.d.ts +5 -9
  189. package/packages/@monomind/cli/dist/src/mcp-tools/guidance-tools.js +2 -2
  190. package/packages/@monomind/cli/dist/src/mcp-tools/hive-mind-tools.js +25 -3
  191. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.d.ts +0 -3
  192. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-routing.js +45 -159
  193. package/packages/@monomind/cli/dist/src/mcp-tools/hooks-tools.js +1 -4
  194. package/packages/@monomind/cli/dist/src/mcp-tools/index.d.ts +0 -2
  195. package/packages/@monomind/cli/dist/src/mcp-tools/index.js +0 -3
  196. package/packages/@monomind/cli/dist/src/mcp-tools/memory-tools.js +24 -0
  197. package/packages/@monomind/cli/dist/src/mcp-tools/monograph-tools.js +452 -7
  198. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.d.ts +4 -10
  199. package/packages/@monomind/cli/dist/src/mcp-tools/neural-tools.js +28 -54
  200. package/packages/@monomind/cli/dist/src/mcp-tools/performance-tools.js +5 -17
  201. package/packages/@monomind/cli/dist/src/mcp-tools/quality/coverage-analysis/prioritize-gaps.js +2 -2
  202. package/packages/@monomind/cli/dist/src/mcp-tools/quality/security-compliance/detect-secrets.d.ts +4 -4
  203. package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.d.ts +7 -2
  204. package/packages/@monomind/cli/dist/src/mcp-tools/quality-tools.js +7 -257
  205. package/packages/@monomind/cli/dist/src/memory/intelligence.d.ts +7 -8
  206. package/packages/@monomind/cli/dist/src/memory/intelligence.js +15 -16
  207. package/packages/@monomind/cli/dist/src/memory/memory-bridge.d.ts +1 -0
  208. package/packages/@monomind/cli/dist/src/memory/memory-bridge.js +37 -0
  209. package/packages/@monomind/cli/dist/src/services/worker-daemon.d.ts +3 -21
  210. package/packages/@monomind/cli/dist/src/services/worker-daemon.js +13 -80
  211. package/packages/@monomind/cli/dist/src/suggest.js +0 -5
  212. package/packages/@monomind/cli/package.json +1 -1
  213. package/packages/@monomind/guidance/README.md +49 -1153
  214. package/packages/@monomind/guidance/package.json +1 -74
  215. package/.claude/helpers/auto-memory-hook.mjs +0 -503
  216. package/packages/@monomind/cli/.claude/helpers/auto-memory-hook.mjs +0 -503
  217. package/packages/@monomind/cli/dist/src/commands/deployment.d.ts +0 -10
  218. package/packages/@monomind/cli/dist/src/commands/deployment.js +0 -706
@@ -1,15 +1,9 @@
1
1
  /**
2
- * Neural MCP Tools for CLI
2
+ * Pattern Store MCP Tools
3
3
  *
4
- * V2 Compatibility - Neural network and ML tools
5
- *
6
- * HYBRID Implementation:
7
- * - Uses monovector ONNX embeddings when available
8
- * - Falls back to deterministic hash-based embeddings otherwise
9
- * - Pattern storage and search with cosine similarity (real math in all tiers)
10
- * - Training stores patterns as searchable embeddings (not simulated)
11
- *
12
- * Note: The lean build has no neural training. The full loop lives on monoes-full-loop.
4
+ * Embed text as vectors, store patterns, search by cosine similarity.
5
+ * Uses monovector ONNX embeddings when available, deterministic hash fallback otherwise.
6
+ * Tools are registered under the "neural" namespace for backwards compatibility.
13
7
  */
14
8
  import { getProjectCwd } from './types.js';
15
9
  import { existsSync, readFileSync, writeFileSync, renameSync, mkdirSync, statSync } from 'node:fs';
@@ -141,16 +135,16 @@ function cosineSimilarity(a, b) {
141
135
  export const neuralTools = [
142
136
  {
143
137
  name: 'neural_train',
144
- description: 'Train a neural model',
138
+ description: 'Embed and store patterns for similarity search',
145
139
  category: 'neural',
146
140
  inputSchema: {
147
141
  type: 'object',
148
142
  properties: {
149
- modelId: { type: 'string', description: 'Model ID to train' },
150
- modelType: { type: 'string', enum: ['moe', 'transformer', 'classifier', 'embedding'], description: 'Model type' },
151
- epochs: { type: 'number', description: 'Number of training epochs' },
152
- learningRate: { type: 'number', description: 'Learning rate' },
153
- data: { type: 'object', description: 'Training data' },
143
+ modelId: { type: 'string', description: 'Store ID (groups related patterns)' },
144
+ modelType: { type: 'string', enum: ['pattern', 'embedding'], description: 'Store type' },
145
+ epochs: { type: 'number', description: 'Ignored (kept for backwards compatibility)' },
146
+ learningRate: { type: 'number', description: 'Ignored (kept for backwards compatibility)' },
147
+ data: { type: 'object', description: 'Data to embed and store (array of strings or {text/content/label} objects)' },
154
148
  },
155
149
  required: ['modelType'],
156
150
  },
@@ -174,30 +168,21 @@ export const neuralTools = [
174
168
  if (Object.keys(store.models ?? {}).length >= MAX_MODELS) {
175
169
  return { success: false, error: `Model store full (max ${MAX_MODELS}). Delete old models first.` };
176
170
  }
177
- // Runtime-validate modelType against the allowed enum. The JSON schema
178
- // declares an enum but callers that bypass schema validation (e.g. direct
179
- // MCP calls) can pass arbitrary strings, which would be stored verbatim.
180
- const VALID_MODEL_TYPES = new Set(['moe', 'transformer', 'classifier', 'embedding']);
171
+ const VALID_MODEL_TYPES = new Set(['pattern', 'embedding']);
181
172
  const rawModelType = input.modelType;
182
173
  if (!rawModelType || !VALID_MODEL_TYPES.has(rawModelType)) {
183
- return { success: false, error: `Invalid modelType "${rawModelType}". Must be one of: moe, transformer, classifier, embedding` };
174
+ return { success: false, error: `Invalid modelType "${rawModelType}". Must be one of: pattern, embedding` };
184
175
  }
185
176
  const modelType = rawModelType;
186
- // Cap epochs to prevent storing absurdly large numbers in the JSON store.
187
- const MAX_EPOCHS = 10000;
188
- const rawEpochs = typeof input.epochs === 'number' && Number.isFinite(input.epochs) ? input.epochs : 10;
189
- const epochs = Math.max(1, Math.min(Math.floor(rawEpochs), MAX_EPOCHS));
177
+ const epochs = 1;
190
178
  const model = {
191
179
  id: modelId,
192
- name: `${modelType}-model`,
180
+ name: `${modelType}-store`,
193
181
  type: modelType,
194
- status: 'training',
195
- accuracy: 0,
182
+ status: 'indexing',
183
+ patternsStored: 0,
196
184
  epochs,
197
- config: {
198
- learningRate: input.learningRate || 0.001,
199
- batchSize: 32,
200
- },
185
+ config: {},
201
186
  };
202
187
  store.models[modelId] = model;
203
188
  saveNeuralStore(store);
@@ -241,7 +226,7 @@ export const neuralTools = [
241
226
  }
242
227
  }
243
228
  model.status = 'ready';
244
- model.accuracy = patternsStored > 0 ? 1.0 : 0; // accuracy = data stored, not simulated
229
+ model.patternsStored = patternsStored;
245
230
  model.trainedAt = new Date().toISOString();
246
231
  saveNeuralStore(store);
247
232
  // Mirror patterns to patterns.json so CLI commands (neural patterns list,
@@ -294,14 +279,14 @@ export const neuralTools = [
294
279
  },
295
280
  {
296
281
  name: 'neural_predict',
297
- description: 'Make predictions using a neural model',
282
+ description: 'Find similar patterns by cosine similarity',
298
283
  category: 'neural',
299
284
  inputSchema: {
300
285
  type: 'object',
301
286
  properties: {
302
287
  modelId: { type: 'string', description: 'Model ID to use' },
303
- input: { type: 'string', description: 'Input text or data' },
304
- topK: { type: 'number', description: 'Number of top predictions' },
288
+ input: { type: 'string', description: 'Text to find similar patterns for' },
289
+ topK: { type: 'number', description: 'Number of top results to return' },
305
290
  },
306
291
  required: ['input'],
307
292
  },
@@ -330,9 +315,8 @@ export const neuralTools = [
330
315
  const startTime = performance.now();
331
316
  const embedding = await generateEmbedding(inputText, 384);
332
317
  const latency = Math.round(performance.now() - startTime);
333
- // Search stored patterns via real cosine similarity.
334
- // Merge MCP models.json patterns with CLI patterns.json so both training
335
- // paths are visible from predict.
318
+ // Search stored patterns via cosine similarity.
319
+ // Merge MCP models.json patterns with CLI patterns.json.
336
320
  const MAX_SCAN = 10000;
337
321
  const EARLY_EXIT_THRESHOLD = 0.1;
338
322
  const mcpPatterns = Object.values(store.patterns);
@@ -525,7 +509,7 @@ export const neuralTools = [
525
509
  },
526
510
  {
527
511
  name: 'neural_compress',
528
- description: 'Compress neural model or embeddings',
512
+ description: 'Compress pattern store (quantize, prune, or deduplicate)',
529
513
  category: 'neural',
530
514
  inputSchema: {
531
515
  type: 'object',
@@ -634,7 +618,7 @@ export const neuralTools = [
634
618
  },
635
619
  {
636
620
  name: 'neural_status',
637
- description: 'Get neural system status',
621
+ description: 'Get pattern store status',
638
622
  category: 'neural',
639
623
  inputSchema: {
640
624
  type: 'object',
@@ -663,15 +647,11 @@ export const neuralTools = [
663
647
  const models = Object.values(store.models);
664
648
  const patterns = Object.values(store.patterns);
665
649
  return {
666
- _realEmbeddings: !!realEmbeddings,
667
650
  embeddingProvider: realEmbeddings ? embeddingServiceName : 'hash-based (deterministic)',
668
651
  models: {
669
652
  total: models.length,
670
653
  ready: models.filter(m => m.status === 'ready').length,
671
- training: models.filter(m => m.status === 'training').length,
672
- avgAccuracy: models.length > 0
673
- ? models.reduce((sum, m) => sum + m.accuracy, 0) / models.length
674
- : 0,
654
+ indexing: models.filter(m => m.status === 'indexing').length,
675
655
  },
676
656
  patterns: {
677
657
  total: patterns.length,
@@ -679,20 +659,14 @@ export const neuralTools = [
679
659
  acc[p.type] = (acc[p.type] || 0) + 1;
680
660
  return acc;
681
661
  }, {}),
682
- totalEmbeddingDims: patterns.length > 0 ? patterns[0].embedding.length : 384,
683
- },
684
- features: {
685
- hnsw: true,
686
- quantization: true,
687
- flashAttention: false,
688
- reasoningBank: true,
662
+ embeddingDims: patterns.length > 0 ? patterns[0].embedding.length : 384,
689
663
  },
690
664
  };
691
665
  },
692
666
  },
693
667
  {
694
668
  name: 'neural_optimize',
695
- description: 'Optimize neural model performance',
669
+ description: 'Optimize pattern store (deduplicate, quantize, prune empty)',
696
670
  category: 'neural',
697
671
  inputSchema: {
698
672
  type: 'object',
@@ -640,24 +640,12 @@ export const performanceTools = [
640
640
  _real: true,
641
641
  },
642
642
  latency: {
643
- current: 45,
644
- avg: 52,
645
- min: 15,
646
- max: 250,
647
- p50: 48,
648
- p95: 150,
649
- p99: 220,
650
- unit: 'ms',
643
+ _note: 'No latency telemetry collected. Wire up real instrumentation to populate this section.',
644
+ available: false,
651
645
  },
652
646
  throughput: {
653
- current: 1250,
654
- avg: 1100,
655
- min: 500,
656
- max: 2000,
657
- p50: 1050,
658
- p95: 1800,
659
- p99: 1950,
660
- unit: 'ops/s',
647
+ _note: 'No throughput telemetry collected. Wire up real instrumentation to populate this section.',
648
+ available: false,
661
649
  },
662
650
  };
663
651
  if (metric === 'all') {
@@ -681,7 +669,7 @@ export const performanceTools = [
681
669
  _real: ['cpu', 'memory'].includes(metric),
682
670
  metric,
683
671
  value: aggValue,
684
- unit: selectedMetric.unit,
672
+ unit: 'unit' in selectedMetric ? selectedMetric.unit : undefined,
685
673
  details: selectedMetric,
686
674
  timestamp: new Date().toISOString(),
687
675
  };
@@ -150,7 +150,7 @@ async function calculatePriorities(gaps, factors, weights, bridge) {
150
150
  score,
151
151
  weight: weights.complexity,
152
152
  contribution,
153
- details: `Cyclomatic complexity: ${Math.round(score * 20)}`,
153
+ details: `Estimated complexity (line-based proxy, not McCabe): ${Math.round(score * 20)}`,
154
154
  });
155
155
  totalScore += contribution;
156
156
  }
@@ -237,7 +237,7 @@ async function calculatePriorities(gaps, factors, weights, bridge) {
237
237
  }
238
238
  function calculateComplexityScore(gap) {
239
239
  const lines = gap.endLine - gap.startLine;
240
- // Estimate cyclomatic complexity from line count
240
+ // Line-based proxy not real McCabe cyclomatic complexity
241
241
  const estimatedComplexity = lines / 5;
242
242
  return Math.min(estimatedComplexity / 10, 1);
243
243
  }
@@ -15,16 +15,16 @@ export declare const DetectSecretsInputSchema: z.ZodObject<{
15
15
  scanHistory: z.ZodDefault<z.ZodBoolean>;
16
16
  }, "strip", z.ZodTypeAny, {
17
17
  targetPath: string;
18
- excludePatterns: string[];
19
18
  secretTypes: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[];
19
+ excludePatterns: string[];
20
20
  includeEntropy: boolean;
21
21
  entropyThreshold: number;
22
22
  verifySecrets: boolean;
23
23
  scanHistory: boolean;
24
24
  }, {
25
25
  targetPath: string;
26
- excludePatterns?: string[] | undefined;
27
26
  secretTypes?: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[] | undefined;
27
+ excludePatterns?: string[] | undefined;
28
28
  includeEntropy?: boolean | undefined;
29
29
  entropyThreshold?: number | undefined;
30
30
  verifySecrets?: boolean | undefined;
@@ -116,16 +116,16 @@ export declare const toolDefinition: {
116
116
  scanHistory: z.ZodDefault<z.ZodBoolean>;
117
117
  }, "strip", z.ZodTypeAny, {
118
118
  targetPath: string;
119
- excludePatterns: string[];
120
119
  secretTypes: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[];
120
+ excludePatterns: string[];
121
121
  includeEntropy: boolean;
122
122
  entropyThreshold: number;
123
123
  verifySecrets: boolean;
124
124
  scanHistory: boolean;
125
125
  }, {
126
126
  targetPath: string;
127
- excludePatterns?: string[] | undefined;
128
127
  secretTypes?: ("password" | "api-key" | "private-key" | "token" | "connection-string" | "certificate" | "aws-key" | "aws-secret" | "gcp-key" | "azure-key" | "generic")[] | undefined;
128
+ excludePatterns?: string[] | undefined;
129
129
  includeEntropy?: boolean | undefined;
130
130
  entropyThreshold?: number | undefined;
131
131
  verifySecrets?: boolean | undefined;
@@ -1,8 +1,13 @@
1
1
  /**
2
2
  * Quality Tools — built-in quality MCP tools
3
3
  *
4
- * Wraps all 16 tools for test generation, coverage, defect intelligence, security, chaos
5
- * (quality_*) and plain JSON Schema inputSchemas.
4
+ * Wraps 2 tools: coverage gap prioritization and secret detection.
5
+ *
6
+ * monolean: 14 tools were removed — their handlers fabricated results
7
+ * (hardcoded fake file coverage, Math.random()-driven projections/predictions,
8
+ * invented defect data, fake security scan findings, hardcoded compliance
9
+ * results) rather than performing real analysis. Only prioritize-gaps
10
+ * (salvageable) and detect-secrets (real) remain.
6
11
  */
7
12
  import type { MCPTool } from './types.js';
8
13
  export declare const qualityTools: MCPTool[];
@@ -1,25 +1,16 @@
1
1
  /**
2
2
  * Quality Tools — built-in quality MCP tools
3
3
  *
4
- * Wraps all 16 tools for test generation, coverage, defect intelligence, security, chaos
5
- * (quality_*) and plain JSON Schema inputSchemas.
4
+ * Wraps 2 tools: coverage gap prioritization and secret detection.
5
+ *
6
+ * monolean: 14 tools were removed — their handlers fabricated results
7
+ * (hardcoded fake file coverage, Math.random()-driven projections/predictions,
8
+ * invented defect data, fake security scan findings, hardcoded compliance
9
+ * results) rather than performing real analysis. Only prioritize-gaps
10
+ * (salvageable) and detect-secrets (real) remain.
6
11
  */
7
- import { handler as generateTestsHandler } from './quality/test-generation/generate-tests.js';
8
- import { handler as tddCycleHandler } from './quality/test-generation/tdd-cycle.js';
9
- import { handler as suggestTestsHandler } from './quality/test-generation/suggest-tests.js';
10
- import { handler as analyzeCoverageHandler } from './quality/coverage-analysis/analyze-coverage.js';
11
12
  import { handler as prioritizeGapsHandler } from './quality/coverage-analysis/prioritize-gaps.js';
12
- import { handler as trackTrendsHandler } from './quality/coverage-analysis/track-trends.js';
13
- import { handler as evaluateGateHandler } from './quality/quality-assessment/evaluate-quality-gate.js';
14
- import { handler as assessReadinessHandler } from './quality/quality-assessment/assess-readiness.js';
15
- import { handler as calculateRiskHandler } from './quality/quality-assessment/calculate-risk.js';
16
- import { handler as predictDefectsHandler } from './quality/defect-intelligence/predict-defects.js';
17
- import { handler as analyzeDefectHandler } from './quality/defect-intelligence/analyze-root-cause.js';
18
- import { handler as findSimilarDefectsHandler } from './quality/defect-intelligence/find-similar-defects.js';
19
- import { handler as securityScanHandler } from './quality/security-compliance/security-scan.js';
20
- import { handler as auditComplianceHandler } from './quality/security-compliance/audit-compliance.js';
21
13
  import { handler as detectSecretsHandler } from './quality/security-compliance/detect-secrets.js';
22
- import { handler as chaosInjectHandler } from './quality/chaos-resilience/chaos-inject.js';
23
14
  // monolean: minimal context shim — quality handlers call context.get() which
24
15
  // is optional; returning undefined is safe for all current handlers.
25
16
  const noopContext = { get: (_key) => undefined };
@@ -30,84 +21,6 @@ function wrap(handler) {
30
21
  };
31
22
  }
32
23
  export const qualityTools = [
33
- {
34
- name: 'quality_generate_tests',
35
- description: 'Generate AI-powered tests for code. Supports unit, integration, e2e, property, mutation, and fuzz test types across multiple frameworks.',
36
- category: 'quality',
37
- version: '0.1.0',
38
- inputSchema: {
39
- type: 'object',
40
- properties: {
41
- targetPath: { type: 'string', description: 'Path to file/directory to test' },
42
- testType: { type: 'string', enum: ['unit', 'integration', 'e2e', 'property', 'mutation', 'fuzz'] },
43
- framework: { type: 'string', enum: ['vitest', 'jest', 'mocha', 'pytest', 'junit'] },
44
- coverage: {
45
- type: 'object',
46
- properties: {
47
- target: { type: 'number' },
48
- focusGaps: { type: 'boolean' },
49
- },
50
- },
51
- style: { type: 'string', enum: ['tdd-london', 'tdd-chicago', 'bdd', 'example-based'] },
52
- language: { type: 'string', enum: ['typescript', 'javascript', 'python', 'java', 'go', 'rust'] },
53
- includeEdgeCases: { type: 'boolean' },
54
- includeMocks: { type: 'boolean' },
55
- maxTests: { type: 'number' },
56
- },
57
- required: ['targetPath'],
58
- },
59
- handler: wrap(generateTestsHandler),
60
- },
61
- {
62
- name: 'quality_tdd_cycle',
63
- description: 'Run a TDD red-green-refactor cycle for a requirement. Creates failing test, minimal implementation, then refactors.',
64
- category: 'quality',
65
- version: '0.1.0',
66
- inputSchema: {
67
- type: 'object',
68
- properties: {
69
- requirement: { type: 'string', description: 'Requirement or feature to implement via TDD' },
70
- targetPath: { type: 'string', description: 'Path to file/directory for implementation' },
71
- framework: { type: 'string', enum: ['vitest', 'jest', 'mocha', 'pytest', 'junit'] },
72
- language: { type: 'string', enum: ['typescript', 'javascript', 'python', 'java', 'go', 'rust'] },
73
- style: { type: 'string', enum: ['tdd-london', 'tdd-chicago', 'bdd', 'example-based'] },
74
- },
75
- required: ['requirement', 'targetPath'],
76
- },
77
- handler: wrap(tddCycleHandler),
78
- },
79
- {
80
- name: 'quality_suggest_tests',
81
- description: 'Suggest tests to improve coverage for a given file or directory. Returns prioritized test suggestions.',
82
- category: 'quality',
83
- version: '0.1.0',
84
- inputSchema: {
85
- type: 'object',
86
- properties: {
87
- targetPath: { type: 'string', description: 'Path to file/directory to analyze' },
88
- maxSuggestions: { type: 'number' },
89
- focusAreas: { type: 'array', items: { type: 'string' } },
90
- },
91
- required: ['targetPath'],
92
- },
93
- handler: wrap(suggestTestsHandler),
94
- },
95
- {
96
- name: 'quality_analyze_coverage',
97
- description: 'Analyze test coverage for a file or directory. Returns coverage metrics and identifies gaps.',
98
- category: 'quality',
99
- version: '0.1.0',
100
- inputSchema: {
101
- type: 'object',
102
- properties: {
103
- targetPath: { type: 'string', description: 'Path to file/directory to analyze' },
104
- includeUncovered: { type: 'boolean' },
105
- threshold: { type: 'number' },
106
- },
107
- required: ['targetPath'],
108
- },
109
- handler: wrap(analyzeCoverageHandler),
110
- },
111
24
  {
112
25
  name: 'quality_prioritize_gaps',
113
26
  description: 'Prioritize coverage gaps by risk and impact. Returns ordered list of gaps to address.',
@@ -124,151 +37,6 @@ export const qualityTools = [
124
37
  },
125
38
  handler: wrap(prioritizeGapsHandler),
126
39
  },
127
- {
128
- name: 'quality_track_trends',
129
- description: 'Track coverage trends over time. Returns trend analysis and regression detection.',
130
- category: 'quality',
131
- version: '0.1.0',
132
- inputSchema: {
133
- type: 'object',
134
- properties: {
135
- targetPath: { type: 'string' },
136
- period: { type: 'string', enum: ['day', 'week', 'month'] },
137
- metric: { type: 'string', enum: ['line', 'branch', 'function'] },
138
- },
139
- required: [],
140
- },
141
- handler: wrap(trackTrendsHandler),
142
- },
143
- {
144
- name: 'quality_evaluate_gate',
145
- description: 'Evaluate whether code passes quality gates (coverage thresholds, complexity, etc.).',
146
- category: 'quality',
147
- version: '0.1.0',
148
- inputSchema: {
149
- type: 'object',
150
- properties: {
151
- targetPath: { type: 'string' },
152
- gates: { type: 'array', items: { type: 'object' } },
153
- strict: { type: 'boolean' },
154
- },
155
- required: [],
156
- },
157
- handler: wrap(evaluateGateHandler),
158
- },
159
- {
160
- name: 'quality_assess_readiness',
161
- description: 'Assess code readiness for release. Checks quality gates, test coverage, and risk factors.',
162
- category: 'quality',
163
- version: '0.1.0',
164
- inputSchema: {
165
- type: 'object',
166
- properties: {
167
- targetPath: { type: 'string' },
168
- releaseType: { type: 'string', enum: ['major', 'minor', 'patch'] },
169
- checkList: { type: 'array', items: { type: 'string' } },
170
- },
171
- required: [],
172
- },
173
- handler: wrap(assessReadinessHandler),
174
- },
175
- {
176
- name: 'quality_calculate_risk',
177
- description: 'Calculate risk score for a file or change. Returns risk metrics and recommendations.',
178
- category: 'quality',
179
- version: '0.1.0',
180
- inputSchema: {
181
- type: 'object',
182
- properties: {
183
- targetPath: { type: 'string', description: 'Path to file/directory to assess' },
184
- includeHistory: { type: 'boolean' },
185
- riskFactors: { type: 'array', items: { type: 'string' } },
186
- },
187
- required: ['targetPath'],
188
- },
189
- handler: wrap(calculateRiskHandler),
190
- },
191
- {
192
- name: 'quality_predict_defects',
193
- description: 'Predict defect-prone areas in code using static analysis and historical patterns.',
194
- category: 'quality',
195
- version: '0.1.0',
196
- inputSchema: {
197
- type: 'object',
198
- properties: {
199
- targetPath: { type: 'string', description: 'Path to file/directory to analyze' },
200
- confidence: { type: 'number' },
201
- maxPredictions: { type: 'number' },
202
- },
203
- required: ['targetPath'],
204
- },
205
- handler: wrap(predictDefectsHandler),
206
- },
207
- {
208
- name: 'quality_analyze_defect',
209
- description: 'Analyze root cause of a defect. Returns causal chain, contributing factors, and fix recommendations.',
210
- category: 'quality',
211
- version: '0.1.0',
212
- inputSchema: {
213
- type: 'object',
214
- properties: {
215
- defect: { type: 'object', description: 'Defect description with title, description, stackTrace' },
216
- codeContext: { type: 'string' },
217
- includeFixSuggestions: { type: 'boolean' },
218
- },
219
- required: ['defect'],
220
- },
221
- handler: wrap(analyzeDefectHandler),
222
- },
223
- {
224
- name: 'quality_find_similar_defects',
225
- description: 'Find defects similar to a given query using semantic search.',
226
- category: 'quality',
227
- version: '0.1.0',
228
- inputSchema: {
229
- type: 'object',
230
- properties: {
231
- query: { type: 'string', description: 'Defect description to search for' },
232
- maxResults: { type: 'number' },
233
- threshold: { type: 'number' },
234
- },
235
- required: ['query'],
236
- },
237
- handler: wrap(findSimilarDefectsHandler),
238
- },
239
- {
240
- name: 'quality_security_scan',
241
- description: 'Scan code for security vulnerabilities. Returns findings with severity, location, and remediation.',
242
- category: 'quality',
243
- version: '0.1.0',
244
- inputSchema: {
245
- type: 'object',
246
- properties: {
247
- targetPath: { type: 'string', description: 'Path to file/directory to scan' },
248
- scanType: { type: 'string', enum: ['sast', 'dependency', 'all'] },
249
- severity: { type: 'string', enum: ['low', 'medium', 'high', 'critical'] },
250
- excludePatterns: { type: 'array', items: { type: 'string' } },
251
- },
252
- required: ['targetPath'],
253
- },
254
- handler: wrap(securityScanHandler),
255
- },
256
- {
257
- name: 'quality_audit_compliance',
258
- description: 'Audit code for compliance with security standards (OWASP, CWE, GDPR, etc.).',
259
- category: 'quality',
260
- version: '0.1.0',
261
- inputSchema: {
262
- type: 'object',
263
- properties: {
264
- targetPath: { type: 'string', description: 'Path to file/directory to audit' },
265
- standards: { type: 'array', items: { type: 'string' } },
266
- strict: { type: 'boolean' },
267
- },
268
- required: ['targetPath'],
269
- },
270
- handler: wrap(auditComplianceHandler),
271
- },
272
40
  {
273
41
  name: 'quality_detect_secrets',
274
42
  description: 'Detect hardcoded secrets, API keys, and credentials in code.',
@@ -286,23 +54,5 @@ export const qualityTools = [
286
54
  },
287
55
  handler: wrap(detectSecretsHandler),
288
56
  },
289
- {
290
- name: 'quality_chaos_inject',
291
- description: 'Inject chaos (failures, latency, errors) into a target to test resilience.',
292
- category: 'quality',
293
- version: '0.1.0',
294
- inputSchema: {
295
- type: 'object',
296
- properties: {
297
- target: { type: 'string', description: 'Target service or component' },
298
- failureType: { type: 'string', enum: ['latency', 'error', 'crash', 'resource-exhaustion', 'network-partition'] },
299
- duration: { type: 'number' },
300
- intensity: { type: 'number' },
301
- dryRun: { type: 'boolean' },
302
- },
303
- required: ['target', 'failureType'],
304
- },
305
- handler: wrap(chaosInjectHandler),
306
- },
307
57
  ];
308
58
  //# sourceMappingURL=quality-tools.js.map
@@ -13,8 +13,7 @@
13
13
  export interface SonaConfig {
14
14
  instantLoopEnabled: boolean;
15
15
  backgroundLoopEnabled: boolean;
16
- loraLearningRate: number;
17
- loraRank: number;
16
+ confidenceLearningRate: number;
18
17
  ewcLambda: number;
19
18
  maxTrajectorySize: number;
20
19
  patternThreshold: number;
@@ -104,7 +103,7 @@ declare class LocalSonaCoordinator {
104
103
  */
105
104
  addTrajectoryStep(step: TrajectoryStep): void;
106
105
  /**
107
- * End the current trajectory with a verdict and apply RL updates.
106
+ * End the current trajectory with a verdict and apply confidence updates.
108
107
  * Reward mapping: success=1.0, partial=0.5, failure=-0.5
109
108
  *
110
109
  * For successful/partial trajectories, boosts confidence of similar patterns
@@ -116,10 +115,10 @@ declare class LocalSonaCoordinator {
116
115
  }>;
117
116
  /**
118
117
  * Distill learning from recent successful trajectories.
119
- * Applies LoRA-style confidence updates and integrates EWC++ consolidation.
118
+ * Applies incremental confidence updates and integrates EWC consolidation.
120
119
  *
121
120
  * For each successful trajectory step with high confidence,
122
- * increases the pattern's stored confidence by loraLearningRate * reward.
121
+ * increases the pattern's stored confidence by confidenceLearningRate * reward.
123
122
  * Before applying updates, checks EWC penalty to prevent catastrophic forgetting.
124
123
  */
125
124
  distillLearning(bank: LocalReasoningBank): Promise<{
@@ -264,8 +263,8 @@ export declare function getSonaCoordinator(): LocalSonaCoordinator | null;
264
263
  */
265
264
  export declare function getReasoningBank(): LocalReasoningBank | null;
266
265
  /**
267
- * End the current trajectory with a verdict and apply RL updates.
268
- * This is the public API for the SONA RL loop.
266
+ * End the current trajectory with a verdict and apply confidence updates.
267
+ * This is the public API for the SONA feedback loop.
269
268
  *
270
269
  * @param verdict - 'success' (reward=1.0), 'partial' (0.5), or 'failure' (-0.5)
271
270
  * @returns Update statistics or null if not initialized
@@ -276,7 +275,7 @@ export declare function endTrajectoryWithVerdict(verdict: 'success' | 'failure'
276
275
  } | null>;
277
276
  /**
278
277
  * Distill learning from recent successful trajectories.
279
- * Applies LoRA-style confidence updates with EWC++ consolidation protection.
278
+ * Applies incremental confidence updates with EWC consolidation protection.
280
279
  *
281
280
  * @returns Distillation statistics or null if not initialized
282
281
  */