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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Executable embedding-space provenance (#633).
|
|
3
|
+
*
|
|
4
|
+
* Model names and dimensions are declarations, not proof that two vectors are
|
|
5
|
+
* comparable. An embedding space is therefore identified by canonical runtime
|
|
6
|
+
* configuration plus a fingerprint of a fixed canary vector.
|
|
7
|
+
*/
|
|
8
|
+
import { createHash } from 'node:crypto';
|
|
9
|
+
import { existsSync, readFileSync, renameSync, writeFileSync } from 'node:fs';
|
|
10
|
+
import { cosineSimilarity } from '../shared/utils/vector-math.js';
|
|
11
|
+
export const EMBEDDING_SPACE_CANARY = 'aqe embedding-space compatibility canary v1';
|
|
12
|
+
export const EMBEDDING_ROUND_TRIP_MIN_COSINE = 0.999;
|
|
13
|
+
export class EmbeddingSpaceError extends Error {
|
|
14
|
+
code;
|
|
15
|
+
constructor(code, message) {
|
|
16
|
+
super(`${code}: ${message}`);
|
|
17
|
+
this.code = code;
|
|
18
|
+
this.name = 'EmbeddingSpaceError';
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
function canonicalIdentity(identity) {
|
|
22
|
+
return JSON.stringify({
|
|
23
|
+
provider: identity.provider,
|
|
24
|
+
model: identity.model,
|
|
25
|
+
dimensions: identity.dimensions,
|
|
26
|
+
pooling: identity.pooling ?? null,
|
|
27
|
+
normalized: identity.normalized,
|
|
28
|
+
preprocessingVersion: identity.preprocessingVersion ?? null,
|
|
29
|
+
implementation: identity.implementation ?? null,
|
|
30
|
+
runtimeFingerprint: identity.runtimeFingerprint,
|
|
31
|
+
});
|
|
32
|
+
}
|
|
33
|
+
/** Fingerprint a normalized canary vector after stable int16 quantization. */
|
|
34
|
+
export function fingerprintEmbeddingRuntime(vector) {
|
|
35
|
+
const bytes = Buffer.alloc(vector.length * 2);
|
|
36
|
+
for (let i = 0; i < vector.length; i++) {
|
|
37
|
+
const quantized = Math.max(-32768, Math.min(32767, Math.round(vector[i] * 32767)));
|
|
38
|
+
bytes.writeInt16LE(quantized, i * 2);
|
|
39
|
+
}
|
|
40
|
+
return createHash('sha256').update(bytes).digest('hex').slice(0, 16);
|
|
41
|
+
}
|
|
42
|
+
export function deriveEmbeddingSpaceIdentity(identity) {
|
|
43
|
+
if (!identity.runtimeFingerprint) {
|
|
44
|
+
throw new Error('Embedding space identity requires executable runtime evidence');
|
|
45
|
+
}
|
|
46
|
+
const spaceId = createHash('sha256')
|
|
47
|
+
.update('aqe:embedding-space:v1\0')
|
|
48
|
+
.update(canonicalIdentity(identity))
|
|
49
|
+
.digest('hex');
|
|
50
|
+
return { ...identity, spaceId };
|
|
51
|
+
}
|
|
52
|
+
/** Execute the same-text write/read canary before semantic ranking is trusted. */
|
|
53
|
+
export async function verifyEmbeddingRoundTrip(writeEmbed, queryEmbed, minimumCosine = EMBEDDING_ROUND_TRIP_MIN_COSINE) {
|
|
54
|
+
const [written, queried] = await Promise.all([
|
|
55
|
+
writeEmbed(EMBEDDING_SPACE_CANARY),
|
|
56
|
+
queryEmbed(EMBEDDING_SPACE_CANARY),
|
|
57
|
+
]);
|
|
58
|
+
if (written.length !== queried.length) {
|
|
59
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_MISMATCH', `round-trip dimensions differ (${written.length} != ${queried.length})`);
|
|
60
|
+
}
|
|
61
|
+
const similarity = cosineSimilarity(written, queried);
|
|
62
|
+
if (!Number.isFinite(similarity) || similarity < minimumCosine) {
|
|
63
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_MISMATCH', `write/read canary cosine ${similarity.toFixed(6)} is below ${minimumCosine}`);
|
|
64
|
+
}
|
|
65
|
+
return similarity;
|
|
66
|
+
}
|
|
67
|
+
export function inspectEmbeddingSpaceRows(rows, activeSpaceId) {
|
|
68
|
+
const storedSpaceIds = [...new Set(rows.flatMap((row) => row.spaceId ? [row.spaceId] : []))].sort();
|
|
69
|
+
const unverifiedVectors = rows.filter((row) => !row.spaceId).length;
|
|
70
|
+
const verifiedVectors = activeSpaceId
|
|
71
|
+
? rows.filter((row) => row.spaceId === activeSpaceId).length
|
|
72
|
+
: 0;
|
|
73
|
+
const mismatchedVectors = activeSpaceId
|
|
74
|
+
? rows.filter((row) => row.spaceId !== null && row.spaceId !== activeSpaceId).length
|
|
75
|
+
: rows.length - unverifiedVectors;
|
|
76
|
+
const status = unverifiedVectors > 0 || !activeSpaceId
|
|
77
|
+
? 'unverified'
|
|
78
|
+
: mismatchedVectors > 0 || storedSpaceIds.length > 1
|
|
79
|
+
? 'vector_space_mismatch'
|
|
80
|
+
: 'healthy';
|
|
81
|
+
return {
|
|
82
|
+
status,
|
|
83
|
+
activeSpaceId,
|
|
84
|
+
storedSpaceIds,
|
|
85
|
+
verifiedVectors,
|
|
86
|
+
mismatchedVectors,
|
|
87
|
+
unverifiedVectors,
|
|
88
|
+
};
|
|
89
|
+
}
|
|
90
|
+
/** Sidecar path used to bind a persistent ANN index to one embedding space. */
|
|
91
|
+
export function embeddingSpaceManifestPath(indexPath) {
|
|
92
|
+
return `${indexPath}.space.json`;
|
|
93
|
+
}
|
|
94
|
+
/**
|
|
95
|
+
* Bind an empty persistent index to the active space, or verify an existing
|
|
96
|
+
* binding. A populated index without a manifest is legacy/unverified and must
|
|
97
|
+
* be rebuilt rather than silently adopted by the current runtime.
|
|
98
|
+
*/
|
|
99
|
+
export function verifyOrCreateEmbeddingSpaceManifest(indexPath, activeSpaceId, vectorCount) {
|
|
100
|
+
if (!activeSpaceId) {
|
|
101
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_UNVERIFIED', `cannot open ANN index ${indexPath} without runtime provenance`);
|
|
102
|
+
}
|
|
103
|
+
const manifestPath = embeddingSpaceManifestPath(indexPath);
|
|
104
|
+
if (existsSync(manifestPath)) {
|
|
105
|
+
let manifest;
|
|
106
|
+
try {
|
|
107
|
+
manifest = JSON.parse(readFileSync(manifestPath, 'utf8'));
|
|
108
|
+
}
|
|
109
|
+
catch {
|
|
110
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_UNVERIFIED', `ANN index manifest ${manifestPath} is unreadable`);
|
|
111
|
+
}
|
|
112
|
+
if (manifest.version !== 1 || !manifest.spaceId) {
|
|
113
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_UNVERIFIED', `ANN index manifest ${manifestPath} has no verified space`);
|
|
114
|
+
}
|
|
115
|
+
if (manifest.spaceId !== activeSpaceId) {
|
|
116
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_MISMATCH', `ANN index space ${manifest.spaceId} != active space ${activeSpaceId}`);
|
|
117
|
+
}
|
|
118
|
+
return;
|
|
119
|
+
}
|
|
120
|
+
if (vectorCount > 0) {
|
|
121
|
+
throw new EmbeddingSpaceError('VECTOR_SPACE_UNVERIFIED', `populated ANN index ${indexPath} has no embedding-space manifest; rebuild required`);
|
|
122
|
+
}
|
|
123
|
+
const manifest = { version: 1, spaceId: activeSpaceId };
|
|
124
|
+
const temporaryPath = `${manifestPath}.${process.pid}.tmp`;
|
|
125
|
+
writeFileSync(temporaryPath, `${JSON.stringify(manifest)}\n`, { encoding: 'utf8', mode: 0o600 });
|
|
126
|
+
renameSync(temporaryPath, manifestPath);
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=embedding-space.js.map
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Database as DatabaseType } from 'better-sqlite3';
|
|
2
|
+
import type { LearningAdmissionResult, LearningEvidenceManifest } from './learning-evidence-admission.js';
|
|
3
|
+
export interface PersistLearningEvidenceOptions {
|
|
4
|
+
patternId?: string;
|
|
5
|
+
policyVersion?: string;
|
|
6
|
+
policyHash?: string;
|
|
7
|
+
correlationGroup?: string;
|
|
8
|
+
}
|
|
9
|
+
export interface PersistedLearningEvidence {
|
|
10
|
+
manifestId: string;
|
|
11
|
+
admissionId: string;
|
|
12
|
+
disposition: 'admitted' | 'rejected' | 'review-required';
|
|
13
|
+
}
|
|
14
|
+
export declare function persistLearningEvidence(db: DatabaseType, manifest: LearningEvidenceManifest, admission: LearningAdmissionResult, options?: PersistLearningEvidenceOptions): PersistedLearningEvidence;
|
|
15
|
+
//# sourceMappingURL=evidence-admission-store.d.ts.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { randomUUID } from 'node:crypto';
|
|
2
|
+
function evidenceClass(source) {
|
|
3
|
+
if (source === 'executed')
|
|
4
|
+
return 'EXECUTED';
|
|
5
|
+
if (source === 'static' || source === 'human-reviewed')
|
|
6
|
+
return 'STATIC';
|
|
7
|
+
return 'INFERRED';
|
|
8
|
+
}
|
|
9
|
+
export function persistLearningEvidence(db, manifest, admission, options = {}) {
|
|
10
|
+
if (!/^[a-f0-9]{64}$/.test(manifest.trajectoryHash)) {
|
|
11
|
+
throw new Error('trajectoryHash must be a lowercase SHA-256 digest');
|
|
12
|
+
}
|
|
13
|
+
const disposition = admission.disposition === 'admit'
|
|
14
|
+
? 'admitted'
|
|
15
|
+
: admission.disposition === 'reject' ? 'rejected' : 'review-required';
|
|
16
|
+
const admissionId = randomUUID();
|
|
17
|
+
const persist = db.transaction(() => {
|
|
18
|
+
db.prepare(`
|
|
19
|
+
INSERT INTO learning_evidence_manifests (
|
|
20
|
+
id, trajectory_id, trajectory_hash, manifest_hash, task_family,
|
|
21
|
+
task_identity, run_identity, correlation_group, dedupe_fingerprint,
|
|
22
|
+
revision, environment, outcome, oracle_refs_json, source_kind,
|
|
23
|
+
process_signals_json, manifest_version
|
|
24
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, ?, 1)
|
|
25
|
+
`).run(manifest.trajectoryId, manifest.trajectoryId, manifest.trajectoryHash, manifest.trajectoryHash, manifest.taskFamily, manifest.trajectoryId, manifest.trajectoryId, options.correlationGroup ?? null, manifest.trajectoryHash, manifest.revision ?? null, manifest.environment ?? null, manifest.outcome, JSON.stringify(manifest.oracleRefs), manifest.sourceKind, JSON.stringify(manifest.processSignals));
|
|
26
|
+
const insertSegment = db.prepare(`
|
|
27
|
+
INSERT INTO learning_evidence_segments (
|
|
28
|
+
id, manifest_id, segment_order, kind, contribution,
|
|
29
|
+
evidence_refs_json, admit_for_learning, reasons_json
|
|
30
|
+
) VALUES (?, ?, ?, ?, ?, ?, ?, ?)
|
|
31
|
+
`);
|
|
32
|
+
manifest.segments.forEach((segment, index) => insertSegment.run(segment.id, manifest.trajectoryId, index, segment.kind, segment.contribution, JSON.stringify(segment.evidenceRefs), segment.admitForLearning ? 1 : 0, JSON.stringify(segment.reasons)));
|
|
33
|
+
const insertEdge = db.prepare(`
|
|
34
|
+
INSERT INTO learning_segment_edges (
|
|
35
|
+
manifest_id, parent_segment_id, child_segment_id, edge_kind
|
|
36
|
+
) VALUES (?, ?, ?, 'depends-on')
|
|
37
|
+
`);
|
|
38
|
+
for (const segment of manifest.segments) {
|
|
39
|
+
for (const parentId of segment.parentIds) {
|
|
40
|
+
insertEdge.run(manifest.trajectoryId, parentId, segment.id);
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
db.prepare(`
|
|
44
|
+
INSERT INTO learning_evidence_admissions (
|
|
45
|
+
id, manifest_id, decision_seq, disposition, reason_codes_json,
|
|
46
|
+
assessor_kind, evidence_class, policy_version, policy_hash
|
|
47
|
+
) VALUES (?, ?, 1, ?, ?, ?, ?, ?, ?)
|
|
48
|
+
`).run(admissionId, manifest.trajectoryId, disposition, JSON.stringify(admission.reasons), manifest.sourceKind, evidenceClass(manifest.sourceKind), options.policyVersion ?? null, options.policyHash ?? null);
|
|
49
|
+
if (options.patternId) {
|
|
50
|
+
db.prepare(`
|
|
51
|
+
INSERT INTO pattern_manifest_lineage (
|
|
52
|
+
pattern_id, manifest_id, use_kind
|
|
53
|
+
) VALUES (?, ?, ?)
|
|
54
|
+
`).run(options.patternId, manifest.trajectoryId, disposition === 'admitted' ? 'promotion-support' : 'rejection');
|
|
55
|
+
const insertSegmentLineage = db.prepare(`
|
|
56
|
+
INSERT INTO pattern_segment_lineage (
|
|
57
|
+
pattern_id, manifest_id, segment_id, use_kind
|
|
58
|
+
) VALUES (?, ?, ?, ?)
|
|
59
|
+
`);
|
|
60
|
+
for (const segmentId of admission.admittedSegmentIds) {
|
|
61
|
+
insertSegmentLineage.run(options.patternId, manifest.trajectoryId, segmentId, 'promotion-support');
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
});
|
|
65
|
+
persist();
|
|
66
|
+
return { manifestId: manifest.trajectoryId, admissionId, disposition };
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=evidence-admission-store.js.map
|
package/dist/learning/index.d.ts
CHANGED
|
@@ -42,10 +42,17 @@
|
|
|
42
42
|
export { QEReasoningBank, createQEReasoningBank, DEFAULT_QE_REASONING_BANK_CONFIG, } from './qe-reasoning-bank.js';
|
|
43
43
|
export type { QEReasoningBankConfig, QERoutingRequest, QERoutingResult, LearningOutcome, IQEReasoningBank, QEReasoningBankStats, } from './qe-reasoning-bank.js';
|
|
44
44
|
export { QE_DOMAINS, QE_DOMAIN_LIST, QE_PATTERN_TYPES, detectQEDomain, detectQEDomains, mapQEDomainToAQE, calculateQualityScore, shouldPromotePattern, validateQEPattern, applyPatternTemplate, matchPatternContext, } from './qe-patterns.js';
|
|
45
|
+
export { admitLearningEvidence, countIndependentAdmissions, createLearningEvidenceManifest, } from './learning-evidence-admission.js';
|
|
46
|
+
export { persistLearningEvidence } from './evidence-admission-store.js';
|
|
47
|
+
export type { PersistLearningEvidenceOptions, PersistedLearningEvidence, } from './evidence-admission-store.js';
|
|
48
|
+
export type { LearningAdmissionResult, LearningContribution, LearningEvidenceManifest, LearningSegment, } from './learning-evidence-admission.js';
|
|
49
|
+
export * from './structural-retrieval/index.js';
|
|
45
50
|
export type { QEDomain, QEPatternType, QEPattern, QEPatternContext, QEPatternTemplate, QETemplateVariable, ProgrammingLanguage, TestFramework, ComplexityLevel, CreateQEPatternOptions, PatternMatchResult, } from './qe-patterns.js';
|
|
46
51
|
export { QE_GUIDANCE_REGISTRY, TEST_GENERATION_GUIDANCE, COVERAGE_ANALYSIS_GUIDANCE, MUTATION_TESTING_GUIDANCE, API_TESTING_GUIDANCE, SECURITY_TESTING_GUIDANCE, VISUAL_TESTING_GUIDANCE, ACCESSIBILITY_GUIDANCE, PERFORMANCE_GUIDANCE, getGuidance, getFrameworkGuidance, getLanguageGuidance, getCombinedGuidance, checkAntiPatterns, generateGuidanceContext, } from './qe-guidance.js';
|
|
47
52
|
export type { QEGuidance, AntiPattern, GuidanceExample, } from './qe-guidance.js';
|
|
48
53
|
export { PatternStore, createPatternStore, DEFAULT_PATTERN_STORE_CONFIG, } from './pattern-store.js';
|
|
54
|
+
export { PatternMutationError } from './pattern-mutation-error.js';
|
|
55
|
+
export type { PatternMutationDisposition } from './pattern-mutation-error.js';
|
|
49
56
|
export type { IPatternStore, PatternStoreConfig, PatternStoreStats, PatternSearchOptions, PatternSearchResult, } from './pattern-store.js';
|
|
50
57
|
export { QE_HOOK_EVENTS, createQEHookHandlers, QEHookRegistry, createQEHookRegistry, setupQEHooks, } from './qe-hooks.js';
|
|
51
58
|
export type { QEHookEvent, QEHookContext, QEHookResult, QEHookHandler, } from './qe-hooks.js';
|
package/dist/learning/index.js
CHANGED
|
@@ -53,6 +53,9 @@ QE_DOMAINS, QE_DOMAIN_LIST,
|
|
|
53
53
|
QE_PATTERN_TYPES,
|
|
54
54
|
// Utility functions
|
|
55
55
|
detectQEDomain, detectQEDomains, mapQEDomainToAQE, calculateQualityScore, shouldPromotePattern, validateQEPattern, applyPatternTemplate, matchPatternContext, } from './qe-patterns.js';
|
|
56
|
+
export { admitLearningEvidence, countIndependentAdmissions, createLearningEvidenceManifest, } from './learning-evidence-admission.js';
|
|
57
|
+
export { persistLearningEvidence } from './evidence-admission-store.js';
|
|
58
|
+
export * from './structural-retrieval/index.js';
|
|
56
59
|
// ============================================================================
|
|
57
60
|
// QE Guidance
|
|
58
61
|
// ============================================================================
|
|
@@ -67,6 +70,7 @@ getGuidance, getFrameworkGuidance, getLanguageGuidance, getCombinedGuidance, che
|
|
|
67
70
|
// Pattern Store
|
|
68
71
|
// ============================================================================
|
|
69
72
|
export { PatternStore, createPatternStore, DEFAULT_PATTERN_STORE_CONFIG, } from './pattern-store.js';
|
|
73
|
+
export { PatternMutationError } from './pattern-mutation-error.js';
|
|
70
74
|
// ============================================================================
|
|
71
75
|
// QE Hooks
|
|
72
76
|
// ============================================================================
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
export type LearningContribution = 'causal' | 'supporting' | 'irrelevant' | 'harmful' | 'unknown';
|
|
2
|
+
export interface LearningSegment {
|
|
3
|
+
readonly id: string;
|
|
4
|
+
readonly parentIds: readonly string[];
|
|
5
|
+
readonly kind: 'observe' | 'decide' | 'act' | 'verify' | 'recover' | 'other';
|
|
6
|
+
readonly contribution: LearningContribution;
|
|
7
|
+
readonly evidenceRefs: readonly string[];
|
|
8
|
+
readonly admitForLearning: boolean;
|
|
9
|
+
readonly reasons: readonly string[];
|
|
10
|
+
}
|
|
11
|
+
export interface LearningEvidenceManifest {
|
|
12
|
+
readonly trajectoryId: string;
|
|
13
|
+
readonly trajectoryHash: string;
|
|
14
|
+
readonly taskFamily: string;
|
|
15
|
+
readonly revision?: string;
|
|
16
|
+
readonly environment?: string;
|
|
17
|
+
readonly outcome: 'verified-success' | 'verified-failure' | 'unknown';
|
|
18
|
+
readonly oracleRefs: readonly string[];
|
|
19
|
+
readonly sourceKind: 'executed' | 'static' | 'human-reviewed' | 'inferred';
|
|
20
|
+
readonly processSignals: Readonly<{
|
|
21
|
+
observedBeforeActing: boolean;
|
|
22
|
+
verificationAfterActing: boolean;
|
|
23
|
+
toolSuccessRate: number;
|
|
24
|
+
repeatedNoProgressActions: number;
|
|
25
|
+
scopeDrift: boolean;
|
|
26
|
+
leakageOrShortcut: boolean;
|
|
27
|
+
weakenedOracle: boolean;
|
|
28
|
+
unsafeSideEffect: boolean;
|
|
29
|
+
}>;
|
|
30
|
+
readonly segments: readonly LearningSegment[];
|
|
31
|
+
}
|
|
32
|
+
export interface LearningAdmissionResult {
|
|
33
|
+
readonly disposition: 'admit' | 'reject' | 'human-review';
|
|
34
|
+
readonly autoPromotable: boolean;
|
|
35
|
+
readonly admittedSegmentIds: readonly string[];
|
|
36
|
+
readonly rejectedSegmentIds: readonly string[];
|
|
37
|
+
readonly reasons: readonly string[];
|
|
38
|
+
}
|
|
39
|
+
type ManifestInput = Omit<LearningEvidenceManifest, 'trajectoryHash'>;
|
|
40
|
+
export declare function createLearningEvidenceManifest(input: ManifestInput): LearningEvidenceManifest;
|
|
41
|
+
export declare function admitLearningEvidence(manifest: LearningEvidenceManifest): LearningAdmissionResult;
|
|
42
|
+
export declare function countIndependentAdmissions(manifests: readonly LearningEvidenceManifest[]): number;
|
|
43
|
+
export {};
|
|
44
|
+
//# sourceMappingURL=learning-evidence-admission.d.ts.map
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { createHash } from 'node:crypto';
|
|
2
|
+
function canonicalize(value) {
|
|
3
|
+
if (Array.isArray(value))
|
|
4
|
+
return `[${value.map(canonicalize).join(',')}]`;
|
|
5
|
+
if (value && typeof value === 'object') {
|
|
6
|
+
return `{${Object.entries(value)
|
|
7
|
+
.sort(([a], [b]) => a.localeCompare(b))
|
|
8
|
+
.map(([key, entry]) => `${JSON.stringify(key)}:${canonicalize(entry)}`)
|
|
9
|
+
.join(',')}}`;
|
|
10
|
+
}
|
|
11
|
+
return JSON.stringify(value) ?? 'undefined';
|
|
12
|
+
}
|
|
13
|
+
function freezeManifest(manifest) {
|
|
14
|
+
Object.freeze(manifest.processSignals);
|
|
15
|
+
manifest.segments.forEach(segment => {
|
|
16
|
+
Object.freeze(segment.parentIds);
|
|
17
|
+
Object.freeze(segment.evidenceRefs);
|
|
18
|
+
Object.freeze(segment.reasons);
|
|
19
|
+
Object.freeze(segment);
|
|
20
|
+
});
|
|
21
|
+
Object.freeze(manifest.oracleRefs);
|
|
22
|
+
Object.freeze(manifest.segments);
|
|
23
|
+
return Object.freeze(manifest);
|
|
24
|
+
}
|
|
25
|
+
export function createLearningEvidenceManifest(input) {
|
|
26
|
+
const trajectoryHash = createHash('sha256').update(canonicalize(input)).digest('hex');
|
|
27
|
+
return freezeManifest({ ...input, trajectoryHash });
|
|
28
|
+
}
|
|
29
|
+
function expectedTrajectoryHash(manifest) {
|
|
30
|
+
const { trajectoryHash: _claimedHash, ...input } = manifest;
|
|
31
|
+
return createHash('sha256').update(canonicalize(input)).digest('hex');
|
|
32
|
+
}
|
|
33
|
+
export function admitLearningEvidence(manifest) {
|
|
34
|
+
const reasons = [];
|
|
35
|
+
if (manifest.trajectoryHash !== expectedTrajectoryHash(manifest))
|
|
36
|
+
reasons.push('integrity:trajectory-hash-mismatch');
|
|
37
|
+
if (manifest.outcome !== 'verified-success')
|
|
38
|
+
reasons.push(`outcome:${manifest.outcome}`);
|
|
39
|
+
if (manifest.sourceKind === 'inferred')
|
|
40
|
+
reasons.push('source:inferred');
|
|
41
|
+
if (manifest.oracleRefs.length === 0)
|
|
42
|
+
reasons.push('oracle:missing');
|
|
43
|
+
if (!manifest.processSignals.verificationAfterActing)
|
|
44
|
+
reasons.push('verification:missing-after-action');
|
|
45
|
+
if (!manifest.processSignals.observedBeforeActing)
|
|
46
|
+
reasons.push('process:acted-before-observation');
|
|
47
|
+
if (manifest.processSignals.toolSuccessRate < 0 || manifest.processSignals.toolSuccessRate > 1) {
|
|
48
|
+
reasons.push('process:invalid-tool-success-rate');
|
|
49
|
+
}
|
|
50
|
+
else if (manifest.processSignals.toolSuccessRate < 1) {
|
|
51
|
+
reasons.push('process:tool-failure');
|
|
52
|
+
}
|
|
53
|
+
if (manifest.processSignals.repeatedNoProgressActions > 0)
|
|
54
|
+
reasons.push('process:repeated-no-progress');
|
|
55
|
+
if (manifest.processSignals.scopeDrift)
|
|
56
|
+
reasons.push('process:scope-drift');
|
|
57
|
+
if (manifest.processSignals.weakenedOracle)
|
|
58
|
+
reasons.push('oracle:weakened');
|
|
59
|
+
if (manifest.processSignals.leakageOrShortcut)
|
|
60
|
+
reasons.push('process:leakage-or-shortcut');
|
|
61
|
+
if (manifest.processSignals.unsafeSideEffect)
|
|
62
|
+
reasons.push('process:unsafe-side-effect');
|
|
63
|
+
const admittedSegmentIds = manifest.segments
|
|
64
|
+
.filter(segment => segment.admitForLearning &&
|
|
65
|
+
(segment.contribution === 'causal' || segment.contribution === 'supporting'))
|
|
66
|
+
.map(segment => segment.id);
|
|
67
|
+
const rejectedSegmentIds = manifest.segments
|
|
68
|
+
.filter(segment => !admittedSegmentIds.includes(segment.id))
|
|
69
|
+
.map(segment => segment.id);
|
|
70
|
+
if (admittedSegmentIds.length === 0)
|
|
71
|
+
reasons.push('segments:no-admitted-contribution');
|
|
72
|
+
if (manifest.segments.some(segment => admittedSegmentIds.includes(segment.id) && segment.evidenceRefs.length === 0)) {
|
|
73
|
+
reasons.push('segments:admitted-without-evidence');
|
|
74
|
+
}
|
|
75
|
+
const hardReject = reasons.some(reason => reason === 'oracle:weakened' || reason === 'process:leakage-or-shortcut' ||
|
|
76
|
+
reason === 'process:unsafe-side-effect' || reason === 'integrity:trajectory-hash-mismatch' ||
|
|
77
|
+
reason === 'process:invalid-tool-success-rate' || reason.startsWith('outcome:'));
|
|
78
|
+
const disposition = hardReject ? 'reject' : reasons.length > 0 ? 'human-review' : 'admit';
|
|
79
|
+
return Object.freeze({
|
|
80
|
+
disposition,
|
|
81
|
+
autoPromotable: disposition === 'admit',
|
|
82
|
+
admittedSegmentIds: Object.freeze(admittedSegmentIds),
|
|
83
|
+
rejectedSegmentIds: Object.freeze(rejectedSegmentIds),
|
|
84
|
+
reasons: Object.freeze(reasons),
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
export function countIndependentAdmissions(manifests) {
|
|
88
|
+
const identities = new Set();
|
|
89
|
+
for (const manifest of manifests) {
|
|
90
|
+
if (!admitLearningEvidence(manifest).autoPromotable)
|
|
91
|
+
continue;
|
|
92
|
+
const { trajectoryId: _runIdentity, trajectoryHash: _runHash, ...evidence } = manifest;
|
|
93
|
+
identities.add(canonicalize(evidence));
|
|
94
|
+
}
|
|
95
|
+
return identities.size;
|
|
96
|
+
}
|
|
97
|
+
//# sourceMappingURL=learning-evidence-admission.js.map
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
export type PatternMutationDisposition = 'FAILED' | 'COMMITTED_PENDING_INDEX';
|
|
2
|
+
/** Error evidence that distinguishes an uncommitted write from index lag. */
|
|
3
|
+
export declare class PatternMutationError extends Error {
|
|
4
|
+
readonly patternId: string;
|
|
5
|
+
readonly disposition: PatternMutationDisposition;
|
|
6
|
+
readonly cause: unknown;
|
|
7
|
+
constructor(patternId: string, disposition: PatternMutationDisposition, cause: unknown);
|
|
8
|
+
}
|
|
9
|
+
//# sourceMappingURL=pattern-mutation-error.d.ts.map
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/** Error evidence that distinguishes an uncommitted write from index lag. */
|
|
2
|
+
export class PatternMutationError extends Error {
|
|
3
|
+
patternId;
|
|
4
|
+
disposition;
|
|
5
|
+
cause;
|
|
6
|
+
constructor(patternId, disposition, cause) {
|
|
7
|
+
super(`${disposition}: pattern ${patternId}: ${cause instanceof Error ? cause.message : String(cause)}`);
|
|
8
|
+
this.name = 'PatternMutationError';
|
|
9
|
+
this.patternId = patternId;
|
|
10
|
+
this.disposition = disposition;
|
|
11
|
+
this.cause = cause;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=pattern-mutation-error.js.map
|
|
@@ -46,6 +46,8 @@ export interface PatternStoreConfig {
|
|
|
46
46
|
namespace: string;
|
|
47
47
|
/** Dimension of embedding vectors */
|
|
48
48
|
embeddingDimension: number;
|
|
49
|
+
/** Runtime-provided provenance override (primarily for injected embedders/tests). */
|
|
50
|
+
embeddingSpaceId?: string;
|
|
49
51
|
/** HNSW configuration */
|
|
50
52
|
hnsw: {
|
|
51
53
|
M: number;
|
|
@@ -124,6 +126,8 @@ export interface PatternSearchOptions {
|
|
|
124
126
|
context?: Partial<QEPatternContext>;
|
|
125
127
|
/** Include vector similarity search */
|
|
126
128
|
useVectorSearch?: boolean;
|
|
129
|
+
/** Provenance of a pre-computed query vector. Required for semantic ranking. */
|
|
130
|
+
embeddingSpaceId?: string;
|
|
127
131
|
/**
|
|
128
132
|
* Composable metadata filter expression (Task 1.2: ruvector-filter).
|
|
129
133
|
* Applied post-search to refine results by domain, severity,
|
|
@@ -212,6 +216,7 @@ export declare class PatternStore implements IPatternStore {
|
|
|
212
216
|
private typeIndex;
|
|
213
217
|
private tierIndex;
|
|
214
218
|
private hnswIndex;
|
|
219
|
+
private hnswSpaceId;
|
|
215
220
|
private hnswAvailable;
|
|
216
221
|
private hnswInitPromise;
|
|
217
222
|
private hdcCache;
|
|
@@ -6,6 +6,8 @@
|
|
|
6
6
|
* O(log n) approximate nearest neighbor search.
|
|
7
7
|
*/
|
|
8
8
|
import { v4 as uuidv4 } from 'uuid';
|
|
9
|
+
import { existsSync } from 'node:fs';
|
|
10
|
+
import { join as joinPath } from 'node:path';
|
|
9
11
|
// Issue #516: lightweight, sqlite-free project-root resolver (static import so it
|
|
10
12
|
// resolves under the test runner; avoids pulling unified-memory's sqlite graph).
|
|
11
13
|
import { findProjectRoot } from '../kernel/project-root.js';
|
|
@@ -28,6 +30,8 @@ import { createVectorDeltaTracker, } from '../integrations/ruvector/vector-delta
|
|
|
28
30
|
import { createHopfieldMemory } from '../integrations/ruvector/hopfield-memory.js';
|
|
29
31
|
import { createHyperbolicPatternIndex, } from './hyperbolic-pattern-index.js';
|
|
30
32
|
import { PatternNullStore } from './pattern-null-store.js';
|
|
33
|
+
import { getActiveEmbeddingSpaceIdentity } from './real-embeddings.js';
|
|
34
|
+
import { PatternMutationError } from './pattern-mutation-error.js';
|
|
31
35
|
// ============================================================================
|
|
32
36
|
// R1: HDC Fingerprint Singleton (lazy-initialized)
|
|
33
37
|
// ============================================================================
|
|
@@ -120,6 +124,7 @@ export class PatternStore {
|
|
|
120
124
|
// HNSW index for vector search (lazy loaded - ADR-048)
|
|
121
125
|
// Using dynamic import type since HNSWIndex is lazily loaded
|
|
122
126
|
hnswIndex = null;
|
|
127
|
+
hnswSpaceId = null;
|
|
123
128
|
hnswAvailable = false;
|
|
124
129
|
hnswInitPromise = null;
|
|
125
130
|
// R1: HDC fingerprint cache (pattern ID -> fingerprint vector)
|
|
@@ -206,6 +211,11 @@ export class PatternStore {
|
|
|
206
211
|
async ensureHNSW() {
|
|
207
212
|
// Already initialized
|
|
208
213
|
if (this.hnswIndex !== null) {
|
|
214
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId ?? null;
|
|
215
|
+
if (this.hnswSpaceId !== activeSpaceId) {
|
|
216
|
+
console.warn('[PatternStore] VECTOR_SPACE_MISMATCH: active embedder changed; semantic index disabled');
|
|
217
|
+
return null;
|
|
218
|
+
}
|
|
209
219
|
return this.hnswIndex;
|
|
210
220
|
}
|
|
211
221
|
// Already marked as unavailable
|
|
@@ -234,6 +244,10 @@ export class PatternStore {
|
|
|
234
244
|
*/
|
|
235
245
|
async initializeHNSWInternal() {
|
|
236
246
|
try {
|
|
247
|
+
this.hnswSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId ?? null;
|
|
248
|
+
if (!this.hnswSpaceId) {
|
|
249
|
+
throw new Error('VECTOR_SPACE_UNVERIFIED: cannot initialize HNSW without runtime provenance');
|
|
250
|
+
}
|
|
237
251
|
// ADR-071: Use unified HNSW via bridge when flag is enabled
|
|
238
252
|
const unifiedFlags = getRuVectorFeatureFlags();
|
|
239
253
|
if (unifiedFlags.useUnifiedHnsw) {
|
|
@@ -302,10 +316,11 @@ export class PatternStore {
|
|
|
302
316
|
const maxBootstrap = this.config.hnsw.maxElements;
|
|
303
317
|
let loaded = 0;
|
|
304
318
|
let skipped = 0;
|
|
305
|
-
|
|
319
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId;
|
|
320
|
+
for (const { patternId, embedding, spaceId } of embeddings) {
|
|
306
321
|
if (loaded >= maxBootstrap)
|
|
307
322
|
break;
|
|
308
|
-
if (!embedding || embedding.length !== this.config.embeddingDimension) {
|
|
323
|
+
if (!activeSpaceId || spaceId !== activeSpaceId || !embedding || embedding.length !== this.config.embeddingDimension) {
|
|
309
324
|
skipped++;
|
|
310
325
|
continue;
|
|
311
326
|
}
|
|
@@ -429,6 +444,14 @@ export class PatternStore {
|
|
|
429
444
|
if (pattern.confidence < this.config.minConfidence) {
|
|
430
445
|
return err(new Error(`Pattern confidence ${pattern.confidence} below threshold ${this.config.minConfidence}`));
|
|
431
446
|
}
|
|
447
|
+
const persistentBackend = (process.env.AQE_MEMORY_BACKEND ?? 'memory') !== 'memory';
|
|
448
|
+
if (persistentBackend && !this.sqliteStore) {
|
|
449
|
+
return err(new PatternMutationError(pattern.id, 'FAILED', new Error('authoritative SQLite pattern store is unavailable')));
|
|
450
|
+
}
|
|
451
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId;
|
|
452
|
+
if (pattern.embedding && !activeSpaceId) {
|
|
453
|
+
return err(new Error('VECTOR_SPACE_UNVERIFIED: refusing to persist or index an embedding without runtime provenance'));
|
|
454
|
+
}
|
|
432
455
|
// Check domain limit
|
|
433
456
|
const domainCount = this.domainIndex.get(pattern.qeDomain)?.size || 0;
|
|
434
457
|
if (domainCount >= this.config.maxPatternsPerDomain) {
|
|
@@ -437,12 +460,18 @@ export class PatternStore {
|
|
|
437
460
|
}
|
|
438
461
|
// R3b: Capture pre-existing pattern for VectorDeltaTracker before overwrite
|
|
439
462
|
const existingPattern = this.patternCache.get(pattern.id) ?? null;
|
|
463
|
+
let authoritativeCommitted = false;
|
|
464
|
+
const rollbackUncommittedCache = () => {
|
|
465
|
+
this.unindexPattern(pattern);
|
|
466
|
+
if (existingPattern)
|
|
467
|
+
this.indexPattern(existingPattern);
|
|
468
|
+
};
|
|
440
469
|
// Index in memory cache
|
|
441
470
|
this.indexPattern(pattern);
|
|
442
471
|
// Persist to SQLite (pattern + embedding atomically)
|
|
443
472
|
if (this.sqliteStore) {
|
|
444
473
|
try {
|
|
445
|
-
const actualId = this.sqliteStore.storePattern(pattern, pattern.embedding);
|
|
474
|
+
const actualId = this.sqliteStore.storePattern(pattern, pattern.embedding, activeSpaceId);
|
|
446
475
|
// #447: ON CONFLICT(name, qe_domain, pattern_type) may preserve an
|
|
447
476
|
// existing row's id instead of the one we generated — realign the
|
|
448
477
|
// in-memory indices (and pattern.id itself) or every later
|
|
@@ -454,14 +483,23 @@ export class PatternStore {
|
|
|
454
483
|
pattern.id = actualId;
|
|
455
484
|
this.indexPattern(pattern);
|
|
456
485
|
}
|
|
486
|
+
authoritativeCommitted = true;
|
|
457
487
|
}
|
|
458
488
|
catch (error) {
|
|
459
|
-
|
|
489
|
+
rollbackUncommittedCache();
|
|
490
|
+
return err(new PatternMutationError(pattern.id, 'FAILED', error));
|
|
460
491
|
}
|
|
461
492
|
}
|
|
462
493
|
// Add to HNSW if embedding is available (lazy-load HNSW only when needed)
|
|
463
494
|
if (pattern.embedding) {
|
|
464
495
|
const hnsw = await this.ensureHNSW();
|
|
496
|
+
if (!hnsw && authoritativeCommitted) {
|
|
497
|
+
return err(new PatternMutationError(pattern.id, 'COMMITTED_PENDING_INDEX', new Error('HNSW unavailable after authoritative pattern commit')));
|
|
498
|
+
}
|
|
499
|
+
if (!hnsw && persistentBackend) {
|
|
500
|
+
rollbackUncommittedCache();
|
|
501
|
+
return err(new PatternMutationError(pattern.id, 'FAILED', new Error('HNSW unavailable before an authoritative pattern commit')));
|
|
502
|
+
}
|
|
465
503
|
if (hnsw) {
|
|
466
504
|
try {
|
|
467
505
|
// Cast pattern metadata to CoverageVectorMetadata for HNSW storage
|
|
@@ -480,7 +518,9 @@ export class PatternStore {
|
|
|
480
518
|
});
|
|
481
519
|
}
|
|
482
520
|
catch (error) {
|
|
483
|
-
|
|
521
|
+
if (!authoritativeCommitted)
|
|
522
|
+
rollbackUncommittedCache();
|
|
523
|
+
return err(new PatternMutationError(pattern.id, authoritativeCommitted ? 'COMMITTED_PENDING_INDEX' : 'FAILED', error));
|
|
484
524
|
}
|
|
485
525
|
}
|
|
486
526
|
}
|
|
@@ -703,6 +743,10 @@ export class PatternStore {
|
|
|
703
743
|
}
|
|
704
744
|
// Vector search if query is embedding and HNSW available (lazy-load)
|
|
705
745
|
if (Array.isArray(query) && options.useVectorSearch !== false) {
|
|
746
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId;
|
|
747
|
+
if (!activeSpaceId || options.embeddingSpaceId !== activeSpaceId) {
|
|
748
|
+
throw new Error('VECTOR_SPACE_UNVERIFIED: pre-computed query vectors require the active embeddingSpaceId');
|
|
749
|
+
}
|
|
706
750
|
const hnsw = await this.ensureHNSW();
|
|
707
751
|
if (hnsw) {
|
|
708
752
|
const hnswResults = await hnsw.search(query, limit * 2);
|
|
@@ -1410,8 +1454,6 @@ export function createPatternStore(memory, config) {
|
|
|
1410
1454
|
// Only use RVF if the data directory exists (created by kernel init).
|
|
1411
1455
|
// Issue #516: anchor to the project root so a subfolder cwd reads/writes
|
|
1412
1456
|
// the project's own .agentic-qe/ rather than a cwd-relative stray store.
|
|
1413
|
-
const { existsSync } = require('fs');
|
|
1414
|
-
const { join: joinPath } = require('path');
|
|
1415
1457
|
const projectRoot = process.env.AQE_PROJECT_ROOT ?? findProjectRoot();
|
|
1416
1458
|
const rvfDir = joinPath(projectRoot, '.agentic-qe');
|
|
1417
1459
|
const rvfPath = joinPath(rvfDir, 'patterns.rvf');
|
|
@@ -1431,7 +1473,12 @@ export function createPatternStore(memory, config) {
|
|
|
1431
1473
|
const shared = getSharedRvfAdapter(rvfDir, mergedConfig.embeddingDimension);
|
|
1432
1474
|
if (shared) {
|
|
1433
1475
|
useSharedAdapter = true;
|
|
1434
|
-
const store = new RvfPatternStore(() => shared, {
|
|
1476
|
+
const store = new RvfPatternStore(() => shared, {
|
|
1477
|
+
rvfPath,
|
|
1478
|
+
base: mergedConfig,
|
|
1479
|
+
skipCloseOnDispose: true,
|
|
1480
|
+
embeddingSpaceId: mergedConfig.embeddingSpaceId,
|
|
1481
|
+
});
|
|
1435
1482
|
console.log('[PatternStore] Using RVF-backed store (ADR-066)');
|
|
1436
1483
|
return store;
|
|
1437
1484
|
}
|
|
@@ -1487,7 +1534,11 @@ export function createPatternStore(memory, config) {
|
|
|
1487
1534
|
}
|
|
1488
1535
|
throw createErr;
|
|
1489
1536
|
}
|
|
1490
|
-
}, {
|
|
1537
|
+
}, {
|
|
1538
|
+
rvfPath,
|
|
1539
|
+
base: mergedConfig,
|
|
1540
|
+
embeddingSpaceId: mergedConfig.embeddingSpaceId,
|
|
1541
|
+
});
|
|
1491
1542
|
console.log('[PatternStore] Using RVF-backed store (ADR-066)');
|
|
1492
1543
|
return store;
|
|
1493
1544
|
}
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
* (the LLM step is the metered part — bind it deliberately).
|
|
22
22
|
*/
|
|
23
23
|
import type { Database as DatabaseType } from 'better-sqlite3';
|
|
24
|
+
import { type EmbeddingSpaceIdentity } from '../embedding-space.js';
|
|
24
25
|
import type { RetrievalPolicy } from './policy.js';
|
|
25
26
|
import type { PolicyScorer } from './generation.js';
|
|
26
27
|
/** A pattern retrieved as a few-shot example for test generation. */
|
|
@@ -73,6 +74,13 @@ export interface SemanticRetrieverOptions {
|
|
|
73
74
|
db: DatabaseType;
|
|
74
75
|
/** Embed a query into the pattern-embedding space. Default: all-MiniLM-L6-v2. */
|
|
75
76
|
embed?: (text: string) => Promise<number[]>;
|
|
77
|
+
/** Storage-side embedding path used by the executable round-trip canary. */
|
|
78
|
+
writeEmbed?: (text: string) => Promise<number[]>;
|
|
79
|
+
/** Runtime identities for injected embedders. Defaults to the active AQE embedder. */
|
|
80
|
+
embeddingSpace?: EmbeddingSpaceIdentity;
|
|
81
|
+
writeEmbeddingSpace?: EmbeddingSpaceIdentity;
|
|
82
|
+
/** Explicit non-semantic fallback used when provenance cannot be verified. */
|
|
83
|
+
fallback?: RetrieveFn;
|
|
76
84
|
topK?: number;
|
|
77
85
|
}
|
|
78
86
|
/**
|