agentic-qe 3.9.16 → 3.9.18

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 (298) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +34 -0
  3. package/README.md +65 -0
  4. package/assets/skills/skills-manifest.json +1 -1
  5. package/dist/cli/bundle.js +5 -5
  6. package/dist/cli/chunks/adapter-C7AKAAPC.js +2 -0
  7. package/dist/cli/chunks/{agent-booster-wasm-IECTFMRK.js → agent-booster-wasm-RJHBIG5V.js} +2 -2
  8. package/dist/cli/chunks/{agent-handler-HLLTKZ5G.js → agent-handler-CXS6EE2V.js} +2 -2
  9. package/dist/cli/chunks/{agent-memory-branch-WJUD3DS4.js → agent-memory-branch-7NV5DD5A.js} +2 -2
  10. package/dist/cli/chunks/aqe-learning-engine-7P3AXQNO.js +2 -0
  11. package/dist/cli/chunks/{audit-3DLZNWHO.js → audit-3NWGSPJW.js} +2 -2
  12. package/dist/cli/chunks/base-GIDVLEPA.js +2 -0
  13. package/dist/cli/chunks/{better-sqlite3-Q356NEQ6.js → better-sqlite3-NXOMSJDC.js} +2 -2
  14. package/dist/cli/chunks/{brain-handler-MX2HP7LO.js → brain-handler-6N5WWZVA.js} +3 -3
  15. package/dist/cli/chunks/{branch-enumerator-Z3TF3HVO.js → branch-enumerator-I7UTOCAW.js} +2 -2
  16. package/dist/cli/chunks/{browser-Z6PQ7FTO.js → browser-6VOFWA52.js} +2 -2
  17. package/dist/cli/chunks/browser-workflow-DAUS4Z5V.js +2 -0
  18. package/dist/cli/chunks/{chunk-2MJEAEOW.js → chunk-27MW2RFA.js} +2 -2
  19. package/dist/cli/chunks/{chunk-GP7IXB3E.js → chunk-2A4JCRAW.js} +2 -2
  20. package/dist/cli/chunks/{chunk-G5DMEEQQ.js → chunk-3DLD7OMF.js} +1 -1
  21. package/dist/cli/chunks/{chunk-TPRYLARW.js → chunk-3GA7M5NK.js} +2 -2
  22. package/dist/cli/chunks/{chunk-46K7ALFU.js → chunk-4666TC3P.js} +2 -2
  23. package/dist/cli/chunks/{chunk-LSA4XGSE.js → chunk-4BIWQLD3.js} +2 -2
  24. package/dist/cli/chunks/{chunk-HVAW64YW.js → chunk-4ELLGWTS.js} +2 -2
  25. package/dist/cli/chunks/{chunk-HFGCLV56.js → chunk-4U2JKV44.js} +1 -1
  26. package/dist/cli/chunks/chunk-4XYQJ4LQ.js +2 -0
  27. package/dist/cli/chunks/{chunk-WSKASZYC.js → chunk-54TOOHER.js} +2 -2
  28. package/dist/cli/chunks/{chunk-7NMLIJHL.js → chunk-5ROA7KOT.js} +1 -1
  29. package/dist/cli/chunks/{chunk-SMNOZEM7.js → chunk-5SZLQCFP.js} +2 -2
  30. package/dist/cli/chunks/{chunk-3ZGYB23S.js → chunk-6BGSH2YR.js} +1 -1
  31. package/dist/cli/chunks/{chunk-N5ZTPAX7.js → chunk-6G3RNT5H.js} +2 -2
  32. package/dist/cli/chunks/{chunk-MTF6ABUH.js → chunk-6IBFYVLK.js} +2 -2
  33. package/dist/cli/chunks/{chunk-KR7S4IZZ.js → chunk-6KTF7QB3.js} +2 -2
  34. package/dist/cli/chunks/{chunk-ZCE6JNRI.js → chunk-6QSB4XOL.js} +2 -2
  35. package/dist/cli/chunks/{chunk-4PFHQH4B.js → chunk-6ZMQL3U6.js} +2 -2
  36. package/dist/cli/chunks/{chunk-UT4CXF6C.js → chunk-7GGSUXVM.js} +2 -2
  37. package/dist/cli/chunks/{chunk-XQ6WIPDC.js → chunk-7OGUAZGJ.js} +1 -1
  38. package/dist/cli/chunks/{chunk-OP7X434R.js → chunk-7XLTLFP5.js} +2 -2
  39. package/dist/cli/chunks/{chunk-7DP2IQ6F.js → chunk-7ZIKFJ6X.js} +2 -2
  40. package/dist/cli/chunks/{chunk-TUPFBZKO.js → chunk-A26GU6YU.js} +1 -1
  41. package/dist/cli/chunks/{chunk-TWEBJWJI.js → chunk-AGPZVE6B.js} +2 -2
  42. package/dist/cli/chunks/{chunk-7MF6LVLH.js → chunk-AMRUZ6XG.js} +2 -2
  43. package/dist/cli/chunks/{chunk-FLWIEPAT.js → chunk-AZGESIFV.js} +1 -1
  44. package/dist/cli/chunks/{chunk-FKQV52TC.js → chunk-B6BAK2JI.js} +2 -2
  45. package/dist/cli/chunks/{chunk-CR7LLS26.js → chunk-BADBKGZE.js} +2 -2
  46. package/dist/cli/chunks/{chunk-WVHH3OQ4.js → chunk-BFM47L3X.js} +2 -2
  47. package/dist/cli/chunks/{chunk-MQHP65QB.js → chunk-BGSYFAEJ.js} +3 -3
  48. package/dist/cli/chunks/{chunk-JCQ5PXVM.js → chunk-BRWWIY6O.js} +2 -2
  49. package/dist/cli/chunks/{chunk-LWG7LKOK.js → chunk-BSQTOKNR.js} +1 -1
  50. package/dist/cli/chunks/{chunk-HON4X4Z3.js → chunk-BXTHB2A2.js} +2 -2
  51. package/dist/cli/chunks/{chunk-XAULPLOC.js → chunk-BY44ODHD.js} +4 -4
  52. package/dist/cli/chunks/{chunk-7IF4LRX2.js → chunk-CCM7MBLA.js} +2 -2
  53. package/dist/cli/chunks/{chunk-TFBEX7ED.js → chunk-CSYQKVZY.js} +1 -1
  54. package/dist/cli/chunks/{chunk-RVQXMMRO.js → chunk-D7SS56EG.js} +2 -2
  55. package/dist/cli/chunks/{chunk-NLU4XJBN.js → chunk-DC3PADV3.js} +1 -1
  56. package/dist/cli/chunks/{chunk-QEKZA2NJ.js → chunk-DCB2VUYM.js} +1 -1
  57. package/dist/cli/chunks/{chunk-HJUC2DE6.js → chunk-DOSDUAVZ.js} +2 -2
  58. package/dist/cli/chunks/{chunk-T36IXY5W.js → chunk-DQCWNCOT.js} +2 -2
  59. package/dist/cli/chunks/{chunk-FQTUUZVK.js → chunk-EN2A2CVT.js} +1 -1
  60. package/dist/cli/chunks/{chunk-IUQ6HE2J.js → chunk-ENYQUSSK.js} +2 -2
  61. package/dist/cli/chunks/{chunk-HN6GVQ4Q.js → chunk-EZN7QMOZ.js} +4 -4
  62. package/dist/cli/chunks/{chunk-VOAECU7B.js → chunk-F7XU7KZL.js} +2 -2
  63. package/dist/cli/chunks/{chunk-BEE5KXQT.js → chunk-FDDB7QTM.js} +1 -1
  64. package/dist/cli/chunks/{chunk-NOJVROCD.js → chunk-FKNYOKIK.js} +1 -1
  65. package/dist/cli/chunks/{chunk-W6TMZY5R.js → chunk-FTIHPDWV.js} +2 -2
  66. package/dist/cli/chunks/{chunk-NCXXXZGL.js → chunk-G2H4W7NN.js} +1 -1
  67. package/dist/cli/chunks/{chunk-666L7MC2.js → chunk-H5JZZH2C.js} +2 -2
  68. package/dist/cli/chunks/{chunk-H3JEGAFC.js → chunk-HLXPD4Y2.js} +39 -38
  69. package/dist/cli/chunks/{chunk-JZOMOYHZ.js → chunk-HZKY5KPB.js} +1 -1
  70. package/dist/cli/chunks/{chunk-3K4IX7L4.js → chunk-I3POPZT5.js} +2 -2
  71. package/dist/cli/chunks/{chunk-J2ERTUDX.js → chunk-IJPTWPXG.js} +1 -1
  72. package/dist/cli/chunks/{chunk-3CAPNE2H.js → chunk-IS2PMHB5.js} +2 -2
  73. package/dist/cli/chunks/{chunk-3SLFWPRE.js → chunk-J7BG55VG.js} +3 -3
  74. package/dist/cli/chunks/{chunk-NIXMFJJC.js → chunk-JBW2A2O6.js} +2 -2
  75. package/dist/cli/chunks/{chunk-7JFSMXIA.js → chunk-JD6KE6DJ.js} +2 -2
  76. package/dist/cli/chunks/{chunk-PNZADZSI.js → chunk-JGNVI5UB.js} +3 -3
  77. package/dist/cli/chunks/{chunk-KLVS6FT2.js → chunk-JMK5OCWL.js} +2 -2
  78. package/dist/cli/chunks/{chunk-JUKCBZCZ.js → chunk-JZG23IPV.js} +1 -1
  79. package/dist/cli/chunks/{chunk-BCT26J7X.js → chunk-JZTB35EQ.js} +1 -1
  80. package/dist/cli/chunks/{chunk-6XKZ62O7.js → chunk-K5NFP7B5.js} +2 -2
  81. package/dist/cli/chunks/{chunk-7PHYOV2X.js → chunk-KFITGSW3.js} +2 -2
  82. package/dist/cli/chunks/{chunk-LJINNQNN.js → chunk-KMHGQD76.js} +2 -2
  83. package/dist/cli/chunks/{chunk-4ZN4GM7W.js → chunk-KV6PIOHN.js} +1 -1
  84. package/dist/cli/chunks/{chunk-LVA53A5R.js → chunk-KYLE6ZSC.js} +4 -4
  85. package/dist/cli/chunks/chunk-LVABI4OA.js +2 -0
  86. package/dist/cli/chunks/{chunk-T7VIUEKI.js → chunk-MBGWDELE.js} +2 -2
  87. package/dist/cli/chunks/{chunk-MFRC267A.js → chunk-MDCTQOUJ.js} +1 -1
  88. package/dist/cli/chunks/chunk-MJ7UYPGY.js +15 -0
  89. package/dist/cli/chunks/{chunk-LVK2PDUW.js → chunk-MLVVYUFS.js} +1 -1
  90. package/dist/cli/chunks/{chunk-ZCZJYM42.js → chunk-NBQW7MXF.js} +1 -1
  91. package/dist/cli/chunks/{chunk-VK2GKQYI.js → chunk-NKOLFLXF.js} +2 -2
  92. package/dist/cli/chunks/{chunk-WVFLNGOK.js → chunk-ODGACHEZ.js} +2 -2
  93. package/dist/cli/chunks/{chunk-6V5P2VMQ.js → chunk-OXL6JSVR.js} +45 -44
  94. package/dist/cli/chunks/{chunk-5E7FVOOG.js → chunk-P6HIDCTQ.js} +1 -1
  95. package/dist/cli/chunks/{chunk-3H657FNU.js → chunk-PM77Z4PR.js} +2 -2
  96. package/dist/cli/chunks/{chunk-77OVXVN2.js → chunk-QGSELG75.js} +2 -2
  97. package/dist/cli/chunks/{chunk-PQLT3X6X.js → chunk-QTNDHCZ7.js} +3 -3
  98. package/dist/cli/chunks/{chunk-3EUA73H6.js → chunk-QTUTQLOY.js} +2 -2
  99. package/dist/cli/chunks/{chunk-AFLQFUXA.js → chunk-QW2RFI73.js} +2 -2
  100. package/dist/cli/chunks/{chunk-RYCAVZSD.js → chunk-R3U3ARVJ.js} +2 -2
  101. package/dist/cli/chunks/{chunk-7V2Z3PUJ.js → chunk-RGLCMGNZ.js} +2 -2
  102. package/dist/cli/chunks/{chunk-2KCMS4UW.js → chunk-RHYGRUNU.js} +3 -3
  103. package/dist/cli/chunks/{chunk-DF3DZP7H.js → chunk-RI3NTZ2I.js} +2 -2
  104. package/dist/cli/chunks/{chunk-H4BZJVKU.js → chunk-RPT7HCMH.js} +2 -2
  105. package/dist/cli/chunks/{chunk-P4IYRPCB.js → chunk-S2XBAOXE.js} +1 -1
  106. package/dist/cli/chunks/{chunk-PPUEXTH2.js → chunk-SQHM6WUF.js} +3 -3
  107. package/dist/cli/chunks/{chunk-GB6D3SSY.js → chunk-TFUWIKGZ.js} +2 -2
  108. package/dist/cli/chunks/{chunk-EFTK4ZVP.js → chunk-TPL3CBMS.js} +1 -1
  109. package/dist/cli/chunks/{chunk-RFLSJ7OL.js → chunk-UFGFV4BO.js} +2 -2
  110. package/dist/cli/chunks/{chunk-V2ELGHLG.js → chunk-UNPTSPAO.js} +2 -2
  111. package/dist/cli/chunks/{chunk-FEQ5RDQL.js → chunk-UPP5V7Y3.js} +2 -2
  112. package/dist/cli/chunks/{chunk-ZXLF3IKT.js → chunk-V2N7KWT7.js} +1 -1
  113. package/dist/cli/chunks/{chunk-4CFQZHUC.js → chunk-VRHKEJR6.js} +3 -3
  114. package/dist/cli/chunks/{chunk-MECDNFOJ.js → chunk-VW7FKTFO.js} +2 -2
  115. package/dist/cli/chunks/{chunk-VNAAXZGF.js → chunk-VXQK4GKV.js} +1 -1
  116. package/dist/cli/chunks/{chunk-DBCN7R63.js → chunk-VZO5I23B.js} +1 -1
  117. package/dist/cli/chunks/{chunk-XKMMFQSJ.js → chunk-WC5A7C5L.js} +1 -1
  118. package/dist/cli/chunks/{chunk-JNXIYHLI.js → chunk-WH7ZOJCF.js} +1 -1
  119. package/dist/cli/chunks/{chunk-TR4NPMRW.js → chunk-WKQSZTU6.js} +2 -2
  120. package/dist/cli/chunks/{chunk-OE7SGIX2.js → chunk-WMJCFDTA.js} +2 -2
  121. package/dist/cli/chunks/{chunk-66BUIFFH.js → chunk-X2T4TI7D.js} +2 -2
  122. package/dist/cli/chunks/{chunk-HXF4FUPY.js → chunk-XBWVHO6G.js} +2 -2
  123. package/dist/cli/chunks/{chunk-L2GANTQN.js → chunk-XSLKR2DM.js} +2 -2
  124. package/dist/cli/chunks/{chunk-5A5XANSD.js → chunk-XTCV5UOJ.js} +2 -2
  125. package/dist/cli/chunks/{chunk-BNDK7JRW.js → chunk-YNVVRND7.js} +2 -2
  126. package/dist/cli/chunks/{chunk-WKLSXJD4.js → chunk-YQL6JH2Y.js} +2 -2
  127. package/dist/cli/chunks/{chunk-AA6IUBCM.js → chunk-YZIOM7JL.js} +2 -2
  128. package/dist/cli/chunks/{chunk-UH7TV6BY.js → chunk-Z4YHL4JU.js} +1 -1
  129. package/dist/cli/chunks/{chunk-DJPS7H2M.js → chunk-ZHA5Z5V4.js} +1 -1
  130. package/dist/cli/chunks/{chunk-QKQAQPXY.js → chunk-ZJEVL5O3.js} +2 -2
  131. package/dist/cli/chunks/{chunk-MJKFU6A6.js → chunk-ZURHHRSA.js} +2 -2
  132. package/dist/cli/chunks/{chunk-W4ZV6LAJ.js → chunk-ZWR4PZ4Z.js} +2 -2
  133. package/dist/cli/chunks/{ci-TTP5HJSW.js → ci-LYAVZLM3.js} +2 -2
  134. package/dist/cli/chunks/{ci-output-TKESU45X.js → ci-output-L7TR2NCN.js} +2 -2
  135. package/dist/cli/chunks/{circuit-breaker-GFRV5R7E.js → circuit-breaker-AQOGJGKI.js} +2 -2
  136. package/dist/cli/chunks/{claude-flow-setup-LY6MADFA.js → claude-flow-setup-SO2ZN26K.js} +2 -2
  137. package/dist/cli/chunks/client-LIKTMSIP.js +2 -0
  138. package/dist/cli/chunks/{cline-installer-OSAILLDH.js → cline-installer-XCXFH4UR.js} +2 -2
  139. package/dist/cli/chunks/{code-ASRSOGYH.js → code-3Z2HMS5I.js} +2 -2
  140. package/dist/cli/chunks/{code-index-extractor-AMLGVHB7.js → code-index-extractor-KE362AJX.js} +2 -2
  141. package/dist/cli/chunks/{codex-installer-3CKH3WV4.js → codex-installer-GTD3GFTF.js} +2 -2
  142. package/dist/cli/chunks/{completions-MXNPWLOE.js → completions-EDCXRRJO.js} +2 -2
  143. package/dist/cli/chunks/{complexity-analyzer-2Z347PXF.js → complexity-analyzer-QMN3V6D3.js} +2 -2
  144. package/dist/cli/chunks/{continuedev-installer-LE7K745N.js → continuedev-installer-U6HN376C.js} +2 -2
  145. package/dist/cli/chunks/{copilot-installer-CHJL3275.js → copilot-installer-54PZIREM.js} +2 -2
  146. package/dist/cli/chunks/{cost-tracker-C3ZWNNSV.js → cost-tracker-33O475QA.js} +2 -2
  147. package/dist/cli/chunks/{coverage-6JOXBVDL.js → coverage-B7E545AJ.js} +3 -3
  148. package/dist/cli/chunks/cross-domain-router-SSBT32Q3.js +2 -0
  149. package/dist/cli/chunks/{cursor-installer-RKCNWO42.js → cursor-installer-LKKSPZUM.js} +2 -2
  150. package/dist/cli/chunks/{daemon-XXWOT6TM.js → daemon-DVOHWXUR.js} +3 -3
  151. package/dist/cli/chunks/{dag-attention-scheduler-37MG6XR4.js → dag-attention-scheduler-EQOHQBUG.js} +2 -2
  152. package/dist/cli/chunks/{detect-QOTL36CE.js → detect-OCB2XT6C.js} +2 -2
  153. package/dist/cli/chunks/dist-node-HSG4QK4G.js +2 -0
  154. package/dist/cli/chunks/{domain-handler-TJNLNJ7Z.js → domain-handler-USGF4CIG.js} +2 -2
  155. package/dist/cli/chunks/{domain-transfer-FDHC2MGH.js → domain-transfer-OUERZRGL.js} +2 -2
  156. package/dist/cli/chunks/dream-FAHB6BWB.js +2 -0
  157. package/dist/cli/chunks/{eval-JP7CLUTD.js → eval-LHYXXWFK.js} +2 -2
  158. package/dist/cli/chunks/{fast-paths-CWTVLIIC.js → fast-paths-UTK7BN63.js} +2 -2
  159. package/dist/cli/chunks/{feature-flags-H2UU53L4.js → feature-flags-XB6ALB3X.js} +2 -2
  160. package/dist/cli/chunks/{feature-flags-SKFBAHR3.js → feature-flags-XEP6B4GN.js} +2 -2
  161. package/dist/cli/chunks/{file-discovery-RWVGKIDB.js → file-discovery-O4DUCNHK.js} +2 -2
  162. package/dist/cli/chunks/{fleet-JOSUYRTZ.js → fleet-37NGGRJI.js} +3 -3
  163. package/dist/cli/chunks/{gnn-wrapper-WNOZFTDD.js → gnn-wrapper-5E7T3IQX.js} +2 -2
  164. package/dist/cli/chunks/{heartbeat-handler-73YSR6K7.js → heartbeat-handler-Q44PCI7K.js} +4 -4
  165. package/dist/cli/chunks/{heartbeat-scheduler-EN52JZUX.js → heartbeat-scheduler-6JPB2AQS.js} +2 -2
  166. package/dist/cli/chunks/hnsw-adapter-GQM3ONQE.js +2 -0
  167. package/dist/cli/chunks/hnsw-index-XF3NY4R4.js +2 -0
  168. package/dist/cli/chunks/{hnsw-legacy-bridge-PWD6DXS4.js → hnsw-legacy-bridge-B55GGQYA.js} +2 -2
  169. package/dist/cli/chunks/{hnswlib-node-VAZOCNY7.js → hnswlib-node-B3D2XIL5.js} +2 -2
  170. package/dist/cli/chunks/hooks-MOBQSJLJ.js +101 -0
  171. package/dist/cli/chunks/{hybrid-router-6W323WKW.js → hybrid-router-RV34PYQD.js} +2 -2
  172. package/dist/cli/chunks/{hypergraph-engine-R2N4C24I.js → hypergraph-engine-FT5YK5RF.js} +2 -2
  173. package/dist/cli/chunks/{hypergraph-handler-AY4YZDOG.js → hypergraph-handler-EUS6MIYW.js} +3 -3
  174. package/dist/cli/chunks/impact-analyzer-V6PBIMZH.js +2 -0
  175. package/dist/cli/chunks/{init-handler-UDBW4P3Z.js → init-handler-3MV32TKZ.js} +6 -6
  176. package/dist/cli/chunks/init-wizard-7ROJWLEO.js +2 -0
  177. package/dist/cli/chunks/kernel-AOUBGDXU.js +2 -0
  178. package/dist/cli/chunks/{kilocode-installer-J2NZUDEQ.js → kilocode-installer-RZPRXQI2.js} +2 -2
  179. package/dist/cli/chunks/{kiro-installer-AHOOKFQH.js → kiro-installer-BGDBNZHI.js} +2 -2
  180. package/dist/cli/chunks/knowledge-graph-SJA3YGMQ.js +2 -0
  181. package/dist/cli/chunks/{learning-VC7X2HKA.js → learning-KNEBWLEZ.js} +3 -3
  182. package/dist/cli/chunks/{llm-router-3PU7CH5P.js → llm-router-Q2VQPOQ3.js} +4 -4
  183. package/dist/cli/chunks/{load-WB4JD6X7.js → load-RL53SYBD.js} +2 -2
  184. package/dist/cli/chunks/load-test-NSHIGHCV.js +2 -0
  185. package/dist/cli/chunks/{mcp-QUU2DYYK.js → mcp-GTINFFUF.js} +2 -2
  186. package/dist/cli/chunks/{memory-UAEWPG34.js → memory-STPMUUAK.js} +5 -5
  187. package/dist/cli/chunks/memory-backend-SZAYMQVP.js +2 -0
  188. package/dist/cli/chunks/{memory-handlers-3FBXIZG4.js → memory-handlers-LWX3LPVF.js} +2 -2
  189. package/dist/cli/chunks/{multi-model-executor-CIUHXR43.js → multi-model-executor-36ZYYDA6.js} +2 -2
  190. package/dist/cli/chunks/{opencode-installer-VV6RIHNR.js → opencode-installer-KTCQKS2K.js} +2 -2
  191. package/dist/cli/chunks/{orchestrator-WV27PZZM.js → orchestrator-6EGOOXQG.js} +6 -6
  192. package/dist/cli/chunks/{pipeline-JRBCX2U3.js → pipeline-WSLAIOYC.js} +2 -2
  193. package/dist/cli/chunks/{platform-TUPMH4ND.js → platform-MNUN663B.js} +2 -2
  194. package/dist/cli/chunks/{plugin-H757CYQK.js → plugin-PLDTG4A2.js} +2 -2
  195. package/dist/cli/chunks/{prime-radiant-advanced-wasm-5BWO25RA.js → prime-radiant-advanced-wasm-B4UFONWB.js} +2 -2
  196. package/dist/cli/chunks/protocol-executor-22KKAYX2.js +2 -0
  197. package/dist/cli/chunks/{protocol-handler-Z6DCNTUU.js → protocol-handler-VAVLLAI2.js} +2 -2
  198. package/dist/cli/chunks/{prove-4OGWFOUM.js → prove-WVNPDWUC.js} +2 -2
  199. package/dist/cli/chunks/{provider-manager-K736L6LN.js → provider-manager-VJF4D6AW.js} +2 -2
  200. package/dist/cli/chunks/qe-reasoning-bank-N7ZXOAEN.js +2 -0
  201. package/dist/cli/chunks/{quality-YFLEATGZ.js → quality-LTMHVQBG.js} +2 -2
  202. package/dist/cli/chunks/queen-coordinator-BC54OCHH.js +2 -0
  203. package/dist/cli/chunks/{real-embeddings-5QUSL7J4.js → real-embeddings-6ACQACTM.js} +2 -2
  204. package/dist/cli/chunks/{roocode-installer-HDWE5XW3.js → roocode-installer-T5ZWC3SS.js} +2 -2
  205. package/dist/cli/chunks/router-YTQZRTIB.js +2 -0
  206. package/dist/cli/chunks/routing-feedback-AASAMEUY.js +2 -0
  207. package/dist/cli/chunks/{routing-handler-P6PP3FYW.js → routing-handler-Y2O2I2HM.js} +2 -2
  208. package/dist/cli/chunks/{ruvector-commands-VNMTRQML.js → ruvector-commands-F2V36B4W.js} +2 -2
  209. package/dist/cli/chunks/{rvf-dual-writer-A7VW5CAT.js → rvf-dual-writer-R6CNMPQD.js} +2 -2
  210. package/dist/cli/chunks/{rvf-migration-adapter-QIPSNASM.js → rvf-migration-adapter-IDVOB3LN.js} +2 -2
  211. package/dist/cli/chunks/{rvf-migration-coordinator-XT4XDLRZ.js → rvf-migration-coordinator-VM4AMFZG.js} +2 -2
  212. package/dist/cli/chunks/rvf-native-adapter-VHIHJOPA.js +2 -0
  213. package/dist/cli/chunks/safe-db-NVEBL662.js +2 -0
  214. package/dist/cli/chunks/schedule-KVUFE56T.js +2 -0
  215. package/dist/cli/chunks/scheduler-6GRLJZ2A.js +2 -0
  216. package/dist/cli/chunks/{security-E2XCP5CG.js → security-WQ7YMR6M.js} +3 -3
  217. package/dist/cli/chunks/shared-rvf-adapter-XORIDF3Q.js +2 -0
  218. package/dist/cli/chunks/{shared-rvf-dual-writer-NPWTXHUI.js → shared-rvf-dual-writer-HYI64CBX.js} +2 -2
  219. package/dist/cli/chunks/sqlite-persistence-25TDMX6G.js +2 -0
  220. package/dist/cli/chunks/{status-handler-MWVNDZSZ.js → status-handler-BH2WCMPA.js} +2 -2
  221. package/dist/cli/chunks/{structural-health-2KZO43IF.js → structural-health-XWX6FKVF.js} +2 -2
  222. package/dist/cli/chunks/{sync-C5BOK3WU.js → sync-PRDGCHE2.js} +2 -2
  223. package/dist/cli/chunks/{task-handler-KRVSHJGJ.js → task-handler-YFHFBMHO.js} +2 -2
  224. package/dist/cli/chunks/{task-handlers-CKOHD633.js → task-handlers-4OQRADMG.js} +2 -2
  225. package/dist/cli/chunks/{test-3B7FK6MJ.js → test-ZBTQ4Z66.js} +4 -4
  226. package/dist/cli/chunks/{test-scheduling-HZIMSTAX.js → test-scheduling-F47Y3KNO.js} +3 -3
  227. package/dist/cli/chunks/{token-bootstrap-JJCANIHJ.js → token-bootstrap-XOGAEQPG.js} +2 -2
  228. package/dist/cli/chunks/{token-usage-5VCMBZU7.js → token-usage-2KZ7WE5J.js} +2 -2
  229. package/dist/cli/chunks/{transformers-ETUTMOTF.js → transformers-KCJ7PWZ4.js} +2 -2
  230. package/dist/cli/chunks/{tree-sitter-wasm-parser-TMR44BKP.js → tree-sitter-wasm-parser-H6DL2DFA.js} +2 -2
  231. package/dist/cli/chunks/{types-GYT6373C.js → types-633TMIO3.js} +2 -2
  232. package/dist/cli/chunks/unified-memory-BTX45KY5.js +2 -0
  233. package/dist/cli/chunks/unified-memory-hnsw-MMHMQ4CP.js +2 -0
  234. package/dist/cli/chunks/unified-persistence-GA7HKYZC.js +2 -0
  235. package/dist/cli/chunks/{upgrade-534QLY7P.js → upgrade-CH742GRF.js} +2 -2
  236. package/dist/cli/chunks/{validate-UBVF3CSS.js → validate-44WH3CKE.js} +2 -2
  237. package/dist/cli/chunks/{validate-swarm-2XD45EVM.js → validate-swarm-W2A7CUM7.js} +2 -2
  238. package/dist/cli/chunks/{vibium-NMT6AQ4S.js → vibium-B25MIEBK.js} +2 -2
  239. package/dist/cli/chunks/visual-security-HPF5HCYF.js +2 -0
  240. package/dist/cli/chunks/{web-tree-sitter-RNG6NRDD.js → web-tree-sitter-B54K47HF.js} +2 -2
  241. package/dist/cli/chunks/{windsurf-installer-RVCDSJT3.js → windsurf-installer-EWL7COTI.js} +2 -2
  242. package/dist/cli/chunks/{witness-chain-YDFB22MT.js → witness-chain-DWNP7VR6.js} +2 -2
  243. package/dist/cli/chunks/witness-chain-LROQLFND.js +2 -0
  244. package/dist/cli/chunks/{workflow-MHW4KHNK.js → workflow-LT2J7U23.js} +4 -4
  245. package/dist/cli/chunks/workflow-orchestrator-VFRKGG5Y.js +2 -0
  246. package/dist/cli/chunks/{wrappers-SAZY3C2S.js → wrappers-OAZ6MKXO.js} +2 -2
  247. package/dist/cli/commands/hooks-handlers/routing-hooks.d.ts +6 -0
  248. package/dist/cli/commands/hooks-handlers/routing-hooks.js +80 -4
  249. package/dist/coordination/handlers/test-execution-handlers.d.ts +18 -0
  250. package/dist/coordination/handlers/test-execution-handlers.js +77 -9
  251. package/dist/domains/test-generation/generators/jest-vitest-generator.js +13 -3
  252. package/dist/domains/test-generation/interfaces.d.ts +12 -0
  253. package/dist/domains/test-generation/services/test-generator.js +5 -1
  254. package/dist/governance/continue-gate-integration.d.ts +13 -0
  255. package/dist/governance/continue-gate-integration.js +31 -8
  256. package/dist/init/init-wizard-hooks.js +4 -1
  257. package/dist/init/phases/07-hooks.js +4 -1
  258. package/dist/mcp/bundle.js +411 -409
  259. package/dist/mcp/protocol-server.js +6 -1
  260. package/dist/mcp/tools/coverage-analysis/index.js +11 -2
  261. package/package.json +2 -2
  262. package/dist/cli/chunks/adapter-XFJIW42U.js +0 -2
  263. package/dist/cli/chunks/aqe-learning-engine-UD4SXENM.js +0 -2
  264. package/dist/cli/chunks/base-ETEN7L2V.js +0 -2
  265. package/dist/cli/chunks/browser-workflow-KVHPOIBA.js +0 -2
  266. package/dist/cli/chunks/chunk-3ADFXSO2.js +0 -15
  267. package/dist/cli/chunks/chunk-5LDXAVDC.js +0 -2
  268. package/dist/cli/chunks/chunk-ED5OUSYZ.js +0 -2
  269. package/dist/cli/chunks/client-ZDVM5WFL.js +0 -2
  270. package/dist/cli/chunks/cross-domain-router-J5VK276J.js +0 -2
  271. package/dist/cli/chunks/dream-VCLN6RM4.js +0 -2
  272. package/dist/cli/chunks/esm-node-YZSRCH6T.js +0 -2
  273. package/dist/cli/chunks/hnsw-adapter-Y5HVTNJW.js +0 -2
  274. package/dist/cli/chunks/hnsw-index-NZTCPZA5.js +0 -2
  275. package/dist/cli/chunks/hooks-K7XGDF2Y.js +0 -101
  276. package/dist/cli/chunks/impact-analyzer-ROWLIS6H.js +0 -2
  277. package/dist/cli/chunks/init-wizard-MI76CUL5.js +0 -2
  278. package/dist/cli/chunks/kernel-5WVAV5RX.js +0 -2
  279. package/dist/cli/chunks/knowledge-graph-QXL3AWPV.js +0 -2
  280. package/dist/cli/chunks/load-test-2JOY7YH6.js +0 -2
  281. package/dist/cli/chunks/memory-backend-ZKGLAWQZ.js +0 -2
  282. package/dist/cli/chunks/protocol-executor-3Q4QY7G6.js +0 -2
  283. package/dist/cli/chunks/qe-reasoning-bank-SAMJF3NF.js +0 -2
  284. package/dist/cli/chunks/queen-coordinator-OFRH67Y2.js +0 -2
  285. package/dist/cli/chunks/router-UDHEENEY.js +0 -2
  286. package/dist/cli/chunks/routing-feedback-PBZRVFVL.js +0 -2
  287. package/dist/cli/chunks/rvf-native-adapter-CJFEDG74.js +0 -2
  288. package/dist/cli/chunks/safe-db-YMSZFHWP.js +0 -2
  289. package/dist/cli/chunks/schedule-B43N6CVB.js +0 -2
  290. package/dist/cli/chunks/scheduler-ITZH5YQM.js +0 -2
  291. package/dist/cli/chunks/shared-rvf-adapter-PV5ZBJ25.js +0 -2
  292. package/dist/cli/chunks/sqlite-persistence-RK5CKPHB.js +0 -2
  293. package/dist/cli/chunks/unified-memory-LIKELZVA.js +0 -2
  294. package/dist/cli/chunks/unified-memory-hnsw-VTN3MUB4.js +0 -2
  295. package/dist/cli/chunks/unified-persistence-MQVUY5WN.js +0 -2
  296. package/dist/cli/chunks/visual-security-HVJWGY7T.js +0 -2
  297. package/dist/cli/chunks/witness-chain-5R322YYF.js +0 -2
  298. package/dist/cli/chunks/workflow-orchestrator-637BCZI4.js +0 -2
@@ -9,6 +9,71 @@ import chalk from 'chalk';
9
9
  import path from 'node:path';
10
10
  import { findProjectRoot } from '../../../kernel/unified-memory.js';
11
11
  import { getHooksSystem, createHybridBackendWithTimeout, incrementDreamExperience, printJson, printError, printGuidance, } from './hooks-shared.js';
12
+ /**
13
+ * Read piped stdin with a short timeout. Claude Code delivers
14
+ * UserPromptSubmit / PostToolUse / etc. events as JSON on stdin —
15
+ * `$PROMPT` is NOT exposed as an env var, so reading stdin is the
16
+ * only reliable way to recover the prompt body for routing.
17
+ *
18
+ * Returns '' when stdin is a TTY (interactive run) or no data arrives
19
+ * before the timeout. Never throws — a hook must never crash the host.
20
+ */
21
+ async function readStdinJsonEvent(timeoutMs = 500) {
22
+ if (process.stdin.isTTY)
23
+ return '';
24
+ return new Promise((resolve) => {
25
+ let data = '';
26
+ const timer = setTimeout(() => {
27
+ process.stdin.removeAllListeners();
28
+ process.stdin.pause();
29
+ resolve(data);
30
+ }, timeoutMs);
31
+ process.stdin.setEncoding('utf8');
32
+ process.stdin.on('data', (chunk) => {
33
+ data += chunk;
34
+ });
35
+ process.stdin.on('end', () => {
36
+ clearTimeout(timer);
37
+ resolve(data);
38
+ });
39
+ process.stdin.on('error', () => {
40
+ clearTimeout(timer);
41
+ resolve(data);
42
+ });
43
+ process.stdin.resume();
44
+ });
45
+ }
46
+ /**
47
+ * Extract a routable task description from a Claude Code hook event JSON
48
+ * payload. Different hook surfaces use different field names — try the
49
+ * documented ones in priority order. Exported for unit testing.
50
+ */
51
+ export function extractPromptFromEvent(raw) {
52
+ if (!raw.trim())
53
+ return '';
54
+ let event;
55
+ try {
56
+ event = JSON.parse(raw);
57
+ }
58
+ catch {
59
+ // Not JSON — treat the whole stdin as the prompt body
60
+ return raw.trim();
61
+ }
62
+ const candidates = [
63
+ event.prompt,
64
+ event.user_prompt,
65
+ event.command,
66
+ event.tool_input?.prompt,
67
+ event.tool_input?.description,
68
+ event.toolInput?.prompt,
69
+ event.toolInput?.description,
70
+ ];
71
+ for (const c of candidates) {
72
+ if (typeof c === 'string' && c.trim())
73
+ return c;
74
+ }
75
+ return '';
76
+ }
12
77
  /**
13
78
  * Register route subcommand on the hooks command.
14
79
  */
@@ -19,15 +84,26 @@ export function registerRoutingHooks(hooks) {
19
84
  hooks
20
85
  .command('route')
21
86
  .description('Route a task to the optimal QE agent')
22
- .requiredOption('-t, --task <description>', 'Task description')
87
+ .option('-t, --task <description>', 'Task description (falls back to stdin event JSON)')
23
88
  .option('-d, --domain <domain>', 'Target QE domain hint')
24
89
  .option('-c, --capabilities <caps...>', 'Required capabilities')
25
90
  .option('--json', 'Output as JSON')
26
91
  .action(async (options) => {
27
92
  try {
93
+ // Resolve task: explicit --task wins, otherwise read the Claude Code
94
+ // hook event from stdin (UserPromptSubmit ships {prompt: "..."} on stdin
95
+ // and exposes nothing useful in env vars).
96
+ let task = options.task ?? '';
97
+ if (!task.trim()) {
98
+ const stdin = await readStdinJsonEvent();
99
+ task = extractPromptFromEvent(stdin);
100
+ }
101
+ if (!task.trim()) {
102
+ throw new Error('No task provided. Pass --task <description> or pipe a Claude Code hook event JSON to stdin.');
103
+ }
28
104
  const { reasoningBank } = await getHooksSystem();
29
105
  const request = {
30
- task: options.task,
106
+ task,
31
107
  domain: options.domain,
32
108
  capabilities: options.capabilities,
33
109
  };
@@ -49,7 +125,7 @@ export function registerRoutingHooks(hooks) {
49
125
  }
50
126
  else {
51
127
  console.log(chalk.bold('\n🎯 Task Routing Result'));
52
- console.log(chalk.dim(` Task: "${options.task}"`));
128
+ console.log(chalk.dim(` Task: "${task}"`));
53
129
  console.log(chalk.bold('\n👤 Recommended Agent:'), chalk.cyan(routing.recommendedAgent));
54
130
  console.log(chalk.dim(` Confidence: ${(routing.confidence * 100).toFixed(1)}%`));
55
131
  if (routing.alternatives.length > 0) {
@@ -78,7 +154,7 @@ export function registerRoutingHooks(hooks) {
78
154
  followed_recommendation, success, quality_score,
79
155
  duration_ms, error
80
156
  ) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
81
- `).run(outcomeId, JSON.stringify({ description: options.task, domain: options.domain }), JSON.stringify({
157
+ `).run(outcomeId, JSON.stringify({ description: task, domain: options.domain }), JSON.stringify({
82
158
  recommended: routing.recommendedAgent,
83
159
  confidence: routing.confidence,
84
160
  alternatives: routing.alternatives,
@@ -5,5 +5,23 @@
5
5
  * Covers: generate-tests, execute-tests
6
6
  */
7
7
  import type { TaskHandlerContext } from './handler-types';
8
+ /**
9
+ * Rewrite any temp-source references in a generated test so the user gets a
10
+ * test that imports from the original source path (when known) or a clear
11
+ * placeholder. Without this, generated tests reference the throwaway
12
+ * `/tmp/aqe-temp-*` file we created for analysis — that file is unlinked
13
+ * after generation, so the test would never run as-emitted.
14
+ *
15
+ * The generator may emit the temp path with the original extension
16
+ * (`/tmp/aqe-temp-X.ts`), with a substituted extension
17
+ * (`/tmp/aqe-temp-X.test.ts`), or extension-stripped (TS import convention:
18
+ * `/tmp/aqe-temp-X`). All three forms must be rewritten.
19
+ *
20
+ * Exported for unit testing (bug #1 regression).
21
+ */
22
+ export declare function rewriteTempPathsInGeneratedTest(testCode: string | undefined, sourceFile: string | undefined, tempPath: string | undefined, originalFilePath: string | undefined): {
23
+ testCode?: string;
24
+ sourceFile?: string;
25
+ };
8
26
  export declare function registerTestExecutionHandlers(ctx: TaskHandlerContext): void;
9
27
  //# sourceMappingURL=test-execution-handlers.d.ts.map
@@ -8,6 +8,49 @@ import { v4 as uuidv4 } from 'uuid';
8
8
  import * as fs from 'fs/promises';
9
9
  import { ok, err } from '../../shared/types';
10
10
  import { toError } from '../../shared/error-utils.js';
11
+ function escapeRegExp(s) {
12
+ return s.replace(/[.*+?^${}()|[\]\\]/g, '\\$&');
13
+ }
14
+ /**
15
+ * Rewrite any temp-source references in a generated test so the user gets a
16
+ * test that imports from the original source path (when known) or a clear
17
+ * placeholder. Without this, generated tests reference the throwaway
18
+ * `/tmp/aqe-temp-*` file we created for analysis — that file is unlinked
19
+ * after generation, so the test would never run as-emitted.
20
+ *
21
+ * The generator may emit the temp path with the original extension
22
+ * (`/tmp/aqe-temp-X.ts`), with a substituted extension
23
+ * (`/tmp/aqe-temp-X.test.ts`), or extension-stripped (TS import convention:
24
+ * `/tmp/aqe-temp-X`). All three forms must be rewritten.
25
+ *
26
+ * Exported for unit testing (bug #1 regression).
27
+ */
28
+ export function rewriteTempPathsInGeneratedTest(testCode, sourceFile, tempPath, originalFilePath) {
29
+ if (!tempPath) {
30
+ return { testCode, sourceFile };
31
+ }
32
+ // For the user's import target we strip the source extension when the
33
+ // original is a path (TS imports omit `.ts`); preserve it otherwise.
34
+ const stripExt = (p) => p.replace(/\.[a-z]+$/i, '');
35
+ const replacement = originalFilePath
36
+ ? (originalFilePath.match(/\.(ts|tsx|js|jsx|mjs|cjs)$/i) ? stripExt(originalFilePath) : originalFilePath)
37
+ : './module-under-test';
38
+ const todoComment = originalFilePath
39
+ ? ''
40
+ : `// TODO: replace './module-under-test' with the actual import path of the module under test\n`;
41
+ // Build a regex that matches the temp path with any (or no) extension suffix.
42
+ // Order matters: replace extension-bearing forms before extension-less, since
43
+ // the extension-less form is a prefix of the others.
44
+ const tempBase = stripExt(tempPath);
45
+ const tempBaseEscaped = escapeRegExp(tempBase);
46
+ // Matches: <base>.<ext> | <base>.<ext>.<ext> | <base>
47
+ const anyForm = new RegExp(tempBaseEscaped + '(?:\\.[a-zA-Z]+){0,2}', 'g');
48
+ const newCode = testCode
49
+ ? todoComment + testCode.replace(anyForm, replacement)
50
+ : testCode;
51
+ const newRef = sourceFile === tempPath ? (originalFilePath || sourceFile) : sourceFile;
52
+ return { testCode: newCode, sourceFile: newRef };
53
+ }
11
54
  export function registerTestExecutionHandlers(ctx) {
12
55
  // Register test generation handler - REAL IMPLEMENTATION
13
56
  ctx.registerHandler('generate-tests', async (task) => {
@@ -16,6 +59,7 @@ export function registerTestExecutionHandlers(ctx) {
16
59
  const generator = ctx.getTestGenerator();
17
60
  // Determine source files to analyze
18
61
  let sourceFiles = [];
62
+ let tempPath;
19
63
  if (payload.sourceFiles && payload.sourceFiles.length > 0) {
20
64
  sourceFiles = payload.sourceFiles;
21
65
  }
@@ -32,7 +76,7 @@ export function registerTestExecutionHandlers(ctx) {
32
76
  cpp: '.cpp', c: '.c', scala: '.scala',
33
77
  };
34
78
  const ext = langExtMap[payload.language?.toLowerCase() || 'typescript'] || '.ts';
35
- const tempPath = `/tmp/aqe-temp-${uuidv4()}${ext}`;
79
+ tempPath = `/tmp/aqe-temp-${uuidv4()}${ext}`;
36
80
  await fs.writeFile(tempPath, payload.sourceCode, 'utf-8');
37
81
  sourceFiles = [tempPath];
38
82
  }
@@ -46,30 +90,54 @@ export function registerTestExecutionHandlers(ctx) {
46
90
  warning: 'No source files or code provided for test generation. Provide sourceCode, filePath, or sourceFiles in the payload.',
47
91
  });
48
92
  }
49
- // Use the real TestGeneratorService
93
+ // Use the real TestGeneratorService.
94
+ // Bug #1 fix: when we wrote a temp file for analysis, tell the generator
95
+ // to bake a sensible logical import path into the emitted tests instead
96
+ // of the throwaway temp path. If the user supplied filePath, use that;
97
+ // otherwise use a placeholder the user can edit.
50
98
  const framework = (payload.framework || 'vitest');
99
+ const importPathOverrides = tempPath
100
+ ? { [tempPath]: payload.filePath
101
+ ? payload.filePath.replace(/\.(ts|tsx|js|jsx|mjs|cjs)$/i, '')
102
+ : './module-under-test' }
103
+ : undefined;
51
104
  const result = await generator.generateTests({
52
105
  sourceFiles,
53
106
  testType: payload.testType || 'unit',
54
107
  framework,
55
108
  coverageTarget: payload.coverageGoal || 80,
56
109
  patterns: [],
110
+ importPathOverrides,
57
111
  });
112
+ // Always clean up the temp file we created — even on failure
113
+ if (tempPath) {
114
+ try {
115
+ await fs.unlink(tempPath);
116
+ }
117
+ catch { /* best-effort */ }
118
+ }
58
119
  if (!result.success) {
59
120
  return result;
60
121
  }
61
122
  const generatedTests = result.value;
62
- return ok({
63
- testsGenerated: generatedTests.tests.length,
64
- coverageEstimate: generatedTests.coverageEstimate,
65
- tests: generatedTests.tests.map(t => ({
123
+ // Rewrite any temp-path references in generated tests so users get tests
124
+ // that reference a real source path (or a clear placeholder) rather than
125
+ // a /tmp/aqe-temp-* path that never existed in their codebase.
126
+ const tests = generatedTests.tests.map(t => {
127
+ const rewritten = rewriteTempPathsInGeneratedTest(t.testCode, t.sourceFile, tempPath, payload.filePath);
128
+ return {
66
129
  name: t.name,
67
130
  file: t.testFile,
68
131
  type: t.type,
69
- sourceFile: t.sourceFile,
132
+ sourceFile: rewritten.sourceFile,
70
133
  assertions: t.assertions,
71
- testCode: t.testCode,
72
- })),
134
+ testCode: rewritten.testCode,
135
+ };
136
+ });
137
+ return ok({
138
+ testsGenerated: tests.length,
139
+ coverageEstimate: generatedTests.coverageEstimate,
140
+ tests,
73
141
  patternsUsed: generatedTests.patternsUsed,
74
142
  });
75
143
  }
@@ -52,8 +52,15 @@ export class JestVitestGenerator extends BaseTestGenerator {
52
52
  const patternComment = this.generatePatternComment(patterns);
53
53
  const exports = this.extractExports(analysis.functions, analysis.classes);
54
54
  const importStatement = this.generateImportStatement(exports, importPath, moduleName);
55
- const mockImport = this.framework === 'vitest' ? ', vi' : '';
56
- let testCode = `${patternComment}import { describe, it, expect, beforeEach${mockImport} } from '${this.framework}';
55
+ // Per-framework imports:
56
+ // - vitest: `import { ..., vi } from 'vitest'` (vi is the mock util)
57
+ // - jest: `import { ..., jest } from '@jest/globals'`
58
+ // (jest 28+ provides @jest/globals; importing from 'jest' is invalid —
59
+ // it's a CLI package, not a runtime export. Globals work too but
60
+ // explicit imports match vitest style and are TS-friendly.)
61
+ const mockImport = this.framework === 'vitest' ? ', vi' : ', jest';
62
+ const importSource = this.framework === 'vitest' ? 'vitest' : '@jest/globals';
63
+ let testCode = `${patternComment}import { describe, it, expect, beforeEach${mockImport} } from '${importSource}';
57
64
  ${importStatement}
58
65
  `;
59
66
  // KG: Generate mock declarations for external (non-relative) dependencies only.
@@ -274,7 +281,10 @@ ${importStatement}
274
281
  callerTest += ` expect(publicKeys.length).toBeGreaterThan(0);\n`;
275
282
  callerTest += ` });\n`;
276
283
  }
277
- return `${patternComment}import { ${moduleName} } from '${importPath}';
284
+ const stubImportSource = this.framework === 'vitest' ? 'vitest' : '@jest/globals';
285
+ const stubMockImport = this.framework === 'vitest' ? ', vi' : ', jest';
286
+ return `${patternComment}import { describe, it, expect, beforeEach${stubMockImport} } from '${stubImportSource}';
287
+ import { ${moduleName} } from '${importPath}';
278
288
  ${mockDeclarations}
279
289
  describe('${moduleName}', () => {
280
290
  ${similarityComment} describe('${testType} tests', () => {
@@ -26,6 +26,18 @@ export interface IGenerateTestsRequest {
26
26
  projectRoot?: string;
27
27
  compileValidation?: boolean;
28
28
  maxCompileRetries?: number;
29
+ /**
30
+ * Map of sourceFile path → import path to bake into generated test imports.
31
+ * Use this when the file at `sourceFiles[i]` is a temporary copy of source
32
+ * (e.g. an inline-source MCP call) and the generated tests should reference
33
+ * a different logical path. If a file is not in the map, the import path
34
+ * is derived from the source file path as before.
35
+ *
36
+ * Example:
37
+ * { '/tmp/aqe-temp-abc.ts': './src/services/auth' }
38
+ * → generated test emits `import { ... } from './src/services/auth'`
39
+ */
40
+ importPathOverrides?: Record<string, string>;
29
41
  }
30
42
  export interface IGeneratedTests {
31
43
  tests: IGeneratedTest[];
@@ -420,7 +420,11 @@ Return a JSON array of test suggestions, each with: { "name": "test name", "desc
420
420
  }
421
421
  const generator = this.generatorFactory.create(framework);
422
422
  const moduleName = this.extractModuleName(sourceFile);
423
- const importPath = this.getImportPath(sourceFile);
423
+ // Bug #1 fix: prefer caller-supplied import path override when present
424
+ // (used by MCP handler when sourceCode is written to a temp file but the
425
+ // generated tests should reference the original logical path).
426
+ const importPath = originalRequest?.importPathOverrides?.[sourceFile]
427
+ ?? this.getImportPath(sourceFile);
424
428
  const context = {
425
429
  moduleName,
426
430
  importPath,
@@ -79,6 +79,19 @@ export declare class ContinueGateIntegration {
79
79
  *
80
80
  * ContinueDecision has: { decision, reasons, metrics, recommendedAction }
81
81
  * We map to: { shouldContinue, reason, throttleMs, escalate, reworkRatio }
82
+ *
83
+ * Decision semantics:
84
+ * - 'continue', 'checkpoint': proceed normally
85
+ * - 'throttle': proceed but caller should slow down (soft signal — not a block).
86
+ * The recommended action is "slow down", not "abort". Treating throttle as
87
+ * a hard rejection would cause legitimate work to be denied; the caller can
88
+ * apply the throttleMs as a backoff hint between subsequent calls.
89
+ * - 'pause', 'stop': block this task
90
+ *
91
+ * NOTE: With totalTokensUsed pinned to 0 in the caller (no real token
92
+ * telemetry yet), the guidance gate's budget-slope detector cannot fire,
93
+ * so 'throttle' from this path is rare in practice — it would only fire
94
+ * if some other slowdown signal (not budget) were configured.
82
95
  */
83
96
  private mapGuidanceDecision;
84
97
  /**
@@ -142,6 +142,17 @@ export class ContinueGateIntegration {
142
142
  if (this.guidanceContinueGate && localDecision.shouldContinue && !localDecision.reason) {
143
143
  try {
144
144
  const reworkRatio = this.calculateReworkRatio(history.slice(-10));
145
+ // ADR-058 NOTE: We do NOT track real per-action token usage here.
146
+ // Passing a synthetic estimate (e.g. history.length * 500) to the
147
+ // guidance gate causes the linear-regression slope detector to fire
148
+ // on the first multi-step interaction (slope = 500 vs 0.02 threshold),
149
+ // which would block legitimate one-off MCP tool calls.
150
+ //
151
+ // Until real token telemetry is wired in, we set totalTokensUsed = 0
152
+ // and a generous budgetRemaining. This effectively disables the
153
+ // budget-slope and budget-exhaustion checks (they require non-zero
154
+ // token data to fire) while keeping the coherence, rework, and
155
+ // uncertainty checks active — those use real data we DO have.
145
156
  const stepContext = {
146
157
  stepNumber: history.length,
147
158
  totalToolCalls: history.length,
@@ -150,9 +161,9 @@ export class ContinueGateIntegration {
150
161
  uncertaintyScore: reworkRatio,
151
162
  elapsedMs: history.length > 0 ? Date.now() - history[0].timestamp : 0,
152
163
  lastCheckpointStep: 0,
153
- totalTokensUsed: history.length * 500, // Estimate ~500 tokens per action
164
+ totalTokensUsed: 0, // No real token telemetry — see comment above
154
165
  budgetRemaining: {
155
- tokens: Math.max(0, (flags.maxConsecutiveRetries * 10 * 500) - (history.length * 500)),
166
+ tokens: Number.MAX_SAFE_INTEGER, // Defer budget gating to dedicated cost monitor
156
167
  toolCalls: Math.max(0, (flags.maxConsecutiveRetries * 10) - history.length),
157
168
  timeMs: Math.max(0, flags.idleTimeoutMs - (history.length > 0 ? Date.now() - history[history.length - 1].timestamp : 0)),
158
169
  },
@@ -254,15 +265,27 @@ export class ContinueGateIntegration {
254
265
  *
255
266
  * ContinueDecision has: { decision, reasons, metrics, recommendedAction }
256
267
  * We map to: { shouldContinue, reason, throttleMs, escalate, reworkRatio }
268
+ *
269
+ * Decision semantics:
270
+ * - 'continue', 'checkpoint': proceed normally
271
+ * - 'throttle': proceed but caller should slow down (soft signal — not a block).
272
+ * The recommended action is "slow down", not "abort". Treating throttle as
273
+ * a hard rejection would cause legitimate work to be denied; the caller can
274
+ * apply the throttleMs as a backoff hint between subsequent calls.
275
+ * - 'pause', 'stop': block this task
276
+ *
277
+ * NOTE: With totalTokensUsed pinned to 0 in the caller (no real token
278
+ * telemetry yet), the guidance gate's budget-slope detector cannot fire,
279
+ * so 'throttle' from this path is rare in practice — it would only fire
280
+ * if some other slowdown signal (not budget) were configured.
257
281
  */
258
282
  mapGuidanceDecision(decision, agentId) {
259
283
  const flags = governanceFlags.getFlags().continueGate;
260
- const shouldContinue = decision.decision === 'continue' || decision.decision === 'checkpoint';
284
+ const isBlocking = decision.decision === 'pause' || decision.decision === 'stop';
285
+ const shouldContinue = !isBlocking;
261
286
  const reason = decision.reasons.length > 0 ? decision.reasons.join('; ') : undefined;
262
- // Throttle on 'throttle', 'pause', or 'stop'
263
- if (!shouldContinue && flags.throttleOnExceed) {
264
- const throttleMs = decision.decision === 'stop' ? 30000 :
265
- decision.decision === 'pause' ? 15000 : 5000;
287
+ if (isBlocking && flags.throttleOnExceed) {
288
+ const throttleMs = decision.decision === 'stop' ? 30000 : 15000;
266
289
  this.throttledAgents.set(agentId, Date.now() + throttleMs);
267
290
  }
268
291
  return {
@@ -271,7 +294,7 @@ export class ContinueGateIntegration {
271
294
  throttleMs: decision.decision === 'throttle' ? 5000 :
272
295
  decision.decision === 'pause' ? 15000 :
273
296
  decision.decision === 'stop' ? 30000 : undefined,
274
- escalate: decision.decision === 'stop' || decision.decision === 'pause',
297
+ escalate: isBlocking,
275
298
  reworkRatio: decision.metrics.reworkRatio,
276
299
  };
277
300
  }
@@ -131,8 +131,11 @@ export async function configureHooks(projectRoot, config) {
131
131
  {
132
132
  hooks: [
133
133
  {
134
+ // Claude Code delivers the prompt body on stdin as JSON
135
+ // (e.g. {"prompt":"..."}). $PROMPT is NOT exposed as an env
136
+ // var, so we let the CLI read stdin directly.
134
137
  type: 'command',
135
- command: 'npx agentic-qe hooks route --task "$PROMPT" --json',
138
+ command: 'npx agentic-qe hooks route --json',
136
139
  timeout: 5000,
137
140
  continueOnError: true,
138
141
  },
@@ -489,8 +489,11 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
489
489
  {
490
490
  hooks: [
491
491
  {
492
+ // Claude Code delivers the prompt body on stdin as JSON
493
+ // (e.g. {"prompt":"..."}). $PROMPT is NOT exposed as an env
494
+ // var, so we let the CLI read stdin directly.
492
495
  type: 'command',
493
- command: 'npx agentic-qe hooks route --task "$PROMPT" --json',
496
+ command: 'npx agentic-qe hooks route --json',
494
497
  timeout: 5000,
495
498
  continueOnError: true,
496
499
  },