agentic-qe 3.14.5 → 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.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +76 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/ag-ui/event-types.d.ts +1 -1
- package/dist/audit/witness-chain-hash.d.ts +18 -0
- package/dist/audit/witness-chain-hash.js +37 -0
- package/dist/audit/witness-chain-repair.d.ts +71 -0
- package/dist/audit/witness-chain-repair.js +203 -0
- package/dist/audit/witness-chain-verifier.d.ts +152 -0
- package/dist/audit/witness-chain-verifier.js +293 -0
- package/dist/audit/witness-chain.d.ts +10 -43
- package/dist/audit/witness-chain.js +16 -106
- package/dist/audit/witness-findings.js +4 -1
- package/dist/cli/bundle.js +7 -7
- package/dist/cli/chunks/adapter-UYOJPTOX.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-2YGML6OU.js +2 -0
- package/dist/cli/chunks/{agent-handler-V6CZ7Q6S.js → agent-handler-D5SSQYNU.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-ZMD6ULC3.js → agent-memory-branch-YHPLTITV.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +2 -0
- package/dist/cli/chunks/{arena-QLSBESC7.js → arena-7BGOXGXO.js} +2 -2
- package/dist/cli/chunks/{arena-4UPAEHFT.js → arena-MCE6EU7K.js} +4 -4
- package/dist/cli/chunks/audit-BMWTQECB.js +4 -0
- package/dist/cli/chunks/base-DRZ2LS6X.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-4DSBPDRH.js → better-sqlite3-PMUNGASU.js} +2 -2
- package/dist/cli/chunks/{brain-handler-GBY4EZ4P.js → brain-handler-QPUFYX7F.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-XYBVXCNO.js → branch-enumerator-WKFDGRN4.js} +2 -2
- package/dist/cli/chunks/{browser-32F6MREU.js → browser-VY5HKH5X.js} +2 -2
- package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +2 -0
- package/dist/cli/chunks/{chunk-C3Z4VVHP.js → chunk-257E2A5M.js} +5 -5
- package/dist/cli/chunks/{chunk-EFV4ADMO.js → chunk-2JVWITNK.js} +2 -2
- package/dist/cli/chunks/{chunk-IGBEJ4UJ.js → chunk-2NPKIBAZ.js} +2 -2
- package/dist/cli/chunks/{chunk-KIP6WZGV.js → chunk-2TMWAQQ3.js} +3 -3
- package/dist/cli/chunks/{chunk-DLF5BOJD.js → chunk-2YXGBZWV.js} +1 -1
- package/dist/cli/chunks/{chunk-KEY43ANX.js → chunk-3EA536JF.js} +2 -2
- package/dist/cli/chunks/{chunk-WX6RRIGW.js → chunk-3EZOZN25.js} +2 -2
- package/dist/cli/chunks/{chunk-BYG36QC5.js → chunk-3HZS4M3O.js} +2 -2
- package/dist/cli/chunks/{chunk-G3L5L6YQ.js → chunk-3NIG7S5W.js} +1 -1
- package/dist/cli/chunks/{chunk-CZO4BJG5.js → chunk-4N23RFDU.js} +2 -2
- package/dist/cli/chunks/{chunk-QWUXCG2L.js → chunk-5J6W7SIA.js} +1 -1
- package/dist/cli/chunks/{chunk-RD2VGOUH.js → chunk-5OOMJGFN.js} +1 -1
- package/dist/cli/chunks/{chunk-YDFL445W.js → chunk-5QQSIGUA.js} +2 -2
- package/dist/cli/chunks/{chunk-TUSSPKRM.js → chunk-5VFPCSK7.js} +1 -1
- package/dist/cli/chunks/{chunk-WLXK2KNU.js → chunk-62N4NUJH.js} +2 -2
- package/dist/cli/chunks/{chunk-JSZ663MU.js → chunk-64VGZQLB.js} +1 -1
- package/dist/cli/chunks/{chunk-UMGFMKDW.js → chunk-66VWCR67.js} +2 -2
- package/dist/cli/chunks/{chunk-6ITZZIQX.js → chunk-6LIHFV7O.js} +2 -2
- package/dist/cli/chunks/{chunk-DKUBQQFG.js → chunk-6OS76PHI.js} +2 -2
- package/dist/cli/chunks/{chunk-Y5L3ES4L.js → chunk-6RE3X4V5.js} +2 -2
- package/dist/cli/chunks/{chunk-CVMNJSCB.js → chunk-6SH5VZUD.js} +2 -2
- package/dist/cli/chunks/chunk-6SQM2MUX.js +4 -0
- package/dist/cli/chunks/{chunk-6CR4VQBQ.js → chunk-6U7LNMWZ.js} +2 -2
- package/dist/cli/chunks/{chunk-HYEJJJY3.js → chunk-72KXSMWI.js} +1 -1
- package/dist/cli/chunks/chunk-7CUQCCMD.js +27 -0
- package/dist/cli/chunks/chunk-7D3V65N5.js +2 -0
- package/dist/cli/chunks/{chunk-K7NJHFLZ.js → chunk-7J6QC567.js} +3 -3
- package/dist/cli/chunks/{chunk-6LKDHEBY.js → chunk-7LPR6HJG.js} +2 -2
- package/dist/cli/chunks/{chunk-RGGK6VZ7.js → chunk-7NITCZWD.js} +1 -1
- package/dist/cli/chunks/{chunk-IYTLXUBO.js → chunk-7Z5LHRC3.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCWERUYB.js → chunk-AHKELLIO.js} +3 -3
- package/dist/cli/chunks/{chunk-IJHCIXJC.js → chunk-AIRGNL55.js} +2 -2
- package/dist/cli/chunks/{chunk-2OMLTYQK.js → chunk-AJRUJAAK.js} +1 -1
- package/dist/cli/chunks/{chunk-QYOGD2VW.js → chunk-AVBJYI5I.js} +1 -1
- package/dist/cli/chunks/{chunk-PSPKSUF6.js → chunk-B6D2CHEH.js} +1 -1
- package/dist/cli/chunks/{chunk-M23ZOZVY.js → chunk-B6MOJC3X.js} +1 -1
- package/dist/cli/chunks/{chunk-VD5IO5EO.js → chunk-BAMN2CHI.js} +1 -1
- package/dist/cli/chunks/{chunk-KO4FNAUR.js → chunk-BBT64TII.js} +3 -3
- package/dist/cli/chunks/{chunk-7JZJJA7U.js → chunk-BJTJLJRZ.js} +3 -3
- package/dist/cli/chunks/{chunk-LULD4JV2.js → chunk-BMAPORJ7.js} +2 -2
- package/dist/cli/chunks/{chunk-GTKCGPJZ.js → chunk-BPEDWS6O.js} +2 -2
- package/dist/cli/chunks/{chunk-3DDXWYMO.js → chunk-BVR7RMC5.js} +1 -1
- package/dist/cli/chunks/{chunk-52L77RMG.js → chunk-C6KWXUFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-BJPL6THQ.js → chunk-CCK4BF76.js} +1 -1
- package/dist/cli/chunks/{chunk-RP2ZKPYV.js → chunk-CD542DNJ.js} +1 -1
- package/dist/cli/chunks/{chunk-AFEDJ3RU.js → chunk-CF2ISEOJ.js} +2 -2
- package/dist/cli/chunks/chunk-CM7U6TAX.js +5 -0
- package/dist/cli/chunks/{chunk-R74ZKREV.js → chunk-D45SG6CP.js} +1 -1
- package/dist/cli/chunks/{chunk-YXP6BKGS.js → chunk-D6CJIGRU.js} +89 -83
- package/dist/cli/chunks/{chunk-NVYBM3R4.js → chunk-DBDPRORT.js} +2 -2
- package/dist/cli/chunks/{chunk-CYE2TJFV.js → chunk-DHVX5UB2.js} +2 -2
- package/dist/cli/chunks/{chunk-XUR2M2WB.js → chunk-DK4XN4CU.js} +2 -2
- package/dist/cli/chunks/{chunk-W2XCZU62.js → chunk-DPYSUDAO.js} +1 -1
- package/dist/cli/chunks/{chunk-WJHWH5D2.js → chunk-DUYOVM5I.js} +2 -2
- package/dist/cli/chunks/{chunk-XLAUGSW7.js → chunk-DZ3AUAAB.js} +2 -2
- package/dist/cli/chunks/{chunk-37TUN44F.js → chunk-E6G2RD5H.js} +2 -2
- package/dist/cli/chunks/{chunk-ELBZON4V.js → chunk-EAY2JMZG.js} +2 -2
- package/dist/cli/chunks/{chunk-HSVKZ5KI.js → chunk-ELLBS5RP.js} +2 -2
- package/dist/cli/chunks/chunk-ENGZ4D5V.js +2 -0
- package/dist/cli/chunks/chunk-FBMN7B46.js +4 -0
- package/dist/cli/chunks/{chunk-F34OAHOM.js → chunk-FWASDOT2.js} +2 -2
- package/dist/cli/chunks/{chunk-E4AZXCT5.js → chunk-FZOBD67M.js} +1 -1
- package/dist/cli/chunks/{chunk-QZMUXJHZ.js → chunk-GDSXITFH.js} +2 -2
- package/dist/cli/chunks/{chunk-LSUILON7.js → chunk-GGRHV6D7.js} +1 -1
- package/dist/cli/chunks/{chunk-3YUB5HER.js → chunk-GPYVDFB3.js} +101 -101
- package/dist/cli/chunks/{chunk-4FWTLJEP.js → chunk-GSF6MB64.js} +2 -2
- package/dist/cli/chunks/{chunk-3KDL6QDK.js → chunk-H52HZ67P.js} +2 -2
- package/dist/cli/chunks/{chunk-2JGEZHWY.js → chunk-H5BS5VH7.js} +2 -2
- package/dist/cli/chunks/{chunk-SQF6HRXR.js → chunk-H6ZM3PUT.js} +1 -1
- package/dist/cli/chunks/{chunk-OEIQTWQP.js → chunk-HM6ZSCPI.js} +1 -1
- package/dist/cli/chunks/{chunk-URVHZPWY.js → chunk-HNFVJP4I.js} +2 -2
- package/dist/cli/chunks/{chunk-RD6TEZ64.js → chunk-I33ERSGB.js} +2 -2
- package/dist/cli/chunks/{chunk-IUDWEOLX.js → chunk-IAF6T27S.js} +2 -2
- package/dist/cli/chunks/{chunk-XZSMZHM2.js → chunk-IB27QACC.js} +2 -2
- package/dist/cli/chunks/{chunk-I6X3EGJI.js → chunk-ICTXTNQZ.js} +1 -1
- package/dist/cli/chunks/chunk-IG5GNEC6.js +4 -0
- package/dist/cli/chunks/{chunk-6A44AOGN.js → chunk-IQO7UCFR.js} +2 -2
- package/dist/cli/chunks/{chunk-R6IU3EWP.js → chunk-IV5UZOHH.js} +2 -2
- package/dist/cli/chunks/{chunk-VTOVWHEM.js → chunk-JBTPOIAC.js} +2 -2
- package/dist/cli/chunks/{chunk-KLTP5IDB.js → chunk-JIXUMYKZ.js} +1 -1
- package/dist/cli/chunks/{chunk-3VIXOHMS.js → chunk-JMONHE4B.js} +1 -1
- package/dist/cli/chunks/{chunk-SX4JLSLV.js → chunk-JVNTSNWU.js} +2 -2
- package/dist/cli/chunks/{chunk-JVQBWYHW.js → chunk-JXGFRBUO.js} +2 -2
- package/dist/cli/chunks/{chunk-HVXJC3OC.js → chunk-JZOS5FCX.js} +2 -2
- package/dist/cli/chunks/{chunk-XEZIIQYJ.js → chunk-KNNISEDY.js} +1 -1
- package/dist/cli/chunks/{chunk-73EI4C2E.js → chunk-L4RUBPLR.js} +2 -2
- package/dist/cli/chunks/{chunk-AF4XKLXO.js → chunk-LL3IGZBI.js} +2 -2
- package/dist/cli/chunks/{chunk-UJWAWIRV.js → chunk-MBRHSU6W.js} +10 -10
- package/dist/cli/chunks/{chunk-J5UNP6W3.js → chunk-MJS53PRX.js} +2 -2
- package/dist/cli/chunks/{chunk-EOR2UT72.js → chunk-MQROI74N.js} +2 -2
- package/dist/cli/chunks/{chunk-BXVAVFGU.js → chunk-MUOG6QXR.js} +2 -2
- package/dist/cli/chunks/{chunk-O3JTQ7N4.js → chunk-MW2GGZZ5.js} +1 -1
- package/dist/cli/chunks/{chunk-IIAR5S7Q.js → chunk-NHWGMJAP.js} +2 -2
- package/dist/cli/chunks/{chunk-WOIGKU2N.js → chunk-NMAIY4PX.js} +3 -3
- package/dist/cli/chunks/{chunk-QIRL6B3C.js → chunk-NQZ5AR3D.js} +2 -2
- package/dist/cli/chunks/{chunk-6TU7FEMD.js → chunk-P6OYS755.js} +1 -1
- package/dist/cli/chunks/{chunk-HVU64GP5.js → chunk-PI7TJS62.js} +2 -2
- package/dist/cli/chunks/{chunk-N7H767TP.js → chunk-PX5YDCRH.js} +2 -2
- package/dist/cli/chunks/{chunk-3EZ5DR2R.js → chunk-PZPWRQ2M.js} +2 -2
- package/dist/cli/chunks/{chunk-RKOUXVZZ.js → chunk-Q5XTSMWR.js} +2 -2
- package/dist/cli/chunks/{chunk-K27SU3RE.js → chunk-Q7EAGKAE.js} +2 -2
- package/dist/cli/chunks/{chunk-M5AEL7IS.js → chunk-QDFTT3RF.js} +2 -2
- package/dist/cli/chunks/{chunk-TY5WC3FT.js → chunk-QGA55PFM.js} +3 -3
- package/dist/cli/chunks/{chunk-NQI7FWCS.js → chunk-QW6VMTBR.js} +2 -2
- package/dist/cli/chunks/{chunk-BHFR2EXL.js → chunk-QZANMBIT.js} +1 -1
- package/dist/cli/chunks/{chunk-5D36YHS3.js → chunk-RETBYIAC.js} +4 -4
- package/dist/cli/chunks/{chunk-UKGXWW64.js → chunk-RFNPJK6N.js} +3 -3
- package/dist/cli/chunks/{chunk-G3W6BMVJ.js → chunk-RG52OKAM.js} +1 -1
- package/dist/cli/chunks/{chunk-DO6EI5KB.js → chunk-RSXXCL4A.js} +1 -1
- package/dist/cli/chunks/{chunk-E3W6XQ57.js → chunk-RTFO5UQH.js} +2 -2
- package/dist/cli/chunks/{chunk-DDCIYOGT.js → chunk-RZZCUIAI.js} +2 -2
- package/dist/cli/chunks/{chunk-C3HQL6S4.js → chunk-SDRHUMJB.js} +2 -2
- package/dist/cli/chunks/{chunk-KYA5LARK.js → chunk-SE4WIB26.js} +1 -1
- package/dist/cli/chunks/{chunk-NU7UTXMP.js → chunk-SESK3ARK.js} +2 -2
- package/dist/cli/chunks/{chunk-YQGPQBCX.js → chunk-SJUXE4IC.js} +2 -2
- package/dist/cli/chunks/{chunk-HBCGYMQU.js → chunk-SMDN3BQZ.js} +1 -1
- package/dist/cli/chunks/{chunk-D6OUCB2H.js → chunk-SNOBH4AZ.js} +2 -2
- package/dist/cli/chunks/{chunk-QRCIZFNK.js → chunk-SPV2VKC5.js} +2 -2
- package/dist/cli/chunks/chunk-TCHGOB2N.js +2 -0
- package/dist/cli/chunks/{chunk-2KJQ2UQE.js → chunk-TVYY3OCX.js} +1 -1
- package/dist/cli/chunks/{chunk-RIZVC4XY.js → chunk-UCFQALXO.js} +2 -2
- package/dist/cli/chunks/{chunk-XFPPERA2.js → chunk-UKA2KOXE.js} +2 -2
- package/dist/cli/chunks/{chunk-UTBYJ4RF.js → chunk-UNFFDHER.js} +16 -11
- package/dist/cli/chunks/{chunk-6VAZAHQG.js → chunk-UQ32JHES.js} +2 -2
- package/dist/cli/chunks/{chunk-CPC7FN52.js → chunk-V4DM6ELU.js} +2 -2
- package/dist/cli/chunks/{chunk-67YV75XP.js → chunk-VGFFFKGK.js} +2 -2
- package/dist/cli/chunks/{chunk-WK7B4B6Y.js → chunk-VMNWDJIZ.js} +2 -2
- package/dist/cli/chunks/chunk-W6HXLH5G.js +180 -0
- package/dist/cli/chunks/{chunk-7VFY7TUR.js → chunk-WCJBU2KI.js} +2 -2
- package/dist/cli/chunks/{chunk-JROVR6YS.js → chunk-WGM35YWL.js} +2 -2
- package/dist/cli/chunks/{chunk-IUHB5GVS.js → chunk-WO4QMXIG.js} +2 -2
- package/dist/cli/chunks/{chunk-JES6R5KP.js → chunk-XAS3XRYM.js} +1 -1
- package/dist/cli/chunks/chunk-Y3LZ35OG.js +2 -0
- package/dist/cli/chunks/{chunk-75QJ5HWE.js → chunk-Y3UOUNHM.js} +2 -2
- package/dist/cli/chunks/{chunk-WJTSY5MC.js → chunk-YFBSPLJG.js} +1 -1
- package/dist/cli/chunks/{chunk-DPBRWP4J.js → chunk-YHKEDEAA.js} +3 -3
- package/dist/cli/chunks/{chunk-NRE4NAVA.js → chunk-YS4FCTWF.js} +1 -1
- package/dist/cli/chunks/{chunk-I2NENQ44.js → chunk-YSLL6VSL.js} +2 -2
- package/dist/cli/chunks/chunk-Z6GGIRQQ.js +65 -0
- package/dist/cli/chunks/{chunk-E4EYPYR3.js → chunk-Z7WODOTH.js} +2 -2
- package/dist/cli/chunks/{chunk-7DETTOPZ.js → chunk-ZCRTRYXK.js} +2 -2
- package/dist/cli/chunks/{chunk-FUNGTIF2.js → chunk-ZEV3YTO7.js} +2 -2
- package/dist/cli/chunks/{chunk-SQKW3B6B.js → chunk-ZL6SYKUK.js} +1 -1
- package/dist/cli/chunks/{chunk-AMMQOV35.js → chunk-ZSPU4MOS.js} +2 -2
- package/dist/cli/chunks/{chunk-KKHYJF5U.js → chunk-ZVWVV4EX.js} +1 -1
- package/dist/cli/chunks/{ci-RACDAJMR.js → ci-W6K6G2KZ.js} +2 -2
- package/dist/cli/chunks/{ci-output-EHRSZBKG.js → ci-output-LDT24TS3.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-GBV7M5XG.js → circuit-breaker-F5V4KITU.js} +2 -2
- package/dist/cli/chunks/claude-flow-setup-DT6WQQVD.js +2 -0
- package/dist/cli/chunks/client-KHWJT6FB.js +2 -0
- package/dist/cli/chunks/{cline-installer-W4NMXJSG.js → cline-installer-G7TJOAEX.js} +2 -2
- package/dist/cli/chunks/{code-JWXJMYXB.js → code-PGE6A42V.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-RVI2IFTM.js → code-index-extractor-RNITH372.js} +2 -2
- package/dist/cli/chunks/{codex-installer-3BORJINH.js → codex-installer-LBX77AI3.js} +6 -6
- package/dist/cli/chunks/{completions-A55NCTAO.js → completions-4AWLAARX.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-JCXHGGLY.js → complexity-analyzer-ZPNSS476.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-PUVFMGYW.js → continuedev-installer-UAPWX6OA.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-4DCMYWHB.js → copilot-installer-BJN2YJGI.js} +2 -2
- package/dist/cli/chunks/core-handlers-HING5RRG.js +2 -0
- package/dist/cli/chunks/{cost-tracker-5TV2GGKY.js → cost-tracker-MHP2VJ63.js} +2 -2
- package/dist/cli/chunks/{coverage-NNWM7TX3.js → coverage-PQB4IEFG.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +2 -0
- package/dist/cli/chunks/{cursor-installer-4NCHGJGK.js → cursor-installer-ZXBWYAS3.js} +2 -2
- package/dist/cli/chunks/{daemon-T4JO4IXP.js → daemon-64C7R6OJ.js} +3 -3
- package/dist/cli/chunks/{daemon-QIKCXKWO.js → daemon-N2BEGEFY.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-RPAAIDAD.js → dag-attention-scheduler-SPZDAPNL.js} +2 -2
- package/dist/cli/chunks/{detect-SBEEVDSN.js → detect-LXJBSSZW.js} +2 -2
- package/dist/cli/chunks/{dist-node-ZHI6NCSU.js → dist-node-U3TKZ2IZ.js} +2 -2
- package/dist/cli/chunks/{domain-handler-LBC3GJ7Z.js → domain-handler-3DDWUVSR.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-H6IZ5USZ.js → domain-plugins-JJVWI4OQ.js} +2 -2
- package/dist/cli/chunks/domain-transfer-M36KUJ2U.js +2 -0
- package/dist/cli/chunks/dream-WUGRSNCV.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-AHTR7CRU.js → embed-and-insert-pattern-JPAR7TXX.js} +2 -2
- package/dist/cli/chunks/{eval-DZU2KISM.js → eval-SOLG23EA.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-5IQCWKSL.js → experience-capture-middleware-T7G2VOOD.js} +3 -3
- package/dist/cli/chunks/{fast-paths-2KLDUWCY.js → fast-paths-32N3ELI4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-N6UAEZY4.js → feature-flags-APJDQ4N7.js} +2 -2
- package/dist/cli/chunks/{feature-flags-7AC3XDZA.js → feature-flags-NAHKLDRN.js} +2 -2
- package/dist/cli/chunks/{file-discovery-5SDIW4V2.js → file-discovery-YKVM3MDB.js} +2 -2
- package/dist/cli/chunks/{fleet-ZIQCAZ2Y.js → fleet-55M5CJS4.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-DUMBZJEV.js → gnn-wrapper-UD6E6S6Z.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-6HVM6ZMR.js → heartbeat-handler-OYVW3VSC.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +2 -0
- package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-5DRL5FLX.js → hnsw-legacy-bridge-HBYIS3ZW.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-GW67GTCL.js → hnswlib-node-EQPM42OU.js} +2 -2
- package/dist/cli/chunks/{hooks-QHH6FVO4.js → hooks-5ZSSJWO6.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-7XDCCVG2.js → hypergraph-engine-XBGVQ4PD.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-QHF7NOU5.js → hypergraph-handler-CAWAQ673.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +2 -0
- package/dist/cli/chunks/{init-handler-5UIVOM7K.js → init-handler-PRHXSARK.js} +6 -6
- package/dist/cli/chunks/init-wizard-72MFBI3G.js +2 -0
- package/dist/cli/chunks/kernel-BRCBVMSK.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-TGGV6K5Q.js → kilocode-installer-F7LXBM7I.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-4XYBHZWW.js → kiro-installer-NM723ZRG.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +2 -0
- package/dist/cli/chunks/{learning-STE5W6BS.js → learning-5QYIDHH3.js} +3 -3
- package/dist/cli/chunks/{llm-router-NKF7J3RI.js → llm-router-43HKWPSX.js} +4 -4
- package/dist/cli/chunks/llm-router-service-24KXFX32.js +2 -0
- package/dist/cli/chunks/{load-B2T77UJQ.js → load-5YDBWSCS.js} +2 -2
- package/dist/cli/chunks/load-test-N4TAYJY3.js +2 -0
- package/dist/cli/chunks/mcp-UMAPMNMY.js +2 -0
- package/dist/cli/chunks/{memory-WRFZKG56.js → memory-FWCPCQFP.js} +5 -5
- package/dist/cli/chunks/memory-backend-NVYFYVAU.js +2 -0
- package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +2 -0
- package/dist/cli/chunks/multi-model-executor-2XTBGLE4.js +14 -0
- package/dist/cli/chunks/{opencode-installer-J36EMQU7.js → opencode-installer-GIXOJ6NS.js} +2 -2
- package/dist/cli/chunks/orchestrator-VW6BKHLI.js +393 -0
- package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-BVMTWI3E.js → pattern-usage-recorder-7CEUC3J7.js} +2 -2
- package/dist/cli/chunks/{pipeline-OWAHDUAQ.js → pipeline-IGUQPPPO.js} +2 -2
- package/dist/cli/chunks/{platform-ANGBFWBV.js → platform-2P636I7B.js} +2 -2
- package/dist/cli/chunks/{plugin-OO7ON2YW.js → plugin-NY6SWDPE.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-HFG3BXWU.js → prime-radiant-advanced-wasm-2UUDTIO2.js} +2 -2
- package/dist/cli/chunks/{project-root-LNOYVTYY.js → project-root-IOISG5KX.js} +2 -2
- package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +2 -0
- package/dist/cli/chunks/{protocol-handler-CE3Q6LY4.js → protocol-handler-ZTPCRQ5W.js} +2 -2
- package/dist/cli/chunks/{prove-7XPN53PY.js → prove-SQX5A3IG.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +2 -0
- package/dist/cli/chunks/{quality-TT23JRFX.js → quality-DROILKRY.js} +2 -2
- package/dist/cli/chunks/{quality-gate-PPPRP255.js → quality-gate-PWKWDJY2.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +2 -0
- package/dist/cli/chunks/{real-embeddings-EYNZIFJE.js → real-embeddings-P5U3MGYC.js} +2 -2
- package/dist/cli/chunks/{ref-validation-QQR64ZXD.js → ref-validation-KY73NQXD.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-UIGS7ZJD.js → roocode-installer-6JPPRB3W.js} +2 -2
- package/dist/cli/chunks/router-SRSO3IHF.js +2 -0
- package/dist/cli/chunks/routing-feedback-PASRE5HY.js +2 -0
- package/dist/cli/chunks/{routing-handler-6AENUIRG.js → routing-handler-VTJIVFUO.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-5AWMEV34.js → ruvector-commands-C6RPSJJO.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-NWRJ7C22.js → rvf-migration-coordinator-R53URRIO.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-ISKRP563.js → rvf-store-integrity-MMXN5TEJ.js} +2 -2
- package/dist/cli/chunks/safe-db-QJLFO33B.js +2 -0
- package/dist/cli/chunks/schedule-YIVXW5O2.js +2 -0
- package/dist/cli/chunks/scheduler-AON7DWSJ.js +2 -0
- package/dist/cli/chunks/{security-325A7FMB.js → security-3B3R2NL4.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-VIJB7JUS.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-THFDYS2Z.js → shared-rvf-dual-writer-UVWGDUWC.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +2 -0
- package/dist/cli/chunks/{standalone-memory-UD4MJ6GZ.js → standalone-memory-M4LWAAYZ.js} +2 -2
- package/dist/cli/chunks/{status-handler-CPFTN4XL.js → status-handler-YYFV6OZL.js} +2 -2
- package/dist/cli/chunks/{structural-health-2MG2IVBL.js → structural-health-27E6LLKB.js} +2 -2
- package/dist/cli/chunks/sync-26CEGSTC.js +2 -0
- package/dist/cli/chunks/{sync-EE4VVKOW.js → sync-J3LJ56WN.js} +2 -2
- package/dist/cli/chunks/{task-handler-7H5OYJG4.js → task-handler-4MCEBQZL.js} +2 -2
- package/dist/cli/chunks/{task-handlers-NH4GJHCJ.js → task-handlers-GYBAWKE2.js} +3 -3
- package/dist/cli/chunks/{test-MPHGT4T6.js → test-MPC5HRH5.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-CHQ4ZLLJ.js → test-scheduling-ZJBFRZ3J.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +2 -0
- package/dist/cli/chunks/{token-usage-EBXUJNRB.js → token-usage-3X5WMTG2.js} +2 -2
- package/dist/cli/chunks/{transformers-ZEKS2OJZ.js → transformers-MVL4C5IX.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-SLW65ZFO.js +2 -0
- package/dist/cli/chunks/{types-KYAA5VLV.js → types-TG5P3CRS.js} +2 -2
- package/dist/cli/chunks/unified-memory-UCQ6AB32.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +2 -0
- package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +2 -0
- package/dist/cli/chunks/{upgrade-UJBJ5AYM.js → upgrade-ETBHDEPY.js} +2 -2
- package/dist/cli/chunks/{validate-RUV6YMWS.js → validate-C2A73LZK.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-IVEVMGVM.js → validate-swarm-67XN42ML.js} +2 -2
- package/dist/cli/chunks/{vibium-HOGMFJ2Z.js → vibium-NILGKHLN.js} +2 -2
- package/dist/cli/chunks/visual-security-4VZXPEVG.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-AVWA6HKE.js → web-tree-sitter-USJN77P4.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-DAH7HI2W.js → windsurf-installer-5GGZXGJW.js} +2 -2
- package/dist/cli/chunks/witness-chain-IWS5ZHHL.js +2 -0
- package/dist/cli/chunks/witness-chain-JQA2VPZI.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +2 -0
- package/dist/cli/chunks/witness-chain-verifier-3GEADWPE.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-JSTBMG43.js → witness-key-manager-ZWEIK3VJ.js} +2 -2
- package/dist/cli/chunks/{workflow-TWOIA6LZ.js → workflow-KHMVVBBA.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +2 -0
- package/dist/cli/chunks/wrappers-N6XIK5PT.js +2 -0
- package/dist/cli/commands/audit.d.ts +20 -2
- package/dist/cli/commands/audit.js +158 -16
- package/dist/cli/commands/claude-flow-setup.js +5 -4
- package/dist/cli/index.js +2 -1
- package/dist/init/agents-installer.d.ts +4 -0
- package/dist/init/agents-installer.js +24 -11
- package/dist/init/codex-installer.js +4 -2
- package/dist/init/idempotent-write.d.ts +53 -0
- package/dist/init/idempotent-write.js +160 -0
- package/dist/init/phases/05-learning.js +3 -1
- package/dist/init/phases/07-hooks.js +32 -16
- package/dist/init/phases/08-mcp.js +4 -2
- package/dist/init/phases/10-workers.js +7 -5
- package/dist/init/phases/12-verification.js +7 -2
- package/dist/init/project-analyzer.d.ts +9 -0
- package/dist/init/project-analyzer.js +20 -1
- package/dist/init/self-configurator.d.ts +5 -3
- package/dist/init/self-configurator.js +18 -29
- package/dist/init/skills-installer.js +4 -2
- package/dist/init/types.d.ts +6 -0
- package/dist/init/types.js +20 -24
- package/dist/integrations/coherence/coherence-service.js +84 -24
- package/dist/integrations/coherence/vote-tally.d.ts +38 -0
- package/dist/integrations/coherence/vote-tally.js +39 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.d.ts +23 -0
- package/dist/integrations/ruvector/shared-rvf-adapter.js +24 -0
- package/dist/kernel/kernel.js +3 -2
- package/dist/learning/pattern-store.d.ts +11 -0
- package/dist/learning/pattern-store.js +26 -8
- package/dist/learning/qe-patterns.d.ts +6 -0
- package/dist/learning/qe-patterns.js +7 -1
- package/dist/learning/qe-reasoning-bank.js +3 -0
- package/dist/learning/rvf-pattern-store.js +20 -7
- package/dist/learning/sqlite-persistence.d.ts +8 -1
- package/dist/learning/sqlite-persistence.js +49 -9
- package/dist/logging/console-logger.d.ts +2 -5
- package/dist/logging/console-logger.js +10 -46
- package/dist/logging/index.d.ts +2 -0
- package/dist/logging/index.js +1 -0
- package/dist/logging/redaction.d.ts +27 -0
- package/dist/logging/redaction.js +170 -0
- package/dist/mcp/bundle.js +435 -421
- package/dist/mcp/handlers/core-handlers.js +5 -4
- package/dist/mcp/protocol-server.js +2 -1
- package/dist/mcp/tools/base.d.ts +9 -2
- package/dist/mcp/tools/base.js +7 -0
- package/dist/mcp/tools/coherence/consensus.js +51 -2
- package/dist/mcp/tools/planning/goap-plan.d.ts +20 -7
- package/dist/mcp/tools/planning/goap-plan.js +92 -20
- package/dist/mcp/tools/planning/goap-status.d.ts +37 -12
- package/dist/mcp/tools/planning/goap-status.js +52 -23
- package/dist/mcp/tools/planning/world-state.d.ts +101 -0
- package/dist/mcp/tools/planning/world-state.js +274 -0
- package/dist/mcp/types.d.ts +4 -2
- package/dist/planning/goap-planner.d.ts +60 -4
- package/dist/planning/goap-planner.js +218 -60
- package/dist/planning/index.d.ts +1 -1
- package/dist/planning/index.js +1 -1
- package/dist/planning/plan-executor.d.ts +20 -1
- package/dist/planning/plan-executor.js +209 -100
- package/dist/planning/types.d.ts +16 -0
- package/dist/planning/types.js +17 -0
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-IYC62SXA.js +0 -2
- package/dist/cli/chunks/agent-booster-wasm-EDNKP3SP.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-LLOU2IXD.js +0 -2
- package/dist/cli/chunks/audit-CVZQMF55.js +0 -3
- package/dist/cli/chunks/base-P3Z4IKCT.js +0 -2
- package/dist/cli/chunks/browser-workflow-YYHQQ25X.js +0 -2
- package/dist/cli/chunks/chunk-5WOSWNDN.js +0 -2
- package/dist/cli/chunks/chunk-7CD7PBHY.js +0 -3
- package/dist/cli/chunks/chunk-7X7JYWT4.js +0 -27
- package/dist/cli/chunks/chunk-J27F4NSB.js +0 -2
- package/dist/cli/chunks/chunk-MI5Q55DG.js +0 -65
- package/dist/cli/chunks/chunk-UDHVCKGA.js +0 -5
- package/dist/cli/chunks/chunk-XQSIRBKT.js +0 -180
- package/dist/cli/chunks/chunk-ZBABIZ2D.js +0 -2
- package/dist/cli/chunks/claude-flow-setup-5LVJOFKP.js +0 -2
- package/dist/cli/chunks/client-HUVFA5PF.js +0 -2
- package/dist/cli/chunks/core-handlers-UEXO3VAA.js +0 -2
- package/dist/cli/chunks/cross-domain-router-ODU5IZD6.js +0 -2
- package/dist/cli/chunks/domain-transfer-JZA5TMW3.js +0 -2
- package/dist/cli/chunks/dream-HE3OX42F.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-QUIFGGLX.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-42KB37KP.js +0 -2
- package/dist/cli/chunks/hnsw-index-T2PGO77J.js +0 -2
- package/dist/cli/chunks/hybrid-backend-FRNWYRKH.js +0 -2
- package/dist/cli/chunks/impact-analyzer-A5QYOYBR.js +0 -2
- package/dist/cli/chunks/init-wizard-XBU674YH.js +0 -2
- package/dist/cli/chunks/kernel-DV5MTNZD.js +0 -2
- package/dist/cli/chunks/knowledge-graph-4ACGVJQK.js +0 -2
- package/dist/cli/chunks/llm-router-service-PSMASERT.js +0 -2
- package/dist/cli/chunks/load-test-MRUO2VPF.js +0 -2
- package/dist/cli/chunks/mcp-JGSFCEMH.js +0 -2
- package/dist/cli/chunks/memory-backend-2MPGI6JW.js +0 -2
- package/dist/cli/chunks/memory-handlers-XT4HMITB.js +0 -2
- package/dist/cli/chunks/multi-model-executor-26Q5BSVG.js +0 -14
- package/dist/cli/chunks/orchestrator-D5IFV65I.js +0 -393
- package/dist/cli/chunks/pattern-null-store-TGWUL237.js +0 -2
- package/dist/cli/chunks/protocol-executor-GEVH5KD6.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-DJ2JL6QB.js +0 -2
- package/dist/cli/chunks/queen-coordinator-F7E3AS26.js +0 -2
- package/dist/cli/chunks/router-OZH3QSAU.js +0 -2
- package/dist/cli/chunks/routing-feedback-J2E3ADZB.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-HK525Y5Y.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-Q7FB3BKR.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-5ZRCGUI6.js +0 -2
- package/dist/cli/chunks/safe-db-3OYEPVEH.js +0 -2
- package/dist/cli/chunks/schedule-AG4C2EIQ.js +0 -2
- package/dist/cli/chunks/scheduler-SQS2CZFZ.js +0 -2
- package/dist/cli/chunks/shared-rvf-adapter-NFL6QSZ6.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-MAKDFSHC.js +0 -2
- package/dist/cli/chunks/sync-MBTW5XBF.js +0 -2
- package/dist/cli/chunks/token-bootstrap-SSDCYEKK.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-J6ZMAK37.js +0 -2
- package/dist/cli/chunks/unified-memory-DDWMC435.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-4JA7SGBK.js +0 -2
- package/dist/cli/chunks/unified-persistence-F6OSNTXY.js +0 -2
- package/dist/cli/chunks/visual-security-25SMBIYT.js +0 -2
- package/dist/cli/chunks/witness-chain-PJOQPFUX.js +0 -2
- package/dist/cli/chunks/witness-chain-ZW6KKUZU.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-UKSIDM7Q.js +0 -2
- package/dist/cli/chunks/wrappers-UR7BLXKV.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,82 @@ 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.6] - 2026-09-29
|
|
9
|
+
|
|
10
|
+
This patch fixes an `aqe audit verify` crash on stores with no audit chain yet.
|
|
11
|
+
It adds `aqe audit repair` for stores forked by concurrent writers before
|
|
12
|
+
3.14.5, makes repeat `aqe init --auto` runs leave an unchanged project
|
|
13
|
+
untouched, and makes GOAP planning work from the live fleet state. It also
|
|
14
|
+
redacts secrets from AQE's logs and lets keyword matches improve pattern
|
|
15
|
+
search.
|
|
16
|
+
|
|
17
|
+
### Security
|
|
18
|
+
|
|
19
|
+
- Secrets are redacted from AQE's structured logs and from logged errors. This
|
|
20
|
+
covers API keys (`sk-ant-`, `sk-`, `ghp_`, `github_pat_`, `AKIA…`),
|
|
21
|
+
Bearer/Basic credentials, credentials in URLs, JWTs, PEM private keys,
|
|
22
|
+
cookies, and values under sensitive keys (`password`, `token`, `apiKey`,
|
|
23
|
+
`access_token`, …) in objects, JSON text and query strings. Command output
|
|
24
|
+
such as `aqe memory get` is not changed ([#789]).
|
|
25
|
+
|
|
26
|
+
### Added
|
|
27
|
+
|
|
28
|
+
- `aqe audit verify --chain audit` now keeps checking past accidental forks
|
|
29
|
+
left by pre-3.14.5 concurrent writers, and reports them separately from
|
|
30
|
+
tampering (`status: "forked"`, `tampered: false`). The new
|
|
31
|
+
`aqe audit repair --chain audit [--dry-run]` acknowledges those forks with
|
|
32
|
+
one signed entry. It refuses if anything was tampered with, backs up the
|
|
33
|
+
database first, and never edits or deletes an existing row. Afterwards verify
|
|
34
|
+
passes again ([#784]).
|
|
35
|
+
- `goap_status {type:"plans"}` lists saved GOAP plans ([#791]).
|
|
36
|
+
|
|
37
|
+
### Changed
|
|
38
|
+
|
|
39
|
+
- Running `aqe init --auto` again on an unchanged project no longer rewrites
|
|
40
|
+
generated files or creates `.claude/settings.json.backup`. Fresh and repeat
|
|
41
|
+
runs now produce the same settings: all 13 domains, and pattern promotion at
|
|
42
|
+
3 successes / 0.7 success rate, which is what the learning runtime actually
|
|
43
|
+
enforces ([#783]).
|
|
44
|
+
- Keyword matches now contribute to pattern search alongside vector
|
|
45
|
+
similarity. A keyword-only hit is weighted by how many of the query's terms
|
|
46
|
+
it matches ([#779]).
|
|
47
|
+
- `qe_coherence_consensus` rejects malformed votes with a clear error. Only a
|
|
48
|
+
unanimous vote is flagged as possible false consensus, and every
|
|
49
|
+
recommendation states the real tally ([#781]).
|
|
50
|
+
- `goap_plan` rejects unknown constraint keys and supports
|
|
51
|
+
`constraints.maxSteps` ([#785]).
|
|
52
|
+
|
|
53
|
+
### Fixed
|
|
54
|
+
|
|
55
|
+
- `aqe audit verify --chain audit` and `aqe audit repair --dry-run` no longer
|
|
56
|
+
crash with `SQLITE_READONLY` on a store that has no audit chain yet (for
|
|
57
|
+
example after `aqe init --minimal`) or on older stores without the archive
|
|
58
|
+
table. A store whose live chain was deleted while archived rows remain is
|
|
59
|
+
now reported as tampered instead of valid ([#788]).
|
|
60
|
+
- GOAP world state is read from the live fleet, and coverage from a coverage
|
|
61
|
+
report when one exists. Values it can't measure are reported as `null` with
|
|
62
|
+
`dataSource: "estimated"` instead of defaults labelled as real. Planning for
|
|
63
|
+
goals such as `achieve-90-percent-coverage` works again, and a plan can be
|
|
64
|
+
dry-run executed by its ID. A step whose domain call returns an error now
|
|
65
|
+
fails instead of being recorded as completed ([#785]).
|
|
66
|
+
- A repeat `fleet_init` reports the fleet settings actually in effect instead
|
|
67
|
+
of echoing the requested ones ([#790]).
|
|
68
|
+
- When another live process holds an RVF lock, AQE logs one clear warning and
|
|
69
|
+
falls back to SQLite, without a second, misleading `LockHeld` error ([#782]).
|
|
70
|
+
- Updated `ip-address` to 10.7.2 ([#776]).
|
|
71
|
+
|
|
72
|
+
[#776]: https://github.com/proffesor-for-testing/agentic-qe/pull/776
|
|
73
|
+
[#779]: https://github.com/proffesor-for-testing/agentic-qe/pull/779
|
|
74
|
+
[#781]: https://github.com/proffesor-for-testing/agentic-qe/pull/781
|
|
75
|
+
[#782]: https://github.com/proffesor-for-testing/agentic-qe/pull/782
|
|
76
|
+
[#783]: https://github.com/proffesor-for-testing/agentic-qe/pull/783
|
|
77
|
+
[#784]: https://github.com/proffesor-for-testing/agentic-qe/pull/784
|
|
78
|
+
[#785]: https://github.com/proffesor-for-testing/agentic-qe/pull/785
|
|
79
|
+
[#788]: https://github.com/proffesor-for-testing/agentic-qe/pull/788
|
|
80
|
+
[#789]: https://github.com/proffesor-for-testing/agentic-qe/pull/789
|
|
81
|
+
[#790]: https://github.com/proffesor-for-testing/agentic-qe/pull/790
|
|
82
|
+
[#791]: https://github.com/proffesor-for-testing/agentic-qe/pull/791
|
|
83
|
+
|
|
8
84
|
## [3.14.5] - 2026-09-29
|
|
9
85
|
|
|
10
86
|
This patch makes Agentic QE's results trustworthy for scripts and CI: failed
|
|
@@ -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
|