@llm-dev-ops/agentics-cli 1.4.59 → 1.4.69

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 (452) hide show
  1. package/README.md +1 -1
  2. package/dist/commands/agents.d.ts.map +1 -1
  3. package/dist/commands/agents.js +167 -0
  4. package/dist/commands/agents.js.map +1 -1
  5. package/dist/pipeline/auto-chain.d.ts +1 -0
  6. package/dist/pipeline/auto-chain.d.ts.map +1 -1
  7. package/dist/pipeline/auto-chain.js +124 -37
  8. package/dist/pipeline/auto-chain.js.map +1 -1
  9. package/dist/pipeline/execution-context.d.ts.map +1 -1
  10. package/dist/pipeline/execution-context.js +12 -37
  11. package/dist/pipeline/execution-context.js.map +1 -1
  12. package/dist/pipeline/phase2/phases/adr-generator.d.ts.map +1 -1
  13. package/dist/pipeline/phase2/phases/adr-generator.js +160 -1
  14. package/dist/pipeline/phase2/phases/adr-generator.js.map +1 -1
  15. package/dist/pipeline/phase2/phases/ddd-generator.d.ts.map +1 -1
  16. package/dist/pipeline/phase2/phases/ddd-generator.js +400 -3
  17. package/dist/pipeline/phase2/phases/ddd-generator.js.map +1 -1
  18. package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts +43 -0
  19. package/dist/pipeline/phase2/phases/ddd-quality-gate.d.ts.map +1 -0
  20. package/dist/pipeline/phase2/phases/ddd-quality-gate.js +413 -0
  21. package/dist/pipeline/phase2/phases/ddd-quality-gate.js.map +1 -0
  22. package/dist/pipeline/phase2/phases/research-dossier.d.ts +0 -13
  23. package/dist/pipeline/phase2/phases/research-dossier.d.ts.map +1 -1
  24. package/dist/pipeline/phase2/phases/research-dossier.js +114 -1
  25. package/dist/pipeline/phase2/phases/research-dossier.js.map +1 -1
  26. package/dist/pipeline/phase2/phases/research-quality-gate.d.ts +48 -0
  27. package/dist/pipeline/phase2/phases/research-quality-gate.d.ts.map +1 -0
  28. package/dist/pipeline/phase2/phases/research-quality-gate.js +322 -0
  29. package/dist/pipeline/phase2/phases/research-quality-gate.js.map +1 -0
  30. package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts +41 -0
  31. package/dist/pipeline/phase2/phases/sparc-quality-gate.d.ts.map +1 -0
  32. package/dist/pipeline/phase2/phases/sparc-quality-gate.js +350 -0
  33. package/dist/pipeline/phase2/phases/sparc-quality-gate.js.map +1 -0
  34. package/dist/pipeline/phase2/phases/sparc-specification.d.ts +14 -0
  35. package/dist/pipeline/phase2/phases/sparc-specification.d.ts.map +1 -1
  36. package/dist/pipeline/phase2/phases/sparc-specification.js +500 -10
  37. package/dist/pipeline/phase2/phases/sparc-specification.js.map +1 -1
  38. package/dist/pipeline/phase2/phases/tdd-plan-generator.js +1 -1
  39. package/dist/pipeline/phase2/phases/tdd-plan-generator.js.map +1 -1
  40. package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts +72 -0
  41. package/dist/pipeline/phase2/phases/tech-stack-detector.d.ts.map +1 -0
  42. package/dist/pipeline/phase2/phases/tech-stack-detector.js +332 -0
  43. package/dist/pipeline/phase2/phases/tech-stack-detector.js.map +1 -0
  44. package/dist/pipeline/phase2/types.d.ts +2 -0
  45. package/dist/pipeline/phase2/types.d.ts.map +1 -1
  46. package/dist/pipeline/phase3/phases/domain-codegen.d.ts.map +1 -1
  47. package/dist/pipeline/phase3/phases/domain-codegen.js +169 -4
  48. package/dist/pipeline/phase3/phases/domain-codegen.js.map +1 -1
  49. package/dist/pipeline/phase3/phases/test-generator.d.ts.map +1 -1
  50. package/dist/pipeline/phase3/phases/test-generator.js +12 -2
  51. package/dist/pipeline/phase3/phases/test-generator.js.map +1 -1
  52. package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.d.ts.map +1 -1
  53. package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js +99 -1
  54. package/dist/pipeline/phase3-sparc/phase3-sparc-coordinator.js.map +1 -1
  55. package/dist/pipeline/phase4/phases/deployment-generator.d.ts +17 -4
  56. package/dist/pipeline/phase4/phases/deployment-generator.d.ts.map +1 -1
  57. package/dist/pipeline/phase4/phases/deployment-generator.js +364 -44
  58. package/dist/pipeline/phase4/phases/deployment-generator.js.map +1 -1
  59. package/dist/pipeline/phase4/phases/erp-client-generator.d.ts.map +1 -1
  60. package/dist/pipeline/phase4/phases/erp-client-generator.js +27 -15
  61. package/dist/pipeline/phase4/phases/erp-client-generator.js.map +1 -1
  62. package/dist/pipeline/phase4/phases/erp-target-resolver.d.ts.map +1 -1
  63. package/dist/pipeline/phase4/phases/erp-target-resolver.js +49 -2
  64. package/dist/pipeline/phase4/phases/erp-target-resolver.js.map +1 -1
  65. package/dist/pipeline/phase4/phases/http-server-generator.d.ts.map +1 -1
  66. package/dist/pipeline/phase4/phases/http-server-generator.js +263 -3
  67. package/dist/pipeline/phase4/phases/http-server-generator.js.map +1 -1
  68. package/dist/pipeline/phase4/phases/infra-adapter-generator.d.ts.map +1 -1
  69. package/dist/pipeline/phase4/phases/infra-adapter-generator.js +335 -37
  70. package/dist/pipeline/phase4/phases/infra-adapter-generator.js.map +1 -1
  71. package/dist/pipeline/phase4/types.d.ts +3 -1
  72. package/dist/pipeline/phase4/types.d.ts.map +1 -1
  73. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.d.ts.map +1 -1
  74. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js +211 -2
  75. package/dist/pipeline/phase4-adrs/phase4-adrs-coordinator.js.map +1 -1
  76. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts +54 -0
  77. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.d.ts.map +1 -0
  78. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js +417 -0
  79. package/dist/pipeline/phase5-build/phases/implementation-quality-gate.js.map +1 -0
  80. package/dist/pipeline/phases/prompt-generator.js +1 -1
  81. package/dist/pipeline/phases/prompt-generator.js.map +1 -1
  82. package/dist/pipeline/ruflo-phase-executor.d.ts +116 -1
  83. package/dist/pipeline/ruflo-phase-executor.d.ts.map +1 -1
  84. package/dist/pipeline/ruflo-phase-executor.js +666 -159
  85. package/dist/pipeline/ruflo-phase-executor.js.map +1 -1
  86. package/dist/pipeline/swarm-orchestrator.d.ts.map +1 -1
  87. package/dist/pipeline/swarm-orchestrator.js +62 -6
  88. package/dist/pipeline/swarm-orchestrator.js.map +1 -1
  89. package/dist/routing/capability-classifier.d.ts +43 -0
  90. package/dist/routing/capability-classifier.d.ts.map +1 -0
  91. package/dist/routing/capability-classifier.js +157 -0
  92. package/dist/routing/capability-classifier.js.map +1 -0
  93. package/dist/routing/composition-engine.d.ts +77 -0
  94. package/dist/routing/composition-engine.d.ts.map +1 -0
  95. package/dist/routing/composition-engine.js +249 -0
  96. package/dist/routing/composition-engine.js.map +1 -0
  97. package/dist/routing/graph-federation.d.ts +71 -0
  98. package/dist/routing/graph-federation.d.ts.map +1 -0
  99. package/dist/routing/graph-federation.js +210 -0
  100. package/dist/routing/graph-federation.js.map +1 -0
  101. package/dist/routing/graph-loader.d.ts +74 -0
  102. package/dist/routing/graph-loader.d.ts.map +1 -0
  103. package/dist/routing/graph-loader.js +383 -0
  104. package/dist/routing/graph-loader.js.map +1 -0
  105. package/dist/routing/graph-router.d.ts +103 -0
  106. package/dist/routing/graph-router.d.ts.map +1 -0
  107. package/dist/routing/graph-router.js +415 -0
  108. package/dist/routing/graph-router.js.map +1 -0
  109. package/dist/routing/graph-validator.d.ts +44 -0
  110. package/dist/routing/graph-validator.d.ts.map +1 -0
  111. package/dist/routing/graph-validator.js +329 -0
  112. package/dist/routing/graph-validator.js.map +1 -0
  113. package/dist/routing/index.d.ts +52 -0
  114. package/dist/routing/index.d.ts.map +1 -0
  115. package/dist/routing/index.js +68 -0
  116. package/dist/routing/index.js.map +1 -0
  117. package/dist/routing/outcome-recorder.d.ts +71 -0
  118. package/dist/routing/outcome-recorder.d.ts.map +1 -0
  119. package/dist/routing/outcome-recorder.js +133 -0
  120. package/dist/routing/outcome-recorder.js.map +1 -0
  121. package/dist/routing/weight-adjuster.d.ts +59 -0
  122. package/dist/routing/weight-adjuster.d.ts.map +1 -0
  123. package/dist/routing/weight-adjuster.js +167 -0
  124. package/dist/routing/weight-adjuster.js.map +1 -0
  125. package/dist/routing/weighted-resolver.d.ts +55 -0
  126. package/dist/routing/weighted-resolver.d.ts.map +1 -0
  127. package/dist/routing/weighted-resolver.js +133 -0
  128. package/dist/routing/weighted-resolver.js.map +1 -0
  129. package/dist/synthesis/ask-artifact-writer.d.ts.map +1 -1
  130. package/dist/synthesis/ask-artifact-writer.js +8 -0
  131. package/dist/synthesis/ask-artifact-writer.js.map +1 -1
  132. package/dist/synthesis/simulation-artifact-generator.d.ts +14 -0
  133. package/dist/synthesis/simulation-artifact-generator.d.ts.map +1 -1
  134. package/dist/synthesis/simulation-artifact-generator.js +224 -1
  135. package/dist/synthesis/simulation-artifact-generator.js.map +1 -1
  136. package/dist/synthesis/simulation-renderers.d.ts.map +1 -1
  137. package/dist/synthesis/simulation-renderers.js +211 -40
  138. package/dist/synthesis/simulation-renderers.js.map +1 -1
  139. package/package.json +3 -1
  140. package/scripts/postinstall.sh +25 -0
  141. package/dist/bundled-agents/connector-hub-agents/package-lock.json +0 -11697
  142. package/dist/bundled-agents/connector-hub-agents/package.json +0 -75
  143. package/dist/bundled-agents/connector-hub-agents/tsconfig.build.json +0 -22
  144. package/dist/bundled-agents/connector-hub-agents/tsconfig.json +0 -57
  145. package/dist/bundled-agents/copilot-agents/functions/.gcloudignore +0 -17
  146. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.d.ts +0 -14
  147. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js +0 -35
  148. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/cors.js.map +0 -1
  149. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.d.ts +0 -55
  150. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js +0 -40
  151. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/envelope.js.map +0 -1
  152. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.d.ts +0 -22
  153. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js +0 -38
  154. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/health.js.map +0 -1
  155. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.d.ts +0 -34
  156. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js +0 -186
  157. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/index.js.map +0 -1
  158. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.d.ts +0 -36
  159. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js +0 -121
  160. package/dist/bundled-agents/copilot-agents/functions/dist/functions/src/router.js.map +0 -1
  161. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.d.ts +0 -157
  162. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js +0 -948
  163. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/config-validation-agent.js.map +0 -1
  164. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.d.ts +0 -9
  165. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js +0 -27
  166. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/config-validation/index.js.map +0 -1
  167. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
  168. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js +0 -50
  169. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/agent-span-wrapper.js.map +0 -1
  170. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.d.ts +0 -214
  171. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js +0 -91
  172. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/base-agent.js.map +0 -1
  173. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.d.ts +0 -1166
  174. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js +0 -308
  175. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/config-validation-schemas.js.map +0 -1
  176. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.d.ts +0 -59
  177. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js +0 -62
  178. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decision-event.js.map +0 -1
  179. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.d.ts +0 -400
  180. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js +0 -113
  181. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/decomposer-schemas.js.map +0 -1
  182. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.d.ts +0 -250
  183. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js +0 -169
  184. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/execution-graph.js.map +0 -1
  185. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.d.ts +0 -17
  186. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js +0 -97
  187. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/index.js.map +0 -1
  188. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
  189. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js +0 -246
  190. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intelligence-schemas.js.map +0 -1
  191. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1085
  192. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js +0 -218
  193. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
  194. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -949
  195. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js +0 -253
  196. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
  197. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -657
  198. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js +0 -205
  199. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
  200. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.d.ts +0 -285
  201. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js +0 -106
  202. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/pipeline-schemas.js.map +0 -1
  203. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.d.ts +0 -581
  204. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js +0 -136
  205. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/planner-schemas.js.map +0 -1
  206. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.d.ts +0 -791
  207. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js +0 -225
  208. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/contracts/reflection-schemas.js.map +0 -1
  209. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.d.ts +0 -120
  210. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js +0 -535
  211. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/decomposer-agent.js.map +0 -1
  212. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.d.ts +0 -9
  213. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js +0 -18
  214. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/decomposer/index.js.map +0 -1
  215. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.d.ts +0 -4
  216. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js +0 -9
  217. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/index.js.map +0 -1
  218. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
  219. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
  220. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
  221. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.d.ts +0 -10
  222. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js +0 -25
  223. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/index.js.map +0 -1
  224. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
  225. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
  226. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
  227. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.d.ts +0 -11
  228. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js +0 -25
  229. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/meta-reasoner/telemetry.js.map +0 -1
  230. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.d.ts +0 -6
  231. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js +0 -15
  232. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/index.js.map +0 -1
  233. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
  234. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
  235. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
  236. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
  237. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
  238. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
  239. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.d.ts +0 -73
  240. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js +0 -192
  241. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/objective-clarifier/telemetry.js.map +0 -1
  242. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.d.ts +0 -11
  243. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js +0 -25
  244. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/index.js.map +0 -1
  245. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.d.ts +0 -127
  246. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js +0 -483
  247. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/planner-agent.js.map +0 -1
  248. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.d.ts +0 -49
  249. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js +0 -125
  250. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/ruvector-persistence.js.map +0 -1
  251. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.d.ts +0 -73
  252. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js +0 -192
  253. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/planner/telemetry.js.map +0 -1
  254. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.d.ts +0 -11
  255. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js +0 -27
  256. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/index.js.map +0 -1
  257. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.d.ts +0 -122
  258. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js +0 -645
  259. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/reflection-agent.js.map +0 -1
  260. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.d.ts +0 -59
  261. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js +0 -156
  262. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/ruvector-persistence.js.map +0 -1
  263. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.d.ts +0 -88
  264. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js +0 -246
  265. package/dist/bundled-agents/copilot-agents/functions/dist/services/agents/reflection/telemetry.js.map +0 -1
  266. package/dist/bundled-agents/copilot-agents/functions/index.js +0 -4
  267. package/dist/bundled-agents/copilot-agents/functions/jest.config.js +0 -29
  268. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.d.ts +0 -14
  269. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js +0 -35
  270. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/cors.js.map +0 -1
  271. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.d.ts +0 -27
  272. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js +0 -21
  273. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/envelope.js.map +0 -1
  274. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.d.ts +0 -22
  275. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js +0 -38
  276. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/health.js.map +0 -1
  277. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.d.ts +0 -34
  278. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js +0 -174
  279. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/index.js.map +0 -1
  280. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.d.ts +0 -27
  281. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js +0 -107
  282. package/dist/bundled-agents/copilot-agents/functions/lib/functions/src/router.js.map +0 -1
  283. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.d.ts +0 -157
  284. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js +0 -941
  285. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/config-validation-agent.js.map +0 -1
  286. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.d.ts +0 -9
  287. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js +0 -27
  288. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/config-validation/index.js.map +0 -1
  289. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.d.ts +0 -23
  290. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js +0 -50
  291. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/agent-span-wrapper.js.map +0 -1
  292. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.d.ts +0 -185
  293. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js +0 -86
  294. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/base-agent.js.map +0 -1
  295. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.d.ts +0 -1081
  296. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js +0 -305
  297. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/config-validation-schemas.js.map +0 -1
  298. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.d.ts +0 -59
  299. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js +0 -62
  300. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decision-event.js.map +0 -1
  301. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.d.ts +0 -315
  302. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js +0 -110
  303. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/decomposer-schemas.js.map +0 -1
  304. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.d.ts +0 -250
  305. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js +0 -169
  306. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/execution-graph.js.map +0 -1
  307. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.d.ts +0 -16
  308. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js +0 -88
  309. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/index.js.map +0 -1
  310. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.d.ts +0 -1674
  311. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js +0 -246
  312. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intelligence-schemas.js.map +0 -1
  313. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.d.ts +0 -1000
  314. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js +0 -215
  315. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/intent-classifier-schemas.js.map +0 -1
  316. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.d.ts +0 -864
  317. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js +0 -250
  318. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/meta-reasoner-schemas.js.map +0 -1
  319. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.d.ts +0 -572
  320. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js +0 -202
  321. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/objective-clarifier-schemas.js.map +0 -1
  322. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.d.ts +0 -496
  323. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js +0 -133
  324. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/planner-schemas.js.map +0 -1
  325. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.d.ts +0 -706
  326. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js +0 -222
  327. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/contracts/reflection-schemas.js.map +0 -1
  328. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.d.ts +0 -107
  329. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js +0 -360
  330. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/decomposer-agent.js.map +0 -1
  331. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.d.ts +0 -9
  332. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js +0 -18
  333. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/decomposer/index.js.map +0 -1
  334. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.d.ts +0 -4
  335. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js +0 -9
  336. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/index.js.map +0 -1
  337. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.d.ts +0 -123
  338. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js +0 -609
  339. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/intent-classifier/intent-classifier-agent.js.map +0 -1
  340. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.d.ts +0 -10
  341. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js +0 -25
  342. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/index.js.map +0 -1
  343. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.d.ts +0 -111
  344. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js +0 -686
  345. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/meta-reasoner-agent.js.map +0 -1
  346. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.d.ts +0 -11
  347. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js +0 -25
  348. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/meta-reasoner/telemetry.js.map +0 -1
  349. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.d.ts +0 -6
  350. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js +0 -15
  351. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/index.js.map +0 -1
  352. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.d.ts +0 -126
  353. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js +0 -780
  354. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/objective-clarifier-agent.js.map +0 -1
  355. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.d.ts +0 -49
  356. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js +0 -125
  357. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/ruvector-persistence.js.map +0 -1
  358. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.d.ts +0 -73
  359. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js +0 -192
  360. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/objective-clarifier/telemetry.js.map +0 -1
  361. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.d.ts +0 -11
  362. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js +0 -25
  363. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/index.js.map +0 -1
  364. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.d.ts +0 -119
  365. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js +0 -421
  366. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/planner-agent.js.map +0 -1
  367. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.d.ts +0 -49
  368. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js +0 -125
  369. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/ruvector-persistence.js.map +0 -1
  370. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.d.ts +0 -73
  371. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js +0 -192
  372. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/planner/telemetry.js.map +0 -1
  373. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.d.ts +0 -11
  374. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js +0 -27
  375. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/index.js.map +0 -1
  376. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.d.ts +0 -122
  377. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js +0 -645
  378. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/reflection-agent.js.map +0 -1
  379. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.d.ts +0 -59
  380. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js +0 -156
  381. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/ruvector-persistence.js.map +0 -1
  382. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.d.ts +0 -88
  383. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js +0 -246
  384. package/dist/bundled-agents/copilot-agents/functions/lib/services/agents/reflection/telemetry.js.map +0 -1
  385. package/dist/bundled-agents/copilot-agents/functions/package-lock.json +0 -5473
  386. package/dist/bundled-agents/copilot-agents/functions/package.json +0 -40
  387. package/dist/bundled-agents/copilot-agents/functions/src/claude.ts +0 -71
  388. package/dist/bundled-agents/copilot-agents/functions/src/cors.ts +0 -36
  389. package/dist/bundled-agents/copilot-agents/functions/src/envelope.ts +0 -77
  390. package/dist/bundled-agents/copilot-agents/functions/src/handler.test.ts +0 -340
  391. package/dist/bundled-agents/copilot-agents/functions/src/health.ts +0 -53
  392. package/dist/bundled-agents/copilot-agents/functions/src/index.ts +0 -201
  393. package/dist/bundled-agents/copilot-agents/functions/src/router.ts +0 -148
  394. package/dist/bundled-agents/copilot-agents/functions/tsconfig.json +0 -31
  395. package/dist/bundled-agents/copilot-agents/package-lock.json +0 -11825
  396. package/dist/bundled-agents/copilot-agents/package.json +0 -5
  397. package/dist/bundled-agents/governance-dashboard-agents/package-lock.json +0 -8282
  398. package/dist/bundled-agents/governance-dashboard-agents/package.json +0 -13
  399. package/dist/bundled-agents/orchestrator-agents/functions/contracts/index.js +0 -590
  400. package/dist/bundled-agents/orchestrator-agents/functions/index.js +0 -442
  401. package/dist/bundled-agents/orchestrator-agents/functions/test.js +0 -325
  402. package/dist/bundled-agents/orchestrator-agents/index.js +0 -6
  403. package/dist/bundled-agents/orchestrator-agents/package-lock.json +0 -13254
  404. package/dist/bundled-agents/orchestrator-agents/package.json +0 -20
  405. package/dist/bundled-agents/platform-agents/package-lock.json +0 -1723
  406. package/dist/bundled-agents/platform-agents/package.json +0 -22
  407. package/dist/bundled-agents/platform-agents/src/agents/decision-memo.ts +0 -463
  408. package/dist/bundled-agents/platform-agents/src/agents/decision.ts +0 -234
  409. package/dist/bundled-agents/platform-agents/src/agents/executive-summary.ts +0 -229
  410. package/dist/bundled-agents/platform-agents/src/agents/risk-score.ts +0 -327
  411. package/dist/bundled-agents/platform-agents/src/claude.ts +0 -71
  412. package/dist/bundled-agents/platform-agents/src/cors.ts +0 -24
  413. package/dist/bundled-agents/platform-agents/src/envelope.ts +0 -37
  414. package/dist/bundled-agents/platform-agents/src/health.ts +0 -20
  415. package/dist/bundled-agents/platform-agents/src/index.ts +0 -171
  416. package/dist/bundled-agents/platform-agents/src/router.ts +0 -38
  417. package/dist/bundled-agents/platform-agents/src/text-analysis.ts +0 -238
  418. package/dist/bundled-agents/platform-agents/tsconfig.json +0 -19
  419. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts +0 -3
  420. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.d.ts.map +0 -1
  421. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js +0 -43
  422. package/dist/bundled-agents/sentinel-agents/lib/agents/alert.js.map +0 -1
  423. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts +0 -3
  424. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.d.ts.map +0 -1
  425. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js +0 -30
  426. package/dist/bundled-agents/sentinel-agents/lib/agents/anomaly.js.map +0 -1
  427. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts +0 -3
  428. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.d.ts.map +0 -1
  429. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js +0 -53
  430. package/dist/bundled-agents/sentinel-agents/lib/agents/correlation.js.map +0 -1
  431. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts +0 -3
  432. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.d.ts.map +0 -1
  433. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js +0 -51
  434. package/dist/bundled-agents/sentinel-agents/lib/agents/drift.js.map +0 -1
  435. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts +0 -3
  436. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.d.ts.map +0 -1
  437. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js +0 -36
  438. package/dist/bundled-agents/sentinel-agents/lib/agents/rca.js.map +0 -1
  439. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts +0 -2
  440. package/dist/bundled-agents/sentinel-agents/lib/index.d.ts.map +0 -1
  441. package/dist/bundled-agents/sentinel-agents/lib/index.js +0 -70
  442. package/dist/bundled-agents/sentinel-agents/lib/index.js.map +0 -1
  443. package/dist/bundled-agents/sentinel-agents/package-lock.json +0 -12591
  444. package/dist/bundled-agents/sentinel-agents/package.json +0 -62
  445. package/dist/bundled-agents/sentinel-agents/src/agents/alert.ts +0 -46
  446. package/dist/bundled-agents/sentinel-agents/src/agents/anomaly.ts +0 -33
  447. package/dist/bundled-agents/sentinel-agents/src/agents/correlation.ts +0 -56
  448. package/dist/bundled-agents/sentinel-agents/src/agents/drift.ts +0 -54
  449. package/dist/bundled-agents/sentinel-agents/src/agents/rca.ts +0 -38
  450. package/dist/bundled-agents/sentinel-agents/src/claude.ts +0 -71
  451. package/dist/bundled-agents/sentinel-agents/src/index.ts +0 -77
  452. package/dist/bundled-agents/sentinel-agents/tsconfig.json +0 -20
@@ -1,686 +0,0 @@
1
- "use strict";
2
- /**
3
- * Meta-Reasoner Agent
4
- *
5
- * Purpose: Evaluate reasoning quality and consistency across agents
6
- * Classification: META_ANALYSIS, REASONING_QUALITY_ASSESSMENT
7
- * decision_type: meta_reasoning_analysis
8
- *
9
- * Scope:
10
- * - Detect contradictions
11
- * - Assess confidence calibration
12
- * - Identify systemic reasoning issues
13
- *
14
- * CONSTITUTION COMPLIANCE:
15
- * ✓ Stateless at runtime
16
- * ✓ Emits exactly ONE DecisionEvent per invocation
17
- * ✓ Persists ONLY via ruvector-service
18
- * ✓ NEVER connects directly to databases
19
- * ✓ NEVER executes SQL
20
- * ✓ NEVER modifies runtime behavior
21
- * ✓ NEVER orchestrates other agents
22
- * ✓ NEVER enforces policy
23
- * ✓ NEVER intercepts execution paths
24
- *
25
- * Must Never:
26
- * - Override outputs
27
- * - Enforce corrections
28
- * - Execute logic
29
- */
30
- Object.defineProperty(exports, "__esModule", { value: true });
31
- exports.MetaReasonerAgent = void 0;
32
- const uuid_1 = require("uuid");
33
- const contracts_1 = require("../contracts");
34
- const AGENT_ID = 'meta-reasoner-agent';
35
- const AGENT_VERSION = '1.0.0';
36
- const DECISION_TYPE = 'meta_reasoning_analysis';
37
- /**
38
- * Meta-Reasoner Agent Implementation
39
- *
40
- * This agent analyzes reasoning traces from other agents to detect
41
- * contradictions, assess confidence calibration, and identify systemic issues.
42
- * It is purely analytical - it NEVER overrides outputs or enforces corrections.
43
- */
44
- class MetaReasonerAgent {
45
- metadata = {
46
- id: AGENT_ID,
47
- name: 'Meta-Reasoner Agent',
48
- version: AGENT_VERSION,
49
- classifications: [
50
- contracts_1.AgentClassification.META_ANALYSIS,
51
- contracts_1.AgentClassification.REASONING_QUALITY_ASSESSMENT,
52
- ],
53
- decision_type: DECISION_TYPE,
54
- description: 'Evaluates reasoning quality and consistency across agents by detecting contradictions, assessing confidence calibration, and identifying systemic reasoning issues.',
55
- };
56
- persistence;
57
- telemetry;
58
- constructor(persistence, telemetry) {
59
- this.persistence = persistence;
60
- this.telemetry = telemetry;
61
- }
62
- /**
63
- * Validate input against MetaReasonerInputSchema
64
- */
65
- validateInput(input) {
66
- return contracts_1.MetaReasonerInputSchema.parse(input);
67
- }
68
- /**
69
- * Invoke the meta-reasoner agent
70
- *
71
- * DETERMINISTIC: Same input always produces same output structure
72
- * STATELESS: No internal state modified
73
- * NON-BLOCKING: Fully async
74
- */
75
- async invoke(input, executionRef) {
76
- const startTime = Date.now();
77
- try {
78
- // Emit telemetry start
79
- this.telemetry.recordStart(AGENT_ID, executionRef, input);
80
- // Perform meta-reasoning analysis (pure analysis, no side effects)
81
- const output = this.analyzeReasoning(input);
82
- // Validate output
83
- const validatedOutput = contracts_1.MetaReasonerOutputSchema.parse(output);
84
- // Calculate confidence based on analysis quality
85
- const confidence = this.calculateConfidence(validatedOutput, input);
86
- // Constraints applied during analysis
87
- const constraintsApplied = this.getAppliedConstraints(input);
88
- // Create the DecisionEvent
89
- const event = (0, contracts_1.createDecisionEvent)(AGENT_ID, AGENT_VERSION, DECISION_TYPE, input, validatedOutput, confidence, constraintsApplied, executionRef);
90
- // Persist via ruvector-service (best-effort, non-blocking)
91
- let persistence_status;
92
- try {
93
- await this.persistence.store(event);
94
- persistence_status = { status: 'persisted' };
95
- }
96
- catch (persistError) {
97
- const persistMessage = persistError instanceof Error ? persistError.message : 'Unknown persistence error';
98
- console.error(`[${AGENT_ID}] RuVector persistence failed (non-blocking): ${persistMessage}`);
99
- persistence_status = { status: 'skipped', error: persistMessage };
100
- }
101
- // Emit telemetry success
102
- this.telemetry.recordSuccess(AGENT_ID, executionRef, Date.now() - startTime);
103
- return {
104
- status: 'success',
105
- event,
106
- persistence_status,
107
- };
108
- }
109
- catch (error) {
110
- const errorMessage = error instanceof Error ? error.message : 'Unknown error';
111
- const errorCode = this.classifyError(error);
112
- // Emit telemetry failure
113
- this.telemetry.recordFailure(AGENT_ID, executionRef, errorCode, errorMessage);
114
- return (0, contracts_1.createErrorResult)(errorCode, errorMessage, executionRef);
115
- }
116
- }
117
- /**
118
- * Perform meta-reasoning analysis on the provided traces
119
- *
120
- * This is the core analysis logic - purely analytical.
121
- * NEVER overrides outputs or enforces corrections.
122
- */
123
- analyzeReasoning(input) {
124
- const analysisId = (0, uuid_1.v4)();
125
- const traces = input.traces;
126
- const scope = input.scope;
127
- // Collect unique agents and decision types
128
- const uniqueAgents = new Set(traces.map(t => t.agent_id));
129
- const uniqueDecisionTypes = new Set(traces.map(t => t.decision_type));
130
- // Calculate time span
131
- const timestamps = traces.map(t => new Date(t.timestamp).getTime()).sort((a, b) => a - b);
132
- const timeSpan = timestamps.length > 0 ? {
133
- earliest: new Date(timestamps[0]).toISOString(),
134
- latest: new Date(timestamps[timestamps.length - 1]).toISOString(),
135
- } : undefined;
136
- // Perform analyses based on scope
137
- const contradictions = scope.detect_contradictions
138
- ? this.detectContradictions(traces)
139
- : [];
140
- const confidenceCalibrations = scope.assess_confidence_calibration
141
- ? this.assessConfidenceCalibration(traces, input.context?.historical_accuracy)
142
- : [];
143
- const systemicIssues = scope.identify_systemic_issues
144
- ? this.identifySystemicIssues(traces)
145
- : [];
146
- // Calculate quality metrics
147
- const qualityMetrics = this.calculateQualityMetrics(traces, contradictions, confidenceCalibrations, systemicIssues);
148
- // Generate key findings
149
- const keyFindings = this.generateKeyFindings(contradictions, confidenceCalibrations, systemicIssues, qualityMetrics);
150
- // Generate summary
151
- const summary = this.generateSummary(traces.length, uniqueAgents.size, contradictions.length, systemicIssues.length, qualityMetrics.overall_score);
152
- // Extract assumptions
153
- const assumptions = this.extractAssumptions(input);
154
- return {
155
- analysis_id: analysisId,
156
- summary,
157
- quality_metrics: qualityMetrics,
158
- contradictions,
159
- confidence_calibrations: confidenceCalibrations,
160
- systemic_issues: systemicIssues,
161
- analysis_metadata: {
162
- total_traces: traces.length,
163
- traces_analyzed: traces.length,
164
- unique_agents: uniqueAgents.size,
165
- unique_decision_types: uniqueDecisionTypes.size,
166
- time_span: timeSpan,
167
- scope_executed: {
168
- contradictions_checked: scope.detect_contradictions,
169
- calibration_assessed: scope.assess_confidence_calibration,
170
- systemic_issues_checked: scope.identify_systemic_issues,
171
- fallacies_checked: scope.detect_fallacies,
172
- completeness_checked: scope.check_completeness,
173
- },
174
- },
175
- key_findings: keyFindings,
176
- assumptions,
177
- version: '1.0.0',
178
- };
179
- }
180
- /**
181
- * Detect contradictions between reasoning traces
182
- */
183
- detectContradictions(traces) {
184
- const contradictions = [];
185
- let contradictionCount = 0;
186
- // Group traces by decision type for comparison
187
- const tracesByType = new Map();
188
- for (const trace of traces) {
189
- const existing = tracesByType.get(trace.decision_type) || [];
190
- existing.push(trace);
191
- tracesByType.set(trace.decision_type, existing);
192
- }
193
- // Check for contradictions within same decision type
194
- for (const [decisionType, typeTraces] of tracesByType) {
195
- if (typeTraces.length < 2)
196
- continue;
197
- // Compare pairs of traces
198
- for (let i = 0; i < typeTraces.length; i++) {
199
- for (let j = i + 1; j < typeTraces.length; j++) {
200
- const trace1 = typeTraces[i];
201
- const trace2 = typeTraces[j];
202
- // Check for confidence contradictions
203
- const confidenceGap = Math.abs(trace1.reported_confidence - trace2.reported_confidence);
204
- if (confidenceGap > 0.5) {
205
- contradictionCount++;
206
- contradictions.push({
207
- contradiction_id: `contradiction-${contradictionCount}`,
208
- type: 'statistical',
209
- severity: confidenceGap > 0.7 ? 'high' : 'medium',
210
- involved_traces: [trace1.execution_ref, trace2.execution_ref],
211
- involved_agents: [trace1.agent_id, trace2.agent_id],
212
- description: `Large confidence gap (${(confidenceGap * 100).toFixed(1)}%) between agents for same decision type "${decisionType}"`,
213
- evidence: [
214
- {
215
- trace_ref: trace1.execution_ref,
216
- excerpt: `Confidence: ${trace1.reported_confidence}`,
217
- relevance: 'First trace confidence value',
218
- },
219
- {
220
- trace_ref: trace2.execution_ref,
221
- excerpt: `Confidence: ${trace2.reported_confidence}`,
222
- relevance: 'Second trace confidence value',
223
- },
224
- ],
225
- finding_confidence: 0.8,
226
- });
227
- }
228
- // Check for constraint contradictions
229
- const constraints1 = new Set(trace1.constraints_applied);
230
- const constraints2 = new Set(trace2.constraints_applied);
231
- const conflictingConstraints = this.findConflictingConstraints(constraints1, constraints2);
232
- if (conflictingConstraints.length > 0) {
233
- contradictionCount++;
234
- contradictions.push({
235
- contradiction_id: `contradiction-${contradictionCount}`,
236
- type: 'contextual',
237
- severity: 'medium',
238
- involved_traces: [trace1.execution_ref, trace2.execution_ref],
239
- involved_agents: [trace1.agent_id, trace2.agent_id],
240
- description: `Conflicting constraints applied for same decision type "${decisionType}"`,
241
- evidence: [
242
- {
243
- trace_ref: trace1.execution_ref,
244
- excerpt: `Constraints: ${Array.from(constraints1).join(', ')}`,
245
- relevance: 'First trace constraints',
246
- },
247
- {
248
- trace_ref: trace2.execution_ref,
249
- excerpt: `Constraints: ${Array.from(constraints2).join(', ')}`,
250
- relevance: 'Second trace constraints',
251
- },
252
- ],
253
- finding_confidence: 0.7,
254
- });
255
- }
256
- }
257
- }
258
- }
259
- // Check for temporal contradictions (same agent, changing conclusions)
260
- const tracesByAgent = new Map();
261
- for (const trace of traces) {
262
- const existing = tracesByAgent.get(trace.agent_id) || [];
263
- existing.push(trace);
264
- tracesByAgent.set(trace.agent_id, existing);
265
- }
266
- for (const [agentId, agentTraces] of tracesByAgent) {
267
- if (agentTraces.length < 2)
268
- continue;
269
- // Sort by timestamp
270
- const sorted = [...agentTraces].sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
271
- // Check for rapid confidence fluctuation
272
- for (let i = 1; i < sorted.length; i++) {
273
- const prev = sorted[i - 1];
274
- const curr = sorted[i];
275
- if (prev.decision_type === curr.decision_type) {
276
- const confidenceChange = Math.abs(curr.reported_confidence - prev.reported_confidence);
277
- if (confidenceChange > 0.3) {
278
- contradictionCount++;
279
- contradictions.push({
280
- contradiction_id: `contradiction-${contradictionCount}`,
281
- type: 'temporal',
282
- severity: confidenceChange > 0.5 ? 'high' : 'low',
283
- involved_traces: [prev.execution_ref, curr.execution_ref],
284
- involved_agents: [agentId],
285
- description: `Rapid confidence change (${(confidenceChange * 100).toFixed(1)}%) for agent "${agentId}" on same decision type`,
286
- evidence: [
287
- {
288
- trace_ref: prev.execution_ref,
289
- excerpt: `Earlier confidence: ${prev.reported_confidence} at ${prev.timestamp}`,
290
- relevance: 'Previous confidence value',
291
- },
292
- {
293
- trace_ref: curr.execution_ref,
294
- excerpt: `Later confidence: ${curr.reported_confidence} at ${curr.timestamp}`,
295
- relevance: 'Current confidence value',
296
- },
297
- ],
298
- finding_confidence: 0.75,
299
- });
300
- }
301
- }
302
- }
303
- }
304
- return contradictions;
305
- }
306
- /**
307
- * Find conflicting constraints between two sets
308
- */
309
- findConflictingConstraints(set1, set2) {
310
- const conflicts = [];
311
- // Define known conflicting constraint pairs
312
- const conflictPairs = [
313
- ['strict_validation', 'relaxed_validation'],
314
- ['high_precision', 'high_recall'],
315
- ['fast_execution', 'thorough_analysis'],
316
- ];
317
- for (const [a, b] of conflictPairs) {
318
- if ((set1.has(a) && set2.has(b)) || (set1.has(b) && set2.has(a))) {
319
- conflicts.push(`${a} vs ${b}`);
320
- }
321
- }
322
- return conflicts;
323
- }
324
- /**
325
- * Assess confidence calibration for each agent
326
- */
327
- assessConfidenceCalibration(traces, historicalAccuracy) {
328
- const calibrations = [];
329
- // Group traces by agent
330
- const tracesByAgent = new Map();
331
- for (const trace of traces) {
332
- const existing = tracesByAgent.get(trace.agent_id) || [];
333
- existing.push(trace);
334
- tracesByAgent.set(trace.agent_id, existing);
335
- }
336
- for (const [agentId, agentTraces] of tracesByAgent) {
337
- const confidences = agentTraces.map(t => t.reported_confidence);
338
- const meanConfidence = confidences.reduce((a, b) => a + b, 0) / confidences.length;
339
- const expectedAccuracy = historicalAccuracy?.[agentId];
340
- let calibrationScore;
341
- let assessment;
342
- let calibrationGap;
343
- const recommendations = [];
344
- if (expectedAccuracy !== undefined) {
345
- calibrationGap = meanConfidence - expectedAccuracy;
346
- if (Math.abs(calibrationGap) <= 0.1) {
347
- calibrationScore = 0.9;
348
- assessment = 'well_calibrated';
349
- }
350
- else if (calibrationGap > 0.1) {
351
- calibrationScore = Math.max(0, 1 - calibrationGap);
352
- assessment = 'overconfident';
353
- recommendations.push(`Consider reducing confidence by ~${(calibrationGap * 100).toFixed(0)}%`, 'Review historical accuracy data for calibration');
354
- }
355
- else {
356
- calibrationScore = Math.max(0, 1 + calibrationGap);
357
- assessment = 'underconfident';
358
- recommendations.push(`Consider increasing confidence by ~${(Math.abs(calibrationGap) * 100).toFixed(0)}%`, 'Agent may be underestimating its capabilities');
359
- }
360
- }
361
- else {
362
- // Without historical data, assess based on consistency
363
- const confidenceVariance = this.calculateVariance(confidences);
364
- if (confidenceVariance > 0.1) {
365
- calibrationScore = Math.max(0, 1 - confidenceVariance);
366
- assessment = 'inconsistent';
367
- recommendations.push('Confidence varies significantly across invocations', 'Consider implementing more stable confidence estimation');
368
- }
369
- else {
370
- calibrationScore = 0.7; // Default moderate score without historical data
371
- assessment = 'insufficient_data';
372
- recommendations.push('Historical accuracy data needed for proper calibration assessment', 'Track prediction outcomes to build accuracy baseline');
373
- }
374
- }
375
- calibrations.push({
376
- agent_id: agentId,
377
- calibration_score: calibrationScore,
378
- assessment,
379
- mean_reported_confidence: meanConfidence,
380
- expected_accuracy: expectedAccuracy,
381
- calibration_gap: calibrationGap,
382
- traces_analyzed: agentTraces.length,
383
- recommendations,
384
- });
385
- }
386
- return calibrations;
387
- }
388
- /**
389
- * Calculate variance of an array of numbers
390
- */
391
- calculateVariance(values) {
392
- if (values.length < 2)
393
- return 0;
394
- const mean = values.reduce((a, b) => a + b, 0) / values.length;
395
- const squaredDiffs = values.map(v => Math.pow(v - mean, 2));
396
- return squaredDiffs.reduce((a, b) => a + b, 0) / values.length;
397
- }
398
- /**
399
- * Identify systemic reasoning issues across traces
400
- */
401
- identifySystemicIssues(traces) {
402
- const issues = [];
403
- let issueCount = 0;
404
- // Check for anchoring bias: early traces heavily influencing later ones
405
- const sortedTraces = [...traces].sort((a, b) => new Date(a.timestamp).getTime() - new Date(b.timestamp).getTime());
406
- if (sortedTraces.length >= 3) {
407
- const earlyConfidence = sortedTraces.slice(0, Math.floor(sortedTraces.length / 3))
408
- .map(t => t.reported_confidence);
409
- const lateConfidence = sortedTraces.slice(-Math.floor(sortedTraces.length / 3))
410
- .map(t => t.reported_confidence);
411
- const earlyMean = earlyConfidence.reduce((a, b) => a + b, 0) / earlyConfidence.length;
412
- const lateMean = lateConfidence.reduce((a, b) => a + b, 0) / lateConfidence.length;
413
- if (Math.abs(earlyMean - lateMean) < 0.05 && this.calculateVariance(earlyConfidence) < 0.01) {
414
- issueCount++;
415
- issues.push({
416
- issue_id: `issue-${issueCount}`,
417
- type: 'anchoring_bias',
418
- severity: 'medium',
419
- affected_agents: [...new Set(traces.map(t => t.agent_id))],
420
- occurrences: sortedTraces.slice(0, 3).map(t => t.execution_ref),
421
- frequency: 'occasional',
422
- description: 'Early confidence values may be anchoring subsequent analyses',
423
- evidence: [
424
- {
425
- trace_ref: sortedTraces[0].execution_ref,
426
- observation: `Early mean confidence: ${earlyMean.toFixed(3)}`,
427
- },
428
- {
429
- trace_ref: sortedTraces[sortedTraces.length - 1].execution_ref,
430
- observation: `Late mean confidence: ${lateMean.toFixed(3)} (minimal drift suggests anchoring)`,
431
- },
432
- ],
433
- impact: 'May reduce adaptability to new information',
434
- finding_confidence: 0.6,
435
- });
436
- }
437
- }
438
- // Check for missing uncertainty acknowledgment
439
- const highConfidenceTraces = traces.filter(t => t.reported_confidence > 0.9);
440
- if (highConfidenceTraces.length > traces.length * 0.5) {
441
- issueCount++;
442
- issues.push({
443
- issue_id: `issue-${issueCount}`,
444
- type: 'missing_uncertainty',
445
- severity: 'medium',
446
- affected_agents: [...new Set(highConfidenceTraces.map(t => t.agent_id))],
447
- occurrences: highConfidenceTraces.slice(0, 5).map(t => t.execution_ref),
448
- frequency: highConfidenceTraces.length > traces.length * 0.7 ? 'pervasive' : 'frequent',
449
- description: 'Majority of traces report very high confidence (>90%), potentially underestimating uncertainty',
450
- evidence: highConfidenceTraces.slice(0, 3).map(t => ({
451
- trace_ref: t.execution_ref,
452
- observation: `Confidence: ${(t.reported_confidence * 100).toFixed(1)}%`,
453
- })),
454
- impact: 'High confidence without uncertainty bounds may lead to overreliance on outputs',
455
- finding_confidence: 0.75,
456
- });
457
- }
458
- // Check for inconsistent criteria across agents
459
- const constraintSets = new Map();
460
- for (const trace of traces) {
461
- const existing = constraintSets.get(trace.decision_type) || new Set();
462
- trace.constraints_applied.forEach(c => existing.add(c));
463
- constraintSets.set(trace.decision_type, existing);
464
- }
465
- for (const [decisionType, constraints] of constraintSets) {
466
- const tracesOfType = traces.filter(t => t.decision_type === decisionType);
467
- const uniqueConstraintCombinations = new Set(tracesOfType.map(t => JSON.stringify([...t.constraints_applied].sort())));
468
- if (uniqueConstraintCombinations.size > 3 && tracesOfType.length > 5) {
469
- issueCount++;
470
- issues.push({
471
- issue_id: `issue-${issueCount}`,
472
- type: 'inconsistent_criteria',
473
- severity: 'low',
474
- affected_agents: [...new Set(tracesOfType.map(t => t.agent_id))],
475
- occurrences: tracesOfType.slice(0, 3).map(t => t.execution_ref),
476
- frequency: 'occasional',
477
- description: `Multiple different constraint sets (${uniqueConstraintCombinations.size}) used for decision type "${decisionType}"`,
478
- evidence: tracesOfType.slice(0, 2).map(t => ({
479
- trace_ref: t.execution_ref,
480
- observation: `Constraints: ${t.constraints_applied.join(', ')}`,
481
- })),
482
- impact: 'May indicate inconsistent evaluation standards',
483
- finding_confidence: 0.65,
484
- });
485
- }
486
- }
487
- return issues;
488
- }
489
- /**
490
- * Calculate overall reasoning quality metrics
491
- */
492
- calculateQualityMetrics(traces, contradictions, calibrations, systemicIssues) {
493
- // Consistency score: penalize for contradictions
494
- const contradictionPenalty = Math.min(contradictions.length * 0.1, 0.5);
495
- const consistencyScore = Math.max(0, 1 - contradictionPenalty);
496
- // Completeness score: based on traces having required fields
497
- const tracesWithConstraints = traces.filter(t => t.constraints_applied.length > 0).length;
498
- const completenessScore = traces.length > 0 ? tracesWithConstraints / traces.length : 0;
499
- // Clarity score: based on calibration quality
500
- const avgCalibrationScore = calibrations.length > 0
501
- ? calibrations.reduce((a, b) => a + b.calibration_score, 0) / calibrations.length
502
- : 0.7;
503
- const clarityScore = avgCalibrationScore;
504
- // Constraint adherence score
505
- const constraintAdherenceScore = traces.length > 0 ? completenessScore : 0;
506
- // Calculate overall score
507
- const overallScore = (consistencyScore * 0.35 +
508
- completenessScore * 0.2 +
509
- clarityScore * 0.25 +
510
- constraintAdherenceScore * 0.2) * (1 - Math.min(systemicIssues.length * 0.05, 0.3));
511
- const uniqueAgents = new Set(traces.map(t => t.agent_id));
512
- return {
513
- overall_score: Math.max(0, Math.min(1, overallScore)),
514
- consistency_score: consistencyScore,
515
- completeness_score: completenessScore,
516
- clarity_score: clarityScore,
517
- constraint_adherence_score: constraintAdherenceScore,
518
- traces_analyzed: traces.length,
519
- agents_analyzed: uniqueAgents.size,
520
- coverage_percentage: 100, // All provided traces are analyzed
521
- };
522
- }
523
- /**
524
- * Generate prioritized key findings
525
- */
526
- generateKeyFindings(contradictions, calibrations, systemicIssues, qualityMetrics) {
527
- const findings = [];
528
- // Critical/high severity contradictions
529
- const criticalContradictions = contradictions.filter(c => c.severity === 'critical' || c.severity === 'high');
530
- if (criticalContradictions.length > 0) {
531
- findings.push({
532
- priority: 1,
533
- category: 'contradiction',
534
- finding: `Found ${criticalContradictions.length} high-severity contradiction(s) requiring attention`,
535
- affected_entities: criticalContradictions.flatMap(c => c.involved_agents),
536
- });
537
- }
538
- // Calibration issues
539
- const poorlyCalibrated = calibrations.filter(c => c.assessment === 'overconfident' || c.assessment === 'underconfident');
540
- if (poorlyCalibrated.length > 0) {
541
- findings.push({
542
- priority: 2,
543
- category: 'calibration',
544
- finding: `${poorlyCalibrated.length} agent(s) show calibration issues (${poorlyCalibrated.map(c => c.assessment).join(', ')})`,
545
- affected_entities: poorlyCalibrated.map(c => c.agent_id),
546
- });
547
- }
548
- // Systemic issues
549
- const severeSystems = systemicIssues.filter(i => i.severity === 'critical' || i.severity === 'high');
550
- if (severeSystems.length > 0) {
551
- findings.push({
552
- priority: 3,
553
- category: 'systemic',
554
- finding: `Identified ${severeSystems.length} systemic issue(s): ${severeSystems.map(i => i.type).join(', ')}`,
555
- affected_entities: severeSystems.flatMap(i => i.affected_agents),
556
- });
557
- }
558
- // Overall quality assessment
559
- if (qualityMetrics.overall_score < 0.5) {
560
- findings.push({
561
- priority: 4,
562
- category: 'quality',
563
- finding: `Overall reasoning quality score is low (${(qualityMetrics.overall_score * 100).toFixed(1)}%)`,
564
- affected_entities: [],
565
- });
566
- }
567
- else if (qualityMetrics.overall_score >= 0.8) {
568
- findings.push({
569
- priority: 10,
570
- category: 'quality',
571
- finding: `Overall reasoning quality is good (${(qualityMetrics.overall_score * 100).toFixed(1)}%)`,
572
- affected_entities: [],
573
- });
574
- }
575
- // Sort by priority
576
- return findings.sort((a, b) => a.priority - b.priority);
577
- }
578
- /**
579
- * Generate summary of the analysis
580
- */
581
- generateSummary(traceCount, agentCount, contradictionCount, issueCount, overallScore) {
582
- const qualityDescriptor = overallScore >= 0.8 ? 'good' :
583
- overallScore >= 0.6 ? 'moderate' :
584
- overallScore >= 0.4 ? 'fair' : 'poor';
585
- let summary = `Meta-reasoning analysis of ${traceCount} trace(s) from ${agentCount} agent(s). `;
586
- summary += `Overall reasoning quality is ${qualityDescriptor} (${(overallScore * 100).toFixed(1)}%). `;
587
- if (contradictionCount > 0) {
588
- summary += `Detected ${contradictionCount} contradiction(s). `;
589
- }
590
- if (issueCount > 0) {
591
- summary += `Identified ${issueCount} systemic issue(s). `;
592
- }
593
- if (contradictionCount === 0 && issueCount === 0) {
594
- summary += `No significant issues detected.`;
595
- }
596
- return summary.trim();
597
- }
598
- /**
599
- * Extract assumptions made during analysis
600
- */
601
- extractAssumptions(input) {
602
- const assumptions = [
603
- 'All provided traces are authentic and unmodified',
604
- 'Timestamps are accurate and timezone-consistent (UTC)',
605
- 'Reported confidence values reflect agent certainty',
606
- ];
607
- if (!input.context?.historical_accuracy) {
608
- assumptions.push('No historical accuracy baseline available - calibration assessment limited');
609
- }
610
- if (input.traces.length < 5) {
611
- assumptions.push('Limited trace count may reduce statistical significance of findings');
612
- }
613
- if (!input.context?.correlation_groups?.length) {
614
- assumptions.push('No correlation groups specified - assuming all traces are independent');
615
- }
616
- return assumptions;
617
- }
618
- /**
619
- * Calculate confidence score based on analysis quality
620
- */
621
- calculateConfidence(output, input) {
622
- let confidence = 0.7; // Base confidence
623
- // Boost for sufficient trace count
624
- if (input.traces.length >= 10) {
625
- confidence += 0.1;
626
- }
627
- else if (input.traces.length >= 5) {
628
- confidence += 0.05;
629
- }
630
- // Boost for multiple agents (cross-validation potential)
631
- if (output.analysis_metadata.unique_agents >= 3) {
632
- confidence += 0.05;
633
- }
634
- // Boost for having historical accuracy data
635
- if (input.context?.historical_accuracy) {
636
- confidence += 0.05;
637
- }
638
- // Reduce for limited scope
639
- const scopeCount = Object.values(output.analysis_metadata.scope_executed)
640
- .filter(Boolean).length;
641
- if (scopeCount < 3) {
642
- confidence -= 0.05;
643
- }
644
- return Math.min(1.0, Math.max(0.0, confidence));
645
- }
646
- /**
647
- * Get constraints applied during analysis
648
- */
649
- getAppliedConstraints(input) {
650
- const constraints = [
651
- 'read_only_analysis',
652
- 'no_output_override',
653
- 'no_correction_enforcement',
654
- 'no_logic_execution',
655
- 'deterministic_output',
656
- 'stateless_processing',
657
- ];
658
- // Add scope-specific constraints
659
- if (input.scope.detect_contradictions) {
660
- constraints.push('contradiction_detection_enabled');
661
- }
662
- if (input.scope.assess_confidence_calibration) {
663
- constraints.push('calibration_assessment_enabled');
664
- }
665
- if (input.scope.identify_systemic_issues) {
666
- constraints.push('systemic_analysis_enabled');
667
- }
668
- return constraints;
669
- }
670
- /**
671
- * Classify error for proper error code
672
- */
673
- classifyError(error) {
674
- if (error instanceof Error) {
675
- if (error.name === 'ZodError') {
676
- return contracts_1.AgentErrorCodes.VALIDATION_FAILED;
677
- }
678
- if (error.message.includes('persistence') || error.message.includes('ruvector')) {
679
- return contracts_1.AgentErrorCodes.PERSISTENCE_ERROR;
680
- }
681
- }
682
- return contracts_1.AgentErrorCodes.PROCESSING_ERROR;
683
- }
684
- }
685
- exports.MetaReasonerAgent = MetaReasonerAgent;
686
- //# sourceMappingURL=meta-reasoner-agent.js.map