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
|
@@ -18,6 +18,10 @@
|
|
|
18
18
|
* A `defect:predictions` record without
|
|
19
19
|
* the measured stamp (the invented one written by <= 3.15.6) is ignored and
|
|
20
20
|
* replaced by the next measured run.
|
|
21
|
+
*
|
|
22
|
+
* #1137: the latest run of every target is reported, so predicting `src/b`
|
|
23
|
+
* after `src/a` keeps `src/a`'s files; a file named by several targets takes
|
|
24
|
+
* its prediction from the newest run that names it.
|
|
21
25
|
*/
|
|
22
26
|
import * as fs from 'fs';
|
|
23
27
|
import * as path from 'path';
|
|
@@ -85,7 +89,7 @@ export class DefectPredictorWorker extends BaseWorker {
|
|
|
85
89
|
context.logger.info('Starting defect prediction analysis');
|
|
86
90
|
const findings = [];
|
|
87
91
|
const recommendations = [];
|
|
88
|
-
const { measured: latest, unusable } = await this.readLatestPrediction(context);
|
|
92
|
+
const { measured: latest, unusable, estimatedFiles } = await this.readLatestPrediction(context);
|
|
89
93
|
if (!latest) {
|
|
90
94
|
findings.push({
|
|
91
95
|
type: 'defect-prediction-unmeasured',
|
|
@@ -106,9 +110,11 @@ export class DefectPredictorWorker extends BaseWorker {
|
|
|
106
110
|
return this.createResult(Date.now() - startTime, {
|
|
107
111
|
itemsAnalyzed: 0,
|
|
108
112
|
issuesFound: 0,
|
|
109
|
-
|
|
113
|
+
// #1137: nothing was measured, so there is no health to report.
|
|
114
|
+
healthScore: null,
|
|
110
115
|
trend: 'stable',
|
|
111
116
|
domainMetrics: {
|
|
117
|
+
health: 'unmeasured',
|
|
112
118
|
filesAnalyzed: 0,
|
|
113
119
|
highRiskFiles: 0,
|
|
114
120
|
hotspots: 'unmeasured',
|
|
@@ -117,6 +123,13 @@ export class DefectPredictorWorker extends BaseWorker {
|
|
|
117
123
|
}, findings, recommendations);
|
|
118
124
|
}
|
|
119
125
|
const { predictions } = latest;
|
|
126
|
+
if (latest.ambiguousTargetsSkipped) {
|
|
127
|
+
findings.push({
|
|
128
|
+
type: 'defect-prediction-ambiguous', severity: 'info', domain: 'defect-intelligence',
|
|
129
|
+
title: 'Ambiguous Defect Prediction',
|
|
130
|
+
description: `${latest.ambiguousTargetsSkipped} predicted targets have several latest runs with the same timestamp, so their files are not reported. Run defect_predict on them again to assess.`,
|
|
131
|
+
});
|
|
132
|
+
}
|
|
120
133
|
if (latest.filesSkipped) {
|
|
121
134
|
findings.push({
|
|
122
135
|
type: 'defect-prediction-partial', severity: 'info', domain: 'defect-intelligence',
|
|
@@ -124,7 +137,7 @@ export class DefectPredictorWorker extends BaseWorker {
|
|
|
124
137
|
description: `${latest.filesSkipped} source files could not be read; risk estimates cover only ${predictions.length} successfully analyzed files.`,
|
|
125
138
|
});
|
|
126
139
|
}
|
|
127
|
-
this.analyzeHighRiskPredictions(predictions, findings, recommendations,
|
|
140
|
+
this.analyzeHighRiskPredictions(predictions, findings, recommendations, estimatedFiles);
|
|
128
141
|
await context.memory.set(PREDICTIONS_KEY, latest);
|
|
129
142
|
await context.memory.set('defect:lastAnalysis', latest.evaluatedAt);
|
|
130
143
|
const healthScore = this.calculateHealthScore(predictions);
|
|
@@ -147,6 +160,7 @@ export class DefectPredictorWorker extends BaseWorker {
|
|
|
147
160
|
highRiskFiles: highRisk,
|
|
148
161
|
missingFilesSkipped: latest.missingFilesSkipped,
|
|
149
162
|
outsideProjectSkipped: latest.outsideProjectSkipped,
|
|
163
|
+
targetsReported: latest.runs.length,
|
|
150
164
|
hotspots: 'unmeasured',
|
|
151
165
|
avgDefectProbability: (predictions.reduce((sum, p) => sum + p.probability, 0) / predictions.length).toFixed(2),
|
|
152
166
|
},
|
|
@@ -168,69 +182,116 @@ export class DefectPredictorWorker extends BaseWorker {
|
|
|
168
182
|
});
|
|
169
183
|
}
|
|
170
184
|
/**
|
|
171
|
-
* #1043: the most recent prediction
|
|
185
|
+
* #1043: the most recent prediction runs the defect-intelligence predictor
|
|
172
186
|
* recorded, restricted to regular files whose real path is inside the
|
|
173
|
-
* project root.
|
|
174
|
-
*
|
|
175
|
-
*
|
|
187
|
+
* project root. #1137: the latest run of each target contributes, and a
|
|
188
|
+
* file takes its prediction from the newest run naming it. `measured` is
|
|
189
|
+
* `null` when no file qualifies; `unusable` then describes the newest run
|
|
190
|
+
* (or its ambiguous timestamp).
|
|
176
191
|
*/
|
|
177
192
|
async readLatestPrediction(context) {
|
|
178
193
|
const keys = await context.memory.search(PREDICTION_KEY_PATTERN, Number.MAX_SAFE_INTEGER, { namespace: DEFECT_NAMESPACE });
|
|
179
194
|
const now = Date.now();
|
|
180
|
-
|
|
181
|
-
let ambiguous = false;
|
|
195
|
+
const byTarget = new Map();
|
|
182
196
|
for (const found of keys) {
|
|
183
197
|
// #1049: the in-memory backend returns `<namespace>:<key>` from a namespaced search.
|
|
184
198
|
const key = bareSearchKey(found, DEFECT_NAMESPACE, PREDICTION_KEY_PATTERN);
|
|
185
199
|
const parsed = parsePredictionRecord(await context.memory.get(key, { namespace: DEFECT_NAMESPACE }), now);
|
|
186
200
|
if (!parsed)
|
|
187
201
|
continue;
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
ambiguous
|
|
202
|
+
const current = byTarget.get(parsed.target);
|
|
203
|
+
if (!current || Date.parse(parsed.timestamp) > Date.parse(current.run.timestamp)) {
|
|
204
|
+
byTarget.set(parsed.target, { run: parsed, ambiguous: false });
|
|
205
|
+
}
|
|
206
|
+
else if (Date.parse(parsed.timestamp) === Date.parse(current.run.timestamp) && parsed.id !== current.run.id) {
|
|
207
|
+
// Timestamp precision cannot establish ordering between concurrent runs.
|
|
208
|
+
// Never let backend key ordering decide whether the current scan is clean.
|
|
209
|
+
current.ambiguous = true;
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
const estimatedFiles = new Set();
|
|
213
|
+
const latestRuns = [...byTarget.values()]
|
|
214
|
+
.sort((a, b) => Date.parse(b.run.timestamp) - Date.parse(a.run.timestamp));
|
|
215
|
+
if (latestRuns.length === 0)
|
|
216
|
+
return { measured: null, unusable: null, estimatedFiles };
|
|
217
|
+
const realRoot = realProjectRoot();
|
|
218
|
+
const claimed = new Set();
|
|
219
|
+
const contributing = [];
|
|
220
|
+
let outside = 0;
|
|
221
|
+
let missing = 0;
|
|
222
|
+
let ambiguousTargets = 0;
|
|
223
|
+
let newestCounts = { outside: 0, missing: 0 };
|
|
224
|
+
for (const [index, { run, ambiguous }] of latestRuns.entries()) {
|
|
225
|
+
if (ambiguous) {
|
|
226
|
+
ambiguousTargets++;
|
|
227
|
+
continue;
|
|
191
228
|
}
|
|
192
|
-
|
|
193
|
-
|
|
229
|
+
const disposition = run.predictions.map((p) => classifyPredictedFile(p.file, realRoot));
|
|
230
|
+
const runOutside = disposition.filter((d) => d === 'outside').length;
|
|
231
|
+
const runMissing = disposition.filter((d) => d === 'missing').length;
|
|
232
|
+
outside += runOutside;
|
|
233
|
+
missing += runMissing;
|
|
234
|
+
if (index === 0)
|
|
235
|
+
newestCounts = { outside: runOutside, missing: runMissing };
|
|
236
|
+
if (runOutside > 0) {
|
|
237
|
+
context.logger.warn('Ignoring defect predictions for paths outside the project root', { predictionId: run.id, outside: runOutside });
|
|
194
238
|
}
|
|
239
|
+
const files = run.predictions.filter((p, i) => {
|
|
240
|
+
if (disposition[i] !== 'inside')
|
|
241
|
+
return false;
|
|
242
|
+
const identity = path.resolve(realRoot, p.file);
|
|
243
|
+
if (claimed.has(identity))
|
|
244
|
+
return false;
|
|
245
|
+
claimed.add(identity);
|
|
246
|
+
return true;
|
|
247
|
+
});
|
|
248
|
+
if (files.length > 0)
|
|
249
|
+
contributing.push({ run, files });
|
|
195
250
|
}
|
|
196
|
-
if (
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
// Never let backend key ordering decide whether the current scan is clean.
|
|
200
|
-
if (ambiguous)
|
|
251
|
+
if (contributing.length === 0) {
|
|
252
|
+
const newest = latestRuns[0];
|
|
253
|
+
context.logger.info('Latest defect predictions name no file inside the project', { predictionId: newest.run.id });
|
|
201
254
|
return {
|
|
202
255
|
measured: null,
|
|
203
|
-
unusable:
|
|
256
|
+
unusable: newest.ambiguous
|
|
257
|
+
? { id: `ambiguous:${newest.run.timestamp}`, outside: 0, missing: 0, ambiguous: true }
|
|
258
|
+
: { id: newest.run.id, ...newestCounts },
|
|
259
|
+
estimatedFiles,
|
|
204
260
|
};
|
|
205
|
-
const realRoot = realProjectRoot();
|
|
206
|
-
const disposition = latest.predictions.map((p) => classifyPredictedFile(p.file, realRoot));
|
|
207
|
-
const existing = latest.predictions.filter((_, i) => disposition[i] === 'inside');
|
|
208
|
-
const outside = disposition.filter((d) => d === 'outside').length;
|
|
209
|
-
const missing = disposition.filter((d) => d === 'missing').length;
|
|
210
|
-
if (outside > 0) {
|
|
211
|
-
context.logger.warn('Ignoring defect predictions for paths outside the project root', { predictionId: latest.id, outside });
|
|
212
|
-
}
|
|
213
|
-
if (existing.length === 0) {
|
|
214
|
-
context.logger.info('Latest defect prediction names no file inside the project', { predictionId: latest.id });
|
|
215
|
-
return { measured: null, unusable: { id: latest.id, outside, missing } };
|
|
216
261
|
}
|
|
217
|
-
|
|
262
|
+
const estimatedRuns = contributing.filter(({ run }) => run.estimated);
|
|
263
|
+
for (const { files } of estimatedRuns)
|
|
264
|
+
files.forEach((p) => estimatedFiles.add(p));
|
|
265
|
+
const newest = contributing[0].run;
|
|
266
|
+
return { unusable: null, estimatedFiles, measured: {
|
|
218
267
|
measured: true,
|
|
219
268
|
schemaVersion: SCHEMA_VERSION,
|
|
220
269
|
source: 'defect-intelligence',
|
|
221
|
-
predictionId:
|
|
222
|
-
...(
|
|
223
|
-
|
|
270
|
+
predictionId: newest.id,
|
|
271
|
+
...(estimatedRuns.length > 0 ? {
|
|
272
|
+
estimated: true, predictionMethod: 'static-code-indicators',
|
|
273
|
+
filesSkipped: estimatedRuns.reduce((sum, { run }) => sum + (run.filesSkipped ?? 0), 0),
|
|
274
|
+
} : {}),
|
|
275
|
+
predictedAt: newest.timestamp,
|
|
224
276
|
evaluatedAt: new Date().toISOString(),
|
|
225
|
-
predictions:
|
|
277
|
+
predictions: contributing.flatMap(({ files }) => files),
|
|
278
|
+
runs: contributing.map(({ run, files }) => ({
|
|
279
|
+
predictionId: run.id,
|
|
280
|
+
...(run.target ? { target: run.target } : {}),
|
|
281
|
+
predictedAt: run.timestamp,
|
|
282
|
+
files: files.length,
|
|
283
|
+
...(run.estimated ? { estimated: true } : {}),
|
|
284
|
+
})),
|
|
226
285
|
missingFilesSkipped: missing,
|
|
227
286
|
outsideProjectSkipped: outside,
|
|
287
|
+
...(ambiguousTargets > 0 ? { ambiguousTargetsSkipped: ambiguousTargets } : {}),
|
|
228
288
|
} };
|
|
229
289
|
}
|
|
230
|
-
analyzeHighRiskPredictions(predictions, findings, recommendations,
|
|
290
|
+
analyzeHighRiskPredictions(predictions, findings, recommendations, estimatedFiles) {
|
|
231
291
|
const critical = predictions.filter(p => p.riskLevel === 'critical');
|
|
232
292
|
const high = predictions.filter(p => p.riskLevel === 'high');
|
|
233
293
|
for (const prediction of [...critical, ...high]) {
|
|
294
|
+
const estimated = estimatedFiles.has(prediction);
|
|
234
295
|
const name = prediction.file.split(/[\\/]/).pop();
|
|
235
296
|
findings.push({
|
|
236
297
|
type: `${prediction.riskLevel}-defect-risk`,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "agentic-qe",
|
|
3
|
-
"version": "3.15.
|
|
3
|
+
"version": "3.15.18",
|
|
4
4
|
"description": "Agentic Quality Engineering V3 - Domain-Driven Design Architecture with 13 Bounded Contexts, O(log n) coverage analysis, ReasoningBank learning, 60 specialized QE agents, mathematical Coherence verification, deep Claude Flow integration",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -1,2 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a,b,c}from"./chunk-E3D4GPLP.js";import"./chunk-VWPM27GU.js";import"./chunk-MD43XRX5.js";import"./chunk-V5NHZV7S.js";import"./chunk-KNSRL6NO.js";import"./chunk-AJMJNQMP.js";export{a as AgentBoosterAdapter,b as createAgentBoosterAdapter,c as createAgentBoosterAdapterSync};
|
|
@@ -1,2 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f}from"./chunk-UNGBRZDK.js";import"./chunk-FDDC72IA.js";import"./chunk-4LQFBY5L.js";import"./chunk-KU2AUFGX.js";import"./chunk-5B5QPCNU.js";import"./chunk-PHT5N7SC.js";import"./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"./chunk-KVF4NXGQ.js";import"./chunk-IOKYCMTJ.js";import"./chunk-HGWXF45W.js";import"./chunk-VJCIEHEF.js";import"./chunk-MO55CVMT.js";import"./chunk-CEYSYSK5.js";import"./chunk-WP4RETKG.js";import"./chunk-JDIYMZCQ.js";import"./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"./chunk-M4FRQ4TE.js";import"./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"./chunk-AGRV5B3T.js";import"./chunk-U2A7NHZA.js";import"./chunk-I7MQIM2U.js";import"./chunk-ZFL436FN.js";import"./chunk-KPRCB5LT.js";import"./chunk-KNSRL6NO.js";import"./chunk-2H4XH6FT.js";import"./chunk-AJMJNQMP.js";export{b as AQELearningEngine,a as DEFAULT_ENGINE_CONFIG,c as DEFAULT_META_LEARNING_CONFIG,d as MetaLearningEngine,e as createAQELearningEngine,f as createDefaultLearningEngine};
|
|
@@ -1,2 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a,b,c,d,e,f,g,h,i,j,k,l}from"./chunk-GAHNO6JJ.js";import"./chunk-SUDMM5SO.js";import"./chunk-JQ3DYUMS.js";import"./chunk-HGWXF45W.js";import"./chunk-MO55CVMT.js";import"./chunk-CEYSYSK5.js";import"./chunk-WP4RETKG.js";import"./chunk-JDIYMZCQ.js";import"./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"./chunk-FLNAW7C4.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-AGRV5B3T.js";import"./chunk-U2A7NHZA.js";import"./chunk-KPRCB5LT.js";import"./chunk-KNSRL6NO.js";import"./chunk-2H4XH6FT.js";import"./chunk-AJMJNQMP.js";export{l as MCPToolBase,k as defaultToolLogger,j as getKernel,i as getLLMRouter,e as getMemoryBackend,g as getSharedLLMRouter,c as getSharedMemoryBackend,a as isMemoryOnlyMode,b as registerRvfResetFn,h as resetSharedLLMRouter,d as resetSharedMemoryBackend,f as setSharedLLMRouter};
|
|
@@ -1,95 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a as P,b as z,c as G,d as C,e as fe,f as U,g as X,h as N,i as me,j as ue,k as Q,l as De,m as K,n as pe,o as Te,p as j,q as Y,r as Z,s as ee,t as ne}from"./chunk-SASBO5Y5.js";import{c as $e}from"./chunk-63ZKI4PX.js";import{b as Ne}from"./chunk-5LAVKGLH.js";import{a as ke,d as de,e as Ae}from"./chunk-IOQ6ZQ5W.js";import"./chunk-MO55CVMT.js";import"./chunk-CEYSYSK5.js";import"./chunk-WP4RETKG.js";import"./chunk-JDIYMZCQ.js";import{b as $,d as ce}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"./chunk-FLNAW7C4.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-AGRV5B3T.js";import"./chunk-U2A7NHZA.js";import{a as Ie,b as Oe,c as H,d as W,f as pn}from"./chunk-ZFL436FN.js";import{d as q,e as gn}from"./chunk-KPRCB5LT.js";import"./chunk-KNSRL6NO.js";import"./chunk-2H4XH6FT.js";import"./chunk-AJMJNQMP.js";import M from"path";import o from"chalk";gn();ce();import{existsSync as re,mkdirSync as yn,writeFileSync as bn,readFileSync as ge}from"fs";import{join as T,resolve as ye}from"path";function te(e,n){let r="shake256",t=JSON.stringify(n),a=e.prepare("SELECT * FROM witness_chain ORDER BY id DESC LIMIT 1").get(),i=a?de(r,Ae(a)):ke;e.prepare(`
|
|
3
|
-
INSERT INTO witness_chain
|
|
4
|
-
(prev_hash, action_hash, action_type, action_data, timestamp, actor, hash_algo)
|
|
5
|
-
VALUES (?, ?, 'BRAIN_IMPORT', ?, ?, 'brain-import', ?)
|
|
6
|
-
`).run(i,de(r,t),t,new Date().toISOString(),r)}var hn={rl_q_values:"includeQValues",dream_insights:"includeDreamInsights",dream_cycles:"includeDreamInsights",witness_chain:"includeWitnessChain",vectors:"includeVectors"};function Rn(e,n){let r=hn[e.tableName];return!(r&&n[r]===!1)}var wn=1e4;function vn(e,n,r,t){if(!Rn(n,r))return pe(T(t,n.fileName),[]),{count:0,rows:[]};let[a,i]=n.domainColumn?K(r.domains,n.domainColumn):[void 0,[]];if(r.domains&&r.domains.length>0&&!n.domainColumn){let d=r.domains.map(()=>"?").join(","),c=`manifest_id IN (SELECT id FROM learning_evidence_manifests WHERE task_family IN (${d}))`;["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(n.tableName)?(a=c,i=[...r.domains]):["pattern_manifest_lineage","pattern_segment_lineage"].includes(n.tableName)&&(a=`${c} AND pattern_id IN (SELECT id FROM qe_patterns WHERE qe_domain IN (${d}))`,i=[...r.domains,...r.domains])}if(ue(e,n.tableName,a,i)>=wn){let d=n.blobColumns,c=d&&d.length>0?p=>U(p,d):void 0;return{count:Te(T(t,n.fileName),De(e,n.tableName,a,i),c)}}let s=Q(e,n.tableName,a,i);return n.blobColumns&&n.blobColumns.length>0&&(s=s.map(d=>U(d,n.blobColumns))),pe(T(t,n.fileName),s),{count:s.length,rows:s}}function Me(e){let n=[];for(let r of C){let t=T(e,r.fileName);re(t)?n.push(N(ge(t,"utf-8"))):n.push(N(""))}return N(n.join(":"))}function Fe(e,n,r="memory.db"){let t=ye(n.outputPath);re(t)||yn(t,{recursive:!0});let a=0,i={},l=new Set;for(let m of C){let p=vn(e,m,n,t);if(i[m.tableName]=p.count,a+=p.count,m.tableName==="qe_patterns"){if(p.rows)for(let h of p.rows)h.qe_domain&&l.add(h.qe_domain);else if(p.count>0){let[h,B]=m.domainColumn?K(n.domains,m.domainColumn):[void 0,[]],f=`SELECT DISTINCT qe_domain FROM qe_patterns ${h?`WHERE ${h} AND qe_domain IS NOT NULL`:"WHERE qe_domain IS NOT NULL"}`;try{let R=e.prepare(f).all(...B||[]);for(let y of R)l.add(y.qe_domain)}catch{}}}}let s=n.includeVectors!==!1?ue(e,"vectors"):0,d=Me(t),c={version:"3.0",exportedAt:new Date().toISOString(),sourceDb:r,stats:{patternCount:i.qe_patterns||0,vectorCount:s,qValueCount:i.rl_q_values||0,dreamInsightCount:i.dream_insights||0,witnessChainLength:i.witness_chain||0,totalRecords:a},domains:[...l].sort(),checksum:d,tableRecordCounts:i};return bn(T(t,"manifest.json"),JSON.stringify(c,null,2),"utf-8"),c}var Sn=new Set(["qe_patterns","rl_q_values","dream_insights","witness_chain"]);function _n(e){return e==="1.0"?C.filter(n=>Sn.has(n.tableName)):e==="3.0"?C:(console.warn(`[brain-import] Unknown manifest version '${e}'. Attempting full import \u2014 some files may be missing.`),C)}function Le(e,n,r){let t=ye(n),a=T(t,"manifest.json");if(!re(a))throw new Error(`Manifest not found at ${a}`);let i=$(ge(a,"utf-8")),l=Me(t);if(l!==i.checksum)throw new Error(`Checksum mismatch: expected ${i.checksum}, got ${l}. The export may have been tampered with or corrupted.`);let s=_n(i.version),d=0,c=0,m=0,p=()=>{let h=new Map,B=new Map,g=0;for(let f of s){let R=T(t,f.fileName),y=j(R,$);if(f.tableName==="witness_chain"){g+=y.length,c+=y.length;continue}f.blobColumns&&f.blobColumns.length>0&&(y=y.map(b=>X(b,f.blobColumns)));for(let b of y){let k=Y(b,h),w;if(f.dedupColumns&&f.dedupColumns.length>0)w=ee(e,f.tableName,k,f.dedupColumns,f.preserveId);else{let D=P[f.tableName]||"id",u=G[f.tableName],I=z[f.tableName];w=Z(e,f.tableName,k,D,r.mergeStrategy,u,I,h,B,b.pattern_id)}d+=w.imported,c+=w.skipped,m+=w.conflicts}}te(e,{sourceChecksum:i.checksum,sourceWitnessRows:g,importedRecords:d,skippedRecords:c,conflicts:m}),d+=1};return ne(e,r.dryRun??!1,p),{imported:d,skipped:c,conflicts:m}}function qe(e){let n=ye(e),r=T(n,"manifest.json");if(!re(r))throw new Error(`Manifest not found at ${r}`);return $(ge(r,"utf-8"))}pn();import{existsSync as V,readdirSync as En,renameSync as Cn,statSync as xn,unlinkSync as he,writeFileSync as Bn}from"fs";import{basename as In,dirname as On,join as Nn,resolve as ie}from"path";var kn=128*1024*1024,oe="code-intelligence:",Pe=`substr(id, 1, ${oe.length}) = ?`;function An(e,n){if(e!=="vectors")return!1;let r=n.id;return typeof r=="string"&&r.startsWith(oe)}var ae=class extends Error{constructor(r,t,a,i){let l=Object.entries(a).filter(([,s])=>s>=1048576).sort((s,d)=>d[1]-s[1]).slice(0,3).map(([s,d])=>`${s} ${be(d)}`).join(", ");super(`RVF_KERNEL_TOO_LARGE: the brain kernel needs ${i?"":"at least "}${be(r)}, over the ${be(t)} limit of the native RVF writer.`+(l?` Largest tables: ${l}.`:"")+" Nothing was written. Use --format jsonl (no size limit), or reduce the largest learning tables first.");this.kernelBytes=r;this.limitBytes=t;this.tableBytes=a;this.complete=i;this.name="RvfKernelTooLargeError"}kernelBytes;limitBytes;tableBytes;complete;code="RVF_KERNEL_TOO_LARGE"};function be(e){return`${(e/(1024*1024)).toFixed(1)} MB`}var Ve=["",".idmap.json",".manifest.json"],$n=[...Ve,".lock"];function je(e){for(let n of $n)try{let r=`${e}${n}`;V(r)&&he(r)}catch{}}function Dn(e){let n=On(e),r=`${In(e)}.tmp.`,t;try{t=En(n)}catch{return}for(let a of t){if(!a.startsWith(r))continue;let i=Number.parseInt(a.slice(r.length).split(".")[0],10);if(!(!Number.isInteger(i)||i<=0)&&!(i!==process.pid&&Tn(i)))try{he(Nn(n,a))}catch{}}}function Tn(e){try{return process.kill(e,0),!0}catch(n){return n.code==="EPERM"}}function Je(e,n,r="memory.db"){if(!W())throw new Error("@ruvector/rvf-node is not available. Install it or use --format jsonl instead.");let t=ie(n.outputPath),a=n.dimension??384,i=`${t}.tmp.${process.pid}`;Dn(t),je(i);let l=n.maxKernelBytes??kn,s={},d=[],c={},m={},p={},h=new Set,B=0,g=0;for(let u of C){let[I,A]=u.domainColumn?K(n.domains,u.domainColumn):[void 0,[]];if(u.tableName==="vectors"&&me(e,"vectors")){let{n:x}=e.prepare(`SELECT COUNT(*) AS n FROM vectors WHERE ${Pe}`).get(oe);x>0&&(p.vectors=x),I=`(id IS NULL OR NOT ${Pe})`,A=[oe]}let _=Q(e,u.tableName,I,A);if(n.domains&&n.domains.length>0){let x=new Set((s.learning_evidence_manifests??[]).map(v=>v.id)),L=new Set((s.qe_patterns??[]).map(v=>v.id));["learning_evidence_segments","learning_segment_edges","learning_evidence_admissions"].includes(u.tableName)?_=_.filter(v=>x.has(v.manifest_id)):u.tableName==="pattern_manifest_lineage"?_=_.filter(v=>{let S=v;return x.has(S.manifest_id)&&L.has(S.pattern_id)}):u.tableName==="pattern_segment_lineage"&&(_=_.filter(v=>{let S=v;return x.has(S.manifest_id)&&L.has(S.pattern_id)}))}if(u.tableName==="qe_patterns")for(let x of _)x.qe_domain&&h.add(x.qe_domain);let F=fe[u.tableName];F&&F.length>0&&(_=_.map(x=>U(x,F))),(u.tableName==="qe_patterns"||u.tableName==="learning_evidence_manifests")&&(s[u.tableName]=_),m[u.tableName]=_.length,B+=_.length;let J=JSON.stringify(_);if(d.push([u.tableName,J]),c[u.tableName]=Buffer.byteLength(J),g+=c[u.tableName],g>l)throw new ae(g,l,c,!1)}let f=new Date().toISOString(),R=[...h].sort(),y=`{"version":"3.0","format":"rvf","exportedAt":${JSON.stringify(f)},"sourceDb":${JSON.stringify(r)},"domains":${JSON.stringify(R)},"tables":{`+d.map(([u,I])=>`${JSON.stringify(u)}:${I}`).join(",")+"}}";d.length=0;let b=Buffer.from(y);if(b.length>l)throw new ae(b.length,l,c,!0);let k=N(y),w=Ie(i,a),D=!1;try{let u=0,I=[];if(me(e,"qe_pattern_embeddings")){let v=e.prepare("PRAGMA table_info('qe_pattern_embeddings')").all().some(E=>E.name==="space_id"),S=e.prepare(`SELECT pattern_id, embedding, dimension, ${v?"space_id":"NULL"} AS space_id
|
|
7
|
-
FROM qe_pattern_embeddings`).all();for(let E of S)E.embedding&&E.dimension===a&&E.space_id&&I.push({id:`pe:${E.pattern_id}`,vector:new Float32Array(E.embedding.buffer,E.embedding.byteOffset,a),metadata:{tableName:"qe_pattern_embeddings",spaceId:E.space_id}})}I.length>0&&(u=w.ingest(I).accepted),w.embedKernel(b);let A=n.sign?w.sign(b)??void 0:void 0,_=A?n.signerKeyId??"default":void 0,F=w.fileId(),J=F?{fileId:F,parentId:w.parentId(),lineageDepth:w.lineageDepth()}:void 0,x=w.status(),L={version:"3.0",format:"rvf",exportedAt:f,sourceDb:r,stats:{patternCount:m.qe_patterns??0,embeddingCount:u,qValueCount:m.rl_q_values??0,dreamInsightCount:m.dream_insights??0,witnessChainLength:m.witness_chain??0,totalRecords:B,tableCounts:m,...Object.keys(p).length>0?{skippedCacheRows:p}:{}},domains:R,checksum:k,rvfStatus:{totalVectors:x.totalVectors,totalSegments:x.totalSegments,fileSizeBytes:x.fileSizeBytes},...A?{signature:A,signerKeyId:_}:{},...J?{lineage:J}:{}};if(A)try{w.freeze()}catch{}if(Bn(`${i}.manifest.json`,JSON.stringify(L,null,2),"utf-8"),w.close(),D=!0,V(t)&&!n.allowOverwriteRicher){let v;try{v=Ue(t,!0)}catch(S){if(Mn(t)||!Fn(S)){let E=S instanceof Error?S.message:String(S);throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: the existing mirror is readable but its richness could not be established (${E}). Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`)}}if(v){let S=v.stats.tableCounts,E=L.stats.tableCounts,xe=C.map(({tableName:O})=>O).filter(O=>!S||!Number.isSafeInteger(S[O]));if(xe.length>0)throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: existing mirror lacks trustworthy counts for ${xe.join(", ")}. Preserve/import it before retrying, or repeat with --force-overwrite-richer after preserving a backup.`);let Be=C.map(({tableName:O})=>({tableName:O,existing:S[O],candidate:E[O]})).filter(({existing:O,candidate:le})=>O>le);if(Be.length>0){let O=Be.map(({tableName:le,existing:mn,candidate:un})=>`${le} ${mn} -> ${un}`).join(", ");throw new Error(`RVF_MIRROR_RICHER: refusing to replace richer mirrored tables: ${O}. Restore/import the mirror first, or repeat with --force-overwrite-richer after preserving a backup.`)}}}for(let v of[...Ve].reverse()){let S=`${i}${v}`,E=`${t}${v}`;V(S)?Cn(S,E):V(E)&&he(E)}return L}catch(u){if(!D)try{w.close()}catch{}throw je(i),u}}function Mn(e){let n;try{return n=H(ie(e)),!!n.extractKernel()?.image}catch{return!1}finally{try{n?.close()}catch{}}}function Fn(e){let n=e instanceof Error?e.message:String(e);return/ManifestNotFound|InvalidMagic|ChecksumMismatch|CorruptStore/i.test(n)}var Ln={patterns:"qe_patterns",qValues:"rl_q_values",dreamInsights:"dream_insights",witnessChain:"witness_chain"};function We(e,n,r){if(!W())throw new Error("@ruvector/rvf-node is not available. Install it or use JSONL format.");let t=ie(n);if(!V(t))throw new Error(`RVF file not found: ${t}`);let a=r.dryRun?H(t):Oe(t);try{let i=a.verifyWitness();if(!i.valid&&(i.totalEntries>0||i.errors.length>0)){let g=i.errors.length>0?i.errors.join("; "):"unknown integrity error";throw new Error(`RVF witness verification failed: ${g}`)}let l=a.extractKernel();if(!l||!l.image)throw new Error("No brain data found in RVF file (missing kernel segment)");let s;try{s=JSON.parse(l.image.toString("utf-8"))}catch(g){throw new Error(`Failed to parse brain kernel data as JSON: ${g instanceof Error?g.message:g}`)}let d=0,c=0,m=0,p=0,h={};if(s.tables)Object.assign(h,s.tables);else for(let[g,f]of Object.entries(Ln)){let R=s[g];Array.isArray(R)&&(h[f]=R)}let B=()=>{let g=new Map,f=new Map,R=0;for(let y of C){let b=h[y.tableName];if(!b||!Array.isArray(b))continue;if(y.tableName==="witness_chain"){R+=b.length,c+=b.length;continue}let k=fe[y.tableName];k&&k.length>0&&(b=b.map(w=>X(w,k)));for(let w of b){let D=Y(w,g),u;if(y.dedupColumns&&y.dedupColumns.length>0)u=ee(e,y.tableName,D,y.dedupColumns,y.preserveId);else{let I=P[y.tableName]||"id",A=G[y.tableName],_=z[y.tableName];u=Z(e,y.tableName,D,I,r.mergeStrategy,A,_,g,f,w.pattern_id)}if(u.imported)for(let I of k??[])D[I]instanceof Buffer&&p++;d+=u.imported,c+=u.skipped,m+=u.conflicts}}te(e,{sourceChecksum:N(l.image.toString("utf-8")),sourceWitnessRows:R,importedRecords:d,skippedRecords:c,conflicts:m}),d+=1};if(ne(e,r.dryRun??!1,B),!r.dryRun&&m>0)try{a.compact()}catch{}return{imported:d,skipped:c,conflicts:m,embeddingsRestored:p}}finally{a.close()}}function se(e){return Ue(e,!1)}function Ue(e,n){if(!W())throw new Error("@ruvector/rvf-node is not available.");let r=ie(e);if(!V(r))throw new Error(`RVF file not found: ${r}`);let t=H(r);try{let a=t.extractKernel();if(!a||!a.image)throw new Error("No brain data found in RVF file");let i=a.image.toString("utf-8"),l;try{l=JSON.parse(i)}catch(f){throw new Error(`Failed to parse brain kernel data as JSON: ${f instanceof Error?f.message:f}`)}let s=t.status(),d=xn(r).size,c=l.tables,m=c?c.qe_patterns?.length??0:l.patterns?.length??0,p=c?c.rl_q_values?.length??0:l.qValues?.length??0,h=c?c.dream_insights?.length??0:l.dreamInsights?.length??0,B=c?c.witness_chain?.length??0:l.witnessChain?.length??0,g=c&&typeof c=="object"&&!Array.isArray(c)?Object.fromEntries(Object.entries(c).filter(f=>Array.isArray(f[1])).map(([f,R])=>[f,n?R.filter(y=>!An(f,y)).length:R.length])):void 0;return{version:"3.0",format:"rvf",exportedAt:l.exportedAt??"unknown",sourceDb:l.sourceDb??"unknown",stats:{patternCount:m,embeddingCount:s.totalVectors,qValueCount:p,dreamInsightCount:h,witnessChainLength:B,...g?{tableCounts:g}:{}},domains:l.domains??[],checksum:N(i),rvfStatus:{totalVectors:s.totalVectors,totalSegments:s.totalSegments,fileSizeBytes:d}}}finally{t.close()}}function Re(){return W()}ce();import{existsSync as ve,readFileSync as qn,statSync as Pn}from"fs";import{join as we,resolve as Ke}from"path";function Xe(e,n,r={}){let t=Ke(e),a=Ke(n),i=He(t),l=He(a),s=ze(t,i),d=ze(a,l),c=i==="jsonl"&&l==="jsonl",m=Jn({pathA:t,pathB:a,manifestA:s,manifestB:d,recordLevel:c,tableFilter:r.tableFilter,maxIdsPerBucket:r.maxIdsPerBucket??500}),p=new Set(s.domains),h=new Set(d.domains),B=s.domains.filter(b=>!h.has(b)),g=d.domains.filter(b=>!p.has(b)),f=s.checksum===d.checksum,R=s.version===d.version,y=f&&R&&m.every(b=>b.delta===0&&(b.added?.length??0)===0&&(b.removed?.length??0)===0&&(b.changed?.length??0)===0);return{pathA:t,pathB:a,formatA:i,formatB:l,manifestA:s,manifestB:d,checksumMatch:f,versionMatch:R,identical:y,recordLevel:c,tableDiffs:m,domainsOnlyInA:B,domainsOnlyInB:g}}function He(e){if(!ve(e))throw new Error(`Path not found: ${e}`);if(e.endsWith(".rvf"))return"rvf";if(Pn(e).isFile())throw new Error(`Unsupported brain export: ${e} (expected a .rvf file or a JSONL directory)`);return"jsonl"}function ze(e,n){return n==="rvf"?Vn(e):jn(e)}function jn(e){let n=we(e,"manifest.json");if(!ve(n))throw new Error(`Manifest not found at ${n}`);let r=$(qn(n,"utf-8"));return Qe(r,"jsonl")}function Vn(e){let n=se(e);return Qe(n,"rvf")}function Qe(e,n){return{format:n,version:e.version??"unknown",exportedAt:e.exportedAt??"unknown",sourceDb:e.sourceDb??"unknown",checksum:e.checksum??"",totalRecords:e.stats?.totalRecords??0,domains:e.domains??[],tableRecordCounts:e.tableRecordCounts??{}}}function Jn(e){let n=e.tableFilter?C.filter(t=>t.tableName===e.tableFilter):C;if(e.tableFilter&&n.length===0)throw new Error(`Unknown table: ${e.tableFilter}`);let r=[];for(let t of n){let a=e.manifestA.tableRecordCounts[t.tableName]??0,i=e.manifestB.tableRecordCounts[t.tableName]??0,l=i-a,s,d,c;if(e.recordLevel&&Wn(t)){let m=Un(we(e.pathA,t.fileName),we(e.pathB,t.fileName),t,e.maxIdsPerBucket);s=m.added,d=m.removed,c=m.changed}r.push({tableName:t.tableName,countA:a,countB:i,delta:l,...s!==void 0?{added:s}:{},...d!==void 0?{removed:d}:{},...c!==void 0?{changed:c}:{}})}return r}function Wn(e){return!0}function Un(e,n,r,t){let a=Ge(e,r),i=Ge(n,r),l=[],s=[],d=[];for(let[c,m]of a){let p=i.get(c);if(p===void 0)s.length<t&&s.push(c);else if(p!==m){if(r.dedupColumns&&r.dedupColumns.length>0)continue;d.length<t&&d.push(c)}}for(let c of i.keys())a.has(c)||l.length<t&&l.push(c);return l.sort(),s.sort(),d.sort(),{added:l,removed:s,changed:d}}function Ge(e,n){let r=new Map;if(!ve(e))return r;let t=j(e,$);for(let a of t){let i=Kn(a,n);if(i===void 0)continue;let l=Hn(a);r.set(i,zn(l))}return r}function Kn(e,n){if(n.dedupColumns&&n.dedupColumns.length>0){let a=[];for(let i of n.dedupColumns){let l=e[i];if(l==null)return;a.push(String(l))}return a.join("")}let r=P[n.tableName]??"id",t=e[r];if(t!=null)return String(t)}function Hn(e){let n=Object.keys(e).sort(),r={};for(let t of n)r[t]=e[t];return JSON.stringify(r)}function zn(e){return N(e)}ce();import{existsSync as Se,statSync as Gn}from"fs";import{join as Ye,resolve as Xn}from"path";var Qn=20,Yn="qe_patterns";function Ze(e,n={}){let r=Xn(e);nt(r);let t=n.table??Yn,a=C.find(R=>R.tableName===t);if(!a)throw new Error(`Unknown table: ${t}`);let i=Ye(r,a.fileName);if(!Se(i))throw new Error(`Table file not found: ${a.fileName} (expected in ${r}). Was this export generated with --format jsonl?`);let l=j(i,$),s=a.domainColumn,d=Math.max(1,n.limit??Qn),c=n.query?n.query.toLowerCase():void 0,m=n.domains&&n.domains.length>0?new Set(n.domains):void 0,p=n.since,h=n.until,B=n.patternType,g=0,f=[];for(let R of l)Zn(R,{domainColumn:s,domains:m,patternType:B,since:p,until:h,queryLower:c})&&(g++,f.length<d&&f.push(et(R,a.tableName,s)));return{table:t,inputPath:r,totalScanned:l.length,totalMatched:g,limit:d,hits:f,truncated:g>d}}function Zn(e,n){if(n.domains){if(!n.domainColumn)return!1;let r=e[n.domainColumn];if(typeof r!="string"||!n.domains.has(r))return!1}if(n.patternType!==void 0&&e.pattern_type!==n.patternType)return!1;if(n.since!==void 0||n.until!==void 0){let r=en(e);if(r===void 0||n.since!==void 0&&r<n.since||n.until!==void 0&&r>n.until)return!1}if(n.queryLower!==void 0){let r=typeof e.name=="string"?e.name.toLowerCase():"",t=typeof e.description=="string"?e.description.toLowerCase():"";if(!r.includes(n.queryLower)&&!t.includes(n.queryLower))return!1}return!0}function en(e){for(let n of["updated_at","created_at","timestamp"]){let r=e[n];if(typeof r=="string"&&r.length>0)return r}}function et(e,n,r){let t=(typeof e.id=="string"||typeof e.id=="number"?String(e.id):void 0)??`${n}:?`,a={name:typeof e.name=="string"?e.name:void 0,description:typeof e.description=="string"?e.description:void 0,domain:r&&typeof e[r]=="string"?e[r]:void 0,patternType:typeof e.pattern_type=="string"?e.pattern_type:void 0,confidence:typeof e.confidence=="number"?e.confidence:void 0,updatedAt:en(e)};return{id:t,display:a,row:e}}function nt(e){if(!Se(e))throw new Error(`Path not found: ${e}`);if(Gn(e).isFile())throw e.endsWith(".rvf")?new Error("Brain search does not support RVF exports. Re-export with --format jsonl, or use `aqe brain info` for RVF summaries."):new Error(`Unsupported brain export: ${e} (expected a JSONL directory)`);let r=Ye(e,"manifest.json");if(!Se(r))throw new Error(`Manifest not found at ${r}. Is this a brain export directory?`)}function nn(e,n){if(!e.prepare("SELECT name FROM sqlite_master WHERE type='table' AND name='qe_patterns'").get())return{created:0,skipped:0};e.exec(`
|
|
8
|
-
CREATE TEMP TABLE IF NOT EXISTS _covered_patterns (
|
|
9
|
-
pattern_id TEXT PRIMARY KEY
|
|
10
|
-
)
|
|
11
|
-
`),e.exec("DELETE FROM _covered_patterns"),e.exec(`
|
|
12
|
-
INSERT INTO _covered_patterns (pattern_id)
|
|
13
|
-
SELECT DISTINCT json_extract(action_data, '$.patternId')
|
|
14
|
-
FROM witness_chain
|
|
15
|
-
WHERE action_type = 'PATTERN_CREATE'
|
|
16
|
-
AND json_extract(action_data, '$.patternId') IS NOT NULL
|
|
17
|
-
`),e.exec(`
|
|
18
|
-
INSERT OR IGNORE INTO _covered_patterns (pattern_id)
|
|
19
|
-
SELECT DISTINCT json_extract(action_data, '$.pattern_id')
|
|
20
|
-
FROM witness_chain
|
|
21
|
-
WHERE action_type = 'PATTERN_CREATE'
|
|
22
|
-
AND json_extract(action_data, '$.pattern_id') IS NOT NULL
|
|
23
|
-
`);let t=e.prepare(`SELECT p.id, p.pattern_type, p.qe_domain, p.name, p.created_at
|
|
24
|
-
FROM qe_patterns p
|
|
25
|
-
LEFT JOIN _covered_patterns c ON p.id = c.pattern_id
|
|
26
|
-
WHERE c.pattern_id IS NULL
|
|
27
|
-
ORDER BY p.created_at ASC`).all(),i=e.prepare("SELECT COUNT(*) as count FROM qe_patterns").get().count-t.length,l=0;for(let s of t)n.append("PATTERN_CREATE",{patternId:s.id,patternType:s.pattern_type,qeDomain:s.qe_domain,name:s.name,originalCreatedAt:s.created_at,backfilled:!0},"system:backfill"),l++;return e.exec("DROP TABLE IF EXISTS _covered_patterns"),{created:l,skipped:i}}async function tn(e,n){if(tt(n.format)==="rvf"){let a=q(e,{readonly:!0});try{return Je(a,{outputPath:n.outputPath,domains:n.domains,allowOverwriteRicher:n.allowOverwriteRicher},e)}finally{a.close()}}let t=q(e,{readonly:!0});try{return Fe(t,n,e)}finally{t.close()}}async function rn(e,n,r){if(cn(n,r.format)==="rvf"){let i=q(e);try{return We(i,n,{mergeStrategy:r.mergeStrategy,dryRun:r.dryRun})}finally{i.close()}}let a=q(e);try{return Le(a,n,r)}finally{a.close()}}async function on(e,n){return cn(e,n)==="rvf"?se(e):qe(e)}async function an(e,n,r={}){return Xe(e,n,r)}async function sn(e,n={}){return Ze(e,n)}async function ln(e){let n=q(e);try{let r=$e(n,Ne());return await r.initialize(),nn(n,r)}finally{n.close()}}function tt(e){if(e==="jsonl")return"jsonl";if(e==="rvf"){if(!Re())throw new Error("RVF format requested but @ruvector/rvf-node is not available on this platform. Use --format jsonl instead.");return"rvf"}return Re()?"rvf":"jsonl"}function cn(e,n){return n==="rvf"?"rvf":n==="jsonl"?"jsonl":e.endsWith(".rvf")?"rvf":"jsonl"}var Ce=class{name="brain";description="Export, import, and inspect QE brain state";cleanupAndExit;ensureInitialized;constructor(n,r){this.cleanupAndExit=n,this.ensureInitialized=r}register(n,r){let t=n.command("brain").description(this.description);t.command("export").description("Export brain state to a portable directory").requiredOption("-o, --output <path>","Output directory path").option("--format <format>","Export format: rvf (default) or jsonl","rvf").option("--db <path>","Source database path").option("--force-overwrite-richer","Allow replacing an existing RVF with fewer patterns",!1).action(async a=>{await this.executeExport(a)}),t.command("import").description("Import brain state from an export directory").requiredOption("-i, --input <path>","Path to brain export directory").option("--strategy <strategy>","Merge strategy","skip-conflicts").option("--dry-run","Preview import without writing",!1).option("--db <path>","Target database path").action(async a=>{await this.executeImport(a)}),t.command("info").description("Show manifest info for a brain export").requiredOption("-i, --input <path>","Path to brain export directory").action(async a=>{await this.executeInfo(a)}),t.command("witness-backfill").description("Create witness chain entries for patterns that predate the witness chain").option("--db <path>","Database path").action(async a=>{await this.executeWitnessBackfill(a)}),t.command("diff").description("Compare two brain exports (JSONL directory or .rvf file)").argument("<a>","Path to first brain export").argument("<b>","Path to second brain export").option("--table <name>","Restrict comparison to a single table").option("--verbose","Show the IDs of added/removed/changed records",!1).option("--json","Emit the diff as JSON to stdout",!1).action(async(a,i,l)=>{await this.executeDiff(a,i,l)}),t.command("search").description("Search a JSONL brain export with filters").requiredOption("-i, --input <path>","Path to brain export directory (JSONL)").option("--table <name>","Table to search (default: qe_patterns)").option("--domain <name...>","Restrict to one or more domains").option("--pattern-type <type>","Restrict to a specific pattern_type (qe_patterns only)").option("--since <iso>","Include rows with timestamp \u2265 <iso>").option("--until <iso>","Include rows with timestamp \u2264 <iso>").option("-q, --query <text>","Substring match across name + description (case-insensitive)").option("-l, --limit <n>","Maximum results to return","20").option("--json","Emit results as JSON to stdout",!1).action(async a=>{await this.executeSearch(a)})}async executeExport(n){try{console.log(o.blue(`
|
|
28
|
-
Exporting brain state (format: ${n.format})...
|
|
29
|
-
`));let r=await _e(n.db),t=await tn(r,{outputPath:M.resolve(n.output),format:n.format,allowOverwriteRicher:n.forceOverwriteRicher});if(console.log(o.green(" Export complete.")),console.log(` Format: ${o.cyan("format"in t?t.format??"jsonl":"jsonl")}`),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"embeddingCount"in t.stats?console.log(` Vectors: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`),"rvfStatus"in t){let i=t.rvfStatus;console.log(` RVF Size: ${o.cyan(dn(i.fileSizeBytes))}`),console.log(` Segments: ${o.cyan(i.totalSegments)}`)}let a=t.stats.skippedCacheRows?.vectors;a&&console.log(` Skipped: ${o.gray(`${a} code-index vectors (regenerable: aqe code index <path>)`)}`),console.log(` Checksum: ${o.gray(t.checksum)}`),console.log(` Output: ${o.cyan(M.resolve(n.output))}`),console.log(""),await this.cleanupAndExit(0)}catch(r){r?.code==="RVF_KERNEL_TOO_LARGE"?console.error(o.red(`
|
|
30
|
-
Brain export failed:`),r.message):console.error(o.red(`
|
|
31
|
-
Brain export failed:`),r),await this.cleanupAndExit(1)}}async executeImport(n){try{n.dryRun?console.log(o.yellow(`
|
|
32
|
-
Dry-run mode \u2014 no data will be written.
|
|
33
|
-
`)):console.log(o.blue(`
|
|
34
|
-
Importing brain state...
|
|
35
|
-
`));let r=await _e(n.db),t=await rn(r,M.resolve(n.input),{mergeStrategy:n.strategy,dryRun:n.dryRun});console.log(o.green(" Import complete.")),console.log(` Imported: ${o.cyan(t.imported)}`),console.log(` Skipped: ${o.yellow(t.skipped)}`),console.log(` Conflicts: ${o.red(t.conflicts)}`),"embeddingsRestored"in t&&console.log(` Embeddings: ${o.cyan(t.embeddingsRestored)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
36
|
-
Brain import failed:`),r),await this.cleanupAndExit(1)}}async executeInfo(n){try{console.log(o.blue(`
|
|
37
|
-
Brain Export Info
|
|
38
|
-
`));let r=M.resolve(n.input),t=await on(r),a="format"in t?t.format??"jsonl":"jsonl";if(console.log(` Version: ${o.cyan(t.version)}`),console.log(` Format: ${o.cyan(a)}`),console.log(` Exported: ${o.cyan(t.exportedAt)}`),console.log(` Source DB: ${o.cyan(t.sourceDb)}`),console.log(o.blue(`
|
|
39
|
-
Learning Data:`)),console.log(` Patterns: ${o.cyan(t.stats.patternCount)}`),"qValueCount"in t.stats&&console.log(` Q-Values: ${o.cyan(t.stats.qValueCount)}`),"dreamInsightCount"in t.stats){let s=t.stats.dreamInsightCount,c=("tableRecordCounts"in t?t.tableRecordCounts:void 0)?.dream_cycles,m=c!==void 0?` (${c} cycles)`:"";console.log(` Dream Insights: ${o.cyan(s)}${o.gray(m)}`)}"witnessChainLength"in t.stats&&console.log(` Witness Chain: ${o.cyan(t.stats.witnessChainLength)} entries`),"embeddingCount"in t.stats?console.log(` Embeddings: ${o.cyan(t.stats.embeddingCount)}`):"vectorCount"in t.stats&&console.log(` Vectors: ${o.cyan(t.stats.vectorCount)}`);let i="tableRecordCounts"in t?t.tableRecordCounts:void 0;if(i){let s=Object.entries(i).filter(([d,c])=>c>0&&!["qe_patterns","rl_q_values","dream_insights","dream_cycles","witness_chain","vectors","qe_pattern_embeddings"].includes(d));if(s.length>0)for(let[d,c]of s){let p=`${d.replace(/_/g," ").replace(/\b\w/g,h=>h.toUpperCase())}:`.padEnd(15);console.log(` ${p}${o.cyan(c)}`)}}let l="totalRecords"in t.stats?t.stats.totalRecords:void 0;if(l!==void 0&&(console.log(o.blue(`
|
|
40
|
-
Summary:`)),console.log(` Total Records: ${o.cyan(l)}`)),"domains"in t&&Array.isArray(t.domains)&&t.domains.length>0&&(l||console.log(o.blue(`
|
|
41
|
-
Summary:`)),console.log(` Domains: ${o.cyan(t.domains.join(", "))}`)),"rvfStatus"in t){let s=t.rvfStatus;console.log(o.blue(`
|
|
42
|
-
RVF Details:`)),console.log(` File Size: ${o.cyan(dn(s.fileSizeBytes))}`),console.log(` Vectors: ${o.cyan(s.totalVectors)}`),console.log(` Segments: ${o.cyan(s.totalSegments)}`)}if("lineage"in t){let s=t.lineage;s&&(console.log(o.blue(`
|
|
43
|
-
Lineage:`)),console.log(` File ID: ${o.cyan(s.fileId)}`),console.log(` Parent ID: ${o.cyan(s.parentId??"none (root)")}`),console.log(` Depth: ${o.cyan(s.lineageDepth)}`))}if("signature"in t){let s=t.signature,d=t.signerKeyId;console.log(o.blue(`
|
|
44
|
-
Signature:`)),s?(console.log(` Status: ${o.green("Signed")}`),console.log(` Key ID: ${o.cyan(d??"unknown")}`),console.log(` Signature: ${o.gray(s.slice(0,32)+"...")}`)):console.log(` Status: ${o.yellow("Unsigned")}`)}console.log(`
|
|
45
|
-
Checksum: ${o.gray(t.checksum)}`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
46
|
-
Failed to read brain info:`),r),await this.cleanupAndExit(1)}}async executeDiff(n,r,t){try{let a=await an(M.resolve(n),M.resolve(r),{tableFilter:t.table});if(t.json){process.stdout.write(JSON.stringify(a,null,2)+`
|
|
47
|
-
`),await this.cleanupAndExit(a.identical?0:1);return}at(a,t.verbose),await this.cleanupAndExit(a.identical?0:1)}catch(a){console.error(o.red(`
|
|
48
|
-
Brain diff failed:`),a),await this.cleanupAndExit(2)}}async executeSearch(n){try{let r=rt(n.limit),t=ot(n.domain),a=await sn(M.resolve(n.input),{table:n.table,domains:t,patternType:n.patternType,since:n.since,until:n.until,query:n.query,limit:r});if(n.json){process.stdout.write(JSON.stringify(a,null,2)+`
|
|
49
|
-
`),await this.cleanupAndExit(a.totalMatched>0?0:3);return}lt(a),await this.cleanupAndExit(a.totalMatched>0?0:3)}catch(r){console.error(o.red(`
|
|
50
|
-
Brain search failed:`),r),await this.cleanupAndExit(2)}}async executeWitnessBackfill(n){try{console.log(o.blue(`
|
|
51
|
-
Running witness chain backfill...
|
|
52
|
-
`));let r=await _e(n.db),t=await ln(r);console.log(o.green(" Backfill complete.")),console.log(` Created: ${o.cyan(t.created)} new witness entries`),console.log(` Skipped: ${o.cyan(t.skipped)} (already witnessed)`),console.log(""),await this.cleanupAndExit(0)}catch(r){console.error(o.red(`
|
|
53
|
-
Witness backfill failed:`),r),await this.cleanupAndExit(1)}}getHelp(){return`
|
|
54
|
-
Export, import, and inspect QE brain state.
|
|
55
|
-
|
|
56
|
-
Formats:
|
|
57
|
-
rvf \u2014 Single portable .rvf file (default, requires @ruvector/rvf-node)
|
|
58
|
-
jsonl \u2014 JSONL directory format (fallback when native not available)
|
|
59
|
-
|
|
60
|
-
Usage:
|
|
61
|
-
aqe brain export -o brain.rvf [--format rvf] [--db <path>]
|
|
62
|
-
aqe brain export -o ./brain-dir --format jsonl [--db <path>]
|
|
63
|
-
aqe brain import -i brain.rvf [--strategy skip-conflicts] [--dry-run] [--db <path>]
|
|
64
|
-
aqe brain info -i brain.rvf
|
|
65
|
-
|
|
66
|
-
Subcommands:
|
|
67
|
-
export Export brain state to a portable .rvf file or JSONL directory
|
|
68
|
-
import Import a brain export into the local database
|
|
69
|
-
info Show manifest metadata for an existing brain export
|
|
70
|
-
diff Compare two brain exports (manifest always; record-level for JSONL)
|
|
71
|
-
search Filtered search over a JSONL brain export
|
|
72
|
-
|
|
73
|
-
Examples:
|
|
74
|
-
aqe brain export -o .agentic-qe/brain.rvf
|
|
75
|
-
aqe brain export -o .agentic-qe/brain.rvf --format rvf
|
|
76
|
-
aqe brain export -o ./brain-export --format jsonl
|
|
77
|
-
aqe brain import -i .agentic-qe/brain.rvf --strategy latest-wins
|
|
78
|
-
aqe brain import -i .agentic-qe/brain.rvf --dry-run
|
|
79
|
-
aqe brain info -i .agentic-qe/brain.rvf
|
|
80
|
-
aqe brain diff ./brain-a ./brain-b --verbose
|
|
81
|
-
aqe brain search -i ./brain-export --query oauth --domain test-generation
|
|
82
|
-
aqe brain search -i ./brain-export --since 2026-03-01 --limit 50 --json
|
|
83
|
-
`}};async function _e(e){if(e)return e;let{findProjectRoot:n}=await import("./unified-memory-GI76TXFV.js");return M.join(n(),".agentic-qe","memory.db")}function dn(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function rt(e){let n=Number.parseInt(e,10);return!Number.isFinite(n)||n<1?20:n}function ot(e){if(e===void 0)return;let n=Array.isArray(e)?e:[e],r=[];for(let t of n)for(let a of t.split(",")){let i=a.trim();i&&r.push(i)}return r.length>0?r:void 0}function at(e,n){console.log(o.blue(`
|
|
84
|
-
Brain Diff
|
|
85
|
-
`)),console.log(` A: ${o.cyan(e.pathA)} (${e.formatA})`),console.log(` B: ${o.cyan(e.pathB)} (${e.formatB})`),console.log(` Versions: ${o.cyan(e.manifestA.version)} \u2192 ${o.cyan(e.manifestB.version)}`+(e.versionMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Checksums: ${o.gray(e.manifestA.checksum.slice(0,12))}\u2026 \u2192 ${o.gray(e.manifestB.checksum.slice(0,12))}\u2026`+(e.checksumMatch?o.gray(" (match)"):o.yellow(" (differ)"))),console.log(` Exported: ${o.gray(e.manifestA.exportedAt)} \u2192 ${o.gray(e.manifestB.exportedAt)}`),console.log(` Records: ${o.cyan(e.manifestA.totalRecords)} \u2192 ${o.cyan(e.manifestB.totalRecords)} `+fn(e.manifestB.totalRecords-e.manifestA.totalRecords)),(e.domainsOnlyInA.length>0||e.domainsOnlyInB.length>0)&&(console.log(o.blue(`
|
|
86
|
-
Domains:`)),e.domainsOnlyInA.length>0&&console.log(` Only in A: ${o.yellow(e.domainsOnlyInA.join(", "))}`),e.domainsOnlyInB.length>0&&console.log(` Only in B: ${o.yellow(e.domainsOnlyInB.join(", "))}`)),e.recordLevel||console.log(o.gray(`
|
|
87
|
-
Note: record-level diff is only available when both sides are JSONL exports.
|
|
88
|
-
Per-table counts shown below; re-export with --format jsonl for added/removed/changed IDs.`)),console.log(o.blue(`
|
|
89
|
-
Tables:`));let r=e.tableDiffs.filter(it);if(r.length===0)console.log(o.gray(" (no differences)"));else for(let t of r)console.log(` ${t.tableName.padEnd(28)} ${o.cyan(String(t.countA).padStart(7))} \u2192 ${o.cyan(String(t.countB).padStart(7))} ${fn(t.delta)}`+st(t,n)),n&&(t.added&&t.added.length>0&&Ee("added",t.added),t.removed&&t.removed.length>0&&Ee("removed",t.removed),t.changed&&t.changed.length>0&&Ee("changed",t.changed));console.log(""),e.identical?console.log(o.green(` Result: identical
|
|
90
|
-
`)):console.log(o.yellow(` Result: differences found
|
|
91
|
-
`))}function it(e){return!!(e.delta!==0||e.added&&e.added.length>0||e.removed&&e.removed.length>0||e.changed&&e.changed.length>0)}function fn(e){return e===0?o.gray("(\xB10)"):e>0?o.green(`(+${e})`):o.red(`(${e})`)}function st(e,n){let r=[];return e.added&&e.added.length>0&&r.push(o.green(`+${e.added.length}`)),e.removed&&e.removed.length>0&&r.push(o.red(`-${e.removed.length}`)),e.changed&&e.changed.length>0&&r.push(o.yellow(`~${e.changed.length}`)),r.length===0?"":n?" "+r.join(" "):" "+o.gray("[")+r.join(" ")+o.gray("]")}function Ee(e,n){let r=n.slice(0,10).join(", "),t=n.length>10?o.gray(` \u2026(+${n.length-10} more)`):"";console.log(` ${o.gray(e+":")} ${r}${t}`)}function lt(e){if(console.log(o.blue(`
|
|
92
|
-
Brain Search
|
|
93
|
-
`)),console.log(` Input: ${o.cyan(e.inputPath)}`),console.log(` Table: ${o.cyan(e.table)}`),console.log(` Scanned: ${o.cyan(e.totalScanned)} Matched: ${o.cyan(e.totalMatched)} Shown: ${o.cyan(e.hits.length)}`+(e.truncated?o.yellow(` (truncated to limit ${e.limit})`):"")),e.hits.length===0){console.log(o.yellow(`
|
|
94
|
-
No matching rows.
|
|
95
|
-
`));return}console.log("");for(let n of e.hits){let r=o.cyan(n.id)+(n.display.patternType?o.gray(` ${n.display.patternType}`):"")+(n.display.domain?o.gray(` [${n.display.domain}]`):"")+(n.display.confidence!==void 0?o.gray(` conf=${n.display.confidence.toFixed(2)}`):"");if(console.log(` ${r}`),n.display.name&&console.log(` ${o.bold(n.display.name)}`),n.display.description){let t=n.display.description.length>200?n.display.description.slice(0,200)+"\u2026":n.display.description;console.log(` ${o.gray(t)}`)}n.display.updatedAt&&console.log(` ${o.gray(n.display.updatedAt)}`),console.log("")}}function Ht(e,n){return new Ce(e,n)}export{Ce as BrainHandler,Ht as createBrainHandler};
|
|
@@ -1,2 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a}from"./chunk-KITOPKRG.js";import"./chunk-GAHNO6JJ.js";import"./chunk-SUDMM5SO.js";import"./chunk-JQ3DYUMS.js";import"./chunk-HGWXF45W.js";import"./chunk-MO55CVMT.js";import"./chunk-CEYSYSK5.js";import"./chunk-WP4RETKG.js";import"./chunk-JDIYMZCQ.js";import"./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"./chunk-FLNAW7C4.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-AGRV5B3T.js";import"./chunk-U2A7NHZA.js";import"./chunk-KPRCB5LT.js";import"./chunk-KNSRL6NO.js";import"./chunk-2H4XH6FT.js";import"./chunk-AJMJNQMP.js";export{a as BrowserWorkflowTool};
|
|
@@ -1,3 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a as y,b as C}from"./chunk-RV74I3YO.js";import{b as h}from"./chunk-GSKMOPL7.js";import{f as g,g as v,l as f,m as b,n as p,p as d}from"./chunk-D6COXLYE.js";import D from"chalk";var E=3,R="instrumented-report",T="static-estimation";async function x(e,r=n=>console.log(n)){let n=await f(e);if(n.status==="target-missing")return{kind:"no-data",reason:"target-missing",message:d("target-missing",e,null)};if(n.status==="evaluated"){let{evaluation:a,projectRoot:t}=n;if(a.status==="measured"){let{files:u,evidence:i}=a;return{kind:"data",data:{files:u,summary:y(u),instrumented:!0,...i.unmeasuredFiles.length>0?{unmeasuredFiles:i.unmeasuredFiles}:{}},projectRoot:t,evidence:i}}return{kind:"no-data",reason:a.reason,message:d(a.reason,e,t)}}let s=h(n.target,{includeTests:!1});return s.length===0?{kind:"no-sources"}:(r(D.gray(` Analyzing ${s.length} files...
|
|
3
|
-
`)),{kind:"data",data:C(s,n.projectRoot),projectRoot:n.projectRoot})}function w(e){return{branch:e.files.some(r=>r.branches.total>0),function:e.files.some(r=>r.functions.total>0),statement:e.files.some(r=>r.statements.total>0)}}var F=e=>e==="target-missing"||e==="unreadable-report";function N(){return"UNMEASURED: no coverage report exists for this project, so these figures are a STATIC ESTIMATE derived from source shape \u2014 not measured coverage. No threshold verdict is given and nothing is stored as evidence. Run your tests with coverage first (e.g. `npm test -- --coverage`) and re-run."}async function O(e,r,n,s){let a=await x(r,s);if(a.kind==="no-sources")return a;if(a.kind==="no-data")return F(a.reason)?{kind:"error",reason:a.reason,message:a.message}:{kind:"unmeasured",reason:a.reason,message:a.message};let t=a.data,u=t.instrumented,i=await e.analyze({coverageData:t,threshold:n,includeFileDetails:!0,measured:u,...a.projectRoot?{projectRoot:a.projectRoot}:{}});if(!i.success||!i.value)return{kind:"analysis-failed",message:i.error?.message||"Coverage analysis failed"};let o=i.value;if(!u)return{kind:"estimate",data:t,summary:{...o.summary},message:N()};let l=w(t),c=b(o.summary,n,l),m=g(a.evidence,a.projectRoot??r),k={...c,meetsThreshold:c.meetsThreshold&&m.length===0};return{kind:"measured",data:t,collected:l,verdict:k,insufficientEvidence:m,...a.evidence?{evidence:a.evidence}:{},summary:{...o.summary,branch:l.branch?o.summary.branch:null,function:l.function?o.summary.function:null,statement:l.statement?o.summary.statement:null},recommendations:p(o.recommendations??[],c,n,l)}}function U(e,r){switch(e.kind){case"measured":{if(e.insufficientEvidence.length>0)return E;let{overall:n,meetsThreshold:s}=e.verdict;return s?n<r+5?2:0:1}case"estimate":case"unmeasured":return E;case"no-sources":return 0;default:return 1}}function j(e,r){if(e.length===0&&r.length===0)return{};let n=e.length>0?`INSUFFICIENT EVIDENCE: ${e.join("; ")}`:"";return r.length===0?{warning:n}:{warning:[n&&n.replace(/\.?$/,"."),...r].filter(Boolean).join(" ")}}function _(e,r,n){let s={line:null,branch:null,function:null,statement:null};switch(e.kind){case"measured":return{summary:e.summary,meetsThreshold:e.verdict.meetsThreshold,threshold:r,recommendations:e.recommendations,measured:!0,estimated:!1,coverageMethod:R,branchDataCollected:e.collected.branch,functionDataCollected:e.collected.function,statementDataCollected:e.collected.statement,...e.data.unmeasuredFiles?.length?{unmeasuredFiles:e.data.unmeasuredFiles}:{},...e.evidence?{evidenceStatus:e.evidence.status}:{},...e.evidence?.stale?{staleReport:e.evidence.stale}:{},...e.evidence?.conflictingFiles?{conflictingFiles:e.evidence.conflictingFiles}:{},...e.evidence?.excludedEntries?{excludedReportEntries:e.evidence.excludedEntries}:{},...j(e.insufficientEvidence,v(e.evidence))};case"estimate":return{summary:e.summary,meetsThreshold:null,threshold:r,measured:!1,estimated:!0,unmeasured:!0,coverageMethod:T,reason:"no-coverage-report",target:n,warning:e.message};case"unmeasured":case"error":return{summary:s,meetsThreshold:null,threshold:r,measured:!1,unmeasured:e.kind==="unmeasured",reason:e.reason,target:n,warning:e.message};case"analysis-failed":return{summary:s,meetsThreshold:null,threshold:r,measured:!1,target:n,error:e.message};case"no-sources":return{summary:s,meetsThreshold:null,threshold:r,measured:!1,target:n,warning:"No source files found"}}}export{E as a,x as b,O as c,U as d,_ as e};
|
|
@@ -1,8 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a as V,c as Y,d as q,e as R,f as K,j as H}from"./chunk-IUBJVHNB.js";import{c as P,e as Te}from"./chunk-HCH4Y6XX.js";import{c as B,d as C}from"./chunk-NZU4ACBZ.js";import{c as z,d as $e}from"./chunk-AGRV5B3T.js";import*as x from"fs";import*as v from"path";import*as p from"fs";import*as ee from"os";import*as g from"path";Te();function Ae(e=process.env){let t=(e.AQE_COVERAGE_NO_EXEC??"").trim().toLowerCase();return t?t!=="false"&&t!=="0"&&t!=="no"&&t!=="off":!1}var De=new Set([".ts",".tsx",".js",".jsx",".mjs",".cjs",".py",".go",".rs",".java",".rb"]),te=new Set(["node_modules","dist","build","coverage",".git",".claude",".agentic-qe","__pycache__",".venv","target","vendor"]),ne=new Set(["tests","test","__tests__","benches","examples","spec"]),Pe=[/\.test\./i,/\.spec\./i,/_test\./i,/_spec\./i,/^test_/i,/^test\./i,/^conftest\./i];function E(e,t){let n=e.split(g.sep).join("/"),r=g.basename(n);if(Pe.some(o=>o.test(r)))return!0;let s=n;if(t){let o=g.resolve(t).split(g.sep).join("/"),i=g.resolve(e).split(g.sep).join("/");(i===o||i.startsWith(`${o}/`))&&(s=i.slice(o.length).replace(/^\//,""))}return s.split("/").some(o=>ne.has(o))}function _e(e){let t=e.split(""),n=e.length,r=0,s=(o,i)=>{for(let a=o;a<i&&a<n;a++)e[a]!==`
|
|
3
|
-
`&&(t[a]=" ")};for(;r<n;){let o=e[r];if(o==="/"&&e[r+1]==="/"){let a=e.indexOf(`
|
|
4
|
-
`,r),c=a===-1?n:a;s(r,c),r=c;continue}if(o==="/"&&e[r+1]==="*"){let a=0,c=r;for(;r<n;){if(e[r]==="/"&&e[r+1]==="*"){a++,r+=2;continue}if(e[r]==="*"&&e[r+1]==="/"){if(a--,r+=2,a===0)break;continue}r++}s(c,r);continue}let i=/^b?r(#*)"/.exec(e.slice(r,r+300));if(i){let a=`"${i[1]}`,c=r+i[0].length,u=e.indexOf(a,c),f=u===-1?n:u+a.length;s(r,f),r=f;continue}if(o==='"'){let a=r;for(r++;r<n;){if(e[r]==="\\"){r+=2;continue}if(e[r]==='"'){r++;break}r++}s(a,r);continue}if(o==="'"){let a=-1;if(e[r+1]==="\\"){let c=e.indexOf("'",r+2);c!==-1&&c<=r+5&&(a=c+1)}else e[r+2]==="'"&&(a=r+3);if(a!==-1){s(r,a),r=a;continue}}r++}return t.join("")}function Ne(e,t){if(t!==".rs")return[];let n=_e(e).split(`
|
|
5
|
-
`),r=[];for(let s=0;s<n.length;s++){if(!/#\s*\[\s*cfg\s*\(\s*test\s*\)\s*\]/.test(n[s]))continue;let o=-1;for(let c=s;c<Math.min(n.length,s+10);c++){let u=n[c],f=u.indexOf("{"),h=u.indexOf(";");if(h!==-1&&(f===-1||h<f))break;if(f!==-1){let b=n.slice(s,c+1).join(" ");/\bmod\s+\w+/.test(b)&&(o=c);break}}if(o===-1)continue;let i=0,a=-1;for(let c=o;c<n.length;c++){for(let u of n[c])u==="{"?i++:u==="}"&&i--;if(i<=0){a=c;break}}r.push([s+1,(a===-1?n.length-1:a)+1]),s=a===-1?n.length:a}return r}function Me(e){if(e.length===0)return 0;let t=e.split(`
|
|
6
|
-
`);return t[t.length-1]===""&&t.pop(),t.length}function re(e,t=6){let n=g.resolve(e);try{if(!p.existsSync(n))return null;p.statSync(n).isDirectory()||(n=g.dirname(n))}catch{return null}for(let r=0;r<=t;r++){if(p.existsSync(g.join(n,"Cargo.toml")))return p.realpathSync(n);let s=g.dirname(n);if(s===n)break;n=s}return null}function se(e,t=0){if(t>4)return!1;let n;try{n=p.readdirSync(e,{withFileTypes:!0})}catch{return!1}for(let r of n)if(r.isFile()&&g.extname(r.name)===".rs")return!0;for(let r of n)if(r.isDirectory()&&!te.has(r.name)&&se(g.join(e,r.name),t+1))return!0;return!1}function vt(e){let t=re(e);if(t===null)return!1;let n=g.resolve(e);return n===t||se(n)}async function bt(e,t={}){if(Ae())return null;let n=t.timeoutMs??3e5,r=re(e);if(!r)return null;let s=await P("cargo",["llvm-cov","--version"],{cwd:r,timeout:3e4});if(s.error||s.status!==0)return null;let o=g.join(p.mkdtempSync(g.join(ee.tmpdir(),"aqe-rust-cov-")),"lcov.info");try{let i=await P("cargo",["llvm-cov","--lcov","--output-path",o],{cwd:r,timeout:n});if(i.error||i.status!==0||!p.existsSync(o))return null;let c=R(p.readFileSync(o,"utf-8")).files.filter(h=>!E(h.path,r));if(c.length===0)return null;let u=oe(c),f=c.some(h=>h.branches.total>0);return{data:u,provenance:{method:"cargo-llvm-cov",estimated:!1,branchDataCollected:f,functionDataCollected:c.some(h=>h.functions.total>0),notes:f?[]:["cargo-llvm-cov reported no branch data (Rust branch coverage requires a nightly toolchain with -Z coverage-options=branch). Branch coverage is reported as null rather than assumed."]}}}catch{return null}finally{try{p.rmSync(g.dirname(o),{recursive:!0,force:!0})}catch{}}}var Z={".rs":{fn:/\bfn\s+\w+/g,branch:/\b(if|match|while|for)\b|\?\?|\|\||&&/g},".go":{fn:/\bfunc\s+\w*/g,branch:/\b(if|switch|case|for|select)\b|\|\||&&/g},".py":{fn:/\b(def|lambda)\b/g,branch:/\b(if|elif|for|while|except)\b|\band\b|\bor\b/g},".java":{fn:/\b(public|private|protected|static)[\w<>,\s[\]]+\w+\s*\(/g,branch:/\b(if|switch|case|for|while|catch)\b|\|\||&&/g},".rb":{fn:/\bdef\s+\w+/g,branch:/\b(if|elsif|unless|case|when|while)\b|\|\||&&/g},default:{fn:/\bfunction\b|=>|\b\w+\s*\([^)]*\)\s*\{/g,branch:/\b(if|switch|case|for|while|catch)\b|\?\?|\|\||&&/g}};function Ie(e){return Z[e]??Z.default}function Q(e,t){return(e.match(new RegExp(t.source,t.flags))||[]).length}function oe(e){let t=o=>e.reduce((i,a)=>i+o(a),0),n=(o,i)=>i>0?Math.round(o/i*100):0,r=t(o=>o.lines.total),s=t(o=>o.lines.covered);return{files:e,summary:{line:n(s,r),branch:n(t(o=>o.branches.covered),t(o=>o.branches.total)),function:n(t(o=>o.functions.covered),t(o=>o.functions.total)),statement:n(s,r),files:e.length}}}function _(e){let t=[],n=e;function r(s,o){if(o>6)return;let i;try{i=p.readdirSync(s,{withFileTypes:!0})}catch{return}for(let a of i){let c=g.join(s,a.name);if(a.isDirectory()){if(te.has(a.name)||ne.has(a.name))continue;r(c,o+1)}else if(a.isFile()){if(!De.has(g.extname(a.name))||E(c,n))continue;t.push(c)}}}return r(e,0),t}function yt(e){if(!p.existsSync(e)||!p.statSync(e).isDirectory())return null;let t=_(e);if(t.length===0)return null;let n=t.map(r=>{let s="";try{s=C(r,{outsideRoot:"allow"})}catch{}let o=g.extname(r),i=Me(s),a=Ne(s,o),c=y=>a.some(([A,D])=>y>=A&&y<=D),u=a.reduce((y,[A,D])=>y+(D-A+1),0),f=Math.max(i-u,0),h=Ie(o),b=Q(s,h.fn),Ce=a.length>0,Se=Le(r),we=Ce||Se,Ee=Q(s,h.branch),je=Math.min(Ee*.005,.15),Re=Math.min(f*1e-4,.1),ke=Math.max(.05,Math.min(.95,we?.85-je-Re:.2)),T=Math.floor(f*ke),X=[];for(let y=1;y<=i;y++)c(y)||X.push(y);let Fe=X.slice(T);return{path:r,lines:{covered:T,total:f},branches:{covered:0,total:0},functions:{covered:0,total:b},statements:{covered:T,total:f},uncoveredLines:Fe,uncoveredBranches:[]}});return{data:oe(n),provenance:{method:"static-estimation",estimated:!0,branchDataCollected:!1,functionDataCollected:!1,notes:["No instrumentation ran. These numbers are a STATIC ESTIMATE derived from source shape (file size, declaration counts, presence of a test file) \u2014 they are not measured coverage and must not be reported as such.","Branch and function coverage were not collected and are reported as null."]}}}function Le(e){let t=g.extname(e),n=e.slice(0,-t.length);return[`${n}.test${t}`,`${n}.spec${t}`,`${n}_test${t}`,`${n}.test${t}`.replace("/src/","/tests/"),`${n}.spec${t}`.replace("/src/","/tests/"),`${n}${t}`.replace("/src/","/tests/")].some(s=>{try{return p.existsSync(s)}catch{return!1}})}import*as M from"fs";import*as m from"path";var I=["ts","mts","cts","js","mjs","cjs"],Oe=[...I.map(e=>`vitest.config.${e}`),...I.map(e=>`vite.config.${e}`)],We=[...I.map(e=>`jest.config.${e}`),"jest.config.json"],Ue=[".nycrc",".nycrc.json"],Je=[".c8rc",".c8rc.json"];function Ge(e){return e.replace(/[.+^$()|[\]\\]/g,"\\$&")}function ce(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r==="*"&&e[n+1]==="*")e[n+2]==="/"?(t+="(?:.*/)?",n+=2):(t+=".*",n+=1);else if(r==="*")t+="[^/]*";else if(r==="?")t+="[^/]";else if(r==="{"){let s=e.indexOf("}",n);if(s===-1){t+="\\{";continue}t+=`(?:${e.slice(n+1,s).split(",").map(ce).join("|")})`,n=s}else t+=Ge(r)}return t}function ie(e){let t=e.replace(/^<rootDir>\//,"").replace(/^\.\//,"").replace(/\/+$/,"");return new RegExp(`^${ce(t)}(?:/.*)?$`)}function le(e){let t="";for(let n=0;n<e.length;n++){let r=e[n];if(r==='"'||r==="'"||r==="`"){let s=n;for(n++;n<e.length&&e[n]!==r;n++)e[n]==="\\"&&n++;t+=e.slice(s,n+1)}else if(r==="/"&&e[n+1]==="/"){for(;n<e.length&&e[n]!==`
|
|
7
|
-
`;)n++;t+=`
|
|
8
|
-
`}else if(r==="/"&&e[n+1]==="*"){let s=e.indexOf("*/",n+2);n=s===-1?e.length:s+1}else t+=r}return t}function ue(e,t){let n={"[":"]","{":"}","(":")"},r=[];for(let s=t;s<e.length;s++){let o=e[s];if(o==='"'||o==="'"||o==="`")for(s++;s<e.length&&e[s]!==o;s++)e[s]==="\\"&&s++;else if(n[o])r.push(n[o]);else if(o===r[r.length-1]&&(r.pop(),r.length===0))return s+1}return-1}function Xe(e){let t=[],n=0,r=0;for(let s=0;s<e.length;s++){let o=e[s];if(o==='"'||o==="'"||o==="`")for(s++;s<e.length&&e[s]!==o;s++)e[s]==="\\"&&s++;else"[{(".includes(o)?n++:"]})".includes(o)?n--:o===","&&n===0&&(t.push(e.slice(r,s)),r=s+1)}return t.push(e.slice(r)),t.map(s=>s.trim()).filter(s=>s.length>0)}var ae=/^(['"])((?:\\.|(?!\1)[^\\])*)\1$|^`([^`$\\]*)`$/;function $(e,t){let n=new RegExp(`(?:^|[\\s,{])['"]?${t}['"]?\\s*:\\s*`).exec(e);if(!n)return;let r=n.index+n[0].length;if(e[r]==="'"||e[r]==='"'){let i=ae.exec(e.slice(r,ze(e,r)));return i?[i[2]??i[3]]:null}if(e[r]!=="[")return null;let s=ue(e,r);if(s===-1)return null;let o=[];for(let i of Xe(e.slice(r+1,s-1))){if(/^\.\.\.[\w$.]*defaults?\b/i.test(i))continue;let a=ae.exec(i);if(!a)return null;o.push(a[2]??a[3])}return o}function ze(e,t){let n=t+1;for(;n<e.length&&e[n]!==e[t];n++)e[n]==="\\"&&n++;return n+1}function L(e){try{return C(e,{outsideRoot:"allow"})}catch{return null}}function N(e){let t=L(e);if(t===null)return null;try{let n=JSON.parse(t);return typeof n=="object"&&n!==null?n:null}catch{return null}}var k=e=>e===void 0?void 0:typeof e=="string"?[e]:Array.isArray(e)&&e.every(t=>typeof t=="string")?e:null;function S(e,t){let n=[t.include,t.exclude,t.collectFrom,t.ignore].every(o=>o!==null),r=t.collectFrom??[],s=[];for(let o of t.ignore??[])try{s.push(new RegExp(o))}catch{}return{source:e,readable:n,ignorePatterns:s,include:[...t.include??[],...r.filter(o=>!o.startsWith("!"))],exclude:[...t.exclude??[],...r.filter(o=>o.startsWith("!")).map(o=>o.slice(1))]}}function Be(e,t){let n=le(t),r=/(?:^|[\s,{])['"]?coverage['"]?\s*(?::\s*|(?=[,}]))/.exec(n);if(!r)return null;let s=r.index+r[0].length;if(!r[0].includes(":")||n[s]!=="{")return S(e,{include:null});let o=ue(n,s),i=o===-1?"":n.slice(s,o);return S(e,{include:$(i,"include"),exclude:$(i,"exclude")})}function Ve(e,t){let n=le(t),r=$(n,"collectCoverageFrom"),s=$(n,"coveragePathIgnorePatterns");return r===void 0&&s===void 0?null:S(e,{collectFrom:r,ignore:s})}function F(e,t){return!t||typeof t!="object"?null:"collectCoverageFrom"in t||"coveragePathIgnorePatterns"in t?S(e,{collectFrom:k(t.collectCoverageFrom),ignore:k(t.coveragePathIgnorePatterns)}):"include"in t||"exclude"in t?S(e,{include:k(t.include),exclude:k(t.exclude)}):null}function fe(e){for(let r of Oe){let s=L(m.join(e,r));if(s!==null){let o=Be(r,s);if(o)return o}}for(let r of We){let s=m.join(e,r);if(!M.existsSync(s))continue;let o=r.endsWith(".json")?F(r,N(s)??void 0):Ve(r,L(s)??"");if(o)return o}let t=N(m.join(e,"package.json")),n=F('package.json "jest"',t?.jest);if(n)return n;for(let[r,s]of[[Ue,"nyc"],[Je,"c8"]]){for(let i of r){let a=N(m.join(e,i)),c=F(i,a??void 0);if(c)return c;if(!a&&M.existsSync(m.join(e,i)))return S(i,{include:null})}let o=F(`package.json "${s}"`,t?.[s]);if(o)return o}return null}function ge(e,t,n){if(!e)return!0;let r=m.relative(n,t).split(m.sep).join("/");if(e.include.length>0&&!e.include.some(i=>ie(i).test(r))||e.exclude.some(i=>ie(i).test(r)))return!1;let s=t.split(m.sep).join("/"),o=n.split(m.sep).join("/");return!e.ignorePatterns.some(i=>i.test(s)||i.test(s.replace(o,"<rootDir>")))}var Ye=[[".ts",".tsx",".js",".jsx",".mjs",".cjs"],[".py"],[".go"],[".rs"],[".java"],[".rb"]];function pe(e){let t=v.extname(e).toLowerCase();return Ye.find(n=>n.includes(t))}function qe(e){let t=v.basename(e);return t.endsWith(".d.ts")||t.startsWith(".")||/\.config\.[cm]?[jt]sx?$/.test(t)}function j(e){try{return x.realpathSync(e)}catch{return v.resolve(e)}}function de(e,t){let n=j(t);return new Set(e.map(r=>v.isAbsolute(r.path)?j(r.path):j(v.resolve(n,r.path))))}function Ke(e,t,n){let r=!1;try{r=x.statSync(n).isDirectory()}catch{}if(!r)return{targetFiles:[],unmeasured:[]};let s=j(t),o=fe(s),i=new Set(e.map(u=>pe(u.path)).filter(Boolean)),a=de(e,t),c=_(n).filter(u=>i.has(pe(u))&&!qe(u)).map(j).filter(u=>ge(o,u,s));return{targetFiles:c,unmeasured:c.filter(u=>!a.has(u)).sort(),...o?{coverageScope:{source:o.source,readable:o.readable}}:{}}}function He(e,t){let n;try{n=x.statSync(e).mtimeMs}catch{return}let r=t.filter(s=>{try{return x.statSync(s).mtimeMs>n}catch{return!1}}).sort();return r.length>0?{reportPath:e,reportModified:new Date(n).toISOString(),newerFiles:r}:void 0}function he(e,t,n,r,s={}){let{targetFiles:o,unmeasured:i,coverageScope:a}=s.checkCompleteness===!1?{targetFiles:[],unmeasured:[],coverageScope:void 0}:Ke(e.files,n,r),c=new Set([...o,...de(t,n)]),u=s.reportPath?He(s.reportPath,[...c].filter(b=>x.existsSync(b))):void 0,f=s.excluded??[],h=[...new Set(f.flatMap(b=>b.file?[b.file]:[]))].sort();return{status:i.length>0||u||h.length>0?"insufficient-evidence":"complete",unmeasuredFiles:i,targetFiles:c.size+h.filter(b=>!c.has(b)).length,...u?{stale:u}:{},...a?{coverageScope:a}:{},...f.length>0?{excludedEntries:f}:{},...h.length>0?{conflictingFiles:h}:{}}}var w=5;function O(e,t){return e.slice(0,w).map(r=>v.relative(t,r)||r).join(", ")+(e.length>w?`, \u2026 ${e.length-w} more`:"")}function jt(e,t){if(!e)return[];let n=[],r=e.unmeasuredFiles.length;if(r>0){let o=e.coverageScope,i=o&&!o.readable?` The coverage include/exclude in ${o.source} could not be read statically, so files it leaves out may be listed here; write them as literal string arrays to have them honoured.`:"";n.push(`${r} of ${e.targetFiles} source files under the target are not in the coverage report (UNMEASURED, not counted as covered): ${O(e.unmeasuredFiles,t)}. Regenerate the report with coverage for the whole target, or exclude files that are not meant to be measured in the coverage tool's include/exclude config.${i}`)}let s=e.conflictingFiles??[];if(s.length>0&&n.push(`${s.length} source file${s.length===1?" is":"s are"} listed in the coverage report under two spellings (e.g. \`./src/a.ts\` and \`src/a.ts\`), so which entry is right is unknown; they are UNMEASURED and left out of the figures: ${O(s,t)}`),e.stale){let o=e.stale.newerFiles.length;n.push(`the coverage report ${v.relative(t,e.stale.reportPath)||e.stale.reportPath} is STALE: ${o} source file${o===1?" was":"s were"} modified after it was written (${e.stale.reportModified}): ${O(e.stale.newerFiles,t)}`)}return n}var Ze={"outside-project":"outside the project root","windows-path":"a Windows path, which cannot name a file here","duplicate-spelling":"a second spelling of a file the report already lists"};function Rt(e){let t=(e?.excludedEntries??[]).filter(s=>s.reason!=="duplicate-spelling");if(t.length===0)return[];let n=t.slice(0,w).map(s=>`${s.path} (${Ze[s.reason]})`),r=t.length>w?`, \u2026 ${t.length-w} more`:"";return[`${t.length} coverage report entr${t.length===1?"y is":"ies are"} not a project file and ${t.length===1?"is":"are"} left out of the figures: ${n.join(", ")}${r}.`]}import*as d from"fs";import*as ye from"os";import*as l from"path";$e();var Qe=["package.json","pyproject.toml","setup.py","setup.cfg","go.mod","Cargo.toml","pom.xml","build.gradle","build.gradle.kts",".git"],et=["vitest.config.ts","vitest.config.js","vitest.config.mts","vitest.config.mjs","vitest.config.cts","vitest.config.cjs","vitest.workspace.ts","vitest.workspace.js","vitest.workspace.mts","vitest.workspace.mjs","vitest.workspace.json","vite.config.ts","vite.config.js","vite.config.mts","vite.config.mjs","jest.config.ts","jest.config.js","jest.config.mts","jest.config.mjs","jest.config.cts","jest.config.cjs","jest.config.json"];function me(e){return et.some(t=>d.existsSync(l.join(e,t)))?!0:G(e)?.jest!==void 0}function W(e){let t=G(e);if(!t)return null;let n={...t.devDependencies,...t.dependencies};return n.jest||n["@jest/core"]?"jest":n.mocha||n.nyc?"nyc":n.vitest?"vitest":null}function tt(e){try{return d.readdirSync(e).some(t=>/^\.(mocharc|nycrc)(\.|$)/.test(t))}catch{return!1}}function nt(e,t){if(tt(e))return(W(t)??"vitest")==="nyc";let n=W(e);return n===null||n===(W(t)??"vitest")}function G(e){try{let t=JSON.parse(C(l.join(e,"package.json"),{outsideRoot:"allow"}));return typeof t=="object"&&t!==null?t:null}catch{return null}}function xe(e){let t=[],n=!1,s=G(e)?.workspaces,o=Array.isArray(s)?s:typeof s=="object"&&s!==null&&Array.isArray(s.packages)?s.packages:null;s!=null&&typeof s=="object"&&(n=!0),o&&t.push(...o.filter(i=>typeof i=="string"));try{let i=C(l.join(e,"pnpm-workspace.yaml"),{outsideRoot:"allow"});n=!0;let a=!1;for(let c of i.split(/\r?\n/)){let u=c.replace(/\s+#.*$/,"").trimEnd();if(/^packages\s*:/.test(u)){a=!0;continue}if(a){let f=/^\s+-\s+(.+)$/.exec(u);f?t.push(f[1].trim().replace(/^['"]|['"]$/g,"")):/^\S/.test(u)&&(a=!1)}}}catch{}return n?t:null}function rt(e){let r=e.replace(/^\.\//,"").replace(/\/+$/,"").replace(/[.+^${}()|[\]\\]/g,"\\$&").replace(/\*\*\//g,"\0").replace(/\*\*/g,"").replace(/\*/g,"[^/]*").replace(/\?/g,"[^/]").split("\0").join("(?:.*/)?").split("").join(".*");return new RegExp(`^${r}$`)}function st(e,t){let n=xe(e);if(!n)return!1;let r=l.relative(e,t).split(l.sep).join("/");if(r===""||r.startsWith("..")||l.isAbsolute(r))return!1;let s=!1;for(let o of n){let i=o.startsWith("!"),a=i?o.slice(1):o;l.isAbsolute(a)||/^[A-Za-z]:/.test(a)||a.split(/[\\/]/).includes("..")||rt(a).test(r)&&(s=!i)}return s}function J(e,t){let n=l.relative(t,e);return n===""||!n.startsWith("..")&&!l.isAbsolute(n)}function ot(e){try{return d.realpathSync(l.resolve(z(e)))}catch{return null}}function ve(e,t=12){let n;try{let a=l.resolve(e);if(!d.existsSync(a))return null;let c=d.realpathSync(a);n=d.statSync(c).isDirectory()?c:l.dirname(c)}catch{return null}let r=null;try{r=d.realpathSync(ye.homedir())}catch{r=null}let s=n,o=null,i=null;for(let a=0;a<=t;a++){if(r!==null&&n===r&&n!==s)return o;if(!o&&Qe.some(u=>d.existsSync(l.join(n,u)))){if(o=n,me(n)||!d.existsSync(l.join(n,"package.json")))return n}else if(o&&xe(n)!==null)return i??=ot(s)??"",i&&J(n,i)&&J(o,i)&&st(n,o)&&me(n)&&nt(o,n)?n:o;if(o&&d.existsSync(l.join(n,".git")))return o;let c=l.dirname(n);if(c===n)return o;n=c}return o}function _t(e,t){try{let n=d.realpathSync(t),r=d.realpathSync(l.resolve(e)),s=d.statSync(r).isDirectory()?r:l.dirname(r);for(;s!==n&&J(s,n);){if(d.existsSync(l.join(s,"package.json")))return`${l.relative(n,s).split(l.sep).join("/")}/`;let o=l.dirname(s);if(o===s)break;s=o}}catch{}return null}var it=new Set(["lcov.info","coverage-final.json","coverage-summary.json","coverage.xml","cobertura-coverage.xml","cobertura.xml"]);function at(e){let t=l.basename(e).toLowerCase();return it.has(t)||t.endsWith(".lcov")||t.endsWith(".lcov.info")}async function ct(e){let t;try{t=await B(e,{outsideRoot:"allow"})}catch{return null}if(t.trim().length===0)return null;try{let n=l.basename(e).toLowerCase(),r;if(n.endsWith(".json")){let s=JSON.parse(t);if(ut(s))r=q(t);else if(lt(s))r=Y(t);else return null}else n.endsWith(".xml")?r=K(t):r=R(t);return r.files.length>0?r:null}catch{return null}}function lt(e){let t=Object.values(e);return t.length>0&&t.every(n=>typeof n=="object"&&n!==null&&!Array.isArray(n)&&typeof n.s=="object"&&typeof n.statementMap=="object")}function ut(e){let t=e.total;return typeof t=="object"&&t!==null&&typeof t.lines=="object"}function ft(e,t){let n=l.relative(t,e);return n===""||!n.startsWith("..")&&!l.isAbsolute(n)}function U(e){try{return d.realpathSync(e)}catch{return l.resolve(e)}}function gt(e,t,n){let r=U(t),s=U(n);return s===r?[...e.files]:e.files.filter(o=>{let i=l.isAbsolute(o.path)?U(o.path):l.resolve(r,o.path);return ft(i,s)})}function be(e,t,n,r={}){if(r.numTotalTests===0)return{status:"no-data",reason:"no-tests-ran"};let s=gt(e,t,n),{keys:o,excluded:i}=H(s.map(f=>f.path),t),a=s.filter(f=>o.has(f.path));if(a.length===0)return{status:"no-data",reason:"target-not-covered"};let c=a.filter(f=>!E(f.path,t));if(c.length===0)return{status:"no-data",reason:"test-only-report"};let u=he(e,c,t,n,{reportPath:r.reportPath,checkCompleteness:r.checkCompleteness,excluded:i.filter(f=>!f.file||!E(f.file,t))});return{status:"measured",files:c,evidence:u}}async function Nt(e){let t=l.resolve(e),n;try{n=d.statSync(t)}catch{return{status:"target-missing",target:t}}if(n.isFile()&&at(t)){let o=l.dirname(t),i=ve(o)??(l.basename(o)==="coverage"?l.dirname(o):o),a=await ct(t),c=a?be(a,i,i,{reportPath:t,checkCompleteness:!1}):{status:"no-data",reason:"unreadable-report"};return{status:"evaluated",target:t,projectRoot:i,source:"report-file",evaluation:c}}let r=ve(t)??(n.isDirectory()?t:l.dirname(t)),s=await V(r);return s?{status:"evaluated",target:t,projectRoot:r,source:"project-report",evaluation:be(s.data,r,t,{reportPath:s.path})}:{status:"no-report",target:t,projectRoot:r}}function Mt(e,t,n){let r=[e.line];n.statement!==!1&&r.push(e.statement),n.branch&&r.push(e.branch),n.function&&r.push(e.function);let s=r.reduce((o,i)=>o+i,0)/r.length;return{overall:s,meetsThreshold:s>=t}}var pt=/^Coverage is [\d.]+% below threshold/i;function It(e,t,n,r){let s=e.filter(o=>!pt.test(o)&&(r.branch||!/branch coverage/i.test(o))&&(r.function||!/function coverage/i.test(o)));return t.meetsThreshold?s:[`Coverage is ${(n-t.overall).toFixed(1)}% below threshold. Focus on high-risk files first.`,...s]}function Lt(e){return e==="target-not-covered"||e==="no-tests-ran"}function Ot(e,t,n){switch(e){case"target-missing":return`Target does not exist: ${t}`;case"unreadable-report":return`Unreadable coverage report: ${t}. It could not be parsed or lists no files. Supported: lcov.info, istanbul coverage-final.json / coverage-summary.json, Cobertura XML. Raw V8 output is not supported \u2014 convert it with c8 or your runner's istanbul reporter.`;case"test-only-report":return"The coverage report contains only test files, so there is no production coverage to report. Coverage OF a test file is not a meaningful metric. Check that your coverage tool is instrumenting your source directory.";case"target-not-covered":return`Target is UNMEASURED: the coverage data for project ${n??"?"} has no entry for any production file under ${t}. This is not 0% coverage \u2014 no measurement exists for it. Check your coverage tool's include/exclude settings, or regenerate the report.`;case"no-tests-ran":return`Target is UNMEASURED: the test runner reported running 0 tests from ${n??"?"}. This is not 0% coverage.`}}export{Ae as a,re as b,vt as c,bt as d,yt as e,jt as f,Rt as g,_t as h,ct as i,gt as j,be as k,Nt as l,Mt as m,It as n,Lt as o,Ot as p};
|
|
@@ -1,2 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{c as i,e as m}from"./chunk-KNSRL6NO.js";m();var u='expected [{ "functionName": "add", "args": [2, 3], "expected": 5 }]',g={type:"object",description:"One caller-owned specification example",properties:{functionName:{type:"string",description:"Named export of the source file to call"},args:{type:"array",description:"Positional JSON arguments; length must equal the function arity",items:{}},expected:{description:"Expected JSON return value (use null for a null result)"}},required:["functionName","args","expected"]};function d(t,s="Behavior example value"){let o=(e,r)=>{if(!(e===null||typeof e=="string"||typeof e=="boolean")&&!(typeof e=="number"&&Number.isFinite(e)&&!Object.is(e,-0))){if(typeof e!="object"||r.has(e))throw new i(`${s} must be finite JSON data (no undefined, functions, NaN/Infinity, cycles, or negative zero)`);if(!Array.isArray(e)&&Object.getPrototypeOf(e)!==Object.prototype&&Object.getPrototypeOf(e)!==null)throw new i(`${s} must contain only plain JSON objects`);r.add(e);for(let l of Array.isArray(e)?Array.from(e):Object.values(e))o(l,r);r.delete(e)}};o(t,new Set)}function h(t){if(t!==void 0){if(!Array.isArray(t))throw new i(`behaviorExamples must be an array; ${u}`);return t.forEach((s,o)=>{let e=`behaviorExamples[${o}]`;if(typeof s!="object"||s===null||Array.isArray(s))throw new i(`${e} must be an object; ${u}`);let r=s;if(typeof r.functionName!="string"||r.functionName.trim()==="")throw new i(`${e}.functionName must be a non-empty string`);if(!Array.isArray(r.args))throw new i(`${e}.args must be an array of arguments`);if(!Object.prototype.hasOwnProperty.call(r,"expected"))throw new i(`${e}.expected is required (use null for a null result)`);d(r.args,`${e}.args`),d(r.expected,`${e}.expected`)}),t}}function x(t,s){let o=new Map(t.failedTests.map(n=>[n.testId,n])),e=s.tests??[],r={totalRetries:s.retried,nowPassing:s.nowPassing,stillFailing:s.stillFailing,tests:e.map(({testId:n,...a})=>({name:o.get(n)?.testName??n,file:o.get(n)?.file??"",...a}))};t.retries=r;let l=new Set(e.filter(n=>n.passed&&!n.unmatched).map(n=>n.testId)),f=t.failedTests.filter(n=>l.has(n.testId));if(f.length!==0&&(t.failedTests=t.failedTests.filter(n=>!l.has(n.testId)),t.failed=Math.max(0,t.failed-f.length),t.passed+=f.length,t.flaky=(t.flaky??0)+f.length,t.failed===0&&t.status==="failed"&&(t.status="passed"),t.testCases)){let n=[...f];t.testCases=t.testCases.map(a=>{if(a.status!=="failed")return a;let c=n.findIndex(p=>p.testName===a.name&&p.file===a.file);return c<0?a:(n.splice(c,1),{...a,status:"passed",flaky:!0})})}}export{g as a,d as b,h as c,x as d};
|
|
@@ -1,3 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{c as J}from"./chunk-QPEOLAAS.js";import{c as $}from"./chunk-NZU4ACBZ.js";import{b as K,d as Q}from"./chunk-V5NHZV7S.js";import{c as P,d as G}from"./chunk-AGRV5B3T.js";import*as W from"fs/promises";import*as C from"path";Q();async function ie(e){let s=[C.join(e,"coverage","coverage-final.json"),C.join(e,"coverage","lcov.info"),C.join(e,".nyc_output","coverage-final.json"),C.join(e,"coverage-final.json"),C.join(e,"coverage","coverage-summary.json"),C.join(e,"coverage.xml"),C.join(e,"htmlcov","status.json"),C.join(e,"cobertura-coverage.xml")];for(let t of s)try{let c=await $(t,{outsideRoot:"allow"});if(t.endsWith("coverage-summary.json"))return{data:Z(c),path:t};if(t.endsWith(".json"))return{data:Y(c),path:t};if(t.endsWith(".info"))return{data:ee(c),path:t};if(t.endsWith(".xml"))return{data:te(c),path:t}}catch{}return null}function V(e){let s=new Map,t=e.statementMap||{};for(let[c,l]of Object.entries(e.s||{})){let r=t[c]?.start?.line;if(typeof r!="number")continue;let o=s.get(r);(o===void 0||o<l)&&s.set(r,l)}return s}function Y(e){let s=K(e),t=[],c=0,l=0,r=0,o=0,n=0,u=0,g=0,a=0;for(let[b,f]of Object.entries(s)){let p=f,d=p.s||{},F=p.branchMap||{},v=p.b||{},R=p.f||{},i=V(p),w=i.size,x=[...i.values()].filter(h=>h>0).length,y=Object.values(v).flat().length,N=Object.values(v).flat().filter(h=>h>0).length,L=Object.keys(R).length,S=Object.values(R).filter(h=>h>0).length,k=Object.keys(d).length,I=Object.values(d).filter(h=>h>0).length,_=[...i.entries()].filter(([,h])=>h===0).map(([h])=>h),B=[];for(let[h,M]of Object.entries(v)){let D=F[h];M.forEach((E,j)=>{E===0&&D?.locations?.[j]?.start?.line&&B.push(D.locations[j].start.line)})}t.push({path:b,lines:{covered:x,total:w},branches:{covered:N,total:y},functions:{covered:S,total:L},statements:{covered:I,total:k},uncoveredLines:_.sort((h,M)=>h-M),uncoveredBranches:Array.from(new Set(B)).sort((h,M)=>h-M)}),c+=w,l+=x,r+=y,o+=N,n+=L,u+=S,g+=k,a+=I}return{files:t,summary:{line:c>0?l/c*100:0,branch:r>0?o/r*100:0,function:n>0?u/n*100:0,statement:g>0?a/g*100:0,files:t.length}}}function Z(e){let s=K(e),t=o=>({covered:Number(o?.covered)||0,total:Number(o?.total)||0}),c=[];for(let[o,n]of Object.entries(s))o==="total"||typeof n!="object"||n===null||!n.lines||c.push({path:o,lines:t(n.lines),branches:t(n.branches),functions:t(n.functions),statements:t(n.statements??n.lines),uncoveredLines:[],uncoveredBranches:[]});let l=o=>c.reduce((n,u)=>({covered:n.covered+o(u).covered,total:n.total+o(u).total}),{covered:0,total:0}),r=o=>o.total>0?o.covered/o.total*100:0;return{files:c,summary:{line:r(l(o=>o.lines)),branch:r(l(o=>o.branches)),function:r(l(o=>o.functions)),statement:r(l(o=>o.statements)),files:c.length}}}function ee(e){let s=[],t=e.split(`
|
|
3
|
-
`),c=null,l=0,r=0,o=0,n=0,u=0,g=0,a=[],b=[];for(let i of t)if(i.startsWith("SF:"))c=i.slice(3);else if(i.startsWith("LF:"))l=parseInt(i.slice(3),10);else if(i.startsWith("LH:"))r=parseInt(i.slice(3),10);else if(i.startsWith("BRF:"))o=parseInt(i.slice(4),10);else if(i.startsWith("BRH:"))n=parseInt(i.slice(4),10);else if(i.startsWith("FNF:"))u=parseInt(i.slice(4),10);else if(i.startsWith("FNH:"))g=parseInt(i.slice(4),10);else if(i.startsWith("DA:")){let[w,x]=i.slice(3).split(",").map(y=>parseInt(y,10));x===0&&a.push(w)}else if(i.startsWith("BRDA:")){let w=i.slice(5).split(","),x=parseInt(w[0],10),y=w[3];(y==="0"||y==="-")&&b.push(x)}else i==="end_of_record"&&c&&(s.push({path:c,lines:{covered:r,total:l},branches:{covered:n,total:o},functions:{covered:g,total:u},statements:{covered:0,total:0},uncoveredLines:Array.from(new Set(a)),uncoveredBranches:Array.from(new Set(b))}),c=null,l=r=0,o=n=0,u=g=0,a.length=0,b.length=0);let f=0,p=0,d=0,F=0,v=0,R=0;for(let i of s)f+=i.lines.total,p+=i.lines.covered,d+=i.branches.total,F+=i.branches.covered,v+=i.functions.total,R+=i.functions.covered;return{files:s,summary:{line:f>0?p/f*100:0,branch:d>0?F/d*100:0,function:v>0?R/v*100:0,statement:f>0?p/f*100:0,files:s.length}}}function te(e){let s=[];function t(d,F){let v=d.match(new RegExp(`${F}=["']([^"']*)["']`));return v?v[1]:null}let c=/<class\s[^>]*?>/g,l;for(;(l=c.exec(e))!==null;){let d=l[0],F=t(d,"filename");if(!F)continue;let v=parseFloat(t(d,"line-rate")||"NaN"),R=parseFloat(t(d,"branch-rate")||"NaN"),i=l.index,w=e.indexOf("</class>",i),x=w>i?e.slice(i,w):"",y=0,N=0,L=0,S=0,k=0,I=0,_=[],B=[],h=/<line\s([^>]*?)\/>/g,M;for(;(M=h.exec(x))!==null;){let j=M[1],T=parseInt(t(j,"number")||"0",10),O=parseInt(t(j,"hits")||"0",10),z=t(j,"branch")==="true",A=t(j,"condition-coverage");y++,O>0?N++:_.push(T),z&&(L++,(A?parseInt(A,10):O>0?100:0)===100?S++:B.push(T))}let D=/<method\s([^>]*?)>/g,E;for(;(E=D.exec(x))!==null;){k++;let j=E.index,T=x.indexOf("</method>",j);if(T>j){let O=x.slice(j,T),z=/<line\s([^>]*?)\/>/g,A=!1,H;for(;(H=z.exec(O))!==null;)if(parseInt(t(H[1],"hits")||"0",10)>0){A=!0;break}A&&I++}}y===0&&!isNaN(v)&&(y=100,N=Math.round(Math.max(0,Math.min(1,v))*100)),s.push({path:F,lines:{covered:N,total:y},branches:{covered:S,total:L},functions:{covered:I,total:k},statements:{covered:0,total:0},uncoveredLines:_,uncoveredBranches:B})}let r=0,o=0,n=0,u=0,g=0,a=0;for(let d of s)r+=d.lines.total,o+=d.lines.covered,n+=d.branches.total,u+=d.branches.covered,g+=d.functions.total,a+=d.functions.covered;let b=e.match(/<coverage\s[^>]*?>/),f=b?parseFloat(t(b[0],"line-rate")||"NaN")*100:NaN,p=b?parseFloat(t(b[0],"branch-rate")||"NaN")*100:NaN;return{files:s,summary:{line:isNaN(f)?r>0?o/r*100:0:f,branch:isNaN(p)?n>0?u/n*100:0:p,function:g>0?a/g*100:0,statement:r>0?o/r*100:0,files:s.length}}}async function ce(e,s={}){let t=[],{includeTests:c=!0,languages:l,maxFiles:r=5e3,completeScope:o=!1}=s,n=[".ts",".tsx",".mts",".cts",".js",".jsx",".mjs",".cjs",".py",".pyw",".go",".rs",".java",".kt",".kts",".rb",".cs",".php",".swift",".c",".h",".cpp",".hpp",".cc",".scala"];if(l&&l.length>0){n=[];for(let a of l)a==="typescript"&&n.push(".ts",".tsx",".mts",".cts"),a==="javascript"&&n.push(".js",".jsx",".mjs",".cjs"),a==="python"&&n.push(".py",".pyw"),a==="go"&&n.push(".go"),a==="rust"&&n.push(".rs"),a==="java"&&n.push(".java"),a==="kotlin"&&n.push(".kt",".kts"),a==="ruby"&&n.push(".rb"),(a==="csharp"||a==="c#")&&n.push(".cs"),a==="php"&&n.push(".php"),a==="swift"&&n.push(".swift"),(a==="c"||a==="cpp"||a==="c++")&&n.push(".c",".h",".cpp",".hpp",".cc"),a==="scala"&&n.push(".scala")}o&&(!l||l.length===0)&&n.push(".vue",".svelte");async function u(a){try{let b=await W.readdir(a,{withFileTypes:!0});for(let f of b){let p=C.join(a,f.name);if(f.isDirectory()){if(["node_modules",".git","dist","build","coverage",".nyc_output","__pycache__",".venv","venv",".tox",".mypy_cache","target",".gradle","vendor",".bundle",".cache",".npm",".yarn",".next",".nuxt",".svelte-kit","out",".turbo","tmp","temp",".tmp"].includes(f.name)||J(a,f.name,a===e))continue;if(t.length>=r)return;await u(p)}else if(f.isFile()||o&&f.isSymbolicLink()&&await g(p)){let d=C.extname(f.name);if(!n.includes(d)||!c&&(f.name.includes(".test.")||f.name.includes(".spec.")||f.name.endsWith("_test.ts")||f.name.endsWith("_test.js")||p.includes("/__tests__/")||p.includes("/test/")||p.includes("/tests/")))continue;if(t.length>=r)return;t.push(p)}}}catch{}}async function g(a){try{return(await W.stat(a)).isFile()}catch{return!1}}try{if((await W.stat(e)).isFile())return[e];await u(e)}catch{}return t}function le(e){let s=new Set,t={injection:"Use parameterized queries and input validation to prevent injection attacks",xss:"Sanitize user input and use Content-Security-Policy headers","sensitive-data":"Never hardcode secrets; use environment variables or secret managers","access-control":"Implement proper authentication and authorization checks","security-misconfiguration":"Review and harden security configurations","insecure-deserialization":"Avoid deserializing untrusted data; use safe alternatives","broken-auth":"Use strong authentication mechanisms and secure session management",dependencies:"Keep dependencies updated and regularly audit for vulnerabilities"};for(let r of e){let o=t[r.category];o&&s.add(o)}let c=e.some(r=>r.severity==="critical"),l=e.some(r=>r.severity==="high");return c&&s.add("CRITICAL: Address critical vulnerabilities immediately before deployment"),l&&s.add("Prioritize fixing high-severity issues in the next sprint"),s.size===0&&e.length===0&&s.add("No vulnerabilities found - maintain current security practices"),Array.from(s)}G();import*as U from"fs";import*as m from"path";function X(e,s){return m.isAbsolute(e)?m.normalize(e):m.resolve(s??P(),e)}function q(e,s){let t=m.relative(e,s);return t!==""&&t!==".."&&!t.startsWith(`..${m.sep}`)&&!m.isAbsolute(t)}function ne(e){try{return U.realpathSync(e)}catch{return e}}function se(e,s){let t=m.resolve(s??P()),c=ne(t),l=new Map,r=[],o=new Map;for(let n of e){if(!m.isAbsolute(n)&&m.win32.isAbsolute(n)){r.push({path:n,reason:"windows-path"});continue}let u=X(n,t);if(!q(t,u)&&!q(c,u)){r.push({path:n,reason:"outside-project"});continue}l.set(n,u),o.set(u,(o.get(u)??0)+1)}for(let[n,u]of l)(o.get(u)??0)>1&&(l.delete(n),r.push({path:n,reason:"duplicate-spelling",file:u}));return{keys:l,excluded:r}}function de(e,s){return se(e,s).keys}function pe(e,s){let t=`coverage:file:${X(e,s)}`,c=`coverage:file:${e}`;return t===c?[t]:[t,c]}function he(e){return{branch:e.some(s=>s.branches.total>0),function:e.some(s=>s.functions.total>0),statement:e.some(s=>s.statements.total>0)}}function me(e,s){return{line:e.line,branch:s.branch?e.branch:null,function:s.function?e.function:null,statement:s.statement?e.statement:null,files:e.files}}export{ie as a,V as b,Y as c,Z as d,ee as e,te as f,ce as g,le as h,X as i,se as j,de as k,pe as l,he as m,me as n};
|
|
@@ -1,4 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a,d as R}from"./chunk-XIIQ5QTT.js";import{realpathSync as x,statSync as y}from"node:fs";import{basename as h,dirname as E,extname as $,resolve as p,sep as j}from"node:path";function m(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function N(e,t=process.cwd()){let r=p(t,e);try{return p(x(E(r)),h(r))}catch{return r}}function S(e){try{return y(e).isDirectory()}catch{return $(e)===""}}function A(e,t=process.cwd()){let r=N(e,t),n=r.split(j).join("/"),s=S(r)?"(?:/|$)":"$";return`^${m(n)}${s}`}function k(e,t){let r=`^${t.split(" ").map(m).join("(?: > | )")}$`;return e==="mocha"?`--grep=${r}`:`--testNamePattern=${r}`}function P(e){return e.some(t=>/(^|[\\/])jest(\.cmd|\.js|\.mjs)?$/i.test(t))}R();var c=class extends Error{constructor(t){super(a(t,Number.POSITIVE_INFINITY)),this.name="TestRunnerExecutionError"}};function b(e,t=4e3){return a(e,Number.POSITIVE_INFINITY).slice(0,t)}function z(e,t,r,n,s,i){let l=(i?.testResults??[]).filter(u=>u.status==="failed"&&(e==="vitest"&&u.message||!u.assertionResults?.some(g=>g.status==="failed"))),o;if(r===null?o="terminated without an exit code":n.passed+n.failed+n.skipped===0?o="reported zero tests":l.length>0||(i?.numRuntimeErrorTestSuites??0)>0||(i?.numFailedTestSuites??0)>0&&n.failed===0?o="reported a suite execution error":(r!==0||i?.success===!1)&&n.failed===0&&(o="failed without a failed assertion"),!o)return;let d=[...l.map(u=>u.message).filter(Boolean),s.trim()].filter(Boolean).join(`
|
|
3
|
-
`);return new c(`${e} ${o} for ${t} (exit code ${r??"unknown"}).`+(d?`
|
|
4
|
-
${b(d)}`:""))}import{mkdtempSync as T,readFileSync as F,rmSync as w}from"node:fs";import{tmpdir as I}from"node:os";import{join as f}from"node:path";function J(e,t){if(!t)return;let r;try{r=F(t,"utf-8")}catch(n){if(n.code==="ENOENT")return;throw new Error("Could not read the current Vitest JSON report.")}try{let n=JSON.parse(r);if(!n||!Array.isArray(n.testResults))throw new Error("Invalid report")}catch{throw new Error("The current Vitest JSON report is malformed.")}return r}function q(){let e=T(f(I(),"aqe-vitest-report-")),t=f(e,"report.json"),r=!1;return{path:t,args:[`--outputFile=${t}`],read:n=>J(n,t),cleanup:()=>{if(!r){r=!0;try{w(e,{recursive:!0,force:!0})}catch{}}}}}function W(e){let t=e.some(s=>/(^|[\\/])vitest(\.cmd|\.js|\.mjs)?$/i.test(s)),r=e.some((s,i)=>s==="--reporter=json"||s==="--reporter"&&e[i+1]==="json"),n=e.some(s=>s.startsWith("--outputFile"));return t&&r&&!n}export{N as a,A as b,k as c,P as d,c as e,b as f,z as g,q as h,W as i};
|
|
@@ -1,7 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
import{a as u,e as I}from"./chunk-KNSRL6NO.js";import{a as p,q as D}from"./chunk-2H4XH6FT.js";import{b as E}from"./chunk-AJMJNQMP.js";import{existsSync as l,renameSync as m,copyFileSync as O,readdirSync as F,statSync as N,openSync as j,readSync as B,closeSync as U,writeFileSync as C,rmSync as S}from"node:fs";import{join as _,dirname as Q}from"node:path";function $(e){if(!l(e))return!0;let t;try{t=N(e).size}catch{return!1}if(t===0)return!0;if(t<g.length)return!1;let n;try{n=j(e,"r");let r=Buffer.alloc(g.length);return B(n,r,0,g.length,0),r.equals(g)}catch{return!1}finally{if(n!==void 0)try{U(n)}catch{}}}function W(e){let t;try{return t=new p(e,{readonly:!0,fileMustExist:!0}),t.pragma("integrity_check",{simple:!0})==="ok"}catch{return!1}finally{try{t?.close()}catch{}}}function q(e){return _(Q(e),"backups","verified")}function G(e){if(!l(e))return null;let t=F(e).filter(n=>n.startsWith("memory-")&&n.endsWith(".db")).map(n=>{let r=_(e,n);return{path:r,mtime:N(r).mtimeMs}}).sort((n,r)=>r.mtime-n.mtime);for(let n of t)if(W(n.path))return n.path;return null}function v(e,t){if($(e))return{restored:!1,reason:"healthy"};let n=t?.backupDir??q(e),r=G(n);if(!r)return{restored:!1,reason:"no-verified-backup"};let o=`${e}.restore.lock`;try{C(o,String(process.pid),{flag:"wx"})}catch{return{restored:!1,reason:"restore-in-progress"}}try{if($(e))return{restored:!1,reason:"healthy"};let f=t?.now??Date.now(),a=`${e}.corrupt-${f}`;try{l(e)&&m(e,a);for(let i of["-wal","-shm"])l(e+i)&&m(e+i,a+i)}catch{return{restored:!1,reason:"park-failed"}}let c=`${e}.restoring-${f}`;try{O(r,c),m(c,e)}catch{try{l(c)&&S(c,{force:!0}),!l(e)&&l(a)&&m(a,e)}catch{}return{restored:!1,reason:"copy-failed"}}return{restored:!0,reason:"restored-from-backup",backupUsed:r,parkedTo:a}}finally{try{S(o,{force:!0})}catch{}}}var g,R=E(()=>{"use strict";D();g=Buffer.concat([Buffer.from("SQLite format 3","latin1"),Buffer.from([0])])});function H(e){let t=[],n=e;for(let r=0;n!=null&&r<5;r++){t.push(u(n));let o=n.code;typeof o=="string"&&t.push(o),n=n.cause}return t.join(`
|
|
3
|
-
`)}function Y(e){let t=e.split(`
|
|
4
|
-
`)[0].trim();return t.endsWith("Tried:")?t.slice(0,-6).trimEnd():t}function A(e,t="better-sqlite3"){if(e==null)return null;let n=H(e),r=Y(u(e));return K.some(o=>o.test(n))?{moduleName:t,reason:"missing-binding",detail:r}:V.some(o=>o.test(n))?{moduleName:t,reason:"abi-mismatch",detail:r}:z.some(o=>o.test(n))?{moduleName:t,reason:"load-failed",detail:r}:null}function Z(e){let{moduleName:t}=e;return[`${t} ${h}: ${X[e.reason]}`," Fix a global install (reinstall, naming the package):",` npm install -g agentic-qe --allow-scripts=${J}`," Or rebuild just the native module in an existing global install:",` npm rebuild -g ${t} --allow-scripts=${t}`," For a project-local install (devDependency), run in the project:",` npm install-scripts approve ${t} && npm rebuild ${t}`,` Original error: ${e.detail}`].join(`
|
|
5
|
-
`)}function M(e,t="better-sqlite3"){if(e instanceof d||u(e).includes(h))return e;let n=A(e,t);return n?new d(n,e):e}function se(e){return e instanceof d||u(e).includes(h)||A(e)!==null}var h,J,K,V,z,X,d,x=E(()=>{"use strict";I();h="native module could not be loaded",J="agentic-qe,better-sqlite3,hnswlib-node",K=[/Could not locate the bindings file/i],V=[/NODE_MODULE_VERSION/,/compiled against a different Node\.js version/i,/Module did not self-register/i],z=[/ERR_DLOPEN_FAILED/,/invalid ELF header/i,/wrong ELF class/i,/incompatible architecture/i,/mach-o file, but is an incompatible architecture/i,/\.node: cannot open shared object file/i,/is not a valid Win32 application/i];X={"missing-binding":"its compiled binary is missing. Its install script never ran \u2014 npm 12+ blocks dependency install scripts unless they are allowed (allowScripts).","abi-mismatch":`it was built for a different Node.js version than the one running now (${process.version}). Rebuild it after switching Node versions.`,"load-failed":"the binary exists but the OS refused to load it (wrong platform/architecture or a corrupt build)."};d=class extends Error{moduleName;reason;constructor(t,n){super(Z(t),{cause:n}),this.name="NativeModuleLoadError",this.moduleName=t.moduleName,this.reason=t.reason}}});import{basename as P}from"node:path";function fe(e,t){let n=t?.readonly??!1,r=t?.fileMustExist??!1,o=t?.busyTimeout??5e3,f=t?.walMode??!n;if(t?.autoRestore&&!n){let s=v(e,{backupDir:t.backupDir});s.restored?console.warn(`[safe-db] memory DB at ${e} was malformed; auto-restored from ${s.backupUsed}. Corrupt original parked at ${s.parkedTo}.`):s.reason==="no-verified-backup"&&console.error(`[safe-db] memory DB at ${e} appears malformed and NO verified backup was found to restore from. Leaving it in place for manual inspection.`)}let a=(process.env.AQE_JOURNAL_MODE??"").trim().toUpperCase(),c=process.env.AQE_DISABLE_WAL==="1"||a==="DELETE"||a==="TRUNCATE",i;try{i=new p(e,{readonly:n,fileMustExist:r})}catch(s){throw M(s)}if(i.pragma(`busy_timeout = ${o}`),c){if(!n){let s=(a||"DELETE").toUpperCase(),y=String(i.pragma("journal_mode",{simple:!0})??"").toUpperCase();if(y!==s){try{i.pragma(`journal_mode = ${s}`)}catch(b){let k=b?.code;if(i.close(),k!=="SQLITE_BUSY"&&k!=="SQLITE_LOCKED")throw b;let T=P(e),L=process.env.AQE_DISABLE_WAL==="1"?"AQE_DISABLE_WAL=1":`AQE_JOURNAL_MODE=${a}`;throw new Error(`[safe-db] cannot switch ${e} from '${y}' to '${s}' \u2014 another process holds the database open. ${L} declares WAL unsafe on this filesystem, so writing in '${y}' is NOT safe and this open is refused. Find the holder with:
|
|
6
|
-
for p in /proc/[0-9]*; do for f in $p/fd/*; do readlink "$f" 2>/dev/null | grep -q ${JSON.stringify(T)} && echo "$(basename $p) $(tr '\\0' ' ' < $p/cmdline)"; done; done | sort -u
|
|
7
|
-
then stop it and retry. Original error: ${b.message}`)}let w=String(i.pragma("journal_mode",{simple:!0})??"").toUpperCase();if(w!==s)throw i.close(),new Error(`[safe-db] journal_mode switch to '${s}' silently did not take on ${e} (still '${w}'). Refusing to write in an unsafe mode.`)}}}else f&&i.pragma("journal_mode = WAL");return i}var ee=E(()=>{D();R();x()});export{M as a,se as b,x as c,fe as d,ee as e};
|
|
@@ -1,2 +0,0 @@
|
|
|
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.16");process.exit(0)}
|
|
2
|
-
var l="defect-intelligence",d=["critical","high","medium","low","info"],m=e=>!!e&&typeof e=="object"&&!Array.isArray(e);function u(e){if(!m(e))return null;let{file:i,probability:t,riskLevel:r}=e;if(typeof i!="string"||i.length===0||typeof t!="number"||!Number.isFinite(t)||t<0||t>1||!d.includes(r))return null;let c=Array.isArray(e.factors)?e.factors.filter(o=>m(o)&&typeof o.name=="string"&&typeof o.contribution=="number"&&Number.isFinite(o.contribution)):[],a=Array.isArray(e.recommendations)?e.recommendations.filter(o=>typeof o=="string"):[];return{file:i,probability:t,riskLevel:r,factors:c,recommendations:a}}function f(e,i){if(!m(e)||typeof e.id!="string"||typeof e.timestamp!="string")return null;let t=Date.parse(e.timestamp);if(!Number.isFinite(t)||t>i+6e4||i-t>6048e5||!Array.isArray(e.predictions)||e.predictions.length===0)return null;let r=e.predictions.map(u);return r.some(c=>c===null)?null:{id:e.id,timestamp:e.timestamp,predictions:r,...e.predictionMethod==="static-code-indicators"?{predictionMethod:"static-code-indicators",estimated:!0,filesSkipped:typeof e.filesSkipped=="number"&&Number.isSafeInteger(e.filesSkipped)&&e.filesSkipped>=0?e.filesSkipped:0}:{}}}async function A(e,i="defect-intelligence:predictor"){let t=`${i}:prediction:`,r=await e.search(`${t}*`,Number.MAX_SAFE_INTEGER,{namespace:l}),c=Date.now(),a=[],o=[];for(let n of r){let s=n.startsWith(`${l}:${t}`)?n.slice(l.length+1):n;if(!s.startsWith(t))continue;let p=f(await e.get(s,{namespace:l}),c);p?a.push({key:s,timestamp:Date.parse(p.timestamp),id:p.id}):o.push(s)}a.sort((n,s)=>s.timestamp-n.timestamp||(n.id===s.id?n.key===s.key?0:n.key>s.key?-1:1:n.id>s.id?-1:1));for(let n of[...o,...a.slice(32).map(s=>s.key)])await e.delete(n,{namespace:l})}function g(e){let i=e.replace(/[.+^${}()|[\]\\]/g,"\\$&");return new RegExp(`^${i.replace(/\*/g,".*").replace(/\?/g,".")}$`,"s")}function y(e,i,t){return g(t).test(e)?e:e.startsWith(`${i}:`)?e.slice(i.length+1):e}var k=1e4,h=32;async function b(e,i,t={}){let r=Math.max(1,Math.floor(t.pageSize??k)),c=await e.search(i,r,t.retrieve);for(let n=1;c.length>=r;n++){if(n>=h)throw new Error(`searchAllKeys('${i}'): the backend never returned a short page after ${n} requests (last limit ${r}); refusing to return a possibly incomplete key list`);r*=2,c=await e.search(i,r,t.retrieve)}let a=t.retrieve?.namespace,o=a?c.map(n=>y(n,a,i)):c;return[...new Set(o)].sort()}export{f as a,A as b,y as c,b as d};
|