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
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
/** Resolve the opt-in Vibium runtime for both local and global AQE installs. */
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { execFileSync } from 'node:child_process';
|
|
4
|
+
import { existsSync } from 'node:fs';
|
|
5
|
+
import { dirname, join } from 'node:path';
|
|
6
|
+
export const VIBIUM_SETUP = 'aqe init --browser-engine (or npm install vibium@^26.8.21)';
|
|
7
|
+
const requireFromHere = createRequire(import.meta.url);
|
|
8
|
+
/**
|
|
9
|
+
* How to run npm without a shell. On Windows `npm` is an `npm.cmd` shim, which
|
|
10
|
+
* execFile cannot start without `shell: true` (EINVAL/ENOENT since the
|
|
11
|
+
* CVE-2024-27980 fix), so run the npm CLI bundled next to node.exe instead.
|
|
12
|
+
* Falls back to plain `npm` when that layout is absent.
|
|
13
|
+
*/
|
|
14
|
+
export function npmInvocation(platform = process.platform, execPath = process.execPath, exists = existsSync) {
|
|
15
|
+
if (platform === 'win32') {
|
|
16
|
+
const npmCli = join(dirname(execPath), 'node_modules', 'npm', 'bin', 'npm-cli.js');
|
|
17
|
+
if (exists(npmCli))
|
|
18
|
+
return [execPath, [npmCli]];
|
|
19
|
+
}
|
|
20
|
+
return ['npm', []];
|
|
21
|
+
}
|
|
22
|
+
/** Never install or download anything while probing availability. */
|
|
23
|
+
function resolveRuntime() {
|
|
24
|
+
try {
|
|
25
|
+
return requireFromHere.resolve('vibium');
|
|
26
|
+
}
|
|
27
|
+
catch {
|
|
28
|
+
try {
|
|
29
|
+
return createRequire(join(process.cwd(), 'package.json')).resolve('vibium');
|
|
30
|
+
}
|
|
31
|
+
catch { /* No project-local opt-in runtime. Try global setup below. */ }
|
|
32
|
+
// A global CLI installation is not on Node's normal module search path.
|
|
33
|
+
// npm root is read-only and honors the same npm prefix as explicit setup.
|
|
34
|
+
const [npmBin, npmPrefixArgs] = npmInvocation();
|
|
35
|
+
const root = execFileSync(npmBin, [...npmPrefixArgs, 'root', '-g'], {
|
|
36
|
+
encoding: 'utf8', timeout: 5000, stdio: ['ignore', 'pipe', 'pipe'],
|
|
37
|
+
}).trim();
|
|
38
|
+
return requireFromHere.resolve(join(root, 'vibium'));
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Accept the modern API from the namespace itself or from its `default`
|
|
43
|
+
* export. CJS interop and bundler createRequire shims expose the package
|
|
44
|
+
* object only as `default`, so checking the namespace alone rejects a
|
|
45
|
+
* correctly installed runtime.
|
|
46
|
+
*/
|
|
47
|
+
function selectBrowserApi(loaded) {
|
|
48
|
+
if (typeof loaded?.browser?.start === 'function')
|
|
49
|
+
return loaded;
|
|
50
|
+
if (typeof loaded?.default?.browser?.start === 'function')
|
|
51
|
+
return loaded.default;
|
|
52
|
+
return null;
|
|
53
|
+
}
|
|
54
|
+
export async function loadVibium() {
|
|
55
|
+
let loaded;
|
|
56
|
+
try {
|
|
57
|
+
loaded = await import('vibium');
|
|
58
|
+
}
|
|
59
|
+
catch (error) {
|
|
60
|
+
// Only a missing local package permits global resolution. A broken local
|
|
61
|
+
// installation must not be silently replaced by an unrelated runtime.
|
|
62
|
+
if (error.code !== 'ERR_MODULE_NOT_FOUND' &&
|
|
63
|
+
error.code !== 'MODULE_NOT_FOUND')
|
|
64
|
+
throw error;
|
|
65
|
+
let entry;
|
|
66
|
+
try {
|
|
67
|
+
entry = resolveRuntime();
|
|
68
|
+
}
|
|
69
|
+
catch (cause) {
|
|
70
|
+
throw new Error(`Vibium is not installed; run ${VIBIUM_SETUP}`, { cause });
|
|
71
|
+
}
|
|
72
|
+
loaded = requireFromHere(entry);
|
|
73
|
+
}
|
|
74
|
+
const runtime = selectBrowserApi(loaded);
|
|
75
|
+
if (!runtime) {
|
|
76
|
+
throw new Error('Unsupported Vibium API: the installed package exposes no browser.start() ' +
|
|
77
|
+
`(neither as a named nor a default export); run ${VIBIUM_SETUP}`);
|
|
78
|
+
}
|
|
79
|
+
return runtime;
|
|
80
|
+
}
|
|
81
|
+
/** Check the payload belonging to the resolved library, not a different PATH CLI. */
|
|
82
|
+
export function isVibiumReady() {
|
|
83
|
+
try {
|
|
84
|
+
const cli = join(dirname(resolveRuntime()), '..', 'bin', 'cli.js');
|
|
85
|
+
execFileSync(process.execPath, [cli, 'is-installed'], {
|
|
86
|
+
timeout: 5000, stdio: 'ignore',
|
|
87
|
+
});
|
|
88
|
+
return true;
|
|
89
|
+
}
|
|
90
|
+
catch {
|
|
91
|
+
return false;
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
//# sourceMappingURL=runtime.js.map
|
package/dist/kernel/kernel.js
CHANGED
|
@@ -7,6 +7,7 @@ import { ALL_DOMAINS } from '../shared/types/index.js';
|
|
|
7
7
|
import { InMemoryEventBus } from './event-bus.js';
|
|
8
8
|
import { DefaultAgentCoordinator } from './agent-coordinator.js';
|
|
9
9
|
import { DefaultPluginLoader } from './plugin-loader.js';
|
|
10
|
+
import { formatErrorForLog } from '../logging/redaction.js';
|
|
10
11
|
import { InMemoryBackend } from './memory-backend.js';
|
|
11
12
|
import { createKernelMemoryBackend } from './hybrid-backend.js';
|
|
12
13
|
import { SemanticAntiDriftMiddleware, ToolCallSignatureTracker } from './anti-drift-middleware.js';
|
|
@@ -488,7 +489,7 @@ export class QEKernelImpl {
|
|
|
488
489
|
plugin = await this._plugins.load(domain);
|
|
489
490
|
}
|
|
490
491
|
catch (error) {
|
|
491
|
-
console.error(`[QEKernel] Failed to lazy load domain ${domain}:`, error);
|
|
492
|
+
console.error(`[QEKernel] Failed to lazy load domain ${domain}:`, formatErrorForLog(error));
|
|
492
493
|
return undefined;
|
|
493
494
|
}
|
|
494
495
|
}
|
|
@@ -511,7 +512,7 @@ export class QEKernelImpl {
|
|
|
511
512
|
return true;
|
|
512
513
|
}
|
|
513
514
|
catch (error) {
|
|
514
|
-
console.error(`[QEKernel] Failed to load domain ${domain}:`, error);
|
|
515
|
+
console.error(`[QEKernel] Failed to load domain ${domain}:`, formatErrorForLog(error));
|
|
515
516
|
return false;
|
|
516
517
|
}
|
|
517
518
|
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* qe_patterns FTS5 self-heal (runs on every open, not gated on schema version)
|
|
3
|
+
*
|
|
4
|
+
* `qe_patterns_fts` is an FTS5 *external-content* table: it stores only the
|
|
5
|
+
* inverted index, and the three AFTER INSERT/UPDATE/DELETE triggers on
|
|
6
|
+
* qe_patterns are the ONLY thing keeping it in sync. Migration v9 creates them
|
|
7
|
+
* once (`currentVersion < 9`), so a database whose triggers were lost later
|
|
8
|
+
* (older code, a `.recover`, a copy/restore, a manual drop...) never heals:
|
|
9
|
+
* new patterns are invisible to keyword search and deleted ones linger as
|
|
10
|
+
* stale entries that skew BM25. Since hybrid FTS5+vector retrieval (#780/#796)
|
|
11
|
+
* keyword search is part of production ranking, so drift silently degrades
|
|
12
|
+
* retrieval and anything that locates a pattern through FTS.
|
|
13
|
+
*
|
|
14
|
+
* This module detects that state cheaply and repairs it idempotently:
|
|
15
|
+
* 1. qe_patterns exists but qe_patterns_fts doesn't -> create the table
|
|
16
|
+
* 2. any sync trigger missing -> recreate it (shared DDL)
|
|
17
|
+
* 3. a sync trigger whose body differs from the shared DDL -> drop + recreate
|
|
18
|
+
* (CREATE TRIGGER IF NOT EXISTS never replaces a same-named trigger)
|
|
19
|
+
* 4. any of the above OR index rowids != content rowids -> FTS5 'rebuild'
|
|
20
|
+
*
|
|
21
|
+
* Detection is read-only (counts + one anti-join on the docsize PK); the write
|
|
22
|
+
* transaction (BEGIN IMMEDIATE) is taken only when a repair is needed. It never
|
|
23
|
+
* throws: failures are logged and the caller continues (FTS search already
|
|
24
|
+
* degrades to vector-only). Read-only connections are skipped entirely.
|
|
25
|
+
*
|
|
26
|
+
* The 'rebuild' command reconstructs the index from the content table and
|
|
27
|
+
* never modifies qe_patterns rows.
|
|
28
|
+
*/
|
|
29
|
+
import type { Database as DatabaseType } from 'better-sqlite3';
|
|
30
|
+
/** Names of the triggers that keep qe_patterns_fts in sync. */
|
|
31
|
+
export declare const QE_PATTERNS_FTS_TRIGGERS: string[];
|
|
32
|
+
export type PatternFtsHealStatus = 'healthy' | 'healed' | 'no-patterns' | 'readonly' | 'failed';
|
|
33
|
+
export interface PatternFtsHealResult {
|
|
34
|
+
status: PatternFtsHealStatus;
|
|
35
|
+
/** True when qe_patterns_fts had to be created. */
|
|
36
|
+
createdTable: boolean;
|
|
37
|
+
/** Triggers that were missing and have been recreated. */
|
|
38
|
+
recreatedTriggers: string[];
|
|
39
|
+
/** Triggers whose body differed from the shared DDL and have been replaced. */
|
|
40
|
+
replacedTriggers: string[];
|
|
41
|
+
/** True when the FTS5 'rebuild' command ran. */
|
|
42
|
+
rebuilt: boolean;
|
|
43
|
+
/** qe_patterns row count observed before repair (-1 if unknown). */
|
|
44
|
+
patternsBefore: number;
|
|
45
|
+
/** Indexed document count before repair (-1 if unknown / no table). */
|
|
46
|
+
indexedBefore: number;
|
|
47
|
+
/** Indexed document count after repair (-1 if not repaired). */
|
|
48
|
+
indexedAfter: number;
|
|
49
|
+
error?: string;
|
|
50
|
+
}
|
|
51
|
+
export interface PatternFtsHealOptions {
|
|
52
|
+
/** Log sink for the single heal/failure line. Defaults to console.warn. */
|
|
53
|
+
log?: (message: string) => void;
|
|
54
|
+
/** Prefix for the log line, e.g. "[UnifiedMemory]". */
|
|
55
|
+
logPrefix?: string;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Ensure qe_patterns_fts exists, has its three sync triggers, and indexes
|
|
59
|
+
* exactly the rows of qe_patterns. Idempotent and silent when healthy; logs
|
|
60
|
+
* one line when it repairs something; never throws.
|
|
61
|
+
*/
|
|
62
|
+
export declare function ensurePatternFtsInSync(db: DatabaseType, options?: PatternFtsHealOptions): PatternFtsHealResult;
|
|
63
|
+
//# sourceMappingURL=pattern-fts-self-heal.d.ts.map
|
|
@@ -0,0 +1,193 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* qe_patterns FTS5 self-heal (runs on every open, not gated on schema version)
|
|
3
|
+
*
|
|
4
|
+
* `qe_patterns_fts` is an FTS5 *external-content* table: it stores only the
|
|
5
|
+
* inverted index, and the three AFTER INSERT/UPDATE/DELETE triggers on
|
|
6
|
+
* qe_patterns are the ONLY thing keeping it in sync. Migration v9 creates them
|
|
7
|
+
* once (`currentVersion < 9`), so a database whose triggers were lost later
|
|
8
|
+
* (older code, a `.recover`, a copy/restore, a manual drop...) never heals:
|
|
9
|
+
* new patterns are invisible to keyword search and deleted ones linger as
|
|
10
|
+
* stale entries that skew BM25. Since hybrid FTS5+vector retrieval (#780/#796)
|
|
11
|
+
* keyword search is part of production ranking, so drift silently degrades
|
|
12
|
+
* retrieval and anything that locates a pattern through FTS.
|
|
13
|
+
*
|
|
14
|
+
* This module detects that state cheaply and repairs it idempotently:
|
|
15
|
+
* 1. qe_patterns exists but qe_patterns_fts doesn't -> create the table
|
|
16
|
+
* 2. any sync trigger missing -> recreate it (shared DDL)
|
|
17
|
+
* 3. a sync trigger whose body differs from the shared DDL -> drop + recreate
|
|
18
|
+
* (CREATE TRIGGER IF NOT EXISTS never replaces a same-named trigger)
|
|
19
|
+
* 4. any of the above OR index rowids != content rowids -> FTS5 'rebuild'
|
|
20
|
+
*
|
|
21
|
+
* Detection is read-only (counts + one anti-join on the docsize PK); the write
|
|
22
|
+
* transaction (BEGIN IMMEDIATE) is taken only when a repair is needed. It never
|
|
23
|
+
* throws: failures are logged and the caller continues (FTS search already
|
|
24
|
+
* degrades to vector-only). Read-only connections are skipped entirely.
|
|
25
|
+
*
|
|
26
|
+
* The 'rebuild' command reconstructs the index from the content table and
|
|
27
|
+
* never modifies qe_patterns rows.
|
|
28
|
+
*/
|
|
29
|
+
import { toErrorMessage } from '../shared/error-utils.js';
|
|
30
|
+
import { QE_PATTERNS_FTS_TABLE_DDL, QE_PATTERNS_FTS_TRIGGER_DDL, } from './unified-memory-schemas.js';
|
|
31
|
+
/** Names of the triggers that keep qe_patterns_fts in sync. */
|
|
32
|
+
export const QE_PATTERNS_FTS_TRIGGERS = Object.keys(QE_PATTERNS_FTS_TRIGGER_DDL);
|
|
33
|
+
function objectExists(db, type, name) {
|
|
34
|
+
return db.prepare('SELECT 1 FROM sqlite_master WHERE type = ? AND name = ?').get(type, name) !== undefined;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Canonical form of a CREATE TRIGGER statement for comparison: sqlite_master
|
|
38
|
+
* stores the text as written minus IF NOT EXISTS, and older code paths used
|
|
39
|
+
* different indentation, so collapse whitespace and drop the clause/semicolon.
|
|
40
|
+
*/
|
|
41
|
+
function normalizeTriggerSql(sql) {
|
|
42
|
+
return sql
|
|
43
|
+
.replace(/\s+/g, ' ')
|
|
44
|
+
.trim()
|
|
45
|
+
.replace(/^CREATE TRIGGER IF NOT EXISTS /i, 'CREATE TRIGGER ')
|
|
46
|
+
.replace(/ ?;$/, '')
|
|
47
|
+
.toLowerCase();
|
|
48
|
+
}
|
|
49
|
+
const CANONICAL_TRIGGER_SQL = Object.freeze(Object.fromEntries(Object.entries(QE_PATTERNS_FTS_TRIGGER_DDL).map(([name, ddl]) => [name, normalizeTriggerSql(ddl)])));
|
|
50
|
+
function count(db, sql) {
|
|
51
|
+
const row = db.prepare(sql).get();
|
|
52
|
+
return row?.n ?? 0;
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* Read-only inspection. `qe_patterns_fts_docsize` holds exactly one row per
|
|
56
|
+
* indexed document (id = content rowid; columnsize defaults to on), so
|
|
57
|
+
* comparing it with qe_patterns detects both unindexed and stale entries
|
|
58
|
+
* without scanning the index itself. `SELECT count(*) FROM qe_patterns_fts`
|
|
59
|
+
* is NOT usable: for an external-content table it reads the content table.
|
|
60
|
+
*/
|
|
61
|
+
function inspect(db) {
|
|
62
|
+
const hasTable = objectExists(db, 'table', 'qe_patterns_fts');
|
|
63
|
+
const hasDocsize = hasTable && objectExists(db, 'table', 'qe_patterns_fts_docsize');
|
|
64
|
+
const missingTriggers = [];
|
|
65
|
+
const mismatchedTriggers = [];
|
|
66
|
+
const triggerSql = db.prepare("SELECT sql FROM sqlite_master WHERE type = 'trigger' AND name = ?");
|
|
67
|
+
for (const name of QE_PATTERNS_FTS_TRIGGERS) {
|
|
68
|
+
const row = triggerSql.get(name);
|
|
69
|
+
if (row === undefined)
|
|
70
|
+
missingTriggers.push(name);
|
|
71
|
+
else if (normalizeTriggerSql(row.sql ?? '') !== CANONICAL_TRIGGER_SQL[name])
|
|
72
|
+
mismatchedTriggers.push(name);
|
|
73
|
+
}
|
|
74
|
+
const patterns = count(db, 'SELECT count(*) AS n FROM qe_patterns');
|
|
75
|
+
const indexed = hasDocsize ? count(db, 'SELECT count(*) AS n FROM qe_patterns_fts_docsize') : -1;
|
|
76
|
+
// Equal counts + every content rowid indexed => identical rowid sets (both
|
|
77
|
+
// sides are unique), so one anti-join over the docsize PK suffices.
|
|
78
|
+
const unindexed = hasDocsize && indexed === patterns
|
|
79
|
+
? count(db, `SELECT count(*) AS n FROM qe_patterns p
|
|
80
|
+
WHERE NOT EXISTS (SELECT 1 FROM qe_patterns_fts_docsize d WHERE d.id = p.rowid)`)
|
|
81
|
+
: 0;
|
|
82
|
+
return { hasTable, hasDocsize, missingTriggers, mismatchedTriggers, patterns, indexed, unindexed };
|
|
83
|
+
}
|
|
84
|
+
function needsRepair(s) {
|
|
85
|
+
if (!s.hasTable || s.missingTriggers.length > 0 || s.mismatchedTriggers.length > 0)
|
|
86
|
+
return true;
|
|
87
|
+
// Without a docsize table (non-default FTS options) drift can't be measured
|
|
88
|
+
// cheaply; trust the triggers rather than rebuilding on every open.
|
|
89
|
+
if (!s.hasDocsize)
|
|
90
|
+
return false;
|
|
91
|
+
return s.indexed !== s.patterns || s.unindexed > 0;
|
|
92
|
+
}
|
|
93
|
+
function isReadOnly(db) {
|
|
94
|
+
if (db.readonly)
|
|
95
|
+
return true;
|
|
96
|
+
try {
|
|
97
|
+
return Number(db.pragma('query_only', { simple: true })) === 1;
|
|
98
|
+
}
|
|
99
|
+
catch {
|
|
100
|
+
return false;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Ensure qe_patterns_fts exists, has its three sync triggers, and indexes
|
|
105
|
+
* exactly the rows of qe_patterns. Idempotent and silent when healthy; logs
|
|
106
|
+
* one line when it repairs something; never throws.
|
|
107
|
+
*/
|
|
108
|
+
export function ensurePatternFtsInSync(db, options = {}) {
|
|
109
|
+
const log = options.log ?? ((m) => console.warn(m));
|
|
110
|
+
const prefix = options.logPrefix ?? '[PatternFTS]';
|
|
111
|
+
const result = {
|
|
112
|
+
status: 'healthy',
|
|
113
|
+
createdTable: false,
|
|
114
|
+
recreatedTriggers: [],
|
|
115
|
+
replacedTriggers: [],
|
|
116
|
+
rebuilt: false,
|
|
117
|
+
patternsBefore: -1,
|
|
118
|
+
indexedBefore: -1,
|
|
119
|
+
indexedAfter: -1,
|
|
120
|
+
};
|
|
121
|
+
try {
|
|
122
|
+
if (!objectExists(db, 'table', 'qe_patterns')) {
|
|
123
|
+
result.status = 'no-patterns';
|
|
124
|
+
return result;
|
|
125
|
+
}
|
|
126
|
+
if (isReadOnly(db)) {
|
|
127
|
+
result.status = 'readonly';
|
|
128
|
+
return result;
|
|
129
|
+
}
|
|
130
|
+
const before = inspect(db);
|
|
131
|
+
result.patternsBefore = before.patterns;
|
|
132
|
+
result.indexedBefore = before.indexed;
|
|
133
|
+
if (!needsRepair(before))
|
|
134
|
+
return result;
|
|
135
|
+
// Re-inspect inside BEGIN IMMEDIATE so a concurrent opener that already
|
|
136
|
+
// healed (or is mid-write) is observed under the write lock. Results are
|
|
137
|
+
// only published after COMMIT succeeds: a failed commit rolls everything
|
|
138
|
+
// back and must not be reported as a repair.
|
|
139
|
+
const repaired = db.transaction(() => {
|
|
140
|
+
const s = inspect(db);
|
|
141
|
+
if (!needsRepair(s))
|
|
142
|
+
return null;
|
|
143
|
+
if (!s.hasTable)
|
|
144
|
+
db.exec(QE_PATTERNS_FTS_TABLE_DDL);
|
|
145
|
+
for (const name of s.missingTriggers)
|
|
146
|
+
db.exec(QE_PATTERNS_FTS_TRIGGER_DDL[name]);
|
|
147
|
+
for (const name of s.mismatchedTriggers) {
|
|
148
|
+
db.exec(`DROP TRIGGER IF EXISTS ${name}`);
|
|
149
|
+
db.exec(QE_PATTERNS_FTS_TRIGGER_DDL[name]);
|
|
150
|
+
}
|
|
151
|
+
// Rebuild from the content table: clears stale entries and indexes rows
|
|
152
|
+
// inserted/updated while triggers were absent. Never touches qe_patterns.
|
|
153
|
+
db.exec("INSERT INTO qe_patterns_fts(qe_patterns_fts) VALUES('rebuild')");
|
|
154
|
+
return { s, indexedAfter: count(db, 'SELECT count(*) AS n FROM qe_patterns_fts_docsize') };
|
|
155
|
+
}).immediate();
|
|
156
|
+
if (repaired) {
|
|
157
|
+
const { s } = repaired;
|
|
158
|
+
result.createdTable = !s.hasTable;
|
|
159
|
+
result.recreatedTriggers = [...s.missingTriggers];
|
|
160
|
+
result.replacedTriggers = [...s.mismatchedTriggers];
|
|
161
|
+
result.patternsBefore = s.patterns;
|
|
162
|
+
result.indexedBefore = s.indexed;
|
|
163
|
+
result.indexedAfter = repaired.indexedAfter;
|
|
164
|
+
result.rebuilt = true;
|
|
165
|
+
}
|
|
166
|
+
if (result.rebuilt) {
|
|
167
|
+
result.status = 'healed';
|
|
168
|
+
const parts = [];
|
|
169
|
+
if (result.createdTable)
|
|
170
|
+
parts.push('created qe_patterns_fts');
|
|
171
|
+
if (result.recreatedTriggers.length > 0) {
|
|
172
|
+
parts.push(`recreated triggers [${result.recreatedTriggers.join(', ')}]`);
|
|
173
|
+
}
|
|
174
|
+
if (result.replacedTriggers.length > 0) {
|
|
175
|
+
parts.push(`replaced triggers [${result.replacedTriggers.join(', ')}]`);
|
|
176
|
+
}
|
|
177
|
+
const indexedBefore = result.indexedBefore < 0 ? 'n/a' : String(result.indexedBefore);
|
|
178
|
+
parts.push(`rebuilt index (indexed ${indexedBefore} -> ${result.indexedAfter}, qe_patterns ${result.patternsBefore})`);
|
|
179
|
+
log(`${prefix} Healed qe_patterns FTS5 index: ${parts.join('; ')}`);
|
|
180
|
+
}
|
|
181
|
+
return result;
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
result.status = 'failed';
|
|
185
|
+
result.error = toErrorMessage(error);
|
|
186
|
+
try {
|
|
187
|
+
log(`${prefix} qe_patterns FTS5 self-heal skipped: ${result.error} (keyword search may be degraded; vector search unaffected)`);
|
|
188
|
+
}
|
|
189
|
+
catch { /* logging must never break open */ }
|
|
190
|
+
return result;
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
//# sourceMappingURL=pattern-fts-self-heal.js.map
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Process lifecycle ownership (#801)
|
|
3
|
+
*
|
|
4
|
+
* A long-running entry point (the MCP server) owns process shutdown: before it
|
|
5
|
+
* exits it must drain in-flight work and release native handles. The shared
|
|
6
|
+
* patterns RVF adapter, for example, holds a `patterns.rvf.lock` marker that
|
|
7
|
+
* only its own close() removes.
|
|
8
|
+
*
|
|
9
|
+
* Module-level signal handlers elsewhere (the kernel stores, the CLI wrapper)
|
|
10
|
+
* used to call `process.exit(0)` synchronously. Node runs signal listeners one
|
|
11
|
+
* after another in the same tick, so that exit pre-empted the owner's async
|
|
12
|
+
* graceful shutdown and leaked the marker. Those handlers now route the
|
|
13
|
+
* request to the claimed owner and do not exit themselves.
|
|
14
|
+
*
|
|
15
|
+
* With no owner claimed (every non-MCP CLI command), nothing changes and
|
|
16
|
+
* callers keep their own exit behaviour.
|
|
17
|
+
*
|
|
18
|
+
* The owner lives on `globalThis` under a registry symbol because `aqe mcp`
|
|
19
|
+
* loads the MCP bundle into the CLI bundle's process. Each bundle has its own
|
|
20
|
+
* copy of this module, and both copies must see the same owner.
|
|
21
|
+
*/
|
|
22
|
+
export interface ProcessLifecycleOwner {
|
|
23
|
+
/** Diagnostic name, e.g. `mcp`. */
|
|
24
|
+
readonly name: string;
|
|
25
|
+
/**
|
|
26
|
+
* Start the owner's graceful shutdown. Must be idempotent, must not throw,
|
|
27
|
+
* and must eventually exit the process (e.g. guarded by a watchdog). Before
|
|
28
|
+
* exiting, on every path, it must call `closeRegisteredStores()`.
|
|
29
|
+
*/
|
|
30
|
+
shutdown(reason: string): void;
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Register a synchronous, idempotent close for a process-wide store (the
|
|
34
|
+
* kernel's unified memory/persistence singletons). A claimed owner closes
|
|
35
|
+
* every registered store at the end of its shutdown, so stores are closed on
|
|
36
|
+
* every termination path, not only the signal ones. Returns an unregister
|
|
37
|
+
* function. Shared across bundle copies through the registry symbol.
|
|
38
|
+
*/
|
|
39
|
+
export declare function registerStoreCloser(close: () => void): () => void;
|
|
40
|
+
/**
|
|
41
|
+
* Close every registered store, most recently registered first (a facade is
|
|
42
|
+
* registered after the store it wraps, so it closes first). Synchronous so it
|
|
43
|
+
* also works from a process 'exit' listener; never throws. Closers must be
|
|
44
|
+
* idempotent: this may run from both the shutdown and an exit backstop.
|
|
45
|
+
*/
|
|
46
|
+
export declare function closeRegisteredStores(): void;
|
|
47
|
+
/** Make `owner` responsible for every graceful shutdown in this process. */
|
|
48
|
+
export declare function claimProcessLifecycle(owner: ProcessLifecycleOwner): void;
|
|
49
|
+
/** Remove the current owner (only if it is still `owner`, when given). Test seam. */
|
|
50
|
+
export declare function releaseProcessLifecycle(owner?: ProcessLifecycleOwner): void;
|
|
51
|
+
export declare function getProcessLifecycleOwner(): ProcessLifecycleOwner | undefined;
|
|
52
|
+
/**
|
|
53
|
+
* Hand a termination request to the claimed owner.
|
|
54
|
+
*
|
|
55
|
+
* Returns true when an owner accepted it: the caller must then NOT exit the
|
|
56
|
+
* process itself. Returns false when no owner is claimed: the caller keeps its
|
|
57
|
+
* own behaviour.
|
|
58
|
+
*/
|
|
59
|
+
export declare function requestOwnedShutdown(reason: string): boolean;
|
|
60
|
+
//# sourceMappingURL=process-lifecycle.d.ts.map
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Agentic QE v3 - Process lifecycle ownership (#801)
|
|
3
|
+
*
|
|
4
|
+
* A long-running entry point (the MCP server) owns process shutdown: before it
|
|
5
|
+
* exits it must drain in-flight work and release native handles. The shared
|
|
6
|
+
* patterns RVF adapter, for example, holds a `patterns.rvf.lock` marker that
|
|
7
|
+
* only its own close() removes.
|
|
8
|
+
*
|
|
9
|
+
* Module-level signal handlers elsewhere (the kernel stores, the CLI wrapper)
|
|
10
|
+
* used to call `process.exit(0)` synchronously. Node runs signal listeners one
|
|
11
|
+
* after another in the same tick, so that exit pre-empted the owner's async
|
|
12
|
+
* graceful shutdown and leaked the marker. Those handlers now route the
|
|
13
|
+
* request to the claimed owner and do not exit themselves.
|
|
14
|
+
*
|
|
15
|
+
* With no owner claimed (every non-MCP CLI command), nothing changes and
|
|
16
|
+
* callers keep their own exit behaviour.
|
|
17
|
+
*
|
|
18
|
+
* The owner lives on `globalThis` under a registry symbol because `aqe mcp`
|
|
19
|
+
* loads the MCP bundle into the CLI bundle's process. Each bundle has its own
|
|
20
|
+
* copy of this module, and both copies must see the same owner.
|
|
21
|
+
*/
|
|
22
|
+
const OWNER_KEY = Symbol.for('agentic-qe.process-lifecycle-owner');
|
|
23
|
+
const CLOSERS_KEY = Symbol.for('agentic-qe.process-lifecycle-store-closers');
|
|
24
|
+
function closers() {
|
|
25
|
+
const g = globalThis;
|
|
26
|
+
return (g[CLOSERS_KEY] ??= []);
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Register a synchronous, idempotent close for a process-wide store (the
|
|
30
|
+
* kernel's unified memory/persistence singletons). A claimed owner closes
|
|
31
|
+
* every registered store at the end of its shutdown, so stores are closed on
|
|
32
|
+
* every termination path, not only the signal ones. Returns an unregister
|
|
33
|
+
* function. Shared across bundle copies through the registry symbol.
|
|
34
|
+
*/
|
|
35
|
+
export function registerStoreCloser(close) {
|
|
36
|
+
closers().push(close);
|
|
37
|
+
return () => {
|
|
38
|
+
const list = closers();
|
|
39
|
+
const at = list.indexOf(close);
|
|
40
|
+
if (at >= 0)
|
|
41
|
+
list.splice(at, 1);
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Close every registered store, most recently registered first (a facade is
|
|
46
|
+
* registered after the store it wraps, so it closes first). Synchronous so it
|
|
47
|
+
* also works from a process 'exit' listener; never throws. Closers must be
|
|
48
|
+
* idempotent: this may run from both the shutdown and an exit backstop.
|
|
49
|
+
*/
|
|
50
|
+
export function closeRegisteredStores() {
|
|
51
|
+
for (const close of [...closers()].reverse()) {
|
|
52
|
+
try {
|
|
53
|
+
close();
|
|
54
|
+
}
|
|
55
|
+
catch { /* best effort: keep closing the rest */ }
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
/** Make `owner` responsible for every graceful shutdown in this process. */
|
|
59
|
+
export function claimProcessLifecycle(owner) {
|
|
60
|
+
globalThis[OWNER_KEY] = owner;
|
|
61
|
+
}
|
|
62
|
+
/** Remove the current owner (only if it is still `owner`, when given). Test seam. */
|
|
63
|
+
export function releaseProcessLifecycle(owner) {
|
|
64
|
+
const g = globalThis;
|
|
65
|
+
if (!owner || g[OWNER_KEY] === owner)
|
|
66
|
+
delete g[OWNER_KEY];
|
|
67
|
+
}
|
|
68
|
+
export function getProcessLifecycleOwner() {
|
|
69
|
+
return globalThis[OWNER_KEY];
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Hand a termination request to the claimed owner.
|
|
73
|
+
*
|
|
74
|
+
* Returns true when an owner accepted it: the caller must then NOT exit the
|
|
75
|
+
* process itself. Returns false when no owner is claimed: the caller keeps its
|
|
76
|
+
* own behaviour.
|
|
77
|
+
*/
|
|
78
|
+
export function requestOwnedShutdown(reason) {
|
|
79
|
+
const owner = getProcessLifecycleOwner();
|
|
80
|
+
if (!owner)
|
|
81
|
+
return false;
|
|
82
|
+
try {
|
|
83
|
+
owner.shutdown(reason);
|
|
84
|
+
return true;
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// A broken owner must not leave the process running: let the caller exit.
|
|
88
|
+
return false;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
//# sourceMappingURL=process-lifecycle.js.map
|
|
@@ -15,7 +15,21 @@ export declare const VECTORS_SCHEMA = "\n -- Vector Embeddings (new in v3 - rep
|
|
|
15
15
|
export declare const RL_QVALUES_SCHEMA = "\n -- Q-Values for RL algorithms (ADR-046)\n CREATE TABLE IF NOT EXISTS rl_q_values (\n id TEXT PRIMARY KEY,\n algorithm TEXT NOT NULL,\n agent_id TEXT NOT NULL,\n state_key TEXT NOT NULL,\n action_key TEXT NOT NULL,\n q_value REAL NOT NULL DEFAULT 0.0,\n visits INTEGER NOT NULL DEFAULT 0,\n last_reward REAL,\n domain TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n UNIQUE(algorithm, agent_id, state_key, action_key)\n );\n CREATE INDEX IF NOT EXISTS idx_qvalues_agent ON rl_q_values(agent_id);\n CREATE INDEX IF NOT EXISTS idx_qvalues_algorithm ON rl_q_values(algorithm);\n CREATE INDEX IF NOT EXISTS idx_qvalues_state ON rl_q_values(agent_id, state_key);\n CREATE INDEX IF NOT EXISTS idx_qvalues_domain ON rl_q_values(domain);\n CREATE INDEX IF NOT EXISTS idx_qvalues_updated ON rl_q_values(updated_at);\n";
|
|
16
16
|
export declare const GOAP_SCHEMA = "\n -- GOAP Goals\n CREATE TABLE IF NOT EXISTS goap_goals (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT,\n conditions TEXT NOT NULL,\n priority INTEGER DEFAULT 3,\n qe_domain TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- GOAP Actions\n CREATE TABLE IF NOT EXISTS goap_actions (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT,\n agent_type TEXT NOT NULL,\n preconditions TEXT NOT NULL,\n effects TEXT NOT NULL,\n cost REAL DEFAULT 1.0,\n estimated_duration_ms INTEGER,\n success_rate REAL DEFAULT 1.0,\n execution_count INTEGER DEFAULT 0,\n category TEXT NOT NULL,\n qe_domain TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n -- A14: real domain API method binding (kernel.getDomainAPI(qe_domain)[method](params)).\n -- method/implemented are NULL/0 for actions with no real backing yet \u2014\n -- GOAPExecutor must report those as \"not implemented\", never simulate them.\n method TEXT,\n params TEXT,\n implemented INTEGER DEFAULT 0\n );\n\n -- GOAP Plans\n CREATE TABLE IF NOT EXISTS goap_plans (\n id TEXT PRIMARY KEY,\n goal_id TEXT,\n initial_state TEXT NOT NULL,\n goal_state TEXT NOT NULL,\n action_sequence TEXT NOT NULL,\n total_cost REAL,\n estimated_duration_ms INTEGER,\n status TEXT DEFAULT 'pending',\n reused_from TEXT,\n similarity_score REAL,\n created_at TEXT DEFAULT (datetime('now')),\n executed_at TEXT,\n completed_at TEXT,\n FOREIGN KEY (goal_id) REFERENCES goap_goals(id)\n );\n\n -- Plan Signatures (for similarity matching)\n CREATE TABLE IF NOT EXISTS goap_plan_signatures (\n id TEXT PRIMARY KEY,\n plan_id TEXT NOT NULL UNIQUE,\n goal_hash TEXT NOT NULL,\n state_vector TEXT NOT NULL,\n action_sequence TEXT NOT NULL,\n total_cost REAL NOT NULL,\n success_rate REAL DEFAULT 1.0,\n usage_count INTEGER DEFAULT 0,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- A14: canonical per-step execution history (was previously undefined in\n -- this schema \u2014 plan-executor.ts invented its own parallel\n -- execution_results/executed_steps tables instead). One row per action\n -- step per execution attempt (execution_id groups steps from the same\n -- plan.execute() call, since a plan can be executed/retried more than\n -- once). Aggregate per-execution stats (steps completed/failed, total\n -- duration, final world state) are derived by querying this table rather\n -- than maintained in a separate denormalized summary table.\n CREATE TABLE IF NOT EXISTS goap_execution_steps (\n id TEXT PRIMARY KEY,\n plan_id TEXT NOT NULL,\n execution_id TEXT NOT NULL,\n action_id TEXT NOT NULL,\n step_order INTEGER NOT NULL,\n world_state_before TEXT,\n world_state_after TEXT,\n status TEXT NOT NULL DEFAULT 'pending',\n retries INTEGER DEFAULT 0,\n started_at TEXT,\n duration_ms INTEGER,\n agent_id TEXT,\n agent_output TEXT,\n error_message TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n -- Deliberately no FK to goap_plans/goap_actions: PlanExecutor.execute()\n -- can legitimately run an ad-hoc GOAPPlan/GOAPAction that was never\n -- saved via savePlan()/addAction() (e.g. programmatic orchestration\n -- bypassing the A* planner). unified-memory.ts enables the\n -- foreign_keys pragma, so an enforced FK here would reject that\n -- entirely legitimate usage, not just catch real corruption.\n );\n\n -- GOAP Indexes\n CREATE INDEX IF NOT EXISTS idx_goap_actions_category ON goap_actions(category);\n CREATE INDEX IF NOT EXISTS idx_goap_actions_agent ON goap_actions(agent_type);\n CREATE INDEX IF NOT EXISTS idx_goap_plans_status ON goap_plans(status);\n CREATE INDEX IF NOT EXISTS idx_goap_sig_goal ON goap_plan_signatures(goal_hash);\n CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_plan ON goap_execution_steps(plan_id);\n CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_action ON goap_execution_steps(action_id);\n -- idx_goap_exec_steps_execution is NOT created here: databases with a\n -- pre-existing narrower goap_execution_steps table (missing execution_id)\n -- would fail on \"no such column\" since CREATE TABLE IF NOT EXISTS above\n -- silently no-ops against them. unified-memory.ts's v11 migration creates\n -- this index only after confirming/backfilling the column.\n";
|
|
17
17
|
export declare const DREAM_SCHEMA = "\n -- Concept Graph Nodes (Dream Engine)\n CREATE TABLE IF NOT EXISTS concept_nodes (\n id TEXT PRIMARY KEY,\n concept_type TEXT NOT NULL,\n content TEXT NOT NULL,\n embedding BLOB,\n activation_level REAL DEFAULT 0.0,\n last_activated TEXT,\n pattern_id TEXT,\n metadata TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- Concept Edges\n CREATE TABLE IF NOT EXISTS concept_edges (\n id TEXT PRIMARY KEY,\n source TEXT NOT NULL,\n target TEXT NOT NULL,\n weight REAL NOT NULL DEFAULT 1.0,\n edge_type TEXT NOT NULL,\n evidence INTEGER DEFAULT 1,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (source) REFERENCES concept_nodes(id) ON DELETE CASCADE,\n FOREIGN KEY (target) REFERENCES concept_nodes(id) ON DELETE CASCADE\n );\n\n -- Dream Cycles\n CREATE TABLE IF NOT EXISTS dream_cycles (\n id TEXT PRIMARY KEY,\n start_time TEXT NOT NULL,\n end_time TEXT,\n duration_ms INTEGER,\n concepts_processed INTEGER DEFAULT 0,\n associations_found INTEGER DEFAULT 0,\n insights_generated INTEGER DEFAULT 0,\n status TEXT DEFAULT 'running',\n error TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- Dream Insights\n CREATE TABLE IF NOT EXISTS dream_insights (\n id TEXT PRIMARY KEY,\n cycle_id TEXT NOT NULL,\n insight_type TEXT NOT NULL,\n source_concepts TEXT NOT NULL,\n description TEXT NOT NULL,\n novelty_score REAL DEFAULT 0.5,\n confidence_score REAL DEFAULT 0.5,\n actionable INTEGER DEFAULT 0,\n applied INTEGER DEFAULT 0,\n suggested_action TEXT,\n pattern_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (cycle_id) REFERENCES dream_cycles(id) ON DELETE CASCADE\n );\n\n -- Dream Indexes\n CREATE INDEX IF NOT EXISTS idx_concept_type ON concept_nodes(concept_type);\n CREATE INDEX IF NOT EXISTS idx_concept_activation ON concept_nodes(activation_level);\n CREATE INDEX IF NOT EXISTS idx_concept_pattern ON concept_nodes(pattern_id);\n CREATE INDEX IF NOT EXISTS idx_edge_source ON concept_edges(source);\n CREATE INDEX IF NOT EXISTS idx_edge_target ON concept_edges(target);\n CREATE INDEX IF NOT EXISTS idx_edge_type ON concept_edges(edge_type);\n CREATE INDEX IF NOT EXISTS idx_edge_weight ON concept_edges(weight DESC);\n CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);\n CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);\n";
|
|
18
|
-
|
|
18
|
+
/** FTS5 external-content index over qe_patterns (hybrid vector/text search). */
|
|
19
|
+
export declare const QE_PATTERNS_FTS_TABLE_DDL = "\n CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(\n name, description, pattern_type, qe_domain,\n content='qe_patterns',\n content_rowid='rowid'\n );\n";
|
|
20
|
+
/** Sync triggers keeping qe_patterns_fts in step with qe_patterns, keyed by name. */
|
|
21
|
+
export declare const QE_PATTERNS_FTS_TRIGGER_DDL: Readonly<Record<string, string>>;
|
|
22
|
+
/** FTS5 table plus all sync triggers (idempotent). Requires qe_patterns to exist. */
|
|
23
|
+
export declare const QE_PATTERNS_FTS_SCHEMA: string;
|
|
24
|
+
export declare const QE_PATTERNS_SCHEMA: string;
|
|
25
|
+
/**
|
|
26
|
+
* QE_PATTERNS_SCHEMA without the FTS5 table/triggers, for migrations that run
|
|
27
|
+
* after v9 on an existing DB. Re-creating the sync triggers there (with
|
|
28
|
+
* CREATE TRIGGER IF NOT EXISTS, no rebuild) would hide "triggers were missing"
|
|
29
|
+
* from the on-open self-heal, leaving UPDATE-only drift unrepaired; the heal
|
|
30
|
+
* creates any missing FTS objects and rebuilds instead.
|
|
31
|
+
*/
|
|
32
|
+
export declare const QE_PATTERNS_SCHEMA_WITHOUT_FTS: string;
|
|
19
33
|
export declare const MINCUT_SCHEMA = "\n -- MinCut Graph Snapshots (ADR-047)\n CREATE TABLE IF NOT EXISTS mincut_snapshots (\n id TEXT PRIMARY KEY,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n vertex_count INTEGER NOT NULL,\n edge_count INTEGER NOT NULL,\n total_weight REAL NOT NULL DEFAULT 0.0,\n is_connected INTEGER NOT NULL DEFAULT 1,\n component_count INTEGER NOT NULL DEFAULT 1,\n vertices_json TEXT NOT NULL,\n edges_json TEXT NOT NULL,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- MinCut History (time-series MinCut values)\n CREATE TABLE IF NOT EXISTS mincut_history (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n mincut_value REAL NOT NULL,\n vertex_count INTEGER NOT NULL,\n edge_count INTEGER NOT NULL,\n algorithm TEXT NOT NULL DEFAULT 'weighted-degree',\n duration_ms INTEGER,\n snapshot_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Weak Vertices (detected bottlenecks)\n CREATE TABLE IF NOT EXISTS mincut_weak_vertices (\n id TEXT PRIMARY KEY,\n vertex_id TEXT NOT NULL,\n weighted_degree REAL NOT NULL,\n risk_score REAL NOT NULL,\n reason TEXT NOT NULL,\n domain TEXT,\n vertex_type TEXT NOT NULL,\n suggestions_json TEXT,\n detected_at TEXT NOT NULL DEFAULT (datetime('now')),\n resolved_at TEXT,\n snapshot_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Alerts\n CREATE TABLE IF NOT EXISTS mincut_alerts (\n id TEXT PRIMARY KEY,\n severity TEXT NOT NULL,\n message TEXT NOT NULL,\n mincut_value REAL NOT NULL,\n threshold REAL NOT NULL,\n affected_vertices_json TEXT,\n remediations_json TEXT,\n acknowledged INTEGER DEFAULT 0,\n acknowledged_at TEXT,\n acknowledged_by TEXT,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- MinCut Healing Actions (self-healing history)\n CREATE TABLE IF NOT EXISTS mincut_healing_actions (\n id TEXT PRIMARY KEY,\n action_type TEXT NOT NULL,\n action_params_json TEXT NOT NULL,\n success INTEGER NOT NULL,\n mincut_before REAL NOT NULL,\n mincut_after REAL NOT NULL,\n improvement REAL NOT NULL DEFAULT 0.0,\n error_message TEXT,\n duration_ms INTEGER NOT NULL,\n triggered_by TEXT,\n snapshot_before_id TEXT,\n snapshot_after_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_before_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL,\n FOREIGN KEY (snapshot_after_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Strange Loop Observations (P1: self-organizing)\n CREATE TABLE IF NOT EXISTS mincut_observations (\n id TEXT PRIMARY KEY,\n iteration INTEGER NOT NULL,\n mincut_value REAL NOT NULL,\n weak_vertex_count INTEGER NOT NULL DEFAULT 0,\n weak_vertices_json TEXT,\n snapshot_id TEXT,\n prediction_json TEXT,\n actual_vs_predicted_diff REAL,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Indexes\n CREATE INDEX IF NOT EXISTS idx_mincut_history_timestamp ON mincut_history(timestamp DESC);\n CREATE INDEX IF NOT EXISTS idx_mincut_history_value ON mincut_history(mincut_value);\n CREATE INDEX IF NOT EXISTS idx_mincut_weak_vertex ON mincut_weak_vertices(vertex_id);\n CREATE INDEX IF NOT EXISTS idx_mincut_weak_risk ON mincut_weak_vertices(risk_score DESC);\n CREATE INDEX IF NOT EXISTS idx_mincut_weak_resolved ON mincut_weak_vertices(resolved_at);\n CREATE INDEX IF NOT EXISTS idx_mincut_alerts_severity ON mincut_alerts(severity);\n CREATE INDEX IF NOT EXISTS idx_mincut_alerts_ack ON mincut_alerts(acknowledged);\n CREATE INDEX IF NOT EXISTS idx_mincut_healing_type ON mincut_healing_actions(action_type);\n CREATE INDEX IF NOT EXISTS idx_mincut_healing_success ON mincut_healing_actions(success);\n CREATE INDEX IF NOT EXISTS idx_mincut_observations_iter ON mincut_observations(iteration);\n";
|
|
20
34
|
export declare const SONA_PATTERNS_SCHEMA = "\n -- SONA Patterns table (ADR-046: Pattern Persistence for Neural Backbone)\n CREATE TABLE IF NOT EXISTS sona_patterns (\n id TEXT PRIMARY KEY,\n type TEXT NOT NULL,\n domain TEXT NOT NULL,\n state_embedding BLOB,\n action_embedding BLOB,\n action_type TEXT NOT NULL,\n action_value TEXT,\n outcome_reward REAL NOT NULL DEFAULT 0.0,\n outcome_success INTEGER NOT NULL DEFAULT 0,\n outcome_quality REAL NOT NULL DEFAULT 0.0,\n confidence REAL DEFAULT 0.5,\n usage_count INTEGER DEFAULT 0,\n success_count INTEGER DEFAULT 0,\n failure_count INTEGER DEFAULT 0,\n metadata TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n last_used_at TEXT\n );\n CREATE INDEX IF NOT EXISTS idx_sona_patterns_type ON sona_patterns(type);\n CREATE INDEX IF NOT EXISTS idx_sona_patterns_domain ON sona_patterns(domain);\n CREATE INDEX IF NOT EXISTS idx_sona_patterns_confidence ON sona_patterns(confidence DESC);\n CREATE INDEX IF NOT EXISTS idx_sona_patterns_updated ON sona_patterns(updated_at DESC);\n";
|
|
21
35
|
export declare const WITNESS_CHAIN_SCHEMA = "\n -- Witness Chain (ADR-070: Cryptographic audit trail for QE decisions)\n CREATE TABLE IF NOT EXISTS witness_chain (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n prev_hash TEXT NOT NULL,\n action_hash TEXT NOT NULL,\n action_type TEXT NOT NULL,\n action_data TEXT,\n timestamp TEXT NOT NULL,\n actor TEXT NOT NULL\n );\n CREATE INDEX IF NOT EXISTS idx_witness_action_type ON witness_chain(action_type);\n CREATE INDEX IF NOT EXISTS idx_witness_timestamp ON witness_chain(timestamp);\n";
|