agentic-qe 3.14.4 → 3.14.6

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 (486) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +169 -0
  3. package/assets/skills/skills-manifest.json +1 -1
  4. package/dist/adapters/ag-ui/event-types.d.ts +1 -1
  5. package/dist/audit/witness-chain-hash.d.ts +18 -0
  6. package/dist/audit/witness-chain-hash.js +37 -0
  7. package/dist/audit/witness-chain-repair.d.ts +71 -0
  8. package/dist/audit/witness-chain-repair.js +203 -0
  9. package/dist/audit/witness-chain-verifier.d.ts +152 -0
  10. package/dist/audit/witness-chain-verifier.js +293 -0
  11. package/dist/audit/witness-chain.d.ts +10 -43
  12. package/dist/audit/witness-chain.js +43 -126
  13. package/dist/audit/witness-findings.js +4 -1
  14. package/dist/cli/bundle.js +13 -10
  15. package/dist/cli/chunks/adapter-UYOJPTOX.js +2 -0
  16. package/dist/cli/chunks/agent-booster-wasm-2YGML6OU.js +2 -0
  17. package/dist/cli/chunks/{agent-handler-RDNTK4CA.js → agent-handler-D5SSQYNU.js} +2 -2
  18. package/dist/cli/chunks/{agent-memory-branch-NAAMBWIR.js → agent-memory-branch-YHPLTITV.js} +2 -2
  19. package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +2 -0
  20. package/dist/cli/chunks/{arena-KXFHRWX4.js → arena-7BGOXGXO.js} +2 -2
  21. package/dist/cli/chunks/{arena-HXTWJ5YY.js → arena-MCE6EU7K.js} +4 -4
  22. package/dist/cli/chunks/audit-BMWTQECB.js +4 -0
  23. package/dist/cli/chunks/base-DRZ2LS6X.js +2 -0
  24. package/dist/cli/chunks/{better-sqlite3-UICJZIDG.js → better-sqlite3-PMUNGASU.js} +2 -2
  25. package/dist/cli/chunks/brain-handler-QPUFYX7F.js +94 -0
  26. package/dist/cli/chunks/{branch-enumerator-SS7UNVIA.js → branch-enumerator-WKFDGRN4.js} +2 -2
  27. package/dist/cli/chunks/{browser-77GI6KBE.js → browser-VY5HKH5X.js} +2 -2
  28. package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +2 -0
  29. package/dist/cli/chunks/{chunk-PZJOPURC.js → chunk-257E2A5M.js} +5 -5
  30. package/dist/cli/chunks/{chunk-55RWDRJD.js → chunk-2JVWITNK.js} +4 -4
  31. package/dist/cli/chunks/{chunk-BOARZKU3.js → chunk-2NPKIBAZ.js} +2 -2
  32. package/dist/cli/chunks/chunk-2TMWAQQ3.js +13 -0
  33. package/dist/cli/chunks/{chunk-M4WJKGVK.js → chunk-2YXGBZWV.js} +1 -1
  34. package/dist/cli/chunks/{chunk-3VOQRIQM.js → chunk-3EA536JF.js} +2 -2
  35. package/dist/cli/chunks/{chunk-ZZDIMOOV.js → chunk-3EZOZN25.js} +2 -2
  36. package/dist/cli/chunks/{chunk-MNW6QGNJ.js → chunk-3HZS4M3O.js} +2 -2
  37. package/dist/cli/chunks/{chunk-EKQ673SA.js → chunk-3NIG7S5W.js} +1 -1
  38. package/dist/cli/chunks/{chunk-7D777LTF.js → chunk-4N23RFDU.js} +2 -2
  39. package/dist/cli/chunks/{chunk-BOZZYWCR.js → chunk-5J6W7SIA.js} +1 -1
  40. package/dist/cli/chunks/{chunk-HIVA55CJ.js → chunk-5OOMJGFN.js} +1 -1
  41. package/dist/cli/chunks/{chunk-W7BWUTVV.js → chunk-5QQSIGUA.js} +2 -2
  42. package/dist/cli/chunks/{chunk-PAWXJ73E.js → chunk-5VFPCSK7.js} +1 -1
  43. package/dist/cli/chunks/{chunk-KPA7MZ6C.js → chunk-62N4NUJH.js} +2 -2
  44. package/dist/cli/chunks/chunk-64VGZQLB.js +2 -0
  45. package/dist/cli/chunks/{chunk-64PFWE2F.js → chunk-66VWCR67.js} +2 -2
  46. package/dist/cli/chunks/{chunk-XRT2WRMS.js → chunk-6LIHFV7O.js} +2 -2
  47. package/dist/cli/chunks/{chunk-STJCATGN.js → chunk-6OS76PHI.js} +2 -2
  48. package/dist/cli/chunks/{chunk-ZNPKDCZR.js → chunk-6RE3X4V5.js} +2 -2
  49. package/dist/cli/chunks/{chunk-BFP7KO7P.js → chunk-6SH5VZUD.js} +2 -2
  50. package/dist/cli/chunks/chunk-6SQM2MUX.js +4 -0
  51. package/dist/cli/chunks/{chunk-IPR4QP3H.js → chunk-6U7LNMWZ.js} +2 -2
  52. package/dist/cli/chunks/{chunk-MIQTXNBG.js → chunk-72KXSMWI.js} +1 -1
  53. package/dist/cli/chunks/chunk-7CUQCCMD.js +27 -0
  54. package/dist/cli/chunks/chunk-7D3V65N5.js +2 -0
  55. package/dist/cli/chunks/{chunk-JZ3ORVZ3.js → chunk-7J6QC567.js} +3 -3
  56. package/dist/cli/chunks/{chunk-4OYFXLBK.js → chunk-7LPR6HJG.js} +2 -2
  57. package/dist/cli/chunks/{chunk-4MHXCAG2.js → chunk-7NITCZWD.js} +1 -1
  58. package/dist/cli/chunks/{chunk-M5QUBZY6.js → chunk-7Z5LHRC3.js} +2 -2
  59. package/dist/cli/chunks/{chunk-CSU5NYOX.js → chunk-AHKELLIO.js} +4 -4
  60. package/dist/cli/chunks/{chunk-DHJPWQBR.js → chunk-AIRGNL55.js} +2 -2
  61. package/dist/cli/chunks/{chunk-C2WU3533.js → chunk-AJRUJAAK.js} +1 -1
  62. package/dist/cli/chunks/{chunk-HIYXCDEP.js → chunk-AVBJYI5I.js} +1 -1
  63. package/dist/cli/chunks/{chunk-U5K45TFH.js → chunk-B6D2CHEH.js} +1 -1
  64. package/dist/cli/chunks/{chunk-FRH6VAUS.js → chunk-B6MOJC3X.js} +1 -1
  65. package/dist/cli/chunks/{chunk-HUWNIPZ5.js → chunk-BAMN2CHI.js} +1 -1
  66. package/dist/cli/chunks/{chunk-ONII3572.js → chunk-BBT64TII.js} +3 -3
  67. package/dist/cli/chunks/{chunk-KSKEF7LZ.js → chunk-BJTJLJRZ.js} +3 -3
  68. package/dist/cli/chunks/chunk-BMAPORJ7.js +15 -0
  69. package/dist/cli/chunks/{chunk-CIZ5JPDC.js → chunk-BPEDWS6O.js} +3 -3
  70. package/dist/cli/chunks/{chunk-Z3RHREWF.js → chunk-BVR7RMC5.js} +1 -1
  71. package/dist/cli/chunks/{chunk-HDSAM2RE.js → chunk-C6KWXUFJ.js} +2 -2
  72. package/dist/cli/chunks/{chunk-ZBAKA4YB.js → chunk-CCK4BF76.js} +1 -1
  73. package/dist/cli/chunks/{chunk-IFCLB7FJ.js → chunk-CD542DNJ.js} +1 -1
  74. package/dist/cli/chunks/{chunk-6KJABXAR.js → chunk-CF2ISEOJ.js} +2 -2
  75. package/dist/cli/chunks/chunk-CM7U6TAX.js +5 -0
  76. package/dist/cli/chunks/{chunk-3X3DJZJJ.js → chunk-D45SG6CP.js} +1 -1
  77. package/dist/cli/chunks/{chunk-DAEFDCJ4.js → chunk-D6CJIGRU.js} +89 -83
  78. package/dist/cli/chunks/{chunk-MVPCNSPY.js → chunk-DBDPRORT.js} +2 -2
  79. package/dist/cli/chunks/{chunk-AUXFKCQL.js → chunk-DHVX5UB2.js} +2 -2
  80. package/dist/cli/chunks/{chunk-GPLQ6DOK.js → chunk-DK4XN4CU.js} +2 -2
  81. package/dist/cli/chunks/{chunk-SRKETSFF.js → chunk-DPYSUDAO.js} +1 -1
  82. package/dist/cli/chunks/{chunk-CNG6GQEZ.js → chunk-DUYOVM5I.js} +2 -2
  83. package/dist/cli/chunks/{chunk-VIHTL3U2.js → chunk-DZ3AUAAB.js} +2 -2
  84. package/dist/cli/chunks/{chunk-CU46J64M.js → chunk-E6G2RD5H.js} +2 -2
  85. package/dist/cli/chunks/{chunk-5YPYDPBJ.js → chunk-EAY2JMZG.js} +2 -2
  86. package/dist/cli/chunks/{chunk-V3QLFNA2.js → chunk-ELLBS5RP.js} +4 -4
  87. package/dist/cli/chunks/chunk-ENGZ4D5V.js +2 -0
  88. package/dist/cli/chunks/chunk-FBMN7B46.js +4 -0
  89. package/dist/cli/chunks/{chunk-EDJ3O7RH.js → chunk-FWASDOT2.js} +2 -2
  90. package/dist/cli/chunks/{chunk-MDWCE7YW.js → chunk-FZOBD67M.js} +1 -1
  91. package/dist/cli/chunks/{chunk-A4FYONNU.js → chunk-GDSXITFH.js} +2 -2
  92. package/dist/cli/chunks/{chunk-2JW3BCGG.js → chunk-GGRHV6D7.js} +1 -1
  93. package/dist/cli/chunks/{chunk-ISDMD6EU.js → chunk-GPYVDFB3.js} +90 -90
  94. package/dist/cli/chunks/{chunk-CDKG6EI7.js → chunk-GSF6MB64.js} +2 -2
  95. package/dist/cli/chunks/{chunk-WLG5AJ4N.js → chunk-H52HZ67P.js} +2 -2
  96. package/dist/cli/chunks/{chunk-FGYMFUE2.js → chunk-H5BS5VH7.js} +2 -2
  97. package/dist/cli/chunks/{chunk-34WO57CW.js → chunk-H6ZM3PUT.js} +1 -1
  98. package/dist/cli/chunks/{chunk-6CQN24ZK.js → chunk-HM6ZSCPI.js} +1 -1
  99. package/dist/cli/chunks/{chunk-DPFRKBOG.js → chunk-HNFVJP4I.js} +2 -2
  100. package/dist/cli/chunks/{chunk-TPGED2IF.js → chunk-I33ERSGB.js} +2 -2
  101. package/dist/cli/chunks/{chunk-UEM7ZF5K.js → chunk-IAF6T27S.js} +2 -2
  102. package/dist/cli/chunks/{chunk-KCZR45PA.js → chunk-IB27QACC.js} +2 -2
  103. package/dist/cli/chunks/{chunk-SGYJ4NFZ.js → chunk-ICTXTNQZ.js} +1 -1
  104. package/dist/cli/chunks/chunk-IG5GNEC6.js +4 -0
  105. package/dist/cli/chunks/{chunk-KHFNNVJA.js → chunk-IQO7UCFR.js} +2 -2
  106. package/dist/cli/chunks/{chunk-3TW5W5LX.js → chunk-IV5UZOHH.js} +2 -2
  107. package/dist/cli/chunks/{chunk-7ZIOFPL3.js → chunk-JBTPOIAC.js} +2 -2
  108. package/dist/cli/chunks/{chunk-ZNEMGX5O.js → chunk-JIXUMYKZ.js} +1 -1
  109. package/dist/cli/chunks/{chunk-MTZH7AHC.js → chunk-JMONHE4B.js} +1 -1
  110. package/dist/cli/chunks/{chunk-TDZ53WO2.js → chunk-JVNTSNWU.js} +2 -2
  111. package/dist/cli/chunks/{chunk-PFR4G3DJ.js → chunk-JXGFRBUO.js} +2 -2
  112. package/dist/cli/chunks/chunk-JZOS5FCX.js +2 -0
  113. package/dist/cli/chunks/{chunk-STM3UDNO.js → chunk-KNNISEDY.js} +2 -2
  114. package/dist/cli/chunks/{chunk-TWAWHOP7.js → chunk-L4RUBPLR.js} +2 -2
  115. package/dist/cli/chunks/chunk-LL3IGZBI.js +2 -0
  116. package/dist/cli/chunks/{chunk-CIKSHTEQ.js → chunk-MBRHSU6W.js} +10 -10
  117. package/dist/cli/chunks/{chunk-G6T45OIC.js → chunk-MJS53PRX.js} +2 -2
  118. package/dist/cli/chunks/{chunk-PO3IXGMQ.js → chunk-MQROI74N.js} +2 -2
  119. package/dist/cli/chunks/{chunk-DOTK76IJ.js → chunk-MUOG6QXR.js} +2 -2
  120. package/dist/cli/chunks/{chunk-MVNP7GIR.js → chunk-MW2GGZZ5.js} +1 -1
  121. package/dist/cli/chunks/{chunk-FWGOHAAB.js → chunk-NHWGMJAP.js} +2 -2
  122. package/dist/cli/chunks/{chunk-ZBJ4XOOV.js → chunk-NMAIY4PX.js} +4 -4
  123. package/dist/cli/chunks/{chunk-CDHQFHRP.js → chunk-NQZ5AR3D.js} +2 -2
  124. package/dist/cli/chunks/{chunk-FLYOJOKN.js → chunk-P6OYS755.js} +1 -1
  125. package/dist/cli/chunks/{chunk-BGE6FOLM.js → chunk-PI7TJS62.js} +2 -2
  126. package/dist/cli/chunks/chunk-PX5YDCRH.js +4 -0
  127. package/dist/cli/chunks/{chunk-Q5DO24IJ.js → chunk-PZPWRQ2M.js} +3 -3
  128. package/dist/cli/chunks/{chunk-R4VL6E65.js → chunk-Q5XTSMWR.js} +2 -2
  129. package/dist/cli/chunks/{chunk-JBNEE5UH.js → chunk-Q7EAGKAE.js} +2 -2
  130. package/dist/cli/chunks/{chunk-R5NE6B2M.js → chunk-QDFTT3RF.js} +2 -2
  131. package/dist/cli/chunks/{chunk-DFZCKIGY.js → chunk-QGA55PFM.js} +3 -3
  132. package/dist/cli/chunks/{chunk-RJCYCLZV.js → chunk-QW6VMTBR.js} +2 -2
  133. package/dist/cli/chunks/{chunk-6VRA2QGL.js → chunk-QZANMBIT.js} +1 -1
  134. package/dist/cli/chunks/{chunk-MEGDYJPV.js → chunk-RETBYIAC.js} +4 -4
  135. package/dist/cli/chunks/{chunk-XJ7QNVI5.js → chunk-RFNPJK6N.js} +3 -3
  136. package/dist/cli/chunks/{chunk-NJBGXDQ7.js → chunk-RG52OKAM.js} +1 -1
  137. package/dist/cli/chunks/{chunk-DA5K5754.js → chunk-RSXXCL4A.js} +1 -1
  138. package/dist/cli/chunks/{chunk-HV2J7KKQ.js → chunk-RTFO5UQH.js} +2 -2
  139. package/dist/cli/chunks/{chunk-6UWGMOND.js → chunk-RZZCUIAI.js} +2 -2
  140. package/dist/cli/chunks/chunk-SDRHUMJB.js +2 -0
  141. package/dist/cli/chunks/{chunk-TSRSV3LD.js → chunk-SE4WIB26.js} +1 -1
  142. package/dist/cli/chunks/{chunk-ODKLFVYC.js → chunk-SESK3ARK.js} +2 -2
  143. package/dist/cli/chunks/{chunk-AWWNB2T7.js → chunk-SJUXE4IC.js} +2 -2
  144. package/dist/cli/chunks/{chunk-QGIU2WRL.js → chunk-SMDN3BQZ.js} +1 -1
  145. package/dist/cli/chunks/{chunk-VD6QRULW.js → chunk-SNOBH4AZ.js} +2 -2
  146. package/dist/cli/chunks/{chunk-OSLYSG3B.js → chunk-SPV2VKC5.js} +2 -2
  147. package/dist/cli/chunks/chunk-TCHGOB2N.js +2 -0
  148. package/dist/cli/chunks/{chunk-MOBNBMFW.js → chunk-TVYY3OCX.js} +1 -1
  149. package/dist/cli/chunks/{chunk-UGVHCMUN.js → chunk-UCFQALXO.js} +3 -3
  150. package/dist/cli/chunks/{chunk-3QHGWY7T.js → chunk-UKA2KOXE.js} +2 -2
  151. package/dist/cli/chunks/{chunk-MCUJEZT6.js → chunk-UNFFDHER.js} +16 -11
  152. package/dist/cli/chunks/{chunk-6QYNWR7U.js → chunk-UQ32JHES.js} +2 -2
  153. package/dist/cli/chunks/{chunk-OULHKEVH.js → chunk-V4DM6ELU.js} +2 -2
  154. package/dist/cli/chunks/{chunk-M2JBBZQB.js → chunk-VGFFFKGK.js} +2 -2
  155. package/dist/cli/chunks/{chunk-OCWWP5PL.js → chunk-VMNWDJIZ.js} +2 -2
  156. package/dist/cli/chunks/chunk-W6HXLH5G.js +180 -0
  157. package/dist/cli/chunks/{chunk-AIHDEEJO.js → chunk-WCJBU2KI.js} +2 -2
  158. package/dist/cli/chunks/{chunk-ZBQY5GLF.js → chunk-WGM35YWL.js} +2 -2
  159. package/dist/cli/chunks/chunk-WO4QMXIG.js +3 -0
  160. package/dist/cli/chunks/{chunk-3UPAMMCB.js → chunk-XAS3XRYM.js} +1 -1
  161. package/dist/cli/chunks/chunk-Y3LZ35OG.js +2 -0
  162. package/dist/cli/chunks/{chunk-5R3QL7WN.js → chunk-Y3UOUNHM.js} +2 -2
  163. package/dist/cli/chunks/{chunk-ZJ26AQA5.js → chunk-YFBSPLJG.js} +1 -1
  164. package/dist/cli/chunks/{chunk-BDESSCVR.js → chunk-YHKEDEAA.js} +3 -3
  165. package/dist/cli/chunks/{chunk-CXQPR5MY.js → chunk-YS4FCTWF.js} +1 -1
  166. package/dist/cli/chunks/{chunk-CLTMDCSE.js → chunk-YSLL6VSL.js} +2 -2
  167. package/dist/cli/chunks/chunk-Z6GGIRQQ.js +65 -0
  168. package/dist/cli/chunks/{chunk-F3SBRQC6.js → chunk-Z7WODOTH.js} +2 -2
  169. package/dist/cli/chunks/chunk-ZCRTRYXK.js +14 -0
  170. package/dist/cli/chunks/{chunk-XRYF6JV7.js → chunk-ZEV3YTO7.js} +2 -2
  171. package/dist/cli/chunks/{chunk-YNXS6CGV.js → chunk-ZL6SYKUK.js} +1 -1
  172. package/dist/cli/chunks/{chunk-5SJHQ2CO.js → chunk-ZSPU4MOS.js} +2 -2
  173. package/dist/cli/chunks/{chunk-UDHKLT4C.js → chunk-ZVWVV4EX.js} +1 -1
  174. package/dist/cli/chunks/{ci-464KPQNP.js → ci-W6K6G2KZ.js} +2 -2
  175. package/dist/cli/chunks/{ci-output-I7FX2RSO.js → ci-output-LDT24TS3.js} +2 -2
  176. package/dist/cli/chunks/{circuit-breaker-3FW237WW.js → circuit-breaker-F5V4KITU.js} +2 -2
  177. package/dist/cli/chunks/claude-flow-setup-DT6WQQVD.js +2 -0
  178. package/dist/cli/chunks/client-KHWJT6FB.js +2 -0
  179. package/dist/cli/chunks/{cline-installer-UWFHT6VY.js → cline-installer-G7TJOAEX.js} +2 -2
  180. package/dist/cli/chunks/{code-KQSUT3FS.js → code-PGE6A42V.js} +3 -3
  181. package/dist/cli/chunks/{code-index-extractor-PABBNUSC.js → code-index-extractor-RNITH372.js} +2 -2
  182. package/dist/cli/chunks/codex-installer-LBX77AI3.js +14 -0
  183. package/dist/cli/chunks/{completions-7RWHAUAR.js → completions-4AWLAARX.js} +2 -2
  184. package/dist/cli/chunks/{complexity-analyzer-XPOAF33E.js → complexity-analyzer-ZPNSS476.js} +2 -2
  185. package/dist/cli/chunks/{continuedev-installer-V4F2FIZP.js → continuedev-installer-UAPWX6OA.js} +2 -2
  186. package/dist/cli/chunks/{copilot-installer-JMICURQB.js → copilot-installer-BJN2YJGI.js} +2 -2
  187. package/dist/cli/chunks/core-handlers-HING5RRG.js +2 -0
  188. package/dist/cli/chunks/{cost-tracker-5OFHEYFJ.js → cost-tracker-MHP2VJ63.js} +2 -2
  189. package/dist/cli/chunks/{coverage-QKN57JDS.js → coverage-PQB4IEFG.js} +3 -3
  190. package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +2 -0
  191. package/dist/cli/chunks/{cursor-installer-GBJ7YXSM.js → cursor-installer-ZXBWYAS3.js} +2 -2
  192. package/dist/cli/chunks/{daemon-GKP7CMEK.js → daemon-64C7R6OJ.js} +3 -3
  193. package/dist/cli/chunks/{daemon-IAVSO6HK.js → daemon-N2BEGEFY.js} +4 -4
  194. package/dist/cli/chunks/{dag-attention-scheduler-S225TCI7.js → dag-attention-scheduler-SPZDAPNL.js} +2 -2
  195. package/dist/cli/chunks/{detect-IUYH422U.js → detect-LXJBSSZW.js} +2 -2
  196. package/dist/cli/chunks/{dist-node-2YRE6A7C.js → dist-node-U3TKZ2IZ.js} +2 -2
  197. package/dist/cli/chunks/{domain-handler-PL2TZC6H.js → domain-handler-3DDWUVSR.js} +2 -2
  198. package/dist/cli/chunks/{domain-plugins-HCGLXKIT.js → domain-plugins-JJVWI4OQ.js} +2 -2
  199. package/dist/cli/chunks/domain-transfer-M36KUJ2U.js +2 -0
  200. package/dist/cli/chunks/dream-WUGRSNCV.js +2 -0
  201. package/dist/cli/chunks/embed-and-insert-pattern-JPAR7TXX.js +3 -0
  202. package/dist/cli/chunks/{eval-WCK7KNFN.js → eval-SOLG23EA.js} +2 -2
  203. package/dist/cli/chunks/{experience-capture-middleware-2MSQWSAR.js → experience-capture-middleware-T7G2VOOD.js} +4 -4
  204. package/dist/cli/chunks/{fast-paths-VYOSIBKF.js → fast-paths-32N3ELI4.js} +2 -2
  205. package/dist/cli/chunks/{feature-flags-WCFUKHNQ.js → feature-flags-APJDQ4N7.js} +2 -2
  206. package/dist/cli/chunks/{feature-flags-UJRHFBRX.js → feature-flags-NAHKLDRN.js} +2 -2
  207. package/dist/cli/chunks/{file-discovery-JDGL4ZWS.js → file-discovery-YKVM3MDB.js} +2 -2
  208. package/dist/cli/chunks/{fleet-ROXVMZ2F.js → fleet-55M5CJS4.js} +3 -3
  209. package/dist/cli/chunks/{gnn-wrapper-NIO4ZCO3.js → gnn-wrapper-UD6E6S6Z.js} +2 -2
  210. package/dist/cli/chunks/{heartbeat-handler-PI42WD3C.js → heartbeat-handler-OYVW3VSC.js} +4 -4
  211. package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +2 -0
  212. package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +2 -0
  213. package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +2 -0
  214. package/dist/cli/chunks/{hnsw-legacy-bridge-YLC7SPK2.js → hnsw-legacy-bridge-HBYIS3ZW.js} +2 -2
  215. package/dist/cli/chunks/{hnswlib-node-LG6OS3B7.js → hnswlib-node-EQPM42OU.js} +2 -2
  216. package/dist/cli/chunks/{hooks-WVALP5GX.js → hooks-5ZSSJWO6.js} +10 -10
  217. package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +2 -0
  218. package/dist/cli/chunks/{hypergraph-engine-GJEMW3EG.js → hypergraph-engine-XBGVQ4PD.js} +2 -2
  219. package/dist/cli/chunks/{hypergraph-handler-BLF6LXEV.js → hypergraph-handler-CAWAQ673.js} +3 -3
  220. package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +2 -0
  221. package/dist/cli/chunks/{init-handler-K25RWRYY.js → init-handler-PRHXSARK.js} +6 -6
  222. package/dist/cli/chunks/init-wizard-72MFBI3G.js +2 -0
  223. package/dist/cli/chunks/kernel-BRCBVMSK.js +2 -0
  224. package/dist/cli/chunks/{kilocode-installer-BXN6WZ7G.js → kilocode-installer-F7LXBM7I.js} +2 -2
  225. package/dist/cli/chunks/{kiro-installer-PM362DLN.js → kiro-installer-NM723ZRG.js} +2 -2
  226. package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +2 -0
  227. package/dist/cli/chunks/{learning-CPERDDRG.js → learning-5QYIDHH3.js} +3 -3
  228. package/dist/cli/chunks/{llm-router-GOAV5FPI.js → llm-router-43HKWPSX.js} +4 -4
  229. package/dist/cli/chunks/llm-router-service-24KXFX32.js +2 -0
  230. package/dist/cli/chunks/{load-2BG6SHAK.js → load-5YDBWSCS.js} +2 -2
  231. package/dist/cli/chunks/load-test-N4TAYJY3.js +2 -0
  232. package/dist/cli/chunks/mcp-UMAPMNMY.js +2 -0
  233. package/dist/cli/chunks/{memory-4NHBYT6S.js → memory-FWCPCQFP.js} +6 -6
  234. package/dist/cli/chunks/memory-backend-NVYFYVAU.js +2 -0
  235. package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +2 -0
  236. package/dist/cli/chunks/multi-model-executor-2XTBGLE4.js +14 -0
  237. package/dist/cli/chunks/{opencode-installer-ATZLLK74.js → opencode-installer-GIXOJ6NS.js} +2 -2
  238. package/dist/cli/chunks/orchestrator-VW6BKHLI.js +393 -0
  239. package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +2 -0
  240. package/dist/cli/chunks/{pattern-usage-recorder-7VE4XDAI.js → pattern-usage-recorder-7CEUC3J7.js} +2 -2
  241. package/dist/cli/chunks/{pipeline-LQZSNDD2.js → pipeline-IGUQPPPO.js} +2 -2
  242. package/dist/cli/chunks/platform-2P636I7B.js +2 -0
  243. package/dist/cli/chunks/{plugin-EJ6K2MGU.js → plugin-NY6SWDPE.js} +2 -2
  244. package/dist/cli/chunks/{prime-radiant-advanced-wasm-OIHTKJMN.js → prime-radiant-advanced-wasm-2UUDTIO2.js} +2 -2
  245. package/dist/cli/chunks/project-root-IOISG5KX.js +2 -0
  246. package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +2 -0
  247. package/dist/cli/chunks/{protocol-handler-NRBROAU7.js → protocol-handler-ZTPCRQ5W.js} +2 -2
  248. package/dist/cli/chunks/{prove-EJOGEGD3.js → prove-SQX5A3IG.js} +2 -2
  249. package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +2 -0
  250. package/dist/cli/chunks/{quality-E55UC73D.js → quality-DROILKRY.js} +2 -2
  251. package/dist/cli/chunks/{quality-gate-OIQATNT3.js → quality-gate-PWKWDJY2.js} +3 -3
  252. package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +2 -0
  253. package/dist/cli/chunks/real-embeddings-P5U3MGYC.js +2 -0
  254. package/dist/cli/chunks/{ref-validation-OPO6J7OL.js → ref-validation-KY73NQXD.js} +2 -2
  255. package/dist/cli/chunks/{roocode-installer-ODY5KRWU.js → roocode-installer-6JPPRB3W.js} +2 -2
  256. package/dist/cli/chunks/router-SRSO3IHF.js +2 -0
  257. package/dist/cli/chunks/routing-feedback-PASRE5HY.js +2 -0
  258. package/dist/cli/chunks/{routing-handler-KQM6VWLC.js → routing-handler-VTJIVFUO.js} +2 -2
  259. package/dist/cli/chunks/{ruvector-commands-U2GVV6PF.js → ruvector-commands-C6RPSJJO.js} +2 -2
  260. package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +2 -0
  261. package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +2 -0
  262. package/dist/cli/chunks/rvf-migration-coordinator-R53URRIO.js +2 -0
  263. package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +2 -0
  264. package/dist/cli/chunks/{rvf-store-integrity-KMIHD3LP.js → rvf-store-integrity-MMXN5TEJ.js} +2 -2
  265. package/dist/cli/chunks/safe-db-QJLFO33B.js +2 -0
  266. package/dist/cli/chunks/schedule-YIVXW5O2.js +2 -0
  267. package/dist/cli/chunks/scheduler-AON7DWSJ.js +2 -0
  268. package/dist/cli/chunks/{security-P5NM353C.js → security-3B3R2NL4.js} +3 -3
  269. package/dist/cli/chunks/shared-rvf-adapter-VIJB7JUS.js +2 -0
  270. package/dist/cli/chunks/{shared-rvf-dual-writer-2CSG7C4W.js → shared-rvf-dual-writer-UVWGDUWC.js} +2 -2
  271. package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +2 -0
  272. package/dist/cli/chunks/standalone-memory-M4LWAAYZ.js +2 -0
  273. package/dist/cli/chunks/{status-handler-6TU6O37R.js → status-handler-YYFV6OZL.js} +2 -2
  274. package/dist/cli/chunks/{structural-health-KBIJSTXJ.js → structural-health-27E6LLKB.js} +2 -2
  275. package/dist/cli/chunks/sync-26CEGSTC.js +2 -0
  276. package/dist/cli/chunks/{sync-LNHI5SB7.js → sync-J3LJ56WN.js} +2 -2
  277. package/dist/cli/chunks/task-handler-4MCEBQZL.js +54 -0
  278. package/dist/cli/chunks/task-handlers-GYBAWKE2.js +9 -0
  279. package/dist/cli/chunks/{test-DHAAI3DU.js → test-MPC5HRH5.js} +4 -4
  280. package/dist/cli/chunks/{test-scheduling-XDBZ3QC2.js → test-scheduling-ZJBFRZ3J.js} +3 -3
  281. package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +2 -0
  282. package/dist/cli/chunks/{token-usage-Q2YG5YQN.js → token-usage-3X5WMTG2.js} +2 -2
  283. package/dist/cli/chunks/{transformers-F5UQTQCY.js → transformers-MVL4C5IX.js} +2 -2
  284. package/dist/cli/chunks/tree-sitter-wasm-parser-SLW65ZFO.js +2 -0
  285. package/dist/cli/chunks/{types-JQ7EQO5Q.js → types-TG5P3CRS.js} +2 -2
  286. package/dist/cli/chunks/unified-memory-UCQ6AB32.js +2 -0
  287. package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +2 -0
  288. package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +2 -0
  289. package/dist/cli/chunks/{upgrade-TJRVGHGD.js → upgrade-ETBHDEPY.js} +2 -2
  290. package/dist/cli/chunks/{validate-BWPCVHBN.js → validate-C2A73LZK.js} +2 -2
  291. package/dist/cli/chunks/{validate-swarm-QVVKCQLP.js → validate-swarm-67XN42ML.js} +2 -2
  292. package/dist/cli/chunks/{vibium-ZFATIWHO.js → vibium-NILGKHLN.js} +2 -2
  293. package/dist/cli/chunks/visual-security-4VZXPEVG.js +2 -0
  294. package/dist/cli/chunks/{web-tree-sitter-KPLY7ONR.js → web-tree-sitter-USJN77P4.js} +2 -2
  295. package/dist/cli/chunks/{windsurf-installer-H7XM7ISA.js → windsurf-installer-5GGZXGJW.js} +2 -2
  296. package/dist/cli/chunks/witness-chain-IWS5ZHHL.js +2 -0
  297. package/dist/cli/chunks/witness-chain-JQA2VPZI.js +2 -0
  298. package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +2 -0
  299. package/dist/cli/chunks/witness-chain-verifier-3GEADWPE.js +2 -0
  300. package/dist/cli/chunks/{witness-key-manager-DFRL42GE.js → witness-key-manager-ZWEIK3VJ.js} +2 -2
  301. package/dist/cli/chunks/{workflow-2ZQO6WYI.js → workflow-KHMVVBBA.js} +4 -4
  302. package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +2 -0
  303. package/dist/cli/chunks/wrappers-N6XIK5PT.js +2 -0
  304. package/dist/cli/commands/audit.d.ts +20 -2
  305. package/dist/cli/commands/audit.js +158 -16
  306. package/dist/cli/commands/claude-flow-setup.js +5 -4
  307. package/dist/cli/commands/mcp.js +6 -0
  308. package/dist/cli/commands/memory.d.ts +1 -1
  309. package/dist/cli/commands/memory.js +8 -8
  310. package/dist/cli/commands/platform.js +15 -2
  311. package/dist/cli/commands/upgrade.d.ts +3 -3
  312. package/dist/cli/commands/upgrade.js +3 -3
  313. package/dist/cli/handlers/init-handler.d.ts +10 -0
  314. package/dist/cli/handlers/task-handler.js +24 -3
  315. package/dist/cli/helpers/standalone-memory.d.ts +12 -0
  316. package/dist/cli/helpers/standalone-memory.js +46 -0
  317. package/dist/cli/index.js +39 -42
  318. package/dist/cli/log-gate.d.ts +66 -0
  319. package/dist/cli/log-gate.js +170 -0
  320. package/dist/init/agents-installer.d.ts +4 -0
  321. package/dist/init/agents-installer.js +24 -11
  322. package/dist/init/codex-installer.js +22 -8
  323. package/dist/init/idempotent-write.d.ts +53 -0
  324. package/dist/init/idempotent-write.js +160 -0
  325. package/dist/init/orchestrator.js +1 -0
  326. package/dist/init/phases/05-learning.js +3 -1
  327. package/dist/init/phases/07-hooks.js +32 -16
  328. package/dist/init/phases/08-mcp.js +4 -2
  329. package/dist/init/phases/09-assets.d.ts +10 -0
  330. package/dist/init/phases/09-assets.js +3 -0
  331. package/dist/init/phases/10-workers.js +7 -5
  332. package/dist/init/phases/12-verification.js +7 -2
  333. package/dist/init/project-analyzer.d.ts +9 -0
  334. package/dist/init/project-analyzer.js +20 -1
  335. package/dist/init/self-configurator.d.ts +5 -3
  336. package/dist/init/self-configurator.js +18 -29
  337. package/dist/init/skills-installer.js +4 -2
  338. package/dist/init/token-bootstrap.d.ts +1 -1
  339. package/dist/init/token-bootstrap.js +12 -2
  340. package/dist/init/types.d.ts +16 -0
  341. package/dist/init/types.js +20 -24
  342. package/dist/integrations/coherence/coherence-service.js +84 -24
  343. package/dist/integrations/coherence/vote-tally.d.ts +38 -0
  344. package/dist/integrations/coherence/vote-tally.js +39 -0
  345. package/dist/integrations/ruvector/brain-exporter.js +17 -0
  346. package/dist/integrations/ruvector/brain-import-audit.d.ts +20 -0
  347. package/dist/integrations/ruvector/brain-import-audit.js +22 -0
  348. package/dist/integrations/ruvector/brain-rvf-exporter.js +16 -0
  349. package/dist/integrations/ruvector/brain-shared.js +1 -1
  350. package/dist/integrations/ruvector/rvf-dual-writer.js +6 -1
  351. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +23 -0
  352. package/dist/integrations/ruvector/shared-rvf-adapter.js +24 -0
  353. package/dist/kernel/hybrid-backend.d.ts +6 -0
  354. package/dist/kernel/hybrid-backend.js +18 -0
  355. package/dist/kernel/kernel.js +12 -16
  356. package/dist/kernel/project-root.d.ts +1 -1
  357. package/dist/kernel/project-root.js +24 -3
  358. package/dist/learning/embedder-identity-store.js +4 -3
  359. package/dist/learning/pattern-store.d.ts +11 -0
  360. package/dist/learning/pattern-store.js +31 -9
  361. package/dist/learning/qe-patterns.d.ts +6 -0
  362. package/dist/learning/qe-patterns.js +7 -1
  363. package/dist/learning/qe-reasoning-bank.js +3 -0
  364. package/dist/learning/real-embeddings.d.ts +8 -0
  365. package/dist/learning/real-embeddings.js +16 -0
  366. package/dist/learning/rvf-pattern-store.js +30 -10
  367. package/dist/learning/sqlite-persistence.d.ts +8 -1
  368. package/dist/learning/sqlite-persistence.js +49 -9
  369. package/dist/logging/console-logger.d.ts +2 -5
  370. package/dist/logging/console-logger.js +10 -46
  371. package/dist/logging/index.d.ts +2 -0
  372. package/dist/logging/index.js +1 -0
  373. package/dist/logging/redaction.d.ts +27 -0
  374. package/dist/logging/redaction.js +170 -0
  375. package/dist/mcp/bundle.js +463 -449
  376. package/dist/mcp/entry.js +2 -0
  377. package/dist/mcp/handlers/core-handlers.js +5 -4
  378. package/dist/mcp/handlers/memory-handlers.d.ts +6 -1
  379. package/dist/mcp/handlers/memory-handlers.js +44 -22
  380. package/dist/mcp/handlers/task-handlers.js +14 -1
  381. package/dist/mcp/protocol-server.js +3 -1
  382. package/dist/mcp/services/session-store.js +5 -1
  383. package/dist/mcp/tools/base.d.ts +9 -2
  384. package/dist/mcp/tools/base.js +7 -0
  385. package/dist/mcp/tools/coherence/consensus.js +51 -2
  386. package/dist/mcp/tools/planning/goap-plan.d.ts +20 -7
  387. package/dist/mcp/tools/planning/goap-plan.js +92 -20
  388. package/dist/mcp/tools/planning/goap-status.d.ts +37 -12
  389. package/dist/mcp/tools/planning/goap-status.js +52 -23
  390. package/dist/mcp/tools/planning/world-state.d.ts +101 -0
  391. package/dist/mcp/tools/planning/world-state.js +274 -0
  392. package/dist/mcp/types.d.ts +4 -2
  393. package/dist/planning/goap-planner.d.ts +60 -4
  394. package/dist/planning/goap-planner.js +218 -60
  395. package/dist/planning/index.d.ts +1 -1
  396. package/dist/planning/index.js +1 -1
  397. package/dist/planning/plan-executor.d.ts +20 -1
  398. package/dist/planning/plan-executor.js +209 -100
  399. package/dist/planning/types.d.ts +16 -0
  400. package/dist/planning/types.js +17 -0
  401. package/dist/plugins/cache.d.ts +2 -0
  402. package/dist/plugins/cache.js +15 -2
  403. package/dist/plugins/lifecycle.js +15 -2
  404. package/dist/plugins/manifest.js +7 -5
  405. package/dist/plugins/resolver.d.ts +13 -22
  406. package/dist/plugins/resolver.js +169 -61
  407. package/dist/plugins/version-policy.d.ts +13 -0
  408. package/dist/plugins/version-policy.js +18 -0
  409. package/dist/shared/types/index.d.ts +6 -0
  410. package/dist/shared/types/index.js +8 -0
  411. package/package.json +2 -1
  412. package/dist/cli/chunks/adapter-TNNNJRDG.js +0 -2
  413. package/dist/cli/chunks/agent-booster-wasm-5PC7D2FW.js +0 -2
  414. package/dist/cli/chunks/aqe-learning-engine-5ZRMYJLB.js +0 -2
  415. package/dist/cli/chunks/audit-YSGA7UWT.js +0 -3
  416. package/dist/cli/chunks/base-KWZHOPSH.js +0 -2
  417. package/dist/cli/chunks/brain-handler-ET6YAP4B.js +0 -90
  418. package/dist/cli/chunks/browser-workflow-2FZTKDUL.js +0 -2
  419. package/dist/cli/chunks/chunk-33YYYWBQ.js +0 -4
  420. package/dist/cli/chunks/chunk-5Z6XZV7K.js +0 -65
  421. package/dist/cli/chunks/chunk-6J62K3SW.js +0 -2
  422. package/dist/cli/chunks/chunk-6TPKK7LD.js +0 -15
  423. package/dist/cli/chunks/chunk-DEYLEDJN.js +0 -27
  424. package/dist/cli/chunks/chunk-J6GNQS62.js +0 -5
  425. package/dist/cli/chunks/chunk-KGT36Z42.js +0 -14
  426. package/dist/cli/chunks/chunk-NA7B2QYB.js +0 -2
  427. package/dist/cli/chunks/chunk-NDPFGIMJ.js +0 -13
  428. package/dist/cli/chunks/chunk-OBAP2TXZ.js +0 -2
  429. package/dist/cli/chunks/chunk-PEPFCPES.js +0 -2
  430. package/dist/cli/chunks/chunk-T6BVLVI5.js +0 -2
  431. package/dist/cli/chunks/chunk-TT23RRB7.js +0 -2
  432. package/dist/cli/chunks/chunk-XC7DYDSY.js +0 -180
  433. package/dist/cli/chunks/chunk-XWMZ6D6N.js +0 -2
  434. package/dist/cli/chunks/chunk-Y3MW3YBC.js +0 -3
  435. package/dist/cli/chunks/claude-flow-setup-6JKMBPGU.js +0 -2
  436. package/dist/cli/chunks/client-7E4LM2WW.js +0 -2
  437. package/dist/cli/chunks/codex-installer-CQ24DTP5.js +0 -14
  438. package/dist/cli/chunks/core-handlers-IFG3757P.js +0 -2
  439. package/dist/cli/chunks/cross-domain-router-EK7W4PGP.js +0 -2
  440. package/dist/cli/chunks/domain-transfer-KQJRUPXA.js +0 -2
  441. package/dist/cli/chunks/dream-NFSCSLY7.js +0 -2
  442. package/dist/cli/chunks/embed-and-insert-pattern-ZPAG7235.js +0 -3
  443. package/dist/cli/chunks/heartbeat-scheduler-ZATCDJDK.js +0 -2
  444. package/dist/cli/chunks/hnsw-adapter-WXQABRCA.js +0 -2
  445. package/dist/cli/chunks/hnsw-index-TPSWLEA5.js +0 -2
  446. package/dist/cli/chunks/impact-analyzer-HNIU45P5.js +0 -2
  447. package/dist/cli/chunks/init-wizard-JUIPBMHG.js +0 -2
  448. package/dist/cli/chunks/kernel-5BOZQ754.js +0 -2
  449. package/dist/cli/chunks/knowledge-graph-EWDAENWM.js +0 -2
  450. package/dist/cli/chunks/llm-router-service-3YT7JGBS.js +0 -2
  451. package/dist/cli/chunks/load-test-BP2CPLIV.js +0 -2
  452. package/dist/cli/chunks/mcp-5TTB37DC.js +0 -2
  453. package/dist/cli/chunks/memory-backend-4PYQBPRM.js +0 -2
  454. package/dist/cli/chunks/memory-handlers-2B27NITS.js +0 -2
  455. package/dist/cli/chunks/multi-model-executor-KCWSGCDT.js +0 -14
  456. package/dist/cli/chunks/orchestrator-RKB7XJRG.js +0 -393
  457. package/dist/cli/chunks/pattern-null-store-OYOQOV2O.js +0 -2
  458. package/dist/cli/chunks/platform-OD5H5U6G.js +0 -2
  459. package/dist/cli/chunks/protocol-executor-3ATJTXWG.js +0 -2
  460. package/dist/cli/chunks/qe-reasoning-bank-LLMYZT4X.js +0 -2
  461. package/dist/cli/chunks/queen-coordinator-RN7L6KG5.js +0 -2
  462. package/dist/cli/chunks/real-embeddings-FPFFNOSZ.js +0 -2
  463. package/dist/cli/chunks/router-MDHITQ2V.js +0 -2
  464. package/dist/cli/chunks/routing-feedback-5XLNJ3Y3.js +0 -2
  465. package/dist/cli/chunks/rvf-dual-writer-JBW4O3II.js +0 -2
  466. package/dist/cli/chunks/rvf-migration-adapter-BPPQL4XJ.js +0 -2
  467. package/dist/cli/chunks/rvf-migration-coordinator-V2GHCJKN.js +0 -2
  468. package/dist/cli/chunks/rvf-native-adapter-S4562CG5.js +0 -2
  469. package/dist/cli/chunks/safe-db-FIRHSXVF.js +0 -2
  470. package/dist/cli/chunks/schedule-RVXFB4HK.js +0 -2
  471. package/dist/cli/chunks/scheduler-IKKAMAOO.js +0 -2
  472. package/dist/cli/chunks/shared-rvf-adapter-LVIUOO4S.js +0 -2
  473. package/dist/cli/chunks/sqlite-persistence-SQ3HCUQ7.js +0 -2
  474. package/dist/cli/chunks/sync-UHOX6RJW.js +0 -2
  475. package/dist/cli/chunks/task-handler-AVDHMLGI.js +0 -49
  476. package/dist/cli/chunks/task-handlers-KYK4VTRA.js +0 -9
  477. package/dist/cli/chunks/token-bootstrap-GUTTLPZX.js +0 -2
  478. package/dist/cli/chunks/tree-sitter-wasm-parser-DEGOHS6F.js +0 -2
  479. package/dist/cli/chunks/unified-memory-CXHLHB5I.js +0 -2
  480. package/dist/cli/chunks/unified-memory-hnsw-I7WAE54M.js +0 -2
  481. package/dist/cli/chunks/unified-persistence-6CPF65WI.js +0 -2
  482. package/dist/cli/chunks/visual-security-GNPHME5H.js +0 -2
  483. package/dist/cli/chunks/witness-chain-RRN6NDCH.js +0 -2
  484. package/dist/cli/chunks/witness-chain-VT4UHHBR.js +0 -2
  485. package/dist/cli/chunks/workflow-orchestrator-DB3HIECD.js +0 -2
  486. package/dist/cli/chunks/wrappers-SUS6XEJD.js +0 -2
@@ -5,34 +5,11 @@
5
5
  * SHAKE-256 / SHA-256 hash-chained append-only log with optional Ed25519 signing.
6
6
  * Tamper-evident: modifying any entry breaks the hash chain, detectable by verify().
7
7
  */
8
- import { createHash } from 'crypto';
9
8
  import { getUnifiedMemory } from '../kernel/unified-memory.js';
10
9
  import { getDefaultWitnessKeyManager } from './witness-key-manager.js';
11
- // --- Constants & Hash Functions ---
12
- const GENESIS_PREV_HASH = '0'.repeat(64);
13
- function sha256(data) {
14
- return createHash('sha256').update(data, 'utf-8').digest('hex');
15
- }
16
- /** SHAKE-256 (32-byte output) with SHA-256 fallback for older Node.js runtimes. */
17
- function shake256(data) {
18
- try {
19
- return createHash('shake256', { outputLength: 32 }).update(data, 'utf-8').digest('hex');
20
- }
21
- catch {
22
- return sha256(data);
23
- }
24
- }
25
- function hashWith(algo, data) {
26
- return algo === 'shake256' ? shake256(data) : sha256(data);
27
- }
28
- /** Serialize a WitnessEntry to a deterministic string (original 7-field format). */
29
- function serializeEntry(entry) {
30
- return JSON.stringify({
31
- id: entry.id, prev_hash: entry.prev_hash, action_hash: entry.action_hash,
32
- action_type: entry.action_type, action_data: entry.action_data,
33
- timestamp: entry.timestamp, actor: entry.actor,
34
- });
35
- }
10
+ import { GENESIS_PREV_HASH, sha256, shake256, hashWith, serializeEntry, signaturePayload, } from './witness-chain-hash.js';
11
+ import { verifyWitnessChain } from './witness-chain-verifier.js';
12
+ export { CHAIN_REANCHOR_ACTION } from './witness-chain-verifier.js';
36
13
  // --- WitnessChain ---
37
14
  /**
38
15
  * Hash-chained append-only audit log with optional Ed25519 signing.
@@ -66,6 +43,10 @@ export class WitnessChain {
66
43
  ensureTable() {
67
44
  if (!this.db)
68
45
  throw new Error('Database not initialized');
46
+ // A read-only connection (e.g. `aqe audit verify`) must not create or
47
+ // migrate the schema; readers treat missing tables as empty instead.
48
+ if (this.db.readonly)
49
+ return;
69
50
  this.db.exec(`
70
51
  CREATE TABLE IF NOT EXISTS witness_chain (
71
52
  id INTEGER PRIMARY KEY AUTOINCREMENT,
@@ -102,115 +83,51 @@ export class WitnessChain {
102
83
  }
103
84
  /** Append a new SHAKE-256-hashed entry, optionally Ed25519-signed. */
104
85
  append(actionType, actionData, actor) {
105
- if (!this.db)
86
+ const db = this.db;
87
+ if (!db)
106
88
  throw new Error('WitnessChain not initialized');
107
- const timestamp = new Date().toISOString();
108
89
  const actionDataStr = JSON.stringify(actionData);
109
90
  const algo = 'shake256';
110
91
  const actionHash = shake256(actionDataStr);
111
- const lastEntry = this.db
112
- .prepare('SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1')
113
- .get();
114
- const prevHash = lastEntry ? hashWith(algo, serializeEntry(lastEntry)) : GENESIS_PREV_HASH;
115
- let signature = null;
116
- let signerKeyId = null;
117
- if (this.keyManager) {
118
- const sigData = Buffer.from(prevHash + actionHash + actionType + timestamp + actor, 'utf-8');
119
- const result = this.keyManager.sign(sigData);
120
- signature = result.signature.toString('hex');
121
- signerKeyId = result.keyId;
122
- }
123
- const ins = this.db.prepare(`INSERT INTO witness_chain
124
- (prev_hash, action_hash, action_type, action_data, timestamp, actor, hash_algo, signature, signer_key_id)
125
- VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(prevHash, actionHash, actionType, actionDataStr, timestamp, actor, algo, signature, signerKeyId);
126
- return {
127
- id: ins.lastInsertRowid, prev_hash: prevHash, action_hash: actionHash,
128
- action_type: actionType, action_data: actionDataStr, timestamp, actor,
129
- hash_algo: algo, signature, signer_key_id: signerKeyId,
130
- };
131
- }
132
- /**
133
- * Find the entry with the given id, checking the live table first and then
134
- * the archive. Used to recover a predecessor that array-adjacency can't
135
- * see directly (it was archived, possibly by an earlier archival run than
136
- * the one that affects the entry currently being checked).
137
- */
138
- findEntryById(id) {
139
- if (!this.db)
140
- return undefined;
141
- return this.db.prepare('SELECT * FROM witness_chain WHERE id = ?').get(id)
142
- ?? this.db.prepare('SELECT * FROM witness_chain_archive WHERE id = ?').get(id);
92
+ // BEGIN IMMEDIATE acquires the write lock before reading the tail. Without
93
+ // it, two AQE processes can both hash the same predecessor and fork the
94
+ // audit chain despite SQLite serializing their eventual INSERTs.
95
+ const appendEntry = db.transaction(() => {
96
+ const timestamp = new Date().toISOString();
97
+ const lastEntry = db
98
+ .prepare('SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1')
99
+ .get();
100
+ const prevHash = lastEntry ? hashWith(algo, serializeEntry(lastEntry)) : GENESIS_PREV_HASH;
101
+ let signature = null;
102
+ let signerKeyId = null;
103
+ if (this.keyManager) {
104
+ const result = this.keyManager.sign(signaturePayload({
105
+ prev_hash: prevHash, action_hash: actionHash, action_type: actionType, timestamp, actor,
106
+ }));
107
+ signature = result.signature.toString('hex');
108
+ signerKeyId = result.keyId;
109
+ }
110
+ const ins = db.prepare(`INSERT INTO witness_chain
111
+ (prev_hash, action_hash, action_type, action_data, timestamp, actor, hash_algo, signature, signer_key_id)
112
+ VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)`).run(prevHash, actionHash, actionType, actionDataStr, timestamp, actor, algo, signature, signerKeyId);
113
+ return {
114
+ id: ins.lastInsertRowid, prev_hash: prevHash, action_hash: actionHash,
115
+ action_type: actionType, action_data: actionDataStr, timestamp, actor,
116
+ hash_algo: algo, signature, signer_key_id: signerKeyId,
117
+ };
118
+ });
119
+ return appendEntry.immediate();
143
120
  }
144
121
  /**
145
- * Check one entry's self-hash and chain link. `arrayAdjacent` is whatever
146
- * entry sits immediately before `current` in the array currently being
147
- * scanned (undefined at the start of that array) — it's tried first since
148
- * it's free (already fetched); a cross-table lookup by id only runs on a
149
- * mismatch, e.g. because the true predecessor was moved to the archive by
150
- * a *different* archival run than the one this scan is walking.
122
+ * Verify chain integrity. Supports mixed SHA-256/SHAKE-256 and optional
123
+ * signature checks. Classifies every break as a fork (pre-3.14.5 concurrent
124
+ * append, #753) or tampering, and keeps walking past forks so later rows are
125
+ * still checked; see witness-chain-verifier.ts for the exact rules.
151
126
  */
152
- checkEntryLink(current, arrayAdjacent) {
153
- const algo = current.hash_algo || 'sha256';
154
- if (current.action_hash !== hashWith(algo, current.action_data))
155
- return false;
156
- if (current.id === 1)
157
- return current.prev_hash === GENESIS_PREV_HASH; // genesis, never archived
158
- if (arrayAdjacent && current.prev_hash === hashWith(algo, serializeEntry(arrayAdjacent))) {
159
- return true;
160
- }
161
- const predecessor = this.findEntryById(current.id - 1);
162
- return predecessor !== undefined && current.prev_hash === hashWith(algo, serializeEntry(predecessor));
163
- }
164
- /** Verify chain integrity. Supports mixed SHA-256/SHAKE-256 and optional signature checks. */
165
127
  verify(options) {
166
128
  if (!this.db)
167
129
  throw new Error('WitnessChain not initialized');
168
- const live = this.db.prepare('SELECT * FROM witness_chain ORDER BY id ASC').all();
169
- if (live.length === 0)
170
- return { valid: true, entriesChecked: 0 };
171
- let signatureFailures = 0;
172
- const checkSigs = options?.checkSignatures === true && this.keyManager !== null;
173
- const checkSignature = (current) => {
174
- if (checkSigs && current.signature && current.signer_key_id) {
175
- const sigData = Buffer.from(current.prev_hash + current.action_hash + current.action_type + current.timestamp + current.actor, 'utf-8');
176
- if (!this.keyManager.verify(Buffer.from(sigData), Buffer.from(current.signature, 'hex'), current.signer_key_id)) {
177
- signatureFailures++;
178
- }
179
- }
180
- };
181
- // Live table: always its own valid chain, since append() always chains
182
- // to whatever the live tail is at write time — array-adjacency is right
183
- // by construction *except* at a boundary where the true predecessor has
184
- // since been archived, which checkEntryLink()'s fallback covers.
185
- for (let i = 0; i < live.length; i++) {
186
- const current = live[i];
187
- if (!this.checkEntryLink(current, i > 0 ? live[i - 1] : undefined)) {
188
- return { valid: false, brokenAt: current.id, entriesChecked: i + 1, signatureFailures };
189
- }
190
- checkSignature(current);
191
- }
192
- let entriesChecked = live.length;
193
- if (options?.includeArchive) {
194
- // The archived segment is its own contiguous slice of history (by id)
195
- // and is checked the same way — NOT by merging archive+live into one
196
- // id-sorted array, which would wrongly treat an archived row as the
197
- // predecessor of a live row that was actually appended (and correctly
198
- // chained to the live tail) well after that row was archived.
199
- const archived = this.db.prepare('SELECT * FROM witness_chain_archive ORDER BY id ASC').all();
200
- for (let i = 0; i < archived.length; i++) {
201
- const current = archived[i];
202
- if (!this.checkEntryLink(current, i > 0 ? archived[i - 1] : undefined)) {
203
- return { valid: false, brokenAt: current.id, entriesChecked: entriesChecked + i + 1, signatureFailures };
204
- }
205
- checkSignature(current);
206
- }
207
- entriesChecked += archived.length;
208
- }
209
- const valid = signatureFailures === 0;
210
- return {
211
- valid, entriesChecked, signatureFailures,
212
- ...(signatureFailures > 0 ? { brokenAt: live[0].id } : {}),
213
- };
130
+ return verifyWitnessChain(this.db, this.keyManager, options);
214
131
  }
215
132
  /** Query entries with optional filters. */
216
133
  getEntries(filter) {
@@ -323,5 +240,5 @@ export function createWitnessChain(db, keyManager) {
323
240
  export function _resetWitnessChainForTests() {
324
241
  _instance = null;
325
242
  }
326
- export { GENESIS_PREV_HASH, sha256, shake256, hashWith, serializeEntry };
243
+ export { GENESIS_PREV_HASH, sha256, shake256, hashWith, serializeEntry, signaturePayload };
327
244
  //# sourceMappingURL=witness-chain.js.map
@@ -31,7 +31,10 @@ export function recordGateResult(chain, result, actor = DEFAULT_ACTOR) {
31
31
  export function verifyDeliveryChain(chain, opts) {
32
32
  const r = chain.verify({ checkSignatures: opts?.checkSignatures === true });
33
33
  if (!r.valid) {
34
- throw new Error(`Witness delivery chain INVALID — tampering detected at entry ${r.brokenAt ?? '?'} (checked ${r.entriesChecked}). Delivered findings cannot be trusted.`);
34
+ const what = r.tampered
35
+ ? `tampering detected at entry ${r.tamperedAt ?? r.brokenAt ?? '?'}`
36
+ : `${r.forks.length - r.acknowledgedForks.length} unacknowledged fork(s), first at entry ${r.brokenAt ?? '?'}`;
37
+ throw new Error(`Witness delivery chain INVALID — ${what} (checked ${r.entriesChecked}). Delivered findings cannot be trusted.`);
35
38
  }
36
39
  if (opts?.checkSignatures && (r.signatureFailures ?? 0) > 0) {
37
40
  throw new Error(`Witness delivery chain has ${r.signatureFailures} signature failure(s) — provenance unverifiable.`);
@@ -1,13 +1,16 @@
1
1
  #!/usr/bin/env node
2
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
3
- import{b as h}from"./chunks/chunk-34WO57CW.js";import{a as y}from"./chunks/chunk-STM3UDNO.js";import{a as f,c as b}from"./chunks/chunk-G6T45OIC.js";import"./chunks/chunk-TT23RRB7.js";b();import{createRequire as D}from"node:module";import{Command as R}from"commander";import m from"chalk";function w(e,a,s,i){let l=e.command(a).description(s);if(i)for(let u of i)l.alias(u);return l.helpOption(!1),l.allowUnknownOption(!0),l.allowExcessArguments(!0),l}function C(e,a){let s=e.commands,i=s.indexOf(a);i>=0&&s.splice(i,1)}function o(e,a){let s=w(e,a.name,a.description,a.aliases);s.action(async()=>{try{let i=await a.factory();C(e,s),e.addCommand(i),await e.parseAsync(process.argv)}catch(i){console.error(`Failed to load command '${a.name}':`,i instanceof Error?i.message:i),process.exit(1)}})}function d(e,a,s,i,l,u){let g=w(e,a,s,u);g.action(async()=>{try{let p=await i();C(e,g),p.register(e,l),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${a}':`,p instanceof Error?p.message:p),process.exit(1)}})}var q=["[UnifiedMemory]","[HybridBackend]","[UnifiedPersistence]","[PersistentSONAEngine]","[QueenGovernance]","[QueenCoordinator]","[Queen]","[QUEEN]","[DomainBreakerRegistry]","[RealEmbeddings]","[HNSWIndex]","[PatternStore]","[TestGenerationCoordinator]","[CodeIntelligence]","[ProductFactorsBridge]","[LearningOptimizationCoordinator]","[DreamEngine]","[DreamScheduler]","[SecurityCompliance]","[Providers]","[GNN]","[test-generation]","[test-execution]","[coverage-analysis]","[quality-assessment]","[defect-intelligence]","[requirements-validation]","[code-intelligence]","[security-compliance]","[contract-testing]","[visual-accessibility]","[chaos-resilience]","[learning-optimization]","[enterprise-integration]","[coordination]","[PatternLearnerService]","[RequirementsValidation]","[ParserRegistry]","[AdversarialDefense]","[ContinueGateIntegration]","[ContinueGate]","[SQLitePatternStore]","[TokenTracking]","[InfraHealing]","[ExperienceCapture]"],x=/^\[\d{2}:\d{2}:\d{2}\.\d{3}\]\s+\[/,L=console.log.bind(console);console.log=(...e)=>{let s=(typeof e[0]=="string"?e[0]:"").trimStart();if(q.some(i=>s.startsWith(i))||x.test(s)){process.stderr.write(e.map(String).join(" ")+`
4
- `);return}L(...e)};console.info=(...e)=>{process.stderr.write(e.map(String).join(" ")+`
5
- `)};var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function k(e,a){let s=e.getDomainAPI("visual-accessibility");if(s?.registerWorkflowActions)try{s.registerWorkflowActions(a)}catch(l){console.error(m.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(l)}`))}let i=e.getDomainAPI("requirements-validation");if(i?.registerWorkflowActions)try{i.registerWorkflowActions(a)}catch(l){console.error(m.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(l)}`))}}async function z(){let{QEKernelImpl:e}=await import("./chunks/kernel-5BOZQ754.js"),{CrossDomainEventRouter:a}=await import("./chunks/cross-domain-router-EK7W4PGP.js"),{DefaultProtocolExecutor:s}=await import("./chunks/protocol-executor-3ATJTXWG.js"),{WorkflowOrchestrator:i}=await import("./chunks/workflow-orchestrator-DB3HIECD.js"),{createQueenCoordinator:l}=await import("./chunks/queen-coordinator-RN7L6KG5.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-IKKAMAOO.js"),{loadCLIDomainPlugins:g}=await import("./chunks/domain-plugins-HCGLXKIT.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...y],enableExperienceBridge:!1}),await t.kernel.initialize();let p=await g(t.kernel.plugins);t.router=new a(t.kernel.eventBus),await t.router.initialize();let A=I=>t.kernel.getDomainAPI(I),P=new s(t.kernel.eventBus,t.kernel.memory,A);t.workflowOrchestrator=new i(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),k(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=l(t.kernel,t.router,P,void 0,p),await t.queen.initialize();let{adoptExternalFleet:S}=await import("./chunks/core-handlers-IFG3757P.js");S({kernel:t.kernel,queen:t.queen,router:t.router,workflowOrchestrator:t.workflowOrchestrator}),t.initialized=!0}async function v(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),s=(await import("path")).resolve(".agentic-qe");return e.existsSync(s)?c():(console.error(m.red(`
6
- Error: AQE system not initialized in this directory.`)),console.log(m.yellow("Run `aqe init` first to set up this project.\n")),!1)}async function c(){if(t.initialized&&t.kernel&&t.queen)return!0;process.stderr.write(m.gray("Auto-initializing v3 system...")+`
7
- `);let e=3e4,a=new Promise((s,i)=>{setTimeout(()=>i(new Error("Initialization timeout after 30 seconds")),e)});try{return await Promise.race([z(),a]),process.stderr.write(m.green("System ready")+`
2
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
3
+ import{b as E}from"./chunks/chunk-H6ZM3PUT.js";import{b as C,c as k,e as v}from"./chunks/chunk-WO4QMXIG.js";import{a as h}from"./chunks/chunk-KNNISEDY.js";import{a as O}from"./chunks/chunk-TCHGOB2N.js";import{b as w,c as R}from"./chunks/chunk-FBMN7B46.js";import"./chunks/chunk-ENGZ4D5V.js";import{a as f,c as Q}from"./chunks/chunk-MJS53PRX.js";import{Q as y,S as z}from"./chunks/chunk-DUYOVM5I.js";import"./chunks/chunk-64VGZQLB.js";Q();z();import{createRequire as V}from"node:module";import{Command as _}from"commander";import l from"chalk";O();R();function A(e,a,c,i){let m=e.command(a).description(c);if(i)for(let u of i)m.alias(u);return m.helpOption(!1),m.allowUnknownOption(!0),m.allowExcessArguments(!0),m}function L(e,a){let c=e.commands,i=c.indexOf(a);i>=0&&c.splice(i,1)}function n(e,a){let c=A(e,a.name,a.description,a.aliases);c.action(async()=>{try{let i=await a.factory();L(e,c),e.addCommand(i),await e.parseAsync(process.argv)}catch(i){console.error(`Failed to load command '${a.name}':`,i instanceof Error?i.message:i),process.exit(1)}})}function d(e,a,c,i,m,u){let g=A(e,a,c,u);g.action(async()=>{try{let p=await i();L(e,g),p.register(e,m),await e.parseAsync(process.argv)}catch(p){console.error(`Failed to load command '${a}':`,p instanceof Error?p.message:p),process.exit(1)}})}v();var t={kernel:null,queen:null,router:null,workflowOrchestrator:null,scheduledWorkflows:new Map,persistentScheduler:null,initialized:!1};function P(e,a){let c=e.getDomainAPI("visual-accessibility");if(c?.registerWorkflowActions)try{c.registerWorkflowActions(a)}catch(m){console.error(l.yellow(` Warning: Could not register visual-accessibility workflow actions: ${f(m)}`))}let i=e.getDomainAPI("requirements-validation");if(i?.registerWorkflowActions)try{i.registerWorkflowActions(a)}catch(m){console.error(l.yellow(` Warning: Could not register requirements-validation workflow actions: ${f(m)}`))}}async function M(){let{QEKernelImpl:e}=await import("./chunks/kernel-BRCBVMSK.js"),{CrossDomainEventRouter:a}=await import("./chunks/cross-domain-router-PQTD6AZN.js"),{DefaultProtocolExecutor:c}=await import("./chunks/protocol-executor-IBYEII5Q.js"),{WorkflowOrchestrator:i}=await import("./chunks/workflow-orchestrator-GI5NQH7C.js"),{createQueenCoordinator:m}=await import("./chunks/queen-coordinator-NHUK2MWJ.js"),{createPersistentScheduler:u}=await import("./chunks/scheduler-AON7DWSJ.js"),{loadCLIDomainPlugins:g}=await import("./chunks/domain-plugins-JJVWI4OQ.js");t.kernel=new e({maxConcurrentAgents:15,memoryBackend:"sqlite",hnswEnabled:!0,lazyLoading:!0,enabledDomains:[...h],enableExperienceBridge:!1}),await t.kernel.initialize();let p=await g(t.kernel.plugins);t.router=new a(t.kernel.eventBus),await t.router.initialize();let b=q=>t.kernel.getDomainAPI(q),x=new c(t.kernel.eventBus,t.kernel.memory,b);t.workflowOrchestrator=new i(t.kernel.eventBus,t.kernel.memory,t.kernel.coordinator),await t.workflowOrchestrator.initialize(),P(t.kernel,t.workflowOrchestrator),t.persistentScheduler=u(),t.queen=m(t.kernel,t.router,x,void 0,p),await t.queen.initialize();let{adoptExternalFleet:D}=await import("./chunks/core-handlers-HING5RRG.js");D({kernel:t.kernel,queen:t.queen,router:t.router,workflowOrchestrator:t.workflowOrchestrator}),t.initialized=!0}async function I(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=await import("fs"),a=await import("path"),{findProjectRoot:c}=await import("./chunks/project-root-IOISG5KX.js"),i=a.join(c(),".agentic-qe");return e.existsSync(i)?s():(console.error(l.red(`
4
+ Error: AQE system not initialized in this directory.`)),console.log(l.yellow("Run `aqe init` first to set up this project.\n")),process.exitCode=1,!1)}async function s(){if(t.initialized&&t.kernel&&t.queen)return!0;let e=k(1);e&&process.stderr.write(l.gray("Auto-initializing v3 system...")+`
5
+ `);let a=3e4,c=new Promise((i,m)=>{setTimeout(()=>m(new Error("Initialization timeout after 30 seconds")),a)});try{return await Promise.race([M(),c]),e&&process.stderr.write(l.green("System ready")+`
8
6
 
9
- `),!0}catch(s){return s.message.includes("timeout")?(console.error(m.red("Initialization timed out after 30 seconds.")),console.log(m.yellow("Try running `aqe init` manually."))):(console.error(m.red("Failed to auto-initialize:"),s),console.log(m.yellow("Try running `aqe init` manually."))),!1}}async function r(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}process.exit(e)}var n=new R,Q=D(import.meta.url),G=Q("../../package.json").version,E="3.14.4";n.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(E);d(n,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-K25RWRYY.js").then(e=>e.createInitHandler(r)),t);d(n,"status","Show system status",()=>import("./chunks/status-handler-6TU6O37R.js").then(e=>e.createStatusHandler(r,v)),t);d(n,"health","Check system health",()=>import("./chunks/status-handler-6TU6O37R.js").then(e=>e.createHealthHandler(r,v)),t);d(n,"task","Manage QE tasks",()=>import("./chunks/task-handler-AVDHMLGI.js").then(e=>e.createTaskHandler(r,c)),t);d(n,"agent","Manage QE agents",()=>import("./chunks/agent-handler-RDNTK4CA.js").then(e=>e.createAgentHandler(r,c)),t);d(n,"domain","Domain operations",()=>import("./chunks/domain-handler-PL2TZC6H.js").then(e=>e.createDomainHandler(r,c)),t);d(n,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-NRBROAU7.js").then(e=>e.createProtocolHandler(r,c)),t);d(n,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-ET6YAP4B.js").then(e=>e.createBrainHandler(r,c)),t);d(n,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-BLF6LXEV.js").then(e=>e.createHypergraphHandler(r,c)),t,["hg"]);d(n,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-PI42WD3C.js").then(e=>e.createHeartbeatHandler(r)),t);d(n,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-KQM6VWLC.js").then(e=>e.createRoutingHandler(r)),t);o(n,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-2ZQO6WYI.js").then(e=>e.createWorkflowCommand(t,r,c))});o(n,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-DHAAI3DU.js").then(e=>e.createTestCommand(t,r,c))});o(n,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-QKN57JDS.js").then(e=>e.createCoverageCommand(t,r,c))});o(n,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-E55UC73D.js").then(e=>e.createQualityCommand(t,r,c))});o(n,{name:"quality-gate",description:"Two-gate, three-valued quality verdict against a pinned checklist (ADR-119)",factory:()=>import("./chunks/quality-gate-OIQATNT3.js").then(e=>e.createQualityGateCommand(t,r,c))});o(n,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-P5NM353C.js").then(e=>e.createSecurityCommand(t,r,c))});o(n,{name:"arena",description:"Competitive test-strategy tournaments (ADR-104)",factory:()=>import("./chunks/arena-HXTWJ5YY.js").then(e=>e.createArenaCommand(t,r,c))});o(n,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-KQSUT3FS.js").then(e=>e.createCodeCommand(t,r,c))});o(n,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-7RWHAUAR.js").then(e=>e.createCompletionsCommand(r))});o(n,{name:"upgrade",description:"Detect optional native bindings and recommend install / flag changes",factory:()=>import("./chunks/upgrade-TJRVGHGD.js").then(e=>e.createUpgradeCommand(r))});o(n,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-ROXVMZ2F.js").then(e=>e.createFleetCommand(t,r,c,k))});o(n,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-QVVKCQLP.js").then(e=>e.createValidateSwarmCommand(t,r,c))});o(n,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-BWPCVHBN.js").then(e=>e.createValidateCommand(t,r,c))});o(n,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-WCK7KNFN.js").then(e=>e.createEvalCommand())});o(n,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-464KPQNP.js").then(e=>e.createCICommand(t,r,c))});o(n,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-Q2YG5YQN.js").then(e=>e.createTokenUsageCommand())});o(n,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-GOAV5FPI.js").then(e=>e.createLLMRouterCommand())});o(n,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-LNHI5SB7.js").then(e=>e.createSyncCommands())});o(n,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-WVALP5GX.js").then(e=>e.createHooksCommand())});o(n,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-CPERDDRG.js").then(e=>e.createLearningCommand())});o(n,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>import("./chunks/memory-4NHBYT6S.js").then(e=>e.createMemoryCommand(t,r,c))});o(n,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-5TTB37DC.js").then(e=>e.createMcpCommand())});o(n,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-OD5H5U6G.js").then(e=>e.createPlatformCommand())});o(n,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-EJOGEGD3.js").then(e=>e.createProveCommand(t,r,c))});o(n,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-U2GVV6PF.js").then(e=>e.createRuVectorCommand())});o(n,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-YSGA7UWT.js").then(e=>e.createAuditCommand(t,r,c))});o(n,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-LQZSNDD2.js").then(e=>e.createPipelineCommand(t,r,c))});o(n,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-EJ6K2MGU.js").then(e=>e.createPluginCommand())});o(n,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-GKP7CMEK.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{console.log(m.yellow(`
7
+ `),!0}catch(i){return i.message.includes("timeout")?(console.error(l.red("Initialization timed out after 30 seconds.")),console.log(l.yellow("Try running `aqe init` manually."))):(console.error(l.red("Failed to auto-initialize:"),i),console.log(l.yellow("Try running `aqe init` manually."))),process.exitCode=1,!1}}async function o(e=0){try{t.workflowOrchestrator&&t.workflowOrchestrator.dispose().catch(()=>{}),t.queen&&t.queen.dispose().catch(()=>{}),t.router&&t.router.dispose().catch(()=>{}),t.kernel&&t.kernel.dispose().catch(()=>{})}catch{}process.exit(e)}var r=new _,H=V(import.meta.url),Z=H("../../package.json").version,S="3.14.6";r.name("aqe").description("Agentic QE - Domain-Driven Quality Engineering").version(S).addHelpText("after",`
8
+ Environment:
9
+ AQE_LOG_LEVEL Internal log level: debug | info | warn | error | silent (default: warn)
10
+ LOG_LEVEL Same as AQE_LOG_LEVEL; AQE_LOG_LEVEL takes precedence
11
+ AQE_VERBOSE=1 Shorthand for info-level logging (full system-init output)
12
+ Diagnostics are written to stderr; stdout carries command output only.`);r.hook("preAction",(e,a)=>{C(a.opts())});d(r,"init","Initialize the AQE v3 system",()=>import("./chunks/init-handler-PRHXSARK.js").then(e=>e.createInitHandler(o)),t);d(r,"status","Show system status",()=>import("./chunks/status-handler-YYFV6OZL.js").then(e=>e.createStatusHandler(o,I)),t);d(r,"health","Check system health",()=>import("./chunks/status-handler-YYFV6OZL.js").then(e=>e.createHealthHandler(o,I)),t);d(r,"task","Manage QE tasks",()=>import("./chunks/task-handler-4MCEBQZL.js").then(e=>e.createTaskHandler(o,s)),t);d(r,"agent","Manage QE agents",()=>import("./chunks/agent-handler-D5SSQYNU.js").then(e=>e.createAgentHandler(o,s)),t);d(r,"domain","Domain operations",()=>import("./chunks/domain-handler-3DDWUVSR.js").then(e=>e.createDomainHandler(o,s)),t);d(r,"protocol","Execute coordination protocols",()=>import("./chunks/protocol-handler-ZTPCRQ5W.js").then(e=>e.createProtocolHandler(o,s)),t);d(r,"brain","Export, import, and inspect QE brain state",()=>import("./chunks/brain-handler-QPUFYX7F.js").then(e=>e.createBrainHandler(o,s)),t);d(r,"hypergraph","Query the code knowledge hypergraph",()=>import("./chunks/hypergraph-handler-CAWAQ673.js").then(e=>e.createHypergraphHandler(o,s)),t,["hg"]);d(r,"heartbeat","Manage the token-free heartbeat scheduler",()=>import("./chunks/heartbeat-handler-OYVW3VSC.js").then(e=>e.createHeartbeatHandler(o)),t);d(r,"routing","View routing performance, economics, and accuracy",()=>import("./chunks/routing-handler-VTJIVFUO.js").then(e=>e.createRoutingHandler(o)),t);n(r,{name:"workflow",description:"Manage QE workflows and pipelines (ADR-041)",factory:()=>import("./chunks/workflow-KHMVVBBA.js").then(e=>e.createWorkflowCommand(t,o,s))});n(r,{name:"test",description:"Test generation, execution, scheduling, and load testing",factory:()=>import("./chunks/test-MPC5HRH5.js").then(e=>e.createTestCommand(t,o,s))});n(r,{name:"coverage",description:"Coverage analysis shortcut",factory:()=>import("./chunks/coverage-PQB4IEFG.js").then(e=>e.createCoverageCommand(t,o,s))});n(r,{name:"quality",description:"Quality assessment shortcut",factory:()=>import("./chunks/quality-DROILKRY.js").then(e=>e.createQualityCommand(t,o,s))});n(r,{name:"quality-gate",description:"Two-gate, three-valued quality verdict against a pinned checklist (ADR-119)",factory:()=>import("./chunks/quality-gate-PWKWDJY2.js").then(e=>e.createQualityGateCommand(t,o,s))});n(r,{name:"security",description:"Security scanning and URL validation",factory:()=>import("./chunks/security-3B3R2NL4.js").then(e=>e.createSecurityCommand(t,o,s))});n(r,{name:"arena",description:"Competitive test-strategy tournaments (ADR-104)",factory:()=>import("./chunks/arena-MCE6EU7K.js").then(e=>e.createArenaCommand(t,o,s))});n(r,{name:"code",description:"Code intelligence analysis",factory:()=>import("./chunks/code-PGE6A42V.js").then(e=>e.createCodeCommand(t,o,s))});n(r,{name:"completions",description:"Generate shell completions for aqe",factory:()=>import("./chunks/completions-4AWLAARX.js").then(e=>e.createCompletionsCommand(o))});n(r,{name:"upgrade",description:"Detect optional native bindings and recommend install / flag changes",factory:()=>import("./chunks/upgrade-ETBHDEPY.js").then(e=>e.createUpgradeCommand(o))});n(r,{name:"fleet",description:"Fleet operations with multi-agent progress tracking",factory:()=>import("./chunks/fleet-55M5CJS4.js").then(e=>e.createFleetCommand(t,o,s,P))});n(r,{name:"validate",description:"Validation commands for skills and agents",factory:()=>import("./chunks/validate-swarm-67XN42ML.js").then(e=>e.createValidateSwarmCommand(t,o,s))});n(r,{name:"skill",description:"Skill validation and reporting (ADR-056)",factory:()=>import("./chunks/validate-C2A73LZK.js").then(e=>e.createValidateCommand(t,o,s))});n(r,{name:"eval",description:"Run skill evaluation suites in parallel",factory:()=>import("./chunks/eval-SOLG23EA.js").then(e=>e.createEvalCommand())});n(r,{name:"ci",description:"CI/CD pipeline orchestration",factory:()=>import("./chunks/ci-W6K6G2KZ.js").then(e=>e.createCICommand(t,o,s))});n(r,{name:"token-usage",description:"View and analyze token consumption metrics (ADR-042)",factory:()=>import("./chunks/token-usage-3X5WMTG2.js").then(e=>e.createTokenUsageCommand())});n(r,{name:"llm",description:"LLM Router management (ADR-043)",factory:()=>import("./chunks/llm-router-43HKWPSX.js").then(e=>e.createLLMRouterCommand())});n(r,{name:"sync",description:"Sync local learning data to cloud PostgreSQL",factory:()=>import("./chunks/sync-J3LJ56WN.js").then(e=>e.createSyncCommands())});n(r,{name:"hooks",description:"Self-learning QE hooks for pattern recognition and guidance",factory:()=>import("./chunks/hooks-5ZSSJWO6.js").then(e=>e.createHooksCommand())});n(r,{name:"learning",description:"AQE self-learning system management (standalone, no claude-flow required)",factory:()=>import("./chunks/learning-5QYIDHH3.js").then(e=>e.createLearningCommand())});n(r,{name:"memory",description:"Memory store, retrieve, search, and delete operations",factory:()=>Promise.all([import("./chunks/memory-FWCPCQFP.js"),import("./chunks/standalone-memory-M4LWAAYZ.js")]).then(([e,a])=>e.createMemoryCommand(t,o,a.createEnsureMemoryBackend(t)))});n(r,{name:"mcp",description:"Start the MCP protocol server for Claude Code integration",factory:()=>import("./chunks/mcp-UMAPMNMY.js").then(e=>e.createMcpCommand())});n(r,{name:"platform",description:"Manage coding agent platform configurations",factory:()=>import("./chunks/platform-2P636I7B.js").then(e=>e.createPlatformCommand())});n(r,{name:"prove",description:"Generate a verifiable Proof-of-Quality attestation",factory:()=>import("./chunks/prove-SQX5A3IG.js").then(e=>e.createProveCommand(t,o,s))});n(r,{name:"ruvector",description:"RuVector integration management",factory:()=>import("./chunks/ruvector-commands-C6RPSJJO.js").then(e=>e.createRuVectorCommand())});n(r,{name:"audit",description:"Witness chain audit trail management",factory:()=>import("./chunks/audit-BMWTQECB.js").then(e=>e.createAuditCommand(t,o,s))});n(r,{name:"pipeline",description:"Manage YAML deterministic pipelines (Imp-9)",factory:()=>import("./chunks/pipeline-IGUQPPPO.js").then(e=>e.createPipelineCommand(t,o,s))});n(r,{name:"plugin",description:"Manage external QE domain plugins",factory:()=>import("./chunks/plugin-NY6SWDPE.js").then(e=>e.createPluginCommand())});n(r,{name:"daemon",description:"Manage the QE Quality Daemon",factory:()=>import("./chunks/daemon-64C7R6OJ.js").then(e=>e.createDaemonCommand())});process.on("SIGINT",async()=>{console.log(l.yellow(`
10
13
 
11
- Shutting down...`)),console.log(m.green(`Shutdown complete
12
- `)),await r(0)});process.on("SIGTERM",async()=>{console.log(m.yellow(`
13
- Received SIGTERM, shutting down gracefully...`)),await r(0)});async function O(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-VYOSIBKF.js");e(process.argv)&&(console.log(E),process.exit(0));let a=process.argv.slice(2).filter(i=>i!=="--");if(!(a[0]==="learning"&&(a[1]==="backup"||a[1]==="restore"))){let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-GUTTLPZX.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"})}await n.parseAsync(),!h()&&await r(0)}O().catch(async e=>{console.error(m.red("Fatal error:"),e),await r(1)});
14
+ Shutting down...`)),console.log(l.green(`Shutdown complete
15
+ `)),await o(0)});process.on("SIGTERM",async()=>{console.log(l.yellow(`
16
+ Received SIGTERM, shutting down gracefully...`)),await o(0)});async function T(){let{isVersionFastPath:e}=await import("./chunks/fast-paths-32N3ELI4.js");e(process.argv)&&(console.log(S),process.exit(0)),y();let a=process.argv.slice(2).filter(i=>i!=="--");if(!(a[0]==="learning"&&(a[1]==="backup"||a[1]==="restore"))){let{bootstrapTokenTracking:i}=await import("./chunks/token-bootstrap-2Y2XITBX.js");await i({enableOptimization:!0,enablePersistence:!0,verbose:process.env.AQE_VERBOSE==="true"})}await r.parseAsync(),!E()&&await o(process.exitCode??0)}T().catch(async e=>{console.error(l.red("Fatal error:"),w(e)),await o(1)});
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{a,b,c}from"./chunk-RFNPJK6N.js";import"./chunk-YSLL6VSL.js";import"./chunk-2YXGBZWV.js";import"./chunk-AIRGNL55.js";import"./chunk-MJS53PRX.js";import"./chunk-64VGZQLB.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{a as x}from"./chunk-TCHGOB2N.js";import{e as f}from"./chunk-FBMN7B46.js";import"./chunk-ENGZ4D5V.js";import"./chunk-64VGZQLB.js";x();import{createRequire as w}from"module";var S=f.create("agent-booster-wasm"),t={JavaScript:0,TypeScript:1,Python:2,Rust:3,Go:4,Java:5,C:6,Cpp:7},l={ExactReplace:0,FuzzyReplace:1,InsertAfter:2,InsertBefore:3,Append:4},v={0:"JavaScript",1:"TypeScript",2:"Python",3:"Rust",4:"Go",5:"Java",6:"C",7:"Cpp"},a=null,u=null,p=null;async function g(){if(a)return!0;if(p)return!1;try{if(a=w(import.meta.url)("./agent_booster_wasm.js"),!a)throw new Error("WASM module loaded but is null");return u=new a.AgentBoosterWasm,!0}catch(e){return p=e,console.warn("[AgentBoosterWASM] Failed to load WASM module:",e),!1}}function A(e){return{".js":t.JavaScript,".mjs":t.JavaScript,".cjs":t.JavaScript,".jsx":t.JavaScript,".ts":t.TypeScript,".tsx":t.TypeScript,".mts":t.TypeScript,".cts":t.TypeScript,".py":t.Python,".rs":t.Rust,".go":t.Go,".java":t.Java,".c":t.C,".h":t.C,".cpp":t.Cpp,".cc":t.Cpp,".cxx":t.Cpp,".hpp":t.Cpp}[e.toLowerCase()]??t.JavaScript}var M=[{name:"var-to-const",detect:(e,r)=>e.includes("var ")&&r.includes("const "),apply:(e,r)=>e.replace(/\bvar\s+/g,"const ")},{name:"var-to-let",detect:(e,r)=>e.includes("var ")&&r.includes("let "),apply:(e,r)=>e.replace(/\bvar\s+/g,"let ")},{name:"add-types-function",detect:(e,r)=>e.includes("function")&&!e.includes(":")&&r.includes(":"),apply:(e,r)=>r},{name:"async-wrapper",detect:(e,r)=>!e.includes("async")&&r.includes("async")&&r.includes("await"),apply:(e,r)=>r},{name:"try-catch-wrapper",detect:(e,r)=>!e.includes("try {")&&r.includes("try {"),apply:(e,r)=>r},{name:"null-check",detect:(e,r)=>!e.includes("if (!")&&!e.includes("if (!")&&(r.includes("if (!")||r.includes("?.")),apply:(e,r)=>r},{name:"test-assertion",detect:(e,r)=>e.includes("test(")&&!e.includes("expect(")&&r.includes("expect("),apply:(e,r)=>r}];function y(e,r){for(let n of M)if(n.detect(e,r))try{return{success:!0,code:n.apply(e,r),pattern:n.name}}catch(s){S.debug("Pattern transform failed, trying next",{pattern:n.name,error:s instanceof Error?s.message:String(s)});continue}return{success:!1,code:r}}async function b(e,r,n,s={}){let o=performance.now(),{confidenceThreshold:T=.5,allowFallback:d=!0}=s;if(!e.trim())return{success:!0,mergedCode:r,confidence:1,strategy:l.Append,syntaxValid:!0,source:"fallback",latencyMs:performance.now()-o};if(await g()&&u&&a)try{let c=a.WasmLanguage[v[n]],i=u.apply_edit(e,r,c);return{success:!0,mergedCode:i.merged_code,confidence:i.confidence,strategy:i.strategy,syntaxValid:i.syntax_valid,source:"wasm",latencyMs:performance.now()-o}}catch(c){let i=c;if(d){let m=y(e,r);if(m.success)return{success:!0,mergedCode:m.code,confidence:.7,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:i.message}}if(d){let c=y(e,r);return{success:c.success,mergedCode:c.code,confidence:c.success?.7:0,strategy:l.FuzzyReplace,syntaxValid:!0,source:"pattern",latencyMs:performance.now()-o}}return{success:!1,mergedCode:r,confidence:0,strategy:l.Append,syntaxValid:!1,source:"fallback",latencyMs:performance.now()-o,error:p?.message??"WASM not available"}}async function W(e,r={}){return Promise.all(e.map(({original:n,edit:s,language:o})=>b(n,s,o,r)))}async function C(){return g()}async function L(){return await g()&&a?a.AgentBoosterWasm.version():"unavailable"}async function R(){if(await g(),u&&a)try{u.apply_edit("function x() {}","function x() {}",a.WasmLanguage.JavaScript)}catch(e){console.debug("[AgentBoosterWASM] Warmup error:",e instanceof Error?e.message:e)}}var _={transform:b,batchTransform:W,isWasmAvailable:C,getVersion:L,warmup:R,Language:t,MergeStrategy:l,languageFromExtension:A};export{t as Language,l as MergeStrategy,W as batchTransform,_ as default,L as getVersion,C as isWasmAvailable,A as languageFromExtension,b as transform,R as warmup};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
2
- import{b as p}from"./chunk-DPFRKBOG.js";import{a as g}from"./chunk-3X3DJZJJ.js";import"./chunk-DHJPWQBR.js";import"./chunk-TT23RRB7.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{b as p}from"./chunk-HNFVJP4I.js";import{a as g}from"./chunk-D45SG6CP.js";import"./chunk-AIRGNL55.js";import"./chunk-64VGZQLB.js";import s from"chalk";var l=class{name="agent";description="Manage QE agents";cleanupAndExit;ensureInitialized;constructor(n,t){this.cleanupAndExit=n,this.ensureInitialized=t}register(n,t){let a=n.command("agent").description(this.description);a.command("list").description("List all agents").option("-d, --domain <domain>","Filter by domain").option("-s, --status <status>","Filter by status").action(async e=>{await this.executeList(e,t)}),a.command("spawn <domain>").description("Spawn an agent in a domain").option("-t, --type <type>","Agent type","worker").option("-c, --capabilities <caps>","Comma-separated capabilities","general").option("--no-progress","Disable progress indicator").action(async(e,o)=>{await this.executeSpawn(e,o,t)})}async executeList(n,t){if(await this.ensureInitialized())try{let a=n.domain?t.queen.getAgentsByDomain(n.domain):t.queen.listAllAgents();if(n.status&&(a=a.filter(e=>e.status===n.status)),console.log(s.blue(`
3
3
  Agents (${a.length})
4
4
  `)),a.length===0)console.log(s.gray(" No agents found"));else{let e=new Map;for(let i of a)e.has(i.domain)||e.set(i.domain,[]),e.get(i.domain).push(i);let o=Array.from(e.entries());for(let[i,m]of o){console.log(s.cyan(` ${i}:`));for(let r of m)console.log(` ${r.id}`),console.log(` Type: ${r.type}`),console.log(` Status: ${g(r.status)}`),r.startedAt&&console.log(s.gray(` Started: ${r.startedAt.toISOString()}`));console.log("")}}}catch(a){console.error(s.red(`
5
5
  Failed to list agents:`),a),await this.cleanupAndExit(1)}}async executeSpawn(n,t,a){if(await this.ensureInitialized())try{let e=t.capabilities.split(",");console.log(s.blue(`
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
2
- import"./chunk-TT23RRB7.js";import{existsSync as i,mkdirSync as d,unlinkSync as s,readdirSync as p,statSync as f}from"fs";import{join as o,basename as l}from"path";var v={branchDir:".agentic-qe/branches",defaultStrategy:"child-wins",orphanMaxAgeMs:36e5},g=class{config;parentAdapter;activeBranches=new Map;witnessChain=null;constructor(t,e){this.parentAdapter=t,this.config={...v,...e}}setWitnessChain(t){this.witnessChain=t}createBranch(t){if(this.activeBranches.has(t))throw new Error(`Branch already exists for agent ${t}`);i(this.config.branchDir)||d(this.config.branchDir,{recursive:!0});let e=o(this.config.branchDir,`${t}.rvf`),r=this.parentAdapter.path(),n=this.parentAdapter.derive(e),a={agentId:t,childPath:e,parentPath:r,childAdapter:n,createdAt:Date.now(),ingestLog:[]};return this.activeBranches.set(t,a),a}recordIngest(t,e){let r=this.activeBranches.get(t);if(r)for(let n of e)r.ingestLog.push({id:n.id,vector:n.vector})}async mergeBranch(t,e){let r=e??this.config.defaultStrategy,n=performance.now(),a=0;if(r==="child-wins"&&t.ingestLog.length>0)try{a=this.parentAdapter.ingest(t.ingestLog).accepted}catch(c){console.warn(`[AgentMemoryBranch] Merge replay failed for ${t.agentId}:`,c)}return this.witnessChain?.append("BRANCH_MERGE",{agentId:t.agentId,strategy:r,vectorsMerged:a,branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId),{vectorsMerged:a,strategy:r,durationMs:performance.now()-n}}discardBranch(t){this.witnessChain?.append("BRANCH_DISCARD",{agentId:t.agentId,action:"discard",branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId)}getBranch(t){return this.activeBranches.get(t)}getActiveBranches(){return Array.from(this.activeBranches.values())}listBranchFiles(){return i(this.config.branchDir)?p(this.config.branchDir).filter(e=>e.endsWith(".rvf")).map(e=>{let r=o(this.config.branchDir,e),n=f(r);return{agentId:l(e,".rvf"),path:r,sizeBytes:n.size,modifiedAt:n.mtime}}):[]}cleanupOrphans(t){let e=t??this.config.orphanMaxAgeMs,r=Date.now(),n=0;for(let a of this.listBranchFiles())if(r-a.modifiedAt.getTime()>e&&!this.activeBranches.has(a.agentId))try{s(a.path);let h=`${a.path}.idmap.json`;i(h)&&s(h),n++}catch{}return n}cleanupBranchFile(t){try{t.childAdapter.close()}catch{}try{i(t.childPath)&&s(t.childPath);let e=`${t.childPath}.idmap.json`;i(e)&&s(e)}catch{}}};export{g as AgentMemoryBranch};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import"./chunk-64VGZQLB.js";import{existsSync as i,mkdirSync as d,unlinkSync as s,readdirSync as p,statSync as f}from"fs";import{join as o,basename as l}from"path";var v={branchDir:".agentic-qe/branches",defaultStrategy:"child-wins",orphanMaxAgeMs:36e5},g=class{config;parentAdapter;activeBranches=new Map;witnessChain=null;constructor(t,e){this.parentAdapter=t,this.config={...v,...e}}setWitnessChain(t){this.witnessChain=t}createBranch(t){if(this.activeBranches.has(t))throw new Error(`Branch already exists for agent ${t}`);i(this.config.branchDir)||d(this.config.branchDir,{recursive:!0});let e=o(this.config.branchDir,`${t}.rvf`),r=this.parentAdapter.path(),n=this.parentAdapter.derive(e),a={agentId:t,childPath:e,parentPath:r,childAdapter:n,createdAt:Date.now(),ingestLog:[]};return this.activeBranches.set(t,a),a}recordIngest(t,e){let r=this.activeBranches.get(t);if(r)for(let n of e)r.ingestLog.push({id:n.id,vector:n.vector})}async mergeBranch(t,e){let r=e??this.config.defaultStrategy,n=performance.now(),a=0;if(r==="child-wins"&&t.ingestLog.length>0)try{a=this.parentAdapter.ingest(t.ingestLog).accepted}catch(c){console.warn(`[AgentMemoryBranch] Merge replay failed for ${t.agentId}:`,c)}return this.witnessChain?.append("BRANCH_MERGE",{agentId:t.agentId,strategy:r,vectorsMerged:a,branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId),{vectorsMerged:a,strategy:r,durationMs:performance.now()-n}}discardBranch(t){this.witnessChain?.append("BRANCH_DISCARD",{agentId:t.agentId,action:"discard",branchPath:t.childPath},`agent-${t.agentId}`),this.cleanupBranchFile(t),this.activeBranches.delete(t.agentId)}getBranch(t){return this.activeBranches.get(t)}getActiveBranches(){return Array.from(this.activeBranches.values())}listBranchFiles(){return i(this.config.branchDir)?p(this.config.branchDir).filter(e=>e.endsWith(".rvf")).map(e=>{let r=o(this.config.branchDir,e),n=f(r);return{agentId:l(e,".rvf"),path:r,sizeBytes:n.size,modifiedAt:n.mtime}}):[]}cleanupOrphans(t){let e=t??this.config.orphanMaxAgeMs,r=Date.now(),n=0;for(let a of this.listBranchFiles())if(r-a.modifiedAt.getTime()>e&&!this.activeBranches.has(a.agentId))try{s(a.path);let h=`${a.path}.idmap.json`;i(h)&&s(h),n++}catch{}return n}cleanupBranchFile(t){try{t.childAdapter.close()}catch{}try{i(t.childPath)&&s(t.childPath);let e=`${t.childPath}.idmap.json`;i(e)&&s(e)}catch{}}};export{g as AgentMemoryBranch};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{a,b,c,d,e,f}from"./chunk-AHKELLIO.js";import"./chunk-CM7U6TAX.js";import"./chunk-MBRHSU6W.js";import"./chunk-Z6GGIRQQ.js";import"./chunk-CD542DNJ.js";import"./chunk-7LPR6HJG.js";import"./chunk-7D3V65N5.js";import"./chunk-CCK4BF76.js";import"./chunk-YFBSPLJG.js";import"./chunk-7CUQCCMD.js";import"./chunk-3HZS4M3O.js";import"./chunk-Y3LZ35OG.js";import"./chunk-JVNTSNWU.js";import"./chunk-SMDN3BQZ.js";import"./chunk-6U7LNMWZ.js";import"./chunk-I33ERSGB.js";import"./chunk-IG5GNEC6.js";import"./chunk-UNFFDHER.js";import"./chunk-2TMWAQQ3.js";import"./chunk-2JVWITNK.js";import"./chunk-Q5XTSMWR.js";import"./chunk-AIRGNL55.js";import"./chunk-QW6VMTBR.js";import"./chunk-SDRHUMJB.js";import"./chunk-5J6W7SIA.js";import"./chunk-KNNISEDY.js";import"./chunk-TCHGOB2N.js";import"./chunk-FBMN7B46.js";import"./chunk-ENGZ4D5V.js";import"./chunk-MJS53PRX.js";import"./chunk-DPYSUDAO.js";import"./chunk-PI7TJS62.js";import"./chunk-EAY2JMZG.js";import"./chunk-C6KWXUFJ.js";import"./chunk-IB27QACC.js";import"./chunk-6SH5VZUD.js";import"./chunk-SESK3ARK.js";import"./chunk-SNOBH4AZ.js";import"./chunk-IQO7UCFR.js";import"./chunk-DUYOVM5I.js";import"./chunk-64VGZQLB.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
@@ -1,4 +1,4 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
2
- import"./chunk-TT23RRB7.js";import*as K from"fs";import*as M from"path";function G(t){let r=t>>>0;return function(){r|=0,r=r+1831565813|0;let n=Math.imul(r^r>>>15,1|r);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function w(t,r){return Math.floor(t()*r)}var z=[["===","!=="],["!==","==="],["<=","<"],[">=",">"],["&&","||"],["||","&&"],["<","<="],[">",">="],["+","-"],["*","+"]];function H(t){let r=new Array(t.length).fill(!1),n=0,e="code";for(;n<t.length;){let s=t[n],i=t[n+1];e==="code"?(s==="'"?e="single":s==='"'?e="double":s==="`"?e="template":s==="/"&&i==="/"?e="line-comment":s==="/"&&i==="*"&&(e="block-comment"),e!=="code"&&(r[n]=!0)):(r[n]=!0,e==="single"&&s==="'"&&t[n-1]!=="\\"||e==="double"&&s==='"'&&t[n-1]!=="\\"||e==="template"&&s==="`"&&t[n-1]!=="\\"||e==="line-comment"&&s===`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import"./chunk-64VGZQLB.js";import*as K from"fs";import*as M from"path";function G(t){let r=t>>>0;return function(){r|=0,r=r+1831565813|0;let n=Math.imul(r^r>>>15,1|r);return n=n+Math.imul(n^n>>>7,61|n)^n,((n^n>>>14)>>>0)/4294967296}}function w(t,r){return Math.floor(t()*r)}var z=[["===","!=="],["!==","==="],["<=","<"],[">=",">"],["&&","||"],["||","&&"],["<","<="],[">",">="],["+","-"],["*","+"]];function H(t){let r=new Array(t.length).fill(!1),n=0,e="code";for(;n<t.length;){let s=t[n],i=t[n+1];e==="code"?(s==="'"?e="single":s==='"'?e="double":s==="`"?e="template":s==="/"&&i==="/"?e="line-comment":s==="/"&&i==="*"&&(e="block-comment"),e!=="code"&&(r[n]=!0)):(r[n]=!0,e==="single"&&s==="'"&&t[n-1]!=="\\"||e==="double"&&s==='"'&&t[n-1]!=="\\"||e==="template"&&s==="`"&&t[n-1]!=="\\"||e==="line-comment"&&s===`
3
3
  `?e="code":e==="block-comment"&&s==="*"&&i==="/"&&(r[n+1]=!0,n++,e="code")),n++}return r}function E(t,r){let n=1;for(let e=0;e<r;e++)t[e]===`
4
4
  `&&n++;return n}function A(t,r){let n=H(t),e=new Array(t.length).fill(!1),s=[];for(let[i,c]of z){let a=t.indexOf(i);for(;a!==-1;){let u=a+i.length,y=e.slice(a,u).some(Boolean),h=n.slice(a,u).some(Boolean),v=i===">"&&t[a-1]==="=",S=(i==="<"||i===">")&&(t[u]==="="||t[a-1]==="<"||t[a-1]===">");if(!y&&!h&&!v&&!S){for(let d=a;d<u;d++)e[d]=!0;s.push({id:`${r}:${E(t,a)}:${a}:${i}->${c}`,index:a,from:i,to:c,line:E(t,a)})}a=t.indexOf(i,a+1)}}return s.sort((i,c)=>i.index-c.index)}function W(t,r){return t.slice(0,r.index)+r.to+t.slice(r.index+r.from.length)}import*as m from"fs";import*as f from"path";import*as L from"os";import{spawnSync as J}from"child_process";function I(t){let r=f.resolve(t),n=f.join(r,"src"),e=f.join(r,"tests");if(!m.existsSync(n)||!m.existsSync(e))throw new Error(`not an arena fixture (expected src/ and tests/): ${r}`);let s=m.readdirSync(n).filter(c=>c.endsWith(".mjs")).sort().map(c=>f.join("src",c)),i={};for(let c of m.readdirSync(e).filter(a=>a.endsWith(".test.mjs")).sort())i[c.replace(".test.mjs","")]=f.join("tests",c);if(s.length===0||Object.keys(i).length===0)throw new Error(`fixture has no src/*.mjs or tests/*.test.mjs: ${r}`);return{root:r,sourceFiles:s,testGroups:i}}function T(t,r){let n=m.mkdtempSync(f.join(r,"arena-ws-"));m.mkdirSync(f.join(n,"src"),{recursive:!0}),m.mkdirSync(f.join(n,"tests"),{recursive:!0});for(let e of t.layout.sourceFiles){let s=t.mutatedFile&&t.mutatedFile.relPath===e?t.mutatedFile.content:m.readFileSync(f.join(t.layout.root,e),"utf8");m.writeFileSync(f.join(n,e),s)}for(let e of t.groups){let s=t.layout.testGroups[e];m.copyFileSync(f.join(t.layout.root,s),f.join(n,s))}return n}function $(t,r={}){let n=["--test"];r.coverage&&n.push("--experimental-test-coverage");let e=m.readdirSync(f.join(t,"tests")).filter(u=>u.endsWith(".test.mjs")).sort().map(u=>f.join("tests",u));n.push(...e);let s=process.hrtime.bigint(),i=J(process.execPath,n,{cwd:t,timeout:r.timeoutMs??12e4,encoding:"utf8"}),c=Number(process.hrtime.bigint()-s)/1e6,a=null;if(r.coverage){let u=/all files\s*\|\s*([\d.]+)/.exec(i.stdout??"");a=u?Number(u[1]):null}return{ok:i.status===0,durationMs:Math.round(c),coveragePct:a}}function N(){return m.mkdtempSync(f.join(L.tmpdir(),"qe-arena-"))}function B(t){m.rmSync(t,{recursive:!0,force:!0})}var k={kill:.6,coverage:.3,runtimePenalty:.1};function Q(t,r,n){let e=[...t].sort(),s=new Set([e.join("+")]),i=[{id:"s1",name:`all(${e.join("+")})`,groups:e}],c=0;for(;i.length<r&&c++<200;){let a=e.filter(()=>n()<.5);if(a.length===0)continue;let u=a.join("+");s.has(u)||(s.add(u),i.push({id:`s${i.length+1}`,name:u,groups:a}))}return i}function C(t,r,n){let e=r===null?0:r/100,s=k.kill*t+k.coverage*e-k.runtimePenalty*n;return Math.round(s*1e4)/1e4}function D(t,r,n,e){let s=T({layout:t,groups:r.groups},e),i=$(s,{coverage:!0});if(!i.ok)return{baselinePassed:!1,killed:0,total:0,coveragePct:i.coveragePct,runtimeMs:i.durationMs};let c=0,a=0;for(let u of n)for(let y of u.mutants){a++;let h=T({layout:t,groups:r.groups,mutatedFile:{relPath:u.relPath,content:W(u.source,y)}},e);$(h).ok||c++}return{baselinePassed:!0,killed:c,total:a,coveragePct:i.coveragePct,runtimeMs:i.durationMs}}function rt(t){let r=t.seed??42,n=t.log??(()=>{}),e=G(r),s=I(t.target),i=N();try{let c=t.maxMutants??24,a=s.sourceFiles.map(l=>{let o=K.readFileSync(M.join(s.root,l),"utf8");return{relPath:l,source:o,mutants:A(o,l)}}),u=a.flatMap(l=>l.mutants.map(o=>({file:l.relPath,m:o})));if(u.length>c){let l=new Set;for(;l.size<c;)l.add(u[w(e,u.length)].m.id);for(let o of a)o.mutants=o.mutants.filter(p=>l.has(p.id));u=a.flatMap(o=>o.mutants.map(p=>({file:o.relPath,m:p})))}n(`mutants: ${u.length} (of ${a.reduce((l,o)=>l+A(o.source,o.relPath).length,0)} enumerated)`);let y=Q(Object.keys(s.testGroups),t.strategies??4,e),h={},v=y.map(l=>{n(`evaluating ${l.id} [${l.name}] ...`);let o=D(s,l,a,i);return h[l.id]=o.runtimeMs,{s:l,e:o}}),S=Object.keys(s.testGroups).length,d=v.map(({s:l,e:o})=>{let p=o.total>0?Math.round(o.killed/o.total*1e4)/1e4:0,g=Math.round(l.groups.length/S*1e4)/1e4;return{...l,baselinePassed:o.baselinePassed,mutantsKilled:o.killed,mutantsTotal:o.total,killRate:p,coveragePct:o.coveragePct,suiteCostRatio:g,fitness:o.baselinePassed?C(p,o.coveragePct,g):0}}),P=[...d].sort((l,o)=>o.fitness-l.fitness||l.id.localeCompare(o.id)).map(l=>l.id),U=d.map(l=>d.map(o=>l.fitness>o.fitness?1:l.fitness<o.fitness?-1:0)),j=[];if(t.evolveSteps&&t.evolveSteps>0){let l=Object.keys(s.testGroups).sort(),o=d.find(g=>g.id===P[0]).groups,p=d.find(g=>g.id===P[0]).fitness;for(let g=1;g<=t.evolveSteps;g++){let R=l[w(e,l.length)],b=o.includes(R)?o.filter(q=>q!==R):[...o,R].sort();if(b.length===0){j.push({step:g,groups:b,fitness:0,accepted:!1});continue}let x=D(s,{id:`evo${g}`,name:b.join("+"),groups:b},a,i),_=x.total>0?x.killed/x.total:0,F=x.baselinePassed?C(_,x.coveragePct,b.length/l.length):0,O=F>p;j.push({step:g,groups:b,fitness:F,accepted:O}),O&&(o=b,p=F)}}return{contract:"arena-result@1",seed:r,target:M.relative(process.cwd(),s.root)||".",weights:{...k},mutantsTotal:u.length,strategies:d,ranking:P,competitiveArray:U,evolution:j,informational:{runtimesMs:h}}}finally{B(i)}}export{Q as buildStrategies,rt as runArena};
@@ -1,5 +1,5 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
2
- import{a as c,c as f}from"./chunk-G6T45OIC.js";import"./chunk-TT23RRB7.js";f();import{Command as $}from"commander";import r from"chalk";function x(v,g,p){let m=new $("arena").description("Competitive test-strategy tournaments (ADR-104)").addHelpText("after",`
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{a as c,c as f}from"./chunk-MJS53PRX.js";import"./chunk-64VGZQLB.js";f();import{Command as $}from"commander";import r from"chalk";function x(v,g,p){let m=new $("arena").description("Competitive test-strategy tournaments (ADR-104)").addHelpText("after",`
3
3
  Examples:
4
4
  # Run a 4-strategy tournament against the demo fixture (reproducible under --seed)
5
5
  aqe arena run --strategies 4 --target fixtures/arena-demo --seed 42
@@ -9,10 +9,10 @@ Examples:
9
9
 
10
10
  # List persisted runs
11
11
  aqe arena list
12
- `);return m.command("run").description("Run a seeded strategy tournament against an arena fixture").requiredOption("--target <dir>","Arena fixture directory (src/*.mjs + tests/*.test.mjs)").option("--strategies <n>","Number of strategies","4").option("--seed <n>","RNG seed (same seed = same tournament)","42").option("--max-mutants <n>","Mutant sample cap","24").option("--evolve <steps>","Hill-climb steps from the winner","0").option("--json","Output the full arena-result@1 envelope as JSON").action(async a=>{try{let{runArena:i}=await import("./arena-KXFHRWX4.js"),t=i({target:a.target,strategies:parseInt(a.strategies,10),seed:parseInt(a.seed,10),maxMutants:parseInt(a.maxMutants,10),evolveSteps:parseInt(a.evolve,10),log:a.json?()=>{}:e=>console.error(r.dim(` ${e}`))});try{let{getUnifiedMemory:e}=await import("./unified-memory-CXHLHB5I.js"),s=e();s.isInitialized()||await s.initialize(),s.getDatabase().prepare("INSERT OR REPLACE INTO kv_store (namespace, key, value) VALUES ('arena', ?, ?)").run(`run:${t.seed}:${t.target}`,JSON.stringify(t))}catch(e){console.error(r.dim(` note: run not persisted (${c(e)})`))}if(a.json){console.log(JSON.stringify(t,null,2));return}let d=new Map(t.strategies.map(e=>[e.id,e]));console.log(r.blue(`
12
+ `);return m.command("run").description("Run a seeded strategy tournament against an arena fixture").requiredOption("--target <dir>","Arena fixture directory (src/*.mjs + tests/*.test.mjs)").option("--strategies <n>","Number of strategies","4").option("--seed <n>","RNG seed (same seed = same tournament)","42").option("--max-mutants <n>","Mutant sample cap","24").option("--evolve <steps>","Hill-climb steps from the winner","0").option("--json","Output the full arena-result@1 envelope as JSON").action(async a=>{try{let{runArena:i}=await import("./arena-7BGOXGXO.js"),t=i({target:a.target,strategies:parseInt(a.strategies,10),seed:parseInt(a.seed,10),maxMutants:parseInt(a.maxMutants,10),evolveSteps:parseInt(a.evolve,10),log:a.json?()=>{}:e=>console.error(r.dim(` ${e}`))});try{let{getUnifiedMemory:e}=await import("./unified-memory-UCQ6AB32.js"),s=e();s.isInitialized()||await s.initialize(),s.getDatabase().prepare("INSERT OR REPLACE INTO kv_store (namespace, key, value) VALUES ('arena', ?, ?)").run(`run:${t.seed}:${t.target}`,JSON.stringify(t))}catch(e){console.error(r.dim(` note: run not persisted (${c(e)})`))}if(a.json){console.log(JSON.stringify(t,null,2));return}let d=new Map(t.strategies.map(e=>[e.id,e]));console.log(r.blue(`
13
13
  Arena: ${t.target} \xB7 seed ${t.seed} \xB7 ${t.mutantsTotal} mutants
14
14
  `)),console.log(" rank id kill-rate coverage cost fitness groups"),t.ranking.forEach((e,s)=>{let n=d.get(e),u=n.coveragePct===null?" n/a":`${n.coveragePct.toFixed(2)}%`.padStart(7);console.log(` ${String(s+1).padEnd(5)}${n.id.padEnd(5)}${(n.killRate*100).toFixed(1).padStart(6)}% ${u} ${n.suiteCostRatio.toFixed(2).padEnd(6)}${n.fitness.toFixed(4).padEnd(9)}${n.name}`+(n.baselinePassed?"":r.red(" [baseline FAILED]")))}),console.log(`
15
15
  competitive array (row beats column = 1):`);let o=t.strategies.map(e=>e.id);if(console.log(` ${o.map(e=>e.padEnd(4)).join("")}`),t.competitiveArray.forEach((e,s)=>{console.log(` ${o[s].padEnd(4)}${e.map(n=>String(n).padStart(2).padEnd(4)).join("")}`)}),t.evolution.length>0){console.log(`
16
16
  evolution:`);for(let e of t.evolution)console.log(` step ${e.step}: [${e.groups.join("+")}] fitness ${e.fitness.toFixed(4)} ${e.accepted?r.green("accepted"):"rejected"}`)}let l=d.get(t.ranking[0]);console.log(r.green(`
17
17
  winner: ${l.id} [${l.name}] \u2014 kill ${(l.killRate*100).toFixed(1)}%, fitness ${l.fitness.toFixed(4)}
18
- `))}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m.command("list").description("List persisted arena runs").option("--json","Output as JSON").action(async a=>{if(await p())try{let{getUnifiedMemory:i}=await import("./unified-memory-CXHLHB5I.js"),t=i();t.isInitialized()||await t.initialize();let d=t.getDatabase().prepare("SELECT key, value FROM kv_store WHERE namespace = 'arena' ORDER BY key").all();if(a.json){console.log(JSON.stringify(d.map(o=>({key:o.key,result:JSON.parse(o.value)})),null,2));return}if(d.length===0){console.log(r.yellow(" no persisted arena runs"));return}for(let o of d){let l=JSON.parse(o.value),e=l.strategies.find(s=>s.id===l.ranking[0]);console.log(` ${r.green(o.key)} \u2014 winner ${e?.id} [${e?.name}] fitness ${e?.fitness}`)}}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m}export{x as createArenaCommand};
18
+ `))}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m.command("list").description("List persisted arena runs").option("--json","Output as JSON").action(async a=>{if(await p())try{let{getUnifiedMemory:i}=await import("./unified-memory-UCQ6AB32.js"),t=i();t.isInitialized()||await t.initialize();let d=t.getDatabase().prepare("SELECT key, value FROM kv_store WHERE namespace = 'arena' ORDER BY key").all();if(a.json){console.log(JSON.stringify(d.map(o=>({key:o.key,result:JSON.parse(o.value)})),null,2));return}if(d.length===0){console.log(r.yellow(" no persisted arena runs"));return}for(let o of d){let l=JSON.parse(o.value),e=l.strategies.find(s=>s.id===l.ranking[0]);console.log(` ${r.green(o.key)} \u2014 winner ${e?.id} [${e?.name}] fitness ${e?.fitness}`)}}catch(i){console.error(r.red(` \u2717 ${c(i)}`)),await g(1)}}),m}export{x as createArenaCommand};
@@ -0,0 +1,4 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{d as g,e as y,f as k,g as w}from"./chunk-BPEDWS6O.js";import{o as x}from"./chunk-2JVWITNK.js";import"./chunk-Q5XTSMWR.js";import"./chunk-AIRGNL55.js";import"./chunk-QW6VMTBR.js";import{b as l}from"./chunk-SDRHUMJB.js";import"./chunk-TCHGOB2N.js";import"./chunk-FBMN7B46.js";import"./chunk-ENGZ4D5V.js";import"./chunk-MJS53PRX.js";import"./chunk-PI7TJS62.js";import{p as F,q as j}from"./chunk-EAY2JMZG.js";import"./chunk-C6KWXUFJ.js";import"./chunk-IB27QACC.js";import"./chunk-6SH5VZUD.js";import"./chunk-SESK3ARK.js";import"./chunk-SNOBH4AZ.js";import"./chunk-IQO7UCFR.js";import"./chunk-DUYOVM5I.js";import{f as v}from"./chunk-64VGZQLB.js";import{Command as E}from"commander";import s from"chalk";x();import{existsSync as f}from"node:fs";import p from"node:path";function b(e,a,n){let t=[];t.push(s.bold("Witness Chain Audit Verification")),t.push("");let r=a?s.green("ENABLED"):s.yellow("DISABLED");t.push(` Feature Flag: ${r}`),t.push(` Chain Length: ${e.length} receipts`);let o=n?.status==="forked"?s.yellow("FORKED (no tampering detected)"):e.valid?s.green(n?.status==="valid-with-forks"?"VALID (forks re-anchored)":"VALID"):s.red(n?.status==="tampered"?"BROKEN (tampering detected)":"BROKEN");t.push(` Integrity: ${o}`),e.length>0&&t.push(` Last Hash: ${e.lastHash.slice(0,16)}...`);let i=n?.forks?.length??0;if(i>0){let d=n?.acknowledgedForks?.length??0;t.push(` Forks: ${i} accidental (pre-3.14.5 concurrent writes, #753), ${d} re-anchored`)}if(n?.status==="forked")t.push(""),t.push(s.yellow(` ${e.message}`));else if(!e.valid&&e.brokenAt>=0){t.push("");let d=n?.status==="tampered"&&n.tamperedAt!==void 0?n.tamperedAt:e.brokenAt;t.push(s.red(` Break detected at index ${d}${n?.tamperReason?` (${n.tamperReason})`:""}`)),t.push(s.red(` ${e.message}`))}else e.valid&&i>0&&(t.push(""),t.push(s.green(` ${e.message}`)));return t.push(""),t.join(`
3
+ `)}function O(){try{let e=l(),a=p.join(e,".agentic-qe","memory.db");if(!f(a))return null;let n=(j(),v(F)),t=new n(a),r=g(t),o=k(r);return t.close(),o}catch{return null}}async function P(e){let a=w(),t=(O()??y()).verifyChain(),r={featureEnabled:a,chainLength:t.length,integrity:t.valid,brokenAt:t.brokenAt,lastHash:t.lastHash,message:t.message};return e.format==="json"?console.log(JSON.stringify(r,null,2)):console.log(b(t,a)),r}async function L(e){let{WitnessChain:a,hashWith:n,serializeEntry:t}=await import("./witness-chain-JQA2VPZI.js"),{dbPath:r,keyDir:o}=R(),i;if(!f(r))i={featureEnabled:!0,chainLength:0,integrity:!0,brokenAt:-1,lastHash:"",message:`No database found at ${r} \u2014 nothing to verify`};else{let{default:d}=await import("./better-sqlite3-PMUNGASU.js"),u=new d(r,{readonly:!0});try{let m=new a(u,await A(o)??void 0);await m.initialize();let c=m.verify({includeArchive:!0,checkSignatures:!1}),{tableExists:C}=await import("./witness-chain-verifier-3GEADWPE.js"),h=C(u,"witness_chain")?u.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get():void 0,$=h?n(h.hash_algo||"sha256",t(h)):"";i={featureEnabled:!0,chainLength:c.entriesChecked,integrity:c.valid,brokenAt:c.brokenAt??-1,lastHash:$,message:V(c),status:c.status,tampered:c.tampered,...c.tamperedAt!==void 0?{tamperedAt:c.tamperedAt}:{},...c.tamperReason?{tamperReason:c.tamperReason}:{},forks:c.forks,acknowledgedForks:c.acknowledgedForks}}finally{u.close()}}return e.format==="json"?console.log(JSON.stringify(i,null,2)):console.log(b({valid:i.integrity,length:i.chainLength,brokenAt:i.brokenAt,lastHash:i.lastHash,message:i.message},i.featureEnabled,i)),i}function R(){let e=l();return{dbPath:p.join(e,".agentic-qe","memory.db"),keyDir:p.join(e,".agentic-qe","witness-keys")}}async function A(e){if(!f(e))return null;let{WitnessKeyManager:a}=await import("./witness-key-manager-ZWEIK3VJ.js");return new a({keyDir:e,autoGenerate:!1})}function V(e){let a=e.entriesChecked,n=e.forks.length,t=n-e.acknowledgedForks.length;switch(e.status){case"valid":return`Audit chain verified: ${a} entries checked, ${e.signatureFailures??0} signature failures`;case"valid-with-forks":return`Audit chain verified: ${a} entries checked; ${n} accidental fork(s) from pre-3.14.5 concurrent writes are re-anchored by CHAIN_REANCHOR, no tampering detected`;case"forked":return`${t} accidental fork(s) (pre-3.14.5 concurrent writes, #753), no tampering detected \u2014 ${a} entries checked, first fork at id=${e.brokenAt}. Run \`aqe audit repair --chain audit\` to back up the store and re-anchor.`;default:return`Audit chain BROKEN: tampering detected at id=${e.tamperedAt} (${e.tamperReason}); ${a} entries checked`+(n>0?`, ${n} accidental fork(s) found before it`:"")}}function W(e){return e.action==="refused"?!0:e.action==="reanchored"&&!(e.after?.status==="valid"||e.after?.status==="valid-with-forks")}async function D(e){let{repairWitnessChainForks:a}=await import("./witness-chain-repair-4UA7IPS3.js"),{dbPath:n,keyDir:t}=R(),r=e.dryRun===!0,o;if(f(n)){let{openDatabase:i}=await import("./safe-db-QJLFO33B.js"),d=i(n,{readonly:r,fileMustExist:!0});try{let u=r?await A(t):(await import("./witness-key-manager-ZWEIK3VJ.js")).getDefaultWitnessKeyManager();o=await a(d,{dbPath:n,dryRun:r,keyManager:u})}finally{d.close()}}else{let i={status:"valid",entriesChecked:0,forks:0,unacknowledgedForks:0};o={action:"none",dryRun:r,message:`No database found at ${n} \u2014 nothing to repair`,before:i,rowsBefore:{live:0,archive:0},rowsAfter:{live:0,archive:0},forksAcknowledged:[]}}return e.format==="json"?console.log(JSON.stringify(o,null,2)):console.log(S(o)),o}function S(e){let a=e.action==="refused"?s.red:e.action==="reanchored"?s.green:s.yellow,n=[s.bold("Witness Chain Audit Repair"),"",` Action: ${a(e.action.toUpperCase())}${e.dryRun?" (dry run)":""}`,` Before: ${e.before.status}, ${e.before.forks} fork(s), ${e.before.unacknowledgedForks} unacknowledged`,` Rows: live ${e.rowsBefore.live} -> ${e.rowsAfter.live}, archive ${e.rowsBefore.archive} -> ${e.rowsAfter.archive}`];return e.after&&n.push(` After: ${e.after.status}`),e.backupPath&&n.push(` Backup: ${e.backupPath}`),n.push("",` ${a(e.message)}`,""),n.join(`
4
+ `)}function q(e,a,n){let t=new E("audit").description("Witness chain audit trail management");return t.command("verify").description("Verify witness chain integrity").option("-F, --format <format>","Output format (json|text)","text").option("-C, --chain <chain>","Which chain to verify: governance (29 decision receipts) or audit (full QE audit trail)","governance").action(async r=>{try{let o=r.format,i=r.chain==="audit"?await L({format:o}):await P({format:o});await a(i.integrity?0:1)}catch(o){console.error("Failed to verify witness chain:",o),await a(1)}}),t.command("repair").description("Re-anchor accidental pre-3.14.5 forks in the audit chain (#753); backs up first, refuses on tampering").option("-C, --chain <chain>",'Chain to repair (only "audit" is supported)',"audit").option("--dry-run","Report what would be done without writing anything",!1).option("-F, --format <format>","Output format (json|text)","text").action(async r=>{try{if(r.chain!=="audit"){console.error(`aqe audit repair supports only --chain audit (got "${r.chain}")`),await a(1);return}let o=await D({format:r.format,dryRun:r.dryRun===!0});await a(W(o)?1:0)}catch(o){console.error("Failed to repair witness chain:",o),await a(1)}}),t}export{q as createAuditCommand,b as formatVerificationText,D as handleAuditChainRepair,L as handleAuditChainVerify,P as handleAuditVerify};
@@ -0,0 +1,2 @@
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-5QQSIGUA.js";import"./chunk-BMAPORJ7.js";import"./chunk-2JVWITNK.js";import"./chunk-Q5XTSMWR.js";import"./chunk-AIRGNL55.js";import"./chunk-QW6VMTBR.js";import"./chunk-SDRHUMJB.js";import"./chunk-TCHGOB2N.js";import"./chunk-FBMN7B46.js";import"./chunk-ENGZ4D5V.js";import"./chunk-MJS53PRX.js";import"./chunk-DPYSUDAO.js";import"./chunk-WCJBU2KI.js";import"./chunk-PI7TJS62.js";import"./chunk-EAY2JMZG.js";import"./chunk-C6KWXUFJ.js";import"./chunk-IB27QACC.js";import"./chunk-6SH5VZUD.js";import"./chunk-SESK3ARK.js";import"./chunk-SNOBH4AZ.js";import"./chunk-IQO7UCFR.js";import"./chunk-DUYOVM5I.js";import"./chunk-64VGZQLB.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
@@ -1,2 +1,2 @@
1
- import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.4");process.exit(0)}
2
- import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-5YPYDPBJ.js";import"./chunk-TT23RRB7.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};
1
+ import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.14.6");process.exit(0)}
2
+ import{a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,q as p}from"./chunk-EAY2JMZG.js";import"./chunk-64VGZQLB.js";p();export{i as DotProductAttention,h as FlashAttention,k as HyperbolicAttention,l as LinearAttention,m as MoEAttention,j as MultiHeadAttention,b as RuvectorLayer,n as SonaEngine,c as TensorCompress,a as default,d as differentiableSearch,f as getCompressionLevel,e as hierarchicalForward,g as init,o as pipeline};