agentic-qe 3.15.15 → 3.15.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +90 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/audit/witness-chain.d.ts +7 -0
- package/dist/audit/witness-chain.js +10 -0
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-6CQ2PIP5.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-EUF4XVUC.js → agent-booster-wasm-45NWEKVS.js} +2 -2
- package/dist/cli/chunks/{agent-handler-MOX6PSIQ.js → agent-handler-LVHMYFEF.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-AEXKIGDG.js → agent-memory-branch-YDWOJFEQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +2 -0
- package/dist/cli/chunks/{arena-IQ5ZZDRF.js → arena-CZKHXDDS.js} +2 -2
- package/dist/cli/chunks/{arena-M7GA3CVG.js → arena-ELDZH3CZ.js} +4 -4
- package/dist/cli/chunks/{audit-4IPBMKWB.js → audit-5MT4T47Z.js} +3 -3
- package/dist/cli/chunks/base-SMCMMVGP.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-IKDKJ2IE.js → better-sqlite3-6TGYPC2B.js} +2 -2
- package/dist/cli/chunks/{brain-handler-5NQUDH4W.js → brain-handler-HQWZFO52.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-KSXELWRC.js → branch-enumerator-WVILM4SO.js} +2 -2
- package/dist/cli/chunks/{browser-6LACARWE.js → browser-RX5ALU3H.js} +2 -2
- package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +2 -0
- package/dist/cli/chunks/{chunk-SJCKCSN3.js → chunk-24OX5TQJ.js} +1 -1
- package/dist/cli/chunks/{chunk-J3FP5UGL.js → chunk-24QHCVX6.js} +1 -1
- package/dist/cli/chunks/{chunk-BZULJMGH.js → chunk-2H4XH6FT.js} +2 -2
- package/dist/cli/chunks/{chunk-E3MRDIZF.js → chunk-2YZ4G6NW.js} +1 -1
- package/dist/cli/chunks/chunk-32BPDLRZ.js +27 -0
- package/dist/cli/chunks/{chunk-76P32JVU.js → chunk-32GN3JKR.js} +1 -1
- package/dist/cli/chunks/{chunk-W62OOK7A.js → chunk-3HD7E6HN.js} +2 -2
- package/dist/cli/chunks/{chunk-AJPROCDW.js → chunk-4D4DENG6.js} +2 -2
- package/dist/cli/chunks/{chunk-PFQCV6YS.js → chunk-4LQFBY5L.js} +6 -6
- package/dist/cli/chunks/{chunk-4ATQP3PR.js → chunk-4NFQLP6R.js} +1 -1
- package/dist/cli/chunks/{chunk-WUOOX7UG.js → chunk-525CFDUE.js} +2 -2
- package/dist/cli/chunks/chunk-5B5QPCNU.js +65 -0
- package/dist/cli/chunks/{chunk-SON6ZRH3.js → chunk-5JZRZI4S.js} +2 -2
- package/dist/cli/chunks/{chunk-2ZFLULL4.js → chunk-5LAVKGLH.js} +2 -2
- package/dist/cli/chunks/chunk-5NNNEWLS.js +755 -0
- package/dist/cli/chunks/{chunk-JCZCJE6X.js → chunk-5PBLPQ5T.js} +2 -2
- package/dist/cli/chunks/chunk-5QO3R3TU.js +6 -0
- package/dist/cli/chunks/{chunk-EKP2SC77.js → chunk-5SPCGMBB.js} +2 -2
- package/dist/cli/chunks/{chunk-3J3RNJNX.js → chunk-5V3TI2LG.js} +1 -1
- package/dist/cli/chunks/{chunk-UAQZI6N4.js → chunk-5VZL4UVN.js} +2 -2
- package/dist/cli/chunks/{chunk-MIA447GY.js → chunk-63GMRQ25.js} +1 -1
- package/dist/cli/chunks/{chunk-TODNOP7C.js → chunk-63ZKI4PX.js} +6 -6
- package/dist/cli/chunks/{chunk-TZIHDJZD.js → chunk-67Z5R7RJ.js} +2 -2
- package/dist/cli/chunks/{chunk-WVXJ2QIG.js → chunk-6DPYNAOK.js} +2 -2
- package/dist/cli/chunks/{chunk-4HKAD25N.js → chunk-6ICX3FEG.js} +3 -3
- package/dist/cli/chunks/{chunk-BLL2XU7A.js → chunk-6XXZDV2C.js} +2 -2
- package/dist/cli/chunks/{chunk-R6LHJ7ME.js → chunk-6ZBXSOX6.js} +2 -2
- package/dist/cli/chunks/{chunk-5PTAFGJT.js → chunk-72XSEQMW.js} +2 -2
- package/dist/cli/chunks/{chunk-GKSMRBHU.js → chunk-7TE5ONQQ.js} +1 -1
- package/dist/cli/chunks/{chunk-UJABDXST.js → chunk-A5GBXCP5.js} +2 -2
- package/dist/cli/chunks/{chunk-22UKJGGN.js → chunk-AAMLQ2LF.js} +3 -3
- package/dist/cli/chunks/chunk-AG2EWGXS.js +21 -0
- package/dist/cli/chunks/{chunk-SZAZQZWI.js → chunk-AGRV5B3T.js} +2 -2
- package/dist/cli/chunks/{chunk-XH4JMX5O.js → chunk-AJMJNQMP.js} +1 -1
- package/dist/cli/chunks/{chunk-ZIPAB5J6.js → chunk-AR67RJPY.js} +2 -2
- package/dist/cli/chunks/{chunk-GGQGCT4Y.js → chunk-ASEOFRIG.js} +2 -2
- package/dist/cli/chunks/{chunk-AHMWD6JG.js → chunk-BEKDKVQT.js} +2 -2
- package/dist/cli/chunks/{chunk-W27AJ5B4.js → chunk-BY5OF7OH.js} +2 -2
- package/dist/cli/chunks/{chunk-T67R2MUN.js → chunk-C5FP5GW3.js} +2 -2
- package/dist/cli/chunks/{chunk-XHHWABJV.js → chunk-C6D5AHBO.js} +2 -2
- package/dist/cli/chunks/{chunk-PXATBHWN.js → chunk-CAKMOVZ6.js} +2 -2
- package/dist/cli/chunks/{chunk-337Z52QM.js → chunk-CEYSYSK5.js} +2 -2
- package/dist/cli/chunks/{chunk-KJBPB7P5.js → chunk-CGGUM2YJ.js} +2 -2
- package/dist/cli/chunks/{chunk-CAOUV5GZ.js → chunk-CJSHWQXP.js} +2 -2
- package/dist/cli/chunks/{chunk-GCHYOPRZ.js → chunk-CRPIYUTJ.js} +2 -2
- package/dist/cli/chunks/{chunk-RIRZHOS2.js → chunk-D6COXLYE.js} +2 -2
- package/dist/cli/chunks/{chunk-O6EWL5DQ.js → chunk-DTMAS2GB.js} +2 -2
- package/dist/cli/chunks/{chunk-XM6ZVFM5.js → chunk-DVYHMDFR.js} +470 -411
- package/dist/cli/chunks/chunk-DXD6K2ZP.js +3 -0
- package/dist/cli/chunks/{chunk-74YG72NQ.js → chunk-E3D4GPLP.js} +3 -3
- package/dist/cli/chunks/{chunk-KCQNFBBR.js → chunk-EA4YQVKS.js} +1 -1
- package/dist/cli/chunks/{chunk-4D4CWP72.js → chunk-EGYE5UPQ.js} +2 -2
- package/dist/cli/chunks/{chunk-DURD37JZ.js → chunk-EK7OLYOZ.js} +2 -2
- package/dist/cli/chunks/{chunk-DKX4GNRU.js → chunk-F742SZAX.js} +2 -2
- package/dist/cli/chunks/{chunk-JCQGJGGZ.js → chunk-FBDVGRSC.js} +1 -1
- package/dist/cli/chunks/{chunk-LVABQNRF.js → chunk-FDDC72IA.js} +2 -2
- package/dist/cli/chunks/{chunk-5AFVEWMT.js → chunk-FL64OUBA.js} +2 -2
- package/dist/cli/chunks/{chunk-5I7357KS.js → chunk-FLNAW7C4.js} +2 -2
- package/dist/cli/chunks/{chunk-BQ47GQPK.js → chunk-G5RHFBAY.js} +2 -2
- package/dist/cli/chunks/{chunk-XIVVTYM2.js → chunk-GAHNO6JJ.js} +2 -2
- package/dist/cli/chunks/{chunk-X33CWRDF.js → chunk-GFWHUQSF.js} +2 -2
- package/dist/cli/chunks/{chunk-VMAM46HQ.js → chunk-GJYHWYXR.js} +2 -2
- package/dist/cli/chunks/{chunk-ZYJB6FML.js → chunk-GQ6TUIKY.js} +1 -1
- package/dist/cli/chunks/{chunk-E56PVVWC.js → chunk-GSKMOPL7.js} +2 -2
- package/dist/cli/chunks/{chunk-JUDUBQHA.js → chunk-HCH4Y6XX.js} +2 -2
- package/dist/cli/chunks/{chunk-QFGYH6HD.js → chunk-HGWXF45W.js} +1 -1
- package/dist/cli/chunks/{chunk-FTRSS64D.js → chunk-HJ6ZGVTB.js} +2 -2
- package/dist/cli/chunks/{chunk-6BRQPHMZ.js → chunk-HLUXXCHF.js} +1 -1
- package/dist/cli/chunks/{chunk-BP5T3OEV.js → chunk-HVRRLYX6.js} +4 -4
- package/dist/cli/chunks/{chunk-AOKKUB5F.js → chunk-I7MQIM2U.js} +1 -1
- package/dist/cli/chunks/{chunk-7XB3FCKM.js → chunk-IESR7TNB.js} +2 -2
- package/dist/cli/chunks/{chunk-OQG3UQQ7.js → chunk-IHRXZZQM.js} +1 -1
- package/dist/cli/chunks/{chunk-YUS6TWAL.js → chunk-IOKYCMTJ.js} +6 -6
- package/dist/cli/chunks/{chunk-ERN56H6S.js → chunk-IOQ6ZQ5W.js} +1 -1
- package/dist/cli/chunks/{chunk-GQABPCQE.js → chunk-IOYG4VFL.js} +2 -2
- package/dist/cli/chunks/{chunk-KLTMOXIK.js → chunk-IUBJVHNB.js} +2 -2
- package/dist/cli/chunks/{chunk-ZSOMUTNL.js → chunk-J442IZLE.js} +1 -1
- package/dist/cli/chunks/{chunk-G242G224.js → chunk-J4ELZNLY.js} +2 -2
- package/dist/cli/chunks/chunk-J7I6PABJ.js +153 -0
- package/dist/cli/chunks/chunk-JDIYMZCQ.js +2 -0
- package/dist/cli/chunks/{chunk-2IIXCEMS.js → chunk-JHQCRRJI.js} +2 -2
- package/dist/cli/chunks/{chunk-6LE362LZ.js → chunk-JQ3DYUMS.js} +2 -2
- package/dist/cli/chunks/{chunk-EFUJDMNC.js → chunk-KITOPKRG.js} +2 -2
- package/dist/cli/chunks/{chunk-M4CJCPCQ.js → chunk-KKU2QGSJ.js} +2 -2
- package/dist/cli/chunks/chunk-KL7OKSU2.js +4 -0
- package/dist/cli/chunks/{chunk-HL2ANKN3.js → chunk-KNSRL6NO.js} +2 -2
- package/dist/cli/chunks/{chunk-FOOW4JVS.js → chunk-KPRCB5LT.js} +2 -2
- package/dist/cli/chunks/{chunk-E5G4WZ2T.js → chunk-KQYJ4VQ5.js} +1 -1
- package/dist/cli/chunks/{chunk-RBKUU7WF.js → chunk-KU2AUFGX.js} +2 -2
- package/dist/cli/chunks/{chunk-UQPA33UK.js → chunk-KVF4NXGQ.js} +2 -2
- package/dist/cli/chunks/{chunk-BDKEAGQ2.js → chunk-KXCLACFG.js} +2 -2
- package/dist/cli/chunks/{chunk-K3WZICFA.js → chunk-L2DWPVNJ.js} +1 -1
- package/dist/cli/chunks/{chunk-6YVMX2TC.js → chunk-L6QSTQME.js} +2 -2
- package/dist/cli/chunks/{chunk-LJMYRTJ7.js → chunk-LE4QJREF.js} +1 -1
- package/dist/cli/chunks/{chunk-NWIIYHT6.js → chunk-LKTTUHLF.js} +2 -2
- package/dist/cli/chunks/{chunk-W5ZJG2OU.js → chunk-LQLPB2T6.js} +2 -2
- package/dist/cli/chunks/{chunk-JKJOB65O.js → chunk-LRSX2FJM.js} +1 -1
- package/dist/cli/chunks/chunk-M4FRQ4TE.js +12 -0
- package/dist/cli/chunks/chunk-M7WJCTG3.js +2 -0
- package/dist/cli/chunks/{chunk-6RBTS3NF.js → chunk-MAFQV4U4.js} +2 -2
- package/dist/cli/chunks/{chunk-UE2J6MA5.js → chunk-MD43XRX5.js} +1 -1
- package/dist/cli/chunks/{chunk-2CKERSMB.js → chunk-MI5MFHRA.js} +2 -2
- package/dist/cli/chunks/{chunk-T66PPF4D.js → chunk-MO55CVMT.js} +32 -32
- package/dist/cli/chunks/{chunk-C4KLXFJP.js → chunk-N7HL5PHH.js} +1 -1
- package/dist/cli/chunks/chunk-NAEWCFQT.js +14 -0
- package/dist/cli/chunks/{chunk-U62OUXBF.js → chunk-NDJ7P2EP.js} +1 -1
- package/dist/cli/chunks/{chunk-M4WMSCAE.js → chunk-NO3IV5Q5.js} +1 -1
- package/dist/cli/chunks/{chunk-27HE2BHC.js → chunk-NQXXI77K.js} +2 -2
- package/dist/cli/chunks/{chunk-NQS3BWS6.js → chunk-NVEWF4JV.js} +1 -1
- package/dist/cli/chunks/{chunk-EBTNMQSS.js → chunk-NZU4ACBZ.js} +2 -2
- package/dist/cli/chunks/chunk-O5W3FIO6.js +63 -0
- package/dist/cli/chunks/{chunk-BFQTLF5X.js → chunk-OAEE6JWQ.js} +2 -2
- package/dist/cli/chunks/{chunk-PS6UMZVK.js → chunk-OCV2XEWQ.js} +2 -2
- package/dist/cli/chunks/{chunk-BU4UQR36.js → chunk-P3EYRILV.js} +2 -2
- package/dist/cli/chunks/{chunk-LHMQIZ6B.js → chunk-PEQDY4BO.js} +2 -2
- package/dist/cli/chunks/{chunk-PYPS65P7.js → chunk-PF7RBAYL.js} +2 -2
- package/dist/cli/chunks/{chunk-UXIY4IAI.js → chunk-PHT5N7SC.js} +2 -2
- package/dist/cli/chunks/{chunk-GV2QE5TO.js → chunk-PINSJCM3.js} +1 -1
- package/dist/cli/chunks/{chunk-4X3SWKBA.js → chunk-PPUZWYUG.js} +2 -2
- package/dist/cli/chunks/{chunk-L32JNNKL.js → chunk-QPEOLAAS.js} +1 -1
- package/dist/cli/chunks/{chunk-UUBIQR6A.js → chunk-QQWBWEJS.js} +18 -18
- package/dist/cli/chunks/{chunk-VCXI4XC4.js → chunk-QVDCVD5D.js} +2 -2
- package/dist/cli/chunks/{chunk-JW74KRBC.js → chunk-RJIEG3NA.js} +2 -2
- package/dist/cli/chunks/{chunk-C4RTAVC6.js → chunk-RV74I3YO.js} +2 -2
- package/dist/cli/chunks/{chunk-5G4UFTV4.js → chunk-S75SOOZL.js} +2 -2
- package/dist/cli/chunks/{chunk-MV55NXTD.js → chunk-SASBO5Y5.js} +2 -2
- package/dist/cli/chunks/{chunk-UORB2QDU.js → chunk-SDLWKRVL.js} +2 -2
- package/dist/cli/chunks/{chunk-Y2OX6KGN.js → chunk-SHKOCGNK.js} +2 -2
- package/dist/cli/chunks/{chunk-6KCSKGVY.js → chunk-SI6DPU5D.js} +1 -1
- package/dist/cli/chunks/{chunk-LYJHUNBK.js → chunk-SJ6Y4725.js} +2 -2
- package/dist/cli/chunks/{chunk-7ACCBHRB.js → chunk-SR52XP5F.js} +1 -1
- package/dist/cli/chunks/{chunk-C5CXL3JP.js → chunk-SSUAAX3F.js} +2 -2
- package/dist/cli/chunks/{chunk-BBRROA3Z.js → chunk-SSYAQZXA.js} +2 -2
- package/dist/cli/chunks/{chunk-DUKE27HC.js → chunk-SUDMM5SO.js} +2 -2
- package/dist/cli/chunks/{chunk-H5DER3JY.js → chunk-TIUKLYAI.js} +1 -1
- package/dist/cli/chunks/{chunk-5C62XMJR.js → chunk-TVGI32MB.js} +33 -33
- package/dist/cli/chunks/{chunk-MPFPWJTH.js → chunk-U2A7NHZA.js} +2 -2
- package/dist/cli/chunks/{chunk-TX2CHQD7.js → chunk-UE5ZOZR2.js} +2 -2
- package/dist/cli/chunks/{chunk-OLZH5LRT.js → chunk-UHEOGZLX.js} +11 -11
- package/dist/cli/chunks/chunk-UNGBRZDK.js +12 -0
- package/dist/cli/chunks/{chunk-XWIAZG3C.js → chunk-V5NHZV7S.js} +2 -2
- package/dist/cli/chunks/{chunk-AP2W7Z3A.js → chunk-VJCIEHEF.js} +1 -1
- package/dist/cli/chunks/{chunk-K3XBQC3R.js → chunk-VMDFFTCK.js} +1 -1
- package/dist/cli/chunks/chunk-VSIKHWZ4.js +29 -0
- package/dist/cli/chunks/{chunk-LB2LGEDP.js → chunk-VWPM27GU.js} +2 -2
- package/dist/cli/chunks/{chunk-HTZSRMHW.js → chunk-VXFLJNCA.js} +2 -2
- package/dist/cli/chunks/{chunk-73PBAWAF.js → chunk-W5HQUIML.js} +2 -2
- package/dist/cli/chunks/{chunk-DEKR3CTS.js → chunk-WP4RETKG.js} +2 -2
- package/dist/cli/chunks/{chunk-ZWBGYJ7K.js → chunk-XIIQ5QTT.js} +2 -2
- package/dist/cli/chunks/{chunk-TDQWTSBS.js → chunk-XIQW7EFL.js} +2 -2
- package/dist/cli/chunks/{chunk-AKZO6GGG.js → chunk-XWUWX7BV.js} +4 -4
- package/dist/cli/chunks/{chunk-LNX74WHQ.js → chunk-Y4PFUMOU.js} +1 -1
- package/dist/cli/chunks/chunk-YAPLJR7K.js +2 -0
- package/dist/cli/chunks/{chunk-3CYNZFKH.js → chunk-YLMNVLDK.js} +1 -1
- package/dist/cli/chunks/{chunk-XG4F4XH4.js → chunk-YNMJEDN5.js} +2 -2
- package/dist/cli/chunks/{chunk-RDMRY7CT.js → chunk-YPBSUGMI.js} +1 -1
- package/dist/cli/chunks/{chunk-OBDONJQM.js → chunk-YRAX7SFJ.js} +2 -2
- package/dist/cli/chunks/{chunk-7BLZHFKD.js → chunk-YTHTQPWR.js} +1 -1
- package/dist/cli/chunks/{chunk-IXL5ZHWJ.js → chunk-YU2BDRSD.js} +1 -1
- package/dist/cli/chunks/chunk-ZB3LEFYG.js +2 -0
- package/dist/cli/chunks/{chunk-T4GE7MPI.js → chunk-ZFL436FN.js} +2 -2
- package/dist/cli/chunks/{chunk-CBK5CT6T.js → chunk-ZJH5MU2I.js} +2 -2
- package/dist/cli/chunks/{chunk-LTQVUAPH.js → chunk-ZQ2XW3IP.js} +2 -2
- package/dist/cli/chunks/chunk-ZR2TKVXQ.js +14 -0
- package/dist/cli/chunks/{ci-UCUJOSBW.js → ci-MFUR4CWV.js} +2 -2
- package/dist/cli/chunks/{ci-config-2XILD3XG.js → ci-config-PNDLQ6XV.js} +2 -2
- package/dist/cli/chunks/{ci-output-BL6KWOHW.js → ci-output-PFZ4M7NC.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-5XLIOXE5.js → circuit-breaker-5HH6NLZN.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-4IMP6ACS.js → claude-flow-setup-QCKYLGLC.js} +2 -2
- package/dist/cli/chunks/client-MHQRTZM4.js +2 -0
- package/dist/cli/chunks/{cline-installer-RYLHCDK7.js → cline-installer-EASVPFXR.js} +2 -2
- package/dist/cli/chunks/{code-WY3GJXHX.js → code-UJXDVYRK.js} +4 -3
- package/dist/cli/chunks/{code-index-extractor-Y4MZBZCW.js → code-index-extractor-BZJ3UDP4.js} +2 -2
- package/dist/cli/chunks/{codex-installer-SCJ3T3DX.js → codex-installer-XSQZUVOZ.js} +2 -2
- package/dist/cli/chunks/{completions-CN2DXQFU.js → completions-OWOOJFI2.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-7MDPPIBH.js → complexity-analyzer-KP5TOHDT.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-GCEJRK34.js → continuedev-installer-IFKQXLHM.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-BHPDSELY.js → copilot-installer-IGJ6KGQY.js} +2 -2
- package/dist/cli/chunks/core-handlers-UAK3LLJE.js +2 -0
- package/dist/cli/chunks/{cost-tracker-VO5MFWR6.js → cost-tracker-MMDDNKZB.js} +2 -2
- package/dist/cli/chunks/{coverage-LYFQYNH6.js → coverage-LUH2B7NT.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +2 -0
- package/dist/cli/chunks/{cursor-installer-KP4HA7TV.js → cursor-installer-4YLM5GWM.js} +2 -2
- package/dist/cli/chunks/daemon-CAVZ7OFV.js +18 -0
- package/dist/cli/chunks/{daemon-7RC7TS57.js → daemon-MZKVM4CJ.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-NKA44RSR.js → dag-attention-scheduler-X4CYW665.js} +2 -2
- package/dist/cli/chunks/{detect-CMYAJWYF.js → detect-7BM2XINO.js} +2 -2
- package/dist/cli/chunks/{dist-node-EN3PYEGW.js → dist-node-Y5APLEYB.js} +2 -2
- package/dist/cli/chunks/{domain-handler-EXSZCX7A.js → domain-handler-X3ZRJNAH.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-HCQFSNL7.js → domain-plugins-2UW5KQJB.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-3LGSNTPO.js → domain-transfer-35W4CIBV.js} +2 -2
- package/dist/cli/chunks/dream-EJY24JN6.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +3 -0
- package/dist/cli/chunks/embedding-space-SBM2MZD2.js +2 -0
- package/dist/cli/chunks/{eval-OQELIWJK.js → eval-4QA2SROK.js} +2 -2
- package/dist/cli/chunks/experience-capture-middleware-Z6BF6KYM.js +40 -0
- package/dist/cli/chunks/{fast-paths-UV4NDEWM.js → fast-paths-FIORX6GN.js} +2 -2
- package/dist/cli/chunks/{feature-flags-CKTYX67J.js → feature-flags-6LYI2T4G.js} +2 -2
- package/dist/cli/chunks/{feature-flags-H7H33B6C.js → feature-flags-ZOO7LMIC.js} +2 -2
- package/dist/cli/chunks/file-discovery-UZSFSS4V.js +2 -0
- package/dist/cli/chunks/{fleet-ZJBCAKRG.js → fleet-7WF53H4F.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-RUE2QZRG.js → gnn-wrapper-KJ6B7BRM.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-XRV327M7.js → heartbeat-handler-DEKKMOVW.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +2 -0
- package/dist/cli/chunks/hnsw-index-POCPMVJH.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-UJID6ZZ4.js → hnsw-legacy-bridge-L27WS27N.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-WS43R4AX.js → hnswlib-node-4YOQC6L4.js} +2 -2
- package/dist/cli/chunks/{hooks-YZNJKXAJ.js → hooks-TAOKV4EJ.js} +23 -22
- package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-XQJSIMTS.js → hypergraph-engine-BODRJLHL.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-ZD2NYXMR.js → hypergraph-handler-RKMYJNTU.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +2 -0
- package/dist/cli/chunks/{init-guard-DSRUAVRT.js → init-guard-MXHSLSB2.js} +2 -2
- package/dist/cli/chunks/{init-handler-RJU5QMAP.js → init-handler-HUE57IFW.js} +6 -6
- package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +2 -0
- package/dist/cli/chunks/kernel-CCDWT7KS.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-BCPOCVMC.js → kilocode-installer-S333IKYQ.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-GFCWCB2S.js → kiro-installer-WM5DLQWC.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +2 -0
- package/dist/cli/chunks/{learning-FZTD72CF.js → learning-LNHMQLH5.js} +3 -3
- package/dist/cli/chunks/{llm-router-GJVKGRJL.js → llm-router-EWFXYZZR.js} +4 -4
- package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +2 -0
- package/dist/cli/chunks/{load-YKTPOYBE.js → load-FGYGWVDK.js} +2 -2
- package/dist/cli/chunks/load-test-UNZUWY3F.js +2 -0
- package/dist/cli/chunks/{mcp-LT6R2IKS.js → mcp-2FHNAAOM.js} +2 -2
- package/dist/cli/chunks/{memory-4HKKOLRY.js → memory-DZMQ73AB.js} +5 -5
- package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +2 -0
- package/dist/cli/chunks/memory-handlers-MP426XRJ.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-2YPM2WTK.js → multi-model-executor-6F2UAEUW.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-WBAJMH5K.js → opencode-installer-XY3BGOTZ.js} +2 -2
- package/dist/cli/chunks/{orchestrator-5W5WVMVJ.js → orchestrator-B4CNKUOS.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-GXRMNPAZ.js → pattern-usage-recorder-R4GUFNMD.js} +2 -2
- package/dist/cli/chunks/{pipeline-2NA4DRDA.js → pipeline-FG5RKVRO.js} +2 -2
- package/dist/cli/chunks/{platform-BGERNQ5V.js → platform-3BT4KEVJ.js} +2 -2
- package/dist/cli/chunks/{plugin-L4EPVENR.js → plugin-WI4RIN7O.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-RTQRTPTM.js → prime-radiant-advanced-wasm-7ECDNQFS.js} +2 -2
- package/dist/cli/chunks/project-root-BEANNYWU.js +2 -0
- package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +2 -0
- package/dist/cli/chunks/{protocol-handler-SYQXM6JK.js → protocol-handler-WNODKPGW.js} +2 -2
- package/dist/cli/chunks/{prove-5O7GPJCU.js → prove-5RHAEPYZ.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +2 -0
- package/dist/cli/chunks/{quality-KIIDHGNF.js → quality-WPHR7BGQ.js} +2 -2
- package/dist/cli/chunks/{quality-gate-H65VECD3.js → quality-gate-4RKTEZMX.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +2 -0
- package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +2 -0
- package/dist/cli/chunks/{ref-validation-CSBJOMZM.js → ref-validation-TPAWHOHH.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-G7OVYXEN.js → roocode-installer-7AVHFNDI.js} +2 -2
- package/dist/cli/chunks/router-EP34O3KB.js +2 -0
- package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +2 -0
- package/dist/cli/chunks/{routing-handler-ZNZPPI5Y.js → routing-handler-YKEDVJSH.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-C6IG3OY3.js → ruvector-commands-JUAMM354.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-3G6LFLT3.js → rvf-store-integrity-VJDUIRTX.js} +2 -2
- package/dist/cli/chunks/safe-db-TCAU4FUT.js +2 -0
- package/dist/cli/chunks/schedule-NB5KV435.js +2 -0
- package/dist/cli/chunks/scheduler-JKXGKVK6.js +2 -0
- package/dist/cli/chunks/{security-A3IMVLFM.js → security-ORDN3RD2.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-VHWQ6US5.js → shared-rvf-adapter-CF4BCIO7.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-JB3QS7IG.js → shared-rvf-dual-writer-C32UBR6D.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +2 -0
- package/dist/cli/chunks/{standalone-memory-DDNXCSBD.js → standalone-memory-OXRJYZXN.js} +2 -2
- package/dist/cli/chunks/{status-handler-2HK7XPEK.js → status-handler-BCX5D4HY.js} +2 -2
- package/dist/cli/chunks/{structural-health-DSJVLEPV.js → structural-health-LFG7RUU6.js} +2 -2
- package/dist/cli/chunks/sync-OSF7C2NL.js +2 -0
- package/dist/cli/chunks/{sync-NTUR53PI.js → sync-YJEE2K2L.js} +2 -2
- package/dist/cli/chunks/task-handler-6LXKPTXJ.js +64 -0
- package/dist/cli/chunks/{task-handlers-VJR6EHRZ.js → task-handlers-CILP36I7.js} +4 -4
- package/dist/cli/chunks/{test-O6FK3FVF.js → test-SD457QJ6.js} +4 -4
- package/dist/cli/chunks/test-runner-process-VKD65QQU.js +2 -0
- package/dist/cli/chunks/{test-scheduling-Q6QEEOS6.js → test-scheduling-ISI2O4Q5.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +2 -0
- package/dist/cli/chunks/{token-usage-YEEFWSSI.js → token-usage-XOC5KG7S.js} +2 -2
- package/dist/cli/chunks/{transformers-BZCHJJJT.js → transformers-LSLQAARK.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +2 -0
- package/dist/cli/chunks/{types-4AOKZYOX.js → types-5BLCGLCR.js} +2 -2
- package/dist/cli/chunks/unified-memory-GI76TXFV.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +2 -0
- package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +2 -0
- package/dist/cli/chunks/{upgrade-2MWW6BT2.js → upgrade-RQJYLK3J.js} +2 -2
- package/dist/cli/chunks/{validate-PAEV3GT5.js → validate-QBHWXXCK.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-ZIXACK5K.js → validate-swarm-IKXBKFB5.js} +2 -2
- package/dist/cli/chunks/visual-security-GZ2MOKWB.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-VLTXZFAB.js → web-tree-sitter-ZF6FIE5R.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-VELMLOZF.js → windsurf-installer-HQGDZT5D.js} +2 -2
- package/dist/cli/chunks/witness-chain-DCHCAMSQ.js +2 -0
- package/dist/cli/chunks/witness-chain-P3XXXA62.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-MIDWD4JS.js → witness-chain-verifier-PX2OQ6XT.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-OSVCWOB2.js → witness-key-manager-RXYQNFJB.js} +2 -2
- package/dist/cli/chunks/{workflow-MK7A7QCX.js → workflow-FBKCA4H6.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +2 -0
- package/dist/cli/chunks/wrappers-TWSKBTWD.js +2 -0
- package/dist/cli/commands/code.js +4 -0
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +10 -2
- package/dist/cli/handlers/task-handler.d.ts +5 -0
- package/dist/cli/handlers/task-handler.js +21 -1
- package/dist/cli/utils/task-result.d.ts +11 -0
- package/dist/cli/utils/task-result.js +39 -0
- package/dist/coordination/handlers/test-execution-handlers.js +92 -58
- package/dist/coordination/mincut/mincut-persistence.js +29 -25
- package/dist/domains/code-intelligence/coordinator.d.ts +4 -0
- package/dist/domains/code-intelligence/coordinator.js +46 -13
- package/dist/domains/code-intelligence/interfaces.d.ts +10 -1
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +32 -7
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +112 -53
- package/dist/domains/learning-optimization/services/learning-coordinator.js +1 -1
- package/dist/domains/quality-assessment/coordinator.js +2 -1
- package/dist/domains/test-execution/coordinator.js +10 -5
- package/dist/domains/test-execution/interfaces.d.ts +12 -0
- package/dist/domains/test-execution/plugin.js +6 -2
- package/dist/domains/test-execution/services/retry-handler.d.ts +2 -0
- package/dist/domains/test-execution/services/retry-handler.js +14 -9
- package/dist/domains/test-execution/services/test-executor.d.ts +1 -0
- package/dist/domains/test-execution/services/test-executor.js +28 -9
- package/dist/domains/visual-accessibility/coordinator.d.ts +15 -7
- package/dist/domains/visual-accessibility/coordinator.js +15 -7
- package/dist/domains/visual-accessibility/interfaces.d.ts +27 -3
- package/dist/domains/visual-accessibility/services/accessibility-contrast.d.ts +39 -0
- package/dist/domains/visual-accessibility/services/accessibility-contrast.js +93 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.d.ts +18 -3
- package/dist/domains/visual-accessibility/services/accessibility-tester-browser.js +50 -40
- package/dist/domains/visual-accessibility/services/accessibility-tester-checks.d.ts +27 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester-checks.js +137 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.d.ts +5 -0
- package/dist/domains/visual-accessibility/services/accessibility-tester.js +43 -24
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.d.ts +2 -3
- package/dist/domains/visual-accessibility/services/browser-swarm-coordinator.js +8 -14
- package/dist/feedback/coverage-learner.js +13 -9
- package/dist/feedback/test-outcome-tracker.js +13 -9
- package/dist/governance/witness-chain.d.ts +5 -0
- package/dist/governance/witness-chain.js +22 -6
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.d.ts +22 -0
- package/dist/integrations/agentic-flow/reasoning-bank/experience-replay.js +115 -45
- package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.d.ts +6 -0
- package/dist/integrations/agentic-flow/reasoning-bank/pattern-evolution.js +51 -33
- package/dist/integrations/agentic-flow/reasoning-bank/trajectory-tracker.js +17 -9
- package/dist/integrations/embeddings/cache/EmbeddingCache.d.ts +8 -0
- package/dist/integrations/embeddings/cache/EmbeddingCache.js +24 -10
- package/dist/integrations/ruvector/delta-tracker.d.ts +11 -0
- package/dist/integrations/ruvector/delta-tracker.js +16 -0
- package/dist/integrations/ruvector/sona-persistence.d.ts +10 -0
- package/dist/integrations/ruvector/sona-persistence.js +49 -24
- package/dist/kernel/unified-memory.d.ts +24 -0
- package/dist/kernel/unified-memory.js +63 -8
- package/dist/learning/aqe-learning-engine.js +1 -1
- package/dist/learning/embed-and-insert-pattern.js +4 -2
- package/dist/learning/embedder-endpoint-client.d.ts +31 -0
- package/dist/learning/embedder-endpoint-client.js +103 -10
- package/dist/learning/embedding-space.d.ts +12 -0
- package/dist/learning/embedding-space.js +17 -0
- package/dist/learning/experience-capture-middleware.js +25 -13
- package/dist/learning/experience-capture.js +1 -1
- package/dist/learning/experience-consolidation.d.ts +18 -0
- package/dist/learning/experience-consolidation.js +55 -8
- package/dist/learning/experience-space-verification.d.ts +71 -0
- package/dist/learning/experience-space-verification.js +147 -0
- package/dist/learning/pattern-lifecycle.d.ts +40 -4
- package/dist/learning/pattern-lifecycle.js +153 -76
- package/dist/learning/pattern-null-store.d.ts +5 -0
- package/dist/learning/pattern-null-store.js +8 -0
- package/dist/learning/pattern-promotion.js +6 -3
- package/dist/learning/pattern-store.d.ts +6 -0
- package/dist/learning/pattern-store.js +19 -6
- package/dist/learning/qe-reasoning-bank.js +2 -2
- package/dist/learning/real-embeddings.js +3 -1
- package/dist/learning/real-qe-reasoning-bank.d.ts +5 -0
- package/dist/learning/real-qe-reasoning-bank.js +77 -47
- package/dist/learning/rvf-pattern-store.js +6 -2
- package/dist/learning/sqlite-persistence.d.ts +6 -0
- package/dist/learning/sqlite-persistence.js +10 -0
- package/dist/mcp/bundle.js +641 -570
- package/dist/mcp/entry.js +4 -0
- package/dist/mcp/handlers/domain-handler-configs.js +2 -0
- package/dist/mcp/handlers/trajectory-judge.js +1 -1
- package/dist/mcp/protocol-server.js +1 -0
- package/dist/mcp/tools/visual-accessibility/index.js +8 -2
- package/dist/mcp/types.d.ts +6 -0
- package/dist/optimization/session-cache.d.ts +17 -1
- package/dist/optimization/session-cache.js +40 -36
- package/dist/planning/goap-planner.d.ts +6 -0
- package/dist/planning/goap-planner.js +35 -19
- package/dist/planning/plan-executor.js +24 -15
- package/dist/routing/co-execution-repository.js +12 -9
- package/dist/routing/routing-feedback.d.ts +8 -0
- package/dist/routing/routing-feedback.js +46 -24
- package/dist/routing/routing-outcomes-migration.js +7 -2
- package/dist/shared/llm/spend-ledger.d.ts +9 -0
- package/dist/shared/llm/spend-ledger.js +64 -39
- package/dist/shared/sqlite-lock-wait.d.ts +27 -0
- package/dist/shared/sqlite-lock-wait.js +37 -0
- package/dist/shared/sqlite-write-queue.d.ts +28 -0
- package/dist/shared/sqlite-write-queue.js +38 -0
- package/dist/shared/test-runner-project.d.ts +69 -0
- package/dist/shared/test-runner-project.js +186 -0
- package/dist/skills/security-visual-testing/index.d.ts +3 -1
- package/dist/skills/security-visual-testing/index.js +49 -35
- package/dist/skills/security-visual-testing/types.d.ts +19 -3
- package/dist/workers/workers/heartbeat-scheduler.js +5 -5
- package/dist/workers/workers/learning-consolidation.js +8 -7
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-QU6INSKP.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-PAJPENJD.js +0 -2
- package/dist/cli/chunks/base-OTGSN6IC.js +0 -2
- package/dist/cli/chunks/browser-workflow-WLZGR6SB.js +0 -2
- package/dist/cli/chunks/chunk-2LUTPMBO.js +0 -21
- package/dist/cli/chunks/chunk-3HVFIITW.js +0 -2
- package/dist/cli/chunks/chunk-5KA5TVPR.js +0 -6
- package/dist/cli/chunks/chunk-6NBRMD25.js +0 -13
- package/dist/cli/chunks/chunk-7O45RQHF.js +0 -153
- package/dist/cli/chunks/chunk-EMSZVUYA.js +0 -29
- package/dist/cli/chunks/chunk-G6RDCCFV.js +0 -4
- package/dist/cli/chunks/chunk-HH4ED4F7.js +0 -744
- package/dist/cli/chunks/chunk-Q6I4SIUU.js +0 -65
- package/dist/cli/chunks/chunk-QGBGSQ2E.js +0 -14
- package/dist/cli/chunks/chunk-QRKTBSZT.js +0 -27
- package/dist/cli/chunks/chunk-SHRI7TKJ.js +0 -62
- package/dist/cli/chunks/chunk-UGYM4U44.js +0 -2
- package/dist/cli/chunks/chunk-VY4U6DPO.js +0 -12
- package/dist/cli/chunks/chunk-WNTA4YKE.js +0 -14
- package/dist/cli/chunks/chunk-XHLYGXYE.js +0 -2
- package/dist/cli/chunks/client-KKRNPX4F.js +0 -2
- package/dist/cli/chunks/core-handlers-47MPMED7.js +0 -2
- package/dist/cli/chunks/cross-domain-router-U6MBFHEC.js +0 -2
- package/dist/cli/chunks/daemon-AXLVPKVO.js +0 -18
- package/dist/cli/chunks/dream-76L6EEN7.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-B6MNHICW.js +0 -3
- package/dist/cli/chunks/experience-capture-middleware-SUFILYPW.js +0 -40
- package/dist/cli/chunks/file-discovery-VSFKZ3LJ.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-NIK3KKEH.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-WJG7LUJJ.js +0 -2
- package/dist/cli/chunks/hnsw-index-D6PRI5HC.js +0 -2
- package/dist/cli/chunks/hybrid-backend-RIUR3I7F.js +0 -2
- package/dist/cli/chunks/impact-analyzer-C36YYTJ5.js +0 -2
- package/dist/cli/chunks/init-wizard-JCKNGIGT.js +0 -2
- package/dist/cli/chunks/kernel-F7ILJTYD.js +0 -2
- package/dist/cli/chunks/knowledge-graph-VTXDBHB2.js +0 -2
- package/dist/cli/chunks/llm-router-service-TNOWQINA.js +0 -2
- package/dist/cli/chunks/load-test-FPVBK2EV.js +0 -2
- package/dist/cli/chunks/memory-backend-2QE7O67A.js +0 -2
- package/dist/cli/chunks/memory-handlers-X4CMVBXB.js +0 -2
- package/dist/cli/chunks/pattern-null-store-UI35ORHW.js +0 -2
- package/dist/cli/chunks/project-root-S7WDFTMU.js +0 -2
- package/dist/cli/chunks/protocol-executor-OPANXQVB.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-3OTF4DYQ.js +0 -2
- package/dist/cli/chunks/queen-coordinator-WTYH4TAN.js +0 -2
- package/dist/cli/chunks/real-embeddings-DYIOLKQ3.js +0 -2
- package/dist/cli/chunks/router-DBBW4NC2.js +0 -2
- package/dist/cli/chunks/routing-feedback-W35QHCL4.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-X3NSL25Z.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-TZR7GDOK.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-4ATTHGHD.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-HD25ZYV5.js +0 -2
- package/dist/cli/chunks/safe-db-ZS2QKANY.js +0 -2
- package/dist/cli/chunks/schedule-ZH6VNA32.js +0 -2
- package/dist/cli/chunks/scheduler-T6CD74B6.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-47WU5EKZ.js +0 -2
- package/dist/cli/chunks/sync-3MUV6S5E.js +0 -2
- package/dist/cli/chunks/task-handler-74MZN2EO.js +0 -62
- package/dist/cli/chunks/test-runner-process-2NPW3UDQ.js +0 -2
- package/dist/cli/chunks/token-bootstrap-TTRCECLP.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-RZAND65G.js +0 -2
- package/dist/cli/chunks/unified-memory-FZ5K2C7W.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-VREWX56M.js +0 -2
- package/dist/cli/chunks/unified-persistence-YZGMKX6B.js +0 -2
- package/dist/cli/chunks/visual-security-GXGSFBVA.js +0 -2
- package/dist/cli/chunks/witness-chain-MRJKVCOW.js +0 -2
- package/dist/cli/chunks/witness-chain-WWHJKITG.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-5SAXPETG.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-SG7DV72E.js +0 -2
- package/dist/cli/chunks/wrappers-5QFMCKXL.js +0 -2
|
@@ -14,8 +14,9 @@
|
|
|
14
14
|
*/
|
|
15
15
|
import { v4 as uuidv4 } from 'uuid';
|
|
16
16
|
import { getUnifiedMemory } from '../../../kernel/unified-memory.js';
|
|
17
|
-
import { computeRealEmbedding, cosineSimilarity, } from '../../../learning/real-embeddings.js';
|
|
17
|
+
import { computeRealEmbedding, cosineSimilarity, getActiveEmbeddingSpaceIdentity, } from '../../../learning/real-embeddings.js';
|
|
18
18
|
import { EmbedderRecovery, probeEmbedder } from '../../../learning/embedder-recovery.js';
|
|
19
|
+
import { verifyLegacyExperienceSpaces } from '../../../learning/experience-space-verification.js';
|
|
19
20
|
import { CircularBuffer } from '../../../shared/utils/circular-buffer.js';
|
|
20
21
|
import { HNSWEmbeddingIndex } from '../../embeddings/index/HNSWIndex.js';
|
|
21
22
|
import { safeJsonParse } from '../../../shared/safe-json.js';
|
|
@@ -74,6 +75,12 @@ export class ExperienceReplay {
|
|
|
74
75
|
idToExperienceId = new Map();
|
|
75
76
|
experienceIdToHnswId = new Map();
|
|
76
77
|
nextHnswId = 0;
|
|
78
|
+
/**
|
|
79
|
+
* #1217: embedding space the HNSW index holds vectors of. The index only
|
|
80
|
+
* holds vectors of one space, so a similarity is never measured across
|
|
81
|
+
* spaces. Null until the embedder's space is known.
|
|
82
|
+
*/
|
|
83
|
+
indexSpaceId = null;
|
|
77
84
|
// Recent experiences buffer
|
|
78
85
|
recentExperiences;
|
|
79
86
|
// Reservoir replay buffer (R10, ADR-087) — coherence-gated admission
|
|
@@ -130,7 +137,7 @@ export class ExperienceReplay {
|
|
|
130
137
|
// Prepare statements
|
|
131
138
|
this.prepareStatements();
|
|
132
139
|
// Load embeddings into memory index
|
|
133
|
-
await this.loadEmbeddingIndex();
|
|
140
|
+
await this.loadEmbeddingIndex(getActiveEmbeddingSpaceIdentity()?.spaceId ?? null);
|
|
134
141
|
// Backfill missing embeddings on captured_experiences. Hook-side INSERT
|
|
135
142
|
// paths (sources: cli-hook-post-command, patch-060-post-task, etc.)
|
|
136
143
|
// bypass storeExperience() and never call computeRealEmbedding(),
|
|
@@ -149,7 +156,7 @@ export class ExperienceReplay {
|
|
|
149
156
|
return;
|
|
150
157
|
const updateStmt = this.db.prepare(`
|
|
151
158
|
UPDATE captured_experiences
|
|
152
|
-
SET embedding = ?, embedding_dimension = ?
|
|
159
|
+
SET embedding = ?, embedding_dimension = ?, embedding_space_id = ?
|
|
153
160
|
WHERE id = ?
|
|
154
161
|
`);
|
|
155
162
|
let written = 0;
|
|
@@ -157,21 +164,15 @@ export class ExperienceReplay {
|
|
|
157
164
|
// ADR-099: legacy rows may predate ingestion-time scrubbing
|
|
158
165
|
const text = scrubReasoningBlocks(`${row.domain ?? ''}: ${row.task}`).slice(0, 512);
|
|
159
166
|
const embedding = await computeRealEmbedding(text);
|
|
167
|
+
const spaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
|
|
168
|
+
// ADR-097: a vector without provenance would never be compared.
|
|
169
|
+
if (!spaceId)
|
|
170
|
+
break;
|
|
160
171
|
const buf = Buffer.from(new Float32Array(embedding).buffer);
|
|
161
|
-
|
|
172
|
+
// #1263: retried asynchronously, so a locked DB does not freeze the MCP server.
|
|
173
|
+
await this.unifiedMemory.writeWhenUnlocked(() => updateStmt.run(buf, embedding.length, spaceId, row.id));
|
|
162
174
|
// Add to live HNSW so freshly-embedded rows are immediately searchable
|
|
163
|
-
|
|
164
|
-
this.hnswIndex.addEmbedding({
|
|
165
|
-
vector: embedding,
|
|
166
|
-
dimension: 384,
|
|
167
|
-
namespace: 'experiences',
|
|
168
|
-
text: row.id,
|
|
169
|
-
timestamp: Date.now(),
|
|
170
|
-
quantization: 'none',
|
|
171
|
-
metadata: {},
|
|
172
|
-
}, hnswId);
|
|
173
|
-
this.idToExperienceId.set(hnswId, row.id);
|
|
174
|
-
this.experienceIdToHnswId.set(row.id, hnswId);
|
|
175
|
+
this.indexExperience(row.id, embedding, spaceId);
|
|
175
176
|
written++;
|
|
176
177
|
}
|
|
177
178
|
console.log(`[ExperienceReplay] Backfilled ${written} captured_experiences embeddings`);
|
|
@@ -180,6 +181,30 @@ export class ExperienceReplay {
|
|
|
180
181
|
console.warn('[ExperienceReplay] Embedding backfill failed:', err instanceof Error ? err.message : err);
|
|
181
182
|
}
|
|
182
183
|
})();
|
|
184
|
+
// #1217: vectors stored before embedding-space provenance existed are
|
|
185
|
+
// never compared. Attribute those the active embedder reproduces to its
|
|
186
|
+
// space; the vectors themselves are never rewritten. Same cap per boot.
|
|
187
|
+
void (async () => {
|
|
188
|
+
try {
|
|
189
|
+
if (!this.db)
|
|
190
|
+
return;
|
|
191
|
+
const result = await verifyLegacyExperienceSpaces(this.db, {
|
|
192
|
+
embed: (text) => computeRealEmbedding(text, this.config.embedding),
|
|
193
|
+
activeSpaceId: () => getActiveEmbeddingSpaceIdentity()?.spaceId,
|
|
194
|
+
write: (fn) => this.unifiedMemory.writeWhenUnlocked(fn),
|
|
195
|
+
});
|
|
196
|
+
if (result.checked === 0)
|
|
197
|
+
return;
|
|
198
|
+
if (result.stamped.length > 0 && result.spaceId) {
|
|
199
|
+
await this.loadEmbeddingIndex(result.spaceId);
|
|
200
|
+
}
|
|
201
|
+
console.log(`[ExperienceReplay] Checked ${result.checked} experience vectors without an embedding space: ` +
|
|
202
|
+
`${result.stamped.length} match the active embedder, ${result.left} left uncompared`);
|
|
203
|
+
}
|
|
204
|
+
catch (err) {
|
|
205
|
+
console.warn('[ExperienceReplay] Embedding-space check failed:', err instanceof Error ? err.message : err);
|
|
206
|
+
}
|
|
207
|
+
})();
|
|
183
208
|
// Backfill missing embeddings on qe_trajectories. TrajectoryTracker.endTrajectory()
|
|
184
209
|
// writes embedding=NULL with no follow-up worker; hook-side trajectory inserts
|
|
185
210
|
// (cli-hook-post-task) also leave the column NULL. Without this, kNN over
|
|
@@ -206,7 +231,7 @@ export class ExperienceReplay {
|
|
|
206
231
|
// ADR-099: legacy rows may predate ingestion-time scrubbing
|
|
207
232
|
const text = scrubReasoningBlocks(`${row.domain ?? ''}: ${row.task}`).slice(0, 512);
|
|
208
233
|
const embedding = await computeRealEmbedding(text);
|
|
209
|
-
updateStmt.run(Buffer.from(new Float32Array(embedding).buffer), row.id);
|
|
234
|
+
await this.unifiedMemory.writeWhenUnlocked(() => updateStmt.run(Buffer.from(new Float32Array(embedding).buffer), row.id));
|
|
210
235
|
written++;
|
|
211
236
|
}
|
|
212
237
|
console.log(`[ExperienceReplay] Backfilled ${written} qe_trajectories embeddings`);
|
|
@@ -254,6 +279,7 @@ export class ExperienceReplay {
|
|
|
254
279
|
avg_token_savings REAL DEFAULT 0,
|
|
255
280
|
embedding BLOB,
|
|
256
281
|
embedding_dimension INTEGER,
|
|
282
|
+
embedding_space_id TEXT,
|
|
257
283
|
tags TEXT,
|
|
258
284
|
last_applied_at TEXT
|
|
259
285
|
);
|
|
@@ -269,6 +295,8 @@ export class ExperienceReplay {
|
|
|
269
295
|
['avg_token_savings', 'REAL DEFAULT 0'],
|
|
270
296
|
['embedding', 'BLOB'],
|
|
271
297
|
['embedding_dimension', 'INTEGER'],
|
|
298
|
+
// #1217: embedding-space identity of the stored vector (ADR-097)
|
|
299
|
+
['embedding_space_id', 'TEXT'],
|
|
272
300
|
['tags', 'TEXT'],
|
|
273
301
|
['last_applied_at', 'TEXT'],
|
|
274
302
|
// Consolidation columns (experience-consolidation system)
|
|
@@ -320,8 +348,8 @@ export class ExperienceReplay {
|
|
|
320
348
|
this.prepared.set('insertExperience', this.db.prepare(`
|
|
321
349
|
INSERT INTO captured_experiences (
|
|
322
350
|
id, task, agent, domain, success, quality, duration_ms,
|
|
323
|
-
steps_json, routing_json, embedding, embedding_dimension, tags, source
|
|
324
|
-
) VALUES (?, ?, ?, ?, 1, ?, 0, ?, ?, ?, ?, ?, 'experience-replay')
|
|
351
|
+
steps_json, routing_json, embedding, embedding_dimension, embedding_space_id, tags, source
|
|
352
|
+
) VALUES (?, ?, ?, ?, 1, ?, 0, ?, ?, ?, ?, ?, ?, 'experience-replay')
|
|
325
353
|
`));
|
|
326
354
|
this.prepared.set('getExperience', this.db.prepare(`
|
|
327
355
|
SELECT * FROM captured_experiences WHERE id = ?
|
|
@@ -333,7 +361,8 @@ export class ExperienceReplay {
|
|
|
333
361
|
SELECT * FROM captured_experiences WHERE consolidated_into IS NULL ORDER BY quality DESC LIMIT ?
|
|
334
362
|
`));
|
|
335
363
|
this.prepared.set('getAllEmbeddings', this.db.prepare(`
|
|
336
|
-
SELECT id, embedding, embedding_dimension FROM captured_experiences
|
|
364
|
+
SELECT id, embedding, embedding_dimension FROM captured_experiences
|
|
365
|
+
WHERE embedding IS NOT NULL AND embedding_space_id = ? AND consolidated_into IS NULL
|
|
337
366
|
`));
|
|
338
367
|
this.prepared.set('updateApplication', this.db.prepare(`
|
|
339
368
|
UPDATE captured_experiences SET
|
|
@@ -353,17 +382,22 @@ export class ExperienceReplay {
|
|
|
353
382
|
/**
|
|
354
383
|
* Load embeddings into HNSW index for O(log n) similarity search
|
|
355
384
|
* Performance: 150x-12,500x faster than linear scan
|
|
385
|
+
*
|
|
386
|
+
* #1217: loads only vectors of the given embedding space, as the pattern
|
|
387
|
+
* banks do (ADR-097). Vectors of another space, or without provenance, are
|
|
388
|
+
* not comparable with a query embedded in this one.
|
|
356
389
|
*/
|
|
357
|
-
async loadEmbeddingIndex() {
|
|
390
|
+
async loadEmbeddingIndex(spaceId) {
|
|
358
391
|
const stmt = this.prepared.get('getAllEmbeddings');
|
|
359
392
|
if (!stmt)
|
|
360
393
|
return;
|
|
361
|
-
const rows = stmt.all();
|
|
394
|
+
const rows = (spaceId ? stmt.all(spaceId) : []);
|
|
362
395
|
// Clear existing mappings
|
|
363
396
|
this.idToExperienceId.clear();
|
|
364
397
|
this.experienceIdToHnswId.clear();
|
|
365
398
|
this.hnswIndex.clearIndex('experiences');
|
|
366
399
|
this.nextHnswId = 0;
|
|
400
|
+
this.indexSpaceId = spaceId;
|
|
367
401
|
// Build HNSW index with all embeddings
|
|
368
402
|
for (const row of rows) {
|
|
369
403
|
if (row.embedding && row.embedding_dimension) {
|
|
@@ -413,6 +447,8 @@ export class ExperienceReplay {
|
|
|
413
447
|
// Generate embedding for similarity search
|
|
414
448
|
const embeddingText = `${task} ${strategy} ${keyActions.join(' ')}`;
|
|
415
449
|
const embedding = (await this.embedOrNull(embeddingText)) ?? undefined;
|
|
450
|
+
// ADR-097: a vector is kept only with the space it was computed in.
|
|
451
|
+
const embeddingSpaceId = embedding ? getActiveEmbeddingSpaceIdentity()?.spaceId : undefined;
|
|
416
452
|
const id = uuidv4();
|
|
417
453
|
const domain = trajectory.domain || 'test-generation';
|
|
418
454
|
const experience = {
|
|
@@ -426,7 +462,8 @@ export class ExperienceReplay {
|
|
|
426
462
|
applicationCount: 0,
|
|
427
463
|
successRate: 1.0,
|
|
428
464
|
avgTokenSavings: 0,
|
|
429
|
-
embedding,
|
|
465
|
+
embedding: embeddingSpaceId ? embedding : undefined,
|
|
466
|
+
embeddingSpaceId,
|
|
430
467
|
createdAt: new Date(),
|
|
431
468
|
originalMetrics: trajectory.metrics,
|
|
432
469
|
tags,
|
|
@@ -434,27 +471,17 @@ export class ExperienceReplay {
|
|
|
434
471
|
// Store in captured_experiences table
|
|
435
472
|
const insertStmt = this.prepared.get('insertExperience');
|
|
436
473
|
if (insertStmt) {
|
|
437
|
-
const embeddingBuffer = embedding ? this.floatArrayToBuffer(embedding) : null;
|
|
438
|
-
|
|
474
|
+
const embeddingBuffer = experience.embedding ? this.floatArrayToBuffer(experience.embedding) : null;
|
|
475
|
+
// Queued (#1274): runs when task completion events end a trajectory.
|
|
476
|
+
const run = () => insertStmt.run(id, task, strategy, // agent column stores strategy
|
|
439
477
|
domain, trajectory.metrics.efficiencyScore, JSON.stringify(keyActions), // steps_json stores key actions
|
|
440
478
|
JSON.stringify(trajectory.metrics), // routing_json stores original metrics
|
|
441
|
-
embeddingBuffer, embedding?.length ?? null, JSON.stringify(tags));
|
|
479
|
+
embeddingBuffer, experience.embedding?.length ?? null, embeddingSpaceId ?? null, JSON.stringify(tags));
|
|
480
|
+
await (this.unifiedMemory ? this.unifiedMemory.writeWhenUnlocked(run) : run());
|
|
442
481
|
}
|
|
443
482
|
// Add to HNSW index for fast similarity search
|
|
444
|
-
if (embedding) {
|
|
445
|
-
|
|
446
|
-
const iEmbedding = {
|
|
447
|
-
vector: embedding,
|
|
448
|
-
dimension: 384,
|
|
449
|
-
namespace: 'experiences',
|
|
450
|
-
text: id, // Use ID as text identifier
|
|
451
|
-
timestamp: Date.now(),
|
|
452
|
-
quantization: 'none',
|
|
453
|
-
metadata: {},
|
|
454
|
-
};
|
|
455
|
-
this.hnswIndex.addEmbedding(iEmbedding, hnswId);
|
|
456
|
-
this.idToExperienceId.set(hnswId, id);
|
|
457
|
-
this.experienceIdToHnswId.set(id, hnswId);
|
|
483
|
+
if (experience.embedding && embeddingSpaceId) {
|
|
484
|
+
this.indexExperience(id, experience.embedding, embeddingSpaceId);
|
|
458
485
|
}
|
|
459
486
|
// Add to recent buffer
|
|
460
487
|
this.recentExperiences.push(experience);
|
|
@@ -515,7 +542,9 @@ export class ExperienceReplay {
|
|
|
515
542
|
// #1022: without an embedding of the query nothing measures relevance, so
|
|
516
543
|
// return no guidance rather than picks with a made-up similarity.
|
|
517
544
|
const queryEmbedding = await this.embedOrNull(scrubReasoningBlocks(task));
|
|
518
|
-
|
|
545
|
+
// #1217: the query's embedding space; only vectors of it are compared.
|
|
546
|
+
const querySpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId;
|
|
547
|
+
if (!queryEmbedding || !querySpaceId) {
|
|
519
548
|
return null;
|
|
520
549
|
}
|
|
521
550
|
// Find similar experiences via HNSW
|
|
@@ -535,7 +564,11 @@ export class ExperienceReplay {
|
|
|
535
564
|
// Skip if domain filter doesn't match
|
|
536
565
|
if (domain && exp.domain !== domain)
|
|
537
566
|
continue;
|
|
538
|
-
|
|
567
|
+
// #1217: a vector from another embedding space (even of the same
|
|
568
|
+
// dimension), or without provenance, has no comparable similarity.
|
|
569
|
+
if (!exp.embedding || exp.embeddingSpaceId !== querySpaceId)
|
|
570
|
+
continue;
|
|
571
|
+
if (exp.embedding.length !== queryEmbedding.length)
|
|
539
572
|
continue;
|
|
540
573
|
const similarity = cosineSimilarity(queryEmbedding, exp.embedding);
|
|
541
574
|
if (similarity < this.config.similarityThreshold)
|
|
@@ -600,8 +633,9 @@ export class ExperienceReplay {
|
|
|
600
633
|
async findSimilarExperiences(task, domain, limit) {
|
|
601
634
|
this.ensureInitialized();
|
|
602
635
|
const k = limit ?? this.config.topK;
|
|
603
|
-
// Check if index is empty
|
|
604
|
-
|
|
636
|
+
// Check if index is empty (and bound to the active embedding space)
|
|
637
|
+
const knownSpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? null;
|
|
638
|
+
if (this.idToExperienceId.size === 0 && knownSpaceId !== null && knownSpaceId === this.indexSpaceId) {
|
|
605
639
|
return [];
|
|
606
640
|
}
|
|
607
641
|
// Generate embedding for the task
|
|
@@ -611,6 +645,16 @@ export class ExperienceReplay {
|
|
|
611
645
|
if (!taskEmbedding) {
|
|
612
646
|
return [];
|
|
613
647
|
}
|
|
648
|
+
// #1217: search only vectors of the query's embedding space.
|
|
649
|
+
const querySpaceId = getActiveEmbeddingSpaceIdentity()?.spaceId ?? null;
|
|
650
|
+
if (!querySpaceId)
|
|
651
|
+
return [];
|
|
652
|
+
if (querySpaceId !== this.indexSpaceId) {
|
|
653
|
+
await this.loadEmbeddingIndex(querySpaceId);
|
|
654
|
+
}
|
|
655
|
+
if (this.idToExperienceId.size === 0) {
|
|
656
|
+
return [];
|
|
657
|
+
}
|
|
614
658
|
// Create query embedding for HNSW search
|
|
615
659
|
const queryEmbedding = {
|
|
616
660
|
vector: taskEmbedding,
|
|
@@ -722,7 +766,7 @@ export class ExperienceReplay {
|
|
|
722
766
|
// Remove HNSW mappings for absorbed experiences
|
|
723
767
|
if (result.merged > 0) {
|
|
724
768
|
// Reload HNSW index to reflect consolidated state
|
|
725
|
-
await this.loadEmbeddingIndex();
|
|
769
|
+
await this.loadEmbeddingIndex(this.indexSpaceId);
|
|
726
770
|
}
|
|
727
771
|
console.log(`[ExperienceReplay] Auto-consolidated ${domain}: ` +
|
|
728
772
|
`${result.merged} merged, ${result.archived} archived`);
|
|
@@ -815,12 +859,38 @@ export class ExperienceReplay {
|
|
|
815
859
|
embedding: row.embedding && row.embedding_dimension
|
|
816
860
|
? this.bufferToFloatArray(row.embedding, row.embedding_dimension)
|
|
817
861
|
: undefined,
|
|
862
|
+
embeddingSpaceId: row.embedding_space_id ?? undefined,
|
|
818
863
|
createdAt: new Date(row.started_at),
|
|
819
864
|
lastAppliedAt: row.last_applied_at ? new Date(row.last_applied_at) : undefined,
|
|
820
865
|
originalMetrics: safeJsonParse(row.routing_json || '{}'),
|
|
821
866
|
tags: safeJsonParse(row.tags || '[]'),
|
|
822
867
|
};
|
|
823
868
|
}
|
|
869
|
+
/**
|
|
870
|
+
* #1217: add a stored vector to the HNSW index. A vector of another
|
|
871
|
+
* embedding space re-binds the index to that space (the active one, since
|
|
872
|
+
* the vector was just computed): the rows of that space are reloaded,
|
|
873
|
+
* including this one.
|
|
874
|
+
*/
|
|
875
|
+
indexExperience(id, embedding, spaceId) {
|
|
876
|
+
if (spaceId !== this.indexSpaceId) {
|
|
877
|
+
void this.loadEmbeddingIndex(spaceId);
|
|
878
|
+
return;
|
|
879
|
+
}
|
|
880
|
+
const hnswId = this.nextHnswId++;
|
|
881
|
+
const iEmbedding = {
|
|
882
|
+
vector: embedding,
|
|
883
|
+
dimension: 384,
|
|
884
|
+
namespace: 'experiences',
|
|
885
|
+
text: id, // Use ID as text identifier
|
|
886
|
+
timestamp: Date.now(),
|
|
887
|
+
quantization: 'none',
|
|
888
|
+
metadata: {},
|
|
889
|
+
};
|
|
890
|
+
this.hnswIndex.addEmbedding(iEmbedding, hnswId);
|
|
891
|
+
this.idToExperienceId.set(hnswId, id);
|
|
892
|
+
this.experienceIdToHnswId.set(id, hnswId);
|
|
893
|
+
}
|
|
824
894
|
floatArrayToBuffer(arr) {
|
|
825
895
|
const buffer = Buffer.alloc(arr.length * 4);
|
|
826
896
|
for (let i = 0; i < arr.length; i++) {
|
|
@@ -231,6 +231,12 @@ export declare class PatternEvolution {
|
|
|
231
231
|
* Record an evolution event
|
|
232
232
|
*/
|
|
233
233
|
private recordEvent;
|
|
234
|
+
/**
|
|
235
|
+
* Run a write through the shared connection's writeWhenUnlocked queue, so a
|
|
236
|
+
* locked memory.db does not freeze the MCP server's event loop while the
|
|
237
|
+
* hourly consolidation timer merges and prunes patterns (#1274).
|
|
238
|
+
*/
|
|
239
|
+
private write;
|
|
234
240
|
/**
|
|
235
241
|
* Get statistics
|
|
236
242
|
*/
|
|
@@ -223,31 +223,38 @@ export class PatternEvolution {
|
|
|
223
223
|
*/
|
|
224
224
|
async trackVersion(patternId, embedding, changes = [], trigger = 'manual') {
|
|
225
225
|
this.ensureInitialized();
|
|
226
|
-
// Get current version count
|
|
227
|
-
const countStmt = this.prepared.get('getVersionCount');
|
|
228
|
-
const countResult = countStmt?.get(patternId);
|
|
229
|
-
const newVersion = (countResult?.count ?? 0) + 1;
|
|
230
|
-
// Get pattern quality/success rate
|
|
231
|
-
const patternStmt = this.prepared.get('getPattern');
|
|
232
|
-
const pattern = patternStmt?.get(patternId);
|
|
233
226
|
const id = uuidv4();
|
|
234
|
-
const
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
227
|
+
const embeddingBuffer = this.floatArrayToBuffer(embedding);
|
|
228
|
+
// #1283: read the version count and insert the new version as one queued
|
|
229
|
+
// unit, so a locked memory.db does not freeze the MCP server and two
|
|
230
|
+
// concurrent calls cannot both claim the same version number.
|
|
231
|
+
const version = await this.write(() => {
|
|
232
|
+
// Get current version count
|
|
233
|
+
const countStmt = this.prepared.get('getVersionCount');
|
|
234
|
+
const countResult = countStmt?.get(patternId);
|
|
235
|
+
const newVersion = (countResult?.count ?? 0) + 1;
|
|
236
|
+
// Get pattern quality/success rate
|
|
237
|
+
const patternStmt = this.prepared.get('getPattern');
|
|
238
|
+
const pattern = patternStmt?.get(patternId);
|
|
239
|
+
const tracked = {
|
|
240
|
+
id,
|
|
241
|
+
patternId,
|
|
242
|
+
version: newVersion,
|
|
243
|
+
embedding,
|
|
244
|
+
changes,
|
|
245
|
+
qualityScore: pattern?.quality_score ?? 0.5,
|
|
246
|
+
successRate: pattern?.success_rate ?? 0.5,
|
|
247
|
+
timestamp: new Date(),
|
|
248
|
+
trigger,
|
|
249
|
+
};
|
|
250
|
+
// Store in database
|
|
251
|
+
const insertStmt = this.prepared.get('insertVersion');
|
|
252
|
+
if (insertStmt) {
|
|
253
|
+
insertStmt.run(id, patternId, newVersion, embeddingBuffer, embedding.length, JSON.stringify(changes), tracked.qualityScore, tracked.successRate, trigger);
|
|
254
|
+
}
|
|
255
|
+
return tracked;
|
|
256
|
+
});
|
|
257
|
+
const newVersion = version.version;
|
|
251
258
|
// Update embedding cache
|
|
252
259
|
this.embeddingCache.set(patternId, embedding);
|
|
253
260
|
// Record evolution event
|
|
@@ -429,7 +436,8 @@ export class PatternEvolution {
|
|
|
429
436
|
*/
|
|
430
437
|
async mergePatterns(patternId1, patternId2, mergedName) {
|
|
431
438
|
this.ensureInitialized();
|
|
432
|
-
|
|
439
|
+
const db = this.db;
|
|
440
|
+
if (!db)
|
|
433
441
|
return null;
|
|
434
442
|
const patternStmt = this.prepared.get('getPattern');
|
|
435
443
|
const p1 = patternStmt?.get(patternId1);
|
|
@@ -442,13 +450,13 @@ export class PatternEvolution {
|
|
|
442
450
|
: [p2, p1];
|
|
443
451
|
// Update retained pattern name if provided
|
|
444
452
|
if (mergedName) {
|
|
445
|
-
this.db.prepare(`UPDATE qe_patterns SET name = ? WHERE id = ?`).run(mergedName, retained.id);
|
|
453
|
+
await this.write(() => db.prepare(`UPDATE qe_patterns SET name = ? WHERE id = ?`).run(mergedName, retained.id));
|
|
446
454
|
}
|
|
447
455
|
// Combine usage counts and recalculate success rate
|
|
448
456
|
const totalUsage = (retained.usage_count ?? 0) + (archived.usage_count ?? 0);
|
|
449
457
|
const totalSuccess = (retained.successful_uses ?? 0) + (archived.successful_uses ?? 0);
|
|
450
458
|
const newSuccessRate = totalUsage > 0 ? totalSuccess / totalUsage : 0;
|
|
451
|
-
this.db.prepare(`
|
|
459
|
+
await this.write(() => db.prepare(`
|
|
452
460
|
UPDATE qe_patterns SET
|
|
453
461
|
usage_count = ?,
|
|
454
462
|
successful_uses = ?,
|
|
@@ -460,14 +468,15 @@ export class PatternEvolution {
|
|
|
460
468
|
END,
|
|
461
469
|
updated_at = datetime('now')
|
|
462
470
|
WHERE id = ?
|
|
463
|
-
`).run(totalUsage, totalSuccess, newSuccessRate, archived.last_used_at, archived.last_used_at, archived.last_used_at, retained.id);
|
|
471
|
+
`).run(totalUsage, totalSuccess, newSuccessRate, archived.last_used_at, archived.last_used_at, archived.last_used_at, retained.id));
|
|
464
472
|
// Record merge relationship
|
|
465
473
|
const relStmt = this.prepared.get('insertRelationship');
|
|
466
474
|
if (relStmt) {
|
|
467
|
-
|
|
475
|
+
const relId = uuidv4();
|
|
476
|
+
await this.write(() => relStmt.run(relId, archived.id, retained.id, 'merged', 1.0));
|
|
468
477
|
}
|
|
469
478
|
// Archive the lower quality pattern (mark as archived)
|
|
470
|
-
this.db.prepare(`UPDATE qe_patterns SET tier = 'archived' WHERE id = ?`).run(archived.id);
|
|
479
|
+
await this.write(() => db.prepare(`UPDATE qe_patterns SET tier = 'archived' WHERE id = ?`).run(archived.id));
|
|
471
480
|
// Record events
|
|
472
481
|
await this.recordEvent(retained.id, 'merged', { absorbedFrom: archived.id });
|
|
473
482
|
await this.recordEvent(archived.id, 'archived', { mergedInto: retained.id });
|
|
@@ -497,8 +506,9 @@ export class PatternEvolution {
|
|
|
497
506
|
for (const candidate of pruneCandidates) {
|
|
498
507
|
if (candidate.reason === 'low-quality' || candidate.reason === 'obsolete') {
|
|
499
508
|
// Actually delete the pattern
|
|
500
|
-
|
|
501
|
-
|
|
509
|
+
const db = this.db;
|
|
510
|
+
if (db) {
|
|
511
|
+
await this.write(() => db.prepare(`DELETE FROM qe_patterns WHERE id = ?`).run(candidate.patternId));
|
|
502
512
|
this.embeddingCache.delete(candidate.patternId);
|
|
503
513
|
await this.recordEvent(candidate.patternId, 'pruned', { reason: candidate.reason });
|
|
504
514
|
pruned++;
|
|
@@ -560,10 +570,18 @@ export class PatternEvolution {
|
|
|
560
570
|
details,
|
|
561
571
|
timestamp: new Date(),
|
|
562
572
|
};
|
|
563
|
-
insertStmt.run(event.id, patternId, eventType, JSON.stringify(details));
|
|
573
|
+
await this.write(() => insertStmt.run(event.id, patternId, eventType, JSON.stringify(details)));
|
|
564
574
|
this.recentEvents.push(event);
|
|
565
575
|
}
|
|
566
576
|
}
|
|
577
|
+
/**
|
|
578
|
+
* Run a write through the shared connection's writeWhenUnlocked queue, so a
|
|
579
|
+
* locked memory.db does not freeze the MCP server's event loop while the
|
|
580
|
+
* hourly consolidation timer merges and prunes patterns (#1274).
|
|
581
|
+
*/
|
|
582
|
+
write(fn) {
|
|
583
|
+
return this.unifiedMemory ? this.unifiedMemory.writeWhenUnlocked(fn) : Promise.resolve(fn());
|
|
584
|
+
}
|
|
567
585
|
/**
|
|
568
586
|
* Get statistics
|
|
569
587
|
*/
|
|
@@ -75,7 +75,7 @@ export class TrajectoryTracker {
|
|
|
75
75
|
// Load recent trajectories into buffer
|
|
76
76
|
await this.loadRecentTrajectories();
|
|
77
77
|
// Clean up orphaned trajectories from previous sessions (started > 1 hour ago, never completed)
|
|
78
|
-
this.cleanupOrphanedTrajectories();
|
|
78
|
+
await this.cleanupOrphanedTrajectories();
|
|
79
79
|
this.initialized = true;
|
|
80
80
|
console.log('[TrajectoryTracker] Initialized');
|
|
81
81
|
}
|
|
@@ -83,18 +83,20 @@ export class TrajectoryTracker {
|
|
|
83
83
|
* Clean up orphaned trajectories that were started but never completed.
|
|
84
84
|
* Marks them as failed with an auto-close reason. Runs at initialization.
|
|
85
85
|
*/
|
|
86
|
-
cleanupOrphanedTrajectories() {
|
|
87
|
-
|
|
86
|
+
async cleanupOrphanedTrajectories() {
|
|
87
|
+
const db = this.db;
|
|
88
|
+
if (!db || !this.unifiedMemory)
|
|
88
89
|
return;
|
|
89
90
|
try {
|
|
90
|
-
|
|
91
|
+
// #1263: retried asynchronously, so a locked DB does not freeze the MCP server.
|
|
92
|
+
const result = await this.unifiedMemory.writeWhenUnlocked(() => db.prepare(`
|
|
91
93
|
UPDATE qe_trajectories
|
|
92
94
|
SET success = 0,
|
|
93
95
|
ended_at = datetime('now'),
|
|
94
96
|
feedback = 'auto-closed: orphaned trajectory from previous session'
|
|
95
97
|
WHERE success IS NULL
|
|
96
98
|
AND started_at < datetime('now', '-1 hour')
|
|
97
|
-
`).run();
|
|
99
|
+
`).run());
|
|
98
100
|
if (result.changes > 0) {
|
|
99
101
|
this.stats.trajectoriesAbandoned += result.changes;
|
|
100
102
|
console.log(`[TrajectoryTracker] Cleaned up ${result.changes} orphaned trajectories`);
|
|
@@ -238,10 +240,13 @@ export class TrajectoryTracker {
|
|
|
238
240
|
startedAt,
|
|
239
241
|
context: options.context,
|
|
240
242
|
});
|
|
241
|
-
// Persist to SQLite
|
|
243
|
+
// Persist to SQLite. Queued (#1283): task_orchestrate starts a trajectory
|
|
244
|
+
// inside the tool call, and a locked memory.db must not freeze the MCP
|
|
245
|
+
// server's event loop. The later end update queues after this insert.
|
|
242
246
|
const insertStmt = this.prepared.get('insertTrajectory');
|
|
243
247
|
if (insertStmt) {
|
|
244
|
-
insertStmt.run(id, task, options.agent || null, options.domain || null, startedAt.toISOString(), options.context ? JSON.stringify(options.context) : null);
|
|
248
|
+
const run = () => insertStmt.run(id, task, options.agent || null, options.domain || null, startedAt.toISOString(), options.context ? JSON.stringify(options.context) : null);
|
|
249
|
+
await (this.unifiedMemory ? this.unifiedMemory.writeWhenUnlocked(run) : run());
|
|
245
250
|
}
|
|
246
251
|
this.stats.trajectoriesStarted++;
|
|
247
252
|
// Set auto-end timeout
|
|
@@ -344,12 +349,15 @@ export class TrajectoryTracker {
|
|
|
344
349
|
endedAt,
|
|
345
350
|
feedback,
|
|
346
351
|
};
|
|
347
|
-
// Persist to SQLite
|
|
352
|
+
// Persist to SQLite. Queued (#1274): task completion events end
|
|
353
|
+
// trajectories in the background, and a locked memory.db must not freeze
|
|
354
|
+
// the MCP server's event loop.
|
|
348
355
|
const updateStmt = this.prepared.get('updateTrajectory');
|
|
349
356
|
if (updateStmt) {
|
|
350
|
-
updateStmt.run(endedAt.toISOString(), success ? 1 : 0, JSON.stringify(active.steps), JSON.stringify({ metrics, context: active.context }), null, // embedding - computed later if needed
|
|
357
|
+
const run = () => updateStmt.run(endedAt.toISOString(), success ? 1 : 0, JSON.stringify(active.steps), JSON.stringify({ metrics, context: active.context }), null, // embedding - computed later if needed
|
|
351
358
|
feedback ?? null, null, // related_patterns - computed later
|
|
352
359
|
trajectoryId);
|
|
360
|
+
await (this.unifiedMemory ? this.unifiedMemory.writeWhenUnlocked(run) : run());
|
|
353
361
|
}
|
|
354
362
|
// Remove from active, add to recent buffer
|
|
355
363
|
this.activeTrajectories.delete(trajectoryId);
|
|
@@ -84,6 +84,14 @@ export declare class EmbeddingCache {
|
|
|
84
84
|
* Persist entry to disk
|
|
85
85
|
*/
|
|
86
86
|
private persistToDisk;
|
|
87
|
+
/**
|
|
88
|
+
* Run a write on the cache's connection without blocking the caller
|
|
89
|
+
* (#1283). On the shared memory.db connection it goes through the write
|
|
90
|
+
* queue, so a locked database does not freeze the MCP server's event loop;
|
|
91
|
+
* on a private (legacy) connection it runs at once. A failure is logged,
|
|
92
|
+
* since the in-memory cache is already up to date.
|
|
93
|
+
*/
|
|
94
|
+
private persist;
|
|
87
95
|
/**
|
|
88
96
|
* Flush writes that were queued during async DB initialization
|
|
89
97
|
*/
|
|
@@ -24,6 +24,7 @@ import { join } from 'path';
|
|
|
24
24
|
import { existsSync, mkdirSync } from 'fs';
|
|
25
25
|
import { getUnifiedMemory, findProjectRoot } from '../../../kernel/unified-memory.js';
|
|
26
26
|
import { safeJsonParse } from '../../../shared/safe-json.js';
|
|
27
|
+
import { writeWhenUnlockedOn } from '../../../shared/sqlite-write-queue.js';
|
|
27
28
|
/**
|
|
28
29
|
* Embedding cache with LRU eviction and persistent storage
|
|
29
30
|
*/
|
|
@@ -183,8 +184,7 @@ export class EmbeddingCache {
|
|
|
183
184
|
const cache = this.memoryCache.get(namespace);
|
|
184
185
|
const deleted = cache?.delete(key) || false;
|
|
185
186
|
if (deleted && this.persistent && this.db) {
|
|
186
|
-
|
|
187
|
-
stmt.run(key, namespace);
|
|
187
|
+
this.persist('delete', (db) => db.prepare('DELETE FROM embeddings WHERE key = ? AND namespace = ?').run(key, namespace));
|
|
188
188
|
}
|
|
189
189
|
return deleted;
|
|
190
190
|
}
|
|
@@ -196,8 +196,7 @@ export class EmbeddingCache {
|
|
|
196
196
|
const cache = this.memoryCache.get(namespace);
|
|
197
197
|
cache?.clear();
|
|
198
198
|
if (this.persistent && this.db) {
|
|
199
|
-
|
|
200
|
-
stmt.run(namespace);
|
|
199
|
+
this.persist('clear', (db) => db.prepare('DELETE FROM embeddings WHERE namespace = ?').run(namespace));
|
|
201
200
|
}
|
|
202
201
|
}
|
|
203
202
|
else {
|
|
@@ -205,7 +204,7 @@ export class EmbeddingCache {
|
|
|
205
204
|
cache.clear();
|
|
206
205
|
}
|
|
207
206
|
if (this.persistent && this.db) {
|
|
208
|
-
this.db.exec('DELETE FROM embeddings');
|
|
207
|
+
this.persist('clear', (db) => db.exec('DELETE FROM embeddings'));
|
|
209
208
|
}
|
|
210
209
|
}
|
|
211
210
|
}
|
|
@@ -243,8 +242,8 @@ export class EmbeddingCache {
|
|
|
243
242
|
if (lruKey) {
|
|
244
243
|
cache.delete(lruKey);
|
|
245
244
|
if (this.persistent && this.db) {
|
|
246
|
-
const
|
|
247
|
-
|
|
245
|
+
const evicted = lruKey;
|
|
246
|
+
this.persist('evict', (db) => db.prepare('DELETE FROM embeddings WHERE key = ? AND namespace = ?').run(evicted, namespace));
|
|
248
247
|
}
|
|
249
248
|
}
|
|
250
249
|
}
|
|
@@ -259,17 +258,32 @@ export class EmbeddingCache {
|
|
|
259
258
|
const metadataJson = embedding.metadata
|
|
260
259
|
? JSON.stringify(embedding.metadata)
|
|
261
260
|
: null;
|
|
262
|
-
const
|
|
261
|
+
const lastAccess = Date.now();
|
|
262
|
+
this.persist('persist', (db) => db.prepare(`
|
|
263
263
|
INSERT OR REPLACE INTO embeddings
|
|
264
264
|
(key, namespace, vector, dimension, text, timestamp, quantization, metadata, last_access)
|
|
265
265
|
VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)
|
|
266
|
-
`);
|
|
267
|
-
stmt.run(key, namespace, vectorBuffer, embedding.dimension, embedding.text, embedding.timestamp, embedding.quantization, metadataJson, Date.now());
|
|
266
|
+
`).run(key, namespace, vectorBuffer, embedding.dimension, embedding.text, embedding.timestamp, embedding.quantization, metadataJson, lastAccess));
|
|
268
267
|
}
|
|
269
268
|
catch (error) {
|
|
270
269
|
console.warn('Failed to persist embedding:', error);
|
|
271
270
|
}
|
|
272
271
|
}
|
|
272
|
+
/**
|
|
273
|
+
* Run a write on the cache's connection without blocking the caller
|
|
274
|
+
* (#1283). On the shared memory.db connection it goes through the write
|
|
275
|
+
* queue, so a locked database does not freeze the MCP server's event loop;
|
|
276
|
+
* on a private (legacy) connection it runs at once. A failure is logged,
|
|
277
|
+
* since the in-memory cache is already up to date.
|
|
278
|
+
*/
|
|
279
|
+
persist(action, write) {
|
|
280
|
+
const db = this.db;
|
|
281
|
+
if (!db)
|
|
282
|
+
return;
|
|
283
|
+
writeWhenUnlockedOn(db, () => write(db)).catch((error) => {
|
|
284
|
+
console.warn(`Failed to ${action} embedding cache entry:`, error);
|
|
285
|
+
});
|
|
286
|
+
}
|
|
273
287
|
/**
|
|
274
288
|
* Flush writes that were queued during async DB initialization
|
|
275
289
|
*/
|