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.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +150 -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 +8 -8
- package/dist/cli/chunks/adapter-TVQKH65T.js +2 -0
- package/dist/cli/chunks/agent-booster-wasm-AK2W76RG.js +2 -0
- package/dist/cli/chunks/{agent-handler-V6CZ7Q6S.js → agent-handler-MGZCWHIY.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-ZMD6ULC3.js → agent-memory-branch-JZ54MCSP.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-ULGTVVWE.js +2 -0
- package/dist/cli/chunks/{arena-QLSBESC7.js → arena-CUVH3V7H.js} +2 -2
- package/dist/cli/chunks/{arena-4UPAEHFT.js → arena-YSWTKBCL.js} +4 -4
- package/dist/cli/chunks/audit-LVU76QGA.js +4 -0
- package/dist/cli/chunks/base-W42BURDL.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-4DSBPDRH.js → better-sqlite3-DB3LOJQU.js} +2 -2
- package/dist/cli/chunks/{brain-handler-GBY4EZ4P.js → brain-handler-SD63KOQ6.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-XYBVXCNO.js → branch-enumerator-4MNOPUC7.js} +2 -2
- package/dist/cli/chunks/{browser-32F6MREU.js → browser-OLPNTWQE.js} +2 -2
- package/dist/cli/chunks/browser-workflow-HKGHFFFT.js +2 -0
- package/dist/cli/chunks/{chunk-WLXK2KNU.js → chunk-23CX7JNL.js} +2 -2
- package/dist/cli/chunks/{chunk-O3JTQ7N4.js → chunk-25P6JA6V.js} +1 -1
- package/dist/cli/chunks/{chunk-DO6EI5KB.js → chunk-2G63VIJE.js} +1 -1
- package/dist/cli/chunks/{chunk-G3L5L6YQ.js → chunk-2IMSJ7IO.js} +1 -1
- package/dist/cli/chunks/{chunk-RD6TEZ64.js → chunk-36VKMAMN.js} +2 -2
- package/dist/cli/chunks/{chunk-KIP6WZGV.js → chunk-3M7J4U74.js} +3 -3
- package/dist/cli/chunks/chunk-3QJU4Q4R.js +5 -0
- package/dist/cli/chunks/{chunk-2JGEZHWY.js → chunk-4EKV7PHB.js} +2 -2
- package/dist/cli/chunks/chunk-4INST4ZL.js +4 -0
- package/dist/cli/chunks/{chunk-DPBRWP4J.js → chunk-53BXTTRO.js} +3 -3
- package/dist/cli/chunks/chunk-5D7ZFWDS.js +2 -0
- package/dist/cli/chunks/{chunk-XLAUGSW7.js → chunk-5FSLMYAC.js} +2 -2
- package/dist/cli/chunks/chunk-5GFKTJ65.js +4 -0
- package/dist/cli/chunks/{chunk-WOIGKU2N.js → chunk-5U6N4V5M.js} +11 -11
- package/dist/cli/chunks/{chunk-PSPKSUF6.js → chunk-6EGS77BB.js} +1 -1
- package/dist/cli/chunks/{chunk-QIRL6B3C.js → chunk-6PJPQGF4.js} +2 -2
- package/dist/cli/chunks/{chunk-I6X3EGJI.js → chunk-6RD44SCE.js} +1 -1
- package/dist/cli/chunks/{chunk-IGBEJ4UJ.js → chunk-74IOEOMH.js} +2 -2
- package/dist/cli/chunks/{chunk-E3W6XQ57.js → chunk-77QZHIVX.js} +2 -2
- package/dist/cli/chunks/{chunk-R74ZKREV.js → chunk-7EZ2Z2CK.js} +1 -1
- package/dist/cli/chunks/{chunk-UTBYJ4RF.js → chunk-7MIOK72I.js} +18 -35
- package/dist/cli/chunks/{chunk-URVHZPWY.js → chunk-7QYOTUOX.js} +2 -2
- package/dist/cli/chunks/{chunk-K27SU3RE.js → chunk-A2VUCUTT.js} +2 -2
- package/dist/cli/chunks/{chunk-2KJQ2UQE.js → chunk-A3DK3XNZ.js} +1 -1
- package/dist/cli/chunks/{chunk-5D36YHS3.js → chunk-A5MA7A23.js} +4 -4
- package/dist/cli/chunks/{chunk-WJHWH5D2.js → chunk-AEUEMVJK.js} +2 -2
- package/dist/cli/chunks/{chunk-6CR4VQBQ.js → chunk-AJUBT4NP.js} +2 -2
- package/dist/cli/chunks/chunk-B2YGVSOP.js +27 -0
- package/dist/cli/chunks/{chunk-D6OUCB2H.js → chunk-B4I43GE2.js} +2 -2
- package/dist/cli/chunks/{chunk-WK7B4B6Y.js → chunk-BD7FEUN3.js} +2 -2
- package/dist/cli/chunks/{chunk-OEIQTWQP.js → chunk-BE4KALTE.js} +1 -1
- package/dist/cli/chunks/{chunk-JROVR6YS.js → chunk-BEFTQVEW.js} +2 -2
- package/dist/cli/chunks/{chunk-HBCGYMQU.js → chunk-BLG7SH4A.js} +1 -1
- package/dist/cli/chunks/{chunk-2OMLTYQK.js → chunk-C3FXFU2T.js} +1 -1
- package/dist/cli/chunks/{chunk-6A44AOGN.js → chunk-CBONQM5D.js} +2 -2
- package/dist/cli/chunks/{chunk-73EI4C2E.js → chunk-CQNMGK6Y.js} +2 -2
- package/dist/cli/chunks/{chunk-IIAR5S7Q.js → chunk-CVOQ6ESD.js} +2 -2
- package/dist/cli/chunks/{chunk-6TU7FEMD.js → chunk-DOBKEXMJ.js} +1 -1
- package/dist/cli/chunks/{chunk-BHFR2EXL.js → chunk-DYTQHRUS.js} +1 -1
- package/dist/cli/chunks/{chunk-E4AZXCT5.js → chunk-EADSQN5T.js} +1 -1
- package/dist/cli/chunks/{chunk-CYE2TJFV.js → chunk-EGOIIUBD.js} +2 -2
- package/dist/cli/chunks/{chunk-DKUBQQFG.js → chunk-EIGRV3J6.js} +2 -2
- package/dist/cli/chunks/{chunk-RP2ZKPYV.js → chunk-EJ6MMYLK.js} +1 -1
- package/dist/cli/chunks/{chunk-HSVKZ5KI.js → chunk-ENK44A6Q.js} +2 -2
- package/dist/cli/chunks/{chunk-67YV75XP.js → chunk-EYXE2XKP.js} +2 -2
- package/dist/cli/chunks/{chunk-HYEJJJY3.js → chunk-F2OPFVQH.js} +1 -1
- package/dist/cli/chunks/{chunk-XUR2M2WB.js → chunk-FBZC4IGB.js} +2 -2
- package/dist/cli/chunks/{chunk-BXVAVFGU.js → chunk-FSSR6WBE.js} +2 -2
- package/dist/cli/chunks/{chunk-W2XCZU62.js → chunk-FW4DJ4FJ.js} +1 -1
- package/dist/cli/chunks/{chunk-KKHYJF5U.js → chunk-FYPX5WBJ.js} +1 -1
- package/dist/cli/chunks/{chunk-K7NJHFLZ.js → chunk-G367W7XR.js} +3 -3
- package/dist/cli/chunks/{chunk-IUDWEOLX.js → chunk-GLGKQX2V.js} +2 -2
- package/dist/cli/chunks/{chunk-JVQBWYHW.js → chunk-GV4DYPJP.js} +2 -2
- package/dist/cli/chunks/{chunk-GTKCGPJZ.js → chunk-GVVFTFMB.js} +2 -2
- package/dist/cli/chunks/{chunk-AFEDJ3RU.js → chunk-H5RQPO3X.js} +2 -2
- package/dist/cli/chunks/{chunk-4FWTLJEP.js → chunk-HPWWYT67.js} +2 -2
- package/dist/cli/chunks/{chunk-G3W6BMVJ.js → chunk-HXXHMLJ5.js} +1 -1
- package/dist/cli/chunks/{chunk-NU7UTXMP.js → chunk-HYFQUWNB.js} +2 -2
- package/dist/cli/chunks/chunk-HYOPJHHW.js +2 -0
- package/dist/cli/chunks/{chunk-6LKDHEBY.js → chunk-HZY42OVU.js} +2 -2
- package/dist/cli/chunks/{chunk-C3HQL6S4.js → chunk-IAENZ2DR.js} +2 -2
- package/dist/cli/chunks/{chunk-M23ZOZVY.js → chunk-IEJ7ZV3M.js} +1 -1
- package/dist/cli/chunks/{chunk-RIZVC4XY.js → chunk-IWFFO6VT.js} +2 -2
- package/dist/cli/chunks/chunk-J7AQZLIH.js +21 -0
- package/dist/cli/chunks/{chunk-3KDL6QDK.js → chunk-JHJUSSAU.js} +2 -2
- package/dist/cli/chunks/{chunk-DLF5BOJD.js → chunk-JOZ47MV6.js} +1 -1
- package/dist/cli/chunks/{chunk-ELBZON4V.js → chunk-JZT7BU44.js} +2 -2
- package/dist/cli/chunks/{chunk-3DDXWYMO.js → chunk-KD2BLA5Y.js} +1 -1
- package/dist/cli/chunks/{chunk-VD5IO5EO.js → chunk-KUHLTVWC.js} +1 -1
- package/dist/cli/chunks/{chunk-YDFL445W.js → chunk-LU2EDWQK.js} +2 -2
- package/dist/cli/chunks/chunk-LXZMP3VX.js +736 -0
- package/dist/cli/chunks/{chunk-3YUB5HER.js → chunk-LY7MFGBD.js} +196 -187
- package/dist/cli/chunks/chunk-MM56VPNE.js +180 -0
- package/dist/cli/chunks/{chunk-37TUN44F.js → chunk-MNQN7UZX.js} +2 -2
- package/dist/cli/chunks/{chunk-7DETTOPZ.js → chunk-MQZ53OR3.js} +2 -2
- package/dist/cli/chunks/{chunk-BYG36QC5.js → chunk-MT7UNBZ7.js} +2 -2
- package/dist/cli/chunks/{chunk-JES6R5KP.js → chunk-MZB2UV2O.js} +1 -1
- package/dist/cli/chunks/{chunk-QZMUXJHZ.js → chunk-MZMG6CUJ.js} +2 -2
- package/dist/cli/chunks/chunk-N5XOXPHZ.js +4 -0
- package/dist/cli/chunks/{chunk-RD2VGOUH.js → chunk-NBLDBVAW.js} +1 -1
- package/dist/cli/chunks/{chunk-HVU64GP5.js → chunk-ND4QTZOL.js} +2 -2
- package/dist/cli/chunks/{chunk-SQF6HRXR.js → chunk-NHUGHAY6.js} +1 -1
- package/dist/cli/chunks/{chunk-TUSSPKRM.js → chunk-NOHWJOBS.js} +1 -1
- package/dist/cli/chunks/{chunk-NVYBM3R4.js → chunk-O5V7RHVG.js} +2 -2
- package/dist/cli/chunks/{chunk-6VAZAHQG.js → chunk-O6MO5KMR.js} +2 -2
- package/dist/cli/chunks/{chunk-IUHB5GVS.js → chunk-OAZX6WFU.js} +2 -2
- package/dist/cli/chunks/{chunk-LSUILON7.js → chunk-OEPNNLR4.js} +1 -1
- package/dist/cli/chunks/{chunk-IJHCIXJC.js → chunk-OIDWDGLG.js} +2 -2
- package/dist/cli/chunks/{chunk-CPC7FN52.js → chunk-ON2UTP2U.js} +2 -2
- package/dist/cli/chunks/{chunk-UJWAWIRV.js → chunk-ONR2NXXD.js} +7 -7
- package/dist/cli/chunks/{chunk-7VFY7TUR.js → chunk-OXHF3L2T.js} +2 -2
- package/dist/cli/chunks/{chunk-QYOGD2VW.js → chunk-OZGIOKEA.js} +1 -1
- package/dist/cli/chunks/{chunk-WJTSY5MC.js → chunk-P2UPYSDJ.js} +1 -1
- package/dist/cli/chunks/{chunk-52L77RMG.js → chunk-P7XSPP5D.js} +2 -2
- package/dist/cli/chunks/{chunk-M5AEL7IS.js → chunk-PCJQCEBA.js} +2 -2
- package/dist/cli/chunks/chunk-PELENDDQ.js +2 -0
- package/dist/cli/chunks/{chunk-C3Z4VVHP.js → chunk-PYKY22GC.js} +5 -5
- package/dist/cli/chunks/{chunk-AF4XKLXO.js → chunk-Q3NSU24F.js} +2 -2
- package/dist/cli/chunks/chunk-Q6NTEICT.js +2 -0
- package/dist/cli/chunks/chunk-QFETNCNN.js +12 -0
- package/dist/cli/chunks/{chunk-KYA5LARK.js → chunk-QGOWNVVG.js} +1 -1
- package/dist/cli/chunks/{chunk-Y5L3ES4L.js → chunk-QPLSYEWJ.js} +2 -2
- package/dist/cli/chunks/{chunk-F34OAHOM.js → chunk-QQFQDEUE.js} +2 -2
- package/dist/cli/chunks/{chunk-EFV4ADMO.js → chunk-QUORH2MG.js} +55 -79
- package/dist/cli/chunks/{chunk-QWUXCG2L.js → chunk-QVH5Y7AP.js} +1 -1
- package/dist/cli/chunks/{chunk-I2NENQ44.js → chunk-RC2A4JZ5.js} +2 -2
- package/dist/cli/chunks/{chunk-XZSMZHM2.js → chunk-RDGPXENG.js} +2 -2
- package/dist/cli/chunks/{chunk-N7H767TP.js → chunk-RKI3IQKQ.js} +2 -2
- package/dist/cli/chunks/{chunk-LULD4JV2.js → chunk-RKUAWQOF.js} +2 -2
- package/dist/cli/chunks/chunk-RLW25X66.js +2 -0
- package/dist/cli/chunks/{chunk-UKGXWW64.js → chunk-ROVZSZCS.js} +3 -3
- package/dist/cli/chunks/{chunk-EOR2UT72.js → chunk-RT6O2HW2.js} +2 -2
- package/dist/cli/chunks/{chunk-75QJ5HWE.js → chunk-SM2YJ2AL.js} +2 -2
- package/dist/cli/chunks/{chunk-KO4FNAUR.js → chunk-SRPLERER.js} +3 -3
- package/dist/cli/chunks/{chunk-NRE4NAVA.js → chunk-T77GZF4B.js} +1 -1
- package/dist/cli/chunks/{chunk-R6IU3EWP.js → chunk-TFK2AYIN.js} +2 -2
- package/dist/cli/chunks/chunk-TW3SR4TS.js +2 -0
- package/dist/cli/chunks/{chunk-IYTLXUBO.js → chunk-TXSPBLBT.js} +2 -2
- package/dist/cli/chunks/chunk-UA7TDVL7.js +12 -0
- package/dist/cli/chunks/{chunk-WX6RRIGW.js → chunk-UBJG3IHT.js} +2 -2
- package/dist/cli/chunks/{chunk-NQI7FWCS.js → chunk-UFSVUBTR.js} +2 -2
- package/dist/cli/chunks/{chunk-FUNGTIF2.js → chunk-UOI6ULCH.js} +2 -2
- package/dist/cli/chunks/{chunk-HVXJC3OC.js → chunk-UYUJT6QO.js} +2 -2
- package/dist/cli/chunks/{chunk-KEY43ANX.js → chunk-V5AK56DA.js} +2 -2
- package/dist/cli/chunks/{chunk-XFPPERA2.js → chunk-V6RE4YRQ.js} +2 -2
- package/dist/cli/chunks/{chunk-DDCIYOGT.js → chunk-VW6FRMLW.js} +2 -2
- package/dist/cli/chunks/chunk-VXKWNRGA.js +2 -0
- package/dist/cli/chunks/{chunk-CVMNJSCB.js → chunk-VYDVI6FZ.js} +2 -2
- package/dist/cli/chunks/{chunk-7JZJJA7U.js → chunk-WF6UISKW.js} +3 -3
- package/dist/cli/chunks/{chunk-SQKW3B6B.js → chunk-WIH522AP.js} +1 -1
- package/dist/cli/chunks/{chunk-KLTP5IDB.js → chunk-WOV6XI3A.js} +1 -1
- package/dist/cli/chunks/{chunk-VTOVWHEM.js → chunk-X7ADKL7T.js} +2 -2
- package/dist/cli/chunks/{chunk-SX4JLSLV.js → chunk-XBYQ2BS4.js} +2 -2
- package/dist/cli/chunks/{chunk-E4EYPYR3.js → chunk-XL5KIYE3.js} +2 -2
- package/dist/cli/chunks/{chunk-3VIXOHMS.js → chunk-XWYELBZS.js} +1 -1
- package/dist/cli/chunks/{chunk-YQGPQBCX.js → chunk-XYLQZWF6.js} +2 -2
- package/dist/cli/chunks/{chunk-XEZIIQYJ.js → chunk-Y6AKKQIQ.js} +1 -1
- package/dist/cli/chunks/{chunk-BJPL6THQ.js → chunk-YMW57PEL.js} +1 -1
- package/dist/cli/chunks/{chunk-JSZ663MU.js → chunk-YO4ESCB4.js} +1 -1
- package/dist/cli/chunks/{chunk-AMMQOV35.js → chunk-YRHTQZU4.js} +2 -2
- package/dist/cli/chunks/chunk-Z4Q5PCRZ.js +65 -0
- package/dist/cli/chunks/{chunk-RKOUXVZZ.js → chunk-ZELWDJXT.js} +2 -2
- package/dist/cli/chunks/{chunk-QRCIZFNK.js → chunk-ZQZD55MN.js} +2 -2
- package/dist/cli/chunks/{chunk-UMGFMKDW.js → chunk-ZS4XVJGV.js} +2 -2
- package/dist/cli/chunks/{chunk-6ITZZIQX.js → chunk-ZUB5YOCM.js} +2 -2
- package/dist/cli/chunks/chunk-ZUOVNFXK.js +2 -0
- package/dist/cli/chunks/{chunk-RGGK6VZ7.js → chunk-ZWEKAEEV.js} +1 -1
- package/dist/cli/chunks/{ci-RACDAJMR.js → ci-J3TDK5RA.js} +8 -8
- package/dist/cli/chunks/{ci-output-EHRSZBKG.js → ci-output-RLS32FUY.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-GBV7M5XG.js → circuit-breaker-MRCC7WCM.js} +2 -2
- package/dist/cli/chunks/claude-flow-setup-LIZCEKDF.js +2 -0
- package/dist/cli/chunks/client-3BD2DI4N.js +2 -0
- package/dist/cli/chunks/{cline-installer-W4NMXJSG.js → cline-installer-T7H6R2RC.js} +2 -2
- package/dist/cli/chunks/{code-JWXJMYXB.js → code-XMBLI7OF.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-RVI2IFTM.js → code-index-extractor-QS7BYLEX.js} +2 -2
- package/dist/cli/chunks/{codex-installer-3BORJINH.js → codex-installer-6PGT5FM6.js} +6 -6
- package/dist/cli/chunks/{completions-A55NCTAO.js → completions-2A3WRXY2.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-JCXHGGLY.js → complexity-analyzer-23HOOGJ7.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-PUVFMGYW.js → continuedev-installer-4FSF7B3N.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-4DCMYWHB.js → copilot-installer-A5GRQQUU.js} +2 -2
- package/dist/cli/chunks/core-handlers-C3H2ZCS2.js +2 -0
- package/dist/cli/chunks/{cost-tracker-5TV2GGKY.js → cost-tracker-Z4STQ5VB.js} +2 -2
- package/dist/cli/chunks/{coverage-NNWM7TX3.js → coverage-NUPP6KZZ.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-JCQ7SWDP.js +2 -0
- package/dist/cli/chunks/{cursor-installer-4NCHGJGK.js → cursor-installer-FVJ7ROPJ.js} +2 -2
- package/dist/cli/chunks/{daemon-QIKCXKWO.js → daemon-7ZZA2MMN.js} +4 -4
- package/dist/cli/chunks/{daemon-T4JO4IXP.js → daemon-D662EX5N.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-RPAAIDAD.js → dag-attention-scheduler-IB4TQ2KA.js} +2 -2
- package/dist/cli/chunks/{detect-SBEEVDSN.js → detect-LGLBZN4I.js} +2 -2
- package/dist/cli/chunks/{dist-node-ZHI6NCSU.js → dist-node-Z3OL42YE.js} +2 -2
- package/dist/cli/chunks/{domain-handler-LBC3GJ7Z.js → domain-handler-L3CLNL7U.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-H6IZ5USZ.js → domain-plugins-GQ3V5X6L.js} +2 -2
- package/dist/cli/chunks/domain-transfer-MFCI76IY.js +2 -0
- package/dist/cli/chunks/dream-FTP33IJB.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-AHTR7CRU.js → embed-and-insert-pattern-UGD6USYH.js} +2 -2
- package/dist/cli/chunks/{eval-DZU2KISM.js → eval-3B7UIYGY.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-5IQCWKSL.js → experience-capture-middleware-3RQ4NYY3.js} +3 -3
- package/dist/cli/chunks/{fast-paths-2KLDUWCY.js → fast-paths-QOSAEPYD.js} +2 -2
- package/dist/cli/chunks/{feature-flags-7AC3XDZA.js → feature-flags-3S5TH6P4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-N6UAEZY4.js → feature-flags-TLF4NKOH.js} +2 -2
- package/dist/cli/chunks/{file-discovery-5SDIW4V2.js → file-discovery-AEVMJRNB.js} +2 -2
- package/dist/cli/chunks/{fleet-ZIQCAZ2Y.js → fleet-E6WTXWFL.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-DUMBZJEV.js → gnn-wrapper-MCKH3AUU.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-6HVM6ZMR.js → heartbeat-handler-U7XENHRR.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-HXBJVJL2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-TU6WG2ME.js +2 -0
- package/dist/cli/chunks/hnsw-index-MS5KODD7.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-5DRL5FLX.js → hnsw-legacy-bridge-5GW4SAEI.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-GW67GTCL.js → hnswlib-node-7BLZBK5T.js} +2 -2
- package/dist/cli/chunks/{hooks-QHH6FVO4.js → hooks-F3O2SB6H.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-HT45LBHC.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-7XDCCVG2.js → hypergraph-engine-PV4EKXHB.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-QHF7NOU5.js → hypergraph-handler-VOWO5ZTW.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-AP4AGTG5.js +2 -0
- package/dist/cli/chunks/{init-handler-5UIVOM7K.js → init-handler-ENJ5ONJX.js} +16 -14
- package/dist/cli/chunks/init-wizard-I5DFZUQL.js +2 -0
- package/dist/cli/chunks/kernel-MISPSPPA.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-TGGV6K5Q.js → kilocode-installer-HNNJOOPE.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-4XYBHZWW.js → kiro-installer-UZBIQ3IC.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-L26JESGE.js +2 -0
- package/dist/cli/chunks/{learning-STE5W6BS.js → learning-YMLCVFUT.js} +3 -3
- package/dist/cli/chunks/{llm-router-NKF7J3RI.js → llm-router-YWTARCCT.js} +4 -4
- package/dist/cli/chunks/llm-router-service-MWGC43ZA.js +2 -0
- package/dist/cli/chunks/{load-B2T77UJQ.js → load-DKE3F3IP.js} +2 -2
- package/dist/cli/chunks/load-test-H5ISNNM5.js +2 -0
- package/dist/cli/chunks/mcp-5PSGIUCW.js +2 -0
- package/dist/cli/chunks/{memory-WRFZKG56.js → memory-3L3O6JMM.js} +5 -5
- package/dist/cli/chunks/memory-backend-HWDNOBKW.js +2 -0
- package/dist/cli/chunks/memory-handlers-ZFDVQZM5.js +2 -0
- package/dist/cli/chunks/multi-model-executor-AEEO7IA4.js +14 -0
- package/dist/cli/chunks/{opencode-installer-J36EMQU7.js → opencode-installer-ABBO355U.js} +2 -2
- package/dist/cli/chunks/orchestrator-E36Q7MKE.js +393 -0
- package/dist/cli/chunks/pattern-null-store-GQP6ICWK.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-BVMTWI3E.js → pattern-usage-recorder-H4XKSID4.js} +2 -2
- package/dist/cli/chunks/{pipeline-OWAHDUAQ.js → pipeline-BGFEHXIN.js} +2 -2
- package/dist/cli/chunks/{platform-ANGBFWBV.js → platform-GK7ZVDJI.js} +2 -2
- package/dist/cli/chunks/{plugin-OO7ON2YW.js → plugin-CAH2CKI6.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-HFG3BXWU.js → prime-radiant-advanced-wasm-M5EYRONA.js} +2 -2
- package/dist/cli/chunks/{project-root-LNOYVTYY.js → project-root-BSNZC243.js} +2 -2
- package/dist/cli/chunks/protocol-executor-AD5A4DAI.js +2 -0
- package/dist/cli/chunks/{protocol-handler-CE3Q6LY4.js → protocol-handler-JDSSC2SF.js} +2 -2
- package/dist/cli/chunks/{prove-7XPN53PY.js → prove-ANPTOZJE.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-W3Z2PKTR.js +2 -0
- package/dist/cli/chunks/{quality-TT23JRFX.js → quality-SXWGYRQR.js} +2 -2
- package/dist/cli/chunks/{quality-gate-PPPRP255.js → quality-gate-GYNCA4ZY.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-HQRHLIJX.js +2 -0
- package/dist/cli/chunks/{real-embeddings-EYNZIFJE.js → real-embeddings-WSRYAOZM.js} +2 -2
- package/dist/cli/chunks/{ref-validation-QQR64ZXD.js → ref-validation-AZ3LRWEK.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-UIGS7ZJD.js → roocode-installer-2QKGFIEU.js} +2 -2
- package/dist/cli/chunks/router-MTP5LH4H.js +2 -0
- package/dist/cli/chunks/routing-feedback-GWETVB4L.js +2 -0
- package/dist/cli/chunks/{routing-handler-6AENUIRG.js → routing-handler-UYDC5MMD.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-5AWMEV34.js → ruvector-commands-QXADPVEY.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-4UE5S7WP.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-PHH3HF4Q.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-NWRJ7C22.js → rvf-migration-coordinator-GD4NBFKT.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-KTLZBUWV.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-ISKRP563.js → rvf-store-integrity-7SXG66IL.js} +2 -2
- package/dist/cli/chunks/safe-db-FWWGAPVE.js +2 -0
- package/dist/cli/chunks/schedule-TPA4V4D5.js +2 -0
- package/dist/cli/chunks/scheduler-5ZTEPNDD.js +2 -0
- package/dist/cli/chunks/{security-325A7FMB.js → security-YKB622PK.js} +3 -3
- package/dist/cli/chunks/shared-rvf-adapter-KMLAV7JK.js +2 -0
- package/dist/cli/chunks/{shared-rvf-dual-writer-THFDYS2Z.js → shared-rvf-dual-writer-OYY27DFV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-HPTT624C.js +2 -0
- package/dist/cli/chunks/{standalone-memory-UD4MJ6GZ.js → standalone-memory-2DOABVLC.js} +2 -2
- package/dist/cli/chunks/{status-handler-CPFTN4XL.js → status-handler-EXRKETV7.js} +2 -2
- package/dist/cli/chunks/{structural-health-2MG2IVBL.js → structural-health-2SKK6DU6.js} +2 -2
- package/dist/cli/chunks/sync-DQ2YUNI6.js +2 -0
- package/dist/cli/chunks/{sync-EE4VVKOW.js → sync-UW7SX7GO.js} +2 -2
- package/dist/cli/chunks/{task-handler-7H5OYJG4.js → task-handler-LYQ6WYUY.js} +2 -2
- package/dist/cli/chunks/task-handlers-DIJO232S.js +9 -0
- package/dist/cli/chunks/test-WRHZMUCW.js +33 -0
- package/dist/cli/chunks/{test-scheduling-CHQ4ZLLJ.js → test-scheduling-HI23RXFK.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-23SA6SWZ.js +2 -0
- package/dist/cli/chunks/{token-usage-EBXUJNRB.js → token-usage-M7RRDPXO.js} +2 -2
- package/dist/cli/chunks/{transformers-ZEKS2OJZ.js → transformers-4TC35KKS.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-F4LTKAWD.js +2 -0
- package/dist/cli/chunks/{types-KYAA5VLV.js → types-NBXV6LXQ.js} +2 -2
- package/dist/cli/chunks/unified-memory-OVFEPRPS.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-KKRSCZHR.js +2 -0
- package/dist/cli/chunks/unified-persistence-7GLR4RI3.js +2 -0
- package/dist/cli/chunks/{upgrade-UJBJ5AYM.js → upgrade-4BGOU5RM.js} +2 -2
- package/dist/cli/chunks/{validate-RUV6YMWS.js → validate-EDWAR63H.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-IVEVMGVM.js → validate-swarm-VI72CPR7.js} +2 -2
- package/dist/cli/chunks/visual-security-2FUM5GLI.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-AVWA6HKE.js → web-tree-sitter-Y5XBRQXF.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-DAH7HI2W.js → windsurf-installer-VEX23WAF.js} +2 -2
- package/dist/cli/chunks/witness-chain-3YNL6YGY.js +2 -0
- package/dist/cli/chunks/witness-chain-MH6GA5L6.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-MJZGZRWT.js +2 -0
- package/dist/cli/chunks/witness-chain-verifier-TTJYXTBE.js +2 -0
- package/dist/cli/chunks/{witness-key-manager-JSTBMG43.js → witness-key-manager-EM6YXYOY.js} +2 -2
- package/dist/cli/chunks/{workflow-TWOIA6LZ.js → workflow-2RBDOM7V.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-H6G65YKU.js +2 -0
- package/dist/cli/chunks/wrappers-5OTAVVOV.js +2 -0
- package/dist/cli/commands/audit.d.ts +20 -2
- package/dist/cli/commands/audit.js +158 -16
- package/dist/cli/commands/ci.js +1 -1
- package/dist/cli/commands/claude-flow-setup.js +5 -4
- package/dist/cli/commands/test.js +18 -3
- package/dist/cli/handlers/init-handler.d.ts +2 -0
- package/dist/cli/handlers/init-handler.js +8 -2
- package/dist/cli/index.js +10 -1
- package/dist/coordination/handlers/test-execution-handlers.js +13 -8
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/queen-event-handlers.js +9 -6
- package/dist/coordination/result-saver.js +1 -1
- package/dist/coordination/services/index.d.ts +1 -1
- package/dist/coordination/services/task-audit-logger.d.ts +38 -13
- package/dist/coordination/services/task-audit-logger.js +33 -5
- package/dist/coordination/task-executor.d.ts +5 -0
- package/dist/coordination/task-executor.js +10 -5
- package/dist/domains/test-generation/coordinator.js +6 -5
- package/dist/domains/test-generation/interfaces.d.ts +11 -1
- package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
- package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
- package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
- package/dist/domains/test-generation/services/behavior-examples.js +65 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
- package/dist/domains/test-generation/services/test-generator.js +59 -30
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
- package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
- package/dist/init/agents-installer.d.ts +4 -0
- package/dist/init/agents-installer.js +24 -11
- package/dist/init/browser-engine-installer.d.ts +5 -5
- package/dist/init/browser-engine-installer.js +28 -6
- 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/init-wizard.d.ts +2 -0
- package/dist/init/orchestrator.js +1 -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/09-assets.js +8 -18
- package/dist/init/phases/10-workers.js +7 -5
- package/dist/init/phases/12-verification.js +7 -2
- package/dist/init/phases/phase-interface.d.ts +2 -0
- 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/agentic-flow/reasoning-bank/index.d.ts +2 -5
- 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/integrations/vibium/client.d.ts +1 -0
- package/dist/integrations/vibium/client.js +24 -11
- package/dist/integrations/vibium/runtime.d.ts +14 -0
- package/dist/integrations/vibium/runtime.js +94 -0
- package/dist/kernel/kernel.js +3 -2
- package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
- package/dist/kernel/pattern-fts-self-heal.js +193 -0
- package/dist/kernel/process-lifecycle.d.ts +60 -0
- package/dist/kernel/process-lifecycle.js +91 -0
- package/dist/kernel/unified-memory-schemas.d.ts +15 -1
- package/dist/kernel/unified-memory-schemas.js +53 -25
- package/dist/kernel/unified-memory.js +31 -34
- package/dist/kernel/unified-persistence.js +12 -6
- package/dist/learning/experience-capture.d.ts +2 -1
- package/dist/learning/experience-capture.js +23 -8
- package/dist/learning/pattern-store.d.ts +12 -1
- package/dist/learning/pattern-store.js +45 -30
- package/dist/learning/qe-patterns.d.ts +12 -0
- package/dist/learning/qe-patterns.js +7 -1
- package/dist/learning/qe-reasoning-bank.d.ts +1 -0
- package/dist/learning/qe-reasoning-bank.js +17 -4
- package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
- package/dist/learning/real-qe-reasoning-bank.js +28 -4
- package/dist/learning/rvf-pattern-store.js +36 -23
- package/dist/learning/sqlite-persistence.d.ts +8 -1
- package/dist/learning/sqlite-persistence.js +58 -33
- 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 +522 -545
- package/dist/mcp/entry.js +52 -6
- package/dist/mcp/handlers/core-handlers.js +5 -4
- package/dist/mcp/handlers/domain-handler-configs.js +12 -4
- package/dist/mcp/handlers/task-handlers.js +11 -7
- package/dist/mcp/protocol-server.js +20 -4
- package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
- package/dist/mcp/services/reasoning-bank-service.js +5 -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/tools/test-execution/e2e-execute.js +9 -1
- package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
- package/dist/mcp/tools/test-generation/generate.js +8 -0
- package/dist/mcp/types.d.ts +10 -4
- 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/dist/shared/error-utils.d.ts +15 -0
- package/dist/shared/error-utils.js +21 -0
- package/dist/shared/events/domain-events.d.ts +2 -1
- package/package.json +10 -6
- 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-3EZ5DR2R.js +0 -21
- 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-CZO4BJG5.js +0 -2
- package/dist/cli/chunks/chunk-J27F4NSB.js +0 -2
- package/dist/cli/chunks/chunk-J5UNP6W3.js +0 -2
- package/dist/cli/chunks/chunk-MI5Q55DG.js +0 -65
- package/dist/cli/chunks/chunk-TY5WC3FT.js +0 -12
- package/dist/cli/chunks/chunk-UDHVCKGA.js +0 -5
- package/dist/cli/chunks/chunk-XQSIRBKT.js +0 -180
- package/dist/cli/chunks/chunk-YXP6BKGS.js +0 -730
- package/dist/cli/chunks/chunk-ZBABIZ2D.js +0 -2
- package/dist/cli/chunks/chunk-ZCWERUYB.js +0 -12
- 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/task-handlers-NH4GJHCJ.js +0 -9
- package/dist/cli/chunks/test-MPHGT4T6.js +0 -33
- 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/vibium-HOGMFJ2Z.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
|
@@ -254,7 +254,48 @@ export const DREAM_SCHEMA = `
|
|
|
254
254
|
CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);
|
|
255
255
|
CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);
|
|
256
256
|
`;
|
|
257
|
-
|
|
257
|
+
// ============================================================================
|
|
258
|
+
// qe_patterns FTS5 index (single source of truth)
|
|
259
|
+
// ============================================================================
|
|
260
|
+
//
|
|
261
|
+
// Shared by QE_PATTERNS_SCHEMA, the v9 migration, the legacy SQLitePatternStore
|
|
262
|
+
// schema and the on-open self-heal (pattern-fts-self-heal.ts), so the DDL can't
|
|
263
|
+
// drift between paths. External-content table: the index stores no text of its
|
|
264
|
+
// own and is kept in sync ONLY by the three triggers below.
|
|
265
|
+
/** FTS5 external-content index over qe_patterns (hybrid vector/text search). */
|
|
266
|
+
export const QE_PATTERNS_FTS_TABLE_DDL = `
|
|
267
|
+
CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(
|
|
268
|
+
name, description, pattern_type, qe_domain,
|
|
269
|
+
content='qe_patterns',
|
|
270
|
+
content_rowid='rowid'
|
|
271
|
+
);
|
|
272
|
+
`;
|
|
273
|
+
/** Sync triggers keeping qe_patterns_fts in step with qe_patterns, keyed by name. */
|
|
274
|
+
export const QE_PATTERNS_FTS_TRIGGER_DDL = Object.freeze({
|
|
275
|
+
qe_patterns_fts_insert: `
|
|
276
|
+
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_insert AFTER INSERT ON qe_patterns BEGIN
|
|
277
|
+
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
278
|
+
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
279
|
+
END;
|
|
280
|
+
`,
|
|
281
|
+
qe_patterns_fts_delete: `
|
|
282
|
+
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_delete AFTER DELETE ON qe_patterns BEGIN
|
|
283
|
+
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
284
|
+
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
285
|
+
END;
|
|
286
|
+
`,
|
|
287
|
+
qe_patterns_fts_update: `
|
|
288
|
+
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_update AFTER UPDATE ON qe_patterns BEGIN
|
|
289
|
+
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
290
|
+
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
291
|
+
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
292
|
+
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
293
|
+
END;
|
|
294
|
+
`,
|
|
295
|
+
});
|
|
296
|
+
/** FTS5 table plus all sync triggers (idempotent). Requires qe_patterns to exist. */
|
|
297
|
+
export const QE_PATTERNS_FTS_SCHEMA = QE_PATTERNS_FTS_TABLE_DDL + Object.values(QE_PATTERNS_FTS_TRIGGER_DDL).join('');
|
|
298
|
+
const qePatternsSchema = (ftsSchema) => `
|
|
258
299
|
-- QE Patterns table (unified from sqlite-persistence.ts)
|
|
259
300
|
CREATE TABLE IF NOT EXISTS qe_patterns (
|
|
260
301
|
id TEXT PRIMARY KEY,
|
|
@@ -367,30 +408,8 @@ export const QE_PATTERNS_SCHEMA = `
|
|
|
367
408
|
FOREIGN KEY (execution_id) REFERENCES execution_results(id)
|
|
368
409
|
);
|
|
369
410
|
|
|
370
|
-
-- FTS5 full-text search index for hybrid vector/text search
|
|
371
|
-
|
|
372
|
-
name, description, pattern_type, qe_domain,
|
|
373
|
-
content='qe_patterns',
|
|
374
|
-
content_rowid='rowid'
|
|
375
|
-
);
|
|
376
|
-
|
|
377
|
-
-- FTS5 triggers to keep index in sync
|
|
378
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_insert AFTER INSERT ON qe_patterns BEGIN
|
|
379
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
380
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
381
|
-
END;
|
|
382
|
-
|
|
383
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_delete AFTER DELETE ON qe_patterns BEGIN
|
|
384
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
385
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
386
|
-
END;
|
|
387
|
-
|
|
388
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_update AFTER UPDATE ON qe_patterns BEGIN
|
|
389
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
390
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
391
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
392
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
393
|
-
END;
|
|
411
|
+
-- FTS5 full-text search index + sync triggers for hybrid vector/text search
|
|
412
|
+
${ftsSchema}
|
|
394
413
|
|
|
395
414
|
-- QE Patterns indexes
|
|
396
415
|
CREATE INDEX IF NOT EXISTS idx_qe_patterns_domain ON qe_patterns(qe_domain);
|
|
@@ -407,6 +426,15 @@ export const QE_PATTERNS_SCHEMA = `
|
|
|
407
426
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_execution ON executed_steps(execution_id);
|
|
408
427
|
CREATE INDEX IF NOT EXISTS idx_executed_steps_action ON executed_steps(action_id);
|
|
409
428
|
`;
|
|
429
|
+
export const QE_PATTERNS_SCHEMA = qePatternsSchema(QE_PATTERNS_FTS_SCHEMA);
|
|
430
|
+
/**
|
|
431
|
+
* QE_PATTERNS_SCHEMA without the FTS5 table/triggers, for migrations that run
|
|
432
|
+
* after v9 on an existing DB. Re-creating the sync triggers there (with
|
|
433
|
+
* CREATE TRIGGER IF NOT EXISTS, no rebuild) would hide "triggers were missing"
|
|
434
|
+
* from the on-open self-heal, leaving UPDATE-only drift unrepaired; the heal
|
|
435
|
+
* creates any missing FTS objects and rebuilds instead.
|
|
436
|
+
*/
|
|
437
|
+
export const QE_PATTERNS_SCHEMA_WITHOUT_FTS = qePatternsSchema('');
|
|
410
438
|
export const MINCUT_SCHEMA = `
|
|
411
439
|
-- MinCut Graph Snapshots (ADR-047)
|
|
412
440
|
CREATE TABLE IF NOT EXISTS mincut_snapshots (
|
|
@@ -41,7 +41,8 @@ export { BinaryHeap, UnifiedHnswIndex, createHnswIndex } from './unified-memory-
|
|
|
41
41
|
// parity tests or benchmarks only.
|
|
42
42
|
import { UnifiedHnswIndex } from './unified-memory-hnsw.js';
|
|
43
43
|
// Import schemas
|
|
44
|
-
import { SCHEMA_VERSION, SCHEMA_VERSION_TABLE, KV_STORE_SCHEMA, VECTORS_SCHEMA, RL_QVALUES_SCHEMA, GOAP_SCHEMA, DREAM_SCHEMA, QE_PATTERNS_SCHEMA, MINCUT_SCHEMA, SONA_PATTERNS_SCHEMA, FEEDBACK_SCHEMA, HYPERGRAPH_SCHEMA, PATTERN_NULLS_SCHEMA, STATS_TABLES, } from './unified-memory-schemas.js';
|
|
44
|
+
import { SCHEMA_VERSION, SCHEMA_VERSION_TABLE, KV_STORE_SCHEMA, VECTORS_SCHEMA, RL_QVALUES_SCHEMA, GOAP_SCHEMA, DREAM_SCHEMA, QE_PATTERNS_SCHEMA, QE_PATTERNS_FTS_SCHEMA, QE_PATTERNS_SCHEMA_WITHOUT_FTS, MINCUT_SCHEMA, SONA_PATTERNS_SCHEMA, FEEDBACK_SCHEMA, HYPERGRAPH_SCHEMA, PATTERN_NULLS_SCHEMA, STATS_TABLES, } from './unified-memory-schemas.js';
|
|
45
|
+
import { ensurePatternFtsInSync } from './pattern-fts-self-heal.js';
|
|
45
46
|
import { applyMigration as applyLearningEvidenceMigration } from '../migrations/20260830_add_learning_evidence_tables.js';
|
|
46
47
|
// CRDT imports for distributed state synchronization
|
|
47
48
|
import { createCRDTStore, } from '../memory/crdt/index.js';
|
|
@@ -55,6 +56,7 @@ import { createCRDTStore, } from '../memory/crdt/index.js';
|
|
|
55
56
|
// working unchanged. Imported (not bare re-exported) so internal callers below
|
|
56
57
|
// have a usable local binding.
|
|
57
58
|
import { findProjectRoot, clearProjectRootCache } from './project-root.js';
|
|
59
|
+
import { registerStoreCloser, requestOwnedShutdown } from './process-lifecycle.js';
|
|
58
60
|
export { findProjectRoot, clearProjectRootCache };
|
|
59
61
|
/**
|
|
60
62
|
* Get the default database path using project root detection.
|
|
@@ -276,6 +278,9 @@ export class UnifiedMemoryManager {
|
|
|
276
278
|
signal.throwIfAborted();
|
|
277
279
|
}
|
|
278
280
|
await this.runMigrations();
|
|
281
|
+
// Not gated on schema version: repairs missing qe_patterns_fts sync
|
|
282
|
+
// triggers / index drift on every open. Never throws; silent when healthy.
|
|
283
|
+
ensurePatternFtsInSync(this.db, { logPrefix: '[UnifiedMemory]' });
|
|
279
284
|
signal?.throwIfAborted();
|
|
280
285
|
// DATA LOSS PREVENTION: After migration, if the DB existed before and was
|
|
281
286
|
// large (>1MB = has real data), but now qe_patterns is empty, something
|
|
@@ -451,36 +456,13 @@ export class UnifiedMemoryManager {
|
|
|
451
456
|
if (currentVersion < 8)
|
|
452
457
|
this.db.exec(FEEDBACK_SCHEMA);
|
|
453
458
|
if (currentVersion < 9) {
|
|
454
|
-
// Add FTS5 full-text search for qe_patterns (hybrid vector/text search)
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_insert AFTER INSERT ON qe_patterns BEGIN
|
|
463
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
464
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
465
|
-
END;
|
|
466
|
-
|
|
467
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_delete AFTER DELETE ON qe_patterns BEGIN
|
|
468
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
469
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
470
|
-
END;
|
|
471
|
-
|
|
472
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_update AFTER UPDATE ON qe_patterns BEGIN
|
|
473
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
474
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
475
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
476
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
477
|
-
END;
|
|
478
|
-
`);
|
|
479
|
-
// Populate FTS5 index from existing patterns
|
|
480
|
-
this.db.exec(`
|
|
481
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
482
|
-
SELECT rowid, name, description, pattern_type, qe_domain FROM qe_patterns;
|
|
483
|
-
`);
|
|
459
|
+
// Add FTS5 full-text search for qe_patterns (hybrid vector/text search).
|
|
460
|
+
// DDL shared with QE_PATTERNS_SCHEMA and the on-open self-heal.
|
|
461
|
+
this.db.exec(QE_PATTERNS_FTS_SCHEMA);
|
|
462
|
+
// Populate the index from existing patterns. 'rebuild' rather than a
|
|
463
|
+
// raw INSERT...SELECT so it's idempotent when QE_PATTERNS_SCHEMA's
|
|
464
|
+
// triggers already indexed some rows.
|
|
465
|
+
this.db.exec(`INSERT INTO qe_patterns_fts(qe_patterns_fts) VALUES('rebuild')`);
|
|
484
466
|
}
|
|
485
467
|
if (currentVersion < 10)
|
|
486
468
|
this.db.exec(PATTERN_NULLS_SCHEMA);
|
|
@@ -810,7 +792,9 @@ export class UnifiedMemoryManager {
|
|
|
810
792
|
const db = this.db;
|
|
811
793
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_pattern_embeddings'").get();
|
|
812
794
|
if (!table) {
|
|
813
|
-
|
|
795
|
+
// FTS objects are left to ensurePatternFtsInSync (runs after migrations)
|
|
796
|
+
// so missing triggers are still seen and the index is rebuilt.
|
|
797
|
+
db.exec(QE_PATTERNS_SCHEMA_WITHOUT_FTS);
|
|
814
798
|
return;
|
|
815
799
|
}
|
|
816
800
|
const columns = db.prepare("PRAGMA table_info('qe_pattern_embeddings')").all();
|
|
@@ -1091,8 +1075,21 @@ function registerExitHandlers() {
|
|
|
1091
1075
|
}
|
|
1092
1076
|
};
|
|
1093
1077
|
process.on('beforeExit', cleanup);
|
|
1094
|
-
|
|
1095
|
-
|
|
1078
|
+
// A claimed lifecycle owner (the MCP server) closes this store at the end of
|
|
1079
|
+
// its shutdown on every path (EOF, JSON-RPC shutdown, signals, watchdog), so
|
|
1080
|
+
// the WAL is checkpointed into memory.db. close() is idempotent.
|
|
1081
|
+
registerStoreCloser(cleanup);
|
|
1082
|
+
const onSignal = (signal) => {
|
|
1083
|
+
// #801: when a lifecycle owner is claimed, its graceful shutdown may still
|
|
1084
|
+
// need this store, and exiting here would pre-empt it. The owner closes it
|
|
1085
|
+
// through the closer registered above.
|
|
1086
|
+
if (requestOwnedShutdown(signal))
|
|
1087
|
+
return;
|
|
1088
|
+
cleanup();
|
|
1089
|
+
process.exit(0);
|
|
1090
|
+
};
|
|
1091
|
+
process.on('SIGINT', onSignal);
|
|
1092
|
+
process.on('SIGTERM', onSignal);
|
|
1096
1093
|
}
|
|
1097
1094
|
registerExitHandlers();
|
|
1098
1095
|
//# sourceMappingURL=unified-memory.js.map
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import { toErrorMessage } from '../shared/error-utils.js';
|
|
22
22
|
import { getUnifiedMemory, resetUnifiedMemory, DEFAULT_UNIFIED_MEMORY_CONFIG, } from './unified-memory.js';
|
|
23
23
|
import { MEMORY_CONSTANTS } from './constants.js';
|
|
24
|
+
import { registerStoreCloser, requestOwnedShutdown } from './process-lifecycle.js';
|
|
24
25
|
// Use same path as unified-memory for true unification
|
|
25
26
|
export const DEFAULT_UNIFIED_CONFIG = {
|
|
26
27
|
dbPath: DEFAULT_UNIFIED_MEMORY_CONFIG.dbPath, // '.agentic-qe/memory.db'
|
|
@@ -254,14 +255,19 @@ function registerExitHandlers() {
|
|
|
254
255
|
}
|
|
255
256
|
};
|
|
256
257
|
process.on('beforeExit', cleanup);
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
// Closed by a claimed lifecycle owner (the MCP server) at the end of its
|
|
259
|
+
// shutdown on every path; registered after unified memory, so it closes first.
|
|
260
|
+
registerStoreCloser(cleanup);
|
|
261
|
+
const onSignal = (signal) => {
|
|
262
|
+
// #801: defer to a claimed lifecycle owner instead of exiting under its
|
|
263
|
+
// graceful shutdown; the owner closes the facade via the closer above.
|
|
264
|
+
if (requestOwnedShutdown(signal))
|
|
265
|
+
return;
|
|
262
266
|
cleanup();
|
|
263
267
|
process.exit(0);
|
|
264
|
-
}
|
|
268
|
+
};
|
|
269
|
+
process.on('SIGINT', onSignal);
|
|
270
|
+
process.on('SIGTERM', onSignal);
|
|
265
271
|
}
|
|
266
272
|
// Register exit handlers when module is loaded
|
|
267
273
|
registerExitHandlers();
|
|
@@ -301,8 +301,9 @@ export declare class ExperienceCaptureService {
|
|
|
301
301
|
*/
|
|
302
302
|
private detectPatternType;
|
|
303
303
|
/**
|
|
304
|
-
*
|
|
304
|
+
* Stable lookup identity; verify full origin metadata before reinforcement.
|
|
305
305
|
*/
|
|
306
|
+
private experienceIdentity;
|
|
306
307
|
private generatePatternName;
|
|
307
308
|
/**
|
|
308
309
|
* Extract tags from experience
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - Pattern promotion after threshold uses
|
|
13
13
|
* - Cross-domain experience sharing
|
|
14
14
|
*/
|
|
15
|
+
import { createHash } from 'node:crypto';
|
|
15
16
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
17
|
import { ok, err } from '../shared/types/index.js';
|
|
17
18
|
import { LoggerFactory } from '../logging/index.js';
|
|
@@ -373,16 +374,23 @@ export class ExperienceCaptureService {
|
|
|
373
374
|
if (!this.patternStore) {
|
|
374
375
|
return { newPattern: false, reinforced: false, promoted: false };
|
|
375
376
|
}
|
|
376
|
-
//
|
|
377
|
-
|
|
377
|
+
// Reinforcement records repeated observations of the exact originating task;
|
|
378
|
+
// lexical relevance is not a semantic reuse oracle.
|
|
379
|
+
const identity = this.experienceIdentity(experience);
|
|
380
|
+
const searchResult = await this.patternStore.search(identity, {
|
|
378
381
|
limit: 1,
|
|
379
382
|
domain: experience.domain,
|
|
380
|
-
|
|
383
|
+
patternType: this.detectPatternType(experience.task),
|
|
384
|
+
useVectorSearch: false,
|
|
381
385
|
});
|
|
382
386
|
if (searchResult.success && searchResult.value.length > 0) {
|
|
383
387
|
const existing = searchResult.value[0];
|
|
384
|
-
|
|
385
|
-
if (
|
|
388
|
+
const origin = existing.pattern.context?.experienceOrigin;
|
|
389
|
+
if (origin?.task === experience.task
|
|
390
|
+
&& origin.domain === (experience.domain ?? null)
|
|
391
|
+
&& origin.patternType === this.detectPatternType(experience.task)
|
|
392
|
+
&& existing.pattern.patternType === origin.patternType
|
|
393
|
+
&& (!experience.domain || existing.pattern.qeDomain === experience.domain)) {
|
|
386
394
|
const usageResult = await this.patternStore.recordUsage(existing.pattern.id, experience.success);
|
|
387
395
|
// Check if pattern should be promoted (short-term → long-term)
|
|
388
396
|
const pattern = await this.patternStore.get(existing.pattern.id);
|
|
@@ -590,10 +598,12 @@ ${stepDescriptions}
|
|
|
590
598
|
Duration: ${experience.durationMs}ms`;
|
|
591
599
|
return {
|
|
592
600
|
patternType,
|
|
601
|
+
qeDomain: experience.domain,
|
|
593
602
|
name: this.generatePatternName(experience),
|
|
594
603
|
description: `Pattern extracted from: ${experience.task}`,
|
|
595
604
|
context: {
|
|
596
|
-
tags: this.extractTags(experience),
|
|
605
|
+
tags: [...this.extractTags(experience), this.experienceIdentity(experience)],
|
|
606
|
+
experienceOrigin: { task: experience.task, domain: experience.domain ?? null, patternType },
|
|
597
607
|
testType: this.detectTestType(experience.task),
|
|
598
608
|
},
|
|
599
609
|
template: {
|
|
@@ -657,8 +667,13 @@ Duration: ${experience.durationMs}ms`;
|
|
|
657
667
|
return 'test-template'; // Default
|
|
658
668
|
}
|
|
659
669
|
/**
|
|
660
|
-
*
|
|
670
|
+
* Stable lookup identity; verify full origin metadata before reinforcement.
|
|
661
671
|
*/
|
|
672
|
+
experienceIdentity(experience) {
|
|
673
|
+
return createHash('sha256').update(JSON.stringify([
|
|
674
|
+
experience.task, experience.domain ?? null, this.detectPatternType(experience.task),
|
|
675
|
+
])).digest('hex');
|
|
676
|
+
}
|
|
662
677
|
generatePatternName(experience) {
|
|
663
678
|
// Take first 50 chars of task, sanitize
|
|
664
679
|
const sanitized = experience.task
|
|
@@ -666,7 +681,7 @@ Duration: ${experience.durationMs}ms`;
|
|
|
666
681
|
.slice(0, 50)
|
|
667
682
|
.trim();
|
|
668
683
|
const domain = experience.domain ? `[${experience.domain}] ` : '';
|
|
669
|
-
return `${domain}${sanitized}`;
|
|
684
|
+
return `${domain}${sanitized} ${this.experienceIdentity(experience)}`;
|
|
670
685
|
}
|
|
671
686
|
/**
|
|
672
687
|
* Extract tags from experience
|
|
@@ -128,6 +128,11 @@ export interface PatternSearchOptions {
|
|
|
128
128
|
useVectorSearch?: boolean;
|
|
129
129
|
/** Provenance of a pre-computed query vector. Required for semantic ranking. */
|
|
130
130
|
embeddingSpaceId?: string;
|
|
131
|
+
/**
|
|
132
|
+
* Original text of a pre-computed query vector (#653). Lets FTS5 lexical
|
|
133
|
+
* scoring participate when the caller embedded the text before searching.
|
|
134
|
+
*/
|
|
135
|
+
textQuery?: string;
|
|
131
136
|
/**
|
|
132
137
|
* Composable metadata filter expression (Task 1.2: ruvector-filter).
|
|
133
138
|
* Applied post-search to refine results by domain, severity,
|
|
@@ -150,7 +155,7 @@ export interface PatternSearchResult {
|
|
|
150
155
|
/** Match score (0-1) */
|
|
151
156
|
score: number;
|
|
152
157
|
/** How the pattern was matched */
|
|
153
|
-
matchType: 'vector' | 'exact' | 'context';
|
|
158
|
+
matchType: 'vector' | 'exact' | 'lexical' | 'context';
|
|
154
159
|
/** Similarity score for vector matches (ADR-042) */
|
|
155
160
|
similarity: number;
|
|
156
161
|
/** Whether this pattern can be reused to skip LLM calls (ADR-042) */
|
|
@@ -386,6 +391,12 @@ export declare class PatternStore implements IPatternStore {
|
|
|
386
391
|
*/
|
|
387
392
|
searchHyperbolic(query: Float32Array | number[], k?: number): Promise<Result<PatternSearchResult[]>>;
|
|
388
393
|
}
|
|
394
|
+
/**
|
|
395
|
+
* Hybrid score for a hit found by both vector and FTS5 search (#653):
|
|
396
|
+
* 75% vector + 25% BM25, but lexical agreement may only raise the vector
|
|
397
|
+
* score — a weak BM25 match must not demote a near-identical vector hit.
|
|
398
|
+
*/
|
|
399
|
+
export declare function blendFtsScore(vectorScore: number, ftsScore: number): number;
|
|
389
400
|
/**
|
|
390
401
|
* Create a new pattern store instance.
|
|
391
402
|
*
|
|
@@ -60,10 +60,12 @@ function getHDCTokenFingerprinter() {
|
|
|
60
60
|
/** Module-level Hopfield memory for exact pattern recall */
|
|
61
61
|
let hopfieldMemory = null;
|
|
62
62
|
let hopfieldDimension = 0;
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
let hopfieldSpaceId;
|
|
64
|
+
function getHopfieldMemory(dimension, spaceId) {
|
|
65
|
+
if (!hopfieldMemory || hopfieldDimension !== dimension || hopfieldSpaceId !== spaceId) {
|
|
65
66
|
hopfieldMemory = createHopfieldMemory({ dimension, maxPatterns: 10000 });
|
|
66
67
|
hopfieldDimension = dimension;
|
|
68
|
+
hopfieldSpaceId = spaceId;
|
|
67
69
|
}
|
|
68
70
|
return hopfieldMemory;
|
|
69
71
|
}
|
|
@@ -564,9 +566,9 @@ export class PatternStore {
|
|
|
564
566
|
console.debug(`[PatternStore] HDC token fingerprint failed for ${pattern.id}:`, toErrorMessage(error));
|
|
565
567
|
}
|
|
566
568
|
// R5: Store embedding in Hopfield memory for exact recall
|
|
567
|
-
if (isHopfieldMemoryEnabled() && pattern.embedding) {
|
|
569
|
+
if (isHopfieldMemoryEnabled() && pattern.embedding && activeSpaceId) {
|
|
568
570
|
try {
|
|
569
|
-
const hopfield = getHopfieldMemory(pattern.embedding.length);
|
|
571
|
+
const hopfield = getHopfieldMemory(pattern.embedding.length, activeSpaceId);
|
|
570
572
|
hopfield.store(new Float32Array(pattern.embedding), {
|
|
571
573
|
id: pattern.id,
|
|
572
574
|
name: pattern.name,
|
|
@@ -717,10 +719,14 @@ export class PatternStore {
|
|
|
717
719
|
const limit = options.limit || 10;
|
|
718
720
|
const results = [];
|
|
719
721
|
try {
|
|
722
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId;
|
|
723
|
+
if (Array.isArray(query) && (!activeSpaceId || options.embeddingSpaceId !== activeSpaceId)) {
|
|
724
|
+
throw new Error('VECTOR_SPACE_UNVERIFIED: pre-computed query vectors require the active embeddingSpaceId');
|
|
725
|
+
}
|
|
720
726
|
// R5: Exact recall via Hopfield — check for high-confidence exact match
|
|
721
|
-
if (Array.isArray(query) && isHopfieldMemoryEnabled()) {
|
|
727
|
+
if (Array.isArray(query) && options.useVectorSearch !== false && activeSpaceId && isHopfieldMemoryEnabled()) {
|
|
722
728
|
try {
|
|
723
|
-
const hopfield = getHopfieldMemory(query.length);
|
|
729
|
+
const hopfield = getHopfieldMemory(query.length, activeSpaceId);
|
|
724
730
|
if (hopfield.getPatternCount() > 0) {
|
|
725
731
|
const recallResult = hopfield.recall(new Float32Array(query));
|
|
726
732
|
if (recallResult && recallResult.similarity > 0.98) {
|
|
@@ -747,10 +753,6 @@ export class PatternStore {
|
|
|
747
753
|
}
|
|
748
754
|
// Vector search if query is embedding and HNSW available (lazy-load)
|
|
749
755
|
if (Array.isArray(query) && options.useVectorSearch !== false) {
|
|
750
|
-
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId;
|
|
751
|
-
if (!activeSpaceId || options.embeddingSpaceId !== activeSpaceId) {
|
|
752
|
-
throw new Error('VECTOR_SPACE_UNVERIFIED: pre-computed query vectors require the active embeddingSpaceId');
|
|
753
|
-
}
|
|
754
756
|
const hnsw = await this.ensureHNSW();
|
|
755
757
|
if (hnsw) {
|
|
756
758
|
const hnswResults = await hnsw.search(query, limit * 2);
|
|
@@ -772,18 +774,19 @@ export class PatternStore {
|
|
|
772
774
|
}
|
|
773
775
|
}
|
|
774
776
|
// FTS5 hybrid search: blend BM25 text relevance with vector similarity
|
|
775
|
-
//
|
|
776
|
-
|
|
777
|
+
// (see blendFtsScore) for patterns found by both
|
|
778
|
+
const ftsText = typeof query === 'string' ? query : options.textQuery;
|
|
779
|
+
if (ftsText?.trim() && this.sqliteStore) {
|
|
777
780
|
try {
|
|
778
|
-
const ftsResults = this.sqliteStore.searchFTS(
|
|
781
|
+
const ftsResults = this.sqliteStore.searchFTS(ftsText, limit * 2);
|
|
779
782
|
if (ftsResults.length > 0) {
|
|
780
|
-
const ftsScoreMap = new Map(ftsResults.map(r => [r.id, r.ftsScore]));
|
|
783
|
+
const ftsScoreMap = new Map(ftsResults.map(r => [r.id, r.ftsScore * r.coverage]));
|
|
781
784
|
const existingIds = new Set(results.map(r => r.pattern.id));
|
|
782
785
|
// Boost existing vector results that also match FTS5
|
|
783
786
|
for (const result of results) {
|
|
784
787
|
const ftsScore = ftsScoreMap.get(result.pattern.id);
|
|
785
788
|
if (ftsScore !== undefined) {
|
|
786
|
-
result.score =
|
|
789
|
+
result.score = blendFtsScore(result.score, ftsScore);
|
|
787
790
|
}
|
|
788
791
|
}
|
|
789
792
|
// Add FTS5-only results not already in vector results
|
|
@@ -792,15 +795,18 @@ export class PatternStore {
|
|
|
792
795
|
continue;
|
|
793
796
|
const pattern = await this.get(ftsResult.id);
|
|
794
797
|
if (pattern && this.matchesFilters(pattern, options)) {
|
|
795
|
-
|
|
798
|
+
// Relative BM25 is weighted by query coverage for ranking;
|
|
799
|
+
// lexical evidence alone never authorizes vector reuse.
|
|
800
|
+
const keywordScore = 0.5 * ftsResult.ftsScore * ftsResult.coverage;
|
|
801
|
+
const similarity = 0; // Lexical relevance is not vector similarity or safe reuse.
|
|
796
802
|
results.push({
|
|
797
803
|
pattern,
|
|
798
|
-
score:
|
|
799
|
-
matchType: '
|
|
800
|
-
similarity
|
|
801
|
-
canReuse:
|
|
802
|
-
estimatedTokenSavings:
|
|
803
|
-
reuseConfidence:
|
|
804
|
+
score: keywordScore,
|
|
805
|
+
matchType: 'lexical',
|
|
806
|
+
similarity,
|
|
807
|
+
canReuse: false,
|
|
808
|
+
estimatedTokenSavings: 0,
|
|
809
|
+
reuseConfidence: 0,
|
|
804
810
|
});
|
|
805
811
|
}
|
|
806
812
|
}
|
|
@@ -812,7 +818,9 @@ export class PatternStore {
|
|
|
812
818
|
}
|
|
813
819
|
// Text search fallback or additional
|
|
814
820
|
if (typeof query === 'string' || results.length < limit) {
|
|
815
|
-
|
|
821
|
+
// #653: with the caller's text, pad with text matches rather than
|
|
822
|
+
// unrelated patterns ranked by quality score alone.
|
|
823
|
+
const textResults = await this.searchByText(ftsText ?? '', options, limit - results.length);
|
|
816
824
|
// Deduplicate: only add text results not already present
|
|
817
825
|
const existingIds = new Set(results.map(r => r.pattern.id));
|
|
818
826
|
for (const tr of textResults) {
|
|
@@ -964,15 +972,14 @@ export class PatternStore {
|
|
|
964
972
|
score = pattern.qualityScore;
|
|
965
973
|
}
|
|
966
974
|
if (score > 0 || !queryLower) {
|
|
967
|
-
const reuseInfo = this.calculateReuseInfo(pattern, score);
|
|
968
975
|
results.push({
|
|
969
976
|
pattern,
|
|
970
|
-
score: score
|
|
971
|
-
matchType: queryLower ? '
|
|
972
|
-
similarity:
|
|
973
|
-
canReuse:
|
|
974
|
-
estimatedTokenSavings:
|
|
975
|
-
reuseConfidence:
|
|
977
|
+
score: queryLower ? 0.5 * score : pattern.qualityScore,
|
|
978
|
+
matchType: queryLower ? 'lexical' : 'context',
|
|
979
|
+
similarity: 0,
|
|
980
|
+
canReuse: false,
|
|
981
|
+
estimatedTokenSavings: 0,
|
|
982
|
+
reuseConfidence: 0,
|
|
976
983
|
});
|
|
977
984
|
}
|
|
978
985
|
}
|
|
@@ -1443,6 +1450,14 @@ export class PatternStore {
|
|
|
1443
1450
|
// ============================================================================
|
|
1444
1451
|
// Factory Functions
|
|
1445
1452
|
// ============================================================================
|
|
1453
|
+
/**
|
|
1454
|
+
* Hybrid score for a hit found by both vector and FTS5 search (#653):
|
|
1455
|
+
* 75% vector + 25% BM25, but lexical agreement may only raise the vector
|
|
1456
|
+
* score — a weak BM25 match must not demote a near-identical vector hit.
|
|
1457
|
+
*/
|
|
1458
|
+
export function blendFtsScore(vectorScore, ftsScore) {
|
|
1459
|
+
return Math.max(vectorScore, 0.75 * vectorScore + 0.25 * ftsScore);
|
|
1460
|
+
}
|
|
1446
1461
|
/**
|
|
1447
1462
|
* Create a new pattern store instance.
|
|
1448
1463
|
*
|
|
@@ -111,6 +111,12 @@ export interface QEPattern {
|
|
|
111
111
|
* Pattern applicability context
|
|
112
112
|
*/
|
|
113
113
|
export interface QEPatternContext {
|
|
114
|
+
/** Exact originating experience; reinforcement identity, never a similarity claim. */
|
|
115
|
+
readonly experienceOrigin?: {
|
|
116
|
+
task: string;
|
|
117
|
+
domain: QEDomain | null;
|
|
118
|
+
patternType: QEPatternType;
|
|
119
|
+
};
|
|
114
120
|
/** Programming language this pattern applies to */
|
|
115
121
|
readonly language?: ProgrammingLanguage;
|
|
116
122
|
/** Test framework this pattern uses */
|
|
@@ -201,6 +207,12 @@ export declare function calculateQualityScore(pattern: {
|
|
|
201
207
|
* experience-capture, and shouldPromotePattern().
|
|
202
208
|
*/
|
|
203
209
|
export declare const PROMOTION_THRESHOLD = 3;
|
|
210
|
+
/**
|
|
211
|
+
* Minimum success rate a pattern needs before it can be promoted to long-term
|
|
212
|
+
* storage. Paired with PROMOTION_THRESHOLD; `aqe init` reports both values in
|
|
213
|
+
* the generated settings so they match what the runtime enforces (#778).
|
|
214
|
+
*/
|
|
215
|
+
export declare const PROMOTION_MIN_SUCCESS_RATE = 0.7;
|
|
204
216
|
export interface PromotionCheck {
|
|
205
217
|
meetsUsageCriteria: boolean;
|
|
206
218
|
meetsQualityCriteria: boolean;
|
|
@@ -81,6 +81,12 @@ export function calculateQualityScore(pattern) {
|
|
|
81
81
|
* experience-capture, and shouldPromotePattern().
|
|
82
82
|
*/
|
|
83
83
|
export const PROMOTION_THRESHOLD = 3;
|
|
84
|
+
/**
|
|
85
|
+
* Minimum success rate a pattern needs before it can be promoted to long-term
|
|
86
|
+
* storage. Paired with PROMOTION_THRESHOLD; `aqe init` reports both values in
|
|
87
|
+
* the generated settings so they match what the runtime enforces (#778).
|
|
88
|
+
*/
|
|
89
|
+
export const PROMOTION_MIN_SUCCESS_RATE = 0.7;
|
|
84
90
|
/**
|
|
85
91
|
* Check if pattern should be promoted to long-term storage
|
|
86
92
|
* Requires 3+ successful uses as per ADR-021
|
|
@@ -92,7 +98,7 @@ export const PROMOTION_THRESHOLD = 3;
|
|
|
92
98
|
*/
|
|
93
99
|
export function shouldPromotePattern(pattern, coherenceEnergy, coherenceThreshold = 0.4) {
|
|
94
100
|
const meetsUsageCriteria = pattern.tier === 'short-term' && pattern.successfulUses >= PROMOTION_THRESHOLD;
|
|
95
|
-
const meetsQualityCriteria = pattern.successRate >=
|
|
101
|
+
const meetsQualityCriteria = pattern.successRate >= PROMOTION_MIN_SUCCESS_RATE && pattern.confidence >= 0.6;
|
|
96
102
|
// NEW: Coherence criteria - only block if coherence energy is provided and exceeds threshold
|
|
97
103
|
const meetsCoherenceCriteria = coherenceEnergy === undefined || coherenceEnergy < coherenceThreshold;
|
|
98
104
|
let blockReason;
|
|
@@ -48,6 +48,7 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
48
48
|
private readonly eventBus?;
|
|
49
49
|
private readonly coherenceService?;
|
|
50
50
|
private readonly config;
|
|
51
|
+
private readonly embeddingProvenance;
|
|
51
52
|
private patternStore;
|
|
52
53
|
private initialized;
|
|
53
54
|
private sqliteStore;
|
|
@@ -64,6 +64,7 @@ export class QEReasoningBank {
|
|
|
64
64
|
eventBus;
|
|
65
65
|
coherenceService;
|
|
66
66
|
config;
|
|
67
|
+
embeddingProvenance = new WeakMap();
|
|
67
68
|
patternStore;
|
|
68
69
|
initialized = false;
|
|
69
70
|
sqliteStore = null;
|
|
@@ -337,14 +338,20 @@ export class QEReasoningBank {
|
|
|
337
338
|
searchQuery = '';
|
|
338
339
|
}
|
|
339
340
|
else {
|
|
340
|
-
|
|
341
|
+
const embedding = await this.embed(query);
|
|
342
|
+
// Hash fallback and resized vectors do not belong to the active provider.
|
|
343
|
+
// Keep their text searchable without claiming semantic comparability.
|
|
344
|
+
searchQuery = this.embeddingProvenance.has(embedding) ? embedding : query;
|
|
345
|
+
useVectorSearch = Array.isArray(searchQuery);
|
|
341
346
|
}
|
|
342
347
|
}
|
|
343
348
|
return this.patternStore.search(searchQuery, {
|
|
344
349
|
...options,
|
|
350
|
+
// #653: keep the text so FTS5 hybrid scoring still runs on the vector path
|
|
351
|
+
textQuery: typeof query === 'string' && query.trim() ? query : options?.textQuery,
|
|
345
352
|
useVectorSearch,
|
|
346
353
|
embeddingSpaceId: typeof query === 'string'
|
|
347
|
-
?
|
|
354
|
+
? (Array.isArray(searchQuery) ? this.embeddingProvenance.get(searchQuery) : undefined)
|
|
348
355
|
: options?.embeddingSpaceId,
|
|
349
356
|
});
|
|
350
357
|
}
|
|
@@ -440,10 +447,13 @@ export class QEReasoningBank {
|
|
|
440
447
|
}
|
|
441
448
|
// 2. Search for similar patterns
|
|
442
449
|
const embedding = await this.embed(request.task);
|
|
443
|
-
const
|
|
450
|
+
const embeddingSpaceId = this.embeddingProvenance.get(embedding);
|
|
451
|
+
const patternResults = await this.patternStore.search(embeddingSpaceId ? embedding : request.task, {
|
|
444
452
|
limit: this.config.maxRoutingCandidates,
|
|
445
453
|
domain: detectedDomains[0],
|
|
446
|
-
useVectorSearch:
|
|
454
|
+
useVectorSearch: Boolean(embeddingSpaceId),
|
|
455
|
+
textQuery: request.task,
|
|
456
|
+
embeddingSpaceId,
|
|
447
457
|
});
|
|
448
458
|
const patterns = patternResults.success
|
|
449
459
|
? patternResults.value.map((r) => r.pattern)
|
|
@@ -604,6 +614,9 @@ export class QEReasoningBank {
|
|
|
604
614
|
if (embedding.length !== this.config.embeddingDimension) {
|
|
605
615
|
return resizeEmbedding(embedding, this.config.embeddingDimension);
|
|
606
616
|
}
|
|
617
|
+
const spaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
|
|
618
|
+
if (spaceId)
|
|
619
|
+
this.embeddingProvenance.set(embedding, spaceId);
|
|
607
620
|
return embedding;
|
|
608
621
|
}
|
|
609
622
|
catch (error) {
|