agentic-qe 3.10.3 → 3.10.5

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 (370) hide show
  1. package/.claude/skills/qcsd-development-swarm/SKILL.md +27 -6
  2. package/.claude/skills/skills-manifest.json +1 -1
  3. package/CHANGELOG.md +104 -0
  4. package/assets/skills/skills-manifest.json +1 -1
  5. package/dist/arena/arena.d.ts +68 -0
  6. package/dist/arena/arena.js +169 -0
  7. package/dist/arena/mutator.d.ts +23 -0
  8. package/dist/arena/mutator.js +112 -0
  9. package/dist/arena/rng.d.ts +15 -0
  10. package/dist/arena/rng.js +34 -0
  11. package/dist/arena/runner.d.ts +44 -0
  12. package/dist/arena/runner.js +79 -0
  13. package/dist/cli/bundle.js +7 -7
  14. package/dist/cli/chunks/adapter-XZVL3DHO.js +2 -0
  15. package/dist/cli/chunks/{agent-booster-wasm-NGC6LSQP.js → agent-booster-wasm-3BC5LIEB.js} +2 -2
  16. package/dist/cli/chunks/{agent-handler-P2IJE4GK.js → agent-handler-QLXWVZZF.js} +2 -2
  17. package/dist/cli/chunks/{agent-memory-branch-JXRJ5GKQ.js → agent-memory-branch-3U5PDYW7.js} +2 -2
  18. package/dist/cli/chunks/aqe-learning-engine-YIL25K6W.js +2 -0
  19. package/dist/cli/chunks/arena-BMJQK4RD.js +18 -0
  20. package/dist/cli/chunks/arena-XENAGV4I.js +4 -0
  21. package/dist/cli/chunks/audit-WPIRUJNZ.js +3 -0
  22. package/dist/cli/chunks/base-YCYV23Q3.js +2 -0
  23. package/dist/cli/chunks/{hnswlib-node-64EGGWIC.js → better-sqlite3-6AGIBSVE.js} +2 -2
  24. package/dist/cli/chunks/{brain-handler-SACNDFSW.js → brain-handler-PHSWG5PR.js} +3 -3
  25. package/dist/cli/chunks/{branch-enumerator-LFOTVUDA.js → branch-enumerator-LNSYT34I.js} +2 -2
  26. package/dist/cli/chunks/{browser-FK7PRF3W.js → browser-M5BVQMBI.js} +2 -2
  27. package/dist/cli/chunks/browser-workflow-ALCOCRA2.js +2 -0
  28. package/dist/cli/chunks/{chunk-ZXQNE4QV.js → chunk-24A7KD3D.js} +1 -1
  29. package/dist/cli/chunks/{chunk-6Q2PPOOF.js → chunk-253TDTPH.js} +1 -1
  30. package/dist/cli/chunks/{chunk-MC7K44M4.js → chunk-2RLRPKCG.js} +2 -2
  31. package/dist/cli/chunks/{chunk-VRXY4T22.js → chunk-2UQWVF4P.js} +2 -2
  32. package/dist/cli/chunks/{chunk-UDV4YB42.js → chunk-2Z7HIT5I.js} +1 -1
  33. package/dist/cli/chunks/{chunk-CTDO2UB2.js → chunk-3BGGNHHZ.js} +1 -1
  34. package/dist/cli/chunks/{chunk-HWM2XJ3P.js → chunk-3JWV4GE6.js} +2 -2
  35. package/dist/cli/chunks/{chunk-BT3QLWII.js → chunk-3KGUP2SD.js} +2 -2
  36. package/dist/cli/chunks/{chunk-T63EK6GH.js → chunk-3WOQY6UL.js} +2 -2
  37. package/dist/cli/chunks/{chunk-QM65UGPV.js → chunk-4FTO3TPH.js} +2 -2
  38. package/dist/cli/chunks/{chunk-WWD5IWTV.js → chunk-4K7T6AKM.js} +1 -1
  39. package/dist/cli/chunks/{chunk-XTP2GHI7.js → chunk-4Z7XH4JE.js} +2 -2
  40. package/dist/cli/chunks/{chunk-FND6V2RV.js → chunk-54IPDQIZ.js} +8 -8
  41. package/dist/cli/chunks/{chunk-KTRB3L53.js → chunk-56RA6YPN.js} +2 -2
  42. package/dist/cli/chunks/{chunk-7YYTTWGY.js → chunk-5D7GLMT3.js} +1 -1
  43. package/dist/cli/chunks/{chunk-M5CDW2ZH.js → chunk-66LOFIBP.js} +2 -2
  44. package/dist/cli/chunks/{chunk-3X2ZQ55B.js → chunk-6SAU7GXO.js} +3 -3
  45. package/dist/cli/chunks/{chunk-DF3MJ2YL.js → chunk-75MP7JMV.js} +1 -1
  46. package/dist/cli/chunks/{chunk-RTDHWOAG.js → chunk-7DU35D4M.js} +1 -1
  47. package/dist/cli/chunks/{chunk-Q7EBD24B.js → chunk-7JZCEQFR.js} +1 -1
  48. package/dist/cli/chunks/{chunk-JXIPRMAY.js → chunk-A3BDPU5F.js} +4 -4
  49. package/dist/cli/chunks/{chunk-I42R57ON.js → chunk-A7HGS7FW.js} +2 -2
  50. package/dist/cli/chunks/{chunk-NNZMEYLT.js → chunk-AMBIOEMO.js} +1 -1
  51. package/dist/cli/chunks/{chunk-BO2OV2RH.js → chunk-AVQD7KEN.js} +2 -2
  52. package/dist/cli/chunks/{chunk-6GCOIIHY.js → chunk-AZCKTAUI.js} +2 -2
  53. package/dist/cli/chunks/{chunk-GL3HZN3O.js → chunk-B4F5EPNR.js} +1 -1
  54. package/dist/cli/chunks/{chunk-HAO3SPOE.js → chunk-BB7MEGXD.js} +2 -2
  55. package/dist/cli/chunks/{chunk-VDTFRMES.js → chunk-BSRCL6RU.js} +2 -2
  56. package/dist/cli/chunks/{chunk-RZCAA2PZ.js → chunk-CS3UB2OL.js} +1 -1
  57. package/dist/cli/chunks/{chunk-4OUAHZX2.js → chunk-CTG3GJIM.js} +2 -2
  58. package/dist/cli/chunks/{chunk-BWP3UVPE.js → chunk-CUAM34RQ.js} +3 -3
  59. package/dist/cli/chunks/chunk-CUY2EUSQ.js +2 -0
  60. package/dist/cli/chunks/{chunk-X2B7SANM.js → chunk-D3Q4443B.js} +1 -1
  61. package/dist/cli/chunks/{chunk-5IBJURYB.js → chunk-D4WDJ4ZF.js} +2 -2
  62. package/dist/cli/chunks/chunk-D7NKRCIL.js +2 -0
  63. package/dist/cli/chunks/{chunk-JP63XACW.js → chunk-DBR4TQPK.js} +2 -2
  64. package/dist/cli/chunks/{chunk-FLTPHVZ3.js → chunk-DIJ74M7V.js} +1 -1
  65. package/dist/cli/chunks/{chunk-PFCAMX6H.js → chunk-DJQYZ4RZ.js} +1 -1
  66. package/dist/cli/chunks/{chunk-5LON3MLI.js → chunk-DN65ILSI.js} +2 -2
  67. package/dist/cli/chunks/{chunk-6ZK24V2Y.js → chunk-DWLGFYXV.js} +2 -2
  68. package/dist/cli/chunks/{chunk-5EWWA4QP.js → chunk-EIL7FQC4.js} +6 -6
  69. package/dist/cli/chunks/{chunk-IRR7YA3Q.js → chunk-FE3FGMNB.js} +2 -2
  70. package/dist/cli/chunks/{chunk-ADV4DH3W.js → chunk-FLYFNNSN.js} +3 -3
  71. package/dist/cli/chunks/{chunk-SWOG3PBD.js → chunk-FNJZBIR3.js} +2 -2
  72. package/dist/cli/chunks/chunk-FPWA73N6.js +2 -0
  73. package/dist/cli/chunks/{chunk-NEYYLAYS.js → chunk-FW3C4LWU.js} +2 -2
  74. package/dist/cli/chunks/{chunk-5G5AAEFF.js → chunk-G4GX6YKX.js} +2 -2
  75. package/dist/cli/chunks/{chunk-NNVXHC74.js → chunk-G5UIGH4C.js} +3 -3
  76. package/dist/cli/chunks/{chunk-QEODION5.js → chunk-G6FP3S3G.js} +2 -2
  77. package/dist/cli/chunks/{chunk-ZG4P3DTL.js → chunk-GDUGW6FZ.js} +2 -2
  78. package/dist/cli/chunks/{chunk-GJUGSH7T.js → chunk-GKG6IQP6.js} +3 -3
  79. package/dist/cli/chunks/chunk-GMU7P5O3.js +2 -0
  80. package/dist/cli/chunks/{chunk-NRCL3WCP.js → chunk-GTVXVYKE.js} +2 -2
  81. package/dist/cli/chunks/{chunk-2ULVCLOW.js → chunk-HHEHGERJ.js} +2 -2
  82. package/dist/cli/chunks/{chunk-6FL3GN4T.js → chunk-HKJ3LG3N.js} +2 -2
  83. package/dist/cli/chunks/{chunk-E2BJT6A7.js → chunk-HNYSBE5J.js} +2 -2
  84. package/dist/cli/chunks/{chunk-JTZ3Q2QS.js → chunk-HPKYIK7R.js} +2 -2
  85. package/dist/cli/chunks/{chunk-GHNNJHH3.js → chunk-HRORJ352.js} +2 -2
  86. package/dist/cli/chunks/{chunk-5ER3COX3.js → chunk-IIFCTJOF.js} +2 -2
  87. package/dist/cli/chunks/{chunk-UIJFU4KD.js → chunk-IOE6LDPF.js} +2 -2
  88. package/dist/cli/chunks/{chunk-JD2PG4KS.js → chunk-IRS4HKAR.js} +1 -1
  89. package/dist/cli/chunks/{chunk-VIWIO27R.js → chunk-IT7CEHAJ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-JE3C7JYN.js → chunk-IUKERFLT.js} +1 -1
  91. package/dist/cli/chunks/{chunk-YDKYLNKZ.js → chunk-IVKSZNMI.js} +1 -1
  92. package/dist/cli/chunks/{chunk-3RZL4QTT.js → chunk-IWRORKD7.js} +2 -2
  93. package/dist/cli/chunks/{chunk-NZHOKLII.js → chunk-J533CJUN.js} +3 -3
  94. package/dist/cli/chunks/{chunk-5SGEOO2F.js → chunk-JPOEI7CJ.js} +2 -2
  95. package/dist/cli/chunks/{chunk-MBSJ5G4I.js → chunk-JY7T2AQQ.js} +4 -4
  96. package/dist/cli/chunks/{chunk-4QFAUSWQ.js → chunk-K5KKZWED.js} +2 -2
  97. package/dist/cli/chunks/{chunk-L74CHKFR.js → chunk-KIMJPTHD.js} +2 -2
  98. package/dist/cli/chunks/{chunk-N7IBYDW5.js → chunk-MEN3UW7W.js} +1 -1
  99. package/dist/cli/chunks/{chunk-UHDBM7QS.js → chunk-MFQIJ3HV.js} +2 -2
  100. package/dist/cli/chunks/{chunk-SL6YZAT4.js → chunk-MGCW5FWH.js} +2 -2
  101. package/dist/cli/chunks/{chunk-U6UK3UMX.js → chunk-MIMJVKJJ.js} +3 -3
  102. package/dist/cli/chunks/{chunk-7ZSPCGTI.js → chunk-MJRYHHOG.js} +2 -2
  103. package/dist/cli/chunks/{chunk-FU77CDEM.js → chunk-MRXKIXVV.js} +2 -2
  104. package/dist/cli/chunks/{chunk-DY5KEOHX.js → chunk-MWPFUBXS.js} +2 -2
  105. package/dist/cli/chunks/{chunk-C6BBRM2J.js → chunk-N2TJXGHG.js} +1 -1
  106. package/dist/cli/chunks/{chunk-MQOFFRTA.js → chunk-NGSA53GC.js} +2 -2
  107. package/dist/cli/chunks/{chunk-YXH2CVAF.js → chunk-NKW7VOZV.js} +1 -1
  108. package/dist/cli/chunks/{chunk-YIYV2JB6.js → chunk-O5OOUMBB.js} +2 -2
  109. package/dist/cli/chunks/{chunk-HM523MTQ.js → chunk-OATHXZYW.js} +1 -1
  110. package/dist/cli/chunks/{chunk-WPVCSFDA.js → chunk-OJNG6ZXG.js} +2 -2
  111. package/dist/cli/chunks/{chunk-7SEHQTYD.js → chunk-PGNQR2VM.js} +1 -1
  112. package/dist/cli/chunks/{chunk-UZL366ZI.js → chunk-PPM5D7LH.js} +1 -1
  113. package/dist/cli/chunks/{chunk-ERYMAYJW.js → chunk-PYBVFG6T.js} +2 -2
  114. package/dist/cli/chunks/{chunk-FJGSEPFL.js → chunk-Q6BKJZTG.js} +2 -2
  115. package/dist/cli/chunks/chunk-QAW6RVAR.js +699 -0
  116. package/dist/cli/chunks/chunk-QTDZS4U6.js +2 -0
  117. package/dist/cli/chunks/{chunk-USFZ4IJD.js → chunk-R573V37S.js} +15 -15
  118. package/dist/cli/chunks/{chunk-Z2K5IZM6.js → chunk-RCAIOTIF.js} +2 -2
  119. package/dist/cli/chunks/{chunk-7RMZAVGO.js → chunk-RFNEEDPQ.js} +2 -2
  120. package/dist/cli/chunks/{chunk-IL2KOW5W.js → chunk-RFVZMNYX.js} +2 -2
  121. package/dist/cli/chunks/{chunk-B5MMDMH6.js → chunk-RLU7764Y.js} +2 -2
  122. package/dist/cli/chunks/chunk-RLZDXQNM.js +2 -0
  123. package/dist/cli/chunks/{chunk-QWG76RHA.js → chunk-RONMVGCT.js} +2 -2
  124. package/dist/cli/chunks/{chunk-X3RJ6SFC.js → chunk-RR55MLD4.js} +1 -1
  125. package/dist/cli/chunks/{chunk-PL5SLO2W.js → chunk-RUQV3BTV.js} +1 -1
  126. package/dist/cli/chunks/{chunk-NXPFGPHV.js → chunk-RZ7D5SHS.js} +1 -1
  127. package/dist/cli/chunks/{chunk-3LRK7PYN.js → chunk-S73KENCH.js} +2 -2
  128. package/dist/cli/chunks/{chunk-3HBWDG62.js → chunk-S7FGTHFE.js} +2 -2
  129. package/dist/cli/chunks/{chunk-CAMEFWRK.js → chunk-S7HQOGVD.js} +1 -1
  130. package/dist/cli/chunks/{chunk-PZHZPX3O.js → chunk-SK6YRNXI.js} +2 -2
  131. package/dist/cli/chunks/{chunk-JTF6D2RJ.js → chunk-SXQIH2QA.js} +2 -2
  132. package/dist/cli/chunks/{chunk-6B4S7PKP.js → chunk-TISBFSDJ.js} +1 -1
  133. package/dist/cli/chunks/{chunk-72LE6PHL.js → chunk-TMD6IC6D.js} +2 -2
  134. package/dist/cli/chunks/{chunk-YDDZJCKY.js → chunk-TMTLWSSA.js} +1 -1
  135. package/dist/cli/chunks/{chunk-HQJMCTWN.js → chunk-UOIT5JZ6.js} +2 -2
  136. package/dist/cli/chunks/{chunk-OPDTDKN3.js → chunk-UTORITJT.js} +2 -2
  137. package/dist/cli/chunks/{chunk-3JAOFKEU.js → chunk-VB7DZVCI.js} +1 -1
  138. package/dist/cli/chunks/{chunk-2L73WXA4.js → chunk-VC256KH2.js} +2 -2
  139. package/dist/cli/chunks/{chunk-SNTMAVPH.js → chunk-VESYE5YO.js} +3 -3
  140. package/dist/cli/chunks/{chunk-YYAPO3CU.js → chunk-VKWDMOR4.js} +2 -2
  141. package/dist/cli/chunks/{chunk-HRLXU4LH.js → chunk-VWN66V7U.js} +2 -2
  142. package/dist/cli/chunks/{chunk-CNEWYJKT.js → chunk-W5C7R2LS.js} +3 -3
  143. package/dist/cli/chunks/{chunk-JLL27IGU.js → chunk-W7KGHW4T.js} +2 -2
  144. package/dist/cli/chunks/{chunk-H56AROF2.js → chunk-WFZ4DRIC.js} +2 -2
  145. package/dist/cli/chunks/{chunk-4CYLSXA6.js → chunk-WFZUKXV5.js} +2 -2
  146. package/dist/cli/chunks/{chunk-AEJVOJPT.js → chunk-X4B3R3ZZ.js} +2 -2
  147. package/dist/cli/chunks/{chunk-KG5SM36Y.js → chunk-XI6ZZMX7.js} +1 -1
  148. package/dist/cli/chunks/{chunk-R5ONQAQL.js → chunk-YEO2Z3UX.js} +2 -2
  149. package/dist/cli/chunks/{chunk-D2FBUOAR.js → chunk-YZD4VIE5.js} +1 -1
  150. package/dist/cli/chunks/{chunk-U7NMPZE2.js → chunk-YZFNPTGN.js} +2 -2
  151. package/dist/cli/chunks/{chunk-OX4R55T3.js → chunk-ZCYKWEAM.js} +2 -2
  152. package/dist/cli/chunks/{chunk-OG7CWWFR.js → chunk-ZG3DSWUA.js} +1 -1
  153. package/dist/cli/chunks/{chunk-EETVN2OJ.js → chunk-ZS4BGJJV.js} +1 -1
  154. package/dist/cli/chunks/{chunk-LZ6TNTGO.js → chunk-ZT7JSFGT.js} +2 -2
  155. package/dist/cli/chunks/{chunk-HMFEPKAR.js → chunk-ZTC64OJE.js} +2 -2
  156. package/dist/cli/chunks/{chunk-RNF47IJ5.js → chunk-ZUBJBAUD.js} +15 -15
  157. package/dist/cli/chunks/{ci-AWZ3S5OT.js → ci-M2BSQBLL.js} +2 -2
  158. package/dist/cli/chunks/{ci-output-JLCYTIMT.js → ci-output-Z4TMK6GZ.js} +2 -2
  159. package/dist/cli/chunks/{circuit-breaker-BJDKBDIL.js → circuit-breaker-E3G4GGWB.js} +2 -2
  160. package/dist/cli/chunks/{claude-flow-setup-KKOP5ZMO.js → claude-flow-setup-MASRQU54.js} +2 -2
  161. package/dist/cli/chunks/client-RPB6RYVY.js +2 -0
  162. package/dist/cli/chunks/{cline-installer-7M525SEA.js → cline-installer-P3BWAKQA.js} +2 -2
  163. package/dist/cli/chunks/{code-27SUVJDO.js → code-7HY5HQAV.js} +2 -2
  164. package/dist/cli/chunks/{code-index-extractor-TTQQZLAK.js → code-index-extractor-MBVKLOEU.js} +2 -2
  165. package/dist/cli/chunks/{codex-installer-GHNGNPKP.js → codex-installer-WZ6QO2PH.js} +2 -2
  166. package/dist/cli/chunks/{completions-JPJD24DG.js → completions-TOJC2UFP.js} +2 -2
  167. package/dist/cli/chunks/{complexity-analyzer-Q74EJV33.js → complexity-analyzer-QYVDIAAW.js} +2 -2
  168. package/dist/cli/chunks/{continuedev-installer-ULTRDIML.js → continuedev-installer-J72CV7P4.js} +2 -2
  169. package/dist/cli/chunks/{copilot-installer-EK52X4CG.js → copilot-installer-ACDA3GEA.js} +2 -2
  170. package/dist/cli/chunks/core-handlers-QFJT5NX6.js +2 -0
  171. package/dist/cli/chunks/{cost-tracker-2GKBRYXL.js → cost-tracker-BAYQJELE.js} +2 -2
  172. package/dist/cli/chunks/{coverage-YCLC3W2A.js → coverage-QD3XJV6W.js} +3 -3
  173. package/dist/cli/chunks/cross-domain-router-5GJ7WZKX.js +2 -0
  174. package/dist/cli/chunks/{cursor-installer-B3ALFW5E.js → cursor-installer-SPGZ4TQM.js} +2 -2
  175. package/dist/cli/chunks/{daemon-ZKEBVLJA.js → daemon-3EVOL2UH.js} +3 -3
  176. package/dist/cli/chunks/daemon-N4JKD5SO.js +10 -0
  177. package/dist/cli/chunks/{dag-attention-scheduler-OQPJ6ULA.js → dag-attention-scheduler-3BVLL3L5.js} +2 -2
  178. package/dist/cli/chunks/{detect-YMYIQH3Q.js → detect-SWACKB45.js} +2 -2
  179. package/dist/cli/chunks/{dist-node-R4FAYQRY.js → dist-node-LU4E7PI6.js} +2 -2
  180. package/dist/cli/chunks/{domain-handler-IGWXLF2S.js → domain-handler-5AKKAC43.js} +2 -2
  181. package/dist/cli/chunks/{domain-transfer-A7YNO76C.js → domain-transfer-LB6H7RPX.js} +2 -2
  182. package/dist/cli/chunks/dream-C6VNLTON.js +2 -0
  183. package/dist/cli/chunks/{embed-and-insert-pattern-KODZAS7Y.js → embed-and-insert-pattern-7RBA5NDK.js} +2 -2
  184. package/dist/cli/chunks/{eval-ALQW7Q2S.js → eval-ZZFPRENX.js} +5 -5
  185. package/dist/cli/chunks/{experience-capture-middleware-3WK4RXWK.js → experience-capture-middleware-HRO3EGIW.js} +3 -3
  186. package/dist/cli/chunks/{fast-paths-PQWDFIJZ.js → fast-paths-IRRNQBTY.js} +2 -2
  187. package/dist/cli/chunks/{feature-flags-JRUAZCND.js → feature-flags-R5N5IWI2.js} +2 -2
  188. package/dist/cli/chunks/{feature-flags-6X33B3WX.js → feature-flags-W54ABAUA.js} +2 -2
  189. package/dist/cli/chunks/{file-discovery-SA3YU3IH.js → file-discovery-6CIDLVID.js} +2 -2
  190. package/dist/cli/chunks/{fleet-7TXCAOKQ.js → fleet-YTFN64WE.js} +3 -3
  191. package/dist/cli/chunks/{gnn-wrapper-ZKNYACEC.js → gnn-wrapper-RXMPLMV2.js} +2 -2
  192. package/dist/cli/chunks/{heartbeat-handler-KRZRZ23F.js → heartbeat-handler-HQQWEEQQ.js} +4 -4
  193. package/dist/cli/chunks/heartbeat-scheduler-4SBO27BG.js +2 -0
  194. package/dist/cli/chunks/hnsw-adapter-W7G6VNXW.js +2 -0
  195. package/dist/cli/chunks/hnsw-index-LENA5QML.js +2 -0
  196. package/dist/cli/chunks/{hnsw-legacy-bridge-LVHQ5SG7.js → hnsw-legacy-bridge-GPZIKYFD.js} +2 -2
  197. package/dist/cli/chunks/{better-sqlite3-HP4JZS6K.js → hnswlib-node-P6HSEFLW.js} +2 -2
  198. package/dist/cli/chunks/hooks-AYLAGFOK.js +285 -0
  199. package/dist/cli/chunks/hybrid-router-IXHIC45P.js +2 -0
  200. package/dist/cli/chunks/{hypergraph-engine-2EZBZMFK.js → hypergraph-engine-56FMXI3T.js} +2 -2
  201. package/dist/cli/chunks/{hypergraph-handler-GLPWYII2.js → hypergraph-handler-APEVT5IE.js} +3 -3
  202. package/dist/cli/chunks/impact-analyzer-DKGVMYU6.js +2 -0
  203. package/dist/cli/chunks/{init-handler-ZSDO5VMA.js → init-handler-5DWF4REQ.js} +6 -6
  204. package/dist/cli/chunks/init-wizard-BBY3LY3F.js +2 -0
  205. package/dist/cli/chunks/kernel-7CUW7G62.js +2 -0
  206. package/dist/cli/chunks/{kilocode-installer-ATYSDWIV.js → kilocode-installer-XKAUA5VA.js} +2 -2
  207. package/dist/cli/chunks/{kiro-installer-K66YT6PC.js → kiro-installer-NI2KIYJE.js} +2 -2
  208. package/dist/cli/chunks/knowledge-graph-Q5CP47IP.js +2 -0
  209. package/dist/cli/chunks/{learning-BVYCC4RI.js → learning-ZIUMUNXZ.js} +3 -3
  210. package/dist/cli/chunks/{llm-router-VBCXE6DN.js → llm-router-IL52EF2V.js} +4 -4
  211. package/dist/cli/chunks/llm-router-service-MTXCX7TO.js +2 -0
  212. package/dist/cli/chunks/{load-AREDQE2U.js → load-B5LFYD6O.js} +2 -2
  213. package/dist/cli/chunks/load-test-YBWXASBO.js +2 -0
  214. package/dist/cli/chunks/{mcp-NG6H6UC5.js → mcp-K6GZLWBC.js} +2 -2
  215. package/dist/cli/chunks/{memory-Y65EHG6N.js → memory-NCQRVSN6.js} +5 -5
  216. package/dist/cli/chunks/memory-backend-52LANEA3.js +2 -0
  217. package/dist/cli/chunks/memory-handlers-KFW3HYAP.js +2 -0
  218. package/dist/cli/chunks/{multi-model-executor-VRPRFUZT.js → multi-model-executor-R4LBSJWK.js} +2 -2
  219. package/dist/cli/chunks/{opencode-installer-CKQXPM5R.js → opencode-installer-I6CBR3PV.js} +2 -2
  220. package/dist/cli/chunks/{orchestrator-I7JBKD6G.js → orchestrator-5FXUCES6.js} +10 -10
  221. package/dist/cli/chunks/{pipeline-MV2RWCBI.js → pipeline-GDKCTXJH.js} +2 -2
  222. package/dist/cli/chunks/{platform-VU5P3SOG.js → platform-ZFY3F4T3.js} +2 -2
  223. package/dist/cli/chunks/{plugin-6TERLKCB.js → plugin-HQMEN3OS.js} +2 -2
  224. package/dist/cli/chunks/{prime-radiant-advanced-wasm-WIUIN2DL.js → prime-radiant-advanced-wasm-LSJGF4CV.js} +2 -2
  225. package/dist/cli/chunks/protocol-executor-TRYUS77M.js +2 -0
  226. package/dist/cli/chunks/{protocol-handler-HKWBGARO.js → protocol-handler-BMDNIGPP.js} +2 -2
  227. package/dist/cli/chunks/{prove-7CQPHBRJ.js → prove-ABVGAG4Z.js} +2 -2
  228. package/dist/cli/chunks/provider-manager-6XQQN7FX.js +2 -0
  229. package/dist/cli/chunks/qe-reasoning-bank-3IUPE4DJ.js +2 -0
  230. package/dist/cli/chunks/{quality-VLUVXKVG.js → quality-ENJXPNP5.js} +2 -2
  231. package/dist/cli/chunks/queen-coordinator-VWPH4XPX.js +2 -0
  232. package/dist/cli/chunks/{real-embeddings-JPZ64KK2.js → real-embeddings-W3GNAEJO.js} +2 -2
  233. package/dist/cli/chunks/{roocode-installer-NONVB3UE.js → roocode-installer-4FJNQ7PU.js} +2 -2
  234. package/dist/cli/chunks/router-OIB6ODHA.js +2 -0
  235. package/dist/cli/chunks/routing-feedback-EKYPCZYG.js +2 -0
  236. package/dist/cli/chunks/{routing-handler-YYXDT4J2.js → routing-handler-GFS5FA4F.js} +2 -2
  237. package/dist/cli/chunks/{ruvector-commands-5PFMNDLR.js → ruvector-commands-GBMYNJKN.js} +2 -2
  238. package/dist/cli/chunks/{rvf-dual-writer-TF6H7AXH.js → rvf-dual-writer-STUAQT6U.js} +2 -2
  239. package/dist/cli/chunks/{rvf-migration-adapter-VNGIUZCO.js → rvf-migration-adapter-LO6DBNJH.js} +2 -2
  240. package/dist/cli/chunks/{rvf-migration-coordinator-VA52YAIY.js → rvf-migration-coordinator-I5AD4VJ2.js} +2 -2
  241. package/dist/cli/chunks/rvf-native-adapter-7RXP2Q4Q.js +2 -0
  242. package/dist/cli/chunks/safe-db-MNKFEPBX.js +2 -0
  243. package/dist/cli/chunks/schedule-AJXABVXX.js +2 -0
  244. package/dist/cli/chunks/scheduler-LDWYHIAW.js +2 -0
  245. package/dist/cli/chunks/{security-62HEETBF.js → security-X3WCA5K5.js} +3 -3
  246. package/dist/cli/chunks/shared-rvf-adapter-Z4FSPWNP.js +2 -0
  247. package/dist/cli/chunks/{shared-rvf-dual-writer-JTZK7LRD.js → shared-rvf-dual-writer-QOPOIRIC.js} +2 -2
  248. package/dist/cli/chunks/sqlite-persistence-A6GKDMOJ.js +2 -0
  249. package/dist/cli/chunks/{status-handler-LSUPUKRF.js → status-handler-B2B5QBVK.js} +2 -2
  250. package/dist/cli/chunks/{structural-health-Z75A666N.js → structural-health-KT47LBVH.js} +2 -2
  251. package/dist/cli/chunks/sync-CKID22IW.js +2 -0
  252. package/dist/cli/chunks/{sync-M3O4T3A3.js → sync-VWD6OOUR.js} +2 -2
  253. package/dist/cli/chunks/{task-handler-AQBSZAQC.js → task-handler-X5JT5YBF.js} +2 -2
  254. package/dist/cli/chunks/{task-handlers-BOZP247V.js → task-handlers-IW4GQDW4.js} +3 -3
  255. package/dist/cli/chunks/{test-FTEGPNN2.js → test-MBZSUASD.js} +4 -4
  256. package/dist/cli/chunks/{test-scheduling-IGR4U2VQ.js → test-scheduling-E5KHKRZS.js} +3 -3
  257. package/dist/cli/chunks/token-bootstrap-TIDPJ5IG.js +2 -0
  258. package/dist/cli/chunks/{token-usage-VCHV47EO.js → token-usage-ECJSPOQB.js} +2 -2
  259. package/dist/cli/chunks/{transformers-M27QSNFH.js → transformers-UZJAQ7OZ.js} +2 -2
  260. package/dist/cli/chunks/{tree-sitter-wasm-parser-IIGEJYFU.js → tree-sitter-wasm-parser-H6BU2E5R.js} +2 -2
  261. package/dist/cli/chunks/{types-RQFPUUKA.js → types-PM7NT3MH.js} +2 -2
  262. package/dist/cli/chunks/unified-memory-27QJHABO.js +2 -0
  263. package/dist/cli/chunks/unified-memory-hnsw-76VUXR4H.js +2 -0
  264. package/dist/cli/chunks/unified-persistence-QRCGDEXH.js +2 -0
  265. package/dist/cli/chunks/{upgrade-VJMYX3AL.js → upgrade-FS2XYC2P.js} +2 -2
  266. package/dist/cli/chunks/{validate-ML7HUAU5.js → validate-4Y2BNN3A.js} +3 -3
  267. package/dist/cli/chunks/{validate-swarm-RCR6EYRC.js → validate-swarm-Z7QXZSUE.js} +4 -4
  268. package/dist/cli/chunks/{vibium-ZOOS3W5L.js → vibium-VZ6L3O2G.js} +2 -2
  269. package/dist/cli/chunks/visual-security-KB27O7BE.js +2 -0
  270. package/dist/cli/chunks/{web-tree-sitter-2YPGYLWK.js → web-tree-sitter-H7P37W5U.js} +2 -2
  271. package/dist/cli/chunks/{windsurf-installer-GOJWUWC5.js → windsurf-installer-IB2VHSZS.js} +2 -2
  272. package/dist/cli/chunks/{witness-chain-3MGSS3Q4.js → witness-chain-C4DISYJN.js} +2 -2
  273. package/dist/cli/chunks/witness-chain-EYPXHRDV.js +2 -0
  274. package/dist/cli/chunks/{workflow-B5Q77BI4.js → workflow-IGM7KVIO.js} +4 -4
  275. package/dist/cli/chunks/workflow-orchestrator-6AQZ3USU.js +2 -0
  276. package/dist/cli/chunks/wrappers-PQXC263L.js +2 -0
  277. package/dist/cli/commands/arena.d.ts +10 -0
  278. package/dist/cli/commands/arena.js +129 -0
  279. package/dist/cli/commands/hooks-handlers/command-hooks.js +38 -2
  280. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +4 -0
  281. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +66 -3
  282. package/dist/cli/commands/hooks-handlers/nesting-provenance.d.ts +27 -0
  283. package/dist/cli/commands/hooks-handlers/nesting-provenance.js +46 -0
  284. package/dist/cli/commands/hooks-handlers/task-hooks.js +72 -1
  285. package/dist/cli/commands/hooks-handlers/tool-loop-guardrail.d.ts +71 -0
  286. package/dist/cli/commands/hooks-handlers/tool-loop-guardrail.js +142 -0
  287. package/dist/cli/index.js +17 -0
  288. package/dist/contracts/verdicts.d.ts +297 -0
  289. package/dist/contracts/verdicts.js +178 -0
  290. package/dist/coordination/queen-types.d.ts +4 -0
  291. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +15 -6
  292. package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +12 -0
  293. package/dist/integrations/ruvector/shared-rvf-adapter.js +12 -1
  294. package/dist/integrations/ruvector/shared-rvf-dual-writer.js +6 -2
  295. package/dist/kernel/project-root.d.ts +33 -0
  296. package/dist/kernel/project-root.js +86 -0
  297. package/dist/kernel/unified-memory.d.ts +2 -19
  298. package/dist/kernel/unified-memory.js +8 -64
  299. package/dist/learning/local-judge-client.d.ts +55 -0
  300. package/dist/learning/local-judge-client.js +127 -0
  301. package/dist/learning/nagual-client.d.ts +73 -0
  302. package/dist/learning/nagual-client.js +150 -0
  303. package/dist/learning/pattern-store.js +10 -3
  304. package/dist/mcp/bundle.js +393 -391
  305. package/dist/mcp/entry.js +44 -33
  306. package/dist/mcp/handlers/core-handlers.d.ts +20 -0
  307. package/dist/mcp/handlers/core-handlers.js +28 -0
  308. package/dist/mcp/handlers/domain-handler-configs.d.ts +3 -0
  309. package/dist/mcp/handlers/domain-handler-configs.js +22 -10
  310. package/dist/mcp/transport/stdio.d.ts +7 -0
  311. package/dist/mcp/transport/stdio.js +39 -2
  312. package/dist/shared/llm/cost-tracker.js +6 -2
  313. package/dist/shared/llm/interfaces.d.ts +4 -0
  314. package/dist/shared/llm/providers/claude.js +16 -2
  315. package/dist/shared/reasoning-scrub.d.ts +29 -0
  316. package/dist/shared/reasoning-scrub.js +75 -0
  317. package/dist/workers/daemon.js +2 -0
  318. package/dist/workers/quality-daemon/git-watcher.js +2 -0
  319. package/dist/workers/quality-daemon/index.js +2 -0
  320. package/dist/workers/worker-manager.js +4 -0
  321. package/package.json +1 -1
  322. package/dist/cli/chunks/adapter-BHPUKMJ5.js +0 -2
  323. package/dist/cli/chunks/aqe-learning-engine-JQ5WD2HM.js +0 -2
  324. package/dist/cli/chunks/audit-BMQ3VESB.js +0 -3
  325. package/dist/cli/chunks/base-E32WLGY2.js +0 -2
  326. package/dist/cli/chunks/browser-workflow-LNNXXAJG.js +0 -2
  327. package/dist/cli/chunks/chunk-2EQVYYBF.js +0 -2
  328. package/dist/cli/chunks/chunk-3VF3HCG4.js +0 -2
  329. package/dist/cli/chunks/chunk-GELF4ILR.js +0 -699
  330. package/dist/cli/chunks/chunk-JOLDCS6X.js +0 -2
  331. package/dist/cli/chunks/chunk-JSFYPLMQ.js +0 -2
  332. package/dist/cli/chunks/chunk-YX2HY4MX.js +0 -2
  333. package/dist/cli/chunks/client-2UKBYFX4.js +0 -2
  334. package/dist/cli/chunks/cross-domain-router-FPM3L27L.js +0 -2
  335. package/dist/cli/chunks/daemon-YWINEHG4.js +0 -10
  336. package/dist/cli/chunks/dream-XM33US3V.js +0 -2
  337. package/dist/cli/chunks/heartbeat-scheduler-GM3M2MTG.js +0 -2
  338. package/dist/cli/chunks/hnsw-adapter-K62GEHIL.js +0 -2
  339. package/dist/cli/chunks/hnsw-index-VCAK3TWN.js +0 -2
  340. package/dist/cli/chunks/hooks-6Y3UHYI2.js +0 -248
  341. package/dist/cli/chunks/hybrid-router-432QNCNG.js +0 -2
  342. package/dist/cli/chunks/impact-analyzer-VTSISNN4.js +0 -2
  343. package/dist/cli/chunks/init-wizard-COB5AH7Q.js +0 -2
  344. package/dist/cli/chunks/kernel-ROK7X5FM.js +0 -2
  345. package/dist/cli/chunks/knowledge-graph-YUWIDIWW.js +0 -2
  346. package/dist/cli/chunks/llm-router-service-7VLXJ7VE.js +0 -2
  347. package/dist/cli/chunks/load-test-32524DL3.js +0 -2
  348. package/dist/cli/chunks/memory-backend-BI2V5AAB.js +0 -2
  349. package/dist/cli/chunks/memory-handlers-NSOFWVFN.js +0 -2
  350. package/dist/cli/chunks/protocol-executor-2UPB7SPI.js +0 -2
  351. package/dist/cli/chunks/provider-manager-PDT37MIJ.js +0 -2
  352. package/dist/cli/chunks/qe-reasoning-bank-AQQ2BI4V.js +0 -2
  353. package/dist/cli/chunks/queen-coordinator-6DVDVEU4.js +0 -2
  354. package/dist/cli/chunks/router-O2G4KQ6L.js +0 -2
  355. package/dist/cli/chunks/routing-feedback-TAGTD3KQ.js +0 -2
  356. package/dist/cli/chunks/rvf-native-adapter-46GRWQJR.js +0 -2
  357. package/dist/cli/chunks/safe-db-LNIPXXHH.js +0 -2
  358. package/dist/cli/chunks/schedule-AUH3ZALY.js +0 -2
  359. package/dist/cli/chunks/scheduler-KK3OYPWW.js +0 -2
  360. package/dist/cli/chunks/shared-rvf-adapter-XWTQPGCT.js +0 -2
  361. package/dist/cli/chunks/sqlite-persistence-CYESP7NG.js +0 -2
  362. package/dist/cli/chunks/sync-VI37UHHH.js +0 -2
  363. package/dist/cli/chunks/token-bootstrap-2DFRVMBM.js +0 -2
  364. package/dist/cli/chunks/unified-memory-RISHEANP.js +0 -2
  365. package/dist/cli/chunks/unified-memory-hnsw-2IKXGMNZ.js +0 -2
  366. package/dist/cli/chunks/unified-persistence-ZTTUJNTU.js +0 -2
  367. package/dist/cli/chunks/visual-security-D66DTAO5.js +0 -2
  368. package/dist/cli/chunks/witness-chain-RHWHHDLV.js +0 -2
  369. package/dist/cli/chunks/workflow-orchestrator-OQMFW2TC.js +0 -2
  370. package/dist/cli/chunks/wrappers-MM5VLEPG.js +0 -2
@@ -0,0 +1,46 @@
1
+ /**
2
+ * Agentic QE v3 - Nested-Subagent Provenance Validation (ADR-101)
3
+ *
4
+ * Parses and validates the `--parent-agent-id` / `--depth` flags on
5
+ * `aqe hooks post-task`. Anthropic announced nested subagent support
6
+ * (depth=5) on 2026-06-09; recording which agent spawned a task and at
7
+ * what depth lets ReasoningBank segment patterns per hierarchy level —
8
+ * useful today for flat depth-1 spawns, and ready for deep chains the
9
+ * day the upstream `Task` denylist lifts.
10
+ */
11
+ /** Agent identifiers: alphanum start, then alphanum / _ . : - , max 128 chars */
12
+ const AGENT_ID_RE = /^[A-Za-z0-9][A-Za-z0-9_.:-]{0,127}$/;
13
+ /** Defensive bound — well above Anthropic's announced depth=5 cap */
14
+ export const MAX_NESTING_DEPTH = 32;
15
+ /**
16
+ * Validate raw flag values. Both flags are optional and independent;
17
+ * depth=0 is a valid value (top-level) and must survive as 0, not be
18
+ * coerced to undefined.
19
+ */
20
+ export function parseNestingProvenance(parentAgentIdRaw, depthRaw) {
21
+ const result = {};
22
+ if (parentAgentIdRaw !== undefined) {
23
+ if (!AGENT_ID_RE.test(parentAgentIdRaw)) {
24
+ return {
25
+ error: `Invalid --parent-agent-id "${parentAgentIdRaw}": must start with a letter or digit ` +
26
+ `and contain only letters, digits, "_", ".", ":", "-" (max 128 chars)`,
27
+ };
28
+ }
29
+ result.parentAgentId = parentAgentIdRaw;
30
+ }
31
+ if (depthRaw !== undefined) {
32
+ const depth = typeof depthRaw === 'number' ? depthRaw : Number(depthRaw);
33
+ if (!Number.isInteger(depth)) {
34
+ return { error: `Invalid --depth "${depthRaw}": must be an integer` };
35
+ }
36
+ if (depth < 0) {
37
+ return { error: `Invalid --depth ${depth}: must be >= 0` };
38
+ }
39
+ if (depth > MAX_NESTING_DEPTH) {
40
+ return { error: `Invalid --depth ${depth}: must be <= ${MAX_NESTING_DEPTH}` };
41
+ }
42
+ result.depth = depth;
43
+ }
44
+ return result;
45
+ }
46
+ //# sourceMappingURL=nesting-provenance.js.map
@@ -9,10 +9,12 @@ import chalk from 'chalk';
9
9
  import path from 'node:path';
10
10
  import { QE_HOOK_EVENTS } from '../../../learning/qe-hooks.js';
11
11
  import { findProjectRoot, getUnifiedMemory } from '../../../kernel/unified-memory.js';
12
+ import { getNagualClient } from '../../../learning/nagual-client.js';
12
13
  import { applyHookBusyTimeout, getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, persistTaskOutcome, updateHookRouterQValue, updateRoutingOutcomeQuality, printJson, printSuccess, } from './hooks-shared.js';
13
14
  import { ensureRoutingOutcomesAdr095Columns } from '../../../routing/routing-outcomes-migration.js';
14
15
  import { deriveTaskType } from '../../../learning/agent-routing.js';
15
16
  import { detectQEDomains } from '../../../learning/qe-patterns.js';
17
+ import { parseNestingProvenance } from './nesting-provenance.js';
16
18
  // ============================================================================
17
19
  // Constants — task-bridge / routing-quality / q-learning
18
20
  // ============================================================================
@@ -32,6 +34,36 @@ const LOW_CONFIDENCE_THRESHOLD = 0.5;
32
34
  function hashDescription(description) {
33
35
  return createHash('sha256').update(description).digest('hex').slice(0, 16);
34
36
  }
37
+ /**
38
+ * QE domains where nagual patterns add meaningful context.
39
+ * Skipped for trivial/short tasks to avoid latency with no benefit.
40
+ */
41
+ const NAGUAL_SEARCH_DOMAINS = new Set([
42
+ 'test-generation',
43
+ 'coverage-analysis',
44
+ 'defect-intelligence',
45
+ 'security-compliance',
46
+ 'quality-assessment',
47
+ 'requirements-validation',
48
+ ]);
49
+ const NAGUAL_SEARCH_MIN_DESCRIPTION_LENGTH = 80;
50
+ /**
51
+ * Search nagual for relevant patterns when the task is complex enough to benefit.
52
+ * Returns empty array silently on any failure — always best-effort.
53
+ */
54
+ async function fetchNagualContext(description, domain) {
55
+ if (!process.env['NAGUAL_URL'] && !process.env['NAGUAL_CLOUD_URL'] && !process.env['NAGUAL_CLOUD_KEY']) {
56
+ return [];
57
+ }
58
+ if (description.length < NAGUAL_SEARCH_MIN_DESCRIPTION_LENGTH) {
59
+ return [];
60
+ }
61
+ if (domain && !NAGUAL_SEARCH_DOMAINS.has(domain)) {
62
+ return [];
63
+ }
64
+ const client = getNagualClient();
65
+ return client.search(description.slice(0, 300), domain, 3);
66
+ }
35
67
  /**
36
68
  * Register pre-task and post-task subcommands on the hooks command.
37
69
  */
@@ -63,6 +95,11 @@ export function registerTaskHooks(hooks) {
63
95
  .slice(0, 5)
64
96
  .map((p) => p?.id)
65
97
  .filter((id) => typeof id === 'string');
98
+ // Nagual context: search cross-project knowledge hub for complex tasks
99
+ const nagualDomain = routing?.domains?.[0];
100
+ const nagualPatterns = options.description
101
+ ? await fetchNagualContext(String(options.description), nagualDomain)
102
+ : [];
66
103
  // Patches 090/100/160/300/320: signals derived from memory.db.
67
104
  // All best-effort: failures fall through to empty/default values.
68
105
  let historicalBest = null;
@@ -228,6 +265,14 @@ export function registerTaskHooks(hooks) {
228
265
  lowConfidence,
229
266
  // Bridge identifier so post-task can correlate (debug aid)
230
267
  bridgeKey,
268
+ // Nagual cross-project context
269
+ nagualPatterns: nagualPatterns.map((p) => ({
270
+ id: p.id,
271
+ problem: p.problem,
272
+ solution: p.solution.slice(0, 400),
273
+ domain: p.domain,
274
+ reward: p.reward,
275
+ })),
231
276
  });
232
277
  }
233
278
  else {
@@ -240,6 +285,12 @@ export function registerTaskHooks(hooks) {
240
285
  console.log(chalk.yellow(' ⚠ Low confidence — consider providing more context'));
241
286
  }
242
287
  }
288
+ if (nagualPatterns.length > 0) {
289
+ console.log(chalk.bold('\n📚 Nagual context (cross-project):'));
290
+ for (const p of nagualPatterns) {
291
+ console.log(chalk.dim(` [${p.domain}] ${p.problem.slice(0, 80)} (reward: ${p.reward.toFixed(2)})`));
292
+ }
293
+ }
243
294
  }
244
295
  return;
245
296
  }
@@ -261,10 +312,24 @@ export function registerTaskHooks(hooks) {
261
312
  .option('--agent <name>', 'Agent that executed the task')
262
313
  .option('--duration <ms>', 'Task duration in milliseconds')
263
314
  .option('-d, --description <desc>', 'Task description — fallback Q-state source when pre-task bridge is absent (issue #499)')
315
+ .option('--parent-agent-id <id>', 'Agent that spawned this task (ADR-101 nesting provenance)')
316
+ .option('--depth <n>', 'Nesting depth of this task, 0 = top-level (ADR-101)')
264
317
  .option('--json', 'Output as JSON')
265
318
  .action(async (options) => {
266
319
  try {
267
320
  const success = options.success === 'true' || options.success === true;
321
+ // ADR-101: validate nesting provenance before any persistence
322
+ const provenance = parseNestingProvenance(options.parentAgentId, options.depth);
323
+ if (provenance.error) {
324
+ if (options.json) {
325
+ console.log(JSON.stringify({ success: false, error: provenance.error }));
326
+ }
327
+ else {
328
+ console.error(chalk.red(` ✗ ${provenance.error}`));
329
+ }
330
+ process.exitCode = 1;
331
+ return;
332
+ }
268
333
  // Initialize hooks system and record learning outcome
269
334
  // BUG FIX: Must call getHooksSystem() FIRST to initialize, not check state.initialized
270
335
  let patternsLearned = 0;
@@ -294,11 +359,15 @@ export function registerTaskHooks(hooks) {
294
359
  const effectiveTaskId = options.taskId || `hook-${Date.now()}`;
295
360
  const agent = options.agent || 'unknown';
296
361
  const durationMs = options.duration ? parseInt(options.duration, 10) : 0;
362
+ // ADR-101: provenance rides in the feedback string so the
363
+ // learning loop can segment patterns per hierarchy level
364
+ const provenanceSuffix = (provenance.parentAgentId ? `, Parent: ${provenance.parentAgentId}` : '') +
365
+ (provenance.depth !== undefined ? `, Depth: ${provenance.depth}` : '');
297
366
  await reasoningBank.recordOutcome({
298
367
  patternId: `task:${agent}:${effectiveTaskId}`,
299
368
  success,
300
369
  metrics: { executionTimeMs: durationMs },
301
- feedback: `Agent: ${agent}, Task: ${effectiveTaskId}`,
370
+ feedback: `Agent: ${agent}, Task: ${effectiveTaskId}${provenanceSuffix}`,
302
371
  });
303
372
  // Stream B: full experience pipeline (captured_experiences,
304
373
  // experience_applications + per-pattern fan-out, qe_trajectories
@@ -309,6 +378,8 @@ export function registerTaskHooks(hooks) {
309
378
  agent,
310
379
  durationMs,
311
380
  success,
381
+ parentAgentId: provenance.parentAgentId,
382
+ depth: provenance.depth,
312
383
  });
313
384
  // Issue #460: when --agent arrives empty (Claude Code does not
314
385
  // expose $TOOL_RESULT_agent_id in PostToolUse context), `agent`
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Agentic QE v3 - Tool-Loop Circuit Breaker (ADR-100)
3
+ *
4
+ * Detects consecutive failures of the same Bash command across hook
5
+ * invocations and breaks runaway retry loops: WARN at 3, BLOCK at 5.
6
+ * Advisory by default (the block is a strongly-worded recommendation in
7
+ * the hook output); `AQE_STRICT_TOOL_LOOP=1` upgrades the block to a
8
+ * PreToolUse deny.
9
+ *
10
+ * Mirrors the closed → open → half-open semantics of
11
+ * `src/coordination/circuit-breaker/domain-circuit-breaker.ts` (ADR-064),
12
+ * but persists state in a small JSON sidecar instead of process memory:
13
+ * every hook call is a fresh CLI process, so in-process state cannot see
14
+ * the previous invocation, and opening memory.db from pre-command would
15
+ * add DB-init latency to every Bash command. The sidecar is ephemeral
16
+ * guardrail state — safe to delete at any time, not a data store.
17
+ */
18
+ export type ToolLoopVerdict = 'allow' | 'warn' | 'block';
19
+ export interface ToolLoopCheck {
20
+ verdict: ToolLoopVerdict;
21
+ consecutiveFailures: number;
22
+ /** True when an open breaker is being given a probe attempt (half-open) */
23
+ halfOpen: boolean;
24
+ /** Human-readable guidance for warn/block verdicts */
25
+ hint?: string;
26
+ }
27
+ export interface ToolLoopGuardrailOptions {
28
+ /** Path of the JSON state sidecar */
29
+ statePath: string;
30
+ /** Consecutive failures before warning (default 3) */
31
+ warnThreshold?: number;
32
+ /** Consecutive failures before blocking (default 5) */
33
+ blockThreshold?: number;
34
+ /** An open breaker allows one probe attempt after this long (default 2 min) */
35
+ halfOpenAfterMs?: number;
36
+ /** Entries idle longer than this are pruned (default 30 min) */
37
+ staleAfterMs?: number;
38
+ }
39
+ export declare class ToolLoopGuardrail {
40
+ private readonly statePath;
41
+ private readonly warnThreshold;
42
+ private readonly blockThreshold;
43
+ private readonly halfOpenAfterMs;
44
+ private readonly staleAfterMs;
45
+ constructor(options: ToolLoopGuardrailOptions);
46
+ /**
47
+ * Normalize a command into a breaker key: whitespace-collapsed and
48
+ * length-capped so cosmetic differences don't split the failure count.
49
+ */
50
+ static signature(command: string): string;
51
+ /**
52
+ * Consult the breaker before a command runs (pre-command hook).
53
+ * Fail-open: any state-read problem yields 'allow'.
54
+ */
55
+ check(command: string, now?: number): ToolLoopCheck;
56
+ /**
57
+ * Record a command outcome (post-command hook). Success resets the
58
+ * breaker for that command; failure increments it. Fail-open on errors.
59
+ */
60
+ record(command: string, success: boolean, now?: number): void;
61
+ /** Whether strict mode upgrades the advisory block to a hook deny. */
62
+ static isStrict(env?: NodeJS.ProcessEnv): boolean;
63
+ private readState;
64
+ private writeState;
65
+ }
66
+ /**
67
+ * Guardrail bound to the project's `.agentic-qe/` directory — the shared
68
+ * instance used by the pre-command/post-command hooks.
69
+ */
70
+ export declare function createProjectToolLoopGuardrail(projectRoot: string): ToolLoopGuardrail;
71
+ //# sourceMappingURL=tool-loop-guardrail.d.ts.map
@@ -0,0 +1,142 @@
1
+ /**
2
+ * Agentic QE v3 - Tool-Loop Circuit Breaker (ADR-100)
3
+ *
4
+ * Detects consecutive failures of the same Bash command across hook
5
+ * invocations and breaks runaway retry loops: WARN at 3, BLOCK at 5.
6
+ * Advisory by default (the block is a strongly-worded recommendation in
7
+ * the hook output); `AQE_STRICT_TOOL_LOOP=1` upgrades the block to a
8
+ * PreToolUse deny.
9
+ *
10
+ * Mirrors the closed → open → half-open semantics of
11
+ * `src/coordination/circuit-breaker/domain-circuit-breaker.ts` (ADR-064),
12
+ * but persists state in a small JSON sidecar instead of process memory:
13
+ * every hook call is a fresh CLI process, so in-process state cannot see
14
+ * the previous invocation, and opening memory.db from pre-command would
15
+ * add DB-init latency to every Bash command. The sidecar is ephemeral
16
+ * guardrail state — safe to delete at any time, not a data store.
17
+ */
18
+ import * as fs from 'fs';
19
+ import * as path from 'path';
20
+ export class ToolLoopGuardrail {
21
+ statePath;
22
+ warnThreshold;
23
+ blockThreshold;
24
+ halfOpenAfterMs;
25
+ staleAfterMs;
26
+ constructor(options) {
27
+ this.statePath = options.statePath;
28
+ this.warnThreshold = options.warnThreshold ?? 3;
29
+ this.blockThreshold = options.blockThreshold ?? 5;
30
+ this.halfOpenAfterMs = options.halfOpenAfterMs ?? 120_000;
31
+ this.staleAfterMs = options.staleAfterMs ?? 30 * 60_000;
32
+ }
33
+ /**
34
+ * Normalize a command into a breaker key: whitespace-collapsed and
35
+ * length-capped so cosmetic differences don't split the failure count.
36
+ */
37
+ static signature(command) {
38
+ return command.trim().replace(/\s+/g, ' ').slice(0, 200);
39
+ }
40
+ /**
41
+ * Consult the breaker before a command runs (pre-command hook).
42
+ * Fail-open: any state-read problem yields 'allow'.
43
+ */
44
+ check(command, now = Date.now()) {
45
+ const sig = ToolLoopGuardrail.signature(command);
46
+ if (!sig) {
47
+ return { verdict: 'allow', consecutiveFailures: 0, halfOpen: false };
48
+ }
49
+ const entry = this.readState()[sig];
50
+ if (!entry || entry.consecutiveFailures < this.warnThreshold) {
51
+ return { verdict: 'allow', consecutiveFailures: entry?.consecutiveFailures ?? 0, halfOpen: false };
52
+ }
53
+ const failures = entry.consecutiveFailures;
54
+ if (failures >= this.blockThreshold) {
55
+ // Open breaker: allow a single probe once the half-open window elapses
56
+ if (now - entry.lastFailureAt >= this.halfOpenAfterMs) {
57
+ return {
58
+ verdict: 'warn',
59
+ consecutiveFailures: failures,
60
+ halfOpen: true,
61
+ hint: `This command has failed ${failures}x consecutively; allowing one probe attempt. ` +
62
+ `If it fails again it will be flagged immediately.`,
63
+ };
64
+ }
65
+ return {
66
+ verdict: 'block',
67
+ consecutiveFailures: failures,
68
+ halfOpen: false,
69
+ hint: `The same command failed ${failures}x consecutively. Re-running it unchanged is ` +
70
+ `unlikely to succeed — inspect the error output, change the approach, or fix the ` +
71
+ `underlying problem first. (A successful run resets this breaker.)`,
72
+ };
73
+ }
74
+ return {
75
+ verdict: 'warn',
76
+ consecutiveFailures: failures,
77
+ halfOpen: false,
78
+ hint: `This command has failed ${failures}x consecutively — consider changing approach before retrying.`,
79
+ };
80
+ }
81
+ /**
82
+ * Record a command outcome (post-command hook). Success resets the
83
+ * breaker for that command; failure increments it. Fail-open on errors.
84
+ */
85
+ record(command, success, now = Date.now()) {
86
+ const sig = ToolLoopGuardrail.signature(command);
87
+ if (!sig)
88
+ return;
89
+ try {
90
+ const state = this.readState();
91
+ if (success) {
92
+ if (state[sig]) {
93
+ delete state[sig];
94
+ this.writeState(state, now);
95
+ }
96
+ return;
97
+ }
98
+ const entry = state[sig] ?? { consecutiveFailures: 0, lastFailureAt: now };
99
+ entry.consecutiveFailures += 1;
100
+ entry.lastFailureAt = now;
101
+ state[sig] = entry;
102
+ this.writeState(state, now);
103
+ }
104
+ catch {
105
+ /* fail-open: guardrail must never break the hook */
106
+ }
107
+ }
108
+ /** Whether strict mode upgrades the advisory block to a hook deny. */
109
+ static isStrict(env = process.env) {
110
+ return env.AQE_STRICT_TOOL_LOOP === '1' || env.AQE_STRICT_TOOL_LOOP === 'true';
111
+ }
112
+ readState() {
113
+ try {
114
+ const raw = fs.readFileSync(this.statePath, 'utf8');
115
+ const parsed = JSON.parse(raw);
116
+ return typeof parsed === 'object' && parsed !== null ? parsed : {};
117
+ }
118
+ catch {
119
+ return {}; // missing or corrupt sidecar → clean slate
120
+ }
121
+ }
122
+ writeState(state, now) {
123
+ // Prune stale entries so the sidecar stays small
124
+ for (const [key, entry] of Object.entries(state)) {
125
+ if (now - entry.lastFailureAt > this.staleAfterMs) {
126
+ delete state[key];
127
+ }
128
+ }
129
+ fs.mkdirSync(path.dirname(this.statePath), { recursive: true });
130
+ fs.writeFileSync(this.statePath, JSON.stringify(state));
131
+ }
132
+ }
133
+ /**
134
+ * Guardrail bound to the project's `.agentic-qe/` directory — the shared
135
+ * instance used by the pre-command/post-command hooks.
136
+ */
137
+ export function createProjectToolLoopGuardrail(projectRoot) {
138
+ return new ToolLoopGuardrail({
139
+ statePath: path.join(projectRoot, '.agentic-qe', 'tool-loop-state.json'),
140
+ });
141
+ }
142
+ //# sourceMappingURL=tool-loop-guardrail.js.map
package/dist/cli/index.js CHANGED
@@ -120,6 +120,18 @@ async function autoInitialize() {
120
120
  context.persistentScheduler = createPersistentScheduler();
121
121
  context.queen = createQueenCoordinator(context.kernel, context.router, protocolExecutor, undefined);
122
122
  await context.queen.initialize();
123
+ // Bridge the CLI-initialized components into the MCP handlers' fleet state.
124
+ // The memory/agent/task/team/pipeline handlers are shared between the MCP
125
+ // server and the CLI and are guarded by isFleetInitialized(); without this
126
+ // bridge every CLI invocation failed with "Fleet not initialized" even
127
+ // after a successful auto-init (MCP-CLI parity).
128
+ const { adoptExternalFleet } = await import('../mcp/handlers/core-handlers.js');
129
+ adoptExternalFleet({
130
+ kernel: context.kernel,
131
+ queen: context.queen,
132
+ router: context.router,
133
+ workflowOrchestrator: context.workflowOrchestrator,
134
+ });
123
135
  context.initialized = true;
124
136
  }
125
137
  async function ensureInitializedStrict() {
@@ -241,6 +253,11 @@ registerLazyCommand(program, {
241
253
  description: 'Security scanning and URL validation',
242
254
  factory: () => import('./commands/security.js').then(m => m.createSecurityCommand(context, cleanupAndExit, ensureInitialized)),
243
255
  });
256
+ registerLazyCommand(program, {
257
+ name: 'arena',
258
+ description: 'Competitive test-strategy tournaments (ADR-104)',
259
+ factory: () => import('./commands/arena.js').then(m => m.createArenaCommand(context, cleanupAndExit, ensureInitialized)),
260
+ });
244
261
  registerLazyCommand(program, {
245
262
  name: 'code',
246
263
  description: 'Code intelligence analysis',