agentic-qe 3.10.3 → 3.10.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (370) hide show
  1. package/.claude/skills/qcsd-development-swarm/SKILL.md +27 -6
  2. package/.claude/skills/skills-manifest.json +1 -1
  3. package/CHANGELOG.md +104 -0
  4. package/assets/skills/skills-manifest.json +1 -1
  5. package/dist/arena/arena.d.ts +68 -0
  6. package/dist/arena/arena.js +169 -0
  7. package/dist/arena/mutator.d.ts +23 -0
  8. package/dist/arena/mutator.js +112 -0
  9. package/dist/arena/rng.d.ts +15 -0
  10. package/dist/arena/rng.js +34 -0
  11. package/dist/arena/runner.d.ts +44 -0
  12. package/dist/arena/runner.js +79 -0
  13. package/dist/cli/bundle.js +7 -7
  14. package/dist/cli/chunks/adapter-XZVL3DHO.js +2 -0
  15. package/dist/cli/chunks/{agent-booster-wasm-NGC6LSQP.js → agent-booster-wasm-3BC5LIEB.js} +2 -2
  16. package/dist/cli/chunks/{agent-handler-P2IJE4GK.js → agent-handler-QLXWVZZF.js} +2 -2
  17. package/dist/cli/chunks/{agent-memory-branch-JXRJ5GKQ.js → agent-memory-branch-3U5PDYW7.js} +2 -2
  18. package/dist/cli/chunks/aqe-learning-engine-YIL25K6W.js +2 -0
  19. package/dist/cli/chunks/arena-BMJQK4RD.js +18 -0
  20. package/dist/cli/chunks/arena-XENAGV4I.js +4 -0
  21. package/dist/cli/chunks/audit-WPIRUJNZ.js +3 -0
  22. package/dist/cli/chunks/base-YCYV23Q3.js +2 -0
  23. package/dist/cli/chunks/{hnswlib-node-64EGGWIC.js → better-sqlite3-6AGIBSVE.js} +2 -2
  24. package/dist/cli/chunks/{brain-handler-SACNDFSW.js → brain-handler-PHSWG5PR.js} +3 -3
  25. package/dist/cli/chunks/{branch-enumerator-LFOTVUDA.js → branch-enumerator-LNSYT34I.js} +2 -2
  26. package/dist/cli/chunks/{browser-FK7PRF3W.js → browser-M5BVQMBI.js} +2 -2
  27. package/dist/cli/chunks/browser-workflow-ALCOCRA2.js +2 -0
  28. package/dist/cli/chunks/{chunk-ZXQNE4QV.js → chunk-24A7KD3D.js} +1 -1
  29. package/dist/cli/chunks/{chunk-6Q2PPOOF.js → chunk-253TDTPH.js} +1 -1
  30. package/dist/cli/chunks/{chunk-MC7K44M4.js → chunk-2RLRPKCG.js} +2 -2
  31. package/dist/cli/chunks/{chunk-VRXY4T22.js → chunk-2UQWVF4P.js} +2 -2
  32. package/dist/cli/chunks/{chunk-UDV4YB42.js → chunk-2Z7HIT5I.js} +1 -1
  33. package/dist/cli/chunks/{chunk-CTDO2UB2.js → chunk-3BGGNHHZ.js} +1 -1
  34. package/dist/cli/chunks/{chunk-HWM2XJ3P.js → chunk-3JWV4GE6.js} +2 -2
  35. package/dist/cli/chunks/{chunk-BT3QLWII.js → chunk-3KGUP2SD.js} +2 -2
  36. package/dist/cli/chunks/{chunk-T63EK6GH.js → chunk-3WOQY6UL.js} +2 -2
  37. package/dist/cli/chunks/{chunk-QM65UGPV.js → chunk-4FTO3TPH.js} +2 -2
  38. package/dist/cli/chunks/{chunk-WWD5IWTV.js → chunk-4K7T6AKM.js} +1 -1
  39. package/dist/cli/chunks/{chunk-XTP2GHI7.js → chunk-4Z7XH4JE.js} +2 -2
  40. package/dist/cli/chunks/{chunk-FND6V2RV.js → chunk-54IPDQIZ.js} +8 -8
  41. package/dist/cli/chunks/{chunk-KTRB3L53.js → chunk-56RA6YPN.js} +2 -2
  42. package/dist/cli/chunks/{chunk-7YYTTWGY.js → chunk-5D7GLMT3.js} +1 -1
  43. package/dist/cli/chunks/{chunk-M5CDW2ZH.js → chunk-66LOFIBP.js} +2 -2
  44. package/dist/cli/chunks/{chunk-3X2ZQ55B.js → chunk-6SAU7GXO.js} +3 -3
  45. package/dist/cli/chunks/{chunk-DF3MJ2YL.js → chunk-75MP7JMV.js} +1 -1
  46. package/dist/cli/chunks/{chunk-RTDHWOAG.js → chunk-7DU35D4M.js} +1 -1
  47. package/dist/cli/chunks/{chunk-Q7EBD24B.js → chunk-7JZCEQFR.js} +1 -1
  48. package/dist/cli/chunks/{chunk-JXIPRMAY.js → chunk-A3BDPU5F.js} +4 -4
  49. package/dist/cli/chunks/{chunk-I42R57ON.js → chunk-A7HGS7FW.js} +2 -2
  50. package/dist/cli/chunks/{chunk-NNZMEYLT.js → chunk-AMBIOEMO.js} +1 -1
  51. package/dist/cli/chunks/{chunk-BO2OV2RH.js → chunk-AVQD7KEN.js} +2 -2
  52. package/dist/cli/chunks/{chunk-6GCOIIHY.js → chunk-AZCKTAUI.js} +2 -2
  53. package/dist/cli/chunks/{chunk-GL3HZN3O.js → chunk-B4F5EPNR.js} +1 -1
  54. package/dist/cli/chunks/{chunk-HAO3SPOE.js → chunk-BB7MEGXD.js} +2 -2
  55. package/dist/cli/chunks/{chunk-VDTFRMES.js → chunk-BSRCL6RU.js} +2 -2
  56. package/dist/cli/chunks/{chunk-RZCAA2PZ.js → chunk-CS3UB2OL.js} +1 -1
  57. package/dist/cli/chunks/{chunk-4OUAHZX2.js → chunk-CTG3GJIM.js} +2 -2
  58. package/dist/cli/chunks/{chunk-BWP3UVPE.js → chunk-CUAM34RQ.js} +3 -3
  59. package/dist/cli/chunks/chunk-CUY2EUSQ.js +2 -0
  60. package/dist/cli/chunks/{chunk-X2B7SANM.js → chunk-D3Q4443B.js} +1 -1
  61. package/dist/cli/chunks/{chunk-5IBJURYB.js → chunk-D4WDJ4ZF.js} +2 -2
  62. package/dist/cli/chunks/chunk-D7NKRCIL.js +2 -0
  63. package/dist/cli/chunks/{chunk-JP63XACW.js → chunk-DBR4TQPK.js} +2 -2
  64. package/dist/cli/chunks/{chunk-FLTPHVZ3.js → chunk-DIJ74M7V.js} +1 -1
  65. package/dist/cli/chunks/{chunk-PFCAMX6H.js → chunk-DJQYZ4RZ.js} +1 -1
  66. package/dist/cli/chunks/{chunk-5LON3MLI.js → chunk-DN65ILSI.js} +2 -2
  67. package/dist/cli/chunks/{chunk-6ZK24V2Y.js → chunk-DWLGFYXV.js} +2 -2
  68. package/dist/cli/chunks/{chunk-5EWWA4QP.js → chunk-EIL7FQC4.js} +6 -6
  69. package/dist/cli/chunks/{chunk-IRR7YA3Q.js → chunk-FE3FGMNB.js} +2 -2
  70. package/dist/cli/chunks/{chunk-ADV4DH3W.js → chunk-FLYFNNSN.js} +3 -3
  71. package/dist/cli/chunks/{chunk-SWOG3PBD.js → chunk-FNJZBIR3.js} +2 -2
  72. package/dist/cli/chunks/chunk-FPWA73N6.js +2 -0
  73. package/dist/cli/chunks/{chunk-NEYYLAYS.js → chunk-FW3C4LWU.js} +2 -2
  74. package/dist/cli/chunks/{chunk-5G5AAEFF.js → chunk-G4GX6YKX.js} +2 -2
  75. package/dist/cli/chunks/{chunk-NNVXHC74.js → chunk-G5UIGH4C.js} +3 -3
  76. package/dist/cli/chunks/{chunk-QEODION5.js → chunk-G6FP3S3G.js} +2 -2
  77. package/dist/cli/chunks/{chunk-ZG4P3DTL.js → chunk-GDUGW6FZ.js} +2 -2
  78. package/dist/cli/chunks/{chunk-GJUGSH7T.js → chunk-GKG6IQP6.js} +3 -3
  79. package/dist/cli/chunks/chunk-GMU7P5O3.js +2 -0
  80. package/dist/cli/chunks/{chunk-NRCL3WCP.js → chunk-GTVXVYKE.js} +2 -2
  81. package/dist/cli/chunks/{chunk-2ULVCLOW.js → chunk-HHEHGERJ.js} +2 -2
  82. package/dist/cli/chunks/{chunk-6FL3GN4T.js → chunk-HKJ3LG3N.js} +2 -2
  83. package/dist/cli/chunks/{chunk-E2BJT6A7.js → chunk-HNYSBE5J.js} +2 -2
  84. package/dist/cli/chunks/{chunk-JTZ3Q2QS.js → chunk-HPKYIK7R.js} +2 -2
  85. package/dist/cli/chunks/{chunk-GHNNJHH3.js → chunk-HRORJ352.js} +2 -2
  86. package/dist/cli/chunks/{chunk-5ER3COX3.js → chunk-IIFCTJOF.js} +2 -2
  87. package/dist/cli/chunks/{chunk-UIJFU4KD.js → chunk-IOE6LDPF.js} +2 -2
  88. package/dist/cli/chunks/{chunk-JD2PG4KS.js → chunk-IRS4HKAR.js} +1 -1
  89. package/dist/cli/chunks/{chunk-VIWIO27R.js → chunk-IT7CEHAJ.js} +2 -2
  90. package/dist/cli/chunks/{chunk-JE3C7JYN.js → chunk-IUKERFLT.js} +1 -1
  91. package/dist/cli/chunks/{chunk-YDKYLNKZ.js → chunk-IVKSZNMI.js} +1 -1
  92. package/dist/cli/chunks/{chunk-3RZL4QTT.js → chunk-IWRORKD7.js} +2 -2
  93. package/dist/cli/chunks/{chunk-NZHOKLII.js → chunk-J533CJUN.js} +3 -3
  94. package/dist/cli/chunks/{chunk-5SGEOO2F.js → chunk-JPOEI7CJ.js} +2 -2
  95. package/dist/cli/chunks/{chunk-MBSJ5G4I.js → chunk-JY7T2AQQ.js} +4 -4
  96. package/dist/cli/chunks/{chunk-4QFAUSWQ.js → chunk-K5KKZWED.js} +2 -2
  97. package/dist/cli/chunks/{chunk-L74CHKFR.js → chunk-KIMJPTHD.js} +2 -2
  98. package/dist/cli/chunks/{chunk-N7IBYDW5.js → chunk-MEN3UW7W.js} +1 -1
  99. package/dist/cli/chunks/{chunk-UHDBM7QS.js → chunk-MFQIJ3HV.js} +2 -2
  100. package/dist/cli/chunks/{chunk-SL6YZAT4.js → chunk-MGCW5FWH.js} +2 -2
  101. package/dist/cli/chunks/{chunk-U6UK3UMX.js → chunk-MIMJVKJJ.js} +3 -3
  102. package/dist/cli/chunks/{chunk-7ZSPCGTI.js → chunk-MJRYHHOG.js} +2 -2
  103. package/dist/cli/chunks/{chunk-FU77CDEM.js → chunk-MRXKIXVV.js} +2 -2
  104. package/dist/cli/chunks/{chunk-DY5KEOHX.js → chunk-MWPFUBXS.js} +2 -2
  105. package/dist/cli/chunks/{chunk-C6BBRM2J.js → chunk-N2TJXGHG.js} +1 -1
  106. package/dist/cli/chunks/{chunk-MQOFFRTA.js → chunk-NGSA53GC.js} +2 -2
  107. package/dist/cli/chunks/{chunk-YXH2CVAF.js → chunk-NKW7VOZV.js} +1 -1
  108. package/dist/cli/chunks/{chunk-YIYV2JB6.js → chunk-O5OOUMBB.js} +2 -2
  109. package/dist/cli/chunks/{chunk-HM523MTQ.js → chunk-OATHXZYW.js} +1 -1
  110. package/dist/cli/chunks/{chunk-WPVCSFDA.js → chunk-OJNG6ZXG.js} +2 -2
  111. package/dist/cli/chunks/{chunk-7SEHQTYD.js → chunk-PGNQR2VM.js} +1 -1
  112. package/dist/cli/chunks/{chunk-UZL366ZI.js → chunk-PPM5D7LH.js} +1 -1
  113. package/dist/cli/chunks/{chunk-ERYMAYJW.js → chunk-PYBVFG6T.js} +2 -2
  114. package/dist/cli/chunks/{chunk-FJGSEPFL.js → chunk-Q6BKJZTG.js} +2 -2
  115. package/dist/cli/chunks/chunk-QAW6RVAR.js +699 -0
  116. package/dist/cli/chunks/chunk-QTDZS4U6.js +2 -0
  117. package/dist/cli/chunks/{chunk-USFZ4IJD.js → chunk-R573V37S.js} +15 -15
  118. package/dist/cli/chunks/{chunk-Z2K5IZM6.js → chunk-RCAIOTIF.js} +2 -2
  119. package/dist/cli/chunks/{chunk-7RMZAVGO.js → chunk-RFNEEDPQ.js} +2 -2
  120. package/dist/cli/chunks/{chunk-IL2KOW5W.js → chunk-RFVZMNYX.js} +2 -2
  121. package/dist/cli/chunks/{chunk-B5MMDMH6.js → chunk-RLU7764Y.js} +2 -2
  122. package/dist/cli/chunks/chunk-RLZDXQNM.js +2 -0
  123. package/dist/cli/chunks/{chunk-QWG76RHA.js → chunk-RONMVGCT.js} +2 -2
  124. package/dist/cli/chunks/{chunk-X3RJ6SFC.js → chunk-RR55MLD4.js} +1 -1
  125. package/dist/cli/chunks/{chunk-PL5SLO2W.js → chunk-RUQV3BTV.js} +1 -1
  126. package/dist/cli/chunks/{chunk-NXPFGPHV.js → chunk-RZ7D5SHS.js} +1 -1
  127. package/dist/cli/chunks/{chunk-3LRK7PYN.js → chunk-S73KENCH.js} +2 -2
  128. package/dist/cli/chunks/{chunk-3HBWDG62.js → chunk-S7FGTHFE.js} +2 -2
  129. package/dist/cli/chunks/{chunk-CAMEFWRK.js → chunk-S7HQOGVD.js} +1 -1
  130. package/dist/cli/chunks/{chunk-PZHZPX3O.js → chunk-SK6YRNXI.js} +2 -2
  131. package/dist/cli/chunks/{chunk-JTF6D2RJ.js → chunk-SXQIH2QA.js} +2 -2
  132. package/dist/cli/chunks/{chunk-6B4S7PKP.js → chunk-TISBFSDJ.js} +1 -1
  133. package/dist/cli/chunks/{chunk-72LE6PHL.js → chunk-TMD6IC6D.js} +2 -2
  134. package/dist/cli/chunks/{chunk-YDDZJCKY.js → chunk-TMTLWSSA.js} +1 -1
  135. package/dist/cli/chunks/{chunk-HQJMCTWN.js → chunk-UOIT5JZ6.js} +2 -2
  136. package/dist/cli/chunks/{chunk-OPDTDKN3.js → chunk-UTORITJT.js} +2 -2
  137. package/dist/cli/chunks/{chunk-3JAOFKEU.js → chunk-VB7DZVCI.js} +1 -1
  138. package/dist/cli/chunks/{chunk-2L73WXA4.js → chunk-VC256KH2.js} +2 -2
  139. package/dist/cli/chunks/{chunk-SNTMAVPH.js → chunk-VESYE5YO.js} +3 -3
  140. package/dist/cli/chunks/{chunk-YYAPO3CU.js → chunk-VKWDMOR4.js} +2 -2
  141. package/dist/cli/chunks/{chunk-HRLXU4LH.js → chunk-VWN66V7U.js} +2 -2
  142. package/dist/cli/chunks/{chunk-CNEWYJKT.js → chunk-W5C7R2LS.js} +3 -3
  143. package/dist/cli/chunks/{chunk-JLL27IGU.js → chunk-W7KGHW4T.js} +2 -2
  144. package/dist/cli/chunks/{chunk-H56AROF2.js → chunk-WFZ4DRIC.js} +2 -2
  145. package/dist/cli/chunks/{chunk-4CYLSXA6.js → chunk-WFZUKXV5.js} +2 -2
  146. package/dist/cli/chunks/{chunk-AEJVOJPT.js → chunk-X4B3R3ZZ.js} +2 -2
  147. package/dist/cli/chunks/{chunk-KG5SM36Y.js → chunk-XI6ZZMX7.js} +1 -1
  148. package/dist/cli/chunks/{chunk-R5ONQAQL.js → chunk-YEO2Z3UX.js} +2 -2
  149. package/dist/cli/chunks/{chunk-D2FBUOAR.js → chunk-YZD4VIE5.js} +1 -1
  150. package/dist/cli/chunks/{chunk-U7NMPZE2.js → chunk-YZFNPTGN.js} +2 -2
  151. package/dist/cli/chunks/{chunk-OX4R55T3.js → chunk-ZCYKWEAM.js} +2 -2
  152. package/dist/cli/chunks/{chunk-OG7CWWFR.js → chunk-ZG3DSWUA.js} +1 -1
  153. package/dist/cli/chunks/{chunk-EETVN2OJ.js → chunk-ZS4BGJJV.js} +1 -1
  154. package/dist/cli/chunks/{chunk-LZ6TNTGO.js → chunk-ZT7JSFGT.js} +2 -2
  155. package/dist/cli/chunks/{chunk-HMFEPKAR.js → chunk-ZTC64OJE.js} +2 -2
  156. package/dist/cli/chunks/{chunk-RNF47IJ5.js → chunk-ZUBJBAUD.js} +15 -15
  157. package/dist/cli/chunks/{ci-AWZ3S5OT.js → ci-M2BSQBLL.js} +2 -2
  158. package/dist/cli/chunks/{ci-output-JLCYTIMT.js → ci-output-Z4TMK6GZ.js} +2 -2
  159. package/dist/cli/chunks/{circuit-breaker-BJDKBDIL.js → circuit-breaker-E3G4GGWB.js} +2 -2
  160. package/dist/cli/chunks/{claude-flow-setup-KKOP5ZMO.js → claude-flow-setup-MASRQU54.js} +2 -2
  161. package/dist/cli/chunks/client-RPB6RYVY.js +2 -0
  162. package/dist/cli/chunks/{cline-installer-7M525SEA.js → cline-installer-P3BWAKQA.js} +2 -2
  163. package/dist/cli/chunks/{code-27SUVJDO.js → code-7HY5HQAV.js} +2 -2
  164. package/dist/cli/chunks/{code-index-extractor-TTQQZLAK.js → code-index-extractor-MBVKLOEU.js} +2 -2
  165. package/dist/cli/chunks/{codex-installer-GHNGNPKP.js → codex-installer-WZ6QO2PH.js} +2 -2
  166. package/dist/cli/chunks/{completions-JPJD24DG.js → completions-TOJC2UFP.js} +2 -2
  167. package/dist/cli/chunks/{complexity-analyzer-Q74EJV33.js → complexity-analyzer-QYVDIAAW.js} +2 -2
  168. package/dist/cli/chunks/{continuedev-installer-ULTRDIML.js → continuedev-installer-J72CV7P4.js} +2 -2
  169. package/dist/cli/chunks/{copilot-installer-EK52X4CG.js → copilot-installer-ACDA3GEA.js} +2 -2
  170. package/dist/cli/chunks/core-handlers-QFJT5NX6.js +2 -0
  171. package/dist/cli/chunks/{cost-tracker-2GKBRYXL.js → cost-tracker-BAYQJELE.js} +2 -2
  172. package/dist/cli/chunks/{coverage-YCLC3W2A.js → coverage-QD3XJV6W.js} +3 -3
  173. package/dist/cli/chunks/cross-domain-router-5GJ7WZKX.js +2 -0
  174. package/dist/cli/chunks/{cursor-installer-B3ALFW5E.js → cursor-installer-SPGZ4TQM.js} +2 -2
  175. package/dist/cli/chunks/{daemon-ZKEBVLJA.js → daemon-3EVOL2UH.js} +3 -3
  176. package/dist/cli/chunks/daemon-N4JKD5SO.js +10 -0
  177. package/dist/cli/chunks/{dag-attention-scheduler-OQPJ6ULA.js → dag-attention-scheduler-3BVLL3L5.js} +2 -2
  178. package/dist/cli/chunks/{detect-YMYIQH3Q.js → detect-SWACKB45.js} +2 -2
  179. package/dist/cli/chunks/{dist-node-R4FAYQRY.js → dist-node-LU4E7PI6.js} +2 -2
  180. package/dist/cli/chunks/{domain-handler-IGWXLF2S.js → domain-handler-5AKKAC43.js} +2 -2
  181. package/dist/cli/chunks/{domain-transfer-A7YNO76C.js → domain-transfer-LB6H7RPX.js} +2 -2
  182. package/dist/cli/chunks/dream-C6VNLTON.js +2 -0
  183. package/dist/cli/chunks/{embed-and-insert-pattern-KODZAS7Y.js → embed-and-insert-pattern-7RBA5NDK.js} +2 -2
  184. package/dist/cli/chunks/{eval-ALQW7Q2S.js → eval-ZZFPRENX.js} +5 -5
  185. package/dist/cli/chunks/{experience-capture-middleware-3WK4RXWK.js → experience-capture-middleware-HRO3EGIW.js} +3 -3
  186. package/dist/cli/chunks/{fast-paths-PQWDFIJZ.js → fast-paths-IRRNQBTY.js} +2 -2
  187. package/dist/cli/chunks/{feature-flags-JRUAZCND.js → feature-flags-R5N5IWI2.js} +2 -2
  188. package/dist/cli/chunks/{feature-flags-6X33B3WX.js → feature-flags-W54ABAUA.js} +2 -2
  189. package/dist/cli/chunks/{file-discovery-SA3YU3IH.js → file-discovery-6CIDLVID.js} +2 -2
  190. package/dist/cli/chunks/{fleet-7TXCAOKQ.js → fleet-YTFN64WE.js} +3 -3
  191. package/dist/cli/chunks/{gnn-wrapper-ZKNYACEC.js → gnn-wrapper-RXMPLMV2.js} +2 -2
  192. package/dist/cli/chunks/{heartbeat-handler-KRZRZ23F.js → heartbeat-handler-HQQWEEQQ.js} +4 -4
  193. package/dist/cli/chunks/heartbeat-scheduler-4SBO27BG.js +2 -0
  194. package/dist/cli/chunks/hnsw-adapter-W7G6VNXW.js +2 -0
  195. package/dist/cli/chunks/hnsw-index-LENA5QML.js +2 -0
  196. package/dist/cli/chunks/{hnsw-legacy-bridge-LVHQ5SG7.js → hnsw-legacy-bridge-GPZIKYFD.js} +2 -2
  197. package/dist/cli/chunks/{better-sqlite3-HP4JZS6K.js → hnswlib-node-P6HSEFLW.js} +2 -2
  198. package/dist/cli/chunks/hooks-AYLAGFOK.js +285 -0
  199. package/dist/cli/chunks/hybrid-router-IXHIC45P.js +2 -0
  200. package/dist/cli/chunks/{hypergraph-engine-2EZBZMFK.js → hypergraph-engine-56FMXI3T.js} +2 -2
  201. package/dist/cli/chunks/{hypergraph-handler-GLPWYII2.js → hypergraph-handler-APEVT5IE.js} +3 -3
  202. package/dist/cli/chunks/impact-analyzer-DKGVMYU6.js +2 -0
  203. package/dist/cli/chunks/{init-handler-ZSDO5VMA.js → init-handler-5DWF4REQ.js} +6 -6
  204. package/dist/cli/chunks/init-wizard-BBY3LY3F.js +2 -0
  205. package/dist/cli/chunks/kernel-7CUW7G62.js +2 -0
  206. package/dist/cli/chunks/{kilocode-installer-ATYSDWIV.js → kilocode-installer-XKAUA5VA.js} +2 -2
  207. package/dist/cli/chunks/{kiro-installer-K66YT6PC.js → kiro-installer-NI2KIYJE.js} +2 -2
  208. package/dist/cli/chunks/knowledge-graph-Q5CP47IP.js +2 -0
  209. package/dist/cli/chunks/{learning-BVYCC4RI.js → learning-ZIUMUNXZ.js} +3 -3
  210. package/dist/cli/chunks/{llm-router-VBCXE6DN.js → llm-router-IL52EF2V.js} +4 -4
  211. package/dist/cli/chunks/llm-router-service-MTXCX7TO.js +2 -0
  212. package/dist/cli/chunks/{load-AREDQE2U.js → load-B5LFYD6O.js} +2 -2
  213. package/dist/cli/chunks/load-test-YBWXASBO.js +2 -0
  214. package/dist/cli/chunks/{mcp-NG6H6UC5.js → mcp-K6GZLWBC.js} +2 -2
  215. package/dist/cli/chunks/{memory-Y65EHG6N.js → memory-NCQRVSN6.js} +5 -5
  216. package/dist/cli/chunks/memory-backend-52LANEA3.js +2 -0
  217. package/dist/cli/chunks/memory-handlers-KFW3HYAP.js +2 -0
  218. package/dist/cli/chunks/{multi-model-executor-VRPRFUZT.js → multi-model-executor-R4LBSJWK.js} +2 -2
  219. package/dist/cli/chunks/{opencode-installer-CKQXPM5R.js → opencode-installer-I6CBR3PV.js} +2 -2
  220. package/dist/cli/chunks/{orchestrator-I7JBKD6G.js → orchestrator-5FXUCES6.js} +10 -10
  221. package/dist/cli/chunks/{pipeline-MV2RWCBI.js → pipeline-GDKCTXJH.js} +2 -2
  222. package/dist/cli/chunks/{platform-VU5P3SOG.js → platform-ZFY3F4T3.js} +2 -2
  223. package/dist/cli/chunks/{plugin-6TERLKCB.js → plugin-HQMEN3OS.js} +2 -2
  224. package/dist/cli/chunks/{prime-radiant-advanced-wasm-WIUIN2DL.js → prime-radiant-advanced-wasm-LSJGF4CV.js} +2 -2
  225. package/dist/cli/chunks/protocol-executor-TRYUS77M.js +2 -0
  226. package/dist/cli/chunks/{protocol-handler-HKWBGARO.js → protocol-handler-BMDNIGPP.js} +2 -2
  227. package/dist/cli/chunks/{prove-7CQPHBRJ.js → prove-ABVGAG4Z.js} +2 -2
  228. package/dist/cli/chunks/provider-manager-6XQQN7FX.js +2 -0
  229. package/dist/cli/chunks/qe-reasoning-bank-3IUPE4DJ.js +2 -0
  230. package/dist/cli/chunks/{quality-VLUVXKVG.js → quality-ENJXPNP5.js} +2 -2
  231. package/dist/cli/chunks/queen-coordinator-VWPH4XPX.js +2 -0
  232. package/dist/cli/chunks/{real-embeddings-JPZ64KK2.js → real-embeddings-W3GNAEJO.js} +2 -2
  233. package/dist/cli/chunks/{roocode-installer-NONVB3UE.js → roocode-installer-4FJNQ7PU.js} +2 -2
  234. package/dist/cli/chunks/router-OIB6ODHA.js +2 -0
  235. package/dist/cli/chunks/routing-feedback-EKYPCZYG.js +2 -0
  236. package/dist/cli/chunks/{routing-handler-YYXDT4J2.js → routing-handler-GFS5FA4F.js} +2 -2
  237. package/dist/cli/chunks/{ruvector-commands-5PFMNDLR.js → ruvector-commands-GBMYNJKN.js} +2 -2
  238. package/dist/cli/chunks/{rvf-dual-writer-TF6H7AXH.js → rvf-dual-writer-STUAQT6U.js} +2 -2
  239. package/dist/cli/chunks/{rvf-migration-adapter-VNGIUZCO.js → rvf-migration-adapter-LO6DBNJH.js} +2 -2
  240. package/dist/cli/chunks/{rvf-migration-coordinator-VA52YAIY.js → rvf-migration-coordinator-I5AD4VJ2.js} +2 -2
  241. package/dist/cli/chunks/rvf-native-adapter-7RXP2Q4Q.js +2 -0
  242. package/dist/cli/chunks/safe-db-MNKFEPBX.js +2 -0
  243. package/dist/cli/chunks/schedule-AJXABVXX.js +2 -0
  244. package/dist/cli/chunks/scheduler-LDWYHIAW.js +2 -0
  245. package/dist/cli/chunks/{security-62HEETBF.js → security-X3WCA5K5.js} +3 -3
  246. package/dist/cli/chunks/shared-rvf-adapter-Z4FSPWNP.js +2 -0
  247. package/dist/cli/chunks/{shared-rvf-dual-writer-JTZK7LRD.js → shared-rvf-dual-writer-QOPOIRIC.js} +2 -2
  248. package/dist/cli/chunks/sqlite-persistence-A6GKDMOJ.js +2 -0
  249. package/dist/cli/chunks/{status-handler-LSUPUKRF.js → status-handler-B2B5QBVK.js} +2 -2
  250. package/dist/cli/chunks/{structural-health-Z75A666N.js → structural-health-KT47LBVH.js} +2 -2
  251. package/dist/cli/chunks/sync-CKID22IW.js +2 -0
  252. package/dist/cli/chunks/{sync-M3O4T3A3.js → sync-VWD6OOUR.js} +2 -2
  253. package/dist/cli/chunks/{task-handler-AQBSZAQC.js → task-handler-X5JT5YBF.js} +2 -2
  254. package/dist/cli/chunks/{task-handlers-BOZP247V.js → task-handlers-IW4GQDW4.js} +3 -3
  255. package/dist/cli/chunks/{test-FTEGPNN2.js → test-MBZSUASD.js} +4 -4
  256. package/dist/cli/chunks/{test-scheduling-IGR4U2VQ.js → test-scheduling-E5KHKRZS.js} +3 -3
  257. package/dist/cli/chunks/token-bootstrap-TIDPJ5IG.js +2 -0
  258. package/dist/cli/chunks/{token-usage-VCHV47EO.js → token-usage-ECJSPOQB.js} +2 -2
  259. package/dist/cli/chunks/{transformers-M27QSNFH.js → transformers-UZJAQ7OZ.js} +2 -2
  260. package/dist/cli/chunks/{tree-sitter-wasm-parser-IIGEJYFU.js → tree-sitter-wasm-parser-H6BU2E5R.js} +2 -2
  261. package/dist/cli/chunks/{types-RQFPUUKA.js → types-PM7NT3MH.js} +2 -2
  262. package/dist/cli/chunks/unified-memory-27QJHABO.js +2 -0
  263. package/dist/cli/chunks/unified-memory-hnsw-76VUXR4H.js +2 -0
  264. package/dist/cli/chunks/unified-persistence-QRCGDEXH.js +2 -0
  265. package/dist/cli/chunks/{upgrade-VJMYX3AL.js → upgrade-FS2XYC2P.js} +2 -2
  266. package/dist/cli/chunks/{validate-ML7HUAU5.js → validate-4Y2BNN3A.js} +3 -3
  267. package/dist/cli/chunks/{validate-swarm-RCR6EYRC.js → validate-swarm-Z7QXZSUE.js} +4 -4
  268. package/dist/cli/chunks/{vibium-ZOOS3W5L.js → vibium-VZ6L3O2G.js} +2 -2
  269. package/dist/cli/chunks/visual-security-KB27O7BE.js +2 -0
  270. package/dist/cli/chunks/{web-tree-sitter-2YPGYLWK.js → web-tree-sitter-H7P37W5U.js} +2 -2
  271. package/dist/cli/chunks/{windsurf-installer-GOJWUWC5.js → windsurf-installer-IB2VHSZS.js} +2 -2
  272. package/dist/cli/chunks/{witness-chain-3MGSS3Q4.js → witness-chain-C4DISYJN.js} +2 -2
  273. package/dist/cli/chunks/witness-chain-EYPXHRDV.js +2 -0
  274. package/dist/cli/chunks/{workflow-B5Q77BI4.js → workflow-IGM7KVIO.js} +4 -4
  275. package/dist/cli/chunks/workflow-orchestrator-6AQZ3USU.js +2 -0
  276. package/dist/cli/chunks/wrappers-PQXC263L.js +2 -0
  277. package/dist/cli/commands/arena.d.ts +10 -0
  278. package/dist/cli/commands/arena.js +129 -0
  279. package/dist/cli/commands/hooks-handlers/command-hooks.js +38 -2
  280. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +4 -0
  281. package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +66 -3
  282. package/dist/cli/commands/hooks-handlers/nesting-provenance.d.ts +27 -0
  283. package/dist/cli/commands/hooks-handlers/nesting-provenance.js +46 -0
  284. package/dist/cli/commands/hooks-handlers/task-hooks.js +72 -1
  285. package/dist/cli/commands/hooks-handlers/tool-loop-guardrail.d.ts +71 -0
  286. package/dist/cli/commands/hooks-handlers/tool-loop-guardrail.js +142 -0
  287. package/dist/cli/index.js +17 -0
  288. package/dist/contracts/verdicts.d.ts +297 -0
  289. package/dist/contracts/verdicts.js +178 -0
  290. package/dist/coordination/queen-types.d.ts +4 -0
  291. package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +15 -6
  292. package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +12 -0
  293. package/dist/integrations/ruvector/shared-rvf-adapter.js +12 -1
  294. package/dist/integrations/ruvector/shared-rvf-dual-writer.js +6 -2
  295. package/dist/kernel/project-root.d.ts +33 -0
  296. package/dist/kernel/project-root.js +86 -0
  297. package/dist/kernel/unified-memory.d.ts +2 -19
  298. package/dist/kernel/unified-memory.js +8 -64
  299. package/dist/learning/local-judge-client.d.ts +55 -0
  300. package/dist/learning/local-judge-client.js +127 -0
  301. package/dist/learning/nagual-client.d.ts +73 -0
  302. package/dist/learning/nagual-client.js +150 -0
  303. package/dist/learning/pattern-store.js +10 -3
  304. package/dist/mcp/bundle.js +393 -391
  305. package/dist/mcp/entry.js +44 -33
  306. package/dist/mcp/handlers/core-handlers.d.ts +20 -0
  307. package/dist/mcp/handlers/core-handlers.js +28 -0
  308. package/dist/mcp/handlers/domain-handler-configs.d.ts +3 -0
  309. package/dist/mcp/handlers/domain-handler-configs.js +22 -10
  310. package/dist/mcp/transport/stdio.d.ts +7 -0
  311. package/dist/mcp/transport/stdio.js +39 -2
  312. package/dist/shared/llm/cost-tracker.js +6 -2
  313. package/dist/shared/llm/interfaces.d.ts +4 -0
  314. package/dist/shared/llm/providers/claude.js +16 -2
  315. package/dist/shared/reasoning-scrub.d.ts +29 -0
  316. package/dist/shared/reasoning-scrub.js +75 -0
  317. package/dist/workers/daemon.js +2 -0
  318. package/dist/workers/quality-daemon/git-watcher.js +2 -0
  319. package/dist/workers/quality-daemon/index.js +2 -0
  320. package/dist/workers/worker-manager.js +4 -0
  321. package/package.json +1 -1
  322. package/dist/cli/chunks/adapter-BHPUKMJ5.js +0 -2
  323. package/dist/cli/chunks/aqe-learning-engine-JQ5WD2HM.js +0 -2
  324. package/dist/cli/chunks/audit-BMQ3VESB.js +0 -3
  325. package/dist/cli/chunks/base-E32WLGY2.js +0 -2
  326. package/dist/cli/chunks/browser-workflow-LNNXXAJG.js +0 -2
  327. package/dist/cli/chunks/chunk-2EQVYYBF.js +0 -2
  328. package/dist/cli/chunks/chunk-3VF3HCG4.js +0 -2
  329. package/dist/cli/chunks/chunk-GELF4ILR.js +0 -699
  330. package/dist/cli/chunks/chunk-JOLDCS6X.js +0 -2
  331. package/dist/cli/chunks/chunk-JSFYPLMQ.js +0 -2
  332. package/dist/cli/chunks/chunk-YX2HY4MX.js +0 -2
  333. package/dist/cli/chunks/client-2UKBYFX4.js +0 -2
  334. package/dist/cli/chunks/cross-domain-router-FPM3L27L.js +0 -2
  335. package/dist/cli/chunks/daemon-YWINEHG4.js +0 -10
  336. package/dist/cli/chunks/dream-XM33US3V.js +0 -2
  337. package/dist/cli/chunks/heartbeat-scheduler-GM3M2MTG.js +0 -2
  338. package/dist/cli/chunks/hnsw-adapter-K62GEHIL.js +0 -2
  339. package/dist/cli/chunks/hnsw-index-VCAK3TWN.js +0 -2
  340. package/dist/cli/chunks/hooks-6Y3UHYI2.js +0 -248
  341. package/dist/cli/chunks/hybrid-router-432QNCNG.js +0 -2
  342. package/dist/cli/chunks/impact-analyzer-VTSISNN4.js +0 -2
  343. package/dist/cli/chunks/init-wizard-COB5AH7Q.js +0 -2
  344. package/dist/cli/chunks/kernel-ROK7X5FM.js +0 -2
  345. package/dist/cli/chunks/knowledge-graph-YUWIDIWW.js +0 -2
  346. package/dist/cli/chunks/llm-router-service-7VLXJ7VE.js +0 -2
  347. package/dist/cli/chunks/load-test-32524DL3.js +0 -2
  348. package/dist/cli/chunks/memory-backend-BI2V5AAB.js +0 -2
  349. package/dist/cli/chunks/memory-handlers-NSOFWVFN.js +0 -2
  350. package/dist/cli/chunks/protocol-executor-2UPB7SPI.js +0 -2
  351. package/dist/cli/chunks/provider-manager-PDT37MIJ.js +0 -2
  352. package/dist/cli/chunks/qe-reasoning-bank-AQQ2BI4V.js +0 -2
  353. package/dist/cli/chunks/queen-coordinator-6DVDVEU4.js +0 -2
  354. package/dist/cli/chunks/router-O2G4KQ6L.js +0 -2
  355. package/dist/cli/chunks/routing-feedback-TAGTD3KQ.js +0 -2
  356. package/dist/cli/chunks/rvf-native-adapter-46GRWQJR.js +0 -2
  357. package/dist/cli/chunks/safe-db-LNIPXXHH.js +0 -2
  358. package/dist/cli/chunks/schedule-AUH3ZALY.js +0 -2
  359. package/dist/cli/chunks/scheduler-KK3OYPWW.js +0 -2
  360. package/dist/cli/chunks/shared-rvf-adapter-XWTQPGCT.js +0 -2
  361. package/dist/cli/chunks/sqlite-persistence-CYESP7NG.js +0 -2
  362. package/dist/cli/chunks/sync-VI37UHHH.js +0 -2
  363. package/dist/cli/chunks/token-bootstrap-2DFRVMBM.js +0 -2
  364. package/dist/cli/chunks/unified-memory-RISHEANP.js +0 -2
  365. package/dist/cli/chunks/unified-memory-hnsw-2IKXGMNZ.js +0 -2
  366. package/dist/cli/chunks/unified-persistence-ZTTUJNTU.js +0 -2
  367. package/dist/cli/chunks/visual-security-D66DTAO5.js +0 -2
  368. package/dist/cli/chunks/witness-chain-RHWHHDLV.js +0 -2
  369. package/dist/cli/chunks/workflow-orchestrator-OQMFW2TC.js +0 -2
  370. package/dist/cli/chunks/wrappers-MM5VLEPG.js +0 -2
@@ -0,0 +1,86 @@
1
+ /**
2
+ * Project Root Detection
3
+ *
4
+ * Lightweight, dependency-free resolution of the AQE project root. Kept in its
5
+ * own module (no SQLite / kernel imports) so hot paths — e.g. the RVF pattern
6
+ * store factory — can import it statically without dragging in the sqlite-heavy
7
+ * unified-memory graph, and so it resolves cleanly under the test runner.
8
+ *
9
+ * `unified-memory` re-exports `findProjectRoot` / `clearProjectRootCache` for
10
+ * backward compatibility, so existing import sites keep working.
11
+ *
12
+ * @module kernel/project-root
13
+ */
14
+ import * as fs from 'fs';
15
+ import * as path from 'path';
16
+ /** Module-level cache for findProjectRoot result. */
17
+ let _cachedProjectRoot = null;
18
+ /**
19
+ * Clear the cached project root. Useful for testing or when the
20
+ * environment changes at runtime.
21
+ */
22
+ export function clearProjectRootCache() {
23
+ _cachedProjectRoot = null;
24
+ }
25
+ /**
26
+ * Find the project root by walking up the directory tree.
27
+ *
28
+ * Priority order:
29
+ * 1. AQE_PROJECT_ROOT environment variable (set by MCP config or init)
30
+ * 2. Walk up looking for the NEAREST .agentic-qe directory (existing AQE project)
31
+ * 3. Walk up looking for .git directory (git repo root)
32
+ * 4. Walk up looking for package.json WITHOUT node_modules sibling (monorepo root)
33
+ * 5. Fallback to current working directory
34
+ *
35
+ * Optimized: single upward walk checks all markers in one pass,
36
+ * and the result is cached at module level for subsequent calls.
37
+ */
38
+ export function findProjectRoot(startDir = process.cwd()) {
39
+ if (_cachedProjectRoot) {
40
+ return _cachedProjectRoot;
41
+ }
42
+ if (process.env.AQE_PROJECT_ROOT) {
43
+ _cachedProjectRoot = process.env.AQE_PROJECT_ROOT;
44
+ return _cachedProjectRoot;
45
+ }
46
+ const dir = startDir;
47
+ const root = path.parse(dir).root;
48
+ let checkDir = dir;
49
+ let nearestAqeDir = null;
50
+ let lowestGitDir = null;
51
+ let topmostPackageJson = null;
52
+ while (checkDir !== root) {
53
+ // Issue #516: prefer the NEAREST (lowest) .agentic-qe, mirroring the
54
+ // .git logic below. Keeping the topmost match let an ancestor store
55
+ // (e.g. ~/.agentic-qe, created by any `aqe` run from $HOME) hijack
56
+ // every descendant project and fragment its learning into $HOME.
57
+ if (fs.existsSync(path.join(checkDir, '.agentic-qe'))) {
58
+ if (nearestAqeDir === null) {
59
+ nearestAqeDir = checkDir;
60
+ }
61
+ }
62
+ if (fs.existsSync(path.join(checkDir, '.git'))) {
63
+ if (lowestGitDir === null) {
64
+ lowestGitDir = checkDir;
65
+ }
66
+ }
67
+ if (fs.existsSync(path.join(checkDir, 'package.json'))) {
68
+ topmostPackageJson = checkDir;
69
+ }
70
+ checkDir = path.dirname(checkDir);
71
+ }
72
+ if (nearestAqeDir) {
73
+ _cachedProjectRoot = nearestAqeDir;
74
+ }
75
+ else if (lowestGitDir) {
76
+ _cachedProjectRoot = lowestGitDir;
77
+ }
78
+ else if (topmostPackageJson) {
79
+ _cachedProjectRoot = topmostPackageJson;
80
+ }
81
+ else {
82
+ _cachedProjectRoot = process.cwd();
83
+ }
84
+ return _cachedProjectRoot;
85
+ }
86
+ //# sourceMappingURL=project-root.js.map
@@ -25,25 +25,8 @@ import { type Database as DatabaseType, type Statement } from 'better-sqlite3';
25
25
  export { validateTableName, ALLOWED_TABLE_NAMES } from '../shared/sql-safety.js';
26
26
  export { BinaryHeap, UnifiedHnswIndex, createHnswIndex } from './unified-memory-hnsw.js';
27
27
  import { type CRDTStore, type CRDTStoreState, type CRDTStoreDelta } from '../memory/crdt/index.js';
28
- /**
29
- * Clear the cached project root. Useful for testing or when the
30
- * environment changes at runtime.
31
- */
32
- export declare function clearProjectRootCache(): void;
33
- /**
34
- * Find the project root by walking up the directory tree.
35
- *
36
- * Priority order:
37
- * 1. AQE_PROJECT_ROOT environment variable (set by MCP config or init)
38
- * 2. Walk up looking for .agentic-qe directory (existing AQE project)
39
- * 3. Walk up looking for .git directory (git repo root)
40
- * 4. Walk up looking for package.json WITHOUT node_modules sibling (monorepo root)
41
- * 5. Fallback to current working directory
42
- *
43
- * Optimized: single upward walk checks all markers in one pass,
44
- * and the result is cached at module level for subsequent calls.
45
- */
46
- export declare function findProjectRoot(startDir?: string): string;
28
+ import { findProjectRoot, clearProjectRootCache } from './project-root.js';
29
+ export { findProjectRoot, clearProjectRootCache };
47
30
  /**
48
31
  * Get the default database path using project root detection.
49
32
  * Always resolves to {project_root}/.agentic-qe/memory.db
@@ -46,70 +46,14 @@ import { createCRDTStore, } from '../memory/crdt/index.js';
46
46
  // ============================================================================
47
47
  // Project Root Detection
48
48
  // ============================================================================
49
- /** Module-level cache for findProjectRoot result. */
50
- let _cachedProjectRoot = null;
51
- /**
52
- * Clear the cached project root. Useful for testing or when the
53
- * environment changes at runtime.
54
- */
55
- export function clearProjectRootCache() {
56
- _cachedProjectRoot = null;
57
- }
58
- /**
59
- * Find the project root by walking up the directory tree.
60
- *
61
- * Priority order:
62
- * 1. AQE_PROJECT_ROOT environment variable (set by MCP config or init)
63
- * 2. Walk up looking for .agentic-qe directory (existing AQE project)
64
- * 3. Walk up looking for .git directory (git repo root)
65
- * 4. Walk up looking for package.json WITHOUT node_modules sibling (monorepo root)
66
- * 5. Fallback to current working directory
67
- *
68
- * Optimized: single upward walk checks all markers in one pass,
69
- * and the result is cached at module level for subsequent calls.
70
- */
71
- export function findProjectRoot(startDir = process.cwd()) {
72
- if (_cachedProjectRoot) {
73
- return _cachedProjectRoot;
74
- }
75
- if (process.env.AQE_PROJECT_ROOT) {
76
- _cachedProjectRoot = process.env.AQE_PROJECT_ROOT;
77
- return _cachedProjectRoot;
78
- }
79
- const dir = startDir;
80
- const root = path.parse(dir).root;
81
- let checkDir = dir;
82
- let topmostAqeDir = null;
83
- let lowestGitDir = null;
84
- let topmostPackageJson = null;
85
- while (checkDir !== root) {
86
- if (fs.existsSync(path.join(checkDir, '.agentic-qe'))) {
87
- topmostAqeDir = checkDir;
88
- }
89
- if (fs.existsSync(path.join(checkDir, '.git'))) {
90
- if (lowestGitDir === null) {
91
- lowestGitDir = checkDir;
92
- }
93
- }
94
- if (fs.existsSync(path.join(checkDir, 'package.json'))) {
95
- topmostPackageJson = checkDir;
96
- }
97
- checkDir = path.dirname(checkDir);
98
- }
99
- if (topmostAqeDir) {
100
- _cachedProjectRoot = topmostAqeDir;
101
- }
102
- else if (lowestGitDir) {
103
- _cachedProjectRoot = lowestGitDir;
104
- }
105
- else if (topmostPackageJson) {
106
- _cachedProjectRoot = topmostPackageJson;
107
- }
108
- else {
109
- _cachedProjectRoot = process.cwd();
110
- }
111
- return _cachedProjectRoot;
112
- }
49
+ // Issue #516: findProjectRoot / clearProjectRootCache live in a lightweight,
50
+ // sqlite-free module so RVF hot paths can import them statically without
51
+ // pulling in this sqlite-heavy module. Re-exported here for backward compat —
52
+ // existing `import { findProjectRoot } from '.../unified-memory.js'` sites keep
53
+ // working unchanged. Imported (not bare re-exported) so internal callers below
54
+ // have a usable local binding.
55
+ import { findProjectRoot, clearProjectRootCache } from './project-root.js';
56
+ export { findProjectRoot, clearProjectRootCache };
113
57
  /**
114
58
  * Get the default database path using project root detection.
115
59
  * Always resolves to {project_root}/.agentic-qe/memory.db
@@ -0,0 +1,55 @@
1
+ /**
2
+ * Agentic QE v3 - Local LLM Judge Client
3
+ *
4
+ * Scores QE patterns for coherence, specificity, and reusability using a
5
+ * locally running Ollama-compatible LLM (OpenAI chat completions API).
6
+ *
7
+ * Reward blending: final_reward = 0.7 * outcome_reward + 0.3 * judge_score
8
+ * Escalation: score in [0.4, 0.6] → logged for human review (ambiguous zone)
9
+ *
10
+ * Env vars (all optional — client is disabled if none set):
11
+ * NAGUAL_JUDGE_URL — base URL of Ollama server (default: http://localhost:11434)
12
+ * NAGUAL_JUDGE_MODEL — model to use (default: qwen3:8b)
13
+ *
14
+ * Supported models (in preference order for M-series Macs):
15
+ * gemma4:12b-mlx — 10GB, MLX-optimised, best quality on Apple Silicon
16
+ * qwen3:8b — 5.2GB, strong reasoning, already installed
17
+ * qwen3:30b-a3b — 18GB, highest quality, use only if RAM permits
18
+ */
19
+ /** Output of a judge evaluation. */
20
+ export interface JudgeResult {
21
+ /** Quality score in [0, 1]. */
22
+ score: number;
23
+ /** One-sentence reasoning from the model. */
24
+ reason: string;
25
+ /** Model that produced the score. */
26
+ model: string;
27
+ /** True if score falls in the ambiguous zone [0.4, 0.6]. */
28
+ needsReview: boolean;
29
+ }
30
+ /**
31
+ * Blend an outcome reward with a judge score.
32
+ * final = 0.7 * outcomeReward + 0.3 * judgeScore
33
+ * Falls back to outcomeReward if judgeResult is null (judge unavailable).
34
+ */
35
+ export declare function blendReward(outcomeReward: number, judgeResult: JudgeResult | null): number;
36
+ /**
37
+ * Local LLM judge using OpenAI-compatible chat completions.
38
+ * Disabled automatically when NAGUAL_JUDGE_URL and NAGUAL_JUDGE_MODEL are both unset.
39
+ */
40
+ export declare class LocalJudgeClient {
41
+ readonly baseUrl: string;
42
+ readonly model: string;
43
+ readonly enabled: boolean;
44
+ constructor(opts?: {
45
+ url?: string;
46
+ model?: string;
47
+ });
48
+ /**
49
+ * Score a piece of text (pattern problem+solution) for QE quality.
50
+ * Returns null if judge is disabled or unavailable — callers use outcomeReward as-is.
51
+ */
52
+ score(text: string): Promise<JudgeResult | null>;
53
+ }
54
+ export declare function getLocalJudgeClient(): LocalJudgeClient;
55
+ //# sourceMappingURL=local-judge-client.d.ts.map
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Agentic QE v3 - Local LLM Judge Client
3
+ *
4
+ * Scores QE patterns for coherence, specificity, and reusability using a
5
+ * locally running Ollama-compatible LLM (OpenAI chat completions API).
6
+ *
7
+ * Reward blending: final_reward = 0.7 * outcome_reward + 0.3 * judge_score
8
+ * Escalation: score in [0.4, 0.6] → logged for human review (ambiguous zone)
9
+ *
10
+ * Env vars (all optional — client is disabled if none set):
11
+ * NAGUAL_JUDGE_URL — base URL of Ollama server (default: http://localhost:11434)
12
+ * NAGUAL_JUDGE_MODEL — model to use (default: qwen3:8b)
13
+ *
14
+ * Supported models (in preference order for M-series Macs):
15
+ * gemma4:12b-mlx — 10GB, MLX-optimised, best quality on Apple Silicon
16
+ * qwen3:8b — 5.2GB, strong reasoning, already installed
17
+ * qwen3:30b-a3b — 18GB, highest quality, use only if RAM permits
18
+ */
19
+ import { LoggerFactory } from '../logging/index.js';
20
+ const logger = LoggerFactory.create('local-judge');
21
+ const DEFAULT_URL = 'http://localhost:11434';
22
+ const DEFAULT_MODEL = 'qwen3:8b';
23
+ const JUDGE_TIMEOUT_MS = 30_000;
24
+ const MAX_TEXT_LENGTH = 600;
25
+ // Thinking models (gemma4, qwen3) need extra tokens to finish reasoning before output
26
+ const MAX_TOKENS = 600;
27
+ /** Score in this range is ambiguous — flagged for human review. */
28
+ const AMBIGUOUS_LOW = 0.4;
29
+ const AMBIGUOUS_HIGH = 0.6;
30
+ /**
31
+ * Blend an outcome reward with a judge score.
32
+ * final = 0.7 * outcomeReward + 0.3 * judgeScore
33
+ * Falls back to outcomeReward if judgeResult is null (judge unavailable).
34
+ */
35
+ export function blendReward(outcomeReward, judgeResult) {
36
+ if (judgeResult === null)
37
+ return outcomeReward;
38
+ return 0.7 * outcomeReward + 0.3 * judgeResult.score;
39
+ }
40
+ /**
41
+ * Local LLM judge using OpenAI-compatible chat completions.
42
+ * Disabled automatically when NAGUAL_JUDGE_URL and NAGUAL_JUDGE_MODEL are both unset.
43
+ */
44
+ export class LocalJudgeClient {
45
+ baseUrl;
46
+ model;
47
+ enabled;
48
+ constructor(opts) {
49
+ this.baseUrl = opts?.url ?? process.env['NAGUAL_JUDGE_URL'] ?? DEFAULT_URL;
50
+ this.model = opts?.model ?? process.env['NAGUAL_JUDGE_MODEL'] ?? DEFAULT_MODEL;
51
+ // Only active when explicitly configured via env or constructor options
52
+ this.enabled = Boolean(opts?.url ?? opts?.model ??
53
+ process.env['NAGUAL_JUDGE_URL'] ??
54
+ process.env['NAGUAL_JUDGE_MODEL']);
55
+ }
56
+ /**
57
+ * Score a piece of text (pattern problem+solution) for QE quality.
58
+ * Returns null if judge is disabled or unavailable — callers use outcomeReward as-is.
59
+ */
60
+ async score(text) {
61
+ if (!this.enabled)
62
+ return null;
63
+ const truncated = text.slice(0, MAX_TEXT_LENGTH);
64
+ const prompt = [
65
+ 'You are a QE pattern quality judge.',
66
+ 'Rate the following pattern for: coherence, specificity, and reusability in a software quality engineering context.',
67
+ 'Reply with valid JSON only, no other text: {"score": <float 0.0-1.0>, "reason": "<one sentence>"}',
68
+ '',
69
+ `Pattern:\n${truncated}`,
70
+ ].join('\n');
71
+ try {
72
+ const response = await fetch(`${this.baseUrl}/v1/chat/completions`, {
73
+ method: 'POST',
74
+ headers: { 'Content-Type': 'application/json' },
75
+ body: JSON.stringify({
76
+ model: this.model,
77
+ messages: [{ role: 'user', content: prompt }],
78
+ temperature: 0.1,
79
+ max_tokens: MAX_TOKENS,
80
+ }),
81
+ signal: AbortSignal.timeout(JUDGE_TIMEOUT_MS),
82
+ });
83
+ if (!response.ok) {
84
+ logger.debug('judge request failed', { status: response.status, model: this.model });
85
+ return null;
86
+ }
87
+ const data = await response.json();
88
+ const msg = data.choices?.[0]?.message;
89
+ // Thinking models (gemma4, qwen3) emit final answer in content; reasoning
90
+ // holds the internal chain-of-thought. Fall back to reasoning if content empty.
91
+ const rawText = (msg?.content ?? '') || (msg?.reasoning ?? '');
92
+ // Strip markdown code fences before parsing
93
+ const cleaned = rawText.replace(/```[\w]*\n?/g, '').replace(/```/g, '');
94
+ // Extract first JSON object — handles multiline values via [\s\S] inside quotes
95
+ const jsonMatch = cleaned.match(/\{[\s\S]*?"score"[\s\S]*?\}/);
96
+ if (!jsonMatch) {
97
+ logger.debug('judge response had no JSON', { rawText: rawText.slice(0, 150) });
98
+ return null;
99
+ }
100
+ const parsed = JSON.parse(jsonMatch[0]);
101
+ if (typeof parsed.score !== 'number')
102
+ return null;
103
+ const score = Math.max(0, Math.min(1, parsed.score));
104
+ const reason = typeof parsed.reason === 'string' ? parsed.reason : '';
105
+ const needsReview = score >= AMBIGUOUS_LOW && score <= AMBIGUOUS_HIGH;
106
+ if (needsReview) {
107
+ logger.info('[SurpriseReview] ambiguous judge score — flag for human review', {
108
+ score,
109
+ reason,
110
+ model: this.model,
111
+ });
112
+ }
113
+ return { score, reason, model: this.model, needsReview };
114
+ }
115
+ catch (err) {
116
+ logger.debug('judge unavailable (non-fatal)', { err, model: this.model });
117
+ return null;
118
+ }
119
+ }
120
+ }
121
+ let _instance;
122
+ export function getLocalJudgeClient() {
123
+ if (!_instance)
124
+ _instance = new LocalJudgeClient();
125
+ return _instance;
126
+ }
127
+ //# sourceMappingURL=local-judge-client.js.map
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Agentic QE v3 - Nagual Client
3
+ *
4
+ * REST client for a nagual self-learning pattern hub.
5
+ * Defaults to a locally running nagual serve instance.
6
+ *
7
+ * Setup: run your own nagual instance from
8
+ * https://github.com/proffesor-for-testing/nagual-qe
9
+ * then: nagual serve --port 3333
10
+ *
11
+ * Env vars:
12
+ * NAGUAL_URL — base URL of your nagual instance (default: http://localhost:3333)
13
+ * NAGUAL_API_TOKEN — API token if your instance requires one
14
+ * NAGUAL_CLOUD_KEY — alias for NAGUAL_API_TOKEN, loaded from ~/.nagual/cloud-hooks.env
15
+ */
16
+ export interface NagualPattern {
17
+ id: string;
18
+ problem: string;
19
+ solution: string;
20
+ domain: string;
21
+ reward: number;
22
+ tags: string[];
23
+ use_count?: number;
24
+ success_rate?: number;
25
+ embedding_method?: string;
26
+ }
27
+ export type NagualOutcomeType = 'success' | 'partial_success' | 'failure';
28
+ export interface NagualOutcome {
29
+ outcome: NagualOutcomeType;
30
+ reward: number;
31
+ feedback?: string;
32
+ }
33
+ export interface NagualPromotePayload {
34
+ problem: string;
35
+ solution: string;
36
+ domain: string;
37
+ reward: number;
38
+ tags?: string[];
39
+ source_project?: string;
40
+ }
41
+ /** Map AQE TestOutcome → nagual outcome + reward. */
42
+ export declare function mapTestOutcomeToNagual(testOutcome: string): {
43
+ outcome: NagualOutcomeType;
44
+ reward: number;
45
+ };
46
+ /**
47
+ * Thin REST client for the nagual pattern hub.
48
+ * All methods are fire-and-forget safe — they never throw.
49
+ */
50
+ export declare class NagualClient {
51
+ private readonly baseUrl;
52
+ private readonly token;
53
+ readonly enabled: boolean;
54
+ constructor();
55
+ /**
56
+ * Search nagual for patterns relevant to a task.
57
+ * Returns empty array on any error — callers must not depend on results.
58
+ */
59
+ search(query: string, domain?: string, limit?: number): Promise<NagualPattern[]>;
60
+ /**
61
+ * Record an outcome for a nagual pattern that was used in a task.
62
+ * Fire-and-forget — never awaited by callers in the hot path.
63
+ */
64
+ recordOutcome(patternId: string, outcome: NagualOutcome): Promise<void>;
65
+ /**
66
+ * Promote an AQE long-term pattern up to nagual as the cross-project hub.
67
+ * Applies 0.8 confidence decay on the reward before storing.
68
+ */
69
+ promotePattern(payload: NagualPromotePayload): Promise<void>;
70
+ private headers;
71
+ }
72
+ export declare function getNagualClient(): NagualClient;
73
+ //# sourceMappingURL=nagual-client.d.ts.map
@@ -0,0 +1,150 @@
1
+ /**
2
+ * Agentic QE v3 - Nagual Client
3
+ *
4
+ * REST client for a nagual self-learning pattern hub.
5
+ * Defaults to a locally running nagual serve instance.
6
+ *
7
+ * Setup: run your own nagual instance from
8
+ * https://github.com/proffesor-for-testing/nagual-qe
9
+ * then: nagual serve --port 3333
10
+ *
11
+ * Env vars:
12
+ * NAGUAL_URL — base URL of your nagual instance (default: http://localhost:3333)
13
+ * NAGUAL_API_TOKEN — API token if your instance requires one
14
+ * NAGUAL_CLOUD_KEY — alias for NAGUAL_API_TOKEN, loaded from ~/.nagual/cloud-hooks.env
15
+ */
16
+ import { readFileSync } from 'node:fs';
17
+ import { homedir } from 'node:os';
18
+ import { LoggerFactory } from '../logging/index.js';
19
+ const logger = LoggerFactory.create('nagual-client');
20
+ /** Load NAGUAL_CLOUD_KEY from ~/.nagual/cloud-hooks.env when not in process.env. */
21
+ function loadCloudKeyFromFile() {
22
+ try {
23
+ const envFile = readFileSync(`${homedir()}/.nagual/cloud-hooks.env`, 'utf8');
24
+ for (const line of envFile.split('\n')) {
25
+ const m = line.match(/^(?:export\s+)?NAGUAL_CLOUD_KEY=(.+)/);
26
+ if (m)
27
+ return m[1].trim().replace(/^['"]|['"]$/g, '');
28
+ }
29
+ }
30
+ catch { /* file may not exist */ }
31
+ return undefined;
32
+ }
33
+ const DEFAULT_URL = 'http://localhost:3333';
34
+ const REQUEST_TIMEOUT_MS = 3000;
35
+ const PROMOTE_TIMEOUT_MS = 5000;
36
+ /** Map AQE TestOutcome → nagual outcome + reward. */
37
+ export function mapTestOutcomeToNagual(testOutcome) {
38
+ switch (testOutcome) {
39
+ case 'catches-bug': return { outcome: 'success', reward: 0.9 };
40
+ case 'new-coverage': return { outcome: 'partial_success', reward: 0.7 };
41
+ case 'neutral': return { outcome: 'partial_success', reward: 0.5 };
42
+ case 'redundant': return { outcome: 'partial_success', reward: 0.3 };
43
+ case 'code-smell': return { outcome: 'failure', reward: 0.2 };
44
+ case 'flaky': return { outcome: 'failure', reward: 0.2 };
45
+ case 'false-positive': return { outcome: 'failure', reward: 0.1 };
46
+ default: return { outcome: 'partial_success', reward: 0.5 };
47
+ }
48
+ }
49
+ /**
50
+ * Thin REST client for the nagual pattern hub.
51
+ * All methods are fire-and-forget safe — they never throw.
52
+ */
53
+ export class NagualClient {
54
+ baseUrl;
55
+ token;
56
+ enabled;
57
+ constructor() {
58
+ this.baseUrl = process.env['NAGUAL_URL'] ?? DEFAULT_URL;
59
+ this.token =
60
+ process.env['NAGUAL_CLOUD_KEY'] ??
61
+ process.env['NAGUAL_API_TOKEN'] ??
62
+ loadCloudKeyFromFile();
63
+ this.enabled = true; // always attempt; errors are swallowed
64
+ }
65
+ /**
66
+ * Search nagual for patterns relevant to a task.
67
+ * Returns empty array on any error — callers must not depend on results.
68
+ */
69
+ async search(query, domain, limit = 5) {
70
+ try {
71
+ const response = await fetch(`${this.baseUrl}/api/patterns/search`, {
72
+ method: 'POST',
73
+ headers: this.headers(),
74
+ body: JSON.stringify({ query, domain, limit }),
75
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
76
+ });
77
+ if (!response.ok)
78
+ return [];
79
+ const data = await response.json();
80
+ return data.patterns ?? [];
81
+ }
82
+ catch {
83
+ return [];
84
+ }
85
+ }
86
+ /**
87
+ * Record an outcome for a nagual pattern that was used in a task.
88
+ * Fire-and-forget — never awaited by callers in the hot path.
89
+ */
90
+ async recordOutcome(patternId, outcome) {
91
+ try {
92
+ const response = await fetch(`${this.baseUrl}/api/patterns/${encodeURIComponent(patternId)}/outcome`, {
93
+ method: 'POST',
94
+ headers: this.headers(),
95
+ body: JSON.stringify(outcome),
96
+ signal: AbortSignal.timeout(REQUEST_TIMEOUT_MS),
97
+ });
98
+ if (!response.ok) {
99
+ logger.debug('nagual recordOutcome non-OK', { patternId, status: response.status });
100
+ }
101
+ }
102
+ catch (err) {
103
+ logger.debug('nagual recordOutcome failed (non-fatal)', { patternId, err });
104
+ }
105
+ }
106
+ /**
107
+ * Promote an AQE long-term pattern up to nagual as the cross-project hub.
108
+ * Applies 0.8 confidence decay on the reward before storing.
109
+ */
110
+ async promotePattern(payload) {
111
+ const body = {
112
+ problem: payload.problem,
113
+ solution: payload.solution,
114
+ domain: payload.domain,
115
+ reward: payload.reward * 0.8, // cross-domain confidence decay
116
+ tags: [
117
+ ...(payload.tags ?? []),
118
+ 'source:aqe',
119
+ payload.source_project ? `project:${payload.source_project}` : null,
120
+ ].filter((t) => t !== null),
121
+ };
122
+ try {
123
+ const response = await fetch(`${this.baseUrl}/api/patterns`, {
124
+ method: 'POST',
125
+ headers: this.headers(),
126
+ body: JSON.stringify(body),
127
+ signal: AbortSignal.timeout(PROMOTE_TIMEOUT_MS),
128
+ });
129
+ if (!response.ok) {
130
+ logger.debug('nagual promotePattern non-OK', { status: response.status });
131
+ }
132
+ }
133
+ catch (err) {
134
+ logger.debug('nagual promotePattern failed (non-fatal)', { err });
135
+ }
136
+ }
137
+ headers() {
138
+ const h = { 'Content-Type': 'application/json' };
139
+ if (this.token)
140
+ h['Authorization'] = `Bearer ${this.token}`;
141
+ return h;
142
+ }
143
+ }
144
+ let _instance;
145
+ export function getNagualClient() {
146
+ if (!_instance)
147
+ _instance = new NagualClient();
148
+ return _instance;
149
+ }
150
+ //# sourceMappingURL=nagual-client.js.map
@@ -6,6 +6,9 @@
6
6
  * O(log n) approximate nearest neighbor search.
7
7
  */
8
8
  import { v4 as uuidv4 } from 'uuid';
9
+ // Issue #516: lightweight, sqlite-free project-root resolver (static import so it
10
+ // resolves under the test runner; avoids pulling unified-memory's sqlite graph).
11
+ import { findProjectRoot } from '../kernel/project-root.js';
9
12
  import { ok, err } from '../shared/types/index.js';
10
13
  import { RvfPatternStore } from './rvf-pattern-store.js';
11
14
  import { createRvfStore as _createRvfStore, isRvfNativeAvailable } from '../integrations/ruvector/rvf-native-adapter.js';
@@ -1364,10 +1367,14 @@ export function createPatternStore(memory, config) {
1364
1367
  try {
1365
1368
  const flags = getRuVectorFeatureFlags();
1366
1369
  if (flags.useRVFPatternStore && isRvfNativeAvailable()) {
1367
- // Only use RVF if the data directory exists (created by kernel init)
1370
+ // Only use RVF if the data directory exists (created by kernel init).
1371
+ // Issue #516: anchor to the project root so a subfolder cwd reads/writes
1372
+ // the project's own .agentic-qe/ rather than a cwd-relative stray store.
1368
1373
  const { existsSync } = require('fs');
1369
- const rvfPath = '.agentic-qe/patterns.rvf';
1370
- const rvfDir = require('path').dirname(rvfPath);
1374
+ const { join: joinPath } = require('path');
1375
+ const projectRoot = process.env.AQE_PROJECT_ROOT ?? findProjectRoot();
1376
+ const rvfDir = joinPath(projectRoot, '.agentic-qe');
1377
+ const rvfPath = joinPath(rvfDir, 'patterns.rvf');
1371
1378
  if (existsSync(rvfDir)) {
1372
1379
  const mergedConfig = { ...DEFAULT_PATTERN_STORE_CONFIG, ...config };
1373
1380
  // FIX: Route through getSharedRvfAdapter() singleton to avoid