agentic-qe 3.11.4 → 3.11.5
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/hooks/aqe-hook.cjs +44 -10
- package/.claude/skills/skills-manifest.json +1 -1
- package/CHANGELOG.md +58 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/dist/audit/witness-chain.d.ts +25 -0
- package/dist/audit/witness-chain.js +69 -22
- package/dist/audit/witness-key-manager.d.ts +11 -0
- package/dist/audit/witness-key-manager.js +24 -0
- package/dist/cli/brain-commands.js +2 -1
- package/dist/cli/bundle.js +5 -5
- package/dist/cli/chunks/adapter-KNM5R47J.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-62I6ZNRW.js → agent-booster-wasm-CSTBLNYZ.js} +2 -2
- package/dist/cli/chunks/{agent-handler-E2TZKKBS.js → agent-handler-M4W4GTXN.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-JHAHC2NH.js → agent-memory-branch-VGXFYLSQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-MXPJLVR3.js +2 -0
- package/dist/cli/chunks/{arena-72ZV65BR.js → arena-FKSD3LLM.js} +4 -4
- package/dist/cli/chunks/{arena-KLG3YSSR.js → arena-IQBRGWAG.js} +2 -2
- package/dist/cli/chunks/audit-7NSGRR4Z.js +3 -0
- package/dist/cli/chunks/base-X4EXQ2AS.js +2 -0
- package/dist/cli/chunks/{hnswlib-node-LAFK5QZ4.js → better-sqlite3-2KR4LQRU.js} +2 -2
- package/dist/cli/chunks/brain-handler-M6A3UB66.js +89 -0
- package/dist/cli/chunks/{branch-enumerator-C7MPNYT7.js → branch-enumerator-2JGKY4BB.js} +2 -2
- package/dist/cli/chunks/{browser-UUDUDYLR.js → browser-J43WQPJL.js} +2 -2
- package/dist/cli/chunks/browser-workflow-4HX6RP5F.js +2 -0
- package/dist/cli/chunks/{chunk-UJMTKXPI.js → chunk-26WEI3P4.js} +2 -2
- package/dist/cli/chunks/{chunk-TQ373GGI.js → chunk-2XPMATEK.js} +2 -2
- package/dist/cli/chunks/{chunk-QJ5NCYJ3.js → chunk-2XQHG56O.js} +2 -2
- package/dist/cli/chunks/{chunk-EONKMHKO.js → chunk-354367AP.js} +2 -2
- package/dist/cli/chunks/{chunk-THKZVOZV.js → chunk-37ZUF5NX.js} +1 -1
- package/dist/cli/chunks/{chunk-5P7Q5YNC.js → chunk-3I4TCMOJ.js} +1 -1
- package/dist/cli/chunks/{chunk-PQUXFSN6.js → chunk-3JF5A72M.js} +2 -2
- package/dist/cli/chunks/{chunk-B5XUWHKQ.js → chunk-3LY7OCSO.js} +1 -1
- package/dist/cli/chunks/{chunk-HJ24KMC2.js → chunk-3V36WMIO.js} +1 -1
- package/dist/cli/chunks/{chunk-6JUOH6L4.js → chunk-3WR35GFF.js} +2 -2
- package/dist/cli/chunks/{chunk-T76RFXQX.js → chunk-4LODYRNV.js} +2 -2
- package/dist/cli/chunks/{chunk-D5S47YUS.js → chunk-4MHN7JWC.js} +3 -3
- package/dist/cli/chunks/chunk-4QOI5JS7.js +14 -0
- package/dist/cli/chunks/{chunk-63QUN3JK.js → chunk-4RTWPR3X.js} +1 -1
- package/dist/cli/chunks/chunk-4XJ2A3HY.js +65 -0
- package/dist/cli/chunks/{chunk-KUZMVH6N.js → chunk-4Y3LGBKJ.js} +3 -3
- package/dist/cli/chunks/{chunk-JFLSQH2X.js → chunk-52U5BFZP.js} +2 -2
- package/dist/cli/chunks/{chunk-YNK6SUPU.js → chunk-53YOYZW5.js} +2 -2
- package/dist/cli/chunks/{chunk-O7PVZ32A.js → chunk-5WMU7XCF.js} +1 -1
- package/dist/cli/chunks/{chunk-ZKCKOQJI.js → chunk-62OTU2AP.js} +2 -2
- package/dist/cli/chunks/{chunk-3SKIZDKL.js → chunk-62UM7Q5N.js} +1 -1
- package/dist/cli/chunks/{chunk-SFDUT5WM.js → chunk-6Q57K4YD.js} +2 -2
- package/dist/cli/chunks/{chunk-3SBUL72V.js → chunk-6R3YOAKO.js} +2 -2
- package/dist/cli/chunks/chunk-6T65OKUM.js +2 -0
- package/dist/cli/chunks/{chunk-TCVEKRPI.js → chunk-7BCRULCP.js} +2 -2
- package/dist/cli/chunks/{chunk-VKJQAKYG.js → chunk-7DTMENY6.js} +2 -2
- package/dist/cli/chunks/{chunk-XQ6DW5FV.js → chunk-7KXPNNMR.js} +2 -2
- package/dist/cli/chunks/{chunk-N2BJN6AO.js → chunk-7P6X4BFO.js} +3 -3
- package/dist/cli/chunks/{chunk-SL3SNOO2.js → chunk-7YSBATSN.js} +2 -2
- package/dist/cli/chunks/{chunk-5U2WHPXL.js → chunk-ABU64UWB.js} +1 -1
- package/dist/cli/chunks/{chunk-4RHNPRAP.js → chunk-AF6P5RWY.js} +2 -2
- package/dist/cli/chunks/{chunk-4JFH3MVA.js → chunk-AGJOGUP5.js} +1 -1
- package/dist/cli/chunks/{chunk-5Z4FBCBK.js → chunk-AL5VJJN4.js} +1 -1
- package/dist/cli/chunks/{chunk-Z2REKBD6.js → chunk-AOQYORVA.js} +2 -2
- package/dist/cli/chunks/{chunk-X64BEXUY.js → chunk-AOXJFDH5.js} +117 -113
- package/dist/cli/chunks/{chunk-DRMHVY4T.js → chunk-AXKWV5NF.js} +4 -4
- package/dist/cli/chunks/{chunk-3FJZMQJ7.js → chunk-B2VBDMDI.js} +2 -2
- package/dist/cli/chunks/{chunk-ARPBG6FQ.js → chunk-BJLA2IX7.js} +2 -2
- package/dist/cli/chunks/{chunk-6W3QHS45.js → chunk-BLPWJQTY.js} +2 -2
- package/dist/cli/chunks/{chunk-O5NEJIHB.js → chunk-BTLUWH4R.js} +2 -2
- package/dist/cli/chunks/{chunk-Y4AXOHW4.js → chunk-C4EZNOWK.js} +1 -1
- package/dist/cli/chunks/{chunk-FRFVN6AA.js → chunk-C5C4W572.js} +2 -2
- package/dist/cli/chunks/{chunk-7AWK43JN.js → chunk-CDJP6COA.js} +2 -2
- package/dist/cli/chunks/{chunk-VJGHRWMH.js → chunk-CKOF27L7.js} +2 -2
- package/dist/cli/chunks/{chunk-3E7D3A35.js → chunk-D45QLJEL.js} +1 -1
- package/dist/cli/chunks/{chunk-MALOUGSF.js → chunk-DFRRWOEX.js} +2 -2
- package/dist/cli/chunks/{chunk-JDFPAJGB.js → chunk-DLBVADWQ.js} +92 -92
- package/dist/cli/chunks/{chunk-7IKWF2AD.js → chunk-DPL762HU.js} +1 -1
- package/dist/cli/chunks/{chunk-RFQBDMAP.js → chunk-DVW66FPU.js} +1 -1
- package/dist/cli/chunks/{chunk-JPENUVCI.js → chunk-EDOGRFAG.js} +1 -1
- package/dist/cli/chunks/{chunk-HWBMYR5W.js → chunk-EEKG35K5.js} +5 -5
- package/dist/cli/chunks/{chunk-WQZ2WRO4.js → chunk-EK3HPH6A.js} +1 -1
- package/dist/cli/chunks/{chunk-WZYNY3VF.js → chunk-FGD6HINU.js} +1 -1
- package/dist/cli/chunks/{chunk-ZSBJNE35.js → chunk-FGSIID5C.js} +2 -2
- package/dist/cli/chunks/{chunk-TCWR6TDN.js → chunk-FHTYEAQ3.js} +2 -2
- package/dist/cli/chunks/{chunk-BRLUNIR4.js → chunk-FII3WCCY.js} +2 -2
- package/dist/cli/chunks/{chunk-VCUCD3B5.js → chunk-FIPKIIMS.js} +2 -2
- package/dist/cli/chunks/{chunk-6545AS2J.js → chunk-FMNXHVIN.js} +2 -2
- package/dist/cli/chunks/{chunk-VO6YJGB4.js → chunk-G2ZIJZJ7.js} +2 -2
- package/dist/cli/chunks/{chunk-7ADD2ZQL.js → chunk-GODAWJMZ.js} +2 -2
- package/dist/cli/chunks/{chunk-AQIEK4SY.js → chunk-GW6XWMX2.js} +2 -2
- package/dist/cli/chunks/{chunk-GOQ4P2PB.js → chunk-HC6KTVFR.js} +2 -2
- package/dist/cli/chunks/{chunk-2KNFS3L5.js → chunk-HJWT4KME.js} +1 -1
- package/dist/cli/chunks/{chunk-NV3TXXOW.js → chunk-I3ANRYQ6.js} +2 -2
- package/dist/cli/chunks/{chunk-IQBZBUP5.js → chunk-I3NWKPXJ.js} +2 -2
- package/dist/cli/chunks/chunk-IBDQWKI3.js +2 -0
- package/dist/cli/chunks/{chunk-LW5DHT3Z.js → chunk-IU5RSN6M.js} +2 -2
- package/dist/cli/chunks/{chunk-XHRLBJTM.js → chunk-J5XDKVI7.js} +2 -2
- package/dist/cli/chunks/{chunk-QEVX4GWF.js → chunk-J6PFPY7V.js} +2 -2
- package/dist/cli/chunks/{chunk-AE6HXMOG.js → chunk-JATLFS6A.js} +1 -1
- package/dist/cli/chunks/{chunk-HJO4RNOW.js → chunk-JBKZ5TUM.js} +2 -2
- package/dist/cli/chunks/{chunk-7QTB5XIQ.js → chunk-JDSHUECG.js} +2 -2
- package/dist/cli/chunks/{chunk-GRQ36XUH.js → chunk-K4C25BWV.js} +2 -2
- package/dist/cli/chunks/{chunk-BMQDELPA.js → chunk-K4I7UIU5.js} +1 -1
- package/dist/cli/chunks/{chunk-AJXGGTX7.js → chunk-KP3R2M2G.js} +1 -1
- package/dist/cli/chunks/chunk-KQVIWE3W.js +2 -0
- package/dist/cli/chunks/{chunk-ZFCVT43J.js → chunk-KVVJVMDM.js} +2 -2
- package/dist/cli/chunks/{chunk-WMIRAD3J.js → chunk-LOE2JETO.js} +2 -2
- package/dist/cli/chunks/{chunk-54B6P2WS.js → chunk-LPR2R3AN.js} +3 -3
- package/dist/cli/chunks/{chunk-EZRHSHOQ.js → chunk-M6FW56MV.js} +2 -2
- package/dist/cli/chunks/{chunk-IF3HPQNV.js → chunk-MCHEUSY4.js} +1 -1
- package/dist/cli/chunks/{chunk-NBBLPDJX.js → chunk-MEIU7457.js} +2 -2
- package/dist/cli/chunks/{chunk-4BFCLSDN.js → chunk-MHMQ6MCT.js} +2 -2
- package/dist/cli/chunks/{chunk-UQ72K44T.js → chunk-MIU5RUBJ.js} +2 -2
- package/dist/cli/chunks/{chunk-LKURMUBU.js → chunk-MMEXHZUC.js} +37 -12
- package/dist/cli/chunks/{chunk-SRVTNG6L.js → chunk-MTBGOWJA.js} +2 -2
- package/dist/cli/chunks/{chunk-TPMBFARK.js → chunk-NCSXLMDL.js} +67 -22
- package/dist/cli/chunks/{chunk-TU6YN43Q.js → chunk-O7J54OHN.js} +1 -1
- package/dist/cli/chunks/{chunk-JCTCM6IR.js → chunk-OGNTCZKK.js} +1 -1
- package/dist/cli/chunks/{chunk-FSGMRQFC.js → chunk-OS2HHJTM.js} +2 -2
- package/dist/cli/chunks/{chunk-TSWF3AGQ.js → chunk-OS62Y77J.js} +2 -2
- package/dist/cli/chunks/{chunk-VQU7DMEY.js → chunk-PVDXNQPL.js} +2 -2
- package/dist/cli/chunks/{chunk-DNOU2HVQ.js → chunk-PW72M2FE.js} +2 -2
- package/dist/cli/chunks/{chunk-HH6NCBSP.js → chunk-Q5TR6ETB.js} +22 -22
- package/dist/cli/chunks/{chunk-PFWJQPUC.js → chunk-QKK7VBVB.js} +2 -2
- package/dist/cli/chunks/{chunk-JNQN5DNS.js → chunk-RFLHPLET.js} +1 -1
- package/dist/cli/chunks/{chunk-IB3ZPLFA.js → chunk-RJN2RM76.js} +2 -2
- package/dist/cli/chunks/{chunk-PEIQDQXN.js → chunk-RKXZLTWR.js} +2 -2
- package/dist/cli/chunks/{chunk-5VSQAGA2.js → chunk-SE3JFUKP.js} +1 -1
- package/dist/cli/chunks/{chunk-LMJUMUQJ.js → chunk-SK754ZSH.js} +4 -4
- package/dist/cli/chunks/{chunk-UCYTY4LG.js → chunk-SO6G4IX3.js} +2 -2
- package/dist/cli/chunks/{chunk-ICCTQ5LO.js → chunk-SUL3I6QZ.js} +2 -2
- package/dist/cli/chunks/{chunk-G3TFNY4T.js → chunk-TBT3OFRW.js} +2 -2
- package/dist/cli/chunks/{chunk-AYGEWPN4.js → chunk-TEIWJ3GJ.js} +1 -1
- package/dist/cli/chunks/{chunk-YKSWC7I4.js → chunk-TRNBQFFG.js} +8 -20
- package/dist/cli/chunks/{chunk-NSPCZPTB.js → chunk-TTJJ4DQE.js} +2 -2
- package/dist/cli/chunks/{chunk-2WPSMQIL.js → chunk-UBI2EOS3.js} +1 -1
- package/dist/cli/chunks/{chunk-ADFKY3X2.js → chunk-UBY322ED.js} +2 -2
- package/dist/cli/chunks/{chunk-QSDIY3E2.js → chunk-UORTQXJ2.js} +1 -1
- package/dist/cli/chunks/{chunk-ODZSQVEW.js → chunk-URP75DL4.js} +1 -1
- package/dist/cli/chunks/{chunk-37ZDGJ3H.js → chunk-V6NAB5UZ.js} +1 -1
- package/dist/cli/chunks/{chunk-YZ5EQR37.js → chunk-VMFAANWX.js} +2 -2
- package/dist/cli/chunks/{chunk-NFJT7XXR.js → chunk-VMWRMINE.js} +1 -1
- package/dist/cli/chunks/{chunk-MCT4CD5M.js → chunk-VN2HHBZN.js} +2 -2
- package/dist/cli/chunks/{chunk-QMC5MTBV.js → chunk-W72FJA2H.js} +2 -2
- package/dist/cli/chunks/chunk-W7TYKPLY.js +27 -0
- package/dist/cli/chunks/{chunk-YUHM72VQ.js → chunk-WHHQIL4F.js} +2 -2
- package/dist/cli/chunks/{chunk-4YT5YN5G.js → chunk-WMZ2QGGS.js} +2 -2
- package/dist/cli/chunks/{chunk-Q7ORVHJB.js → chunk-WPSK237F.js} +3 -3
- package/dist/cli/chunks/{chunk-ZYZT2CDX.js → chunk-XKQY2Z3Q.js} +1 -1
- package/dist/cli/chunks/{chunk-WNMDWP5A.js → chunk-XLT3FYS7.js} +2 -2
- package/dist/cli/chunks/{chunk-U34OZXD6.js → chunk-XT4TDLOB.js} +2 -2
- package/dist/cli/chunks/{chunk-6GYGAW53.js → chunk-Y25PO65W.js} +2 -2
- package/dist/cli/chunks/{chunk-3SRPFBU7.js → chunk-Y6DWJKHU.js} +3 -3
- package/dist/cli/chunks/{chunk-D6CKKNYC.js → chunk-YBPLJRVT.js} +2 -2
- package/dist/cli/chunks/{chunk-LLUPRGOR.js → chunk-YFCULQBP.js} +2 -2
- package/dist/cli/chunks/{chunk-HT6WAYIR.js → chunk-YGVDP6X7.js} +1 -1
- package/dist/cli/chunks/{chunk-RCPD6F4R.js → chunk-YR2JKBZO.js} +2 -2
- package/dist/cli/chunks/{chunk-P6S6ZVB5.js → chunk-YZSTZUGJ.js} +1 -1
- package/dist/cli/chunks/{chunk-CNF3ZWLM.js → chunk-ZG5UAEEO.js} +2 -2
- package/dist/cli/chunks/{chunk-MWFJC5HR.js → chunk-ZLBY25MB.js} +1 -1
- package/dist/cli/chunks/chunk-ZMPAM4DY.js +2 -0
- package/dist/cli/chunks/{chunk-A4OMK3FO.js → chunk-ZPP57WQU.js} +2 -2
- package/dist/cli/chunks/{chunk-U3AVZGQA.js → chunk-ZXEWTZFR.js} +1 -1
- package/dist/cli/chunks/{ci-HQCRSCC7.js → ci-CBNVLOOQ.js} +2 -2
- package/dist/cli/chunks/{ci-output-YBVXLA6O.js → ci-output-I4HY2FYJ.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-ULGMF2QN.js → circuit-breaker-5VRBKGWL.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-MKZ2LJXK.js → claude-flow-setup-XPJPKHIO.js} +2 -2
- package/dist/cli/chunks/client-AHXNCOHK.js +2 -0
- package/dist/cli/chunks/{cline-installer-WZQ6XBWN.js → cline-installer-OFRDUUWZ.js} +2 -2
- package/dist/cli/chunks/{code-H3KGH45S.js → code-QIZQVB3E.js} +2 -2
- package/dist/cli/chunks/{code-index-extractor-NUVEAJ7C.js → code-index-extractor-LMUUWEX4.js} +2 -2
- package/dist/cli/chunks/{codex-installer-JQI6E6CV.js → codex-installer-N2MKIZ2S.js} +2 -2
- package/dist/cli/chunks/{completions-NDF4PFE7.js → completions-Y36S3C5J.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-XCZH66HG.js → complexity-analyzer-73YS3WUD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-Z4AJGZ7S.js → continuedev-installer-SAOTP6J3.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-K4IPAL7C.js → copilot-installer-A4HXF6HE.js} +2 -2
- package/dist/cli/chunks/core-handlers-EEFLLMAZ.js +2 -0
- package/dist/cli/chunks/{cost-tracker-35KXAB23.js → cost-tracker-P26XUVZS.js} +2 -2
- package/dist/cli/chunks/{coverage-QW5I4TYZ.js → coverage-HVNHSMVJ.js} +3 -3
- package/dist/cli/chunks/cross-domain-router-LT3H4SNJ.js +2 -0
- package/dist/cli/chunks/{cursor-installer-P4Z7RMIZ.js → cursor-installer-46BQFTYZ.js} +2 -2
- package/dist/cli/chunks/{daemon-WQWTCYBM.js → daemon-Y54O3FLT.js} +3 -3
- package/dist/cli/chunks/daemon-YE7K2AZF.js +10 -0
- package/dist/cli/chunks/{dag-attention-scheduler-7XD2VGON.js → dag-attention-scheduler-ETA7YY52.js} +2 -2
- package/dist/cli/chunks/{detect-GZ3P4DI7.js → detect-5WLQ2J3E.js} +2 -2
- package/dist/cli/chunks/{dist-node-6WWAW7OP.js → dist-node-45WW6I7J.js} +2 -2
- package/dist/cli/chunks/{domain-handler-3GTLWARQ.js → domain-handler-J7DQV74M.js} +2 -2
- package/dist/cli/chunks/domain-transfer-GD2EGQVR.js +2 -0
- package/dist/cli/chunks/dream-4K3BK4IG.js +2 -0
- package/dist/cli/chunks/{embed-and-insert-pattern-BGIMA77V.js → embed-and-insert-pattern-JELNEA2D.js} +2 -2
- package/dist/cli/chunks/{eval-SXV6DRDD.js → eval-A4PA5G2U.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-TT6WCT2S.js → experience-capture-middleware-MLHTYWTA.js} +3 -3
- package/dist/cli/chunks/{fast-paths-HTAZHEQP.js → fast-paths-QYDTITRV.js} +2 -2
- package/dist/cli/chunks/{feature-flags-WBUKU54W.js → feature-flags-H4MSY26Z.js} +2 -2
- package/dist/cli/chunks/{feature-flags-DIE3Z2B4.js → feature-flags-MQYYRHIK.js} +2 -2
- package/dist/cli/chunks/{file-discovery-SKDETFS3.js → file-discovery-RMFVJNGL.js} +2 -2
- package/dist/cli/chunks/{fleet-WCWEPAVU.js → fleet-7KZQOTAC.js} +4 -4
- package/dist/cli/chunks/{gnn-wrapper-KWZOWBYS.js → gnn-wrapper-NMZFTGVH.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-3AGYHVG2.js → heartbeat-handler-7BQDK7MG.js} +4 -4
- package/dist/cli/chunks/heartbeat-scheduler-IMPPGQUK.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-EIAA6R2L.js +2 -0
- package/dist/cli/chunks/hnsw-index-ZXXP6AXZ.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-6OJJDZHL.js → hnsw-legacy-bridge-TPPGBPKF.js} +2 -2
- package/dist/cli/chunks/{better-sqlite3-URULPKRF.js → hnswlib-node-E6NSZPP2.js} +2 -2
- package/dist/cli/chunks/{hooks-OXEBTLXV.js → hooks-CYZIUYSH.js} +48 -52
- package/dist/cli/chunks/hybrid-router-LXWG4MLH.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-NL74PRHD.js → hypergraph-engine-WC6DMTYQ.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-KZ54AEEL.js → hypergraph-handler-GTGA3TXJ.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-TP5LRFYH.js +2 -0
- package/dist/cli/chunks/{init-handler-XKZXRXPG.js → init-handler-N3Z72JNI.js} +6 -6
- package/dist/cli/chunks/init-wizard-AIOA5KOY.js +2 -0
- package/dist/cli/chunks/kernel-SQALRU6Q.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-WISQMJK7.js → kilocode-installer-FUX4V6II.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-O7TBB3GM.js → kiro-installer-ZSNZT7ZR.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-JFVT6SNN.js +2 -0
- package/dist/cli/chunks/{learning-6IZBGVRU.js → learning-UQY64COU.js} +3 -3
- package/dist/cli/chunks/{llm-router-QDMQPPQ7.js → llm-router-CMHGGX6N.js} +4 -4
- package/dist/cli/chunks/llm-router-service-XHFKTH3I.js +2 -0
- package/dist/cli/chunks/{load-KLAJJGL5.js → load-E6WH4QN2.js} +2 -2
- package/dist/cli/chunks/load-test-JEIFJKNN.js +2 -0
- package/dist/cli/chunks/{mcp-SZOPQZIZ.js → mcp-UM5VTW6N.js} +2 -2
- package/dist/cli/chunks/{memory-G3WY74C6.js → memory-7Q3XDUE5.js} +5 -5
- package/dist/cli/chunks/memory-backend-NT7I37CP.js +2 -0
- package/dist/cli/chunks/memory-handlers-746D7NE7.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-TDNQGTOT.js → multi-model-executor-LZENWVRR.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-NGYGEDMV.js → opencode-installer-O2JAIPLF.js} +2 -2
- package/dist/cli/chunks/{orchestrator-KPI5DY2C.js → orchestrator-DKZWXDRI.js} +5 -5
- package/dist/cli/chunks/pattern-null-store-6QU6WHDW.js +2 -0
- package/dist/cli/chunks/pattern-usage-recorder-CLUL4M55.js +2 -0
- package/dist/cli/chunks/{pipeline-CSDCC675.js → pipeline-2VDLTR5J.js} +2 -2
- package/dist/cli/chunks/{platform-Q5XKEVKH.js → platform-4N4Q5XYX.js} +2 -2
- package/dist/cli/chunks/{plugin-XKKR3GVL.js → plugin-GY5AU5CS.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-22QVNKEN.js → prime-radiant-advanced-wasm-TQ4DKDZS.js} +2 -2
- package/dist/cli/chunks/protocol-executor-GT2MZYUU.js +2 -0
- package/dist/cli/chunks/{protocol-handler-REQKTJGG.js → protocol-handler-T3LZ3WRG.js} +2 -2
- package/dist/cli/chunks/{prove-NOFUFSQN.js → prove-OV7S5J4W.js} +2 -2
- package/dist/cli/chunks/provider-manager-OATJ7R3D.js +2 -0
- package/dist/cli/chunks/qe-reasoning-bank-IJXNQ67O.js +2 -0
- package/dist/cli/chunks/{quality-3DQ2H5TK.js → quality-AXD4NLQA.js} +2 -2
- package/dist/cli/chunks/queen-coordinator-6RBHWCUG.js +2 -0
- package/dist/cli/chunks/{real-embeddings-FCGNYWLL.js → real-embeddings-2PUCC7FG.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-HX3CNRIR.js → roocode-installer-WJ5ARGLW.js} +2 -2
- package/dist/cli/chunks/router-XKQRT5JK.js +2 -0
- package/dist/cli/chunks/routing-feedback-ACPSD4LW.js +2 -0
- package/dist/cli/chunks/{routing-handler-YRZ2LDCR.js → routing-handler-CU6657SZ.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-GCQVBJ4E.js → ruvector-commands-IIF6VSFW.js} +2 -2
- package/dist/cli/chunks/{rvf-dual-writer-B562P3ZC.js → rvf-dual-writer-YMQI7XO2.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-adapter-NAGFKCMD.js → rvf-migration-adapter-HDE3PR2W.js} +2 -2
- package/dist/cli/chunks/{rvf-migration-coordinator-WWFBEJ5Q.js → rvf-migration-coordinator-MQV5OA7K.js} +2 -2
- package/dist/cli/chunks/rvf-native-adapter-SIWRKE33.js +2 -0
- package/dist/cli/chunks/safe-db-LCPUYMX4.js +2 -0
- package/dist/cli/chunks/schedule-HIQJCWXG.js +2 -0
- package/dist/cli/chunks/scheduler-QE5EJ5LE.js +2 -0
- package/dist/cli/chunks/{security-IFOYTD75.js → security-UM3IGDSM.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-TYD5TQ35.js → shared-rvf-adapter-I3SOJ6M4.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-YGOOVDQZ.js → shared-rvf-dual-writer-KQGC2UO7.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-EU54UTMH.js +2 -0
- package/dist/cli/chunks/status-handler-OX4CJZME.js +46 -0
- package/dist/cli/chunks/{structural-health-KZI6YMKV.js → structural-health-PYUMVBXJ.js} +2 -2
- package/dist/cli/chunks/{sync-Z5BDDBMK.js → sync-2TED3YTY.js} +2 -2
- package/dist/cli/chunks/{sync-ABZNNYRC.js → sync-VALFNTA6.js} +2 -2
- package/dist/cli/chunks/{task-handler-5ACZEPJ7.js → task-handler-VPGAJVPC.js} +2 -2
- package/dist/cli/chunks/{task-handlers-UZWDPL6A.js → task-handlers-IB4UAMU6.js} +3 -3
- package/dist/cli/chunks/{test-APO3MCVV.js → test-OMRJOZB6.js} +4 -4
- package/dist/cli/chunks/{test-scheduling-EFZA5G5C.js → test-scheduling-ZL3YFPBU.js} +3 -3
- package/dist/cli/chunks/{token-bootstrap-J2OPLNUK.js → token-bootstrap-DNWZI7SH.js} +2 -2
- package/dist/cli/chunks/{token-usage-VHWVNN4R.js → token-usage-IYO7RGFF.js} +2 -2
- package/dist/cli/chunks/{transformers-PX4HPO75.js → transformers-53ALC34T.js} +2 -2
- package/dist/cli/chunks/{tree-sitter-wasm-parser-44HA2Z3F.js → tree-sitter-wasm-parser-WUKJ2I2Q.js} +2 -2
- package/dist/cli/chunks/{types-IMOP7F4R.js → types-47FTEPMV.js} +2 -2
- package/dist/cli/chunks/unified-memory-CJLMC2I4.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-FDGR4D2J.js +2 -0
- package/dist/cli/chunks/unified-persistence-UFH5GLDN.js +2 -0
- package/dist/cli/chunks/{upgrade-OZ3O6ZZI.js → upgrade-QPLMJA5Z.js} +2 -2
- package/dist/cli/chunks/{validate-DRY5BMWX.js → validate-3GVKZOVF.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-QD3LYPUF.js → validate-swarm-XCRTLVM6.js} +2 -2
- package/dist/cli/chunks/{vibium-2J3H2ITD.js → vibium-CH4VPKVZ.js} +2 -2
- package/dist/cli/chunks/visual-security-4ARJ7J2Y.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-KRNUOGKI.js → web-tree-sitter-JDBNAZTV.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-PQIPH3WP.js → windsurf-installer-3MNPVJBP.js} +2 -2
- package/dist/cli/chunks/witness-chain-73QC33ED.js +2 -0
- package/dist/cli/chunks/{witness-chain-HPLOYPS7.js → witness-chain-HR5UBV5J.js} +2 -2
- package/dist/cli/chunks/witness-key-manager-G5SQTIBZ.js +2 -0
- package/dist/cli/chunks/{workflow-OAQ3FWCY.js → workflow-43EMD5FY.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-RKMMPXNA.js +2 -0
- package/dist/cli/chunks/{wrappers-UPIU6S5S.js → wrappers-3N7AYNM3.js} +2 -2
- package/dist/cli/commands/audit.d.ts +12 -0
- package/dist/cli/commands/audit.js +64 -4
- package/dist/cli/commands/hooks-handlers/hooks-dream-learning.js +45 -19
- package/dist/cli/commands/hooks-handlers/hooks-shared.d.ts +13 -0
- package/dist/cli/commands/hooks-handlers/hooks-shared.js +38 -0
- package/dist/cli/commands/hooks-handlers/task-hooks.js +19 -1
- package/dist/cli/handlers/status-handler.d.ts +18 -0
- package/dist/cli/handlers/status-handler.js +47 -0
- package/dist/coordination/mincut/queen-integration.js +24 -7
- package/dist/coordination/protocol-executor.js +2 -1
- package/dist/coordination/queen-lifecycle.js +4 -1
- package/dist/domains/code-intelligence/coordinator.js +10 -6
- package/dist/domains/code-intelligence/services/product-factors-bridge.js +3 -1
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +6 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +21 -0
- package/dist/domains/learning-optimization/interfaces.d.ts +7 -0
- package/dist/domains/learning-optimization/plugin.js +5 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.d.ts +10 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js +57 -0
- package/dist/domains/test-execution/plugin.js +2 -2
- package/dist/domains/test-execution/services/flaky-detector.js +1 -1
- package/dist/domains/test-generation/coordinator.js +22 -8
- package/dist/domains/test-generation/interfaces.d.ts +3 -0
- package/dist/domains/test-generation/services/test-generator.js +9 -1
- package/dist/integrations/ruvector/delta-tracker.js +10 -1
- package/dist/integrations/ruvector/sona-persistence.d.ts +24 -0
- package/dist/integrations/ruvector/sona-persistence.js +76 -0
- package/dist/integrations/ruvector/sona-three-loop.d.ts +15 -0
- package/dist/integrations/ruvector/sona-three-loop.js +17 -0
- package/dist/kernel/unified-memory-schemas.d.ts +2 -2
- package/dist/kernel/unified-memory-schemas.js +48 -2
- package/dist/kernel/unified-memory.d.ts +22 -0
- package/dist/kernel/unified-memory.js +43 -0
- package/dist/learning/aqe-learning-engine.js +3 -1
- package/dist/learning/dream/concept-graph.d.ts +31 -1
- package/dist/learning/dream/concept-graph.js +109 -3
- package/dist/learning/dream/dream-engine.d.ts +13 -1
- package/dist/learning/dream/dream-engine.js +146 -10
- package/dist/learning/dream/index.d.ts +1 -1
- package/dist/learning/dream/types.d.ts +23 -0
- package/dist/learning/pattern-store.d.ts +2 -2
- package/dist/learning/pattern-store.js +14 -3
- package/dist/learning/qe-reasoning-bank.js +34 -31
- package/dist/learning/routing-topology-gate.d.ts +12 -2
- package/dist/learning/routing-topology-gate.js +15 -3
- package/dist/learning/rvf-pattern-store.d.ts +1 -1
- package/dist/learning/rvf-pattern-store.js +21 -8
- package/dist/learning/sqlite-persistence.js +12 -9
- package/dist/mcp/bundle.js +516 -442
- package/dist/mcp/qe-tool-bridge.js +7 -2
- package/dist/mcp/tools/base.d.ts +29 -0
- package/dist/mcp/tools/base.js +25 -0
- package/dist/mcp/tools/coverage-analysis/index.js +6 -4
- package/dist/mcp/tools/learning-optimization/dream.d.ts +4 -13
- package/dist/mcp/tools/learning-optimization/dream.js +10 -96
- package/dist/mcp/tools/planning/goap-execute.d.ts +13 -1
- package/dist/mcp/tools/planning/goap-execute.js +33 -18
- package/dist/mcp/tools/registry.js +7 -2
- package/dist/persistence/rvf-migration-coordinator.js +2 -1
- package/dist/planning/actions/qe-action-library.js +124 -1
- package/dist/planning/goap-planner.d.ts +14 -2
- package/dist/planning/goap-planner.js +51 -9
- package/dist/planning/index.d.ts +1 -1
- package/dist/planning/plan-executor.d.ts +84 -4
- package/dist/planning/plan-executor.js +221 -56
- package/dist/planning/types.d.ts +27 -0
- package/dist/shared/events/domain-events.d.ts +2 -0
- package/dist/workers/workers/learning-consolidation.js +21 -1
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-2HMUXHWY.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-M2NKRVRE.js +0 -2
- package/dist/cli/chunks/audit-EPB7ETMT.js +0 -3
- package/dist/cli/chunks/base-CCHC2DAC.js +0 -2
- package/dist/cli/chunks/brain-handler-FBMYEERK.js +0 -89
- package/dist/cli/chunks/browser-workflow-4DGHFYY3.js +0 -2
- package/dist/cli/chunks/chunk-5AQ7FXYG.js +0 -27
- package/dist/cli/chunks/chunk-KYTFIP6R.js +0 -2
- package/dist/cli/chunks/chunk-MYMIEQSZ.js +0 -65
- package/dist/cli/chunks/chunk-XXRTWG7O.js +0 -2
- package/dist/cli/chunks/chunk-ZSA6V5FH.js +0 -2
- package/dist/cli/chunks/client-2OVEDWGU.js +0 -2
- package/dist/cli/chunks/core-handlers-UXRRYP52.js +0 -2
- package/dist/cli/chunks/cross-domain-router-PV3VQVLO.js +0 -2
- package/dist/cli/chunks/daemon-ESUEM6VB.js +0 -10
- package/dist/cli/chunks/domain-transfer-TQYO3SVG.js +0 -2
- package/dist/cli/chunks/dream-UFUXVJQC.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-MBG3SARO.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-5HXA3QB3.js +0 -2
- package/dist/cli/chunks/hnsw-index-PZRQWBRG.js +0 -2
- package/dist/cli/chunks/hybrid-router-NQRIE2GG.js +0 -2
- package/dist/cli/chunks/impact-analyzer-46347ZDV.js +0 -2
- package/dist/cli/chunks/init-wizard-CJYP4WKO.js +0 -2
- package/dist/cli/chunks/kernel-22KQZ56U.js +0 -2
- package/dist/cli/chunks/knowledge-graph-KM3JDBGR.js +0 -2
- package/dist/cli/chunks/llm-router-service-IFO6GRRO.js +0 -2
- package/dist/cli/chunks/load-test-TTKCYAPB.js +0 -2
- package/dist/cli/chunks/memory-backend-ELHCX2ZT.js +0 -2
- package/dist/cli/chunks/memory-handlers-3SKYQZTL.js +0 -2
- package/dist/cli/chunks/pattern-null-store-TMXAYD43.js +0 -2
- package/dist/cli/chunks/protocol-executor-BPLR5EJC.js +0 -2
- package/dist/cli/chunks/provider-manager-4MMD5QKL.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-P7KNT3WZ.js +0 -2
- package/dist/cli/chunks/queen-coordinator-NBZZ4MGC.js +0 -2
- package/dist/cli/chunks/router-2RXR6J2Q.js +0 -2
- package/dist/cli/chunks/routing-feedback-AVAA76TK.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-X2YDJA55.js +0 -2
- package/dist/cli/chunks/safe-db-4PRU65BK.js +0 -2
- package/dist/cli/chunks/schedule-2AST5CHW.js +0 -2
- package/dist/cli/chunks/scheduler-SW6II7OU.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-OB5NEGAK.js +0 -2
- package/dist/cli/chunks/status-handler-HFPWSCBY.js +0 -45
- package/dist/cli/chunks/unified-memory-X7OJYGSD.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-O6HOD5YL.js +0 -2
- package/dist/cli/chunks/unified-persistence-C332CER2.js +0 -2
- package/dist/cli/chunks/visual-security-MPUG5HPI.js +0 -2
- package/dist/cli/chunks/witness-chain-Q4BZHPDF.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-4NDWECYK.js +0 -2
|
@@ -277,7 +277,7 @@ export class QueenMinCutBridge {
|
|
|
277
277
|
};
|
|
278
278
|
// Agent status changed
|
|
279
279
|
const onAgentStatusChanged = async (event) => {
|
|
280
|
-
const { agentId, status
|
|
280
|
+
const { agentId, status } = event.payload;
|
|
281
281
|
const vertexId = `agent:${agentId}`;
|
|
282
282
|
const vertex = this.graph.getVertex(vertexId);
|
|
283
283
|
if (vertex) {
|
|
@@ -293,7 +293,7 @@ export class QueenMinCutBridge {
|
|
|
293
293
|
};
|
|
294
294
|
// Task coordination (agent-to-agent communication)
|
|
295
295
|
const onTaskCoordination = async (event) => {
|
|
296
|
-
const { fromAgent, toAgent
|
|
296
|
+
const { fromAgent, toAgent } = event.payload;
|
|
297
297
|
const sourceId = `agent:${fromAgent}`;
|
|
298
298
|
const targetId = `agent:${toAgent}`;
|
|
299
299
|
if (this.graph.hasVertex(sourceId) && this.graph.hasVertex(targetId)) {
|
|
@@ -321,11 +321,20 @@ export class QueenMinCutBridge {
|
|
|
321
321
|
}
|
|
322
322
|
}
|
|
323
323
|
};
|
|
324
|
-
//
|
|
325
|
-
//
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
324
|
+
// A16: these handlers existed but were never actually subscribed — the
|
|
325
|
+
// topology graph only ever saw its static domain-coordinator scaffold,
|
|
326
|
+
// never a real agent, no matter how many agents Queen actually spawned.
|
|
327
|
+
// `QueenCoordinator.publishEvent()` prefixes every event with "Queen"
|
|
328
|
+
// (e.g. `AgentSpawned` -> `QueenAgentSpawned`); only that one has a real
|
|
329
|
+
// publisher today (`queen-coordinator.ts`). The other three are wired to
|
|
330
|
+
// the same convention so they activate automatically if/when a publisher
|
|
331
|
+
// for agent termination / status-change / cross-agent coordination is
|
|
332
|
+
// added — they are current no-ops otherwise, not fabricated coverage.
|
|
333
|
+
const spawnedSub = this.eventBus.subscribe('QueenAgentSpawned', onAgentSpawned);
|
|
334
|
+
const terminatedSub = this.eventBus.subscribe('QueenAgentTerminated', onAgentTerminated);
|
|
335
|
+
const statusSub = this.eventBus.subscribe('QueenAgentStatusChanged', onAgentStatusChanged);
|
|
336
|
+
const taskCoordSub = this.eventBus.subscribe('QueenTaskCoordination', onTaskCoordination);
|
|
337
|
+
this.eventSubscriptions.push(() => spawnedSub.unsubscribe(), () => terminatedSub.unsubscribe(), () => statusSub.unsubscribe(), () => taskCoordSub.unsubscribe());
|
|
329
338
|
}
|
|
330
339
|
// ==========================================================================
|
|
331
340
|
// Health Integration
|
|
@@ -437,6 +446,14 @@ export class QueenMinCutBridge {
|
|
|
437
446
|
*/
|
|
438
447
|
startSnapshotTimer() {
|
|
439
448
|
this.snapshotTimer = setInterval(async () => {
|
|
449
|
+
// A16: skip the periodic write entirely when no real agents have
|
|
450
|
+
// spawned yet — the domain-coordinator scaffold is static, so an
|
|
451
|
+
// empty-of-agents graph produces the exact same degenerate reading
|
|
452
|
+
// (14 vertices, mincut 0.0) every tick forever, which is noise, not
|
|
453
|
+
// signal. The dispose()-time final snapshot still runs unconditionally
|
|
454
|
+
// since that's a single row, not a recurring accumulation.
|
|
455
|
+
if (this.isEmptyTopology())
|
|
456
|
+
return;
|
|
440
457
|
await this.saveSnapshot();
|
|
441
458
|
// Also record history
|
|
442
459
|
await this.persistence.recordHistory({
|
|
@@ -486,7 +486,8 @@ export class DefaultProtocolExecutor {
|
|
|
486
486
|
results: Object.fromEntries(execution.results),
|
|
487
487
|
}, {
|
|
488
488
|
namespace: 'coordination',
|
|
489
|
-
ttl
|
|
489
|
+
// ttl is in SECONDS, not ms (unified-memory.ts:607) — was 1000x too long.
|
|
490
|
+
ttl: 86400, // 24 hours
|
|
490
491
|
});
|
|
491
492
|
}
|
|
492
493
|
/**
|
|
@@ -67,7 +67,10 @@ export function startMetricsCollectionTimer(ctx) {
|
|
|
67
67
|
const metrics = ctx.getMetrics();
|
|
68
68
|
await ctx.publishEvent('MetricsCollected', { metrics });
|
|
69
69
|
await ctx.memory.set(`queen:metrics:${Date.now()}`, metrics, {
|
|
70
|
-
ttl
|
|
70
|
+
// MemoryBackend.set's ttl is in SECONDS, not ms (unified-memory.ts:607
|
|
71
|
+
// does Date.now() + ttl * 1000) — this was 86400000, making rows live
|
|
72
|
+
// 1000 days instead of 1, hence unbounded kv_store growth.
|
|
73
|
+
ttl: 86400, // 24 hours
|
|
71
74
|
namespace: 'queen-coordinator',
|
|
72
75
|
});
|
|
73
76
|
// ADR-064 Phase 4C: Feed workload metrics to dynamic scaler
|
|
@@ -853,14 +853,16 @@ export class CodeIntelligenceCoordinator extends BaseDomainCoordinator {
|
|
|
853
853
|
*/
|
|
854
854
|
async storeC4DiagramsInMemory(projectPath, result) {
|
|
855
855
|
const key = `c4-diagrams:latest:${this.hashCode(projectPath)}`;
|
|
856
|
+
// ttl is in SECONDS, not ms (unified-memory.ts:607) — these were
|
|
857
|
+
// 3600000, making cache entries live ~41.6 days instead of 1 hour.
|
|
856
858
|
await this.memory.set(key, result, {
|
|
857
859
|
namespace: 'code-intelligence',
|
|
858
860
|
persist: true,
|
|
859
|
-
ttl:
|
|
861
|
+
ttl: 3600, // 1 hour
|
|
860
862
|
});
|
|
861
863
|
// Also store components and external systems separately for quick access
|
|
862
|
-
await this.memory.set(`c4-components:${this.hashCode(projectPath)}`, result.components, { namespace: 'code-intelligence', ttl:
|
|
863
|
-
await this.memory.set(`c4-external-systems:${this.hashCode(projectPath)}`, result.externalSystems, { namespace: 'code-intelligence', ttl:
|
|
864
|
+
await this.memory.set(`c4-components:${this.hashCode(projectPath)}`, result.components, { namespace: 'code-intelligence', ttl: 3600 });
|
|
865
|
+
await this.memory.set(`c4-external-systems:${this.hashCode(projectPath)}`, result.externalSystems, { namespace: 'code-intelligence', ttl: 3600 });
|
|
864
866
|
}
|
|
865
867
|
// ============================================================================
|
|
866
868
|
// V3 Integration: MetricCollector for Real Code Metrics (Phase 5)
|
|
@@ -921,14 +923,16 @@ export class CodeIntelligenceCoordinator extends BaseDomainCoordinator {
|
|
|
921
923
|
*/
|
|
922
924
|
async storeProjectMetricsInMemory(projectPath, metrics) {
|
|
923
925
|
const key = `project-metrics:latest:${this.hashCode(projectPath)}`;
|
|
926
|
+
// ttl is in SECONDS, not ms (unified-memory.ts:607) — these were
|
|
927
|
+
// 300000, making entries live ~3.47 days instead of 5 minutes.
|
|
924
928
|
await this.memory.set(key, metrics, {
|
|
925
929
|
namespace: 'code-intelligence',
|
|
926
930
|
persist: true,
|
|
927
|
-
ttl:
|
|
931
|
+
ttl: 300, // 5 minutes (metrics can change frequently)
|
|
928
932
|
});
|
|
929
933
|
// Store LOC and test counts separately for quick access
|
|
930
|
-
await this.memory.set(`loc-metrics:${this.hashCode(projectPath)}`, metrics.loc, { namespace: 'code-intelligence', ttl:
|
|
931
|
-
await this.memory.set(`test-metrics:${this.hashCode(projectPath)}`, metrics.tests, { namespace: 'code-intelligence', ttl:
|
|
934
|
+
await this.memory.set(`loc-metrics:${this.hashCode(projectPath)}`, metrics.loc, { namespace: 'code-intelligence', ttl: 300 });
|
|
935
|
+
await this.memory.set(`test-metrics:${this.hashCode(projectPath)}`, metrics.tests, { namespace: 'code-intelligence', ttl: 300 });
|
|
932
936
|
}
|
|
933
937
|
/**
|
|
934
938
|
* Get the MetricCollector service for direct access
|
|
@@ -624,7 +624,9 @@ export class ProductFactorsBridgeService {
|
|
|
624
624
|
};
|
|
625
625
|
await this.memory.set(cacheKey, cacheEntry, {
|
|
626
626
|
namespace: 'code-intelligence',
|
|
627
|
-
ttl:
|
|
627
|
+
// MemoryBackend.set's ttl is in SECONDS (unified-memory.ts:607 does
|
|
628
|
+
// Date.now() + ttl * 1000) — cacheTtlMs is milliseconds, so convert.
|
|
629
|
+
ttl: this.config.cacheTtlMs / 1000,
|
|
628
630
|
});
|
|
629
631
|
}
|
|
630
632
|
getCacheKey(projectPath) {
|
|
@@ -121,6 +121,12 @@ export declare class DefectPredictorService implements IDefectPredictorService {
|
|
|
121
121
|
* ADR-051: Retrieve historical defect patterns for context
|
|
122
122
|
*/
|
|
123
123
|
private getHistoricalDefectPatterns;
|
|
124
|
+
/**
|
|
125
|
+
* Write side of getHistoricalDefectPatterns — records a confirmed defect's
|
|
126
|
+
* type both per-file and in the general pool, capped and deduped to match
|
|
127
|
+
* what the reader expects.
|
|
128
|
+
*/
|
|
129
|
+
private recordConfirmedDefectPattern;
|
|
124
130
|
/**
|
|
125
131
|
* Analyze regression risk for a changeset
|
|
126
132
|
*/
|
|
@@ -331,6 +331,21 @@ Be specific and actionable. Focus on concrete issues, not generic advice.`,
|
|
|
331
331
|
}
|
|
332
332
|
return [...new Set(patterns)].slice(0, 10);
|
|
333
333
|
}
|
|
334
|
+
/**
|
|
335
|
+
* Write side of getHistoricalDefectPatterns — records a confirmed defect's
|
|
336
|
+
* type both per-file and in the general pool, capped and deduped to match
|
|
337
|
+
* what the reader expects.
|
|
338
|
+
*/
|
|
339
|
+
async recordConfirmedDefectPattern(file, defectType) {
|
|
340
|
+
const fileKey = `${this.config.modelNamespace}:defect-patterns:${file}`;
|
|
341
|
+
const existing = await this.memory.get(fileKey);
|
|
342
|
+
const patterns = [...new Set([...(existing?.patterns ?? []), defectType])].slice(-20);
|
|
343
|
+
await this.memory.set(fileKey, { patterns }, { namespace: 'defect-intelligence', persist: true });
|
|
344
|
+
const generalKey = `${this.config.modelNamespace}:common-defect-patterns`;
|
|
345
|
+
const existingGeneral = (await this.memory.get(generalKey)) ?? [];
|
|
346
|
+
const general = [...new Set([...existingGeneral, defectType])].slice(-50);
|
|
347
|
+
await this.memory.set(generalKey, general, { namespace: 'defect-intelligence', persist: true });
|
|
348
|
+
}
|
|
334
349
|
/**
|
|
335
350
|
* Analyze regression risk for a changeset
|
|
336
351
|
*/
|
|
@@ -385,6 +400,12 @@ Be specific and actionable. Focus on concrete issues, not generic advice.`,
|
|
|
385
400
|
});
|
|
386
401
|
// Update model metrics based on feedback
|
|
387
402
|
await this.recalculateMetrics(feedback);
|
|
403
|
+
// A confirmed defect with a known type is the write side of
|
|
404
|
+
// getHistoricalDefectPatterns' read — previously nothing populated
|
|
405
|
+
// these keys, so historical-pattern lookup always returned empty.
|
|
406
|
+
if (feedback.actualDefect && feedback.defectType) {
|
|
407
|
+
await this.recordConfirmedDefectPattern(feedback.file, feedback.defectType);
|
|
408
|
+
}
|
|
388
409
|
return ok(undefined);
|
|
389
410
|
}
|
|
390
411
|
catch (error) {
|
|
@@ -56,6 +56,13 @@ export interface Experience {
|
|
|
56
56
|
readonly result: ExperienceResult;
|
|
57
57
|
readonly reward: number;
|
|
58
58
|
readonly timestamp: Date;
|
|
59
|
+
/**
|
|
60
|
+
* ReasoningBank pattern IDs that were applied/matched to produce this
|
|
61
|
+
* experience (ADR-110 kept-nulls). Optional — most domains don't yet
|
|
62
|
+
* track which pattern influenced a given operation; only populate this
|
|
63
|
+
* when real matched-pattern data exists, never a placeholder.
|
|
64
|
+
*/
|
|
65
|
+
readonly appliedPatternIds?: readonly string[];
|
|
59
66
|
}
|
|
60
67
|
export interface StateSnapshot {
|
|
61
68
|
readonly context: Record<string, unknown>;
|
|
@@ -391,6 +391,11 @@ export class LearningOptimizationPlugin extends BaseDomainPlugin {
|
|
|
391
391
|
duration: 0,
|
|
392
392
|
},
|
|
393
393
|
reward: 0.8,
|
|
394
|
+
// ADR-110: real matched-pattern IDs from test-generation/coordinator.ts's
|
|
395
|
+
// GeneratedTests.patternsUsed. This event always represents a successful
|
|
396
|
+
// generation, so nulls won't fire from here in practice — threaded for
|
|
397
|
+
// correctness/future use, not for immediate null-recording payoff.
|
|
398
|
+
appliedPatternIds: payload.patternsUsed,
|
|
394
399
|
});
|
|
395
400
|
}
|
|
396
401
|
async handleTestRunCompleted(event) {
|
|
@@ -40,6 +40,8 @@ export declare class LearningCoordinatorService implements IPatternLearningServi
|
|
|
40
40
|
* Provides 2.49x-7.47x speedup via @ruvector/attention SIMD implementation
|
|
41
41
|
*/
|
|
42
42
|
private flashAttention;
|
|
43
|
+
/** ADR-110 null store, lazily wired. undefined = not yet attempted; null = attempted and unavailable. */
|
|
44
|
+
private _nullStore?;
|
|
43
45
|
constructor(dependencies: LearningCoordinatorDependencies, config?: Partial<LearningCoordinatorConfig>);
|
|
44
46
|
/**
|
|
45
47
|
* Initialize FlashAttention for high-performance similarity computations.
|
|
@@ -143,6 +145,14 @@ export declare class LearningCoordinatorService implements IPatternLearningServi
|
|
|
143
145
|
* Record a new experience
|
|
144
146
|
*/
|
|
145
147
|
recordExperience(experience: Omit<Experience, 'id' | 'timestamp'>): Promise<Result<string>>;
|
|
148
|
+
/**
|
|
149
|
+
* Lazily wire the ADR-110 null store (fail-soft — mirrors the witness-chain
|
|
150
|
+
* wiring pattern in AQELearningEngine). Cached after first successful init;
|
|
151
|
+
* silently no-ops if the unified persistence layer isn't available (e.g.
|
|
152
|
+
* memory-only mode) so a learning-side failure never blocks the caller.
|
|
153
|
+
*/
|
|
154
|
+
private getNullStore;
|
|
155
|
+
private recordPatternNulls;
|
|
146
156
|
/**
|
|
147
157
|
* Mine experiences for insights
|
|
148
158
|
*/
|
|
@@ -40,6 +40,8 @@ export class LearningCoordinatorService {
|
|
|
40
40
|
* Provides 2.49x-7.47x speedup via @ruvector/attention SIMD implementation
|
|
41
41
|
*/
|
|
42
42
|
flashAttention = null;
|
|
43
|
+
/** ADR-110 null store, lazily wired. undefined = not yet attempted; null = attempted and unavailable. */
|
|
44
|
+
_nullStore;
|
|
43
45
|
constructor(dependencies, config = {}) {
|
|
44
46
|
this.memory = dependencies.memory;
|
|
45
47
|
this.llmRouter = dependencies.llmRouter;
|
|
@@ -462,12 +464,67 @@ Provide:
|
|
|
462
464
|
});
|
|
463
465
|
// Index by agent and domain for faster retrieval
|
|
464
466
|
await this.indexExperience(fullExperience);
|
|
467
|
+
// ADR-110: a pattern-guided failure is a kept null, not a discarded
|
|
468
|
+
// run. Only fires when the caller supplied real matched-pattern IDs
|
|
469
|
+
// (appliedPatternIds) — most domains don't track this yet, so this is
|
|
470
|
+
// a no-op for them, which is correct (nothing to blame the failure on).
|
|
471
|
+
if (!experience.result.success && experience.appliedPatternIds?.length) {
|
|
472
|
+
await this.recordPatternNulls(fullExperience);
|
|
473
|
+
}
|
|
465
474
|
return ok(id);
|
|
466
475
|
}
|
|
467
476
|
catch (error) {
|
|
468
477
|
return err(toError(error));
|
|
469
478
|
}
|
|
470
479
|
}
|
|
480
|
+
/**
|
|
481
|
+
* Lazily wire the ADR-110 null store (fail-soft — mirrors the witness-chain
|
|
482
|
+
* wiring pattern in AQELearningEngine). Cached after first successful init;
|
|
483
|
+
* silently no-ops if the unified persistence layer isn't available (e.g.
|
|
484
|
+
* memory-only mode) so a learning-side failure never blocks the caller.
|
|
485
|
+
*/
|
|
486
|
+
async getNullStore() {
|
|
487
|
+
if (this._nullStore !== undefined)
|
|
488
|
+
return this._nullStore || undefined;
|
|
489
|
+
try {
|
|
490
|
+
const { getUnifiedPersistence } = await import('../../../kernel/unified-persistence.js');
|
|
491
|
+
const persistence = getUnifiedPersistence();
|
|
492
|
+
if (!persistence.isInitialized()) {
|
|
493
|
+
this._nullStore = null;
|
|
494
|
+
return undefined;
|
|
495
|
+
}
|
|
496
|
+
const { PatternNullStore } = await import('../../../learning/pattern-null-store.js');
|
|
497
|
+
this._nullStore = new PatternNullStore(persistence.getDatabase());
|
|
498
|
+
return this._nullStore;
|
|
499
|
+
}
|
|
500
|
+
catch (e) {
|
|
501
|
+
this._nullStore = null;
|
|
502
|
+
logger.warn('Null store wiring skipped', { error: e instanceof Error ? e.message : String(e) });
|
|
503
|
+
return undefined;
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
async recordPatternNulls(experience) {
|
|
507
|
+
const nullStore = await this.getNullStore();
|
|
508
|
+
if (!nullStore)
|
|
509
|
+
return;
|
|
510
|
+
const contextFingerprint = `${experience.domain}:${experience.action}`;
|
|
511
|
+
for (const patternId of experience.appliedPatternIds ?? []) {
|
|
512
|
+
try {
|
|
513
|
+
nullStore.recordNull({
|
|
514
|
+
patternId,
|
|
515
|
+
contextFingerprint,
|
|
516
|
+
failureMode: String(experience.result.outcome?.error ?? experience.action),
|
|
517
|
+
evidenceClass: 'EXECUTED',
|
|
518
|
+
});
|
|
519
|
+
}
|
|
520
|
+
catch (e) {
|
|
521
|
+
logger.warn('Failed to record pattern null', {
|
|
522
|
+
patternId,
|
|
523
|
+
error: e instanceof Error ? e.message : String(e),
|
|
524
|
+
});
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
}
|
|
471
528
|
/**
|
|
472
529
|
* Mine experiences for insights
|
|
473
530
|
*/
|
|
@@ -181,7 +181,7 @@ export class TestExecutionPlugin extends BaseDomainPlugin {
|
|
|
181
181
|
eventId: event.id,
|
|
182
182
|
timestamp: event.timestamp,
|
|
183
183
|
sourceFiles: payload.sourceFiles,
|
|
184
|
-
}, { namespace: 'test-execution', ttl:
|
|
184
|
+
}, { namespace: 'test-execution', ttl: 86400 } // 24 hours (ttl is in SECONDS — unified-memory.ts:607)
|
|
185
185
|
);
|
|
186
186
|
}
|
|
187
187
|
async handleQualityGateEvaluated(event) {
|
|
@@ -192,7 +192,7 @@ export class TestExecutionPlugin extends BaseDomainPlugin {
|
|
|
192
192
|
await this.memory.set(`quality-context:${payload.gateId}`, {
|
|
193
193
|
requiresRetry: true,
|
|
194
194
|
failedChecks: payload.checks.filter(c => !c.passed).map(c => c.name),
|
|
195
|
-
}, { namespace: 'test-execution', ttl:
|
|
195
|
+
}, { namespace: 'test-execution', ttl: 3600 } // 1 hour (ttl is in SECONDS — unified-memory.ts:607)
|
|
196
196
|
);
|
|
197
197
|
}
|
|
198
198
|
this.updateHealth({
|
|
@@ -92,7 +92,7 @@ export class FlakyDetectorService {
|
|
|
92
92
|
this.analysisCache.set(testId, cachedAnalysis);
|
|
93
93
|
await this.memory.set(`flaky-analysis:${testId}`, cachedAnalysis, {
|
|
94
94
|
namespace: 'test-execution',
|
|
95
|
-
ttl:
|
|
95
|
+
ttl: 3600, // 1 hour (ttl is in SECONDS — unified-memory.ts:607)
|
|
96
96
|
});
|
|
97
97
|
return ok(analysis);
|
|
98
98
|
}
|
|
@@ -350,7 +350,7 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
350
350
|
if (this.config.publishEvents) {
|
|
351
351
|
await this.publishTestSuiteCreated(result.value, request);
|
|
352
352
|
for (const test of result.value.tests) {
|
|
353
|
-
await this.publishTestGenerated(test, request.framework ?? 'vitest');
|
|
353
|
+
await this.publishTestGenerated(test, request.framework ?? 'vitest', result.value.patternsUsed);
|
|
354
354
|
}
|
|
355
355
|
}
|
|
356
356
|
// Three-loop protocol: instantAdapt must precede recordOutcome
|
|
@@ -631,13 +631,14 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
631
631
|
// ============================================================================
|
|
632
632
|
// Event Publishing Methods
|
|
633
633
|
// ============================================================================
|
|
634
|
-
async publishTestGenerated(test, framework) {
|
|
634
|
+
async publishTestGenerated(test, framework, patternsUsed) {
|
|
635
635
|
const payload = {
|
|
636
636
|
testId: test.id,
|
|
637
637
|
testFile: test.testFile,
|
|
638
638
|
framework,
|
|
639
639
|
sourceFile: test.sourceFile,
|
|
640
640
|
testType: test.type,
|
|
641
|
+
patternsUsed,
|
|
641
642
|
};
|
|
642
643
|
const event = createEvent(TestGenerationEvents.TestGenerated, 'test-generation', payload);
|
|
643
644
|
await this.eventBus.publish(event);
|
|
@@ -889,14 +890,27 @@ export class TestGenerationCoordinator extends BaseDomainCoordinator {
|
|
|
889
890
|
// Pattern Learning
|
|
890
891
|
// ============================================================================
|
|
891
892
|
async learnFromGeneration(tests) {
|
|
892
|
-
//
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
893
|
+
// A7: this was previously a no-op — the comment claimed usage tracking
|
|
894
|
+
// "is handled internally by recordPatternUsage" but nothing was ever
|
|
895
|
+
// called, and tests.patternsUsed (display names) wasn't even a valid
|
|
896
|
+
// pattern ID to begin with. Only called on the success path (coordinator
|
|
897
|
+
// line ~618), so success:true is honest here.
|
|
898
|
+
const patternIds = tests.patternIds ?? [];
|
|
899
|
+
if (patternIds.length === 0)
|
|
900
|
+
return;
|
|
901
|
+
try {
|
|
902
|
+
const { getUnifiedMemory } = await import('../../kernel/unified-memory.js');
|
|
903
|
+
const { recordPatternUsage } = await import('../../learning/pattern-usage-recorder.js');
|
|
904
|
+
const db = getUnifiedMemory().getDatabase();
|
|
905
|
+
for (const patternId of patternIds) {
|
|
906
|
+
recordPatternUsage(db, { patternId, success: true });
|
|
898
907
|
}
|
|
899
908
|
}
|
|
909
|
+
catch (error) {
|
|
910
|
+
logger.warn('Pattern usage recording skipped', {
|
|
911
|
+
error: error instanceof Error ? error.message : String(error),
|
|
912
|
+
});
|
|
913
|
+
}
|
|
900
914
|
}
|
|
901
915
|
// ============================================================================
|
|
902
916
|
// @ruvector Integration Methods (ADR-040)
|
|
@@ -42,7 +42,10 @@ export interface IGenerateTestsRequest {
|
|
|
42
42
|
export interface IGeneratedTests {
|
|
43
43
|
tests: IGeneratedTest[];
|
|
44
44
|
coverageEstimate: number;
|
|
45
|
+
/** Human-readable pattern names, for display (reports, CLI output). */
|
|
45
46
|
patternsUsed: string[];
|
|
47
|
+
/** Real qe_patterns.id values for the same patterns, for usage/ADR-110 tracking. */
|
|
48
|
+
patternIds?: string[];
|
|
46
49
|
}
|
|
47
50
|
export interface IGeneratedTest {
|
|
48
51
|
id: string;
|
|
@@ -302,11 +302,13 @@ Return a JSON array of test suggestions, each with: { "name": "test name", "desc
|
|
|
302
302
|
}
|
|
303
303
|
const tests = [];
|
|
304
304
|
const patternsUsed = [];
|
|
305
|
+
const patternIds = [];
|
|
305
306
|
for (const sourceFile of sourceFiles) {
|
|
306
307
|
const fileTests = await this.generateTestsForFile(sourceFile, testType, effectiveFramework, patterns, effectiveLanguage, request);
|
|
307
308
|
if (fileTests.success) {
|
|
308
309
|
tests.push(...fileTests.value.tests);
|
|
309
310
|
patternsUsed.push(...fileTests.value.patternsUsed);
|
|
311
|
+
patternIds.push(...fileTests.value.patternIds);
|
|
310
312
|
}
|
|
311
313
|
}
|
|
312
314
|
// ADR-062 Tier 2: Mark holdout tests when feature flag is enabled
|
|
@@ -323,6 +325,7 @@ Return a JSON array of test suggestions, each with: { "name": "test name", "desc
|
|
|
323
325
|
tests,
|
|
324
326
|
coverageEstimate,
|
|
325
327
|
patternsUsed: Array.from(new Set(patternsUsed)),
|
|
328
|
+
patternIds: Array.from(new Set(patternIds)),
|
|
326
329
|
});
|
|
327
330
|
}
|
|
328
331
|
catch (error) {
|
|
@@ -396,8 +399,13 @@ Return a JSON array of test suggestions, each with: { "name": "test name", "desc
|
|
|
396
399
|
async generateTestsForFile(sourceFile, testType, framework, patterns, effectiveLanguage, originalRequest) {
|
|
397
400
|
const testFile = this.getTestFilePath(sourceFile, framework);
|
|
398
401
|
const patternsUsed = [];
|
|
402
|
+
// Real qe_patterns.id values, parallel to patternsUsed (names) — feeds
|
|
403
|
+
// recordPatternUsage/ADR-110 appliedPatternIds, which would silently
|
|
404
|
+
// no-op against a display name instead of a real pattern ID.
|
|
405
|
+
const patternIds = [];
|
|
399
406
|
const applicablePatterns = await this.findApplicablePatterns(sourceFile, patterns);
|
|
400
407
|
patternsUsed.push(...applicablePatterns.map((p) => p.name));
|
|
408
|
+
patternIds.push(...applicablePatterns.map((p) => p.id));
|
|
401
409
|
let codeAnalysis = null;
|
|
402
410
|
let sourceContent = '';
|
|
403
411
|
try {
|
|
@@ -470,7 +478,7 @@ Return a JSON array of test suggestions, each with: { "name": "test name", "desc
|
|
|
470
478
|
if (this.qualityGate) {
|
|
471
479
|
test.qualityGateResult = this.qualityGate.validate(testCode, sourceFile, sourceContent || undefined);
|
|
472
480
|
}
|
|
473
|
-
return ok({ tests: [test], patternsUsed });
|
|
481
|
+
return ok({ tests: [test], patternsUsed, patternIds });
|
|
474
482
|
}
|
|
475
483
|
async generateTestForLines(file, lines, framework) {
|
|
476
484
|
if (lines.length === 0)
|
|
@@ -8,7 +8,16 @@
|
|
|
8
8
|
* @module integrations/ruvector/delta-tracker
|
|
9
9
|
*/
|
|
10
10
|
import { v4 as uuidv4 } from 'uuid';
|
|
11
|
-
import * as
|
|
11
|
+
import * as fastJsonPatchNs from 'fast-json-patch';
|
|
12
|
+
// fast-json-patch ships two entry points with different export shapes: its CJS
|
|
13
|
+
// entry (index.js) attaches named exports directly via Object.assign(exports,
|
|
14
|
+
// core), but its ESM entry (index.mjs) only exports a single default object
|
|
15
|
+
// bundling everything — it has no named `compare`/`applyPatch` exports. Which
|
|
16
|
+
// shape `import * as fastJsonPatchNs` lands on depends on the resolving
|
|
17
|
+
// loader/bundler, so `fastJsonPatchNs.compare` can be undefined even though
|
|
18
|
+
// the package is installed and working. Normalize once so callers don't care.
|
|
19
|
+
const fastJsonPatch = (fastJsonPatchNs.default
|
|
20
|
+
?? fastJsonPatchNs);
|
|
12
21
|
// ============================================================================
|
|
13
22
|
// Schema
|
|
14
23
|
// ============================================================================
|
|
@@ -194,6 +194,11 @@ export declare class PersistentSONAEngine {
|
|
|
194
194
|
* @returns Adaptation result, or null if three-loop engine not initialized
|
|
195
195
|
*/
|
|
196
196
|
instantAdapt(requestFeatures: number[]): import('./sona-three-loop.js').AdaptationResult | null;
|
|
197
|
+
/**
|
|
198
|
+
* Get the three-loop engine's current request count (A10), or null if the
|
|
199
|
+
* three-loop engine is not active.
|
|
200
|
+
*/
|
|
201
|
+
getRequestCount(): number | null;
|
|
197
202
|
/**
|
|
198
203
|
* Record the outcome of a request for REINFORCE-style gradient estimation (Loop 1b).
|
|
199
204
|
*
|
|
@@ -356,6 +361,25 @@ export declare class PersistentSONAEngine {
|
|
|
356
361
|
* @returns true if a row was deleted
|
|
357
362
|
*/
|
|
358
363
|
deleteFisherMatrix(domain: string): boolean;
|
|
364
|
+
/**
|
|
365
|
+
* A10 fix: persist the three-loop engine's request counter independently
|
|
366
|
+
* of the Fisher row, in kv_store (namespace 'sona'). Consolidation (the
|
|
367
|
+
* thing that writes the FIRST Fisher row) requires requestCount to reach
|
|
368
|
+
* consolidationInterval — but requestCount previously only survived via
|
|
369
|
+
* restoreFisher(), which only runs once a Fisher row already exists.
|
|
370
|
+
* Fresh short-lived CLI/MCP processes doing ~1 instantAdapt() each could
|
|
371
|
+
* never accumulate past the threshold: cold-start deadlock. This lets the
|
|
372
|
+
* counter accumulate across process restarts before any consolidation
|
|
373
|
+
* has ever happened.
|
|
374
|
+
*/
|
|
375
|
+
saveRequestCount(domain: string, requestCount: number): void;
|
|
376
|
+
/** Load the persisted request counter for a domain, or null if never saved. */
|
|
377
|
+
loadRequestCount(domain: string): number | null;
|
|
378
|
+
/**
|
|
379
|
+
* Internal variant of loadRequestCount that skips ensureInitialized() —
|
|
380
|
+
* used during _doInitialize(), mirroring _loadFisherMatrixUnsafe.
|
|
381
|
+
*/
|
|
382
|
+
private _loadRequestCountUnsafe;
|
|
359
383
|
/**
|
|
360
384
|
* Set or update the server client for cross-process pattern sharing
|
|
361
385
|
*/
|
|
@@ -187,6 +187,23 @@ export class PersistentSONAEngine {
|
|
|
187
187
|
});
|
|
188
188
|
}
|
|
189
189
|
}
|
|
190
|
+
else {
|
|
191
|
+
// A10 fix: no Fisher row exists yet (the common case pre-first-
|
|
192
|
+
// consolidation), but the request counter may still have
|
|
193
|
+
// accumulated across prior short-lived processes — restore it
|
|
194
|
+
// independently so it isn't reset to 0 every time.
|
|
195
|
+
const savedCount = this._loadRequestCountUnsafe(this.config.domain);
|
|
196
|
+
if (savedCount !== null) {
|
|
197
|
+
const engine = this.baseEngine.getThreeLoopEngine();
|
|
198
|
+
if (engine) {
|
|
199
|
+
engine.restoreRequestCount(savedCount);
|
|
200
|
+
logger.info('Three-loop engine restored request count independently of Fisher state', {
|
|
201
|
+
domain: this.config.domain,
|
|
202
|
+
requestCount: savedCount,
|
|
203
|
+
});
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
}
|
|
190
207
|
logger.info('Three-loop engine initialized with Fisher persistence', {
|
|
191
208
|
domain: this.config.domain,
|
|
192
209
|
});
|
|
@@ -569,6 +586,14 @@ export class PersistentSONAEngine {
|
|
|
569
586
|
this.ensureInitialized();
|
|
570
587
|
return this.baseEngine.instantAdapt(requestFeatures);
|
|
571
588
|
}
|
|
589
|
+
/**
|
|
590
|
+
* Get the three-loop engine's current request count (A10), or null if the
|
|
591
|
+
* three-loop engine is not active.
|
|
592
|
+
*/
|
|
593
|
+
getRequestCount() {
|
|
594
|
+
this.ensureInitialized();
|
|
595
|
+
return this.baseEngine.getThreeLoopEngine()?.getRequestCount() ?? null;
|
|
596
|
+
}
|
|
572
597
|
/**
|
|
573
598
|
* Record the outcome of a request for REINFORCE-style gradient estimation (Loop 1b).
|
|
574
599
|
*
|
|
@@ -771,6 +796,19 @@ export class PersistentSONAEngine {
|
|
|
771
796
|
}
|
|
772
797
|
this.pendingSaves.clear();
|
|
773
798
|
}
|
|
799
|
+
// A10 fix: checkpoint the request counter once per process lifetime
|
|
800
|
+
// (cheap — not on the instantAdapt hot path) so short-lived CLI/MCP
|
|
801
|
+
// processes accumulate progress toward consolidationInterval instead of
|
|
802
|
+
// resetting to 0 every time.
|
|
803
|
+
try {
|
|
804
|
+
const engine = this.baseEngine.getThreeLoopEngine();
|
|
805
|
+
if (engine && this.db) {
|
|
806
|
+
this.saveRequestCount(this.config.domain, engine.getRequestCount());
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
catch (err) {
|
|
810
|
+
console.warn('[PersistentSONAEngine] Request count checkpoint failed:', err instanceof Error ? err.message : err);
|
|
811
|
+
}
|
|
774
812
|
this.prepared.clear();
|
|
775
813
|
this.db = null;
|
|
776
814
|
this.persistence = null;
|
|
@@ -866,6 +904,44 @@ export class PersistentSONAEngine {
|
|
|
866
904
|
const result = stmt.run(domain);
|
|
867
905
|
return result.changes > 0;
|
|
868
906
|
}
|
|
907
|
+
/**
|
|
908
|
+
* A10 fix: persist the three-loop engine's request counter independently
|
|
909
|
+
* of the Fisher row, in kv_store (namespace 'sona'). Consolidation (the
|
|
910
|
+
* thing that writes the FIRST Fisher row) requires requestCount to reach
|
|
911
|
+
* consolidationInterval — but requestCount previously only survived via
|
|
912
|
+
* restoreFisher(), which only runs once a Fisher row already exists.
|
|
913
|
+
* Fresh short-lived CLI/MCP processes doing ~1 instantAdapt() each could
|
|
914
|
+
* never accumulate past the threshold: cold-start deadlock. This lets the
|
|
915
|
+
* counter accumulate across process restarts before any consolidation
|
|
916
|
+
* has ever happened.
|
|
917
|
+
*/
|
|
918
|
+
saveRequestCount(domain, requestCount) {
|
|
919
|
+
if (!this.db)
|
|
920
|
+
return;
|
|
921
|
+
this.db.prepare(`
|
|
922
|
+
INSERT INTO kv_store (namespace, key, value)
|
|
923
|
+
VALUES ('sona', ?, ?)
|
|
924
|
+
ON CONFLICT(namespace, key) DO UPDATE SET value = excluded.value
|
|
925
|
+
`).run(`request-count:${domain}`, String(requestCount));
|
|
926
|
+
}
|
|
927
|
+
/** Load the persisted request counter for a domain, or null if never saved. */
|
|
928
|
+
loadRequestCount(domain) {
|
|
929
|
+
this.ensureInitialized();
|
|
930
|
+
return this._loadRequestCountUnsafe(domain);
|
|
931
|
+
}
|
|
932
|
+
/**
|
|
933
|
+
* Internal variant of loadRequestCount that skips ensureInitialized() —
|
|
934
|
+
* used during _doInitialize(), mirroring _loadFisherMatrixUnsafe.
|
|
935
|
+
*/
|
|
936
|
+
_loadRequestCountUnsafe(domain) {
|
|
937
|
+
if (!this.db)
|
|
938
|
+
return null;
|
|
939
|
+
const row = this.db.prepare(`SELECT value FROM kv_store WHERE namespace = 'sona' AND key = ?`).get(`request-count:${domain}`);
|
|
940
|
+
if (!row)
|
|
941
|
+
return null;
|
|
942
|
+
const parsed = Number(row.value);
|
|
943
|
+
return Number.isFinite(parsed) ? parsed : null;
|
|
944
|
+
}
|
|
869
945
|
// ==========================================================================
|
|
870
946
|
// Server Integration
|
|
871
947
|
// ==========================================================================
|
|
@@ -335,6 +335,21 @@ export declare class SONAThreeLoopEngine {
|
|
|
335
335
|
getEffectiveWeights(): Float32Array;
|
|
336
336
|
/** Get the total number of requests processed */
|
|
337
337
|
getRequestCount(): number;
|
|
338
|
+
/**
|
|
339
|
+
* Restore the request counter independently of Fisher state (A10 fix).
|
|
340
|
+
*
|
|
341
|
+
* Previously requestCount only survived process restarts via
|
|
342
|
+
* restoreFisher(), which only runs `if (saved)` — i.e. only after a
|
|
343
|
+
* Fisher row already exists. Since consolidation (the thing that WRITES
|
|
344
|
+
* the first Fisher row) requires requestCount to reach
|
|
345
|
+
* consolidationInterval (default 100), and each CLI/MCP invocation is a
|
|
346
|
+
* fresh short-lived process doing ~1 instantAdapt() call, requestCount
|
|
347
|
+
* could never accumulate across processes: cold-start deadlock, 0 rows
|
|
348
|
+
* in sona_fisher_matrices forever. Call this at init (independently of
|
|
349
|
+
* whether a Fisher row exists) so the counter accumulates across process
|
|
350
|
+
* restarts even before the first consolidation ever happens.
|
|
351
|
+
*/
|
|
352
|
+
restoreRequestCount(count: number): void;
|
|
338
353
|
/** Get the engine configuration */
|
|
339
354
|
getConfig(): ThreeLoopConfig;
|
|
340
355
|
/** Get the connected peer states */
|