agentic-qe 3.14.6 → 3.14.8
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/.helpers-version +1 -1
- package/.claude/helpers/auto-memory-hook.mjs +18 -9
- package/.claude/helpers/helpers.manifest.json +6 -5
- package/.claude/helpers/hook-handler.cjs +40 -12
- package/.claude/helpers/memory.cjs +86 -0
- package/.claude/helpers/router.cjs +105 -0
- package/.claude/helpers/session.cjs +166 -0
- package/.claude/helpers/statusline.cjs +73 -621
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +204 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/adapters/a2a/notifications/retry-queue.js +5 -0
- package/dist/adapters/claude-flow/pretrain-bridge.js +3 -2
- package/dist/agents/claim-verifier/verifiers/file-verifier.js +3 -2
- package/dist/cli/bundle.js +8 -8
- package/dist/cli/chunks/adapter-XYCOXQCC.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-2YGML6OU.js → agent-booster-wasm-67OKGDGZ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-D5SSQYNU.js → agent-handler-4HZEQ3WQ.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-YHPLTITV.js → agent-memory-branch-IBHZQSRN.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-DTJCROTG.js +2 -0
- package/dist/cli/chunks/{arena-7BGOXGXO.js → arena-EJBIGSF4.js} +2 -2
- package/dist/cli/chunks/{arena-MCE6EU7K.js → arena-LCLRGUIK.js} +4 -4
- package/dist/cli/chunks/{audit-BMWTQECB.js → audit-PY4JNDQQ.js} +3 -3
- package/dist/cli/chunks/base-5TQ34GMD.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-PMUNGASU.js → better-sqlite3-2JG5K6XT.js} +2 -2
- package/dist/cli/chunks/{brain-handler-QPUFYX7F.js → brain-handler-3UYK55GA.js} +4 -4
- package/dist/cli/chunks/{branch-enumerator-WKFDGRN4.js → branch-enumerator-GOSWOX46.js} +2 -2
- package/dist/cli/chunks/{browser-VY5HKH5X.js → browser-DC2JV47Z.js} +2 -2
- package/dist/cli/chunks/browser-workflow-KWX4ESTJ.js +2 -0
- package/dist/cli/chunks/{chunk-FWASDOT2.js → chunk-25EEIAHS.js} +2 -2
- package/dist/cli/chunks/{chunk-P6OYS755.js → chunk-3576QGPP.js} +1 -1
- package/dist/cli/chunks/{chunk-2TMWAQQ3.js → chunk-3EKG7HFV.js} +4 -4
- package/dist/cli/chunks/{chunk-QZANMBIT.js → chunk-3FCHH4VP.js} +1 -1
- package/dist/cli/chunks/{chunk-CD542DNJ.js → chunk-3S5IIK32.js} +1 -1
- package/dist/cli/chunks/{chunk-5VFPCSK7.js → chunk-3X2JSW3R.js} +1 -1
- package/dist/cli/chunks/{chunk-D45SG6CP.js → chunk-4HXFPBAA.js} +1 -1
- package/dist/cli/chunks/{chunk-JVNTSNWU.js → chunk-4PY44TKH.js} +2 -2
- package/dist/cli/chunks/{chunk-DZ3AUAAB.js → chunk-4RNCVSVN.js} +2 -2
- package/dist/cli/chunks/{chunk-JBTPOIAC.js → chunk-56M4QNXU.js} +2 -2
- package/dist/cli/chunks/{chunk-H52HZ67P.js → chunk-5X4HDW5W.js} +2 -2
- package/dist/cli/chunks/{chunk-UNFFDHER.js → chunk-673XJBGW.js} +10 -32
- package/dist/cli/chunks/{chunk-RTFO5UQH.js → chunk-6F7MFHTY.js} +2 -2
- package/dist/cli/chunks/{chunk-Y3LZ35OG.js → chunk-6GJWT2OY.js} +2 -2
- package/dist/cli/chunks/{chunk-JXGFRBUO.js → chunk-6GNWVPMR.js} +2 -2
- package/dist/cli/chunks/{chunk-3EA536JF.js → chunk-6VTC3OHD.js} +2 -2
- package/dist/cli/chunks/{chunk-W6HXLH5G.js → chunk-775WGWLL.js} +3 -3
- package/dist/cli/chunks/{chunk-TVYY3OCX.js → chunk-77WL5HQW.js} +1 -1
- package/dist/cli/chunks/chunk-7STWD4KJ.js +3 -0
- package/dist/cli/chunks/{chunk-YSLL6VSL.js → chunk-7TNCEVWX.js} +2 -2
- package/dist/cli/chunks/{chunk-Z7WODOTH.js → chunk-7X3LMTRA.js} +2 -2
- package/dist/cli/chunks/{chunk-RZZCUIAI.js → chunk-A53MMSGC.js} +2 -2
- package/dist/cli/chunks/{chunk-QW6VMTBR.js → chunk-A5CLVZC3.js} +2 -2
- package/dist/cli/chunks/{chunk-IG5GNEC6.js → chunk-AEYJ4ZLA.js} +1 -1
- package/dist/cli/chunks/{chunk-NMAIY4PX.js → chunk-AJ5PCJQ2.js} +11 -11
- package/dist/cli/chunks/{chunk-WO4QMXIG.js → chunk-AJMAKUS3.js} +2 -2
- package/dist/cli/chunks/{chunk-2NPKIBAZ.js → chunk-AOD2ES44.js} +2 -2
- package/dist/cli/chunks/chunk-AR2S4DOB.js +2 -0
- package/dist/cli/chunks/{chunk-257E2A5M.js → chunk-AUFV2G2J.js} +5 -5
- package/dist/cli/chunks/{chunk-BVR7RMC5.js → chunk-B2QKBQYD.js} +1 -1
- package/dist/cli/chunks/{chunk-B6D2CHEH.js → chunk-BCCSV3RH.js} +1 -1
- package/dist/cli/chunks/{chunk-2YXGBZWV.js → chunk-BFIXUKOR.js} +1 -1
- package/dist/cli/chunks/chunk-BHPTHC5O.js +4 -0
- package/dist/cli/chunks/{chunk-AIRGNL55.js → chunk-BITFGVZ4.js} +2 -2
- package/dist/cli/chunks/{chunk-MBRHSU6W.js → chunk-BL6273KR.js} +10 -10
- package/dist/cli/chunks/{chunk-SMDN3BQZ.js → chunk-BOIUENWW.js} +1 -1
- package/dist/cli/chunks/{chunk-YS4FCTWF.js → chunk-BT3MI2BW.js} +1 -1
- package/dist/cli/chunks/{chunk-JZOS5FCX.js → chunk-BTBJ2NLH.js} +2 -2
- package/dist/cli/chunks/{chunk-CCK4BF76.js → chunk-BUVJIVFG.js} +1 -1
- package/dist/cli/chunks/{chunk-2JVWITNK.js → chunk-BZIPW2PA.js} +56 -80
- package/dist/cli/chunks/{chunk-BPEDWS6O.js → chunk-C647D42G.js} +2 -2
- package/dist/cli/chunks/{chunk-6U7LNMWZ.js → chunk-CBWM5NOO.js} +3 -3
- package/dist/cli/chunks/{chunk-72KXSMWI.js → chunk-CIEXUYY7.js} +1 -1
- package/dist/cli/chunks/{chunk-SE4WIB26.js → chunk-CLUHGBLN.js} +4 -4
- package/dist/cli/chunks/{chunk-JIXUMYKZ.js → chunk-CQEWL32R.js} +1 -1
- package/dist/cli/chunks/{chunk-CM7U6TAX.js → chunk-CXUC7YKA.js} +2 -2
- package/dist/cli/chunks/{chunk-7LPR6HJG.js → chunk-D2Y36V5J.js} +2 -2
- package/dist/cli/chunks/{chunk-BJTJLJRZ.js → chunk-DSJJHPPS.js} +4 -4
- package/dist/cli/chunks/{chunk-ZVWVV4EX.js → chunk-DZHXCOSK.js} +1 -1
- package/dist/cli/chunks/{chunk-7Z5LHRC3.js → chunk-EBV3WFIR.js} +2 -2
- package/dist/cli/chunks/{chunk-KNNISEDY.js → chunk-EKO5QL2B.js} +1 -1
- package/dist/cli/chunks/{chunk-XAS3XRYM.js → chunk-EMOZ5O5S.js} +1 -1
- package/dist/cli/chunks/{chunk-62N4NUJH.js → chunk-ES7TAJRJ.js} +2 -2
- package/dist/cli/chunks/chunk-EXQGHTPD.js +65 -0
- package/dist/cli/chunks/{chunk-Q7EAGKAE.js → chunk-F2WAB4WK.js} +2 -2
- package/dist/cli/chunks/{chunk-L4RUBPLR.js → chunk-F57FTFWS.js} +2 -2
- package/dist/cli/chunks/{chunk-GGRHV6D7.js → chunk-F6JJNBE5.js} +1 -1
- package/dist/cli/chunks/{chunk-3EZOZN25.js → chunk-FRC7AFB4.js} +2 -2
- package/dist/cli/chunks/{chunk-RSXXCL4A.js → chunk-G36RZF2Y.js} +1 -1
- package/dist/cli/chunks/{chunk-ZSPU4MOS.js → chunk-G3C7Z6FO.js} +2 -2
- package/dist/cli/chunks/{chunk-SNOBH4AZ.js → chunk-GA63ESNT.js} +2 -2
- package/dist/cli/chunks/{chunk-HNFVJP4I.js → chunk-GHMJFICO.js} +2 -2
- package/dist/cli/chunks/{chunk-7D3V65N5.js → chunk-GK5WLUX3.js} +1 -1
- package/dist/cli/chunks/{chunk-RETBYIAC.js → chunk-GQJ4QDEN.js} +6 -6
- package/dist/cli/chunks/chunk-GVLRE3BV.js +12 -0
- package/dist/cli/chunks/{chunk-MW2GGZZ5.js → chunk-H5UH234L.js} +1 -1
- package/dist/cli/chunks/{chunk-HM6ZSCPI.js → chunk-HBAFXWSO.js} +1 -1
- package/dist/cli/chunks/{chunk-DHVX5UB2.js → chunk-HE3BDBAO.js} +2 -2
- package/dist/cli/chunks/{chunk-YFBSPLJG.js → chunk-HHANMCD2.js} +1 -1
- package/dist/cli/chunks/chunk-HPVYJ6JH.js +2 -0
- package/dist/cli/chunks/{chunk-PX5YDCRH.js → chunk-I6NZFBT3.js} +3 -3
- package/dist/cli/chunks/{chunk-5J6W7SIA.js → chunk-ISBOHF6Y.js} +1 -1
- package/dist/cli/chunks/{chunk-UCFQALXO.js → chunk-J24AJEDE.js} +2 -2
- package/dist/cli/chunks/{chunk-FBMN7B46.js → chunk-J5HTQHJK.js} +2 -2
- package/dist/cli/chunks/{chunk-GPYVDFB3.js → chunk-JDOVO4E4.js} +205 -195
- package/dist/cli/chunks/chunk-JQAJUXRE.js +2 -0
- package/dist/cli/chunks/{chunk-RG52OKAM.js → chunk-JRK5GX56.js} +1 -1
- package/dist/cli/chunks/{chunk-I33ERSGB.js → chunk-JRLZ7LZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-NQZ5AR3D.js → chunk-JTOFLDU7.js} +2 -2
- package/dist/cli/chunks/{chunk-NHWGMJAP.js → chunk-K6EOHGKS.js} +2 -2
- package/dist/cli/chunks/{chunk-5QQSIGUA.js → chunk-KKXH25IH.js} +2 -2
- package/dist/cli/chunks/{chunk-VGFFFKGK.js → chunk-KNSQWM2E.js} +2 -2
- package/dist/cli/chunks/{chunk-B6MOJC3X.js → chunk-L5T32SRF.js} +1 -1
- package/dist/cli/chunks/{chunk-WGM35YWL.js → chunk-LKFBW2QM.js} +2 -2
- package/dist/cli/chunks/{chunk-AJRUJAAK.js → chunk-LMAI74EP.js} +1 -1
- package/dist/cli/chunks/{chunk-C6KWXUFJ.js → chunk-LQVS5IWH.js} +2 -2
- package/dist/cli/chunks/{chunk-H5BS5VH7.js → chunk-LRGTPUJA.js} +2 -2
- package/dist/cli/chunks/{chunk-3HZS4M3O.js → chunk-LTHV4PIG.js} +2 -2
- package/dist/cli/chunks/{chunk-7CUQCCMD.js → chunk-M7QKCHLQ.js} +2 -2
- package/dist/cli/chunks/{chunk-CF2ISEOJ.js → chunk-N3ASALOL.js} +2 -2
- package/dist/cli/chunks/{chunk-ZCRTRYXK.js → chunk-NEXBTLN6.js} +2 -2
- package/dist/cli/chunks/{chunk-VMNWDJIZ.js → chunk-NJEEKYEP.js} +3 -3
- package/dist/cli/chunks/{chunk-ZEV3YTO7.js → chunk-NWUFTLSF.js} +2 -2
- package/dist/cli/chunks/{chunk-MQROI74N.js → chunk-O4QB2GFL.js} +2 -2
- package/dist/cli/chunks/{chunk-GDSXITFH.js → chunk-OA75C4HY.js} +2 -2
- package/dist/cli/chunks/{chunk-SESK3ARK.js → chunk-OVMG6EEF.js} +2 -2
- package/dist/cli/chunks/{chunk-MUOG6QXR.js → chunk-OX7MJFLC.js} +2 -2
- package/dist/cli/chunks/{chunk-ELLBS5RP.js → chunk-OZJQN7YE.js} +2 -2
- package/dist/cli/chunks/{chunk-D6CJIGRU.js → chunk-PFXCRRR6.js} +55 -55
- package/dist/cli/chunks/{chunk-ZL6SYKUK.js → chunk-PVJLQ2YZ.js} +1 -1
- package/dist/cli/chunks/{chunk-6LIHFV7O.js → chunk-QDRFLM77.js} +2 -2
- package/dist/cli/chunks/{chunk-H6ZM3PUT.js → chunk-QH7C4PTX.js} +1 -1
- package/dist/cli/chunks/chunk-QKM4XT2F.js +2 -0
- package/dist/cli/chunks/{chunk-V4DM6ELU.js → chunk-QP7EKLWU.js} +2 -2
- package/dist/cli/chunks/{chunk-BAMN2CHI.js → chunk-QPACHVDI.js} +1 -1
- package/dist/cli/chunks/{chunk-QDFTT3RF.js → chunk-QQVE65ER.js} +2 -2
- package/dist/cli/chunks/{chunk-LL3IGZBI.js → chunk-QYCZYJH7.js} +2 -2
- package/dist/cli/chunks/{chunk-DUYOVM5I.js → chunk-R6I5I724.js} +2 -2
- package/dist/cli/chunks/{chunk-ENGZ4D5V.js → chunk-RJJIPTVH.js} +2 -2
- package/dist/cli/chunks/{chunk-7NITCZWD.js → chunk-RM6OC35G.js} +1 -1
- package/dist/cli/chunks/{chunk-Q5XTSMWR.js → chunk-RTD4U7IW.js} +2 -2
- package/dist/cli/chunks/{chunk-DBDPRORT.js → chunk-SKJQKOFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-ICTXTNQZ.js → chunk-SMBGK7XI.js} +1 -1
- package/dist/cli/chunks/{chunk-PI7TJS62.js → chunk-SPS472C5.js} +2 -2
- package/dist/cli/chunks/{chunk-IV5UZOHH.js → chunk-SUNXA2UR.js} +2 -2
- package/dist/cli/chunks/{chunk-IB27QACC.js → chunk-SVP3BP52.js} +2 -2
- package/dist/cli/chunks/{chunk-5OOMJGFN.js → chunk-T4WQPE77.js} +1 -1
- package/dist/cli/chunks/{chunk-66VWCR67.js → chunk-T53ZN4NO.js} +2 -2
- package/dist/cli/chunks/chunk-T6W2EYHC.js +2 -0
- package/dist/cli/chunks/{chunk-EAY2JMZG.js → chunk-T7YCNOW5.js} +2 -2
- package/dist/cli/chunks/{chunk-FZOBD67M.js → chunk-TCQWVVSR.js} +1 -1
- package/dist/cli/chunks/{chunk-SJUXE4IC.js → chunk-TGRHO4ES.js} +2 -2
- package/dist/cli/chunks/{chunk-6RE3X4V5.js → chunk-TP7L4EX6.js} +2 -2
- package/dist/cli/chunks/{chunk-6SQM2MUX.js → chunk-TT45RCLN.js} +2 -2
- package/dist/cli/chunks/{chunk-AVBJYI5I.js → chunk-TUZNWRYC.js} +1 -1
- package/dist/cli/chunks/{chunk-YHKEDEAA.js → chunk-U2QTL5T2.js} +3 -3
- package/dist/cli/chunks/chunk-U64QORFO.js +2 -0
- package/dist/cli/chunks/{chunk-BBT64TII.js → chunk-UHLZKH6B.js} +4 -4
- package/dist/cli/chunks/{chunk-GSF6MB64.js → chunk-UIWXKRTK.js} +2 -2
- package/dist/cli/chunks/{chunk-JMONHE4B.js → chunk-UNFE4RPV.js} +1 -1
- package/dist/cli/chunks/{chunk-DPYSUDAO.js → chunk-UQGIC5OX.js} +1 -1
- package/dist/cli/chunks/{chunk-IAF6T27S.js → chunk-VAXTPLO3.js} +2 -2
- package/dist/cli/chunks/{chunk-6SH5VZUD.js → chunk-VCSNNLWL.js} +2 -2
- package/dist/cli/chunks/chunk-VSPNIDQK.js +21 -0
- package/dist/cli/chunks/{chunk-6OS76PHI.js → chunk-VV2JVYOI.js} +2 -2
- package/dist/cli/chunks/{chunk-IQO7UCFR.js → chunk-VW7AXJQS.js} +2 -2
- package/dist/cli/chunks/{chunk-UQ32JHES.js → chunk-W7JUD4EZ.js} +2 -2
- package/dist/cli/chunks/chunk-WFKE7NZ5.js +12 -0
- package/dist/cli/chunks/{chunk-RFNPJK6N.js → chunk-WVEHKAIH.js} +3 -3
- package/dist/cli/chunks/{chunk-64VGZQLB.js → chunk-XAESN54Q.js} +1 -1
- package/dist/cli/chunks/{chunk-BMAPORJ7.js → chunk-XECZYQT5.js} +2 -2
- package/dist/cli/chunks/chunk-XFT4FYTC.js +2 -0
- package/dist/cli/chunks/{chunk-Y3UOUNHM.js → chunk-YHX74M7C.js} +2 -2
- package/dist/cli/chunks/chunk-YIWBJ637.js +2 -0
- package/dist/cli/chunks/{chunk-SDRHUMJB.js → chunk-Z5UZOYQS.js} +2 -2
- package/dist/cli/chunks/{chunk-7J6QC567.js → chunk-Z6G3QVZ4.js} +12 -12
- package/dist/cli/chunks/ci-5LIV2HW5.js +82 -0
- package/dist/cli/chunks/{ci-output-LDT24TS3.js → ci-output-UO5BDFU4.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-F5V4KITU.js → circuit-breaker-UQDPXYRD.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-DT6WQQVD.js → claude-flow-setup-62QES3QX.js} +2 -2
- package/dist/cli/chunks/client-AJZKCP4I.js +2 -0
- package/dist/cli/chunks/{cline-installer-G7TJOAEX.js → cline-installer-X7VZTSZG.js} +2 -2
- package/dist/cli/chunks/{code-PGE6A42V.js → code-H3BF4L4H.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-RNITH372.js → code-index-extractor-BJGFZGGL.js} +2 -2
- package/dist/cli/chunks/{codex-installer-LBX77AI3.js → codex-installer-KVZWKU6S.js} +2 -2
- package/dist/cli/chunks/{completions-4AWLAARX.js → completions-YMILE6V7.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-ZPNSS476.js → complexity-analyzer-J26N2PWG.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-UAPWX6OA.js → continuedev-installer-MAR42OV7.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-BJN2YJGI.js → copilot-installer-CVOJF6OT.js} +2 -2
- package/dist/cli/chunks/core-handlers-MQHEMGDV.js +2 -0
- package/dist/cli/chunks/{cost-tracker-MHP2VJ63.js → cost-tracker-SXLWXE55.js} +2 -2
- package/dist/cli/chunks/{coverage-PQB4IEFG.js → coverage-D7HCHFP3.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-3QNMZV5R.js +2 -0
- package/dist/cli/chunks/{cursor-installer-ZXBWYAS3.js → cursor-installer-X37VHIKW.js} +2 -2
- package/dist/cli/chunks/{daemon-64C7R6OJ.js → daemon-JN7SOH6F.js} +4 -4
- package/dist/cli/chunks/{daemon-N2BEGEFY.js → daemon-LIW47IDM.js} +4 -4
- package/dist/cli/chunks/{dag-attention-scheduler-SPZDAPNL.js → dag-attention-scheduler-QCHHIZBT.js} +2 -2
- package/dist/cli/chunks/{detect-LXJBSSZW.js → detect-WRFCWAX5.js} +2 -2
- package/dist/cli/chunks/{dist-node-U3TKZ2IZ.js → dist-node-6FWT4XZO.js} +2 -2
- package/dist/cli/chunks/{domain-handler-3DDWUVSR.js → domain-handler-SNFPNMRT.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-JJVWI4OQ.js → domain-plugins-MXKHH62P.js} +2 -2
- package/dist/cli/chunks/domain-transfer-47UJNERX.js +2 -0
- package/dist/cli/chunks/dream-OSWAITPT.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-JPAR7TXX.js → embed-and-insert-pattern-LZFAUNBQ.js} +2 -2
- package/dist/cli/chunks/{eval-SOLG23EA.js → eval-AMUXTMJB.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-T7G2VOOD.js → experience-capture-middleware-3D65TR2C.js} +4 -4
- package/dist/cli/chunks/{fast-paths-32N3ELI4.js → fast-paths-Y7BBMM56.js} +2 -2
- package/dist/cli/chunks/{feature-flags-APJDQ4N7.js → feature-flags-JMQQ7JW4.js} +2 -2
- package/dist/cli/chunks/{feature-flags-NAHKLDRN.js → feature-flags-VESRRQ6V.js} +2 -2
- package/dist/cli/chunks/{file-discovery-YKVM3MDB.js → file-discovery-JJKQQUV6.js} +2 -2
- package/dist/cli/chunks/{fleet-55M5CJS4.js → fleet-WIGHICJF.js} +4 -4
- package/dist/cli/chunks/{gnn-wrapper-UD6E6S6Z.js → gnn-wrapper-BFNPETTT.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-OYVW3VSC.js → heartbeat-handler-HDXKTGUI.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-BVRVVIE2.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-MZTHXULS.js +2 -0
- package/dist/cli/chunks/hnsw-index-KHEX4VDG.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-HBYIS3ZW.js → hnsw-legacy-bridge-6A7OTAPT.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-EQPM42OU.js → hnswlib-node-LKV2H47B.js} +2 -2
- package/dist/cli/chunks/{hooks-5ZSSJWO6.js → hooks-KDSFYQQG.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-2B3LCLR4.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-XBGVQ4PD.js → hypergraph-engine-GDLPEPUC.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-CAWAQ673.js → hypergraph-handler-4UMFA2EW.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-4R4VWOGQ.js +2 -0
- package/dist/cli/chunks/{init-handler-PRHXSARK.js → init-handler-4GCHPQHD.js} +16 -14
- package/dist/cli/chunks/init-wizard-TAOPXHHD.js +2 -0
- package/dist/cli/chunks/kernel-6I6VZUWY.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-F7LXBM7I.js → kilocode-installer-HJZMT2G5.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-NM723ZRG.js → kiro-installer-WUPY67HG.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-KFMTTUR5.js +2 -0
- package/dist/cli/chunks/{learning-5QYIDHH3.js → learning-AXKIS7IG.js} +4 -4
- package/dist/cli/chunks/{llm-router-43HKWPSX.js → llm-router-HUDPNZLJ.js} +4 -4
- package/dist/cli/chunks/llm-router-service-2D74XVM3.js +2 -0
- package/dist/cli/chunks/{load-5YDBWSCS.js → load-RM44POD7.js} +2 -2
- package/dist/cli/chunks/load-test-53FWOWNS.js +2 -0
- package/dist/cli/chunks/{mcp-UMAPMNMY.js → mcp-5JVQRBOP.js} +2 -2
- package/dist/cli/chunks/{memory-FWCPCQFP.js → memory-VGZ2V6PL.js} +5 -5
- package/dist/cli/chunks/memory-backend-KFJDDPEZ.js +2 -0
- package/dist/cli/chunks/memory-handlers-EI537Z32.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-2XTBGLE4.js → multi-model-executor-WPRKCSCM.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-GIXOJ6NS.js → opencode-installer-YAJMRCQO.js} +2 -2
- package/dist/cli/chunks/{orchestrator-VW6BKHLI.js → orchestrator-MUGWBUYP.js} +17 -17
- package/dist/cli/chunks/pattern-null-store-7DMU5CJ4.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-7CEUC3J7.js → pattern-usage-recorder-ZQJJ2YNG.js} +2 -2
- package/dist/cli/chunks/{pipeline-IGUQPPPO.js → pipeline-F4DXDUDC.js} +2 -2
- package/dist/cli/chunks/{platform-2P636I7B.js → platform-HI3A3OWF.js} +2 -2
- package/dist/cli/chunks/{plugin-NY6SWDPE.js → plugin-XRITPTR7.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-2UUDTIO2.js → prime-radiant-advanced-wasm-HHNJP7CQ.js} +2 -2
- package/dist/cli/chunks/{project-root-IOISG5KX.js → project-root-2VN4WO2A.js} +2 -2
- package/dist/cli/chunks/protocol-executor-2EMTBTMG.js +2 -0
- package/dist/cli/chunks/{protocol-handler-ZTPCRQ5W.js → protocol-handler-ZEVHSEBG.js} +2 -2
- package/dist/cli/chunks/{prove-SQX5A3IG.js → prove-C4BLZWBS.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-VZHZZPHE.js +2 -0
- package/dist/cli/chunks/{quality-DROILKRY.js → quality-M3DTE4KK.js} +2 -2
- package/dist/cli/chunks/quality-gate-V6KS7ML3.js +7 -0
- package/dist/cli/chunks/queen-coordinator-7MYTTUHI.js +2 -0
- package/dist/cli/chunks/{real-embeddings-P5U3MGYC.js → real-embeddings-YWSE3IRT.js} +2 -2
- package/dist/cli/chunks/{ref-validation-KY73NQXD.js → ref-validation-ZWOTFA3T.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-6JPPRB3W.js → roocode-installer-GJBIWETD.js} +2 -2
- package/dist/cli/chunks/router-ZD4LXAWA.js +2 -0
- package/dist/cli/chunks/routing-feedback-FSLMDVGD.js +2 -0
- package/dist/cli/chunks/{routing-handler-VTJIVFUO.js → routing-handler-CFYLGNAR.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-C6RPSJJO.js → ruvector-commands-EDKG456B.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-LTKTDRFS.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-IF24EVC5.js +2 -0
- package/dist/cli/chunks/{rvf-migration-coordinator-R53URRIO.js → rvf-migration-coordinator-ZMEYMAI6.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-E6JNBKMZ.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-MMXN5TEJ.js → rvf-store-integrity-AH6PNJP6.js} +2 -2
- package/dist/cli/chunks/safe-db-F6TRB5KZ.js +2 -0
- package/dist/cli/chunks/schedule-HBD4BYTE.js +2 -0
- package/dist/cli/chunks/scheduler-6FYWPMQC.js +2 -0
- package/dist/cli/chunks/{security-3B3R2NL4.js → security-ZU2GW3ZM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-VIJB7JUS.js → shared-rvf-adapter-5FOVSL3T.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-UVWGDUWC.js → shared-rvf-dual-writer-IO4DC4XV.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-DOU72F5Z.js +2 -0
- package/dist/cli/chunks/{standalone-memory-M4LWAAYZ.js → standalone-memory-3UXDZ7HI.js} +2 -2
- package/dist/cli/chunks/{status-handler-YYFV6OZL.js → status-handler-264CHTWS.js} +2 -2
- package/dist/cli/chunks/{structural-health-27E6LLKB.js → structural-health-E2QPUOZE.js} +2 -2
- package/dist/cli/chunks/{sync-J3LJ56WN.js → sync-2ACMWM7D.js} +2 -2
- package/dist/cli/chunks/sync-N2L2OST4.js +2 -0
- package/dist/cli/chunks/{task-handler-4MCEBQZL.js → task-handler-IB5CVOTY.js} +2 -2
- package/dist/cli/chunks/task-handlers-QBMYNJHE.js +9 -0
- package/dist/cli/chunks/test-7RGLRDSP.js +33 -0
- package/dist/cli/chunks/{test-scheduling-ZJBFRZ3J.js → test-scheduling-RJABJT2W.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-JVHMHB72.js +2 -0
- package/dist/cli/chunks/{token-usage-3X5WMTG2.js → token-usage-3ECHQVCY.js} +2 -2
- package/dist/cli/chunks/{transformers-MVL4C5IX.js → transformers-KJH3IJWI.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-SLW65ZFO.js → tree-sitter-wasm-parser-XN6PFI32.js} +2 -2
- package/dist/cli/chunks/{types-TG5P3CRS.js → types-5BAPXOLS.js} +2 -2
- package/dist/cli/chunks/unified-memory-GHAYAXWZ.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-CCC63YXT.js +2 -0
- package/dist/cli/chunks/unified-persistence-HKRHI5PG.js +2 -0
- package/dist/cli/chunks/{upgrade-ETBHDEPY.js → upgrade-S5NFQZID.js} +2 -2
- package/dist/cli/chunks/{validate-C2A73LZK.js → validate-BIBWOLJD.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-67XN42ML.js → validate-swarm-WAA3LBHH.js} +2 -2
- package/dist/cli/chunks/visual-security-APOXJ3Q3.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-USJN77P4.js → web-tree-sitter-OTBQTHAV.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-5GGZXGJW.js → windsurf-installer-NNQ22EW6.js} +2 -2
- package/dist/cli/chunks/witness-chain-7IP5IJGT.js +2 -0
- package/dist/cli/chunks/{witness-chain-IWS5ZHHL.js → witness-chain-E7MUBOJW.js} +2 -2
- package/dist/cli/chunks/witness-chain-repair-FW4QSN4C.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-3GEADWPE.js → witness-chain-verifier-YMROEBVL.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-ZWEIK3VJ.js → witness-key-manager-4CGRNDMJ.js} +2 -2
- package/dist/cli/chunks/{workflow-KHMVVBBA.js → workflow-4VRSTRAN.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-2HNW5ZMQ.js +2 -0
- package/dist/cli/chunks/wrappers-4M4UTGEU.js +2 -0
- package/dist/cli/commands/ci.js +18 -7
- package/dist/cli/commands/quality-gate.js +6 -1
- package/dist/cli/commands/test.js +18 -3
- package/dist/cli/handlers/init-handler.d.ts +2 -0
- package/dist/cli/handlers/init-handler.js +8 -2
- package/dist/cli/index.js +15 -2
- package/dist/cli/process-store-cleanup.d.ts +7 -0
- package/dist/cli/process-store-cleanup.js +27 -0
- package/dist/cli/utils/ci-config.d.ts +3 -3
- package/dist/cli/utils/ci-config.js +202 -68
- package/dist/coordination/handlers/test-execution-handlers.js +13 -8
- package/dist/coordination/index.d.ts +1 -1
- package/dist/coordination/queen-event-handlers.js +9 -6
- package/dist/coordination/result-saver.js +1 -1
- package/dist/coordination/services/index.d.ts +1 -1
- package/dist/coordination/services/task-audit-logger.d.ts +38 -13
- package/dist/coordination/services/task-audit-logger.js +33 -5
- package/dist/coordination/task-executor.d.ts +5 -0
- package/dist/coordination/task-executor.js +10 -5
- package/dist/domains/quality-assessment/quality-evidence.d.ts +3 -1
- package/dist/domains/quality-assessment/quality-evidence.js +7 -2
- package/dist/domains/test-execution/services/retry-handler.js +32 -13
- package/dist/domains/test-execution/services/test-executor.d.ts +3 -3
- package/dist/domains/test-execution/services/test-executor.js +66 -22
- package/dist/domains/test-generation/coordinator.js +6 -5
- package/dist/domains/test-generation/interfaces.d.ts +11 -1
- package/dist/domains/test-generation/services/behavior-example-validation.d.ts +36 -0
- package/dist/domains/test-generation/services/behavior-example-validation.js +89 -0
- package/dist/domains/test-generation/services/behavior-examples.d.ts +8 -0
- package/dist/domains/test-generation/services/behavior-examples.js +65 -0
- package/dist/domains/test-generation/services/test-generator.d.ts +1 -1
- package/dist/domains/test-generation/services/test-generator.js +59 -30
- package/dist/domains/visual-accessibility/services/axe-core-audit.d.ts +0 -15
- package/dist/domains/visual-accessibility/services/axe-core-audit.js +12 -10
- package/dist/init/browser-engine-installer.d.ts +5 -5
- package/dist/init/browser-engine-installer.js +28 -6
- package/dist/init/fleet-integration.js +3 -2
- package/dist/init/init-wizard-steps.js +3 -2
- package/dist/init/init-wizard.d.ts +2 -0
- package/dist/init/orchestrator.js +1 -0
- package/dist/init/phases/06-code-intelligence.js +6 -4
- package/dist/init/phases/09-assets.js +8 -18
- package/dist/init/phases/phase-interface.d.ts +2 -0
- package/dist/integrations/agentic-flow/reasoning-bank/index.d.ts +2 -5
- package/dist/integrations/ruvector/sona-persistence.d.ts +1 -0
- package/dist/integrations/ruvector/sona-persistence.js +74 -20
- package/dist/integrations/ruvector/sona-wrapper.d.ts +2 -0
- package/dist/integrations/ruvector/sona-wrapper.js +13 -0
- package/dist/integrations/vibium/client.d.ts +1 -0
- package/dist/integrations/vibium/client.js +24 -11
- package/dist/integrations/vibium/runtime.d.ts +14 -0
- package/dist/integrations/vibium/runtime.js +94 -0
- package/dist/kernel/memory-backend.js +5 -4
- package/dist/kernel/pattern-fts-self-heal.d.ts +63 -0
- package/dist/kernel/pattern-fts-self-heal.js +193 -0
- package/dist/kernel/process-lifecycle.d.ts +60 -0
- package/dist/kernel/process-lifecycle.js +91 -0
- package/dist/kernel/unified-memory-schemas.d.ts +15 -1
- package/dist/kernel/unified-memory-schemas.js +53 -25
- package/dist/kernel/unified-memory.js +34 -36
- package/dist/kernel/unified-persistence.js +12 -6
- package/dist/learning/aqe-learning-engine.js +3 -2
- package/dist/learning/experience-capture.d.ts +2 -1
- package/dist/learning/experience-capture.js +23 -8
- package/dist/learning/pattern-store.d.ts +1 -1
- package/dist/learning/pattern-store.js +27 -30
- package/dist/learning/qe-patterns.d.ts +6 -0
- package/dist/learning/qe-reasoning-bank.d.ts +1 -0
- package/dist/learning/qe-reasoning-bank.js +14 -4
- package/dist/learning/real-qe-reasoning-bank.d.ts +9 -4
- package/dist/learning/real-qe-reasoning-bank.js +28 -4
- package/dist/learning/rvf-pattern-store.js +19 -19
- package/dist/learning/sqlite-persistence.js +9 -24
- package/dist/mcp/bundle.js +545 -581
- package/dist/mcp/connection-pool.d.ts +2 -0
- package/dist/mcp/connection-pool.js +13 -2
- package/dist/mcp/entry.js +52 -6
- package/dist/mcp/handlers/domain-handler-configs.js +12 -4
- package/dist/mcp/handlers/memory-handlers.d.ts +1 -0
- package/dist/mcp/handlers/memory-handlers.js +16 -6
- package/dist/mcp/handlers/task-handlers.js +11 -7
- package/dist/mcp/protocol-server.js +47 -11
- package/dist/mcp/services/reasoning-bank-service.d.ts +6 -1
- package/dist/mcp/services/reasoning-bank-service.js +5 -1
- package/dist/mcp/tools/test-execution/e2e-execute.js +9 -1
- package/dist/mcp/tools/test-generation/generate.d.ts +6 -1
- package/dist/mcp/tools/test-generation/generate.js +8 -0
- package/dist/mcp/types.d.ts +8 -2
- package/dist/optimization/session-cache.js +13 -11
- package/dist/plugins/cache.js +10 -3
- package/dist/shared/embeddings/embedding-cache.js +4 -4
- package/dist/shared/error-utils.d.ts +15 -0
- package/dist/shared/error-utils.js +21 -0
- package/dist/shared/events/domain-events.d.ts +2 -1
- package/dist/shared/llm/cache.js +7 -10
- package/dist/shared/retry-engine.js +4 -0
- package/dist/shared/test-runner-process.d.ts +10 -0
- package/dist/shared/test-runner-process.js +210 -0
- package/dist/validation/quality-verdict.js +3 -2
- package/dist/workers/quality-daemon/priority-queue.js +4 -1
- package/package.json +10 -6
- package/dist/cli/chunks/adapter-UYOJPTOX.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-JR5AVQXR.js +0 -2
- package/dist/cli/chunks/base-DRZ2LS6X.js +0 -2
- package/dist/cli/chunks/browser-workflow-CJ7T3MXF.js +0 -2
- package/dist/cli/chunks/chunk-3NIG7S5W.js +0 -2
- package/dist/cli/chunks/chunk-4N23RFDU.js +0 -2
- package/dist/cli/chunks/chunk-AHKELLIO.js +0 -12
- package/dist/cli/chunks/chunk-DK4XN4CU.js +0 -2
- package/dist/cli/chunks/chunk-E6G2RD5H.js +0 -4
- package/dist/cli/chunks/chunk-MJS53PRX.js +0 -2
- package/dist/cli/chunks/chunk-PZPWRQ2M.js +0 -21
- package/dist/cli/chunks/chunk-QGA55PFM.js +0 -12
- package/dist/cli/chunks/chunk-SPV2VKC5.js +0 -3
- package/dist/cli/chunks/chunk-TCHGOB2N.js +0 -2
- package/dist/cli/chunks/chunk-UKA2KOXE.js +0 -2
- package/dist/cli/chunks/chunk-WCJBU2KI.js +0 -2
- package/dist/cli/chunks/chunk-Z6GGIRQQ.js +0 -65
- package/dist/cli/chunks/ci-W6K6G2KZ.js +0 -81
- package/dist/cli/chunks/client-KHWJT6FB.js +0 -2
- package/dist/cli/chunks/core-handlers-HING5RRG.js +0 -2
- package/dist/cli/chunks/cross-domain-router-PQTD6AZN.js +0 -2
- package/dist/cli/chunks/domain-transfer-M36KUJ2U.js +0 -2
- package/dist/cli/chunks/dream-WUGRSNCV.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-33XX5XNQ.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-XQPERX3H.js +0 -2
- package/dist/cli/chunks/hnsw-index-2GNXTWHH.js +0 -2
- package/dist/cli/chunks/hybrid-backend-CCF7URKI.js +0 -2
- package/dist/cli/chunks/impact-analyzer-HGKAZWIG.js +0 -2
- package/dist/cli/chunks/init-wizard-72MFBI3G.js +0 -2
- package/dist/cli/chunks/kernel-BRCBVMSK.js +0 -2
- package/dist/cli/chunks/knowledge-graph-DG44IPEI.js +0 -2
- package/dist/cli/chunks/llm-router-service-24KXFX32.js +0 -2
- package/dist/cli/chunks/load-test-N4TAYJY3.js +0 -2
- package/dist/cli/chunks/memory-backend-NVYFYVAU.js +0 -2
- package/dist/cli/chunks/memory-handlers-UTWCNCHL.js +0 -2
- package/dist/cli/chunks/pattern-null-store-SBPNYDBR.js +0 -2
- package/dist/cli/chunks/protocol-executor-IBYEII5Q.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-7IETWW6W.js +0 -2
- package/dist/cli/chunks/quality-gate-PWKWDJY2.js +0 -7
- package/dist/cli/chunks/queen-coordinator-NHUK2MWJ.js +0 -2
- package/dist/cli/chunks/router-SRSO3IHF.js +0 -2
- package/dist/cli/chunks/routing-feedback-PASRE5HY.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-4M4J67OU.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-TSXGT5LF.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-MOF3E7BR.js +0 -2
- package/dist/cli/chunks/safe-db-QJLFO33B.js +0 -2
- package/dist/cli/chunks/schedule-YIVXW5O2.js +0 -2
- package/dist/cli/chunks/scheduler-AON7DWSJ.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-75VHKKQB.js +0 -2
- package/dist/cli/chunks/sync-26CEGSTC.js +0 -2
- package/dist/cli/chunks/task-handlers-GYBAWKE2.js +0 -9
- package/dist/cli/chunks/test-MPC5HRH5.js +0 -33
- package/dist/cli/chunks/token-bootstrap-2Y2XITBX.js +0 -2
- package/dist/cli/chunks/unified-memory-UCQ6AB32.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-IXYUMKRR.js +0 -2
- package/dist/cli/chunks/unified-persistence-7E6JQ4FZ.js +0 -2
- package/dist/cli/chunks/vibium-NILGKHLN.js +0 -2
- package/dist/cli/chunks/visual-security-4VZXPEVG.js +0 -2
- package/dist/cli/chunks/witness-chain-JQA2VPZI.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-4UA7IPS3.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-GI5NQH7C.js +0 -2
- package/dist/cli/chunks/wrappers-N6XIK5PT.js +0 -2
|
@@ -41,7 +41,8 @@ export { BinaryHeap, UnifiedHnswIndex, createHnswIndex } from './unified-memory-
|
|
|
41
41
|
// parity tests or benchmarks only.
|
|
42
42
|
import { UnifiedHnswIndex } from './unified-memory-hnsw.js';
|
|
43
43
|
// Import schemas
|
|
44
|
-
import { SCHEMA_VERSION, SCHEMA_VERSION_TABLE, KV_STORE_SCHEMA, VECTORS_SCHEMA, RL_QVALUES_SCHEMA, GOAP_SCHEMA, DREAM_SCHEMA, QE_PATTERNS_SCHEMA, MINCUT_SCHEMA, SONA_PATTERNS_SCHEMA, FEEDBACK_SCHEMA, HYPERGRAPH_SCHEMA, PATTERN_NULLS_SCHEMA, STATS_TABLES, } from './unified-memory-schemas.js';
|
|
44
|
+
import { SCHEMA_VERSION, SCHEMA_VERSION_TABLE, KV_STORE_SCHEMA, VECTORS_SCHEMA, RL_QVALUES_SCHEMA, GOAP_SCHEMA, DREAM_SCHEMA, QE_PATTERNS_SCHEMA, QE_PATTERNS_FTS_SCHEMA, QE_PATTERNS_SCHEMA_WITHOUT_FTS, MINCUT_SCHEMA, SONA_PATTERNS_SCHEMA, FEEDBACK_SCHEMA, HYPERGRAPH_SCHEMA, PATTERN_NULLS_SCHEMA, STATS_TABLES, } from './unified-memory-schemas.js';
|
|
45
|
+
import { ensurePatternFtsInSync } from './pattern-fts-self-heal.js';
|
|
45
46
|
import { applyMigration as applyLearningEvidenceMigration } from '../migrations/20260830_add_learning_evidence_tables.js';
|
|
46
47
|
// CRDT imports for distributed state synchronization
|
|
47
48
|
import { createCRDTStore, } from '../memory/crdt/index.js';
|
|
@@ -55,6 +56,7 @@ import { createCRDTStore, } from '../memory/crdt/index.js';
|
|
|
55
56
|
// working unchanged. Imported (not bare re-exported) so internal callers below
|
|
56
57
|
// have a usable local binding.
|
|
57
58
|
import { findProjectRoot, clearProjectRootCache } from './project-root.js';
|
|
59
|
+
import { registerStoreCloser, requestOwnedShutdown } from './process-lifecycle.js';
|
|
58
60
|
export { findProjectRoot, clearProjectRootCache };
|
|
59
61
|
/**
|
|
60
62
|
* Get the default database path using project root detection.
|
|
@@ -276,6 +278,9 @@ export class UnifiedMemoryManager {
|
|
|
276
278
|
signal.throwIfAborted();
|
|
277
279
|
}
|
|
278
280
|
await this.runMigrations();
|
|
281
|
+
// Not gated on schema version: repairs missing qe_patterns_fts sync
|
|
282
|
+
// triggers / index drift on every open. Never throws; silent when healthy.
|
|
283
|
+
ensurePatternFtsInSync(this.db, { logPrefix: '[UnifiedMemory]' });
|
|
279
284
|
signal?.throwIfAborted();
|
|
280
285
|
// DATA LOSS PREVENTION: After migration, if the DB existed before and was
|
|
281
286
|
// large (>1MB = has real data), but now qe_patterns is empty, something
|
|
@@ -451,36 +456,13 @@ export class UnifiedMemoryManager {
|
|
|
451
456
|
if (currentVersion < 8)
|
|
452
457
|
this.db.exec(FEEDBACK_SCHEMA);
|
|
453
458
|
if (currentVersion < 9) {
|
|
454
|
-
// Add FTS5 full-text search for qe_patterns (hybrid vector/text search)
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_insert AFTER INSERT ON qe_patterns BEGIN
|
|
463
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
464
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
465
|
-
END;
|
|
466
|
-
|
|
467
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_delete AFTER DELETE ON qe_patterns BEGIN
|
|
468
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
469
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
470
|
-
END;
|
|
471
|
-
|
|
472
|
-
CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_update AFTER UPDATE ON qe_patterns BEGIN
|
|
473
|
-
INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)
|
|
474
|
-
VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);
|
|
475
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
476
|
-
VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);
|
|
477
|
-
END;
|
|
478
|
-
`);
|
|
479
|
-
// Populate FTS5 index from existing patterns
|
|
480
|
-
this.db.exec(`
|
|
481
|
-
INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)
|
|
482
|
-
SELECT rowid, name, description, pattern_type, qe_domain FROM qe_patterns;
|
|
483
|
-
`);
|
|
459
|
+
// Add FTS5 full-text search for qe_patterns (hybrid vector/text search).
|
|
460
|
+
// DDL shared with QE_PATTERNS_SCHEMA and the on-open self-heal.
|
|
461
|
+
this.db.exec(QE_PATTERNS_FTS_SCHEMA);
|
|
462
|
+
// Populate the index from existing patterns. 'rebuild' rather than a
|
|
463
|
+
// raw INSERT...SELECT so it's idempotent when QE_PATTERNS_SCHEMA's
|
|
464
|
+
// triggers already indexed some rows.
|
|
465
|
+
this.db.exec(`INSERT INTO qe_patterns_fts(qe_patterns_fts) VALUES('rebuild')`);
|
|
484
466
|
}
|
|
485
467
|
if (currentVersion < 10)
|
|
486
468
|
this.db.exec(PATTERN_NULLS_SCHEMA);
|
|
@@ -600,10 +582,11 @@ export class UnifiedMemoryManager {
|
|
|
600
582
|
}
|
|
601
583
|
async kvSearch(pattern, namespace = 'default', limit = 100) {
|
|
602
584
|
this.ensureInitialized();
|
|
603
|
-
|
|
585
|
+
// Only glob wildcards are special; SQL LIKE's own wildcard/escape bytes are literal.
|
|
586
|
+
const sqlPattern = pattern.replace(/[!%_]/g, '!$&').replace(/\*/g, '%').replace(/\?/g, '_');
|
|
604
587
|
const rows = this.db.prepare(`
|
|
605
588
|
SELECT key FROM kv_store
|
|
606
|
-
WHERE namespace = ? AND key LIKE ?
|
|
589
|
+
WHERE namespace = ? AND key LIKE ? ESCAPE '!'
|
|
607
590
|
AND (expires_at IS NULL OR expires_at > ?)
|
|
608
591
|
LIMIT ?
|
|
609
592
|
`).all(namespace, sqlPattern, Date.now(), limit);
|
|
@@ -810,7 +793,9 @@ export class UnifiedMemoryManager {
|
|
|
810
793
|
const db = this.db;
|
|
811
794
|
const table = db.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_pattern_embeddings'").get();
|
|
812
795
|
if (!table) {
|
|
813
|
-
|
|
796
|
+
// FTS objects are left to ensurePatternFtsInSync (runs after migrations)
|
|
797
|
+
// so missing triggers are still seen and the index is rebuilt.
|
|
798
|
+
db.exec(QE_PATTERNS_SCHEMA_WITHOUT_FTS);
|
|
814
799
|
return;
|
|
815
800
|
}
|
|
816
801
|
const columns = db.prepare("PRAGMA table_info('qe_pattern_embeddings')").all();
|
|
@@ -1091,8 +1076,21 @@ function registerExitHandlers() {
|
|
|
1091
1076
|
}
|
|
1092
1077
|
};
|
|
1093
1078
|
process.on('beforeExit', cleanup);
|
|
1094
|
-
|
|
1095
|
-
|
|
1079
|
+
// A claimed lifecycle owner (the MCP server) closes this store at the end of
|
|
1080
|
+
// its shutdown on every path (EOF, JSON-RPC shutdown, signals, watchdog), so
|
|
1081
|
+
// the WAL is checkpointed into memory.db. close() is idempotent.
|
|
1082
|
+
registerStoreCloser(cleanup);
|
|
1083
|
+
const onSignal = (signal) => {
|
|
1084
|
+
// #801: when a lifecycle owner is claimed, its graceful shutdown may still
|
|
1085
|
+
// need this store, and exiting here would pre-empt it. The owner closes it
|
|
1086
|
+
// through the closer registered above.
|
|
1087
|
+
if (requestOwnedShutdown(signal))
|
|
1088
|
+
return;
|
|
1089
|
+
cleanup();
|
|
1090
|
+
process.exit(0);
|
|
1091
|
+
};
|
|
1092
|
+
process.on('SIGINT', onSignal);
|
|
1093
|
+
process.on('SIGTERM', onSignal);
|
|
1096
1094
|
}
|
|
1097
1095
|
registerExitHandlers();
|
|
1098
1096
|
//# sourceMappingURL=unified-memory.js.map
|
|
@@ -21,6 +21,7 @@
|
|
|
21
21
|
import { toErrorMessage } from '../shared/error-utils.js';
|
|
22
22
|
import { getUnifiedMemory, resetUnifiedMemory, DEFAULT_UNIFIED_MEMORY_CONFIG, } from './unified-memory.js';
|
|
23
23
|
import { MEMORY_CONSTANTS } from './constants.js';
|
|
24
|
+
import { registerStoreCloser, requestOwnedShutdown } from './process-lifecycle.js';
|
|
24
25
|
// Use same path as unified-memory for true unification
|
|
25
26
|
export const DEFAULT_UNIFIED_CONFIG = {
|
|
26
27
|
dbPath: DEFAULT_UNIFIED_MEMORY_CONFIG.dbPath, // '.agentic-qe/memory.db'
|
|
@@ -254,14 +255,19 @@ function registerExitHandlers() {
|
|
|
254
255
|
}
|
|
255
256
|
};
|
|
256
257
|
process.on('beforeExit', cleanup);
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
258
|
+
// Closed by a claimed lifecycle owner (the MCP server) at the end of its
|
|
259
|
+
// shutdown on every path; registered after unified memory, so it closes first.
|
|
260
|
+
registerStoreCloser(cleanup);
|
|
261
|
+
const onSignal = (signal) => {
|
|
262
|
+
// #801: defer to a claimed lifecycle owner instead of exiting under its
|
|
263
|
+
// graceful shutdown; the owner closes the facade via the closer above.
|
|
264
|
+
if (requestOwnedShutdown(signal))
|
|
265
|
+
return;
|
|
262
266
|
cleanup();
|
|
263
267
|
process.exit(0);
|
|
264
|
-
}
|
|
268
|
+
};
|
|
269
|
+
process.on('SIGINT', onSignal);
|
|
270
|
+
process.on('SIGTERM', onSignal);
|
|
265
271
|
}
|
|
266
272
|
// Register exit handlers when module is loaded
|
|
267
273
|
registerExitHandlers();
|
|
@@ -752,7 +752,7 @@ export class AQELearningEngine {
|
|
|
752
752
|
*/
|
|
753
753
|
async localAnalyze(targetPath, depth) {
|
|
754
754
|
try {
|
|
755
|
-
const glob = await import('
|
|
755
|
+
const { glob } = await import('tinyglobby');
|
|
756
756
|
const { existsSync, readFileSync } = await import('fs');
|
|
757
757
|
const { join } = await import('path');
|
|
758
758
|
// Scan patterns based on depth
|
|
@@ -762,9 +762,10 @@ export class AQELearningEngine {
|
|
|
762
762
|
? ['**/*.ts', '**/*.js', '**/*.json', '**/*.py']
|
|
763
763
|
: ['**/*'];
|
|
764
764
|
const ignore = ['node_modules/**', 'dist/**', 'coverage/**', '.git/**'];
|
|
765
|
-
const files = await glob
|
|
765
|
+
const files = await glob(patterns, {
|
|
766
766
|
cwd: targetPath,
|
|
767
767
|
ignore,
|
|
768
|
+
expandDirectories: false,
|
|
768
769
|
onlyFiles: true,
|
|
769
770
|
});
|
|
770
771
|
// Detect languages and frameworks
|
|
@@ -301,8 +301,9 @@ export declare class ExperienceCaptureService {
|
|
|
301
301
|
*/
|
|
302
302
|
private detectPatternType;
|
|
303
303
|
/**
|
|
304
|
-
*
|
|
304
|
+
* Stable lookup identity; verify full origin metadata before reinforcement.
|
|
305
305
|
*/
|
|
306
|
+
private experienceIdentity;
|
|
306
307
|
private generatePatternName;
|
|
307
308
|
/**
|
|
308
309
|
* Extract tags from experience
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - Pattern promotion after threshold uses
|
|
13
13
|
* - Cross-domain experience sharing
|
|
14
14
|
*/
|
|
15
|
+
import { createHash } from 'node:crypto';
|
|
15
16
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
17
|
import { ok, err } from '../shared/types/index.js';
|
|
17
18
|
import { LoggerFactory } from '../logging/index.js';
|
|
@@ -373,16 +374,23 @@ export class ExperienceCaptureService {
|
|
|
373
374
|
if (!this.patternStore) {
|
|
374
375
|
return { newPattern: false, reinforced: false, promoted: false };
|
|
375
376
|
}
|
|
376
|
-
//
|
|
377
|
-
|
|
377
|
+
// Reinforcement records repeated observations of the exact originating task;
|
|
378
|
+
// lexical relevance is not a semantic reuse oracle.
|
|
379
|
+
const identity = this.experienceIdentity(experience);
|
|
380
|
+
const searchResult = await this.patternStore.search(identity, {
|
|
378
381
|
limit: 1,
|
|
379
382
|
domain: experience.domain,
|
|
380
|
-
|
|
383
|
+
patternType: this.detectPatternType(experience.task),
|
|
384
|
+
useVectorSearch: false,
|
|
381
385
|
});
|
|
382
386
|
if (searchResult.success && searchResult.value.length > 0) {
|
|
383
387
|
const existing = searchResult.value[0];
|
|
384
|
-
|
|
385
|
-
if (
|
|
388
|
+
const origin = existing.pattern.context?.experienceOrigin;
|
|
389
|
+
if (origin?.task === experience.task
|
|
390
|
+
&& origin.domain === (experience.domain ?? null)
|
|
391
|
+
&& origin.patternType === this.detectPatternType(experience.task)
|
|
392
|
+
&& existing.pattern.patternType === origin.patternType
|
|
393
|
+
&& (!experience.domain || existing.pattern.qeDomain === experience.domain)) {
|
|
386
394
|
const usageResult = await this.patternStore.recordUsage(existing.pattern.id, experience.success);
|
|
387
395
|
// Check if pattern should be promoted (short-term → long-term)
|
|
388
396
|
const pattern = await this.patternStore.get(existing.pattern.id);
|
|
@@ -590,10 +598,12 @@ ${stepDescriptions}
|
|
|
590
598
|
Duration: ${experience.durationMs}ms`;
|
|
591
599
|
return {
|
|
592
600
|
patternType,
|
|
601
|
+
qeDomain: experience.domain,
|
|
593
602
|
name: this.generatePatternName(experience),
|
|
594
603
|
description: `Pattern extracted from: ${experience.task}`,
|
|
595
604
|
context: {
|
|
596
|
-
tags: this.extractTags(experience),
|
|
605
|
+
tags: [...this.extractTags(experience), this.experienceIdentity(experience)],
|
|
606
|
+
experienceOrigin: { task: experience.task, domain: experience.domain ?? null, patternType },
|
|
597
607
|
testType: this.detectTestType(experience.task),
|
|
598
608
|
},
|
|
599
609
|
template: {
|
|
@@ -657,8 +667,13 @@ Duration: ${experience.durationMs}ms`;
|
|
|
657
667
|
return 'test-template'; // Default
|
|
658
668
|
}
|
|
659
669
|
/**
|
|
660
|
-
*
|
|
670
|
+
* Stable lookup identity; verify full origin metadata before reinforcement.
|
|
661
671
|
*/
|
|
672
|
+
experienceIdentity(experience) {
|
|
673
|
+
return createHash('sha256').update(JSON.stringify([
|
|
674
|
+
experience.task, experience.domain ?? null, this.detectPatternType(experience.task),
|
|
675
|
+
])).digest('hex');
|
|
676
|
+
}
|
|
662
677
|
generatePatternName(experience) {
|
|
663
678
|
// Take first 50 chars of task, sanitize
|
|
664
679
|
const sanitized = experience.task
|
|
@@ -666,7 +681,7 @@ Duration: ${experience.durationMs}ms`;
|
|
|
666
681
|
.slice(0, 50)
|
|
667
682
|
.trim();
|
|
668
683
|
const domain = experience.domain ? `[${experience.domain}] ` : '';
|
|
669
|
-
return `${domain}${sanitized}`;
|
|
684
|
+
return `${domain}${sanitized} ${this.experienceIdentity(experience)}`;
|
|
670
685
|
}
|
|
671
686
|
/**
|
|
672
687
|
* Extract tags from experience
|
|
@@ -155,7 +155,7 @@ export interface PatternSearchResult {
|
|
|
155
155
|
/** Match score (0-1) */
|
|
156
156
|
score: number;
|
|
157
157
|
/** How the pattern was matched */
|
|
158
|
-
matchType: 'vector' | 'exact' | 'context';
|
|
158
|
+
matchType: 'vector' | 'exact' | 'lexical' | 'context';
|
|
159
159
|
/** Similarity score for vector matches (ADR-042) */
|
|
160
160
|
similarity: number;
|
|
161
161
|
/** Whether this pattern can be reused to skip LLM calls (ADR-042) */
|
|
@@ -60,10 +60,12 @@ function getHDCTokenFingerprinter() {
|
|
|
60
60
|
/** Module-level Hopfield memory for exact pattern recall */
|
|
61
61
|
let hopfieldMemory = null;
|
|
62
62
|
let hopfieldDimension = 0;
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
let hopfieldSpaceId;
|
|
64
|
+
function getHopfieldMemory(dimension, spaceId) {
|
|
65
|
+
if (!hopfieldMemory || hopfieldDimension !== dimension || hopfieldSpaceId !== spaceId) {
|
|
65
66
|
hopfieldMemory = createHopfieldMemory({ dimension, maxPatterns: 10000 });
|
|
66
67
|
hopfieldDimension = dimension;
|
|
68
|
+
hopfieldSpaceId = spaceId;
|
|
67
69
|
}
|
|
68
70
|
return hopfieldMemory;
|
|
69
71
|
}
|
|
@@ -564,9 +566,9 @@ export class PatternStore {
|
|
|
564
566
|
console.debug(`[PatternStore] HDC token fingerprint failed for ${pattern.id}:`, toErrorMessage(error));
|
|
565
567
|
}
|
|
566
568
|
// R5: Store embedding in Hopfield memory for exact recall
|
|
567
|
-
if (isHopfieldMemoryEnabled() && pattern.embedding) {
|
|
569
|
+
if (isHopfieldMemoryEnabled() && pattern.embedding && activeSpaceId) {
|
|
568
570
|
try {
|
|
569
|
-
const hopfield = getHopfieldMemory(pattern.embedding.length);
|
|
571
|
+
const hopfield = getHopfieldMemory(pattern.embedding.length, activeSpaceId);
|
|
570
572
|
hopfield.store(new Float32Array(pattern.embedding), {
|
|
571
573
|
id: pattern.id,
|
|
572
574
|
name: pattern.name,
|
|
@@ -717,10 +719,14 @@ export class PatternStore {
|
|
|
717
719
|
const limit = options.limit || 10;
|
|
718
720
|
const results = [];
|
|
719
721
|
try {
|
|
722
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId;
|
|
723
|
+
if (Array.isArray(query) && (!activeSpaceId || options.embeddingSpaceId !== activeSpaceId)) {
|
|
724
|
+
throw new Error('VECTOR_SPACE_UNVERIFIED: pre-computed query vectors require the active embeddingSpaceId');
|
|
725
|
+
}
|
|
720
726
|
// R5: Exact recall via Hopfield — check for high-confidence exact match
|
|
721
|
-
if (Array.isArray(query) && isHopfieldMemoryEnabled()) {
|
|
727
|
+
if (Array.isArray(query) && options.useVectorSearch !== false && activeSpaceId && isHopfieldMemoryEnabled()) {
|
|
722
728
|
try {
|
|
723
|
-
const hopfield = getHopfieldMemory(query.length);
|
|
729
|
+
const hopfield = getHopfieldMemory(query.length, activeSpaceId);
|
|
724
730
|
if (hopfield.getPatternCount() > 0) {
|
|
725
731
|
const recallResult = hopfield.recall(new Float32Array(query));
|
|
726
732
|
if (recallResult && recallResult.similarity > 0.98) {
|
|
@@ -747,10 +753,6 @@ export class PatternStore {
|
|
|
747
753
|
}
|
|
748
754
|
// Vector search if query is embedding and HNSW available (lazy-load)
|
|
749
755
|
if (Array.isArray(query) && options.useVectorSearch !== false) {
|
|
750
|
-
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.config.embeddingSpaceId;
|
|
751
|
-
if (!activeSpaceId || options.embeddingSpaceId !== activeSpaceId) {
|
|
752
|
-
throw new Error('VECTOR_SPACE_UNVERIFIED: pre-computed query vectors require the active embeddingSpaceId');
|
|
753
|
-
}
|
|
754
756
|
const hnsw = await this.ensureHNSW();
|
|
755
757
|
if (hnsw) {
|
|
756
758
|
const hnswResults = await hnsw.search(query, limit * 2);
|
|
@@ -778,7 +780,7 @@ export class PatternStore {
|
|
|
778
780
|
try {
|
|
779
781
|
const ftsResults = this.sqliteStore.searchFTS(ftsText, limit * 2);
|
|
780
782
|
if (ftsResults.length > 0) {
|
|
781
|
-
const ftsScoreMap = new Map(ftsResults.map(r => [r.id, r.ftsScore]));
|
|
783
|
+
const ftsScoreMap = new Map(ftsResults.map(r => [r.id, r.ftsScore * r.coverage]));
|
|
782
784
|
const existingIds = new Set(results.map(r => r.pattern.id));
|
|
783
785
|
// Boost existing vector results that also match FTS5
|
|
784
786
|
for (const result of results) {
|
|
@@ -793,22 +795,18 @@ export class PatternStore {
|
|
|
793
795
|
continue;
|
|
794
796
|
const pattern = await this.get(ftsResult.id);
|
|
795
797
|
if (pattern && this.matchesFilters(pattern, options)) {
|
|
796
|
-
//
|
|
797
|
-
//
|
|
798
|
-
// report the conservative keyword score as their similarity.
|
|
799
|
-
// Scaled by query-term coverage so the best of a weak lexical
|
|
800
|
-
// set (e.g. one shared stopword) cannot outrank vector hits.
|
|
798
|
+
// Relative BM25 is weighted by query coverage for ranking;
|
|
799
|
+
// lexical evidence alone never authorizes vector reuse.
|
|
801
800
|
const keywordScore = 0.5 * ftsResult.ftsScore * ftsResult.coverage;
|
|
802
|
-
const similarity =
|
|
803
|
-
const reuseInfo = this.calculateReuseInfo(pattern, similarity);
|
|
801
|
+
const similarity = 0; // Lexical relevance is not vector similarity or safe reuse.
|
|
804
802
|
results.push({
|
|
805
803
|
pattern,
|
|
806
|
-
score: keywordScore,
|
|
807
|
-
matchType: '
|
|
804
|
+
score: keywordScore,
|
|
805
|
+
matchType: 'lexical',
|
|
808
806
|
similarity,
|
|
809
|
-
canReuse:
|
|
810
|
-
estimatedTokenSavings:
|
|
811
|
-
reuseConfidence:
|
|
807
|
+
canReuse: false,
|
|
808
|
+
estimatedTokenSavings: 0,
|
|
809
|
+
reuseConfidence: 0,
|
|
812
810
|
});
|
|
813
811
|
}
|
|
814
812
|
}
|
|
@@ -974,15 +972,14 @@ export class PatternStore {
|
|
|
974
972
|
score = pattern.qualityScore;
|
|
975
973
|
}
|
|
976
974
|
if (score > 0 || !queryLower) {
|
|
977
|
-
const reuseInfo = this.calculateReuseInfo(pattern, score);
|
|
978
975
|
results.push({
|
|
979
976
|
pattern,
|
|
980
|
-
score: score
|
|
981
|
-
matchType: queryLower ? '
|
|
982
|
-
similarity:
|
|
983
|
-
canReuse:
|
|
984
|
-
estimatedTokenSavings:
|
|
985
|
-
reuseConfidence:
|
|
977
|
+
score: queryLower ? 0.5 * score : pattern.qualityScore,
|
|
978
|
+
matchType: queryLower ? 'lexical' : 'context',
|
|
979
|
+
similarity: 0,
|
|
980
|
+
canReuse: false,
|
|
981
|
+
estimatedTokenSavings: 0,
|
|
982
|
+
reuseConfidence: 0,
|
|
986
983
|
});
|
|
987
984
|
}
|
|
988
985
|
}
|
|
@@ -111,6 +111,12 @@ export interface QEPattern {
|
|
|
111
111
|
* Pattern applicability context
|
|
112
112
|
*/
|
|
113
113
|
export interface QEPatternContext {
|
|
114
|
+
/** Exact originating experience; reinforcement identity, never a similarity claim. */
|
|
115
|
+
readonly experienceOrigin?: {
|
|
116
|
+
task: string;
|
|
117
|
+
domain: QEDomain | null;
|
|
118
|
+
patternType: QEPatternType;
|
|
119
|
+
};
|
|
114
120
|
/** Programming language this pattern applies to */
|
|
115
121
|
readonly language?: ProgrammingLanguage;
|
|
116
122
|
/** Test framework this pattern uses */
|
|
@@ -48,6 +48,7 @@ export declare class QEReasoningBank implements IQEReasoningBank {
|
|
|
48
48
|
private readonly eventBus?;
|
|
49
49
|
private readonly coherenceService?;
|
|
50
50
|
private readonly config;
|
|
51
|
+
private readonly embeddingProvenance;
|
|
51
52
|
private patternStore;
|
|
52
53
|
private initialized;
|
|
53
54
|
private sqliteStore;
|
|
@@ -64,6 +64,7 @@ export class QEReasoningBank {
|
|
|
64
64
|
eventBus;
|
|
65
65
|
coherenceService;
|
|
66
66
|
config;
|
|
67
|
+
embeddingProvenance = new WeakMap();
|
|
67
68
|
patternStore;
|
|
68
69
|
initialized = false;
|
|
69
70
|
sqliteStore = null;
|
|
@@ -337,7 +338,11 @@ export class QEReasoningBank {
|
|
|
337
338
|
searchQuery = '';
|
|
338
339
|
}
|
|
339
340
|
else {
|
|
340
|
-
|
|
341
|
+
const embedding = await this.embed(query);
|
|
342
|
+
// Hash fallback and resized vectors do not belong to the active provider.
|
|
343
|
+
// Keep their text searchable without claiming semantic comparability.
|
|
344
|
+
searchQuery = this.embeddingProvenance.has(embedding) ? embedding : query;
|
|
345
|
+
useVectorSearch = Array.isArray(searchQuery);
|
|
341
346
|
}
|
|
342
347
|
}
|
|
343
348
|
return this.patternStore.search(searchQuery, {
|
|
@@ -346,7 +351,7 @@ export class QEReasoningBank {
|
|
|
346
351
|
textQuery: typeof query === 'string' && query.trim() ? query : options?.textQuery,
|
|
347
352
|
useVectorSearch,
|
|
348
353
|
embeddingSpaceId: typeof query === 'string'
|
|
349
|
-
?
|
|
354
|
+
? (Array.isArray(searchQuery) ? this.embeddingProvenance.get(searchQuery) : undefined)
|
|
350
355
|
: options?.embeddingSpaceId,
|
|
351
356
|
});
|
|
352
357
|
}
|
|
@@ -442,11 +447,13 @@ export class QEReasoningBank {
|
|
|
442
447
|
}
|
|
443
448
|
// 2. Search for similar patterns
|
|
444
449
|
const embedding = await this.embed(request.task);
|
|
445
|
-
const
|
|
450
|
+
const embeddingSpaceId = this.embeddingProvenance.get(embedding);
|
|
451
|
+
const patternResults = await this.patternStore.search(embeddingSpaceId ? embedding : request.task, {
|
|
446
452
|
limit: this.config.maxRoutingCandidates,
|
|
447
453
|
domain: detectedDomains[0],
|
|
448
|
-
useVectorSearch:
|
|
454
|
+
useVectorSearch: Boolean(embeddingSpaceId),
|
|
449
455
|
textQuery: request.task,
|
|
456
|
+
embeddingSpaceId,
|
|
450
457
|
});
|
|
451
458
|
const patterns = patternResults.success
|
|
452
459
|
? patternResults.value.map((r) => r.pattern)
|
|
@@ -607,6 +614,9 @@ export class QEReasoningBank {
|
|
|
607
614
|
if (embedding.length !== this.config.embeddingDimension) {
|
|
608
615
|
return resizeEmbedding(embedding, this.config.embeddingDimension);
|
|
609
616
|
}
|
|
617
|
+
const spaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
|
|
618
|
+
if (spaceId)
|
|
619
|
+
this.embeddingProvenance.set(embedding, spaceId);
|
|
610
620
|
return embedding;
|
|
611
621
|
}
|
|
612
622
|
catch (error) {
|
|
@@ -30,6 +30,14 @@ export interface RealQEReasoningBankConfig {
|
|
|
30
30
|
coherenceThreshold?: number;
|
|
31
31
|
}
|
|
32
32
|
export declare const DEFAULT_REAL_CONFIG: RealQEReasoningBankConfig;
|
|
33
|
+
/** Ranking evidence keeps lexical relevance separate from vector reuse safety. */
|
|
34
|
+
export interface RealQEPatternSearchResult {
|
|
35
|
+
pattern: QEPattern;
|
|
36
|
+
score: number;
|
|
37
|
+
similarity: number;
|
|
38
|
+
matchType: 'vector' | 'lexical';
|
|
39
|
+
canReuse: boolean;
|
|
40
|
+
}
|
|
33
41
|
export interface RealQERoutingRequest {
|
|
34
42
|
task: string;
|
|
35
43
|
taskType?: 'test-generation' | 'analysis' | 'debugging' | 'optimization';
|
|
@@ -144,10 +152,7 @@ export declare class RealQEReasoningBank {
|
|
|
144
152
|
limit?: number;
|
|
145
153
|
domain?: QEDomain;
|
|
146
154
|
minSimilarity?: number;
|
|
147
|
-
}): Promise<Result<
|
|
148
|
-
pattern: QEPattern;
|
|
149
|
-
similarity: number;
|
|
150
|
-
}>>>;
|
|
155
|
+
}): Promise<Result<RealQEPatternSearchResult[]>>;
|
|
151
156
|
/**
|
|
152
157
|
* Route a task to optimal agent
|
|
153
158
|
*/
|
|
@@ -19,6 +19,7 @@ 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 { blendFtsScore, DEFAULT_PATTERN_STORE_CONFIG } from './pattern-store.js';
|
|
22
23
|
import { EMBEDDING_SPACE_CANARY } from './embedding-space.js';
|
|
23
24
|
const logger = LoggerFactory.create('RealQEReasoningBank');
|
|
24
25
|
import { computeRealEmbedding, isTransformerAvailable, getEmbeddingDimension, clearEmbeddingCache, getActiveEmbeddingSpaceIdentity, } from './real-embeddings.js';
|
|
@@ -418,11 +419,11 @@ export class RealQEReasoningBank {
|
|
|
418
419
|
const limit = options.limit || 10;
|
|
419
420
|
const results = this.hnswIndex.searchKnn(queryEmbedding, limit * 2); // Get extra for filtering
|
|
420
421
|
const patterns = [];
|
|
421
|
-
for (let i = 0; i < results.neighbors.length
|
|
422
|
+
for (let i = 0; i < results.neighbors.length; i++) {
|
|
422
423
|
const hnswIndex = results.neighbors[i];
|
|
423
424
|
const distance = results.distances[i];
|
|
424
425
|
const similarity = 1 - distance; // Convert distance to similarity
|
|
425
|
-
if (options.minSimilarity && similarity < options.minSimilarity) {
|
|
426
|
+
if (options.minSimilarity !== undefined && similarity < options.minSimilarity) {
|
|
426
427
|
continue;
|
|
427
428
|
}
|
|
428
429
|
const patternId = this.patternIdMap.get(hnswIndex);
|
|
@@ -435,13 +436,36 @@ export class RealQEReasoningBank {
|
|
|
435
436
|
if (options.domain && pattern.qeDomain !== options.domain) {
|
|
436
437
|
continue;
|
|
437
438
|
}
|
|
438
|
-
|
|
439
|
+
const reuse = DEFAULT_PATTERN_STORE_CONFIG.reuseOptimization;
|
|
440
|
+
const ageDays = (Date.now() - new Date(pattern.lastUsedAt).getTime()) / 86_400_000;
|
|
441
|
+
patterns.push({ pattern, similarity, score: similarity, matchType: 'vector',
|
|
442
|
+
canReuse: Boolean(pattern.reusable && similarity >= reuse.minSimilarityForReuse
|
|
443
|
+
&& pattern.successRate >= reuse.minSuccessRateForReuse && ageDays <= reuse.maxAgeForReuse),
|
|
444
|
+
});
|
|
445
|
+
}
|
|
446
|
+
const existing = new Map(patterns.map(hit => [hit.pattern.id, hit]));
|
|
447
|
+
for (const lexical of this.sqliteStore.searchFTS(query, limit * 2)) {
|
|
448
|
+
const vector = existing.get(lexical.id);
|
|
449
|
+
if (vector) {
|
|
450
|
+
vector.score = blendFtsScore(vector.score, lexical.ftsScore * lexical.coverage);
|
|
451
|
+
continue;
|
|
452
|
+
}
|
|
453
|
+
// A vector threshold requires measured vector evidence. A rejected
|
|
454
|
+
// vector must never re-enter through the lexical-only branch.
|
|
455
|
+
if (options.minSimilarity !== undefined)
|
|
456
|
+
continue;
|
|
457
|
+
const pattern = this.sqliteStore.getPattern(lexical.id);
|
|
458
|
+
if (!pattern || (options.domain && pattern.qeDomain !== options.domain))
|
|
459
|
+
continue;
|
|
460
|
+
patterns.push({ pattern, score: 0.5 * lexical.ftsScore * lexical.coverage,
|
|
461
|
+
similarity: 0, matchType: 'lexical', canReuse: false });
|
|
439
462
|
}
|
|
463
|
+
patterns.sort((a, b) => b.score - a.score);
|
|
440
464
|
const searchTime = performance.now() - startTime;
|
|
441
465
|
if (searchTime > 10) {
|
|
442
466
|
logger.warn('Slow search', { searchTimeMs: Number(searchTime.toFixed(1)) });
|
|
443
467
|
}
|
|
444
|
-
return ok(patterns);
|
|
468
|
+
return ok(patterns.slice(0, limit));
|
|
445
469
|
}
|
|
446
470
|
catch (error) {
|
|
447
471
|
return err(toError(error));
|
|
@@ -322,16 +322,18 @@ export class RvfPatternStore {
|
|
|
322
322
|
// Uses getPattern(id) which joins the embedding from qe_pattern_embeddings.
|
|
323
323
|
if (Array.isArray(query) && !this.adapter && this.sqliteStore && results.length === 0) {
|
|
324
324
|
try {
|
|
325
|
-
const
|
|
325
|
+
const activeSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? this.embeddingSpaceId;
|
|
326
|
+
const embeddings = this.sqliteStore.getAllEmbeddings();
|
|
326
327
|
const qArr = query;
|
|
327
328
|
const qMag = Math.sqrt(qArr.reduce((s, v) => s + v * v, 0));
|
|
328
329
|
if (qMag > 0) {
|
|
329
|
-
for (const
|
|
330
|
-
if (!
|
|
330
|
+
for (const row of embeddings) {
|
|
331
|
+
if (!activeSpaceId || row.spaceId !== activeSpaceId)
|
|
331
332
|
continue;
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
333
|
+
const full = this.sqliteStore.getPattern(row.patternId);
|
|
334
|
+
if (!full || !this.matchesFilters(full, options))
|
|
335
|
+
continue;
|
|
336
|
+
const emb = row.embedding;
|
|
335
337
|
if (!emb || emb.length !== qArr.length)
|
|
336
338
|
continue;
|
|
337
339
|
let dot = 0, eMag = 0;
|
|
@@ -368,15 +370,14 @@ export class RvfPatternStore {
|
|
|
368
370
|
continue;
|
|
369
371
|
if (!this.matchesFilters(pattern, options))
|
|
370
372
|
continue;
|
|
371
|
-
const reuseInfo = this.calculateReuseInfo(pattern, pattern.confidence);
|
|
372
373
|
results.push({
|
|
373
374
|
pattern,
|
|
374
375
|
score: pattern.confidence,
|
|
375
|
-
matchType: '
|
|
376
|
-
similarity:
|
|
377
|
-
canReuse:
|
|
378
|
-
estimatedTokenSavings:
|
|
379
|
-
reuseConfidence:
|
|
376
|
+
matchType: 'context',
|
|
377
|
+
similarity: 0,
|
|
378
|
+
canReuse: false,
|
|
379
|
+
estimatedTokenSavings: 0,
|
|
380
|
+
reuseConfidence: 0,
|
|
380
381
|
});
|
|
381
382
|
}
|
|
382
383
|
}
|
|
@@ -390,7 +391,7 @@ export class RvfPatternStore {
|
|
|
390
391
|
const existingIds = new Set(results.map(r => r.pattern.id));
|
|
391
392
|
// #653: same vector/FTS5 blend as PatternStore for hits found by
|
|
392
393
|
// both, so lexical relevance can reorder vector results.
|
|
393
|
-
const ftsScoreMap = new Map(ftsResults.map(r => [r.id, r.ftsScore]));
|
|
394
|
+
const ftsScoreMap = new Map(ftsResults.map(r => [r.id, r.ftsScore * r.coverage]));
|
|
394
395
|
for (const result of results) {
|
|
395
396
|
const ftsScore = ftsScoreMap.get(result.pattern.id);
|
|
396
397
|
if (ftsScore !== undefined) {
|
|
@@ -404,16 +405,15 @@ export class RvfPatternStore {
|
|
|
404
405
|
if (pattern && this.matchesFilters(pattern, options)) {
|
|
405
406
|
// Same keyword-only similarity rule as PatternStore (#653)
|
|
406
407
|
const keywordScore = 0.5 * ftsResult.ftsScore * ftsResult.coverage;
|
|
407
|
-
const similarity =
|
|
408
|
-
const reuseInfo = this.calculateReuseInfo(pattern, similarity);
|
|
408
|
+
const similarity = 0; // Lexical relevance is not vector similarity or safe reuse.
|
|
409
409
|
results.push({
|
|
410
410
|
pattern,
|
|
411
411
|
score: keywordScore,
|
|
412
|
-
matchType: '
|
|
412
|
+
matchType: 'lexical',
|
|
413
413
|
similarity,
|
|
414
|
-
canReuse:
|
|
415
|
-
estimatedTokenSavings:
|
|
416
|
-
reuseConfidence:
|
|
414
|
+
canReuse: false,
|
|
415
|
+
estimatedTokenSavings: 0,
|
|
416
|
+
reuseConfidence: 0,
|
|
417
417
|
});
|
|
418
418
|
}
|
|
419
419
|
}
|