agentic-qe 3.15.16 → 3.15.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.claude/helpers/brain-checkpoint.cjs +107 -10
- package/.claude/skills/agentic-quality-engineering/SKILL.md +67 -44
- package/.claude/skills/brutal-honesty-review/SKILL.md +12 -7
- package/.claude/skills/brutal-honesty-review/evals/brutal-honesty-review.yaml +120 -0
- package/.claude/skills/brutal-honesty-review/schemas/output.json +9 -3
- package/.claude/skills/code-review-quality/SKILL.md +2 -2
- package/.claude/skills/holistic-testing-pact/SKILL.md +11 -11
- package/.claude/skills/sherlock-review/SKILL.md +4 -2
- package/.claude/skills/sherlock-review/evals/sherlock-review.yaml +124 -0
- package/.claude/skills/skills-manifest.json +1 -1
- package/.claude/skills/technical-writing/SKILL.md +12 -6
- package/.claude/skills/technical-writing/evals/technical-writing.yaml +96 -0
- package/.opencode/skills/qe-agentic-quality-engineering.yaml +2 -2
- package/.opencode/skills/qe-holistic-testing-pact.yaml +2 -2
- package/CHANGELOG.md +201 -0
- package/assets/skills/agentic-quality-engineering/SKILL.md +67 -44
- package/assets/skills/brutal-honesty-review/SKILL.md +12 -8
- package/assets/skills/brutal-honesty-review/evals/brutal-honesty-review.yaml +120 -0
- package/assets/skills/brutal-honesty-review/schemas/output.json +9 -3
- package/assets/skills/code-review-quality/SKILL.md +2 -2
- package/assets/skills/holistic-testing-pact/SKILL.md +11 -11
- package/assets/skills/sherlock-review/SKILL.md +4 -3
- package/assets/skills/sherlock-review/evals/sherlock-review.yaml +124 -0
- package/assets/skills/skills-manifest.json +1 -1
- package/assets/skills/technical-writing/SKILL.md +12 -6
- package/assets/skills/technical-writing/evals/technical-writing.yaml +96 -0
- package/dist/cli/brain-commands.d.ts +5 -0
- package/dist/cli/brain-commands.js +4 -0
- package/dist/cli/bundle.js +6 -6
- package/dist/cli/chunks/adapter-WRSDXLOT.js +2 -0
- package/dist/cli/chunks/{agent-booster-wasm-45NWEKVS.js → agent-booster-wasm-UFNJNF3M.js} +2 -2
- package/dist/cli/chunks/{agent-handler-LVHMYFEF.js → agent-handler-EAYVRJXN.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-YDWOJFEQ.js → agent-memory-branch-M65C6WAQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-O6NJBCCM.js +2 -0
- package/dist/cli/chunks/{arena-ELDZH3CZ.js → arena-2GDICP6R.js} +4 -4
- package/dist/cli/chunks/{arena-CZKHXDDS.js → arena-CG3X67OE.js} +2 -2
- package/dist/cli/chunks/{audit-5MT4T47Z.js → audit-F4FSPJPL.js} +3 -3
- package/dist/cli/chunks/base-J2FXOE77.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-6TGYPC2B.js → better-sqlite3-2MCFXW4J.js} +2 -2
- package/dist/cli/chunks/brain-handler-WGTJNYNB.js +95 -0
- package/dist/cli/chunks/{branch-enumerator-WVILM4SO.js → branch-enumerator-KL7C535H.js} +2 -2
- package/dist/cli/chunks/{browser-RX5ALU3H.js → browser-SJEXDVHS.js} +2 -2
- package/dist/cli/chunks/browser-workflow-LXGER6ZD.js +2 -0
- package/dist/cli/chunks/{chunk-2H4XH6FT.js → chunk-244RKAEP.js} +2 -2
- package/dist/cli/chunks/{chunk-SI6DPU5D.js → chunk-27TUMXPD.js} +1 -1
- package/dist/cli/chunks/{chunk-YNMJEDN5.js → chunk-2MBYDPCP.js} +2 -2
- package/dist/cli/chunks/{chunk-24QHCVX6.js → chunk-2Q6DTBMT.js} +1 -1
- package/dist/cli/chunks/{chunk-XWUWX7BV.js → chunk-355MI7RV.js} +13 -13
- package/dist/cli/chunks/{chunk-NQXXI77K.js → chunk-3LX5OKBD.js} +2 -2
- package/dist/cli/chunks/{chunk-63GMRQ25.js → chunk-3RPDKJGV.js} +1 -1
- package/dist/cli/chunks/chunk-3YMIT73A.js +4 -0
- package/dist/cli/chunks/{chunk-P3EYRILV.js → chunk-43KUVBSU.js} +2 -2
- package/dist/cli/chunks/chunk-477FKXSS.js +2 -0
- package/dist/cli/chunks/{chunk-HGWXF45W.js → chunk-4BIMTRRX.js} +1 -1
- package/dist/cli/chunks/{chunk-SSUAAX3F.js → chunk-4CVNVBX5.js} +2 -2
- package/dist/cli/chunks/{chunk-5V3TI2LG.js → chunk-4HL3SD4A.js} +1 -1
- package/dist/cli/chunks/{chunk-KKU2QGSJ.js → chunk-4PEG4DU2.js} +2 -2
- package/dist/cli/chunks/{chunk-J4ELZNLY.js → chunk-4QSQKFED.js} +2 -2
- package/dist/cli/chunks/chunk-53ZBETYR.js +16 -0
- package/dist/cli/chunks/{chunk-7TE5ONQQ.js → chunk-544KDWL4.js} +1 -1
- package/dist/cli/chunks/chunk-54RCGMLB.js +8 -0
- package/dist/cli/chunks/{chunk-KU2AUFGX.js → chunk-5AGXIZQ5.js} +2 -2
- package/dist/cli/chunks/{chunk-LQLPB2T6.js → chunk-5M24X6W7.js} +2 -2
- package/dist/cli/chunks/{chunk-YU2BDRSD.js → chunk-5O5T4LEU.js} +1 -1
- package/dist/cli/chunks/{chunk-NAEWCFQT.js → chunk-5RFXX4IF.js} +2 -2
- package/dist/cli/chunks/{chunk-MD43XRX5.js → chunk-62MLAQRJ.js} +1 -1
- package/dist/cli/chunks/{chunk-PEQDY4BO.js → chunk-6D6TGL2E.js} +2 -2
- package/dist/cli/chunks/{chunk-IOYG4VFL.js → chunk-6IHZDSDL.js} +2 -2
- package/dist/cli/chunks/{chunk-C5FP5GW3.js → chunk-6P3Y45QL.js} +2 -2
- package/dist/cli/chunks/{chunk-4LQFBY5L.js → chunk-6TEVM3X3.js} +10 -10
- package/dist/cli/chunks/{chunk-YPBSUGMI.js → chunk-7XTUKKRA.js} +1 -1
- package/dist/cli/chunks/chunk-A3GDX6UF.js +2 -0
- package/dist/cli/chunks/{chunk-HLUXXCHF.js → chunk-A5YTKKNA.js} +1 -1
- package/dist/cli/chunks/{chunk-Y4PFUMOU.js → chunk-ADNGZAT2.js} +1 -1
- package/dist/cli/chunks/{chunk-KNSRL6NO.js → chunk-AWQAE3SW.js} +2 -2
- package/dist/cli/chunks/{chunk-BY5OF7OH.js → chunk-AXDBQFR4.js} +2 -2
- package/dist/cli/chunks/{chunk-525CFDUE.js → chunk-AXVD7O3F.js} +2 -2
- package/dist/cli/chunks/{chunk-JHQCRRJI.js → chunk-B52ULNYO.js} +2 -2
- package/dist/cli/chunks/chunk-B6S4FC7M.js +3 -0
- package/dist/cli/chunks/{chunk-AJMJNQMP.js → chunk-BDVFSMOQ.js} +1 -1
- package/dist/cli/chunks/{chunk-DXD6K2ZP.js → chunk-BGXXMX3Y.js} +2 -2
- package/dist/cli/chunks/{chunk-EK7OLYOZ.js → chunk-BKMQQY5T.js} +2 -2
- package/dist/cli/chunks/{chunk-VWPM27GU.js → chunk-BN2FROBQ.js} +2 -2
- package/dist/cli/chunks/{chunk-J7I6PABJ.js → chunk-BO6EQNOC.js} +2 -2
- package/dist/cli/chunks/{chunk-4D4DENG6.js → chunk-BOVAKCDC.js} +2 -2
- package/dist/cli/chunks/{chunk-ZFL436FN.js → chunk-BSXKZDKO.js} +2 -2
- package/dist/cli/chunks/{chunk-J442IZLE.js → chunk-C5QVJ5XQ.js} +1 -1
- package/dist/cli/chunks/{chunk-ZB3LEFYG.js → chunk-CFQLLF3D.js} +2 -2
- package/dist/cli/chunks/{chunk-UHEOGZLX.js → chunk-DUCVLT3F.js} +7 -7
- package/dist/cli/chunks/{chunk-TVGI32MB.js → chunk-E4RMJCGA.js} +3 -3
- package/dist/cli/chunks/{chunk-TIUKLYAI.js → chunk-EONDCWY4.js} +1 -1
- package/dist/cli/chunks/{chunk-ZJH5MU2I.js → chunk-F4AGNKL2.js} +2 -2
- package/dist/cli/chunks/{chunk-N7HL5PHH.js → chunk-F6YD3BOW.js} +1 -1
- package/dist/cli/chunks/{chunk-5VZL4UVN.js → chunk-FQRS7WVA.js} +2 -2
- package/dist/cli/chunks/{chunk-SHKOCGNK.js → chunk-FT24SSDG.js} +2 -2
- package/dist/cli/chunks/chunk-FV4YNSAJ.js +5 -0
- package/dist/cli/chunks/{chunk-KXCLACFG.js → chunk-FVDM3X42.js} +2 -2
- package/dist/cli/chunks/{chunk-32BPDLRZ.js → chunk-FVH7TXWU.js} +2 -2
- package/dist/cli/chunks/{chunk-72XSEQMW.js → chunk-FWR5QY37.js} +2 -2
- package/dist/cli/chunks/chunk-FYINK2B7.js +6 -0
- package/dist/cli/chunks/{chunk-5JZRZI4S.js → chunk-GGISVPOZ.js} +2 -2
- package/dist/cli/chunks/{chunk-5LAVKGLH.js → chunk-GPIJIZJQ.js} +2 -2
- package/dist/cli/chunks/{chunk-5QO3R3TU.js → chunk-GXEVOT5F.js} +2 -2
- package/dist/cli/chunks/{chunk-IHRXZZQM.js → chunk-GZ4VB5RI.js} +1 -1
- package/dist/cli/chunks/chunk-HBDSCYSK.js +2 -0
- package/dist/cli/chunks/{chunk-GSKMOPL7.js → chunk-HGG4HR7C.js} +2 -2
- package/dist/cli/chunks/{chunk-AR67RJPY.js → chunk-HSCKWWO2.js} +2 -2
- package/dist/cli/chunks/{chunk-6XXZDV2C.js → chunk-HSQ3GUYJ.js} +2 -2
- package/dist/cli/chunks/{chunk-AAMLQ2LF.js → chunk-HZQBW5EM.js} +3 -3
- package/dist/cli/chunks/{chunk-O5W3FIO6.js → chunk-IGIYANVT.js} +2 -2
- package/dist/cli/chunks/{chunk-C6D5AHBO.js → chunk-IPWMSXBF.js} +2 -2
- package/dist/cli/chunks/{chunk-NDJ7P2EP.js → chunk-IWVNC7VY.js} +1 -1
- package/dist/cli/chunks/{chunk-FDDC72IA.js → chunk-IZODXKZD.js} +2 -2
- package/dist/cli/chunks/{chunk-NO3IV5Q5.js → chunk-J2MT2OJV.js} +1 -1
- package/dist/cli/chunks/{chunk-GQ6TUIKY.js → chunk-JKIJVVSP.js} +1 -1
- package/dist/cli/chunks/{chunk-LE4QJREF.js → chunk-JMRDT2XK.js} +1 -1
- package/dist/cli/chunks/{chunk-2YZ4G6NW.js → chunk-JR2UMTKG.js} +1 -1
- package/dist/cli/chunks/{chunk-RJIEG3NA.js → chunk-K6CH4CFF.js} +2 -2
- package/dist/cli/chunks/{chunk-5NNNEWLS.js → chunk-K7KW5QB5.js} +81 -88
- package/dist/cli/chunks/chunk-KFCQP434.js +2 -0
- package/dist/cli/chunks/{chunk-A5GBXCP5.js → chunk-KH4T6STG.js} +2 -2
- package/dist/cli/chunks/{chunk-VMDFFTCK.js → chunk-KJBYZO57.js} +1 -1
- package/dist/cli/chunks/{chunk-GJYHWYXR.js → chunk-KP4OKOKV.js} +2 -2
- package/dist/cli/chunks/chunk-L2MBKVSE.js +2 -0
- package/dist/cli/chunks/{chunk-XIQW7EFL.js → chunk-L3IPUIT3.js} +2 -2
- package/dist/cli/chunks/{chunk-W5HQUIML.js → chunk-L7PSU2YN.js} +2 -2
- package/dist/cli/chunks/{chunk-6DPYNAOK.js → chunk-LA3JPGQA.js} +2 -2
- package/dist/cli/chunks/{chunk-5PBLPQ5T.js → chunk-LC2QRN7V.js} +14 -13
- package/dist/cli/chunks/{chunk-SSYAQZXA.js → chunk-LHY7TMTM.js} +2 -2
- package/dist/cli/chunks/{chunk-QQWBWEJS.js → chunk-LLQ2UMF6.js} +3 -3
- package/dist/cli/chunks/{chunk-DTMAS2GB.js → chunk-LOJ7OO6W.js} +2 -2
- package/dist/cli/chunks/{chunk-32GN3JKR.js → chunk-LPUSH3VF.js} +1 -1
- package/dist/cli/chunks/{chunk-SDLWKRVL.js → chunk-LSEC2BU7.js} +2 -2
- package/dist/cli/chunks/{chunk-IOKYCMTJ.js → chunk-LTGB7OIU.js} +2 -2
- package/dist/cli/chunks/{chunk-6ZBXSOX6.js → chunk-LUG7YNVZ.js} +2 -2
- package/dist/cli/chunks/{chunk-CAKMOVZ6.js → chunk-LWAFRYKE.js} +2 -2
- package/dist/cli/chunks/{chunk-FLNAW7C4.js → chunk-M24ZAZ4U.js} +2 -2
- package/dist/cli/chunks/{chunk-L2DWPVNJ.js → chunk-MKRKRXTX.js} +1 -1
- package/dist/cli/chunks/{chunk-YTHTQPWR.js → chunk-MNNLONAD.js} +1 -1
- package/dist/cli/chunks/{chunk-V5NHZV7S.js → chunk-MQM37KAR.js} +2 -2
- package/dist/cli/chunks/{chunk-PPUZWYUG.js → chunk-MSX2OHYT.js} +2 -2
- package/dist/cli/chunks/{chunk-YRAX7SFJ.js → chunk-MVYQRVLP.js} +2 -2
- package/dist/cli/chunks/{chunk-QVDCVD5D.js → chunk-MZC5WM2P.js} +2 -2
- package/dist/cli/chunks/{chunk-S75SOOZL.js → chunk-MZRBNBB3.js} +2 -2
- package/dist/cli/chunks/{chunk-FL64OUBA.js → chunk-N3KQU4UC.js} +2 -2
- package/dist/cli/chunks/{chunk-G5RHFBAY.js → chunk-NKU3FFM4.js} +2 -2
- package/dist/cli/chunks/chunk-O5EWFR76.js +2 -0
- package/dist/cli/chunks/{chunk-63ZKI4PX.js → chunk-O5RDHD5T.js} +2 -2
- package/dist/cli/chunks/chunk-O6UWIXME.js +3 -0
- package/dist/cli/chunks/{chunk-HCH4Y6XX.js → chunk-OA4EQDC4.js} +2 -2
- package/dist/cli/chunks/{chunk-QPEOLAAS.js → chunk-OBCXCRXK.js} +1 -1
- package/dist/cli/chunks/{chunk-6ICX3FEG.js → chunk-OHU5P25N.js} +22 -22
- package/dist/cli/chunks/{chunk-GFWHUQSF.js → chunk-OOSV2RIA.js} +2 -2
- package/dist/cli/chunks/{chunk-MO55CVMT.js → chunk-OW23N2Y5.js} +14 -14
- package/dist/cli/chunks/{chunk-M7WJCTG3.js → chunk-OXOO3YDL.js} +2 -2
- package/dist/cli/chunks/{chunk-KQYJ4VQ5.js → chunk-OYGKSSSI.js} +1 -1
- package/dist/cli/chunks/chunk-PGO46IIW.js +2 -0
- package/dist/cli/chunks/{chunk-NVEWF4JV.js → chunk-PZOYQHWS.js} +1 -1
- package/dist/cli/chunks/{chunk-IESR7TNB.js → chunk-Q2BZSG7Z.js} +2 -2
- package/dist/cli/chunks/{chunk-XIIQ5QTT.js → chunk-Q7V722K5.js} +2 -2
- package/dist/cli/chunks/{chunk-F742SZAX.js → chunk-QZU6M5IO.js} +2 -2
- package/dist/cli/chunks/{chunk-PINSJCM3.js → chunk-R55Y76SJ.js} +1 -1
- package/dist/cli/chunks/{chunk-5B5QPCNU.js → chunk-RMEQYJPU.js} +4 -4
- package/dist/cli/chunks/{chunk-ZQ2XW3IP.js → chunk-RTYXFXTI.js} +2 -2
- package/dist/cli/chunks/{chunk-DVYHMDFR.js → chunk-SJF3O4FX.js} +374 -371
- package/dist/cli/chunks/{chunk-AG2EWGXS.js → chunk-SOUS7Z2H.js} +2 -2
- package/dist/cli/chunks/{chunk-3HD7E6HN.js → chunk-SRVNR3R3.js} +2 -2
- package/dist/cli/chunks/{chunk-KITOPKRG.js → chunk-SU3SXMVG.js} +2 -2
- package/dist/cli/chunks/chunk-SWGPLXWW.js +32 -0
- package/dist/cli/chunks/{chunk-ZR2TKVXQ.js → chunk-TRB3EVH3.js} +2 -2
- package/dist/cli/chunks/{chunk-OCV2XEWQ.js → chunk-TVBDUMKT.js} +2 -2
- package/dist/cli/chunks/{chunk-IOQ6ZQ5W.js → chunk-TWTXPSFU.js} +1 -1
- package/dist/cli/chunks/{chunk-CJSHWQXP.js → chunk-ULYUVUL2.js} +2 -2
- package/dist/cli/chunks/{chunk-PHT5N7SC.js → chunk-UNTBVJ5X.js} +2 -2
- package/dist/cli/chunks/{chunk-LKTTUHLF.js → chunk-UQAA4PHU.js} +2 -2
- package/dist/cli/chunks/{chunk-SR52XP5F.js → chunk-UWSJVKTE.js} +1 -1
- package/dist/cli/chunks/{chunk-L6QSTQME.js → chunk-V2LJ54KP.js} +2 -2
- package/dist/cli/chunks/{chunk-FBDVGRSC.js → chunk-VCCTTKP3.js} +7 -7
- package/dist/cli/chunks/{chunk-YLMNVLDK.js → chunk-VEGUYUVS.js} +1 -1
- package/dist/cli/chunks/{chunk-ASEOFRIG.js → chunk-VUQPVWNK.js} +2 -2
- package/dist/cli/chunks/{chunk-VXFLJNCA.js → chunk-VVGUE2T2.js} +2 -2
- package/dist/cli/chunks/{chunk-4NFQLP6R.js → chunk-W5ASDHJQ.js} +1 -1
- package/dist/cli/chunks/{chunk-I7MQIM2U.js → chunk-WGXT5NWQ.js} +1 -1
- package/dist/cli/chunks/chunk-WJN3V7QB.js +7 -0
- package/dist/cli/chunks/chunk-WPCRQIIF.js +29 -0
- package/dist/cli/chunks/{chunk-SASBO5Y5.js → chunk-WQNLXUWA.js} +6 -6
- package/dist/cli/chunks/{chunk-5SPCGMBB.js → chunk-WZVRMKG2.js} +2 -2
- package/dist/cli/chunks/{chunk-MI5MFHRA.js → chunk-X27IUWTD.js} +2 -2
- package/dist/cli/chunks/{chunk-HJ6ZGVTB.js → chunk-X4B345B6.js} +2 -2
- package/dist/cli/chunks/{chunk-HVRRLYX6.js → chunk-X5I2Y4VO.js} +2 -2
- package/dist/cli/chunks/{chunk-SUDMM5SO.js → chunk-X7IQIFTS.js} +2 -2
- package/dist/cli/chunks/chunk-XJN3RKUD.js +3 -0
- package/dist/cli/chunks/{chunk-E3D4GPLP.js → chunk-XQMGXTHJ.js} +3 -3
- package/dist/cli/chunks/{chunk-67Z5R7RJ.js → chunk-XTSAMB2Q.js} +2 -2
- package/dist/cli/chunks/{chunk-KVF4NXGQ.js → chunk-XZLIF4O2.js} +2 -2
- package/dist/cli/chunks/{chunk-EA4YQVKS.js → chunk-Y4LSEOZ3.js} +1 -1
- package/dist/cli/chunks/{chunk-OAEE6JWQ.js → chunk-Y4YN2RXR.js} +2 -2
- package/dist/cli/chunks/{chunk-CEYSYSK5.js → chunk-YDI56L35.js} +2 -2
- package/dist/cli/chunks/{chunk-JDIYMZCQ.js → chunk-YFILS5D5.js} +2 -2
- package/dist/cli/chunks/{chunk-GAHNO6JJ.js → chunk-YISDX6WB.js} +2 -2
- package/dist/cli/chunks/{chunk-AGRV5B3T.js → chunk-YP2GHQSV.js} +2 -2
- package/dist/cli/chunks/{chunk-UNGBRZDK.js → chunk-YSX756AM.js} +4 -4
- package/dist/cli/chunks/{chunk-BEKDKVQT.js → chunk-YWANOASW.js} +2 -2
- package/dist/cli/chunks/{chunk-JQ3DYUMS.js → chunk-YYIJLG7S.js} +2 -2
- package/dist/cli/chunks/{chunk-CRPIYUTJ.js → chunk-Z7SD7LXM.js} +2 -2
- package/dist/cli/chunks/{chunk-U2A7NHZA.js → chunk-ZDWD73UF.js} +2 -2
- package/dist/cli/chunks/{chunk-WP4RETKG.js → chunk-ZFT3RLA4.js} +2 -2
- package/dist/cli/chunks/{chunk-VJCIEHEF.js → chunk-ZNTHX5G3.js} +1 -1
- package/dist/cli/chunks/{chunk-PF7RBAYL.js → chunk-ZS27R7VL.js} +2 -2
- package/dist/cli/chunks/{chunk-24OX5TQJ.js → chunk-ZXHHHR7K.js} +1 -1
- package/dist/cli/chunks/{ci-MFUR4CWV.js → ci-N5MOMNXH.js} +2 -2
- package/dist/cli/chunks/{ci-config-PNDLQ6XV.js → ci-config-6L2ROQCW.js} +2 -2
- package/dist/cli/chunks/{ci-output-PFZ4M7NC.js → ci-output-DSRBYEIK.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-5HH6NLZN.js → circuit-breaker-VRPTNBL7.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-QCKYLGLC.js → claude-flow-setup-4YFG3FU5.js} +2 -2
- package/dist/cli/chunks/client-I3L6BKRQ.js +2 -0
- package/dist/cli/chunks/{cline-installer-EASVPFXR.js → cline-installer-7RGYJWGN.js} +2 -2
- package/dist/cli/chunks/{code-UJXDVYRK.js → code-ISC6NW2K.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-BZJ3UDP4.js → code-index-extractor-2FID75YV.js} +2 -2
- package/dist/cli/chunks/{codex-installer-XSQZUVOZ.js → codex-installer-DZ7OG6KM.js} +2 -2
- package/dist/cli/chunks/{completions-OWOOJFI2.js → completions-SM3LICWK.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-KP5TOHDT.js → complexity-analyzer-ZWD2CTAD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-IFKQXLHM.js → continuedev-installer-AGASOA26.js} +2 -2
- package/dist/cli/chunks/copilot-installer-CLPZYTQC.js +3 -0
- package/dist/cli/chunks/core-handlers-5EFOJ37H.js +2 -0
- package/dist/cli/chunks/{cost-tracker-MMDDNKZB.js → cost-tracker-7PIGQYDV.js} +2 -2
- package/dist/cli/chunks/{coverage-LUH2B7NT.js → coverage-T2GEBTYS.js} +9 -9
- package/dist/cli/chunks/cross-domain-router-65WJAKVD.js +2 -0
- package/dist/cli/chunks/{cursor-installer-4YLM5GWM.js → cursor-installer-KXBID4MB.js} +2 -2
- package/dist/cli/chunks/daemon-43MXIVH3.js +18 -0
- package/dist/cli/chunks/{daemon-MZKVM4CJ.js → daemon-VAMJLQJ5.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-X4CYW665.js → dag-attention-scheduler-UBP4VHTA.js} +2 -2
- package/dist/cli/chunks/{detect-7BM2XINO.js → detect-QWFIQRKI.js} +2 -2
- package/dist/cli/chunks/{dist-node-Y5APLEYB.js → dist-node-I2GICS3W.js} +2 -2
- package/dist/cli/chunks/{domain-handler-X3ZRJNAH.js → domain-handler-Z66ISB2A.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-2UW5KQJB.js → domain-plugins-KHMD3FKT.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-35W4CIBV.js → domain-transfer-JWGNNA6K.js} +2 -2
- package/dist/cli/chunks/dream-VQ2PZCVR.js +2 -0
- package/dist/cli/chunks/embed-and-insert-pattern-F5P5B6JX.js +3 -0
- package/dist/cli/chunks/{embedding-space-SBM2MZD2.js → embedding-space-KHG6TITM.js} +2 -2
- package/dist/cli/chunks/{eval-4QA2SROK.js → eval-43OHU7EI.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-Z6BF6KYM.js → experience-capture-middleware-KXD47H6P.js} +3 -3
- package/dist/cli/chunks/{fast-paths-FIORX6GN.js → fast-paths-6D75D5KD.js} +2 -2
- package/dist/cli/chunks/{feature-flags-6LYI2T4G.js → feature-flags-IE35Y55N.js} +2 -2
- package/dist/cli/chunks/{feature-flags-ZOO7LMIC.js → feature-flags-OYYHY7LS.js} +2 -2
- package/dist/cli/chunks/file-discovery-LGBTY3ID.js +2 -0
- package/dist/cli/chunks/{fleet-7WF53H4F.js → fleet-AGVJMFGD.js} +16 -16
- package/dist/cli/chunks/{gnn-wrapper-KJ6B7BRM.js → gnn-wrapper-5L66A7LW.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-DEKKMOVW.js → heartbeat-handler-2BY6YYOT.js} +5 -5
- package/dist/cli/chunks/heartbeat-scheduler-3DU3M5AT.js +2 -0
- package/dist/cli/chunks/hnsw-adapter-N2IMSRPV.js +2 -0
- package/dist/cli/chunks/hnsw-index-DVU7TTJE.js +2 -0
- package/dist/cli/chunks/{hnsw-legacy-bridge-L27WS27N.js → hnsw-legacy-bridge-RYMWFNAH.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-4YOQC6L4.js → hnswlib-node-GG47HP2P.js} +2 -2
- package/dist/cli/chunks/{hooks-TAOKV4EJ.js → hooks-FQNACS24.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-AS2PNHOD.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-BODRJLHL.js → hypergraph-engine-6BYNJQEP.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-RKMYJNTU.js → hypergraph-handler-CYTAXZKJ.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-Y4OONLFP.js +2 -0
- package/dist/cli/chunks/{init-guard-MXHSLSB2.js → init-guard-METTAV5O.js} +2 -2
- package/dist/cli/chunks/{init-handler-HUE57IFW.js → init-handler-GFT74U5Y.js} +6 -6
- package/dist/cli/chunks/init-wizard-HLNUBJQN.js +2 -0
- package/dist/cli/chunks/kernel-XKFWCL7Y.js +2 -0
- package/dist/cli/chunks/{kilocode-installer-S333IKYQ.js → kilocode-installer-GZV2D3FF.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-WM5DLQWC.js → kiro-installer-Q4ZXUFC7.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-CNL77CSZ.js +2 -0
- package/dist/cli/chunks/{learning-LNHMQLH5.js → learning-WA2QEYL7.js} +35 -34
- package/dist/cli/chunks/{llm-router-EWFXYZZR.js → llm-router-GRTCHWH7.js} +4 -4
- package/dist/cli/chunks/llm-router-service-UIYTYKP6.js +2 -0
- package/dist/cli/chunks/{load-FGYGWVDK.js → load-WXN3Q7Y5.js} +2 -2
- package/dist/cli/chunks/load-test-PXLW4A5B.js +2 -0
- package/dist/cli/chunks/{mcp-2FHNAAOM.js → mcp-LIQCPSJN.js} +2 -2
- package/dist/cli/chunks/{memory-DZMQ73AB.js → memory-OP6CHRFH.js} +5 -5
- package/dist/cli/chunks/memory-backend-XYOSO73Q.js +2 -0
- package/dist/cli/chunks/memory-handlers-PQFYVNVG.js +2 -0
- package/dist/cli/chunks/{multi-model-executor-6F2UAEUW.js → multi-model-executor-H54DEVRZ.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-XY3BGOTZ.js → opencode-installer-BSQV6UAT.js} +2 -2
- package/dist/cli/chunks/{orchestrator-B4CNKUOS.js → orchestrator-TJDPQ4VL.js} +122 -35
- package/dist/cli/chunks/pattern-null-store-BKGTQFNF.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-R4GUFNMD.js → pattern-usage-recorder-FOVS4M5L.js} +2 -2
- package/dist/cli/chunks/{pipeline-FG5RKVRO.js → pipeline-4AY2ZIC6.js} +2 -2
- package/dist/cli/chunks/{platform-3BT4KEVJ.js → platform-FCSITYMR.js} +2 -2
- package/dist/cli/chunks/{plugin-WI4RIN7O.js → plugin-E56TV5S2.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-7ECDNQFS.js → prime-radiant-advanced-wasm-ACOPC533.js} +2 -2
- package/dist/cli/chunks/project-root-MPX7CN2C.js +2 -0
- package/dist/cli/chunks/protocol-executor-CRQOCC4A.js +2 -0
- package/dist/cli/chunks/{protocol-handler-WNODKPGW.js → protocol-handler-KRVXF4LS.js} +2 -2
- package/dist/cli/chunks/{prove-5RHAEPYZ.js → prove-KMFPSKGD.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-UEGQ3O7F.js +2 -0
- package/dist/cli/chunks/{quality-WPHR7BGQ.js → quality-6DBI3HLB.js} +2 -2
- package/dist/cli/chunks/{quality-gate-4RKTEZMX.js → quality-gate-3ROZMEIL.js} +3 -3
- package/dist/cli/chunks/queen-coordinator-32574XSG.js +2 -0
- package/dist/cli/chunks/real-embeddings-MIGZNKK3.js +2 -0
- package/dist/cli/chunks/{ref-validation-TPAWHOHH.js → ref-validation-EYIP7DHW.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-7AVHFNDI.js → roocode-installer-IGGZHR2Y.js} +2 -2
- package/dist/cli/chunks/router-CZJY5WX6.js +2 -0
- package/dist/cli/chunks/routing-feedback-RC3UBNFX.js +2 -0
- package/dist/cli/chunks/{routing-handler-YKEDVJSH.js → routing-handler-BWNHBYDC.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-JUAMM354.js → ruvector-commands-PXIHF432.js} +2 -2
- package/dist/cli/chunks/rvf-dual-writer-OG7OV2AK.js +2 -0
- package/dist/cli/chunks/rvf-migration-adapter-THYMW7ZO.js +2 -0
- package/dist/cli/chunks/rvf-migration-coordinator-3H6CLFU7.js +2 -0
- package/dist/cli/chunks/rvf-native-adapter-6JQJIKKW.js +2 -0
- package/dist/cli/chunks/{rvf-store-integrity-VJDUIRTX.js → rvf-store-integrity-CVB3NMSL.js} +2 -2
- package/dist/cli/chunks/safe-db-QFKCVTIJ.js +2 -0
- package/dist/cli/chunks/schedule-6JLVMMYB.js +2 -0
- package/dist/cli/chunks/scheduler-3MPZRMJD.js +2 -0
- package/dist/cli/chunks/{security-ORDN3RD2.js → security-DCRGOTWU.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-CF4BCIO7.js → shared-rvf-adapter-GKD74QUB.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-C32UBR6D.js → shared-rvf-dual-writer-HVAAVEOH.js} +2 -2
- package/dist/cli/chunks/sqlite-persistence-LGTIKAEX.js +2 -0
- package/dist/cli/chunks/{standalone-memory-OXRJYZXN.js → standalone-memory-O7O2U5N4.js} +2 -2
- package/dist/cli/chunks/{status-handler-BCX5D4HY.js → status-handler-BQTPJJTL.js} +2 -2
- package/dist/cli/chunks/{structural-health-LFG7RUU6.js → structural-health-4H6J4OHK.js} +2 -2
- package/dist/cli/chunks/sync-DJ4TF6QX.js +2 -0
- package/dist/cli/chunks/{sync-YJEE2K2L.js → sync-WW5TAVYW.js} +2 -2
- package/dist/cli/chunks/{task-handler-6LXKPTXJ.js → task-handler-HEM4IEOW.js} +2 -2
- package/dist/cli/chunks/{task-handlers-CILP36I7.js → task-handlers-JRA3NXIR.js} +3 -3
- package/dist/cli/chunks/test-772ZXVG2.js +34 -0
- package/dist/cli/chunks/test-runner-process-XGF2U3NG.js +2 -0
- package/dist/cli/chunks/{test-scheduling-ISI2O4Q5.js → test-scheduling-4TRB7LZ7.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-CICBIJ7T.js +2 -0
- package/dist/cli/chunks/{token-usage-XOC5KG7S.js → token-usage-B7PEKE2G.js} +2 -2
- package/dist/cli/chunks/{transformers-LSLQAARK.js → transformers-V7X7BDZX.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-OXPFKFZS.js +2 -0
- package/dist/cli/chunks/{types-5BLCGLCR.js → types-AHHTUY3I.js} +2 -2
- package/dist/cli/chunks/unified-memory-GUR3IUI6.js +2 -0
- package/dist/cli/chunks/unified-memory-hnsw-NJP2F2RY.js +2 -0
- package/dist/cli/chunks/unified-persistence-NILBWXDP.js +2 -0
- package/dist/cli/chunks/{upgrade-RQJYLK3J.js → upgrade-DZ4DLUQ5.js} +2 -2
- package/dist/cli/chunks/{validate-QBHWXXCK.js → validate-4DTLIDJE.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-IKXBKFB5.js → validate-swarm-A26UFVIS.js} +2 -2
- package/dist/cli/chunks/visual-security-YECYZ27X.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-ZF6FIE5R.js → web-tree-sitter-F2C7QRYT.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-HQGDZT5D.js → windsurf-installer-OOBTDA6W.js} +2 -2
- package/dist/cli/chunks/{witness-chain-DCHCAMSQ.js → witness-chain-KGFZJP32.js} +2 -2
- package/dist/cli/chunks/witness-chain-LYBXFLJB.js +2 -0
- package/dist/cli/chunks/witness-chain-repair-CNTXOGPN.js +2 -0
- package/dist/cli/chunks/{witness-chain-verifier-PX2OQ6XT.js → witness-chain-verifier-OB7ZZOI3.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-RXYQNFJB.js → witness-key-manager-YCKGKGQI.js} +2 -2
- package/dist/cli/chunks/{workflow-FBKCA4H6.js → workflow-PRERHWKY.js} +4 -4
- package/dist/cli/chunks/workflow-orchestrator-UIBGWCU3.js +2 -0
- package/dist/cli/chunks/wrappers-L4UY4V63.js +2 -0
- package/dist/cli/commands/coverage.js +4 -1
- package/dist/cli/commands/learning-prune.js +9 -1
- package/dist/cli/commands/test.js +26 -4
- package/dist/cli/handlers/brain-handler.js +32 -2
- package/dist/cli/handlers/heartbeat-handler.js +3 -1
- package/dist/cli/utils/coverage-data.js +5 -1
- package/dist/cli/utils/coverage-verdict.d.ts +10 -2
- package/dist/cli/utils/coverage-verdict.js +23 -8
- package/dist/cli/utils/fleet-operation.js +9 -3
- package/dist/coordination/handlers/code-intelligence-handlers.js +17 -3
- package/dist/coordination/handlers/coverage-handlers.js +22 -9
- package/dist/coordination/handlers/coverage-target.d.ts +22 -2
- package/dist/coordination/handlers/coverage-target.js +45 -9
- package/dist/coordination/handlers/handler-utils.d.ts +19 -0
- package/dist/coordination/handlers/handler-utils.js +22 -8
- package/dist/coordination/handlers/test-execution-handlers.js +64 -20
- package/dist/coordination/protocols/code-intelligence-index.js +6 -3
- package/dist/coordination/protocols/learning-consolidation-archive.d.ts +6 -3
- package/dist/coordination/protocols/learning-consolidation-archive.js +4 -3
- package/dist/coordination/workflow-builtin.js +1 -0
- package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +8 -3
- package/dist/domains/code-intelligence/services/semantic-analyzer.js +39 -25
- package/dist/domains/code-intelligence/services/text-relevance.d.ts +32 -0
- package/dist/domains/code-intelligence/services/text-relevance.js +63 -0
- package/dist/domains/defect-intelligence/interfaces.d.ts +2 -0
- package/dist/domains/defect-intelligence/prediction-history.d.ts +15 -1
- package/dist/domains/defect-intelligence/prediction-history.js +63 -7
- package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +1 -0
- package/dist/domains/defect-intelligence/services/defect-predictor.js +33 -13
- package/dist/domains/learning-optimization/coordinator.js +17 -10
- package/dist/domains/learning-optimization/domain-ranking.d.ts +26 -0
- package/dist/domains/learning-optimization/domain-ranking.js +28 -0
- package/dist/domains/learning-optimization/interfaces.d.ts +5 -0
- package/dist/domains/learning-optimization/pattern-archive.d.ts +55 -8
- package/dist/domains/learning-optimization/pattern-archive.js +90 -17
- package/dist/domains/learning-optimization/pattern-consolidation.js +18 -2
- package/dist/domains/learning-optimization/pattern-merge.d.ts +26 -0
- package/dist/domains/learning-optimization/pattern-merge.js +127 -0
- package/dist/domains/learning-optimization/services/learning-coordinator.js +21 -35
- package/dist/domains/test-execution/coordinator.d.ts +3 -1
- package/dist/domains/test-execution/coordinator.js +13 -4
- package/dist/domains/test-execution/interfaces.d.ts +5 -0
- package/dist/domains/test-execution/plugin.js +2 -0
- package/dist/domains/test-execution/services/flaky-detector.d.ts +9 -1
- package/dist/domains/test-execution/services/flaky-detector.js +26 -8
- package/dist/domains/test-execution/services/retry-handler.d.ts +7 -1
- package/dist/domains/test-execution/services/retry-handler.js +44 -5
- package/dist/domains/test-execution/services/runner-test-cases.d.ts +2 -0
- package/dist/domains/test-execution/services/runner-test-cases.js +7 -3
- package/dist/domains/test-execution/services/test-executor.d.ts +5 -1
- package/dist/domains/test-execution/services/test-executor.js +85 -17
- package/dist/init/copilot-installer.d.ts +6 -0
- package/dist/init/copilot-installer.js +37 -17
- package/dist/init/init-wizard-steps.js +3 -1
- package/dist/init/phases/07-hooks.js +97 -10
- package/dist/init/platform-config-generator.d.ts +10 -0
- package/dist/init/platform-config-generator.js +26 -1
- package/dist/integrations/embeddings/cache/EmbeddingCache.js +1 -1
- package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +16 -1
- package/dist/integrations/ruvector/brain-rvf-exporter.js +18 -32
- package/dist/integrations/ruvector/brain-rvf-richness.d.ts +75 -0
- package/dist/integrations/ruvector/brain-rvf-richness.js +127 -0
- package/dist/kernel/unified-memory-migration.js +1 -1
- package/dist/kernel/unified-memory.d.ts +8 -0
- package/dist/kernel/unified-memory.js +13 -0
- package/dist/learning/checkpoint-shrink-ack.d.ts +25 -0
- package/dist/learning/checkpoint-shrink-ack.js +57 -0
- package/dist/learning/dream/dream-engine.d.ts +44 -3
- package/dist/learning/dream/dream-engine.js +6 -2
- package/dist/learning/embedder-endpoint-client.d.ts +45 -0
- package/dist/learning/embedder-endpoint-client.js +98 -3
- package/dist/learning/embedder-identity-store.js +3 -1
- package/dist/learning/embedding-space-legacy-adoption.d.ts +53 -0
- package/dist/learning/embedding-space-legacy-adoption.js +115 -0
- package/dist/learning/embedding-space-registry.d.ts +90 -0
- package/dist/learning/embedding-space-registry.js +181 -0
- package/dist/learning/experience-capture.d.ts +3 -1
- package/dist/learning/experience-capture.js +15 -5
- package/dist/learning/experience-space-verification.d.ts +2 -0
- package/dist/learning/experience-space-verification.js +3 -2
- package/dist/learning/learning-retention.js +4 -0
- package/dist/learning/pattern-promotion.d.ts +7 -0
- package/dist/learning/pattern-promotion.js +64 -12
- package/dist/learning/real-embeddings.d.ts +3 -0
- package/dist/learning/real-embeddings.js +73 -11
- package/dist/learning/rvf-pattern-store.js +6 -1
- package/dist/mcp/bundle.js +558 -537
- package/dist/mcp/handlers/domain-handler-configs.d.ts +3 -0
- package/dist/mcp/handlers/domain-handler-configs.js +1 -0
- package/dist/mcp/handlers/heartbeat-handlers.d.ts +4 -2
- package/dist/mcp/protocol-server.js +1 -1
- package/dist/mcp/tools/learning-optimization/optimize.d.ts +6 -1
- package/dist/mcp/tools/learning-optimization/optimize.js +20 -11
- package/dist/planning/goap-planner.js +4 -0
- package/dist/planning/plan-executor.js +6 -2
- package/dist/shared/embeddings/index.d.ts +2 -2
- package/dist/shared/embeddings/index.js +1 -1
- package/dist/shared/embeddings/nomic-embedder.d.ts +8 -2
- package/dist/shared/embeddings/nomic-embedder.js +19 -11
- package/dist/shared/embeddings/ollama-client.d.ts +28 -2
- package/dist/shared/embeddings/ollama-client.js +84 -22
- package/dist/shared/embeddings/types.d.ts +15 -0
- package/dist/shared/embeddings/types.js +4 -0
- package/dist/shared/git/git-analyzer.d.ts +30 -11
- package/dist/shared/git/git-analyzer.js +95 -48
- package/dist/shared/io/confined-read.d.ts +32 -7
- package/dist/shared/io/confined-read.js +58 -25
- package/dist/shared/io/file-reader.js +4 -1
- package/dist/shared/pytest-junit-report.d.ts +93 -0
- package/dist/shared/pytest-junit-report.js +241 -0
- package/dist/shared/safe-db.d.ts +1 -1
- package/dist/shared/safe-db.js +20 -5
- package/dist/shared/sqlite-journal-mode.d.ts +39 -0
- package/dist/shared/sqlite-journal-mode.js +53 -0
- package/dist/shared/test-runner-project.d.ts +51 -1
- package/dist/shared/test-runner-project.js +140 -25
- package/dist/sync/claude-flow-bridge.js +1 -1
- package/dist/sync/readers/sqlite-reader.js +3 -4
- package/dist/sync/writers/sqlite-writer.js +1 -1
- package/dist/workers/interfaces.d.ts +2 -2
- package/dist/workers/quality-daemon/git-watcher.d.ts +8 -0
- package/dist/workers/quality-daemon/git-watcher.js +54 -12
- package/dist/workers/quality-daemon/index.js +1 -1
- package/dist/workers/quality-daemon/priority-queue.d.ts +2 -1
- package/dist/workers/workers/defect-predictor.d.ts +9 -4
- package/dist/workers/workers/defect-predictor.js +98 -37
- package/package.json +1 -1
- package/dist/cli/chunks/adapter-6CQ2PIP5.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +0 -2
- package/dist/cli/chunks/base-SMCMMVGP.js +0 -2
- package/dist/cli/chunks/brain-handler-HQWZFO52.js +0 -95
- package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +0 -2
- package/dist/cli/chunks/chunk-CGGUM2YJ.js +0 -3
- package/dist/cli/chunks/chunk-D6COXLYE.js +0 -8
- package/dist/cli/chunks/chunk-EGYE5UPQ.js +0 -2
- package/dist/cli/chunks/chunk-IUBJVHNB.js +0 -3
- package/dist/cli/chunks/chunk-KL7OKSU2.js +0 -4
- package/dist/cli/chunks/chunk-KPRCB5LT.js +0 -7
- package/dist/cli/chunks/chunk-LRSX2FJM.js +0 -2
- package/dist/cli/chunks/chunk-M4FRQ4TE.js +0 -12
- package/dist/cli/chunks/chunk-MAFQV4U4.js +0 -16
- package/dist/cli/chunks/chunk-NZU4ACBZ.js +0 -2
- package/dist/cli/chunks/chunk-RV74I3YO.js +0 -3
- package/dist/cli/chunks/chunk-SJ6Y4725.js +0 -5
- package/dist/cli/chunks/chunk-UE5ZOZR2.js +0 -2
- package/dist/cli/chunks/chunk-VSIKHWZ4.js +0 -29
- package/dist/cli/chunks/chunk-YAPLJR7K.js +0 -2
- package/dist/cli/chunks/client-MHQRTZM4.js +0 -2
- package/dist/cli/chunks/copilot-installer-IGJ6KGQY.js +0 -3
- package/dist/cli/chunks/core-handlers-UAK3LLJE.js +0 -2
- package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +0 -2
- package/dist/cli/chunks/daemon-CAVZ7OFV.js +0 -18
- package/dist/cli/chunks/dream-EJY24JN6.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +0 -3
- package/dist/cli/chunks/file-discovery-UZSFSS4V.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +0 -2
- package/dist/cli/chunks/hnsw-index-POCPMVJH.js +0 -2
- package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +0 -2
- package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +0 -2
- package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +0 -2
- package/dist/cli/chunks/kernel-CCDWT7KS.js +0 -2
- package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +0 -2
- package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +0 -2
- package/dist/cli/chunks/load-test-UNZUWY3F.js +0 -2
- package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +0 -2
- package/dist/cli/chunks/memory-handlers-MP426XRJ.js +0 -2
- package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +0 -2
- package/dist/cli/chunks/project-root-BEANNYWU.js +0 -2
- package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +0 -2
- package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +0 -2
- package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +0 -2
- package/dist/cli/chunks/router-EP34O3KB.js +0 -2
- package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +0 -2
- package/dist/cli/chunks/safe-db-TCAU4FUT.js +0 -2
- package/dist/cli/chunks/schedule-NB5KV435.js +0 -2
- package/dist/cli/chunks/scheduler-JKXGKVK6.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +0 -2
- package/dist/cli/chunks/sync-OSF7C2NL.js +0 -2
- package/dist/cli/chunks/test-SD457QJ6.js +0 -34
- package/dist/cli/chunks/test-runner-process-VKD65QQU.js +0 -2
- package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +0 -2
- package/dist/cli/chunks/unified-memory-GI76TXFV.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +0 -2
- package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +0 -2
- package/dist/cli/chunks/visual-security-GZ2MOKWB.js +0 -2
- package/dist/cli/chunks/witness-chain-P3XXXA62.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +0 -2
- package/dist/cli/chunks/wrappers-TWSKBTWD.js +0 -2
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a}from"./chunk-OOSV2RIA.js";import"./chunk-OHU5P25N.js";import"./chunk-A3GDX6UF.js";import"./chunk-HBDSCYSK.js";import"./chunk-KFCQP434.js";import"./chunk-AXVD7O3F.js";import"./chunk-WZVRMKG2.js";import"./chunk-RTYXFXTI.js";import"./chunk-4BIMTRRX.js";import"./chunk-MQM37KAR.js";import"./chunk-JMRDT2XK.js";import"./chunk-O5EWFR76.js";import"./chunk-NKU3FFM4.js";import"./chunk-Q7V722K5.js";import"./chunk-KH4T6STG.js";import"./chunk-YP2GHQSV.js";import"./chunk-ZDWD73UF.js";import"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";export{a as ImpactAnalyzerService};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a,b,c,d}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-X27IUWTD.js";import"./chunk-ZDWD73UF.js";import"./chunk-BDVFSMOQ.js";export{d as explicitRootError,a as initProjectRoot,c as sharedDirInitError,b as sharedRootInitError};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as v,b as k}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as v,b as k}from"./chunk-X27IUWTD.js";import{a as b}from"./chunk-JMRDT2XK.js";import"./chunk-ZDWD73UF.js";import{a as y,e as M}from"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";import{Option as I}from"commander";import o from"chalk";import{createRequire as S}from"node:module";M();var P="--no-mcp and --with-mcp cannot be combined: --no-mcp skips the .mcp.json entry, --with-mcp forces it";function w(a,e){return a===!1||e===!0}function h(a){let e={noMcp:w(a.mcp,a.noMcp),withMcp:a.withMcp===!0,noGovernance:w(a.governance,a.noGovernance),noClaude:w(a.claude,a.noClaude),noStatusLine:w(a.statusline,a.noStatusLine),noDatabase:a.database===!1};if(e.noMcp&&e.withMcp)throw new Error(P);return e}var C=class{name="init";description="Initialize the AQE v3 system";cleanupAndExit;originalStdoutWrite=null;constructor(e){this.cleanupAndExit=e}register(e,n){e.command("init").description(this.description).option("-d, --domains <domains>","Comma-separated list of domains to enable","all").option("-m, --max-agents <number>","Maximum concurrent agents","15").option("--memory <backend>",'Memory backend (sqlite|agentdb|hybrid|memory). "memory" = database-free, in-memory only.',"hybrid").option("--no-database","Database-free install: alias for `--memory memory`. Skips the SQLite database phase and runs any MCP server in-memory \u2014 nothing is written to .agentic-qe/.").option("--no-statusline","Do not install AQE's Claude Code status line; remove an existing AQE-owned status line while preserving custom ones").option("--lazy","Enable lazy loading of domains").option("--wizard","Run interactive setup wizard").option("--auto","Auto-configure based on project analysis").option("-u, --upgrade","Upgrade existing installation (overwrite skills, agents, validation)").option("--browser-engine","Install optional Vibium and browser payload (explicit download)",!1).option("--no-browser-engine","Skip optional browser setup (default)").option("--minimal","Minimal configuration (skip optional features)").option("--skip-patterns","Skip loading pre-trained patterns").option("--skip-code-index","Skip code intelligence pre-scan (supported escape hatch \u2014 KG can be built later via `aqe code index`, also via env AQE_SKIP_CODE_INDEX=1)").option("--json","Emit machine-readable JSON result on stdout (suppresses banners; phase progress goes to stderr). Used by the release-gate corpus and CI tooling. See InitJsonOutput in init-handler.ts for the schema.").option("--with-n8n","Install n8n workflow testing agents and skills").option("--with-opencode","Include OpenCode agent/skill provisioning").option("--with-kiro","Include AWS Kiro IDE integration (agents, skills, hooks, steering)").option("--with-copilot","Include GitHub Copilot MCP config and instructions").option("--with-cursor","Include Cursor MCP config and rules").option("--with-cline","Include Cline MCP config and custom QE mode").option("--with-kilocode","Include Kilo Code MCP config and custom QE mode").option("--with-roocode","Include Roo Code MCP config and custom QE mode").option("--with-codex","Include OpenAI Codex CLI MCP, AGENTS.md, hooks, and QE skills").addOption(new I("--codex-guidance <mode>","Codex AGENTS.md guidance policy").choices(["full","compact","none"]).default("full")).option("--with-ruflo","Add optional Ruflo guidance and lifecycle hooks to the Codex setup").option("--with-windsurf","Include Windsurf MCP config and rules").option("--with-continuedev","Include Continue.dev MCP config and rules").option("--no-mcp","Skip MCP server config (MCP is enabled by default). Cannot be combined with --with-mcp").addOption(new I("--with-mcp","Write the project .mcp.json agentic-qe entry even when the agentic-qe-fleet Claude Code plugin already provides the AQE MCP server (#922). Cannot be combined with --no-mcp").conflicts("mcp")).option("--with-all-platforms","Include all coding agent platform configurations").option("--auto-migrate","Automatically migrate from v2 if detected").option("--with-claude-flow","Force Claude Flow integration setup").option("--skip-claude-flow","Skip Claude Flow integration").option("--no-governance","Skip governance configuration (ADR-058)").option("--no-claude","Suppress the default Claude Code surface (.claude/, .mcp.json, CLAUDE.md, governance, hooks) so --with-<platform> flags are the only install targets (#532)").option("--modular","Use new modular init system (default for --auto)").action(async t=>{await this.execute(t,n)})}async execute(e,n){if(e.json===!0){this.originalStdoutWrite=process.stdout.write.bind(process.stdout);let t=process.stderr.write.bind(process.stderr);process.stdout.write=((...r)=>t(...r))}try{let t=v(),r=k(t,!!process.env.AQE_PROJECT_ROOT);if(r){console.error(o.red(`
|
|
3
3
|
${r}
|
|
4
4
|
`)),await this.cleanupAndExit(1);return}if(e.withAllPlatforms&&(e.withCopilot=!0,e.withCursor=!0,e.withCline=!0,e.withKilocode=!0,e.withRoocode=!0,e.withCodex=!0,e.withWindsurf=!0,e.withContinuedev=!0),e.upgrade&&!e.auto&&!e.wizard&&(e.auto=!0),e.wizard||e.auto){if(console.log(o.blue(`
|
|
5
5
|
Agentic QE v3 Initialization
|
|
@@ -8,14 +8,14 @@ import{a as v,b as k}from"./chunk-MI5MFHRA.js";import{a as b}from"./chunk-LE4QJR
|
|
|
8
8
|
`)),await this.runModularInit(e,n,t);return}await this.runStandardInit(e,n)}catch(t){console.error(o.red(`
|
|
9
9
|
Failed to initialize:`),t),await this.cleanupAndExit(1)}}async runModularInit(e,n,t){let r=e.json===!0,s=h(e),d=s.noDatabase||e.memory==="memory";d&&(process.env.AQE_MEMORY_BACKEND="memory",r||console.log(o.gray(` Database-free mode: in-memory backend (no .agentic-qe/memory.db)
|
|
10
10
|
`)));let u=s.noClaude;u&&!(e.withOpencode||e.withN8n||e.withKiro||e.withCopilot||e.withCursor||e.withCline||e.withKilocode||e.withRoocode||e.withCodex||e.withWindsurf||e.withContinuedev||e.withAllPlatforms)&&!r&&console.log(o.yellow(` --no-claude set without any --with-<platform>: this install will write almost nothing.
|
|
11
|
-
`));let{createModularInitOrchestrator:l}=await import("./orchestrator-
|
|
11
|
+
`));let{createModularInitOrchestrator:l}=await import("./orchestrator-TJDPQ4VL.js"),m=l({projectRoot:t,autoMode:e.auto,upgrade:e.upgrade,minimal:e.minimal,browserEngine:e.browserEngine,skipPatterns:e.skipPatterns,skipCodeIndex:e.skipCodeIndex,withN8n:e.withN8n,withOpenCode:e.withOpencode,withKiro:e.withKiro,withCopilot:e.withCopilot,withCursor:e.withCursor,withCline:e.withCline,withKiloCode:e.withKilocode,withRooCode:e.withRoocode,withCodex:e.withCodex,withRuflo:e.withRuflo,codexGuidance:e.codexGuidance,withWindsurf:e.withWindsurf,withContinueDev:e.withContinuedev,noMcp:s.noMcp,withMcp:s.withMcp,noGovernance:s.noGovernance,noClaude:u,noStatusLine:s.noStatusLine,memoryBackend:d?"memory":void 0});console.log(o.white(` Analyzing project...
|
|
12
12
|
`));let i=await m.initialize();if(r){this.originalStdoutWrite&&(process.stdout.write=this.originalStdoutWrite);let g={schemaVersion:1,success:i.success,steps:i.steps.map(p=>({step:p.step,status:p.status,message:p.message,durationMs:p.durationMs})),summary:i.summary,totalDurationMs:i.totalDurationMs,timestamp:i.timestamp.toISOString()};process.stdout.write(JSON.stringify(g,null,2)+`
|
|
13
|
-
`);let f=i.steps.some(p=>p.status==="error");await this.cleanupAndExit(i.success&&!f?0:1);return}A(i.steps);let c;if(!e.skipClaudeFlow&&(e.withClaudeFlow||i.success))try{let{setupClaudeFlowIntegration:g}=await import("./claude-flow-setup-
|
|
13
|
+
`);let f=i.steps.some(p=>p.status==="error");await this.cleanupAndExit(i.success&&!f?0:1);return}A(i.steps);let c;if(!e.skipClaudeFlow&&(e.withClaudeFlow||i.success))try{let{setupClaudeFlowIntegration:g}=await import("./claude-flow-setup-4YFG3FU5.js");if(c=await g({projectRoot:t,force:e.withClaudeFlow}),c.available)console.log(o.green(" * Claude Flow integration enabled")),c.features.trajectories&&console.log(o.gray(" - SONA trajectory tracking")),c.features.modelRouting&&console.log(o.gray(" - 3-tier model routing (haiku/sonnet/opus)")),c.features.pretrain&&console.log(o.gray(" - Codebase pretrain analysis")),console.log("");else{let{getClaudeFlowNotFoundMessage:f}=await import("./detect-QWFIQRKI.js");console.log(o.gray(f())),console.log("")}}catch{let{getClaudeFlowNotFoundMessage:g}=await import("./detect-QWFIQRKI.js");console.log(o.gray(g())),console.log("")}i.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
14
14
|
`)),console.log(o.blue(" Summary:")),console.log(o.gray(` - Patterns loaded: ${i.summary.patternsLoaded}`)),console.log(o.gray(` - Skills installed: ${i.summary.skillsInstalled}`)),console.log(o.gray(` - Agents installed: ${i.summary.agentsInstalled}`)),console.log(o.gray(` - Hooks configured: ${i.summary.hooksConfigured?"Yes":"No"}`)),console.log(o.gray(` - Workers started: ${i.summary.workersStarted}`)),console.log(o.gray(` - Claude Flow: ${c?.available?"Enabled":"Standalone mode"}`)),console.log(o.gray(` - Total time: ${i.totalDurationMs}ms
|
|
15
15
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),i.summary.mcpConfigured&&(console.log(o.gray(`
|
|
16
16
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
17
17
|
`))),E()):(console.log(o.red(` Initialization failed. Check errors above.
|
|
18
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,n,t){let r=h(e),{InitOrchestrator:s}=await import("./init-wizard-
|
|
18
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runLegacyWizard(e,n,t){let r=h(e),{InitOrchestrator:s}=await import("./init-wizard-HLNUBJQN.js"),d={projectRoot:t,autoMode:e.auto,minimal:e.minimal,browserEngine:e.browserEngine,skipPatterns:e.skipPatterns,withN8n:e.withN8n,noMcp:r.noMcp,withMcp:r.withMcp},u=new s(d);if(e.wizard){console.log(o.white(` Setup Wizard Steps:
|
|
19
19
|
`));let m=u.getWizardSteps();for(let i=0;i<m.length;i++)console.log(o.gray(` ${i+1}. ${m[i].title}`)),console.log(o.gray(` ${m[i].description}
|
|
20
20
|
`))}console.log(o.white(` Analyzing project...
|
|
21
21
|
`));let l=await u.initialize();A(l.steps),l.success?(console.log(o.green(` AQE v3 initialized successfully!
|
|
@@ -23,7 +23,7 @@ import{a as v,b as k}from"./chunk-MI5MFHRA.js";import{a as b}from"./chunk-LE4QJR
|
|
|
23
23
|
`)),console.log(o.white("Next steps:")),console.log(o.gray(" 1. Run tests: aqe test <path>")),console.log(o.gray(" 2. Check coverage: aqe coverage <path>")),console.log(o.gray(" 3. Check status: aqe status")),l.summary.mcpConfigured&&(console.log(o.gray(`
|
|
24
24
|
MCP server configured in .mcp.json`)),console.log(o.gray(` Use --no-mcp to skip MCP setup if using CLI only
|
|
25
25
|
`))),E()):(console.log(o.red(` Initialization failed. Check errors above.
|
|
26
|
-
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,n){let{QEKernelImpl:t}=await import("./kernel-
|
|
26
|
+
`)),await this.cleanupAndExit(1)),await this.cleanupAndExit(0)}async runStandardInit(e,n){let{QEKernelImpl:t}=await import("./kernel-XKFWCL7Y.js"),{CrossDomainEventRouter:r}=await import("./cross-domain-router-65WJAKVD.js"),{DefaultProtocolExecutor:s}=await import("./protocol-executor-CRQOCC4A.js"),{WorkflowOrchestrator:d}=await import("./workflow-orchestrator-UIBGWCU3.js"),{createQueenCoordinator:u}=await import("./queen-coordinator-32574XSG.js");console.log(o.blue(`
|
|
27
27
|
Initializing Agentic QE v3...
|
|
28
28
|
`));let l=e.domains==="all"?[...b]:e.domains.split(",").filter(c=>b.includes(c));console.log(o.gray(` Domains: ${l.length}`)),console.log(o.gray(` Max Agents: ${e.maxAgents}`)),console.log(o.gray(` Memory: ${e.memory}`)),console.log(o.gray(` Lazy Loading: ${e.lazy?"enabled":"disabled"}
|
|
29
29
|
`)),n.kernel=new t({maxConcurrentAgents:parseInt(e.maxAgents,10),memoryBackend:e.memory,hnswEnabled:!0,lazyLoading:e.lazy||!1,enabledDomains:l,enableExperienceBridge:!1}),await n.kernel.initialize(),console.log(o.green(" * Kernel initialized")),n.router=new r(n.kernel.eventBus),await n.router.initialize(),console.log(o.green(" * Cross-domain router initialized"));let m=c=>n.kernel.getDomainAPI(c),i=new s(n.kernel.eventBus,n.kernel.memory,m);console.log(o.green(" * Protocol executor initialized")),n.workflowOrchestrator=new d(n.kernel.eventBus,n.kernel.memory,n.kernel.coordinator),await n.workflowOrchestrator.initialize(),this.registerDomainWorkflowActions(n.kernel,n.workflowOrchestrator),console.log(o.green(" * Workflow orchestrator initialized")),n.queen=u(n.kernel,n.router,i,void 0),await n.queen.initialize(),console.log(o.green(" * Queen Coordinator initialized")),n.initialized=!0,console.log(o.green(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a,b,c,d}from"./chunk-355MI7RV.js";import"./chunk-LSEC2BU7.js";import"./chunk-4CVNVBX5.js";import"./chunk-UWSJVKTE.js";import"./chunk-2Q6DTBMT.js";import"./chunk-27TUMXPD.js";import"./chunk-Y4LSEOZ3.js";import"./chunk-MZRBNBB3.js";import"./chunk-MQM37KAR.js";import"./chunk-JMRDT2XK.js";import"./chunk-WJN3V7QB.js";import"./chunk-L2MBKVSE.js";import"./chunk-AWQAE3SW.js";import"./chunk-244RKAEP.js";import"./chunk-BDVFSMOQ.js";export{a as InitOrchestrator,b as createInitOrchestrator,d as formatInitResult,c as quickInit};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{L as a,M as b}from"./chunk-SJF3O4FX.js";import"./chunk-UQAA4PHU.js";import"./chunk-HZQBW5EM.js";import"./chunk-XJN3RKUD.js";import"./chunk-FYINK2B7.js";import"./chunk-OBCXCRXK.js";import"./chunk-477FKXSS.js";import"./chunk-MVYQRVLP.js";import"./chunk-EONDCWY4.js";import"./chunk-4HL3SD4A.js";import"./chunk-KJBYZO57.js";import"./chunk-PGO46IIW.js";import"./chunk-3YMIT73A.js";import"./chunk-ADNGZAT2.js";import"./chunk-JR2UMTKG.js";import"./chunk-6P3Y45QL.js";import"./chunk-L7PSU2YN.js";import"./chunk-DUCVLT3F.js";import"./chunk-LC2QRN7V.js";import"./chunk-WQNLXUWA.js";import"./chunk-53ZBETYR.js";import"./chunk-IPWMSXBF.js";import"./chunk-BOVAKCDC.js";import"./chunk-5M24X6W7.js";import"./chunk-IWVNC7VY.js";import"./chunk-3RPDKJGV.js";import"./chunk-TRB3EVH3.js";import"./chunk-OXOO3YDL.js";import"./chunk-N3KQU4UC.js";import"./chunk-27TUMXPD.js";import"./chunk-OA4EQDC4.js";import"./chunk-PZOYQHWS.js";import"./chunk-OOSV2RIA.js";import"./chunk-OHU5P25N.js";import"./chunk-A3GDX6UF.js";import"./chunk-HBDSCYSK.js";import"./chunk-KFCQP434.js";import"./chunk-FWR5QY37.js";import"./chunk-F4AGNKL2.js";import"./chunk-FVH7TXWU.js";import"./chunk-FT24SSDG.js";import"./chunk-YSX756AM.js";import"./chunk-IZODXKZD.js";import"./chunk-AXVD7O3F.js";import"./chunk-HSQ3GUYJ.js";import"./chunk-FQRS7WVA.js";import"./chunk-K6CH4CFF.js";import"./chunk-6TEVM3X3.js";import"./chunk-5AGXIZQ5.js";import"./chunk-RMEQYJPU.js";import"./chunk-UNTBVJ5X.js";import"./chunk-Y4LSEOZ3.js";import"./chunk-F6YD3BOW.js";import"./chunk-JKIJVVSP.js";import"./chunk-X5I2Y4VO.js";import"./chunk-O5RDHD5T.js";import"./chunk-GPIJIZJQ.js";import"./chunk-TWTXPSFU.js";import"./chunk-XZLIF4O2.js";import"./chunk-X7IQIFTS.js";import"./chunk-YYIJLG7S.js";import"./chunk-LUG7YNVZ.js";import"./chunk-J2MT2OJV.js";import"./chunk-LLQ2UMF6.js";import"./chunk-L3IPUIT3.js";import"./chunk-B52ULNYO.js";import"./chunk-LOJ7OO6W.js";import"./chunk-WZVRMKG2.js";import"./chunk-LHY7TMTM.js";import"./chunk-RTYXFXTI.js";import"./chunk-VVGUE2T2.js";import"./chunk-LTGB7OIU.js";import"./chunk-4BIMTRRX.js";import"./chunk-ZNTHX5G3.js";import"./chunk-OW23N2Y5.js";import"./chunk-YDI56L35.js";import"./chunk-ZFT3RLA4.js";import"./chunk-MZRBNBB3.js";import"./chunk-MSX2OHYT.js";import"./chunk-SRVNR3R3.js";import"./chunk-Z7SD7LXM.js";import"./chunk-QZU6M5IO.js";import"./chunk-LWAFRYKE.js";import"./chunk-5RFXX4IF.js";import"./chunk-SWGPLXWW.js";import"./chunk-YFILS5D5.js";import"./chunk-MQM37KAR.js";import"./chunk-BGXXMX3Y.js";import"./chunk-M24ZAZ4U.js";import"./chunk-FVDM3X42.js";import"./chunk-JMRDT2XK.js";import"./chunk-4QSQKFED.js";import"./chunk-O5EWFR76.js";import"./chunk-NKU3FFM4.js";import"./chunk-Q7V722K5.js";import"./chunk-KH4T6STG.js";import"./chunk-V2LJ54KP.js";import"./chunk-BKMQQY5T.js";import"./chunk-YP2GHQSV.js";import"./chunk-ZDWD73UF.js";import"./chunk-WGXT5NWQ.js";import"./chunk-BSXKZDKO.js";import"./chunk-WJN3V7QB.js";import"./chunk-L2MBKVSE.js";import"./chunk-AWQAE3SW.js";import"./chunk-244RKAEP.js";import"./chunk-BDVFSMOQ.js";export{a as QEKernelImpl,b as createKernel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{b as f}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{b as f}from"./chunk-VCCTTKP3.js";import{a as m,e as v}from"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";v();import{existsSync as n,mkdirSync as p,readFileSync as d,writeFileSync as a}from"fs";import{join as u,dirname as h}from"path";var l=class{projectRoot;overwrite;options;generator;constructor(e){this.projectRoot=e.projectRoot,this.overwrite=e.overwrite??!1,this.options=e,this.generator=f()}async install(){let e={success:!0,mcpConfigured:!1,modeInstalled:!1,errors:[],configPath:"",modePath:""};try{let t=this.generator.generateMcpConfig("kilocode",{memoryBackend:this.options.memoryBackend}),r=u(this.projectRoot,t.path);if(e.configPath=r,!n(r)||this.overwrite){let s=h(r);if(n(s)||p(s,{recursive:!0}),n(r)&&this.overwrite){let c=this.mergeExistingConfig(r,t.content);a(r,c)}else a(r,t.content);e.mcpConfigured=!0}let i=this.generator.generateBehavioralRules("kilocode"),o=u(this.projectRoot,i.path);if(e.modePath=o,!n(o)||this.overwrite){let s=h(o);if(n(s)||p(s,{recursive:!0}),n(o)&&this.overwrite){let c=this.mergeExistingModes(o,i.content);a(o,c)}else a(o,i.content);e.modeInstalled=!0}}catch(t){e.success=!1,e.errors.push(`Kilo Code installation failed: ${m(t)}`)}return e}mergeExistingConfig(e,t){try{let r=JSON.parse(d(e,"utf-8")),i=JSON.parse(t);return r.mcpServers||(r.mcpServers={}),Object.assign(r.mcpServers,i.mcpServers),JSON.stringify(r,null,2)+`
|
|
3
3
|
`}catch{return t}}mergeExistingModes(e,t){try{let r=JSON.parse(d(e,"utf-8")),i=JSON.parse(t);if(!Array.isArray(r))return t;let o=r.filter(s=>s.slug!=="qe-engineer");return o.push(...i),JSON.stringify(o,null,2)+`
|
|
4
4
|
`}catch{return t}}};function x(g){return new l(g)}export{l as KiloCodeInstaller,x as createKiloCodeInstaller};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
2
|
-
import{a as $}from"./chunk-
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{a as $}from"./chunk-UWSJVKTE.js";import{i as w,j as S,k as _,n as Q}from"./chunk-RTYXFXTI.js";import{a as k,e as R}from"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";R();import{existsSync as m,mkdirSync as y,readdirSync as E,readFileSync as q,writeFileSync as v}from"fs";import{join as o,dirname as T}from"path";import{fileURLToPath as I}from"url";Q();var D=I(import.meta.url),P=T(D),M=class{projectRoot;options;openCodeDir;constructor(t){this.projectRoot=t.projectRoot,this.options={installAgents:!0,installSkills:!0,installHooks:!0,installSteering:!0,overwrite:!1,...t},this.openCodeDir=this.findOpenCodeDir()}findOpenCodeDir(){let t=[o(P,"../../.opencode"),o(P,"../../assets/opencode")],e=$(import.meta.url);e&&(t.push(o(e,".opencode")),t.push(o(e,"assets/opencode"))),t.push(o(process.cwd(),"node_modules/agentic-qe/assets/opencode"),o(process.cwd(),"node_modules/agentic-qe/.opencode"));for(let n of t)if(m(n)&&(m(o(n,"agents"))||m(o(n,"skills"))))return n;let s=o(process.cwd(),".opencode");return m(s)&&(m(o(s,"agents"))||m(o(s,"skills")))?s:t[0]}async install(){let t=o(this.projectRoot,".kiro"),e={success:!0,agentsInstalled:[],skillsInstalled:[],hooksInstalled:[],steeringInstalled:[],mcpConfigured:!1,errors:[],targetDir:t};try{if(e.mcpConfigured=this.installMcpConfig(t),this.options.installAgents){let s=this.installAgents(t);e.agentsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSkills){let s=this.installSkills(t);e.skillsInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installHooks){let s=this.installHooks(t);e.hooksInstalled=s.installed,e.errors.push(...s.errors)}if(this.options.installSteering){let s=this.installSteering(t);e.steeringInstalled=s.installed,e.errors.push(...s.errors)}}catch(s){e.success=!1,e.errors.push(`Kiro installation failed: ${k(s)}`)}return e}installMcpConfig(t){let e=o(t,"settings"),s=o(e,"mcp.json");if(m(s)&&!this.options.overwrite)return!1;y(e,{recursive:!0});let n={mcpServers:{"agentic-qe":{command:"npx",args:["-y","agentic-qe@latest","mcp"],env:this.options.memoryBackend==="memory"?{AQE_MEMORY_BACKEND:"memory",AQE_V3_MODE:"true"}:{AQE_MEMORY_PATH:".agentic-qe/memory.db",AQE_V3_MODE:"true"},disabled:!1,autoApprove:["fleet_init","fleet_status","test_generate_enhanced","coverage_analyze_sublinear","quality_assess","memory_store","memory_query"]}}};return v(s,JSON.stringify(n,null,2)+`
|
|
3
3
|
`),!0}installAgents(t){let e=[],s=[],n=o(this.openCodeDir,"agents"),l=o(t,"agents");if(!m(n))return y(l,{recursive:!0}),this.writeDefaultQEAgent(l),e.push("qe-specialist"),{installed:e,errors:s};y(l,{recursive:!0});let i=E(n).filter(r=>r.endsWith(".yaml"));for(let r of i){let c=r.replace(".yaml",""),a=o(l,`${c}.json`);if(!(m(a)&&!this.options.overwrite))try{let p=q(o(n,r),"utf-8"),u=this.parseYamlAgent(p),d=this.convertToKiroAgent(u);v(a,JSON.stringify(d,null,2)+`
|
|
4
4
|
`),e.push(c)}catch(p){s.push(`Failed to convert agent ${r}: ${k(p)}`)}}let g=o(this.options.projectRoot,".claude","agents");if(m(g)){let r=["subagents","n8n","testing","analysis"];for(let c of r){let a=o(g,c);if(!m(a))continue;let p=E(a,{recursive:!1}).filter(u=>typeof u=="string"&&u.endsWith(".md")&&u!=="README.md");for(let u of p){let d=u.replace(".md",""),h=o(l,`${d}.json`);if(!(m(h)&&!this.options.overwrite))try{let f=q(o(a,u),"utf-8"),A=this.convertMdAgentToKiro(f,d);A&&(v(h,JSON.stringify(A,null,2)+`
|
|
5
5
|
`),e.push(d))}catch(f){s.push(`Failed to convert subagent ${u}: ${k(f)}`)}}}}return{installed:e,errors:s}}convertMdAgentToKiro(t,e){let s=t.match(/^---\n([\s\S]*?)\n---\n?([\s\S]*)$/);if(!s)return null;let n=s[1],l=s[2].trim(),i=d=>{let h=new RegExp(`^${d}:\\s*"?([^"
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
2
|
+
import{h as a}from"./chunk-OHU5P25N.js";import"./chunk-A3GDX6UF.js";import"./chunk-HBDSCYSK.js";import"./chunk-KFCQP434.js";import"./chunk-AXVD7O3F.js";import"./chunk-WZVRMKG2.js";import"./chunk-RTYXFXTI.js";import"./chunk-MQM37KAR.js";import"./chunk-JMRDT2XK.js";import"./chunk-O5EWFR76.js";import"./chunk-NKU3FFM4.js";import"./chunk-Q7V722K5.js";import"./chunk-KH4T6STG.js";import"./chunk-YP2GHQSV.js";import"./chunk-ZDWD73UF.js";import"./chunk-AWQAE3SW.js";import"./chunk-BDVFSMOQ.js";export{a as KnowledgeGraphService};
|
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.
|
|
3
|
-
import{a as Se}from"./chunk-67Z5R7RJ.js";import{b as ye,c as he,d as be,e as we,f as $e,i as K,j as ve}from"./chunk-5PBLPQ5T.js";import{h as fe}from"./chunk-4LQFBY5L.js";import"./chunk-KU2AUFGX.js";import{b as L}from"./chunk-5B5QPCNU.js";import"./chunk-PHT5N7SC.js";import{j as z}from"./chunk-EA4YQVKS.js";import"./chunk-N7HL5PHH.js";import"./chunk-GQ6TUIKY.js";import"./chunk-HVRRLYX6.js";import"./chunk-63ZKI4PX.js";import"./chunk-5LAVKGLH.js";import"./chunk-IOQ6ZQ5W.js";import{a as pe}from"./chunk-SUDMM5SO.js";import{d as ge,e as ue,i as me}from"./chunk-IOKYCMTJ.js";import"./chunk-HGWXF45W.js";import"./chunk-VJCIEHEF.js";import{B as ce}from"./chunk-MO55CVMT.js";import"./chunk-CEYSYSK5.js";import"./chunk-WP4RETKG.js";import"./chunk-JDIYMZCQ.js";import{b as Q,d as Me}from"./chunk-V5NHZV7S.js";import"./chunk-S75SOOZL.js";import"./chunk-PPUZWYUG.js";import"./chunk-3HD7E6HN.js";import"./chunk-CRPIYUTJ.js";import"./chunk-F742SZAX.js";import"./chunk-CAKMOVZ6.js";import{n as de}from"./chunk-M4FRQ4TE.js";import{g as le}from"./chunk-DXD6K2ZP.js";import"./chunk-FLNAW7C4.js";import"./chunk-LE4QJREF.js";import"./chunk-J4ELZNLY.js";import"./chunk-YAPLJR7K.js";import"./chunk-G5RHFBAY.js";import"./chunk-XIIQ5QTT.js";import"./chunk-A5GBXCP5.js";import"./chunk-L6QSTQME.js";import"./chunk-EK7OLYOZ.js";import{c as O}from"./chunk-AGRV5B3T.js";import"./chunk-U2A7NHZA.js";import"./chunk-I7MQIM2U.js";import"./chunk-ZFL436FN.js";import{d as E,e as M}from"./chunk-KPRCB5LT.js";import"./chunk-KNSRL6NO.js";import"./chunk-2H4XH6FT.js";import"./chunk-AJMJNQMP.js";ce();Me();import{Command as et}from"commander";import o from"chalk";import S from"node:path";import{randomUUID as tt}from"node:crypto";import{existsSync as x,writeFileSync as qe,readFileSync as ie,copyFileSync as nt,renameSync as Be}from"node:fs";import{stat as ot,unlink as N}from"node:fs/promises";M();M();import{existsSync as j,realpathSync as Pe,statSync as te}from"node:fs";import{mkdir as Te,mkdtemp as _e,rename as We,rm as ne,stat as oe}from"node:fs/promises";import{basename as He,dirname as B,join as I,resolve as Oe}from"node:path";import{randomUUID as Ge}from"node:crypto";ce();import k from"chalk";import Y from"node:path";import{createReadStream as Ee,createWriteStream as xe}from"node:fs";import{createGzip as Qe,createGunzip as ze}from"node:zlib";import{pipeline as Re}from"node:stream/promises";M();var A={reasoningBank:null,initialized:!1};async function C(){if(A.initialized&&A.reasoningBank)return A.reasoningBank;let a=O(),t=Y.join(a,".agentic-qe"),e=new pe({sqlite:{path:Y.join(t,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"qe-patterns"});await e.initialize(),A.reasoningBank=fe(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0}),await A.reasoningBank.initialize();try{let{getSharedRvfDualWriter:n}=await import("./shared-rvf-dual-writer-C32UBR6D.js"),c=await n();c&&A.reasoningBank.setRvfDualWriter(c)}catch(n){process.env.DEBUG&&console.debug("[learning] RVF wiring skipped:",n instanceof Error?n.message:n)}return A.initialized=!0,A.reasoningBank}function w(a){console.log(JSON.stringify(a,null,2))}function P(a){console.log(k.green("\u2713"),a)}function v(a){console.error(k.red("\u2717"),a)}function _(a){console.log(k.blue("\u2139"),a)}function ke(a){let{current:t,topDomains:e}=a,n={tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502",ml:"\u251C",mr:"\u2524"},c=55,g=n.h.repeat(c-2);console.log(""),console.log(`${n.tl}${g}${n.tr}`),console.log(`${n.v}${Ve("AQE LEARNING DASHBOARD",c-2)}${n.v}`),console.log(`${n.ml}${g}${n.mr}`);let i=t.patternsCreatedToday>0?k.green(` (+${t.patternsCreatedToday} today)`):"";console.log(`${n.v} Patterns: ${D(String(t.totalPatterns)+i,32)}${n.v}`);let l=t.experiencesToday>0?k.green(` (+${t.experiencesToday} today)`):"";console.log(`${n.v} Experiences: ${D(String(t.totalExperiences)+l,32)}${n.v}`),console.log(`${n.v} Q-Values: ${D(String(t.totalQValues),32)}${n.v}`);let u=t.avgReward.toFixed(2),p=t.avgRewardDelta>=0?k.green(`(\u2191 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`):k.red(`(\u2193 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`);console.log(`${n.v} Avg Reward: ${D(`${u} ${p}`,32)}${n.v}`);let r=(t.successRate*100).toFixed(1);if(console.log(`${n.v} Success Rate: ${D(`${r}%`,32)}${n.v}`),console.log(`${n.v} Short-term: ${D(String(t.shortTermPatterns),32)}${n.v}`),console.log(`${n.v} Long-term: ${D(String(t.longTermPatterns),32)}${n.v}`),console.log(`${n.v}${" ".repeat(c-2)}${n.v}`),console.log(`${n.v} ${k.bold("Domain Coverage:")}${" ".repeat(c-19)}${n.v}`),e.length===0)console.log(`${n.v} ${k.dim("No patterns yet")}${" ".repeat(c-19)}${n.v}`);else{let s=Math.max(...e.map(f=>f.count),1),m=14;for(let{domain:f,count:h}of e){let b=Math.round(h/s*m),$=m-b,R=k.green("\u2588".repeat(b))+k.dim("\u2591".repeat($)),q=D(f,20),J=Ue(String(h),3);console.log(`${n.v} ${q} ${R} ${J} patterns ${n.v}`)}let d=new Set(e.map(f=>f.domain)),y=z.filter(f=>!d.has(f)).slice(0,3);for(let f of y){let h=k.dim("\u2591".repeat(m)),b=D(f,20);console.log(`${n.v} ${b} ${h} 0 patterns ${n.v}`)}}console.log(`${n.bl}${g}${n.br}`),console.log("")}function Ve(a,t){let e=X(a),n=Math.max(0,t-e.length),c=Math.floor(n/2),g=n-c;return" ".repeat(c)+a+" ".repeat(g)}function D(a,t){let e=X(a),n=Math.max(0,t-e.length);return a+" ".repeat(n)}function Ue(a,t){let e=X(a),n=Math.max(0,t-e.length);return" ".repeat(n)+a}function X(a){return a.replace(/\x1b\[[0-9;]*m/g,"")}function T(){let a=O();return Y.join(a,".agentic-qe","memory.db")}async function V(a,t){let e=t||`${a}.gz`;return await Re(Ee(a),Qe(),xe(e)),e}async function F(a,t){await Re(Ee(a),ze(),xe(t))}async function U(a){try{let t=E(a,{readonly:!0}),e=t.prepare("PRAGMA integrity_check").get();return t.close(),e.integrity_check==="ok"?{valid:!0,message:"Database integrity verified"}:{valid:!1,message:`Integrity check failed: ${e.integrity_check}`}}catch(t){return{valid:!1,message:`Failed to verify: ${t instanceof Error?t.message:"unknown error"}`}}}async function Z(a){try{let t=E(a,{readonly:!0});if(!t.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='schema_version'").get())return t.close(),0;let n=t.prepare("SELECT version FROM schema_version WHERE id = 1").get();return t.close(),n?.version??0}catch{return 0}}var ee="3.1.0",De={generate:"test-generation","test-generation":"test-generation",analyze:"coverage-analysis",coverage:"coverage-analysis","coverage-analysis":"coverage-analysis",run:"test-execution","test-execution":"test-execution",report:"quality-assessment",quality:"quality-assessment","quality-analysis":"quality-assessment",security:"security-compliance",sast:"security-compliance",owasp:"security-compliance",secrets:"security-compliance",audit:"security-compliance",recommend:"defect-intelligence",predict:"defect-intelligence","complexity-analysis":"code-intelligence","code-analysis":"code-intelligence",stabilize:"chaos-resilience",flaky:"chaos-resilience",quarantine:"chaos-resilience",retry:"chaos-resilience",stress:"chaos-resilience",load:"chaos-resilience",endurance:"chaos-resilience",baseline:"chaos-resilience"},Ce={generate:"test-template","test-generation":"test-template",analyze:"coverage-strategy",coverage:"coverage-strategy","coverage-analysis":"coverage-strategy",run:"test-template","test-execution":"test-template",report:"assertion-pattern",quality:"assertion-pattern","quality-analysis":"assertion-pattern",security:"assertion-pattern",sast:"assertion-pattern",owasp:"assertion-pattern",secrets:"assertion-pattern",audit:"assertion-pattern",recommend:"assertion-pattern",predict:"assertion-pattern","complexity-analysis":"assertion-pattern","code-analysis":"assertion-pattern",stabilize:"flaky-fix",flaky:"flaky-fix",quarantine:"flaky-fix",retry:"flaky-fix",stress:"perf-benchmark",load:"perf-benchmark",endurance:"perf-benchmark",baseline:"perf-benchmark",mock:"mock-pattern",dependency:"mock-pattern"};function Ie(a){let t=E(a,{readonly:!0,fileMustExist:!0});try{let e=t.pragma("integrity_check");if(e.length!==1||e[0].integrity_check!=="ok")throw new Error("Database integrity verification failed");return{schemaVersion:(t.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_version'").get()?t.prepare("SELECT version FROM schema_version WHERE id = 1").get():void 0)?.version??0,pages:t.pragma("page_count",{simple:!0}),verification:{valid:!0,message:"Database integrity verified"}}}finally{t.close()}}function H(a){return j(a)?Pe(a):I(Pe(B(a)),He(a))}function Ae(a,t){if(H(a)===H(t))return!0;if(!j(a)||!j(t))return!1;let e=te(a),n=te(t);return e.dev===n.dev&&e.ino===n.ino}function re(a,t){let e=H(a),n=H(t);for(let c of["","-wal","-shm","-journal"])if(Ae(`${e}${c}`,t)||Ae(a,`${n}${c}`))throw new Error("Backup source and destination must not alias the same database or its sidecars")}function Ne(a){if(!te(a).isFile())throw new Error("Backup input must be a regular file")}async function W(a,t,e={}){let n=E(a,{readonly:!0,fileMustExist:!0});try{let c=await n.backup(t);if(c.totalPages<=0||c.remainingPages!==0||e.expectedPages!==void 0&&c.totalPages!==e.expectedPages)throw new Error("SQLite snapshot did not complete; the source may be empty or the destination busy");if(e.standalone){let i=E(t,{fileMustExist:!0,walMode:!1});try{if(i.pragma("journal_mode = DELETE",{simple:!0})!=="delete")throw new Error("Could not create a standalone SQLite image")}finally{i.close()}}let g=Ie(t);if(g.pages!==c.totalPages)throw new Error("SQLite snapshot page count does not match the completed backup");return g}finally{n.close()}}async function G(a,t,e={}){Ne(a);let n=Oe(e.compress?`${t}.gz`:t);await Te(B(n),{recursive:!0}),re(a,Oe(t)),re(a,n);let c=await _e(I(B(n),".aqe-backup-"));try{let g=I(c,"snapshot.db"),i=await W(a,g,{standalone:!0}),l=e.compress?await V(g):g;if(e.compress&&e.verify){let r=I(c,"verified.db");await F(l,r),Ie(r)}let u=Number(((await oe(a)).size/1024).toFixed(2)),p=Number(((await oe(l)).size/1024).toFixed(2));if(["-wal","-shm","-journal"].some(r=>j(`${n}${r}`)))throw new Error("Backup destination has SQLite sidecars; choose an unused output path");return await We(l,n),{backupPath:n,sourceSizeKB:u,backupSizeKB:p,compressed:!!e.compress,schemaVersion:i.schemaVersion,verification:i.verification}}finally{await ne(c,{recursive:!0,force:!0})}}async function je(a,t,e={}){if(Ne(a),await Te(B(t),{recursive:!0}),re(a,t),j(t)&&!e.force)throw new Error(`Database already exists at: ${t}. Use --force to overwrite`);let n=await _e(I(B(t),".aqe-restore-")),c;try{let g=a.endsWith(".gz"),i=I(n,"snapshot.db"),l=a;g&&(l=I(n,"decompressed.db"),await F(a,l));let u=await W(l,i,{standalone:!0}),p=Number(((await oe(i)).size/1024).toFixed(2));if(j(t)){let r=new Date().toISOString().replace(/[:.]/g,"-"),s=`${t}.pre-restore-${r}-${Ge()}.db`;try{await W(t,s,{standalone:!0}),c=s}catch(m){throw await ne(s,{force:!0}),new Error("Cannot create a verified safety backup of the existing database; restore refused. Stop project processes and preserve the database and its sidecars before restoring into an absent destination.",{cause:m})}}return await W(i,t,{expectedPages:u.pages}),{sizeKB:p,schemaVersion:u.schemaVersion,wasCompressed:g,safetyBackupPath:c}}catch(g){if(c){let i=g instanceof Error?g.message:"SQLite snapshot failed";throw new Error(`Restore failed: ${i}; previous database snapshot preserved at ${c}`,{cause:g})}throw g}finally{await ne(n,{recursive:!0,force:!0})}}M();import Le from"node:path";import{randomUUID as Xe}from"node:crypto";import{existsSync as Ze}from"node:fs";import ae from"chalk";function se(a,t,e){if(!/^\d+$/.test(t)||Number(t)<e)throw new Error(`${a} must be a whole number >= ${e}, got "${t}"`);return Number(t)}function Fe(a){a.command("prune").description("Bound learning-table growth (dry run unless --apply)").option("--dry-run","Print the row counts that would change; write nothing (default)").option("--apply","Make the changes (backs up memory.db first)").option("--no-backup","With --apply: skip the backup").option("--failed-dream-cycles-days <n>","Remove failed/interrupted dream cycles older than n days",String(7)).option("--outcome-concepts-max <n>","Keep the newest n outcome concept nodes",String(2e3)).option("--compact-experiences","Opt-in: clear result_json and embedding of archived/merged experiences").option("--routing-outcomes-older-than <days>","Opt-in: remove routing outcomes older than this").option("--json","Output as JSON").addHelpText("after",`
|
|
2
|
+
import{createRequire as __cr}from"module";const require=__cr(import.meta.url);if(process.argv.includes('--version')||process.argv.includes('-v')){console.log("3.15.18");process.exit(0)}
|
|
3
|
+
import{a as De}from"./chunk-XTSAMB2Q.js";import{b as he,c as ye,d as be,e as we,f as $e,g as ve,h as Se,i as Ee,j as xe,k as ke,n as Y,o as Re}from"./chunk-LC2QRN7V.js";import"./chunk-WQNLXUWA.js";import{h as fe}from"./chunk-6TEVM3X3.js";import"./chunk-5AGXIZQ5.js";import{b as L}from"./chunk-RMEQYJPU.js";import"./chunk-UNTBVJ5X.js";import{j as z}from"./chunk-Y4LSEOZ3.js";import"./chunk-F6YD3BOW.js";import"./chunk-JKIJVVSP.js";import"./chunk-X5I2Y4VO.js";import"./chunk-O5RDHD5T.js";import"./chunk-GPIJIZJQ.js";import"./chunk-TWTXPSFU.js";import{a as pe}from"./chunk-X7IQIFTS.js";import{d as ge,e as ue,i as me}from"./chunk-LTGB7OIU.js";import"./chunk-4BIMTRRX.js";import"./chunk-ZNTHX5G3.js";import{C as ce}from"./chunk-OW23N2Y5.js";import"./chunk-YDI56L35.js";import"./chunk-ZFT3RLA4.js";import"./chunk-MZRBNBB3.js";import"./chunk-MSX2OHYT.js";import"./chunk-SRVNR3R3.js";import"./chunk-Z7SD7LXM.js";import"./chunk-QZU6M5IO.js";import"./chunk-LWAFRYKE.js";import{r as de}from"./chunk-SWGPLXWW.js";import"./chunk-YFILS5D5.js";import{b as Q,d as We}from"./chunk-MQM37KAR.js";import{g as le}from"./chunk-BGXXMX3Y.js";import"./chunk-M24ZAZ4U.js";import"./chunk-JMRDT2XK.js";import"./chunk-4QSQKFED.js";import"./chunk-O5EWFR76.js";import"./chunk-NKU3FFM4.js";import"./chunk-Q7V722K5.js";import"./chunk-KH4T6STG.js";import"./chunk-V2LJ54KP.js";import"./chunk-BKMQQY5T.js";import{c as O}from"./chunk-YP2GHQSV.js";import"./chunk-ZDWD73UF.js";import"./chunk-WGXT5NWQ.js";import"./chunk-BSXKZDKO.js";import{d as E,e as M}from"./chunk-WJN3V7QB.js";import"./chunk-L2MBKVSE.js";import"./chunk-AWQAE3SW.js";import"./chunk-244RKAEP.js";import"./chunk-BDVFSMOQ.js";ce();We();import{Command as nt}from"commander";import o from"chalk";import S from"node:path";import{randomUUID as ot}from"node:crypto";import{existsSync as x,writeFileSync as Ue,readFileSync as ie,copyFileSync as rt,renameSync as Ve}from"node:fs";import{stat as at,unlink as N}from"node:fs/promises";M();M();import{existsSync as j,realpathSync as Ie,statSync as ne}from"node:fs";import{mkdir as Le,mkdtemp as Fe,rename as Ye,rm as oe,stat as re}from"node:fs/promises";import{basename as Xe,dirname as B,join as I,resolve as Ne}from"node:path";import{randomUUID as Ze}from"node:crypto";ce();import R from"chalk";import X from"node:path";import{createReadStream as Ce,createWriteStream as Pe}from"node:fs";import{createGzip as He,createGunzip as Ge}from"node:zlib";import{pipeline as Oe}from"node:stream/promises";M();var A={reasoningBank:null,initialized:!1};async function C(){if(A.initialized&&A.reasoningBank)return A.reasoningBank;let a=O(),t=X.join(a,".agentic-qe"),e=new pe({sqlite:{path:X.join(t,"memory.db"),walMode:!0,poolSize:3,busyTimeout:5e3},enableFallback:!0,defaultNamespace:"qe-patterns"});await e.initialize(),A.reasoningBank=fe(e,void 0,{enableLearning:!0,enableGuidance:!0,enableRouting:!0,embeddingDimension:384,useONNXEmbeddings:!0}),await A.reasoningBank.initialize();try{let{getSharedRvfDualWriter:n}=await import("./shared-rvf-dual-writer-HVAAVEOH.js"),c=await n();c&&A.reasoningBank.setRvfDualWriter(c)}catch(n){process.env.DEBUG&&console.debug("[learning] RVF wiring skipped:",n instanceof Error?n.message:n)}return A.initialized=!0,A.reasoningBank}function w(a){console.log(JSON.stringify(a,null,2))}function P(a){console.log(R.green("\u2713"),a)}function v(a){console.error(R.red("\u2717"),a)}function _(a){console.log(R.blue("\u2139"),a)}function Ae(a){let{current:t,topDomains:e}=a,n={tl:"\u250C",tr:"\u2510",bl:"\u2514",br:"\u2518",h:"\u2500",v:"\u2502",ml:"\u251C",mr:"\u2524"},c=55,g=n.h.repeat(c-2);console.log(""),console.log(`${n.tl}${g}${n.tr}`),console.log(`${n.v}${Je("AQE LEARNING DASHBOARD",c-2)}${n.v}`),console.log(`${n.ml}${g}${n.mr}`);let i=t.patternsCreatedToday>0?R.green(` (+${t.patternsCreatedToday} today)`):"";console.log(`${n.v} Patterns: ${D(String(t.totalPatterns)+i,32)}${n.v}`);let l=t.experiencesToday>0?R.green(` (+${t.experiencesToday} today)`):"";console.log(`${n.v} Experiences: ${D(String(t.totalExperiences)+l,32)}${n.v}`),console.log(`${n.v} Q-Values: ${D(String(t.totalQValues),32)}${n.v}`);let u=t.avgReward.toFixed(2),p=t.avgRewardDelta>=0?R.green(`(\u2191 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`):R.red(`(\u2193 ${Math.abs(t.avgRewardDelta).toFixed(2)} from last week)`);console.log(`${n.v} Avg Reward: ${D(`${u} ${p}`,32)}${n.v}`);let r=(t.successRate*100).toFixed(1);if(console.log(`${n.v} Success Rate: ${D(`${r}%`,32)}${n.v}`),console.log(`${n.v} Short-term: ${D(String(t.shortTermPatterns),32)}${n.v}`),console.log(`${n.v} Long-term: ${D(String(t.longTermPatterns),32)}${n.v}`),console.log(`${n.v}${" ".repeat(c-2)}${n.v}`),console.log(`${n.v} ${R.bold("Domain Coverage:")}${" ".repeat(c-19)}${n.v}`),e.length===0)console.log(`${n.v} ${R.dim("No patterns yet")}${" ".repeat(c-19)}${n.v}`);else{let s=Math.max(...e.map(f=>f.count),1),m=14;for(let{domain:f,count:y}of e){let b=Math.round(y/s*m),$=m-b,k=R.green("\u2588".repeat(b))+R.dim("\u2591".repeat($)),q=D(f,20),K=Ke(String(y),3);console.log(`${n.v} ${q} ${k} ${K} patterns ${n.v}`)}let d=new Set(e.map(f=>f.domain)),h=z.filter(f=>!d.has(f)).slice(0,3);for(let f of h){let y=R.dim("\u2591".repeat(m)),b=D(f,20);console.log(`${n.v} ${b} ${y} 0 patterns ${n.v}`)}}console.log(`${n.bl}${g}${n.br}`),console.log("")}function Je(a,t){let e=Z(a),n=Math.max(0,t-e.length),c=Math.floor(n/2),g=n-c;return" ".repeat(c)+a+" ".repeat(g)}function D(a,t){let e=Z(a),n=Math.max(0,t-e.length);return a+" ".repeat(n)}function Ke(a,t){let e=Z(a),n=Math.max(0,t-e.length);return" ".repeat(n)+a}function Z(a){return a.replace(/\x1b\[[0-9;]*m/g,"")}function T(){let a=O();return X.join(a,".agentic-qe","memory.db")}async function V(a,t){let e=t||`${a}.gz`;return await Oe(Ce(a),He(),Pe(e)),e}async function F(a,t){await Oe(Ce(a),Ge(),Pe(t))}async function U(a){try{let t=E(a,{readonly:!0}),e=t.prepare("PRAGMA integrity_check").get();return t.close(),e.integrity_check==="ok"?{valid:!0,message:"Database integrity verified"}:{valid:!1,message:`Integrity check failed: ${e.integrity_check}`}}catch(t){return{valid:!1,message:`Failed to verify: ${t instanceof Error?t.message:"unknown error"}`}}}async function ee(a){try{let t=E(a,{readonly:!0});if(!t.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='schema_version'").get())return t.close(),0;let n=t.prepare("SELECT version FROM schema_version WHERE id = 1").get();return t.close(),n?.version??0}catch{return 0}}var te="3.1.0",Te={generate:"test-generation","test-generation":"test-generation",analyze:"coverage-analysis",coverage:"coverage-analysis","coverage-analysis":"coverage-analysis",run:"test-execution","test-execution":"test-execution",report:"quality-assessment",quality:"quality-assessment","quality-analysis":"quality-assessment",security:"security-compliance",sast:"security-compliance",owasp:"security-compliance",secrets:"security-compliance",audit:"security-compliance",recommend:"defect-intelligence",predict:"defect-intelligence","complexity-analysis":"code-intelligence","code-analysis":"code-intelligence",stabilize:"chaos-resilience",flaky:"chaos-resilience",quarantine:"chaos-resilience",retry:"chaos-resilience",stress:"chaos-resilience",load:"chaos-resilience",endurance:"chaos-resilience",baseline:"chaos-resilience"},_e={generate:"test-template","test-generation":"test-template",analyze:"coverage-strategy",coverage:"coverage-strategy","coverage-analysis":"coverage-strategy",run:"test-template","test-execution":"test-template",report:"assertion-pattern",quality:"assertion-pattern","quality-analysis":"assertion-pattern",security:"assertion-pattern",sast:"assertion-pattern",owasp:"assertion-pattern",secrets:"assertion-pattern",audit:"assertion-pattern",recommend:"assertion-pattern",predict:"assertion-pattern","complexity-analysis":"assertion-pattern","code-analysis":"assertion-pattern",stabilize:"flaky-fix",flaky:"flaky-fix",quarantine:"flaky-fix",retry:"flaky-fix",stress:"perf-benchmark",load:"perf-benchmark",endurance:"perf-benchmark",baseline:"perf-benchmark",mock:"mock-pattern",dependency:"mock-pattern"};function Be(a){let t=E(a,{readonly:!0,fileMustExist:!0});try{let e=t.pragma("integrity_check");if(e.length!==1||e[0].integrity_check!=="ok")throw new Error("Database integrity verification failed");return{schemaVersion:(t.prepare("SELECT 1 FROM sqlite_master WHERE type='table' AND name='schema_version'").get()?t.prepare("SELECT version FROM schema_version WHERE id = 1").get():void 0)?.version??0,pages:t.pragma("page_count",{simple:!0}),verification:{valid:!0,message:"Database integrity verified"}}}finally{t.close()}}function H(a){return j(a)?Ie(a):I(Ie(B(a)),Xe(a))}function je(a,t){if(H(a)===H(t))return!0;if(!j(a)||!j(t))return!1;let e=ne(a),n=ne(t);return e.dev===n.dev&&e.ino===n.ino}function ae(a,t){let e=H(a),n=H(t);for(let c of["","-wal","-shm","-journal"])if(je(`${e}${c}`,t)||je(a,`${n}${c}`))throw new Error("Backup source and destination must not alias the same database or its sidecars")}function qe(a){if(!ne(a).isFile())throw new Error("Backup input must be a regular file")}async function W(a,t,e={}){let n=E(a,{readonly:!0,fileMustExist:!0});try{let c=await n.backup(t);if(c.totalPages<=0||c.remainingPages!==0||e.expectedPages!==void 0&&c.totalPages!==e.expectedPages)throw new Error("SQLite snapshot did not complete; the source may be empty or the destination busy");if(e.standalone){let i=E(t,{fileMustExist:!0,walMode:!1});try{if(i.pragma("journal_mode = DELETE",{simple:!0})!=="delete")throw new Error("Could not create a standalone SQLite image")}finally{i.close()}}let g=Be(t);if(g.pages!==c.totalPages)throw new Error("SQLite snapshot page count does not match the completed backup");return g}finally{n.close()}}async function G(a,t,e={}){qe(a);let n=Ne(e.compress?`${t}.gz`:t);await Le(B(n),{recursive:!0}),ae(a,Ne(t)),ae(a,n);let c=await Fe(I(B(n),".aqe-backup-"));try{let g=I(c,"snapshot.db"),i=await W(a,g,{standalone:!0}),l=e.compress?await V(g):g;if(e.compress&&e.verify){let r=I(c,"verified.db");await F(l,r),Be(r)}let u=Number(((await re(a)).size/1024).toFixed(2)),p=Number(((await re(l)).size/1024).toFixed(2));if(["-wal","-shm","-journal"].some(r=>j(`${n}${r}`)))throw new Error("Backup destination has SQLite sidecars; choose an unused output path");return await Ye(l,n),{backupPath:n,sourceSizeKB:u,backupSizeKB:p,compressed:!!e.compress,schemaVersion:i.schemaVersion,verification:i.verification}}finally{await oe(c,{recursive:!0,force:!0})}}async function Me(a,t,e={}){if(qe(a),await Le(B(t),{recursive:!0}),ae(a,t),j(t)&&!e.force)throw new Error(`Database already exists at: ${t}. Use --force to overwrite`);let n=await Fe(I(B(t),".aqe-restore-")),c;try{let g=a.endsWith(".gz"),i=I(n,"snapshot.db"),l=a;g&&(l=I(n,"decompressed.db"),await F(a,l));let u=await W(l,i,{standalone:!0}),p=Number(((await re(i)).size/1024).toFixed(2));if(j(t)){let r=new Date().toISOString().replace(/[:.]/g,"-"),s=`${t}.pre-restore-${r}-${Ze()}.db`;try{await W(t,s,{standalone:!0}),c=s}catch(m){throw await oe(s,{force:!0}),new Error("Cannot create a verified safety backup of the existing database; restore refused. Stop project processes and preserve the database and its sidecars before restoring into an absent destination.",{cause:m})}}return await W(i,t,{expectedPages:u.pages}),{sizeKB:p,schemaVersion:u.schemaVersion,wasCompressed:g,safetyBackupPath:c}}catch(g){if(c){let i=g instanceof Error?g.message:"SQLite snapshot failed";throw new Error(`Restore failed: ${i}; previous database snapshot preserved at ${c}`,{cause:g})}throw g}finally{await oe(n,{recursive:!0,force:!0})}}M();import Qe from"node:path";import{randomUUID as et}from"node:crypto";import{existsSync as tt}from"node:fs";import J from"chalk";function se(a,t,e){if(!/^\d+$/.test(t)||Number(t)<e)throw new Error(`${a} must be a whole number >= ${e}, got "${t}"`);return Number(t)}function ze(a){a.command("prune").description("Bound learning-table growth (dry run unless --apply)").option("--dry-run","Print the row counts that would change; write nothing (default)").option("--apply","Make the changes (backs up memory.db first)").option("--no-backup","With --apply: skip the backup").option("--failed-dream-cycles-days <n>","Remove failed/interrupted dream cycles older than n days",String(we)).option("--outcome-concepts-max <n>","Keep the newest n outcome concept nodes",String($e)).option("--compact-experiences","Opt-in: clear result_json and embedding of archived/merged experiences").option("--routing-outcomes-older-than <days>","Opt-in: remove routing outcomes older than this").option("--json","Output as JSON").addHelpText("after",`
|
|
4
4
|
Examples:
|
|
5
5
|
aqe learning prune # dry run of the default steps
|
|
6
6
|
aqe learning prune --compact-experiences # dry run, including compaction
|
|
7
7
|
aqe learning prune --compact-experiences --apply # back up, then compact
|
|
8
8
|
|
|
9
|
-
Rows deleted inside the file are reused by SQLite; run VACUUM to shrink the file itself.`).action(async t=>{try{if(t.apply&&t.dryRun)throw new Error("--apply and --dry-run cannot be combined");let e=!t.apply,n=se("--failed-dream-cycles-days",t.failedDreamCyclesDays,1),c=se("--outcome-concepts-max",t.outcomeConceptsMax,
|
|
9
|
+
Rows deleted inside the file are reused by SQLite; run VACUUM to shrink the file itself.`).action(async t=>{try{if(t.apply&&t.dryRun)throw new Error("--apply and --dry-run cannot be combined");let e=!t.apply,n=se("--failed-dream-cycles-days",t.failedDreamCyclesDays,1),c=se("--outcome-concepts-max",t.outcomeConceptsMax,ve),g=t.routingOutcomesOlderThan===void 0?void 0:se("--routing-outcomes-older-than",t.routingOutcomesOlderThan,1),i=T();if(!tt(i))throw new Error(`No learning database found at: ${i}`);let l;if(!e&&t.backup){let s=new Date().toISOString().replace(/[:.]/g,"-").slice(0,23),m=Qe.join(Qe.dirname(i),"backups",`pre-prune-${s}-${et()}.db`);l=(await G(i,m,{verify:!0})).backupPath}let u=E(i,{readonly:e,fileMustExist:!0}),p=[],r;try{p.push(Se(u,{retentionDays:n,dryRun:e})),p.push(Ee(u,{maxNodes:c,dryRun:e})),t.compactExperiences&&p.push(xe(u,{dryRun:e})),g!==void 0&&p.push(ke(u,{olderThanDays:g,dryRun:e})),ye(p)&&(r=be(u,"prune"))}finally{u.close()}if(t.json){w({dryRun:e,dbPath:i,backupPath:l,checkpointAck:r,steps:p});return}console.log(J.bold(`
|
|
10
10
|
Learning prune${e?" (dry run, nothing written)":""}
|
|
11
|
-
`)),console.log(` Database: ${i}`),l&&console.log(` Backup: ${l}`);for(let
|
|
12
|
-
|
|
11
|
+
`)),console.log(` Database: ${i}`),l&&console.log(` Backup: ${l}`);for(let s of p){let m=s.payloadBytes!==void 0?`, ${(s.payloadBytes/1048576).toFixed(1)} MB of payload`:"";console.log(` ${Re(s)}${m}`)}r&&console.log(J.gray(`
|
|
12
|
+
The next brain checkpoint will replace aqe.rvf with the smaller brain.`)),e&&console.log(J.gray(`
|
|
13
|
+
Re-run with --apply to make these changes.`)),(!t.compactExperiences||g===void 0)&&console.log(J.gray(" Opt-in steps: --compact-experiences, --routing-outcomes-older-than <days>.")),console.log("")}catch(e){v(`prune failed: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1}})}function kn(){let a=new nt("learning").description("AQE self-learning system management (standalone, no claude-flow required)").addHelpText("after",`
|
|
13
14
|
Examples:
|
|
14
15
|
# Check learning system status
|
|
15
16
|
aqe learning stats
|
|
@@ -25,33 +26,33 @@ Examples:
|
|
|
25
26
|
|
|
26
27
|
# Run background learning consolidation
|
|
27
28
|
aqe learning daemon --interval 3600
|
|
28
|
-
`);return
|
|
29
|
+
`);return ct(a),lt(a),dt(a),pt(a),gt(a),ut(a),mt(a),ft(a),ht(a),yt(a),bt(a),wt(a),$t(a),vt(a),it(a),st(a),St(a),xt(a),Rt(a),ze(a),a}function st(a){a.command("embedding-health").description("Display active and stored embedding-space provenance").option("--json","Output as JSON").action(async t=>{let e=S.join(O(),".agentic-qe","memory.db");if(!x(e))throw new Error('Database not found. Run "aqe init --auto" first.');let n=E(e,{readonly:!0});try{let c=n.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_pattern_embeddings'").get(),g=c?n.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(u=>u.name==="space_id"):!1,i=c?n.prepare(`SELECT ${g?"space_id":"NULL"} AS spaceId FROM qe_pattern_embeddings`).all():[],l=le(i,de()?.spaceId??null);if(t.json){w(l);return}console.log(o.bold(`
|
|
29
30
|
Embedding Space Health
|
|
30
31
|
`)),console.log(` Status: ${l.status}`),console.log(` Active space: ${l.activeSpaceId??"(runtime not initialized)"}`),console.log(` Stored spaces: ${l.storedSpaceIds.join(", ")||"(none)"}`),console.log(` Verified vectors: ${l.verifiedVectors}`),console.log(` Mismatched vectors: ${l.mismatchedVectors}`),console.log(` Unverified vectors: ${l.unverifiedVectors}
|
|
31
|
-
`)}finally{n.close()}})}function
|
|
32
|
+
`)}finally{n.close()}})}function it(a){a.command("backfill-embeddings").description("Generate embeddings for learned patterns that are missing vectors").option("-b, --batch-size <n>","Patterns per embedding batch","32").option("--dry-run","Report missing embeddings without writing").option("--json","Output as JSON").action(async t=>{let e=Number(t.batchSize);if(!Number.isInteger(e)||e<=0)throw new Error("batch size must be a positive integer");let n=me();try{await n.initialize();let c=n.getGhostPatternCount();if(t.dryRun){t.json?w({dryRun:!0,batchSize:e,...c}):(console.log(o.bold(`
|
|
32
33
|
Pattern Embedding Backfill (dry run)
|
|
33
|
-
`)),console.log(` Patterns: ${c.total}`),console.log(` Missing embeddings: ${c.withoutEmbeddings}`),c.sampleGhostIds.length>0&&console.log(` Sample IDs: ${c.sampleGhostIds.join(", ")}`),console.log(""));return}let g=await n.backfillEmbeddings(e),i=n.getGhostPatternCount(),l={skipped:"vector index unavailable"};if(g.processed>0)try{let p=await C(),r=p.getLastVectorReconcile()??p.reconcileVectorIndex();r&&(l={ingested:r.ingested,missing:r.missing,capped:r.capped})}catch(p){l={skipped:p instanceof Error?p.message:String(p)}}let u={...g,batchSize:e,missingBefore:c.withoutEmbeddings,missingAfter:i.withoutEmbeddings,rvfIndex:l};t.json?w(u):(P("Pattern embedding backfill complete."),console.log(` Processed: ${g.processed}`),console.log(` Skipped: ${g.skipped}`),console.log(` Errors: ${g.errors}`),console.log(` Remaining missing: ${i.withoutEmbeddings}`),console.log(` Method: ${g.method}`),console.log("ingested"in l?` Vector index (RVF): ingested ${l.ingested} of ${l.missing} missing${l.capped?" (capped; rerun to continue)":""}`:` Vector index (RVF): not updated (${l.skipped})`),console.log(""))}catch(c){throw v(`backfill-embeddings failed: ${c instanceof Error?c.message:"unknown"}`),c}finally{n.close()}})}function
|
|
34
|
+
`)),console.log(` Patterns: ${c.total}`),console.log(` Missing embeddings: ${c.withoutEmbeddings}`),c.sampleGhostIds.length>0&&console.log(` Sample IDs: ${c.sampleGhostIds.join(", ")}`),console.log(""));return}let g=await n.backfillEmbeddings(e),i=n.getGhostPatternCount(),l={skipped:"vector index unavailable"};if(g.processed>0)try{let p=await C(),r=p.getLastVectorReconcile()??p.reconcileVectorIndex();r&&(l={ingested:r.ingested,missing:r.missing,capped:r.capped})}catch(p){l={skipped:p instanceof Error?p.message:String(p)}}let u={...g,batchSize:e,missingBefore:c.withoutEmbeddings,missingAfter:i.withoutEmbeddings,rvfIndex:l};t.json?w(u):(P("Pattern embedding backfill complete."),console.log(` Processed: ${g.processed}`),console.log(` Skipped: ${g.skipped}`),console.log(` Errors: ${g.errors}`),console.log(` Remaining missing: ${i.withoutEmbeddings}`),console.log(` Method: ${g.method}`),console.log("ingested"in l?` Vector index (RVF): ingested ${l.ingested} of ${l.missing} missing${l.capped?" (capped; rerun to continue)":""}`:` Vector index (RVF): not updated (${l.skipped})`),console.log(""))}catch(c){throw v(`backfill-embeddings failed: ${c instanceof Error?c.message:"unknown"}`),c}finally{n.close()}})}function ct(a){a.command("stats").description("Display learning system statistics").option("--json","Output as JSON").option("--detailed","Show detailed breakdown").action(async t=>{try{let n=await(await C()).getStats();if(t.json)w(n);else{console.log(o.bold(`
|
|
34
35
|
\u{1F4CA} AQE Learning System Statistics
|
|
35
36
|
`)),console.log(o.bold("Patterns:")),console.log(` Total: ${o.cyan(n.totalPatterns)}`),console.log(` Short-term: ${n.patternStoreStats.byTier.shortTerm}`),console.log(` Long-term: ${n.patternStoreStats.byTier.longTerm}`),console.log(` Avg Confidence: ${(n.patternStoreStats.avgConfidence*100).toFixed(1)}%`),console.log(` Avg Quality: ${(n.patternStoreStats.avgQualityScore*100).toFixed(1)}%`),console.log(o.bold(`
|
|
36
37
|
By Domain:`));let c=Object.entries(n.byDomain).filter(([i,l])=>l>0).sort((i,l)=>l[1]-i[1]);if(c.length===0)console.log(o.dim(" No patterns yet"));else for(let[i,l]of c)console.log(` ${i}: ${l}`);console.log(o.bold(`
|
|
37
38
|
Learning:`)),console.log(` Routing Requests: ${n.routingRequests}`),console.log(` Avg Routing Confidence: ${(n.avgRoutingConfidence*100).toFixed(1)}%`),console.log(` Learning Outcomes: ${ge(n)}`),console.log(` Pattern Success Rate: ${ue(n)}`),console.log(o.bold(`
|
|
38
39
|
Search Performance:`)),console.log(` Operations: ${n.patternStoreStats.searchOperations}`),console.log(` Avg Latency: ${n.patternStoreStats.avgSearchLatencyMs.toFixed(2)}ms`),console.log(` HNSW Native: ${n.patternStoreStats.hnswStats.nativeAvailable?o.green("\u2713"):o.dim("\u25CB")}`),console.log(` Vector Count: ${n.patternStoreStats.hnswStats.vectorCount}`);let g=n.asymmetricLearning;if(g&&(console.log(o.bold(`
|
|
39
40
|
Asymmetric Learning (ADR-061):`)),console.log(` Failure Penalty Ratio: ${g.failurePenaltyRatio||"10:1"}`),console.log(` Quarantined Patterns: ${g.quarantinedPatterns||0}`),console.log(` Rehabilitated: ${g.rehabilitatedPatterns||0}`),console.log(` Avg Confidence Delta: ${((g.avgConfidenceDelta||0)*100).toFixed(1)}%`)),t.detailed){console.log(o.bold(`
|
|
40
|
-
By Pattern Type:`));for(let[i,l]of Object.entries(n.patternStoreStats.byType))l>0&&console.log(` ${i}: ${l}`)}console.log("")}return}catch(e){throw v(`stats failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
41
|
+
By Pattern Type:`));for(let[i,l]of Object.entries(n.patternStoreStats.byType))l>0&&console.log(` ${i}: ${l}`)}console.log("")}return}catch(e){throw v(`stats failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function lt(a){a.command("consolidate").description("Consolidate patterns - promote successful patterns to long-term memory").option("--dry-run","Show what would be promoted without making changes").option("--threshold <n>","Minimum successful uses for promotion","3").option("--success-rate <n>","Minimum success rate for promotion (0-1)","0.7").option("--json","Output as JSON").action(async t=>{try{let e=await C(),n=Number(t.threshold),c=Number(t.successRate),g=.6;if(!Number.isInteger(n)||n<1)throw new Error("threshold must be a positive integer");if(!Number.isFinite(c)||c<0||c>1)throw new Error("success rate must be between 0 and 1");let i=[],l=await e.searchPatterns("",{limit:1e3});if(!l.success)throw new Error(l.error.message);for(let r of l.value){let s=r.pattern;s.tier==="short-term"&&s.successfulUses>=n&&s.successRate>=c&&s.confidence>=g&&i.push({id:s.id,name:s.name,domain:s.qeDomain,successfulUses:s.successfulUses,successRate:s.successRate,currentTier:s.tier})}let u=0,p=[];if(!t.dryRun)for(let r of i){let s=await e.promotePattern(r.id);s.success?u++:p.push({id:r.id,error:s.error.message})}if(t.json)w({dryRun:t.dryRun||!1,eligibleCount:i.length,promotedCount:u,failedCount:p.length,threshold:n,successRateMin:c,confidenceMin:g,patterns:i,failures:p});else{if(console.log(o.bold(`
|
|
41
42
|
\u{1F504} Pattern Consolidation
|
|
42
43
|
`)),console.log(` Promotion threshold: ${n} successful uses`),console.log(` Minimum success rate: ${(c*100).toFixed(0)}%`),console.log(` Minimum confidence: ${(g*100).toFixed(0)}%`),console.log(` Eligible patterns: ${i.length}
|
|
43
44
|
`),i.length===0)console.log(o.dim(" No patterns eligible for promotion yet."));else{console.log(o.bold(" Patterns to promote:"));for(let r of i)console.log(` ${o.cyan(r.name)}`),console.log(o.dim(` Domain: ${r.domain}, Uses: ${r.successfulUses}, Rate: ${(r.successRate*100).toFixed(0)}%`));if(t.dryRun)console.log(o.yellow(`
|
|
44
45
|
Dry run - no changes made`));else if(console.log(o.green(`
|
|
45
|
-
Promoted: ${u}`)),p.length>0){console.log(o.red(` Failed: ${p.length}`));for(let r of p)console.log(o.dim(` ${r.id}: ${r.error}`))}}console.log("")}return}catch(e){throw v(`consolidate failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
46
|
+
Promoted: ${u}`)),p.length>0){console.log(o.red(` Failed: ${p.length}`));for(let r of p)console.log(o.dim(` ${r.id}: ${r.error}`))}}console.log("")}return}catch(e){throw v(`consolidate failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function dt(a){a.command("export").description("Export learned patterns for sharing").option("-o, --output <file>","Output file path","aqe-patterns.json").option("-d, --domain <domain>","Filter by domain").option("--long-term-only","Only export long-term patterns").option("--json","Output as JSON (to stdout)").action(async t=>{try{let n=await(await C()).searchPatterns("",{limit:1e4,domain:t.domain});if(!n.success)throw new Error(n.error.message);let c=n.value.map(i=>i.pattern).filter(i=>!t.longTermOnly||i.tier==="long-term"),g={version:"3.0.0",exportedAt:new Date().toISOString(),source:process.cwd(),patternCount:c.length,patterns:c.map(i=>({id:i.id,name:i.name,description:i.description,patternType:i.patternType,qeDomain:i.qeDomain,tier:i.tier,confidence:i.confidence,successRate:i.successRate,successfulUses:i.successfulUses,qualityScore:i.qualityScore,template:i.template,context:i.context}))};if(t.json)w(g);else{let i=S.resolve(t.output);Ue(i,JSON.stringify(g,null,2),"utf-8"),P(`Exported ${c.length} patterns to ${i}`)}return}catch(e){throw v(`export failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function pt(a){a.command("import").description("Import patterns from file").requiredOption("-i, --input <file>","Input file path").option("--dry-run","Show what would be imported without making changes").option("--json","Output as JSON").action(async t=>{try{let e=S.resolve(t.input);if(!x(e))throw new Error(`File not found: ${e}`);let n=ie(e,"utf-8"),c=Q(n);if(!c.patterns||!Array.isArray(c.patterns))throw new Error("Invalid pattern file format");let g=await C(),i=0,l=0,u=0,p=[];if(!t.dryRun)for(let r of c.patterns)try{let s=await g.storePattern({patternType:r.patternType,name:r.name,description:r.description,template:r.template,context:r.context});s.success?(i++,s.value.embedding&&s.value.embedding.length>0||u++):L(s.error)?(i++,u++):(l++,p.push(`${r.name}: ${s.error.message}`))}catch(s){l++,p.push(`${r.name}: ${s instanceof Error?s.message:"unknown"}`)}t.json?w({dryRun:t.dryRun||!1,totalPatterns:c.patterns.length,imported:i,skipped:l,pendingIndex:u,errors:p}):(console.log(o.bold(`
|
|
46
47
|
\u{1F4E5} Pattern Import
|
|
47
48
|
`)),console.log(` Source: ${e}`),console.log(` Total patterns: ${c.patterns.length}`),t.dryRun?(console.log(o.yellow(`
|
|
48
49
|
Dry run - no changes made`)),console.log(` Would import: ${c.patterns.length} patterns`)):(console.log(o.green(`
|
|
49
|
-
Imported: ${i}`)),u>0&&console.log(o.yellow(` Vector index pending: ${u} (run "aqe learning backfill-embeddings" once an embedder is available)`)),l>0&&console.log(o.yellow(` Skipped: ${l}`))),console.log(""));return}catch(e){throw v(`import failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
50
|
+
Imported: ${i}`)),u>0&&console.log(o.yellow(` Vector index pending: ${u} (run "aqe learning backfill-embeddings" once an embedder is available)`)),l>0&&console.log(o.yellow(` Skipped: ${l}`))),console.log(""));return}catch(e){throw v(`import failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function gt(a){a.command("reset").description("Reset learning data (patterns and metrics)").option("--confirm","Confirm reset without prompting").option("--patterns-only","Only reset patterns, keep metrics").action(async t=>{try{if(!t.confirm){console.log(o.yellow(`
|
|
50
51
|
\u26A0\uFE0F This will reset your learning data.`)),console.log(o.gray(` Use --confirm to proceed
|
|
51
52
|
`));return}let e=O(),n=S.join(e,".agentic-qe"),c=[S.join(n,"data","patterns"),S.join(n,"data","hnsw")];t.patternsOnly||c.push(S.join(n,"data","learning-config.json")),console.log(o.bold(`
|
|
52
53
|
\u{1F5D1}\uFE0F Resetting Learning Data
|
|
53
54
|
`));for(let g of c)x(g)&&console.log(o.dim(` Removing: ${S.relative(e,g)}`));P(`Learning data reset. Run "aqe init --auto" to reinitialize.
|
|
54
|
-
`);return}catch(e){throw v(`reset failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
55
|
+
`);return}catch(e){throw v(`reset failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function ut(a){a.command("extract").description("Extract QE patterns from existing learning experiences").option("--min-reward <n>","Minimum reward threshold for pattern extraction","0.7").option("--min-count <n>","Minimum occurrences to form a pattern","3").option("--dry-run","Show what would be extracted without saving").option("--json","Output as JSON").action(async t=>{try{let e=O(),n=S.join(e,".agentic-qe","memory.db");if(!x(n))throw new Error('No memory database found. Run "aqe init --auto" first.');let c=parseFloat(t.minReward),g=parseInt(t.minCount,10);console.log(o.bold(`
|
|
55
56
|
\u{1F52C} Pattern Extraction from Learning Experiences
|
|
56
57
|
`)),console.log(` Min reward threshold: ${c}`),console.log(` Min occurrences: ${g}
|
|
57
58
|
`);let i=E(n,{readonly:!0}),l=i.prepare(`
|
|
@@ -62,55 +63,55 @@ By Pattern Type:`));for(let[i,l]of Object.entries(n.patternStoreStats.byType))l>
|
|
|
62
63
|
SELECT substr(key, 1, 40) as key_prefix, COUNT(*) as count
|
|
63
64
|
FROM memory_entries WHERE key LIKE 'phase2/learning/%'
|
|
64
65
|
GROUP BY substr(key, 1, 40) HAVING COUNT(*) >= ? ORDER BY COUNT(*) DESC LIMIT 20
|
|
65
|
-
`).all(g)}catch{}i.close();let p=[];for(let r of l){let s=
|
|
66
|
+
`).all(g)}catch{}i.close();let p=[];for(let r of l){let s=Te[r.task_type]||"code-intelligence",m=_e[r.task_type]||"test-template",d=r.actions?r.actions.split(",").slice(0,5):[];p.push({name:`${r.task_type}-success-pattern`,domain:s,patternType:m,confidence:Math.min(.95,r.avg_reward/2),sourceCount:r.count,avgReward:r.avg_reward,actions:d})}if(t.json)w({minReward:c,minCount:g,dryRun:t.dryRun||!1,experienceGroups:l.length,memoryPatterns:u.length,extractedPatterns:p});else{if(console.log(o.bold("Learning Experience Groups:")),l.length===0)console.log(o.dim(" No qualifying experience groups found"));else for(let r of l){let s=r.avg_reward>=1?o.green:r.avg_reward>=.5?o.yellow:o.red;console.log(` ${o.cyan(r.task_type)}`),console.log(` Count: ${r.count}, Avg Reward: ${s(r.avg_reward.toFixed(2))}`)}console.log(o.bold(`
|
|
66
67
|
Memory Pattern Sources:`));for(let r of u.slice(0,10))console.log(` ${r.key_prefix}... (${r.count})`);if(console.log(o.bold(`
|
|
67
|
-
Extracted Patterns:`)),p.length===0)console.log(o.dim(" No patterns extracted"));else for(let r of p)console.log(` ${o.green("+")} ${o.cyan(r.name)}`),console.log(o.dim(` Domain: ${r.domain}, Type: ${r.patternType}`)),console.log(o.dim(` Confidence: ${(r.confidence*100).toFixed(0)}%, Sources: ${r.sourceCount}`));if(!t.dryRun&&p.length>0){let r=await C(),s=0,m=[];for(let d of p)try{let
|
|
68
|
+
Extracted Patterns:`)),p.length===0)console.log(o.dim(" No patterns extracted"));else for(let r of p)console.log(` ${o.green("+")} ${o.cyan(r.name)}`),console.log(o.dim(` Domain: ${r.domain}, Type: ${r.patternType}`)),console.log(o.dim(` Confidence: ${(r.confidence*100).toFixed(0)}%, Sources: ${r.sourceCount}`));if(!t.dryRun&&p.length>0){let r=await C(),s=0,m=[];for(let d of p)try{let h=d.actions.length>0?`// ${d.name}
|
|
68
69
|
// Steps: ${d.actions.join(" -> ")}
|
|
69
70
|
|
|
70
71
|
{{implementation}}`:`// ${d.name}
|
|
71
72
|
// Extracted pattern with ${d.sourceCount} successful uses
|
|
72
73
|
|
|
73
|
-
{{implementation}}`,f=await r.storePattern({patternType:d.patternType,name:d.name,description:`Extracted from ${d.sourceCount} learning experiences with avg reward ${d.avgReward.toFixed(2)}`,template:{type:"code",content:
|
|
74
|
+
{{implementation}}`,f=await r.storePattern({patternType:d.patternType,name:d.name,description:`Extracted from ${d.sourceCount} learning experiences with avg reward ${d.avgReward.toFixed(2)}`,template:{type:"code",content:h,variables:[{name:"implementation",type:"code",required:!0,description:"Implementation code for this pattern"}]},context:{tags:[d.domain,d.patternType,`sources:${d.sourceCount}`,`reward:${d.avgReward.toFixed(2)}`]}});f.success||L(f.error)?s++:m.push(`${d.name}: ${f.error.message}`)}catch(h){m.push(`${d.name}: ${h instanceof Error?h.message:"unknown"}`)}console.log(o.green(`
|
|
74
75
|
\u2713 Stored ${s} new patterns`)),m.length>0&&m.length<=5&&console.log(o.yellow(` Errors: ${m.slice(0,3).join(", ")}${m.length>3?"...":""}`))}else t.dryRun&&console.log(o.yellow(`
|
|
75
|
-
Dry run - no patterns stored`));console.log("")}return}catch(e){throw v(`extract failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
76
|
+
Dry run - no patterns stored`));console.log("")}return}catch(e){throw v(`extract failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function mt(a){a.command("dashboard").description("Display learning system dashboard with metrics and trends").option("--json","Output as JSON").option("--save-snapshot","Save a daily metrics snapshot").action(async t=>{try{let e=O(),n=he(e);await n.initialize(),t.saveSnapshot&&(await n.saveSnapshot(),P("Daily snapshot saved"));let c=await n.getDashboardData();n.close(),t.json?w(c):Ae(c);return}catch(e){throw v(`dashboard failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function ft(a){a.command("info").description("Show learning system configuration and paths").action(async()=>{try{let t=O(),e=S.join(t,".agentic-qe");console.log(o.bold(`
|
|
76
77
|
\u{1F4CB} AQE Learning System Info
|
|
77
78
|
`)),console.log(o.bold("Paths:")),console.log(` Data directory: ${e}`),console.log(` Memory database: ${S.join(e,"memory.db")}`),console.log(` HNSW index: ${S.join(e,"data","hnsw")}`),console.log(` Patterns: ${S.join(e,"data","patterns")}`),console.log(o.bold(`
|
|
78
79
|
Configuration:`)),console.log(` Learning enabled: ${process.env.AQE_LEARNING_ENABLED!=="false"?o.green("yes"):o.red("no")}`),console.log(` V3 mode: ${process.env.AQE_V3_MODE==="true"?o.green("yes"):o.dim("no")}`),console.log(` Promotion threshold: ${process.env.AQE_V3_PATTERN_PROMOTION_THRESHOLD||"3"} uses`),console.log(` Success rate threshold: ${process.env.AQE_V3_SUCCESS_RATE_THRESHOLD||"0.7"}`),console.log(o.bold(`
|
|
79
80
|
Domains:`)),console.log(` ${z.join(", ")}`),console.log(o.bold(`
|
|
80
81
|
Hooks:`)),console.log(" Configure in .claude/settings.json"),console.log(` Events: pre-edit, post-edit, pre-task, post-task, route
|
|
81
|
-
`);return}catch(t){throw v(`info failed: ${t instanceof Error?t.message:"unknown"}`),t}})}function
|
|
82
|
+
`);return}catch(t){throw v(`info failed: ${t instanceof Error?t.message:"unknown"}`),t}})}function ht(a){a.command("backup").description("Backup learning database to a file").option("-o, --output <path>","Dedicated backup artifact path; never another live database").option("--compress","Compress backup with gzip").option("--verify","Verify backup integrity after creation").option("--json","Output as JSON").action(async t=>{try{let e=T();if(!x(e))throw new Error(`No learning database found at: ${e}`);let n=new Date().toISOString().replace(/[:.]/g,"-").slice(0,23),c=S.join(process.cwd(),"backups",`learning-${n}-${ot()}.db`),g=t.output?S.resolve(t.output):c,i=await G(e,g,t),{backupPath:l,sourceSizeKB:u,backupSizeKB:p,schemaVersion:r}=i,s=t.verify?i.verification:void 0;if(t.json)w({success:!0,sourcePath:e,backupPath:l,sourceSizeKB:u,backupSizeKB:p,compressed:t.compress||!1,schemaVersion:r,verification:s,timestamp:new Date().toISOString()});else{if(console.log(o.bold(`
|
|
82
83
|
\u{1F4BE} Learning Database Backup
|
|
83
84
|
`)),console.log(` Source: ${e}`),console.log(` Source size: ${u} KB`),console.log(` Backup: ${l}`),console.log(` Backup size: ${p} KB`),console.log(` Schema version: ${r}`),t.compress){let m=((1-p/u)*100).toFixed(1);console.log(` Compression: ${m}% reduction`)}s&&console.log(s.valid?o.green(` Verification: ${s.message}`):o.red(` Verification: ${s.message}`)),P(`Backup saved to: ${l}
|
|
84
|
-
`)}return}catch(e){throw v(`backup failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
85
|
+
`)}return}catch(e){throw v(`backup failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function yt(a){a.command("restore").description("Restore a verified learning database backup (stop project writers first)").requiredOption("-i, --input <path>","Backup file path to restore from").option("--verify","Verify backup integrity before restore (always enforced)").option("--force","Overwrite existing database without confirmation").option("--json","Output as JSON").action(async t=>{try{let e=S.resolve(t.input),n=T();if(!x(e))throw new Error(`Backup file not found: ${e}`);let c=await Me(e,n,{force:t.force}),{sizeKB:g,schemaVersion:i,wasCompressed:l,safetyBackupPath:u}=c;t.json?w({success:!0,backupPath:e,restoredPath:n,sizeKB:g,schemaVersion:i,wasCompressed:l,safetyBackupPath:u,timestamp:new Date().toISOString()}):(console.log(o.bold(`
|
|
85
86
|
\u{1F504} Learning Database Restore
|
|
86
87
|
`)),console.log(` Backup: ${e}`),console.log(` Restored to: ${n}`),console.log(` Size: ${g.toFixed(2)} KB`),console.log(` Schema version: ${i}`),u&&console.log(` Previous database: ${u}`),P(`Database restored successfully
|
|
87
|
-
`));return}catch(e){throw v(`restore failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
88
|
+
`));return}catch(e){throw v(`restore failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function bt(a){a.command("verify").description("Verify learning database integrity").option("-f, --file <path>","Database file to verify (defaults to current)").option("--json","Output as JSON").action(async t=>{try{let e=t.file?S.resolve(t.file):T();if(!x(e))throw new Error(`Database file not found: ${e}`);let n=await U(e),c=await ee(e),g=await at(e),i={};try{let l=E(e,{readonly:!0});for(let u of["qe_patterns","qe_trajectories","captured_experiences","kv_store","vectors"])try{let p=l.prepare(`SELECT COUNT(*) as count FROM ${u}`).get();i[u]=p.count}catch{}l.close()}catch{}if(t.json)w({valid:n.valid,message:n.message,path:e,sizeKB:parseFloat((g.size/1024).toFixed(2)),schemaVersion:c,tableCounts:i,timestamp:new Date().toISOString()});else{if(console.log(o.bold(`
|
|
88
89
|
\u{1F50D} Database Verification
|
|
89
90
|
`)),console.log(` Path: ${e}`),console.log(` Size: ${(g.size/1024).toFixed(2)} KB`),console.log(` Schema version: ${c}`),console.log(n.valid?o.green(` Status: ${n.message}`):o.red(` Status: ${n.message}`)),Object.keys(i).length>0){console.log(o.bold(`
|
|
90
|
-
Table Counts:`));for(let[l,u]of Object.entries(i))console.log(` ${l}: ${u}`)}console.log("")}if(!n.valid)throw new Error(`Database verification failed: ${n.message}`);return}catch(e){throw v(`verify failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
91
|
+
Table Counts:`));for(let[l,u]of Object.entries(i))console.log(` ${l}: ${u}`)}console.log("")}if(!n.valid)throw new Error(`Database verification failed: ${n.message}`);return}catch(e){throw v(`verify failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function wt(a){a.command("export-full").description("Export all learning data including patterns, trajectories, and experiences").option("-o, --output <file>","Output file path","aqe-learning-export.json").option("--compress","Compress output with gzip").option("--include-trajectories","Include learning trajectories").option("--include-experiences","Include learning experiences").option("--json","Output as JSON (to stdout)").action(async t=>{try{let e=T();if(!x(e))throw new Error('No learning database found. Run "aqe init --auto" first.');let n=await C(),c=await ee(e),g=await n.searchPatterns("",{limit:1e4});if(!g.success)throw new Error(g.error.message);let i=g.value.map(u=>({id:u.pattern.id,name:u.pattern.name,description:u.pattern.description,patternType:u.pattern.patternType,qeDomain:u.pattern.qeDomain,tier:u.pattern.tier,confidence:u.pattern.confidence,successRate:u.pattern.successRate,successfulUses:u.pattern.successfulUses,qualityScore:u.pattern.qualityScore,template:u.pattern.template,context:u.pattern.context,createdAt:u.pattern.createdAt instanceof Date?u.pattern.createdAt.toISOString():u.pattern.createdAt||void 0,lastUsedAt:u.pattern.lastUsedAt instanceof Date?u.pattern.lastUsedAt.toISOString():u.pattern.lastUsedAt||void 0})),l={version:te,exportedAt:new Date().toISOString(),source:process.cwd(),schemaVersion:c,patternCount:i.length,patterns:i};if(t.includeTrajectories)try{let u=E(e,{readonly:!0}),p=u.prepare("SELECT id, task, agent, domain, success, steps_json FROM qe_trajectories ORDER BY started_at DESC LIMIT 1000").all();l.trajectories=p.map(r=>({id:r.id,task:r.task,agent:r.agent,domain:r.domain,success:r.success,stepsJson:r.steps_json})),u.close()}catch{}if(t.includeExperiences)try{let u=E(e,{readonly:!0}),p=u.prepare("SELECT domain as task_type, agent as action, AVG(quality) as avg_reward, COUNT(*) as count FROM captured_experiences WHERE agent != 'cli-hook' GROUP BY domain, agent ORDER BY count DESC LIMIT 500").all();l.experiences=p.map(s=>({taskType:s.task_type,action:s.action,reward:s.avg_reward,count:s.count}));let r=u.prepare("SELECT COUNT(*) as total, AVG(quality) as avg_reward FROM captured_experiences WHERE agent != 'cli-hook'").get();l.metadata={totalExperiences:r.total,avgReward:r.avg_reward},u.close()}catch{}if(t.json)w(l);else{let u=S.resolve(t.output);if(Ue(u,JSON.stringify(l,null,2),"utf-8"),t.compress){let p=await V(u);await N(u),u=p}console.log(o.bold(`
|
|
91
92
|
\u{1F4E4} Learning Data Export
|
|
92
|
-
`)),console.log(` Patterns: ${i.length}`),l.trajectories&&console.log(` Trajectories: ${l.trajectories.length}`),l.experiences&&console.log(` Experience groups: ${l.experiences.length}`),console.log(` Schema version: ${c}`),console.log(` Export format: ${
|
|
93
|
-
`)}return}catch(e){throw v(`export-full failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
93
|
+
`)),console.log(` Patterns: ${i.length}`),l.trajectories&&console.log(` Trajectories: ${l.trajectories.length}`),l.experiences&&console.log(` Experience groups: ${l.experiences.length}`),console.log(` Schema version: ${c}`),console.log(` Export format: ${te}`),P(`Exported to: ${u}
|
|
94
|
+
`)}return}catch(e){throw v(`export-full failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function $t(a){a.command("import-merge").description("Import and merge patterns from export file (preserves existing data)").requiredOption("-i, --input <file>","Input file path").option("--skip-duplicates","Skip patterns with matching names (default: update)").option("--dry-run","Show what would be imported without making changes").option("--json","Output as JSON").action(async t=>{try{let e=S.resolve(t.input);if(!x(e))throw new Error(`File not found: ${e}`);let n;if(e.endsWith(".gz")){let f=e.replace(".gz",".tmp.json");await F(e,f),n=ie(f,"utf-8"),await N(f)}else n=ie(e,"utf-8");let c=Q(n);if(!c.patterns||!Array.isArray(c.patterns))throw new Error("Invalid import file format: missing patterns array");let g=await C(),i=await g.searchPatterns("",{limit:1e4}),l=new Set;if(i.success)for(let f of i.value)l.add(f.pattern.name);let u=0,p=0,r=0,s=[];if(!t.dryRun)for(let f of c.patterns){let y=l.has(f.name);if(y&&t.skipDuplicates){p++;continue}try{let b=await g.storePattern({patternType:f.patternType,name:f.name,description:f.description,template:f.template,context:f.context});b.success||L(b.error)?y?r++:u++:(p++,s.push(`${f.name}: ${b.error.message}`))}catch(b){p++,s.push(`${f.name}: ${b instanceof Error?b.message:"unknown"}`)}}let m=0,d=0,h=0;if(t.dryRun)for(let f of c.patterns){let y=l.has(f.name);y&&t.skipDuplicates?d++:y?h++:m++}t.json?w({dryRun:t.dryRun||!1,importVersion:c.version,totalPatterns:c.patterns.length,imported:t.dryRun?m:u,updated:t.dryRun?h:r,skipped:t.dryRun?d:p,errors:s.slice(0,10)}):(console.log(o.bold(`
|
|
94
95
|
\u{1F4E5} Learning Data Import (Merge)
|
|
95
96
|
`)),console.log(` Source: ${e}`),console.log(` Export version: ${c.version||"unknown"}`),console.log(` Total patterns: ${c.patterns.length}`),console.log(` Existing patterns: ${l.size}`),t.dryRun?(console.log(o.yellow(`
|
|
96
97
|
Dry run - no changes made`)),console.log(` Would import: ${m}
|
|
97
|
-
Would update: ${
|
|
98
|
+
Would update: ${h}
|
|
98
99
|
Would skip: ${d}`)):(console.log(o.green(`
|
|
99
|
-
Imported: ${u}`)),console.log(o.blue(` Updated: ${r}`)),p>0&&console.log(o.yellow(` Skipped: ${p}`)),s.length>0&&console.log(o.red(` Errors: ${s.length}`))),console.log(""));return}catch(e){throw v(`import-merge failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function
|
|
100
|
+
Imported: ${u}`)),console.log(o.blue(` Updated: ${r}`)),p>0&&console.log(o.yellow(` Skipped: ${p}`)),s.length>0&&console.log(o.red(` Errors: ${s.length}`))),console.log(""));return}catch(e){throw v(`import-merge failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function vt(a){a.command("dream").description("Run dream cycles for pattern discovery via spreading activation").option("--duration <ms>","Duration of dream cycle in milliseconds","30000").option("--quick","Run a quick 5-second dream cycle").option("--full","Run a full 30-second dream cycle").option("--status","Show dream system status").option("--history","Show past dream cycles").option("--insights","Show pending insights from previous cycles").option("--apply <id>","Apply a specific insight by ID").option("--limit <n>","Maximum results for history/insights","20").option("--min-patterns <n>","Minimum patterns required to dream","10").option("--json","Output as JSON").action(async t=>{try{let{createDreamEngine:e}=await import("./dream-VQ2PZCVR.js");if(t.status){let r=e();await r.initialize();let s=r.isDreaming(),m=await r.getDreamHistory(100),d=await r.getPendingInsights(100),h=m.reduce((y,b)=>y+b.insightsGenerated,0),f=m[0];if(t.json)w({isDreaming:s,totalCycles:m.length,totalInsights:h,pendingInsights:d.length,lastDreamTime:f?.startTime.toISOString()||null});else{if(console.log(o.bold(`
|
|
100
101
|
\u{1F319} Dream System Status
|
|
101
|
-
`)),console.log(` Currently dreaming: ${s?o.green("Yes"):o.dim("No")}`),console.log(` Total dream cycles: ${m.length}`),console.log(` Total insights generated: ${
|
|
102
|
-
Recent cycles:`));for(let
|
|
102
|
+
`)),console.log(` Currently dreaming: ${s?o.green("Yes"):o.dim("No")}`),console.log(` Total dream cycles: ${m.length}`),console.log(` Total insights generated: ${h}`),console.log(` Pending insights: ${d.length}`),console.log(` Last dream: ${f?f.startTime.toISOString():o.dim("never")}`),m.length>0){console.log(o.bold(`
|
|
103
|
+
Recent cycles:`));for(let y of m.slice(0,3)){let b=y.status==="completed"?o.green(y.status):o.yellow(y.status);console.log(` ${y.id.slice(0,8)} | ${b} | ${y.durationMs||0}ms | ${y.insightsGenerated} insights`)}}console.log("")}await r.close();return}if(t.history){let r=parseInt(t.limit,10),s=e();await s.initialize();let m=await s.getDreamHistory(r);if(t.json)w(m.map(d=>({id:d.id,startTime:d.startTime.toISOString(),endTime:d.endTime?.toISOString(),durationMs:d.durationMs,status:d.status,conceptsProcessed:d.conceptsProcessed,associationsFound:d.associationsFound,insightsGenerated:d.insightsGenerated})));else{if(console.log(o.bold(`
|
|
103
104
|
\u{1F319} Dream Cycle History (${m.length} cycles)
|
|
104
|
-
`)),m.length===0)console.log(o.dim(" No dream cycles found. Run: aqe learning dream"));else for(let d of m){let
|
|
105
|
+
`)),m.length===0)console.log(o.dim(" No dream cycles found. Run: aqe learning dream"));else for(let d of m){let h=d.status==="completed"?o.green("\u2713"):d.status==="failed"?o.red("\u2717"):o.yellow("\u22EF");console.log(` ${h} ${d.id.slice(0,8)} | ${d.startTime.toISOString()}`),console.log(o.dim(` Duration: ${d.durationMs||0}ms | Concepts: ${d.conceptsProcessed} | Associations: ${d.associationsFound} | Insights: ${d.insightsGenerated}`))}console.log("")}await s.close();return}if(t.insights){let r=parseInt(t.limit,10),s=e();await s.initialize();let m=await s.getPendingInsights(r);if(t.json)w(m.map(d=>({id:d.id,type:d.type,description:d.description,noveltyScore:d.noveltyScore,confidenceScore:d.confidenceScore,actionable:d.actionable,applied:d.applied||!1,suggestedAction:d.suggestedAction,createdAt:d.createdAt?.toISOString()})));else{if(console.log(o.bold(`
|
|
105
106
|
\u{1F4A1} Pending Dream Insights (${m.length})
|
|
106
|
-
`)),m.length===0)console.log(o.dim(" No pending insights. Run a dream cycle first: aqe learning dream"));else for(let d of m){let
|
|
107
|
+
`)),m.length===0)console.log(o.dim(" No pending insights. Run a dream cycle first: aqe learning dream"));else for(let d of m){let h=d.noveltyScore>=.7?o.green(`${(d.noveltyScore*100).toFixed(0)}%`):o.yellow(`${(d.noveltyScore*100).toFixed(0)}%`),f=d.confidenceScore>=.7?o.green(`${(d.confidenceScore*100).toFixed(0)}%`):o.yellow(`${(d.confidenceScore*100).toFixed(0)}%`);console.log(` ${o.cyan(d.id.slice(0,8))} [${d.type}] ${d.actionable?"\u26A1":" "}`),console.log(` ${d.description}`),console.log(o.dim(` Novelty: ${h} | Confidence: ${f}`)),d.suggestedAction&&console.log(o.dim(` Action: ${d.suggestedAction}`))}console.log("")}await s.close();return}if(t.apply){let r=t.apply,s=e();await s.initialize();let d=(await s.getPendingInsights(100)).find($=>$.id===r||$.id.startsWith(r));if(!d)throw await s.close(),new Error(`Insight not found: ${r}`);if(!d.actionable)throw await s.close(),new Error(`Insight ${r} is not actionable`);let h=await s.applyInsight(d.id),y=await(await C()).storePattern({patternType:"test-template",name:`Dream Insight: ${d.type}`,description:`${d.description} (confidence: ${d.confidenceScore.toFixed(2)})`,template:{type:"workflow",content:d.suggestedAction||d.description,variables:[]},context:{tags:["dream-generated",d.type,...d.sourceConcepts.slice(0,3)],complexity:"medium"}}),b=y.success?y.value.id:L(y.error);if(t.json?w({insightId:d.id,applied:h.success,patternId:b,error:h.error||(b||y.success?null:y.error?.message)}):h.success?(P(`Applied insight ${d.id.slice(0,8)}`),b&&P(`Created pattern ${b} in ReasoningBank`)):v(`Failed to apply insight: ${h.error}`),await s.close(),!h.success)throw new Error(`Failed to apply insight: ${h.error}`);return}let n=parseInt(t.duration,10);t.quick&&(n=5e3),t.full&&(n=3e4),n=Math.min(n,6e4);let c=parseInt(t.minPatterns,10);_(`Starting dream cycle (${n}ms, min ${c} patterns)...`);let g=e({maxDurationMs:n,minConceptsRequired:c});await g.initialize();let l=await(await C()).searchPatterns("",{limit:100,minConfidence:.3}),u=0;if(l.success&&l.value.length>0){let r=l.value.map(s=>({id:s.pattern.id,name:s.pattern.name,description:s.pattern.description||`${s.pattern.patternType} pattern`,domain:s.pattern.qeDomain||"learning-optimization",patternType:s.pattern.patternType,confidence:s.pattern.confidence,successRate:s.pattern.usageCount>0?s.pattern.successRate:void 0}));u=await g.loadPatternsAsConcepts(r),_(`Loaded ${u} patterns from ReasoningBank as concepts`)}else _("No patterns found in ReasoningBank \u2014 dreaming with existing concepts");let p=await g.dream(n);if(t.json)w({cycleId:p.cycle.id,status:p.cycle.status,durationMs:p.cycle.durationMs||0,conceptsProcessed:p.cycle.conceptsProcessed,associationsFound:p.cycle.associationsFound,insightsGenerated:p.cycle.insightsGenerated,activationStats:p.activationStats,patternsCreated:p.patternsCreated,retention:p.retention?{enabled:p.retention.enabled,steps:Y(p.retention)}:void 0,insights:p.insights.map(r=>({id:r.id,type:r.type,description:r.description,noveltyScore:r.noveltyScore,confidenceScore:r.confidenceScore,actionable:r.actionable}))});else{console.log(o.bold(`
|
|
107
108
|
\u{1F319} Dream Cycle Complete
|
|
108
|
-
`)),console.log(` Cycle ID: ${p.cycle.id.slice(0,8)}`),console.log(` Status: ${p.cycle.status==="completed"?o.green("completed"):o.yellow(p.cycle.status)}`),console.log(` Duration: ${p.cycle.durationMs||0}ms`),console.log(` Concepts: ${p.cycle.conceptsProcessed}`),console.log(` Associations: ${p.cycle.associationsFound}`),console.log(` Insights: ${p.cycle.insightsGenerated}`);for(let r of p.retention?
|
|
109
|
+
`)),console.log(` Cycle ID: ${p.cycle.id.slice(0,8)}`),console.log(` Status: ${p.cycle.status==="completed"?o.green("completed"):o.yellow(p.cycle.status)}`),console.log(` Duration: ${p.cycle.durationMs||0}ms`),console.log(` Concepts: ${p.cycle.conceptsProcessed}`),console.log(` Associations: ${p.cycle.associationsFound}`),console.log(` Insights: ${p.cycle.insightsGenerated}`);for(let r of p.retention?Y(p.retention):[])console.log(` Retention: ${r}`);if(p.activationStats&&(console.log(o.bold(`
|
|
109
110
|
Activation Stats:`)),console.log(` Iterations: ${p.activationStats.totalIterations}`),console.log(` Peak level: ${p.activationStats.peakActivation.toFixed(3)}`),console.log(` Nodes active: ${p.activationStats.nodesActivated}`)),p.insights.length>0){console.log(o.bold(`
|
|
110
111
|
Generated Insights:`));for(let r of p.insights){let s=r.noveltyScore>=.7?o.green(`${(r.noveltyScore*100).toFixed(0)}%`):o.yellow(`${(r.noveltyScore*100).toFixed(0)}%`);console.log(` ${o.cyan(r.id.slice(0,8))} [${r.type}] ${r.actionable?"\u26A1 actionable":""}`),console.log(` ${r.description}`),console.log(o.dim(` Novelty: ${s} | Confidence: ${(r.confidenceScore*100).toFixed(0)}%`))}console.log(o.dim(`
|
|
111
112
|
Apply insights with: aqe learning dream --apply <insight-id>`))}else console.log(o.dim(`
|
|
112
|
-
No insights generated this cycle.`)),console.log(o.dim(" Try loading more patterns or running a longer cycle."));console.log("")}await g.close();return}catch(e){throw v(`dream failed: ${e instanceof Error?e.message:"unknown"}`),e instanceof Error&&e.stack&&console.error(o.dim(e.stack)),e}})}function
|
|
113
|
-
Dry run \u2014 would perform these steps:`)),console.log(" 1. Backup corrupted DB"),console.log(" 2. Dump all data via .dump"),console.log(" 3. Reimport into fresh DB (rebuilds all indexes)"),console.log(" 4. Verify integrity of repaired DB"),console.log(" 5. Verify row counts match"),console.log(" 6. Swap repaired DB into place"),console.log(""));return}let i=`${e}.bak-${Date.now()}`;
|
|
113
|
+
No insights generated this cycle.`)),console.log(o.dim(" Try loading more patterns or running a longer cycle."));console.log("")}await g.close();return}catch(e){throw v(`dream failed: ${e instanceof Error?e.message:"unknown"}`),e instanceof Error&&e.stack&&console.error(o.dim(e.stack)),e}})}function St(a){a.command("repair").description("Repair a corrupted learning database (dump + reimport to rebuild indexes)").option("-f, --file <path>","Database file to repair (defaults to current project)").option("--dry-run","Show what would be done without modifying files").option("--json","Output as JSON").action(async t=>{try{let e=t.file?S.resolve(t.file):T();if(!x(e))throw new Error(`Database file not found: ${e}`);let n=await U(e);if(n.valid){t.json?w({status:"healthy",message:"Database is already healthy, no repair needed",path:e}):P("Database integrity check passed \u2014 no repair needed.");return}_(`Corruption detected: ${n.message}`);let c={};try{let $=E(e,{readonly:!0}),k=$.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").all();for(let q of k)try{let K=$.prepare(`SELECT COUNT(*) as count FROM "${q.name}"`).get();c[q.name]=K.count}catch{}$.close()}catch{}let g=Object.values(c).reduce(($,k)=>$+k,0);if(_(`Found ${Object.keys(c).length} tables, ~${g} total rows`),t.dryRun){t.json?w({status:"dry-run",corruptionDetected:!0,message:n.message,tables:c,totalRows:g}):(console.log(o.bold(`
|
|
114
|
+
Dry run \u2014 would perform these steps:`)),console.log(" 1. Backup corrupted DB"),console.log(" 2. Dump all data via .dump"),console.log(" 3. Reimport into fresh DB (rebuilds all indexes)"),console.log(" 4. Verify integrity of repaired DB"),console.log(" 5. Verify row counts match"),console.log(" 6. Swap repaired DB into place"),console.log(""));return}let i=`${e}.bak-${Date.now()}`;rt(e,i),_(`Backup created: ${i}`);for(let $ of["-wal","-shm"]){let k=e+$;x(k)&&await N(k)}let{execFileSync:l}=await import("node:child_process"),{openSync:u,closeSync:p,readFileSync:r}=await import("node:fs"),s=`${e}.repaired`,m=`${e}.dump.sql`;try{let $=u(m,"w");try{l("sqlite3",[e,".dump"],{stdio:["ignore",$,"pipe"],timeout:12e4})}finally{p($)}l("sqlite3",[s],{input:r(m),stdio:["pipe","pipe","pipe"],timeout:12e4}),l("sqlite3",[s,"PRAGMA journal_mode=WAL;"],{stdio:"pipe"})}catch($){throw x(s)&&await N(s),x(m)&&await N(m),new Error(`sqlite3 dump/reimport failed: ${$ instanceof Error?$.message:"unknown"}. Is sqlite3 installed?`)}let d=await U(s);if(!d.valid)throw x(m)&&await N(m),new Error(`Repaired DB still has integrity issues: ${d.message}. Backup preserved at ${i}`);let h={},f=E(s,{readonly:!0}),y=f.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name NOT LIKE 'sqlite_%'").all();for(let $ of y)try{let k=f.prepare(`SELECT COUNT(*) as count FROM "${$.name}"`).get();h[$.name]=k.count}catch{}f.close();let b=Object.values(h).reduce(($,k)=>$+k,0);Ve(e,`${e}.pre-repair`),Ve(s,e),x(m)&&await N(m),t.json?w({status:"repaired",backupPath:i,rowsBefore:g,rowsAfter:b,tablesRepaired:Object.keys(h).length,rowCounts:h}):(P("Database repaired successfully!"),console.log(` Backup: ${i}`),console.log(` Rows before: ${g}`),console.log(` Rows after: ${b}`),b<g&&console.log(o.yellow(` Warning: ${g-b} rows may have been lost due to data page corruption`)),console.log(` Tables: ${Object.keys(h).length}`),console.log(` Integrity: ${o.green("OK")}`),console.log(""));return}catch(e){throw v(`repair failed: ${e instanceof Error?e.message:"unknown"}`),e}})}function Et(a){switch(a){case"sublinear":return{arrow:"\u25B2",label:"Sublinear (learning)",color:o.green};case"linear":return{arrow:"\u2192",label:"Linear (stagnating)",color:o.yellow};case"superlinear":return{arrow:"\u25BC",label:"Superlinear (degrading)",color:o.red};default:return{arrow:"?",label:"Insufficient data",color:o.dim}}}function xt(a){a.command("health").description("Display per-domain learning health based on regret tracking").option("--json","Output as JSON").option("--domain <domain>","Filter to a specific domain").action(async t=>{try{let e=O(),n=S.join(e,".agentic-qe","memory.db");if(!x(n))throw new Error('Database not found. Run "aqe init --auto" first.');let c=De(),g=E(n,{readonly:!0});if(g.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='captured_experiences'").get()){let s=t.domain?"AND domain = ?":"",m=[];t.domain&&m.push(t.domain);let d=g.prepare(`
|
|
114
115
|
SELECT domain, quality, success, started_at
|
|
115
116
|
FROM captured_experiences
|
|
116
117
|
WHERE agent != 'cli-hook'
|
|
@@ -118,14 +119,14 @@ Dry run \u2014 would perform these steps:`)),console.log(" 1. Backup corrupted
|
|
|
118
119
|
AND domain != ''
|
|
119
120
|
${s}
|
|
120
121
|
ORDER BY started_at ASC
|
|
121
|
-
`).all(...m);for(let
|
|
122
|
+
`).all(...m);for(let h of d){let f=h.quality??(h.success?1:0);c.recordDecision(h.domain,f,1)}}g.close();let l=c.getHealthSummary();if(t.json){w(l);return}if(console.log(""),console.log(o.bold("Learning Health Dashboard:")),l.length===0){console.log(o.dim(" No domain data available. Run some QE tasks to generate learning data.")),console.log("");return}let u=Math.max(...l.map(s=>s.domain.length),20);for(let s of l){let{arrow:m,label:d,color:h}=Et(s.growthRate),f=D(s.domain+":",u+1),y=h(`${m} ${D(d,26)}`),b=`regret: ${s.cumulativeRegret.toFixed(1)}`,$=`decisions: ${s.totalDecisions}`;console.log(` ${f} ${y} ${b} ${$}`)}let p=l.filter(s=>s.stagnating);p.length>0&&(console.log(""),console.log(o.yellow(` Warning: ${p.length} domain(s) showing stagnation: ${p.map(s=>s.domain).join(", ")}`)));let r=l.filter(s=>s.growthRate==="sublinear");r.length>0&&console.log(o.green(` ${r.length} domain(s) actively learning`)),console.log("");return}catch(e){throw v(`health check failed: ${e instanceof Error?e.message:"unknown"}`),e}})}var kt={bridge:3e4,learningWorker:2*36e5,dreamScheduler:2*36e5};function Rt(a){a.command("loop-health").description("Show pipeline component liveness for the self-learning loop").option("--json","Output as JSON").action(async t=>{try{let e=O(),n=S.join(e,".agentic-qe","memory.db");if(!x(n))throw new Error('Database not found. Run "aqe init --auto" first.');let c=E(n,{readonly:!0}),g;try{g=c.prepare("SELECT value FROM kv_store WHERE key = 'learning:loop-health' LIMIT 1").get()?.value}catch{}let i=null;try{if(c.prepare("PRAGMA table_info(routing_outcomes)").all().some(m=>m.name==="exploration")){let m=c.prepare(`SELECT
|
|
122
123
|
COUNT(*) AS total,
|
|
123
124
|
SUM(CASE WHEN exploration = 1 THEN 1 ELSE 0 END) AS explore,
|
|
124
125
|
AVG(criticality) AS avgCrit,
|
|
125
126
|
AVG(q_weight) AS avgQ
|
|
126
127
|
FROM routing_outcomes
|
|
127
|
-
WHERE created_at >= datetime('now', '-7 days')`).get(),d=m.total??0,
|
|
128
|
+
WHERE created_at >= datetime('now', '-7 days')`).get(),d=m.total??0,h=m.explore??0,f=d-h,y=c.prepare(`SELECT AVG(quality_score) AS avgQ FROM routing_outcomes
|
|
128
129
|
WHERE exploration = 0 AND quality_score >= 0
|
|
129
130
|
AND created_at >= datetime('now', '-7 days')`).get(),b=c.prepare(`SELECT AVG(quality_score) AS avgQ FROM routing_outcomes
|
|
130
131
|
WHERE exploration = 1 AND quality_score >= 0
|
|
131
|
-
AND created_at >= datetime('now', '-7 days')`).get();i={totalDecisions:d,explorationCount:
|
|
132
|
+
AND created_at >= datetime('now', '-7 days')`).get();i={totalDecisions:d,explorationCount:h,exploitCount:f,explorationRate:d>0?h/d:0,avgQualityExploit:y.avgQ,avgQualityExplore:b.avgQ,avgCriticality:m.avgCrit,avgQWeight:m.avgQ}}}catch{}c.close();let l=null;if(g)try{l=Q(g)}catch{l=null}let u=Date.now(),p=(r,s)=>{let m=kt[r]??6e5;return!s||!s.lastSuccessAt?"never-ran":u-new Date(s.lastSuccessAt).getTime()>m?"stale":"live"};if(t.json){if(!l){w({overallLastSuccess:null,bootedAt:null,components:{},verdicts:{},routingDiversification:i,note:"No loop-health record yet. Workers must run at least once for this to populate."});return}let r={};for(let s of Object.keys(l.components))r[s]=p(s,l.components[s]);w({...l,verdicts:r,routingDiversification:i});return}if(console.log(""),console.log(o.bold("Self-Learning Loop Health")),console.log(""),!l)console.log(o.dim(" No loop-health record yet.")),console.log(o.dim(" Workers must run at least once to populate.")),console.log(o.dim(" Start the daemon: aqe daemon start"));else{console.log(` Booted at: ${o.dim(l.bootedAt)}`),console.log(` Last success (any): ${l.overallLastSuccess||o.dim("(none yet)")}`),console.log(""),console.log(o.bold(" Components:"));let r=[["bridge","CapturedExperienceBridge"],["learningWorker","LearningConsolidationWorker"],["dreamScheduler","DreamScheduler"]];for(let[m,d]of r){let h=l.components[m],f=p(m,h),y=f==="live"?o.green("\u25CF live"):f==="stale"?o.yellow("\u25CF stale"):o.dim("\u25CB never-ran"),b=h?.lastSuccessAt||o.dim("(never)"),$=h?`${h.successesSinceBoot}/${h.ticksSinceBoot} ticks ok`:o.dim("no ticks");console.log(` ${d.padEnd(32)} ${y.padEnd(20)} ${$}`),console.log(` ${o.dim("last success:")} ${b}`),h?.lastError&&console.log(` ${o.red("last error:")} ${h.lastError.message} ${o.dim("(at "+h.lastError.at+")")}`)}let s=r.filter(([m,d])=>p(m,l.components[m])==="stale");s.length>0&&(console.log(""),console.log(o.yellow(` Warning: ${s.length} component(s) stale \u2014 daemon may not be running or the loop is wedged.`)))}if(i&&i.totalDecisions>0){console.log(""),console.log(o.bold(" Routing diversification (last 7 days):"));let r=(i.explorationRate*100).toFixed(1);if(console.log(` Decisions: ${i.totalDecisions} (${i.exploitCount} exploit, ${i.explorationCount} explore = ${r}%)`),i.avgQualityExploit!==null&&i.avgQualityExplore!==null){let s=i.avgQualityExplore-i.avgQualityExploit,m=s>=0?o.green(`+${s.toFixed(3)}`):o.red(s.toFixed(3));console.log(` Avg quality: exploit=${i.avgQualityExploit.toFixed(3)}, explore=${i.avgQualityExplore.toFixed(3)} (\u0394 ${m})`)}i.avgCriticality!==null&&console.log(` Avg mincut multiplier: ${i.avgCriticality.toFixed(2)} (1.0=full rate, 0.2=critical-topology dampening)`),i.avgQWeight!==null&&i.avgQWeight>0&&console.log(` Avg Q-weight: ${i.avgQWeight.toFixed(3)} (0=cold start, ${.4} max)`)}console.log("");return}catch(e){throw v(`loop-health failed: ${e instanceof Error?e.message:"unknown"}`),e}})}export{kn as createLearningCommand,C as initializeLearningSystem};
|