agentic-qe 3.9.35 → 3.10.0
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 +131 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-WTE6UVGP.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-4PJZ34PF.js → agent-booster-wasm-5UDM2PWG.js} +2 -2
- package/dist/cli/chunks/{agent-handler-OB5JATVT.js → agent-handler-JSYER5YC.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-ZEHRWZ5R.js → agent-memory-branch-T2SAHI4F.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-LCLEBU7D.js +2 -0
- package/dist/cli/chunks/{audit-PWFRSBBW.js → audit-HIBRVGXG.js} +2 -2
- package/dist/cli/chunks/base-73I73HBF.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-XEOLAMMR.js → better-sqlite3-Y6GX6CGB.js} +2 -2
- package/dist/cli/chunks/{brain-handler-6SMUCFO7.js → brain-handler-N6AWIMXG.js} +3 -3
- package/dist/cli/chunks/{branch-enumerator-U6ROQR4O.js → branch-enumerator-VYQGBVEJ.js} +2 -2
- package/dist/cli/chunks/{browser-BMM57TA3.js → browser-2X4WKZPT.js} +2 -2
- package/dist/cli/chunks/browser-workflow-2NSV5O6W.js +2 -0
- package/dist/cli/chunks/{chunk-GWXP36YP.js → chunk-27ACATRH.js} +2 -2
- package/dist/cli/chunks/{chunk-3R6YQEQY.js → chunk-2GL4GH52.js} +4 -4
- package/dist/cli/chunks/{chunk-MSEG7GKM.js → chunk-2POXDKUB.js} +1 -1
- package/dist/cli/chunks/chunk-3BO7EKGO.js +12 -0
- package/dist/cli/chunks/{chunk-X3GKTB6R.js → chunk-3OSCWD7Z.js} +1 -1
- package/dist/cli/chunks/{chunk-WU3RGTLV.js → chunk-3QULDB7K.js} +1 -1
- package/dist/cli/chunks/{chunk-FXITHMQB.js → chunk-3U77XX6J.js} +4 -4
- package/dist/cli/chunks/{chunk-BEJAUYFA.js → chunk-4NQ6KANC.js} +2 -2
- package/dist/cli/chunks/{chunk-56O5V5MP.js → chunk-4UUDFWOP.js} +2 -2
- package/dist/cli/chunks/{chunk-7RNLOYAP.js → chunk-4WYGUTSF.js} +2 -2
- package/dist/cli/chunks/{chunk-HSR7EHVN.js → chunk-55JPAF56.js} +1 -1
- package/dist/cli/chunks/{chunk-T4HZLBM4.js → chunk-5QJDH4Z5.js} +2 -2
- package/dist/cli/chunks/{chunk-UQ6JC3UY.js → chunk-5RQT7EJP.js} +3 -3
- package/dist/cli/chunks/{chunk-CROIRPKG.js → chunk-5UOV7T36.js} +2 -2
- package/dist/cli/chunks/{chunk-HMIRBSTI.js → chunk-66GIKUI2.js} +2 -2
- package/dist/cli/chunks/{chunk-YLYKRAGZ.js → chunk-6F3WJOU2.js} +2 -2
- package/dist/cli/chunks/{chunk-SSJV4AZ7.js → chunk-6H5MRVJS.js} +6 -6
- package/dist/cli/chunks/{chunk-MHUPY3YO.js → chunk-6HCHW5TS.js} +2 -2
- package/dist/cli/chunks/{chunk-FMV22K3J.js → chunk-6MONUYQ5.js} +2 -2
- package/dist/cli/chunks/{chunk-HGJGU625.js → chunk-7Y54QZKF.js} +2 -2
- package/dist/cli/chunks/{chunk-JNK742DP.js → chunk-7ZIRDBXH.js} +1 -1
- package/dist/cli/chunks/{chunk-YPJ2O3TE.js → chunk-AFFYJSW2.js} +2 -2
- package/dist/cli/chunks/{chunk-4NVDPO7L.js → chunk-ALCQRJDY.js} +2 -2
- package/dist/cli/chunks/{chunk-BTPDHALG.js → chunk-BQT4J3BD.js} +2 -2
- package/dist/cli/chunks/{chunk-3UGY4ZQB.js → chunk-BQX5QDU5.js} +1 -1
- package/dist/cli/chunks/{chunk-BSM7YJBY.js → chunk-BTIVIWIG.js} +1 -1
- package/dist/cli/chunks/{chunk-3YIVRMQB.js → chunk-BXCS55GB.js} +1 -1
- package/dist/cli/chunks/{chunk-5CZDHJZX.js → chunk-C5QESAYA.js} +1 -1
- package/dist/cli/chunks/{chunk-CTU4V32J.js → chunk-CU4IUJ2K.js} +2 -2
- package/dist/cli/chunks/{chunk-6TYWIS4R.js → chunk-DQJJS4AX.js} +2 -2
- package/dist/cli/chunks/{chunk-OPD6AENV.js → chunk-DQLEZBWV.js} +2 -2
- package/dist/cli/chunks/{chunk-ACL5JFJR.js → chunk-DXV6NRG3.js} +2 -2
- package/dist/cli/chunks/{chunk-5XXZQCHS.js → chunk-DY7IRNE2.js} +1 -1
- package/dist/cli/chunks/{chunk-NPUMPLL7.js → chunk-F363JJUI.js} +1 -1
- package/dist/cli/chunks/{chunk-HAOGVFKR.js → chunk-FCSJ7GIZ.js} +2 -2
- package/dist/cli/chunks/{chunk-6WZNRHJJ.js → chunk-FEBXP74Y.js} +1 -1
- package/dist/cli/chunks/{chunk-G6BJ5I57.js → chunk-FQ5FT7IE.js} +1 -1
- package/dist/cli/chunks/{chunk-SI6VUQSI.js → chunk-FX4SYT6Y.js} +3 -3
- package/dist/cli/chunks/{chunk-INCNWH3R.js → chunk-G2HA2O3R.js} +2 -2
- package/dist/cli/chunks/{chunk-M4BCSFVN.js → chunk-GPKZ4MMH.js} +1 -1
- package/dist/cli/chunks/{chunk-QOAVXGAU.js → chunk-GXCD7GNH.js} +2 -2
- package/dist/cli/chunks/{chunk-4UZ7G2KT.js → chunk-HD5NQDOL.js} +2 -2
- package/dist/cli/chunks/{chunk-NS4P3VRA.js → chunk-HD6CZBZV.js} +2 -2
- package/dist/cli/chunks/{chunk-RPRFDO23.js → chunk-HIWBW4IQ.js} +1 -1
- package/dist/cli/chunks/{chunk-GHMIADYW.js → chunk-HZPXOAFW.js} +2 -2
- package/dist/cli/chunks/{chunk-3BDZSWCA.js → chunk-I4E6CLC4.js} +2 -2
- package/dist/cli/chunks/{chunk-T2QVCK56.js → chunk-I4T4JPR2.js} +1 -1
- package/dist/cli/chunks/{chunk-OJ5GBEXU.js → chunk-IBXNBLGM.js} +2 -2
- package/dist/cli/chunks/{chunk-J2LOP3GE.js → chunk-IQNR662U.js} +2 -2
- package/dist/cli/chunks/{chunk-FMAUTL26.js → chunk-J5RJYFRM.js} +2 -2
- package/dist/cli/chunks/{chunk-2UY3X3KE.js → chunk-JCKX2LEJ.js} +9 -9
- package/dist/cli/chunks/{chunk-2ICMLI2T.js → chunk-JKVNZASH.js} +2 -2
- package/dist/cli/chunks/{chunk-IQ363U37.js → chunk-JUICZG3T.js} +2 -2
- package/dist/cli/chunks/{chunk-RP5SDWCL.js → chunk-KCHFF4IE.js} +9 -9
- package/dist/cli/chunks/{chunk-NJUNYXMH.js → chunk-KDFW7MVM.js} +2 -2
- package/dist/cli/chunks/{chunk-DEJW6GYF.js → chunk-KNL3QWVA.js} +2 -2
- package/dist/cli/chunks/{chunk-5Q7X5SDB.js → chunk-KOSKGZK4.js} +2 -2
- package/dist/cli/chunks/{chunk-D2ITP3ON.js → chunk-KYLJERZ3.js} +2 -2
- package/dist/cli/chunks/{chunk-S3QU54ZQ.js → chunk-L2AIES7X.js} +1 -1
- package/dist/cli/chunks/{chunk-YYKZVBIG.js → chunk-L3IFZ4IX.js} +2 -2
- package/dist/cli/chunks/{chunk-42QMNST6.js → chunk-L4N6PTIC.js} +2 -2
- package/dist/cli/chunks/{chunk-I7XQT6YM.js → chunk-LDMG4372.js} +2 -2
- package/dist/cli/chunks/{chunk-NAVH552F.js → chunk-LQ3TA22E.js} +2 -2
- package/dist/cli/chunks/{chunk-2FTSVPVG.js → chunk-LRISVDVO.js} +1 -1
- package/dist/cli/chunks/{chunk-M7TDNJMZ.js → chunk-LXHA55EB.js} +1 -1
- package/dist/cli/chunks/{chunk-HKQ23RPJ.js → chunk-LYVFC7C7.js} +2 -2
- package/dist/cli/chunks/{chunk-BTQA2E2Y.js → chunk-M3M7HXDH.js} +2 -2
- package/dist/cli/chunks/{chunk-BKF3E3UJ.js → chunk-M4HDBRVJ.js} +1 -1
- package/dist/cli/chunks/{chunk-XMCMLPXY.js → chunk-M73IL7FA.js} +2 -2
- package/dist/cli/chunks/{chunk-UDKBQAAH.js → chunk-MF3XRML3.js} +2 -2
- package/dist/cli/chunks/{chunk-E7N6CRFV.js → chunk-MJBXQXSX.js} +1 -1
- package/dist/cli/chunks/{chunk-F6R2TGNS.js → chunk-NLCUQMUR.js} +2 -2
- package/dist/cli/chunks/{chunk-UJTI5MRE.js → chunk-NT4PI5HI.js} +2 -2
- package/dist/cli/chunks/{chunk-I5XEXLBF.js → chunk-NWHSEXHA.js} +1 -1
- package/dist/cli/chunks/{chunk-FPPV7TYI.js → chunk-O3NAUNFC.js} +2 -2
- package/dist/cli/chunks/{chunk-TE27EK44.js → chunk-OGT45MZN.js} +2 -2
- package/dist/cli/chunks/{chunk-RZDMSTAQ.js → chunk-OKGK7DBT.js} +2 -2
- package/dist/cli/chunks/{chunk-X27VMOIH.js → chunk-OUJJ34JH.js} +1 -1
- package/dist/cli/chunks/{chunk-A5LZVQQL.js → chunk-OWMGD7FO.js} +3 -3
- package/dist/cli/chunks/{chunk-AAVOYIKA.js → chunk-P6XYFDXN.js} +1 -1
- package/dist/cli/chunks/{chunk-TLBIFZM4.js → chunk-PNDO4W4L.js} +2 -2
- package/dist/cli/chunks/{chunk-WFVBK7N3.js → chunk-QL3U5VSM.js} +2 -2
- package/dist/cli/chunks/{chunk-6SN55CMC.js → chunk-QU54GUEA.js} +2 -2
- package/dist/cli/chunks/{chunk-YBGQT3OS.js → chunk-QWBO76AU.js} +2 -2
- package/dist/cli/chunks/{chunk-Z6NUCGQA.js → chunk-RARSTEUO.js} +1 -1
- package/dist/cli/chunks/{chunk-JW4N25B5.js → chunk-RF6QKV7M.js} +2 -2
- package/dist/cli/chunks/{chunk-T26ENWX5.js → chunk-RGONSQ44.js} +8 -8
- package/dist/cli/chunks/{chunk-PK3NAZQI.js → chunk-RH3PHCJT.js} +2 -2
- package/dist/cli/chunks/{chunk-WGWOCTQW.js → chunk-S33246T4.js} +1 -1
- package/dist/cli/chunks/{chunk-BXBUUSJN.js → chunk-S4CNA6Z5.js} +3 -3
- package/dist/cli/chunks/{chunk-YL56FMCJ.js → chunk-SCYF5CQA.js} +1 -1
- package/dist/cli/chunks/{chunk-SBDRHY3I.js → chunk-SGONA5GS.js} +2 -2
- package/dist/cli/chunks/{chunk-4YKHVRQH.js → chunk-T7DLX3LS.js} +3 -3
- package/dist/cli/chunks/{chunk-NFIOKKA6.js → chunk-TEJPHJMW.js} +2 -2
- package/dist/cli/chunks/{chunk-FMZ7I4XV.js → chunk-TR7BZLB6.js} +1 -1
- package/dist/cli/chunks/{chunk-VMMPOLUV.js → chunk-U56TIYGP.js} +2 -2
- package/dist/cli/chunks/{chunk-H7V3ZQT7.js → chunk-UCIJCRPB.js} +2 -2
- package/dist/cli/chunks/{chunk-GR732YA3.js → chunk-UCXQQCIP.js} +2 -2
- package/dist/cli/chunks/{chunk-IXOGBA7C.js → chunk-UE3XXKLN.js} +2 -2
- package/dist/cli/chunks/{chunk-KAEWFVGD.js → chunk-UGX4EHT5.js} +2 -2
- package/dist/cli/chunks/{chunk-ICYM7H6T.js → chunk-URVDWF2Y.js} +2 -2
- package/dist/cli/chunks/{chunk-BCD2IMXF.js → chunk-V5TRAL57.js} +2 -2
- package/dist/cli/chunks/{chunk-A7QP5E46.js → chunk-VEOQH4W6.js} +2 -2
- package/dist/cli/chunks/{chunk-CMKNLC3Q.js → chunk-VMJXNTJT.js} +4 -4
- package/dist/cli/chunks/{chunk-PY7PJT2Y.js → chunk-VTIXFHZR.js} +2 -2
- package/dist/cli/chunks/{chunk-YTB7DDLE.js → chunk-VTO5O7DA.js} +1 -1
- package/dist/cli/chunks/{chunk-C7QVMFCJ.js → chunk-W6U7SIIK.js} +3 -3
- package/dist/cli/chunks/{chunk-II6DIMY6.js → chunk-WC6KZDPM.js} +2 -2
- package/dist/cli/chunks/{chunk-4HJVTKJD.js → chunk-WG6I7YF3.js} +1 -1
- package/dist/cli/chunks/{chunk-GWROZUWK.js → chunk-WLLE54TA.js} +1 -1
- package/dist/cli/chunks/{chunk-BBHTM2RF.js → chunk-WVCIZIKH.js} +1 -1
- package/dist/cli/chunks/{chunk-ZAGCKWOC.js → chunk-X4U5NYB6.js} +1 -1
- package/dist/cli/chunks/chunk-X73CRYF4.js +2 -0
- package/dist/cli/chunks/{chunk-GQCIW2ZZ.js → chunk-XFMSHTXG.js} +1 -1
- package/dist/cli/chunks/{chunk-NWWXVXXG.js → chunk-XFUU2RCA.js} +2 -2
- package/dist/cli/chunks/{chunk-WSJN6HFR.js → chunk-Y4I5JBOL.js} +2 -2
- package/dist/cli/chunks/{chunk-XUZ73S3Y.js → chunk-YHNEBCYQ.js} +2 -2
- package/dist/cli/chunks/{chunk-O3MTYRBX.js → chunk-YYDHTBHE.js} +1 -1
- package/dist/cli/chunks/{chunk-6CCKOU2U.js → chunk-Z2SCTEZD.js} +2 -2
- package/dist/cli/chunks/{chunk-72HXOVRN.js → chunk-Z6JLPPAY.js} +1 -1
- package/dist/cli/chunks/{chunk-NZB2JE2D.js → chunk-ZCNVFULO.js} +2 -2
- package/dist/cli/chunks/{chunk-VLZ3LC6L.js → chunk-ZFBMBCKN.js} +2 -2
- package/dist/cli/chunks/{chunk-SMPMLODT.js → chunk-ZYZWBNKT.js} +1 -1
- package/dist/cli/chunks/{ci-GXSOJB6I.js → ci-7TR4NQ5I.js} +2 -2
- package/dist/cli/chunks/{ci-output-GNUGZD2F.js → ci-output-SLTICF3O.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-LAW2AAHF.js → circuit-breaker-7GVVTMBY.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-VF5NUUJZ.js → claude-flow-setup-TYCWYEMM.js} +2 -2
- package/dist/cli/chunks/client-7GB4WWUD.js +2 -0
- package/dist/cli/chunks/{cline-installer-H7RPYI3G.js → cline-installer-ESIAJOLK.js} +2 -2
- package/dist/cli/chunks/{code-COHRPYF6.js → code-I42JGOVI.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-353PWY6B.js → code-index-extractor-2CCXPCQW.js} +2 -2
- package/dist/cli/chunks/{codex-installer-DIXHDH63.js → codex-installer-HEZRDNUT.js} +2 -2
- package/dist/cli/chunks/{completions-NGPREB6E.js → completions-44HLIZGI.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-BO3QCTWT.js → complexity-analyzer-SOCSFDVO.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-SG4HUNX6.js → continuedev-installer-Q7O4HLIM.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-RC6ZFHQG.js → copilot-installer-GIWCVLCS.js} +2 -2
- package/dist/cli/chunks/{cost-tracker-Q76KFISR.js → cost-tracker-G7BONKEV.js} +2 -2
- package/dist/cli/chunks/{coverage-PT23ZOGU.js → coverage-5TWVP7KY.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-7HQ74TLE.js +2 -0
- package/dist/cli/chunks/{cursor-installer-ZDS65WC6.js → cursor-installer-43EQZSB5.js} +2 -2
- package/dist/cli/chunks/{daemon-M32BWOES.js → daemon-QQZE4BU2.js} +4 -4
- package/dist/cli/chunks/{daemon-ZRDBUK4Q.js → daemon-ZXHFRDKG.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-GUPZT7PR.js → dag-attention-scheduler-GOZAVAZQ.js} +2 -2
- package/dist/cli/chunks/{detect-PZNLC2CO.js → detect-X777GVJ4.js} +2 -2
- package/dist/cli/chunks/{dist-node-QO5MMHVF.js → dist-node-EZZK46TB.js} +2 -2
- package/dist/cli/chunks/{domain-handler-OH2YSZCT.js → domain-handler-ZT32DKYY.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-TVTK2YX5.js → domain-transfer-LHQVSLJW.js} +2 -2
- package/dist/cli/chunks/dream-G5SEFHI4.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-2ARE7NCX.js → embed-and-insert-pattern-XFYPPWG7.js} +2 -2
- package/dist/cli/chunks/{eval-64RXRKM4.js → eval-V4NYJZUZ.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-TH7JERGY.js → experience-capture-middleware-HXX2W4GL.js} +3 -3
- package/dist/cli/chunks/{fast-paths-IAWNSJFU.js → fast-paths-RBPWQSFJ.js} +2 -2
- package/dist/cli/chunks/{feature-flags-TAKLIOWM.js → feature-flags-INJJZBMN.js} +2 -2
- package/dist/cli/chunks/{feature-flags-22FDDEFG.js → feature-flags-NX5EXRO3.js} +2 -2
- package/dist/cli/chunks/{file-discovery-QWEHC5VO.js → file-discovery-SNFSG6NK.js} +2 -2
- package/dist/cli/chunks/{fleet-5PQX4H2Q.js → fleet-6SDN4UWE.js} +3 -3
- package/dist/cli/chunks/{gnn-wrapper-RR5EYGCL.js → gnn-wrapper-2JDRTDDK.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-QOVPD6JV.js → heartbeat-handler-QLK6E7KA.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-NG7BY3FR.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-TDSLUI7K.js +2 -0
- package/dist/cli/chunks/hnsw-index-OWLQSOQH.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-RRTRMCEL.js → hnsw-legacy-bridge-Q2ZEZQKB.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-XEIBI22V.js → hnswlib-node-TA4DZV62.js} +2 -2
- package/dist/cli/chunks/{hooks-DTEIDS42.js → hooks-D4YENHO2.js} +53 -53
- package/dist/cli/chunks/{hybrid-router-E36GZC7Q.js → hybrid-router-URU2XLBD.js} +2 -2
- package/dist/cli/chunks/{hypergraph-engine-7VTF3N6A.js → hypergraph-engine-G72U446M.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-CTUGX3DL.js → hypergraph-handler-TRZ5FDRH.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-NMTN75KA.js +2 -0
- package/dist/cli/chunks/{init-handler-HRSUGKSE.js → init-handler-3ZD4GCT4.js} +6 -6
- package/dist/cli/chunks/init-wizard-SHBFYGBV.js +2 -0
- package/dist/cli/chunks/kernel-7KVY2JGO.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-UGB5UY5B.js → kilocode-installer-AXSIW3XW.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-7SAM5O2F.js → kiro-installer-JQGIFWBK.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-V4G5J5B7.js +2 -0
- package/dist/cli/chunks/{learning-GBRPEBXN.js → learning-SPO7TGWX.js} +3 -3
- package/dist/cli/chunks/{llm-router-YP2RW2QC.js → llm-router-G6N2OKDA.js} +4 -4
- package/dist/cli/chunks/{load-3TRJPJBJ.js → load-XIDDK64U.js} +2 -2
- package/dist/cli/chunks/load-test-N4RNPLG4.js +2 -0
- package/dist/cli/chunks/{mcp-U7ZYZTEU.js → mcp-3JXRGXO4.js} +2 -2
- package/dist/cli/chunks/{memory-CLBPDAAE.js → memory-A66KRS2P.js} +5 -5
- package/dist/cli/chunks/memory-backend-HPGJ5YDQ.js +2 -0
- package/dist/cli/chunks/{memory-handlers-JEOU6AOR.js → memory-handlers-K33YVCVQ.js} +2 -2
- package/dist/cli/chunks/{multi-model-executor-MPPD63KI.js → multi-model-executor-XCDGUVCE.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-DIMXI5PK.js → opencode-installer-GELXWLF2.js} +2 -2
- package/dist/cli/chunks/{orchestrator-YKOSNTFS.js → orchestrator-CCS3K6NH.js} +5 -5
- package/dist/cli/chunks/{pipeline-SDCM3CNA.js → pipeline-Z5C72H5S.js} +2 -2
- package/dist/cli/chunks/{platform-7UH4BXN7.js → platform-4AK7XJ3Y.js} +2 -2
- package/dist/cli/chunks/{plugin-KIVAXJ3P.js → plugin-7RYBIZI7.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-PONLGWM6.js → prime-radiant-advanced-wasm-E5PARKRX.js} +2 -2
- package/dist/cli/chunks/protocol-executor-GNVWUJUP.js +2 -0
- package/dist/cli/chunks/{protocol-handler-6RYLLDOG.js → protocol-handler-R6QJQFNL.js} +2 -2
- package/dist/cli/chunks/{prove-PDFFRQQW.js → prove-7ESQ2YAL.js} +2 -2
- package/dist/cli/chunks/{provider-manager-I6R4EQGK.js → provider-manager-HV55NIIO.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-DDSBHO6D.js +2 -0
- package/dist/cli/chunks/{quality-KQVKAGWL.js → quality-4UE345QA.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-BQJ5O63C.js +2 -0
- package/dist/cli/chunks/real-embeddings-TYIVN3N5.js +2 -0
- package/dist/cli/chunks/{roocode-installer-RYPQ25JO.js → roocode-installer-2KOANC47.js} +2 -2
- package/dist/cli/chunks/router-C2RKWB7J.js +2 -0
- package/dist/cli/chunks/routing-feedback-RHATTSJ6.js +2 -0
- package/dist/cli/chunks/{routing-handler-U4FEWPIN.js → routing-handler-JFEYTN7T.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-YID52EZ6.js → ruvector-commands-KSLSZRJX.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-HABBORJW.js → rvf-dual-writer-EPBL226J.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-JE5NWU3J.js → rvf-migration-adapter-25KSI6SF.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-FBIFWTAD.js → rvf-migration-coordinator-2XBYHPZP.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-QG4CXHLL.js +2 -0
- package/dist/cli/chunks/safe-db-A4KQ2IDB.js +2 -0
- package/dist/cli/chunks/schedule-O7MLASQT.js +2 -0
- package/dist/cli/chunks/scheduler-HT7RNYQ2.js +2 -0
- package/dist/cli/chunks/{security-22ERFMD6.js → security-4XWYKI4O.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-YU7XN6ND.js → shared-rvf-adapter-WRZ3HGDQ.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-G5VIQHSN.js → shared-rvf-dual-writer-DX2N5STR.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-4NNKJ6CQ.js +2 -0
- package/dist/cli/chunks/{status-handler-5B3FP2DN.js → status-handler-V75OSXMQ.js} +2 -2
- package/dist/cli/chunks/{structural-health-6YSKVKQG.js → structural-health-TLX3JHZ6.js} +2 -2
- package/dist/cli/chunks/{sync-OFSJUYBU.js → sync-DXZFMVZQ.js} +2 -2
- package/dist/cli/chunks/{sync-2YCW23XX.js → sync-KGBEXUF7.js} +2 -2
- package/dist/cli/chunks/{task-handler-6OIPFSXX.js → task-handler-T3OJ6R7H.js} +2 -2
- package/dist/cli/chunks/{task-handlers-6QY5Q5IH.js → task-handlers-NJYR54AS.js} +3 -3
- package/dist/cli/chunks/{test-VR6EP23Y.js → test-KMVDNNQA.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-OI7N5QBA.js → test-scheduling-R5EQ2XGV.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-HZES3TAA.js → token-bootstrap-PFKVV3RO.js} +2 -2
- package/dist/cli/chunks/{token-usage-2NSXSNS7.js → token-usage-ZLOGA6LR.js} +2 -2
- package/dist/cli/chunks/{transformers-4U4PX5YQ.js → transformers-TNPSPQI3.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-NQ3JYKHC.js → tree-sitter-wasm-parser-A2EEB5BF.js} +2 -2
- package/dist/cli/chunks/{types-YGTXBQ4T.js → types-DIXPI4NR.js} +2 -2
- package/dist/cli/chunks/unified-memory-CMNJVHOJ.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-JQLU2KI6.js +2 -0
- package/dist/cli/chunks/unified-persistence-I25TEDIU.js +2 -0
- package/dist/cli/chunks/{upgrade-GS4EJOHW.js → upgrade-LX5KP6VO.js} +2 -2
- package/dist/cli/chunks/{validate-4X7OETYQ.js → validate-3L6F7M36.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-RSVPLHZQ.js → validate-swarm-FD42ZKAQ.js} +2 -2
- package/dist/cli/chunks/{vibium-SN2J4QEA.js → vibium-GSBSJR53.js} +2 -2
- package/dist/cli/chunks/visual-security-AJJIEV5V.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-ZO6DPXRC.js → web-tree-sitter-TXHMO4BW.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-RGSOOJSH.js → windsurf-installer-3EUZ6RD3.js} +2 -2
- package/dist/cli/chunks/witness-chain-762QQBTN.js +2 -0
- package/dist/cli/chunks/{witness-chain-7XBKRDAW.js → witness-chain-ONAUEJ4M.js} +2 -2
- package/dist/cli/chunks/{workflow-H7KG5R6L.js → workflow-E7A6BV4C.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-ZGPYISKY.js +2 -0
- package/dist/cli/chunks/{wrappers-3YCDNHDG.js → wrappers-AHHAQJM3.js} +2 -2
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.d.ts +3 -3
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +4 -3
- package/dist/cli/commands/hooks-handlers/routing-hooks.js +50 -12
- package/dist/cli/commands/hooks-handlers/task-hooks.js +30 -6
- package/dist/learning/agent-routing.d.ts +13 -1
- package/dist/learning/agent-routing.js +14 -1
- package/dist/learning/embedder-endpoint-client.d.ts +133 -0
- package/dist/learning/embedder-endpoint-client.js +426 -0
- package/dist/learning/embedder-identity-store.d.ts +30 -0
- package/dist/learning/embedder-identity-store.js +136 -0
- package/dist/learning/qe-reasoning-bank.js +15 -5
- package/dist/learning/real-embeddings.d.ts +28 -0
- package/dist/learning/real-embeddings.js +130 -19
- package/dist/learning/sqlite-persistence.js +16 -3
- package/dist/mcp/bundle.js +399 -389
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-JUISYMI3.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-DEIUPULJ.js +0 -2
- package/dist/cli/chunks/base-7SMQWXHT.js +0 -2
- package/dist/cli/chunks/browser-workflow-4DGHRZLS.js +0 -2
- package/dist/cli/chunks/chunk-PHJK33IV.js +0 -2
- package/dist/cli/chunks/chunk-YQRABKOC.js +0 -2
- package/dist/cli/chunks/client-OSUT6W6W.js +0 -2
- package/dist/cli/chunks/cross-domain-router-X5EEGWMA.js +0 -2
- package/dist/cli/chunks/dream-CP4VOPNU.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-MX7EHYU5.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-B7FZYZGZ.js +0 -2
- package/dist/cli/chunks/hnsw-index-7OVB67MX.js +0 -2
- package/dist/cli/chunks/impact-analyzer-TG34YBHU.js +0 -2
- package/dist/cli/chunks/init-wizard-MS3A2X5C.js +0 -2
- package/dist/cli/chunks/kernel-J4IW4DA6.js +0 -2
- package/dist/cli/chunks/knowledge-graph-4LCYX5AN.js +0 -2
- package/dist/cli/chunks/load-test-TFBVT7V3.js +0 -2
- package/dist/cli/chunks/memory-backend-E7OCG27P.js +0 -2
- package/dist/cli/chunks/protocol-executor-MYFH7ZP4.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-G46PVD2U.js +0 -2
- package/dist/cli/chunks/queen-coordinator-ZQRKBBUH.js +0 -2
- package/dist/cli/chunks/real-embeddings-VQXMPAH6.js +0 -2
- package/dist/cli/chunks/router-UBQULTOO.js +0 -2
- package/dist/cli/chunks/routing-feedback-3VBS3SYD.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-NDKSHCMG.js +0 -2
- package/dist/cli/chunks/safe-db-ZPGX4NYW.js +0 -2
- package/dist/cli/chunks/schedule-JZUKDE6O.js +0 -2
- package/dist/cli/chunks/scheduler-7YIQOOW3.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-4STSI5SJ.js +0 -2
- package/dist/cli/chunks/unified-memory-R72C7IBY.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-A4LOFKDQ.js +0 -2
- package/dist/cli/chunks/unified-persistence-MYD2R4LE.js +0 -2
- package/dist/cli/chunks/visual-security-CUKQ5N37.js +0 -2
- package/dist/cli/chunks/witness-chain-S7ADS6TA.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-3GIDXU43.js +0 -2
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persistent store for ADR-097 embedder endpoint identity.
|
|
3
|
+
*
|
|
4
|
+
* Identity is written into the unified memory.db `kv_store` table under
|
|
5
|
+
* namespace `_system`, key `embedder_identity:<safe_endpoint_url>`. This lets
|
|
6
|
+
* us detect cross-run model drift: if the fingerprint changes between AQE
|
|
7
|
+
* processes, vectors written before the change may not be comparable to vectors
|
|
8
|
+
* written after, and the operator should know.
|
|
9
|
+
*
|
|
10
|
+
* Conforms to the project's unified-persistence rule (no new .db files).
|
|
11
|
+
*
|
|
12
|
+
* Persistence failures are non-fatal — callers wrap us in try/catch and log.
|
|
13
|
+
* We never throw out of these helpers under expected conditions; failure
|
|
14
|
+
* reasons are surfaced as thrown errors only for genuine I/O problems.
|
|
15
|
+
*/
|
|
16
|
+
import { join } from 'node:path';
|
|
17
|
+
import { existsSync, mkdirSync } from 'node:fs';
|
|
18
|
+
import { createRequire } from 'node:module';
|
|
19
|
+
// `require` is unavailable in pure ESM; createRequire gives us synchronous
|
|
20
|
+
// access to CommonJS modules like better-sqlite3 from the ESM build output.
|
|
21
|
+
const nodeRequire = createRequire(import.meta.url);
|
|
22
|
+
/**
|
|
23
|
+
* Path to the unified memory.db. Honors AQE_MEMORY_PATH env override (used by
|
|
24
|
+
* tests and platform installers), otherwise falls back to the project default.
|
|
25
|
+
*/
|
|
26
|
+
function getMemoryDbPath() {
|
|
27
|
+
const env = process.env.AQE_MEMORY_PATH;
|
|
28
|
+
if (env && env.length > 0)
|
|
29
|
+
return env;
|
|
30
|
+
return join(process.cwd(), '.agentic-qe', 'memory.db');
|
|
31
|
+
}
|
|
32
|
+
const NAMESPACE = '_system';
|
|
33
|
+
const KEY_PREFIX = 'embedder_identity:';
|
|
34
|
+
let cachedDb = null;
|
|
35
|
+
let openFailed = false;
|
|
36
|
+
/**
|
|
37
|
+
* Lazily open memory.db. We use a dedicated read/write connection (better-sqlite3
|
|
38
|
+
* supports concurrent connections to the same file under WAL mode, which the
|
|
39
|
+
* init wizard enables). Failure to open is cached so we don't retry every call.
|
|
40
|
+
*/
|
|
41
|
+
function openDb() {
|
|
42
|
+
if (cachedDb)
|
|
43
|
+
return cachedDb;
|
|
44
|
+
if (openFailed)
|
|
45
|
+
return null;
|
|
46
|
+
try {
|
|
47
|
+
// Dynamic require (via createRequire — `require` is undefined in ESM) so
|
|
48
|
+
// this module doesn't fail to import when better-sqlite3 is absent in
|
|
49
|
+
// some test environments. The endpoint feature is optional; identity
|
|
50
|
+
// persistence is a nice-to-have on top of it.
|
|
51
|
+
const Database = nodeRequire('better-sqlite3');
|
|
52
|
+
const path = getMemoryDbPath();
|
|
53
|
+
const dir = join(path, '..');
|
|
54
|
+
if (!existsSync(dir)) {
|
|
55
|
+
mkdirSync(dir, { recursive: true });
|
|
56
|
+
}
|
|
57
|
+
const db = new Database(path);
|
|
58
|
+
db.pragma('journal_mode = WAL');
|
|
59
|
+
db.pragma('busy_timeout = 5000');
|
|
60
|
+
db.exec(`
|
|
61
|
+
CREATE TABLE IF NOT EXISTS kv_store (
|
|
62
|
+
key TEXT NOT NULL,
|
|
63
|
+
namespace TEXT NOT NULL,
|
|
64
|
+
value TEXT NOT NULL,
|
|
65
|
+
expires_at INTEGER,
|
|
66
|
+
created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),
|
|
67
|
+
PRIMARY KEY (namespace, key)
|
|
68
|
+
);
|
|
69
|
+
CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);
|
|
70
|
+
`);
|
|
71
|
+
cachedDb = db;
|
|
72
|
+
return db;
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
openFailed = true;
|
|
76
|
+
return null;
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Load the last persisted identity for the given endpoint URL.
|
|
81
|
+
* Returns null when nothing has been stored yet OR when the kv store is unavailable.
|
|
82
|
+
*/
|
|
83
|
+
export function loadEmbedderIdentity(endpointUrl) {
|
|
84
|
+
const db = openDb();
|
|
85
|
+
if (!db)
|
|
86
|
+
return null;
|
|
87
|
+
try {
|
|
88
|
+
const row = db
|
|
89
|
+
.prepare('SELECT value FROM kv_store WHERE namespace = ? AND key = ?')
|
|
90
|
+
.get(NAMESPACE, KEY_PREFIX + endpointUrl);
|
|
91
|
+
if (!row)
|
|
92
|
+
return null;
|
|
93
|
+
const parsed = JSON.parse(row.value);
|
|
94
|
+
if (!parsed.fingerprint || typeof parsed.dim !== 'number')
|
|
95
|
+
return null;
|
|
96
|
+
return {
|
|
97
|
+
fingerprint: parsed.fingerprint,
|
|
98
|
+
dim: parsed.dim,
|
|
99
|
+
endpoint: parsed.endpoint,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
catch {
|
|
103
|
+
return null;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Persist the current identity. Overwrites any prior entry for the same endpoint.
|
|
108
|
+
*/
|
|
109
|
+
export function saveEmbedderIdentity(identity) {
|
|
110
|
+
const db = openDb();
|
|
111
|
+
if (!db)
|
|
112
|
+
return;
|
|
113
|
+
const row = {
|
|
114
|
+
fingerprint: identity.fingerprint,
|
|
115
|
+
dim: identity.dim,
|
|
116
|
+
endpoint: identity.endpoint,
|
|
117
|
+
updatedAt: Date.now(),
|
|
118
|
+
};
|
|
119
|
+
db.prepare('INSERT OR REPLACE INTO kv_store (key, namespace, value) VALUES (?, ?, ?)').run(KEY_PREFIX + identity.endpoint, NAMESPACE, JSON.stringify(row));
|
|
120
|
+
}
|
|
121
|
+
/**
|
|
122
|
+
* For tests: close the cached connection so a fresh DB path can be used.
|
|
123
|
+
*/
|
|
124
|
+
export function resetEmbedderIdentityStore() {
|
|
125
|
+
if (cachedDb) {
|
|
126
|
+
try {
|
|
127
|
+
cachedDb.close();
|
|
128
|
+
}
|
|
129
|
+
catch {
|
|
130
|
+
// ignore
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
cachedDb = null;
|
|
134
|
+
openFailed = false;
|
|
135
|
+
}
|
|
136
|
+
//# sourceMappingURL=embedder-identity-store.js.map
|
|
@@ -25,7 +25,7 @@ import { getWitnessChain } from '../audit/witness-chain.js';
|
|
|
25
25
|
// Import extracted modules
|
|
26
26
|
import { DEFAULT_QE_REASONING_BANK_CONFIG } from './qe-reasoning-bank-types.js';
|
|
27
27
|
import { PRETRAINED_PATTERNS } from './pretrained-patterns.js';
|
|
28
|
-
import { AGENT_CAPABILITIES, calculateAgentScores, applyExplorationPolicy, resolveExplorationRate, deriveTaskType, buildRoutingStateKey,
|
|
28
|
+
import { AGENT_CAPABILITIES, calculateAgentScores, applyExplorationPolicy, resolveExplorationRate, deriveTaskType, buildRoutingStateKey, } from './agent-routing.js';
|
|
29
29
|
import { resolveTopologyCriticalFromSharedMincut } from './routing-topology-gate.js';
|
|
30
30
|
import { getUnifiedMemory } from '../kernel/unified-memory.js';
|
|
31
31
|
import { resizeEmbedding, hashEmbedding } from './embedding-utils.js';
|
|
@@ -417,11 +417,13 @@ export class QEReasoningBank {
|
|
|
417
417
|
// ADR-095: build the Q-value lookup closure from the task's state_key.
|
|
418
418
|
// The state_key MUST match what `updateHookRouterQValue` writes from
|
|
419
419
|
// post-task — buildRoutingStateKey enforces that.
|
|
420
|
+
// ADR-096 (issue #499): state_key dropped `complexityBucket` — the
|
|
421
|
+
// length-keyed bucket fragmented identical tasks across cells so
|
|
422
|
+
// QWEIGHT_RAMP_VISITS=20 was never reached. 3-dim key now.
|
|
420
423
|
const stateKey = buildRoutingStateKey({
|
|
421
424
|
taskType: deriveTaskType(request.task),
|
|
422
425
|
priority: 'normal',
|
|
423
426
|
domain: detectedDomains[0],
|
|
424
|
-
complexityBucket: deriveComplexityBucket(request.task),
|
|
425
427
|
});
|
|
426
428
|
const qValueLookup = this.buildQValueLookup(stateKey);
|
|
427
429
|
// 4. Calculate agent scores (now Q-blended when lookup available)
|
|
@@ -551,7 +553,7 @@ export class QEReasoningBank {
|
|
|
551
553
|
* for ARM64 or when transformers module cannot be loaded.
|
|
552
554
|
*/
|
|
553
555
|
async embed(text) {
|
|
554
|
-
// Try ONNX embeddings if enabled
|
|
556
|
+
// Try ONNX / endpoint embeddings if enabled
|
|
555
557
|
if (this.config.useONNXEmbeddings) {
|
|
556
558
|
try {
|
|
557
559
|
const { computeRealEmbedding } = await import('./real-embeddings.js');
|
|
@@ -563,8 +565,16 @@ export class QEReasoningBank {
|
|
|
563
565
|
return embedding;
|
|
564
566
|
}
|
|
565
567
|
catch (error) {
|
|
566
|
-
//
|
|
567
|
-
//
|
|
568
|
+
// ADR-097: if the external embedder endpoint is configured, we MUST NOT
|
|
569
|
+
// silently fall back to hash embeddings — they would poison the HNSW
|
|
570
|
+
// index by mixing non-comparable vectors. Propagate the throw so the
|
|
571
|
+
// caller can decide (retry, skip the write, etc).
|
|
572
|
+
const { isUsingEndpoint } = await import('./real-embeddings.js');
|
|
573
|
+
if (isUsingEndpoint()) {
|
|
574
|
+
throw error;
|
|
575
|
+
}
|
|
576
|
+
// In-process ARM64 ONNX compatibility issue or module not available —
|
|
577
|
+
// fall through to hash-based embedding (existing pre-ADR-097 behavior).
|
|
568
578
|
if (process.env.DEBUG) {
|
|
569
579
|
logger.warn('ONNX embeddings unavailable, using hash fallback', {
|
|
570
580
|
error: toErrorMessage(error),
|
|
@@ -6,6 +6,7 @@
|
|
|
6
6
|
* Model: all-MiniLM-L6-v2 (384-dimensional sentence embeddings)
|
|
7
7
|
*/
|
|
8
8
|
export { cosineSimilarity } from '../shared/utils/vector-math.js';
|
|
9
|
+
import { type EndpointIdentity } from './embedder-endpoint-client.js';
|
|
9
10
|
/**
|
|
10
11
|
* Embedding model configuration
|
|
11
12
|
*/
|
|
@@ -18,6 +19,24 @@ export interface EmbeddingConfig {
|
|
|
18
19
|
enableCache: boolean;
|
|
19
20
|
/** Maximum cache size */
|
|
20
21
|
maxCacheSize: number;
|
|
22
|
+
/**
|
|
23
|
+
* Optional external embedder endpoint (ADR-097).
|
|
24
|
+
*
|
|
25
|
+
* When set, AQE routes feature-extraction to an OpenAI-compatible
|
|
26
|
+
* `/v1/embeddings` service instead of loading `@huggingface/transformers`
|
|
27
|
+
* in-process. Forms:
|
|
28
|
+
* - `http(s)://host:port` — HTTP transport
|
|
29
|
+
* - `unix:/absolute/path` — HTTP-over-Unix-socket transport
|
|
30
|
+
*
|
|
31
|
+
* Defaults to `process.env.AQE_EMBEDDER_ENDPOINT` when unset.
|
|
32
|
+
* When neither is set, behavior is identical to pre-ADR-097.
|
|
33
|
+
*/
|
|
34
|
+
endpoint?: string;
|
|
35
|
+
/**
|
|
36
|
+
* Bearer token for the embedder endpoint (ADR-097).
|
|
37
|
+
* Defaults to `process.env.AQE_EMBEDDER_TOKEN`. Env-only — never in config files.
|
|
38
|
+
*/
|
|
39
|
+
endpointToken?: string;
|
|
21
40
|
}
|
|
22
41
|
export declare const DEFAULT_EMBEDDING_CONFIG: EmbeddingConfig;
|
|
23
42
|
/**
|
|
@@ -55,4 +74,13 @@ export declare function getEmbeddingDimension(): number;
|
|
|
55
74
|
* Reset initialization state (for testing)
|
|
56
75
|
*/
|
|
57
76
|
export declare function resetInitialization(): void;
|
|
77
|
+
/**
|
|
78
|
+
* ADR-097: Returns true when the embedding pipeline is the external endpoint path,
|
|
79
|
+
* false when it's the in-process transformer (or uninitialized).
|
|
80
|
+
*/
|
|
81
|
+
export declare function isUsingEndpoint(): boolean;
|
|
82
|
+
/**
|
|
83
|
+
* ADR-097: Returns the endpoint identity fingerprint, or null when not using an endpoint.
|
|
84
|
+
*/
|
|
85
|
+
export declare function getEndpointIdentity(): EndpointIdentity | null;
|
|
58
86
|
//# sourceMappingURL=real-embeddings.d.ts.map
|
|
@@ -8,21 +8,50 @@
|
|
|
8
8
|
// Re-export cosineSimilarity from shared utility for backward compatibility
|
|
9
9
|
export { cosineSimilarity } from '../shared/utils/vector-math.js';
|
|
10
10
|
import { toErrorMessage } from '../shared/error-utils.js';
|
|
11
|
+
import { EmbedderEndpointClient, redactEndpoint, } from './embedder-endpoint-client.js';
|
|
12
|
+
import { loadEmbedderIdentity, resetEmbedderIdentityStore, saveEmbedderIdentity, } from './embedder-identity-store.js';
|
|
11
13
|
// Lazy-loaded transformer pipeline
|
|
12
14
|
let pipeline = null;
|
|
13
15
|
let embeddingModel = null;
|
|
14
16
|
let initPromise = null;
|
|
15
17
|
let initializationFailed = false;
|
|
16
18
|
let failureReason = '';
|
|
19
|
+
/**
|
|
20
|
+
* Set when ADR-097 endpoint path is active. Tracked separately so callers
|
|
21
|
+
* (tests, observability) can verify endpoint vs in-process unambiguously.
|
|
22
|
+
*/
|
|
23
|
+
let endpointClient = null;
|
|
24
|
+
let endpointIdentity = null;
|
|
17
25
|
export const DEFAULT_EMBEDDING_CONFIG = {
|
|
18
26
|
modelName: 'Xenova/all-MiniLM-L6-v2',
|
|
19
27
|
quantized: true,
|
|
20
28
|
enableCache: true,
|
|
21
29
|
maxCacheSize: 10000,
|
|
30
|
+
endpoint: process.env.AQE_EMBEDDER_ENDPOINT,
|
|
31
|
+
endpointToken: process.env.AQE_EMBEDDER_TOKEN,
|
|
22
32
|
};
|
|
23
|
-
// Embedding cache (LRU)
|
|
33
|
+
// Embedding cache (LRU). Keys are namespaced by embedding mode to prevent
|
|
34
|
+
// cross-mode collisions (e.g. flipping endpoint on/off mid-process must not
|
|
35
|
+
// return a vector computed under the other mode). See `cacheKey()`.
|
|
24
36
|
const embeddingCache = new Map();
|
|
25
37
|
const CACHE_TTL_MS = 3600000; // 1 hour
|
|
38
|
+
/**
|
|
39
|
+
* Build the cache key for a given text under the current embedding mode.
|
|
40
|
+
* Endpoint mode: `endpoint:<fingerprint>:<text>` — different fingerprints
|
|
41
|
+
* (e.g. after a model swap) get separate cache entries.
|
|
42
|
+
* In-process mode: `inproc:<text>`.
|
|
43
|
+
*
|
|
44
|
+
* Until the endpoint probe completes, calls land under `inproc:` — these get
|
|
45
|
+
* evicted naturally by TTL/LRU after init. Callers should not interleave
|
|
46
|
+
* endpoint-enabled and endpoint-disabled `computeRealEmbedding` against the
|
|
47
|
+
* same text within the cache TTL.
|
|
48
|
+
*/
|
|
49
|
+
function cacheKey(text) {
|
|
50
|
+
if (endpointIdentity) {
|
|
51
|
+
return `endpoint:${endpointIdentity.fingerprint}:${text}`;
|
|
52
|
+
}
|
|
53
|
+
return `inproc:${text}`;
|
|
54
|
+
}
|
|
26
55
|
/**
|
|
27
56
|
* Detect if text is a JSON metrics/internal data string that shouldn't be embedded.
|
|
28
57
|
* These strings have no semantic value for vector search and waste compute.
|
|
@@ -57,7 +86,45 @@ async function initializeModel(config = {}) {
|
|
|
57
86
|
const fullConfig = { ...DEFAULT_EMBEDDING_CONFIG, ...config };
|
|
58
87
|
initPromise = (async () => {
|
|
59
88
|
try {
|
|
60
|
-
//
|
|
89
|
+
// ADR-097: Endpoint branch — when an external embedder endpoint is configured,
|
|
90
|
+
// we MUST NOT import @huggingface/transformers in this process. The cold-load
|
|
91
|
+
// elimination depends on the dynamic import being inside the else branch only.
|
|
92
|
+
if (fullConfig.endpoint) {
|
|
93
|
+
const safeUrl = redactEndpoint(fullConfig.endpoint);
|
|
94
|
+
console.log(`[RealEmbeddings] Using external embedder endpoint: ${safeUrl}`);
|
|
95
|
+
endpointClient = new EmbedderEndpointClient({
|
|
96
|
+
endpoint: fullConfig.endpoint,
|
|
97
|
+
token: fullConfig.endpointToken,
|
|
98
|
+
model: fullConfig.modelName,
|
|
99
|
+
expectedDim: getEmbeddingDimension(),
|
|
100
|
+
});
|
|
101
|
+
// Probe + identity fingerprint. Fails loud on dim mismatch.
|
|
102
|
+
endpointIdentity = await endpointClient.probe();
|
|
103
|
+
console.log(`[RealEmbeddings] Endpoint identity: dim=${endpointIdentity.dim} fingerprint=${endpointIdentity.fingerprint}`);
|
|
104
|
+
// Cross-run drift detection: compare against the last-known identity
|
|
105
|
+
// for this endpoint (memory.db kv_store, namespace _system). If the
|
|
106
|
+
// fingerprint changed since last run, log a loud warning — the operator
|
|
107
|
+
// either intentionally swapped models (fine, but should know) or the
|
|
108
|
+
// remote silently changed (poisoning risk for the existing index).
|
|
109
|
+
try {
|
|
110
|
+
const previous = loadEmbedderIdentity(endpointIdentity.endpoint);
|
|
111
|
+
if (previous && previous.fingerprint !== endpointIdentity.fingerprint) {
|
|
112
|
+
console.warn(`[RealEmbeddings] WARNING: endpoint identity changed since last run. ` +
|
|
113
|
+
`Previous fingerprint=${previous.fingerprint} dim=${previous.dim}, ` +
|
|
114
|
+
`current fingerprint=${endpointIdentity.fingerprint} dim=${endpointIdentity.dim}. ` +
|
|
115
|
+
`Vectors written before this change may no longer be comparable.`);
|
|
116
|
+
}
|
|
117
|
+
saveEmbedderIdentity(endpointIdentity);
|
|
118
|
+
}
|
|
119
|
+
catch (persistErr) {
|
|
120
|
+
// Persistence failure is non-fatal — we still have the in-memory identity
|
|
121
|
+
// for this run. Log so operators see it.
|
|
122
|
+
console.warn(`[RealEmbeddings] Could not persist endpoint identity: ${toErrorMessage(persistErr)}`);
|
|
123
|
+
}
|
|
124
|
+
embeddingModel = createEndpointPipeline(endpointClient);
|
|
125
|
+
return;
|
|
126
|
+
}
|
|
127
|
+
// In-process branch — only here do we import the transformers package.
|
|
61
128
|
const transformers = await import('@huggingface/transformers');
|
|
62
129
|
pipeline = transformers.pipeline;
|
|
63
130
|
console.log(`[RealEmbeddings] Loading model: ${fullConfig.modelName}`);
|
|
@@ -77,6 +144,27 @@ async function initializeModel(config = {}) {
|
|
|
77
144
|
})();
|
|
78
145
|
return initPromise;
|
|
79
146
|
}
|
|
147
|
+
/**
|
|
148
|
+
* Build a FeatureExtractionPipeline-shaped wrapper around the endpoint client.
|
|
149
|
+
* The shape matches `pipeline('feature-extraction', ...)` so the rest of
|
|
150
|
+
* computeRealEmbedding / computeBatchEmbeddings remains unchanged.
|
|
151
|
+
*
|
|
152
|
+
* The endpoint already returns L2-normalized vectors (and we re-normalize on
|
|
153
|
+
* receive inside the client), so the `pooling` / `normalize` options from
|
|
154
|
+
* upstream callers are no-ops here — that's the OpenAI contract.
|
|
155
|
+
*/
|
|
156
|
+
function createEndpointPipeline(client) {
|
|
157
|
+
return async (input) => {
|
|
158
|
+
const texts = Array.isArray(input) ? input : [input];
|
|
159
|
+
const vectors = await client.embed(texts);
|
|
160
|
+
const dim = vectors[0]?.length ?? getEmbeddingDimension();
|
|
161
|
+
const data = new Float32Array(texts.length * dim);
|
|
162
|
+
for (let i = 0; i < vectors.length; i++) {
|
|
163
|
+
data.set(vectors[i], i * dim);
|
|
164
|
+
}
|
|
165
|
+
return { data, dims: [texts.length, dim] };
|
|
166
|
+
};
|
|
167
|
+
}
|
|
80
168
|
/**
|
|
81
169
|
* Compute real embedding using transformer model
|
|
82
170
|
*
|
|
@@ -90,20 +178,21 @@ export async function computeRealEmbedding(text, config = {}) {
|
|
|
90
178
|
if (isNonSemanticText(text)) {
|
|
91
179
|
return new Array(getEmbeddingDimension()).fill(0);
|
|
92
180
|
}
|
|
93
|
-
//
|
|
94
|
-
|
|
95
|
-
const cached = embeddingCache.get(text);
|
|
96
|
-
if (cached && Date.now() - cached.timestamp < CACHE_TTL_MS) {
|
|
97
|
-
return cached.embedding;
|
|
98
|
-
}
|
|
99
|
-
}
|
|
100
|
-
// Ensure model is initialized
|
|
181
|
+
// Ensure model is initialized BEFORE checking cache so the cache key
|
|
182
|
+
// namespace (which depends on endpoint identity) is stable.
|
|
101
183
|
if (!embeddingModel) {
|
|
102
184
|
await initializeModel(config);
|
|
103
185
|
}
|
|
104
186
|
if (!embeddingModel) {
|
|
105
187
|
throw new Error('Embedding model failed to initialize');
|
|
106
188
|
}
|
|
189
|
+
const key = cacheKey(text);
|
|
190
|
+
if (fullConfig.enableCache) {
|
|
191
|
+
const cached = embeddingCache.get(key);
|
|
192
|
+
if (cached && Date.now() - cached.timestamp < CACHE_TTL_MS) {
|
|
193
|
+
return cached.embedding;
|
|
194
|
+
}
|
|
195
|
+
}
|
|
107
196
|
// Compute embedding
|
|
108
197
|
const startTime = performance.now();
|
|
109
198
|
const output = await embeddingModel(text, { pooling: 'mean', normalize: true });
|
|
@@ -121,7 +210,7 @@ export async function computeRealEmbedding(text, config = {}) {
|
|
|
121
210
|
if (oldestKey)
|
|
122
211
|
embeddingCache.delete(oldestKey);
|
|
123
212
|
}
|
|
124
|
-
embeddingCache.set(
|
|
213
|
+
embeddingCache.set(key, { embedding, timestamp: Date.now() });
|
|
125
214
|
}
|
|
126
215
|
return embedding;
|
|
127
216
|
}
|
|
@@ -134,9 +223,16 @@ export async function computeBatchEmbeddings(texts, config = {}) {
|
|
|
134
223
|
const uncachedTexts = [];
|
|
135
224
|
const uncachedIndices = [];
|
|
136
225
|
const results = new Array(texts.length).fill(null);
|
|
226
|
+
// Init BEFORE cache lookup so the cache key namespace is stable.
|
|
227
|
+
if (!embeddingModel) {
|
|
228
|
+
await initializeModel(config);
|
|
229
|
+
}
|
|
230
|
+
if (!embeddingModel) {
|
|
231
|
+
throw new Error('Embedding model failed to initialize');
|
|
232
|
+
}
|
|
137
233
|
if (fullConfig.enableCache) {
|
|
138
234
|
for (let i = 0; i < texts.length; i++) {
|
|
139
|
-
const cached = embeddingCache.get(texts[i]);
|
|
235
|
+
const cached = embeddingCache.get(cacheKey(texts[i]));
|
|
140
236
|
if (cached && Date.now() - cached.timestamp < CACHE_TTL_MS) {
|
|
141
237
|
results[i] = cached.embedding;
|
|
142
238
|
}
|
|
@@ -154,12 +250,6 @@ export async function computeBatchEmbeddings(texts, config = {}) {
|
|
|
154
250
|
}
|
|
155
251
|
// Compute uncached embeddings
|
|
156
252
|
if (uncachedTexts.length > 0) {
|
|
157
|
-
if (!embeddingModel) {
|
|
158
|
-
await initializeModel(config);
|
|
159
|
-
}
|
|
160
|
-
if (!embeddingModel) {
|
|
161
|
-
throw new Error('Embedding model failed to initialize');
|
|
162
|
-
}
|
|
163
253
|
const startTime = performance.now();
|
|
164
254
|
// Process in batches of 32 for memory efficiency
|
|
165
255
|
const BATCH_SIZE = 32;
|
|
@@ -184,7 +274,7 @@ export async function computeBatchEmbeddings(texts, config = {}) {
|
|
|
184
274
|
if (oldestKey)
|
|
185
275
|
embeddingCache.delete(oldestKey);
|
|
186
276
|
}
|
|
187
|
-
embeddingCache.set(uncachedTexts[textIndex], { embedding, timestamp: Date.now() });
|
|
277
|
+
embeddingCache.set(cacheKey(uncachedTexts[textIndex]), { embedding, timestamp: Date.now() });
|
|
188
278
|
}
|
|
189
279
|
}
|
|
190
280
|
}
|
|
@@ -231,5 +321,26 @@ export function resetInitialization() {
|
|
|
231
321
|
initializationFailed = false;
|
|
232
322
|
failureReason = '';
|
|
233
323
|
embeddingCache.clear();
|
|
324
|
+
if (endpointClient) {
|
|
325
|
+
endpointClient.close();
|
|
326
|
+
}
|
|
327
|
+
endpointClient = null;
|
|
328
|
+
endpointIdentity = null;
|
|
329
|
+
// Drop the identity-store's cached DB connection so tests that flip cwd or
|
|
330
|
+
// AQE_MEMORY_PATH between runs don't write into a stale handle.
|
|
331
|
+
resetEmbedderIdentityStore();
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* ADR-097: Returns true when the embedding pipeline is the external endpoint path,
|
|
335
|
+
* false when it's the in-process transformer (or uninitialized).
|
|
336
|
+
*/
|
|
337
|
+
export function isUsingEndpoint() {
|
|
338
|
+
return endpointClient !== null;
|
|
339
|
+
}
|
|
340
|
+
/**
|
|
341
|
+
* ADR-097: Returns the endpoint identity fingerprint, or null when not using an endpoint.
|
|
342
|
+
*/
|
|
343
|
+
export function getEndpointIdentity() {
|
|
344
|
+
return endpointIdentity;
|
|
234
345
|
}
|
|
235
346
|
//# sourceMappingURL=real-embeddings.js.map
|
|
@@ -16,7 +16,7 @@ import { v4 as uuidv4 } from 'uuid';
|
|
|
16
16
|
import { safeJsonParse } from '../shared/safe-json.js';
|
|
17
17
|
import { toErrorMessage } from '../shared/error-utils.js';
|
|
18
18
|
import { getUnifiedMemory } from '../kernel/unified-memory.js';
|
|
19
|
-
import { computeBatchEmbeddings, getEmbeddingDimension } from './real-embeddings.js';
|
|
19
|
+
import { computeBatchEmbeddings, getEmbeddingDimension, isUsingEndpoint, } from './real-embeddings.js';
|
|
20
20
|
import { recordPatternUsage } from './pattern-usage-recorder.js';
|
|
21
21
|
export const DEFAULT_SQLITE_CONFIG = {
|
|
22
22
|
// LEGACY: Ignored when useUnified=true (the default). All data goes to memory.db
|
|
@@ -975,13 +975,26 @@ export class SQLitePatternStore {
|
|
|
975
975
|
}
|
|
976
976
|
if (textsWithIds.length === 0)
|
|
977
977
|
continue;
|
|
978
|
-
// Compute real embeddings via all-MiniLM-L6-v2 (async ONNX inference)
|
|
978
|
+
// Compute real embeddings via all-MiniLM-L6-v2 (async ONNX inference) or
|
|
979
|
+
// the ADR-097 endpoint. We MUST NOT silently fall back to hash embeddings
|
|
980
|
+
// when the endpoint is configured — mixing hash and transformer vectors in
|
|
981
|
+
// the same HNSW index poisons it (vectors are not comparable). When the
|
|
982
|
+
// endpoint is active we propagate the failure: a future backfill will
|
|
983
|
+
// retry; the existing hash-fallback path is preserved only for the
|
|
984
|
+
// in-process transformer-load failure case.
|
|
979
985
|
let embeddings;
|
|
980
986
|
try {
|
|
981
987
|
embeddings = await computeBatchEmbeddings(textsWithIds.map(t => t.text));
|
|
982
988
|
}
|
|
983
989
|
catch (e) {
|
|
984
|
-
|
|
990
|
+
if (isUsingEndpoint()) {
|
|
991
|
+
// Endpoint failed (or breaker open). Skip this batch entirely — do NOT
|
|
992
|
+
// poison the index. Re-throw so caller knows the run was incomplete.
|
|
993
|
+
throw new Error(`[SQLitePatternStore] external embedder endpoint failed during backfill; ` +
|
|
994
|
+
`aborting to protect HNSW index. Original error: ${toErrorMessage(e)}`);
|
|
995
|
+
}
|
|
996
|
+
// In-process transformer path: hash fallback is acceptable because the
|
|
997
|
+
// entire index in this mode is hash-based anyway.
|
|
985
998
|
console.warn(`[SQLitePatternStore] Transformer unavailable, falling back to hash embeddings: ${toErrorMessage(e)}`);
|
|
986
999
|
method = 'hash-fallback';
|
|
987
1000
|
embeddings = textsWithIds.map(t => hashEmbedding(t.text, dimension));
|