agentic-qe 3.9.0 → 3.9.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 (416) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +43 -0
  3. package/dist/audit/witness-chain.d.ts +1 -1
  4. package/dist/cli/bundle.js +8 -8
  5. package/dist/cli/chunks/adapter-53WBPKXU.js +2 -0
  6. package/dist/cli/chunks/{agent-booster-wasm-PQYB7VRU.js → agent-booster-wasm-AKAOHSCX.js} +2 -2
  7. package/dist/cli/chunks/{agent-handler-QDAB5NQS.js → agent-handler-MTGPOUVP.js} +2 -2
  8. package/dist/cli/chunks/agent-memory-branch-UFPKWUFK.js +2 -0
  9. package/dist/cli/chunks/aqe-learning-engine-MV7NGY24.js +2 -0
  10. package/dist/cli/chunks/{audit-S7JUYYVP.js → audit-VBEZHNHO.js} +2 -2
  11. package/dist/cli/chunks/base-DZVGMQN2.js +2 -0
  12. package/dist/cli/chunks/better-sqlite3-IRPHIXRU.js +2 -0
  13. package/dist/cli/chunks/brain-handler-7EO3FFRZ.js +68 -0
  14. package/dist/cli/chunks/{branch-enumerator-XK4V5W7L.js → branch-enumerator-MZRGP35N.js} +2 -2
  15. package/dist/cli/chunks/{browser-PALA5PL3.js → browser-VSIWQE7J.js} +2 -2
  16. package/dist/cli/chunks/browser-workflow-3J5YNMEI.js +2 -0
  17. package/dist/cli/chunks/chunk-25LFUL2K.js +79 -0
  18. package/dist/cli/chunks/{chunk-LHJQD2VU.js → chunk-2EC5Z2J4.js} +68 -68
  19. package/dist/cli/chunks/{chunk-4YOMLWEK.js → chunk-2VVV73PW.js} +1 -1
  20. package/dist/cli/chunks/{chunk-BPWXXEH2.js → chunk-2WBCYSUN.js} +128 -128
  21. package/dist/cli/chunks/{chunk-X3KI6JOY.js → chunk-2Z2TFEOL.js} +2 -2
  22. package/dist/cli/chunks/chunk-34U7JDCN.js +2 -0
  23. package/dist/cli/chunks/{chunk-24FKIJNC.js → chunk-3GZKAORV.js} +2 -2
  24. package/dist/cli/chunks/{chunk-72WOAVK6.js → chunk-4D2ZG2QO.js} +1 -1
  25. package/dist/cli/chunks/{chunk-B36CDR4U.js → chunk-4DAOZQ3V.js} +2 -2
  26. package/dist/cli/chunks/{chunk-CL6POIX4.js → chunk-4FMHBBG5.js} +1 -1
  27. package/dist/cli/chunks/{chunk-BXAXGEFC.js → chunk-4FT3PND7.js} +5 -5
  28. package/dist/cli/chunks/{chunk-IGJPMN4I.js → chunk-4LA7IW3V.js} +1 -1
  29. package/dist/cli/chunks/{chunk-JRYGQO2W.js → chunk-4PKXIBX2.js} +1 -1
  30. package/dist/cli/chunks/{chunk-YPFOCNOE.js → chunk-4UH25U4O.js} +1 -1
  31. package/dist/cli/chunks/{chunk-U5RN7YQW.js → chunk-4Z27TRQF.js} +2 -2
  32. package/dist/cli/chunks/{chunk-YW2THB5Q.js → chunk-563PJBDM.js} +2 -2
  33. package/dist/cli/chunks/{chunk-BDIEMZ22.js → chunk-56IWS2KY.js} +2 -2
  34. package/dist/cli/chunks/chunk-5AUKULWO.js +2 -0
  35. package/dist/cli/chunks/{chunk-VSVXUTJN.js → chunk-5L6AU3QK.js} +2 -2
  36. package/dist/cli/chunks/{chunk-RTGGL7D7.js → chunk-5RL66XSH.js} +2 -2
  37. package/dist/cli/chunks/{chunk-YANUP2RO.js → chunk-65M7C6SH.js} +1 -1
  38. package/dist/cli/chunks/{chunk-ESVQ6MEB.js → chunk-6SOJVEU7.js} +2 -2
  39. package/dist/cli/chunks/{chunk-UFUVUO3J.js → chunk-727BDQ3K.js} +2 -2
  40. package/dist/cli/chunks/{chunk-TLHP5EII.js → chunk-7NOIIC7G.js} +1 -1
  41. package/dist/cli/chunks/{chunk-N4TL73TH.js → chunk-7SLN2JGP.js} +8 -8
  42. package/dist/cli/chunks/{chunk-NZ2VCPN4.js → chunk-AA33R5U4.js} +2 -2
  43. package/dist/cli/chunks/{chunk-Y7BHKZFJ.js → chunk-AKSJQ6B3.js} +2 -2
  44. package/dist/cli/chunks/{chunk-3ZOONQG6.js → chunk-BIVIPF4O.js} +1 -1
  45. package/dist/cli/chunks/{chunk-VOS4NQSF.js → chunk-BKCTNRC5.js} +2 -2
  46. package/dist/cli/chunks/{chunk-B6LLWYQ6.js → chunk-BOH22AKC.js} +2 -2
  47. package/dist/cli/chunks/{chunk-OI5NGQO2.js → chunk-BY47GV4T.js} +2 -2
  48. package/dist/cli/chunks/chunk-CCYMJKWX.js +2 -0
  49. package/dist/cli/chunks/chunk-CL3K5EJK.js +2 -0
  50. package/dist/cli/chunks/{chunk-GPQ57KA4.js → chunk-CQBSGYRA.js} +2 -2
  51. package/dist/cli/chunks/{chunk-MZOFWJTM.js → chunk-CQP7ZFME.js} +2 -2
  52. package/dist/cli/chunks/chunk-DBE34QES.js +2 -0
  53. package/dist/cli/chunks/chunk-DHE66JRR.js +12 -0
  54. package/dist/cli/chunks/{chunk-2BZFNEN2.js → chunk-DNLMZTE2.js} +1 -1
  55. package/dist/cli/chunks/{chunk-XLRQYLWW.js → chunk-DSE57A5N.js} +1 -1
  56. package/dist/cli/chunks/{chunk-SUSEVMZT.js → chunk-E25S5E2D.js} +1 -1
  57. package/dist/cli/chunks/{chunk-FEKY7T6Q.js → chunk-FAXVVLPL.js} +2 -2
  58. package/dist/cli/chunks/chunk-FRJLP7IB.js +2 -0
  59. package/dist/cli/chunks/{chunk-CS2KS7LP.js → chunk-FUIHWBVF.js} +1 -1
  60. package/dist/cli/chunks/{chunk-LNQIY6BP.js → chunk-GCMVJS5X.js} +2 -2
  61. package/dist/cli/chunks/{chunk-XT2V2322.js → chunk-GITD7SRQ.js} +2 -2
  62. package/dist/cli/chunks/{chunk-JJO7Y4H3.js → chunk-GK72GUHA.js} +3 -3
  63. package/dist/cli/chunks/{chunk-6EOS7KX2.js → chunk-GPLERTZU.js} +2 -2
  64. package/dist/cli/chunks/{chunk-2E5NQNSU.js → chunk-HW4ISY5B.js} +11 -11
  65. package/dist/cli/chunks/{chunk-HRO6OZQD.js → chunk-ICDXWIFZ.js} +1 -1
  66. package/dist/cli/chunks/{chunk-3NZLZHJI.js → chunk-J4BS6IWE.js} +1 -1
  67. package/dist/cli/chunks/{chunk-4VUPRTVX.js → chunk-JOVINE23.js} +2 -2
  68. package/dist/cli/chunks/chunk-JV7LX6OT.js +95 -0
  69. package/dist/cli/chunks/{chunk-6SVX4DJC.js → chunk-KBA7FBK3.js} +3 -3
  70. package/dist/cli/chunks/chunk-KDDZYXP4.js +2 -0
  71. package/dist/cli/chunks/{chunk-GAOJV3OX.js → chunk-KNVAAVHH.js} +2 -2
  72. package/dist/cli/chunks/{chunk-CWFB6BSA.js → chunk-KQTJ2YLI.js} +4 -4
  73. package/dist/cli/chunks/{chunk-FGA7VIFR.js → chunk-KTYUCZEM.js} +3 -3
  74. package/dist/cli/chunks/{chunk-RU5WAHB7.js → chunk-KZTO5EVM.js} +2 -2
  75. package/dist/cli/chunks/{chunk-IFNIIK34.js → chunk-KZUJBZ7B.js} +3 -3
  76. package/dist/cli/chunks/{chunk-GKNNSCLC.js → chunk-L5WZUPZF.js} +2 -2
  77. package/dist/cli/chunks/{chunk-MDUHYUHF.js → chunk-L5YEPSDU.js} +2 -2
  78. package/dist/cli/chunks/chunk-LCAA6H4J.js +2 -0
  79. package/dist/cli/chunks/{chunk-XRE2HCWG.js → chunk-LMMEUVE5.js} +1 -1
  80. package/dist/cli/chunks/{chunk-7VDBAVTY.js → chunk-MN742FIH.js} +2 -2
  81. package/dist/cli/chunks/chunk-MY4LMIG7.js +180 -0
  82. package/dist/cli/chunks/{chunk-WGMPEW2T.js → chunk-N3F3CX4V.js} +2 -2
  83. package/dist/cli/chunks/{chunk-YVA65UZL.js → chunk-NJY7ZA77.js} +1 -1
  84. package/dist/cli/chunks/{chunk-3IHG3WOY.js → chunk-NM6TIEJ3.js} +3 -3
  85. package/dist/cli/chunks/{chunk-KP5NUODU.js → chunk-NRCKGXJJ.js} +1 -1
  86. package/dist/cli/chunks/{chunk-3ADGXLTM.js → chunk-PFNFC43Q.js} +1 -1
  87. package/dist/cli/chunks/{chunk-4VBTXZRM.js → chunk-PJFLO37I.js} +2 -2
  88. package/dist/cli/chunks/{chunk-XIBDETCS.js → chunk-PNL5G6TE.js} +2 -2
  89. package/dist/cli/chunks/{chunk-AFLLQ5PP.js → chunk-Q4A72ZTV.js} +2 -2
  90. package/dist/cli/chunks/{chunk-EHDQJQ6Y.js → chunk-QEQTC4WQ.js} +5 -5
  91. package/dist/cli/chunks/{chunk-IAV2JMIX.js → chunk-QIH3E775.js} +2 -2
  92. package/dist/cli/chunks/{chunk-GRUUQAR6.js → chunk-QNBQBSAI.js} +2 -2
  93. package/dist/cli/chunks/{chunk-WIEC7VKK.js → chunk-QODE4LM6.js} +2 -2
  94. package/dist/cli/chunks/{chunk-HY6PMO5W.js → chunk-QPRVX4H2.js} +2 -2
  95. package/dist/cli/chunks/chunk-RC5CPXON.js +2 -0
  96. package/dist/cli/chunks/{chunk-TWUWL5EJ.js → chunk-RITN3XR4.js} +2 -2
  97. package/dist/cli/chunks/{chunk-WBQSXPBI.js → chunk-RJROC5M3.js} +2 -2
  98. package/dist/cli/chunks/chunk-RQGYJK7H.js +2 -0
  99. package/dist/cli/chunks/{chunk-XO6PVK2P.js → chunk-S3RDH5CI.js} +2 -2
  100. package/dist/cli/chunks/{chunk-3IUNFTIF.js → chunk-SCF7NRVE.js} +1 -1
  101. package/dist/cli/chunks/chunk-SDTVHR63.js +2 -0
  102. package/dist/cli/chunks/chunk-SGAW2WLI.js +65 -0
  103. package/dist/cli/chunks/{chunk-N2NS2PHA.js → chunk-SNVM4YJS.js} +2 -2
  104. package/dist/cli/chunks/{chunk-JXM26HEE.js → chunk-SRRFWTNF.js} +2 -2
  105. package/dist/cli/chunks/{chunk-UQHYFOBX.js → chunk-STE42EMB.js} +2 -2
  106. package/dist/cli/chunks/{chunk-WJ3DLOXF.js → chunk-T5GV6UIO.js} +2 -2
  107. package/dist/cli/chunks/{chunk-4YS3IJ45.js → chunk-TKF447CW.js} +1 -1
  108. package/dist/cli/chunks/{chunk-ZAPS3UGQ.js → chunk-TTOE336G.js} +3 -3
  109. package/dist/cli/chunks/{chunk-YAGODYIG.js → chunk-UKDOMLBI.js} +3 -3
  110. package/dist/cli/chunks/{chunk-JBANAPWG.js → chunk-V6XBAZNH.js} +1 -1
  111. package/dist/cli/chunks/{chunk-BULKFVYX.js → chunk-VHVWAXCF.js} +1 -1
  112. package/dist/cli/chunks/{chunk-5SKGFSKD.js → chunk-VL7YOOC2.js} +2 -2
  113. package/dist/cli/chunks/{chunk-AKE543X2.js → chunk-VUAO4VFC.js} +2 -2
  114. package/dist/cli/chunks/{chunk-7R6YMLVS.js → chunk-WG4GHAML.js} +2 -2
  115. package/dist/cli/chunks/{chunk-BTREG4IW.js → chunk-WXWY2GAF.js} +2 -2
  116. package/dist/cli/chunks/chunk-X35GP7TR.js +1 -0
  117. package/dist/cli/chunks/chunk-X6LCMOGC.js +2 -0
  118. package/dist/cli/chunks/{chunk-BGXNSCXX.js → chunk-XFMKJ3UD.js} +1 -1
  119. package/dist/cli/chunks/{chunk-BLBRY5UD.js → chunk-XH53ARZD.js} +2 -2
  120. package/dist/cli/chunks/chunk-XIBVVZGB.js +2 -0
  121. package/dist/cli/chunks/chunk-XYJL6DKI.js +2 -0
  122. package/dist/cli/chunks/{chunk-5T2ZQWKF.js → chunk-Y6O7CDLI.js} +2 -2
  123. package/dist/cli/chunks/{chunk-4I2IOUS4.js → chunk-YXCU4CJX.js} +1 -1
  124. package/dist/cli/chunks/{chunk-YR6ZZGH7.js → chunk-Z2IKNC5M.js} +1 -1
  125. package/dist/cli/chunks/{chunk-OLHKGP35.js → chunk-Z54EO6E6.js} +2 -2
  126. package/dist/cli/chunks/{chunk-ZDATDCYN.js → chunk-Z5HXGVXZ.js} +1 -1
  127. package/dist/cli/chunks/{ci-J374KDLI.js → ci-2BCOBWFG.js} +2 -2
  128. package/dist/cli/chunks/ci-output-FB4OJHAC.js +2 -0
  129. package/dist/cli/chunks/{claude-flow-setup-245JLJCN.js → claude-flow-setup-NEEFZTMB.js} +2 -2
  130. package/dist/cli/chunks/client-EF555KYW.js +2 -0
  131. package/dist/cli/chunks/{cline-installer-LBA2M5N3.js → cline-installer-ODO2PS4K.js} +2 -2
  132. package/dist/cli/chunks/{code-U4N4WONM.js → code-NSOF62VE.js} +2 -2
  133. package/dist/cli/chunks/{code-index-extractor-A57Z6BO4.js → code-index-extractor-YQL5XN52.js} +2 -2
  134. package/dist/cli/chunks/{codex-installer-UXMK2N4T.js → codex-installer-SPEY6VYT.js} +2 -2
  135. package/dist/cli/chunks/{completions-W66BSCOE.js → completions-OWKBUMBE.js} +2 -2
  136. package/dist/cli/chunks/complexity-analyzer-PGTXKP73.js +2 -0
  137. package/dist/cli/chunks/{continuedev-installer-LRFZ2SJM.js → continuedev-installer-KGOXAC7L.js} +2 -2
  138. package/dist/cli/chunks/{copilot-installer-CQ3JYBIB.js → copilot-installer-BF3UA3TG.js} +2 -2
  139. package/dist/cli/chunks/cost-tracker-2HDJ66E2.js +2 -0
  140. package/dist/cli/chunks/{coverage-4PUEQXAY.js → coverage-KPA2PHIN.js} +3 -3
  141. package/dist/cli/chunks/cross-domain-router-GXFNK5TS.js +2 -0
  142. package/dist/cli/chunks/{cursor-installer-JZEDEDHA.js → cursor-installer-7CDZFHTV.js} +2 -2
  143. package/dist/cli/chunks/{daemon-B7TWGHXQ.js → daemon-4BPGCKDJ.js} +3 -3
  144. package/dist/cli/chunks/dag-attention-scheduler-2MAVGSBB.js +2 -0
  145. package/dist/cli/chunks/detect-WRPWTGP5.js +2 -0
  146. package/dist/cli/chunks/{domain-handler-FT5FLZWL.js → domain-handler-JZVSJ7AG.js} +2 -2
  147. package/dist/cli/chunks/domain-transfer-XGIZOR2X.js +2 -0
  148. package/dist/cli/chunks/dream-3IKF5XH4.js +2 -0
  149. package/dist/cli/chunks/esm-node-DHAE52OW.js +2 -0
  150. package/dist/cli/chunks/{eval-GHMPFGWV.js → eval-T7YPAS4G.js} +2 -2
  151. package/dist/cli/chunks/{fast-paths-B3R647KN.js → fast-paths-QECJTKCQ.js} +2 -2
  152. package/dist/cli/chunks/{feature-flags-DWS7ARSX.js → feature-flags-LIFURSFZ.js} +2 -2
  153. package/dist/cli/chunks/feature-flags-R4QZYTIW.js +2 -0
  154. package/dist/cli/chunks/file-discovery-4W3K3W4C.js +2 -0
  155. package/dist/cli/chunks/{fleet-EKOKMOMW.js → fleet-NLLQWCI5.js} +3 -3
  156. package/dist/cli/chunks/gnn-wrapper-XEII72LN.js +2 -0
  157. package/dist/cli/chunks/{heartbeat-handler-MBBS4IBU.js → heartbeat-handler-DJ65RE5D.js} +4 -4
  158. package/dist/cli/chunks/{heartbeat-scheduler-XDGMOT7X.js → heartbeat-scheduler-H664265Q.js} +2 -2
  159. package/dist/cli/chunks/hnsw-adapter-DML5KXQR.js +2 -0
  160. package/dist/cli/chunks/hnsw-index-BUPPGVR6.js +2 -0
  161. package/dist/cli/chunks/hnsw-legacy-bridge-SQIDTWAA.js +2 -0
  162. package/dist/cli/chunks/hnswlib-node-WICYCU5U.js +2 -0
  163. package/dist/cli/chunks/{hooks-L5VLZGEK.js → hooks-GZUHUD63.js} +6 -6
  164. package/dist/cli/chunks/hypergraph-engine-MLCDZ6BL.js +2 -0
  165. package/dist/cli/chunks/{hypergraph-handler-3HDGB5SZ.js → hypergraph-handler-NNDDI4R3.js} +3 -3
  166. package/dist/cli/chunks/impact-analyzer-DPTMJRYS.js +2 -0
  167. package/dist/cli/chunks/{init-handler-JDET6WUN.js → init-handler-IJ6BHE6A.js} +6 -6
  168. package/dist/cli/chunks/init-wizard-35PUDJPW.js +2 -0
  169. package/dist/cli/chunks/kernel-2HZ44ZJ4.js +2 -0
  170. package/dist/cli/chunks/{kilocode-installer-GZZG5AFW.js → kilocode-installer-EPZFFPFE.js} +2 -2
  171. package/dist/cli/chunks/{kiro-installer-IWNY5TKH.js → kiro-installer-5VACG3HU.js} +2 -2
  172. package/dist/cli/chunks/knowledge-graph-JL62G72U.js +2 -0
  173. package/dist/cli/chunks/{learning-722ZNSZ6.js → learning-6FITK6XY.js} +3 -3
  174. package/dist/cli/chunks/{llm-router-DNAV746L.js → llm-router-4DDC6AKJ.js} +2 -2
  175. package/dist/cli/chunks/{load-Y3GCUFM4.js → load-KGDNVUBX.js} +2 -2
  176. package/dist/cli/chunks/load-test-LN245SSD.js +2 -0
  177. package/dist/cli/chunks/{mcp-LKPIBZ3W.js → mcp-4LETGVIV.js} +2 -2
  178. package/dist/cli/chunks/{memory-L57MLFOP.js → memory-II4I4QMO.js} +5 -5
  179. package/dist/cli/chunks/memory-backend-SVM7YRIE.js +2 -0
  180. package/dist/cli/chunks/memory-handlers-TQXTOJGQ.js +2 -0
  181. package/dist/cli/chunks/opencode-installer-EU6JCWBW.js +3 -0
  182. package/dist/cli/chunks/{orchestrator-QHSBB2UC.js → orchestrator-YLMGJVSP.js} +5 -5
  183. package/dist/cli/chunks/{pipeline-D3QER35Z.js → pipeline-MPZJWYKK.js} +2 -2
  184. package/dist/cli/chunks/{platform-T4E7Q3RD.js → platform-YH35ZZFZ.js} +2 -2
  185. package/dist/cli/chunks/{plugin-JHW2YPRC.js → plugin-B7JYZFNQ.js} +2 -2
  186. package/dist/cli/chunks/{prime-radiant-advanced-wasm-G7CFNNQV.js → prime-radiant-advanced-wasm-KTUK6UE2.js} +2 -2
  187. package/dist/cli/chunks/protocol-executor-IEN2XB4L.js +2 -0
  188. package/dist/cli/chunks/{protocol-handler-2BQQ4HDM.js → protocol-handler-3NXMVU34.js} +2 -2
  189. package/dist/cli/chunks/{prove-UQ6JFT73.js → prove-H5LMGSUC.js} +2 -2
  190. package/dist/cli/chunks/qe-reasoning-bank-Q3ZV3JRG.js +2 -0
  191. package/dist/cli/chunks/{quality-JRZYMC77.js → quality-RCWHY6GO.js} +2 -2
  192. package/dist/cli/chunks/queen-coordinator-E6ON3JUR.js +2 -0
  193. package/dist/cli/chunks/real-embeddings-NKH4VURF.js +2 -0
  194. package/dist/cli/chunks/{roocode-installer-F4E2LAYR.js → roocode-installer-SB7QJYM3.js} +2 -2
  195. package/dist/cli/chunks/router-WMC3LZ3C.js +2 -0
  196. package/dist/cli/chunks/routing-feedback-VKCZRCE3.js +2 -0
  197. package/dist/cli/chunks/{routing-handler-VNKFUUGB.js → routing-handler-SY7GKG2W.js} +2 -2
  198. package/dist/cli/chunks/ruvector-commands-HATTO3UQ.js +8 -0
  199. package/dist/cli/chunks/rvf-dual-writer-D57EXQUD.js +2 -0
  200. package/dist/cli/chunks/rvf-migration-adapter-OWDYN6KD.js +2 -0
  201. package/dist/cli/chunks/rvf-migration-coordinator-SIQVJB5S.js +2 -0
  202. package/dist/cli/chunks/rvf-native-adapter-C7NBH5UN.js +2 -0
  203. package/dist/cli/chunks/safe-db-5KLXCNXN.js +2 -0
  204. package/dist/cli/chunks/schedule-HAWWOXWB.js +2 -0
  205. package/dist/cli/chunks/scheduler-HTRDY5BC.js +2 -0
  206. package/dist/cli/chunks/{security-EBEG2OPU.js → security-DS3XLZWN.js} +3 -3
  207. package/dist/cli/chunks/shared-rvf-adapter-6I2Z5UGL.js +2 -0
  208. package/dist/cli/chunks/shared-rvf-dual-writer-YB7AH6XJ.js +2 -0
  209. package/dist/cli/chunks/sqlite-persistence-WNNRGTGG.js +2 -0
  210. package/dist/cli/chunks/{status-handler-VZ32M4G4.js → status-handler-TUYHE4FT.js} +2 -2
  211. package/dist/cli/chunks/{structural-health-K6LRCKV6.js → structural-health-XNGBNRRD.js} +2 -2
  212. package/dist/cli/chunks/{sync-MHSHNLIM.js → sync-K6CIRKBB.js} +2 -2
  213. package/dist/cli/chunks/{task-handler-JNOIBZ2G.js → task-handler-7PJY67DR.js} +2 -2
  214. package/dist/cli/chunks/task-handlers-WB5CDWUR.js +2 -0
  215. package/dist/cli/chunks/{test-DO22BNIL.js → test-WV5ALEBB.js} +4 -4
  216. package/dist/cli/chunks/{test-scheduling-VLRQZEFL.js → test-scheduling-N55ZGGA2.js} +3 -3
  217. package/dist/cli/chunks/token-bootstrap-SINWHAKR.js +2 -0
  218. package/dist/cli/chunks/{token-usage-LG3PXRXH.js → token-usage-R7TGEVGL.js} +2 -2
  219. package/dist/cli/chunks/transformers-6DBLXPV7.js +2 -0
  220. package/dist/cli/chunks/{tree-sitter-wasm-parser-FT2KB66N.js → tree-sitter-wasm-parser-7C7FKMQW.js} +2 -2
  221. package/dist/cli/chunks/types-VNPMOKQT.js +2 -0
  222. package/dist/cli/chunks/unified-memory-72SKVZ7Y.js +2 -0
  223. package/dist/cli/chunks/unified-memory-hnsw-TMN2L77W.js +2 -0
  224. package/dist/cli/chunks/unified-persistence-MDN3SRCR.js +2 -0
  225. package/dist/cli/chunks/{validate-VQCRSVNQ.js → validate-53MNIRAF.js} +2 -2
  226. package/dist/cli/chunks/{validate-swarm-A5DHAWTP.js → validate-swarm-ZY4RGUFO.js} +2 -2
  227. package/dist/cli/chunks/{vibium-RZBSL4EB.js → vibium-PBADBIV6.js} +2 -2
  228. package/dist/cli/chunks/visual-security-TRBCXPIB.js +2 -0
  229. package/dist/cli/chunks/{web-tree-sitter-7C4NXEOF.js → web-tree-sitter-O7VI6RLB.js} +2 -2
  230. package/dist/cli/chunks/{windsurf-installer-ES3KPQG3.js → windsurf-installer-HV3C3TAD.js} +2 -2
  231. package/dist/cli/chunks/witness-chain-4WIMYP4X.js +2 -0
  232. package/dist/cli/chunks/witness-chain-JOI2YYGK.js +2 -0
  233. package/dist/cli/chunks/{workflow-JETHX4ML.js → workflow-5RVAQ4TM.js} +4 -4
  234. package/dist/cli/chunks/workflow-orchestrator-2NQ72S3C.js +2 -0
  235. package/dist/cli/chunks/{wrappers-WP5RH745.js → wrappers-RRHCCA3E.js} +2 -2
  236. package/dist/cli/commands/ruvector-commands.js +14 -2
  237. package/dist/cli/index.js +10 -15
  238. package/dist/coordination/agent-memory-branch.d.ts +117 -0
  239. package/dist/coordination/agent-memory-branch.js +213 -0
  240. package/dist/coordination/agent-teams/mailbox.d.ts +43 -0
  241. package/dist/coordination/agent-teams/mailbox.js +130 -4
  242. package/dist/coordination/handlers/handler-utils.d.ts +1 -0
  243. package/dist/coordination/handlers/handler-utils.js +9 -2
  244. package/dist/coordination/handlers/quality-handlers.js +7 -1
  245. package/dist/domains/contract-testing/coordinator.js +11 -0
  246. package/dist/domains/quality-assessment/coherence/gate-controller.d.ts +20 -1
  247. package/dist/domains/quality-assessment/coherence/gate-controller.js +64 -0
  248. package/dist/domains/quality-assessment/coherence/index.d.ts +3 -3
  249. package/dist/domains/quality-assessment/coherence/index.js +2 -2
  250. package/dist/domains/quality-assessment/coherence/types.d.ts +39 -0
  251. package/dist/domains/quality-assessment/coherence/types.js +11 -0
  252. package/dist/domains/quality-assessment/coordinator.d.ts +14 -0
  253. package/dist/domains/quality-assessment/coordinator.js +92 -0
  254. package/dist/domains/test-execution/coordinator.d.ts +19 -0
  255. package/dist/domains/test-execution/coordinator.js +102 -5
  256. package/dist/domains/test-generation/coordinator.js +11 -0
  257. package/dist/domains/test-generation/interfaces.d.ts +2 -0
  258. package/dist/domains/test-generation/services/test-generator.d.ts +9 -0
  259. package/dist/domains/test-generation/services/test-generator.js +37 -0
  260. package/dist/init/agents-installer.d.ts +5 -3
  261. package/dist/init/agents-installer.js +17 -43
  262. package/dist/init/find-package-root.d.ts +22 -0
  263. package/dist/init/find-package-root.js +46 -0
  264. package/dist/init/n8n-installer.d.ts +4 -2
  265. package/dist/init/n8n-installer.js +23 -23
  266. package/dist/init/opencode-installer.d.ts +0 -5
  267. package/dist/init/opencode-installer.js +12 -39
  268. package/dist/init/skills-installer.d.ts +5 -2
  269. package/dist/init/skills-installer.js +15 -37
  270. package/dist/integrations/embeddings/index/HNSWIndex.d.ts +9 -2
  271. package/dist/integrations/embeddings/index/HNSWIndex.js +110 -35
  272. package/dist/integrations/ruvector/cognitive-routing.d.ts +67 -0
  273. package/dist/integrations/ruvector/cognitive-routing.js +208 -0
  274. package/dist/integrations/ruvector/feature-flags.d.ts +84 -0
  275. package/dist/integrations/ruvector/feature-flags.js +59 -0
  276. package/dist/integrations/ruvector/hdc-fingerprint.d.ts +76 -0
  277. package/dist/integrations/ruvector/hdc-fingerprint.js +217 -0
  278. package/dist/integrations/ruvector/hyperbolic-hnsw.d.ts +59 -0
  279. package/dist/integrations/ruvector/hyperbolic-hnsw.js +194 -0
  280. package/dist/integrations/ruvector/index.d.ts +5 -2
  281. package/dist/integrations/ruvector/index.js +13 -2
  282. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +24 -0
  283. package/dist/integrations/ruvector/shared-rvf-adapter.js +55 -0
  284. package/dist/integrations/ruvector/shared-rvf-dual-writer.d.ts +6 -0
  285. package/dist/integrations/ruvector/shared-rvf-dual-writer.js +38 -0
  286. package/dist/integrations/ruvector/sona-persistence.d.ts +8 -0
  287. package/dist/integrations/ruvector/sona-persistence.js +10 -0
  288. package/dist/integrations/ruvector/vector-delta-tracker.d.ts +96 -0
  289. package/dist/integrations/ruvector/vector-delta-tracker.js +226 -0
  290. package/dist/kernel/agent-coordinator.d.ts +75 -1
  291. package/dist/kernel/agent-coordinator.js +250 -1
  292. package/dist/kernel/hnsw-legacy-bridge.d.ts +38 -0
  293. package/dist/kernel/hnsw-legacy-bridge.js +88 -0
  294. package/dist/kernel/hnsw-shadow-validator.d.ts +91 -0
  295. package/dist/kernel/hnsw-shadow-validator.js +139 -0
  296. package/dist/kernel/index.d.ts +1 -1
  297. package/dist/kernel/index.js +1 -1
  298. package/dist/kernel/interfaces.d.ts +39 -0
  299. package/dist/kernel/kernel.d.ts +23 -0
  300. package/dist/kernel/kernel.js +106 -1
  301. package/dist/kernel/unified-memory.d.ts +1 -1
  302. package/dist/kernel/unified-memory.js +7 -3
  303. package/dist/learning/aqe-learning-engine.d.ts +65 -0
  304. package/dist/learning/aqe-learning-engine.js +134 -0
  305. package/dist/learning/dream/dream-engine.d.ts +6 -1
  306. package/dist/learning/dream/dream-engine.js +37 -2
  307. package/dist/learning/dream/dream-scheduler.d.ts +25 -0
  308. package/dist/learning/dream/dream-scheduler.js +120 -0
  309. package/dist/learning/dream/rvcow-branch-manager.d.ts +6 -3
  310. package/dist/learning/dream/rvcow-branch-manager.js +60 -5
  311. package/dist/learning/experience-capture.d.ts +3 -3
  312. package/dist/learning/hyperbolic-pattern-index.d.ts +82 -0
  313. package/dist/learning/hyperbolic-pattern-index.js +142 -0
  314. package/dist/learning/index.d.ts +3 -3
  315. package/dist/learning/index.js +1 -1
  316. package/dist/learning/metrics-tracker.d.ts +44 -0
  317. package/dist/learning/metrics-tracker.js +37 -0
  318. package/dist/learning/pattern-promotion.d.ts +3 -3
  319. package/dist/learning/pattern-store.d.ts +45 -2
  320. package/dist/learning/pattern-store.js +239 -4
  321. package/dist/learning/qe-patterns.d.ts +1 -1
  322. package/dist/learning/qe-reasoning-bank.js +1 -1
  323. package/dist/learning/rvf-pattern-migration.d.ts +50 -0
  324. package/dist/learning/rvf-pattern-migration.js +106 -0
  325. package/dist/learning/rvf-pattern-store.d.ts +69 -0
  326. package/dist/learning/rvf-pattern-store.js +449 -0
  327. package/dist/mcp/bundle.js +1894 -1804
  328. package/dist/mcp/handlers/index.d.ts +1 -0
  329. package/dist/mcp/handlers/index.js +2 -0
  330. package/dist/mcp/handlers/migration-handlers.d.ts +52 -0
  331. package/dist/mcp/handlers/migration-handlers.js +85 -0
  332. package/dist/mcp/protocol-server.d.ts +1 -0
  333. package/dist/mcp/protocol-server.js +63 -2
  334. package/dist/mcp/types.d.ts +1 -1
  335. package/dist/optimization/early-exit-token-optimizer.d.ts +7 -7
  336. package/dist/optimization/early-exit-token-optimizer.js +3 -3
  337. package/dist/persistence/rvf-consistency-validator.d.ts +85 -0
  338. package/dist/persistence/rvf-consistency-validator.js +182 -0
  339. package/dist/persistence/rvf-migration-adapter.d.ts +125 -0
  340. package/dist/persistence/rvf-migration-adapter.js +303 -0
  341. package/dist/persistence/rvf-migration-coordinator.d.ts +115 -0
  342. package/dist/persistence/rvf-migration-coordinator.js +224 -0
  343. package/dist/persistence/rvf-stage-gate.d.ts +70 -0
  344. package/dist/persistence/rvf-stage-gate.js +163 -0
  345. package/package.json +10 -10
  346. package/dist/cli/chunks/adapter-WBR5NXS3.js +0 -2
  347. package/dist/cli/chunks/aqe-learning-engine-TK4JQCGT.js +0 -2
  348. package/dist/cli/chunks/base-2WXOSMBQ.js +0 -2
  349. package/dist/cli/chunks/better-sqlite3-7KY2RDXO.js +0 -2
  350. package/dist/cli/chunks/brain-handler-PPEGDCN4.js +0 -68
  351. package/dist/cli/chunks/browser-workflow-42F7GK5T.js +0 -2
  352. package/dist/cli/chunks/chunk-263XS447.js +0 -2
  353. package/dist/cli/chunks/chunk-2I7J3O6V.js +0 -2
  354. package/dist/cli/chunks/chunk-3JPRUND5.js +0 -2
  355. package/dist/cli/chunks/chunk-3THRQEZ2.js +0 -95
  356. package/dist/cli/chunks/chunk-4B6NCELM.js +0 -2
  357. package/dist/cli/chunks/chunk-62ADTHV7.js +0 -2
  358. package/dist/cli/chunks/chunk-BR26T7ZS.js +0 -180
  359. package/dist/cli/chunks/chunk-DRT3WKQW.js +0 -2
  360. package/dist/cli/chunks/chunk-FIA6X7UL.js +0 -2
  361. package/dist/cli/chunks/chunk-J3KWWR6Z.js +0 -1
  362. package/dist/cli/chunks/chunk-JZSDOIXA.js +0 -2
  363. package/dist/cli/chunks/chunk-MV6CMOJQ.js +0 -65
  364. package/dist/cli/chunks/chunk-N5UXCLFI.js +0 -2
  365. package/dist/cli/chunks/chunk-OF4D7MYI.js +0 -2
  366. package/dist/cli/chunks/chunk-QOVHWZEP.js +0 -1
  367. package/dist/cli/chunks/chunk-RFSN6IDA.js +0 -79
  368. package/dist/cli/chunks/chunk-X5IJGWYG.js +0 -2
  369. package/dist/cli/chunks/ci-output-7JN7F6CI.js +0 -2
  370. package/dist/cli/chunks/client-MCSNSH2C.js +0 -2
  371. package/dist/cli/chunks/complexity-analyzer-AB4OZARV.js +0 -2
  372. package/dist/cli/chunks/cost-tracker-4F723RB6.js +0 -2
  373. package/dist/cli/chunks/cross-domain-router-OWR5IJ5G.js +0 -2
  374. package/dist/cli/chunks/dag-attention-scheduler-JWO6XI6A.js +0 -2
  375. package/dist/cli/chunks/detect-L6ZZHUSX.js +0 -2
  376. package/dist/cli/chunks/domain-transfer-5Y4FGJAJ.js +0 -2
  377. package/dist/cli/chunks/dream-4TDBIYED.js +0 -2
  378. package/dist/cli/chunks/esm-node-2PKHKOTS.js +0 -2
  379. package/dist/cli/chunks/feature-flags-IVQ3AL4Q.js +0 -2
  380. package/dist/cli/chunks/file-discovery-QFPA6GMV.js +0 -2
  381. package/dist/cli/chunks/gnn-wrapper-OYC55N5E.js +0 -2
  382. package/dist/cli/chunks/hnsw-index-YO7CT23I.js +0 -2
  383. package/dist/cli/chunks/hnswlib-node-56YWVXFE.js +0 -2
  384. package/dist/cli/chunks/hypergraph-engine-A4Y2ZRAG.js +0 -2
  385. package/dist/cli/chunks/impact-analyzer-UEIGXSZ4.js +0 -2
  386. package/dist/cli/chunks/init-wizard-JWZUGIPJ.js +0 -2
  387. package/dist/cli/chunks/kernel-YNDTVKIW.js +0 -2
  388. package/dist/cli/chunks/knowledge-graph-NGJKFTSN.js +0 -2
  389. package/dist/cli/chunks/load-test-GZUBXFF3.js +0 -2
  390. package/dist/cli/chunks/memory-backend-3NQIZUXE.js +0 -2
  391. package/dist/cli/chunks/memory-handlers-MDZQ7HVW.js +0 -2
  392. package/dist/cli/chunks/opencode-installer-4HUB36H5.js +0 -3
  393. package/dist/cli/chunks/protocol-executor-SPUVRDWT.js +0 -2
  394. package/dist/cli/chunks/qe-reasoning-bank-3HBK2FVD.js +0 -2
  395. package/dist/cli/chunks/queen-coordinator-RW3NKO5A.js +0 -2
  396. package/dist/cli/chunks/real-embeddings-GK63VF35.js +0 -2
  397. package/dist/cli/chunks/router-RJGHWDQ3.js +0 -2
  398. package/dist/cli/chunks/routing-feedback-ZXBXFKX6.js +0 -2
  399. package/dist/cli/chunks/ruvector-commands-2TLNHC3A.js +0 -8
  400. package/dist/cli/chunks/rvf-dual-writer-MQW2SJLT.js +0 -2
  401. package/dist/cli/chunks/rvf-native-adapter-LKFKTMUN.js +0 -2
  402. package/dist/cli/chunks/safe-db-G22E5ROA.js +0 -2
  403. package/dist/cli/chunks/schedule-Y7VVCPYV.js +0 -2
  404. package/dist/cli/chunks/scheduler-AUQIFQB7.js +0 -2
  405. package/dist/cli/chunks/shared-rvf-dual-writer-BVSCQAFS.js +0 -2
  406. package/dist/cli/chunks/sqlite-persistence-JAVHUGGL.js +0 -2
  407. package/dist/cli/chunks/task-handlers-P5DSUKND.js +0 -2
  408. package/dist/cli/chunks/token-bootstrap-4VJKGVMK.js +0 -2
  409. package/dist/cli/chunks/transformers-GY7SIKEU.js +0 -2
  410. package/dist/cli/chunks/types-QJGNBKP2.js +0 -2
  411. package/dist/cli/chunks/unified-memory-XYGENQUT.js +0 -2
  412. package/dist/cli/chunks/unified-memory-hnsw-MVEGQBF3.js +0 -2
  413. package/dist/cli/chunks/unified-persistence-PFRCWEUG.js +0 -2
  414. package/dist/cli/chunks/visual-security-V47BLGJM.js +0 -2
  415. package/dist/cli/chunks/witness-chain-BR63P4A7.js +0 -2
  416. package/dist/cli/chunks/workflow-orchestrator-7PZMX3JZ.js +0 -2
@@ -0,0 +1,213 @@
1
+ /**
2
+ * Agent Memory Branching via RVF Copy-on-Write (ADR-067)
3
+ *
4
+ * Provides per-agent isolated memory branches using RVF's COW derive().
5
+ * Each spawned agent gets a lightweight .rvf branch file that shares
6
+ * the parent's data via copy-on-write. Writes are isolated to the branch.
7
+ *
8
+ * Lifecycle:
9
+ * spawn → createBranch() → agent works on isolated branch
10
+ * success → mergeBranch() → changed vectors flow back to parent
11
+ * failure → discardBranch() → delete branch file (zero cost)
12
+ *
13
+ * Storage cost: ~0.5% of parent for typical agent workloads
14
+ * (only changed vectors are physically copied).
15
+ *
16
+ * @module coordination/agent-memory-branch
17
+ */
18
+ import { existsSync, mkdirSync, unlinkSync, readdirSync, statSync } from 'fs';
19
+ import { join, basename } from 'path';
20
+ const DEFAULT_CONFIG = {
21
+ branchDir: '.agentic-qe/branches',
22
+ defaultStrategy: 'child-wins',
23
+ orphanMaxAgeMs: 3600_000, // 1 hour
24
+ };
25
+ // ============================================================================
26
+ // AgentMemoryBranch Service
27
+ // ============================================================================
28
+ export class AgentMemoryBranch {
29
+ config;
30
+ parentAdapter;
31
+ activeBranches = new Map();
32
+ witnessChain = null;
33
+ constructor(parentAdapter, config) {
34
+ this.parentAdapter = parentAdapter;
35
+ this.config = { ...DEFAULT_CONFIG, ...config };
36
+ }
37
+ /** Attach a witness chain for merge/discard audit trail */
38
+ setWitnessChain(wc) {
39
+ this.witnessChain = wc;
40
+ }
41
+ // --------------------------------------------------------------------------
42
+ // Branch Lifecycle
43
+ // --------------------------------------------------------------------------
44
+ /**
45
+ * Create a COW branch for an agent.
46
+ * The child .rvf inherits all parent data via copy-on-write.
47
+ * Reads fall through to parent; writes are isolated to the child.
48
+ */
49
+ createBranch(agentId) {
50
+ if (this.activeBranches.has(agentId)) {
51
+ throw new Error(`Branch already exists for agent ${agentId}`);
52
+ }
53
+ // Ensure branch directory exists
54
+ if (!existsSync(this.config.branchDir)) {
55
+ mkdirSync(this.config.branchDir, { recursive: true });
56
+ }
57
+ const childPath = join(this.config.branchDir, `${agentId}.rvf`);
58
+ const parentPath = this.parentAdapter.path();
59
+ // COW derive — creates lightweight child sharing parent's data
60
+ const childAdapter = this.parentAdapter.derive(childPath);
61
+ const handle = {
62
+ agentId,
63
+ childPath,
64
+ parentPath,
65
+ childAdapter,
66
+ createdAt: Date.now(),
67
+ ingestLog: [],
68
+ };
69
+ this.activeBranches.set(agentId, handle);
70
+ return handle;
71
+ }
72
+ /**
73
+ * Record a vector that an agent ingested into its branch.
74
+ * This log is replayed into the parent on merge (child-wins strategy).
75
+ *
76
+ * Agents MUST call this alongside childAdapter.ingest() so that
77
+ * merge can replay the actual vectors into the parent.
78
+ */
79
+ recordIngest(agentId, entries) {
80
+ const handle = this.activeBranches.get(agentId);
81
+ if (!handle)
82
+ return;
83
+ for (const entry of entries) {
84
+ handle.ingestLog.push({ id: entry.id, vector: entry.vector });
85
+ }
86
+ }
87
+ /**
88
+ * Merge a successful agent's branch back to the parent.
89
+ * Replays the agent's ingest log into the parent (child-wins) or
90
+ * discards all child changes (parent-wins).
91
+ */
92
+ async mergeBranch(handle, strategy) {
93
+ const mergeStrategy = strategy ?? this.config.defaultStrategy;
94
+ const startTime = performance.now();
95
+ let vectorsMerged = 0;
96
+ if (mergeStrategy === 'child-wins' && handle.ingestLog.length > 0) {
97
+ // Replay the agent's ingest log into the parent
98
+ // These are the actual vectors the agent wrote — no zero-vector placeholders
99
+ try {
100
+ const result = this.parentAdapter.ingest(handle.ingestLog);
101
+ vectorsMerged = result.accepted;
102
+ }
103
+ catch (error) {
104
+ console.warn(`[AgentMemoryBranch] Merge replay failed for ${handle.agentId}:`, error);
105
+ }
106
+ }
107
+ // parent-wins: nothing to do — child changes are discarded
108
+ // Record in witness chain
109
+ this.witnessChain?.append('BRANCH_MERGE', {
110
+ agentId: handle.agentId,
111
+ strategy: mergeStrategy,
112
+ vectorsMerged,
113
+ branchPath: handle.childPath,
114
+ }, `agent-${handle.agentId}`);
115
+ // Cleanup child
116
+ this.cleanupBranchFile(handle);
117
+ this.activeBranches.delete(handle.agentId);
118
+ return {
119
+ vectorsMerged,
120
+ strategy: mergeStrategy,
121
+ durationMs: performance.now() - startTime,
122
+ };
123
+ }
124
+ /**
125
+ * Discard a failed agent's branch.
126
+ * Simply deletes the child .rvf file — zero computational cost.
127
+ */
128
+ discardBranch(handle) {
129
+ // Record in witness chain
130
+ this.witnessChain?.append('BRANCH_DISCARD', {
131
+ agentId: handle.agentId,
132
+ action: 'discard',
133
+ branchPath: handle.childPath,
134
+ }, `agent-${handle.agentId}`);
135
+ this.cleanupBranchFile(handle);
136
+ this.activeBranches.delete(handle.agentId);
137
+ }
138
+ // --------------------------------------------------------------------------
139
+ // Branch Management
140
+ // --------------------------------------------------------------------------
141
+ /** Get active branch for an agent (if any) */
142
+ getBranch(agentId) {
143
+ return this.activeBranches.get(agentId);
144
+ }
145
+ /** List all active branches */
146
+ getActiveBranches() {
147
+ return Array.from(this.activeBranches.values());
148
+ }
149
+ /** List all branch files on disk (including orphans) */
150
+ listBranchFiles() {
151
+ if (!existsSync(this.config.branchDir))
152
+ return [];
153
+ const files = readdirSync(this.config.branchDir)
154
+ .filter(f => f.endsWith('.rvf'));
155
+ return files.map(f => {
156
+ const fullPath = join(this.config.branchDir, f);
157
+ const stat = statSync(fullPath);
158
+ return {
159
+ agentId: basename(f, '.rvf'),
160
+ path: fullPath,
161
+ sizeBytes: stat.size,
162
+ modifiedAt: stat.mtime,
163
+ };
164
+ });
165
+ }
166
+ /**
167
+ * Clean up orphaned branch files older than maxAge.
168
+ * An orphan is a .rvf file in branchDir with no active branch.
169
+ */
170
+ cleanupOrphans(maxAgeMs) {
171
+ const maxAge = maxAgeMs ?? this.config.orphanMaxAgeMs;
172
+ const now = Date.now();
173
+ let cleaned = 0;
174
+ for (const info of this.listBranchFiles()) {
175
+ const age = now - info.modifiedAt.getTime();
176
+ if (age > maxAge && !this.activeBranches.has(info.agentId)) {
177
+ try {
178
+ unlinkSync(info.path);
179
+ // Also remove idmap sidecar if present
180
+ const idmapPath = `${info.path}.idmap.json`;
181
+ if (existsSync(idmapPath))
182
+ unlinkSync(idmapPath);
183
+ cleaned++;
184
+ }
185
+ catch {
186
+ // Best effort cleanup
187
+ }
188
+ }
189
+ }
190
+ return cleaned;
191
+ }
192
+ // --------------------------------------------------------------------------
193
+ // Private Helpers
194
+ // --------------------------------------------------------------------------
195
+ cleanupBranchFile(handle) {
196
+ try {
197
+ handle.childAdapter.close();
198
+ }
199
+ catch { /* best effort */ }
200
+ try {
201
+ if (existsSync(handle.childPath)) {
202
+ unlinkSync(handle.childPath);
203
+ }
204
+ // Remove idmap sidecar
205
+ const idmapPath = `${handle.childPath}.idmap.json`;
206
+ if (existsSync(idmapPath)) {
207
+ unlinkSync(idmapPath);
208
+ }
209
+ }
210
+ catch { /* best effort */ }
211
+ }
212
+ }
213
+ //# sourceMappingURL=agent-memory-branch.js.map
@@ -24,6 +24,15 @@ export declare class MailboxService {
24
24
  private readonly broadcastHandlers;
25
25
  /** Index of agents by domain for efficient broadcast */
26
26
  private readonly domainAgents;
27
+ /** R13: Optional cognitive router for bandwidth-efficient messaging (lazy-initialized) */
28
+ private cognitiveRouter;
29
+ private cognitiveRouterInitialized;
30
+ /**
31
+ * R13: Tracks which messages were stored with compressed payloads.
32
+ * Maps message ID to the RoutedMessage needed for decompression on receive().
33
+ * This avoids modifying the AgentMessage type while enabling real compression.
34
+ */
35
+ private readonly compressedMessages;
27
36
  /**
28
37
  * Create a mailbox for an agent. If a mailbox already exists for this
29
38
  * agent ID, the existing mailbox is returned unchanged.
@@ -132,6 +141,40 @@ export declare class MailboxService {
132
141
  * Create an immutable snapshot of a mutable mailbox.
133
142
  */
134
143
  private toSnapshot;
144
+ /**
145
+ * Lazily initialize the cognitive router when the feature flag is enabled.
146
+ * Returns the router instance or null if disabled / unavailable.
147
+ */
148
+ private ensureCognitiveRouter;
149
+ /**
150
+ * Attempt to compress a message via the cognitive router.
151
+ * When compression succeeds (compressed payload is smaller), returns a new
152
+ * AgentMessage with the compressed payload and tracks the RoutedMessage
153
+ * for later decompression. When compression is unavailable or unhelpful,
154
+ * returns the original message unchanged.
155
+ *
156
+ * Non-blocking: any error returns the original message unmodified.
157
+ */
158
+ private compressViaCognitive;
159
+ /**
160
+ * Decompress messages that were stored with compressed payloads.
161
+ * Uses the cognitive router's receive() to reconstruct original payloads.
162
+ * Messages that were not compressed are returned unchanged.
163
+ *
164
+ * Non-blocking: decompression failures return the stored payload as-is.
165
+ */
166
+ private decompressMessages;
167
+ /**
168
+ * Get cognitive routing statistics (bandwidth savings, compression rates).
169
+ * Returns null if cognitive routing is not enabled or not initialized.
170
+ */
171
+ getCognitiveRoutingStats(): {
172
+ totalMessages: number;
173
+ compressedMessages: number;
174
+ bandwidthSavedBytes: number;
175
+ bandwidthReductionPercent: number;
176
+ activeStreams: number;
177
+ } | null;
135
178
  }
136
179
  /**
137
180
  * Create a new MailboxService instance.
@@ -10,6 +10,7 @@
10
10
  * - Unread tracking with peek support
11
11
  * - Event callbacks for message arrival
12
12
  */
13
+ import { isCognitiveRoutingEnabled, createCognitiveRouter, } from '../../integrations/ruvector/cognitive-routing.js';
13
14
  // ============================================================================
14
15
  // Mailbox Service
15
16
  // ============================================================================
@@ -26,6 +27,15 @@ export class MailboxService {
26
27
  broadcastHandlers = new Map();
27
28
  /** Index of agents by domain for efficient broadcast */
28
29
  domainAgents = new Map();
30
+ /** R13: Optional cognitive router for bandwidth-efficient messaging (lazy-initialized) */
31
+ cognitiveRouter = null;
32
+ cognitiveRouterInitialized = false;
33
+ /**
34
+ * R13: Tracks which messages were stored with compressed payloads.
35
+ * Maps message ID to the RoutedMessage needed for decompression on receive().
36
+ * This avoids modifying the AgentMessage type while enabling real compression.
37
+ */
38
+ compressedMessages = new Map();
29
39
  // ============================================================================
30
40
  // Mailbox Lifecycle
31
41
  // ============================================================================
@@ -89,6 +99,10 @@ export class MailboxService {
89
99
  this.domainAgents.delete(mailbox.domain);
90
100
  }
91
101
  }
102
+ // R13: Clean up compressed message tracking for this mailbox
103
+ for (const msg of mailbox.messages) {
104
+ this.compressedMessages.delete(msg.id);
105
+ }
92
106
  // Remove handlers
93
107
  this.messageHandlers.delete(agentId);
94
108
  // Remove mailbox
@@ -115,7 +129,12 @@ export class MailboxService {
115
129
  throw new Error(`No mailbox found for agent '${message.to}'. ` +
116
130
  `Create a mailbox first with createMailbox().`);
117
131
  }
118
- mailbox.messages.push(message);
132
+ // R13: Route through cognitive router for bandwidth compression.
133
+ // When compression succeeds, store the smaller compressed payload instead
134
+ // of the original. The original is reconstructed on receive().
135
+ // Non-blocking: routing failure must not prevent message delivery.
136
+ const messageToStore = this.compressViaCognitive(message);
137
+ mailbox.messages.push(messageToStore);
119
138
  mailbox.unreadCount++;
120
139
  // Notify listeners
121
140
  const handlers = this.messageHandlers.get(message.to);
@@ -211,7 +230,9 @@ export class MailboxService {
211
230
  // Mark all as read (regardless of filters, reading marks the mailbox)
212
231
  mailbox.unreadCount = 0;
213
232
  mailbox.lastRead = now;
214
- return unread;
233
+ // R13: Decompress any messages that were stored with compressed payloads.
234
+ // Returns original payloads to the consumer transparently.
235
+ return this.decompressMessages(unread);
215
236
  }
216
237
  /**
217
238
  * Check unread message count without marking any as read.
@@ -254,11 +275,15 @@ export class MailboxService {
254
275
  const readIndex = mailbox.messages.length - mailbox.unreadCount;
255
276
  mailbox.messages = mailbox.messages.filter((msg, index) => {
256
277
  // Remove if older than max age
257
- if (msg.timestamp < cutoff)
278
+ if (msg.timestamp < cutoff) {
279
+ this.compressedMessages.delete(msg.id); // R13: clean up tracking
258
280
  return false;
281
+ }
259
282
  // Remove if TTL expired
260
- if (this.isExpired(msg, now))
283
+ if (this.isExpired(msg, now)) {
284
+ this.compressedMessages.delete(msg.id); // R13: clean up tracking
261
285
  return false;
286
+ }
262
287
  return true;
263
288
  });
264
289
  const removedFromMailbox = before - mailbox.messages.length;
@@ -356,6 +381,9 @@ export class MailboxService {
356
381
  this.messageHandlers.clear();
357
382
  this.broadcastHandlers.clear();
358
383
  this.domainAgents.clear();
384
+ this.compressedMessages.clear(); // R13: clear compressed message index
385
+ this.cognitiveRouter = null; // R13: reset cognitive router
386
+ this.cognitiveRouterInitialized = false;
359
387
  }
360
388
  // ============================================================================
361
389
  // Private Helpers
@@ -380,6 +408,104 @@ export class MailboxService {
380
408
  lastRead: mailbox.lastRead,
381
409
  };
382
410
  }
411
+ // ============================================================================
412
+ // R13: Cognitive Routing Integration (ADR-087)
413
+ // ============================================================================
414
+ /**
415
+ * Lazily initialize the cognitive router when the feature flag is enabled.
416
+ * Returns the router instance or null if disabled / unavailable.
417
+ */
418
+ ensureCognitiveRouter() {
419
+ if (this.cognitiveRouterInitialized) {
420
+ return this.cognitiveRouter;
421
+ }
422
+ this.cognitiveRouterInitialized = true;
423
+ if (!isCognitiveRoutingEnabled()) {
424
+ return null;
425
+ }
426
+ try {
427
+ this.cognitiveRouter = createCognitiveRouter() ?? null;
428
+ }
429
+ catch {
430
+ // Module unavailable — leave router null
431
+ this.cognitiveRouter = null;
432
+ }
433
+ return this.cognitiveRouter;
434
+ }
435
+ /**
436
+ * Attempt to compress a message via the cognitive router.
437
+ * When compression succeeds (compressed payload is smaller), returns a new
438
+ * AgentMessage with the compressed payload and tracks the RoutedMessage
439
+ * for later decompression. When compression is unavailable or unhelpful,
440
+ * returns the original message unchanged.
441
+ *
442
+ * Non-blocking: any error returns the original message unmodified.
443
+ */
444
+ compressViaCognitive(message) {
445
+ try {
446
+ const router = this.ensureCognitiveRouter();
447
+ if (!router)
448
+ return message;
449
+ const streamId = `${message.from}->${message.to}`;
450
+ const routed = router.send(streamId, message.from, message.to, message.payload);
451
+ // Only store compressed version when it actually saves space
452
+ if (routed.compressed && routed.compressedSize < routed.originalSize) {
453
+ // Track the RoutedMessage so receive() can decompress
454
+ this.compressedMessages.set(message.id, routed);
455
+ // Return a copy with the compressed (delta) payload
456
+ return {
457
+ ...message,
458
+ payload: routed.payload,
459
+ };
460
+ }
461
+ // Compression didn't help — return original
462
+ return message;
463
+ }
464
+ catch {
465
+ // Routing failure must never prevent message delivery
466
+ return message;
467
+ }
468
+ }
469
+ /**
470
+ * Decompress messages that were stored with compressed payloads.
471
+ * Uses the cognitive router's receive() to reconstruct original payloads.
472
+ * Messages that were not compressed are returned unchanged.
473
+ *
474
+ * Non-blocking: decompression failures return the stored payload as-is.
475
+ */
476
+ decompressMessages(messages) {
477
+ const router = this.cognitiveRouter;
478
+ if (!router || this.compressedMessages.size === 0)
479
+ return messages;
480
+ return messages.map(msg => {
481
+ try {
482
+ const routed = this.compressedMessages.get(msg.id);
483
+ if (!routed)
484
+ return msg;
485
+ // Decompress via the router's receive path
486
+ const originalPayload = router.receive(routed);
487
+ // Clean up — message has been delivered/decompressed
488
+ this.compressedMessages.delete(msg.id);
489
+ return {
490
+ ...msg,
491
+ payload: originalPayload,
492
+ };
493
+ }
494
+ catch {
495
+ // Decompression failure — return the stored payload as-is
496
+ return msg;
497
+ }
498
+ });
499
+ }
500
+ /**
501
+ * Get cognitive routing statistics (bandwidth savings, compression rates).
502
+ * Returns null if cognitive routing is not enabled or not initialized.
503
+ */
504
+ getCognitiveRoutingStats() {
505
+ if (!this.cognitiveRouter)
506
+ return null;
507
+ return this.cognitiveRouter.getStats();
508
+ }
383
509
  }
384
510
  // ============================================================================
385
511
  // Factory Function
@@ -95,6 +95,7 @@ export declare function parseCoberturaXml(content: string): CoverageData;
95
95
  export declare function discoverSourceFiles(targetPath: string, options?: {
96
96
  includeTests?: boolean;
97
97
  languages?: string[];
98
+ maxFiles?: number;
98
99
  }): Promise<string[]>;
99
100
  /**
100
101
  * Generate security recommendations based on findings
@@ -342,7 +342,7 @@ export function parseCoberturaXml(content) {
342
342
  */
343
343
  export async function discoverSourceFiles(targetPath, options = {}) {
344
344
  const files = [];
345
- const { includeTests = true, languages } = options;
345
+ const { includeTests = true, languages, maxFiles = 5000 } = options;
346
346
  // Determine file extensions to include
347
347
  // Default: scan ALL common source languages unless explicitly filtered
348
348
  let extensions = [
@@ -398,9 +398,14 @@ export async function discoverSourceFiles(targetPath, options = {}) {
398
398
  if (entry.isDirectory()) {
399
399
  if (['node_modules', '.git', 'dist', 'build', 'coverage', '.nyc_output',
400
400
  '__pycache__', '.venv', 'venv', '.tox', '.mypy_cache', 'target',
401
- '.gradle', 'vendor', '.bundle'].includes(entry.name)) {
401
+ '.gradle', 'vendor', '.bundle',
402
+ '.agentic-qe', '.claude', '.cache', '.npm', '.yarn',
403
+ '.next', '.nuxt', '.svelte-kit', 'out', '.turbo',
404
+ 'tmp', 'temp', '.tmp'].includes(entry.name)) {
402
405
  continue;
403
406
  }
407
+ if (files.length >= maxFiles)
408
+ return; // Cap reached
404
409
  await walkDir(fullPath);
405
410
  }
406
411
  else if (entry.isFile()) {
@@ -420,6 +425,8 @@ export async function discoverSourceFiles(targetPath, options = {}) {
420
425
  if (isTestFile)
421
426
  continue;
422
427
  }
428
+ if (files.length >= maxFiles)
429
+ return; // Cap reached
423
430
  files.push(fullPath);
424
431
  }
425
432
  }
@@ -23,7 +23,13 @@ export function registerQualityHandlers(ctx) {
23
23
  sourceFiles = await discoverSourceFiles(payload.target, { includeTests: false });
24
24
  }
25
25
  else {
26
- sourceFiles = await discoverSourceFiles(process.cwd(), { includeTests: false });
26
+ // Default to src/ scanning the entire project root is too slow
27
+ // (node_modules, dist, .git, etc. make it hang on large projects)
28
+ const path = await import('path');
29
+ const fs = await import('fs');
30
+ const srcDir = path.join(process.cwd(), 'src');
31
+ const targetDir = fs.existsSync(srcDir) ? srcDir : process.cwd();
32
+ sourceFiles = await discoverSourceFiles(targetDir, { includeTests: false });
27
33
  }
28
34
  if (sourceFiles.length === 0) {
29
35
  return ok({
@@ -972,6 +972,17 @@ export class ContractTestingCoordinator extends BaseDomainCoordinator {
972
972
  validationSuccess ? 1 : 0,
973
973
  contract.version.major / 10,
974
974
  ]);
975
+ // EWC++ outcome recording: reward based on validation result
976
+ try {
977
+ this.qesona.recordOutcome(validationSuccess ? quality : -quality);
978
+ if (this.qesona.shouldConsolidate()) {
979
+ try {
980
+ this.qesona.backgroundConsolidate();
981
+ }
982
+ catch { /* best-effort */ }
983
+ }
984
+ }
985
+ catch { /* must not break main flow */ }
975
986
  }
976
987
  const action = {
977
988
  type: validationSuccess ? 'validate' : 'reject',
@@ -5,7 +5,7 @@
5
5
  * Evaluates quality lambda and makes 4-tier deployment decisions.
6
6
  * Based on ruvector-mincut-gated-transformer's gate control patterns.
7
7
  */
8
- import { QualityLambda, QualityTier, QualityGateDecision, CoherenceGatePolicy } from './types';
8
+ import { QualityLambda, QualityTier, QualityGateDecision, CoherenceGatePolicy, RatchetConfig, RatchetState } from './types';
9
9
  /**
10
10
  * Configuration for the coherence gate controller
11
11
  */
@@ -106,6 +106,25 @@ export declare class CoherenceGateController {
106
106
  */
107
107
  private recordDecision;
108
108
  }
109
+ /**
110
+ * Check whether a ratchet should occur based on the gate pass/fail result
111
+ * and return the updated ratchet state.
112
+ *
113
+ * Ratcheting rules:
114
+ * - If gate passed: increment consecutivePasses
115
+ * - If consecutivePasses >= required AND cooldown elapsed: ratchet up
116
+ * - Threshold is capped at maxThreshold (95% default)
117
+ * - MONOTONIC INVARIANT: new threshold >= old threshold (never decreases)
118
+ * - If gate failed: reset consecutivePasses to 0
119
+ * - If feature flag disabled: return state unchanged
120
+ *
121
+ * @param passed - Whether the quality gate passed
122
+ * @param config - Ratchet configuration
123
+ * @param state - Current ratchet state
124
+ * @param now - Current timestamp in ms (default: Date.now())
125
+ * @returns Updated ratchet state
126
+ */
127
+ export declare function checkRatchet(passed: boolean, config: RatchetConfig, state: RatchetState, now?: number): RatchetState;
109
128
  /**
110
129
  * Factory function to create a coherence gate controller
111
130
  */
@@ -396,6 +396,70 @@ export class CoherenceGateController {
396
396
  }
397
397
  }
398
398
  }
399
+ // ============================================================================
400
+ // ADR-062 Tier 2: Monotonic Gate Threshold Ratcheting
401
+ // ============================================================================
402
+ /**
403
+ * Check whether a ratchet should occur based on the gate pass/fail result
404
+ * and return the updated ratchet state.
405
+ *
406
+ * Ratcheting rules:
407
+ * - If gate passed: increment consecutivePasses
408
+ * - If consecutivePasses >= required AND cooldown elapsed: ratchet up
409
+ * - Threshold is capped at maxThreshold (95% default)
410
+ * - MONOTONIC INVARIANT: new threshold >= old threshold (never decreases)
411
+ * - If gate failed: reset consecutivePasses to 0
412
+ * - If feature flag disabled: return state unchanged
413
+ *
414
+ * @param passed - Whether the quality gate passed
415
+ * @param config - Ratchet configuration
416
+ * @param state - Current ratchet state
417
+ * @param now - Current timestamp in ms (default: Date.now())
418
+ * @returns Updated ratchet state
419
+ */
420
+ export function checkRatchet(passed, config, state, now = Date.now()) {
421
+ // Feature flag check: if disabled via env or config, return state unchanged
422
+ if (process.env.AQE_GATE_RATCHETING_ENABLED !== 'true' || !config.enabled) {
423
+ return state;
424
+ }
425
+ // Clone state to avoid mutation
426
+ const newState = {
427
+ currentThreshold: state.currentThreshold,
428
+ consecutivePasses: state.consecutivePasses,
429
+ lastRatchetTime: state.lastRatchetTime,
430
+ history: [...state.history],
431
+ };
432
+ if (!passed) {
433
+ // Gate failed: reset consecutive passes counter
434
+ newState.consecutivePasses = 0;
435
+ return newState;
436
+ }
437
+ // Gate passed: increment consecutive passes
438
+ newState.consecutivePasses = newState.consecutivePasses + 1;
439
+ // Check if we should ratchet
440
+ const hasEnoughPasses = newState.consecutivePasses >= config.consecutivePassesRequired;
441
+ const cooldownElapsed = (now - newState.lastRatchetTime) >= config.cooldownMs;
442
+ if (hasEnoughPasses && cooldownElapsed) {
443
+ // Calculate new threshold
444
+ const proposedThreshold = newState.currentThreshold + config.ratchetIncrementPercent;
445
+ // Cap at max threshold
446
+ const cappedThreshold = Math.min(proposedThreshold, config.maxThreshold);
447
+ // MONOTONIC INVARIANT: never decrease
448
+ const newThreshold = Math.max(cappedThreshold, newState.currentThreshold);
449
+ // Only record a ratchet if threshold actually changed
450
+ if (newThreshold > newState.currentThreshold) {
451
+ newState.currentThreshold = newThreshold;
452
+ newState.lastRatchetTime = now;
453
+ newState.history.push({
454
+ threshold: newThreshold,
455
+ ratchetedAt: now,
456
+ });
457
+ }
458
+ // Reset consecutive passes after ratchet attempt (whether or not threshold changed)
459
+ newState.consecutivePasses = 0;
460
+ }
461
+ return newState;
462
+ }
399
463
  /**
400
464
  * Factory function to create a coherence gate controller
401
465
  */
@@ -40,12 +40,12 @@
40
40
  * console.log(`Found ${partitions.partitionCount} quality partitions`);
41
41
  * ```
42
42
  */
43
- export type { QualityLambda, QualityDimensions, QualityMetricsInput, QualityGateReason, QualityAction, QualityGateDecision, CoherenceGatePolicy, QualityPartition, LambdaHistoryPoint, LambdaTrend, } from './types.js';
44
- export { QualityTier, QualityLambdaFlags, DEFAULT_COHERENCE_GATE_POLICY, } from './types.js';
43
+ export type { QualityLambda, QualityDimensions, QualityMetricsInput, QualityGateReason, QualityAction, QualityGateDecision, CoherenceGatePolicy, QualityPartition, LambdaHistoryPoint, LambdaTrend, RatchetConfig, RatchetState, } from './types.js';
44
+ export { QualityTier, QualityLambdaFlags, DEFAULT_COHERENCE_GATE_POLICY, DEFAULT_RATCHET_CONFIG, } from './types.js';
45
45
  export type { QualityPartitionType } from './types.js';
46
46
  export { LambdaCalculator, createLambdaCalculator, calculateQualityLambda, } from './lambda-calculator.js';
47
47
  export type { LambdaCalculatorConfig, } from './lambda-calculator.js';
48
- export { CoherenceGateController, createCoherenceGateController, evaluateQualityGate, } from './gate-controller.js';
48
+ export { CoherenceGateController, createCoherenceGateController, evaluateQualityGate, checkRatchet, } from './gate-controller.js';
49
49
  export type { CoherenceGateControllerConfig, } from './gate-controller.js';
50
50
  export { PartitionDetector, createPartitionDetector, detectQualityPartitions, } from './partition-detector.js';
51
51
  export type { PartitionDetectorConfig, PartitionDetectionResult, RemediationStep, RemediationPlan, } from './partition-detector.js';
@@ -41,11 +41,11 @@
41
41
  * ```
42
42
  */
43
43
  // Runtime values (enums and constants)
44
- export { QualityTier, QualityLambdaFlags, DEFAULT_COHERENCE_GATE_POLICY, } from './types.js';
44
+ export { QualityTier, QualityLambdaFlags, DEFAULT_COHERENCE_GATE_POLICY, DEFAULT_RATCHET_CONFIG, } from './types.js';
45
45
  // Lambda Calculator
46
46
  export { LambdaCalculator, createLambdaCalculator, calculateQualityLambda, } from './lambda-calculator.js';
47
47
  // Gate Controller
48
- export { CoherenceGateController, createCoherenceGateController, evaluateQualityGate, } from './gate-controller.js';
48
+ export { CoherenceGateController, createCoherenceGateController, evaluateQualityGate, checkRatchet, } from './gate-controller.js';
49
49
  // Partition Detector
50
50
  export { PartitionDetector, createPartitionDetector, detectQualityPartitions, } from './partition-detector.js';
51
51
  import { calculateQualityLambda } from './lambda-calculator.js';