agentic-qe 3.15.17 → 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 +123 -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-6BUOFQZA.js → agent-booster-wasm-UFNJNF3M.js} +2 -2
- package/dist/cli/chunks/{agent-handler-HPDK3JI3.js → agent-handler-EAYVRJXN.js} +2 -2
- package/dist/cli/chunks/{agent-memory-branch-5QKUTWK5.js → agent-memory-branch-M65C6WAQ.js} +2 -2
- package/dist/cli/chunks/aqe-learning-engine-O6NJBCCM.js +2 -0
- package/dist/cli/chunks/{arena-HZ35LESR.js → arena-2GDICP6R.js} +4 -4
- package/dist/cli/chunks/{arena-7OKPMNHD.js → arena-CG3X67OE.js} +2 -2
- package/dist/cli/chunks/{audit-XI575SVK.js → audit-F4FSPJPL.js} +3 -3
- package/dist/cli/chunks/base-J2FXOE77.js +2 -0
- package/dist/cli/chunks/{better-sqlite3-YO5X7ZJS.js → better-sqlite3-2MCFXW4J.js} +2 -2
- package/dist/cli/chunks/brain-handler-WGTJNYNB.js +95 -0
- package/dist/cli/chunks/{branch-enumerator-N6G44UU2.js → branch-enumerator-KL7C535H.js} +2 -2
- package/dist/cli/chunks/{browser-EVKPTLOI.js → browser-SJEXDVHS.js} +2 -2
- package/dist/cli/chunks/browser-workflow-LXGER6ZD.js +2 -0
- package/dist/cli/chunks/{chunk-VLTDW7XJ.js → chunk-244RKAEP.js} +2 -2
- package/dist/cli/chunks/{chunk-CVPXHDQU.js → chunk-27TUMXPD.js} +1 -1
- package/dist/cli/chunks/{chunk-FBBPRVNF.js → chunk-2MBYDPCP.js} +2 -2
- package/dist/cli/chunks/{chunk-P3D7SEHW.js → chunk-2Q6DTBMT.js} +1 -1
- package/dist/cli/chunks/{chunk-NE3LRUNC.js → chunk-355MI7RV.js} +13 -13
- package/dist/cli/chunks/{chunk-YCVLKU6H.js → chunk-3LX5OKBD.js} +2 -2
- package/dist/cli/chunks/{chunk-74MDUIAZ.js → chunk-3RPDKJGV.js} +1 -1
- package/dist/cli/chunks/{chunk-OWIQR6N2.js → chunk-3YMIT73A.js} +2 -2
- package/dist/cli/chunks/{chunk-VKREKVFI.js → chunk-43KUVBSU.js} +2 -2
- package/dist/cli/chunks/chunk-477FKXSS.js +2 -0
- package/dist/cli/chunks/{chunk-XPTCQKVE.js → chunk-4BIMTRRX.js} +1 -1
- package/dist/cli/chunks/{chunk-HD6W6PHV.js → chunk-4CVNVBX5.js} +2 -2
- package/dist/cli/chunks/{chunk-CQER6IJ5.js → chunk-4HL3SD4A.js} +1 -1
- package/dist/cli/chunks/{chunk-ZNXM6WVL.js → chunk-4PEG4DU2.js} +2 -2
- package/dist/cli/chunks/{chunk-BSIWI4ES.js → chunk-4QSQKFED.js} +2 -2
- package/dist/cli/chunks/chunk-53ZBETYR.js +16 -0
- package/dist/cli/chunks/{chunk-BHQ2DLJU.js → chunk-544KDWL4.js} +1 -1
- package/dist/cli/chunks/chunk-54RCGMLB.js +8 -0
- package/dist/cli/chunks/{chunk-TDZ6N43D.js → chunk-5AGXIZQ5.js} +2 -2
- package/dist/cli/chunks/{chunk-RKCN4B26.js → chunk-5M24X6W7.js} +2 -2
- package/dist/cli/chunks/{chunk-GG7PMTHD.js → chunk-5O5T4LEU.js} +1 -1
- package/dist/cli/chunks/{chunk-OWIZBZLN.js → chunk-5RFXX4IF.js} +2 -2
- package/dist/cli/chunks/{chunk-VQFV2IPV.js → chunk-62MLAQRJ.js} +1 -1
- package/dist/cli/chunks/{chunk-PCL5JRKN.js → chunk-6D6TGL2E.js} +2 -2
- package/dist/cli/chunks/{chunk-WBDWHHKP.js → chunk-6IHZDSDL.js} +2 -2
- package/dist/cli/chunks/{chunk-UOVCTK5L.js → chunk-6P3Y45QL.js} +2 -2
- package/dist/cli/chunks/{chunk-45223KK6.js → chunk-6TEVM3X3.js} +10 -10
- package/dist/cli/chunks/{chunk-K7WAI662.js → chunk-7XTUKKRA.js} +1 -1
- package/dist/cli/chunks/chunk-A3GDX6UF.js +2 -0
- package/dist/cli/chunks/{chunk-GN6OE3JT.js → chunk-A5YTKKNA.js} +1 -1
- package/dist/cli/chunks/{chunk-KR2TAAF6.js → chunk-ADNGZAT2.js} +1 -1
- package/dist/cli/chunks/{chunk-J7Q5TXFZ.js → chunk-AWQAE3SW.js} +2 -2
- package/dist/cli/chunks/{chunk-ZN35XSKF.js → chunk-AXDBQFR4.js} +2 -2
- package/dist/cli/chunks/{chunk-ND72UDVH.js → chunk-AXVD7O3F.js} +2 -2
- package/dist/cli/chunks/{chunk-SAEECT23.js → chunk-B52ULNYO.js} +2 -2
- package/dist/cli/chunks/chunk-B6S4FC7M.js +3 -0
- package/dist/cli/chunks/{chunk-Z7SKUC6P.js → chunk-BDVFSMOQ.js} +1 -1
- package/dist/cli/chunks/{chunk-CXCMATZ6.js → chunk-BGXXMX3Y.js} +2 -2
- package/dist/cli/chunks/{chunk-R3KBOQ3O.js → chunk-BKMQQY5T.js} +2 -2
- package/dist/cli/chunks/{chunk-SAZ4PJBR.js → chunk-BN2FROBQ.js} +2 -2
- package/dist/cli/chunks/{chunk-G2X3OLMN.js → chunk-BO6EQNOC.js} +2 -2
- package/dist/cli/chunks/{chunk-776K4ZLE.js → chunk-BOVAKCDC.js} +2 -2
- package/dist/cli/chunks/{chunk-QSQNXBD2.js → chunk-BSXKZDKO.js} +2 -2
- package/dist/cli/chunks/{chunk-MGZ6XZHU.js → chunk-C5QVJ5XQ.js} +1 -1
- package/dist/cli/chunks/{chunk-LOLSZG5J.js → chunk-CFQLLF3D.js} +2 -2
- package/dist/cli/chunks/{chunk-J6QRNQJF.js → chunk-DUCVLT3F.js} +7 -7
- package/dist/cli/chunks/{chunk-QTQDX4TZ.js → chunk-E4RMJCGA.js} +3 -3
- package/dist/cli/chunks/{chunk-MLMD3I75.js → chunk-EONDCWY4.js} +1 -1
- package/dist/cli/chunks/{chunk-7BSOO3CY.js → chunk-F4AGNKL2.js} +2 -2
- package/dist/cli/chunks/{chunk-IKB3M7OF.js → chunk-F6YD3BOW.js} +1 -1
- package/dist/cli/chunks/{chunk-LIF6UWHV.js → chunk-FQRS7WVA.js} +2 -2
- package/dist/cli/chunks/{chunk-QJSSUBO3.js → chunk-FT24SSDG.js} +2 -2
- package/dist/cli/chunks/chunk-FV4YNSAJ.js +5 -0
- package/dist/cli/chunks/{chunk-VITV7AEC.js → chunk-FVDM3X42.js} +2 -2
- package/dist/cli/chunks/{chunk-LN7NKE3N.js → chunk-FVH7TXWU.js} +2 -2
- package/dist/cli/chunks/{chunk-FBSBXCZS.js → chunk-FWR5QY37.js} +2 -2
- package/dist/cli/chunks/{chunk-X2DWHGCC.js → chunk-FYINK2B7.js} +2 -2
- package/dist/cli/chunks/{chunk-ECKHDHR2.js → chunk-GGISVPOZ.js} +2 -2
- package/dist/cli/chunks/{chunk-SRBCBVSI.js → chunk-GPIJIZJQ.js} +2 -2
- package/dist/cli/chunks/{chunk-YR5QBUHZ.js → chunk-GXEVOT5F.js} +2 -2
- package/dist/cli/chunks/{chunk-ZTP3DQ5M.js → chunk-GZ4VB5RI.js} +1 -1
- package/dist/cli/chunks/{chunk-HWQPMUSN.js → chunk-HBDSCYSK.js} +2 -2
- package/dist/cli/chunks/{chunk-XBTGEYED.js → chunk-HGG4HR7C.js} +2 -2
- package/dist/cli/chunks/{chunk-YD2C6EPN.js → chunk-HSCKWWO2.js} +2 -2
- package/dist/cli/chunks/{chunk-LOMT4UC2.js → chunk-HSQ3GUYJ.js} +2 -2
- package/dist/cli/chunks/{chunk-ZC3KDNJW.js → chunk-HZQBW5EM.js} +3 -3
- package/dist/cli/chunks/{chunk-SUAZ5Z47.js → chunk-IGIYANVT.js} +2 -2
- package/dist/cli/chunks/{chunk-IHQGNDMX.js → chunk-IPWMSXBF.js} +2 -2
- package/dist/cli/chunks/{chunk-6V6BD6PH.js → chunk-IWVNC7VY.js} +1 -1
- package/dist/cli/chunks/{chunk-M2YI5YUR.js → chunk-IZODXKZD.js} +2 -2
- package/dist/cli/chunks/{chunk-LG5PPJT7.js → chunk-J2MT2OJV.js} +1 -1
- package/dist/cli/chunks/{chunk-6LSZCEW2.js → chunk-JKIJVVSP.js} +1 -1
- package/dist/cli/chunks/{chunk-REY52O7J.js → chunk-JMRDT2XK.js} +1 -1
- package/dist/cli/chunks/{chunk-XEYFZLIT.js → chunk-JR2UMTKG.js} +1 -1
- package/dist/cli/chunks/{chunk-DJDVD6RM.js → chunk-K6CH4CFF.js} +2 -2
- package/dist/cli/chunks/{chunk-2PCEMDIX.js → chunk-K7KW5QB5.js} +78 -87
- package/dist/cli/chunks/{chunk-EPVPXHL7.js → chunk-KFCQP434.js} +2 -2
- package/dist/cli/chunks/{chunk-TWBZONKT.js → chunk-KH4T6STG.js} +2 -2
- package/dist/cli/chunks/{chunk-JI33PMPZ.js → chunk-KJBYZO57.js} +1 -1
- package/dist/cli/chunks/{chunk-PK34KJH7.js → chunk-KP4OKOKV.js} +2 -2
- package/dist/cli/chunks/chunk-L2MBKVSE.js +2 -0
- package/dist/cli/chunks/{chunk-JVWZAE2H.js → chunk-L3IPUIT3.js} +2 -2
- package/dist/cli/chunks/{chunk-KT2QCXO6.js → chunk-L7PSU2YN.js} +2 -2
- package/dist/cli/chunks/{chunk-HAQJFUAQ.js → chunk-LA3JPGQA.js} +2 -2
- package/dist/cli/chunks/{chunk-LV7UIK4Q.js → chunk-LC2QRN7V.js} +14 -13
- package/dist/cli/chunks/{chunk-KTORRIX3.js → chunk-LHY7TMTM.js} +2 -2
- package/dist/cli/chunks/{chunk-IJSROBM6.js → chunk-LLQ2UMF6.js} +3 -3
- package/dist/cli/chunks/{chunk-NKUHMA4T.js → chunk-LOJ7OO6W.js} +2 -2
- package/dist/cli/chunks/{chunk-OJIUIEI4.js → chunk-LPUSH3VF.js} +1 -1
- package/dist/cli/chunks/{chunk-WAOEQA3W.js → chunk-LSEC2BU7.js} +2 -2
- package/dist/cli/chunks/{chunk-YMUY3TES.js → chunk-LTGB7OIU.js} +2 -2
- package/dist/cli/chunks/{chunk-CVYPMGUM.js → chunk-LUG7YNVZ.js} +2 -2
- package/dist/cli/chunks/{chunk-YAJOBZE5.js → chunk-LWAFRYKE.js} +2 -2
- package/dist/cli/chunks/{chunk-ZP5AWQRO.js → chunk-M24ZAZ4U.js} +2 -2
- package/dist/cli/chunks/{chunk-HFZD5KLR.js → chunk-MKRKRXTX.js} +1 -1
- package/dist/cli/chunks/{chunk-4YM45Z5B.js → chunk-MNNLONAD.js} +1 -1
- package/dist/cli/chunks/{chunk-CMN7PU2H.js → chunk-MQM37KAR.js} +2 -2
- package/dist/cli/chunks/{chunk-COTQ44YO.js → chunk-MSX2OHYT.js} +2 -2
- package/dist/cli/chunks/{chunk-4UKTIQDT.js → chunk-MVYQRVLP.js} +2 -2
- package/dist/cli/chunks/{chunk-HRUHHHVR.js → chunk-MZC5WM2P.js} +2 -2
- package/dist/cli/chunks/{chunk-YKRLUTK7.js → chunk-MZRBNBB3.js} +2 -2
- package/dist/cli/chunks/{chunk-XEMCHGAJ.js → chunk-N3KQU4UC.js} +2 -2
- package/dist/cli/chunks/{chunk-DS5IFRY6.js → chunk-NKU3FFM4.js} +2 -2
- package/dist/cli/chunks/chunk-O5EWFR76.js +2 -0
- package/dist/cli/chunks/{chunk-J3QFJI2Y.js → chunk-O5RDHD5T.js} +2 -2
- package/dist/cli/chunks/chunk-O6UWIXME.js +3 -0
- package/dist/cli/chunks/{chunk-Q6F3DYZN.js → chunk-OA4EQDC4.js} +2 -2
- package/dist/cli/chunks/{chunk-NQFDJ6BT.js → chunk-OBCXCRXK.js} +1 -1
- package/dist/cli/chunks/{chunk-S3TBOKAZ.js → chunk-OHU5P25N.js} +4 -4
- package/dist/cli/chunks/{chunk-DNVRTJKB.js → chunk-OOSV2RIA.js} +2 -2
- package/dist/cli/chunks/{chunk-NZJVDOUN.js → chunk-OW23N2Y5.js} +2 -2
- package/dist/cli/chunks/{chunk-ZWUF27P4.js → chunk-OXOO3YDL.js} +2 -2
- package/dist/cli/chunks/{chunk-4L6WX5KC.js → chunk-OYGKSSSI.js} +1 -1
- package/dist/cli/chunks/{chunk-DCDSN67A.js → chunk-PGO46IIW.js} +1 -1
- package/dist/cli/chunks/{chunk-C7QLLMYI.js → chunk-PZOYQHWS.js} +1 -1
- package/dist/cli/chunks/{chunk-BKHEQIRZ.js → chunk-Q2BZSG7Z.js} +2 -2
- package/dist/cli/chunks/{chunk-5FSPELOG.js → chunk-Q7V722K5.js} +2 -2
- package/dist/cli/chunks/{chunk-2EQK7B5L.js → chunk-QZU6M5IO.js} +2 -2
- package/dist/cli/chunks/{chunk-HVT7RMGV.js → chunk-R55Y76SJ.js} +1 -1
- package/dist/cli/chunks/{chunk-POPSZDI2.js → chunk-RMEQYJPU.js} +4 -4
- package/dist/cli/chunks/{chunk-H2LHWZRE.js → chunk-RTYXFXTI.js} +2 -2
- package/dist/cli/chunks/{chunk-QN7HP2UW.js → chunk-SJF3O4FX.js} +236 -236
- package/dist/cli/chunks/{chunk-2YWYW7NU.js → chunk-SOUS7Z2H.js} +2 -2
- package/dist/cli/chunks/{chunk-U5SMBJ6F.js → chunk-SRVNR3R3.js} +2 -2
- package/dist/cli/chunks/{chunk-ZAQMRFBB.js → chunk-SU3SXMVG.js} +2 -2
- package/dist/cli/chunks/chunk-SWGPLXWW.js +32 -0
- package/dist/cli/chunks/{chunk-S3DT5TPR.js → chunk-TRB3EVH3.js} +2 -2
- package/dist/cli/chunks/{chunk-IJZFJPHS.js → chunk-TVBDUMKT.js} +2 -2
- package/dist/cli/chunks/{chunk-7SNSI4VY.js → chunk-TWTXPSFU.js} +1 -1
- package/dist/cli/chunks/{chunk-ORQ2YBRR.js → chunk-ULYUVUL2.js} +2 -2
- package/dist/cli/chunks/{chunk-MVVVGQJ6.js → chunk-UNTBVJ5X.js} +2 -2
- package/dist/cli/chunks/{chunk-5WATBVU6.js → chunk-UQAA4PHU.js} +2 -2
- package/dist/cli/chunks/{chunk-5WYZVSL2.js → chunk-UWSJVKTE.js} +1 -1
- package/dist/cli/chunks/{chunk-JHKKIJT2.js → chunk-V2LJ54KP.js} +2 -2
- package/dist/cli/chunks/{chunk-2UUZCQSD.js → chunk-VCCTTKP3.js} +2 -2
- package/dist/cli/chunks/{chunk-P4OB6WDJ.js → chunk-VEGUYUVS.js} +1 -1
- package/dist/cli/chunks/{chunk-WX4PO65Q.js → chunk-VUQPVWNK.js} +2 -2
- package/dist/cli/chunks/{chunk-IQL6XRF5.js → chunk-VVGUE2T2.js} +2 -2
- package/dist/cli/chunks/{chunk-HZ5O7G2P.js → chunk-W5ASDHJQ.js} +1 -1
- package/dist/cli/chunks/{chunk-U4S74IIZ.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-AGCS5GSO.js → chunk-WQNLXUWA.js} +6 -6
- package/dist/cli/chunks/{chunk-LRY6UIRI.js → chunk-WZVRMKG2.js} +2 -2
- package/dist/cli/chunks/{chunk-KPIPVSIP.js → chunk-X27IUWTD.js} +2 -2
- package/dist/cli/chunks/{chunk-VDEKVIP5.js → chunk-X4B345B6.js} +2 -2
- package/dist/cli/chunks/{chunk-ERYADKMZ.js → chunk-X5I2Y4VO.js} +2 -2
- package/dist/cli/chunks/{chunk-EUWG2JG4.js → chunk-X7IQIFTS.js} +2 -2
- package/dist/cli/chunks/chunk-XJN3RKUD.js +3 -0
- package/dist/cli/chunks/{chunk-JRIJM4LE.js → chunk-XQMGXTHJ.js} +3 -3
- package/dist/cli/chunks/{chunk-VYPVU3JF.js → chunk-XTSAMB2Q.js} +2 -2
- package/dist/cli/chunks/{chunk-4NKZU2JZ.js → chunk-XZLIF4O2.js} +2 -2
- package/dist/cli/chunks/{chunk-XFTX3KLE.js → chunk-Y4LSEOZ3.js} +1 -1
- package/dist/cli/chunks/{chunk-ZVMSSCTH.js → chunk-Y4YN2RXR.js} +2 -2
- package/dist/cli/chunks/{chunk-X5QD76IU.js → chunk-YDI56L35.js} +2 -2
- package/dist/cli/chunks/{chunk-LRKLATSH.js → chunk-YFILS5D5.js} +2 -2
- package/dist/cli/chunks/{chunk-AVHYJ3XP.js → chunk-YISDX6WB.js} +2 -2
- package/dist/cli/chunks/{chunk-GPPTRKEM.js → chunk-YP2GHQSV.js} +2 -2
- package/dist/cli/chunks/{chunk-OO2M2QUV.js → chunk-YSX756AM.js} +4 -4
- package/dist/cli/chunks/{chunk-E7XIMOKW.js → chunk-YWANOASW.js} +2 -2
- package/dist/cli/chunks/{chunk-UHJVZEQA.js → chunk-YYIJLG7S.js} +2 -2
- package/dist/cli/chunks/{chunk-LCWEQRZI.js → chunk-Z7SD7LXM.js} +2 -2
- package/dist/cli/chunks/{chunk-TM75GAXG.js → chunk-ZDWD73UF.js} +2 -2
- package/dist/cli/chunks/{chunk-IRHXGCQR.js → chunk-ZFT3RLA4.js} +2 -2
- package/dist/cli/chunks/{chunk-ZGV7L4MW.js → chunk-ZNTHX5G3.js} +1 -1
- package/dist/cli/chunks/{chunk-D75GLKEL.js → chunk-ZS27R7VL.js} +2 -2
- package/dist/cli/chunks/{chunk-INI3Q4CN.js → chunk-ZXHHHR7K.js} +1 -1
- package/dist/cli/chunks/{ci-3RTTTS2D.js → ci-N5MOMNXH.js} +2 -2
- package/dist/cli/chunks/{ci-config-XRUR3I4K.js → ci-config-6L2ROQCW.js} +2 -2
- package/dist/cli/chunks/{ci-output-E5IAMU2U.js → ci-output-DSRBYEIK.js} +2 -2
- package/dist/cli/chunks/{circuit-breaker-SHR2P44P.js → circuit-breaker-VRPTNBL7.js} +2 -2
- package/dist/cli/chunks/{claude-flow-setup-ZDDILFMF.js → claude-flow-setup-4YFG3FU5.js} +2 -2
- package/dist/cli/chunks/client-I3L6BKRQ.js +2 -0
- package/dist/cli/chunks/{cline-installer-BGYVUM6G.js → cline-installer-7RGYJWGN.js} +2 -2
- package/dist/cli/chunks/{code-PJ4MC3MC.js → code-ISC6NW2K.js} +3 -3
- package/dist/cli/chunks/{code-index-extractor-IW2P22YG.js → code-index-extractor-2FID75YV.js} +2 -2
- package/dist/cli/chunks/{codex-installer-A7WZ6OGL.js → codex-installer-DZ7OG6KM.js} +2 -2
- package/dist/cli/chunks/{completions-KS23WD5J.js → completions-SM3LICWK.js} +2 -2
- package/dist/cli/chunks/{complexity-analyzer-Q7GLSR2E.js → complexity-analyzer-ZWD2CTAD.js} +2 -2
- package/dist/cli/chunks/{continuedev-installer-SK55BFW2.js → continuedev-installer-AGASOA26.js} +2 -2
- package/dist/cli/chunks/{copilot-installer-3N5J3WTM.js → copilot-installer-CLPZYTQC.js} +2 -2
- package/dist/cli/chunks/core-handlers-5EFOJ37H.js +2 -0
- package/dist/cli/chunks/{cost-tracker-NENVSO4A.js → cost-tracker-7PIGQYDV.js} +2 -2
- package/dist/cli/chunks/{coverage-5L7UQWDH.js → coverage-T2GEBTYS.js} +9 -9
- package/dist/cli/chunks/cross-domain-router-65WJAKVD.js +2 -0
- package/dist/cli/chunks/{cursor-installer-XXBO2ZE6.js → cursor-installer-KXBID4MB.js} +2 -2
- package/dist/cli/chunks/daemon-43MXIVH3.js +18 -0
- package/dist/cli/chunks/{daemon-CDCQU3LR.js → daemon-VAMJLQJ5.js} +3 -3
- package/dist/cli/chunks/{dag-attention-scheduler-HOMMF7FA.js → dag-attention-scheduler-UBP4VHTA.js} +2 -2
- package/dist/cli/chunks/{detect-FXCOUG6X.js → detect-QWFIQRKI.js} +2 -2
- package/dist/cli/chunks/{dist-node-GXQ7FMTY.js → dist-node-I2GICS3W.js} +2 -2
- package/dist/cli/chunks/{domain-handler-TI3JBAPC.js → domain-handler-Z66ISB2A.js} +2 -2
- package/dist/cli/chunks/{domain-plugins-R7LTUM32.js → domain-plugins-KHMD3FKT.js} +2 -2
- package/dist/cli/chunks/{domain-transfer-LBIAFHIQ.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-HHLWTBF5.js → embedding-space-KHG6TITM.js} +2 -2
- package/dist/cli/chunks/{eval-KDOZMAXJ.js → eval-43OHU7EI.js} +2 -2
- package/dist/cli/chunks/{experience-capture-middleware-X45PECQN.js → experience-capture-middleware-KXD47H6P.js} +3 -3
- package/dist/cli/chunks/{fast-paths-462V6UUB.js → fast-paths-6D75D5KD.js} +2 -2
- package/dist/cli/chunks/{feature-flags-NIRQ4YDM.js → feature-flags-IE35Y55N.js} +2 -2
- package/dist/cli/chunks/{feature-flags-G66OT3AS.js → feature-flags-OYYHY7LS.js} +2 -2
- package/dist/cli/chunks/file-discovery-LGBTY3ID.js +2 -0
- package/dist/cli/chunks/{fleet-PXWGB7CU.js → fleet-AGVJMFGD.js} +16 -16
- package/dist/cli/chunks/{gnn-wrapper-7MUW3M5M.js → gnn-wrapper-5L66A7LW.js} +2 -2
- package/dist/cli/chunks/{heartbeat-handler-5237PB35.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-OSQPW7JP.js → hnsw-legacy-bridge-RYMWFNAH.js} +2 -2
- package/dist/cli/chunks/{hnswlib-node-GX6WG2GB.js → hnswlib-node-GG47HP2P.js} +2 -2
- package/dist/cli/chunks/{hooks-GUWHL7VC.js → hooks-FQNACS24.js} +10 -10
- package/dist/cli/chunks/hybrid-backend-AS2PNHOD.js +2 -0
- package/dist/cli/chunks/{hypergraph-engine-SRWLLCU3.js → hypergraph-engine-6BYNJQEP.js} +2 -2
- package/dist/cli/chunks/{hypergraph-handler-AVOPRHHO.js → hypergraph-handler-CYTAXZKJ.js} +3 -3
- package/dist/cli/chunks/impact-analyzer-Y4OONLFP.js +2 -0
- package/dist/cli/chunks/{init-guard-P4N6EVZS.js → init-guard-METTAV5O.js} +2 -2
- package/dist/cli/chunks/{init-handler-LRGWOJMD.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-7R2EPOQ6.js → kilocode-installer-GZV2D3FF.js} +2 -2
- package/dist/cli/chunks/{kiro-installer-QNM7DPOB.js → kiro-installer-Q4ZXUFC7.js} +2 -2
- package/dist/cli/chunks/knowledge-graph-CNL77CSZ.js +2 -0
- package/dist/cli/chunks/{learning-7OIZBPXZ.js → learning-WA2QEYL7.js} +35 -34
- package/dist/cli/chunks/{llm-router-SIDXES23.js → llm-router-GRTCHWH7.js} +4 -4
- package/dist/cli/chunks/llm-router-service-UIYTYKP6.js +2 -0
- package/dist/cli/chunks/{load-EI2E2C3S.js → load-WXN3Q7Y5.js} +2 -2
- package/dist/cli/chunks/load-test-PXLW4A5B.js +2 -0
- package/dist/cli/chunks/{mcp-IOE5WOCS.js → mcp-LIQCPSJN.js} +2 -2
- package/dist/cli/chunks/{memory-DLYGJAP7.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-WHH4YCHM.js → multi-model-executor-H54DEVRZ.js} +2 -2
- package/dist/cli/chunks/{opencode-installer-63FDZAMS.js → opencode-installer-BSQV6UAT.js} +2 -2
- package/dist/cli/chunks/{orchestrator-3LA776KK.js → orchestrator-TJDPQ4VL.js} +122 -35
- package/dist/cli/chunks/pattern-null-store-BKGTQFNF.js +2 -0
- package/dist/cli/chunks/{pattern-usage-recorder-NW54QUGI.js → pattern-usage-recorder-FOVS4M5L.js} +2 -2
- package/dist/cli/chunks/{pipeline-P3TYX6J6.js → pipeline-4AY2ZIC6.js} +2 -2
- package/dist/cli/chunks/{platform-FNA2WLI6.js → platform-FCSITYMR.js} +2 -2
- package/dist/cli/chunks/{plugin-NJS7BC2S.js → plugin-E56TV5S2.js} +2 -2
- package/dist/cli/chunks/{prime-radiant-advanced-wasm-NIAVL2OT.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-JU5C4JHY.js → protocol-handler-KRVXF4LS.js} +2 -2
- package/dist/cli/chunks/{prove-35VOSLYP.js → prove-KMFPSKGD.js} +2 -2
- package/dist/cli/chunks/qe-reasoning-bank-UEGQ3O7F.js +2 -0
- package/dist/cli/chunks/{quality-ET74X7HN.js → quality-6DBI3HLB.js} +2 -2
- package/dist/cli/chunks/{quality-gate-FEDQISNB.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-DTBPYCEB.js → ref-validation-EYIP7DHW.js} +2 -2
- package/dist/cli/chunks/{roocode-installer-LYQEMR4J.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-DJOJFPII.js → routing-handler-BWNHBYDC.js} +2 -2
- package/dist/cli/chunks/{ruvector-commands-VXYGJDPW.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-GA2ZYOEG.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-MM6YOECX.js → security-DCRGOTWU.js} +3 -3
- package/dist/cli/chunks/{shared-rvf-adapter-6AHPA3V5.js → shared-rvf-adapter-GKD74QUB.js} +2 -2
- package/dist/cli/chunks/{shared-rvf-dual-writer-EYAVY2GZ.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-A3PLB4CZ.js → standalone-memory-O7O2U5N4.js} +2 -2
- package/dist/cli/chunks/{status-handler-OSSFAP4Z.js → status-handler-BQTPJJTL.js} +2 -2
- package/dist/cli/chunks/{structural-health-PGY5XUNO.js → structural-health-4H6J4OHK.js} +2 -2
- package/dist/cli/chunks/sync-DJ4TF6QX.js +2 -0
- package/dist/cli/chunks/{sync-CWEHYGNN.js → sync-WW5TAVYW.js} +2 -2
- package/dist/cli/chunks/{task-handler-LHMQ75W4.js → task-handler-HEM4IEOW.js} +2 -2
- package/dist/cli/chunks/{task-handlers-S2TX5FTR.js → task-handlers-JRA3NXIR.js} +3 -3
- package/dist/cli/chunks/{test-4EGZZ6NJ.js → test-772ZXVG2.js} +4 -4
- package/dist/cli/chunks/test-runner-process-XGF2U3NG.js +2 -0
- package/dist/cli/chunks/{test-scheduling-YJQHH3XE.js → test-scheduling-4TRB7LZ7.js} +3 -3
- package/dist/cli/chunks/token-bootstrap-CICBIJ7T.js +2 -0
- package/dist/cli/chunks/{token-usage-WPNOJR6H.js → token-usage-B7PEKE2G.js} +2 -2
- package/dist/cli/chunks/{transformers-4MRPXCPU.js → transformers-V7X7BDZX.js} +2 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-OXPFKFZS.js +2 -0
- package/dist/cli/chunks/{types-6P5FB4EB.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-4ICTN63Y.js → upgrade-DZ4DLUQ5.js} +2 -2
- package/dist/cli/chunks/{validate-HQF5GZ7L.js → validate-4DTLIDJE.js} +2 -2
- package/dist/cli/chunks/{validate-swarm-45JYG7VW.js → validate-swarm-A26UFVIS.js} +2 -2
- package/dist/cli/chunks/visual-security-YECYZ27X.js +2 -0
- package/dist/cli/chunks/{web-tree-sitter-UOTWZLNH.js → web-tree-sitter-F2C7QRYT.js} +2 -2
- package/dist/cli/chunks/{windsurf-installer-WDWSBXGN.js → windsurf-installer-OOBTDA6W.js} +2 -2
- package/dist/cli/chunks/{witness-chain-DOYMNPC7.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-JB42X62J.js → witness-chain-verifier-OB7ZZOI3.js} +2 -2
- package/dist/cli/chunks/{witness-key-manager-LXXO6L2G.js → witness-key-manager-YCKGKGQI.js} +2 -2
- package/dist/cli/chunks/{workflow-6ARK47NF.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/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/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/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/services/test-executor.js +6 -2
- package/dist/init/init-wizard-steps.js +3 -1
- package/dist/init/phases/07-hooks.js +97 -10
- 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/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-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 +15 -0
- package/dist/learning/embedding-space-registry.js +50 -11
- 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.js +31 -7
- package/dist/learning/rvf-pattern-store.js +6 -1
- package/dist/mcp/bundle.js +570 -558
- 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/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/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/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/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-OMILP6KH.js +0 -2
- package/dist/cli/chunks/aqe-learning-engine-OXH5CCOS.js +0 -2
- package/dist/cli/chunks/base-MAK2BLTG.js +0 -2
- package/dist/cli/chunks/brain-handler-GCQZFZGQ.js +0 -95
- package/dist/cli/chunks/browser-workflow-IR3VF2TL.js +0 -2
- package/dist/cli/chunks/chunk-4EJLHNER.js +0 -12
- package/dist/cli/chunks/chunk-A4BVDYIL.js +0 -2
- package/dist/cli/chunks/chunk-BE7ZHM34.js +0 -3
- package/dist/cli/chunks/chunk-DHKSPOUQ.js +0 -16
- package/dist/cli/chunks/chunk-FAQ24UHB.js +0 -29
- package/dist/cli/chunks/chunk-IOWEBPXJ.js +0 -5
- package/dist/cli/chunks/chunk-KB34MTFZ.js +0 -3
- package/dist/cli/chunks/chunk-MCXW3DKE.js +0 -8
- package/dist/cli/chunks/chunk-O7VJ3VKD.js +0 -2
- package/dist/cli/chunks/chunk-PIWGKGWP.js +0 -3
- package/dist/cli/chunks/chunk-SFITYZLV.js +0 -7
- package/dist/cli/chunks/chunk-TIVKDIF7.js +0 -2
- package/dist/cli/chunks/client-NO5FOWT4.js +0 -2
- package/dist/cli/chunks/core-handlers-JNAZPXE2.js +0 -2
- package/dist/cli/chunks/cross-domain-router-HEBM767Z.js +0 -2
- package/dist/cli/chunks/daemon-JEBJGEUK.js +0 -18
- package/dist/cli/chunks/dream-GQDCEJMS.js +0 -2
- package/dist/cli/chunks/embed-and-insert-pattern-33KLHDD5.js +0 -3
- package/dist/cli/chunks/file-discovery-33USPLB5.js +0 -2
- package/dist/cli/chunks/heartbeat-scheduler-LIXLC5IH.js +0 -2
- package/dist/cli/chunks/hnsw-adapter-62D5UH27.js +0 -2
- package/dist/cli/chunks/hnsw-index-GSGUMQQC.js +0 -2
- package/dist/cli/chunks/hybrid-backend-FRWP4BOY.js +0 -2
- package/dist/cli/chunks/impact-analyzer-7KF3AQXV.js +0 -2
- package/dist/cli/chunks/init-wizard-XWWAXY25.js +0 -2
- package/dist/cli/chunks/kernel-ZEJPNDBW.js +0 -2
- package/dist/cli/chunks/knowledge-graph-RRZQS7KY.js +0 -2
- package/dist/cli/chunks/llm-router-service-3OSW67LC.js +0 -2
- package/dist/cli/chunks/load-test-7TRIH2WJ.js +0 -2
- package/dist/cli/chunks/memory-backend-G7ZW6Q2B.js +0 -2
- package/dist/cli/chunks/memory-handlers-TPF3KCO5.js +0 -2
- package/dist/cli/chunks/pattern-null-store-OU3ZC3NR.js +0 -2
- package/dist/cli/chunks/project-root-GMOFJEKD.js +0 -2
- package/dist/cli/chunks/protocol-executor-AD345XRO.js +0 -2
- package/dist/cli/chunks/qe-reasoning-bank-NLTP26RC.js +0 -2
- package/dist/cli/chunks/queen-coordinator-2TB4FWS6.js +0 -2
- package/dist/cli/chunks/real-embeddings-II6CXTCI.js +0 -2
- package/dist/cli/chunks/router-PLM3MWME.js +0 -2
- package/dist/cli/chunks/routing-feedback-I7VOX2HU.js +0 -2
- package/dist/cli/chunks/rvf-dual-writer-GQZHFWO2.js +0 -2
- package/dist/cli/chunks/rvf-migration-adapter-3TVKBCAM.js +0 -2
- package/dist/cli/chunks/rvf-migration-coordinator-XUHKLMT6.js +0 -2
- package/dist/cli/chunks/rvf-native-adapter-5GUTYOWS.js +0 -2
- package/dist/cli/chunks/safe-db-RZPQGLGQ.js +0 -2
- package/dist/cli/chunks/schedule-G7JMQDUX.js +0 -2
- package/dist/cli/chunks/scheduler-4SEGPCKD.js +0 -2
- package/dist/cli/chunks/sqlite-persistence-IVE4SQXR.js +0 -2
- package/dist/cli/chunks/sync-PM6D7EQF.js +0 -2
- package/dist/cli/chunks/test-runner-process-72YACW6M.js +0 -2
- package/dist/cli/chunks/token-bootstrap-DJNETMVW.js +0 -2
- package/dist/cli/chunks/tree-sitter-wasm-parser-UVWSDXFR.js +0 -2
- package/dist/cli/chunks/unified-memory-2VMGSGQL.js +0 -2
- package/dist/cli/chunks/unified-memory-hnsw-3KULVD3N.js +0 -2
- package/dist/cli/chunks/unified-persistence-QCSLU2SV.js +0 -2
- package/dist/cli/chunks/visual-security-ZYP2KPH7.js +0 -2
- package/dist/cli/chunks/witness-chain-5QRT7EMX.js +0 -2
- package/dist/cli/chunks/witness-chain-repair-CUF2AFQB.js +0 -2
- package/dist/cli/chunks/workflow-orchestrator-RYDDWIXN.js +0 -2
- package/dist/cli/chunks/wrappers-CYQBOMPL.js +0 -2
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Richness comparison between an existing RVF mirror and a new export
|
|
3
|
+
* (#629, ADR-128; #1251 for the checkpoint policy).
|
|
4
|
+
*
|
|
5
|
+
* - `strict` (default, manual `aqe brain export`): any mirrored table with
|
|
6
|
+
* fewer rows than the existing mirror refuses the export.
|
|
7
|
+
* - `checkpoint` (the Stop-hook checkpoint): routine retention trims rows
|
|
8
|
+
* between turns (routing outcomes, concept edges, q-values, trajectories),
|
|
9
|
+
* so only a collapse refuses: a table that lost more than its share in
|
|
10
|
+
* CHECKPOINT_MAX_LOSS (half by default), and either at least
|
|
11
|
+
* CHECKPOINT_MIN_LOST_ROWS rows or every row of a table that had at least
|
|
12
|
+
* CHECKPOINT_MIN_EMPTIED_ROWS. A database recreated from seed data loses
|
|
13
|
+
* that much; a retention pass does not. A table the existing mirror does
|
|
14
|
+
* not have (added in a later release) held no rows to lose.
|
|
15
|
+
*
|
|
16
|
+
* A deliberate shrink (`aqe learning prune --apply`, dream retention) records
|
|
17
|
+
* a CheckpointShrinkAck. The checkpoint honours it in place of the mirror
|
|
18
|
+
* comparison only while it is fresh and the export still holds the counts the
|
|
19
|
+
* shrink left, so it cannot approve a later, unrelated drop.
|
|
20
|
+
*/
|
|
21
|
+
import { TABLE_CONFIGS, countRows } from './brain-shared.js';
|
|
22
|
+
export const RICHNESS_POLICIES = ['strict', 'checkpoint'];
|
|
23
|
+
/** Smallest loss the checkpoint policy refuses, so retention can trim a small table. */
|
|
24
|
+
export const CHECKPOINT_MIN_LOST_ROWS = 10;
|
|
25
|
+
/** A table emptied from at least this many rows is refused even under the minimum loss. */
|
|
26
|
+
export const CHECKPOINT_MIN_EMPTIED_ROWS = 3;
|
|
27
|
+
/**
|
|
28
|
+
* Largest share of a table the checkpoint policy lets go. Learned patterns
|
|
29
|
+
* are deduplicated at most 10% at a time (SQLitePatternStore), and captured
|
|
30
|
+
* experiences are never deleted (v3.9.22), so they get the 10% bound.
|
|
31
|
+
*/
|
|
32
|
+
export const CHECKPOINT_MAX_LOSS = {
|
|
33
|
+
qe_patterns: 0.1,
|
|
34
|
+
captured_experiences: 0.1,
|
|
35
|
+
};
|
|
36
|
+
const CHECKPOINT_DEFAULT_MAX_LOSS = 0.5;
|
|
37
|
+
/** Code-intelligence vectors are a regenerable cache, never exported (#1238). */
|
|
38
|
+
export const CODE_INDEX_VECTOR_ID_PREFIX = 'code-intelligence:';
|
|
39
|
+
/** Refusal to replace an existing mirror. The message starts with the code. */
|
|
40
|
+
export class RvfMirrorGuardError extends Error {
|
|
41
|
+
code;
|
|
42
|
+
constructor(code, detail) {
|
|
43
|
+
super(`${code}: ${detail}`);
|
|
44
|
+
this.code = code;
|
|
45
|
+
this.name = 'RvfMirrorGuardError';
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
export function isRichnessPolicy(value) {
|
|
49
|
+
return typeof value === 'string' && RICHNESS_POLICIES.includes(value);
|
|
50
|
+
}
|
|
51
|
+
function isLoss(tableName, existing, candidate, policy) {
|
|
52
|
+
if (policy === 'strict')
|
|
53
|
+
return existing > candidate;
|
|
54
|
+
const lost = existing - candidate;
|
|
55
|
+
const maxLoss = CHECKPOINT_MAX_LOSS[tableName] ?? CHECKPOINT_DEFAULT_MAX_LOSS;
|
|
56
|
+
const emptied = candidate === 0 && existing >= CHECKPOINT_MIN_EMPTIED_ROWS;
|
|
57
|
+
return lost > existing * maxLoss && (lost >= CHECKPOINT_MIN_LOST_ROWS || emptied);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Throw when replacing a mirror with `existingCounts` by a candidate with
|
|
61
|
+
* `candidateCounts` would lose rows under `policy`. `existingCounts` is
|
|
62
|
+
* undefined when the mirror has no table inventory at all: that is ambiguous
|
|
63
|
+
* under every policy.
|
|
64
|
+
*/
|
|
65
|
+
export function assertNotPoorerThanMirror(tableNames, existingCounts, candidateCounts, policy = 'strict') {
|
|
66
|
+
const missing = tableNames.filter((tableName) => !existingCounts || !Number.isSafeInteger(existingCounts[tableName]));
|
|
67
|
+
if (!existingCounts || (policy === 'strict' && missing.length > 0)) {
|
|
68
|
+
throw new RvfMirrorGuardError('RVF_MIRROR_INSPECTION_AMBIGUOUS', `existing mirror lacks trustworthy counts for ${missing.join(', ')}. Preserve/import it ` +
|
|
69
|
+
`before retrying, or repeat with --force-overwrite-richer after preserving a backup.`);
|
|
70
|
+
}
|
|
71
|
+
const richer = tableNames
|
|
72
|
+
.map((tableName) => ({
|
|
73
|
+
tableName,
|
|
74
|
+
existing: Number.isSafeInteger(existingCounts[tableName]) ? existingCounts[tableName] : 0,
|
|
75
|
+
candidate: candidateCounts[tableName] ?? 0,
|
|
76
|
+
}))
|
|
77
|
+
.filter(({ tableName, existing, candidate }) => isLoss(tableName, existing, candidate, policy));
|
|
78
|
+
if (richer.length > 0) {
|
|
79
|
+
const differences = richer
|
|
80
|
+
.map(({ tableName, existing, candidate }) => `${tableName} ${existing} -> ${candidate}`)
|
|
81
|
+
.join(', ');
|
|
82
|
+
throw new RvfMirrorGuardError('RVF_MIRROR_RICHER', `refusing to replace richer mirrored tables: ${differences}. Restore/import the mirror ` +
|
|
83
|
+
`first, or repeat with --force-overwrite-richer after preserving a backup.`);
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
/** Row counts of every mirrored table, counted the way the RVF export counts them. */
|
|
87
|
+
export function mirroredTableCounts(db) {
|
|
88
|
+
const counts = {};
|
|
89
|
+
for (const { tableName } of TABLE_CONFIGS) {
|
|
90
|
+
counts[tableName] = tableName === 'vectors'
|
|
91
|
+
? countRows(db, 'vectors', `(id IS NULL OR substr(id, 1, ?) != ?)`, [CODE_INDEX_VECTOR_ID_PREFIX.length, CODE_INDEX_VECTOR_ID_PREFIX])
|
|
92
|
+
: countRows(db, tableName);
|
|
93
|
+
}
|
|
94
|
+
return counts;
|
|
95
|
+
}
|
|
96
|
+
/** An acknowledgement is honoured for this long after the shrink. */
|
|
97
|
+
export const SHRINK_ACK_MAX_AGE_MS = 24 * 3600_000;
|
|
98
|
+
/** Clock skew tolerated for an acknowledgement dated in the future. */
|
|
99
|
+
const SHRINK_ACK_MAX_SKEW_MS = 5 * 60_000;
|
|
100
|
+
/**
|
|
101
|
+
* Whether the acknowledgement `raw` (parsed JSON, or anything else) still
|
|
102
|
+
* vouches for an export with `candidateCounts`: under 24h old, and no table
|
|
103
|
+
* collapsed since the shrink, under the checkpoint policy. Growth is fine.
|
|
104
|
+
*/
|
|
105
|
+
export function evaluateShrinkAck(raw, tableNames, candidateCounts, now = Date.now()) {
|
|
106
|
+
const ack = raw;
|
|
107
|
+
if (!ack || typeof ack !== 'object' || (ack.producer !== 'prune' && ack.producer !== 'dream')
|
|
108
|
+
|| !ack.tableCounts || typeof ack.tableCounts !== 'object') {
|
|
109
|
+
return { honoured: false, reason: 'malformed acknowledgement' };
|
|
110
|
+
}
|
|
111
|
+
const at = Date.parse(String(ack.at));
|
|
112
|
+
if (!Number.isFinite(at) || at > now + SHRINK_ACK_MAX_SKEW_MS) {
|
|
113
|
+
return { honoured: false, reason: `invalid time ${String(ack.at)}` };
|
|
114
|
+
}
|
|
115
|
+
if (now - at > SHRINK_ACK_MAX_AGE_MS) {
|
|
116
|
+
return { honoured: false, reason: `older than 24h (${ack.producer} at ${ack.at})` };
|
|
117
|
+
}
|
|
118
|
+
try {
|
|
119
|
+
assertNotPoorerThanMirror(tableNames, ack.tableCounts, candidateCounts, 'checkpoint');
|
|
120
|
+
}
|
|
121
|
+
catch (error) {
|
|
122
|
+
const detail = error instanceof Error ? error.message.replace(/^RVF_MIRROR_[A-Z_]+: /, '') : String(error);
|
|
123
|
+
return { honoured: false, reason: `the brain shrank again since the ${ack.producer}: ${detail.split('.')[0]}` };
|
|
124
|
+
}
|
|
125
|
+
return { honoured: true, producer: ack.producer };
|
|
126
|
+
}
|
|
127
|
+
//# sourceMappingURL=brain-rvf-richness.js.map
|
|
@@ -70,8 +70,8 @@ export async function migrateToUnifiedMemory(options) {
|
|
|
70
70
|
if (!fs.existsSync(opts.baseDir)) {
|
|
71
71
|
fs.mkdirSync(opts.baseDir, { recursive: true });
|
|
72
72
|
}
|
|
73
|
+
// #1164: openDatabase() set the journal mode (retrying contention, honouring AQE_DISABLE_WAL).
|
|
73
74
|
targetDb = openDatabase(memoryDbPath);
|
|
74
|
-
targetDb.pragma('journal_mode = WAL');
|
|
75
75
|
}
|
|
76
76
|
// Get list of tables to migrate
|
|
77
77
|
const tablesToMigrate = [
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deliberate-shrink acknowledgement for the brain checkpoint (#1251).
|
|
3
|
+
*
|
|
4
|
+
* The Stop-hook checkpoint (`.claude/helpers/brain-checkpoint.cjs export`)
|
|
5
|
+
* refuses to replace `aqe.rvf` with an export in which a table collapsed, so
|
|
6
|
+
* a memory.db recreated from seed data cannot overwrite a richer mirror. A
|
|
7
|
+
* deliberate shrink (`aqe learning prune --apply`, dream retention) is not
|
|
8
|
+
* that case. It leaves this acknowledgement next to memory.db, with the row
|
|
9
|
+
* counts it left behind. The export honours it once, within 24h, and only
|
|
10
|
+
* while the brain still holds those counts (see evaluateShrinkAck).
|
|
11
|
+
*/
|
|
12
|
+
import type { Database as DatabaseType } from 'better-sqlite3';
|
|
13
|
+
import { type ShrinkProducer } from '../integrations/ruvector/brain-rvf-richness.js';
|
|
14
|
+
import type { RetentionStepResult } from './learning-retention.js';
|
|
15
|
+
/** Read by the checkpoint hook in `.agentic-qe/`; keep the name in sync with it. */
|
|
16
|
+
export declare const CHECKPOINT_SHRINK_ACK_FILE = "brain-checkpoint.accept-shrink.json";
|
|
17
|
+
/** True when a step that ran for real left fewer rows in some table. */
|
|
18
|
+
export declare function removedRows(results: readonly RetentionStepResult[]): boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Write the acknowledgement next to the file of `db`, after the shrink and
|
|
21
|
+
* while `db` is still open. Best-effort: returns its path, or undefined when
|
|
22
|
+
* there is no database file (in-memory) or it failed.
|
|
23
|
+
*/
|
|
24
|
+
export declare function acknowledgeCheckpointShrink(db: DatabaseType, producer: ShrinkProducer): string | undefined;
|
|
25
|
+
//# sourceMappingURL=checkpoint-shrink-ack.d.ts.map
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Deliberate-shrink acknowledgement for the brain checkpoint (#1251).
|
|
3
|
+
*
|
|
4
|
+
* The Stop-hook checkpoint (`.claude/helpers/brain-checkpoint.cjs export`)
|
|
5
|
+
* refuses to replace `aqe.rvf` with an export in which a table collapsed, so
|
|
6
|
+
* a memory.db recreated from seed data cannot overwrite a richer mirror. A
|
|
7
|
+
* deliberate shrink (`aqe learning prune --apply`, dream retention) is not
|
|
8
|
+
* that case. It leaves this acknowledgement next to memory.db, with the row
|
|
9
|
+
* counts it left behind. The export honours it once, within 24h, and only
|
|
10
|
+
* while the brain still holds those counts (see evaluateShrinkAck).
|
|
11
|
+
*/
|
|
12
|
+
import { lstatSync, unlinkSync, writeFileSync } from 'node:fs';
|
|
13
|
+
import path from 'node:path';
|
|
14
|
+
import { mirroredTableCounts, } from '../integrations/ruvector/brain-rvf-richness.js';
|
|
15
|
+
/** Read by the checkpoint hook in `.agentic-qe/`; keep the name in sync with it. */
|
|
16
|
+
export const CHECKPOINT_SHRINK_ACK_FILE = 'brain-checkpoint.accept-shrink.json';
|
|
17
|
+
/** True when a step that ran for real left fewer rows in some table. */
|
|
18
|
+
export function removedRows(results) {
|
|
19
|
+
return results.some((r) => !r.dryRun && r.tables.some((t) => t.after < t.before));
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Write the acknowledgement next to the file of `db`, after the shrink and
|
|
23
|
+
* while `db` is still open. Best-effort: returns its path, or undefined when
|
|
24
|
+
* there is no database file (in-memory) or it failed.
|
|
25
|
+
*/
|
|
26
|
+
export function acknowledgeCheckpointShrink(db, producer) {
|
|
27
|
+
const dbPath = db.name;
|
|
28
|
+
if (!dbPath || dbPath === ':memory:')
|
|
29
|
+
return undefined;
|
|
30
|
+
const dir = path.dirname(path.resolve(dbPath));
|
|
31
|
+
try {
|
|
32
|
+
// Same rule as the hook: never write into a symlinked directory.
|
|
33
|
+
const st = lstatSync(dir);
|
|
34
|
+
if (!st.isDirectory() || st.isSymbolicLink())
|
|
35
|
+
return undefined;
|
|
36
|
+
const ack = {
|
|
37
|
+
at: new Date().toISOString(),
|
|
38
|
+
producer,
|
|
39
|
+
tableCounts: mirroredTableCounts(db),
|
|
40
|
+
};
|
|
41
|
+
const ackPath = path.join(dir, CHECKPOINT_SHRINK_ACK_FILE);
|
|
42
|
+
// Unlink, then 'wx': never write through a planted symlink (#970).
|
|
43
|
+
try {
|
|
44
|
+
unlinkSync(ackPath);
|
|
45
|
+
}
|
|
46
|
+
catch (e) {
|
|
47
|
+
if (e.code !== 'ENOENT')
|
|
48
|
+
throw e;
|
|
49
|
+
}
|
|
50
|
+
writeFileSync(ackPath, JSON.stringify(ack) + '\n', { flag: 'wx' });
|
|
51
|
+
return ackPath;
|
|
52
|
+
}
|
|
53
|
+
catch {
|
|
54
|
+
return undefined;
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=checkpoint-shrink-ack.js.map
|
|
@@ -20,13 +20,14 @@
|
|
|
20
20
|
* gives up quickly instead of using the engine's 60 s commit wait.
|
|
21
21
|
*/
|
|
22
22
|
export declare const RETENTION_BUSY_TIMEOUT_MS = 1000;
|
|
23
|
-
import {
|
|
24
|
-
import { type
|
|
23
|
+
import { ConceptGraph } from './concept-graph.js';
|
|
24
|
+
import { type ActivationConfig, type ConceptGraph as SpreadingConceptGraph } from './spreading-activation.js';
|
|
25
|
+
import { type InsightConfig, type DreamInsight, type ConceptGraph as InsightConceptGraph } from './insight-generator.js';
|
|
25
26
|
import { type Branch, type ValidationResult, type ValidationThresholds } from './rvcow-branch-manager.js';
|
|
26
27
|
import { type ComputedDream } from './dream-commit.js';
|
|
27
28
|
import type { WitnessChain } from '../../audit/witness-chain.js';
|
|
28
29
|
import { type DreamRetentionReport } from '../learning-retention.js';
|
|
29
|
-
import type { DreamCycle, PatternImportData, FailureImportData, SuccessImportData } from './types.js';
|
|
30
|
+
import type { DreamCycle, ConceptNode, ConceptEdge, ConceptGraphStats, PatternImportData, FailureImportData, SuccessImportData } from './types.js';
|
|
30
31
|
/**
|
|
31
32
|
* Complete DreamEngine configuration
|
|
32
33
|
*/
|
|
@@ -115,6 +116,46 @@ export interface ApplyInsightResult {
|
|
|
115
116
|
indexPending?: boolean;
|
|
116
117
|
error?: string;
|
|
117
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* Adapter that bridges the actual ConceptGraph class to the minimal interfaces
|
|
121
|
+
* expected by SpreadingActivation and InsightGenerator.
|
|
122
|
+
*
|
|
123
|
+
* The actual ConceptGraph uses async methods and SQLite persistence,
|
|
124
|
+
* while the spreading activation expects synchronous in-memory access.
|
|
125
|
+
* This adapter maintains an in-memory cache for fast access during dreams.
|
|
126
|
+
* Exported for tests only (#1186).
|
|
127
|
+
*/
|
|
128
|
+
export declare class ConceptGraphAdapter implements SpreadingConceptGraph, InsightConceptGraph {
|
|
129
|
+
private readonly graph;
|
|
130
|
+
private nodeCache;
|
|
131
|
+
private edgeCache;
|
|
132
|
+
private activationLevels;
|
|
133
|
+
/** #1060: each node's level when loaded, for the commit's conflict check. */
|
|
134
|
+
private loadedLevels;
|
|
135
|
+
constructor(graph: ConceptGraph);
|
|
136
|
+
/**
|
|
137
|
+
* Load nodes and edges into memory for fast access.
|
|
138
|
+
* @param maxNodes - Maximum number of nodes to load (prevents slow loading
|
|
139
|
+
* on accumulated concept graphs). Nodes are sorted by activation level
|
|
140
|
+
* descending, so the most active concepts are prioritized. Default: no limit.
|
|
141
|
+
*/
|
|
142
|
+
loadIntoMemory(maxNodes?: number): Promise<void>;
|
|
143
|
+
/**
|
|
144
|
+
* Final activation levels with the levels loaded, written by commitDream()
|
|
145
|
+
* in the cycle's single transaction (#1060) instead of one awaited UPDATE
|
|
146
|
+
* per node. The loaded level lets the commit skip a node a foreground write
|
|
147
|
+
* changed during the dream.
|
|
148
|
+
*/
|
|
149
|
+
activationEntries(): Array<[string, number, number | undefined]>;
|
|
150
|
+
getConcept(id: string): ConceptNode | undefined;
|
|
151
|
+
getAllConcepts(minActivation?: number): ConceptNode[];
|
|
152
|
+
getActiveNodes(threshold: number): ConceptNode[];
|
|
153
|
+
getEdges(nodeId: string): ConceptEdge[];
|
|
154
|
+
getEdge(source: string, target: string): ConceptEdge | undefined;
|
|
155
|
+
setActivation(nodeId: string, level: number): void;
|
|
156
|
+
decayActivations(factor: number): void;
|
|
157
|
+
getStats(): ConceptGraphStats;
|
|
158
|
+
}
|
|
118
159
|
/**
|
|
119
160
|
* DreamEngine orchestrates dream-based pattern discovery.
|
|
120
161
|
*
|
|
@@ -37,6 +37,7 @@ import { InsightGenerator, } from './insight-generator.js';
|
|
|
37
37
|
import { DEFAULT_VALIDATION_THRESHOLDS, } from './rvcow-branch-manager.js';
|
|
38
38
|
import { commitDream, markAbandonedCycles, ABANDONED_CYCLE_GRACE_MS, } from './dream-commit.js';
|
|
39
39
|
import { describeRetention, resolveDefaultRetention, runDreamRetention, } from '../learning-retention.js';
|
|
40
|
+
import { addToCount } from '../../shared/utils/safe-record.js';
|
|
40
41
|
/**
|
|
41
42
|
* Default DreamEngine configuration
|
|
42
43
|
*/
|
|
@@ -83,8 +84,9 @@ export class DreamAlreadyRunningError extends Error {
|
|
|
83
84
|
* The actual ConceptGraph uses async methods and SQLite persistence,
|
|
84
85
|
* while the spreading activation expects synchronous in-memory access.
|
|
85
86
|
* This adapter maintains an in-memory cache for fast access during dreams.
|
|
87
|
+
* Exported for tests only (#1186).
|
|
86
88
|
*/
|
|
87
|
-
class ConceptGraphAdapter {
|
|
89
|
+
export class ConceptGraphAdapter {
|
|
88
90
|
graph;
|
|
89
91
|
nodeCache = new Map();
|
|
90
92
|
edgeCache = new Map();
|
|
@@ -187,7 +189,9 @@ class ConceptGraphAdapter {
|
|
|
187
189
|
};
|
|
188
190
|
let totalActivation = 0;
|
|
189
191
|
for (const node of nodes) {
|
|
190
|
-
|
|
192
|
+
// #1186: a stored concept type such as `constructor` or `__proto__` is
|
|
193
|
+
// counted as its own bucket, not added to the inherited member.
|
|
194
|
+
addToCount(byType, node.conceptType);
|
|
191
195
|
totalActivation += this.activationLevels.get(node.id) ?? node.activationLevel;
|
|
192
196
|
}
|
|
193
197
|
let totalEdges = 0;
|
|
@@ -17,6 +17,7 @@ import { join, resolve } from 'node:path';
|
|
|
17
17
|
import { existsSync, mkdirSync } from 'node:fs';
|
|
18
18
|
import { createRequire } from 'node:module';
|
|
19
19
|
import { findProjectRoot } from '../kernel/project-root.js';
|
|
20
|
+
import { setJournalModeWithRetry } from '../shared/sqlite-journal-mode.js';
|
|
20
21
|
// `require` is unavailable in pure ESM; createRequire gives us synchronous
|
|
21
22
|
// access to CommonJS modules like better-sqlite3 from the ESM build output.
|
|
22
23
|
const nodeRequire = createRequire(import.meta.url);
|
|
@@ -56,8 +57,9 @@ function openDb() {
|
|
|
56
57
|
mkdirSync(dir, { recursive: true });
|
|
57
58
|
}
|
|
58
59
|
const db = new Database(path);
|
|
59
|
-
|
|
60
|
+
// busy_timeout first; the WAL switch retries within it (#1164).
|
|
60
61
|
db.pragma('busy_timeout = 5000');
|
|
62
|
+
setJournalModeWithRetry(db, 'WAL', 5000);
|
|
61
63
|
db.exec(`
|
|
62
64
|
CREATE TABLE IF NOT EXISTS kv_store (
|
|
63
65
|
key TEXT NOT NULL,
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adopt an embedding space id minted before the registry (#1302).
|
|
3
|
+
*
|
|
4
|
+
* A space created before #1298 has stored vectors under its exact-hash id but
|
|
5
|
+
* no reference canary in the registry. When the first start after upgrading
|
|
6
|
+
* is already noisy, the derived id differs and no reference can match it, so
|
|
7
|
+
* those vectors would be left under the old id. Before a new space is
|
|
8
|
+
* registered, a few captured_experiences rows of each such legacy id are
|
|
9
|
+
* re-embedded with the #1217 recipe (experience-space-verification). When the
|
|
10
|
+
* active embedder reproduces a stored vector (cosine >=
|
|
11
|
+
* EMBEDDING_ROUND_TRIP_MIN_COSINE), the legacy id is the active space: it is
|
|
12
|
+
* adopted and registered with the current canary as its reference, so later
|
|
13
|
+
* starts resolve it from the registry and this check does not run again.
|
|
14
|
+
*
|
|
15
|
+
* Read-only on stored rows: no vector, id or space id is ever written here.
|
|
16
|
+
*/
|
|
17
|
+
import { type EmbeddingSpaceIdentity } from './embedding-space.js';
|
|
18
|
+
import type { RegisteredEmbeddingSpace } from './embedding-space-registry.js';
|
|
19
|
+
/** Rows re-embedded per legacy space id. */
|
|
20
|
+
export declare const LEGACY_ADOPTION_ROWS_PER_SPACE = 5;
|
|
21
|
+
/** Legacy space ids checked per start, most rows first. */
|
|
22
|
+
export declare const LEGACY_ADOPTION_MAX_SPACES = 3;
|
|
23
|
+
interface ReadableDatabase {
|
|
24
|
+
prepare(sql: string): {
|
|
25
|
+
all(...params: unknown[]): unknown[];
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
export interface LegacySpaceCheck {
|
|
29
|
+
spaceId: string;
|
|
30
|
+
/** Rows of this space whose vector was compared. */
|
|
31
|
+
checked: number;
|
|
32
|
+
/** Rows whose stored vector the active embedder reproduced. */
|
|
33
|
+
matched: number;
|
|
34
|
+
/** Best cosine over the compared rows. */
|
|
35
|
+
bestCosine: number;
|
|
36
|
+
}
|
|
37
|
+
export interface LegacySpaceAdoption {
|
|
38
|
+
/** The legacy space id to adopt, or null to register the derived space. */
|
|
39
|
+
spaceId: string | null;
|
|
40
|
+
/** Why nothing was adopted, or which id was and on what evidence. */
|
|
41
|
+
reason: string;
|
|
42
|
+
checks: LegacySpaceCheck[];
|
|
43
|
+
embeds: number;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Find the legacy space id whose stored experience vectors the active
|
|
47
|
+
* embedder reproduces. `embed` embeds one text with the active runtime and
|
|
48
|
+
* throws when it fails. Never throws; returns spaceId null with a reason when
|
|
49
|
+
* nothing can be verified.
|
|
50
|
+
*/
|
|
51
|
+
export declare function findAdoptableLegacySpace(db: ReadableDatabase, derived: EmbeddingSpaceIdentity, registered: readonly RegisteredEmbeddingSpace[], embed: (text: string) => Promise<number[]>): Promise<LegacySpaceAdoption>;
|
|
52
|
+
export {};
|
|
53
|
+
//# sourceMappingURL=embedding-space-legacy-adoption.d.ts.map
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Adopt an embedding space id minted before the registry (#1302).
|
|
3
|
+
*
|
|
4
|
+
* A space created before #1298 has stored vectors under its exact-hash id but
|
|
5
|
+
* no reference canary in the registry. When the first start after upgrading
|
|
6
|
+
* is already noisy, the derived id differs and no reference can match it, so
|
|
7
|
+
* those vectors would be left under the old id. Before a new space is
|
|
8
|
+
* registered, a few captured_experiences rows of each such legacy id are
|
|
9
|
+
* re-embedded with the #1217 recipe (experience-space-verification). When the
|
|
10
|
+
* active embedder reproduces a stored vector (cosine >=
|
|
11
|
+
* EMBEDDING_ROUND_TRIP_MIN_COSINE), the legacy id is the active space: it is
|
|
12
|
+
* adopted and registered with the current canary as its reference, so later
|
|
13
|
+
* starts resolve it from the registry and this check does not run again.
|
|
14
|
+
*
|
|
15
|
+
* Read-only on stored rows: no vector, id or space id is ever written here.
|
|
16
|
+
*/
|
|
17
|
+
import { cosineSimilarity } from '../shared/utils/vector-math.js';
|
|
18
|
+
import { toErrorMessage } from '../shared/error-utils.js';
|
|
19
|
+
import { EMBEDDING_ROUND_TRIP_MIN_COSINE } from './embedding-space.js';
|
|
20
|
+
import { legacyExperienceEmbeddingTexts, storedExperienceVector, } from './experience-space-verification.js';
|
|
21
|
+
/** Rows re-embedded per legacy space id. */
|
|
22
|
+
export const LEGACY_ADOPTION_ROWS_PER_SPACE = 5;
|
|
23
|
+
/** Legacy space ids checked per start, most rows first. */
|
|
24
|
+
export const LEGACY_ADOPTION_MAX_SPACES = 3;
|
|
25
|
+
/**
|
|
26
|
+
* Find the legacy space id whose stored experience vectors the active
|
|
27
|
+
* embedder reproduces. `embed` embeds one text with the active runtime and
|
|
28
|
+
* throws when it fails. Never throws; returns spaceId null with a reason when
|
|
29
|
+
* nothing can be verified.
|
|
30
|
+
*/
|
|
31
|
+
export async function findAdoptableLegacySpace(db, derived, registered, embed) {
|
|
32
|
+
const none = (reason, checks = [], embeds = 0) => ({ spaceId: null, reason, checks, embeds });
|
|
33
|
+
let legacyIds;
|
|
34
|
+
try {
|
|
35
|
+
legacyIds = legacySpaceIds(db, derived, registered);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
return none(`stored experience vectors could not be read (${toErrorMessage(error)})`);
|
|
39
|
+
}
|
|
40
|
+
if (legacyIds.length === 0)
|
|
41
|
+
return none('no stored experience vectors under an unregistered space id');
|
|
42
|
+
const checks = [];
|
|
43
|
+
let embeds = 0;
|
|
44
|
+
try {
|
|
45
|
+
for (const spaceId of legacyIds) {
|
|
46
|
+
const rows = db.prepare(`
|
|
47
|
+
SELECT rowid, id, task, agent, domain, steps_json, source, embedding, embedding_dimension
|
|
48
|
+
FROM captured_experiences
|
|
49
|
+
WHERE embedding_space_id = ? AND embedding IS NOT NULL AND embedding_dimension = ?
|
|
50
|
+
ORDER BY rowid LIMIT ?
|
|
51
|
+
`).all(spaceId, derived.dimensions, LEGACY_ADOPTION_ROWS_PER_SPACE);
|
|
52
|
+
const check = { spaceId, checked: 0, matched: 0, bestCosine: -1 };
|
|
53
|
+
for (const row of rows) {
|
|
54
|
+
const stored = storedExperienceVector(row);
|
|
55
|
+
if (!stored)
|
|
56
|
+
continue;
|
|
57
|
+
check.checked++;
|
|
58
|
+
for (const text of legacyExperienceEmbeddingTexts(row)) {
|
|
59
|
+
const recomputed = await embed(text);
|
|
60
|
+
embeds++;
|
|
61
|
+
if (recomputed.length !== stored.length)
|
|
62
|
+
continue;
|
|
63
|
+
const cosine = cosineSimilarity(stored, recomputed);
|
|
64
|
+
if (cosine > check.bestCosine)
|
|
65
|
+
check.bestCosine = cosine;
|
|
66
|
+
if (cosine >= EMBEDDING_ROUND_TRIP_MIN_COSINE) {
|
|
67
|
+
check.matched++;
|
|
68
|
+
break;
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
checks.push(check);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
return none(`the embedder failed while re-embedding stored experiences (${toErrorMessage(error)})`, checks, embeds);
|
|
77
|
+
}
|
|
78
|
+
const matching = checks
|
|
79
|
+
.filter((check) => check.matched > 0)
|
|
80
|
+
.sort((a, b) => b.matched - a.matched || b.bestCosine - a.bestCosine);
|
|
81
|
+
if (matching.length === 0) {
|
|
82
|
+
const checked = checks.reduce((sum, check) => sum + check.checked, 0);
|
|
83
|
+
return none(`none of ${checked} re-embedded experiences from ${checks.length} legacy space id(s) ` +
|
|
84
|
+
`reached cosine ${EMBEDDING_ROUND_TRIP_MIN_COSINE}`, checks, embeds);
|
|
85
|
+
}
|
|
86
|
+
const best = matching[0];
|
|
87
|
+
const others = matching.length > 1
|
|
88
|
+
? `; also matching: ${matching.slice(1).map(describeCheck).join(', ')}`
|
|
89
|
+
: '';
|
|
90
|
+
return { spaceId: best.spaceId, reason: `${describeCheck(best)}${others}`, checks, embeds };
|
|
91
|
+
}
|
|
92
|
+
function describeCheck(check) {
|
|
93
|
+
return `${check.spaceId.slice(0, 12)} (${check.matched}/${check.checked} rows, best cosine ${check.bestCosine.toFixed(6)})`;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Space ids of stored experience vectors of the active dimension that have
|
|
97
|
+
* no registry entry, most rows first. The derived id is excluded: if rows are
|
|
98
|
+
* stored under it, registering it already keeps them.
|
|
99
|
+
*/
|
|
100
|
+
function legacySpaceIds(db, derived, registered) {
|
|
101
|
+
const known = new Set(registered.map((entry) => entry.identity.spaceId));
|
|
102
|
+
known.add(derived.spaceId);
|
|
103
|
+
const rows = db.prepare(`
|
|
104
|
+
SELECT embedding_space_id AS spaceId, COUNT(*) AS n
|
|
105
|
+
FROM captured_experiences
|
|
106
|
+
WHERE embedding_space_id IS NOT NULL AND embedding IS NOT NULL AND embedding_dimension = ?
|
|
107
|
+
GROUP BY embedding_space_id
|
|
108
|
+
ORDER BY n DESC, embedding_space_id
|
|
109
|
+
`).all(derived.dimensions);
|
|
110
|
+
return rows
|
|
111
|
+
.map((row) => row.spaceId)
|
|
112
|
+
.filter((spaceId) => !known.has(spaceId))
|
|
113
|
+
.slice(0, LEGACY_ADOPTION_MAX_SPACES);
|
|
114
|
+
}
|
|
115
|
+
//# sourceMappingURL=embedding-space-legacy-adoption.js.map
|
|
@@ -37,6 +37,8 @@ export type EmbeddingSpaceResolution =
|
|
|
37
37
|
| 'matched-cosine'
|
|
38
38
|
/** No registered space matched: the derived space was registered. */
|
|
39
39
|
| 'registered'
|
|
40
|
+
/** No registered space matched; a pre-registry space id was verified and registered (#1302). */
|
|
41
|
+
| 'adopted-legacy'
|
|
40
42
|
/** No usable registry: the derived space is used as before. */
|
|
41
43
|
| 'unavailable';
|
|
42
44
|
export interface ResolvedEmbeddingSpace {
|
|
@@ -72,4 +74,17 @@ export declare function registerEmbeddingSpace(db: EmbeddingSpaceRegistryDb, spa
|
|
|
72
74
|
* when the registry cannot be read the derived space is used, as before.
|
|
73
75
|
*/
|
|
74
76
|
export declare function resolveEmbeddingSpace(db: EmbeddingSpaceRegistryDb | null, derived: EmbeddingSpaceIdentity, canaryText: string, canary: readonly number[]): ResolvedEmbeddingSpace;
|
|
77
|
+
/**
|
|
78
|
+
* Picks a legacy space id (one with stored vectors but no registry entry) the
|
|
79
|
+
* runtime belongs to, or null. Throws only on an unexpected failure.
|
|
80
|
+
*/
|
|
81
|
+
export type LegacySpaceAdopter = (derived: EmbeddingSpaceIdentity, registered: readonly RegisteredEmbeddingSpace[]) => Promise<string | null>;
|
|
82
|
+
/**
|
|
83
|
+
* #1302: like resolveEmbeddingSpace, but before registering a new space the
|
|
84
|
+
* adopter may name a legacy space id the runtime has been shown to reproduce.
|
|
85
|
+
* That id is kept and registered with the current canary as its reference.
|
|
86
|
+
* Its identity carries the current runtime fields: a pre-registry id is a
|
|
87
|
+
* hash that cannot be reversed into the fields it was minted from.
|
|
88
|
+
*/
|
|
89
|
+
export declare function resolveEmbeddingSpaceAdoptingLegacy(db: EmbeddingSpaceRegistryDb | null, derived: EmbeddingSpaceIdentity, canaryText: string, canary: readonly number[], adoptLegacy: LegacySpaceAdopter): Promise<ResolvedEmbeddingSpace>;
|
|
75
90
|
//# sourceMappingURL=embedding-space-registry.d.ts.map
|
|
@@ -104,11 +104,45 @@ export function registerEmbeddingSpace(db, space) {
|
|
|
104
104
|
* when the registry cannot be read the derived space is used, as before.
|
|
105
105
|
*/
|
|
106
106
|
export function resolveEmbeddingSpace(db, derived, canaryText, canary) {
|
|
107
|
+
const lookup = lookupEmbeddingSpace(db, derived, canaryText, canary);
|
|
108
|
+
if (lookup.resolved)
|
|
109
|
+
return lookup.resolved;
|
|
110
|
+
return registerResolvedSpace(lookup.db, derived, canaryText, canary, 'registered', lookup.otherSpaces);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* #1302: like resolveEmbeddingSpace, but before registering a new space the
|
|
114
|
+
* adopter may name a legacy space id the runtime has been shown to reproduce.
|
|
115
|
+
* That id is kept and registered with the current canary as its reference.
|
|
116
|
+
* Its identity carries the current runtime fields: a pre-registry id is a
|
|
117
|
+
* hash that cannot be reversed into the fields it was minted from.
|
|
118
|
+
*/
|
|
119
|
+
export async function resolveEmbeddingSpaceAdoptingLegacy(db, derived, canaryText, canary, adoptLegacy) {
|
|
120
|
+
const lookup = lookupEmbeddingSpace(db, derived, canaryText, canary);
|
|
121
|
+
if (lookup.resolved)
|
|
122
|
+
return lookup.resolved;
|
|
123
|
+
let legacySpaceId = null;
|
|
124
|
+
try {
|
|
125
|
+
legacySpaceId = await adoptLegacy(derived, lookup.entries);
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
console.warn(`[EmbeddingSpaceRegistry] legacy space check failed (${toErrorMessage(error)}); ` +
|
|
129
|
+
`registering the derived space id`);
|
|
130
|
+
}
|
|
131
|
+
if (legacySpaceId) {
|
|
132
|
+
const adopted = { ...derived, spaceId: legacySpaceId };
|
|
133
|
+
return registerResolvedSpace(lookup.db, adopted, canaryText, canary, 'adopted-legacy', 0);
|
|
134
|
+
}
|
|
135
|
+
return registerResolvedSpace(lookup.db, derived, canaryText, canary, 'registered', lookup.otherSpaces);
|
|
136
|
+
}
|
|
137
|
+
/** A registered match (or the unavailable fallback), or what is needed to register. */
|
|
138
|
+
function lookupEmbeddingSpace(db, derived, canaryText, canary) {
|
|
107
139
|
const unavailable = () => ({
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
140
|
+
resolved: {
|
|
141
|
+
identity: derived,
|
|
142
|
+
resolution: 'unavailable',
|
|
143
|
+
otherSpaces: 0,
|
|
144
|
+
registration: Promise.resolve(),
|
|
145
|
+
},
|
|
112
146
|
});
|
|
113
147
|
if (!db)
|
|
114
148
|
return unavailable();
|
|
@@ -124,19 +158,24 @@ export function resolveEmbeddingSpace(db, derived, canaryText, canary) {
|
|
|
124
158
|
const match = matchRegisteredSpace(derived, canaryText, canary, entries);
|
|
125
159
|
if (match) {
|
|
126
160
|
return {
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
161
|
+
resolved: {
|
|
162
|
+
identity: match.entry.identity,
|
|
163
|
+
resolution: match.exact ? 'matched-exact' : 'matched-cosine',
|
|
164
|
+
otherSpaces: 0,
|
|
165
|
+
registration: Promise.resolve(),
|
|
166
|
+
},
|
|
131
167
|
};
|
|
132
168
|
}
|
|
133
169
|
const otherSpaces = entries.filter((entry) => entry.canaryText === canaryText && sameEmbeddingSpaceConfig(entry.identity, derived)).length;
|
|
170
|
+
return { db, entries, otherSpaces };
|
|
171
|
+
}
|
|
172
|
+
function registerResolvedSpace(db, identity, canaryText, canary, resolution, otherSpaces) {
|
|
134
173
|
const registration = Promise.resolve()
|
|
135
|
-
.then(() => registerEmbeddingSpace(db, { identity
|
|
174
|
+
.then(() => registerEmbeddingSpace(db, { identity, canaryText, canary: [...canary] }))
|
|
136
175
|
.catch((error) => {
|
|
137
|
-
console.warn(`[EmbeddingSpaceRegistry] could not register embedding space ${
|
|
176
|
+
console.warn(`[EmbeddingSpaceRegistry] could not register embedding space ${identity.spaceId.slice(0, 12)} ` +
|
|
138
177
|
`(${toErrorMessage(error)}); it is registered at a later start`);
|
|
139
178
|
});
|
|
140
|
-
return { identity
|
|
179
|
+
return { identity, resolution, otherSpaces, registration };
|
|
141
180
|
}
|
|
142
181
|
//# sourceMappingURL=embedding-space-registry.js.map
|
|
@@ -254,7 +254,9 @@ export declare class ExperienceCaptureService {
|
|
|
254
254
|
/**
|
|
255
255
|
* Extract pattern from experience
|
|
256
256
|
*/
|
|
257
|
-
extractPattern(experience: TaskExperience
|
|
257
|
+
extractPattern(experience: TaskExperience, options?: {
|
|
258
|
+
createIfMissing?: boolean;
|
|
259
|
+
}): Promise<PatternExtractionResult>;
|
|
258
260
|
/**
|
|
259
261
|
* Share experience across domains
|
|
260
262
|
*/
|