agentic-qe 3.10.1 → 3.10.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (325) hide show
  1. package/.claude/hooks/README.txt +17 -0
  2. package/.claude/hooks/aqe-hook.cjs +98 -0
  3. package/.claude/hooks/cross-phase-memory.yaml +296 -0
  4. package/.claude/hooks/post-task-sync.sh +113 -0
  5. package/.claude/hooks/v3-domain-workers.json +121 -0
  6. package/.claude/skills/skills-manifest.json +1 -1
  7. package/CHANGELOG.md +76 -0
  8. package/dist/cli/bundle.js +5 -5
  9. package/dist/cli/chunks/adapter-CR6J5C76.js +2 -0
  10. package/dist/cli/chunks/{agent-booster-wasm-FZLWOPSX.js → agent-booster-wasm-DHSIPFTH.js} +2 -2
  11. package/dist/cli/chunks/{agent-handler-KAGRVCKS.js → agent-handler-FPQVHGGT.js} +2 -2
  12. package/dist/cli/chunks/{agent-memory-branch-JJKFEXQW.js → agent-memory-branch-OLOF5ZHV.js} +2 -2
  13. package/dist/cli/chunks/aqe-learning-engine-2MNTHMB6.js +2 -0
  14. package/dist/cli/chunks/{audit-DN5SY4JJ.js → audit-ALRYPHGP.js} +2 -2
  15. package/dist/cli/chunks/base-AOQNGMTL.js +2 -0
  16. package/dist/cli/chunks/{hnswlib-node-YX6OOBN6.js → better-sqlite3-5BT5FO64.js} +2 -2
  17. package/dist/cli/chunks/{brain-handler-O7MP5BGY.js → brain-handler-ROZUHCOT.js} +3 -3
  18. package/dist/cli/chunks/{branch-enumerator-ZPTN5J6V.js → branch-enumerator-VK7G4NKJ.js} +2 -2
  19. package/dist/cli/chunks/{browser-PAZE2JSD.js → browser-Q2S75M2F.js} +2 -2
  20. package/dist/cli/chunks/browser-workflow-UJ4A2ZXO.js +2 -0
  21. package/dist/cli/chunks/{chunk-WDTCCPK4.js → chunk-2244IFZA.js} +1 -1
  22. package/dist/cli/chunks/{chunk-WPNZSL4S.js → chunk-22D6VBPD.js} +1 -1
  23. package/dist/cli/chunks/{chunk-2KTRRSKD.js → chunk-24LUQICS.js} +2 -2
  24. package/dist/cli/chunks/{chunk-IHDUWPFY.js → chunk-2EDWGHDA.js} +2 -2
  25. package/dist/cli/chunks/{chunk-TP77PNN6.js → chunk-2JDLQWSV.js} +2 -2
  26. package/dist/cli/chunks/{chunk-GTGONWGX.js → chunk-2OH3ALYB.js} +1 -1
  27. package/dist/cli/chunks/{chunk-WMG5F6R6.js → chunk-3RHHKYUR.js} +2 -2
  28. package/dist/cli/chunks/{chunk-6E7GI2UB.js → chunk-3Z4FHA2E.js} +1 -1
  29. package/dist/cli/chunks/{chunk-JLKHPIQF.js → chunk-4BXGVM2C.js} +1 -1
  30. package/dist/cli/chunks/{chunk-6D57DWQ6.js → chunk-4F3ZTXHP.js} +2 -2
  31. package/dist/cli/chunks/{chunk-3YOPJ7DY.js → chunk-4GTDW2XL.js} +2 -2
  32. package/dist/cli/chunks/{chunk-W2DT3CDE.js → chunk-5HB54RUS.js} +2 -2
  33. package/dist/cli/chunks/{chunk-LF7URN2X.js → chunk-5PL7WTCU.js} +2 -2
  34. package/dist/cli/chunks/{chunk-Y357YFLF.js → chunk-5PRFFHFV.js} +2 -2
  35. package/dist/cli/chunks/{chunk-GXJ4BCGC.js → chunk-5QHSLWLP.js} +2 -2
  36. package/dist/cli/chunks/{chunk-TL5F2S3Z.js → chunk-5WJ3FWL4.js} +2 -2
  37. package/dist/cli/chunks/{chunk-ZTMWJQTZ.js → chunk-6KSCXPPL.js} +2 -2
  38. package/dist/cli/chunks/{chunk-SQBB2DC6.js → chunk-6NZHEM4V.js} +1 -1
  39. package/dist/cli/chunks/{chunk-EUJHHXE6.js → chunk-6ZFHIKQG.js} +2 -2
  40. package/dist/cli/chunks/{chunk-YPOTBXPU.js → chunk-7DKYCVJI.js} +2 -2
  41. package/dist/cli/chunks/{chunk-DQIS6J77.js → chunk-7IVQ6OVR.js} +2 -2
  42. package/dist/cli/chunks/{chunk-DMIYWPQQ.js → chunk-7IZ2OPC2.js} +2 -2
  43. package/dist/cli/chunks/{chunk-VOIWDPIU.js → chunk-7QRMARM7.js} +2 -2
  44. package/dist/cli/chunks/{chunk-KEC5FBAW.js → chunk-7SJX4CFK.js} +1 -1
  45. package/dist/cli/chunks/{chunk-2S4XHK26.js → chunk-7SWD3D6Y.js} +2 -2
  46. package/dist/cli/chunks/{chunk-RRLQFFCO.js → chunk-7V5UHLNY.js} +2 -2
  47. package/dist/cli/chunks/{chunk-G3BQU3Q6.js → chunk-7Z46RDDV.js} +2 -2
  48. package/dist/cli/chunks/{chunk-TNVYKYTO.js → chunk-A5RMQG4N.js} +3 -3
  49. package/dist/cli/chunks/{chunk-PXFQSVA2.js → chunk-AH7FXNFE.js} +3 -3
  50. package/dist/cli/chunks/{chunk-K22TPWOJ.js → chunk-AIUSZC6K.js} +2 -2
  51. package/dist/cli/chunks/{chunk-IK6AJX3C.js → chunk-AOI67HA3.js} +1 -1
  52. package/dist/cli/chunks/{chunk-6VQ5MFJ6.js → chunk-AV7KYE5P.js} +7 -7
  53. package/dist/cli/chunks/{chunk-GTRXZJNX.js → chunk-AWFIEGR3.js} +2 -2
  54. package/dist/cli/chunks/{chunk-6A2NIR2E.js → chunk-BQCSCAUC.js} +2 -2
  55. package/dist/cli/chunks/{chunk-NQZYUH6S.js → chunk-C2M74HCN.js} +1 -1
  56. package/dist/cli/chunks/{chunk-5EU2VQK3.js → chunk-CIRPP7RQ.js} +2 -2
  57. package/dist/cli/chunks/{chunk-Q5VHBI4U.js → chunk-CMACGG4Z.js} +1 -1
  58. package/dist/cli/chunks/{chunk-YGRTMAWB.js → chunk-CTDLI2ON.js} +1 -1
  59. package/dist/cli/chunks/{chunk-P7T5Y735.js → chunk-CV2SBMBW.js} +2 -2
  60. package/dist/cli/chunks/{chunk-UDFLR7GR.js → chunk-DMQPO43S.js} +1 -1
  61. package/dist/cli/chunks/{chunk-XKOKMS5A.js → chunk-DRWGK3YO.js} +2 -2
  62. package/dist/cli/chunks/{chunk-EBQ6YKP2.js → chunk-DZZEHPSJ.js} +2 -2
  63. package/dist/cli/chunks/{chunk-7SQD2TTQ.js → chunk-EA7ZSN3V.js} +1 -1
  64. package/dist/cli/chunks/{chunk-KKNBYXYA.js → chunk-EQBEGDTG.js} +1 -1
  65. package/dist/cli/chunks/{chunk-2UN4DOBJ.js → chunk-ETN5563K.js} +2 -2
  66. package/dist/cli/chunks/{chunk-BECU52UY.js → chunk-EVCOCGVJ.js} +3 -3
  67. package/dist/cli/chunks/{chunk-OC3OJWLB.js → chunk-FO43SQXP.js} +2 -2
  68. package/dist/cli/chunks/{chunk-CKECJH2A.js → chunk-FO73PZVU.js} +2 -2
  69. package/dist/cli/chunks/{chunk-Y2DPXMOR.js → chunk-FPAW77XV.js} +1 -1
  70. package/dist/cli/chunks/{chunk-UDVX34ZG.js → chunk-FY3CUPNN.js} +20 -17
  71. package/dist/cli/chunks/{chunk-EIROAH6N.js → chunk-G5U6Q42D.js} +2 -2
  72. package/dist/cli/chunks/{chunk-VKRMVTWU.js → chunk-HA63NBFK.js} +9 -9
  73. package/dist/cli/chunks/{chunk-2ETDES5W.js → chunk-HHCYSAH3.js} +2 -2
  74. package/dist/cli/chunks/{chunk-57NJQV57.js → chunk-HJME6G5M.js} +1 -1
  75. package/dist/cli/chunks/{chunk-BN7ERYXI.js → chunk-HJORBNXW.js} +1 -1
  76. package/dist/cli/chunks/{chunk-5KFCH7RH.js → chunk-HO37VP4O.js} +1 -1
  77. package/dist/cli/chunks/{chunk-622MIAOR.js → chunk-I677W5BT.js} +3 -3
  78. package/dist/cli/chunks/chunk-IAZEDWRX.js +2 -0
  79. package/dist/cli/chunks/{chunk-KRXKU54J.js → chunk-IICTTDAA.js} +2 -2
  80. package/dist/cli/chunks/{chunk-BGBSYF3K.js → chunk-JF53LRBL.js} +2 -2
  81. package/dist/cli/chunks/{chunk-RPL6K623.js → chunk-KB5L5TTF.js} +3 -3
  82. package/dist/cli/chunks/{chunk-Q24OJX44.js → chunk-L7VIX22Y.js} +2 -2
  83. package/dist/cli/chunks/{chunk-TFNLXAK5.js → chunk-LQTWPSYL.js} +1 -1
  84. package/dist/cli/chunks/{chunk-ECPB7IAH.js → chunk-LZCBSFAU.js} +4 -4
  85. package/dist/cli/chunks/{chunk-G5DTENO3.js → chunk-MCOFJHSJ.js} +2 -2
  86. package/dist/cli/chunks/{chunk-XRK7FBTY.js → chunk-MCZHKXB4.js} +2 -2
  87. package/dist/cli/chunks/{chunk-H44WD7QX.js → chunk-MEY43PIQ.js} +2 -2
  88. package/dist/cli/chunks/{chunk-WL2J6ECN.js → chunk-MMIQ5DMA.js} +2 -2
  89. package/dist/cli/chunks/{chunk-PUXDXIUE.js → chunk-MNUTRAUV.js} +1 -1
  90. package/dist/cli/chunks/{chunk-KCTH5MHE.js → chunk-MNV3E5KY.js} +2 -2
  91. package/dist/cli/chunks/{chunk-EO4B5GS4.js → chunk-MYWQTCS4.js} +1 -1
  92. package/dist/cli/chunks/{chunk-32R7EA7B.js → chunk-NZO4WUSO.js} +3 -3
  93. package/dist/cli/chunks/{chunk-NOCYYXK4.js → chunk-OIEQF7PG.js} +2 -2
  94. package/dist/cli/chunks/{chunk-IPRDHKSI.js → chunk-OIRZJCZY.js} +2 -2
  95. package/dist/cli/chunks/{chunk-ELZ67OHQ.js → chunk-ON4D4TJ4.js} +2 -2
  96. package/dist/cli/chunks/chunk-OPFN5LFT.js +95 -0
  97. package/dist/cli/chunks/{chunk-4AWJ5PE4.js → chunk-ORF2UKQH.js} +1 -1
  98. package/dist/cli/chunks/{chunk-6LRCMFLV.js → chunk-OWQ6HEYI.js} +2 -2
  99. package/dist/cli/chunks/{chunk-GRG3OP34.js → chunk-OXCEUR5F.js} +2 -2
  100. package/dist/cli/chunks/{chunk-SLNGJW4G.js → chunk-PEK6NGVJ.js} +1 -1
  101. package/dist/cli/chunks/{chunk-5ZCVMR5E.js → chunk-PIZYRPMT.js} +2 -2
  102. package/dist/cli/chunks/{chunk-K4T3RDCB.js → chunk-PXTDEO65.js} +2 -2
  103. package/dist/cli/chunks/{chunk-GRYXNWPF.js → chunk-PYIHZXCI.js} +12 -12
  104. package/dist/cli/chunks/{chunk-HRDGN3OK.js → chunk-QBRHKTFT.js} +1 -1
  105. package/dist/cli/chunks/{chunk-COZDJLIL.js → chunk-QEPFXY6G.js} +1 -1
  106. package/dist/cli/chunks/{chunk-HPNEZ7YN.js → chunk-QJ2EHLJ2.js} +1 -1
  107. package/dist/cli/chunks/{chunk-GMKGLZJU.js → chunk-QQNCSEZG.js} +2 -2
  108. package/dist/cli/chunks/{chunk-CR4ERDS2.js → chunk-QSE67XJO.js} +2 -2
  109. package/dist/cli/chunks/{chunk-7CKVAYP3.js → chunk-R2O6OKT2.js} +1 -1
  110. package/dist/cli/chunks/{chunk-OVENSL64.js → chunk-RLXTBL3H.js} +8 -8
  111. package/dist/cli/chunks/{chunk-PW6MOFXG.js → chunk-RNREAOY4.js} +2 -2
  112. package/dist/cli/chunks/{chunk-YYWIA5FX.js → chunk-S3OZ7XSY.js} +1 -1
  113. package/dist/cli/chunks/{chunk-KZJXVIAW.js → chunk-S3ZO7JXS.js} +2 -2
  114. package/dist/cli/chunks/{chunk-ZEMXMDD3.js → chunk-SJH3HYNC.js} +2 -2
  115. package/dist/cli/chunks/{chunk-5OTYBWRL.js → chunk-STEGWLH5.js} +2 -2
  116. package/dist/cli/chunks/{chunk-F3OVFA6W.js → chunk-SVYTN2GT.js} +2 -2
  117. package/dist/cli/chunks/{chunk-QNW335PD.js → chunk-SW4OKUTC.js} +2 -2
  118. package/dist/cli/chunks/{chunk-WS4XVJHI.js → chunk-THRTUW4Z.js} +1 -1
  119. package/dist/cli/chunks/{chunk-NPSBMDVU.js → chunk-TJKDATEU.js} +2 -2
  120. package/dist/cli/chunks/{chunk-H22MMMYY.js → chunk-U3EUH6LX.js} +2 -2
  121. package/dist/cli/chunks/{chunk-FJSR2U65.js → chunk-UUFOHMUG.js} +2 -2
  122. package/dist/cli/chunks/{chunk-RWYW573C.js → chunk-UVU7XLJY.js} +3 -3
  123. package/dist/cli/chunks/{chunk-BF7MUYWC.js → chunk-UWXH2UQK.js} +2 -2
  124. package/dist/cli/chunks/{chunk-UU2Q6XWF.js → chunk-UYYBPWU3.js} +1 -1
  125. package/dist/cli/chunks/{chunk-AUVC3DDB.js → chunk-VSUTI4G6.js} +2 -2
  126. package/dist/cli/chunks/{chunk-25QGPRWN.js → chunk-WDMPJ2M2.js} +2 -2
  127. package/dist/cli/chunks/{chunk-MVGVD6LS.js → chunk-WNR2KAUH.js} +2 -2
  128. package/dist/cli/chunks/{chunk-NDCPEXDN.js → chunk-WSVUSIAZ.js} +2 -2
  129. package/dist/cli/chunks/{chunk-T3UXMPXX.js → chunk-WZJUMJ2S.js} +1 -1
  130. package/dist/cli/chunks/{chunk-TX7SNQKL.js → chunk-X2VAOIUY.js} +1 -1
  131. package/dist/cli/chunks/{chunk-DVOH75S4.js → chunk-XDSA7YUQ.js} +1 -1
  132. package/dist/cli/chunks/{chunk-TNGGVMPQ.js → chunk-XDU624HU.js} +1 -1
  133. package/dist/cli/chunks/{chunk-6ZRMQXVL.js → chunk-XGBAHAGC.js} +2 -2
  134. package/dist/cli/chunks/{chunk-IITKJCPK.js → chunk-XMJTTF5N.js} +2 -2
  135. package/dist/cli/chunks/{chunk-2TDWCXZ6.js → chunk-XPCNUX2U.js} +2 -2
  136. package/dist/cli/chunks/{chunk-W6ZF2CPN.js → chunk-XRJECWZE.js} +1 -1
  137. package/dist/cli/chunks/{chunk-MQYTW2IN.js → chunk-XTCUN36Z.js} +2 -2
  138. package/dist/cli/chunks/{chunk-7MSYTHZM.js → chunk-Y63MBMOV.js} +2 -2
  139. package/dist/cli/chunks/{chunk-6QFONVEE.js → chunk-YACT5WFC.js} +2 -2
  140. package/dist/cli/chunks/{chunk-PLRSKAFZ.js → chunk-YI6GNRQM.js} +2 -2
  141. package/dist/cli/chunks/chunk-YNNOY3XN.js +62 -0
  142. package/dist/cli/chunks/{chunk-XGUQYVJR.js → chunk-YWZHMXTO.js} +2 -2
  143. package/dist/cli/chunks/{chunk-OQP5OFRR.js → chunk-ZDHMZPSL.js} +1 -1
  144. package/dist/cli/chunks/{chunk-NRLT44YB.js → chunk-ZGNZJJFF.js} +1 -1
  145. package/dist/cli/chunks/{chunk-ELUERFGA.js → chunk-ZK2BH23O.js} +2 -2
  146. package/dist/cli/chunks/{chunk-AABKTWXC.js → chunk-ZQUXNG5X.js} +2 -2
  147. package/dist/cli/chunks/{chunk-WQEZKAUR.js → chunk-ZXTO4C7R.js} +2 -2
  148. package/dist/cli/chunks/{ci-EHRUN7O6.js → ci-PYCRCL7G.js} +2 -2
  149. package/dist/cli/chunks/{ci-output-EXDXVXKB.js → ci-output-EKQQFE2D.js} +2 -2
  150. package/dist/cli/chunks/{circuit-breaker-LM4QRAAL.js → circuit-breaker-RH3Q2MJO.js} +2 -2
  151. package/dist/cli/chunks/{claude-flow-setup-ZHUCZVW7.js → claude-flow-setup-DUDXB4VV.js} +2 -2
  152. package/dist/cli/chunks/client-RDPWGOSA.js +2 -0
  153. package/dist/cli/chunks/{cline-installer-WMFLQOW2.js → cline-installer-3Q4WIWUG.js} +2 -2
  154. package/dist/cli/chunks/{code-L7KRLU5E.js → code-E4Q6DGOO.js} +2 -2
  155. package/dist/cli/chunks/{code-index-extractor-FTMUYQC6.js → code-index-extractor-2PCISUOW.js} +2 -2
  156. package/dist/cli/chunks/{codex-installer-B3F6WI3Z.js → codex-installer-YNNNOLJ6.js} +2 -2
  157. package/dist/cli/chunks/{completions-3JZQRNB6.js → completions-2F7TUFBD.js} +2 -2
  158. package/dist/cli/chunks/{complexity-analyzer-LB2FFEKX.js → complexity-analyzer-2B6MHO7W.js} +2 -2
  159. package/dist/cli/chunks/{continuedev-installer-WH6IMV7R.js → continuedev-installer-ENOKRU5M.js} +2 -2
  160. package/dist/cli/chunks/{copilot-installer-NOIEOFJM.js → copilot-installer-6YD2KM5F.js} +2 -2
  161. package/dist/cli/chunks/{cost-tracker-IKX2VYSA.js → cost-tracker-FCH4QOEA.js} +2 -2
  162. package/dist/cli/chunks/{coverage-TD37CYSY.js → coverage-JTOXZE3T.js} +3 -3
  163. package/dist/cli/chunks/cross-domain-router-4K5ZVZEZ.js +2 -0
  164. package/dist/cli/chunks/{cursor-installer-4NSVGRM5.js → cursor-installer-QZFBUGLQ.js} +2 -2
  165. package/dist/cli/chunks/{daemon-LYDV7NRW.js → daemon-K4QFB5FQ.js} +3 -3
  166. package/dist/cli/chunks/{daemon-UWEBUIDT.js → daemon-M422U3ZA.js} +4 -4
  167. package/dist/cli/chunks/{dag-attention-scheduler-NECJGCHC.js → dag-attention-scheduler-BXAAW33V.js} +2 -2
  168. package/dist/cli/chunks/{detect-4XGC7ILO.js → detect-UGSWIOAD.js} +2 -2
  169. package/dist/cli/chunks/{dist-node-GGJDXRKJ.js → dist-node-FN3HX3OK.js} +2 -2
  170. package/dist/cli/chunks/{domain-handler-UOFONAUT.js → domain-handler-7PP7VYA7.js} +2 -2
  171. package/dist/cli/chunks/{domain-transfer-6JLNOYPA.js → domain-transfer-XZM44W7I.js} +2 -2
  172. package/dist/cli/chunks/dream-RPNWM7VS.js +2 -0
  173. package/dist/cli/chunks/{embed-and-insert-pattern-ZM75DQ4J.js → embed-and-insert-pattern-JZVERJ5L.js} +2 -2
  174. package/dist/cli/chunks/{eval-CYZJTHEB.js → eval-466NFF2D.js} +2 -2
  175. package/dist/cli/chunks/{experience-capture-middleware-RBOJLDUB.js → experience-capture-middleware-I7IQCC7V.js} +3 -3
  176. package/dist/cli/chunks/{fast-paths-S5BWZR3L.js → fast-paths-34OICNZA.js} +2 -2
  177. package/dist/cli/chunks/{feature-flags-6E7H3NYP.js → feature-flags-6UBIVTAD.js} +2 -2
  178. package/dist/cli/chunks/{feature-flags-DUNQPDU3.js → feature-flags-X5WBBWSO.js} +2 -2
  179. package/dist/cli/chunks/{file-discovery-PFFKDGYG.js → file-discovery-NLMDBWXX.js} +2 -2
  180. package/dist/cli/chunks/{fleet-RCDZZFXN.js → fleet-W7CYCHDI.js} +3 -3
  181. package/dist/cli/chunks/{gnn-wrapper-5AG3WDWF.js → gnn-wrapper-K4VTAG5X.js} +2 -2
  182. package/dist/cli/chunks/{heartbeat-handler-O2KAEX4Y.js → heartbeat-handler-ZGKF2Z6T.js} +4 -4
  183. package/dist/cli/chunks/heartbeat-scheduler-JBCXMMZO.js +2 -0
  184. package/dist/cli/chunks/hnsw-adapter-3SC2HZIG.js +2 -0
  185. package/dist/cli/chunks/hnsw-index-FQORAR6K.js +2 -0
  186. package/dist/cli/chunks/{hnsw-legacy-bridge-C7FG6YGW.js → hnsw-legacy-bridge-ELDRLKK5.js} +2 -2
  187. package/dist/cli/chunks/{better-sqlite3-XGPW4HK5.js → hnswlib-node-ZGSUMHDC.js} +2 -2
  188. package/dist/cli/chunks/{hooks-FUHNE2P7.js → hooks-T4CBINAV.js} +13 -13
  189. package/dist/cli/chunks/hybrid-router-6CBFDXPR.js +2 -0
  190. package/dist/cli/chunks/{hypergraph-engine-LQRYBNPV.js → hypergraph-engine-UWFW3XP5.js} +2 -2
  191. package/dist/cli/chunks/{hypergraph-handler-AFFNLZVD.js → hypergraph-handler-PK2BI46K.js} +3 -3
  192. package/dist/cli/chunks/impact-analyzer-SOEFVZWG.js +2 -0
  193. package/dist/cli/chunks/{init-handler-BQ6IDBX4.js → init-handler-HNG6KJOU.js} +6 -6
  194. package/dist/cli/chunks/init-wizard-3E4IU5M4.js +2 -0
  195. package/dist/cli/chunks/kernel-GFZP4G5J.js +2 -0
  196. package/dist/cli/chunks/{kilocode-installer-KS72HUSG.js → kilocode-installer-25V7FEJ4.js} +2 -2
  197. package/dist/cli/chunks/{kiro-installer-2ZEFLGRX.js → kiro-installer-7RMTTCQB.js} +2 -2
  198. package/dist/cli/chunks/knowledge-graph-BKRKBU26.js +2 -0
  199. package/dist/cli/chunks/{learning-GGHGJ6B6.js → learning-XQC2MG2R.js} +3 -3
  200. package/dist/cli/chunks/{llm-router-LP6K5BJF.js → llm-router-6KTTONH4.js} +4 -4
  201. package/dist/cli/chunks/llm-router-service-KE4IGZPP.js +2 -0
  202. package/dist/cli/chunks/{load-2MLKXOT2.js → load-BV64P3AL.js} +2 -2
  203. package/dist/cli/chunks/load-test-VSYJV2AO.js +2 -0
  204. package/dist/cli/chunks/{mcp-CDJBJG5H.js → mcp-U5ZN77TA.js} +2 -2
  205. package/dist/cli/chunks/{memory-4LAX7JZS.js → memory-WB5BNBK7.js} +5 -5
  206. package/dist/cli/chunks/memory-backend-B72RGHRF.js +2 -0
  207. package/dist/cli/chunks/{memory-handlers-OBAFR4WV.js → memory-handlers-NWCH7AUO.js} +2 -2
  208. package/dist/cli/chunks/{multi-model-executor-SLJV73HE.js → multi-model-executor-3X3W3UTY.js} +2 -2
  209. package/dist/cli/chunks/{opencode-installer-M76SONWV.js → opencode-installer-TTTMG7ZZ.js} +2 -2
  210. package/dist/cli/chunks/{orchestrator-TJPUDJMP.js → orchestrator-BLCGSHMZ.js} +18 -18
  211. package/dist/cli/chunks/{pipeline-2PVNFT6J.js → pipeline-DZPGMRG7.js} +2 -2
  212. package/dist/cli/chunks/{platform-KCSEDKEE.js → platform-EVMZAUNV.js} +2 -2
  213. package/dist/cli/chunks/{plugin-QX47QF5U.js → plugin-OR55K4HT.js} +2 -2
  214. package/dist/cli/chunks/{prime-radiant-advanced-wasm-L6VWL7VR.js → prime-radiant-advanced-wasm-4ODV27HD.js} +2 -2
  215. package/dist/cli/chunks/protocol-executor-V3F37FPO.js +2 -0
  216. package/dist/cli/chunks/{protocol-handler-WDNJDEUE.js → protocol-handler-ZOTI5PID.js} +2 -2
  217. package/dist/cli/chunks/{prove-3B75DA3S.js → prove-DIMBYJ7V.js} +2 -2
  218. package/dist/cli/chunks/provider-manager-2PN72TT6.js +2 -0
  219. package/dist/cli/chunks/qe-reasoning-bank-P665QNIR.js +2 -0
  220. package/dist/cli/chunks/{quality-UGASS5WM.js → quality-7MX4VL6M.js} +2 -2
  221. package/dist/cli/chunks/queen-coordinator-XD4F7BGB.js +2 -0
  222. package/dist/cli/chunks/{real-embeddings-COBP2LHS.js → real-embeddings-YPUHWRN2.js} +2 -2
  223. package/dist/cli/chunks/{roocode-installer-TOZ4VLFT.js → roocode-installer-WG5AU4QM.js} +2 -2
  224. package/dist/cli/chunks/router-4SSNWDJC.js +2 -0
  225. package/dist/cli/chunks/routing-feedback-O2JSIBW6.js +2 -0
  226. package/dist/cli/chunks/{routing-handler-5TDVSILX.js → routing-handler-LZB4MN2K.js} +2 -2
  227. package/dist/cli/chunks/{ruvector-commands-AM63KWQN.js → ruvector-commands-YE4ADBMC.js} +2 -2
  228. package/dist/cli/chunks/{rvf-dual-writer-UANIFE2M.js → rvf-dual-writer-QS5ATW4C.js} +2 -2
  229. package/dist/cli/chunks/{rvf-migration-adapter-LNPYWAPI.js → rvf-migration-adapter-YIGKSBD3.js} +2 -2
  230. package/dist/cli/chunks/{rvf-migration-coordinator-U47L63DQ.js → rvf-migration-coordinator-2NDCWP7F.js} +2 -2
  231. package/dist/cli/chunks/rvf-native-adapter-WIUHYXRB.js +2 -0
  232. package/dist/cli/chunks/safe-db-WL5Y7ZNS.js +2 -0
  233. package/dist/cli/chunks/schedule-U7QDGU5A.js +2 -0
  234. package/dist/cli/chunks/scheduler-LXKGQYXA.js +2 -0
  235. package/dist/cli/chunks/{security-KDQ2AH7G.js → security-HT4SUT24.js} +3 -3
  236. package/dist/cli/chunks/{shared-rvf-adapter-5MAGLLYJ.js → shared-rvf-adapter-4IZOJL33.js} +2 -2
  237. package/dist/cli/chunks/{shared-rvf-dual-writer-GF2OPPM5.js → shared-rvf-dual-writer-ZKFO7CBY.js} +2 -2
  238. package/dist/cli/chunks/sqlite-persistence-4KFO3SEB.js +2 -0
  239. package/dist/cli/chunks/{status-handler-XZKEL7LO.js → status-handler-AMEMKBI4.js} +2 -2
  240. package/dist/cli/chunks/{structural-health-27QKWW25.js → structural-health-RBADRLC3.js} +2 -2
  241. package/dist/cli/chunks/{sync-V3HGPEJT.js → sync-ARDDLQBS.js} +2 -2
  242. package/dist/cli/chunks/{sync-INNKS6UK.js → sync-PCB23M4K.js} +2 -2
  243. package/dist/cli/chunks/{task-handler-LDUVOM6G.js → task-handler-J26FSCH5.js} +2 -2
  244. package/dist/cli/chunks/{task-handlers-HTCPV7OO.js → task-handlers-AQRLR6BL.js} +3 -3
  245. package/dist/cli/chunks/{test-PCUVGVJL.js → test-YXWSIOSB.js} +4 -4
  246. package/dist/cli/chunks/{test-scheduling-GYVXWCAA.js → test-scheduling-XY532GI4.js} +3 -3
  247. package/dist/cli/chunks/{token-bootstrap-MJ2ANC4P.js → token-bootstrap-KL2QIQ36.js} +2 -2
  248. package/dist/cli/chunks/{token-usage-ZREHROTF.js → token-usage-2MJVE4DT.js} +2 -2
  249. package/dist/cli/chunks/{transformers-6B3FWFYL.js → transformers-QSNTOD2Z.js} +2 -2
  250. package/dist/cli/chunks/{tree-sitter-wasm-parser-JVV234MN.js → tree-sitter-wasm-parser-QJOKHOIW.js} +2 -2
  251. package/dist/cli/chunks/{types-MVZTJI2F.js → types-RNKRSYMO.js} +2 -2
  252. package/dist/cli/chunks/unified-memory-7AS4LIEF.js +2 -0
  253. package/dist/cli/chunks/unified-memory-hnsw-GREESNJX.js +2 -0
  254. package/dist/cli/chunks/unified-persistence-BPJOMZOA.js +2 -0
  255. package/dist/cli/chunks/{upgrade-MKTFEILD.js → upgrade-EKJHIFWP.js} +2 -2
  256. package/dist/cli/chunks/{validate-IABGALSW.js → validate-KS4T7LWC.js} +2 -2
  257. package/dist/cli/chunks/{validate-swarm-RHF53RF6.js → validate-swarm-SKKWRP2H.js} +2 -2
  258. package/dist/cli/chunks/{vibium-RAKW6FMF.js → vibium-FLUQO4IF.js} +2 -2
  259. package/dist/cli/chunks/visual-security-BW662FHQ.js +2 -0
  260. package/dist/cli/chunks/{web-tree-sitter-PYK7F4JZ.js → web-tree-sitter-UMC63DWD.js} +2 -2
  261. package/dist/cli/chunks/{windsurf-installer-S3U2HWZ4.js → windsurf-installer-V3FQGJIQ.js} +2 -2
  262. package/dist/cli/chunks/{witness-chain-435NKQLB.js → witness-chain-GE74TLSO.js} +2 -2
  263. package/dist/cli/chunks/witness-chain-OXVDLNVT.js +2 -0
  264. package/dist/cli/chunks/{workflow-5UHJCZ6J.js → workflow-4YZ2RPWA.js} +4 -4
  265. package/dist/cli/chunks/workflow-orchestrator-KKNR46XV.js +2 -0
  266. package/dist/cli/chunks/{wrappers-RD3NCMLK.js → wrappers-37NLMKPE.js} +2 -2
  267. package/dist/cli/commands/hooks-handlers/command-hooks.js +1 -1
  268. package/dist/cli/commands/hooks-handlers/routing-hooks.js +1 -1
  269. package/dist/cli/commands/hooks-handlers/task-hooks.js +1 -1
  270. package/dist/init/init-wizard-hooks.js +271 -271
  271. package/dist/init/phases/07-hooks.d.ts +7 -0
  272. package/dist/init/phases/07-hooks.js +132 -96
  273. package/dist/learning/agent-routing.d.ts +19 -0
  274. package/dist/learning/agent-routing.js +27 -1
  275. package/dist/learning/dream/dream-scheduler.d.ts +11 -36
  276. package/dist/learning/dream/dream-scheduler.js +44 -0
  277. package/dist/learning/experience-consolidation.d.ts +16 -0
  278. package/dist/learning/experience-consolidation.js +55 -11
  279. package/dist/learning/pattern-lifecycle.d.ts +21 -0
  280. package/dist/learning/pattern-lifecycle.js +70 -6
  281. package/dist/mcp/bundle.js +352 -349
  282. package/dist/mcp/protocol-server.js +13 -14
  283. package/dist/mcp/transport/stdio.d.ts +20 -0
  284. package/dist/mcp/transport/stdio.js +35 -2
  285. package/dist/shared/utils/rabitq.d.ts +133 -0
  286. package/dist/shared/utils/rabitq.js +201 -0
  287. package/package.json +8 -2
  288. package/dist/cli/chunks/adapter-3JS2CN7C.js +0 -2
  289. package/dist/cli/chunks/aqe-learning-engine-Q4GFNGU6.js +0 -2
  290. package/dist/cli/chunks/base-Q3MAL22Y.js +0 -2
  291. package/dist/cli/chunks/browser-workflow-JX3M2UWG.js +0 -2
  292. package/dist/cli/chunks/chunk-IJ4BUSJN.js +0 -95
  293. package/dist/cli/chunks/chunk-VPCE5CIT.js +0 -2
  294. package/dist/cli/chunks/chunk-WO7KYT3X.js +0 -62
  295. package/dist/cli/chunks/client-PA3UJIHH.js +0 -2
  296. package/dist/cli/chunks/cross-domain-router-BVJRP2ZX.js +0 -2
  297. package/dist/cli/chunks/dream-BXZUEIW2.js +0 -2
  298. package/dist/cli/chunks/heartbeat-scheduler-LEKAWFJF.js +0 -2
  299. package/dist/cli/chunks/hnsw-adapter-2TCEG5M2.js +0 -2
  300. package/dist/cli/chunks/hnsw-index-VDPUTEES.js +0 -2
  301. package/dist/cli/chunks/hybrid-router-2EMDIYIG.js +0 -2
  302. package/dist/cli/chunks/impact-analyzer-HFD6CPWC.js +0 -2
  303. package/dist/cli/chunks/init-wizard-552QIVRC.js +0 -2
  304. package/dist/cli/chunks/kernel-5DN6O6EE.js +0 -2
  305. package/dist/cli/chunks/knowledge-graph-76Y77MB6.js +0 -2
  306. package/dist/cli/chunks/llm-router-service-4O6GCEFH.js +0 -2
  307. package/dist/cli/chunks/load-test-FCI2IWRJ.js +0 -2
  308. package/dist/cli/chunks/memory-backend-MKNCBNDE.js +0 -2
  309. package/dist/cli/chunks/protocol-executor-IA7WNT23.js +0 -2
  310. package/dist/cli/chunks/provider-manager-3K5KB5A6.js +0 -2
  311. package/dist/cli/chunks/qe-reasoning-bank-V5Z3BBYY.js +0 -2
  312. package/dist/cli/chunks/queen-coordinator-QOMPA27Z.js +0 -2
  313. package/dist/cli/chunks/router-P5RZUPC4.js +0 -2
  314. package/dist/cli/chunks/routing-feedback-3PS3OZQC.js +0 -2
  315. package/dist/cli/chunks/rvf-native-adapter-TT7OJPKM.js +0 -2
  316. package/dist/cli/chunks/safe-db-PEW7VBAE.js +0 -2
  317. package/dist/cli/chunks/schedule-QHOTHBQE.js +0 -2
  318. package/dist/cli/chunks/scheduler-KXJBYTRT.js +0 -2
  319. package/dist/cli/chunks/sqlite-persistence-TPXJK34J.js +0 -2
  320. package/dist/cli/chunks/unified-memory-ROS2NKR5.js +0 -2
  321. package/dist/cli/chunks/unified-memory-hnsw-FLEUF3XO.js +0 -2
  322. package/dist/cli/chunks/unified-persistence-QC5L7UNQ.js +0 -2
  323. package/dist/cli/chunks/visual-security-NLIOUQCR.js +0 -2
  324. package/dist/cli/chunks/witness-chain-U7X6JX5J.js +0 -2
  325. package/dist/cli/chunks/workflow-orchestrator-APE6BAXH.js +0 -2
@@ -172,6 +172,9 @@ export class HooksPhase extends BasePhase {
172
172
  this.installBrainCheckpoint(projectRoot, context);
173
173
  // Install statusline-v3 helper into .claude/helpers/
174
174
  this.installStatusline(projectRoot, context);
175
+ // Install the resilient hook shim into .claude/hooks/ — the generated
176
+ // settings.json hooks invoke it (`node .../aqe-hook.cjs <cmd>`).
177
+ this.installHookShim(projectRoot, context);
175
178
  // Install cross-phase memory config
176
179
  const crossPhasePath = join(hooksDir, 'cross-phase-memory.yaml');
177
180
  if (!existsSync(crossPhasePath)) {
@@ -290,40 +293,73 @@ export class HooksPhase extends BasePhase {
290
293
  context.services.log(' Installed statusline-v3.cjs (generated)');
291
294
  }
292
295
  }
296
+ /**
297
+ * Install the resilient hook shim (aqe-hook.cjs) into .claude/hooks/.
298
+ * The generated settings.json hooks run `node .../aqe-hook.cjs <cmd>` — the
299
+ * shim resolves a project-local AQE bundle (or falls back to npx), strips
300
+ * init noise from stdout, swallows stderr, and always exits 0.
301
+ */
302
+ installHookShim(projectRoot, context) {
303
+ const destDir = join(projectRoot, '.claude', 'hooks');
304
+ if (!existsSync(destDir)) {
305
+ mkdirSync(destDir, { recursive: true });
306
+ }
307
+ const destPath = join(destDir, 'aqe-hook.cjs');
308
+ // Source candidates: the installed dependency, then this package's own copy
309
+ // (resolved relative to the compiled init module — works for npx too).
310
+ const sourcePaths = [
311
+ join(projectRoot, 'node_modules', 'agentic-qe', '.claude', 'hooks', 'aqe-hook.cjs'),
312
+ join(__dirname, '..', '..', '..', '.claude', 'hooks', 'aqe-hook.cjs'),
313
+ ];
314
+ for (const src of sourcePaths) {
315
+ if (existsSync(src) && src !== destPath) {
316
+ const { copyFileSync } = require('fs');
317
+ copyFileSync(src, destPath);
318
+ context.services.log(' Installed aqe-hook.cjs (copied)');
319
+ return;
320
+ }
321
+ }
322
+ if (existsSync(destPath)) {
323
+ // Already present (e.g. dogfooding this repo) — leave it.
324
+ return;
325
+ }
326
+ // Should not happen for a real install (the file ships in the package).
327
+ context.services.log(' ⚠ aqe-hook.cjs source not found — hooks will fall back to `npx agentic-qe`');
328
+ }
293
329
  /**
294
330
  * Generate a minimal statusline-v3.cjs script as a fallback.
295
331
  * Used when the full asset isn't available for copying.
296
332
  */
297
333
  generateMinimalStatuslineScript() {
298
- return `#!/usr/bin/env node
299
- /**
300
- * Agentic QE v3 Statusline (minimal fallback, generated by aqe init)
301
- * For the full statusline, reinstall: npx agentic-qe init --auto
302
- */
303
- const fs = require('fs');
304
- const path = require('path');
305
- const { execFileSync } = require('child_process');
306
-
307
- function q(bin, args, d) { try { return execFileSync(bin, args, { encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'] }).trim(); } catch { return d || ''; } }
308
-
309
- const dir = path.resolve(__dirname, '..', '..');
310
- const dbPath = path.join(dir, '.agentic-qe', 'memory.db');
311
- let patterns = 0;
312
- try {
313
- if (fs.existsSync(dbPath)) {
314
- const Database = require('better-sqlite3');
315
- const db = new Database(dbPath, { readonly: true, fileMustExist: true });
316
- db.pragma('busy_timeout = 5000');
317
- patterns = db.prepare("SELECT COUNT(*) AS c FROM qe_patterns WHERE usage_count > 0 OR quality_score > 0 OR name NOT LIKE 'bench-%'").get()?.c || 0;
318
- db.close();
319
- }
320
- } catch { /* ignore */ }
321
-
322
- const branch = q('git', ['branch', '--show-current']);
323
- const branchStr = branch ? \` \\x1b[34m⎇ \${branch}\\x1b[0m\` : '';
324
- const patStr = patterns > 0 ? \` \\x1b[35m🎓 \${patterns} patterns\\x1b[0m\` : '';
325
-
326
- console.log(\`\\x1b[1m\\x1b[35m▊ Agentic QE v3\\x1b[0m\${branchStr}\${patStr}\`);
334
+ return `#!/usr/bin/env node
335
+ /**
336
+ * Agentic QE v3 Statusline (minimal fallback, generated by aqe init)
337
+ * For the full statusline, reinstall: npx agentic-qe init --auto
338
+ */
339
+ const fs = require('fs');
340
+ const path = require('path');
341
+ const { execFileSync } = require('child_process');
342
+
343
+ function q(bin, args, d) { try { return execFileSync(bin, args, { encoding: 'utf-8', timeout: 3000, stdio: ['pipe', 'pipe', 'pipe'] }).trim(); } catch { return d || ''; } }
344
+
345
+ const dir = path.resolve(__dirname, '..', '..');
346
+ const dbPath = path.join(dir, '.agentic-qe', 'memory.db');
347
+ let patterns = 0;
348
+ try {
349
+ if (fs.existsSync(dbPath)) {
350
+ const Database = require('better-sqlite3');
351
+ const db = new Database(dbPath, { readonly: true, fileMustExist: true });
352
+ db.pragma('busy_timeout = 5000');
353
+ patterns = db.prepare("SELECT COUNT(*) AS c FROM qe_patterns WHERE usage_count > 0 OR quality_score > 0 OR name NOT LIKE 'bench-%'").get()?.c || 0;
354
+ db.close();
355
+ }
356
+ } catch { /* ignore */ }
357
+
358
+ const branch = q('git', ['branch', '--show-current']);
359
+ const branchStr = branch ? \` \\x1b[34m⎇ \${branch}\\x1b[0m\` : '';
360
+ const patStr = patterns > 0 ? \` \\x1b[35m🎓 \${patterns} patterns\\x1b[0m\` : '';
361
+
362
+ console.log(\`\\x1b[1m\\x1b[35m▊ Agentic QE v3\\x1b[0m\${branchStr}\${patStr}\`);
327
363
  `;
328
364
  }
329
365
  /**
@@ -331,62 +367,62 @@ console.log(\`\\x1b[1m\\x1b[35m▊ Agentic QE v3\\x1b[0m\${branchStr}\${patStr}\
331
367
  * Used when the source file isn't available for copying.
332
368
  */
333
369
  generateBrainCheckpointScript() {
334
- return `#!/usr/bin/env node
335
- /**
336
- * Brain Checkpoint Helper (generated by aqe init)
337
- *
338
- * Usage:
339
- * node brain-checkpoint.cjs export # Export brain to aqe.rvf (session-end)
340
- * node brain-checkpoint.cjs verify # Verify aqe.rvf exists (session-start)
341
- */
342
- const { execFileSync } = require('child_process');
343
- const fs = require('fs');
344
- const path = require('path');
345
-
346
- const PROJECT_ROOT = path.resolve(__dirname, '..', '..');
347
- const AQE_DIR = path.join(PROJECT_ROOT, '.agentic-qe');
348
- const RVF_PATH = path.join(AQE_DIR, 'aqe.rvf');
349
- const DB_PATH = path.join(AQE_DIR, 'memory.db');
350
- const MAX_AGE_HOURS = 24;
351
-
352
- function log(msg) { process.stderr.write('[brain-checkpoint] ' + msg + '\\n'); }
353
-
354
- function exportBrain() {
355
- if (!fs.existsSync(DB_PATH)) { log('No memory.db, skipping'); return { exported: false }; }
356
- try {
357
- if (fs.existsSync(RVF_PATH)) fs.unlinkSync(RVF_PATH);
358
- const idmap = RVF_PATH + '.idmap.json';
359
- if (fs.existsSync(idmap)) fs.unlinkSync(idmap);
360
- const result = execFileSync(
361
- 'npx', ['agentic-qe', 'brain', 'export', '-o', RVF_PATH, '--format', 'rvf'],
362
- { timeout: 60000, encoding: 'utf-8' }
363
- );
364
- const m = result.match(/Patterns:\\s+(\\d+)/);
365
- const p = m ? m[1] : '0';
366
- log('Exported ' + p + ' patterns to aqe.rvf');
367
- return { exported: true, patterns: parseInt(p) };
368
- } catch (e) {
369
- log('Export failed: ' + e.message);
370
- return { exported: false, reason: e.message };
371
- }
372
- }
373
-
374
- function verifyBrain() {
375
- if (!fs.existsSync(RVF_PATH)) {
376
- log('No aqe.rvf found');
377
- return { valid: false, reason: 'missing' };
378
- }
379
- const stat = fs.statSync(RVF_PATH);
380
- const ageH = (Date.now() - stat.mtimeMs) / 3600000;
381
- if (stat.size < 1024) { log('aqe.rvf too small'); return { valid: false, reason: 'too-small' }; }
382
- if (ageH > MAX_AGE_HOURS) { log('aqe.rvf is ' + ageH.toFixed(1) + 'h old'); return { valid: true, stale: true }; }
383
- log('aqe.rvf OK (' + (stat.size/1048576).toFixed(1) + ' MB)');
384
- return { valid: true, stale: false };
385
- }
386
-
387
- const cmd = process.argv[2] || 'verify';
388
- const result = cmd === 'export' ? exportBrain() : verifyBrain();
389
- if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
370
+ return `#!/usr/bin/env node
371
+ /**
372
+ * Brain Checkpoint Helper (generated by aqe init)
373
+ *
374
+ * Usage:
375
+ * node brain-checkpoint.cjs export # Export brain to aqe.rvf (session-end)
376
+ * node brain-checkpoint.cjs verify # Verify aqe.rvf exists (session-start)
377
+ */
378
+ const { execFileSync } = require('child_process');
379
+ const fs = require('fs');
380
+ const path = require('path');
381
+
382
+ const PROJECT_ROOT = path.resolve(__dirname, '..', '..');
383
+ const AQE_DIR = path.join(PROJECT_ROOT, '.agentic-qe');
384
+ const RVF_PATH = path.join(AQE_DIR, 'aqe.rvf');
385
+ const DB_PATH = path.join(AQE_DIR, 'memory.db');
386
+ const MAX_AGE_HOURS = 24;
387
+
388
+ function log(msg) { process.stderr.write('[brain-checkpoint] ' + msg + '\\n'); }
389
+
390
+ function exportBrain() {
391
+ if (!fs.existsSync(DB_PATH)) { log('No memory.db, skipping'); return { exported: false }; }
392
+ try {
393
+ if (fs.existsSync(RVF_PATH)) fs.unlinkSync(RVF_PATH);
394
+ const idmap = RVF_PATH + '.idmap.json';
395
+ if (fs.existsSync(idmap)) fs.unlinkSync(idmap);
396
+ const result = execFileSync(
397
+ 'npx', ['agentic-qe', 'brain', 'export', '-o', RVF_PATH, '--format', 'rvf'],
398
+ { timeout: 60000, encoding: 'utf-8' }
399
+ );
400
+ const m = result.match(/Patterns:\\s+(\\d+)/);
401
+ const p = m ? m[1] : '0';
402
+ log('Exported ' + p + ' patterns to aqe.rvf');
403
+ return { exported: true, patterns: parseInt(p) };
404
+ } catch (e) {
405
+ log('Export failed: ' + e.message);
406
+ return { exported: false, reason: e.message };
407
+ }
408
+ }
409
+
410
+ function verifyBrain() {
411
+ if (!fs.existsSync(RVF_PATH)) {
412
+ log('No aqe.rvf found');
413
+ return { valid: false, reason: 'missing' };
414
+ }
415
+ const stat = fs.statSync(RVF_PATH);
416
+ const ageH = (Date.now() - stat.mtimeMs) / 3600000;
417
+ if (stat.size < 1024) { log('aqe.rvf too small'); return { valid: false, reason: 'too-small' }; }
418
+ if (ageH > MAX_AGE_HOURS) { log('aqe.rvf is ' + ageH.toFixed(1) + 'h old'); return { valid: true, stale: true }; }
419
+ log('aqe.rvf OK (' + (stat.size/1048576).toFixed(1) + ' MB)');
420
+ return { valid: true, stale: false };
421
+ }
422
+
423
+ const cmd = process.argv[2] || 'verify';
424
+ const result = cmd === 'export' ? exportBrain() : verifyBrain();
425
+ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result));
390
426
  `;
391
427
  }
392
428
  /**
@@ -410,7 +446,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
410
446
  hooks: [
411
447
  {
412
448
  type: 'command',
413
- command: 'npx agentic-qe hooks guard --file "$TOOL_INPUT_file_path" --json',
449
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" guard --file "$TOOL_INPUT_file_path" --json',
414
450
  timeout: 3000,
415
451
  continueOnError: true,
416
452
  },
@@ -422,7 +458,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
422
458
  hooks: [
423
459
  {
424
460
  type: 'command',
425
- command: 'npx agentic-qe hooks pre-edit --file "$TOOL_INPUT_file_path" --json',
461
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-edit --file "$TOOL_INPUT_file_path" --json',
426
462
  timeout: 5000,
427
463
  continueOnError: true,
428
464
  },
@@ -434,7 +470,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
434
470
  hooks: [
435
471
  {
436
472
  type: 'command',
437
- command: 'npx agentic-qe hooks pre-command --command "$TOOL_INPUT_command" --json',
473
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-command --command "$TOOL_INPUT_command" --json',
438
474
  timeout: 3000,
439
475
  continueOnError: true,
440
476
  },
@@ -446,7 +482,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
446
482
  hooks: [
447
483
  {
448
484
  type: 'command',
449
- command: 'npx agentic-qe hooks pre-task --description "$TOOL_INPUT_prompt" --json',
485
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" pre-task --description "$TOOL_INPUT_prompt" --json',
450
486
  timeout: 5000,
451
487
  continueOnError: true,
452
488
  },
@@ -459,7 +495,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
459
495
  hooks: [
460
496
  {
461
497
  type: 'command',
462
- command: 'npx agentic-qe hooks post-edit --file "$TOOL_INPUT_file_path" --success --json',
498
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-edit --file "$TOOL_INPUT_file_path" --success --json',
463
499
  timeout: 5000,
464
500
  continueOnError: true,
465
501
  },
@@ -470,7 +506,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
470
506
  hooks: [
471
507
  {
472
508
  type: 'command',
473
- command: 'npx agentic-qe hooks post-command --command "$TOOL_INPUT_command" --success --json',
509
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-command --command "$TOOL_INPUT_command" --success true --json',
474
510
  timeout: 5000,
475
511
  continueOnError: true,
476
512
  },
@@ -481,7 +517,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
481
517
  hooks: [
482
518
  {
483
519
  type: 'command',
484
- command: 'npx agentic-qe hooks post-task --task-id "$TOOL_RESULT_agent_id" --success --json',
520
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-task --task-id "$TOOL_RESULT_agent_id" --agent "$TOOL_INPUT_subagent_type" --success true --description "$TOOL_INPUT_prompt" --json',
485
521
  timeout: 5000,
486
522
  continueOnError: true,
487
523
  },
@@ -496,7 +532,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
496
532
  // (e.g. {"prompt":"..."}). $PROMPT is NOT exposed as an env
497
533
  // var, so we let the CLI read stdin directly.
498
534
  type: 'command',
499
- command: 'npx agentic-qe hooks route --json',
535
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" route --json',
500
536
  timeout: 5000,
501
537
  continueOnError: true,
502
538
  },
@@ -508,7 +544,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
508
544
  hooks: [
509
545
  {
510
546
  type: 'command',
511
- command: 'npx agentic-qe hooks session-start --session-id "$SESSION_ID" --json',
547
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-start --session-id "$SESSION_ID" --json',
512
548
  timeout: 10000,
513
549
  continueOnError: true,
514
550
  },
@@ -530,7 +566,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
530
566
  hooks: [
531
567
  {
532
568
  type: 'command',
533
- command: 'npx agentic-qe hooks session-end --save-state --json',
569
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" session-end --save-state --json',
534
570
  timeout: 5000,
535
571
  continueOnError: true,
536
572
  },
@@ -544,7 +580,7 @@ if (process.argv.includes('--json')) process.stdout.write(JSON.stringify(result)
544
580
  // — without this, `routing_outcomes` accumulates quality_score=-1
545
581
  // rows forever in direct-work sessions (no Task/Agent spawned).
546
582
  type: 'command',
547
- command: 'npx agentic-qe hooks post-route --success true --json',
583
+ command: 'node "${CLAUDE_PROJECT_DIR:-.}/.claude/hooks/aqe-hook.cjs" post-route --success true --json',
548
584
  timeout: 5000,
549
585
  continueOnError: true,
550
586
  },
@@ -78,6 +78,25 @@ export declare const MAX_Q_WEIGHT = 0.4;
78
78
  * decision. Adjust downward if cold-start latency proves problematic.
79
79
  */
80
80
  export declare const QWEIGHT_RAMP_VISITS = 20;
81
+ /**
82
+ * De-dilution cap for the domain-match denominator (#510 item 2).
83
+ *
84
+ * Domain score is `(domainMatch / denom) * 0.4`. The original `denom` was the
85
+ * full count of *detected* domains, but AQE's domain detector routinely emits
86
+ * 7-12 domains per task, so a perfect single-domain specialist scored
87
+ * `(1/11)*0.4 ≈ 0.04` — relevance washed out by detector breadth, leaving
88
+ * confidence dominated by the fixed performance term (measured easy task
89
+ * 37.3%, hard task 20.5%, with hard tasks mis-routing to high-performance
90
+ * but domain-irrelevant agents).
91
+ *
92
+ * Capping the denominator models the fact that a task has only a few *truly
93
+ * relevant* domains. With cap=3: a precise detector (1-2 domains) is
94
+ * unchanged, while a broad detector no longer dilutes a real match below
95
+ * usefulness. Proportionality across agents is preserved (an agent matching 2
96
+ * relevant domains still beats one matching 1). Tunable; raise toward the old
97
+ * behavior, lower to weight domain relevance more heavily.
98
+ */
99
+ export declare const DOMAIN_DENOM_CAP = 3;
81
100
  /**
82
101
  * Q-value lookup callback supplied by the caller (QEReasoningBank.routeTask).
83
102
  * Returns undefined when the (stateKey, agentType) pair has no recorded
@@ -99,6 +99,25 @@ export const MAX_Q_WEIGHT = 0.4;
99
99
  * decision. Adjust downward if cold-start latency proves problematic.
100
100
  */
101
101
  export const QWEIGHT_RAMP_VISITS = 20;
102
+ /**
103
+ * De-dilution cap for the domain-match denominator (#510 item 2).
104
+ *
105
+ * Domain score is `(domainMatch / denom) * 0.4`. The original `denom` was the
106
+ * full count of *detected* domains, but AQE's domain detector routinely emits
107
+ * 7-12 domains per task, so a perfect single-domain specialist scored
108
+ * `(1/11)*0.4 ≈ 0.04` — relevance washed out by detector breadth, leaving
109
+ * confidence dominated by the fixed performance term (measured easy task
110
+ * 37.3%, hard task 20.5%, with hard tasks mis-routing to high-performance
111
+ * but domain-irrelevant agents).
112
+ *
113
+ * Capping the denominator models the fact that a task has only a few *truly
114
+ * relevant* domains. With cap=3: a precise detector (1-2 domains) is
115
+ * unchanged, while a broad detector no longer dilutes a real match below
116
+ * usefulness. Proportionality across agents is preserved (an agent matching 2
117
+ * relevant domains still beats one matching 1). Tunable; raise toward the old
118
+ * behavior, lower to weight domain relevance more heavily.
119
+ */
120
+ export const DOMAIN_DENOM_CAP = 3;
102
121
  /**
103
122
  * Sigmoid mapping R → (0, 1) for Q-value normalization before blending.
104
123
  * A fresh row with q_value = 0 contributes 0.5 (neutral); negative q_values
@@ -265,7 +284,14 @@ qValueLookup) {
265
284
  const reasoning = [];
266
285
  // Domain match (0-0.4)
267
286
  const domainMatch = detectedDomains.filter((d) => profile.domains.includes(d)).length;
268
- const domainScore = domainMatch > 0 ? (domainMatch / detectedDomains.length) * 0.4 : 0;
287
+ // De-dilute by capping the denominator (#510 item 2): dividing by the full
288
+ // count of *detected* domains (7-12) washed out real matches. Cap models
289
+ // the few truly-relevant domains a task actually has. Math.min(...,1)
290
+ // guards the case where domainMatch exceeds the cap.
291
+ const domainDenom = Math.min(detectedDomains.length, DOMAIN_DENOM_CAP);
292
+ const domainScore = domainMatch > 0
293
+ ? Math.min(domainMatch / domainDenom, 1) * 0.4
294
+ : 0;
269
295
  score += domainScore * routingWeights.similarity;
270
296
  if (domainScore > 0) {
271
297
  reasoning.push(`Domain match: ${(domainScore * 100).toFixed(0)}%`);
@@ -101,42 +101,6 @@ export interface DreamSchedulerDependencies {
101
101
  /** Memory backend for persisting scheduler state (optional) */
102
102
  memoryBackend?: MemoryBackend;
103
103
  }
104
- /**
105
- * DreamScheduler manages automatic triggering of dream cycles.
106
- *
107
- * It follows the dependency injection pattern - all required dependencies
108
- * (DreamEngine, EventBus) must be provided via the constructor.
109
- *
110
- * @example
111
- * ```typescript
112
- * const scheduler = new DreamScheduler({
113
- * dreamEngine,
114
- * eventBus,
115
- * memoryBackend, // optional
116
- * });
117
- *
118
- * await scheduler.initialize();
119
- * scheduler.start();
120
- *
121
- * // Record experiences as they happen
122
- * scheduler.recordExperience({
123
- * id: 'exp-1',
124
- * agentType: 'tester',
125
- * domain: 'test-execution',
126
- * taskType: 'run-tests',
127
- * success: true,
128
- * duration: 5000,
129
- * timestamp: new Date(),
130
- * });
131
- *
132
- * // Manually trigger a dream
133
- * const result = await scheduler.triggerDream();
134
- *
135
- * // Stop and cleanup
136
- * scheduler.stop();
137
- * await scheduler.dispose();
138
- * ```
139
- */
140
104
  export declare class DreamScheduler {
141
105
  private readonly config;
142
106
  private readonly dreamEngine;
@@ -320,6 +284,17 @@ export declare class DreamScheduler {
320
284
  * Publish a dream completed event.
321
285
  */
322
286
  private publishDreamCompletedEvent;
287
+ /**
288
+ * #509: Reconcile the SessionStart-read `dream-scheduler:hook-state` row after
289
+ * a successful dream cycle. The post-task hook only ever INCREMENTS that row's
290
+ * experienceCount; this kernel scheduler is the entity that actually dreams
291
+ * (ADR-094) but historically never wrote it back, so the SessionStart readout
292
+ * showed lastDreamTime:null and a pendingExperiences counter that only grew.
293
+ * We stamp { lastDreamTime: now, experienceCount: 0, totalDreamsThisSession++ }
294
+ * using the SAME key + DEFAULT namespace the hook path uses. Best-effort: a
295
+ * failure here must never break a dream cycle.
296
+ */
297
+ private reconcileHookState;
323
298
  /**
324
299
  * Save scheduler state to memory backend.
325
300
  */
@@ -81,6 +81,17 @@ export const DEFAULT_DREAM_SCHEDULER_CONFIG = {
81
81
  * await scheduler.dispose();
82
82
  * ```
83
83
  */
84
+ /**
85
+ * kv_store key that the SessionStart hook reads for its dream readout and the
86
+ * post-task hook increments. Mirrors `DREAM_STATE_KEY` in
87
+ * cli/commands/hooks-handlers/hooks-dream-learning.ts — kept as a local literal
88
+ * (not imported) to avoid a learning→cli layering dependency. MUST match that
89
+ * value and use the DEFAULT namespace (the hook path passes no namespace).
90
+ * #509: this scheduler is the entity that actually dreams (ADR-094) but never
91
+ * reset this row, so SessionStart showed lastDreamTime:null + an ever-growing
92
+ * pendingExperiences. reconcileHookState() below stamps the truth per cycle.
93
+ */
94
+ const DREAM_HOOK_STATE_KEY = 'dream-scheduler:hook-state';
84
95
  export class DreamScheduler {
85
96
  config;
86
97
  dreamEngine;
@@ -351,6 +362,10 @@ export class DreamScheduler {
351
362
  this.totalDreamsCompleted++;
352
363
  // Clear experience buffer after successful dream
353
364
  this.clearExperienceBuffer();
365
+ // #509: reconcile the SessionStart-read hook-state row. The post-task hook
366
+ // only increments its experienceCount and nothing on the active dream path
367
+ // reset it, so the readout was perpetually stale. Best-effort.
368
+ await this.reconcileHookState();
354
369
  // Auto-apply high-confidence insights if enabled
355
370
  if (this.config.autoApplyHighConfidenceInsights) {
356
371
  await this.autoApplyInsights(result);
@@ -698,6 +713,35 @@ export class DreamScheduler {
698
713
  // ==========================================================================
699
714
  // Private: State Persistence
700
715
  // ==========================================================================
716
+ /**
717
+ * #509: Reconcile the SessionStart-read `dream-scheduler:hook-state` row after
718
+ * a successful dream cycle. The post-task hook only ever INCREMENTS that row's
719
+ * experienceCount; this kernel scheduler is the entity that actually dreams
720
+ * (ADR-094) but historically never wrote it back, so the SessionStart readout
721
+ * showed lastDreamTime:null and a pendingExperiences counter that only grew.
722
+ * We stamp { lastDreamTime: now, experienceCount: 0, totalDreamsThisSession++ }
723
+ * using the SAME key + DEFAULT namespace the hook path uses. Best-effort: a
724
+ * failure here must never break a dream cycle.
725
+ */
726
+ async reconcileHookState() {
727
+ if (!this.memoryBackend)
728
+ return;
729
+ try {
730
+ const prev = await this.memoryBackend.get(DREAM_HOOK_STATE_KEY);
731
+ const next = {
732
+ lastDreamTime: (this.lastDreamTime ?? new Date()).toISOString(),
733
+ experienceCount: 0,
734
+ sessionStartTime: prev?.sessionStartTime,
735
+ totalDreamsThisSession: (prev?.totalDreamsThisSession ?? 0) + 1,
736
+ };
737
+ await this.memoryBackend.set(DREAM_HOOK_STATE_KEY, next);
738
+ }
739
+ catch (err) {
740
+ logger.warn('Dream hook-state reconcile failed (non-critical)', {
741
+ error: err instanceof Error ? err.message : String(err),
742
+ });
743
+ }
744
+ }
701
745
  /**
702
746
  * Save scheduler state to memory backend.
703
747
  */
@@ -18,6 +18,12 @@ import type { Database as DatabaseType } from 'better-sqlite3';
18
18
  export interface ConsolidationResult {
19
19
  /** Experiences merged into survivors */
20
20
  merged: number;
21
+ /**
22
+ * Experiences suppressed from retrieval because they CONTRADICT a
23
+ * higher-quality near-duplicate (similar context, opposite outcome).
24
+ * Soft-suppressed (consolidated_into = 'contradicted'), not deleted.
25
+ */
26
+ contradicted: number;
21
27
  /** Experiences with quality recalculated */
22
28
  qualityUpdated: number;
23
29
  /** Experiences soft-archived (Phase 3 valueless + Phase 4 safety valve) */
@@ -54,6 +60,16 @@ export interface ConsolidationConfig {
54
60
  archiveQualityThreshold: number;
55
61
  /** Quality boost per merged experience */
56
62
  mergeQualityBoost: number;
63
+ /**
64
+ * Contradiction detection (#510 item 7). Two experiences with cosine
65
+ * similarity >= this threshold but a quality delta >= contradictionQualityDelta
66
+ * are treated as "same context, opposite outcome" — a conflict, not a
67
+ * duplicate. The lower-quality loser is suppressed from retrieval instead of
68
+ * merged, so it can't poison recall.
69
+ */
70
+ contradictionSimilarityThreshold: number;
71
+ /** Min quality gap that turns a near-duplicate into a contradiction (0-1). */
72
+ contradictionQualityDelta: number;
57
73
  }
58
74
  export declare class ExperienceConsolidator {
59
75
  private readonly config;