agentic-qe 3.11.0 → 3.11.1

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 (445) 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/reasoningbank-intelligence/SKILL.md +2 -2
  93. package/.claude/skills/skill-builder/SKILL.md +0 -103
  94. package/.claude/skills/skills-manifest.json +1 -1
  95. package/.claude/skills/sparc-methodology/SKILL.md +2 -11
  96. package/.claude/skills/stream-chain/SKILL.md +0 -3
  97. package/.claude/skills/swarm-advanced/SKILL.md +2 -5
  98. package/.claude/skills/swarm-orchestration/SKILL.md +1 -1
  99. package/.claude/skills/verification-quality/SKILL.md +121 -93
  100. package/CHANGELOG.md +49 -0
  101. package/assets/skills/pair-programming/SKILL.md +2 -2
  102. package/assets/skills/verification-quality/SKILL.md +121 -93
  103. package/dist/audit/witness-chain.d.ts +1 -1
  104. package/dist/audit/witness-findings.d.ts +50 -0
  105. package/dist/audit/witness-findings.js +41 -0
  106. package/dist/cli/bundle.js +5 -5
  107. package/dist/cli/chunks/adapter-A6GCBONS.js +2 -0
  108. package/dist/cli/chunks/{agent-booster-wasm-5CSKQB4O.js → agent-booster-wasm-3OJAT664.js} +2 -2
  109. package/dist/cli/chunks/{agent-handler-EBV3OKTE.js → agent-handler-6TCTI5AT.js} +2 -2
  110. package/dist/cli/chunks/{agent-memory-branch-RZ53YM2U.js → agent-memory-branch-FAWCYEGJ.js} +2 -2
  111. package/dist/cli/chunks/aqe-learning-engine-FRCSXNMG.js +2 -0
  112. package/dist/cli/chunks/{arena-UCP74DRO.js → arena-O2TCUQBF.js} +4 -4
  113. package/dist/cli/chunks/{arena-QWYTIQ6I.js → arena-UVYIGYUF.js} +2 -2
  114. package/dist/cli/chunks/{audit-M4FNIX47.js → audit-AYESKHAJ.js} +2 -2
  115. package/dist/cli/chunks/base-CZ3EHBU5.js +2 -0
  116. package/dist/cli/chunks/{hnswlib-node-HMZC5TXM.js → better-sqlite3-MJNUEPYB.js} +2 -2
  117. package/dist/cli/chunks/{brain-handler-OY6Q2GY5.js → brain-handler-KSJBVTHZ.js} +3 -3
  118. package/dist/cli/chunks/{branch-enumerator-TQWN4NIX.js → branch-enumerator-4O3S42EG.js} +2 -2
  119. package/dist/cli/chunks/{browser-2EH3RXJ2.js → browser-5VXK323P.js} +2 -2
  120. package/dist/cli/chunks/browser-workflow-EKTGQQBQ.js +2 -0
  121. package/dist/cli/chunks/{chunk-SQPDGRYR.js → chunk-22FHOXEE.js} +1 -1
  122. package/dist/cli/chunks/{chunk-ZEUUVLS2.js → chunk-2RE32VOF.js} +1 -1
  123. package/dist/cli/chunks/{chunk-ITRUZ3WE.js → chunk-3D4HNUZM.js} +2 -2
  124. package/dist/cli/chunks/{chunk-6VQKNPGY.js → chunk-3DS7ZHA7.js} +2 -2
  125. package/dist/cli/chunks/{chunk-Z45QDDZQ.js → chunk-3G25ZBQ6.js} +1 -1
  126. package/dist/cli/chunks/{chunk-ETGEGMYS.js → chunk-3IMEDZIS.js} +3 -3
  127. package/dist/cli/chunks/{chunk-BEOGI5FC.js → chunk-3V5DAM37.js} +2 -2
  128. package/dist/cli/chunks/{chunk-UFMW25MS.js → chunk-3XCEFSUK.js} +2 -2
  129. package/dist/cli/chunks/{chunk-QYXTESM3.js → chunk-437XL5VZ.js} +2 -2
  130. package/dist/cli/chunks/{chunk-XVQUVCFR.js → chunk-44HXRFOP.js} +2 -2
  131. package/dist/cli/chunks/{chunk-VGYUVMSN.js → chunk-4565IIF6.js} +2 -2
  132. package/dist/cli/chunks/{chunk-IFTEM672.js → chunk-4BMPFEEG.js} +2 -2
  133. package/dist/cli/chunks/{chunk-MKLLB4PM.js → chunk-4G4GTF36.js} +4 -4
  134. package/dist/cli/chunks/{chunk-R7FHQQAV.js → chunk-4OYC5TIZ.js} +2 -2
  135. package/dist/cli/chunks/{chunk-LFT7WYHW.js → chunk-4RUS5E3Q.js} +2 -2
  136. package/dist/cli/chunks/{chunk-IKNDGXZZ.js → chunk-4S3UIY3G.js} +2 -2
  137. package/dist/cli/chunks/{chunk-JQM64WJ2.js → chunk-4UHWZ47M.js} +1 -1
  138. package/dist/cli/chunks/{chunk-NBTKI2TX.js → chunk-56PICCZN.js} +2 -2
  139. package/dist/cli/chunks/chunk-57WGS6BI.js +2 -0
  140. package/dist/cli/chunks/{chunk-MDYI4IIW.js → chunk-5LDUW2FD.js} +1 -1
  141. package/dist/cli/chunks/{chunk-RPYYS6BX.js → chunk-5PSIKJL5.js} +2 -2
  142. package/dist/cli/chunks/{chunk-Y7UJC5OL.js → chunk-5QFZEEJ2.js} +3 -3
  143. package/dist/cli/chunks/{chunk-HNSZDIQU.js → chunk-5Y7GXQOM.js} +2 -2
  144. package/dist/cli/chunks/{chunk-DV7662EZ.js → chunk-6CH7476R.js} +1 -1
  145. package/dist/cli/chunks/{chunk-N52ZBTPM.js → chunk-6WNYBIPS.js} +2 -2
  146. package/dist/cli/chunks/{chunk-WBQEOACC.js → chunk-6YNXH6H4.js} +2 -2
  147. package/dist/cli/chunks/{chunk-SLWJNHCR.js → chunk-6ZAUNPAI.js} +2 -2
  148. package/dist/cli/chunks/{chunk-4OTA6KYJ.js → chunk-72UPBNVF.js} +2 -2
  149. package/dist/cli/chunks/{chunk-KOOY72E3.js → chunk-76UVJLPM.js} +2 -2
  150. package/dist/cli/chunks/{chunk-YR44KQUK.js → chunk-7DQLYWLR.js} +1 -1
  151. package/dist/cli/chunks/{chunk-I2HQLBWG.js → chunk-7GP7ZG3K.js} +2 -2
  152. package/dist/cli/chunks/{chunk-GGSXHGWD.js → chunk-7OAKIXNM.js} +2 -2
  153. package/dist/cli/chunks/{chunk-3GWSHRDA.js → chunk-7QICU44H.js} +2 -2
  154. package/dist/cli/chunks/{chunk-ACV2WVMX.js → chunk-7SRSOZMP.js} +1 -1
  155. package/dist/cli/chunks/{chunk-X2L4POJE.js → chunk-7WQKKYYG.js} +1 -1
  156. package/dist/cli/chunks/{chunk-ZFP3O5FM.js → chunk-AEZMNFXM.js} +1 -1
  157. package/dist/cli/chunks/{chunk-2TUVBEWK.js → chunk-AG4BYKUV.js} +2 -2
  158. package/dist/cli/chunks/{chunk-FTOICJQG.js → chunk-AL54LED5.js} +2 -2
  159. package/dist/cli/chunks/{chunk-IQSPL2H4.js → chunk-ATQTTGSE.js} +2 -2
  160. package/dist/cli/chunks/{chunk-3J6LYF6I.js → chunk-B5EE63VE.js} +2 -2
  161. package/dist/cli/chunks/{chunk-JN3IQB4L.js → chunk-B6U56VWG.js} +1 -1
  162. package/dist/cli/chunks/{chunk-3LP5GPGU.js → chunk-BOQNPFO5.js} +1 -1
  163. package/dist/cli/chunks/{chunk-G25YZ7Z6.js → chunk-BR4ERWVD.js} +2 -2
  164. package/dist/cli/chunks/{chunk-PJ4HSXH3.js → chunk-BVFNF3RW.js} +1 -1
  165. package/dist/cli/chunks/{chunk-KZE5UR4T.js → chunk-BXLWERBR.js} +3 -3
  166. package/dist/cli/chunks/{chunk-7MBF3S25.js → chunk-C27UV6DO.js} +1 -1
  167. package/dist/cli/chunks/{chunk-453UDYD2.js → chunk-C7FYDE5F.js} +161 -154
  168. package/dist/cli/chunks/{chunk-HMSPPGUF.js → chunk-CIDTFU3C.js} +2 -2
  169. package/dist/cli/chunks/{chunk-HHSEIPSQ.js → chunk-CII57TME.js} +1 -1
  170. package/dist/cli/chunks/{chunk-DCJIXDO6.js → chunk-CN2HMHIY.js} +2 -2
  171. package/dist/cli/chunks/{chunk-5ASPEVVF.js → chunk-CXIFCN6G.js} +1 -1
  172. package/dist/cli/chunks/{chunk-GBFAQ4DW.js → chunk-CZU5G6J4.js} +1 -1
  173. package/dist/cli/chunks/{chunk-JQSA6EMI.js → chunk-D4DAZ3P2.js} +2 -2
  174. package/dist/cli/chunks/{chunk-73EWPVBJ.js → chunk-D6MPGK7R.js} +2 -2
  175. package/dist/cli/chunks/{chunk-CERSTEAJ.js → chunk-DZT4A7R3.js} +2 -2
  176. package/dist/cli/chunks/{chunk-UEH6C5JA.js → chunk-EFRIMR74.js} +1 -1
  177. package/dist/cli/chunks/{chunk-PC3VIR2A.js → chunk-EJSDQQZH.js} +2 -2
  178. package/dist/cli/chunks/{chunk-XMZ2DHUL.js → chunk-EQYDPF52.js} +1 -1
  179. package/dist/cli/chunks/{chunk-QCJ7YOVN.js → chunk-EZBXCEBV.js} +2 -2
  180. package/dist/cli/chunks/{chunk-FGOVDO3R.js → chunk-FBOPSWF6.js} +2 -2
  181. package/dist/cli/chunks/{chunk-TGLEREP5.js → chunk-FK3XYV3A.js} +2 -2
  182. package/dist/cli/chunks/{chunk-RKDNLPZM.js → chunk-FOD6JEEU.js} +2 -2
  183. package/dist/cli/chunks/{chunk-ETZ62NFD.js → chunk-GUSW3OGX.js} +1 -1
  184. package/dist/cli/chunks/{chunk-VVJXQ4FR.js → chunk-H4V6WCF7.js} +2 -2
  185. package/dist/cli/chunks/{chunk-IOQYSR5S.js → chunk-H5GCRC2D.js} +2 -2
  186. package/dist/cli/chunks/{chunk-ISVBO4XO.js → chunk-HMVL55QX.js} +2 -2
  187. package/dist/cli/chunks/{chunk-2BBKA5J4.js → chunk-HOFEAA4R.js} +1 -1
  188. package/dist/cli/chunks/{chunk-OZQIDDXB.js → chunk-HYT5EMES.js} +2 -2
  189. package/dist/cli/chunks/{chunk-KBVXKFDI.js → chunk-IAHJ62JS.js} +4 -4
  190. package/dist/cli/chunks/{chunk-AYOTODUV.js → chunk-IIX5Y7BO.js} +1 -1
  191. package/dist/cli/chunks/{chunk-YSTWLDVD.js → chunk-ILZHECWZ.js} +3 -3
  192. package/dist/cli/chunks/{chunk-T6KT63NC.js → chunk-IUVAWWQG.js} +2 -2
  193. package/dist/cli/chunks/{chunk-ZK56THZT.js → chunk-IVZVVZZ3.js} +3 -3
  194. package/dist/cli/chunks/{chunk-FMULOSBL.js → chunk-J2LAYCYZ.js} +1 -1
  195. package/dist/cli/chunks/{chunk-7Q6CMSMD.js → chunk-JGHEGMLD.js} +3 -3
  196. package/dist/cli/chunks/{chunk-72QNONO6.js → chunk-K3BBLIWW.js} +2 -2
  197. package/dist/cli/chunks/{chunk-XSG4XKGO.js → chunk-K7XPKGOL.js} +2 -2
  198. package/dist/cli/chunks/{chunk-YRP73HO4.js → chunk-KIBP3LGY.js} +1 -1
  199. package/dist/cli/chunks/{chunk-SHW43QQV.js → chunk-KRUKMGPF.js} +2 -2
  200. package/dist/cli/chunks/{chunk-WP6XUSVW.js → chunk-L2QHZFC3.js} +1 -1
  201. package/dist/cli/chunks/{chunk-AVKGDS6F.js → chunk-LNV76GGB.js} +2 -2
  202. package/dist/cli/chunks/{chunk-IHNBZ5XG.js → chunk-LOPM3YIO.js} +2 -2
  203. package/dist/cli/chunks/{chunk-JNX7IRSI.js → chunk-LSZLXLZA.js} +2 -2
  204. package/dist/cli/chunks/{chunk-NI7O3GKZ.js → chunk-MILWEZSZ.js} +3 -3
  205. package/dist/cli/chunks/{chunk-7PTA7AVW.js → chunk-MX6M2VPB.js} +1 -1
  206. package/dist/cli/chunks/{chunk-YQIMO7VJ.js → chunk-N4OWZLH5.js} +2 -2
  207. package/dist/cli/chunks/{chunk-7BD7DZCB.js → chunk-N52WQO3G.js} +2 -2
  208. package/dist/cli/chunks/{chunk-Y7TBCHW4.js → chunk-N6NSZG7Z.js} +2 -2
  209. package/dist/cli/chunks/{chunk-C33BMWYZ.js → chunk-N6RSJGTW.js} +5 -5
  210. package/dist/cli/chunks/{chunk-G5VE3HQW.js → chunk-NKCL6RAF.js} +2 -2
  211. package/dist/cli/chunks/{chunk-LTH6XARD.js → chunk-NVJIOCS5.js} +2 -2
  212. package/dist/cli/chunks/{chunk-P3NV6KN3.js → chunk-NYWK7ZSX.js} +1 -1
  213. package/dist/cli/chunks/{chunk-5DG6H553.js → chunk-O5NF6BBD.js} +1 -1
  214. package/dist/cli/chunks/{chunk-J425SQFE.js → chunk-O75SVMMB.js} +2 -2
  215. package/dist/cli/chunks/{chunk-XKRG2U3V.js → chunk-OHBZON7T.js} +1 -1
  216. package/dist/cli/chunks/{chunk-NQD4CMXC.js → chunk-OUBYADPD.js} +2 -2
  217. package/dist/cli/chunks/{chunk-7E5NYLJT.js → chunk-OUSD2RWO.js} +2 -2
  218. package/dist/cli/chunks/{chunk-VHON5NDM.js → chunk-OX2PGDUM.js} +3 -3
  219. package/dist/cli/chunks/{chunk-PUTRXS5I.js → chunk-P7CMWL7Y.js} +2 -2
  220. package/dist/cli/chunks/{chunk-R3YO3Z7I.js → chunk-PY4YQDBM.js} +4 -4
  221. package/dist/cli/chunks/{chunk-BA4WZIAQ.js → chunk-QEDS3MOJ.js} +2 -2
  222. package/dist/cli/chunks/{chunk-X2TUDGFL.js → chunk-QMN563LV.js} +10 -10
  223. package/dist/cli/chunks/{chunk-SKL225P5.js → chunk-QOR4YAZY.js} +2 -2
  224. package/dist/cli/chunks/{chunk-F6Y7DTHR.js → chunk-QUTKELAS.js} +2 -2
  225. package/dist/cli/chunks/{chunk-HJFQVKPI.js → chunk-QXDZN2WX.js} +1 -1
  226. package/dist/cli/chunks/{chunk-RVQW6CBF.js → chunk-S456W64P.js} +2 -2
  227. package/dist/cli/chunks/{chunk-F62ZQZQQ.js → chunk-S7IHSELP.js} +2 -2
  228. package/dist/cli/chunks/{chunk-FMKALHT3.js → chunk-S7ZHD6VN.js} +2 -2
  229. package/dist/cli/chunks/{chunk-AURDGQNB.js → chunk-SU4YXUVK.js} +2 -2
  230. package/dist/cli/chunks/{chunk-MTSMFEWK.js → chunk-SZPTUV3B.js} +2 -2
  231. package/dist/cli/chunks/{chunk-O6FN53HB.js → chunk-T7PUM6OY.js} +1 -1
  232. package/dist/cli/chunks/{chunk-JZFA2PWY.js → chunk-TCKBICJ3.js} +2 -2
  233. package/dist/cli/chunks/{chunk-DDQWW22L.js → chunk-TOQJWLJV.js} +2 -2
  234. package/dist/cli/chunks/{chunk-2WVLFT2I.js → chunk-TUEDIQHY.js} +1 -1
  235. package/dist/cli/chunks/{chunk-QGBXENIP.js → chunk-U5GCSSYX.js} +1 -1
  236. package/dist/cli/chunks/{chunk-N3R3JGUY.js → chunk-UDLN2THT.js} +1 -1
  237. package/dist/cli/chunks/{chunk-N7MKF4F4.js → chunk-V6YDM37M.js} +1 -1
  238. package/dist/cli/chunks/{chunk-B4QA3YN6.js → chunk-VGR65B4Y.js} +1 -1
  239. package/dist/cli/chunks/{chunk-LCDRRAES.js → chunk-VRHLHGKR.js} +2 -2
  240. package/dist/cli/chunks/{chunk-XW5OXBVV.js → chunk-VS2G6LX5.js} +2 -2
  241. package/dist/cli/chunks/{chunk-L7GQKJLV.js → chunk-W6RS5S4Q.js} +2 -2
  242. package/dist/cli/chunks/{chunk-LYV7WJWA.js → chunk-WEPZOCN7.js} +1 -1
  243. package/dist/cli/chunks/{chunk-2ZC7S4UG.js → chunk-WIC5UZCQ.js} +2 -2
  244. package/dist/cli/chunks/{chunk-ZT4NPTML.js → chunk-X2OVUBF6.js} +2 -2
  245. package/dist/cli/chunks/{chunk-D3S4SRSA.js → chunk-X4GKYSOH.js} +2 -2
  246. package/dist/cli/chunks/{chunk-V6WJVFRN.js → chunk-XEVUW4QL.js} +2 -2
  247. package/dist/cli/chunks/{chunk-PVBJUANU.js → chunk-XMDZRULK.js} +2 -2
  248. package/dist/cli/chunks/{chunk-5OJXVVTI.js → chunk-YFY35CSD.js} +2 -2
  249. package/dist/cli/chunks/{chunk-TYS77XHV.js → chunk-Z6ADE3KJ.js} +2 -2
  250. package/dist/cli/chunks/{chunk-QZQGYSDG.js → chunk-ZKPOKMJZ.js} +2 -2
  251. package/dist/cli/chunks/{chunk-2QU6C3OS.js → chunk-ZRWAFMM7.js} +2 -2
  252. package/dist/cli/chunks/{ci-4JK2NFCD.js → ci-KTWY7BZT.js} +2 -2
  253. package/dist/cli/chunks/{ci-output-LCGTJQWC.js → ci-output-WOX6QBMS.js} +2 -2
  254. package/dist/cli/chunks/{circuit-breaker-EJF7D3L4.js → circuit-breaker-6XKOSFIF.js} +2 -2
  255. package/dist/cli/chunks/{claude-flow-setup-3RUC6OB4.js → claude-flow-setup-5JA4MNE4.js} +2 -2
  256. package/dist/cli/chunks/client-X3KUJ6R5.js +2 -0
  257. package/dist/cli/chunks/{cline-installer-6LY5C5QH.js → cline-installer-Z2ANHEKW.js} +2 -2
  258. package/dist/cli/chunks/{code-MPDG4UHS.js → code-NO4ZKNDU.js} +2 -2
  259. package/dist/cli/chunks/{code-index-extractor-OY5GQJBM.js → code-index-extractor-VV4OEPG7.js} +2 -2
  260. package/dist/cli/chunks/{codex-installer-BO7E2ZVA.js → codex-installer-BP7Y2NYR.js} +2 -2
  261. package/dist/cli/chunks/{completions-VGL3KJ2R.js → completions-YULJQUF4.js} +2 -2
  262. package/dist/cli/chunks/{complexity-analyzer-5DPUK7IL.js → complexity-analyzer-D7XYPQ76.js} +2 -2
  263. package/dist/cli/chunks/{continuedev-installer-LFDG2D42.js → continuedev-installer-E3L7UF72.js} +2 -2
  264. package/dist/cli/chunks/{copilot-installer-SEMMMIZH.js → copilot-installer-5TRUMJC5.js} +2 -2
  265. package/dist/cli/chunks/core-handlers-A2EQB3UH.js +2 -0
  266. package/dist/cli/chunks/{cost-tracker-OPBC6FQM.js → cost-tracker-QTYSJMSV.js} +2 -2
  267. package/dist/cli/chunks/{coverage-CFDUSRKU.js → coverage-D5DKZ3XT.js} +3 -3
  268. package/dist/cli/chunks/cross-domain-router-OKZ2PDHT.js +2 -0
  269. package/dist/cli/chunks/{cursor-installer-6TXUUVY4.js → cursor-installer-UDBHGUIG.js} +2 -2
  270. package/dist/cli/chunks/{daemon-7BDBPPAF.js → daemon-2GXYN7F7.js} +3 -3
  271. package/dist/cli/chunks/{daemon-5KO46YQR.js → daemon-IVWUMQKL.js} +4 -4
  272. package/dist/cli/chunks/{dag-attention-scheduler-6DQKZOUW.js → dag-attention-scheduler-PWXR4QTU.js} +2 -2
  273. package/dist/cli/chunks/{detect-R2QAYDPI.js → detect-C6P7ONFB.js} +2 -2
  274. package/dist/cli/chunks/{dist-node-3POCIJ4N.js → dist-node-2BUFM2JK.js} +2 -2
  275. package/dist/cli/chunks/{domain-handler-KW63CHUH.js → domain-handler-Q2GWZLDM.js} +2 -2
  276. package/dist/cli/chunks/{domain-transfer-2QPOJCUD.js → domain-transfer-GMUBAM3J.js} +2 -2
  277. package/dist/cli/chunks/dream-ZBP4Z5C3.js +2 -0
  278. package/dist/cli/chunks/{embed-and-insert-pattern-OIDJZQEP.js → embed-and-insert-pattern-EFUERRM2.js} +2 -2
  279. package/dist/cli/chunks/{eval-UGEKTTAQ.js → eval-24FIC43F.js} +2 -2
  280. package/dist/cli/chunks/{experience-capture-middleware-3BIM2TT7.js → experience-capture-middleware-R4UP2Q2M.js} +3 -3
  281. package/dist/cli/chunks/{fast-paths-HCJQXB7W.js → fast-paths-RQCGGTXB.js} +2 -2
  282. package/dist/cli/chunks/{feature-flags-GDGJKLN4.js → feature-flags-APTWWVNQ.js} +2 -2
  283. package/dist/cli/chunks/{feature-flags-W4JSFBMV.js → feature-flags-SOXVYIBN.js} +2 -2
  284. package/dist/cli/chunks/{file-discovery-JMUZ4MUH.js → file-discovery-66KRMXVF.js} +2 -2
  285. package/dist/cli/chunks/{fleet-YNNK2CKW.js → fleet-EMBNKO5Q.js} +3 -3
  286. package/dist/cli/chunks/{gnn-wrapper-R2ZY6CDD.js → gnn-wrapper-6TKDWFJF.js} +2 -2
  287. package/dist/cli/chunks/{heartbeat-handler-OZX2EJHQ.js → heartbeat-handler-4ODKJ75H.js} +4 -4
  288. package/dist/cli/chunks/heartbeat-scheduler-6JUWQXWG.js +2 -0
  289. package/dist/cli/chunks/hnsw-adapter-JT4BU7XJ.js +2 -0
  290. package/dist/cli/chunks/hnsw-index-JC5YELJX.js +2 -0
  291. package/dist/cli/chunks/{hnsw-legacy-bridge-3S6TYCG3.js → hnsw-legacy-bridge-25KFCLUC.js} +2 -2
  292. package/dist/cli/chunks/{better-sqlite3-RIBLRHJL.js → hnswlib-node-FUWQTM2D.js} +2 -2
  293. package/dist/cli/chunks/{hooks-KM7WR35T.js → hooks-JIDA2COE.js} +10 -10
  294. package/dist/cli/chunks/hybrid-router-SLTXHUFG.js +2 -0
  295. package/dist/cli/chunks/{hypergraph-engine-RX53A73M.js → hypergraph-engine-3YDFDPE3.js} +2 -2
  296. package/dist/cli/chunks/{hypergraph-handler-3QQB3H3Z.js → hypergraph-handler-VWZX2OJX.js} +3 -3
  297. package/dist/cli/chunks/impact-analyzer-JXHCMZXY.js +2 -0
  298. package/dist/cli/chunks/{init-handler-Y62RH4ZI.js → init-handler-DH7VQAMF.js} +6 -6
  299. package/dist/cli/chunks/init-wizard-EX37TYOG.js +2 -0
  300. package/dist/cli/chunks/kernel-JPHAG27D.js +2 -0
  301. package/dist/cli/chunks/{kilocode-installer-26R253L2.js → kilocode-installer-2W2KZCGH.js} +2 -2
  302. package/dist/cli/chunks/{kiro-installer-PFA5QPZZ.js → kiro-installer-E5KP7OMD.js} +2 -2
  303. package/dist/cli/chunks/knowledge-graph-5QJZIRYB.js +2 -0
  304. package/dist/cli/chunks/{learning-CQLM5ANX.js → learning-XJRUVPLF.js} +3 -3
  305. package/dist/cli/chunks/{llm-router-QZ5PG4PF.js → llm-router-AEEKEMF5.js} +4 -4
  306. package/dist/cli/chunks/llm-router-service-SE2RO4P5.js +2 -0
  307. package/dist/cli/chunks/{load-UPA6LPHM.js → load-PZ4YOTBJ.js} +2 -2
  308. package/dist/cli/chunks/load-test-LOTBWIIS.js +2 -0
  309. package/dist/cli/chunks/{mcp-LSWTLAJ4.js → mcp-IVA6LC2S.js} +2 -2
  310. package/dist/cli/chunks/{memory-VGEYYGCG.js → memory-Y3DHXFQE.js} +5 -5
  311. package/dist/cli/chunks/memory-backend-BSDKTFAN.js +2 -0
  312. package/dist/cli/chunks/{memory-handlers-QBURG7NA.js → memory-handlers-V5PXEJWL.js} +2 -2
  313. package/dist/cli/chunks/{multi-model-executor-VZVFBIKC.js → multi-model-executor-646G4S4Y.js} +2 -2
  314. package/dist/cli/chunks/{opencode-installer-PBQAXNLV.js → opencode-installer-P6KOOTUS.js} +2 -2
  315. package/dist/cli/chunks/{orchestrator-YND7JB5O.js → orchestrator-T2GVKYMX.js} +5 -5
  316. package/dist/cli/chunks/pattern-null-store-LRSXCZWM.js +2 -0
  317. package/dist/cli/chunks/{pipeline-GM5RRUES.js → pipeline-CK2ON45P.js} +2 -2
  318. package/dist/cli/chunks/{platform-L7OGGRSL.js → platform-OQNSD3A3.js} +2 -2
  319. package/dist/cli/chunks/{plugin-N4YAE6H5.js → plugin-UOG6RNRM.js} +2 -2
  320. package/dist/cli/chunks/{prime-radiant-advanced-wasm-7D67XV6Z.js → prime-radiant-advanced-wasm-37UE6TG5.js} +2 -2
  321. package/dist/cli/chunks/protocol-executor-WPUVJEL7.js +2 -0
  322. package/dist/cli/chunks/{protocol-handler-V2WTFU7N.js → protocol-handler-V722S6YH.js} +2 -2
  323. package/dist/cli/chunks/{prove-33DS5Z3N.js → prove-ANGY6W3W.js} +2 -2
  324. package/dist/cli/chunks/provider-manager-EVPWSH3E.js +2 -0
  325. package/dist/cli/chunks/qe-reasoning-bank-IH63FG33.js +2 -0
  326. package/dist/cli/chunks/{quality-WCSEA5GH.js → quality-KG4ALI2L.js} +2 -2
  327. package/dist/cli/chunks/queen-coordinator-TTCAGYQO.js +2 -0
  328. package/dist/cli/chunks/{real-embeddings-OQ5F37DG.js → real-embeddings-GUZDO5UN.js} +2 -2
  329. package/dist/cli/chunks/{roocode-installer-II7LIR2X.js → roocode-installer-WROAR6MJ.js} +2 -2
  330. package/dist/cli/chunks/router-64Q4ILOQ.js +2 -0
  331. package/dist/cli/chunks/routing-feedback-KCZV4XXC.js +2 -0
  332. package/dist/cli/chunks/{routing-handler-6OFHARIY.js → routing-handler-UFPSSS5D.js} +2 -2
  333. package/dist/cli/chunks/{ruvector-commands-GD5JTR4M.js → ruvector-commands-XJQMKDRM.js} +2 -2
  334. package/dist/cli/chunks/{rvf-dual-writer-HSK6BYZV.js → rvf-dual-writer-QPRMDKYX.js} +2 -2
  335. package/dist/cli/chunks/{rvf-migration-adapter-554SMF5S.js → rvf-migration-adapter-SOHBK23K.js} +2 -2
  336. package/dist/cli/chunks/{rvf-migration-coordinator-OFDBCAYE.js → rvf-migration-coordinator-MTWUSPEJ.js} +2 -2
  337. package/dist/cli/chunks/rvf-native-adapter-GNJKMURU.js +2 -0
  338. package/dist/cli/chunks/safe-db-6VBZQIJI.js +2 -0
  339. package/dist/cli/chunks/schedule-4V7O5IPX.js +2 -0
  340. package/dist/cli/chunks/scheduler-CQDMHEHN.js +2 -0
  341. package/dist/cli/chunks/{security-GN4J6DSS.js → security-5MAMQKP6.js} +3 -3
  342. package/dist/cli/chunks/{shared-rvf-adapter-Q4PM3QCN.js → shared-rvf-adapter-YEUBSRNN.js} +2 -2
  343. package/dist/cli/chunks/{shared-rvf-dual-writer-R5WK5BXQ.js → shared-rvf-dual-writer-DBQJHG42.js} +2 -2
  344. package/dist/cli/chunks/sqlite-persistence-7DHUFTHL.js +2 -0
  345. package/dist/cli/chunks/{status-handler-AHS5WVMG.js → status-handler-ZUB2UKQZ.js} +2 -2
  346. package/dist/cli/chunks/{structural-health-5KUKNLHZ.js → structural-health-B2GHENWX.js} +2 -2
  347. package/dist/cli/chunks/{sync-PUMM3SR6.js → sync-7VMXJTR2.js} +2 -2
  348. package/dist/cli/chunks/{sync-TQLGD5HX.js → sync-YCUUW3IP.js} +2 -2
  349. package/dist/cli/chunks/{task-handler-D7VXV4AF.js → task-handler-N7LJTXZM.js} +2 -2
  350. package/dist/cli/chunks/{task-handlers-QMN4SWUG.js → task-handlers-GDHNJV2E.js} +3 -3
  351. package/dist/cli/chunks/{test-HEWZR6YQ.js → test-6COGC5KI.js} +4 -4
  352. package/dist/cli/chunks/{test-scheduling-VTMLBEPA.js → test-scheduling-CUERHJMF.js} +3 -3
  353. package/dist/cli/chunks/{token-bootstrap-IYBG7PQ6.js → token-bootstrap-JTGSL6PP.js} +2 -2
  354. package/dist/cli/chunks/{token-usage-C7H27BFZ.js → token-usage-LSG3JYGX.js} +2 -2
  355. package/dist/cli/chunks/{transformers-5ZJVC6NB.js → transformers-ODIITRCT.js} +2 -2
  356. package/dist/cli/chunks/{tree-sitter-wasm-parser-EARBJG2H.js → tree-sitter-wasm-parser-KSP7ZZ5H.js} +2 -2
  357. package/dist/cli/chunks/{types-3IHE42PZ.js → types-6N6SUU2O.js} +2 -2
  358. package/dist/cli/chunks/unified-memory-MQA72NLP.js +2 -0
  359. package/dist/cli/chunks/unified-memory-hnsw-K7HA3CWV.js +2 -0
  360. package/dist/cli/chunks/unified-persistence-2DXB4OE4.js +2 -0
  361. package/dist/cli/chunks/{upgrade-YP3VFSXO.js → upgrade-7SCVOCPS.js} +2 -2
  362. package/dist/cli/chunks/{validate-VSBNKPN6.js → validate-762ISH2Y.js} +2 -2
  363. package/dist/cli/chunks/{validate-swarm-GOCJVWXE.js → validate-swarm-R6WYYXGO.js} +2 -2
  364. package/dist/cli/chunks/{vibium-U6YKCLDF.js → vibium-5GZYSUDQ.js} +2 -2
  365. package/dist/cli/chunks/visual-security-UD6CARIJ.js +2 -0
  366. package/dist/cli/chunks/{web-tree-sitter-TSNVGWSN.js → web-tree-sitter-VYYVAJTY.js} +2 -2
  367. package/dist/cli/chunks/{windsurf-installer-2VKMEFSD.js → windsurf-installer-RRIOR3B6.js} +2 -2
  368. package/dist/cli/chunks/witness-chain-LWALPPMC.js +2 -0
  369. package/dist/cli/chunks/{witness-chain-BWZCW52H.js → witness-chain-SRVBEKDB.js} +2 -2
  370. package/dist/cli/chunks/{workflow-J6SCYLU3.js → workflow-XNUDHGEC.js} +4 -4
  371. package/dist/cli/chunks/workflow-orchestrator-QU652FLH.js +2 -0
  372. package/dist/cli/chunks/{wrappers-M5C7DONW.js → wrappers-3STST7QW.js} +2 -2
  373. package/dist/domains/requirements-validation/coordinator.d.ts +16 -2
  374. package/dist/domains/requirements-validation/coordinator.js +112 -7
  375. package/dist/domains/requirements-validation/plugin.js +20 -1
  376. package/dist/domains/test-generation/coordinator.d.ts +3 -1
  377. package/dist/domains/test-generation/coordinator.js +15 -33
  378. package/dist/integrations/darwin/types.d.ts +10 -3
  379. package/dist/integrations/darwin/types.js +10 -3
  380. package/dist/mcp/bundle.js +366 -359
  381. package/dist/mcp/tool-scoping.d.ts +8 -2
  382. package/dist/mcp/tool-scoping.js +13 -0
  383. package/dist/routing/free-tier/coordinator-support.d.ts +90 -0
  384. package/dist/routing/free-tier/coordinator-support.js +78 -0
  385. package/dist/routing/free-tier/executor.d.ts +43 -1
  386. package/dist/routing/free-tier/executor.js +69 -26
  387. package/dist/routing/free-tier/index.d.ts +1 -0
  388. package/dist/routing/free-tier/index.js +1 -0
  389. package/dist/routing/value-score.d.ts +49 -0
  390. package/dist/routing/value-score.js +54 -0
  391. package/dist/shared/optional-module.d.ts +23 -0
  392. package/dist/shared/optional-module.js +46 -0
  393. package/dist/verification/adversarial-verify/calibrate.d.ts +32 -0
  394. package/dist/verification/adversarial-verify/calibrate.js +33 -0
  395. package/dist/verification/adversarial-verify/gate.d.ts +38 -0
  396. package/dist/verification/adversarial-verify/gate.js +32 -0
  397. package/dist/verification/adversarial-verify/index.d.ts +20 -0
  398. package/dist/verification/adversarial-verify/index.js +6 -0
  399. package/dist/verification/adversarial-verify/prompts.d.ts +14 -0
  400. package/dist/verification/adversarial-verify/prompts.js +17 -0
  401. package/dist/verification/adversarial-verify/synthesize.d.ts +18 -0
  402. package/dist/verification/adversarial-verify/synthesize.js +35 -0
  403. package/dist/verification/adversarial-verify/types.d.ts +59 -0
  404. package/dist/verification/adversarial-verify/types.js +10 -0
  405. package/dist/verification/adversarial-verify/verify.d.ts +20 -0
  406. package/dist/verification/adversarial-verify/verify.js +34 -0
  407. package/package.json +10 -1
  408. package/dist/cli/chunks/adapter-WLFT5VMV.js +0 -2
  409. package/dist/cli/chunks/aqe-learning-engine-JBH4GZUM.js +0 -2
  410. package/dist/cli/chunks/base-A7JGM473.js +0 -2
  411. package/dist/cli/chunks/browser-workflow-TIDJWULK.js +0 -2
  412. package/dist/cli/chunks/chunk-C4OYHUJV.js +0 -2
  413. package/dist/cli/chunks/client-ZLJ3JMBC.js +0 -2
  414. package/dist/cli/chunks/core-handlers-EM7FUYTI.js +0 -2
  415. package/dist/cli/chunks/cross-domain-router-DYGHQ6P5.js +0 -2
  416. package/dist/cli/chunks/dream-DBE5D5BD.js +0 -2
  417. package/dist/cli/chunks/heartbeat-scheduler-NFHAANNL.js +0 -2
  418. package/dist/cli/chunks/hnsw-adapter-HMPCZFBY.js +0 -2
  419. package/dist/cli/chunks/hnsw-index-KRIWSXX4.js +0 -2
  420. package/dist/cli/chunks/hybrid-router-BAB32B2W.js +0 -2
  421. package/dist/cli/chunks/impact-analyzer-3D6XHWQE.js +0 -2
  422. package/dist/cli/chunks/init-wizard-LLU3WVGC.js +0 -2
  423. package/dist/cli/chunks/kernel-ZFHAYHHJ.js +0 -2
  424. package/dist/cli/chunks/knowledge-graph-ETZ65KOY.js +0 -2
  425. package/dist/cli/chunks/llm-router-service-R6CTGF5I.js +0 -2
  426. package/dist/cli/chunks/load-test-UOWIJUCH.js +0 -2
  427. package/dist/cli/chunks/memory-backend-E3ZQKW7A.js +0 -2
  428. package/dist/cli/chunks/pattern-null-store-OUOJO2RH.js +0 -2
  429. package/dist/cli/chunks/protocol-executor-KHAPG5CP.js +0 -2
  430. package/dist/cli/chunks/provider-manager-FGPPW7T4.js +0 -2
  431. package/dist/cli/chunks/qe-reasoning-bank-TS7XOJDA.js +0 -2
  432. package/dist/cli/chunks/queen-coordinator-J35FNFQ3.js +0 -2
  433. package/dist/cli/chunks/router-AFTKPDI5.js +0 -2
  434. package/dist/cli/chunks/routing-feedback-SABZUJTF.js +0 -2
  435. package/dist/cli/chunks/rvf-native-adapter-57MDDSFQ.js +0 -2
  436. package/dist/cli/chunks/safe-db-2HR6MVYM.js +0 -2
  437. package/dist/cli/chunks/schedule-KLVAN6XI.js +0 -2
  438. package/dist/cli/chunks/scheduler-WYZ6BC5Y.js +0 -2
  439. package/dist/cli/chunks/sqlite-persistence-2CGU5INO.js +0 -2
  440. package/dist/cli/chunks/unified-memory-PMYRQC5K.js +0 -2
  441. package/dist/cli/chunks/unified-memory-hnsw-7TRL2K5Q.js +0 -2
  442. package/dist/cli/chunks/unified-persistence-S4BNJK4S.js +0 -2
  443. package/dist/cli/chunks/visual-security-RPMZ3J7L.js +0 -2
  444. package/dist/cli/chunks/witness-chain-BTDZSQ6P.js +0 -2
  445. package/dist/cli/chunks/workflow-orchestrator-42B62D3V.js +0 -2
@@ -9,13 +9,19 @@ export type AgentRole = 'test-generator' | 'coverage-analyzer' | 'security-scann
9
9
  * Tool scope definition for an agent role
10
10
  */
11
11
  export interface ToolScope {
12
- /** Tools the agent can use (if empty/undefined, uses allowAll) */
12
+ /**
13
+ * Tools the agent can use. DEFAULT-DENY: if this is empty/undefined and
14
+ * `allowAll` is not set, the role is denied EVERY tool (`isToolAllowed`
15
+ * falls through to `return false`). It does NOT grant allowAll.
16
+ */
13
17
  allowed?: string[];
14
18
  /** Tools explicitly denied (overrides allowed) */
15
19
  denied?: string[];
16
- /** Allow all tools (default for fleet-admin and unrestricted) */
20
+ /** Allow all tools admin tiers only (fleet-admin, unrestricted). */
17
21
  allowAll?: boolean;
18
22
  }
23
+ /** Every agent role, in declaration order — for governance/policy iteration. */
24
+ export declare const ALL_AGENT_ROLES: AgentRole[];
19
25
  /**
20
26
  * Check if an agent role is allowed to use a specific tool
21
27
  */
@@ -4,6 +4,19 @@
4
4
  * Restricts MCP tool access by agent role for security isolation.
5
5
  * Each agent type has a defined set of tools it can invoke.
6
6
  */
7
+ /** Every agent role, in declaration order — for governance/policy iteration. */
8
+ export const ALL_AGENT_ROLES = [
9
+ 'test-generator',
10
+ 'coverage-analyzer',
11
+ 'security-scanner',
12
+ 'quality-assessor',
13
+ 'defect-predictor',
14
+ 'contract-validator',
15
+ 'accessibility-tester',
16
+ 'chaos-engineer',
17
+ 'fleet-admin',
18
+ 'unrestricted',
19
+ ];
7
20
  /**
8
21
  * Default tool scopes per agent role
9
22
  */
@@ -0,0 +1,90 @@
1
+ /**
2
+ * Coordinator free-tier support (cross-pollination plan 06 — broadening the
3
+ * opt-in beyond test generation; ADR-111 escalation lane).
4
+ *
5
+ * Extracts the generic "build a FreeTierEscalatingExecutor from a coordinator's
6
+ * config + router" wiring that was inline in the test-generation coordinator, so
7
+ * ANY domain coordinator can opt in with a few lines instead of duplicating it.
8
+ *
9
+ * The opt-in lane is justified only for tasks that match the D3 criterion:
10
+ * BOUNDED generation graded by an OBJECTIVE oracle (a test+assertion, valid
11
+ * Gherkin, a schema). Do NOT wire it into analysis/judgement coordinators — the
12
+ * §11 "coder binds" finding means a cheap model can't carry open-ended reasoning.
13
+ */
14
+ import { FreeTierEscalatingExecutor, type QeExecutionResult, type QeVerifier } from './executor.js';
15
+ import { type RoutingFeedbackLike } from './feedback-sink.js';
16
+ import type { FreeTierProviderConfig } from './types.js';
17
+ /** Default cheap tier. qwen3:30b-a3b, NOT qwen3:8b — D3 (2026-06-23) measured the
18
+ * 8B below the QE generation floor (0/3 baseline-valid); the 30B MoE clears it. */
19
+ export declare const DEFAULT_FREE_TIER_MODEL = "qwen3:30b-a3b";
20
+ /** Per-coordinator config knobs (mix into a coordinator's CoordinatorConfig). */
21
+ export interface FreeTierCoordinatorConfig {
22
+ /** Opt-in the cheap-first free local tier. Also via env `AQE_FREE_TIER=1`. */
23
+ enableFreeTier?: boolean;
24
+ /** Local model id (default {@link DEFAULT_FREE_TIER_MODEL} or env AQE_FREE_TIER_MODEL). */
25
+ freeTierModel?: string;
26
+ /** Default same-tier D8 repair retries before escalating. Benchmarked at 2 (D3). */
27
+ freeTierRepairAttempts?: number;
28
+ /**
29
+ * Best-of-k diverse attempts per tier's first round (06 §12). D3 validated k=2
30
+ * (lifted cheap composite +16.7, baseline-valid 50%→70%). Costs an extra local
31
+ * call ONLY when variant 0 fails (the loop breaks on first pass). Default 2.
32
+ */
33
+ freeTierBestOfK?: number;
34
+ /**
35
+ * Cross-model best-of-k generator pool (A12, measured +6 composite over single-
36
+ * model via mutual validity rescue). When set, round-0 best-of-k draws candidates
37
+ * across these providers (e.g. local qwen + an OpenRouter model) instead of one
38
+ * model's variants. Omit ⇒ single-model. Set `freeTierBestOfK ≥ pool size`.
39
+ */
40
+ freeTierCandidateProviders?: FreeTierProviderConfig[];
41
+ }
42
+ /** Structural view of the HybridRouter — avoids a hard import (decoupling). */
43
+ export interface FreeTierLlmRouter {
44
+ chat(args: {
45
+ messages: Array<{
46
+ role: 'system' | 'user' | 'assistant';
47
+ content: string;
48
+ }>;
49
+ agentType: string;
50
+ complexity: 'low' | 'medium' | 'high';
51
+ }): Promise<{
52
+ content: string;
53
+ }>;
54
+ }
55
+ export interface BuildFreeTierExecutorOptions {
56
+ config: FreeTierCoordinatorConfig;
57
+ /** Router agentType hint for escalated (paid) tiers, e.g. 'qe-test-architect'. */
58
+ agentType: string;
59
+ /** D9 sink label, e.g. 'test-generation'. */
60
+ taskKind: string;
61
+ /** Delegate Claude tiers to the host router; omit → local-only (no escalation). */
62
+ llmRouter?: FreeTierLlmRouter | null;
63
+ /** D9: feed cheap-vs-escalated outcomes into routing-feedback. */
64
+ routingFeedback?: RoutingFeedbackLike | null;
65
+ env?: NodeJS.ProcessEnv;
66
+ logger?: {
67
+ info: (m: string) => void;
68
+ };
69
+ }
70
+ /**
71
+ * Build a cheap-first escalating executor from coordinator config + (optional)
72
+ * router. Returns `null` when the free tier is not opted in — callers store the
73
+ * result and fall through to their normal path when it is null.
74
+ */
75
+ export declare function buildFreeTierExecutor(opts: BuildFreeTierExecutorOptions): FreeTierEscalatingExecutor | null;
76
+ /**
77
+ * Run one bounded generation task cheap-first: best-of-k diverse attempts +
78
+ * D8 repair on the local tier, escalating the hard tail. Returns `null` when no
79
+ * executor (not opted in). The `verify` MUST be an objective oracle (06 §10).
80
+ */
81
+ export declare function runFreeTierTextTask(executor: FreeTierEscalatingExecutor | null, args: {
82
+ agentId: string;
83
+ system: string;
84
+ user: string;
85
+ verify: QeVerifier;
86
+ repairAttempts?: number;
87
+ escalate?: boolean;
88
+ bestOfK?: number;
89
+ }): Promise<QeExecutionResult | null>;
90
+ //# sourceMappingURL=coordinator-support.d.ts.map
@@ -0,0 +1,78 @@
1
+ /**
2
+ * Coordinator free-tier support (cross-pollination plan 06 — broadening the
3
+ * opt-in beyond test generation; ADR-111 escalation lane).
4
+ *
5
+ * Extracts the generic "build a FreeTierEscalatingExecutor from a coordinator's
6
+ * config + router" wiring that was inline in the test-generation coordinator, so
7
+ * ANY domain coordinator can opt in with a few lines instead of duplicating it.
8
+ *
9
+ * The opt-in lane is justified only for tasks that match the D3 criterion:
10
+ * BOUNDED generation graded by an OBJECTIVE oracle (a test+assertion, valid
11
+ * Gherkin, a schema). Do NOT wire it into analysis/judgement coordinators — the
12
+ * §11 "coder binds" finding means a cheap model can't carry open-ended reasoning.
13
+ */
14
+ import { FreeTierEscalatingExecutor } from './executor.js';
15
+ import { defaultFreeTierLadder } from './ladder.js';
16
+ import { createRoutingFeedbackSink } from './feedback-sink.js';
17
+ /** Default cheap tier. qwen3:30b-a3b, NOT qwen3:8b — D3 (2026-06-23) measured the
18
+ * 8B below the QE generation floor (0/3 baseline-valid); the 30B MoE clears it. */
19
+ export const DEFAULT_FREE_TIER_MODEL = 'qwen3:30b-a3b';
20
+ /**
21
+ * Build a cheap-first escalating executor from coordinator config + (optional)
22
+ * router. Returns `null` when the free tier is not opted in — callers store the
23
+ * result and fall through to their normal path when it is null.
24
+ */
25
+ export function buildFreeTierExecutor(opts) {
26
+ const env = opts.env ?? process.env;
27
+ const on = opts.config.enableFreeTier === true || env.AQE_FREE_TIER === '1';
28
+ if (!on)
29
+ return null;
30
+ const model = opts.config.freeTierModel || env.AQE_FREE_TIER_MODEL || DEFAULT_FREE_TIER_MODEL;
31
+ // Paid escalation: map the ladder tier to a complexity hint so the host router
32
+ // picks that tier. No router → executor stays local-only (Claude tiers unavailable).
33
+ const claudeRunner = opts.llmRouter
34
+ ? async (tier, msgs) => {
35
+ const complexity = tier === 'opus' ? 'high' : tier === 'sonnet' ? 'medium' : 'low';
36
+ const resp = await opts.llmRouter.chat({
37
+ messages: msgs.map((m) => ({ role: m.role, content: m.content })),
38
+ agentType: opts.agentType,
39
+ complexity,
40
+ });
41
+ return { content: resp.content };
42
+ }
43
+ : undefined;
44
+ const exec = new FreeTierEscalatingExecutor({
45
+ ladder: defaultFreeTierLadder(model),
46
+ claudeRunner,
47
+ defaultRepairAttempts: opts.config.freeTierRepairAttempts ?? 1,
48
+ candidateProviders: opts.config.freeTierCandidateProviders, // A12 cross-model (off unless set)
49
+ onOutcome: opts.routingFeedback
50
+ ? createRoutingFeedbackSink(opts.routingFeedback, { taskKind: opts.taskKind })
51
+ : undefined,
52
+ });
53
+ opts.logger?.info(`Free-tier enabled for ${opts.taskKind} (model=${model}, ` +
54
+ `${claudeRunner ? 'escalation→router' : 'local-only'})`);
55
+ return exec;
56
+ }
57
+ /**
58
+ * Run one bounded generation task cheap-first: best-of-k diverse attempts +
59
+ * D8 repair on the local tier, escalating the hard tail. Returns `null` when no
60
+ * executor (not opted in). The `verify` MUST be an objective oracle (06 §10).
61
+ */
62
+ export async function runFreeTierTextTask(executor, args) {
63
+ if (!executor)
64
+ return null;
65
+ return executor.execute({
66
+ agentId: args.agentId,
67
+ messages: [
68
+ { role: 'system', content: args.system },
69
+ { role: 'user', content: args.user },
70
+ ],
71
+ verify: args.verify,
72
+ repairAttempts: args.repairAttempts,
73
+ escalate: args.escalate ?? true,
74
+ bestOfK: args.bestOfK,
75
+ oracleKind: 'objective',
76
+ });
77
+ }
78
+ //# sourceMappingURL=coordinator-support.js.map
@@ -16,7 +16,7 @@
16
16
  */
17
17
  import { type ChatMessage } from './provider.js';
18
18
  import { AutoEscalationTracker } from '../escalation/auto-escalation-tracker.js';
19
- import type { QeRoutingLadder } from './types.js';
19
+ import type { QeRoutingLadder, FreeTierProviderConfig } from './types.js';
20
20
  import type { AgentTier } from '../routing-config.js';
21
21
  /** Serves a Claude tier. Injected by the host (e.g. delegates to HybridRouter). */
22
22
  export type ClaudeTierRunner = (claudeTier: AgentTier, messages: ChatMessage[]) => Promise<{
@@ -43,12 +43,30 @@ export interface QeTaskRequest {
43
43
  escalate?: boolean;
44
44
  /** Cap on tiers tried for one task (default: full ladder). */
45
45
  maxEscalations?: number;
46
+ /**
47
+ * Best-of-k diverse attempts at each tier's first round (06 §12 correction).
48
+ * Ruv's ablation: a single repro-gated shot Goodharts the oracle (0 gold); k>1
49
+ * diverse attempts picked by the objective verifier are what convert. Default 1.
50
+ */
51
+ bestOfK?: number;
52
+ /**
53
+ * Goodhart guard (06 §10). `objective` = the verifier is a deterministic
54
+ * ground-truth oracle (arena/coverage/schema). `self-authored` = the verifier
55
+ * is the model's own test — an unreliable selection target, so its outcomes are
56
+ * NOT recorded into routing-feedback (they must not lift confidence). Default
57
+ * `objective` (existing callers inject real oracles, e.g. a coverage/test run).
58
+ */
59
+ oracleKind?: 'objective' | 'self-authored';
46
60
  }
47
61
  export interface TierAttempt {
48
62
  tier: string;
49
63
  provider: 'free-tier' | 'claude';
50
64
  /** 0 = first try at this tier; 1.. = repair rounds (D8). */
51
65
  repairRound: number;
66
+ /** Best-of-k variant index within round 0 (0 = primary, 1.. = diversified). */
67
+ variant?: number;
68
+ /** Generator model that produced this candidate (set for cross-model best-of-k). */
69
+ model?: string;
52
70
  ok: boolean;
53
71
  passed: boolean;
54
72
  latencyMs: number;
@@ -66,6 +84,13 @@ export interface QeExecutionResult {
66
84
  escalated: boolean;
67
85
  /** True iff a same-tier repair round produced the passing output. */
68
86
  repaired: boolean;
87
+ /** True iff best-of-k (k>1) diversity at a round produced the passing output. */
88
+ bestOf: boolean;
89
+ /**
90
+ * True iff the outcome was withheld from routing-feedback because the gate was
91
+ * a self-authored oracle (06 §10 Goodhart guard) — it cannot lift confidence.
92
+ */
93
+ goodhartGuarded: boolean;
69
94
  /** Per-attempt trace, cheapest → most capable. */
70
95
  attempts: TierAttempt[];
71
96
  }
@@ -79,6 +104,15 @@ export interface FreeTierExecutorOptions {
79
104
  env?: NodeJS.ProcessEnv;
80
105
  /** Default same-tier repair retries when a request omits `repairAttempts`. */
81
106
  defaultRepairAttempts?: number;
107
+ /**
108
+ * Cross-model best-of-k (A12, measured +6 composite over single-model). When set
109
+ * AND the START tier is free-tier, round-0 best-of-k draws each candidate from a
110
+ * DIFFERENT provider in this pool (e.g. local qwen + an OpenRouter model) instead
111
+ * of one model's temperature/prompt variants — diverse models cover each other's
112
+ * failures and raise the union. Selection stays the objective verifier (first-pass).
113
+ * Omit ⇒ single-model best-of-k (unchanged).
114
+ */
115
+ candidateProviders?: FreeTierProviderConfig[];
82
116
  /** D9 sink: record each completed task outcome (→ routing-feedback). */
83
117
  onOutcome?: (o: {
84
118
  agentId: string;
@@ -103,11 +137,19 @@ export declare class FreeTierEscalatingExecutor {
103
137
  private readonly baseTier;
104
138
  private readonly defaultRepairAttempts;
105
139
  private readonly onOutcome?;
140
+ /** Resolved cross-model generator pool (A12); undefined ⇒ single-model best-of-k. */
141
+ private readonly candidateProviders?;
106
142
  constructor(opts: FreeTierExecutorOptions);
107
143
  /** Expose the tracker so a coordinator can inspect/share adaptation state. */
108
144
  getTracker(): AutoEscalationTracker<string>;
109
145
  /** Run ONE tier once; never throws — failure becomes `{ok:false}` so we repair/escalate. */
110
146
  private runTier;
147
+ /**
148
+ * Best-of-k diversity turn (06 §12): nudge the model toward a structurally
149
+ * different valid solution. Deterministic by `variant` index (no RNG) so runs
150
+ * replay identically.
151
+ */
152
+ private diversify;
111
153
  /** Build the D8 repair turn: show the model its rejected output + why. */
112
154
  private repairMessages;
113
155
  /**
@@ -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,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