agentic-qe 3.13.12 → 3.14.1
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/helpers/brain-checkpoint.cjs +2 -1
- package/.claude/helpers/validate-v3-config.sh +6 -5
- package/.claude/hooks/aqe-hook.cjs +14 -14
- package/.claude/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/.claude/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/.claude/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/.claude/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/.claude/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/.claude/skills/qe-court/SKILL.md +4 -4
- package/.claude/skills/qe-court/config-schema.json +38 -0
- package/.claude/skills/qe-court/evals/qe-court.yaml +8 -8
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +130 -0
- package/assets/skills/qe-browser/evals/qe-browser.yaml +30 -41
- package/assets/skills/qe-browser/fixtures/serve-skills.js +37 -0
- package/assets/skills/qe-browser/scripts/lib/vibium.js +1 -1
- package/assets/skills/qe-browser/scripts/smoke-test.sh +56 -25
- package/assets/skills/qe-browser/scripts/visual-diff.js +24 -15
- package/assets/skills/qe-court/SKILL.md +4 -4
- package/assets/skills/qe-court/config-schema.json +38 -0
- package/assets/skills/qe-court/evals/qe-court.yaml +8 -8
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/brain-commands.d.ts +1 -0
- package/dist/cli/brain-commands.js +1 -0
- package/dist/cli/bundle.js +7 -7
- package/dist/cli/chunks/adapter-I2N7PEKG.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-7I7LZFNC.js → agent-booster-wasm-OY5Y2CUM.js} +2 -2
- package/dist/cli/chunks/{agent-handler-QZZT52BH.js → agent-handler-TUOH55LD.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-MLQS5Y26.js → agent-memory-branch-XM3IYKT3.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-U4ALUH6A.js +2 -0
- package/dist/cli/chunks/{arena-WRIY37EJ.js → arena-DOCLIEBL.js} +4 -4
- package/dist/cli/chunks/{arena-IM4CP6LP.js → arena-UMFJZKG7.js} +2 -2
- package/dist/cli/chunks/{audit-BSAQ4EFN.js → audit-KZLU5VLW.js} +3 -3
- package/dist/cli/chunks/base-RCYIBNHM.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-X2XZUXWZ.js → better-sqlite3-MIEZBNUI.js} +2 -2
- package/dist/cli/chunks/brain-handler-6PZN46B7.js +90 -0
- package/dist/cli/chunks/{branch-enumerator-NI4Q7DSJ.js → branch-enumerator-XCETHA4F.js} +2 -2
- package/dist/cli/chunks/{browser-PXBLORUZ.js → browser-UEXISDCJ.js} +2 -2
- package/dist/cli/chunks/browser-workflow-L6TDB5O5.js +2 -0
- package/dist/cli/chunks/{chunk-5PNQNBDZ.js → chunk-3AYNHOWS.js} +1 -1
- package/dist/cli/chunks/{chunk-NL2SCAGJ.js → chunk-3BRR2FLH.js} +3 -3
- package/dist/cli/chunks/chunk-3FFMUB3B.js +14 -0
- package/dist/cli/chunks/{chunk-GJJWXRAD.js → chunk-3JMSXOU4.js} +2 -2
- package/dist/cli/chunks/{chunk-MB2KLJ6Q.js → chunk-3TMUCJNJ.js} +1 -1
- package/dist/cli/chunks/{chunk-JVFZAJ5N.js → chunk-3WSH4HD2.js} +2 -2
- package/dist/cli/chunks/{chunk-SCQNISGS.js → chunk-3XRXUVUI.js} +1 -1
- package/dist/cli/chunks/{chunk-Z56BBX77.js → chunk-45S5553E.js} +2 -2
- package/dist/cli/chunks/{chunk-6BSZHNOC.js → chunk-4MT62HKK.js} +1 -1
- package/dist/cli/chunks/{chunk-PVINNJ4P.js → chunk-4ZLFUO4I.js} +2 -2
- package/dist/cli/chunks/{chunk-MYVKTG55.js → chunk-5F5V4QYU.js} +3 -3
- package/dist/cli/chunks/{chunk-2W3D5A4R.js → chunk-5KP62DC3.js} +2 -2
- package/dist/cli/chunks/{chunk-BODFJ3DC.js → chunk-5NSSJUWW.js} +2 -2
- package/dist/cli/chunks/{chunk-KXSUDN46.js → chunk-5T6PAUZD.js} +1 -1
- package/dist/cli/chunks/{chunk-7ZVO7I4Q.js → chunk-5TYGSQOL.js} +1 -1
- package/dist/cli/chunks/{chunk-M7CPJW53.js → chunk-5Y2QFSVZ.js} +2 -2
- package/dist/cli/chunks/{chunk-VQD2ELNL.js → chunk-6B77GPWL.js} +2 -2
- package/dist/cli/chunks/{chunk-GJUGG6UR.js → chunk-6DDMHZWH.js} +2 -2
- package/dist/cli/chunks/{chunk-IPZEBALY.js → chunk-6HMNN2Y2.js} +54 -54
- package/dist/cli/chunks/{chunk-M73KM3AZ.js → chunk-6YIMLUH6.js} +160 -26
- package/dist/cli/chunks/{chunk-UBOGJHWC.js → chunk-6Z6Y3YBX.js} +1 -1
- package/dist/cli/chunks/{chunk-M3354CE4.js → chunk-75SC3GEX.js} +2 -2
- package/dist/cli/chunks/{chunk-TJVTV3HP.js → chunk-7AF55H2D.js} +2 -2
- package/dist/cli/chunks/{chunk-3XVZHJQT.js → chunk-7AYTM426.js} +1 -1
- package/dist/cli/chunks/{chunk-U5G6OC2C.js → chunk-7GF6IRSU.js} +2 -2
- package/dist/cli/chunks/{chunk-LRO74LPA.js → chunk-7XL2D56F.js} +4 -4
- package/dist/cli/chunks/{chunk-MGKH4LCM.js → chunk-A6RB34Y6.js} +1 -1
- package/dist/cli/chunks/{chunk-X2SZCVDA.js → chunk-AESYVAPH.js} +8 -7
- package/dist/cli/chunks/{chunk-3ASVQILY.js → chunk-AZUC7E5S.js} +2 -2
- package/dist/cli/chunks/{chunk-R7LGVJMZ.js → chunk-B6Y6AF4M.js} +2 -2
- package/dist/cli/chunks/chunk-C3XNFIOM.js +2 -0
- package/dist/cli/chunks/{chunk-ZSAGRDXA.js → chunk-CBWF42ET.js} +2 -2
- package/dist/cli/chunks/{chunk-VNODKACB.js → chunk-CCZZZBAO.js} +2 -2
- package/dist/cli/chunks/{chunk-5E76HULA.js → chunk-CGDW47WP.js} +2 -2
- package/dist/cli/chunks/chunk-CGZ7LTUK.js +2 -0
- package/dist/cli/chunks/{chunk-6KI6LAAZ.js → chunk-D6RCRTTR.js} +2 -2
- package/dist/cli/chunks/{chunk-TB2N3CAK.js → chunk-DFXQLHQM.js} +2 -2
- package/dist/cli/chunks/chunk-DKSLJZVA.js +2 -0
- package/dist/cli/chunks/{chunk-JTYCOFTD.js → chunk-DKUKGBJE.js} +1 -1
- package/dist/cli/chunks/{chunk-AN5CGTTJ.js → chunk-DKXSJDII.js} +2 -2
- package/dist/cli/chunks/chunk-EEJP3WTQ.js +4 -0
- package/dist/cli/chunks/{chunk-ZMYV4R32.js → chunk-EHW62JL2.js} +1 -1
- package/dist/cli/chunks/{chunk-WYFAPA2G.js → chunk-EPBWFTHH.js} +2 -2
- package/dist/cli/chunks/{chunk-P6EFKHNI.js → chunk-ERTGGFXZ.js} +2 -2
- package/dist/cli/chunks/{chunk-G45AOQDZ.js → chunk-F7TRO2OM.js} +1 -1
- package/dist/cli/chunks/{chunk-XT473WPO.js → chunk-FFRKTZYP.js} +2 -2
- package/dist/cli/chunks/{chunk-5VSS2RBD.js → chunk-FH7SCX2I.js} +2 -2
- package/dist/cli/chunks/{chunk-44NPKZGI.js → chunk-FHBGALBG.js} +2 -2
- package/dist/cli/chunks/{chunk-NTALX2YC.js → chunk-FOAFRC2W.js} +2 -2
- package/dist/cli/chunks/{chunk-7LATB5IR.js → chunk-FPBQ7BXU.js} +2 -2
- package/dist/cli/chunks/{chunk-AKUDUB3O.js → chunk-FRRRDCXY.js} +2 -2
- package/dist/cli/chunks/{chunk-NG6A7LCG.js → chunk-FZ47ZCRL.js} +1 -1
- package/dist/cli/chunks/{chunk-VD53LBF7.js → chunk-GH3NJOTC.js} +3 -3
- package/dist/cli/chunks/{chunk-NDRZZSD5.js → chunk-GO66DCIZ.js} +2 -2
- package/dist/cli/chunks/{chunk-Z6DSYLAG.js → chunk-GRVR3Y6I.js} +1 -1
- package/dist/cli/chunks/chunk-GYTWUOKU.js +65 -0
- package/dist/cli/chunks/{chunk-6KKVMPPR.js → chunk-H2DX36SC.js} +2 -2
- package/dist/cli/chunks/{chunk-NJ3QXJ54.js → chunk-H5LSXVWY.js} +2 -2
- package/dist/cli/chunks/{chunk-HQWFZQMJ.js → chunk-HBAQVJDP.js} +2 -2
- package/dist/cli/chunks/{chunk-33YZGOT6.js → chunk-HCCILQGN.js} +2 -2
- package/dist/cli/chunks/{chunk-KRZYWVS3.js → chunk-HJD52N32.js} +2 -2
- package/dist/cli/chunks/{chunk-IPDM3CAK.js → chunk-HKU5PPS7.js} +1 -1
- package/dist/cli/chunks/{chunk-7RVLVIAI.js → chunk-HPQU6XZH.js} +1 -1
- package/dist/cli/chunks/{chunk-TWUWLSGQ.js → chunk-HRUQWABO.js} +10 -10
- package/dist/cli/chunks/{chunk-HAJG44BD.js → chunk-IGRTQ6VT.js} +2 -2
- package/dist/cli/chunks/{chunk-WXU7FAEB.js → chunk-IIBXGHZT.js} +2 -2
- package/dist/cli/chunks/{chunk-QG5L2JM5.js → chunk-IYB3GRXF.js} +10 -10
- package/dist/cli/chunks/{chunk-NNLZAVFH.js → chunk-IYIMLLUV.js} +1 -1
- package/dist/cli/chunks/{chunk-SXFSJJZF.js → chunk-J2VF7ZO7.js} +2 -2
- package/dist/cli/chunks/{chunk-4FVOJBEU.js → chunk-J33LKXVH.js} +1 -1
- package/dist/cli/chunks/{chunk-IOJ34SXJ.js → chunk-J7VAD4RG.js} +2 -2
- package/dist/cli/chunks/{chunk-VQCLSX7T.js → chunk-JJ4GUO4K.js} +1 -1
- package/dist/cli/chunks/{chunk-QM4Z7TQH.js → chunk-JMULRLD4.js} +1 -1
- package/dist/cli/chunks/{chunk-LXVT6JXO.js → chunk-JNSTKE3K.js} +2 -2
- package/dist/cli/chunks/{chunk-SOS37ECY.js → chunk-JZUWPDVS.js} +1 -1
- package/dist/cli/chunks/chunk-KHUO4NCW.js +11 -0
- package/dist/cli/chunks/chunk-KXMW7XTJ.js +2 -0
- package/dist/cli/chunks/{chunk-4AITMWFZ.js → chunk-KXTN3FR4.js} +2 -2
- package/dist/cli/chunks/{chunk-4Z4X2ND4.js → chunk-L4WATX6B.js} +2 -2
- package/dist/cli/chunks/{chunk-GMLRIZ4E.js → chunk-L66BWYQH.js} +1 -1
- package/dist/cli/chunks/{chunk-52VGZJSD.js → chunk-LJ63HPPN.js} +1 -1
- package/dist/cli/chunks/{chunk-WE3VKDMK.js → chunk-LMPK63PO.js} +3 -3
- package/dist/cli/chunks/{chunk-S6WHYOWV.js → chunk-LQDFWLKK.js} +27 -25
- package/dist/cli/chunks/{chunk-EG73WYAW.js → chunk-LSXQPMPI.js} +2 -2
- package/dist/cli/chunks/{chunk-NJ4YVAG7.js → chunk-MDLLEUFN.js} +3 -3
- package/dist/cli/chunks/{chunk-YQOQVSYU.js → chunk-MFAN5W27.js} +1 -1
- package/dist/cli/chunks/{chunk-A5RWLPVT.js → chunk-MZ2PJUN6.js} +2 -2
- package/dist/cli/chunks/{chunk-HRTSYT4N.js → chunk-N22LMACN.js} +2 -2
- package/dist/cli/chunks/{chunk-L3GBNX7B.js → chunk-NAJCQJSK.js} +2 -2
- package/dist/cli/chunks/{chunk-XM5I7J5S.js → chunk-ND6JBUVH.js} +2 -2
- package/dist/cli/chunks/{chunk-YL2GOJF6.js → chunk-NEEZ6M4W.js} +2 -2
- package/dist/cli/chunks/{chunk-DGFINXUE.js → chunk-NNJ63W77.js} +1 -1
- package/dist/cli/chunks/{chunk-G6FJHDUG.js → chunk-O7KF3GBV.js} +1 -1
- package/dist/cli/chunks/{chunk-RP2BRRLX.js → chunk-OBKMLOHU.js} +2 -2
- package/dist/cli/chunks/{chunk-AOOCV56W.js → chunk-OBLHI4HA.js} +1 -1
- package/dist/cli/chunks/{chunk-OZ53BIY5.js → chunk-ODNLKYOM.js} +1 -1
- package/dist/cli/chunks/{chunk-VBHA4SDU.js → chunk-PMREFRPP.js} +2 -2
- package/dist/cli/chunks/{chunk-ASWWBNX2.js → chunk-PMUF7WU6.js} +2 -2
- package/dist/cli/chunks/{chunk-I5SXLV7D.js → chunk-PS5NIMWJ.js} +2 -2
- package/dist/cli/chunks/chunk-PS6Y662P.js +13 -0
- package/dist/cli/chunks/{chunk-N4OQ4D4V.js → chunk-PYAH4K2U.js} +2 -2
- package/dist/cli/chunks/{chunk-H3GAR4SV.js → chunk-PZZX57ZA.js} +2 -2
- package/dist/cli/chunks/chunk-QAE4BOIV.js +2 -0
- package/dist/cli/chunks/{chunk-7A4WTRWI.js → chunk-QIY43XQJ.js} +1 -1
- package/dist/cli/chunks/{chunk-MLXLGBQZ.js → chunk-QM6EJHP5.js} +1 -1
- package/dist/cli/chunks/{chunk-4ANJV6I4.js → chunk-QMTBWHGR.js} +3 -3
- package/dist/cli/chunks/{chunk-IT5QIUUA.js → chunk-RCHDSUVU.js} +2 -2
- package/dist/cli/chunks/{chunk-AYH3DMW2.js → chunk-RUEHSOE6.js} +1 -1
- package/dist/cli/chunks/{chunk-DCVFHVPR.js → chunk-RVCMZUSJ.js} +2 -2
- package/dist/cli/chunks/{chunk-2JAC57JE.js → chunk-RXHI6CKK.js} +1 -1
- package/dist/cli/chunks/{chunk-QXO35J6F.js → chunk-RXPHQ4ZE.js} +2 -2
- package/dist/cli/chunks/{chunk-FI6J3UHJ.js → chunk-RYHCYTFE.js} +1 -1
- package/dist/cli/chunks/{chunk-DFLASG3B.js → chunk-S4WIAKPL.js} +1 -1
- package/dist/cli/chunks/{chunk-2VY7FL6A.js → chunk-S53ZUAVI.js} +2 -2
- package/dist/cli/chunks/{chunk-4M7YZ2X7.js → chunk-SEKOMKNG.js} +1 -1
- package/dist/cli/chunks/{chunk-UC4EIULB.js → chunk-SZRDEPUY.js} +19 -19
- package/dist/cli/chunks/chunk-T7XYQX5G.js +24 -0
- package/dist/cli/chunks/{chunk-OG3DBHIV.js → chunk-TF33GKWA.js} +2 -2
- package/dist/cli/chunks/{chunk-2VTX4SYW.js → chunk-TGFJUL6M.js} +2 -2
- package/dist/cli/chunks/{chunk-4THFPRFM.js → chunk-TLD727EF.js} +2 -2
- package/dist/cli/chunks/{chunk-7PCIN7UN.js → chunk-TQ2JZVZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-UWZYXI3R.js → chunk-TT7DF2GX.js} +2 -2
- package/dist/cli/chunks/{chunk-X3JNFQW2.js → chunk-UCJEAK7D.js} +2 -2
- package/dist/cli/chunks/{chunk-AM42ROKZ.js → chunk-UN7EHLRV.js} +1 -1
- package/dist/cli/chunks/{chunk-42AS3HPO.js → chunk-UUE5CBZQ.js} +2 -2
- package/dist/cli/chunks/{chunk-E67ZXRG6.js → chunk-UWRMPRY5.js} +1 -1
- package/dist/cli/chunks/{chunk-4YFXF5AQ.js → chunk-VEWYUEVY.js} +5 -5
- package/dist/cli/chunks/{chunk-UJUK6T4V.js → chunk-VUXHJPUS.js} +2 -2
- package/dist/cli/chunks/{chunk-VA2ORJB5.js → chunk-VVP2ROXD.js} +2 -2
- package/dist/cli/chunks/{chunk-BZIPYXSW.js → chunk-WFJKLM6Z.js} +3 -3
- package/dist/cli/chunks/{chunk-MLFELTJX.js → chunk-X5G3UDWP.js} +2 -2
- package/dist/cli/chunks/{chunk-IQH2RDN3.js → chunk-Y63V33M6.js} +5 -5
- package/dist/cli/chunks/{chunk-XIKYUBIV.js → chunk-YXN47QOI.js} +2 -2
- package/dist/cli/chunks/{chunk-RP5VFZJO.js → chunk-Z5YU2TDS.js} +2 -2
- package/dist/cli/chunks/{chunk-KYJBJ56M.js → chunk-ZAHCVRR7.js} +2 -2
- package/dist/cli/chunks/{chunk-66OQ7AB3.js → chunk-ZC3HC6FO.js} +1 -1
- package/dist/cli/chunks/{ci-QAUD62WH.js → ci-Q2VX75PS.js} +2 -2
- package/dist/cli/chunks/{ci-output-TZDVTNE7.js → ci-output-MD5GTVR2.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ZWPHJ7YJ.js → circuit-breaker-JMRLG2XI.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-SCB4EURN.js → claude-flow-setup-IMXYALBU.js} +2 -2
- package/dist/cli/chunks/client-L4PIXCGV.js +2 -0
- package/dist/cli/chunks/{cline-installer-EHZLMLXF.js → cline-installer-HWFASEGE.js} +2 -2
- package/dist/cli/chunks/{code-3N6PBJMK.js → code-3V37TCAD.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-6DIKHNRI.js → code-index-extractor-5V54WGFL.js} +2 -2
- package/dist/cli/chunks/codex-installer-UCA5AVE6.js +14 -0
- package/dist/cli/chunks/{completions-5MKWWCCE.js → completions-2DMRCQU6.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-TPM4IPEK.js → complexity-analyzer-MMQRXBTD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-VXODKGVX.js → continuedev-installer-FAARXP3S.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-PVD5O56P.js → copilot-installer-AKQALMB5.js} +2 -2
- package/dist/cli/chunks/core-handlers-KROSXP4V.js +2 -0
- package/dist/cli/chunks/{cost-tracker-JOMZEQF3.js → cost-tracker-AXWHDND5.js} +2 -2
- package/dist/cli/chunks/{coverage-HTXLEV3B.js → coverage-ZLSKKCG5.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-WMTYBOON.js +2 -0
- package/dist/cli/chunks/{cursor-installer-SHKDTDDZ.js → cursor-installer-UALCQKVD.js} +2 -2
- package/dist/cli/chunks/{daemon-FCFEWVVJ.js → daemon-4LNOPJGN.js} +3 -3
- package/dist/cli/chunks/{daemon-PN4FEPLE.js → daemon-K3DFGCXC.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-PLOHU5SR.js → dag-attention-scheduler-LCQ7MYKC.js} +2 -2
- package/dist/cli/chunks/{detect-F3H4ZEZY.js → detect-P7PEN3MZ.js} +2 -2
- package/dist/cli/chunks/{dist-node-5TC665N6.js → dist-node-I72BJC2D.js} +2 -2
- package/dist/cli/chunks/{domain-handler-ZIWVFXCU.js → domain-handler-LROF6KWN.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-7Q5JYMYR.js → domain-transfer-M2ZSSTPV.js} +2 -2
- package/dist/cli/chunks/dream-AV63YQ2Y.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-MTBPUGO4.js +3 -0
- package/dist/cli/chunks/{eval-E2K2T75A.js → eval-O24ALB3W.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-Z5SE2O53.js → experience-capture-middleware-7JXEOGRE.js} +3 -3
- package/dist/cli/chunks/{fast-paths-3H52RSUK.js → fast-paths-4CFYJV4U.js} +2 -2
- package/dist/cli/chunks/{feature-flags-ONIKUZVK.js → feature-flags-CHPUA7IM.js} +2 -2
- package/dist/cli/chunks/{feature-flags-LUHSMHPS.js → feature-flags-E6PIM6ZB.js} +2 -2
- package/dist/cli/chunks/{file-discovery-FLYSYSS4.js → file-discovery-2ANIAUCP.js} +2 -2
- package/dist/cli/chunks/{fleet-6OJUAAKV.js → fleet-2MQ3OGCP.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-PUL6B7KZ.js → gnn-wrapper-P7JW3622.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-HGHHDUDY.js → heartbeat-handler-WWWZSA7V.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-5IZUGMC2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-NV2NNBJL.js +2 -0
- package/dist/cli/chunks/hnsw-index-GRJ3KA2O.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-NDZSNMYX.js → hnsw-legacy-bridge-W634ZOTV.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-PISLKSO2.js → hnswlib-node-SLZDLMKM.js} +2 -2
- package/dist/cli/chunks/{hooks-WYG54MRI.js → hooks-3BFAZGG7.js} +10 -10
- package/dist/cli/chunks/{hypergraph-engine-EDHKHZZ2.js → hypergraph-engine-XJSGXP2J.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-OCHZAPPL.js → hypergraph-handler-RVUWZMOX.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-YM4QUWVH.js +2 -0
- package/dist/cli/chunks/{init-handler-5TCJ672H.js → init-handler-FYOZNNNO.js} +9 -8
- package/dist/cli/chunks/init-wizard-YESXGIK6.js +2 -0
- package/dist/cli/chunks/kernel-VH5SKESU.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-SWUQRCTZ.js → kilocode-installer-MAAKFVSB.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-L22EBAM5.js → kiro-installer-GX3TLZC5.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-F3NL4WJV.js +2 -0
- package/dist/cli/chunks/learning-T4QZ6C26.js +122 -0
- package/dist/cli/chunks/{llm-router-F2L4LFT2.js → llm-router-N2M4WXOC.js} +14 -14
- package/dist/cli/chunks/llm-router-service-HQYCJMPK.js +2 -0
- package/dist/cli/chunks/{load-A4ZF2KHC.js → load-6RU3G4P2.js} +2 -2
- package/dist/cli/chunks/load-test-GWRGKWMN.js +2 -0
- package/dist/cli/chunks/{mcp-T2Z46NNK.js → mcp-EFBO7BAU.js} +2 -2
- package/dist/cli/chunks/{memory-PUC3J6XC.js → memory-AXU2M3DN.js} +5 -5
- package/dist/cli/chunks/memory-backend-7A2PFKPV.js +2 -0
- package/dist/cli/chunks/memory-handlers-65CXN76C.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-U5L4FI4O.js → multi-model-executor-W7AFGVNH.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-UWI6KHYH.js → opencode-installer-KJE2RLCH.js} +2 -2
- package/dist/cli/chunks/{orchestrator-3BEI7R5D.js → orchestrator-CL6MLGVU.js} +22 -24
- package/dist/cli/chunks/pattern-null-store-K2WPRYCP.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-EGWUI5LU.js → pattern-usage-recorder-7SNSJ7K2.js} +2 -2
- package/dist/cli/chunks/{pipeline-JG6M4RHD.js → pipeline-3UU6ON3F.js} +2 -2
- package/dist/cli/chunks/platform-SNMPIDIT.js +2 -0
- package/dist/cli/chunks/{plugin-EEGN3PMK.js → plugin-65IIUUCU.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-7KZAINFT.js → prime-radiant-advanced-wasm-WWWJRLRP.js} +2 -2
- package/dist/cli/chunks/protocol-executor-TJDLEHND.js +2 -0
- package/dist/cli/chunks/{protocol-handler-UCEHYK2R.js → protocol-handler-SEBHCLLJ.js} +2 -2
- package/dist/cli/chunks/{prove-JSNG75VD.js → prove-N4X7CCJ4.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-CGRMFPDM.js +2 -0
- package/dist/cli/chunks/{quality-7SRM2HBM.js → quality-LBCJWXMU.js} +2 -2
- package/dist/cli/chunks/quality-gate-KZIQI7QT.js +7 -0
- package/dist/cli/chunks/queen-coordinator-FKP6QZAQ.js +2 -0
- package/dist/cli/chunks/real-embeddings-XCZFHFME.js +2 -0
- package/dist/cli/chunks/{roocode-installer-UYQK64BZ.js → roocode-installer-P3O6B7PT.js} +2 -2
- package/dist/cli/chunks/router-KZ5BISAM.js +2 -0
- package/dist/cli/chunks/routing-feedback-O4Y5TTR6.js +2 -0
- package/dist/cli/chunks/{routing-handler-PY3KPDTH.js → routing-handler-OXZ4DOV4.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-GCAOUTYS.js → ruvector-commands-PSY5IDSL.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-NG3UF3D5.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-PUHVTKQY.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-4SUT7GTJ.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-ODXFKZ6G.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-HNDKOM4L.js → rvf-store-integrity-TCKC22FH.js} +2 -2
- package/dist/cli/chunks/safe-db-BUQDNH2R.js +2 -0
- package/dist/cli/chunks/schedule-ZXNDZNNB.js +2 -0
- package/dist/cli/chunks/scheduler-YUQQWWW3.js +2 -0
- package/dist/cli/chunks/{security-MQ2VB7PY.js → security-RQGUQGSI.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-TAZEU6QK.js → shared-rvf-adapter-ZJFN52C2.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-B7N6AOCY.js → shared-rvf-dual-writer-V2R37HWV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-HVSX46C7.js +2 -0
- package/dist/cli/chunks/{status-handler-NZP7DFHE.js → status-handler-XEKWNVDR.js} +2 -2
- package/dist/cli/chunks/{structural-health-ALLUQ4X6.js → structural-health-QMIW6WUN.js} +2 -2
- package/dist/cli/chunks/{sync-WJJG5J6V.js → sync-GDYJ2ULT.js} +2 -2
- package/dist/cli/chunks/{sync-MM7OCUYD.js → sync-H5SXWXPP.js} +2 -2
- package/dist/cli/chunks/{task-handler-CAQUEEB4.js → task-handler-EPLKCQHY.js} +2 -2
- package/dist/cli/chunks/{task-handlers-25BJ7D3W.js → task-handlers-22NTLWTC.js} +3 -3
- package/dist/cli/chunks/{test-HW7GVGVN.js → test-WHJFRZ3F.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-HTMFJMSP.js → test-scheduling-KZVFZOQN.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-BW5WA6PY.js +2 -0
- package/dist/cli/chunks/{token-usage-RJZDMBDP.js → token-usage-4A4O57R6.js} +2 -2
- package/dist/cli/chunks/{transformers-3YFW3EUO.js → transformers-FYTBRV46.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-U3PQPIK7.js → tree-sitter-wasm-parser-TZIJPLF3.js} +2 -2
- package/dist/cli/chunks/{types-7Q762WDO.js → types-B2L6LKFA.js} +2 -2
- package/dist/cli/chunks/unified-memory-AHN4RVBP.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-XB7JPF74.js +2 -0
- package/dist/cli/chunks/unified-persistence-53KWNFQJ.js +2 -0
- package/dist/cli/chunks/{upgrade-F7MKJWBQ.js → upgrade-O6U7EA7V.js} +2 -2
- package/dist/cli/chunks/{validate-B27AVRA6.js → validate-FHNZ5XL3.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-GYZR3GNL.js → validate-swarm-YOLLUEHE.js} +2 -2
- package/dist/cli/chunks/{vibium-W4XQMPJP.js → vibium-UXRPEIXB.js} +2 -2
- package/dist/cli/chunks/visual-security-CRPYS7L7.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-I7CDCFJU.js → web-tree-sitter-JJ5UIYFD.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-UYLHFDHU.js → windsurf-installer-I4QMQPIL.js} +2 -2
- package/dist/cli/chunks/witness-chain-5WCR2CAS.js +2 -0
- package/dist/cli/chunks/{witness-chain-B66SYZKU.js → witness-chain-BIJ7WDGS.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-U4JPAHVW.js → witness-key-manager-3SMMLJLP.js} +2 -2
- package/dist/cli/chunks/{workflow-DYMO47FF.js → workflow-33PUXXJV.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-RZWCLTT5.js +2 -0
- package/dist/cli/chunks/{wrappers-7S6DQTEA.js → wrappers-ASAU36VK.js} +2 -2
- package/dist/cli/commands/learning.js +44 -0
- package/dist/cli/commands/llm-router.js +27 -21
- package/dist/cli/commands/platform.d.ts +1 -0
- package/dist/cli/commands/platform.js +28 -6
- package/dist/cli/commands/quality-gate.js +25 -3
- package/dist/cli/handlers/brain-handler.js +2 -0
- package/dist/cli/handlers/init-handler.d.ts +5 -0
- package/dist/cli/handlers/init-handler.js +6 -0
- package/dist/cli/index.js +4 -1
- package/dist/context/compaction/index.d.ts +1 -0
- package/dist/context/compaction/index.js +3 -0
- package/dist/context/compaction/instruction-provenance.d.ts +20 -0
- package/dist/context/compaction/instruction-provenance.js +18 -0
- package/dist/context/compaction/tier2-session-summary.d.ts +8 -0
- package/dist/context/compaction/tier2-session-summary.js +20 -0
- package/dist/context/compaction/tier3-llm-compact.d.ts +4 -0
- package/dist/context/compaction/tier3-llm-compact.js +32 -4
- package/dist/contracts/verdicts.d.ts +625 -0
- package/dist/contracts/verdicts.js +202 -14
- package/dist/coordination/handlers/coverage-handlers.js +8 -1
- package/dist/domains/chaos-resilience/diagnosis/corpus.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/corpus.js +141 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.d.ts +11 -0
- package/dist/domains/chaos-resilience/diagnosis/detectors.js +109 -0
- package/dist/domains/chaos-resilience/diagnosis/index.d.ts +5 -0
- package/dist/domains/chaos-resilience/diagnosis/index.js +5 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.d.ts +8 -0
- package/dist/domains/chaos-resilience/diagnosis/scorer.js +128 -0
- package/dist/domains/chaos-resilience/diagnosis/types.d.ts +171 -0
- package/dist/domains/chaos-resilience/diagnosis/types.js +3 -0
- package/dist/domains/chaos-resilience/index.d.ts +1 -0
- package/dist/domains/chaos-resilience/index.js +1 -0
- package/dist/domains/index.d.ts +1 -0
- package/dist/domains/index.js +1 -0
- package/dist/early-exit/early-exit-controller.d.ts +4 -2
- package/dist/early-exit/early-exit-controller.js +95 -7
- package/dist/early-exit/index.d.ts +1 -1
- package/dist/early-exit/speculative-executor.js +3 -0
- package/dist/early-exit/types.d.ts +51 -0
- package/dist/early-exit/types.js +3 -0
- package/dist/index.d.ts +4 -2
- package/dist/index.js +2 -1
- package/dist/init/browser-engine-installer.d.ts +11 -0
- package/dist/init/browser-engine-installer.js +35 -5
- package/dist/init/codex-installer.d.ts +11 -1
- package/dist/init/codex-installer.js +90 -24
- package/dist/init/init-wizard-hooks.js +11 -11
- package/dist/init/orchestrator.js +2 -0
- package/dist/init/phases/07-hooks.d.ts +3 -3
- package/dist/init/phases/07-hooks.js +19 -21
- package/dist/init/phases/09-assets.d.ts +4 -0
- package/dist/init/phases/09-assets.js +13 -10
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/init/types.d.ts +4 -0
- package/dist/integrations/embeddings/base/EmbeddingGenerator.js +4 -2
- package/dist/integrations/ruvector/brain-exporter.d.ts +1 -1
- package/dist/integrations/ruvector/brain-exporter.js +15 -3
- package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +4 -0
- package/dist/integrations/ruvector/brain-rvf-exporter.js +118 -37
- package/dist/integrations/ruvector/brain-search.d.ts +1 -1
- package/dist/integrations/ruvector/brain-search.js +1 -1
- package/dist/integrations/ruvector/brain-shared.d.ts +4 -2
- package/dist/integrations/ruvector/brain-shared.js +11 -4
- package/dist/integrations/ruvector/brain-table-ddl.d.ts +2 -2
- package/dist/integrations/ruvector/brain-table-ddl.js +20 -8
- package/dist/integrations/ruvector/cognitive-container.js +1 -1
- package/dist/integrations/ruvector/rvf-dual-writer.d.ts +4 -0
- package/dist/integrations/ruvector/rvf-dual-writer.js +57 -9
- package/dist/integrations/ruvector/rvf-store-integrity.js +1 -1
- package/dist/kernel/unified-memory-schemas.d.ts +4 -3
- package/dist/kernel/unified-memory-schemas.js +19 -9
- package/dist/kernel/unified-memory.d.ts +2 -0
- package/dist/kernel/unified-memory.js +19 -0
- package/dist/learning/embed-and-insert-pattern.js +6 -3
- package/dist/learning/embedding-space.d.ts +50 -0
- package/dist/learning/embedding-space.js +128 -0
- package/dist/learning/evidence-admission-store.d.ts +15 -0
- package/dist/learning/evidence-admission-store.js +68 -0
- package/dist/learning/index.d.ts +7 -0
- package/dist/learning/index.js +4 -0
- package/dist/learning/learning-evidence-admission.d.ts +44 -0
- package/dist/learning/learning-evidence-admission.js +97 -0
- package/dist/learning/pattern-mutation-error.d.ts +9 -0
- package/dist/learning/pattern-mutation-error.js +14 -0
- package/dist/learning/pattern-store.d.ts +5 -0
- package/dist/learning/pattern-store.js +60 -9
- package/dist/learning/qe-flywheel/coupled-anchor.d.ts +8 -0
- package/dist/learning/qe-flywheel/coupled-anchor.js +46 -3
- package/dist/learning/qe-reasoning-bank.js +28 -5
- package/dist/learning/real-embeddings.d.ts +3 -0
- package/dist/learning/real-embeddings.js +40 -3
- package/dist/learning/real-qe-reasoning-bank.js +7 -3
- package/dist/learning/rvf-pattern-migration.d.ts +2 -0
- package/dist/learning/rvf-pattern-migration.js +5 -3
- package/dist/learning/rvf-pattern-store.d.ts +3 -0
- package/dist/learning/rvf-pattern-store.js +44 -6
- package/dist/learning/sqlite-persistence.d.ts +7 -2
- package/dist/learning/sqlite-persistence.js +58 -21
- package/dist/learning/structural-retrieval/corpus.d.ts +5 -0
- package/dist/learning/structural-retrieval/corpus.js +97 -0
- package/dist/learning/structural-retrieval/evaluate.d.ts +7 -0
- package/dist/learning/structural-retrieval/evaluate.js +124 -0
- package/dist/learning/structural-retrieval/index.d.ts +6 -0
- package/dist/learning/structural-retrieval/index.js +4 -0
- package/dist/learning/structural-retrieval/receipt.d.ts +14 -0
- package/dist/learning/structural-retrieval/receipt.js +36 -0
- package/dist/learning/structural-retrieval/types.d.ts +83 -0
- package/dist/learning/structural-retrieval/types.js +2 -0
- package/dist/mcp/bundle.js +589 -433
- package/dist/mcp/handlers/memory-handlers.js +6 -2
- package/dist/mcp/services/session-resume.d.ts +15 -19
- package/dist/mcp/services/session-resume.js +204 -194
- package/dist/mcp/tools/quality-assessment/gate.d.ts +8 -5
- package/dist/mcp/tools/quality-assessment/gate.js +9 -4
- package/dist/migrations/20260830_add_learning_evidence_tables.d.ts +7 -0
- package/dist/migrations/20260830_add_learning_evidence_tables.js +173 -0
- package/dist/persistence/rvf-migration-adapter.d.ts +2 -0
- package/dist/persistence/rvf-migration-adapter.js +56 -12
- package/dist/shared/llm/llm-router-service.d.ts +8 -0
- package/dist/shared/llm/llm-router-service.js +21 -3
- package/dist/shared/sql-safety.js +4 -0
- package/dist/skills/qe-court/cli.d.ts +3 -0
- package/dist/skills/qe-court/cli.js +54 -0
- package/dist/validation/quality-gate-runner.d.ts +27 -4
- package/dist/validation/quality-gate-runner.js +33 -4
- package/dist/validation/verification-reach.d.ts +90 -0
- package/dist/validation/verification-reach.js +187 -0
- package/dist/verification/adversarial-verify/calibrate.d.ts +46 -2
- package/dist/verification/adversarial-verify/calibrate.js +104 -2
- package/dist/verification/adversarial-verify/index.d.ts +2 -2
- package/dist/verification/adversarial-verify/index.js +1 -1
- package/dist/verification/adversarial-verify/measurement-receipt.d.ts +13 -0
- package/dist/verification/adversarial-verify/measurement-receipt.js +136 -0
- package/dist/verification/adversarial-verify/synthesize.js +7 -10
- package/dist/verification/adversarial-verify/types.d.ts +35 -0
- package/dist/verification/adversarial-verify/verify.js +6 -1
- package/package.json +14 -6
- package/schemas/coverage-gap.schema.json +41 -0
- package/schemas/finding-verdict.schema.json +470 -0
- package/schemas/risk-decision.schema.json +41 -0
- package/dist/cli/chunks/adapter-FUV6LBJT.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-QNFNA3J4.js +0 -2
- package/dist/cli/chunks/base-37W2XIXC.js +0 -2
- package/dist/cli/chunks/brain-handler-TVTTWZGP.js +0 -89
- package/dist/cli/chunks/browser-workflow-PDIUEK7B.js +0 -2
- package/dist/cli/chunks/chunk-5PI75QYP.js +0 -4
- package/dist/cli/chunks/chunk-EDRPTLAX.js +0 -2
- package/dist/cli/chunks/chunk-GEQWCK4F.js +0 -2
- package/dist/cli/chunks/chunk-GQLJYTXN.js +0 -2
- package/dist/cli/chunks/chunk-NLZUGANH.js +0 -11
- package/dist/cli/chunks/chunk-O4BWESH5.js +0 -2
- package/dist/cli/chunks/chunk-PGFCKE4G.js +0 -12
- package/dist/cli/chunks/chunk-RACWX2ZX.js +0 -9
- package/dist/cli/chunks/chunk-SNC73DWF.js +0 -2
- package/dist/cli/chunks/chunk-TDVMILKO.js +0 -2
- package/dist/cli/chunks/chunk-TK5XLF3Z.js +0 -65
- package/dist/cli/chunks/chunk-UQ4UCHO7.js +0 -2
- package/dist/cli/chunks/chunk-VZGP77YU.js +0 -12
- package/dist/cli/chunks/chunk-WA6CSEOX.js +0 -2
- package/dist/cli/chunks/chunk-WYIXNHPF.js +0 -2
- package/dist/cli/chunks/client-4W3KWTAU.js +0 -2
- package/dist/cli/chunks/codex-installer-P7DPQMYL.js +0 -15
- package/dist/cli/chunks/core-handlers-BDU2XBLO.js +0 -2
- package/dist/cli/chunks/cross-domain-router-BPB6IHN4.js +0 -2
- package/dist/cli/chunks/dream-WFCZGFDY.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-VESJQSYD.js +0 -3
- package/dist/cli/chunks/heartbeat-scheduler-HWS4SHRM.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-7QOBHKRB.js +0 -2
- package/dist/cli/chunks/hnsw-index-6WUKYJH7.js +0 -2
- package/dist/cli/chunks/hybrid-router-525JTRA5.js +0 -2
- package/dist/cli/chunks/impact-analyzer-GG6CJEOK.js +0 -2
- package/dist/cli/chunks/init-wizard-4VFAOK4Y.js +0 -2
- package/dist/cli/chunks/kernel-N3FQGOST.js +0 -2
- package/dist/cli/chunks/knowledge-graph-I5QIHB4G.js +0 -2
- package/dist/cli/chunks/learning-TQOGG3CR.js +0 -119
- package/dist/cli/chunks/llm-router-service-NCJZYJLG.js +0 -2
- package/dist/cli/chunks/load-test-DCJEYIXD.js +0 -2
- package/dist/cli/chunks/memory-backend-O6KO2KTX.js +0 -2
- package/dist/cli/chunks/memory-handlers-4Z43WEKD.js +0 -2
- package/dist/cli/chunks/pattern-null-store-5WIJKX2K.js +0 -2
- package/dist/cli/chunks/platform-F76G6RUI.js +0 -2
- package/dist/cli/chunks/protocol-executor-5TPNAZTB.js +0 -2
- package/dist/cli/chunks/provider-manager-3VMOZ6HV.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-BATV4NTT.js +0 -2
- package/dist/cli/chunks/quality-gate-A5MPWHST.js +0 -7
- package/dist/cli/chunks/queen-coordinator-EIHGYBUO.js +0 -2
- package/dist/cli/chunks/real-embeddings-ZBF5EQOG.js +0 -2
- package/dist/cli/chunks/router-EMVGY4HU.js +0 -2
- package/dist/cli/chunks/routing-feedback-JUP4OFB2.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-BUNP4SKD.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-VSOAPLMB.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-LSWEHAWX.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-LOC42TQ6.js +0 -2
- package/dist/cli/chunks/safe-db-WQ62IQKV.js +0 -2
- package/dist/cli/chunks/schedule-XJRP57TE.js +0 -2
- package/dist/cli/chunks/scheduler-EZH5SDIM.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-HPEVCTIB.js +0 -2
- package/dist/cli/chunks/token-bootstrap-F2DCLWGW.js +0 -2
- package/dist/cli/chunks/unified-memory-ATILROKR.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-XJXAX7DW.js +0 -2
- package/dist/cli/chunks/unified-persistence-3TN5PBWE.js +0 -2
- package/dist/cli/chunks/visual-security-VFWRBCNA.js +0 -2
- package/dist/cli/chunks/witness-chain-JC5LEXRV.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-TKQUF2KN.js +0 -2
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
* a real policy-weighted DB retriever + an LLM test generator in production
|
|
21
21
|
* (the LLM step is the metered part — bind it deliberately).
|
|
22
22
|
*/
|
|
23
|
-
import { computeRealEmbedding } from '../real-embeddings.js';
|
|
23
|
+
import { computeRealEmbedding, getActiveEmbeddingSpaceIdentity } from '../real-embeddings.js';
|
|
24
|
+
import { EmbeddingSpaceError, inspectEmbeddingSpaceRows, verifyEmbeddingRoundTrip, } from '../embedding-space.js';
|
|
24
25
|
import { evaluateOracle } from '../../validation/oracle-eval.js';
|
|
25
26
|
import { loadAnchorSet, anchorMean as meanOf } from '../../validation/anchor-set.js';
|
|
26
27
|
import { createCorpusScorer } from './corpus-scorer.js';
|
|
@@ -124,20 +125,62 @@ function cosine(a, b) {
|
|
|
124
125
|
export function createSemanticRetriever(opts) {
|
|
125
126
|
const embed = opts.embed ?? ((t) => computeRealEmbedding(t));
|
|
126
127
|
const topK = opts.topK ?? 3;
|
|
128
|
+
const hasSpaceId = opts.db.prepare("PRAGMA table_info('qe_pattern_embeddings')").all()
|
|
129
|
+
.some((column) => column.name === 'space_id');
|
|
127
130
|
const rows = opts.db.prepare(`SELECT p.id AS id, p.name AS name, COALESCE(p.description,'') AS body,
|
|
128
|
-
e.embedding AS embedding, e.dimension AS dimension
|
|
131
|
+
e.embedding AS embedding, e.dimension AS dimension, ${hasSpaceId ? 'e.space_id' : 'NULL'} AS space_id
|
|
129
132
|
FROM qe_patterns p JOIN qe_pattern_embeddings e ON e.pattern_id = p.id
|
|
130
133
|
WHERE p.deprecated_at IS NULL`).all();
|
|
131
134
|
const toks = (s) => new Set(s.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean));
|
|
132
135
|
const docs = rows.map((r) => ({
|
|
133
|
-
id: r.id, name: r.name, body: r.body,
|
|
136
|
+
id: r.id, name: r.name, body: r.body, spaceId: r.space_id,
|
|
134
137
|
vec: new Float32Array(r.embedding.buffer, r.embedding.byteOffset, r.dimension),
|
|
135
138
|
nameToks: toks(r.name), bodyToks: toks(r.body),
|
|
136
139
|
}));
|
|
137
140
|
const queryCache = new Map();
|
|
141
|
+
let compatibilityCheck = null;
|
|
138
142
|
return async (query, policy) => {
|
|
139
143
|
if (docs.length === 0)
|
|
140
144
|
return [];
|
|
145
|
+
try {
|
|
146
|
+
if (!opts.writeEmbed) {
|
|
147
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_UNVERIFIED', 'an independent storage-side embedder is required for the write/read canary');
|
|
148
|
+
}
|
|
149
|
+
if (!compatibilityCheck) {
|
|
150
|
+
compatibilityCheck = verifyEmbeddingRoundTrip(opts.writeEmbed, embed);
|
|
151
|
+
}
|
|
152
|
+
try {
|
|
153
|
+
await compatibilityCheck;
|
|
154
|
+
}
|
|
155
|
+
catch (error) {
|
|
156
|
+
compatibilityCheck = null;
|
|
157
|
+
throw error;
|
|
158
|
+
}
|
|
159
|
+
const activeIdentity = opts.embeddingSpace ?? getActiveEmbeddingSpaceIdentity();
|
|
160
|
+
const writeIdentity = opts.writeEmbeddingSpace ?? activeIdentity;
|
|
161
|
+
if (!activeIdentity || !writeIdentity) {
|
|
162
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_UNVERIFIED', 'runtime embedding-space identity is unavailable');
|
|
163
|
+
}
|
|
164
|
+
if (writeIdentity.spaceId !== activeIdentity.spaceId) {
|
|
165
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_MISMATCH', `write space ${writeIdentity.spaceId} != query space ${activeIdentity.spaceId}`);
|
|
166
|
+
}
|
|
167
|
+
const invalidDimensions = docs.filter((doc) => doc.vec.length !== activeIdentity.dimensions);
|
|
168
|
+
if (invalidDimensions.length > 0) {
|
|
169
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_MISMATCH', `${invalidDimensions.length} stored vectors have dimensions incompatible with ${activeIdentity.dimensions}`);
|
|
170
|
+
}
|
|
171
|
+
const diagnostics = inspectEmbeddingSpaceRows(docs.map((doc) => ({ spaceId: doc.spaceId })), activeIdentity.spaceId);
|
|
172
|
+
if (diagnostics.unverifiedVectors > 0) {
|
|
173
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_UNVERIFIED', `${diagnostics.unverifiedVectors} stored vectors have no provenance`);
|
|
174
|
+
}
|
|
175
|
+
if (diagnostics.status === 'vector_space_mismatch') {
|
|
176
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_MISMATCH', `stored spaces [${diagnostics.storedSpaceIds.join(', ')}] do not match ${activeIdentity.spaceId}`);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
catch (error) {
|
|
180
|
+
if (opts.fallback)
|
|
181
|
+
return opts.fallback(query, policy);
|
|
182
|
+
throw error;
|
|
183
|
+
}
|
|
141
184
|
let qv = queryCache.get(query);
|
|
142
185
|
if (!qv) {
|
|
143
186
|
qv = new Float32Array(await embed(query));
|
|
@@ -22,6 +22,8 @@ import { getGuidance, getCombinedGuidance, generateGuidanceContext, checkAntiPat
|
|
|
22
22
|
import { createPatternStore, } from './pattern-store.js';
|
|
23
23
|
import { createSQLitePatternStore, } from './sqlite-persistence.js';
|
|
24
24
|
import { getWitnessChain } from '../audit/witness-chain.js';
|
|
25
|
+
import { getActiveEmbeddingSpaceIdentity } from './real-embeddings.js';
|
|
26
|
+
import { PatternMutationError } from './pattern-mutation-error.js';
|
|
25
27
|
// Import extracted modules
|
|
26
28
|
import { DEFAULT_QE_REASONING_BANK_CONFIG } from './qe-reasoning-bank-types.js';
|
|
27
29
|
import { PRETRAINED_PATTERNS } from './pretrained-patterns.js';
|
|
@@ -280,16 +282,34 @@ export class QEReasoningBank {
|
|
|
280
282
|
options = { ...options, embedding };
|
|
281
283
|
}
|
|
282
284
|
const result = await this.patternStore.create(options);
|
|
285
|
+
// A pending-index error still proves the authoritative SQLite mutation
|
|
286
|
+
// committed. Resolve that committed row for witness and replication side
|
|
287
|
+
// effects, while returning the original typed partial disposition.
|
|
288
|
+
let committedPattern = result.success ? result.value : null;
|
|
289
|
+
if (!result.success &&
|
|
290
|
+
result.error instanceof PatternMutationError &&
|
|
291
|
+
result.error.disposition === 'COMMITTED_PENDING_INDEX') {
|
|
292
|
+
try {
|
|
293
|
+
committedPattern = await this.patternStore.get(result.error.patternId);
|
|
294
|
+
}
|
|
295
|
+
catch (error) {
|
|
296
|
+
logger.warn('Committed pattern lookup failed', {
|
|
297
|
+
patternId: result.error.patternId,
|
|
298
|
+
error: toErrorMessage(error),
|
|
299
|
+
});
|
|
300
|
+
}
|
|
301
|
+
}
|
|
283
302
|
// ADR-070: Record pattern creation in witness chain
|
|
284
|
-
if (
|
|
285
|
-
|
|
303
|
+
if (committedPattern) {
|
|
304
|
+
const sideEffectPattern = committedPattern;
|
|
305
|
+
getWitnessChain().then(wc => wc.append('PATTERN_CREATE', { patternId: sideEffectPattern.id, domain: sideEffectPattern.qeDomain, confidence: sideEffectPattern.confidence, name: sideEffectPattern.name }, 'reasoning-bank')).catch((e) => { logger.warn('Witness chain PATTERN_CREATE failed', { error: toErrorMessage(e) }); });
|
|
286
306
|
// Phase 3: Best-effort RVF dual-write for vector replication
|
|
287
|
-
if (this.rvfDualWriter &&
|
|
307
|
+
if (this.rvfDualWriter && sideEffectPattern.embedding && sideEffectPattern.embedding.length > 0) {
|
|
288
308
|
try {
|
|
289
|
-
this.rvfDualWriter.writePattern(
|
|
309
|
+
this.rvfDualWriter.writePattern(sideEffectPattern.id, sideEffectPattern.embedding);
|
|
290
310
|
}
|
|
291
311
|
catch (rvfErr) {
|
|
292
|
-
logger.warn('RVF dual-write failed (non-fatal)', { patternId:
|
|
312
|
+
logger.warn('RVF dual-write failed (non-fatal)', { patternId: sideEffectPattern.id, error: toErrorMessage(rvfErr) });
|
|
293
313
|
}
|
|
294
314
|
}
|
|
295
315
|
}
|
|
@@ -323,6 +343,9 @@ export class QEReasoningBank {
|
|
|
323
343
|
return this.patternStore.search(searchQuery, {
|
|
324
344
|
...options,
|
|
325
345
|
useVectorSearch,
|
|
346
|
+
embeddingSpaceId: typeof query === 'string'
|
|
347
|
+
? getActiveEmbeddingSpaceIdentity()?.spaceId
|
|
348
|
+
: options?.embeddingSpaceId,
|
|
326
349
|
});
|
|
327
350
|
}
|
|
328
351
|
/**
|
|
@@ -7,6 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
export { cosineSimilarity } from '../shared/utils/vector-math.js';
|
|
9
9
|
import { type EndpointIdentity } from './embedder-endpoint-client.js';
|
|
10
|
+
import { type EmbeddingSpaceIdentity } from './embedding-space.js';
|
|
10
11
|
/**
|
|
11
12
|
* Embedding model configuration
|
|
12
13
|
*/
|
|
@@ -83,4 +84,6 @@ export declare function isUsingEndpoint(): boolean;
|
|
|
83
84
|
* ADR-097: Returns the endpoint identity fingerprint, or null when not using an endpoint.
|
|
84
85
|
*/
|
|
85
86
|
export declare function getEndpointIdentity(): EndpointIdentity | null;
|
|
87
|
+
/** Runtime-backed identity of the initialized embedding space. */
|
|
88
|
+
export declare function getActiveEmbeddingSpaceIdentity(): EmbeddingSpaceIdentity | null;
|
|
86
89
|
//# sourceMappingURL=real-embeddings.d.ts.map
|
|
@@ -10,6 +10,7 @@ export { cosineSimilarity } from '../shared/utils/vector-math.js';
|
|
|
10
10
|
import { toErrorMessage } from '../shared/error-utils.js';
|
|
11
11
|
import { EmbedderEndpointClient, redactEndpoint, } from './embedder-endpoint-client.js';
|
|
12
12
|
import { loadEmbedderIdentity, resetEmbedderIdentityStore, saveEmbedderIdentity, } from './embedder-identity-store.js';
|
|
13
|
+
import { EMBEDDING_SPACE_CANARY, deriveEmbeddingSpaceIdentity, fingerprintEmbeddingRuntime, } from './embedding-space.js';
|
|
13
14
|
// Lazy-loaded transformer pipeline
|
|
14
15
|
let pipeline = null;
|
|
15
16
|
let embeddingModel = null;
|
|
@@ -22,6 +23,7 @@ let failureReason = '';
|
|
|
22
23
|
*/
|
|
23
24
|
let endpointClient = null;
|
|
24
25
|
let endpointIdentity = null;
|
|
26
|
+
let activeEmbeddingSpaceIdentity = null;
|
|
25
27
|
export const DEFAULT_EMBEDDING_CONFIG = {
|
|
26
28
|
modelName: 'Xenova/all-MiniLM-L6-v2',
|
|
27
29
|
quantized: true,
|
|
@@ -100,6 +102,16 @@ async function initializeModel(config = {}) {
|
|
|
100
102
|
});
|
|
101
103
|
// Probe + identity fingerprint. Fails loud on dim mismatch.
|
|
102
104
|
endpointIdentity = await endpointClient.probe();
|
|
105
|
+
activeEmbeddingSpaceIdentity = deriveEmbeddingSpaceIdentity({
|
|
106
|
+
provider: 'openai-compatible-endpoint',
|
|
107
|
+
model: fullConfig.modelName,
|
|
108
|
+
dimensions: endpointIdentity.dim,
|
|
109
|
+
pooling: 'mean',
|
|
110
|
+
normalized: true,
|
|
111
|
+
preprocessingVersion: 'aqe-text-v1',
|
|
112
|
+
implementation: endpointIdentity.endpoint,
|
|
113
|
+
runtimeFingerprint: endpointIdentity.fingerprint,
|
|
114
|
+
});
|
|
103
115
|
console.log(`[RealEmbeddings] Endpoint identity: dim=${endpointIdentity.dim} fingerprint=${endpointIdentity.fingerprint}`);
|
|
104
116
|
// Cross-run drift detection: compare against the last-known identity
|
|
105
117
|
// for this endpoint (memory.db kv_store, namespace _system). If the
|
|
@@ -136,9 +148,11 @@ async function initializeModel(config = {}) {
|
|
|
136
148
|
}
|
|
137
149
|
catch {
|
|
138
150
|
throw new Error('In-process embeddings require the optional package "@huggingface/transformers", ' +
|
|
139
|
-
'which is not installed.
|
|
140
|
-
'
|
|
141
|
-
'
|
|
151
|
+
'which is not installed. Configure an embedding endpoint ' +
|
|
152
|
+
'(EmbeddingConfig.endpoint / AQE_EMBEDDER_ENDPOINT) so no local model is loaded. ' +
|
|
153
|
+
'Installing @huggingface/transformers@4.2.0 is an explicit security opt-in: ' +
|
|
154
|
+
'its compatible dependency chain currently has unresolved HIGH advisories ' +
|
|
155
|
+
'GHSA-xcpc-8h2w-3j85 and GHSA-f88m-g3jw-g9cj.');
|
|
142
156
|
}
|
|
143
157
|
pipeline = transformers.pipeline;
|
|
144
158
|
console.log(`[RealEmbeddings] Loading model: ${fullConfig.modelName}`);
|
|
@@ -147,6 +161,24 @@ async function initializeModel(config = {}) {
|
|
|
147
161
|
embeddingModel = await pipeline('feature-extraction', fullConfig.modelName, {
|
|
148
162
|
quantized: fullConfig.quantized,
|
|
149
163
|
});
|
|
164
|
+
const initializedModel = embeddingModel;
|
|
165
|
+
if (!initializedModel)
|
|
166
|
+
throw new Error('Transformer pipeline returned no embedding model');
|
|
167
|
+
const canary = await initializedModel(EMBEDDING_SPACE_CANARY, {
|
|
168
|
+
pooling: 'mean',
|
|
169
|
+
normalize: true,
|
|
170
|
+
});
|
|
171
|
+
const canaryVector = Array.from(canary.data);
|
|
172
|
+
activeEmbeddingSpaceIdentity = deriveEmbeddingSpaceIdentity({
|
|
173
|
+
provider: 'huggingface-transformers',
|
|
174
|
+
model: fullConfig.modelName,
|
|
175
|
+
dimensions: canaryVector.length,
|
|
176
|
+
pooling: 'mean',
|
|
177
|
+
normalized: true,
|
|
178
|
+
preprocessingVersion: 'aqe-text-v1',
|
|
179
|
+
implementation: `transformers:${fullConfig.quantized ? 'quantized' : 'full'}`,
|
|
180
|
+
runtimeFingerprint: fingerprintEmbeddingRuntime(canaryVector),
|
|
181
|
+
});
|
|
150
182
|
const loadTime = performance.now() - startTime;
|
|
151
183
|
console.log(`[RealEmbeddings] Model loaded in ${loadTime.toFixed(0)}ms`);
|
|
152
184
|
}
|
|
@@ -356,6 +388,7 @@ export function resetInitialization() {
|
|
|
356
388
|
}
|
|
357
389
|
endpointClient = null;
|
|
358
390
|
endpointIdentity = null;
|
|
391
|
+
activeEmbeddingSpaceIdentity = null;
|
|
359
392
|
// Drop the identity-store's cached DB connection so tests that flip cwd or
|
|
360
393
|
// AQE_MEMORY_PATH between runs don't write into a stale handle.
|
|
361
394
|
resetEmbedderIdentityStore();
|
|
@@ -373,4 +406,8 @@ export function isUsingEndpoint() {
|
|
|
373
406
|
export function getEndpointIdentity() {
|
|
374
407
|
return endpointIdentity;
|
|
375
408
|
}
|
|
409
|
+
/** Runtime-backed identity of the initialized embedding space. */
|
|
410
|
+
export function getActiveEmbeddingSpaceIdentity() {
|
|
411
|
+
return activeEmbeddingSpaceIdentity;
|
|
412
|
+
}
|
|
376
413
|
//# sourceMappingURL=real-embeddings.js.map
|
|
@@ -19,8 +19,9 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
19
19
|
import { LoggerFactory } from '../logging/index.js';
|
|
20
20
|
import { toError, toErrorMessage } from '../shared/error-utils.js';
|
|
21
21
|
import { maybeEnhanceRoutingWithPatterns } from './pattern-routing-guidance.js';
|
|
22
|
+
import { EMBEDDING_SPACE_CANARY } from './embedding-space.js';
|
|
22
23
|
const logger = LoggerFactory.create('RealQEReasoningBank');
|
|
23
|
-
import { computeRealEmbedding, isTransformerAvailable, getEmbeddingDimension, clearEmbeddingCache, } from './real-embeddings.js';
|
|
24
|
+
import { computeRealEmbedding, isTransformerAvailable, getEmbeddingDimension, clearEmbeddingCache, getActiveEmbeddingSpaceIdentity, } from './real-embeddings.js';
|
|
24
25
|
import { createSQLitePatternStore, } from './sqlite-persistence.js';
|
|
25
26
|
import { detectQEDomain, detectQEDomains, mapQEDomainToAQE, QE_DOMAIN_LIST, shouldPromotePattern, } from './qe-patterns.js';
|
|
26
27
|
import { getGuidance, getCombinedGuidance, generateGuidanceContext, checkAntiPatterns, } from './qe-guidance.js';
|
|
@@ -164,6 +165,8 @@ export class RealQEReasoningBank {
|
|
|
164
165
|
// Initialize SQLite persistence
|
|
165
166
|
await this.sqliteStore.initialize();
|
|
166
167
|
logger.info('SQLite persistence initialized');
|
|
168
|
+
// Establish executable provenance before any persisted vectors enter ANN.
|
|
169
|
+
await computeRealEmbedding(EMBEDDING_SPACE_CANARY, this.qeConfig.embeddings);
|
|
167
170
|
// Initialize HNSW index
|
|
168
171
|
await this.initializeHNSW();
|
|
169
172
|
logger.info('HNSW index initialized');
|
|
@@ -228,9 +231,10 @@ export class RealQEReasoningBank {
|
|
|
228
231
|
const expectedDim = getEmbeddingDimension();
|
|
229
232
|
let loaded = 0;
|
|
230
233
|
let skipped = 0;
|
|
231
|
-
|
|
234
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
|
|
235
|
+
for (const { patternId, embedding, spaceId } of embeddings) {
|
|
232
236
|
// Skip invalid or corrupted embeddings
|
|
233
|
-
if (!embedding || !Array.isArray(embedding) || embedding.length !== expectedDim) {
|
|
237
|
+
if (!activeSpaceId || spaceId !== activeSpaceId || !embedding || !Array.isArray(embedding) || embedding.length !== expectedDim) {
|
|
234
238
|
skipped++;
|
|
235
239
|
continue;
|
|
236
240
|
}
|
|
@@ -33,6 +33,8 @@ export interface MigrationOptions {
|
|
|
33
33
|
dimension?: number;
|
|
34
34
|
/** Log progress every N patterns (default: 1000) */
|
|
35
35
|
progressInterval?: number;
|
|
36
|
+
/** Runtime embedding space that the destination RVF index is bound to. */
|
|
37
|
+
embeddingSpaceId?: string;
|
|
36
38
|
}
|
|
37
39
|
/**
|
|
38
40
|
* Migrate pattern embeddings from SQLite to an RVF file.
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @module learning/rvf-pattern-migration
|
|
14
14
|
*/
|
|
15
|
+
import { getActiveEmbeddingSpaceIdentity } from './real-embeddings.js';
|
|
15
16
|
// ============================================================================
|
|
16
17
|
// Migration Function
|
|
17
18
|
// ============================================================================
|
|
@@ -52,10 +53,11 @@ export function migratePatterns(sqliteStore, rvfAdapter, options = {}) {
|
|
|
52
53
|
console.log(`[RVF Migration] Found ${allEmbeddings.length} embeddings to migrate (dim=${dimension})`);
|
|
53
54
|
// Process in batches
|
|
54
55
|
let batch = [];
|
|
56
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? options.embeddingSpaceId;
|
|
55
57
|
for (let i = 0; i < allEmbeddings.length; i++) {
|
|
56
|
-
const { patternId, embedding } = allEmbeddings[i];
|
|
57
|
-
//
|
|
58
|
-
if (embedding.length !== dimension) {
|
|
58
|
+
const { patternId, embedding, spaceId } = allEmbeddings[i];
|
|
59
|
+
// Never mix unknown or incompatible spaces in an ANN file.
|
|
60
|
+
if (!activeSpaceId || spaceId !== activeSpaceId || embedding.length !== dimension) {
|
|
59
61
|
result.totalSkipped++;
|
|
60
62
|
continue;
|
|
61
63
|
}
|
|
@@ -22,6 +22,8 @@ export interface RvfPatternStoreConfig {
|
|
|
22
22
|
base: PatternStoreConfig;
|
|
23
23
|
/** When true, dispose() will not close the adapter (shared singleton) */
|
|
24
24
|
skipCloseOnDispose?: boolean;
|
|
25
|
+
/** Runtime provenance for an injected embedder. */
|
|
26
|
+
embeddingSpaceId?: string;
|
|
25
27
|
}
|
|
26
28
|
/**
|
|
27
29
|
* Pattern store backed by @ruvector/rvf-node for persistent HNSW.
|
|
@@ -34,6 +36,7 @@ export declare class RvfPatternStore implements IPatternStore {
|
|
|
34
36
|
private readonly config;
|
|
35
37
|
private readonly rvfPath;
|
|
36
38
|
private readonly skipCloseOnDispose;
|
|
39
|
+
private readonly embeddingSpaceId?;
|
|
37
40
|
private adapter;
|
|
38
41
|
private sqliteStore;
|
|
39
42
|
private initialized;
|
|
@@ -16,6 +16,9 @@ import { ok, err } from '../shared/types/index.js';
|
|
|
16
16
|
import { toErrorMessage } from '../shared/error-utils.js';
|
|
17
17
|
import { calculateQualityScore, validateQEPattern, mapQEDomainToAQE, PROMOTION_THRESHOLD, } from './qe-patterns.js';
|
|
18
18
|
import { DEFAULT_PATTERN_STORE_CONFIG } from './pattern-store.js';
|
|
19
|
+
import { getActiveEmbeddingSpaceIdentity } from './real-embeddings.js';
|
|
20
|
+
import { verifyOrCreateEmbeddingSpaceManifest } from './embedding-space.js';
|
|
21
|
+
import { PatternMutationError } from './pattern-mutation-error.js';
|
|
19
22
|
// ============================================================================
|
|
20
23
|
// RVF Pattern Store Implementation
|
|
21
24
|
// ============================================================================
|
|
@@ -30,6 +33,7 @@ export class RvfPatternStore {
|
|
|
30
33
|
config;
|
|
31
34
|
rvfPath;
|
|
32
35
|
skipCloseOnDispose;
|
|
36
|
+
embeddingSpaceId;
|
|
33
37
|
adapter = null;
|
|
34
38
|
sqliteStore = null;
|
|
35
39
|
initialized = false;
|
|
@@ -41,6 +45,7 @@ export class RvfPatternStore {
|
|
|
41
45
|
this.config = config?.base ?? DEFAULT_PATTERN_STORE_CONFIG;
|
|
42
46
|
this.rvfPath = config?.rvfPath ?? '.agentic-qe/patterns.rvf';
|
|
43
47
|
this.skipCloseOnDispose = config?.skipCloseOnDispose ?? false;
|
|
48
|
+
this.embeddingSpaceId = config?.embeddingSpaceId;
|
|
44
49
|
}
|
|
45
50
|
/**
|
|
46
51
|
* Attach SQLite persistence for metadata (pattern fields, FTS5).
|
|
@@ -59,9 +64,11 @@ export class RvfPatternStore {
|
|
|
59
64
|
async initialize() {
|
|
60
65
|
if (this.initialized)
|
|
61
66
|
return;
|
|
67
|
+
this.rvfInitError = null;
|
|
62
68
|
// Database-free mode (#534): never create an on-disk patterns.rvf (+ .idmap/.lock).
|
|
63
|
-
// Run adapter-less
|
|
64
|
-
//
|
|
69
|
+
// Run adapter-less and write nothing. The factory normally selects the
|
|
70
|
+
// in-memory PatternStore in this mode; a directly constructed RVF store
|
|
71
|
+
// remains fail-closed unless an authoritative SQLite delegate is attached.
|
|
65
72
|
if (process.env.AQE_MEMORY_BACKEND === 'memory') {
|
|
66
73
|
this.adapter = null;
|
|
67
74
|
this.initialized = true;
|
|
@@ -69,6 +76,8 @@ export class RvfPatternStore {
|
|
|
69
76
|
}
|
|
70
77
|
try {
|
|
71
78
|
this.adapter = this.createAdapter(this.rvfPath, this.config.embeddingDimension);
|
|
79
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.embeddingSpaceId ?? null;
|
|
80
|
+
verifyOrCreateEmbeddingSpaceManifest(this.rvfPath, activeSpaceId, this.adapter.status()?.totalVectors ?? 0);
|
|
72
81
|
this.initialized = true;
|
|
73
82
|
console.log(`[RvfPatternStore] Initialized: ${this.rvfPath} (dim=${this.config.embeddingDimension})`);
|
|
74
83
|
}
|
|
@@ -77,6 +86,10 @@ export class RvfPatternStore {
|
|
|
77
86
|
// so they need to know RVF is not working. Log a clear error, set
|
|
78
87
|
// adapter to null, and mark nativeAvailable=false in stats.
|
|
79
88
|
this.rvfInitError = toErrorMessage(error);
|
|
89
|
+
try {
|
|
90
|
+
this.adapter?.close();
|
|
91
|
+
}
|
|
92
|
+
catch { /* best effort */ }
|
|
80
93
|
console.error(`[RvfPatternStore] ERROR: RVF native init failed — vector search is DISABLED. ` +
|
|
81
94
|
`Cause: ${this.rvfInitError}. ` +
|
|
82
95
|
`Fix: install @ruvector/rvf-node native bindings, or set useRVFPatternStore=false to use SQLite HNSW.`);
|
|
@@ -162,6 +175,18 @@ export class RvfPatternStore {
|
|
|
162
175
|
if (pattern.confidence < this.config.minConfidence) {
|
|
163
176
|
return err(new Error(`Pattern confidence ${pattern.confidence} below threshold ${this.config.minConfidence}`));
|
|
164
177
|
}
|
|
178
|
+
// RVF is a derived persistent index. A write is observable only through its
|
|
179
|
+
// authoritative SQLite metadata row, regardless of the process-wide memory
|
|
180
|
+
// setting. The factory routes memory mode to PatternStore, so a directly
|
|
181
|
+
// constructed RVF store without SQLite must fail before vector ingestion.
|
|
182
|
+
if (!this.sqliteStore) {
|
|
183
|
+
return err(new PatternMutationError(pattern.id, 'FAILED', new Error('authoritative SQLite pattern store is unavailable')));
|
|
184
|
+
}
|
|
185
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.embeddingSpaceId;
|
|
186
|
+
if (pattern.embedding && !activeSpaceId) {
|
|
187
|
+
return err(new Error('VECTOR_SPACE_UNVERIFIED: refusing to persist or index an embedding without runtime provenance'));
|
|
188
|
+
}
|
|
189
|
+
let authoritativeCommitted = false;
|
|
165
190
|
// Persist metadata to SQLite. #447: capture the returned id — ON CONFLICT
|
|
166
191
|
// on (name, qe_domain, pattern_type) preserves the existing row's id, so
|
|
167
192
|
// we must align pattern.id with what's actually stored before ingesting
|
|
@@ -169,28 +194,35 @@ export class RvfPatternStore {
|
|
|
169
194
|
// with "Pattern not found" and qe_pattern_usage stays empty).
|
|
170
195
|
if (this.sqliteStore) {
|
|
171
196
|
try {
|
|
172
|
-
const actualId = this.sqliteStore.storePattern(pattern, pattern.embedding);
|
|
197
|
+
const actualId = this.sqliteStore.storePattern(pattern, pattern.embedding, activeSpaceId);
|
|
173
198
|
if (actualId && actualId !== pattern.id) {
|
|
174
199
|
// QEPattern.id is `readonly` for callers, but inside the store
|
|
175
200
|
// we own the lifecycle and must align it with the persisted row
|
|
176
201
|
// before HNSW ingest (otherwise the index keys diverge from SQLite).
|
|
177
202
|
pattern.id = actualId;
|
|
178
203
|
}
|
|
204
|
+
authoritativeCommitted = true;
|
|
179
205
|
}
|
|
180
206
|
catch (error) {
|
|
181
|
-
|
|
207
|
+
return err(new PatternMutationError(pattern.id, 'FAILED', error));
|
|
182
208
|
}
|
|
183
209
|
}
|
|
210
|
+
if (pattern.embedding && !this.adapter && this.rvfInitError) {
|
|
211
|
+
return err(new PatternMutationError(pattern.id, authoritativeCommitted ? 'COMMITTED_PENDING_INDEX' : 'FAILED', new Error(`RVF unavailable ${authoritativeCommitted ? 'after' : 'before'} authoritative pattern commit: ${this.rvfInitError}`)));
|
|
212
|
+
}
|
|
184
213
|
// Ingest vector into RVF
|
|
185
214
|
if (pattern.embedding && this.adapter) {
|
|
186
215
|
try {
|
|
187
216
|
const vec = pattern.embedding instanceof Float32Array
|
|
188
217
|
? pattern.embedding
|
|
189
218
|
: new Float32Array(pattern.embedding);
|
|
190
|
-
this.adapter.ingest([{ id: pattern.id, vector: vec }]);
|
|
219
|
+
const ingest = this.adapter.ingest([{ id: pattern.id, vector: vec }]);
|
|
220
|
+
if (ingest.accepted !== 1 || ingest.rejected !== 0) {
|
|
221
|
+
throw new Error(`RVF rejected pattern vector (accepted=${ingest.accepted}, rejected=${ingest.rejected})`);
|
|
222
|
+
}
|
|
191
223
|
}
|
|
192
224
|
catch (error) {
|
|
193
|
-
|
|
225
|
+
return err(new PatternMutationError(pattern.id, authoritativeCommitted ? 'COMMITTED_PENDING_INDEX' : 'FAILED', error));
|
|
194
226
|
}
|
|
195
227
|
}
|
|
196
228
|
return ok(pattern.id);
|
|
@@ -245,6 +277,12 @@ export class RvfPatternStore {
|
|
|
245
277
|
const startTime = performance.now();
|
|
246
278
|
const limit = options.limit ?? 10;
|
|
247
279
|
const results = [];
|
|
280
|
+
if (Array.isArray(query)) {
|
|
281
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.embeddingSpaceId;
|
|
282
|
+
if (!activeSpaceId || options.embeddingSpaceId !== activeSpaceId) {
|
|
283
|
+
return err(new Error('VECTOR_SPACE_UNVERIFIED: pre-computed query vectors require the active embeddingSpaceId'));
|
|
284
|
+
}
|
|
285
|
+
}
|
|
248
286
|
// Vector search via RVF native HNSW
|
|
249
287
|
if (Array.isArray(query) && this.adapter) {
|
|
250
288
|
try {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { type Database as DatabaseType } from 'better-sqlite3';
|
|
15
15
|
import type { QEPattern, QEDomain } from './qe-patterns.js';
|
|
16
|
+
import { type EmbeddingSpaceDiagnostics } from './embedding-space.js';
|
|
16
17
|
/**
|
|
17
18
|
* SQLite persistence configuration
|
|
18
19
|
*/
|
|
@@ -71,11 +72,12 @@ export declare class SQLitePatternStore {
|
|
|
71
72
|
/**
|
|
72
73
|
* Prepare commonly used statements
|
|
73
74
|
*/
|
|
75
|
+
private ensureEmbeddingSpaceSchema;
|
|
74
76
|
private prepareStatements;
|
|
75
77
|
/**
|
|
76
78
|
* Store a pattern
|
|
77
79
|
*/
|
|
78
|
-
storePattern(pattern: QEPattern, embedding?: number[]): string;
|
|
80
|
+
storePattern(pattern: QEPattern, embedding?: number[], embeddingSpaceId?: string): string;
|
|
79
81
|
/**
|
|
80
82
|
* Get a pattern by ID
|
|
81
83
|
*/
|
|
@@ -113,6 +115,7 @@ export declare class SQLitePatternStore {
|
|
|
113
115
|
getAllEmbeddings(): Array<{
|
|
114
116
|
patternId: string;
|
|
115
117
|
embedding: number[];
|
|
118
|
+
spaceId: string | null;
|
|
116
119
|
}>;
|
|
117
120
|
/**
|
|
118
121
|
* Get up to `limit` embeddings, most-recently-used first.
|
|
@@ -124,7 +127,9 @@ export declare class SQLitePatternStore {
|
|
|
124
127
|
getRecentEmbeddings(limit: number): Array<{
|
|
125
128
|
patternId: string;
|
|
126
129
|
embedding: number[];
|
|
130
|
+
spaceId: string | null;
|
|
127
131
|
}>;
|
|
132
|
+
getEmbeddingSpaceDiagnostics(activeSpaceId?: string | null): EmbeddingSpaceDiagnostics;
|
|
128
133
|
/**
|
|
129
134
|
* Record pattern usage.
|
|
130
135
|
*
|
|
@@ -191,7 +196,7 @@ export declare class SQLitePatternStore {
|
|
|
191
196
|
/**
|
|
192
197
|
* Store embedding for an existing pattern
|
|
193
198
|
*/
|
|
194
|
-
storePatternEmbedding(patternId: string, embedding: number[]): void;
|
|
199
|
+
storePatternEmbedding(patternId: string, embedding: number[], embeddingSpaceId?: string): void;
|
|
195
200
|
/**
|
|
196
201
|
* Record pattern reuse for metrics tracking (Phase 5.4)
|
|
197
202
|
*
|