agentic-qe 3.11.0 → 3.11.2

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 (470) hide show
  1. package/.claude/commands/agents/README.md +50 -0
  2. package/.claude/commands/agents/agent-capabilities.md +140 -0
  3. package/.claude/commands/agents/agent-coordination.md +28 -0
  4. package/.claude/commands/agents/agent-spawning.md +28 -0
  5. package/.claude/commands/agents/agent-types.md +216 -0
  6. package/.claude/commands/agents/health.md +139 -0
  7. package/.claude/commands/agents/list.md +100 -0
  8. package/.claude/commands/agents/logs.md +130 -0
  9. package/.claude/commands/agents/metrics.md +122 -0
  10. package/.claude/commands/agents/pool.md +127 -0
  11. package/.claude/commands/agents/spawn.md +140 -0
  12. package/.claude/commands/agents/status.md +115 -0
  13. package/.claude/commands/agents/stop.md +102 -0
  14. package/.claude/commands/claude-flow-help.md +1 -1
  15. package/.claude/commands/coordination/README.md +9 -0
  16. package/.claude/commands/coordination/agent-spawn.md +25 -0
  17. package/.claude/commands/coordination/init.md +44 -0
  18. package/.claude/commands/coordination/orchestrate.md +43 -0
  19. package/.claude/commands/coordination/spawn.md +45 -0
  20. package/.claude/commands/coordination/swarm-init.md +85 -0
  21. package/.claude/commands/coordination/task-orchestrate.md +25 -0
  22. package/.claude/commands/github/code-review-swarm.md +1 -1
  23. package/.claude/commands/github/issue-tracker.md +3 -3
  24. package/.claude/commands/github/release-manager.md +5 -3
  25. package/.claude/commands/github/release-swarm.md +1 -1
  26. package/.claude/commands/github/repo-architect.md +2 -2
  27. package/.claude/commands/github/swarm-issue.md +4 -1
  28. package/.claude/commands/github/swarm-pr.md +6 -3
  29. package/.claude/commands/github/sync-coordinator.md +3 -1
  30. package/.claude/commands/github/workflow-automation.md +2 -2
  31. package/.claude/commands/hive-mind/README.md +17 -0
  32. package/.claude/commands/hive-mind/hive-mind-consensus.md +8 -0
  33. package/.claude/commands/hive-mind/hive-mind-init.md +18 -0
  34. package/.claude/commands/hive-mind/hive-mind-memory.md +8 -0
  35. package/.claude/commands/hive-mind/hive-mind-metrics.md +8 -0
  36. package/.claude/commands/hive-mind/hive-mind-resume.md +8 -0
  37. package/.claude/commands/hive-mind/hive-mind-sessions.md +8 -0
  38. package/.claude/commands/hive-mind/hive-mind-spawn.md +21 -0
  39. package/.claude/commands/hive-mind/hive-mind-status.md +8 -0
  40. package/.claude/commands/hive-mind/hive-mind-stop.md +8 -0
  41. package/.claude/commands/hive-mind/hive-mind-wizard.md +8 -0
  42. package/.claude/commands/hive-mind/hive-mind.md +27 -0
  43. package/.claude/commands/memory/README.md +9 -0
  44. package/.claude/commands/memory/memory-persist.md +25 -0
  45. package/.claude/commands/memory/memory-search.md +25 -0
  46. package/.claude/commands/memory/memory-usage.md +25 -0
  47. package/.claude/commands/memory/neural.md +47 -0
  48. package/.claude/commands/swarm/README.md +15 -0
  49. package/.claude/commands/swarm/analysis.md +95 -0
  50. package/.claude/commands/swarm/development.md +96 -0
  51. package/.claude/commands/swarm/examples.md +168 -0
  52. package/.claude/commands/swarm/maintenance.md +102 -0
  53. package/.claude/commands/swarm/optimization.md +117 -0
  54. package/.claude/commands/swarm/research.md +136 -0
  55. package/.claude/commands/swarm/swarm-analysis.md +8 -0
  56. package/.claude/commands/swarm/swarm-background.md +8 -0
  57. package/.claude/commands/swarm/swarm-init.md +19 -0
  58. package/.claude/commands/swarm/swarm-modes.md +8 -0
  59. package/.claude/commands/swarm/swarm-monitor.md +8 -0
  60. package/.claude/commands/swarm/swarm-spawn.md +19 -0
  61. package/.claude/commands/swarm/swarm-status.md +8 -0
  62. package/.claude/commands/swarm/swarm-strategies.md +8 -0
  63. package/.claude/commands/swarm/swarm.md +87 -0
  64. package/.claude/commands/swarm/testing.md +131 -0
  65. package/.claude/commands/workflows/README.md +9 -0
  66. package/.claude/commands/workflows/development.md +78 -0
  67. package/.claude/commands/workflows/research.md +63 -0
  68. package/.claude/commands/workflows/workflow-create.md +25 -0
  69. package/.claude/commands/workflows/workflow-execute.md +25 -0
  70. package/.claude/commands/workflows/workflow-export.md +25 -0
  71. package/.claude/helpers/auto-commit.sh +1 -1
  72. package/.claude/helpers/auto-memory-hook.mjs +37 -4
  73. package/.claude/helpers/github-safe.js +90 -40
  74. package/.claude/helpers/github-setup.sh +30 -13
  75. package/.claude/helpers/hook-handler.cjs +68 -49
  76. package/.claude/helpers/intelligence.cjs +156 -27
  77. package/.claude/helpers/post-commit +1 -1
  78. package/.claude/helpers/pre-commit +1 -1
  79. package/.claude/helpers/quick-start.sh +4 -4
  80. package/.claude/helpers/router.js +70 -31
  81. package/.claude/helpers/ruflo-hook.cjs +59 -0
  82. package/.claude/helpers/session.js +28 -6
  83. package/.claude/helpers/setup-mcp.sh +3 -3
  84. package/.claude/helpers/statusline.cjs +584 -468
  85. package/.claude/helpers/statusline.js +47 -11
  86. package/.claude/skills/github-code-review/SKILL.md +2 -17
  87. package/.claude/skills/github-multi-repo/SKILL.md +4 -16
  88. package/.claude/skills/github-project-management/SKILL.md +18 -33
  89. package/.claude/skills/github-release-management/SKILL.md +4 -21
  90. package/.claude/skills/github-workflow-automation/SKILL.md +8 -26
  91. package/.claude/skills/pair-programming/SKILL.md +2 -2
  92. package/.claude/skills/qe-code-intelligence/SKILL.md +3 -0
  93. package/.claude/skills/reasoningbank-intelligence/SKILL.md +2 -2
  94. package/.claude/skills/skill-builder/SKILL.md +0 -103
  95. package/.claude/skills/skills-manifest.json +1 -1
  96. package/.claude/skills/sparc-methodology/SKILL.md +2 -11
  97. package/.claude/skills/stream-chain/SKILL.md +0 -3
  98. package/.claude/skills/swarm-advanced/SKILL.md +2 -5
  99. package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
  100. package/.claude/skills/verification-quality/SKILL.md +121 -93
  101. package/CHANGELOG.md +84 -0
  102. package/README.md +1 -0
  103. package/assets/skills/pair-programming/SKILL.md +2 -2
  104. package/assets/skills/qe-code-intelligence/SKILL.md +3 -0
  105. package/assets/skills/verification-quality/SKILL.md +121 -93
  106. package/dist/audit/witness-chain.d.ts +1 -1
  107. package/dist/audit/witness-findings.d.ts +50 -0
  108. package/dist/audit/witness-findings.js +41 -0
  109. package/dist/cli/bundle.js +5 -5
  110. package/dist/cli/chunks/adapter-LDNYC4GH.js +2 -0
  111. package/dist/cli/chunks/{agent-booster-wasm-5CSKQB4O.js → agent-booster-wasm-FNCVODUJ.js} +2 -2
  112. package/dist/cli/chunks/{agent-handler-EBV3OKTE.js → agent-handler-JK7VK37B.js} +2 -2
  113. package/dist/cli/chunks/{agent-memory-branch-RZ53YM2U.js → agent-memory-branch-EPVVJNNA.js} +2 -2
  114. package/dist/cli/chunks/aqe-learning-engine-CA4CT5Q7.js +2 -0
  115. package/dist/cli/chunks/{arena-UCP74DRO.js → arena-EH2IMSRW.js} +4 -4
  116. package/dist/cli/chunks/{arena-QWYTIQ6I.js → arena-NTHVDZTJ.js} +2 -2
  117. package/dist/cli/chunks/{audit-M4FNIX47.js → audit-ODZV2T2B.js} +2 -2
  118. package/dist/cli/chunks/base-TSDAEMT4.js +2 -0
  119. package/dist/cli/chunks/{hnswlib-node-HMZC5TXM.js → better-sqlite3-5JTP47LA.js} +2 -2
  120. package/dist/cli/chunks/{brain-handler-OY6Q2GY5.js → brain-handler-NVB6OJ25.js} +3 -3
  121. package/dist/cli/chunks/{branch-enumerator-TQWN4NIX.js → branch-enumerator-BIXSELMY.js} +2 -2
  122. package/dist/cli/chunks/{browser-2EH3RXJ2.js → browser-S2Y2W33Z.js} +2 -2
  123. package/dist/cli/chunks/browser-workflow-3HCTJBLR.js +2 -0
  124. package/dist/cli/chunks/{chunk-V6WJVFRN.js → chunk-26ZMIYSK.js} +2 -2
  125. package/dist/cli/chunks/{chunk-I2HQLBWG.js → chunk-27KNLVOY.js} +2 -2
  126. package/dist/cli/chunks/{chunk-HNSZDIQU.js → chunk-2Q65LTJN.js} +2 -2
  127. package/dist/cli/chunks/{chunk-SKL225P5.js → chunk-3ATEYGVD.js} +2 -2
  128. package/dist/cli/chunks/{chunk-LTH6XARD.js → chunk-3J3QXLWP.js} +2 -2
  129. package/dist/cli/chunks/{chunk-NQD4CMXC.js → chunk-3KTOM7NN.js} +2 -2
  130. package/dist/cli/chunks/{chunk-QCJ7YOVN.js → chunk-3NCVUFAL.js} +2 -2
  131. package/dist/cli/chunks/{chunk-ZEUUVLS2.js → chunk-42DCMEUM.js} +1 -1
  132. package/dist/cli/chunks/{chunk-2QU6C3OS.js → chunk-4FTVTAMN.js} +2 -2
  133. package/dist/cli/chunks/{chunk-QYXTESM3.js → chunk-4PYJCIRO.js} +2 -2
  134. package/dist/cli/chunks/{chunk-LFT7WYHW.js → chunk-527U4AHC.js} +2 -2
  135. package/dist/cli/chunks/{chunk-VHON5NDM.js → chunk-5AFO7ZZG.js} +3 -3
  136. package/dist/cli/chunks/{chunk-F62ZQZQQ.js → chunk-5BDVFFYF.js} +2 -2
  137. package/dist/cli/chunks/{chunk-KBVXKFDI.js → chunk-5KMGG3QW.js} +4 -4
  138. package/dist/cli/chunks/{chunk-AVKGDS6F.js → chunk-6LQIVIZB.js} +2 -2
  139. package/dist/cli/chunks/{chunk-RKDNLPZM.js → chunk-6SOGYNJG.js} +2 -2
  140. package/dist/cli/chunks/{chunk-RPYYS6BX.js → chunk-6VAFRS5N.js} +2 -2
  141. package/dist/cli/chunks/chunk-72VVTMEL.js +2 -0
  142. package/dist/cli/chunks/{chunk-AURDGQNB.js → chunk-75C5GX7D.js} +2 -2
  143. package/dist/cli/chunks/{chunk-JN3IQB4L.js → chunk-76RO2RHG.js} +1 -1
  144. package/dist/cli/chunks/{chunk-7E5NYLJT.js → chunk-7HYO76F2.js} +2 -2
  145. package/dist/cli/chunks/{chunk-R3YO3Z7I.js → chunk-7KHZZVF2.js} +4 -4
  146. package/dist/cli/chunks/{chunk-G5VE3HQW.js → chunk-7MKF52GT.js} +2 -2
  147. package/dist/cli/chunks/{chunk-TGLEREP5.js → chunk-7VM4ZUHT.js} +2 -2
  148. package/dist/cli/chunks/{chunk-XW5OXBVV.js → chunk-7XIQR6VU.js} +2 -2
  149. package/dist/cli/chunks/{chunk-XKRG2U3V.js → chunk-A4ZDKF5F.js} +1 -1
  150. package/dist/cli/chunks/{chunk-XSG4XKGO.js → chunk-AAVUZVM6.js} +2 -2
  151. package/dist/cli/chunks/{chunk-XVQUVCFR.js → chunk-AINAWVGD.js} +2 -2
  152. package/dist/cli/chunks/{chunk-PUTRXS5I.js → chunk-AK5Q2WCJ.js} +2 -2
  153. package/dist/cli/chunks/{chunk-TYS77XHV.js → chunk-AKZK46TQ.js} +2 -2
  154. package/dist/cli/chunks/{chunk-JQM64WJ2.js → chunk-ARUXFZDY.js} +1 -1
  155. package/dist/cli/chunks/{chunk-YR44KQUK.js → chunk-AYXRT2ND.js} +1 -1
  156. package/dist/cli/chunks/{chunk-ZT4NPTML.js → chunk-AZQ6HDPM.js} +2 -2
  157. package/dist/cli/chunks/{chunk-DCJIXDO6.js → chunk-BGVEBYV4.js} +2 -2
  158. package/dist/cli/chunks/{chunk-IHNBZ5XG.js → chunk-C6UTRG66.js} +2 -2
  159. package/dist/cli/chunks/{chunk-R7FHQQAV.js → chunk-CAUTOCLZ.js} +2 -2
  160. package/dist/cli/chunks/{chunk-N52ZBTPM.js → chunk-CAVBEZV4.js} +2 -2
  161. package/dist/cli/chunks/{chunk-3LP5GPGU.js → chunk-CEMROADY.js} +1 -1
  162. package/dist/cli/chunks/{chunk-IQSPL2H4.js → chunk-CMVNYVKL.js} +2 -2
  163. package/dist/cli/chunks/{chunk-7BD7DZCB.js → chunk-CUDGKSFX.js} +2 -2
  164. package/dist/cli/chunks/{chunk-D3S4SRSA.js → chunk-CZYSCUJ4.js} +2 -2
  165. package/dist/cli/chunks/{chunk-4OTA6KYJ.js → chunk-DMUQV2YU.js} +2 -2
  166. package/dist/cli/chunks/{chunk-KZE5UR4T.js → chunk-DPFLJMEI.js} +3 -3
  167. package/dist/cli/chunks/{chunk-IOQYSR5S.js → chunk-DU4GQKTH.js} +2 -2
  168. package/dist/cli/chunks/{chunk-FMKALHT3.js → chunk-EDH4H55B.js} +2 -2
  169. package/dist/cli/chunks/{chunk-NI7O3GKZ.js → chunk-EIWZDVMT.js} +3 -3
  170. package/dist/cli/chunks/{chunk-5DG6H553.js → chunk-FPZLOVEF.js} +1 -1
  171. package/dist/cli/chunks/{chunk-DV7662EZ.js → chunk-FV53RMVB.js} +1 -1
  172. package/dist/cli/chunks/{chunk-BA4WZIAQ.js → chunk-FYY7OJ6Y.js} +2 -2
  173. package/dist/cli/chunks/{chunk-5ASPEVVF.js → chunk-G4CQBQBV.js} +1 -1
  174. package/dist/cli/chunks/{chunk-GBFAQ4DW.js → chunk-G6LIQFT2.js} +1 -1
  175. package/dist/cli/chunks/{chunk-2WVLFT2I.js → chunk-H3LGBH4Y.js} +1 -1
  176. package/dist/cli/chunks/{chunk-G25YZ7Z6.js → chunk-H4ZPPHOI.js} +2 -2
  177. package/dist/cli/chunks/{chunk-C33BMWYZ.js → chunk-H5TM4KIB.js} +5 -5
  178. package/dist/cli/chunks/{chunk-72QNONO6.js → chunk-H6MBRYA7.js} +2 -2
  179. package/dist/cli/chunks/{chunk-5OJXVVTI.js → chunk-HDBJORV7.js} +2 -2
  180. package/dist/cli/chunks/{chunk-HJFQVKPI.js → chunk-I3AD523O.js} +1 -1
  181. package/dist/cli/chunks/{chunk-2BBKA5J4.js → chunk-I7UWFV6N.js} +1 -1
  182. package/dist/cli/chunks/{chunk-IFTEM672.js → chunk-IMPSB5WW.js} +2 -2
  183. package/dist/cli/chunks/{chunk-YSTWLDVD.js → chunk-IO7ZUP2G.js} +3 -3
  184. package/dist/cli/chunks/{chunk-F6Y7DTHR.js → chunk-IQOCTGA2.js} +2 -2
  185. package/dist/cli/chunks/{chunk-RVQW6CBF.js → chunk-IXYF5BZY.js} +2 -2
  186. package/dist/cli/chunks/{chunk-3J6LYF6I.js → chunk-JC4Z2ADP.js} +2 -2
  187. package/dist/cli/chunks/{chunk-T6KT63NC.js → chunk-JCH2FHJ7.js} +2 -2
  188. package/dist/cli/chunks/{chunk-7PTA7AVW.js → chunk-JDFF2QMZ.js} +1 -1
  189. package/dist/cli/chunks/{chunk-UEH6C5JA.js → chunk-JELN5XTK.js} +1 -1
  190. package/dist/cli/chunks/{chunk-Z45QDDZQ.js → chunk-JSZNI3AO.js} +1 -1
  191. package/dist/cli/chunks/{chunk-ZFP3O5FM.js → chunk-K3YM2Z3E.js} +1 -1
  192. package/dist/cli/chunks/{chunk-X2TUDGFL.js → chunk-K426HTEQ.js} +44 -44
  193. package/dist/cli/chunks/{chunk-GGSXHGWD.js → chunk-K6IQBVD7.js} +2 -2
  194. package/dist/cli/chunks/{chunk-453UDYD2.js → chunk-KEJEZY2R.js} +163 -181
  195. package/dist/cli/chunks/{chunk-MTSMFEWK.js → chunk-KFE6LB4I.js} +2 -2
  196. package/dist/cli/chunks/{chunk-DDQWW22L.js → chunk-KO3WB4SU.js} +2 -2
  197. package/dist/cli/chunks/{chunk-ETGEGMYS.js → chunk-LAY35POY.js} +3 -3
  198. package/dist/cli/chunks/{chunk-P3NV6KN3.js → chunk-LFXXA325.js} +1 -1
  199. package/dist/cli/chunks/{chunk-ZK56THZT.js → chunk-LI3T5YNC.js} +3 -3
  200. package/dist/cli/chunks/{chunk-ACV2WVMX.js → chunk-LIEA5EON.js} +1 -1
  201. package/dist/cli/chunks/{chunk-KOOY72E3.js → chunk-LRJWKFGY.js} +2 -2
  202. package/dist/cli/chunks/{chunk-Y7TBCHW4.js → chunk-LY6PTRVL.js} +2 -2
  203. package/dist/cli/chunks/{chunk-WP6XUSVW.js → chunk-MAXOIEUG.js} +1 -1
  204. package/dist/cli/chunks/{chunk-X2L4POJE.js → chunk-MN6W7ZNL.js} +1 -1
  205. package/dist/cli/chunks/{chunk-CERSTEAJ.js → chunk-NGE5YNKC.js} +2 -2
  206. package/dist/cli/chunks/{chunk-J425SQFE.js → chunk-NIW4CLN2.js} +2 -2
  207. package/dist/cli/chunks/{chunk-PJ4HSXH3.js → chunk-NPT7BYGF.js} +1 -1
  208. package/dist/cli/chunks/{chunk-HHSEIPSQ.js → chunk-NZNXEEZR.js} +1 -1
  209. package/dist/cli/chunks/{chunk-FMULOSBL.js → chunk-O3IIAIXB.js} +1 -1
  210. package/dist/cli/chunks/{chunk-ITRUZ3WE.js → chunk-OC2W7KIW.js} +2 -2
  211. package/dist/cli/chunks/{chunk-QZQGYSDG.js → chunk-OFUF3APC.js} +2 -2
  212. package/dist/cli/chunks/{chunk-MKLLB4PM.js → chunk-OU52V67H.js} +4 -4
  213. package/dist/cli/chunks/{chunk-Y7UJC5OL.js → chunk-P2RR4SW5.js} +3 -3
  214. package/dist/cli/chunks/{chunk-7Q6CMSMD.js → chunk-P3VRXQ3H.js} +3 -3
  215. package/dist/cli/chunks/{chunk-YRP73HO4.js → chunk-P5SGBQLY.js} +1 -1
  216. package/dist/cli/chunks/{chunk-MDYI4IIW.js → chunk-P7MIOTVP.js} +1 -1
  217. package/dist/cli/chunks/{chunk-B4QA3YN6.js → chunk-PFDILSVO.js} +1 -1
  218. package/dist/cli/chunks/{chunk-2ZC7S4UG.js → chunk-PPD5ZLNA.js} +2 -2
  219. package/dist/cli/chunks/{chunk-VGYUVMSN.js → chunk-QFJDR4HC.js} +2 -2
  220. package/dist/cli/chunks/{chunk-3GWSHRDA.js → chunk-QZ2GQGJX.js} +2 -2
  221. package/dist/cli/chunks/{chunk-XMZ2DHUL.js → chunk-QZLTIGLB.js} +1 -1
  222. package/dist/cli/chunks/{chunk-BEOGI5FC.js → chunk-RHSUXQNF.js} +2 -2
  223. package/dist/cli/chunks/{chunk-ISVBO4XO.js → chunk-S6BWEZKK.js} +2 -2
  224. package/dist/cli/chunks/{chunk-AYOTODUV.js → chunk-SE4S23C7.js} +1 -1
  225. package/dist/cli/chunks/{chunk-SLWJNHCR.js → chunk-TOGZ37RL.js} +2 -2
  226. package/dist/cli/chunks/{chunk-73EWPVBJ.js → chunk-UCXW24HY.js} +2 -2
  227. package/dist/cli/chunks/{chunk-JQSA6EMI.js → chunk-UQ6WB4N2.js} +2 -2
  228. package/dist/cli/chunks/{chunk-SQPDGRYR.js → chunk-UQBGA4UA.js} +1 -1
  229. package/dist/cli/chunks/{chunk-N3R3JGUY.js → chunk-VNFL2TPU.js} +1 -1
  230. package/dist/cli/chunks/{chunk-QGBXENIP.js → chunk-WARFZ626.js} +1 -1
  231. package/dist/cli/chunks/{chunk-PVBJUANU.js → chunk-WEBHFIWS.js} +2 -2
  232. package/dist/cli/chunks/{chunk-YQIMO7VJ.js → chunk-WKIYYF3G.js} +2 -2
  233. package/dist/cli/chunks/{chunk-6VQKNPGY.js → chunk-WZC4HKGZ.js} +2 -2
  234. package/dist/cli/chunks/{chunk-O6FN53HB.js → chunk-X36TZXDK.js} +1 -1
  235. package/dist/cli/chunks/{chunk-IKNDGXZZ.js → chunk-XN4G3SRU.js} +2 -2
  236. package/dist/cli/chunks/{chunk-N7MKF4F4.js → chunk-XNREA3FG.js} +1 -1
  237. package/dist/cli/chunks/{chunk-PC3VIR2A.js → chunk-XRDPGJNW.js} +2 -2
  238. package/dist/cli/chunks/{chunk-ETZ62NFD.js → chunk-XXCSJMSR.js} +1 -1
  239. package/dist/cli/chunks/{chunk-LCDRRAES.js → chunk-XY2B2BEJ.js} +2 -2
  240. package/dist/cli/chunks/{chunk-HMSPPGUF.js → chunk-XY4JS3IZ.js} +2 -2
  241. package/dist/cli/chunks/{chunk-L7GQKJLV.js → chunk-Y4M2HMPR.js} +2 -2
  242. package/dist/cli/chunks/{chunk-2TUVBEWK.js → chunk-YDPBCN7H.js} +2 -2
  243. package/dist/cli/chunks/{chunk-NBTKI2TX.js → chunk-YGR54EAA.js} +2 -2
  244. package/dist/cli/chunks/{chunk-WBQEOACC.js → chunk-YGRY2TVI.js} +2 -2
  245. package/dist/cli/chunks/{chunk-VVJXQ4FR.js → chunk-YJUJCLXV.js} +2 -2
  246. package/dist/cli/chunks/{chunk-SHW43QQV.js → chunk-YWG4LHFU.js} +2 -2
  247. package/dist/cli/chunks/{chunk-FGOVDO3R.js → chunk-Z2QNTRUX.js} +2 -2
  248. package/dist/cli/chunks/{chunk-UFMW25MS.js → chunk-ZBJMVWQR.js} +2 -2
  249. package/dist/cli/chunks/{chunk-7MBF3S25.js → chunk-ZH6HYT7C.js} +1 -1
  250. package/dist/cli/chunks/{chunk-LYV7WJWA.js → chunk-ZP2GE6DM.js} +1 -1
  251. package/dist/cli/chunks/{chunk-JNX7IRSI.js → chunk-ZQYEBLTL.js} +2 -2
  252. package/dist/cli/chunks/{chunk-FTOICJQG.js → chunk-ZRU3OZEU.js} +2 -2
  253. package/dist/cli/chunks/{chunk-OZQIDDXB.js → chunk-ZU3V4CJ4.js} +2 -2
  254. package/dist/cli/chunks/{chunk-JZFA2PWY.js → chunk-ZWMXF6AX.js} +2 -2
  255. package/dist/cli/chunks/{ci-4JK2NFCD.js → ci-SM3EVLZ4.js} +2 -2
  256. package/dist/cli/chunks/{ci-output-LCGTJQWC.js → ci-output-YYXICZBC.js} +2 -2
  257. package/dist/cli/chunks/{circuit-breaker-EJF7D3L4.js → circuit-breaker-CV5UGKXT.js} +2 -2
  258. package/dist/cli/chunks/{claude-flow-setup-3RUC6OB4.js → claude-flow-setup-BSBUZ4B7.js} +2 -2
  259. package/dist/cli/chunks/client-WRDYZGM2.js +2 -0
  260. package/dist/cli/chunks/{cline-installer-6LY5C5QH.js → cline-installer-P2O6STIC.js} +2 -2
  261. package/dist/cli/chunks/code-M7DDLBGS.js +58 -0
  262. package/dist/cli/chunks/{code-index-extractor-OY5GQJBM.js → code-index-extractor-3QZIUYOG.js} +2 -2
  263. package/dist/cli/chunks/{codex-installer-BO7E2ZVA.js → codex-installer-5JVZCCTC.js} +2 -2
  264. package/dist/cli/chunks/{completions-VGL3KJ2R.js → completions-EM7IL2BJ.js} +8 -5
  265. package/dist/cli/chunks/{complexity-analyzer-5DPUK7IL.js → complexity-analyzer-VJXVB2CV.js} +2 -2
  266. package/dist/cli/chunks/{continuedev-installer-LFDG2D42.js → continuedev-installer-RCKJIAEC.js} +2 -2
  267. package/dist/cli/chunks/{copilot-installer-SEMMMIZH.js → copilot-installer-DZ7LTDOZ.js} +2 -2
  268. package/dist/cli/chunks/core-handlers-O6E5DNHT.js +2 -0
  269. package/dist/cli/chunks/{cost-tracker-OPBC6FQM.js → cost-tracker-QLOLXVAM.js} +2 -2
  270. package/dist/cli/chunks/{coverage-CFDUSRKU.js → coverage-LYHTLWRV.js} +3 -3
  271. package/dist/cli/chunks/cross-domain-router-EV7LQMDO.js +2 -0
  272. package/dist/cli/chunks/{cursor-installer-6TXUUVY4.js → cursor-installer-PSIZ3Y53.js} +2 -2
  273. package/dist/cli/chunks/{daemon-5KO46YQR.js → daemon-IYDTMA5M.js} +4 -4
  274. package/dist/cli/chunks/{daemon-7BDBPPAF.js → daemon-YLOAXM4X.js} +3 -3
  275. package/dist/cli/chunks/{dag-attention-scheduler-6DQKZOUW.js → dag-attention-scheduler-I2UIO3Z7.js} +2 -2
  276. package/dist/cli/chunks/{detect-R2QAYDPI.js → detect-ZXQ7X7GZ.js} +2 -2
  277. package/dist/cli/chunks/{dist-node-3POCIJ4N.js → dist-node-GK6OZX4H.js} +2 -2
  278. package/dist/cli/chunks/{domain-handler-KW63CHUH.js → domain-handler-NS3IBLRQ.js} +2 -2
  279. package/dist/cli/chunks/{domain-transfer-2QPOJCUD.js → domain-transfer-5G4RZEWF.js} +2 -2
  280. package/dist/cli/chunks/dream-E4C236UL.js +2 -0
  281. package/dist/cli/chunks/{embed-and-insert-pattern-OIDJZQEP.js → embed-and-insert-pattern-V4JJUFR6.js} +2 -2
  282. package/dist/cli/chunks/{eval-UGEKTTAQ.js → eval-7Q6PPYKR.js} +2 -2
  283. package/dist/cli/chunks/{experience-capture-middleware-3BIM2TT7.js → experience-capture-middleware-DUBKSYFM.js} +3 -3
  284. package/dist/cli/chunks/{fast-paths-HCJQXB7W.js → fast-paths-IDPPMBUW.js} +2 -2
  285. package/dist/cli/chunks/{feature-flags-W4JSFBMV.js → feature-flags-EPTMAAKA.js} +2 -2
  286. package/dist/cli/chunks/{feature-flags-GDGJKLN4.js → feature-flags-KXI6FDY7.js} +2 -2
  287. package/dist/cli/chunks/{file-discovery-JMUZ4MUH.js → file-discovery-EDX2OJO7.js} +2 -2
  288. package/dist/cli/chunks/{fleet-YNNK2CKW.js → fleet-67BO3LJ4.js} +3 -3
  289. package/dist/cli/chunks/{gnn-wrapper-R2ZY6CDD.js → gnn-wrapper-YARORYT7.js} +2 -2
  290. package/dist/cli/chunks/{heartbeat-handler-OZX2EJHQ.js → heartbeat-handler-K3JGPBYR.js} +4 -4
  291. package/dist/cli/chunks/heartbeat-scheduler-WMADLDKT.js +2 -0
  292. package/dist/cli/chunks/hnsw-adapter-STRDGJ65.js +2 -0
  293. package/dist/cli/chunks/hnsw-index-DBHX3TSC.js +2 -0
  294. package/dist/cli/chunks/{hnsw-legacy-bridge-3S6TYCG3.js → hnsw-legacy-bridge-CDDRSV5E.js} +2 -2
  295. package/dist/cli/chunks/{better-sqlite3-RIBLRHJL.js → hnswlib-node-2KL54YUA.js} +2 -2
  296. package/dist/cli/chunks/{hooks-KM7WR35T.js → hooks-6SCAE6LC.js} +10 -10
  297. package/dist/cli/chunks/hybrid-router-L2K55I4T.js +2 -0
  298. package/dist/cli/chunks/{hypergraph-engine-RX53A73M.js → hypergraph-engine-I3LUMO7I.js} +2 -2
  299. package/dist/cli/chunks/{hypergraph-handler-3QQB3H3Z.js → hypergraph-handler-YAKAIVCN.js} +3 -3
  300. package/dist/cli/chunks/impact-analyzer-WMO7ZGS7.js +2 -0
  301. package/dist/cli/chunks/{init-handler-Y62RH4ZI.js → init-handler-NBKCZD7Q.js} +6 -6
  302. package/dist/cli/chunks/init-wizard-ZAB7UZZS.js +2 -0
  303. package/dist/cli/chunks/kernel-4MUFDEQI.js +2 -0
  304. package/dist/cli/chunks/{kilocode-installer-26R253L2.js → kilocode-installer-YGPJCPU3.js} +2 -2
  305. package/dist/cli/chunks/{kiro-installer-PFA5QPZZ.js → kiro-installer-JV3ONVMN.js} +2 -2
  306. package/dist/cli/chunks/knowledge-graph-GZRFGXLX.js +2 -0
  307. package/dist/cli/chunks/{learning-CQLM5ANX.js → learning-2FEZJ5CX.js} +3 -3
  308. package/dist/cli/chunks/{llm-router-QZ5PG4PF.js → llm-router-SILI4KLU.js} +4 -4
  309. package/dist/cli/chunks/llm-router-service-5ODLU5U5.js +2 -0
  310. package/dist/cli/chunks/{load-UPA6LPHM.js → load-EGXLQVR3.js} +2 -2
  311. package/dist/cli/chunks/load-test-ZDQFS5XS.js +2 -0
  312. package/dist/cli/chunks/{mcp-LSWTLAJ4.js → mcp-OJH775TL.js} +2 -2
  313. package/dist/cli/chunks/{memory-VGEYYGCG.js → memory-FNEOK4FW.js} +5 -5
  314. package/dist/cli/chunks/memory-backend-UK7SQ6ZM.js +2 -0
  315. package/dist/cli/chunks/{memory-handlers-QBURG7NA.js → memory-handlers-6LDUH3JZ.js} +2 -2
  316. package/dist/cli/chunks/{multi-model-executor-VZVFBIKC.js → multi-model-executor-ORTFWLLE.js} +2 -2
  317. package/dist/cli/chunks/{opencode-installer-PBQAXNLV.js → opencode-installer-UAQLW6XX.js} +2 -2
  318. package/dist/cli/chunks/{orchestrator-YND7JB5O.js → orchestrator-VE5KJ2V4.js} +5 -5
  319. package/dist/cli/chunks/pattern-null-store-LO2QTIBU.js +2 -0
  320. package/dist/cli/chunks/{pipeline-GM5RRUES.js → pipeline-FNMDRWTU.js} +2 -2
  321. package/dist/cli/chunks/{platform-L7OGGRSL.js → platform-MGAKRUQN.js} +2 -2
  322. package/dist/cli/chunks/{plugin-N4YAE6H5.js → plugin-YX7THX3I.js} +2 -2
  323. package/dist/cli/chunks/{prime-radiant-advanced-wasm-7D67XV6Z.js → prime-radiant-advanced-wasm-XJV4RLMK.js} +2 -2
  324. package/dist/cli/chunks/protocol-executor-JWMYQEOI.js +2 -0
  325. package/dist/cli/chunks/{protocol-handler-V2WTFU7N.js → protocol-handler-QFET442Y.js} +2 -2
  326. package/dist/cli/chunks/{prove-33DS5Z3N.js → prove-QBAESCOC.js} +2 -2
  327. package/dist/cli/chunks/provider-manager-PEXOHGNB.js +2 -0
  328. package/dist/cli/chunks/qe-reasoning-bank-7B2G4UGQ.js +2 -0
  329. package/dist/cli/chunks/{quality-WCSEA5GH.js → quality-ZTNRL6EG.js} +2 -2
  330. package/dist/cli/chunks/queen-coordinator-6OF4HT3S.js +2 -0
  331. package/dist/cli/chunks/{real-embeddings-OQ5F37DG.js → real-embeddings-ZFFDV6HC.js} +2 -2
  332. package/dist/cli/chunks/{roocode-installer-II7LIR2X.js → roocode-installer-J4LFL4AE.js} +2 -2
  333. package/dist/cli/chunks/router-GMWRF6DU.js +2 -0
  334. package/dist/cli/chunks/routing-feedback-XKJSQK3I.js +2 -0
  335. package/dist/cli/chunks/{routing-handler-6OFHARIY.js → routing-handler-A5QG2TP2.js} +2 -2
  336. package/dist/cli/chunks/{ruvector-commands-GD5JTR4M.js → ruvector-commands-J5JL5WX5.js} +2 -2
  337. package/dist/cli/chunks/{rvf-dual-writer-HSK6BYZV.js → rvf-dual-writer-H7442GMO.js} +2 -2
  338. package/dist/cli/chunks/{rvf-migration-adapter-554SMF5S.js → rvf-migration-adapter-PTFQUYKC.js} +2 -2
  339. package/dist/cli/chunks/{rvf-migration-coordinator-OFDBCAYE.js → rvf-migration-coordinator-RSNROYRX.js} +2 -2
  340. package/dist/cli/chunks/rvf-native-adapter-YEA6TMXB.js +2 -0
  341. package/dist/cli/chunks/safe-db-5DOP2J3V.js +2 -0
  342. package/dist/cli/chunks/schedule-SUWTOBHP.js +2 -0
  343. package/dist/cli/chunks/scheduler-P4VTC5SQ.js +2 -0
  344. package/dist/cli/chunks/{security-GN4J6DSS.js → security-LHHLMCBA.js} +3 -3
  345. package/dist/cli/chunks/{shared-rvf-adapter-Q4PM3QCN.js → shared-rvf-adapter-NPSHVUTM.js} +2 -2
  346. package/dist/cli/chunks/{shared-rvf-dual-writer-R5WK5BXQ.js → shared-rvf-dual-writer-INQDY5WE.js} +2 -2
  347. package/dist/cli/chunks/sqlite-persistence-5Z2RAXH7.js +2 -0
  348. package/dist/cli/chunks/{status-handler-AHS5WVMG.js → status-handler-R2KIAMAE.js} +2 -2
  349. package/dist/cli/chunks/{structural-health-5KUKNLHZ.js → structural-health-2VPPIOZX.js} +2 -2
  350. package/dist/cli/chunks/{sync-PUMM3SR6.js → sync-ASZ3T5GT.js} +2 -2
  351. package/dist/cli/chunks/{sync-TQLGD5HX.js → sync-NLASP7AK.js} +2 -2
  352. package/dist/cli/chunks/{task-handler-D7VXV4AF.js → task-handler-UV5R6LJG.js} +2 -2
  353. package/dist/cli/chunks/{task-handlers-QMN4SWUG.js → task-handlers-I6YJXPYP.js} +3 -3
  354. package/dist/cli/chunks/{test-HEWZR6YQ.js → test-TE43TNTI.js} +4 -4
  355. package/dist/cli/chunks/{test-scheduling-VTMLBEPA.js → test-scheduling-WWWWF2TZ.js} +3 -3
  356. package/dist/cli/chunks/{token-bootstrap-IYBG7PQ6.js → token-bootstrap-HEWP7KKS.js} +2 -2
  357. package/dist/cli/chunks/{token-usage-C7H27BFZ.js → token-usage-3FVHUAW6.js} +2 -2
  358. package/dist/cli/chunks/{transformers-5ZJVC6NB.js → transformers-O5OFM4XM.js} +2 -2
  359. package/dist/cli/chunks/{tree-sitter-wasm-parser-EARBJG2H.js → tree-sitter-wasm-parser-YOYWFW63.js} +2 -2
  360. package/dist/cli/chunks/{types-3IHE42PZ.js → types-42GR6PLO.js} +2 -2
  361. package/dist/cli/chunks/unified-memory-HCKOPFAY.js +2 -0
  362. package/dist/cli/chunks/unified-memory-hnsw-6NQPYA5C.js +2 -0
  363. package/dist/cli/chunks/unified-persistence-NIMKNAFR.js +2 -0
  364. package/dist/cli/chunks/{upgrade-YP3VFSXO.js → upgrade-BU6DJ4LT.js} +2 -2
  365. package/dist/cli/chunks/{validate-VSBNKPN6.js → validate-MPTBARGN.js} +2 -2
  366. package/dist/cli/chunks/{validate-swarm-GOCJVWXE.js → validate-swarm-5LUQYHPP.js} +2 -2
  367. package/dist/cli/chunks/{vibium-U6YKCLDF.js → vibium-MJJDANDL.js} +2 -2
  368. package/dist/cli/chunks/visual-security-HFGHA57Z.js +2 -0
  369. package/dist/cli/chunks/{web-tree-sitter-TSNVGWSN.js → web-tree-sitter-5TF4UGB3.js} +2 -2
  370. package/dist/cli/chunks/{windsurf-installer-2VKMEFSD.js → windsurf-installer-NQAOSVCN.js} +2 -2
  371. package/dist/cli/chunks/{witness-chain-BWZCW52H.js → witness-chain-23UWK2JT.js} +2 -2
  372. package/dist/cli/chunks/witness-chain-VZGGJ7TJ.js +2 -0
  373. package/dist/cli/chunks/{workflow-J6SCYLU3.js → workflow-3QOLXRJC.js} +4 -4
  374. package/dist/cli/chunks/workflow-orchestrator-45L7D4SN.js +2 -0
  375. package/dist/cli/chunks/{wrappers-M5C7DONW.js → wrappers-S6EUZBCX.js} +2 -2
  376. package/dist/cli/commands/code.js +78 -2
  377. package/dist/cli/completions/index.js +4 -1
  378. package/dist/domains/code-intelligence/coordinator.js +8 -4
  379. package/dist/domains/code-intelligence/services/c4-model/from-detected.d.ts +41 -0
  380. package/dist/domains/code-intelligence/services/c4-model/from-detected.js +152 -0
  381. package/dist/domains/code-intelligence/services/c4-model/kg-relationships.d.ts +71 -0
  382. package/dist/domains/code-intelligence/services/c4-model/kg-relationships.js +87 -0
  383. package/dist/domains/code-intelligence/services/knowledge-graph.d.ts +6 -0
  384. package/dist/domains/code-intelligence/services/knowledge-graph.js +3 -3
  385. package/dist/domains/code-intelligence/services/product-factors-bridge.d.ts +26 -5
  386. package/dist/domains/code-intelligence/services/product-factors-bridge.js +72 -65
  387. package/dist/domains/requirements-validation/coordinator.d.ts +16 -2
  388. package/dist/domains/requirements-validation/coordinator.js +112 -7
  389. package/dist/domains/requirements-validation/plugin.js +20 -1
  390. package/dist/domains/test-generation/coordinator.d.ts +3 -1
  391. package/dist/domains/test-generation/coordinator.js +15 -33
  392. package/dist/integrations/darwin/types.d.ts +10 -3
  393. package/dist/integrations/darwin/types.js +10 -3
  394. package/dist/mcp/bundle.js +446 -464
  395. package/dist/mcp/tool-scoping.d.ts +8 -2
  396. package/dist/mcp/tool-scoping.js +13 -0
  397. package/dist/mcp/tools/code-intelligence/c4.d.ts +56 -0
  398. package/dist/mcp/tools/code-intelligence/c4.js +145 -0
  399. package/dist/mcp/tools/index.d.ts +1 -0
  400. package/dist/mcp/tools/index.js +1 -0
  401. package/dist/mcp/tools/registry.d.ts +1 -0
  402. package/dist/mcp/tools/registry.js +3 -0
  403. package/dist/routing/free-tier/coordinator-support.d.ts +90 -0
  404. package/dist/routing/free-tier/coordinator-support.js +78 -0
  405. package/dist/routing/free-tier/executor.d.ts +43 -1
  406. package/dist/routing/free-tier/executor.js +69 -26
  407. package/dist/routing/free-tier/index.d.ts +1 -0
  408. package/dist/routing/free-tier/index.js +1 -0
  409. package/dist/routing/value-score.d.ts +49 -0
  410. package/dist/routing/value-score.js +54 -0
  411. package/dist/shared/c4-model/confidence.d.ts +38 -0
  412. package/dist/shared/c4-model/confidence.js +69 -0
  413. package/dist/shared/c4-model/index.d.ts +4 -0
  414. package/dist/shared/c4-model/index.js +1 -0
  415. package/dist/shared/optional-module.d.ts +23 -0
  416. package/dist/shared/optional-module.js +46 -0
  417. package/dist/verification/adversarial-verify/calibrate.d.ts +32 -0
  418. package/dist/verification/adversarial-verify/calibrate.js +33 -0
  419. package/dist/verification/adversarial-verify/gate.d.ts +38 -0
  420. package/dist/verification/adversarial-verify/gate.js +32 -0
  421. package/dist/verification/adversarial-verify/index.d.ts +20 -0
  422. package/dist/verification/adversarial-verify/index.js +6 -0
  423. package/dist/verification/adversarial-verify/prompts.d.ts +14 -0
  424. package/dist/verification/adversarial-verify/prompts.js +17 -0
  425. package/dist/verification/adversarial-verify/synthesize.d.ts +18 -0
  426. package/dist/verification/adversarial-verify/synthesize.js +35 -0
  427. package/dist/verification/adversarial-verify/types.d.ts +59 -0
  428. package/dist/verification/adversarial-verify/types.js +10 -0
  429. package/dist/verification/adversarial-verify/verify.d.ts +20 -0
  430. package/dist/verification/adversarial-verify/verify.js +34 -0
  431. package/package.json +10 -1
  432. package/dist/cli/chunks/adapter-WLFT5VMV.js +0 -2
  433. package/dist/cli/chunks/aqe-learning-engine-JBH4GZUM.js +0 -2
  434. package/dist/cli/chunks/base-A7JGM473.js +0 -2
  435. package/dist/cli/chunks/browser-workflow-TIDJWULK.js +0 -2
  436. package/dist/cli/chunks/chunk-C4OYHUJV.js +0 -2
  437. package/dist/cli/chunks/client-ZLJ3JMBC.js +0 -2
  438. package/dist/cli/chunks/code-MPDG4UHS.js +0 -39
  439. package/dist/cli/chunks/core-handlers-EM7FUYTI.js +0 -2
  440. package/dist/cli/chunks/cross-domain-router-DYGHQ6P5.js +0 -2
  441. package/dist/cli/chunks/dream-DBE5D5BD.js +0 -2
  442. package/dist/cli/chunks/heartbeat-scheduler-NFHAANNL.js +0 -2
  443. package/dist/cli/chunks/hnsw-adapter-HMPCZFBY.js +0 -2
  444. package/dist/cli/chunks/hnsw-index-KRIWSXX4.js +0 -2
  445. package/dist/cli/chunks/hybrid-router-BAB32B2W.js +0 -2
  446. package/dist/cli/chunks/impact-analyzer-3D6XHWQE.js +0 -2
  447. package/dist/cli/chunks/init-wizard-LLU3WVGC.js +0 -2
  448. package/dist/cli/chunks/kernel-ZFHAYHHJ.js +0 -2
  449. package/dist/cli/chunks/knowledge-graph-ETZ65KOY.js +0 -2
  450. package/dist/cli/chunks/llm-router-service-R6CTGF5I.js +0 -2
  451. package/dist/cli/chunks/load-test-UOWIJUCH.js +0 -2
  452. package/dist/cli/chunks/memory-backend-E3ZQKW7A.js +0 -2
  453. package/dist/cli/chunks/pattern-null-store-OUOJO2RH.js +0 -2
  454. package/dist/cli/chunks/protocol-executor-KHAPG5CP.js +0 -2
  455. package/dist/cli/chunks/provider-manager-FGPPW7T4.js +0 -2
  456. package/dist/cli/chunks/qe-reasoning-bank-TS7XOJDA.js +0 -2
  457. package/dist/cli/chunks/queen-coordinator-J35FNFQ3.js +0 -2
  458. package/dist/cli/chunks/router-AFTKPDI5.js +0 -2
  459. package/dist/cli/chunks/routing-feedback-SABZUJTF.js +0 -2
  460. package/dist/cli/chunks/rvf-native-adapter-57MDDSFQ.js +0 -2
  461. package/dist/cli/chunks/safe-db-2HR6MVYM.js +0 -2
  462. package/dist/cli/chunks/schedule-KLVAN6XI.js +0 -2
  463. package/dist/cli/chunks/scheduler-WYZ6BC5Y.js +0 -2
  464. package/dist/cli/chunks/sqlite-persistence-2CGU5INO.js +0 -2
  465. package/dist/cli/chunks/unified-memory-PMYRQC5K.js +0 -2
  466. package/dist/cli/chunks/unified-memory-hnsw-7TRL2K5Q.js +0 -2
  467. package/dist/cli/chunks/unified-persistence-S4BNJK4S.js +0 -2
  468. package/dist/cli/chunks/visual-security-RPMZ3J7L.js +0 -2
  469. package/dist/cli/chunks/witness-chain-BTDZSQ6P.js +0 -2
  470. package/dist/cli/chunks/workflow-orchestrator-42B62D3V.js +0 -2
@@ -14,7 +14,7 @@
14
14
  * its HybridRouter). No runner → local-only. `escalate:false` = repair-only,
15
15
  * never leaves the start tier (the "no escalation yet" mode).
16
16
  */
17
- import { freeTierChat } from './provider.js';
17
+ import { freeTierChat, resolveFreeTierProvider } from './provider.js';
18
18
  import { resolveTier } from './ladder.js';
19
19
  import { AutoEscalationTracker } from '../escalation/auto-escalation-tracker.js';
20
20
  function normalizeVerdict(v) {
@@ -32,6 +32,8 @@ export class FreeTierEscalatingExecutor {
32
32
  baseTier;
33
33
  defaultRepairAttempts;
34
34
  onOutcome;
35
+ /** Resolved cross-model generator pool (A12); undefined ⇒ single-model best-of-k. */
36
+ candidateProviders;
35
37
  constructor(opts) {
36
38
  this.ladder = opts.ladder;
37
39
  this.claudeRunner = opts.claudeRunner;
@@ -39,6 +41,9 @@ export class FreeTierEscalatingExecutor {
39
41
  this.onOutcome = opts.onOutcome;
40
42
  this.defaultRepairAttempts = opts.defaultRepairAttempts ?? 0;
41
43
  this.baseTier = opts.ladder.tierOrder[0];
44
+ this.candidateProviders = opts.candidateProviders?.length
45
+ ? opts.candidateProviders.map((c) => resolveFreeTierProvider(c, this.env))
46
+ : undefined;
42
47
  this.tracker =
43
48
  opts.tracker ??
44
49
  new AutoEscalationTracker({
@@ -71,6 +76,21 @@ export class FreeTierEscalatingExecutor {
71
76
  return { ok: false, content: '', latencyMs: Date.now() - started, error: e.message };
72
77
  }
73
78
  }
79
+ /**
80
+ * Best-of-k diversity turn (06 §12): nudge the model toward a structurally
81
+ * different valid solution. Deterministic by `variant` index (no RNG) so runs
82
+ * replay identically.
83
+ */
84
+ diversify(base, variant) {
85
+ return [
86
+ ...base,
87
+ {
88
+ role: 'user',
89
+ content: `Alternative approach #${variant}: produce a different valid solution from any ` +
90
+ `previous attempt — vary the structure/strategy, not just naming. Return the full output only.`,
91
+ },
92
+ ];
93
+ }
74
94
  /** Build the D8 repair turn: show the model its rejected output + why. */
75
95
  repairMessages(base, lastOutput, feedback) {
76
96
  return [
@@ -92,6 +112,8 @@ export class FreeTierEscalatingExecutor {
92
112
  const order = this.ladder.tierOrder;
93
113
  const escalate = req.escalate ?? true;
94
114
  const repairAttempts = req.repairAttempts ?? this.defaultRepairAttempts;
115
+ const bestOfK = Math.max(1, req.bestOfK ?? 1);
116
+ const objectiveOracle = (req.oracleKind ?? 'objective') === 'objective';
95
117
  const startTier = this.tracker.getCurrentTier(req.agentId) ?? this.baseTier;
96
118
  const startIdx = Math.max(0, order.indexOf(startTier));
97
119
  const maxIdx = order.indexOf(this.ladder.maxTier ?? order[order.length - 1]);
@@ -101,38 +123,59 @@ export class FreeTierEscalatingExecutor {
101
123
  const attempts = [];
102
124
  let passedAtStart = false;
103
125
  const t0 = Date.now();
104
- let result = { ok: false, content: '', tierUsed: startTier, escalated: false, repaired: false, attempts };
126
+ let result = { ok: false, content: '', tierUsed: startTier, escalated: false, repaired: false, bestOf: false, goodhartGuarded: false, attempts };
105
127
  outer: for (let idx = startIdx; idx <= topIdx; idx++) {
106
128
  const tier = order[idx];
107
129
  const resolved = resolveTier(this.ladder, tier, this.env);
108
- // first try (round 0) + up to `repairAttempts` repair rounds
130
+ // round 0 = best-of-k diverse attempts (06 §12); rounds 1..repairAttempts = single repair turns (D8)
131
+ // A12: at the START free tier, round-0 candidates draw from a CROSS-MODEL pool
132
+ // (diverse models cover each other's failures) instead of one model's variants.
133
+ const pool = this.candidateProviders;
134
+ const xModelHere = !!pool && idx === startIdx && resolved.provider === 'free-tier';
109
135
  for (let round = 0; round <= repairAttempts; round++) {
110
- const messages = round === 0 ? req.messages : this.repairMessages(req.messages, result.content, attempts[attempts.length - 1]?.feedback);
111
- const run = await this.runTier(resolved, messages);
112
- const verdict = run.ok ? normalizeVerdict(await Promise.resolve(req.verify(run.content))) : { passed: false, feedback: run.error };
113
- attempts.push({ tier, provider: resolved.provider, repairRound: round, ok: run.ok, passed: verdict.passed, latencyMs: run.latencyMs, feedback: verdict.feedback, error: run.error });
114
- if (idx === startIdx && round === 0)
115
- passedAtStart = verdict.passed;
116
- if (verdict.passed) {
117
- result = { ok: true, content: run.content, tierUsed: tier, escalated: idx > startIdx, repaired: round > 0, attempts };
118
- break outer;
136
+ const attemptsThisRound = round === 0 ? bestOfK : 1;
137
+ for (let k = 0; k < attemptsThisRound; k++) {
138
+ const candProvider = round === 0 && xModelHere && pool ? pool[k % pool.length] : undefined;
139
+ const candResolved = candProvider ? { provider: 'free-tier', resolved: candProvider } : resolved;
140
+ const messages = round !== 0
141
+ ? this.repairMessages(req.messages, result.content, attempts[attempts.length - 1]?.feedback)
142
+ : candProvider
143
+ // model difference IS the diversity; only nudge when k wraps past the pool
144
+ ? (pool && k < pool.length ? req.messages : this.diversify(req.messages, k))
145
+ : (k === 0 ? req.messages : this.diversify(req.messages, k));
146
+ const run = await this.runTier(candResolved, messages);
147
+ const verdict = run.ok ? normalizeVerdict(await Promise.resolve(req.verify(run.content))) : { passed: false, feedback: run.error };
148
+ attempts.push({ tier, provider: candResolved.provider, repairRound: round, variant: round === 0 ? k : undefined, model: candProvider?.model, ok: run.ok, passed: verdict.passed, latencyMs: run.latencyMs, feedback: verdict.feedback, error: run.error });
149
+ // start-tier capability for adaptation: did ANY round-0 attempt pass?
150
+ if (idx === startIdx && round === 0 && verdict.passed)
151
+ passedAtStart = true;
152
+ if (verdict.passed) {
153
+ result = { ok: true, content: run.content, tierUsed: tier, escalated: idx > startIdx, repaired: round > 0, bestOf: round === 0 && k > 0, goodhartGuarded: false, attempts };
154
+ break outer;
155
+ }
156
+ result = { ok: false, content: run.content || result.content, tierUsed: tier, escalated: idx > startIdx, repaired: round > 0, bestOf: false, goodhartGuarded: false, attempts };
119
157
  }
120
- result = { ok: false, content: run.content || result.content, tierUsed: tier, escalated: idx > startIdx, repaired: round > 0, attempts };
121
158
  }
122
159
  }
123
- // Cross-task adaptation: feed the START-tier verdict to the tracker so the
124
- // base tier drifts up when the cheap tier keeps failing, down when it wins.
125
- this.tracker.recordOutcome(req.agentId, passedAtStart, this.baseTier);
126
- this.onOutcome?.({
127
- agentId: req.agentId,
128
- startTier,
129
- tierUsed: result.tierUsed,
130
- passed: result.ok,
131
- escalated: result.escalated,
132
- repaired: result.repaired,
133
- durationMs: Date.now() - t0,
134
- attempts: attempts.length,
135
- });
160
+ // Goodhart guard (06 §10): only an OBJECTIVE ground-truth oracle may move
161
+ // routing-feedback. A self-authored gate is an unreliable selection target
162
+ // record nothing, so a Goodharted self-test pass can never lift confidence.
163
+ result.goodhartGuarded = !objectiveOracle;
164
+ if (objectiveOracle) {
165
+ // Cross-task adaptation: feed the START-tier verdict to the tracker so the
166
+ // base tier drifts up when the cheap tier keeps failing, down when it wins.
167
+ this.tracker.recordOutcome(req.agentId, passedAtStart, this.baseTier);
168
+ this.onOutcome?.({
169
+ agentId: req.agentId,
170
+ startTier,
171
+ tierUsed: result.tierUsed,
172
+ passed: result.ok,
173
+ escalated: result.escalated,
174
+ repaired: result.repaired,
175
+ durationMs: Date.now() - t0,
176
+ attempts: attempts.length,
177
+ });
178
+ }
136
179
  return result;
137
180
  }
138
181
  }
@@ -11,4 +11,5 @@ export { FREE_TIER_PRESETS, resolveFreeTierProvider, freeTierChat, freeTierHealt
11
11
  export { defaultFreeTierLadder, validateLadder, createFreeTierEscalation, resolveTier, type ResolvedTier, } from './ladder.js';
12
12
  export { FreeTierEscalatingExecutor, type ClaudeTierRunner, type QeVerifier, type QeVerdict, type QeTaskRequest, type QeExecutionResult, type TierAttempt, type FreeTierExecutorOptions, } from './executor.js';
13
13
  export { createRoutingFeedbackSink, type RoutingFeedbackLike, type FreeTierOutcomeEvent, type RoutingFeedbackSinkOptions, } from './feedback-sink.js';
14
+ export { buildFreeTierExecutor, runFreeTierTextTask, DEFAULT_FREE_TIER_MODEL, type FreeTierCoordinatorConfig, type FreeTierLlmRouter, type BuildFreeTierExecutorOptions, } from './coordinator-support.js';
14
15
  //# sourceMappingURL=index.d.ts.map
@@ -2,4 +2,5 @@ export { FREE_TIER_PRESETS, resolveFreeTierProvider, freeTierChat, freeTierHealt
2
2
  export { defaultFreeTierLadder, validateLadder, createFreeTierEscalation, resolveTier, } from './ladder.js';
3
3
  export { FreeTierEscalatingExecutor, } from './executor.js';
4
4
  export { createRoutingFeedbackSink, } from './feedback-sink.js';
5
+ export { buildFreeTierExecutor, runFreeTierTextTask, DEFAULT_FREE_TIER_MODEL, } from './coordinator-support.js';
5
6
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,49 @@
1
+ /**
2
+ * Cost-Pareto Value Score (plan 05 / A13).
3
+ *
4
+ * Ruv's leaderboard lesson (ADR-179): rank by quality-PER-DOLLAR, not absolute
5
+ * quality. This operationalizes ADR-111's "competitive QE quality cheaper than
6
+ * frontier" — pure functions to (a) compute a tunable value score, (b) rank a
7
+ * candidate pool, and (c) extract the cost-Pareto frontier (the non-dominated set
8
+ * a router should choose from). Pure + dependency-free.
9
+ *
10
+ * Companion: model→QE-role fit must be MEASURED, not assumed (the qwen3-coder
11
+ * leaderboard-rank-did-not-transfer lesson). {@link MEASURED_QE_TEST_GEN} is a
12
+ * dated snapshot from D3/A12; the router should refresh it from routing-feedback.
13
+ */
14
+ export interface ModelEconomics {
15
+ model: string;
16
+ /** Measured QE quality on the role, 0..1 (e.g. ADR-104 composite). NOT a vendor claim. */
17
+ quality: number;
18
+ /** USD per instance (0 for free/local tiers). */
19
+ costPerInstance: number;
20
+ }
21
+ export interface ValueScoreOptions {
22
+ /** 0 = rank by pure quality, 1 = pure cost-efficiency. Default 0.5 (the slider). */
23
+ costWeight?: number;
24
+ /** USD ceiling to normalize cost into [0,1]. Default = max cost in the set (or the value's own cost). */
25
+ costCap?: number;
26
+ }
27
+ /**
28
+ * Value score in [0,1]: a `costWeight`-weighted blend of quality and cost-
29
+ * efficiency (1 − normalizedCost). A $0 tier has perfect cost-efficiency, so its
30
+ * value is dominated by its quality.
31
+ */
32
+ export declare function valueScore(m: ModelEconomics, opts?: ValueScoreOptions): number;
33
+ /** Rank a candidate pool by value score (desc). Cost is normalized across the pool. */
34
+ export declare function rankByValue<T extends ModelEconomics>(models: T[], opts?: ValueScoreOptions): Array<T & {
35
+ value: number;
36
+ }>;
37
+ /**
38
+ * The cost-Pareto frontier: models NOT dominated by another (none is both
39
+ * cheaper AND ≥ quality). These are the only rational router choices — everything
40
+ * else is strictly worse on both axes. Sorted cheapest → most expensive.
41
+ */
42
+ export declare function paretoFrontier<T extends ModelEconomics>(models: T[]): T[];
43
+ /**
44
+ * MEASURED QE test-generation economics (snapshot 2026-06-24, D3/A12). Quality =
45
+ * composite (0.6·killRate + 0.3·coverage) on the 5-module corpus; cost is the
46
+ * per-instance estimate. NOT vendor claims — refresh from routing-feedback.
47
+ */
48
+ export declare const MEASURED_QE_TEST_GEN: readonly ModelEconomics[];
49
+ //# sourceMappingURL=value-score.d.ts.map
@@ -0,0 +1,54 @@
1
+ /**
2
+ * Cost-Pareto Value Score (plan 05 / A13).
3
+ *
4
+ * Ruv's leaderboard lesson (ADR-179): rank by quality-PER-DOLLAR, not absolute
5
+ * quality. This operationalizes ADR-111's "competitive QE quality cheaper than
6
+ * frontier" — pure functions to (a) compute a tunable value score, (b) rank a
7
+ * candidate pool, and (c) extract the cost-Pareto frontier (the non-dominated set
8
+ * a router should choose from). Pure + dependency-free.
9
+ *
10
+ * Companion: model→QE-role fit must be MEASURED, not assumed (the qwen3-coder
11
+ * leaderboard-rank-did-not-transfer lesson). {@link MEASURED_QE_TEST_GEN} is a
12
+ * dated snapshot from D3/A12; the router should refresh it from routing-feedback.
13
+ */
14
+ const clamp01 = (x) => Math.max(0, Math.min(1, x));
15
+ /**
16
+ * Value score in [0,1]: a `costWeight`-weighted blend of quality and cost-
17
+ * efficiency (1 − normalizedCost). A $0 tier has perfect cost-efficiency, so its
18
+ * value is dominated by its quality.
19
+ */
20
+ export function valueScore(m, opts = {}) {
21
+ const costWeight = clamp01(opts.costWeight ?? 0.5);
22
+ const cap = opts.costCap && opts.costCap > 0 ? opts.costCap : Math.max(m.costPerInstance, 1e-9);
23
+ const costEfficiency = clamp01(1 - m.costPerInstance / cap);
24
+ return clamp01((1 - costWeight) * clamp01(m.quality) + costWeight * costEfficiency);
25
+ }
26
+ /** Rank a candidate pool by value score (desc). Cost is normalized across the pool. */
27
+ export function rankByValue(models, opts = {}) {
28
+ const cap = opts.costCap && opts.costCap > 0 ? opts.costCap : Math.max(...models.map((m) => m.costPerInstance), 1e-9);
29
+ return models
30
+ .map((m) => ({ ...m, value: valueScore(m, { ...opts, costCap: cap }) }))
31
+ .sort((a, b) => b.value - a.value);
32
+ }
33
+ /**
34
+ * The cost-Pareto frontier: models NOT dominated by another (none is both
35
+ * cheaper AND ≥ quality). These are the only rational router choices — everything
36
+ * else is strictly worse on both axes. Sorted cheapest → most expensive.
37
+ */
38
+ export function paretoFrontier(models) {
39
+ const dominated = (m) => models.some((o) => o !== m && o.costPerInstance <= m.costPerInstance && o.quality >= m.quality &&
40
+ (o.costPerInstance < m.costPerInstance || o.quality > m.quality));
41
+ return models.filter((m) => !dominated(m)).sort((a, b) => a.costPerInstance - b.costPerInstance);
42
+ }
43
+ /**
44
+ * MEASURED QE test-generation economics (snapshot 2026-06-24, D3/A12). Quality =
45
+ * composite (0.6·killRate + 0.3·coverage) on the 5-module corpus; cost is the
46
+ * per-instance estimate. NOT vendor claims — refresh from routing-feedback.
47
+ */
48
+ export const MEASURED_QE_TEST_GEN = [
49
+ { model: 'qwen3:8b', quality: 0.0, costPerInstance: 0 }, // D3: below the generation floor (0/3 valid)
50
+ { model: 'qwen3:30b-a3b', quality: 0.62, costPerInstance: 0 }, // D3: clears the floor (best-of-k ~0.673 on judged)
51
+ { model: 'z-ai/glm-5.2', quality: 0.71, costPerInstance: 0.0065 }, // A12: diverse, higher per-model best
52
+ { model: 'claude-sonnet-4-6', quality: 0.83, costPerInstance: 0.045 }, // D3: frontier ceiling
53
+ ];
54
+ //# sourceMappingURL=value-score.js.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * ADR-112 — Deterministic C4 confidence gate.
3
+ *
4
+ * Pure, code-only (NO LLM in the gate — same discipline as ADR-111's accept
5
+ * gate). Turns the code-intelligence detector's known limits (the
6
+ * qe-code-intelligence skill records ~18% success on complex queries and
7
+ * degradation above ~50K LOC) into an explicit, surfaced signal so a
8
+ * confident-but-wrong diagram is never presented as ground truth.
9
+ */
10
+ export type C4Confidence = 'high' | 'medium' | 'low';
11
+ export interface C4ConfidenceInputs {
12
+ /** Number of components the detector found. */
13
+ componentsDetected: number;
14
+ /** Number of component relationships (edges) detected. */
15
+ relationshipsDetected: number;
16
+ /** Number of external systems detected. */
17
+ externalSystemsDetected: number;
18
+ /** Number of source files analyzed. */
19
+ filesAnalyzed: number;
20
+ /** Total lines of code, if known (e.g. from MetricCollector). Optional. */
21
+ totalLoc?: number;
22
+ }
23
+ export interface C4ConfidenceAssessment {
24
+ /** Bucketed level for quick display. */
25
+ level: C4Confidence;
26
+ /** Continuous score in [0,1] the level is derived from. */
27
+ score: number;
28
+ /** Human-readable reasons (always populated). */
29
+ reasons: string[];
30
+ }
31
+ /** Repo size (LOC) beyond which the skill records detection degradation. */
32
+ export declare const C4_LOC_DEGRADE_THRESHOLD = 50000;
33
+ /**
34
+ * Assess how much to trust an auto-generated C4 diagram. Deterministic: the same
35
+ * inputs always yield the same level + reasons.
36
+ */
37
+ export declare function assessC4Confidence(inputs: C4ConfidenceInputs): C4ConfidenceAssessment;
38
+ //# sourceMappingURL=confidence.d.ts.map
@@ -0,0 +1,69 @@
1
+ /**
2
+ * ADR-112 — Deterministic C4 confidence gate.
3
+ *
4
+ * Pure, code-only (NO LLM in the gate — same discipline as ADR-111's accept
5
+ * gate). Turns the code-intelligence detector's known limits (the
6
+ * qe-code-intelligence skill records ~18% success on complex queries and
7
+ * degradation above ~50K LOC) into an explicit, surfaced signal so a
8
+ * confident-but-wrong diagram is never presented as ground truth.
9
+ */
10
+ /** Repo size (LOC) beyond which the skill records detection degradation. */
11
+ export const C4_LOC_DEGRADE_THRESHOLD = 50_000;
12
+ const clamp01 = (x) => Math.max(0, Math.min(1, x));
13
+ /**
14
+ * Assess how much to trust an auto-generated C4 diagram. Deterministic: the same
15
+ * inputs always yield the same level + reasons.
16
+ */
17
+ export function assessC4Confidence(inputs) {
18
+ const { componentsDetected, relationshipsDetected, externalSystemsDetected, totalLoc } = inputs;
19
+ const reasons = [];
20
+ // Empty diagram — nothing to trust.
21
+ if (componentsDetected === 0) {
22
+ return {
23
+ level: 'low',
24
+ score: 0,
25
+ reasons: ['No components detected — the diagram is effectively empty; verify against the source.'],
26
+ };
27
+ }
28
+ let score = 0.5;
29
+ // Relationships are the weakest link in heuristic detection. Their presence is
30
+ // the strongest signal that the STRUCTURE (not just a node list) is real.
31
+ const relDensity = relationshipsDetected / Math.max(1, componentsDetected);
32
+ if (relationshipsDetected === 0 && componentsDetected > 1) {
33
+ score -= 0.25;
34
+ reasons.push('No relationships detected between components — edges are heuristic-only or missing; the structure is unverified.');
35
+ }
36
+ else if (relDensity >= 0.5) {
37
+ score += 0.2;
38
+ reasons.push(`${relationshipsDetected} relationship(s) detected across ${componentsDetected} components.`);
39
+ }
40
+ else {
41
+ score += 0.05;
42
+ reasons.push(`${relationshipsDetected} relationship(s) detected (sparse) across ${componentsDetected} components.`);
43
+ }
44
+ // External systems detected → the Platform/Interfaces picture is grounded.
45
+ if (externalSystemsDetected > 0) {
46
+ score += 0.1;
47
+ reasons.push(`${externalSystemsDetected} external system(s) detected from dependencies.`);
48
+ }
49
+ // Repo size vs the known degradation threshold.
50
+ if (totalLoc !== undefined && totalLoc > C4_LOC_DEGRADE_THRESHOLD) {
51
+ score -= 0.3;
52
+ reasons.push(`Repository is large (${totalLoc.toLocaleString()} LOC > ~${C4_LOC_DEGRADE_THRESHOLD / 1000}K) — detection accuracy degrades; treat the diagram as a draft.`);
53
+ }
54
+ // A healthy component count adds confidence; a single component is thin.
55
+ if (componentsDetected >= 5) {
56
+ score += 0.1;
57
+ }
58
+ else if (componentsDetected === 1) {
59
+ score -= 0.05;
60
+ reasons.push('Only one component detected — likely an under-segmented view.');
61
+ }
62
+ score = clamp01(score);
63
+ const level = score >= 0.7 ? 'high' : score >= 0.4 ? 'medium' : 'low';
64
+ if (level !== 'high' && !reasons.some((r) => r.includes('draft') || r.includes('verify'))) {
65
+ reasons.push('Auto-generated draft — verify against the source before relying on it.');
66
+ }
67
+ return { level, score: Math.round(score * 1000) / 1000, reasons };
68
+ }
69
+ //# sourceMappingURL=confidence.js.map
@@ -8,6 +8,8 @@
8
8
  * Based on the C4 Model by Simon Brown:
9
9
  * https://c4model.com/
10
10
  */
11
+ export * from './confidence';
12
+ import type { C4ConfidenceAssessment } from './confidence';
11
13
  /**
12
14
  * C4 Diagrams container for all diagram levels
13
15
  */
@@ -52,6 +54,8 @@ export interface C4AnalysisMetadata {
52
54
  externalSystemsDetected: number;
53
55
  /** Analysis duration in milliseconds */
54
56
  analysisTimeMs: number;
57
+ /** ADR-112: deterministic confidence gate for the generated diagrams */
58
+ confidence?: C4ConfidenceAssessment;
55
59
  }
56
60
  /**
57
61
  * C4 Person element - represents a user of the system
@@ -8,6 +8,7 @@
8
8
  * Based on the C4 Model by Simon Brown:
9
9
  * https://c4model.com/
10
10
  */
11
+ export * from './confidence';
11
12
  /**
12
13
  * Check if a cache entry is still valid
13
14
  */
@@ -0,0 +1,23 @@
1
+ export interface OptionalModuleAvailable<T> {
2
+ available: true;
3
+ degraded: false;
4
+ module: T;
5
+ }
6
+ export interface OptionalModuleDegraded {
7
+ available: false;
8
+ degraded: true;
9
+ name: string;
10
+ reason: string;
11
+ }
12
+ export type OptionalModuleResult<T> = OptionalModuleAvailable<T> | OptionalModuleDegraded;
13
+ /** True iff `err` means the module is genuinely NOT INSTALLED (vs. failed to load). */
14
+ export declare function isModuleAbsent(err: unknown): boolean;
15
+ /**
16
+ * Load an optional module. Returns `{available:true, module}` when present,
17
+ * `{available:false, degraded:true}` when genuinely absent, and RE-THROWS on any
18
+ * other load error (so real failures are never masked). Inject `req` for testing.
19
+ */
20
+ export declare function loadOptionalModule<T = unknown>(name: string, req?: NodeRequire): OptionalModuleResult<T>;
21
+ /** Convenience: the module if available, else `undefined` (degradation is silent here). */
22
+ export declare function optionalModule<T = unknown>(name: string, req?: NodeRequire): T | undefined;
23
+ //# sourceMappingURL=optional-module.d.ts.map
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Graceful optional-module loading (plan 05 / A9; ADR-150 pattern).
3
+ *
4
+ * AQE has many native/optional deps (@ruvector/{gnn,attention,sona,...},
5
+ * hnswlib-node, rvlite) declared in `optionalDependencies`, so a platform without
6
+ * a prebuilt binary (or a Dependabot-pruned lockfile) must DEGRADE, not crash.
7
+ *
8
+ * The hazard (AQE #528 lesson): the ad-hoc `try { require(x) } catch {}` scattered
9
+ * across the wrappers swallows EVERY error — so a binary that is PRESENT but fails
10
+ * to load (ABI mismatch, corrupt .node) is silently reported "unavailable",
11
+ * masking a real failure. This helper degrades ONLY on genuine absence
12
+ * (MODULE_NOT_FOUND) and RE-THROWS any other load error.
13
+ */
14
+ import { createRequire } from 'node:module';
15
+ const ABSENT_CODES = new Set(['MODULE_NOT_FOUND', 'ERR_MODULE_NOT_FOUND']);
16
+ /** True iff `err` means the module is genuinely NOT INSTALLED (vs. failed to load). */
17
+ export function isModuleAbsent(err) {
18
+ const e = err;
19
+ if (e?.code && ABSENT_CODES.has(e.code))
20
+ return true;
21
+ // Some loaders throw a plain Error; fall back to the canonical message shape.
22
+ return typeof e?.message === 'string' && /Cannot find module/.test(e.message);
23
+ }
24
+ const defaultRequire = createRequire(import.meta.url);
25
+ /**
26
+ * Load an optional module. Returns `{available:true, module}` when present,
27
+ * `{available:false, degraded:true}` when genuinely absent, and RE-THROWS on any
28
+ * other load error (so real failures are never masked). Inject `req` for testing.
29
+ */
30
+ export function loadOptionalModule(name, req = defaultRequire) {
31
+ try {
32
+ return { available: true, degraded: false, module: req(name) };
33
+ }
34
+ catch (err) {
35
+ if (isModuleAbsent(err)) {
36
+ return { available: false, degraded: true, name, reason: `optional module "${name}" not installed (running degraded)` };
37
+ }
38
+ throw err; // present but broken — do NOT mask a real failure (#528)
39
+ }
40
+ }
41
+ /** Convenience: the module if available, else `undefined` (degradation is silent here). */
42
+ export function optionalModule(name, req) {
43
+ const r = loadOptionalModule(name, req);
44
+ return r.available ? r.module : undefined;
45
+ }
46
+ //# sourceMappingURL=optional-module.js.map
@@ -0,0 +1,32 @@
1
+ /**
2
+ * @ruvector/adversarial-verify — calibration (plan 05 / A2 step 5).
3
+ *
4
+ * Measure the verifier against a LABELED set (findings tagged real/false) to get
5
+ * the operating point: false-kill (a REAL finding wrongly refuted — the costly
6
+ * error) and false-keep (a FALSE finding that survives). Works with any `Judge`
7
+ * — a deterministic stub (characterize the k-of-n aggregation) or a real LLM
8
+ * (empirical false-kill on a labeled corpus).
9
+ */
10
+ import type { AdversarialVerifyOptions, Finding } from './types.js';
11
+ export interface LabeledFinding {
12
+ finding: Finding;
13
+ /** Ground truth: is this a genuine, actionable problem? */
14
+ isReal: boolean;
15
+ }
16
+ export interface CalibrationReport {
17
+ total: number;
18
+ realCount: number;
19
+ falseCount: number;
20
+ /** REAL findings wrongly refuted (the costly error). */
21
+ falseKill: number;
22
+ falseKillRate: number;
23
+ /** FALSE findings wrongly upheld (survived verification). */
24
+ falseKeep: number;
25
+ falseKeepRate: number;
26
+ correctConfirm: number;
27
+ correctKill: number;
28
+ uncertain: number;
29
+ }
30
+ /** Run the verifier over a labeled set and report the confusion vs ground truth. */
31
+ export declare function calibrate(labeled: LabeledFinding[], opts: AdversarialVerifyOptions): Promise<CalibrationReport>;
32
+ //# sourceMappingURL=calibrate.d.ts.map
@@ -0,0 +1,33 @@
1
+ import { adversarialVerify } from './verify.js';
2
+ /** Run the verifier over a labeled set and report the confusion vs ground truth. */
3
+ export async function calibrate(labeled, opts) {
4
+ const verdicts = await adversarialVerify(labeled.map((l) => l.finding), opts);
5
+ const r = {
6
+ total: labeled.length, realCount: 0, falseCount: 0,
7
+ falseKill: 0, falseKillRate: 0, falseKeep: 0, falseKeepRate: 0,
8
+ correctConfirm: 0, correctKill: 0, uncertain: 0,
9
+ };
10
+ labeled.forEach((l, i) => {
11
+ const v = verdicts[i].verdict;
12
+ if (v === 'uncertain')
13
+ r.uncertain++;
14
+ if (l.isReal) {
15
+ r.realCount++;
16
+ if (v === 'refuted')
17
+ r.falseKill++;
18
+ else if (v === 'upheld')
19
+ r.correctConfirm++;
20
+ }
21
+ else {
22
+ r.falseCount++;
23
+ if (v === 'upheld')
24
+ r.falseKeep++;
25
+ else if (v === 'refuted')
26
+ r.correctKill++;
27
+ }
28
+ });
29
+ r.falseKillRate = r.realCount ? r.falseKill / r.realCount : 0;
30
+ r.falseKeepRate = r.falseCount ? r.falseKeep / r.falseCount : 0;
31
+ return r;
32
+ }
33
+ //# sourceMappingURL=calibrate.js.map
@@ -0,0 +1,38 @@
1
+ /**
2
+ * @ruvector/adversarial-verify — output gate (plan 05 / A5).
3
+ *
4
+ * An opt-in "verify before you emit" gate any vertical/harness can embed: route
5
+ * emitted findings/claims through the blind refuters and DROP the refuted ones
6
+ * before acting. Default-off-able and cost-neutral when disabled (no Judge calls).
7
+ * Surfaces every verdict for witness/telemetry, and reports the gate's overhead.
8
+ *
9
+ * Vendor-ready: zero dependencies beyond this module, so MetaHarness (or any host)
10
+ * can embed it as a per-vertical `verify` hook.
11
+ */
12
+ import type { AdversarialVerifyOptions, Finding, FindingVerdict } from './types.js';
13
+ export interface VerifyGateOptions extends AdversarialVerifyOptions {
14
+ /** Off ⇒ no-op pass-through, ZERO Judge calls (cost-neutral). Default true. */
15
+ enabled?: boolean;
16
+ /** Also block `uncertain` verdicts (all refuters failed), not just `refuted`. Default false. */
17
+ dropUncertain?: boolean;
18
+ }
19
+ export interface VerifyGateResult {
20
+ enabled: boolean;
21
+ /** Findings that PASS the gate — emit these. */
22
+ emitted: FindingVerdict[];
23
+ /** Findings the gate blocked (refuted, + uncertain when `dropUncertain`). */
24
+ blocked: FindingVerdict[];
25
+ /** All verdicts (for witness/telemetry). */
26
+ all: FindingVerdict[];
27
+ /** Gate wall-clock overhead in ms (A5 (d) — measured cost). */
28
+ latencyMs: number;
29
+ /** Judge invocations the gate made (0 when disabled). Token cost ∝ this. */
30
+ judgeCalls: number;
31
+ }
32
+ /**
33
+ * Verify findings before emitting them. Returns the survivors (`emitted`), the
34
+ * killed (`blocked`), every verdict (`all`), and the gate's overhead. When
35
+ * `enabled === false` it is a no-op: no Judge calls, everything passes through.
36
+ */
37
+ export declare function verifyGate(findings: Finding[], opts: VerifyGateOptions): Promise<VerifyGateResult>;
38
+ //# sourceMappingURL=gate.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { adversarialVerify } from './verify.js';
2
+ /** A finding passed through un-verified (gate disabled): honest `uncertain`. */
3
+ function passthrough(f) {
4
+ return {
5
+ contract: 'finding-verdict@1',
6
+ id: f.id, title: f.title,
7
+ ...(f.file !== undefined ? { file: f.file } : {}),
8
+ severity: f.severity, confidence: f.confidence, evidence: f.evidence,
9
+ verdict: 'uncertain', refutations: [],
10
+ };
11
+ }
12
+ const isBlocked = (v, dropUncertain) => v.verdict === 'refuted' || (dropUncertain && v.verdict === 'uncertain');
13
+ /**
14
+ * Verify findings before emitting them. Returns the survivors (`emitted`), the
15
+ * killed (`blocked`), every verdict (`all`), and the gate's overhead. When
16
+ * `enabled === false` it is a no-op: no Judge calls, everything passes through.
17
+ */
18
+ export async function verifyGate(findings, opts) {
19
+ const t0 = Date.now();
20
+ if (opts.enabled === false) {
21
+ const emitted = findings.map(passthrough);
22
+ return { enabled: false, emitted, blocked: [], all: emitted, latencyMs: Date.now() - t0, judgeCalls: 0 };
23
+ }
24
+ let judgeCalls = 0;
25
+ const countingJudge = (prompt) => { judgeCalls++; return opts.judge(prompt); };
26
+ const all = await adversarialVerify(findings, { ...opts, judge: countingJudge });
27
+ const dropUncertain = opts.dropUncertain ?? false;
28
+ const blocked = all.filter((v) => isBlocked(v, dropUncertain));
29
+ const emitted = all.filter((v) => !isBlocked(v, dropUncertain));
30
+ return { enabled: true, emitted, blocked, all, latencyMs: Date.now() - t0, judgeCalls };
31
+ }
32
+ //# sourceMappingURL=gate.js.map
@@ -0,0 +1,20 @@
1
+ /**
2
+ * @ruvector/adversarial-verify (plan 05 / A2).
3
+ *
4
+ * Host-agnostic blind-refuter verification: turn raw findings into adversarially
5
+ * verified finding-verdict@1 envelopes. N blind refuters per finding (anti-
6
+ * sycophancy, default-refuted on uncertainty) → deterministic majority-kill.
7
+ * The LLM is injected as a `Judge`, so this has ZERO AQE/Claude-Code dependency
8
+ * and is publishable as `@ruvector/adversarial-verify`.
9
+ *
10
+ * @example
11
+ * const verdicts = await adversarialVerify(findings, { judge, refuters: 3 });
12
+ * const { confirmed, killed } = partitionVerdicts(verdicts);
13
+ */
14
+ export type { Finding, FindingVerdict, FindingSeverity, FindingOutcome, RefuterVote, Judge, AdversarialVerifyOptions, } from './types.js';
15
+ export { adversarialVerify, partitionVerdicts } from './verify.js';
16
+ export { synthesizeVerdict, majorityKill, isFindingVerdict } from './synthesize.js';
17
+ export { refuterPrompt, DEFAULT_LENSES } from './prompts.js';
18
+ export { calibrate, type LabeledFinding, type CalibrationReport } from './calibrate.js';
19
+ export { verifyGate, type VerifyGateOptions, type VerifyGateResult } from './gate.js';
20
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,6 @@
1
+ export { adversarialVerify, partitionVerdicts } from './verify.js';
2
+ export { synthesizeVerdict, majorityKill, isFindingVerdict } from './synthesize.js';
3
+ export { refuterPrompt, DEFAULT_LENSES } from './prompts.js';
4
+ export { calibrate } from './calibrate.js';
5
+ export { verifyGate } from './gate.js';
6
+ //# sourceMappingURL=index.js.map