agentic-qe 3.14.5 → 3.14.7

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 (494) hide show
  1. package/.claude/skills/skills-manifest.json +1 -1
  2. package/CHANGELOG.md +150 -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 +16 -106
  13. package/dist/audit/witness-findings.js +4 -1
  14. package/dist/cli/bundle.js +8 -8
  15. package/dist/cli/chunks/adapter-TVQKH65T.js +2 -0
  16. package/dist/cli/chunks/agent-booster-wasm-AK2W76RG.js +2 -0
  17. package/dist/cli/chunks/{agent-handler-V6CZ7Q6S.js → agent-handler-MGZCWHIY.js} +2 -2
  18. package/dist/cli/chunks/{agent-memory-branch-ZMD6ULC3.js → agent-memory-branch-JZ54MCSP.js} +2 -2
  19. package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +2 -0
  20. package/dist/cli/chunks/{arena-QLSBESC7.js → arena-CUVH3V7H.js} +2 -2
  21. package/dist/cli/chunks/{arena-4UPAEHFT.js → arena-YSWTKBCL.js} +4 -4
  22. package/dist/cli/chunks/audit-LVU76QGA.js +4 -0
  23. package/dist/cli/chunks/base-W42BURDL.js +2 -0
  24. package/dist/cli/chunks/{better-sqlite3-4DSBPDRH.js → better-sqlite3-DB3LOJQU.js} +2 -2
  25. package/dist/cli/chunks/{brain-handler-GBY4EZ4P.js → brain-handler-SD63KOQ6.js} +3 -3
  26. package/dist/cli/chunks/{branch-enumerator-XYBVXCNO.js → branch-enumerator-4MNOPUC7.js} +2 -2
  27. package/dist/cli/chunks/{browser-32F6MREU.js → browser-OLPNTWQE.js} +2 -2
  28. package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +2 -0
  29. package/dist/cli/chunks/{chunk-WLXK2KNU.js → chunk-23CX7JNL.js} +2 -2
  30. package/dist/cli/chunks/{chunk-O3JTQ7N4.js → chunk-25P6JA6V.js} +1 -1
  31. package/dist/cli/chunks/{chunk-DO6EI5KB.js → chunk-2G63VIJE.js} +1 -1
  32. package/dist/cli/chunks/{chunk-G3L5L6YQ.js → chunk-2IMSJ7IO.js} +1 -1
  33. package/dist/cli/chunks/{chunk-RD6TEZ64.js → chunk-36VKMAMN.js} +2 -2
  34. package/dist/cli/chunks/{chunk-KIP6WZGV.js → chunk-3M7J4U74.js} +3 -3
  35. package/dist/cli/chunks/chunk-3QJU4Q4R.js +5 -0
  36. package/dist/cli/chunks/{chunk-2JGEZHWY.js → chunk-4EKV7PHB.js} +2 -2
  37. package/dist/cli/chunks/chunk-4INST4ZL.js +4 -0
  38. package/dist/cli/chunks/{chunk-DPBRWP4J.js → chunk-53BXTTRO.js} +3 -3
  39. package/dist/cli/chunks/chunk-5D7ZFWDS.js +2 -0
  40. package/dist/cli/chunks/{chunk-XLAUGSW7.js → chunk-5FSLMYAC.js} +2 -2
  41. package/dist/cli/chunks/chunk-5GFKTJ65.js +4 -0
  42. package/dist/cli/chunks/{chunk-WOIGKU2N.js → chunk-5U6N4V5M.js} +11 -11
  43. package/dist/cli/chunks/{chunk-PSPKSUF6.js → chunk-6EGS77BB.js} +1 -1
  44. package/dist/cli/chunks/{chunk-QIRL6B3C.js → chunk-6PJPQGF4.js} +2 -2
  45. package/dist/cli/chunks/{chunk-I6X3EGJI.js → chunk-6RD44SCE.js} +1 -1
  46. package/dist/cli/chunks/{chunk-IGBEJ4UJ.js → chunk-74IOEOMH.js} +2 -2
  47. package/dist/cli/chunks/{chunk-E3W6XQ57.js → chunk-77QZHIVX.js} +2 -2
  48. package/dist/cli/chunks/{chunk-R74ZKREV.js → chunk-7EZ2Z2CK.js} +1 -1
  49. package/dist/cli/chunks/{chunk-UTBYJ4RF.js → chunk-7MIOK72I.js} +18 -35
  50. package/dist/cli/chunks/{chunk-URVHZPWY.js → chunk-7QYOTUOX.js} +2 -2
  51. package/dist/cli/chunks/{chunk-K27SU3RE.js → chunk-A2VUCUTT.js} +2 -2
  52. package/dist/cli/chunks/{chunk-2KJQ2UQE.js → chunk-A3DK3XNZ.js} +1 -1
  53. package/dist/cli/chunks/{chunk-5D36YHS3.js → chunk-A5MA7A23.js} +4 -4
  54. package/dist/cli/chunks/{chunk-WJHWH5D2.js → chunk-AEUEMVJK.js} +2 -2
  55. package/dist/cli/chunks/{chunk-6CR4VQBQ.js → chunk-AJUBT4NP.js} +2 -2
  56. package/dist/cli/chunks/chunk-B2YGVSOP.js +27 -0
  57. package/dist/cli/chunks/{chunk-D6OUCB2H.js → chunk-B4I43GE2.js} +2 -2
  58. package/dist/cli/chunks/{chunk-WK7B4B6Y.js → chunk-BD7FEUN3.js} +2 -2
  59. package/dist/cli/chunks/{chunk-OEIQTWQP.js → chunk-BE4KALTE.js} +1 -1
  60. package/dist/cli/chunks/{chunk-JROVR6YS.js → chunk-BEFTQVEW.js} +2 -2
  61. package/dist/cli/chunks/{chunk-HBCGYMQU.js → chunk-BLG7SH4A.js} +1 -1
  62. package/dist/cli/chunks/{chunk-2OMLTYQK.js → chunk-C3FXFU2T.js} +1 -1
  63. package/dist/cli/chunks/{chunk-6A44AOGN.js → chunk-CBONQM5D.js} +2 -2
  64. package/dist/cli/chunks/{chunk-73EI4C2E.js → chunk-CQNMGK6Y.js} +2 -2
  65. package/dist/cli/chunks/{chunk-IIAR5S7Q.js → chunk-CVOQ6ESD.js} +2 -2
  66. package/dist/cli/chunks/{chunk-6TU7FEMD.js → chunk-DOBKEXMJ.js} +1 -1
  67. package/dist/cli/chunks/{chunk-BHFR2EXL.js → chunk-DYTQHRUS.js} +1 -1
  68. package/dist/cli/chunks/{chunk-E4AZXCT5.js → chunk-EADSQN5T.js} +1 -1
  69. package/dist/cli/chunks/{chunk-CYE2TJFV.js → chunk-EGOIIUBD.js} +2 -2
  70. package/dist/cli/chunks/{chunk-DKUBQQFG.js → chunk-EIGRV3J6.js} +2 -2
  71. package/dist/cli/chunks/{chunk-RP2ZKPYV.js → chunk-EJ6MMYLK.js} +1 -1
  72. package/dist/cli/chunks/{chunk-HSVKZ5KI.js → chunk-ENK44A6Q.js} +2 -2
  73. package/dist/cli/chunks/{chunk-67YV75XP.js → chunk-EYXE2XKP.js} +2 -2
  74. package/dist/cli/chunks/{chunk-HYEJJJY3.js → chunk-F2OPFVQH.js} +1 -1
  75. package/dist/cli/chunks/{chunk-XUR2M2WB.js → chunk-FBZC4IGB.js} +2 -2
  76. package/dist/cli/chunks/{chunk-BXVAVFGU.js → chunk-FSSR6WBE.js} +2 -2
  77. package/dist/cli/chunks/{chunk-W2XCZU62.js → chunk-FW4DJ4FJ.js} +1 -1
  78. package/dist/cli/chunks/{chunk-KKHYJF5U.js → chunk-FYPX5WBJ.js} +1 -1
  79. package/dist/cli/chunks/{chunk-K7NJHFLZ.js → chunk-G367W7XR.js} +3 -3
  80. package/dist/cli/chunks/{chunk-IUDWEOLX.js → chunk-GLGKQX2V.js} +2 -2
  81. package/dist/cli/chunks/{chunk-JVQBWYHW.js → chunk-GV4DYPJP.js} +2 -2
  82. package/dist/cli/chunks/{chunk-GTKCGPJZ.js → chunk-GVVFTFMB.js} +2 -2
  83. package/dist/cli/chunks/{chunk-AFEDJ3RU.js → chunk-H5RQPO3X.js} +2 -2
  84. package/dist/cli/chunks/{chunk-4FWTLJEP.js → chunk-HPWWYT67.js} +2 -2
  85. package/dist/cli/chunks/{chunk-G3W6BMVJ.js → chunk-HXXHMLJ5.js} +1 -1
  86. package/dist/cli/chunks/{chunk-NU7UTXMP.js → chunk-HYFQUWNB.js} +2 -2
  87. package/dist/cli/chunks/chunk-HYOPJHHW.js +2 -0
  88. package/dist/cli/chunks/{chunk-6LKDHEBY.js → chunk-HZY42OVU.js} +2 -2
  89. package/dist/cli/chunks/{chunk-C3HQL6S4.js → chunk-IAENZ2DR.js} +2 -2
  90. package/dist/cli/chunks/{chunk-M23ZOZVY.js → chunk-IEJ7ZV3M.js} +1 -1
  91. package/dist/cli/chunks/{chunk-RIZVC4XY.js → chunk-IWFFO6VT.js} +2 -2
  92. package/dist/cli/chunks/chunk-J7AQZLIH.js +21 -0
  93. package/dist/cli/chunks/{chunk-3KDL6QDK.js → chunk-JHJUSSAU.js} +2 -2
  94. package/dist/cli/chunks/{chunk-DLF5BOJD.js → chunk-JOZ47MV6.js} +1 -1
  95. package/dist/cli/chunks/{chunk-ELBZON4V.js → chunk-JZT7BU44.js} +2 -2
  96. package/dist/cli/chunks/{chunk-3DDXWYMO.js → chunk-KD2BLA5Y.js} +1 -1
  97. package/dist/cli/chunks/{chunk-VD5IO5EO.js → chunk-KUHLTVWC.js} +1 -1
  98. package/dist/cli/chunks/{chunk-YDFL445W.js → chunk-LU2EDWQK.js} +2 -2
  99. package/dist/cli/chunks/chunk-LXZMP3VX.js +736 -0
  100. package/dist/cli/chunks/{chunk-3YUB5HER.js → chunk-LY7MFGBD.js} +196 -187
  101. package/dist/cli/chunks/chunk-MM56VPNE.js +180 -0
  102. package/dist/cli/chunks/{chunk-37TUN44F.js → chunk-MNQN7UZX.js} +2 -2
  103. package/dist/cli/chunks/{chunk-7DETTOPZ.js → chunk-MQZ53OR3.js} +2 -2
  104. package/dist/cli/chunks/{chunk-BYG36QC5.js → chunk-MT7UNBZ7.js} +2 -2
  105. package/dist/cli/chunks/{chunk-JES6R5KP.js → chunk-MZB2UV2O.js} +1 -1
  106. package/dist/cli/chunks/{chunk-QZMUXJHZ.js → chunk-MZMG6CUJ.js} +2 -2
  107. package/dist/cli/chunks/chunk-N5XOXPHZ.js +4 -0
  108. package/dist/cli/chunks/{chunk-RD2VGOUH.js → chunk-NBLDBVAW.js} +1 -1
  109. package/dist/cli/chunks/{chunk-HVU64GP5.js → chunk-ND4QTZOL.js} +2 -2
  110. package/dist/cli/chunks/{chunk-SQF6HRXR.js → chunk-NHUGHAY6.js} +1 -1
  111. package/dist/cli/chunks/{chunk-TUSSPKRM.js → chunk-NOHWJOBS.js} +1 -1
  112. package/dist/cli/chunks/{chunk-NVYBM3R4.js → chunk-O5V7RHVG.js} +2 -2
  113. package/dist/cli/chunks/{chunk-6VAZAHQG.js → chunk-O6MO5KMR.js} +2 -2
  114. package/dist/cli/chunks/{chunk-IUHB5GVS.js → chunk-OAZX6WFU.js} +2 -2
  115. package/dist/cli/chunks/{chunk-LSUILON7.js → chunk-OEPNNLR4.js} +1 -1
  116. package/dist/cli/chunks/{chunk-IJHCIXJC.js → chunk-OIDWDGLG.js} +2 -2
  117. package/dist/cli/chunks/{chunk-CPC7FN52.js → chunk-ON2UTP2U.js} +2 -2
  118. package/dist/cli/chunks/{chunk-UJWAWIRV.js → chunk-ONR2NXXD.js} +7 -7
  119. package/dist/cli/chunks/{chunk-7VFY7TUR.js → chunk-OXHF3L2T.js} +2 -2
  120. package/dist/cli/chunks/{chunk-QYOGD2VW.js → chunk-OZGIOKEA.js} +1 -1
  121. package/dist/cli/chunks/{chunk-WJTSY5MC.js → chunk-P2UPYSDJ.js} +1 -1
  122. package/dist/cli/chunks/{chunk-52L77RMG.js → chunk-P7XSPP5D.js} +2 -2
  123. package/dist/cli/chunks/{chunk-M5AEL7IS.js → chunk-PCJQCEBA.js} +2 -2
  124. package/dist/cli/chunks/chunk-PELENDDQ.js +2 -0
  125. package/dist/cli/chunks/{chunk-C3Z4VVHP.js → chunk-PYKY22GC.js} +5 -5
  126. package/dist/cli/chunks/{chunk-AF4XKLXO.js → chunk-Q3NSU24F.js} +2 -2
  127. package/dist/cli/chunks/chunk-Q6NTEICT.js +2 -0
  128. package/dist/cli/chunks/chunk-QFETNCNN.js +12 -0
  129. package/dist/cli/chunks/{chunk-KYA5LARK.js → chunk-QGOWNVVG.js} +1 -1
  130. package/dist/cli/chunks/{chunk-Y5L3ES4L.js → chunk-QPLSYEWJ.js} +2 -2
  131. package/dist/cli/chunks/{chunk-F34OAHOM.js → chunk-QQFQDEUE.js} +2 -2
  132. package/dist/cli/chunks/{chunk-EFV4ADMO.js → chunk-QUORH2MG.js} +55 -79
  133. package/dist/cli/chunks/{chunk-QWUXCG2L.js → chunk-QVH5Y7AP.js} +1 -1
  134. package/dist/cli/chunks/{chunk-I2NENQ44.js → chunk-RC2A4JZ5.js} +2 -2
  135. package/dist/cli/chunks/{chunk-XZSMZHM2.js → chunk-RDGPXENG.js} +2 -2
  136. package/dist/cli/chunks/{chunk-N7H767TP.js → chunk-RKI3IQKQ.js} +2 -2
  137. package/dist/cli/chunks/{chunk-LULD4JV2.js → chunk-RKUAWQOF.js} +2 -2
  138. package/dist/cli/chunks/chunk-RLW25X66.js +2 -0
  139. package/dist/cli/chunks/{chunk-UKGXWW64.js → chunk-ROVZSZCS.js} +3 -3
  140. package/dist/cli/chunks/{chunk-EOR2UT72.js → chunk-RT6O2HW2.js} +2 -2
  141. package/dist/cli/chunks/{chunk-75QJ5HWE.js → chunk-SM2YJ2AL.js} +2 -2
  142. package/dist/cli/chunks/{chunk-KO4FNAUR.js → chunk-SRPLERER.js} +3 -3
  143. package/dist/cli/chunks/{chunk-NRE4NAVA.js → chunk-T77GZF4B.js} +1 -1
  144. package/dist/cli/chunks/{chunk-R6IU3EWP.js → chunk-TFK2AYIN.js} +2 -2
  145. package/dist/cli/chunks/chunk-TW3SR4TS.js +2 -0
  146. package/dist/cli/chunks/{chunk-IYTLXUBO.js → chunk-TXSPBLBT.js} +2 -2
  147. package/dist/cli/chunks/chunk-UA7TDVL7.js +12 -0
  148. package/dist/cli/chunks/{chunk-WX6RRIGW.js → chunk-UBJG3IHT.js} +2 -2
  149. package/dist/cli/chunks/{chunk-NQI7FWCS.js → chunk-UFSVUBTR.js} +2 -2
  150. package/dist/cli/chunks/{chunk-FUNGTIF2.js → chunk-UOI6ULCH.js} +2 -2
  151. package/dist/cli/chunks/{chunk-HVXJC3OC.js → chunk-UYUJT6QO.js} +2 -2
  152. package/dist/cli/chunks/{chunk-KEY43ANX.js → chunk-V5AK56DA.js} +2 -2
  153. package/dist/cli/chunks/{chunk-XFPPERA2.js → chunk-V6RE4YRQ.js} +2 -2
  154. package/dist/cli/chunks/{chunk-DDCIYOGT.js → chunk-VW6FRMLW.js} +2 -2
  155. package/dist/cli/chunks/chunk-VXKWNRGA.js +2 -0
  156. package/dist/cli/chunks/{chunk-CVMNJSCB.js → chunk-VYDVI6FZ.js} +2 -2
  157. package/dist/cli/chunks/{chunk-7JZJJA7U.js → chunk-WF6UISKW.js} +3 -3
  158. package/dist/cli/chunks/{chunk-SQKW3B6B.js → chunk-WIH522AP.js} +1 -1
  159. package/dist/cli/chunks/{chunk-KLTP5IDB.js → chunk-WOV6XI3A.js} +1 -1
  160. package/dist/cli/chunks/{chunk-VTOVWHEM.js → chunk-X7ADKL7T.js} +2 -2
  161. package/dist/cli/chunks/{chunk-SX4JLSLV.js → chunk-XBYQ2BS4.js} +2 -2
  162. package/dist/cli/chunks/{chunk-E4EYPYR3.js → chunk-XL5KIYE3.js} +2 -2
  163. package/dist/cli/chunks/{chunk-3VIXOHMS.js → chunk-XWYELBZS.js} +1 -1
  164. package/dist/cli/chunks/{chunk-YQGPQBCX.js → chunk-XYLQZWF6.js} +2 -2
  165. package/dist/cli/chunks/{chunk-XEZIIQYJ.js → chunk-Y6AKKQIQ.js} +1 -1
  166. package/dist/cli/chunks/{chunk-BJPL6THQ.js → chunk-YMW57PEL.js} +1 -1
  167. package/dist/cli/chunks/{chunk-JSZ663MU.js → chunk-YO4ESCB4.js} +1 -1
  168. package/dist/cli/chunks/{chunk-AMMQOV35.js → chunk-YRHTQZU4.js} +2 -2
  169. package/dist/cli/chunks/chunk-Z4Q5PCRZ.js +65 -0
  170. package/dist/cli/chunks/{chunk-RKOUXVZZ.js → chunk-ZELWDJXT.js} +2 -2
  171. package/dist/cli/chunks/{chunk-QRCIZFNK.js → chunk-ZQZD55MN.js} +2 -2
  172. package/dist/cli/chunks/{chunk-UMGFMKDW.js → chunk-ZS4XVJGV.js} +2 -2
  173. package/dist/cli/chunks/{chunk-6ITZZIQX.js → chunk-ZUB5YOCM.js} +2 -2
  174. package/dist/cli/chunks/chunk-ZUOVNFXK.js +2 -0
  175. package/dist/cli/chunks/{chunk-RGGK6VZ7.js → chunk-ZWEKAEEV.js} +1 -1
  176. package/dist/cli/chunks/{ci-RACDAJMR.js → ci-J3TDK5RA.js} +8 -8
  177. package/dist/cli/chunks/{ci-output-EHRSZBKG.js → ci-output-RLS32FUY.js} +2 -2
  178. package/dist/cli/chunks/{circuit-breaker-GBV7M5XG.js → circuit-breaker-MRCC7WCM.js} +2 -2
  179. package/dist/cli/chunks/claude-flow-setup-LIZCEKDF.js +2 -0
  180. package/dist/cli/chunks/client-3BD2DI4N.js +2 -0
  181. package/dist/cli/chunks/{cline-installer-W4NMXJSG.js → cline-installer-T7H6R2RC.js} +2 -2
  182. package/dist/cli/chunks/{code-JWXJMYXB.js → code-XMBLI7OF.js} +3 -3
  183. package/dist/cli/chunks/{code-index-extractor-RVI2IFTM.js → code-index-extractor-QS7BYLEX.js} +2 -2
  184. package/dist/cli/chunks/{codex-installer-3BORJINH.js → codex-installer-6PGT5FM6.js} +6 -6
  185. package/dist/cli/chunks/{completions-A55NCTAO.js → completions-2A3WRXY2.js} +2 -2
  186. package/dist/cli/chunks/{complexity-analyzer-JCXHGGLY.js → complexity-analyzer-23HOOGJ7.js} +2 -2
  187. package/dist/cli/chunks/{continuedev-installer-PUVFMGYW.js → continuedev-installer-4FSF7B3N.js} +2 -2
  188. package/dist/cli/chunks/{copilot-installer-4DCMYWHB.js → copilot-installer-A5GRQQUU.js} +2 -2
  189. package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +2 -0
  190. package/dist/cli/chunks/{cost-tracker-5TV2GGKY.js → cost-tracker-Z4STQ5VB.js} +2 -2
  191. package/dist/cli/chunks/{coverage-NNWM7TX3.js → coverage-NUPP6KZZ.js} +3 -3
  192. package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +2 -0
  193. package/dist/cli/chunks/{cursor-installer-4NCHGJGK.js → cursor-installer-FVJ7ROPJ.js} +2 -2
  194. package/dist/cli/chunks/{daemon-QIKCXKWO.js → daemon-7ZZA2MMN.js} +4 -4
  195. package/dist/cli/chunks/{daemon-T4JO4IXP.js → daemon-D662EX5N.js} +3 -3
  196. package/dist/cli/chunks/{dag-attention-scheduler-RPAAIDAD.js → dag-attention-scheduler-IB4TQ2KA.js} +2 -2
  197. package/dist/cli/chunks/{detect-SBEEVDSN.js → detect-LGLBZN4I.js} +2 -2
  198. package/dist/cli/chunks/{dist-node-ZHI6NCSU.js → dist-node-Z3OL42YE.js} +2 -2
  199. package/dist/cli/chunks/{domain-handler-LBC3GJ7Z.js → domain-handler-L3CLNL7U.js} +2 -2
  200. package/dist/cli/chunks/{domain-plugins-H6IZ5USZ.js → domain-plugins-GQ3V5X6L.js} +2 -2
  201. package/dist/cli/chunks/domain-transfer-MFCI76IY.js +2 -0
  202. package/dist/cli/chunks/dream-FTP33IJB.js +2 -0
  203. package/dist/cli/chunks/{embed-and-insert-pattern-AHTR7CRU.js → embed-and-insert-pattern-UGD6USYH.js} +2 -2
  204. package/dist/cli/chunks/{eval-DZU2KISM.js → eval-3B7UIYGY.js} +2 -2
  205. package/dist/cli/chunks/{experience-capture-middleware-5IQCWKSL.js → experience-capture-middleware-3RQ4NYY3.js} +3 -3
  206. package/dist/cli/chunks/{fast-paths-2KLDUWCY.js → fast-paths-QOSAEPYD.js} +2 -2
  207. package/dist/cli/chunks/{feature-flags-7AC3XDZA.js → feature-flags-3S5TH6P4.js} +2 -2
  208. package/dist/cli/chunks/{feature-flags-N6UAEZY4.js → feature-flags-TLF4NKOH.js} +2 -2
  209. package/dist/cli/chunks/{file-discovery-5SDIW4V2.js → file-discovery-AEVMJRNB.js} +2 -2
  210. package/dist/cli/chunks/{fleet-ZIQCAZ2Y.js → fleet-E6WTXWFL.js} +3 -3
  211. package/dist/cli/chunks/{gnn-wrapper-DUMBZJEV.js → gnn-wrapper-MCKH3AUU.js} +2 -2
  212. package/dist/cli/chunks/{heartbeat-handler-6HVM6ZMR.js → heartbeat-handler-U7XENHRR.js} +4 -4
  213. package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +2 -0
  214. package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +2 -0
  215. package/dist/cli/chunks/hnsw-index-MS5KODD7.js +2 -0
  216. package/dist/cli/chunks/{hnsw-legacy-bridge-5DRL5FLX.js → hnsw-legacy-bridge-5GW4SAEI.js} +2 -2
  217. package/dist/cli/chunks/{hnswlib-node-GW67GTCL.js → hnswlib-node-7BLZBK5T.js} +2 -2
  218. package/dist/cli/chunks/{hooks-QHH6FVO4.js → hooks-F3O2SB6H.js} +10 -10
  219. package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +2 -0
  220. package/dist/cli/chunks/{hypergraph-engine-7XDCCVG2.js → hypergraph-engine-PV4EKXHB.js} +2 -2
  221. package/dist/cli/chunks/{hypergraph-handler-QHF7NOU5.js → hypergraph-handler-VOWO5ZTW.js} +3 -3
  222. package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +2 -0
  223. package/dist/cli/chunks/{init-handler-5UIVOM7K.js → init-handler-ENJ5ONJX.js} +16 -14
  224. package/dist/cli/chunks/init-wizard-I5DFZUQL.js +2 -0
  225. package/dist/cli/chunks/kernel-MISPSPPA.js +2 -0
  226. package/dist/cli/chunks/{kilocode-installer-TGGV6K5Q.js → kilocode-installer-HNNJOOPE.js} +2 -2
  227. package/dist/cli/chunks/{kiro-installer-4XYBHZWW.js → kiro-installer-UZBIQ3IC.js} +2 -2
  228. package/dist/cli/chunks/knowledge-graph-L26JESGE.js +2 -0
  229. package/dist/cli/chunks/{learning-STE5W6BS.js → learning-YMLCVFUT.js} +3 -3
  230. package/dist/cli/chunks/{llm-router-NKF7J3RI.js → llm-router-YWTARCCT.js} +4 -4
  231. package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +2 -0
  232. package/dist/cli/chunks/{load-B2T77UJQ.js → load-DKE3F3IP.js} +2 -2
  233. package/dist/cli/chunks/load-test-H5ISNNM5.js +2 -0
  234. package/dist/cli/chunks/mcp-5PSGIUCW.js +2 -0
  235. package/dist/cli/chunks/{memory-WRFZKG56.js → memory-3L3O6JMM.js} +5 -5
  236. package/dist/cli/chunks/memory-backend-HWDNOBKW.js +2 -0
  237. package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +2 -0
  238. package/dist/cli/chunks/multi-model-executor-AEEO7IA4.js +14 -0
  239. package/dist/cli/chunks/{opencode-installer-J36EMQU7.js → opencode-installer-ABBO355U.js} +2 -2
  240. package/dist/cli/chunks/orchestrator-E36Q7MKE.js +393 -0
  241. package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +2 -0
  242. package/dist/cli/chunks/{pattern-usage-recorder-BVMTWI3E.js → pattern-usage-recorder-H4XKSID4.js} +2 -2
  243. package/dist/cli/chunks/{pipeline-OWAHDUAQ.js → pipeline-BGFEHXIN.js} +2 -2
  244. package/dist/cli/chunks/{platform-ANGBFWBV.js → platform-GK7ZVDJI.js} +2 -2
  245. package/dist/cli/chunks/{plugin-OO7ON2YW.js → plugin-CAH2CKI6.js} +2 -2
  246. package/dist/cli/chunks/{prime-radiant-advanced-wasm-HFG3BXWU.js → prime-radiant-advanced-wasm-M5EYRONA.js} +2 -2
  247. package/dist/cli/chunks/{project-root-LNOYVTYY.js → project-root-BSNZC243.js} +2 -2
  248. package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +2 -0
  249. package/dist/cli/chunks/{protocol-handler-CE3Q6LY4.js → protocol-handler-JDSSC2SF.js} +2 -2
  250. package/dist/cli/chunks/{prove-7XPN53PY.js → prove-ANPTOZJE.js} +2 -2
  251. package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +2 -0
  252. package/dist/cli/chunks/{quality-TT23JRFX.js → quality-SXWGYRQR.js} +2 -2
  253. package/dist/cli/chunks/{quality-gate-PPPRP255.js → quality-gate-GYNCA4ZY.js} +3 -3
  254. package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +2 -0
  255. package/dist/cli/chunks/{real-embeddings-EYNZIFJE.js → real-embeddings-WSRYAOZM.js} +2 -2
  256. package/dist/cli/chunks/{ref-validation-QQR64ZXD.js → ref-validation-AZ3LRWEK.js} +2 -2
  257. package/dist/cli/chunks/{roocode-installer-UIGS7ZJD.js → roocode-installer-2QKGFIEU.js} +2 -2
  258. package/dist/cli/chunks/router-MTP5LH4H.js +2 -0
  259. package/dist/cli/chunks/routing-feedback-GWETVB4L.js +2 -0
  260. package/dist/cli/chunks/{routing-handler-6AENUIRG.js → routing-handler-UYDC5MMD.js} +2 -2
  261. package/dist/cli/chunks/{ruvector-commands-5AWMEV34.js → ruvector-commands-QXADPVEY.js} +2 -2
  262. package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +2 -0
  263. package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +2 -0
  264. package/dist/cli/chunks/{rvf-migration-coordinator-NWRJ7C22.js → rvf-migration-coordinator-GD4NBFKT.js} +2 -2
  265. package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +2 -0
  266. package/dist/cli/chunks/{rvf-store-integrity-ISKRP563.js → rvf-store-integrity-7SXG66IL.js} +2 -2
  267. package/dist/cli/chunks/safe-db-FWWGAPVE.js +2 -0
  268. package/dist/cli/chunks/schedule-TPA4V4D5.js +2 -0
  269. package/dist/cli/chunks/scheduler-5ZTEPNDD.js +2 -0
  270. package/dist/cli/chunks/{security-325A7FMB.js → security-YKB622PK.js} +3 -3
  271. package/dist/cli/chunks/shared-rvf-adapter-KMLAV7JK.js +2 -0
  272. package/dist/cli/chunks/{shared-rvf-dual-writer-THFDYS2Z.js → shared-rvf-dual-writer-OYY27DFV.js} +2 -2
  273. package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +2 -0
  274. package/dist/cli/chunks/{standalone-memory-UD4MJ6GZ.js → standalone-memory-2DOABVLC.js} +2 -2
  275. package/dist/cli/chunks/{status-handler-CPFTN4XL.js → status-handler-EXRKETV7.js} +2 -2
  276. package/dist/cli/chunks/{structural-health-2MG2IVBL.js → structural-health-2SKK6DU6.js} +2 -2
  277. package/dist/cli/chunks/sync-DQ2YUNI6.js +2 -0
  278. package/dist/cli/chunks/{sync-EE4VVKOW.js → sync-UW7SX7GO.js} +2 -2
  279. package/dist/cli/chunks/{task-handler-7H5OYJG4.js → task-handler-LYQ6WYUY.js} +2 -2
  280. package/dist/cli/chunks/task-handlers-DIJO232S.js +9 -0
  281. package/dist/cli/chunks/test-WRHZMUCW.js +33 -0
  282. package/dist/cli/chunks/{test-scheduling-CHQ4ZLLJ.js → test-scheduling-HI23RXFK.js} +3 -3
  283. package/dist/cli/chunks/token-bootstrap-23SA6SWZ.js +2 -0
  284. package/dist/cli/chunks/{token-usage-EBXUJNRB.js → token-usage-M7RRDPXO.js} +2 -2
  285. package/dist/cli/chunks/{transformers-ZEKS2OJZ.js → transformers-4TC35KKS.js} +2 -2
  286. package/dist/cli/chunks/tree-sitter-wasm-parser-F4LTKAWD.js +2 -0
  287. package/dist/cli/chunks/{types-KYAA5VLV.js → types-NBXV6LXQ.js} +2 -2
  288. package/dist/cli/chunks/unified-memory-OVFEPRPS.js +2 -0
  289. package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +2 -0
  290. package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +2 -0
  291. package/dist/cli/chunks/{upgrade-UJBJ5AYM.js → upgrade-4BGOU5RM.js} +2 -2
  292. package/dist/cli/chunks/{validate-RUV6YMWS.js → validate-EDWAR63H.js} +2 -2
  293. package/dist/cli/chunks/{validate-swarm-IVEVMGVM.js → validate-swarm-VI72CPR7.js} +2 -2
  294. package/dist/cli/chunks/visual-security-2FUM5GLI.js +2 -0
  295. package/dist/cli/chunks/{web-tree-sitter-AVWA6HKE.js → web-tree-sitter-Y5XBRQXF.js} +2 -2
  296. package/dist/cli/chunks/{windsurf-installer-DAH7HI2W.js → windsurf-installer-VEX23WAF.js} +2 -2
  297. package/dist/cli/chunks/witness-chain-3YNL6YGY.js +2 -0
  298. package/dist/cli/chunks/witness-chain-MH6GA5L6.js +2 -0
  299. package/dist/cli/chunks/witness-chain-repair-MJZGZRWT.js +2 -0
  300. package/dist/cli/chunks/witness-chain-verifier-TTJYXTBE.js +2 -0
  301. package/dist/cli/chunks/{witness-key-manager-JSTBMG43.js → witness-key-manager-EM6YXYOY.js} +2 -2
  302. package/dist/cli/chunks/{workflow-TWOIA6LZ.js → workflow-2RBDOM7V.js} +4 -4
  303. package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +2 -0
  304. package/dist/cli/chunks/wrappers-5OTAVVOV.js +2 -0
  305. package/dist/cli/commands/audit.d.ts +20 -2
  306. package/dist/cli/commands/audit.js +158 -16
  307. package/dist/cli/commands/ci.js +1 -1
  308. package/dist/cli/commands/claude-flow-setup.js +5 -4
  309. package/dist/cli/commands/test.js +18 -3
  310. package/dist/cli/handlers/init-handler.d.ts +2 -0
  311. package/dist/cli/handlers/init-handler.js +8 -2
  312. package/dist/cli/index.js +10 -1
  313. package/dist/coordination/handlers/test-execution-handlers.js +13 -8
  314. package/dist/coordination/index.d.ts +1 -1
  315. package/dist/coordination/queen-event-handlers.js +9 -6
  316. package/dist/coordination/result-saver.js +1 -1
  317. package/dist/coordination/services/index.d.ts +1 -1
  318. package/dist/coordination/services/task-audit-logger.d.ts +38 -13
  319. package/dist/coordination/services/task-audit-logger.js +33 -5
  320. package/dist/coordination/task-executor.d.ts +5 -0
  321. package/dist/coordination/task-executor.js +10 -5
  322. package/dist/domains/test-generation/coordinator.js +6 -5
  323. package/dist/domains/test-generation/interfaces.d.ts +11 -1
  324. package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
  325. package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
  326. package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
  327. package/dist/domains/test-generation/services/behavior-examples.js +65 -0
  328. package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
  329. package/dist/domains/test-generation/services/test-generator.js +59 -30
  330. package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
  331. package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
  332. package/dist/init/agents-installer.d.ts +4 -0
  333. package/dist/init/agents-installer.js +24 -11
  334. package/dist/init/browser-engine-installer.d.ts +5 -5
  335. package/dist/init/browser-engine-installer.js +28 -6
  336. package/dist/init/codex-installer.js +4 -2
  337. package/dist/init/idempotent-write.d.ts +53 -0
  338. package/dist/init/idempotent-write.js +160 -0
  339. package/dist/init/init-wizard.d.ts +2 -0
  340. package/dist/init/orchestrator.js +1 -0
  341. package/dist/init/phases/05-learning.js +3 -1
  342. package/dist/init/phases/07-hooks.js +32 -16
  343. package/dist/init/phases/08-mcp.js +4 -2
  344. package/dist/init/phases/09-assets.js +8 -18
  345. package/dist/init/phases/10-workers.js +7 -5
  346. package/dist/init/phases/12-verification.js +7 -2
  347. package/dist/init/phases/phase-interface.d.ts +2 -0
  348. package/dist/init/project-analyzer.d.ts +9 -0
  349. package/dist/init/project-analyzer.js +20 -1
  350. package/dist/init/self-configurator.d.ts +5 -3
  351. package/dist/init/self-configurator.js +18 -29
  352. package/dist/init/skills-installer.js +4 -2
  353. package/dist/init/types.d.ts +6 -0
  354. package/dist/init/types.js +20 -24
  355. package/dist/integrations/agentic-flow/reasoning-bank/index.d.ts +2 -5
  356. package/dist/integrations/coherence/coherence-service.js +84 -24
  357. package/dist/integrations/coherence/vote-tally.d.ts +38 -0
  358. package/dist/integrations/coherence/vote-tally.js +39 -0
  359. package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +23 -0
  360. package/dist/integrations/ruvector/shared-rvf-adapter.js +24 -0
  361. package/dist/integrations/vibium/client.d.ts +1 -0
  362. package/dist/integrations/vibium/client.js +24 -11
  363. package/dist/integrations/vibium/runtime.d.ts +14 -0
  364. package/dist/integrations/vibium/runtime.js +94 -0
  365. package/dist/kernel/kernel.js +3 -2
  366. package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
  367. package/dist/kernel/pattern-fts-self-heal.js +193 -0
  368. package/dist/kernel/process-lifecycle.d.ts +60 -0
  369. package/dist/kernel/process-lifecycle.js +91 -0
  370. package/dist/kernel/unified-memory-schemas.d.ts +15 -1
  371. package/dist/kernel/unified-memory-schemas.js +53 -25
  372. package/dist/kernel/unified-memory.js +31 -34
  373. package/dist/kernel/unified-persistence.js +12 -6
  374. package/dist/learning/experience-capture.d.ts +2 -1
  375. package/dist/learning/experience-capture.js +23 -8
  376. package/dist/learning/pattern-store.d.ts +12 -1
  377. package/dist/learning/pattern-store.js +45 -30
  378. package/dist/learning/qe-patterns.d.ts +12 -0
  379. package/dist/learning/qe-patterns.js +7 -1
  380. package/dist/learning/qe-reasoning-bank.d.ts +1 -0
  381. package/dist/learning/qe-reasoning-bank.js +17 -4
  382. package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
  383. package/dist/learning/real-qe-reasoning-bank.js +28 -4
  384. package/dist/learning/rvf-pattern-store.js +36 -23
  385. package/dist/learning/sqlite-persistence.d.ts +8 -1
  386. package/dist/learning/sqlite-persistence.js +58 -33
  387. package/dist/logging/console-logger.d.ts +2 -5
  388. package/dist/logging/console-logger.js +10 -46
  389. package/dist/logging/index.d.ts +2 -0
  390. package/dist/logging/index.js +1 -0
  391. package/dist/logging/redaction.d.ts +27 -0
  392. package/dist/logging/redaction.js +170 -0
  393. package/dist/mcp/bundle.js +522 -545
  394. package/dist/mcp/entry.js +52 -6
  395. package/dist/mcp/handlers/core-handlers.js +5 -4
  396. package/dist/mcp/handlers/domain-handler-configs.js +12 -4
  397. package/dist/mcp/handlers/task-handlers.js +11 -7
  398. package/dist/mcp/protocol-server.js +20 -4
  399. package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
  400. package/dist/mcp/services/reasoning-bank-service.js +5 -1
  401. package/dist/mcp/tools/base.d.ts +9 -2
  402. package/dist/mcp/tools/base.js +7 -0
  403. package/dist/mcp/tools/coherence/consensus.js +51 -2
  404. package/dist/mcp/tools/planning/goap-plan.d.ts +20 -7
  405. package/dist/mcp/tools/planning/goap-plan.js +92 -20
  406. package/dist/mcp/tools/planning/goap-status.d.ts +37 -12
  407. package/dist/mcp/tools/planning/goap-status.js +52 -23
  408. package/dist/mcp/tools/planning/world-state.d.ts +101 -0
  409. package/dist/mcp/tools/planning/world-state.js +274 -0
  410. package/dist/mcp/tools/test-execution/e2e-execute.js +9 -1
  411. package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
  412. package/dist/mcp/tools/test-generation/generate.js +8 -0
  413. package/dist/mcp/types.d.ts +10 -4
  414. package/dist/planning/goap-planner.d.ts +60 -4
  415. package/dist/planning/goap-planner.js +218 -60
  416. package/dist/planning/index.d.ts +1 -1
  417. package/dist/planning/index.js +1 -1
  418. package/dist/planning/plan-executor.d.ts +20 -1
  419. package/dist/planning/plan-executor.js +209 -100
  420. package/dist/planning/types.d.ts +16 -0
  421. package/dist/planning/types.js +17 -0
  422. package/dist/shared/error-utils.d.ts +15 -0
  423. package/dist/shared/error-utils.js +21 -0
  424. package/dist/shared/events/domain-events.d.ts +2 -1
  425. package/package.json +10 -6
  426. package/dist/cli/chunks/adapter-IYC62SXA.js +0 -2
  427. package/dist/cli/chunks/agent-booster-wasm-EDNKP3SP.js +0 -2
  428. package/dist/cli/chunks/aqe-learning-engine-LLOU2IXD.js +0 -2
  429. package/dist/cli/chunks/audit-CVZQMF55.js +0 -3
  430. package/dist/cli/chunks/base-P3Z4IKCT.js +0 -2
  431. package/dist/cli/chunks/browser-workflow-YYHQQ25X.js +0 -2
  432. package/dist/cli/chunks/chunk-3EZ5DR2R.js +0 -21
  433. package/dist/cli/chunks/chunk-5WOSWNDN.js +0 -2
  434. package/dist/cli/chunks/chunk-7CD7PBHY.js +0 -3
  435. package/dist/cli/chunks/chunk-7X7JYWT4.js +0 -27
  436. package/dist/cli/chunks/chunk-CZO4BJG5.js +0 -2
  437. package/dist/cli/chunks/chunk-J27F4NSB.js +0 -2
  438. package/dist/cli/chunks/chunk-J5UNP6W3.js +0 -2
  439. package/dist/cli/chunks/chunk-MI5Q55DG.js +0 -65
  440. package/dist/cli/chunks/chunk-TY5WC3FT.js +0 -12
  441. package/dist/cli/chunks/chunk-UDHVCKGA.js +0 -5
  442. package/dist/cli/chunks/chunk-XQSIRBKT.js +0 -180
  443. package/dist/cli/chunks/chunk-YXP6BKGS.js +0 -730
  444. package/dist/cli/chunks/chunk-ZBABIZ2D.js +0 -2
  445. package/dist/cli/chunks/chunk-ZCWERUYB.js +0 -12
  446. package/dist/cli/chunks/claude-flow-setup-5LVJOFKP.js +0 -2
  447. package/dist/cli/chunks/client-HUVFA5PF.js +0 -2
  448. package/dist/cli/chunks/core-handlers-UEXO3VAA.js +0 -2
  449. package/dist/cli/chunks/cross-domain-router-ODU5IZD6.js +0 -2
  450. package/dist/cli/chunks/domain-transfer-JZA5TMW3.js +0 -2
  451. package/dist/cli/chunks/dream-HE3OX42F.js +0 -2
  452. package/dist/cli/chunks/heartbeat-scheduler-QUIFGGLX.js +0 -2
  453. package/dist/cli/chunks/hnsw-adapter-42KB37KP.js +0 -2
  454. package/dist/cli/chunks/hnsw-index-T2PGO77J.js +0 -2
  455. package/dist/cli/chunks/hybrid-backend-FRNWYRKH.js +0 -2
  456. package/dist/cli/chunks/impact-analyzer-A5QYOYBR.js +0 -2
  457. package/dist/cli/chunks/init-wizard-XBU674YH.js +0 -2
  458. package/dist/cli/chunks/kernel-DV5MTNZD.js +0 -2
  459. package/dist/cli/chunks/knowledge-graph-4ACGVJQK.js +0 -2
  460. package/dist/cli/chunks/llm-router-service-PSMASERT.js +0 -2
  461. package/dist/cli/chunks/load-test-MRUO2VPF.js +0 -2
  462. package/dist/cli/chunks/mcp-JGSFCEMH.js +0 -2
  463. package/dist/cli/chunks/memory-backend-2MPGI6JW.js +0 -2
  464. package/dist/cli/chunks/memory-handlers-XT4HMITB.js +0 -2
  465. package/dist/cli/chunks/multi-model-executor-26Q5BSVG.js +0 -14
  466. package/dist/cli/chunks/orchestrator-D5IFV65I.js +0 -393
  467. package/dist/cli/chunks/pattern-null-store-TGWUL237.js +0 -2
  468. package/dist/cli/chunks/protocol-executor-GEVH5KD6.js +0 -2
  469. package/dist/cli/chunks/qe-reasoning-bank-DJ2JL6QB.js +0 -2
  470. package/dist/cli/chunks/queen-coordinator-F7E3AS26.js +0 -2
  471. package/dist/cli/chunks/router-OZH3QSAU.js +0 -2
  472. package/dist/cli/chunks/routing-feedback-J2E3ADZB.js +0 -2
  473. package/dist/cli/chunks/rvf-dual-writer-HK525Y5Y.js +0 -2
  474. package/dist/cli/chunks/rvf-migration-adapter-Q7FB3BKR.js +0 -2
  475. package/dist/cli/chunks/rvf-native-adapter-5ZRCGUI6.js +0 -2
  476. package/dist/cli/chunks/safe-db-3OYEPVEH.js +0 -2
  477. package/dist/cli/chunks/schedule-AG4C2EIQ.js +0 -2
  478. package/dist/cli/chunks/scheduler-SQS2CZFZ.js +0 -2
  479. package/dist/cli/chunks/shared-rvf-adapter-NFL6QSZ6.js +0 -2
  480. package/dist/cli/chunks/sqlite-persistence-MAKDFSHC.js +0 -2
  481. package/dist/cli/chunks/sync-MBTW5XBF.js +0 -2
  482. package/dist/cli/chunks/task-handlers-NH4GJHCJ.js +0 -9
  483. package/dist/cli/chunks/test-MPHGT4T6.js +0 -33
  484. package/dist/cli/chunks/token-bootstrap-SSDCYEKK.js +0 -2
  485. package/dist/cli/chunks/tree-sitter-wasm-parser-J6ZMAK37.js +0 -2
  486. package/dist/cli/chunks/unified-memory-DDWMC435.js +0 -2
  487. package/dist/cli/chunks/unified-memory-hnsw-4JA7SGBK.js +0 -2
  488. package/dist/cli/chunks/unified-persistence-F6OSNTXY.js +0 -2
  489. package/dist/cli/chunks/vibium-HOGMFJ2Z.js +0 -2
  490. package/dist/cli/chunks/visual-security-25SMBIYT.js +0 -2
  491. package/dist/cli/chunks/witness-chain-PJOQPFUX.js +0 -2
  492. package/dist/cli/chunks/witness-chain-ZW6KKUZU.js +0 -2
  493. package/dist/cli/chunks/workflow-orchestrator-UKSIDM7Q.js +0 -2
  494. package/dist/cli/chunks/wrappers-UR7BLXKV.js +0 -2
@@ -940,7 +940,7 @@
940
940
  },
941
941
  "metadata": {
942
942
  "generatedBy": "Agentic QE Fleet",
943
- "fleetVersion": "3.14.5",
943
+ "fleetVersion": "3.14.7",
944
944
  "manifestVersion": "1.4.0",
945
945
  "lastUpdated": "2026-04-13T00:00:00.000Z",
946
946
  "contributors": [
package/CHANGELOG.md CHANGED
@@ -5,6 +5,156 @@ All notable changes to the Agentic QE project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [3.14.7] - 2026-10-02
9
+
10
+ This patch makes browser setup opt-in, so installing AQE no longer downloads
11
+ Chrome. The MCP server now always shuts down cleanly: it releases its pattern
12
+ store lock and closes the learning database however it is stopped. Pattern
13
+ search uses keyword and vector matching together, with a keyword index that
14
+ repairs itself. Test generation can build real assertions from examples you
15
+ supply, and no longer guesses expected values.
16
+
17
+ ### Changed
18
+
19
+ - **Browser setup is now opt-in.** `npm install agentic-qe` and `aqe init` no
20
+ longer install Vibium or download a browser. Run
21
+ `aqe init --browser-engine` when you need browser-based testing (visual,
22
+ accessibility, e2e). Vibium 26.8.21 is now an optional peer dependency, and
23
+ `--no-browser-engine` skips browser setup explicitly. Existing installs are
24
+ not affected ([#797], [#812]).
25
+ - **Test generation no longer guesses expected values.** Without examples and
26
+ without an LLM, `test_generate_enhanced` and `aqe test generate` produce a
27
+ clearly marked, skipped scaffold instead of generic assertions such as
28
+ `toBeDefined()`. The coverage estimate is reported as unmeasured rather than
29
+ as an invented percentage ([#795]).
30
+ - `aqe test generate` now exits with code 1 when generation is rejected, for
31
+ example when an example names a function the file doesn't export. CI scripts
32
+ can rely on the exit code ([#811]).
33
+ - Pattern search for routing and `task_orchestrate` uses keyword (FTS5) and
34
+ vector matching together. Pattern hints now report `similarity`, `score`,
35
+ `matchType` and `canReuse`, so you can see why a pattern matched. An
36
+ experience reinforces an existing pattern only when it describes the same
37
+ task, so unrelated tasks no longer strengthen each other's patterns ([#796]).
38
+
39
+ ### Added
40
+
41
+ - Behavior examples for test generation: pass `behaviorExamples` to
42
+ `test_generate_enhanced`, or `--behavior-examples <file>` to
43
+ `aqe test generate`. Each example gives a function, its arguments and the
44
+ expected result. The generated assertions come only from those examples
45
+ (Vitest, Jest and Node's test runner). See
46
+ `docs/test-generation/deterministic-examples.md` ([#795]).
47
+ - The task audit log reports whether its retained window is complete or
48
+ truncated, with recorded, retained and dropped counts, through the new
49
+ `getSnapshot()` and in `getStatistics()` ([#803]).
50
+
51
+ ### Fixed
52
+
53
+ - The MCP server releases `patterns.rvf.lock` and closes the learning database
54
+ cleanly on every kind of shutdown: input stream closed, JSON-RPC `shutdown`,
55
+ SIGTERM/SIGINT, and the shutdown watchdog. This holds for both `aqe-mcp` and
56
+ `aqe mcp`. Previously the lock was left behind, so the next start had to
57
+ recover a stale lock, and the database's write-ahead log was not
58
+ checkpointed ([#802], [#808]).
59
+ - The learning database repairs its keyword search index when it opens.
60
+ Databases whose sync triggers had gone missing kept a stale index: patterns
61
+ added later were invisible to keyword search, and deleted ones still matched.
62
+ The repair recreates the triggers and rebuilds the index without changing
63
+ any stored patterns. Read-only opens are skipped ([#809]).
64
+ - Invalid behavior examples are rejected with a clear error before any work
65
+ starts, and no longer trip the test-generation circuit breaker. Previously
66
+ two bad requests could block test generation for everyone on that MCP
67
+ server for about 30 seconds ([#795]).
68
+ - Updated `brace-expansion` and `@grpc/grpc-js` in the development dependency
69
+ tree ([#806]).
70
+
71
+ [#795]: https://github.com/proffesor-for-testing/agentic-qe/pull/795
72
+ [#796]: https://github.com/proffesor-for-testing/agentic-qe/pull/796
73
+ [#797]: https://github.com/proffesor-for-testing/agentic-qe/pull/797
74
+ [#802]: https://github.com/proffesor-for-testing/agentic-qe/pull/802
75
+ [#803]: https://github.com/proffesor-for-testing/agentic-qe/pull/803
76
+ [#806]: https://github.com/proffesor-for-testing/agentic-qe/pull/806
77
+ [#808]: https://github.com/proffesor-for-testing/agentic-qe/pull/808
78
+ [#809]: https://github.com/proffesor-for-testing/agentic-qe/pull/809
79
+ [#811]: https://github.com/proffesor-for-testing/agentic-qe/pull/811
80
+ [#812]: https://github.com/proffesor-for-testing/agentic-qe/pull/812
81
+
82
+ ## [3.14.6] - 2026-09-29
83
+
84
+ This patch fixes an `aqe audit verify` crash on stores with no audit chain yet.
85
+ It adds `aqe audit repair` for stores forked by concurrent writers before
86
+ 3.14.5, makes repeat `aqe init --auto` runs leave an unchanged project
87
+ untouched, and makes GOAP planning work from the live fleet state. It also
88
+ redacts secrets from AQE's logs and lets keyword matches improve pattern
89
+ search.
90
+
91
+ ### Security
92
+
93
+ - Secrets are redacted from AQE's structured logs and from logged errors. This
94
+ covers API keys (`sk-ant-`, `sk-`, `ghp_`, `github_pat_`, `AKIA…`),
95
+ Bearer/Basic credentials, credentials in URLs, JWTs, PEM private keys,
96
+ cookies, and values under sensitive keys (`password`, `token`, `apiKey`,
97
+ `access_token`, …) in objects, JSON text and query strings. Command output
98
+ such as `aqe memory get` is not changed ([#789]).
99
+
100
+ ### Added
101
+
102
+ - `aqe audit verify --chain audit` now keeps checking past accidental forks
103
+ left by pre-3.14.5 concurrent writers, and reports them separately from
104
+ tampering (`status: "forked"`, `tampered: false`). The new
105
+ `aqe audit repair --chain audit [--dry-run]` acknowledges those forks with
106
+ one signed entry. It refuses if anything was tampered with, backs up the
107
+ database first, and never edits or deletes an existing row. Afterwards verify
108
+ passes again ([#784]).
109
+ - `goap_status {type:"plans"}` lists saved GOAP plans ([#791]).
110
+
111
+ ### Changed
112
+
113
+ - Running `aqe init --auto` again on an unchanged project no longer rewrites
114
+ generated files or creates `.claude/settings.json.backup`. Fresh and repeat
115
+ runs now produce the same settings: all 13 domains, and pattern promotion at
116
+ 3 successes / 0.7 success rate, which is what the learning runtime actually
117
+ enforces ([#783]).
118
+ - Keyword matches now contribute to pattern search alongside vector
119
+ similarity. A keyword-only hit is weighted by how many of the query's terms
120
+ it matches ([#779]).
121
+ - `qe_coherence_consensus` rejects malformed votes with a clear error. Only a
122
+ unanimous vote is flagged as possible false consensus, and every
123
+ recommendation states the real tally ([#781]).
124
+ - `goap_plan` rejects unknown constraint keys and supports
125
+ `constraints.maxSteps` ([#785]).
126
+
127
+ ### Fixed
128
+
129
+ - `aqe audit verify --chain audit` and `aqe audit repair --dry-run` no longer
130
+ crash with `SQLITE_READONLY` on a store that has no audit chain yet (for
131
+ example after `aqe init --minimal`) or on older stores without the archive
132
+ table. A store whose live chain was deleted while archived rows remain is
133
+ now reported as tampered instead of valid ([#788]).
134
+ - GOAP world state is read from the live fleet, and coverage from a coverage
135
+ report when one exists. Values it can't measure are reported as `null` with
136
+ `dataSource: "estimated"` instead of defaults labelled as real. Planning for
137
+ goals such as `achieve-90-percent-coverage` works again, and a plan can be
138
+ dry-run executed by its ID. A step whose domain call returns an error now
139
+ fails instead of being recorded as completed ([#785]).
140
+ - A repeat `fleet_init` reports the fleet settings actually in effect instead
141
+ of echoing the requested ones ([#790]).
142
+ - When another live process holds an RVF lock, AQE logs one clear warning and
143
+ falls back to SQLite, without a second, misleading `LockHeld` error ([#782]).
144
+ - Updated `ip-address` to 10.7.2 ([#776]).
145
+
146
+ [#776]: https://github.com/proffesor-for-testing/agentic-qe/pull/776
147
+ [#779]: https://github.com/proffesor-for-testing/agentic-qe/pull/779
148
+ [#781]: https://github.com/proffesor-for-testing/agentic-qe/pull/781
149
+ [#782]: https://github.com/proffesor-for-testing/agentic-qe/pull/782
150
+ [#783]: https://github.com/proffesor-for-testing/agentic-qe/pull/783
151
+ [#784]: https://github.com/proffesor-for-testing/agentic-qe/pull/784
152
+ [#785]: https://github.com/proffesor-for-testing/agentic-qe/pull/785
153
+ [#788]: https://github.com/proffesor-for-testing/agentic-qe/pull/788
154
+ [#789]: https://github.com/proffesor-for-testing/agentic-qe/pull/789
155
+ [#790]: https://github.com/proffesor-for-testing/agentic-qe/pull/790
156
+ [#791]: https://github.com/proffesor-for-testing/agentic-qe/pull/791
157
+
8
158
  ## [3.14.5] - 2026-09-29
9
159
 
10
160
  This patch makes Agentic QE's results trustworthy for scripts and CI: failed
@@ -940,7 +940,7 @@
940
940
  },
941
941
  "metadata": {
942
942
  "generatedBy": "Agentic QE Fleet",
943
- "fleetVersion": "3.14.5",
943
+ "fleetVersion": "3.14.7",
944
944
  "manifestVersion": "1.4.0",
945
945
  "lastUpdated": "2026-04-13T00:00:00.000Z",
946
946
  "contributors": [
@@ -366,7 +366,7 @@ export interface AQEToolResult<T = unknown> {
366
366
  readonly domain?: string;
367
367
  readonly taskId?: string;
368
368
  readonly toolName?: string;
369
- readonly dataSource?: 'real' | 'demo' | 'fallback';
369
+ readonly dataSource?: 'real' | 'demo' | 'fallback' | 'estimated';
370
370
  };
371
371
  }
372
372
  /**
@@ -0,0 +1,18 @@
1
+ /**
2
+ * Witness Chain hash primitives (ADR-070).
3
+ *
4
+ * Shared by the chain itself, its verifier and the brain-import audit writer
5
+ * so the link format can never drift between the code that writes a link and
6
+ * the code that checks it.
7
+ */
8
+ import type { WitnessEntry } from './witness-chain.js';
9
+ export declare const GENESIS_PREV_HASH: string;
10
+ export declare function sha256(data: string): string;
11
+ /** SHAKE-256 (32-byte output) with SHA-256 fallback for older Node.js runtimes. */
12
+ export declare function shake256(data: string): string;
13
+ export declare function hashWith(algo: string, data: string): string;
14
+ /** Serialize a WitnessEntry to a deterministic string (original 7-field format). */
15
+ export declare function serializeEntry(entry: WitnessEntry): string;
16
+ /** The bytes an Ed25519 witness signature covers (unchanged since ADR-070 Phase 6.2). */
17
+ export declare function signaturePayload(entry: Pick<WitnessEntry, 'prev_hash' | 'action_hash' | 'action_type' | 'timestamp' | 'actor'>): Buffer;
18
+ //# sourceMappingURL=witness-chain-hash.d.ts.map
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Witness Chain hash primitives (ADR-070).
3
+ *
4
+ * Shared by the chain itself, its verifier and the brain-import audit writer
5
+ * so the link format can never drift between the code that writes a link and
6
+ * the code that checks it.
7
+ */
8
+ import { createHash } from 'crypto';
9
+ export const GENESIS_PREV_HASH = '0'.repeat(64);
10
+ export function sha256(data) {
11
+ return createHash('sha256').update(data, 'utf-8').digest('hex');
12
+ }
13
+ /** SHAKE-256 (32-byte output) with SHA-256 fallback for older Node.js runtimes. */
14
+ export function shake256(data) {
15
+ try {
16
+ return createHash('shake256', { outputLength: 32 }).update(data, 'utf-8').digest('hex');
17
+ }
18
+ catch {
19
+ return sha256(data);
20
+ }
21
+ }
22
+ export function hashWith(algo, data) {
23
+ return algo === 'shake256' ? shake256(data) : sha256(data);
24
+ }
25
+ /** Serialize a WitnessEntry to a deterministic string (original 7-field format). */
26
+ export function serializeEntry(entry) {
27
+ return JSON.stringify({
28
+ id: entry.id, prev_hash: entry.prev_hash, action_hash: entry.action_hash,
29
+ action_type: entry.action_type, action_data: entry.action_data,
30
+ timestamp: entry.timestamp, actor: entry.actor,
31
+ });
32
+ }
33
+ /** The bytes an Ed25519 witness signature covers (unchanged since ADR-070 Phase 6.2). */
34
+ export function signaturePayload(entry) {
35
+ return Buffer.from(entry.prev_hash + entry.action_hash + entry.action_type + entry.timestamp + entry.actor, 'utf-8');
36
+ }
37
+ //# sourceMappingURL=witness-chain-hash.js.map
@@ -0,0 +1,71 @@
1
+ /**
2
+ * Witness Chain fork repair (re-anchor) — ADR-070, issue #753.
3
+ *
4
+ * Stores written before v3.14.5 can contain accidental forks from concurrent
5
+ * `append()` calls. `verify()` classifies them (witness-chain-verifier.ts) but
6
+ * keeps `valid: false` until they are acknowledged, so an existing consumer
7
+ * never sees a previously-broken store silently turn valid.
8
+ *
9
+ * Repair acknowledges them by appending ONE signed (when a key is available)
10
+ * `CHAIN_REANCHOR` entry that lists each unacknowledged fork row (id, parent
11
+ * id, prev_hash, action_hash), pins the hash of every dead-end row (the
12
+ * losing race siblings nothing else links to) and records the tip it verified.
13
+ * It:
14
+ *
15
+ * - refuses when any tamper-class break or signature failure exists;
16
+ * - backs up the database first (`VACUUM INTO <db>.bak-<epoch>`, taken while
17
+ * holding the write lock so it is exactly the state being modified) and
18
+ * checks the backup (integrity_check, witness row counts) before writing;
19
+ * - never deletes, moves or rewrites an existing row — history stays as-is
20
+ * and `verify()` still lists every fork (`status: 'valid-with-forks'`);
21
+ * - re-verifies, backs up and appends inside ONE `BEGIN IMMEDIATE`
22
+ * transaction, so no writer can slip a row in between;
23
+ * - checks row counts before/after (live +1, archive unchanged);
24
+ * - is idempotent: a second run finds nothing unacknowledged and writes nothing.
25
+ */
26
+ import { type Database as DatabaseType } from 'better-sqlite3';
27
+ import type { WitnessKeyManager } from './witness-key-manager.js';
28
+ import { type ChainStatus, type TamperReason } from './witness-chain-verifier.js';
29
+ export interface WitnessRowCounts {
30
+ live: number;
31
+ archive: number;
32
+ }
33
+ export interface VerifySummary {
34
+ status: ChainStatus;
35
+ entriesChecked: number;
36
+ forks: number;
37
+ unacknowledgedForks: number;
38
+ tamperedAt?: number;
39
+ tamperReason?: TamperReason;
40
+ }
41
+ export type RepairAction = 'none' | 'would-reanchor' | 'reanchored' | 'refused';
42
+ export interface RepairResult {
43
+ action: RepairAction;
44
+ dryRun: boolean;
45
+ message: string;
46
+ before: VerifySummary;
47
+ after?: VerifySummary;
48
+ rowsBefore: WitnessRowCounts;
49
+ rowsAfter: WitnessRowCounts;
50
+ /** Fork row ids this run acknowledged (or would, on a dry run). */
51
+ forksAcknowledged: number[];
52
+ reanchorId?: number;
53
+ backupPath?: string;
54
+ }
55
+ export interface RepairOptions {
56
+ /** Path of the database file `db` is opened on — the backup is written next to it. */
57
+ dbPath: string;
58
+ dryRun?: boolean;
59
+ /**
60
+ * Signs the CHAIN_REANCHOR row and verifies fork/re-anchor signatures.
61
+ * Pass a read-only (autoGenerate: false) manager for a dry run.
62
+ */
63
+ keyManager?: WitnessKeyManager | null;
64
+ actor?: string;
65
+ }
66
+ /**
67
+ * Re-anchor a witness chain whose only breaks are accidental forks.
68
+ * `db` must be a writable connection on `options.dbPath`.
69
+ */
70
+ export declare function repairWitnessChainForks(db: DatabaseType, options: RepairOptions): Promise<RepairResult>;
71
+ //# sourceMappingURL=witness-chain-repair.d.ts.map
@@ -0,0 +1,203 @@
1
+ /**
2
+ * Witness Chain fork repair (re-anchor) — ADR-070, issue #753.
3
+ *
4
+ * Stores written before v3.14.5 can contain accidental forks from concurrent
5
+ * `append()` calls. `verify()` classifies them (witness-chain-verifier.ts) but
6
+ * keeps `valid: false` until they are acknowledged, so an existing consumer
7
+ * never sees a previously-broken store silently turn valid.
8
+ *
9
+ * Repair acknowledges them by appending ONE signed (when a key is available)
10
+ * `CHAIN_REANCHOR` entry that lists each unacknowledged fork row (id, parent
11
+ * id, prev_hash, action_hash), pins the hash of every dead-end row (the
12
+ * losing race siblings nothing else links to) and records the tip it verified.
13
+ * It:
14
+ *
15
+ * - refuses when any tamper-class break or signature failure exists;
16
+ * - backs up the database first (`VACUUM INTO <db>.bak-<epoch>`, taken while
17
+ * holding the write lock so it is exactly the state being modified) and
18
+ * checks the backup (integrity_check, witness row counts) before writing;
19
+ * - never deletes, moves or rewrites an existing row — history stays as-is
20
+ * and `verify()` still lists every fork (`status: 'valid-with-forks'`);
21
+ * - re-verifies, backs up and appends inside ONE `BEGIN IMMEDIATE`
22
+ * transaction, so no writer can slip a row in between;
23
+ * - checks row counts before/after (live +1, archive unchanged);
24
+ * - is idempotent: a second run finds nothing unacknowledged and writes nothing.
25
+ */
26
+ import { existsSync } from 'node:fs';
27
+ import { basename } from 'node:path';
28
+ import { openDatabase } from '../shared/safe-db.js';
29
+ import { WitnessChain } from './witness-chain.js';
30
+ import { sha256, shake256, serializeEntry } from './witness-chain-hash.js';
31
+ import { ownHash, tableExists, } from './witness-chain-verifier.js';
32
+ const VERIFY_OPTIONS = { includeArchive: true };
33
+ function countRows(db) {
34
+ const n = (table) => (tableExists(db, table)
35
+ ? db.prepare(`SELECT COUNT(*) AS n FROM ${table}`).get().n
36
+ : 0);
37
+ return { live: n('witness_chain'), archive: n('witness_chain_archive') };
38
+ }
39
+ function summarize(r) {
40
+ return {
41
+ status: r.status,
42
+ entriesChecked: r.entriesChecked,
43
+ forks: r.forks.length,
44
+ unacknowledgedForks: r.forks.length - r.acknowledgedForks.length,
45
+ ...(r.tamperedAt !== undefined ? { tamperedAt: r.tamperedAt } : {}),
46
+ ...(r.tamperReason ? { tamperReason: r.tamperReason } : {}),
47
+ };
48
+ }
49
+ function unacknowledged(r) {
50
+ return r.forkDetails.filter((f) => !f.acknowledged)
51
+ .map(({ id, parentId, prevHash, actionHash }) => ({ id, parentId, prevHash, actionHash }));
52
+ }
53
+ /**
54
+ * Dead-end rows: every row except the tip whose hash no row's prev_hash
55
+ * references — the losing sibling of each race. Nothing else vouches for
56
+ * their content, so the re-anchor pins it. (Checked under both hash algos,
57
+ * since a child hashes its parent with the CHILD's algorithm.)
58
+ */
59
+ function deadEndPins(db, tipId) {
60
+ const referenced = new Set();
61
+ const prevs = db.prepare('SELECT prev_hash FROM witness_chain UNION ALL SELECT prev_hash FROM witness_chain_archive').pluck().iterate();
62
+ for (const h of prevs)
63
+ referenced.add(h);
64
+ const pins = [];
65
+ const seen = new Set();
66
+ for (const table of ['witness_chain', 'witness_chain_archive']) {
67
+ const rows = db.prepare(`SELECT * FROM ${table} ORDER BY id ASC`).iterate();
68
+ for (const row of rows) {
69
+ if (row.id === tipId || seen.has(row.id))
70
+ continue;
71
+ seen.add(row.id);
72
+ const ser = serializeEntry(row);
73
+ if (!referenced.has(shake256(ser)) && !referenced.has(sha256(ser)))
74
+ pins.push({ id: row.id, hash: ownHash(row) });
75
+ }
76
+ }
77
+ return pins.sort((a, b) => a.id - b.id);
78
+ }
79
+ function refusal(r) {
80
+ return `Refusing to repair: tampering detected at id=${r.tamperedAt} (${r.tamperReason}). ` +
81
+ 'Only accidental forks can be re-anchored; restore from a backup and investigate.';
82
+ }
83
+ function nextBackupPath(dbPath) {
84
+ const base = `${dbPath}.bak-${Math.floor(Date.now() / 1000)}`;
85
+ if (!existsSync(base))
86
+ return base;
87
+ let i = 1;
88
+ while (existsSync(`${base}-${i}`))
89
+ i++;
90
+ return `${base}-${i}`;
91
+ }
92
+ /**
93
+ * Snapshot the database with VACUUM INTO from a SECOND, read-only connection.
94
+ * Called while the repairing connection holds the write lock (BEGIN IMMEDIATE)
95
+ * and before it writes anything, so the snapshot is exactly the state about to
96
+ * be modified: no other process can commit in between (issue found in review).
97
+ * The backup must then open clean and hold exactly `expected` witness rows.
98
+ */
99
+ function backupDatabase(dbPath, expected) {
100
+ const backupPath = nextBackupPath(dbPath);
101
+ const reader = openDatabase(dbPath, { readonly: true, fileMustExist: true });
102
+ try {
103
+ reader.prepare('VACUUM INTO ?').run(backupPath);
104
+ }
105
+ finally {
106
+ reader.close();
107
+ }
108
+ const copy = openDatabase(backupPath, { readonly: true, fileMustExist: true });
109
+ try {
110
+ const check = copy.pragma('integrity_check', { simple: true });
111
+ if (check !== 'ok')
112
+ throw new Error(`backup integrity_check failed: ${String(check)}`);
113
+ const counts = countRows(copy);
114
+ if (counts.live !== expected.live || counts.archive !== expected.archive) {
115
+ throw new Error(`backup holds ${JSON.stringify(counts)} witness rows, expected ${JSON.stringify(expected)}`);
116
+ }
117
+ }
118
+ finally {
119
+ copy.close();
120
+ }
121
+ return backupPath;
122
+ }
123
+ /**
124
+ * Re-anchor a witness chain whose only breaks are accidental forks.
125
+ * `db` must be a writable connection on `options.dbPath`.
126
+ */
127
+ export async function repairWitnessChainForks(db, options) {
128
+ const dryRun = options.dryRun === true;
129
+ const chain = new WitnessChain(db, options.keyManager ?? undefined);
130
+ await chain.initialize();
131
+ const rowsBefore = countRows(db);
132
+ const before = chain.verify(VERIFY_OPTIONS);
133
+ const base = { dryRun, before: summarize(before), rowsBefore, rowsAfter: rowsBefore };
134
+ if (before.tampered) {
135
+ return { ...base, action: 'refused', message: refusal(before), forksAcknowledged: [] };
136
+ }
137
+ const pending = unacknowledged(before);
138
+ if (pending.length === 0) {
139
+ const message = before.forks.length > 0
140
+ ? `Nothing to repair: all ${before.forks.length} fork(s) are already re-anchored.`
141
+ : 'Nothing to repair: the audit chain has no forks.';
142
+ return { ...base, action: 'none', message, forksAcknowledged: [] };
143
+ }
144
+ if (dryRun) {
145
+ return {
146
+ ...base, action: 'would-reanchor', forksAcknowledged: pending.map((f) => f.id),
147
+ message: `Dry run: would back up the database and append a CHAIN_REANCHOR entry acknowledging ${pending.length} fork(s). Nothing was written.`,
148
+ };
149
+ }
150
+ // Re-verify, back up and append under ONE write lock: nothing can land
151
+ // between the check, the snapshot and the write.
152
+ let backupPath;
153
+ const reanchor = db.transaction(() => {
154
+ const txBefore = countRows(db);
155
+ const check = chain.verify(VERIFY_OPTIONS);
156
+ if (check.tampered)
157
+ return { kind: 'refused', check };
158
+ const forks = unacknowledged(check);
159
+ if (forks.length === 0)
160
+ return { kind: 'noop' };
161
+ backupPath = backupDatabase(options.dbPath, txBefore);
162
+ const tip = db.prepare('SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1').get();
163
+ const entry = chain.append('CHAIN_REANCHOR', {
164
+ reason: 'fork-repair',
165
+ issue: 'https://github.com/proffesor-for-testing/agentic-qe/issues/753',
166
+ note: 'Acknowledges accidental forks from pre-3.14.5 concurrent appends; no rows were changed.',
167
+ forkCount: forks.length,
168
+ forks,
169
+ pins: deadEndPins(db, tip.id),
170
+ verifiedTipId: tip.id,
171
+ verifiedTipHash: ownHash(tip),
172
+ entriesChecked: check.entriesChecked,
173
+ rows: txBefore,
174
+ backup: basename(backupPath),
175
+ }, options.actor ?? 'aqe-audit-repair');
176
+ const txAfter = countRows(db);
177
+ if (txAfter.live !== txBefore.live + 1 || txAfter.archive !== txBefore.archive) {
178
+ throw new Error(`row-count check failed: before ${JSON.stringify(txBefore)}, after ${JSON.stringify(txAfter)}`);
179
+ }
180
+ return { kind: 'reanchored', entry, forks, txAfter };
181
+ }).immediate();
182
+ if (reanchor.kind === 'refused') {
183
+ return { ...base, action: 'refused', message: refusal(reanchor.check), forksAcknowledged: [] };
184
+ }
185
+ if (reanchor.kind === 'noop') {
186
+ return { ...base, action: 'none', message: 'Nothing to repair (another process re-anchored first).', forksAcknowledged: [] };
187
+ }
188
+ const after = chain.verify(VERIFY_OPTIONS);
189
+ const ok = after.valid && !after.tampered;
190
+ return {
191
+ ...base,
192
+ action: 'reanchored',
193
+ after: summarize(after),
194
+ rowsAfter: reanchor.txAfter,
195
+ forksAcknowledged: reanchor.forks.map((f) => f.id),
196
+ reanchorId: reanchor.entry.id,
197
+ backupPath,
198
+ message: ok
199
+ ? `Re-anchored ${reanchor.forks.length} fork(s) with CHAIN_REANCHOR id=${reanchor.entry.id}; chain now ${after.status}. Backup: ${backupPath}`
200
+ : `Appended CHAIN_REANCHOR id=${reanchor.entry.id}, but the chain still verifies as ${after.status}. Backup: ${backupPath}`,
201
+ };
202
+ }
203
+ //# sourceMappingURL=witness-chain-repair.js.map
@@ -0,0 +1,152 @@
1
+ /**
2
+ * Witness Chain verification with break classification (ADR-070, issue #753).
3
+ *
4
+ * Before v3.14.5, two AQE processes appending at once could both read the
5
+ * same tail and write a row whose `prev_hash` points at an older row: an
6
+ * accidental FORK. `verify()` used to stop at the first such break, so the
7
+ * rows after it were never checked and a forked store looked exactly like a
8
+ * tampered one.
9
+ *
10
+ * Every row is now classified:
11
+ *
12
+ * - linked: `prev_hash` is the hash of its predecessor (array-adjacent row,
13
+ * or row `id - 1` in either table, which covers the archival boundary), and
14
+ * no id between the two is missing from live ∪ archive.
15
+ * - fork: the row's own `action_hash` recomputes, its `prev_hash` is the exact
16
+ * hash of an EARLIER row that still exists (live or archive), every id
17
+ * between that parent and the row still exists (no deleted history), and,
18
+ * when the row is signed with a key this verifier holds, the Ed25519
19
+ * signature verifies. The walk records the fork and CONTINUES, checking the
20
+ * next row against the fork row exactly as before.
21
+ * - tamper: anything else. The walk stops there.
22
+ *
23
+ * A fork alone does not make the chain valid: it is only accepted once a later,
24
+ * normally linked `CHAIN_REANCHOR` entry (written by `aqe audit repair`) lists
25
+ * that exact row (id + prev_hash + action_hash + parent id). Forks that appear
26
+ * after a re-anchor are unacknowledged again. The re-anchor also pins the hash
27
+ * of every dead-end row (a losing race sibling that no later row links to), so
28
+ * editing or deleting one after the repair is reported as tampering.
29
+ *
30
+ * Limits (documented in ADR-070): for UNSIGNED rows the fork class is
31
+ * structural, not cryptographic. A row whose prev_hash is the genesis sentinel
32
+ * mid-chain (the legacy #759 brain-import splice) is reported as tamper: the
33
+ * sentinel proves nothing about this chain and is exactly what a forged or
34
+ * history-deleting edit produces.
35
+ */
36
+ import type { Database as DatabaseType } from 'better-sqlite3';
37
+ import type { WitnessEntry } from './witness-chain.js';
38
+ import type { WitnessKeyManager } from './witness-key-manager.js';
39
+ export declare const CHAIN_REANCHOR_ACTION = "CHAIN_REANCHOR";
40
+ export interface VerifyOptions {
41
+ /** Also verify Ed25519 signatures of every row. Requires keyManager on the chain. */
42
+ checkSignatures?: boolean;
43
+ /**
44
+ * Also walk `witness_chain_archive` and validate it as part of the same
45
+ * hash chain (archived rows are hash-linked to each other and to the live
46
+ * table exactly like un-archived rows). Off by default: the live-only walk
47
+ * is enough to catch tampering with current data and already correctly
48
+ * bridges the archival boundary; this option adds full historical coverage
49
+ * for a deep CI gate at the cost of reading the (potentially large) archive.
50
+ */
51
+ includeArchive?: boolean;
52
+ }
53
+ /**
54
+ * - `valid`: no breaks.
55
+ * - `valid-with-forks`: forks exist and every one is acknowledged by a CHAIN_REANCHOR.
56
+ * - `forked`: unacknowledged forks, no tampering. `valid` is false.
57
+ * - `tampered`: a tamper-class break or a signature failure. `valid` is false.
58
+ */
59
+ export type ChainStatus = 'valid' | 'valid-with-forks' | 'forked' | 'tampered';
60
+ export type TamperReason = 'action-hash-mismatch' | 'genesis-link-mismatch' | 'unlinked-genesis-prev-hash' | 'unlinked-prev-hash' | 'id-gap' | 'live-chain-missing' | 'fork-signature-invalid' | 'reanchor-signature-invalid' | 'reanchored-row-changed' | 'signature-invalid';
61
+ export interface WitnessForkInfo {
62
+ id: number;
63
+ parentId: number;
64
+ prevHash: string;
65
+ actionHash: string;
66
+ table: 'live' | 'archive';
67
+ acknowledged: boolean;
68
+ }
69
+ export interface VerifyResult {
70
+ /** True only for status `valid` or `valid-with-forks`. */
71
+ valid: boolean;
72
+ /**
73
+ * First break that makes the chain invalid, in walk order: the first
74
+ * unacknowledged fork, else the tamper row. Same id pre-#753 verify reported.
75
+ */
76
+ brokenAt?: number;
77
+ /** Rows walked (all rows unless a tamper stopped the walk). */
78
+ entriesChecked: number;
79
+ signatureFailures?: number;
80
+ status: ChainStatus;
81
+ /** True for any tamper-class break or signature failure. Never true for forks alone. */
82
+ tampered: boolean;
83
+ tamperedAt?: number;
84
+ tamperReason?: TamperReason;
85
+ /** Ids of every fork-class row found (acknowledged or not). */
86
+ forks: number[];
87
+ /** Subset of `forks` acknowledged by a verified CHAIN_REANCHOR entry. */
88
+ acknowledgedForks: number[];
89
+ forkDetails: WitnessForkInfo[];
90
+ }
91
+ /** One fork acknowledgement inside a CHAIN_REANCHOR entry's action_data. */
92
+ export interface ReanchorForkRecord {
93
+ id: number;
94
+ parentId: number;
95
+ prevHash: string;
96
+ actionHash: string;
97
+ }
98
+ /** A row hash frozen by a CHAIN_REANCHOR entry (dead-end rows nothing else links to). */
99
+ export interface ReanchorPin {
100
+ id: number;
101
+ hash: string;
102
+ }
103
+ /** Row hash under the row's own algorithm (how pins are recorded). */
104
+ export declare function ownHash(row: WitnessEntry): string;
105
+ /** Stateful single-use walker; see file header for the classification rules. */
106
+ export declare class WitnessChainVerifier {
107
+ private readonly db;
108
+ private readonly keyManager;
109
+ private readonly options;
110
+ private archiveRows;
111
+ private readonly parentIndex;
112
+ private readonly acks;
113
+ private readonly pins;
114
+ private readonly forks;
115
+ private tamper;
116
+ private signatureFailures;
117
+ private firstSignatureFailure;
118
+ private entriesChecked;
119
+ private archiveExists;
120
+ constructor(db: DatabaseType, keyManager: WitnessKeyManager | null, options?: VerifyOptions);
121
+ run(): VerifyResult;
122
+ private walk;
123
+ private classify;
124
+ private findEntryById;
125
+ private getArchive;
126
+ /** Stores written before archiving existed (or opened read-only) may lack the archive table. */
127
+ private hasArchive;
128
+ /** hash → id over every row (live + archive), built lazily per hash algo on the first fork candidate. */
129
+ private lookupParent;
130
+ /**
131
+ * True when every id strictly between `from` and `to` exists in live ∪
132
+ * archive. AUTOINCREMENT ids are never reused and a rolled-back insert does
133
+ * not consume one, so a missing id means a row was deleted.
134
+ */
135
+ private idsContiguous;
136
+ /**
137
+ * Signature status of one row against the keys this verifier holds. A row
138
+ * signed by a key it does not hold is `unverifiable` (e.g. a key from before
139
+ * persistent key storage) — classified on structure alone, like unsigned rows.
140
+ */
141
+ private checkSignature;
142
+ /** Legacy `checkSignatures` option: every signed row must verify (unknown key = failure). */
143
+ private checkAllSignatures;
144
+ private registerReanchor;
145
+ /** Rows frozen by a verified re-anchor must still exist with the same hash. */
146
+ private checkPins;
147
+ private result;
148
+ }
149
+ export declare function verifyWitnessChain(db: DatabaseType, keyManager: WitnessKeyManager | null, options?: VerifyOptions): VerifyResult;
150
+ /** True when `name` is a table in the connected database. */
151
+ export declare function tableExists(db: DatabaseType, name: string): boolean;
152
+ //# sourceMappingURL=witness-chain-verifier.d.ts.map