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
|
@@ -712,6 +712,23 @@ export class SONAThreeLoopEngine {
|
|
|
712
712
|
getRequestCount() {
|
|
713
713
|
return this.requestCount;
|
|
714
714
|
}
|
|
715
|
+
/**
|
|
716
|
+
* Restore the request counter independently of Fisher state (A10 fix).
|
|
717
|
+
*
|
|
718
|
+
* Previously requestCount only survived process restarts via
|
|
719
|
+
* restoreFisher(), which only runs `if (saved)` — i.e. only after a
|
|
720
|
+
* Fisher row already exists. Since consolidation (the thing that WRITES
|
|
721
|
+
* the first Fisher row) requires requestCount to reach
|
|
722
|
+
* consolidationInterval (default 100), and each CLI/MCP invocation is a
|
|
723
|
+
* fresh short-lived process doing ~1 instantAdapt() call, requestCount
|
|
724
|
+
* could never accumulate across processes: cold-start deadlock, 0 rows
|
|
725
|
+
* in sona_fisher_matrices forever. Call this at init (independently of
|
|
726
|
+
* whether a Fisher row exists) so the counter accumulates across process
|
|
727
|
+
* restarts even before the first consolidation ever happens.
|
|
728
|
+
*/
|
|
729
|
+
restoreRequestCount(count) {
|
|
730
|
+
this.requestCount = count;
|
|
731
|
+
}
|
|
715
732
|
/** Get the engine configuration */
|
|
716
733
|
getConfig() {
|
|
717
734
|
return { ...this.config };
|
|
@@ -7,12 +7,12 @@
|
|
|
7
7
|
import { HYPERGRAPH_SCHEMA } from '../migrations/20260120_add_hypergraph_tables.js';
|
|
8
8
|
import { PATTERN_NULLS_SCHEMA } from '../migrations/20260611_add_pattern_nulls_table.js';
|
|
9
9
|
export { HYPERGRAPH_SCHEMA, PATTERN_NULLS_SCHEMA };
|
|
10
|
-
export declare const SCHEMA_VERSION =
|
|
10
|
+
export declare const SCHEMA_VERSION = 11;
|
|
11
11
|
export declare const SCHEMA_VERSION_TABLE = "\n CREATE TABLE IF NOT EXISTS schema_version (\n id INTEGER PRIMARY KEY CHECK (id = 1),\n version INTEGER NOT NULL,\n migrated_at TEXT DEFAULT (datetime('now'))\n );\n";
|
|
12
12
|
export declare const KV_STORE_SCHEMA = "\n -- Key-Value Store (v2 compatible - same schema as HybridBackend)\n CREATE TABLE IF NOT EXISTS kv_store (\n key TEXT NOT NULL,\n namespace TEXT NOT NULL,\n value TEXT NOT NULL,\n expires_at INTEGER,\n created_at INTEGER DEFAULT (strftime('%s', 'now') * 1000),\n PRIMARY KEY (namespace, key)\n );\n CREATE INDEX IF NOT EXISTS idx_kv_namespace ON kv_store(namespace);\n CREATE INDEX IF NOT EXISTS idx_kv_expires ON kv_store(expires_at) WHERE expires_at IS NOT NULL;\n";
|
|
13
13
|
export declare const VECTORS_SCHEMA = "\n -- Vector Embeddings (new in v3 - replaces in-memory AgentDB)\n CREATE TABLE IF NOT EXISTS vectors (\n id TEXT PRIMARY KEY,\n namespace TEXT NOT NULL DEFAULT 'default',\n embedding BLOB NOT NULL,\n dimensions INTEGER NOT NULL,\n metadata TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now'))\n );\n CREATE INDEX IF NOT EXISTS idx_vectors_namespace ON vectors(namespace);\n CREATE INDEX IF NOT EXISTS idx_vectors_dimensions ON vectors(dimensions);\n";
|
|
14
14
|
export declare const RL_QVALUES_SCHEMA = "\n -- Q-Values for RL algorithms (ADR-046)\n CREATE TABLE IF NOT EXISTS rl_q_values (\n id TEXT PRIMARY KEY,\n algorithm TEXT NOT NULL,\n agent_id TEXT NOT NULL,\n state_key TEXT NOT NULL,\n action_key TEXT NOT NULL,\n q_value REAL NOT NULL DEFAULT 0.0,\n visits INTEGER NOT NULL DEFAULT 0,\n last_reward REAL,\n domain TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n UNIQUE(algorithm, agent_id, state_key, action_key)\n );\n CREATE INDEX IF NOT EXISTS idx_qvalues_agent ON rl_q_values(agent_id);\n CREATE INDEX IF NOT EXISTS idx_qvalues_algorithm ON rl_q_values(algorithm);\n CREATE INDEX IF NOT EXISTS idx_qvalues_state ON rl_q_values(agent_id, state_key);\n CREATE INDEX IF NOT EXISTS idx_qvalues_domain ON rl_q_values(domain);\n CREATE INDEX IF NOT EXISTS idx_qvalues_updated ON rl_q_values(updated_at);\n";
|
|
15
|
-
export declare const GOAP_SCHEMA = "\n -- GOAP Goals\n CREATE TABLE IF NOT EXISTS goap_goals (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT,\n conditions TEXT NOT NULL,\n priority INTEGER DEFAULT 3,\n qe_domain TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- GOAP Actions\n CREATE TABLE IF NOT EXISTS goap_actions (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT,\n agent_type TEXT NOT NULL,\n preconditions TEXT NOT NULL,\n effects TEXT NOT NULL,\n cost REAL DEFAULT 1.0,\n estimated_duration_ms INTEGER,\n success_rate REAL DEFAULT 1.0,\n execution_count INTEGER DEFAULT 0,\n category TEXT NOT NULL,\n qe_domain TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now'))\n );\n\n -- GOAP Plans\n CREATE TABLE IF NOT EXISTS goap_plans (\n id TEXT PRIMARY KEY,\n goal_id TEXT,\n initial_state TEXT NOT NULL,\n goal_state TEXT NOT NULL,\n action_sequence TEXT NOT NULL,\n total_cost REAL,\n estimated_duration_ms INTEGER,\n status TEXT DEFAULT 'pending',\n reused_from TEXT,\n similarity_score REAL,\n created_at TEXT DEFAULT (datetime('now')),\n executed_at TEXT,\n completed_at TEXT,\n FOREIGN KEY (goal_id) REFERENCES goap_goals(id)\n );\n\n -- Plan Signatures (for similarity matching)\n CREATE TABLE IF NOT EXISTS goap_plan_signatures (\n id TEXT PRIMARY KEY,\n plan_id TEXT NOT NULL UNIQUE,\n goal_hash TEXT NOT NULL,\n state_vector TEXT NOT NULL,\n action_sequence TEXT NOT NULL,\n total_cost REAL NOT NULL,\n success_rate REAL DEFAULT 1.0,\n usage_count INTEGER DEFAULT 0,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- GOAP Indexes\n CREATE INDEX IF NOT EXISTS idx_goap_actions_category ON goap_actions(category);\n CREATE INDEX IF NOT EXISTS idx_goap_actions_agent ON goap_actions(agent_type);\n CREATE INDEX IF NOT EXISTS idx_goap_plans_status ON goap_plans(status);\n CREATE INDEX IF NOT EXISTS idx_goap_sig_goal ON goap_plan_signatures(goal_hash);\n";
|
|
15
|
+
export declare const GOAP_SCHEMA = "\n -- GOAP Goals\n CREATE TABLE IF NOT EXISTS goap_goals (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT,\n conditions TEXT NOT NULL,\n priority INTEGER DEFAULT 3,\n qe_domain TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- GOAP Actions\n CREATE TABLE IF NOT EXISTS goap_actions (\n id TEXT PRIMARY KEY,\n name TEXT NOT NULL,\n description TEXT,\n agent_type TEXT NOT NULL,\n preconditions TEXT NOT NULL,\n effects TEXT NOT NULL,\n cost REAL DEFAULT 1.0,\n estimated_duration_ms INTEGER,\n success_rate REAL DEFAULT 1.0,\n execution_count INTEGER DEFAULT 0,\n category TEXT NOT NULL,\n qe_domain TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n -- A14: real domain API method binding (kernel.getDomainAPI(qe_domain)[method](params)).\n -- method/implemented are NULL/0 for actions with no real backing yet \u2014\n -- GOAPExecutor must report those as \"not implemented\", never simulate them.\n method TEXT,\n params TEXT,\n implemented INTEGER DEFAULT 0\n );\n\n -- GOAP Plans\n CREATE TABLE IF NOT EXISTS goap_plans (\n id TEXT PRIMARY KEY,\n goal_id TEXT,\n initial_state TEXT NOT NULL,\n goal_state TEXT NOT NULL,\n action_sequence TEXT NOT NULL,\n total_cost REAL,\n estimated_duration_ms INTEGER,\n status TEXT DEFAULT 'pending',\n reused_from TEXT,\n similarity_score REAL,\n created_at TEXT DEFAULT (datetime('now')),\n executed_at TEXT,\n completed_at TEXT,\n FOREIGN KEY (goal_id) REFERENCES goap_goals(id)\n );\n\n -- Plan Signatures (for similarity matching)\n CREATE TABLE IF NOT EXISTS goap_plan_signatures (\n id TEXT PRIMARY KEY,\n plan_id TEXT NOT NULL UNIQUE,\n goal_hash TEXT NOT NULL,\n state_vector TEXT NOT NULL,\n action_sequence TEXT NOT NULL,\n total_cost REAL NOT NULL,\n success_rate REAL DEFAULT 1.0,\n usage_count INTEGER DEFAULT 0,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- A14: canonical per-step execution history (was previously undefined in\n -- this schema \u2014 plan-executor.ts invented its own parallel\n -- execution_results/executed_steps tables instead). One row per action\n -- step per execution attempt (execution_id groups steps from the same\n -- plan.execute() call, since a plan can be executed/retried more than\n -- once). Aggregate per-execution stats (steps completed/failed, total\n -- duration, final world state) are derived by querying this table rather\n -- than maintained in a separate denormalized summary table.\n CREATE TABLE IF NOT EXISTS goap_execution_steps (\n id TEXT PRIMARY KEY,\n plan_id TEXT NOT NULL,\n execution_id TEXT NOT NULL,\n action_id TEXT NOT NULL,\n step_order INTEGER NOT NULL,\n world_state_before TEXT,\n world_state_after TEXT,\n status TEXT NOT NULL DEFAULT 'pending',\n retries INTEGER DEFAULT 0,\n started_at TEXT,\n duration_ms INTEGER,\n agent_id TEXT,\n agent_output TEXT,\n error_message TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n -- Deliberately no FK to goap_plans/goap_actions: PlanExecutor.execute()\n -- can legitimately run an ad-hoc GOAPPlan/GOAPAction that was never\n -- saved via savePlan()/addAction() (e.g. programmatic orchestration\n -- bypassing the A* planner). unified-memory.ts enables the\n -- foreign_keys pragma, so an enforced FK here would reject that\n -- entirely legitimate usage, not just catch real corruption.\n );\n\n -- GOAP Indexes\n CREATE INDEX IF NOT EXISTS idx_goap_actions_category ON goap_actions(category);\n CREATE INDEX IF NOT EXISTS idx_goap_actions_agent ON goap_actions(agent_type);\n CREATE INDEX IF NOT EXISTS idx_goap_plans_status ON goap_plans(status);\n CREATE INDEX IF NOT EXISTS idx_goap_sig_goal ON goap_plan_signatures(goal_hash);\n CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_plan ON goap_execution_steps(plan_id);\n CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_action ON goap_execution_steps(action_id);\n -- idx_goap_exec_steps_execution is NOT created here: databases with a\n -- pre-existing narrower goap_execution_steps table (missing execution_id)\n -- would fail on \"no such column\" since CREATE TABLE IF NOT EXISTS above\n -- silently no-ops against them. unified-memory.ts's v11 migration creates\n -- this index only after confirming/backfilling the column.\n";
|
|
16
16
|
export declare const DREAM_SCHEMA = "\n -- Concept Graph Nodes (Dream Engine)\n CREATE TABLE IF NOT EXISTS concept_nodes (\n id TEXT PRIMARY KEY,\n concept_type TEXT NOT NULL,\n content TEXT NOT NULL,\n embedding BLOB,\n activation_level REAL DEFAULT 0.0,\n last_activated TEXT,\n pattern_id TEXT,\n metadata TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- Concept Edges\n CREATE TABLE IF NOT EXISTS concept_edges (\n id TEXT PRIMARY KEY,\n source TEXT NOT NULL,\n target TEXT NOT NULL,\n weight REAL NOT NULL DEFAULT 1.0,\n edge_type TEXT NOT NULL,\n evidence INTEGER DEFAULT 1,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (source) REFERENCES concept_nodes(id) ON DELETE CASCADE,\n FOREIGN KEY (target) REFERENCES concept_nodes(id) ON DELETE CASCADE\n );\n\n -- Dream Cycles\n CREATE TABLE IF NOT EXISTS dream_cycles (\n id TEXT PRIMARY KEY,\n start_time TEXT NOT NULL,\n end_time TEXT,\n duration_ms INTEGER,\n concepts_processed INTEGER DEFAULT 0,\n associations_found INTEGER DEFAULT 0,\n insights_generated INTEGER DEFAULT 0,\n status TEXT DEFAULT 'running',\n error TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- Dream Insights\n CREATE TABLE IF NOT EXISTS dream_insights (\n id TEXT PRIMARY KEY,\n cycle_id TEXT NOT NULL,\n insight_type TEXT NOT NULL,\n source_concepts TEXT NOT NULL,\n description TEXT NOT NULL,\n novelty_score REAL DEFAULT 0.5,\n confidence_score REAL DEFAULT 0.5,\n actionable INTEGER DEFAULT 0,\n applied INTEGER DEFAULT 0,\n suggested_action TEXT,\n pattern_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (cycle_id) REFERENCES dream_cycles(id) ON DELETE CASCADE\n );\n\n -- Dream Indexes\n CREATE INDEX IF NOT EXISTS idx_concept_type ON concept_nodes(concept_type);\n CREATE INDEX IF NOT EXISTS idx_concept_activation ON concept_nodes(activation_level);\n CREATE INDEX IF NOT EXISTS idx_concept_pattern ON concept_nodes(pattern_id);\n CREATE INDEX IF NOT EXISTS idx_edge_source ON concept_edges(source);\n CREATE INDEX IF NOT EXISTS idx_edge_target ON concept_edges(target);\n CREATE INDEX IF NOT EXISTS idx_edge_type ON concept_edges(edge_type);\n CREATE INDEX IF NOT EXISTS idx_edge_weight ON concept_edges(weight DESC);\n CREATE INDEX IF NOT EXISTS idx_insight_cycle ON dream_insights(cycle_id);\n CREATE INDEX IF NOT EXISTS idx_dream_status ON dream_cycles(status);\n";
|
|
17
17
|
export declare const QE_PATTERNS_SCHEMA = "\n -- QE Patterns table (unified from sqlite-persistence.ts)\n CREATE TABLE IF NOT EXISTS qe_patterns (\n id TEXT PRIMARY KEY,\n pattern_type TEXT NOT NULL,\n qe_domain TEXT NOT NULL,\n domain TEXT NOT NULL,\n name TEXT NOT NULL,\n description TEXT,\n confidence REAL DEFAULT 0.5,\n usage_count INTEGER DEFAULT 0,\n success_rate REAL DEFAULT 0.0,\n quality_score REAL DEFAULT 0.0,\n tier TEXT DEFAULT 'short-term',\n template_json TEXT,\n context_json TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n updated_at TEXT DEFAULT (datetime('now')),\n last_used_at TEXT,\n successful_uses INTEGER DEFAULT 0,\n tokens_used INTEGER,\n input_tokens INTEGER,\n output_tokens INTEGER,\n latency_ms REAL,\n reusable INTEGER DEFAULT 0,\n reuse_count INTEGER DEFAULT 0,\n average_token_savings REAL DEFAULT 0,\n total_tokens_saved INTEGER\n );\n\n -- Pattern embeddings table (BLOB storage for vectors)\n CREATE TABLE IF NOT EXISTS qe_pattern_embeddings (\n pattern_id TEXT PRIMARY KEY,\n embedding BLOB NOT NULL,\n dimension INTEGER NOT NULL,\n model TEXT DEFAULT 'all-MiniLM-L6-v2',\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (pattern_id) REFERENCES qe_patterns(id) ON DELETE CASCADE\n );\n\n -- Pattern usage history (no FK -- used as analytics log by hooks with synthetic IDs)\n CREATE TABLE IF NOT EXISTS qe_pattern_usage (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n pattern_id TEXT NOT NULL,\n success INTEGER NOT NULL,\n metrics_json TEXT,\n feedback TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- Learning trajectories\n CREATE TABLE IF NOT EXISTS qe_trajectories (\n id TEXT PRIMARY KEY,\n task TEXT NOT NULL,\n agent TEXT,\n domain TEXT,\n started_at TEXT DEFAULT (datetime('now')),\n ended_at TEXT,\n success INTEGER,\n steps_json TEXT,\n metadata_json TEXT\n );\n\n -- Embeddings table (unified from EmbeddingCache.ts)\n -- Renamed from 'embedding_cache' to 'embeddings' to match existing code\n CREATE TABLE IF NOT EXISTS embeddings (\n key TEXT NOT NULL,\n namespace TEXT NOT NULL,\n vector BLOB NOT NULL,\n dimension INTEGER NOT NULL,\n text TEXT NOT NULL,\n timestamp INTEGER NOT NULL,\n quantization TEXT NOT NULL,\n metadata TEXT,\n access_count INTEGER DEFAULT 1,\n last_access INTEGER NOT NULL,\n PRIMARY KEY (key, namespace)\n );\n\n -- Execution results table (unified from plan-executor.ts)\n CREATE TABLE IF NOT EXISTS execution_results (\n id TEXT PRIMARY KEY,\n plan_id TEXT NOT NULL,\n status TEXT NOT NULL,\n steps_completed INTEGER DEFAULT 0,\n steps_failed INTEGER DEFAULT 0,\n total_duration_ms INTEGER DEFAULT 0,\n final_world_state TEXT,\n error_message TEXT,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- Executed steps table (unified from plan-executor.ts)\n CREATE TABLE IF NOT EXISTS executed_steps (\n id TEXT PRIMARY KEY,\n execution_id TEXT NOT NULL,\n plan_id TEXT NOT NULL,\n action_id TEXT NOT NULL,\n step_order INTEGER NOT NULL,\n status TEXT NOT NULL,\n retries INTEGER DEFAULT 0,\n started_at TEXT NOT NULL,\n completed_at TEXT,\n duration_ms INTEGER,\n agent_id TEXT,\n agent_output TEXT,\n world_state_before TEXT,\n world_state_after TEXT,\n error_message TEXT,\n FOREIGN KEY (execution_id) REFERENCES execution_results(id)\n );\n\n -- FTS5 full-text search index for hybrid vector/text search\n CREATE VIRTUAL TABLE IF NOT EXISTS qe_patterns_fts USING fts5(\n name, description, pattern_type, qe_domain,\n content='qe_patterns',\n content_rowid='rowid'\n );\n\n -- FTS5 triggers to keep index in sync\n CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_insert AFTER INSERT ON qe_patterns BEGIN\n INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)\n VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);\n END;\n\n CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_delete AFTER DELETE ON qe_patterns BEGIN\n INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)\n VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);\n END;\n\n CREATE TRIGGER IF NOT EXISTS qe_patterns_fts_update AFTER UPDATE ON qe_patterns BEGIN\n INSERT INTO qe_patterns_fts(qe_patterns_fts, rowid, name, description, pattern_type, qe_domain)\n VALUES ('delete', old.rowid, old.name, old.description, old.pattern_type, old.qe_domain);\n INSERT INTO qe_patterns_fts(rowid, name, description, pattern_type, qe_domain)\n VALUES (new.rowid, new.name, new.description, new.pattern_type, new.qe_domain);\n END;\n\n -- QE Patterns indexes\n CREATE INDEX IF NOT EXISTS idx_qe_patterns_domain ON qe_patterns(qe_domain);\n CREATE INDEX IF NOT EXISTS idx_qe_patterns_type ON qe_patterns(pattern_type);\n CREATE INDEX IF NOT EXISTS idx_qe_patterns_tier ON qe_patterns(tier);\n CREATE INDEX IF NOT EXISTS idx_qe_patterns_quality ON qe_patterns(quality_score DESC);\n CREATE INDEX IF NOT EXISTS idx_qe_usage_pattern ON qe_pattern_usage(pattern_id);\n CREATE INDEX IF NOT EXISTS idx_qe_trajectories_domain ON qe_trajectories(domain);\n CREATE INDEX IF NOT EXISTS idx_embeddings_namespace ON embeddings(namespace);\n CREATE INDEX IF NOT EXISTS idx_embeddings_timestamp ON embeddings(timestamp);\n CREATE INDEX IF NOT EXISTS idx_execution_results_plan ON execution_results(plan_id);\n CREATE INDEX IF NOT EXISTS idx_execution_results_status ON execution_results(status);\n CREATE INDEX IF NOT EXISTS idx_executed_steps_execution ON executed_steps(execution_id);\n CREATE INDEX IF NOT EXISTS idx_executed_steps_action ON executed_steps(action_id);\n";
|
|
18
18
|
export declare const MINCUT_SCHEMA = "\n -- MinCut Graph Snapshots (ADR-047)\n CREATE TABLE IF NOT EXISTS mincut_snapshots (\n id TEXT PRIMARY KEY,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n vertex_count INTEGER NOT NULL,\n edge_count INTEGER NOT NULL,\n total_weight REAL NOT NULL DEFAULT 0.0,\n is_connected INTEGER NOT NULL DEFAULT 1,\n component_count INTEGER NOT NULL DEFAULT 1,\n vertices_json TEXT NOT NULL,\n edges_json TEXT NOT NULL,\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- MinCut History (time-series MinCut values)\n CREATE TABLE IF NOT EXISTS mincut_history (\n id INTEGER PRIMARY KEY AUTOINCREMENT,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n mincut_value REAL NOT NULL,\n vertex_count INTEGER NOT NULL,\n edge_count INTEGER NOT NULL,\n algorithm TEXT NOT NULL DEFAULT 'weighted-degree',\n duration_ms INTEGER,\n snapshot_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Weak Vertices (detected bottlenecks)\n CREATE TABLE IF NOT EXISTS mincut_weak_vertices (\n id TEXT PRIMARY KEY,\n vertex_id TEXT NOT NULL,\n weighted_degree REAL NOT NULL,\n risk_score REAL NOT NULL,\n reason TEXT NOT NULL,\n domain TEXT,\n vertex_type TEXT NOT NULL,\n suggestions_json TEXT,\n detected_at TEXT NOT NULL DEFAULT (datetime('now')),\n resolved_at TEXT,\n snapshot_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Alerts\n CREATE TABLE IF NOT EXISTS mincut_alerts (\n id TEXT PRIMARY KEY,\n severity TEXT NOT NULL,\n message TEXT NOT NULL,\n mincut_value REAL NOT NULL,\n threshold REAL NOT NULL,\n affected_vertices_json TEXT,\n remediations_json TEXT,\n acknowledged INTEGER DEFAULT 0,\n acknowledged_at TEXT,\n acknowledged_by TEXT,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n created_at TEXT DEFAULT (datetime('now'))\n );\n\n -- MinCut Healing Actions (self-healing history)\n CREATE TABLE IF NOT EXISTS mincut_healing_actions (\n id TEXT PRIMARY KEY,\n action_type TEXT NOT NULL,\n action_params_json TEXT NOT NULL,\n success INTEGER NOT NULL,\n mincut_before REAL NOT NULL,\n mincut_after REAL NOT NULL,\n improvement REAL NOT NULL DEFAULT 0.0,\n error_message TEXT,\n duration_ms INTEGER NOT NULL,\n triggered_by TEXT,\n snapshot_before_id TEXT,\n snapshot_after_id TEXT,\n created_at TEXT DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_before_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL,\n FOREIGN KEY (snapshot_after_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Strange Loop Observations (P1: self-organizing)\n CREATE TABLE IF NOT EXISTS mincut_observations (\n id TEXT PRIMARY KEY,\n iteration INTEGER NOT NULL,\n mincut_value REAL NOT NULL,\n weak_vertex_count INTEGER NOT NULL DEFAULT 0,\n weak_vertices_json TEXT,\n snapshot_id TEXT,\n prediction_json TEXT,\n actual_vs_predicted_diff REAL,\n timestamp TEXT NOT NULL DEFAULT (datetime('now')),\n FOREIGN KEY (snapshot_id) REFERENCES mincut_snapshots(id) ON DELETE SET NULL\n );\n\n -- MinCut Indexes\n CREATE INDEX IF NOT EXISTS idx_mincut_history_timestamp ON mincut_history(timestamp DESC);\n CREATE INDEX IF NOT EXISTS idx_mincut_history_value ON mincut_history(mincut_value);\n CREATE INDEX IF NOT EXISTS idx_mincut_weak_vertex ON mincut_weak_vertices(vertex_id);\n CREATE INDEX IF NOT EXISTS idx_mincut_weak_risk ON mincut_weak_vertices(risk_score DESC);\n CREATE INDEX IF NOT EXISTS idx_mincut_weak_resolved ON mincut_weak_vertices(resolved_at);\n CREATE INDEX IF NOT EXISTS idx_mincut_alerts_severity ON mincut_alerts(severity);\n CREATE INDEX IF NOT EXISTS idx_mincut_alerts_ack ON mincut_alerts(acknowledged);\n CREATE INDEX IF NOT EXISTS idx_mincut_healing_type ON mincut_healing_actions(action_type);\n CREATE INDEX IF NOT EXISTS idx_mincut_healing_success ON mincut_healing_actions(success);\n CREATE INDEX IF NOT EXISTS idx_mincut_observations_iter ON mincut_observations(iteration);\n";
|
|
@@ -11,7 +11,7 @@ export { HYPERGRAPH_SCHEMA, PATTERN_NULLS_SCHEMA };
|
|
|
11
11
|
// ============================================================================
|
|
12
12
|
// Schema Version for Migrations
|
|
13
13
|
// ============================================================================
|
|
14
|
-
export const SCHEMA_VERSION =
|
|
14
|
+
export const SCHEMA_VERSION = 11; // v11: adds goap_execution_steps — canonical GOAP execution history (A14)
|
|
15
15
|
export const SCHEMA_VERSION_TABLE = `
|
|
16
16
|
CREATE TABLE IF NOT EXISTS schema_version (
|
|
17
17
|
id INTEGER PRIMARY KEY CHECK (id = 1),
|
|
@@ -98,7 +98,13 @@ export const GOAP_SCHEMA = `
|
|
|
98
98
|
category TEXT NOT NULL,
|
|
99
99
|
qe_domain TEXT,
|
|
100
100
|
created_at TEXT DEFAULT (datetime('now')),
|
|
101
|
-
updated_at TEXT DEFAULT (datetime('now'))
|
|
101
|
+
updated_at TEXT DEFAULT (datetime('now')),
|
|
102
|
+
-- A14: real domain API method binding (kernel.getDomainAPI(qe_domain)[method](params)).
|
|
103
|
+
-- method/implemented are NULL/0 for actions with no real backing yet —
|
|
104
|
+
-- GOAPExecutor must report those as "not implemented", never simulate them.
|
|
105
|
+
method TEXT,
|
|
106
|
+
params TEXT,
|
|
107
|
+
implemented INTEGER DEFAULT 0
|
|
102
108
|
);
|
|
103
109
|
|
|
104
110
|
-- GOAP Plans
|
|
@@ -132,11 +138,50 @@ export const GOAP_SCHEMA = `
|
|
|
132
138
|
created_at TEXT DEFAULT (datetime('now'))
|
|
133
139
|
);
|
|
134
140
|
|
|
141
|
+
-- A14: canonical per-step execution history (was previously undefined in
|
|
142
|
+
-- this schema — plan-executor.ts invented its own parallel
|
|
143
|
+
-- execution_results/executed_steps tables instead). One row per action
|
|
144
|
+
-- step per execution attempt (execution_id groups steps from the same
|
|
145
|
+
-- plan.execute() call, since a plan can be executed/retried more than
|
|
146
|
+
-- once). Aggregate per-execution stats (steps completed/failed, total
|
|
147
|
+
-- duration, final world state) are derived by querying this table rather
|
|
148
|
+
-- than maintained in a separate denormalized summary table.
|
|
149
|
+
CREATE TABLE IF NOT EXISTS goap_execution_steps (
|
|
150
|
+
id TEXT PRIMARY KEY,
|
|
151
|
+
plan_id TEXT NOT NULL,
|
|
152
|
+
execution_id TEXT NOT NULL,
|
|
153
|
+
action_id TEXT NOT NULL,
|
|
154
|
+
step_order INTEGER NOT NULL,
|
|
155
|
+
world_state_before TEXT,
|
|
156
|
+
world_state_after TEXT,
|
|
157
|
+
status TEXT NOT NULL DEFAULT 'pending',
|
|
158
|
+
retries INTEGER DEFAULT 0,
|
|
159
|
+
started_at TEXT,
|
|
160
|
+
duration_ms INTEGER,
|
|
161
|
+
agent_id TEXT,
|
|
162
|
+
agent_output TEXT,
|
|
163
|
+
error_message TEXT,
|
|
164
|
+
created_at TEXT DEFAULT (datetime('now'))
|
|
165
|
+
-- Deliberately no FK to goap_plans/goap_actions: PlanExecutor.execute()
|
|
166
|
+
-- can legitimately run an ad-hoc GOAPPlan/GOAPAction that was never
|
|
167
|
+
-- saved via savePlan()/addAction() (e.g. programmatic orchestration
|
|
168
|
+
-- bypassing the A* planner). unified-memory.ts enables the
|
|
169
|
+
-- foreign_keys pragma, so an enforced FK here would reject that
|
|
170
|
+
-- entirely legitimate usage, not just catch real corruption.
|
|
171
|
+
);
|
|
172
|
+
|
|
135
173
|
-- GOAP Indexes
|
|
136
174
|
CREATE INDEX IF NOT EXISTS idx_goap_actions_category ON goap_actions(category);
|
|
137
175
|
CREATE INDEX IF NOT EXISTS idx_goap_actions_agent ON goap_actions(agent_type);
|
|
138
176
|
CREATE INDEX IF NOT EXISTS idx_goap_plans_status ON goap_plans(status);
|
|
139
177
|
CREATE INDEX IF NOT EXISTS idx_goap_sig_goal ON goap_plan_signatures(goal_hash);
|
|
178
|
+
CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_plan ON goap_execution_steps(plan_id);
|
|
179
|
+
CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_action ON goap_execution_steps(action_id);
|
|
180
|
+
-- idx_goap_exec_steps_execution is NOT created here: databases with a
|
|
181
|
+
-- pre-existing narrower goap_execution_steps table (missing execution_id)
|
|
182
|
+
-- would fail on "no such column" since CREATE TABLE IF NOT EXISTS above
|
|
183
|
+
-- silently no-ops against them. unified-memory.ts's v11 migration creates
|
|
184
|
+
-- this index only after confirming/backfilling the column.
|
|
140
185
|
`;
|
|
141
186
|
export const DREAM_SCHEMA = `
|
|
142
187
|
-- Concept Graph Nodes (Dream Engine)
|
|
@@ -602,6 +647,7 @@ export const STATS_TABLES = [
|
|
|
602
647
|
'goap_goals',
|
|
603
648
|
'goap_plans',
|
|
604
649
|
'goap_plan_signatures',
|
|
650
|
+
'goap_execution_steps',
|
|
605
651
|
'concept_nodes',
|
|
606
652
|
'concept_edges',
|
|
607
653
|
'dream_cycles',
|
|
@@ -91,6 +91,28 @@ export declare class UnifiedMemoryManager {
|
|
|
91
91
|
private columnExists;
|
|
92
92
|
private handleV2SchemaIncompatibilities;
|
|
93
93
|
private runMigrations;
|
|
94
|
+
/**
|
|
95
|
+
* A14: create/backfill goap_execution_steps and goap_actions' real-method
|
|
96
|
+
* binding columns (method/params/implemented).
|
|
97
|
+
*
|
|
98
|
+
* Re-running GOAP_SCHEMA's `CREATE TABLE IF NOT EXISTS` alone is
|
|
99
|
+
* insufficient here: some databases (this project's own dev DB included)
|
|
100
|
+
* already have a `goap_execution_steps` table left over from an older,
|
|
101
|
+
* narrower schema version that predates unified-memory-schemas.ts
|
|
102
|
+
* tracking this table at all — `IF NOT EXISTS` silently no-ops against it,
|
|
103
|
+
* permanently missing the columns plan-executor.ts now needs. Likewise
|
|
104
|
+
* `goap_actions` already exists in every migrated database (it's been
|
|
105
|
+
* part of the schema since v3), so the new method/params/implemented
|
|
106
|
+
* columns need an explicit ALTER, not just GOAP_SCHEMA's CREATE TABLE.
|
|
107
|
+
*
|
|
108
|
+
* Note: this only adds the columns — it does NOT backfill real method
|
|
109
|
+
* bindings onto already-seeded action rows (those exist with random,
|
|
110
|
+
* non-deterministic ids assigned at seed time, not stable across the
|
|
111
|
+
* qe-action-library.ts source). That backfill is a planning-layer
|
|
112
|
+
* concern, keyed by action `name` against the current library
|
|
113
|
+
* definitions — see GOAPPlanner.backfillActionMethodBindings().
|
|
114
|
+
*/
|
|
115
|
+
private migrateToV11GoapExecutionSteps;
|
|
94
116
|
private loadVectorIndex;
|
|
95
117
|
kvSet(key: string, value: unknown, namespace?: string, ttl?: number): Promise<void>;
|
|
96
118
|
kvGet<T>(key: string, namespace?: string): Promise<T | undefined>;
|
|
@@ -479,6 +479,8 @@ export class UnifiedMemoryManager {
|
|
|
479
479
|
}
|
|
480
480
|
if (currentVersion < 10)
|
|
481
481
|
this.db.exec(PATTERN_NULLS_SCHEMA);
|
|
482
|
+
if (currentVersion < 11)
|
|
483
|
+
this.migrateToV11GoapExecutionSteps();
|
|
482
484
|
this.db.prepare(`
|
|
483
485
|
INSERT OR REPLACE INTO schema_version (id, version, migrated_at)
|
|
484
486
|
VALUES (1, ?, datetime('now'))
|
|
@@ -488,6 +490,47 @@ export class UnifiedMemoryManager {
|
|
|
488
490
|
console.log(`[UnifiedMemory] Migration complete`);
|
|
489
491
|
}
|
|
490
492
|
}
|
|
493
|
+
/**
|
|
494
|
+
* A14: create/backfill goap_execution_steps and goap_actions' real-method
|
|
495
|
+
* binding columns (method/params/implemented).
|
|
496
|
+
*
|
|
497
|
+
* Re-running GOAP_SCHEMA's `CREATE TABLE IF NOT EXISTS` alone is
|
|
498
|
+
* insufficient here: some databases (this project's own dev DB included)
|
|
499
|
+
* already have a `goap_execution_steps` table left over from an older,
|
|
500
|
+
* narrower schema version that predates unified-memory-schemas.ts
|
|
501
|
+
* tracking this table at all — `IF NOT EXISTS` silently no-ops against it,
|
|
502
|
+
* permanently missing the columns plan-executor.ts now needs. Likewise
|
|
503
|
+
* `goap_actions` already exists in every migrated database (it's been
|
|
504
|
+
* part of the schema since v3), so the new method/params/implemented
|
|
505
|
+
* columns need an explicit ALTER, not just GOAP_SCHEMA's CREATE TABLE.
|
|
506
|
+
*
|
|
507
|
+
* Note: this only adds the columns — it does NOT backfill real method
|
|
508
|
+
* bindings onto already-seeded action rows (those exist with random,
|
|
509
|
+
* non-deterministic ids assigned at seed time, not stable across the
|
|
510
|
+
* qe-action-library.ts source). That backfill is a planning-layer
|
|
511
|
+
* concern, keyed by action `name` against the current library
|
|
512
|
+
* definitions — see GOAPPlanner.backfillActionMethodBindings().
|
|
513
|
+
*/
|
|
514
|
+
migrateToV11GoapExecutionSteps() {
|
|
515
|
+
const db = this.db;
|
|
516
|
+
db.exec(GOAP_SCHEMA); // no-op for goap_goals/plans/signatures if already present; creates goap_execution_steps fresh if absent entirely; adds goap_actions if absent entirely (fresh installs only)
|
|
517
|
+
const addColumnIfMissing = (table, column, definition) => {
|
|
518
|
+
const cols = db.prepare(`SELECT name FROM pragma_table_info('${table}')`).all();
|
|
519
|
+
if (!cols.some((c) => c.name === column)) {
|
|
520
|
+
db.exec(`ALTER TABLE ${table} ADD COLUMN ${column} ${definition}`);
|
|
521
|
+
}
|
|
522
|
+
};
|
|
523
|
+
// Nullable even though new rows always populate them — ALTER TABLE can't
|
|
524
|
+
// retroactively backfill a NOT NULL value for a pre-existing table.
|
|
525
|
+
addColumnIfMissing('goap_execution_steps', 'execution_id', 'TEXT');
|
|
526
|
+
addColumnIfMissing('goap_execution_steps', 'retries', 'INTEGER DEFAULT 0');
|
|
527
|
+
addColumnIfMissing('goap_execution_steps', 'started_at', 'TEXT');
|
|
528
|
+
addColumnIfMissing('goap_execution_steps', 'agent_output', 'TEXT');
|
|
529
|
+
addColumnIfMissing('goap_actions', 'method', 'TEXT');
|
|
530
|
+
addColumnIfMissing('goap_actions', 'params', 'TEXT');
|
|
531
|
+
addColumnIfMissing('goap_actions', 'implemented', 'INTEGER DEFAULT 0');
|
|
532
|
+
db.exec('CREATE INDEX IF NOT EXISTS idx_goap_exec_steps_execution ON goap_execution_steps(execution_id)');
|
|
533
|
+
}
|
|
491
534
|
async loadVectorIndex() {
|
|
492
535
|
if (this.vectorsLoaded)
|
|
493
536
|
return;
|
|
@@ -410,7 +410,9 @@ export class AQELearningEngine {
|
|
|
410
410
|
const key = `pattern-usage:search:${Date.now()}-${randomUUID().slice(0, 8)}`;
|
|
411
411
|
await this.memory.set(key, searchEvent, {
|
|
412
412
|
persist: true,
|
|
413
|
-
ttl
|
|
413
|
+
// ttl is in SECONDS, not ms (unified-memory.ts:607) — the extra
|
|
414
|
+
// * 1000 made this ~19,178 years instead of 7 days.
|
|
415
|
+
ttl: 7 * 24 * 60 * 60, // 7 days retention
|
|
414
416
|
});
|
|
415
417
|
}
|
|
416
418
|
catch (error) {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
*
|
|
15
15
|
* @module learning/dream/concept-graph
|
|
16
16
|
*/
|
|
17
|
-
import type { ConceptNode, ConceptGraphConfig, ConceptGraphStats, ConceptType, EdgeType, CreateConceptNodeInput, PatternImportData, NeighborResult } from './types.js';
|
|
17
|
+
import type { ConceptNode, ConceptGraphConfig, ConceptGraphStats, ConceptType, EdgeType, CreateConceptNodeInput, PatternImportData, FailureImportData, SuccessImportData, NeighborResult } from './types.js';
|
|
18
18
|
/**
|
|
19
19
|
* Graph-based concept storage for dream-based pattern discovery
|
|
20
20
|
*
|
|
@@ -95,6 +95,14 @@ export declare class ConceptGraph {
|
|
|
95
95
|
* @param depth How many hops to traverse (default: 2)
|
|
96
96
|
*/
|
|
97
97
|
getCluster(nodeId: string, depth?: number): Promise<ConceptNode[]>;
|
|
98
|
+
/**
|
|
99
|
+
* QEPatternType values representing methodology/approach — loaded as
|
|
100
|
+
* conceptType 'technique' rather than 'pattern' (A8-EXT). Without this
|
|
101
|
+
* split, no 'technique' node ever existed, so detectPatternMerges'
|
|
102
|
+
* pattern-OR-technique check and detectGaps' technique-presence check
|
|
103
|
+
* could never see a technique.
|
|
104
|
+
*/
|
|
105
|
+
private static readonly TECHNIQUE_PATTERN_TYPES;
|
|
98
106
|
/**
|
|
99
107
|
* Load patterns into the concept graph as nodes with edge discovery.
|
|
100
108
|
* Idempotent — skips patterns whose pattern_id already has a node.
|
|
@@ -114,6 +122,28 @@ export declare class ConceptGraph {
|
|
|
114
122
|
* @returns Number of new edges created
|
|
115
123
|
*/
|
|
116
124
|
discoverSameDomainEdges(newNodesByDomain?: Map<string, string[]>): Promise<number>;
|
|
125
|
+
/**
|
|
126
|
+
* Connect a newly-created node to up to `limit` existing pattern/technique
|
|
127
|
+
* nodes in the same domain — the resolution/technique signal detectGaps
|
|
128
|
+
* checks for. Deliberately domain-scoped only (never wired directly to the
|
|
129
|
+
* record's own source pattern) so "hasResolution" reflects whether some
|
|
130
|
+
* OTHER real pattern addresses the domain, not a trivial self-reference.
|
|
131
|
+
*/
|
|
132
|
+
private connectToDomainMates;
|
|
133
|
+
/**
|
|
134
|
+
* Load real ADR-110 pattern-null (recorded failure) rows as 'error'
|
|
135
|
+
* concept nodes — real data source for detectGaps' "error without
|
|
136
|
+
* resolution" check. Idempotent via the synthetic `error:<null.id>` key
|
|
137
|
+
* stored in pattern_id (concept_nodes.pattern_id has no FK, so this
|
|
138
|
+
* distinctly-prefixed key space never collides with a real qe_patterns.id).
|
|
139
|
+
*/
|
|
140
|
+
loadFailuresAsErrors(failures: FailureImportData[]): Promise<number>;
|
|
141
|
+
/**
|
|
142
|
+
* Load real qe_pattern_usage success rows as 'outcome' concept nodes —
|
|
143
|
+
* real data source for detectGaps' "outcome without technique" check.
|
|
144
|
+
* Same idempotency/domain-edge treatment as loadFailuresAsErrors.
|
|
145
|
+
*/
|
|
146
|
+
loadSuccessesAsOutcomes(successes: SuccessImportData[]): Promise<number>;
|
|
117
147
|
/**
|
|
118
148
|
* Count existing similarity edges for a domain.
|
|
119
149
|
* Uses concept_nodes metadata to identify domain membership.
|
|
@@ -358,6 +358,20 @@ export class ConceptGraph {
|
|
|
358
358
|
// ==========================================================================
|
|
359
359
|
// Pattern Import
|
|
360
360
|
// ==========================================================================
|
|
361
|
+
/**
|
|
362
|
+
* QEPatternType values representing methodology/approach — loaded as
|
|
363
|
+
* conceptType 'technique' rather than 'pattern' (A8-EXT). Without this
|
|
364
|
+
* split, no 'technique' node ever existed, so detectPatternMerges'
|
|
365
|
+
* pattern-OR-technique check and detectGaps' technique-presence check
|
|
366
|
+
* could never see a technique.
|
|
367
|
+
*/
|
|
368
|
+
static TECHNIQUE_PATTERN_TYPES = new Set([
|
|
369
|
+
'coverage-strategy',
|
|
370
|
+
'mutation-strategy',
|
|
371
|
+
'refactor-safe',
|
|
372
|
+
'error-handling',
|
|
373
|
+
'meta-optimization',
|
|
374
|
+
]);
|
|
361
375
|
/**
|
|
362
376
|
* Load patterns into the concept graph as nodes with edge discovery.
|
|
363
377
|
* Idempotent — skips patterns whose pattern_id already has a node.
|
|
@@ -376,8 +390,11 @@ export class ConceptGraph {
|
|
|
376
390
|
const existing = await this.findNodeByPatternId(pattern.id);
|
|
377
391
|
if (existing)
|
|
378
392
|
continue;
|
|
393
|
+
const conceptType = pattern.patternType && ConceptGraph.TECHNIQUE_PATTERN_TYPES.has(pattern.patternType)
|
|
394
|
+
? 'technique'
|
|
395
|
+
: 'pattern';
|
|
379
396
|
const patternNodeId = await this.addNode({
|
|
380
|
-
conceptType
|
|
397
|
+
conceptType,
|
|
381
398
|
content: `${pattern.name}: ${pattern.description}`,
|
|
382
399
|
patternId: pattern.id,
|
|
383
400
|
metadata: {
|
|
@@ -457,7 +474,7 @@ export class ConceptGraph {
|
|
|
457
474
|
const newIdSet = new Set(newIds);
|
|
458
475
|
const domainBudget = MAX_TOTAL_EDGES_PER_DOMAIN - existingDomainEdgeCount;
|
|
459
476
|
// Get existing (non-new) same-domain nodes
|
|
460
|
-
const allDomainNodes = this.db.prepare("SELECT id, metadata FROM concept_nodes WHERE concept_type
|
|
477
|
+
const allDomainNodes = this.db.prepare("SELECT id, metadata FROM concept_nodes WHERE concept_type IN ('pattern', 'technique')").all();
|
|
461
478
|
const existingDomainNodes = allDomainNodes.filter((n) => {
|
|
462
479
|
if (newIdSet.has(n.id))
|
|
463
480
|
return false;
|
|
@@ -548,6 +565,95 @@ export class ConceptGraph {
|
|
|
548
565
|
}
|
|
549
566
|
return edgesCreated;
|
|
550
567
|
}
|
|
568
|
+
// ==========================================================================
|
|
569
|
+
// Failure / Success Import (A8-EXT — detectGaps real data)
|
|
570
|
+
// ==========================================================================
|
|
571
|
+
/**
|
|
572
|
+
* Connect a newly-created node to up to `limit` existing pattern/technique
|
|
573
|
+
* nodes in the same domain — the resolution/technique signal detectGaps
|
|
574
|
+
* checks for. Deliberately domain-scoped only (never wired directly to the
|
|
575
|
+
* record's own source pattern) so "hasResolution" reflects whether some
|
|
576
|
+
* OTHER real pattern addresses the domain, not a trivial self-reference.
|
|
577
|
+
*/
|
|
578
|
+
connectToDomainMates(nodeId, domain, excludePatternId, limit = 10) {
|
|
579
|
+
if (!this.db)
|
|
580
|
+
return;
|
|
581
|
+
const mates = this.db.prepare(`SELECT id FROM concept_nodes
|
|
582
|
+
WHERE concept_type IN ('pattern', 'technique')
|
|
583
|
+
AND json_extract(metadata, '$.domain') = ?
|
|
584
|
+
AND (pattern_id IS NULL OR pattern_id != ?)
|
|
585
|
+
LIMIT ?`).all(domain, excludePatternId, limit);
|
|
586
|
+
for (const mate of mates) {
|
|
587
|
+
const existing = this.prepared.get('getEdge')?.get(nodeId, mate.id);
|
|
588
|
+
if (!existing) {
|
|
589
|
+
this.prepared.get('insertEdge').run(uuidv4(), nodeId, mate.id, 'co_occurrence', 0.4, 1);
|
|
590
|
+
}
|
|
591
|
+
}
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* Load real ADR-110 pattern-null (recorded failure) rows as 'error'
|
|
595
|
+
* concept nodes — real data source for detectGaps' "error without
|
|
596
|
+
* resolution" check. Idempotent via the synthetic `error:<null.id>` key
|
|
597
|
+
* stored in pattern_id (concept_nodes.pattern_id has no FK, so this
|
|
598
|
+
* distinctly-prefixed key space never collides with a real qe_patterns.id).
|
|
599
|
+
*/
|
|
600
|
+
async loadFailuresAsErrors(failures) {
|
|
601
|
+
this.ensureInitialized();
|
|
602
|
+
let loaded = 0;
|
|
603
|
+
for (const failure of failures) {
|
|
604
|
+
try {
|
|
605
|
+
const syntheticKey = `error:${failure.id}`;
|
|
606
|
+
const existing = await this.findNodeByPatternId(syntheticKey);
|
|
607
|
+
if (existing)
|
|
608
|
+
continue;
|
|
609
|
+
const errorNodeId = await this.addNode({
|
|
610
|
+
conceptType: 'error',
|
|
611
|
+
content: failure.failureMode,
|
|
612
|
+
patternId: syntheticKey,
|
|
613
|
+
metadata: { domain: failure.domain, sourcePatternId: failure.sourcePatternId },
|
|
614
|
+
});
|
|
615
|
+
loaded++;
|
|
616
|
+
this.connectToDomainMates(errorNodeId, failure.domain, failure.sourcePatternId);
|
|
617
|
+
}
|
|
618
|
+
catch (error) {
|
|
619
|
+
if (this.config.debug) {
|
|
620
|
+
console.error(`[ConceptGraph] Failed to load failure: ${failure.id}`, error);
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
return loaded;
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Load real qe_pattern_usage success rows as 'outcome' concept nodes —
|
|
628
|
+
* real data source for detectGaps' "outcome without technique" check.
|
|
629
|
+
* Same idempotency/domain-edge treatment as loadFailuresAsErrors.
|
|
630
|
+
*/
|
|
631
|
+
async loadSuccessesAsOutcomes(successes) {
|
|
632
|
+
this.ensureInitialized();
|
|
633
|
+
let loaded = 0;
|
|
634
|
+
for (const success of successes) {
|
|
635
|
+
try {
|
|
636
|
+
const syntheticKey = `outcome:${success.id}`;
|
|
637
|
+
const existing = await this.findNodeByPatternId(syntheticKey);
|
|
638
|
+
if (existing)
|
|
639
|
+
continue;
|
|
640
|
+
const outcomeNodeId = await this.addNode({
|
|
641
|
+
conceptType: 'outcome',
|
|
642
|
+
content: success.description,
|
|
643
|
+
patternId: syntheticKey,
|
|
644
|
+
metadata: { domain: success.domain, sourcePatternId: success.sourcePatternId },
|
|
645
|
+
});
|
|
646
|
+
loaded++;
|
|
647
|
+
this.connectToDomainMates(outcomeNodeId, success.domain, success.sourcePatternId);
|
|
648
|
+
}
|
|
649
|
+
catch (error) {
|
|
650
|
+
if (this.config.debug) {
|
|
651
|
+
console.error(`[ConceptGraph] Failed to load success: ${success.id}`, error);
|
|
652
|
+
}
|
|
653
|
+
}
|
|
654
|
+
}
|
|
655
|
+
return loaded;
|
|
656
|
+
}
|
|
551
657
|
/**
|
|
552
658
|
* Count existing similarity edges for a domain.
|
|
553
659
|
* Uses concept_nodes metadata to identify domain membership.
|
|
@@ -560,7 +666,7 @@ export class ConceptGraph {
|
|
|
560
666
|
SELECT COUNT(*) as count FROM concept_edges e
|
|
561
667
|
JOIN concept_nodes n ON e.source = n.id
|
|
562
668
|
WHERE e.edge_type = 'similarity'
|
|
563
|
-
AND n.concept_type
|
|
669
|
+
AND n.concept_type IN ('pattern', 'technique')
|
|
564
670
|
AND json_extract(n.metadata, '$.domain') = ?
|
|
565
671
|
`).get(domain);
|
|
566
672
|
return result.count;
|
|
@@ -18,7 +18,7 @@ import { type ActivationConfig } from './spreading-activation.js';
|
|
|
18
18
|
import { type InsightConfig, type DreamInsight } from './insight-generator.js';
|
|
19
19
|
import { RVCOWBranchManager, type Branch, type ValidationResult, type ValidationThresholds } from './rvcow-branch-manager.js';
|
|
20
20
|
import type { WitnessChain } from '../../audit/witness-chain.js';
|
|
21
|
-
import type { DreamCycle, PatternImportData } from './types.js';
|
|
21
|
+
import type { DreamCycle, PatternImportData, FailureImportData, SuccessImportData } from './types.js';
|
|
22
22
|
/**
|
|
23
23
|
* Complete DreamEngine configuration
|
|
24
24
|
*/
|
|
@@ -143,6 +143,18 @@ export declare class DreamEngine {
|
|
|
143
143
|
* @returns Number of patterns successfully loaded
|
|
144
144
|
*/
|
|
145
145
|
loadPatternsAsConcepts(patterns: PatternImportData[]): Promise<number>;
|
|
146
|
+
/**
|
|
147
|
+
* Load real ADR-110 pattern-null (failure) data as 'error' concept nodes
|
|
148
|
+
* (A8-EXT) — public wrapper for direct/test use; `ensureConceptsLoaded()`
|
|
149
|
+
* calls this automatically from the real qe_pattern_nulls table.
|
|
150
|
+
*/
|
|
151
|
+
loadFailuresAsConcepts(failures: FailureImportData[]): Promise<number>;
|
|
152
|
+
/**
|
|
153
|
+
* Load real qe_pattern_usage success data as 'outcome' concept nodes
|
|
154
|
+
* (A8-EXT) — public wrapper for direct/test use; `ensureConceptsLoaded()`
|
|
155
|
+
* calls this automatically from the real qe_pattern_usage table.
|
|
156
|
+
*/
|
|
157
|
+
loadSuccessesAsConcepts(successes: SuccessImportData[]): Promise<number>;
|
|
146
158
|
/**
|
|
147
159
|
* Ensure sufficient concepts are loaded for dreaming.
|
|
148
160
|
* If the concept graph has fewer nodes than minConceptsRequired,
|