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.
Files changed (495) hide show
  1. package/.claude/helpers/brain-checkpoint.cjs +107 -10
  2. package/.claude/skills/agentic-quality-engineering/SKILL.md +67 -44
  3. package/.claude/skills/brutal-honesty-review/SKILL.md +12 -7
  4. package/.claude/skills/brutal-honesty-review/evals/brutal-honesty-review.yaml +120 -0
  5. package/.claude/skills/brutal-honesty-review/schemas/output.json +9 -3
  6. package/.claude/skills/code-review-quality/SKILL.md +2 -2
  7. package/.claude/skills/holistic-testing-pact/SKILL.md +11 -11
  8. package/.claude/skills/sherlock-review/SKILL.md +4 -2
  9. package/.claude/skills/sherlock-review/evals/sherlock-review.yaml +124 -0
  10. package/.claude/skills/skills-manifest.json +1 -1
  11. package/.claude/skills/technical-writing/SKILL.md +12 -6
  12. package/.claude/skills/technical-writing/evals/technical-writing.yaml +96 -0
  13. package/.opencode/skills/qe-agentic-quality-engineering.yaml +2 -2
  14. package/.opencode/skills/qe-holistic-testing-pact.yaml +2 -2
  15. package/CHANGELOG.md +123 -0
  16. package/assets/skills/agentic-quality-engineering/SKILL.md +67 -44
  17. package/assets/skills/brutal-honesty-review/SKILL.md +12 -8
  18. package/assets/skills/brutal-honesty-review/evals/brutal-honesty-review.yaml +120 -0
  19. package/assets/skills/brutal-honesty-review/schemas/output.json +9 -3
  20. package/assets/skills/code-review-quality/SKILL.md +2 -2
  21. package/assets/skills/holistic-testing-pact/SKILL.md +11 -11
  22. package/assets/skills/sherlock-review/SKILL.md +4 -3
  23. package/assets/skills/sherlock-review/evals/sherlock-review.yaml +124 -0
  24. package/assets/skills/skills-manifest.json +1 -1
  25. package/assets/skills/technical-writing/SKILL.md +12 -6
  26. package/assets/skills/technical-writing/evals/technical-writing.yaml +96 -0
  27. package/dist/cli/brain-commands.d.ts +5 -0
  28. package/dist/cli/brain-commands.js +4 -0
  29. package/dist/cli/bundle.js +6 -6
  30. package/dist/cli/chunks/adapter-WRSDXLOT.js +2 -0
  31. package/dist/cli/chunks/{agent-booster-wasm-6BUOFQZA.js → agent-booster-wasm-UFNJNF3M.js} +2 -2
  32. package/dist/cli/chunks/{agent-handler-HPDK3JI3.js → agent-handler-EAYVRJXN.js} +2 -2
  33. package/dist/cli/chunks/{agent-memory-branch-5QKUTWK5.js → agent-memory-branch-M65C6WAQ.js} +2 -2
  34. package/dist/cli/chunks/aqe-learning-engine-O6NJBCCM.js +2 -0
  35. package/dist/cli/chunks/{arena-HZ35LESR.js → arena-2GDICP6R.js} +4 -4
  36. package/dist/cli/chunks/{arena-7OKPMNHD.js → arena-CG3X67OE.js} +2 -2
  37. package/dist/cli/chunks/{audit-XI575SVK.js → audit-F4FSPJPL.js} +3 -3
  38. package/dist/cli/chunks/base-J2FXOE77.js +2 -0
  39. package/dist/cli/chunks/{better-sqlite3-YO5X7ZJS.js → better-sqlite3-2MCFXW4J.js} +2 -2
  40. package/dist/cli/chunks/brain-handler-WGTJNYNB.js +95 -0
  41. package/dist/cli/chunks/{branch-enumerator-N6G44UU2.js → branch-enumerator-KL7C535H.js} +2 -2
  42. package/dist/cli/chunks/{browser-EVKPTLOI.js → browser-SJEXDVHS.js} +2 -2
  43. package/dist/cli/chunks/browser-workflow-LXGER6ZD.js +2 -0
  44. package/dist/cli/chunks/{chunk-VLTDW7XJ.js → chunk-244RKAEP.js} +2 -2
  45. package/dist/cli/chunks/{chunk-CVPXHDQU.js → chunk-27TUMXPD.js} +1 -1
  46. package/dist/cli/chunks/{chunk-FBBPRVNF.js → chunk-2MBYDPCP.js} +2 -2
  47. package/dist/cli/chunks/{chunk-P3D7SEHW.js → chunk-2Q6DTBMT.js} +1 -1
  48. package/dist/cli/chunks/{chunk-NE3LRUNC.js → chunk-355MI7RV.js} +13 -13
  49. package/dist/cli/chunks/{chunk-YCVLKU6H.js → chunk-3LX5OKBD.js} +2 -2
  50. package/dist/cli/chunks/{chunk-74MDUIAZ.js → chunk-3RPDKJGV.js} +1 -1
  51. package/dist/cli/chunks/{chunk-OWIQR6N2.js → chunk-3YMIT73A.js} +2 -2
  52. package/dist/cli/chunks/{chunk-VKREKVFI.js → chunk-43KUVBSU.js} +2 -2
  53. package/dist/cli/chunks/chunk-477FKXSS.js +2 -0
  54. package/dist/cli/chunks/{chunk-XPTCQKVE.js → chunk-4BIMTRRX.js} +1 -1
  55. package/dist/cli/chunks/{chunk-HD6W6PHV.js → chunk-4CVNVBX5.js} +2 -2
  56. package/dist/cli/chunks/{chunk-CQER6IJ5.js → chunk-4HL3SD4A.js} +1 -1
  57. package/dist/cli/chunks/{chunk-ZNXM6WVL.js → chunk-4PEG4DU2.js} +2 -2
  58. package/dist/cli/chunks/{chunk-BSIWI4ES.js → chunk-4QSQKFED.js} +2 -2
  59. package/dist/cli/chunks/chunk-53ZBETYR.js +16 -0
  60. package/dist/cli/chunks/{chunk-BHQ2DLJU.js → chunk-544KDWL4.js} +1 -1
  61. package/dist/cli/chunks/chunk-54RCGMLB.js +8 -0
  62. package/dist/cli/chunks/{chunk-TDZ6N43D.js → chunk-5AGXIZQ5.js} +2 -2
  63. package/dist/cli/chunks/{chunk-RKCN4B26.js → chunk-5M24X6W7.js} +2 -2
  64. package/dist/cli/chunks/{chunk-GG7PMTHD.js → chunk-5O5T4LEU.js} +1 -1
  65. package/dist/cli/chunks/{chunk-OWIZBZLN.js → chunk-5RFXX4IF.js} +2 -2
  66. package/dist/cli/chunks/{chunk-VQFV2IPV.js → chunk-62MLAQRJ.js} +1 -1
  67. package/dist/cli/chunks/{chunk-PCL5JRKN.js → chunk-6D6TGL2E.js} +2 -2
  68. package/dist/cli/chunks/{chunk-WBDWHHKP.js → chunk-6IHZDSDL.js} +2 -2
  69. package/dist/cli/chunks/{chunk-UOVCTK5L.js → chunk-6P3Y45QL.js} +2 -2
  70. package/dist/cli/chunks/{chunk-45223KK6.js → chunk-6TEVM3X3.js} +10 -10
  71. package/dist/cli/chunks/{chunk-K7WAI662.js → chunk-7XTUKKRA.js} +1 -1
  72. package/dist/cli/chunks/chunk-A3GDX6UF.js +2 -0
  73. package/dist/cli/chunks/{chunk-GN6OE3JT.js → chunk-A5YTKKNA.js} +1 -1
  74. package/dist/cli/chunks/{chunk-KR2TAAF6.js → chunk-ADNGZAT2.js} +1 -1
  75. package/dist/cli/chunks/{chunk-J7Q5TXFZ.js → chunk-AWQAE3SW.js} +2 -2
  76. package/dist/cli/chunks/{chunk-ZN35XSKF.js → chunk-AXDBQFR4.js} +2 -2
  77. package/dist/cli/chunks/{chunk-ND72UDVH.js → chunk-AXVD7O3F.js} +2 -2
  78. package/dist/cli/chunks/{chunk-SAEECT23.js → chunk-B52ULNYO.js} +2 -2
  79. package/dist/cli/chunks/chunk-B6S4FC7M.js +3 -0
  80. package/dist/cli/chunks/{chunk-Z7SKUC6P.js → chunk-BDVFSMOQ.js} +1 -1
  81. package/dist/cli/chunks/{chunk-CXCMATZ6.js → chunk-BGXXMX3Y.js} +2 -2
  82. package/dist/cli/chunks/{chunk-R3KBOQ3O.js → chunk-BKMQQY5T.js} +2 -2
  83. package/dist/cli/chunks/{chunk-SAZ4PJBR.js → chunk-BN2FROBQ.js} +2 -2
  84. package/dist/cli/chunks/{chunk-G2X3OLMN.js → chunk-BO6EQNOC.js} +2 -2
  85. package/dist/cli/chunks/{chunk-776K4ZLE.js → chunk-BOVAKCDC.js} +2 -2
  86. package/dist/cli/chunks/{chunk-QSQNXBD2.js → chunk-BSXKZDKO.js} +2 -2
  87. package/dist/cli/chunks/{chunk-MGZ6XZHU.js → chunk-C5QVJ5XQ.js} +1 -1
  88. package/dist/cli/chunks/{chunk-LOLSZG5J.js → chunk-CFQLLF3D.js} +2 -2
  89. package/dist/cli/chunks/{chunk-J6QRNQJF.js → chunk-DUCVLT3F.js} +7 -7
  90. package/dist/cli/chunks/{chunk-QTQDX4TZ.js → chunk-E4RMJCGA.js} +3 -3
  91. package/dist/cli/chunks/{chunk-MLMD3I75.js → chunk-EONDCWY4.js} +1 -1
  92. package/dist/cli/chunks/{chunk-7BSOO3CY.js → chunk-F4AGNKL2.js} +2 -2
  93. package/dist/cli/chunks/{chunk-IKB3M7OF.js → chunk-F6YD3BOW.js} +1 -1
  94. package/dist/cli/chunks/{chunk-LIF6UWHV.js → chunk-FQRS7WVA.js} +2 -2
  95. package/dist/cli/chunks/{chunk-QJSSUBO3.js → chunk-FT24SSDG.js} +2 -2
  96. package/dist/cli/chunks/chunk-FV4YNSAJ.js +5 -0
  97. package/dist/cli/chunks/{chunk-VITV7AEC.js → chunk-FVDM3X42.js} +2 -2
  98. package/dist/cli/chunks/{chunk-LN7NKE3N.js → chunk-FVH7TXWU.js} +2 -2
  99. package/dist/cli/chunks/{chunk-FBSBXCZS.js → chunk-FWR5QY37.js} +2 -2
  100. package/dist/cli/chunks/{chunk-X2DWHGCC.js → chunk-FYINK2B7.js} +2 -2
  101. package/dist/cli/chunks/{chunk-ECKHDHR2.js → chunk-GGISVPOZ.js} +2 -2
  102. package/dist/cli/chunks/{chunk-SRBCBVSI.js → chunk-GPIJIZJQ.js} +2 -2
  103. package/dist/cli/chunks/{chunk-YR5QBUHZ.js → chunk-GXEVOT5F.js} +2 -2
  104. package/dist/cli/chunks/{chunk-ZTP3DQ5M.js → chunk-GZ4VB5RI.js} +1 -1
  105. package/dist/cli/chunks/{chunk-HWQPMUSN.js → chunk-HBDSCYSK.js} +2 -2
  106. package/dist/cli/chunks/{chunk-XBTGEYED.js → chunk-HGG4HR7C.js} +2 -2
  107. package/dist/cli/chunks/{chunk-YD2C6EPN.js → chunk-HSCKWWO2.js} +2 -2
  108. package/dist/cli/chunks/{chunk-LOMT4UC2.js → chunk-HSQ3GUYJ.js} +2 -2
  109. package/dist/cli/chunks/{chunk-ZC3KDNJW.js → chunk-HZQBW5EM.js} +3 -3
  110. package/dist/cli/chunks/{chunk-SUAZ5Z47.js → chunk-IGIYANVT.js} +2 -2
  111. package/dist/cli/chunks/{chunk-IHQGNDMX.js → chunk-IPWMSXBF.js} +2 -2
  112. package/dist/cli/chunks/{chunk-6V6BD6PH.js → chunk-IWVNC7VY.js} +1 -1
  113. package/dist/cli/chunks/{chunk-M2YI5YUR.js → chunk-IZODXKZD.js} +2 -2
  114. package/dist/cli/chunks/{chunk-LG5PPJT7.js → chunk-J2MT2OJV.js} +1 -1
  115. package/dist/cli/chunks/{chunk-6LSZCEW2.js → chunk-JKIJVVSP.js} +1 -1
  116. package/dist/cli/chunks/{chunk-REY52O7J.js → chunk-JMRDT2XK.js} +1 -1
  117. package/dist/cli/chunks/{chunk-XEYFZLIT.js → chunk-JR2UMTKG.js} +1 -1
  118. package/dist/cli/chunks/{chunk-DJDVD6RM.js → chunk-K6CH4CFF.js} +2 -2
  119. package/dist/cli/chunks/{chunk-2PCEMDIX.js → chunk-K7KW5QB5.js} +78 -87
  120. package/dist/cli/chunks/{chunk-EPVPXHL7.js → chunk-KFCQP434.js} +2 -2
  121. package/dist/cli/chunks/{chunk-TWBZONKT.js → chunk-KH4T6STG.js} +2 -2
  122. package/dist/cli/chunks/{chunk-JI33PMPZ.js → chunk-KJBYZO57.js} +1 -1
  123. package/dist/cli/chunks/{chunk-PK34KJH7.js → chunk-KP4OKOKV.js} +2 -2
  124. package/dist/cli/chunks/chunk-L2MBKVSE.js +2 -0
  125. package/dist/cli/chunks/{chunk-JVWZAE2H.js → chunk-L3IPUIT3.js} +2 -2
  126. package/dist/cli/chunks/{chunk-KT2QCXO6.js → chunk-L7PSU2YN.js} +2 -2
  127. package/dist/cli/chunks/{chunk-HAQJFUAQ.js → chunk-LA3JPGQA.js} +2 -2
  128. package/dist/cli/chunks/{chunk-LV7UIK4Q.js → chunk-LC2QRN7V.js} +14 -13
  129. package/dist/cli/chunks/{chunk-KTORRIX3.js → chunk-LHY7TMTM.js} +2 -2
  130. package/dist/cli/chunks/{chunk-IJSROBM6.js → chunk-LLQ2UMF6.js} +3 -3
  131. package/dist/cli/chunks/{chunk-NKUHMA4T.js → chunk-LOJ7OO6W.js} +2 -2
  132. package/dist/cli/chunks/{chunk-OJIUIEI4.js → chunk-LPUSH3VF.js} +1 -1
  133. package/dist/cli/chunks/{chunk-WAOEQA3W.js → chunk-LSEC2BU7.js} +2 -2
  134. package/dist/cli/chunks/{chunk-YMUY3TES.js → chunk-LTGB7OIU.js} +2 -2
  135. package/dist/cli/chunks/{chunk-CVYPMGUM.js → chunk-LUG7YNVZ.js} +2 -2
  136. package/dist/cli/chunks/{chunk-YAJOBZE5.js → chunk-LWAFRYKE.js} +2 -2
  137. package/dist/cli/chunks/{chunk-ZP5AWQRO.js → chunk-M24ZAZ4U.js} +2 -2
  138. package/dist/cli/chunks/{chunk-HFZD5KLR.js → chunk-MKRKRXTX.js} +1 -1
  139. package/dist/cli/chunks/{chunk-4YM45Z5B.js → chunk-MNNLONAD.js} +1 -1
  140. package/dist/cli/chunks/{chunk-CMN7PU2H.js → chunk-MQM37KAR.js} +2 -2
  141. package/dist/cli/chunks/{chunk-COTQ44YO.js → chunk-MSX2OHYT.js} +2 -2
  142. package/dist/cli/chunks/{chunk-4UKTIQDT.js → chunk-MVYQRVLP.js} +2 -2
  143. package/dist/cli/chunks/{chunk-HRUHHHVR.js → chunk-MZC5WM2P.js} +2 -2
  144. package/dist/cli/chunks/{chunk-YKRLUTK7.js → chunk-MZRBNBB3.js} +2 -2
  145. package/dist/cli/chunks/{chunk-XEMCHGAJ.js → chunk-N3KQU4UC.js} +2 -2
  146. package/dist/cli/chunks/{chunk-DS5IFRY6.js → chunk-NKU3FFM4.js} +2 -2
  147. package/dist/cli/chunks/chunk-O5EWFR76.js +2 -0
  148. package/dist/cli/chunks/{chunk-J3QFJI2Y.js → chunk-O5RDHD5T.js} +2 -2
  149. package/dist/cli/chunks/chunk-O6UWIXME.js +3 -0
  150. package/dist/cli/chunks/{chunk-Q6F3DYZN.js → chunk-OA4EQDC4.js} +2 -2
  151. package/dist/cli/chunks/{chunk-NQFDJ6BT.js → chunk-OBCXCRXK.js} +1 -1
  152. package/dist/cli/chunks/{chunk-S3TBOKAZ.js → chunk-OHU5P25N.js} +4 -4
  153. package/dist/cli/chunks/{chunk-DNVRTJKB.js → chunk-OOSV2RIA.js} +2 -2
  154. package/dist/cli/chunks/{chunk-NZJVDOUN.js → chunk-OW23N2Y5.js} +2 -2
  155. package/dist/cli/chunks/{chunk-ZWUF27P4.js → chunk-OXOO3YDL.js} +2 -2
  156. package/dist/cli/chunks/{chunk-4L6WX5KC.js → chunk-OYGKSSSI.js} +1 -1
  157. package/dist/cli/chunks/{chunk-DCDSN67A.js → chunk-PGO46IIW.js} +1 -1
  158. package/dist/cli/chunks/{chunk-C7QLLMYI.js → chunk-PZOYQHWS.js} +1 -1
  159. package/dist/cli/chunks/{chunk-BKHEQIRZ.js → chunk-Q2BZSG7Z.js} +2 -2
  160. package/dist/cli/chunks/{chunk-5FSPELOG.js → chunk-Q7V722K5.js} +2 -2
  161. package/dist/cli/chunks/{chunk-2EQK7B5L.js → chunk-QZU6M5IO.js} +2 -2
  162. package/dist/cli/chunks/{chunk-HVT7RMGV.js → chunk-R55Y76SJ.js} +1 -1
  163. package/dist/cli/chunks/{chunk-POPSZDI2.js → chunk-RMEQYJPU.js} +4 -4
  164. package/dist/cli/chunks/{chunk-H2LHWZRE.js → chunk-RTYXFXTI.js} +2 -2
  165. package/dist/cli/chunks/{chunk-QN7HP2UW.js → chunk-SJF3O4FX.js} +236 -236
  166. package/dist/cli/chunks/{chunk-2YWYW7NU.js → chunk-SOUS7Z2H.js} +2 -2
  167. package/dist/cli/chunks/{chunk-U5SMBJ6F.js → chunk-SRVNR3R3.js} +2 -2
  168. package/dist/cli/chunks/{chunk-ZAQMRFBB.js → chunk-SU3SXMVG.js} +2 -2
  169. package/dist/cli/chunks/chunk-SWGPLXWW.js +32 -0
  170. package/dist/cli/chunks/{chunk-S3DT5TPR.js → chunk-TRB3EVH3.js} +2 -2
  171. package/dist/cli/chunks/{chunk-IJZFJPHS.js → chunk-TVBDUMKT.js} +2 -2
  172. package/dist/cli/chunks/{chunk-7SNSI4VY.js → chunk-TWTXPSFU.js} +1 -1
  173. package/dist/cli/chunks/{chunk-ORQ2YBRR.js → chunk-ULYUVUL2.js} +2 -2
  174. package/dist/cli/chunks/{chunk-MVVVGQJ6.js → chunk-UNTBVJ5X.js} +2 -2
  175. package/dist/cli/chunks/{chunk-5WATBVU6.js → chunk-UQAA4PHU.js} +2 -2
  176. package/dist/cli/chunks/{chunk-5WYZVSL2.js → chunk-UWSJVKTE.js} +1 -1
  177. package/dist/cli/chunks/{chunk-JHKKIJT2.js → chunk-V2LJ54KP.js} +2 -2
  178. package/dist/cli/chunks/{chunk-2UUZCQSD.js → chunk-VCCTTKP3.js} +2 -2
  179. package/dist/cli/chunks/{chunk-P4OB6WDJ.js → chunk-VEGUYUVS.js} +1 -1
  180. package/dist/cli/chunks/{chunk-WX4PO65Q.js → chunk-VUQPVWNK.js} +2 -2
  181. package/dist/cli/chunks/{chunk-IQL6XRF5.js → chunk-VVGUE2T2.js} +2 -2
  182. package/dist/cli/chunks/{chunk-HZ5O7G2P.js → chunk-W5ASDHJQ.js} +1 -1
  183. package/dist/cli/chunks/{chunk-U4S74IIZ.js → chunk-WGXT5NWQ.js} +1 -1
  184. package/dist/cli/chunks/chunk-WJN3V7QB.js +7 -0
  185. package/dist/cli/chunks/chunk-WPCRQIIF.js +29 -0
  186. package/dist/cli/chunks/{chunk-AGCS5GSO.js → chunk-WQNLXUWA.js} +6 -6
  187. package/dist/cli/chunks/{chunk-LRY6UIRI.js → chunk-WZVRMKG2.js} +2 -2
  188. package/dist/cli/chunks/{chunk-KPIPVSIP.js → chunk-X27IUWTD.js} +2 -2
  189. package/dist/cli/chunks/{chunk-VDEKVIP5.js → chunk-X4B345B6.js} +2 -2
  190. package/dist/cli/chunks/{chunk-ERYADKMZ.js → chunk-X5I2Y4VO.js} +2 -2
  191. package/dist/cli/chunks/{chunk-EUWG2JG4.js → chunk-X7IQIFTS.js} +2 -2
  192. package/dist/cli/chunks/chunk-XJN3RKUD.js +3 -0
  193. package/dist/cli/chunks/{chunk-JRIJM4LE.js → chunk-XQMGXTHJ.js} +3 -3
  194. package/dist/cli/chunks/{chunk-VYPVU3JF.js → chunk-XTSAMB2Q.js} +2 -2
  195. package/dist/cli/chunks/{chunk-4NKZU2JZ.js → chunk-XZLIF4O2.js} +2 -2
  196. package/dist/cli/chunks/{chunk-XFTX3KLE.js → chunk-Y4LSEOZ3.js} +1 -1
  197. package/dist/cli/chunks/{chunk-ZVMSSCTH.js → chunk-Y4YN2RXR.js} +2 -2
  198. package/dist/cli/chunks/{chunk-X5QD76IU.js → chunk-YDI56L35.js} +2 -2
  199. package/dist/cli/chunks/{chunk-LRKLATSH.js → chunk-YFILS5D5.js} +2 -2
  200. package/dist/cli/chunks/{chunk-AVHYJ3XP.js → chunk-YISDX6WB.js} +2 -2
  201. package/dist/cli/chunks/{chunk-GPPTRKEM.js → chunk-YP2GHQSV.js} +2 -2
  202. package/dist/cli/chunks/{chunk-OO2M2QUV.js → chunk-YSX756AM.js} +4 -4
  203. package/dist/cli/chunks/{chunk-E7XIMOKW.js → chunk-YWANOASW.js} +2 -2
  204. package/dist/cli/chunks/{chunk-UHJVZEQA.js → chunk-YYIJLG7S.js} +2 -2
  205. package/dist/cli/chunks/{chunk-LCWEQRZI.js → chunk-Z7SD7LXM.js} +2 -2
  206. package/dist/cli/chunks/{chunk-TM75GAXG.js → chunk-ZDWD73UF.js} +2 -2
  207. package/dist/cli/chunks/{chunk-IRHXGCQR.js → chunk-ZFT3RLA4.js} +2 -2
  208. package/dist/cli/chunks/{chunk-ZGV7L4MW.js → chunk-ZNTHX5G3.js} +1 -1
  209. package/dist/cli/chunks/{chunk-D75GLKEL.js → chunk-ZS27R7VL.js} +2 -2
  210. package/dist/cli/chunks/{chunk-INI3Q4CN.js → chunk-ZXHHHR7K.js} +1 -1
  211. package/dist/cli/chunks/{ci-3RTTTS2D.js → ci-N5MOMNXH.js} +2 -2
  212. package/dist/cli/chunks/{ci-config-XRUR3I4K.js → ci-config-6L2ROQCW.js} +2 -2
  213. package/dist/cli/chunks/{ci-output-E5IAMU2U.js → ci-output-DSRBYEIK.js} +2 -2
  214. package/dist/cli/chunks/{circuit-breaker-SHR2P44P.js → circuit-breaker-VRPTNBL7.js} +2 -2
  215. package/dist/cli/chunks/{claude-flow-setup-ZDDILFMF.js → claude-flow-setup-4YFG3FU5.js} +2 -2
  216. package/dist/cli/chunks/client-I3L6BKRQ.js +2 -0
  217. package/dist/cli/chunks/{cline-installer-BGYVUM6G.js → cline-installer-7RGYJWGN.js} +2 -2
  218. package/dist/cli/chunks/{code-PJ4MC3MC.js → code-ISC6NW2K.js} +3 -3
  219. package/dist/cli/chunks/{code-index-extractor-IW2P22YG.js → code-index-extractor-2FID75YV.js} +2 -2
  220. package/dist/cli/chunks/{codex-installer-A7WZ6OGL.js → codex-installer-DZ7OG6KM.js} +2 -2
  221. package/dist/cli/chunks/{completions-KS23WD5J.js → completions-SM3LICWK.js} +2 -2
  222. package/dist/cli/chunks/{complexity-analyzer-Q7GLSR2E.js → complexity-analyzer-ZWD2CTAD.js} +2 -2
  223. package/dist/cli/chunks/{continuedev-installer-SK55BFW2.js → continuedev-installer-AGASOA26.js} +2 -2
  224. package/dist/cli/chunks/{copilot-installer-3N5J3WTM.js → copilot-installer-CLPZYTQC.js} +2 -2
  225. package/dist/cli/chunks/core-handlers-5EFOJ37H.js +2 -0
  226. package/dist/cli/chunks/{cost-tracker-NENVSO4A.js → cost-tracker-7PIGQYDV.js} +2 -2
  227. package/dist/cli/chunks/{coverage-5L7UQWDH.js → coverage-T2GEBTYS.js} +9 -9
  228. package/dist/cli/chunks/cross-domain-router-65WJAKVD.js +2 -0
  229. package/dist/cli/chunks/{cursor-installer-XXBO2ZE6.js → cursor-installer-KXBID4MB.js} +2 -2
  230. package/dist/cli/chunks/daemon-43MXIVH3.js +18 -0
  231. package/dist/cli/chunks/{daemon-CDCQU3LR.js → daemon-VAMJLQJ5.js} +3 -3
  232. package/dist/cli/chunks/{dag-attention-scheduler-HOMMF7FA.js → dag-attention-scheduler-UBP4VHTA.js} +2 -2
  233. package/dist/cli/chunks/{detect-FXCOUG6X.js → detect-QWFIQRKI.js} +2 -2
  234. package/dist/cli/chunks/{dist-node-GXQ7FMTY.js → dist-node-I2GICS3W.js} +2 -2
  235. package/dist/cli/chunks/{domain-handler-TI3JBAPC.js → domain-handler-Z66ISB2A.js} +2 -2
  236. package/dist/cli/chunks/{domain-plugins-R7LTUM32.js → domain-plugins-KHMD3FKT.js} +2 -2
  237. package/dist/cli/chunks/{domain-transfer-LBIAFHIQ.js → domain-transfer-JWGNNA6K.js} +2 -2
  238. package/dist/cli/chunks/dream-VQ2PZCVR.js +2 -0
  239. package/dist/cli/chunks/embed-and-insert-pattern-F5P5B6JX.js +3 -0
  240. package/dist/cli/chunks/{embedding-space-HHLWTBF5.js → embedding-space-KHG6TITM.js} +2 -2
  241. package/dist/cli/chunks/{eval-KDOZMAXJ.js → eval-43OHU7EI.js} +2 -2
  242. package/dist/cli/chunks/{experience-capture-middleware-X45PECQN.js → experience-capture-middleware-KXD47H6P.js} +3 -3
  243. package/dist/cli/chunks/{fast-paths-462V6UUB.js → fast-paths-6D75D5KD.js} +2 -2
  244. package/dist/cli/chunks/{feature-flags-NIRQ4YDM.js → feature-flags-IE35Y55N.js} +2 -2
  245. package/dist/cli/chunks/{feature-flags-G66OT3AS.js → feature-flags-OYYHY7LS.js} +2 -2
  246. package/dist/cli/chunks/file-discovery-LGBTY3ID.js +2 -0
  247. package/dist/cli/chunks/{fleet-PXWGB7CU.js → fleet-AGVJMFGD.js} +16 -16
  248. package/dist/cli/chunks/{gnn-wrapper-7MUW3M5M.js → gnn-wrapper-5L66A7LW.js} +2 -2
  249. package/dist/cli/chunks/{heartbeat-handler-5237PB35.js → heartbeat-handler-2BY6YYOT.js} +5 -5
  250. package/dist/cli/chunks/heartbeat-scheduler-3DU3M5AT.js +2 -0
  251. package/dist/cli/chunks/hnsw-adapter-N2IMSRPV.js +2 -0
  252. package/dist/cli/chunks/hnsw-index-DVU7TTJE.js +2 -0
  253. package/dist/cli/chunks/{hnsw-legacy-bridge-OSQPW7JP.js → hnsw-legacy-bridge-RYMWFNAH.js} +2 -2
  254. package/dist/cli/chunks/{hnswlib-node-GX6WG2GB.js → hnswlib-node-GG47HP2P.js} +2 -2
  255. package/dist/cli/chunks/{hooks-GUWHL7VC.js → hooks-FQNACS24.js} +10 -10
  256. package/dist/cli/chunks/hybrid-backend-AS2PNHOD.js +2 -0
  257. package/dist/cli/chunks/{hypergraph-engine-SRWLLCU3.js → hypergraph-engine-6BYNJQEP.js} +2 -2
  258. package/dist/cli/chunks/{hypergraph-handler-AVOPRHHO.js → hypergraph-handler-CYTAXZKJ.js} +3 -3
  259. package/dist/cli/chunks/impact-analyzer-Y4OONLFP.js +2 -0
  260. package/dist/cli/chunks/{init-guard-P4N6EVZS.js → init-guard-METTAV5O.js} +2 -2
  261. package/dist/cli/chunks/{init-handler-LRGWOJMD.js → init-handler-GFT74U5Y.js} +6 -6
  262. package/dist/cli/chunks/init-wizard-HLNUBJQN.js +2 -0
  263. package/dist/cli/chunks/kernel-XKFWCL7Y.js +2 -0
  264. package/dist/cli/chunks/{kilocode-installer-7R2EPOQ6.js → kilocode-installer-GZV2D3FF.js} +2 -2
  265. package/dist/cli/chunks/{kiro-installer-QNM7DPOB.js → kiro-installer-Q4ZXUFC7.js} +2 -2
  266. package/dist/cli/chunks/knowledge-graph-CNL77CSZ.js +2 -0
  267. package/dist/cli/chunks/{learning-7OIZBPXZ.js → learning-WA2QEYL7.js} +35 -34
  268. package/dist/cli/chunks/{llm-router-SIDXES23.js → llm-router-GRTCHWH7.js} +4 -4
  269. package/dist/cli/chunks/llm-router-service-UIYTYKP6.js +2 -0
  270. package/dist/cli/chunks/{load-EI2E2C3S.js → load-WXN3Q7Y5.js} +2 -2
  271. package/dist/cli/chunks/load-test-PXLW4A5B.js +2 -0
  272. package/dist/cli/chunks/{mcp-IOE5WOCS.js → mcp-LIQCPSJN.js} +2 -2
  273. package/dist/cli/chunks/{memory-DLYGJAP7.js → memory-OP6CHRFH.js} +5 -5
  274. package/dist/cli/chunks/memory-backend-XYOSO73Q.js +2 -0
  275. package/dist/cli/chunks/memory-handlers-PQFYVNVG.js +2 -0
  276. package/dist/cli/chunks/{multi-model-executor-WHH4YCHM.js → multi-model-executor-H54DEVRZ.js} +2 -2
  277. package/dist/cli/chunks/{opencode-installer-63FDZAMS.js → opencode-installer-BSQV6UAT.js} +2 -2
  278. package/dist/cli/chunks/{orchestrator-3LA776KK.js → orchestrator-TJDPQ4VL.js} +122 -35
  279. package/dist/cli/chunks/pattern-null-store-BKGTQFNF.js +2 -0
  280. package/dist/cli/chunks/{pattern-usage-recorder-NW54QUGI.js → pattern-usage-recorder-FOVS4M5L.js} +2 -2
  281. package/dist/cli/chunks/{pipeline-P3TYX6J6.js → pipeline-4AY2ZIC6.js} +2 -2
  282. package/dist/cli/chunks/{platform-FNA2WLI6.js → platform-FCSITYMR.js} +2 -2
  283. package/dist/cli/chunks/{plugin-NJS7BC2S.js → plugin-E56TV5S2.js} +2 -2
  284. package/dist/cli/chunks/{prime-radiant-advanced-wasm-NIAVL2OT.js → prime-radiant-advanced-wasm-ACOPC533.js} +2 -2
  285. package/dist/cli/chunks/project-root-MPX7CN2C.js +2 -0
  286. package/dist/cli/chunks/protocol-executor-CRQOCC4A.js +2 -0
  287. package/dist/cli/chunks/{protocol-handler-JU5C4JHY.js → protocol-handler-KRVXF4LS.js} +2 -2
  288. package/dist/cli/chunks/{prove-35VOSLYP.js → prove-KMFPSKGD.js} +2 -2
  289. package/dist/cli/chunks/qe-reasoning-bank-UEGQ3O7F.js +2 -0
  290. package/dist/cli/chunks/{quality-ET74X7HN.js → quality-6DBI3HLB.js} +2 -2
  291. package/dist/cli/chunks/{quality-gate-FEDQISNB.js → quality-gate-3ROZMEIL.js} +3 -3
  292. package/dist/cli/chunks/queen-coordinator-32574XSG.js +2 -0
  293. package/dist/cli/chunks/real-embeddings-MIGZNKK3.js +2 -0
  294. package/dist/cli/chunks/{ref-validation-DTBPYCEB.js → ref-validation-EYIP7DHW.js} +2 -2
  295. package/dist/cli/chunks/{roocode-installer-LYQEMR4J.js → roocode-installer-IGGZHR2Y.js} +2 -2
  296. package/dist/cli/chunks/router-CZJY5WX6.js +2 -0
  297. package/dist/cli/chunks/routing-feedback-RC3UBNFX.js +2 -0
  298. package/dist/cli/chunks/{routing-handler-DJOJFPII.js → routing-handler-BWNHBYDC.js} +2 -2
  299. package/dist/cli/chunks/{ruvector-commands-VXYGJDPW.js → ruvector-commands-PXIHF432.js} +2 -2
  300. package/dist/cli/chunks/rvf-dual-writer-OG7OV2AK.js +2 -0
  301. package/dist/cli/chunks/rvf-migration-adapter-THYMW7ZO.js +2 -0
  302. package/dist/cli/chunks/rvf-migration-coordinator-3H6CLFU7.js +2 -0
  303. package/dist/cli/chunks/rvf-native-adapter-6JQJIKKW.js +2 -0
  304. package/dist/cli/chunks/{rvf-store-integrity-GA2ZYOEG.js → rvf-store-integrity-CVB3NMSL.js} +2 -2
  305. package/dist/cli/chunks/safe-db-QFKCVTIJ.js +2 -0
  306. package/dist/cli/chunks/schedule-6JLVMMYB.js +2 -0
  307. package/dist/cli/chunks/scheduler-3MPZRMJD.js +2 -0
  308. package/dist/cli/chunks/{security-MM6YOECX.js → security-DCRGOTWU.js} +3 -3
  309. package/dist/cli/chunks/{shared-rvf-adapter-6AHPA3V5.js → shared-rvf-adapter-GKD74QUB.js} +2 -2
  310. package/dist/cli/chunks/{shared-rvf-dual-writer-EYAVY2GZ.js → shared-rvf-dual-writer-HVAAVEOH.js} +2 -2
  311. package/dist/cli/chunks/sqlite-persistence-LGTIKAEX.js +2 -0
  312. package/dist/cli/chunks/{standalone-memory-A3PLB4CZ.js → standalone-memory-O7O2U5N4.js} +2 -2
  313. package/dist/cli/chunks/{status-handler-OSSFAP4Z.js → status-handler-BQTPJJTL.js} +2 -2
  314. package/dist/cli/chunks/{structural-health-PGY5XUNO.js → structural-health-4H6J4OHK.js} +2 -2
  315. package/dist/cli/chunks/sync-DJ4TF6QX.js +2 -0
  316. package/dist/cli/chunks/{sync-CWEHYGNN.js → sync-WW5TAVYW.js} +2 -2
  317. package/dist/cli/chunks/{task-handler-LHMQ75W4.js → task-handler-HEM4IEOW.js} +2 -2
  318. package/dist/cli/chunks/{task-handlers-S2TX5FTR.js → task-handlers-JRA3NXIR.js} +3 -3
  319. package/dist/cli/chunks/{test-4EGZZ6NJ.js → test-772ZXVG2.js} +4 -4
  320. package/dist/cli/chunks/test-runner-process-XGF2U3NG.js +2 -0
  321. package/dist/cli/chunks/{test-scheduling-YJQHH3XE.js → test-scheduling-4TRB7LZ7.js} +3 -3
  322. package/dist/cli/chunks/token-bootstrap-CICBIJ7T.js +2 -0
  323. package/dist/cli/chunks/{token-usage-WPNOJR6H.js → token-usage-B7PEKE2G.js} +2 -2
  324. package/dist/cli/chunks/{transformers-4MRPXCPU.js → transformers-V7X7BDZX.js} +2 -2
  325. package/dist/cli/chunks/tree-sitter-wasm-parser-OXPFKFZS.js +2 -0
  326. package/dist/cli/chunks/{types-6P5FB4EB.js → types-AHHTUY3I.js} +2 -2
  327. package/dist/cli/chunks/unified-memory-GUR3IUI6.js +2 -0
  328. package/dist/cli/chunks/unified-memory-hnsw-NJP2F2RY.js +2 -0
  329. package/dist/cli/chunks/unified-persistence-NILBWXDP.js +2 -0
  330. package/dist/cli/chunks/{upgrade-4ICTN63Y.js → upgrade-DZ4DLUQ5.js} +2 -2
  331. package/dist/cli/chunks/{validate-HQF5GZ7L.js → validate-4DTLIDJE.js} +2 -2
  332. package/dist/cli/chunks/{validate-swarm-45JYG7VW.js → validate-swarm-A26UFVIS.js} +2 -2
  333. package/dist/cli/chunks/visual-security-YECYZ27X.js +2 -0
  334. package/dist/cli/chunks/{web-tree-sitter-UOTWZLNH.js → web-tree-sitter-F2C7QRYT.js} +2 -2
  335. package/dist/cli/chunks/{windsurf-installer-WDWSBXGN.js → windsurf-installer-OOBTDA6W.js} +2 -2
  336. package/dist/cli/chunks/{witness-chain-DOYMNPC7.js → witness-chain-KGFZJP32.js} +2 -2
  337. package/dist/cli/chunks/witness-chain-LYBXFLJB.js +2 -0
  338. package/dist/cli/chunks/witness-chain-repair-CNTXOGPN.js +2 -0
  339. package/dist/cli/chunks/{witness-chain-verifier-JB42X62J.js → witness-chain-verifier-OB7ZZOI3.js} +2 -2
  340. package/dist/cli/chunks/{witness-key-manager-LXXO6L2G.js → witness-key-manager-YCKGKGQI.js} +2 -2
  341. package/dist/cli/chunks/{workflow-6ARK47NF.js → workflow-PRERHWKY.js} +4 -4
  342. package/dist/cli/chunks/workflow-orchestrator-UIBGWCU3.js +2 -0
  343. package/dist/cli/chunks/wrappers-L4UY4V63.js +2 -0
  344. package/dist/cli/commands/coverage.js +4 -1
  345. package/dist/cli/commands/learning-prune.js +9 -1
  346. package/dist/cli/handlers/brain-handler.js +32 -2
  347. package/dist/cli/handlers/heartbeat-handler.js +3 -1
  348. package/dist/cli/utils/coverage-data.js +5 -1
  349. package/dist/cli/utils/coverage-verdict.d.ts +10 -2
  350. package/dist/cli/utils/coverage-verdict.js +23 -8
  351. package/dist/cli/utils/fleet-operation.js +9 -3
  352. package/dist/coordination/handlers/code-intelligence-handlers.js +17 -3
  353. package/dist/coordination/handlers/coverage-handlers.js +22 -9
  354. package/dist/coordination/handlers/coverage-target.d.ts +22 -2
  355. package/dist/coordination/handlers/coverage-target.js +45 -9
  356. package/dist/coordination/handlers/handler-utils.d.ts +19 -0
  357. package/dist/coordination/handlers/handler-utils.js +22 -8
  358. package/dist/coordination/protocols/code-intelligence-index.js +6 -3
  359. package/dist/coordination/protocols/learning-consolidation-archive.d.ts +6 -3
  360. package/dist/coordination/protocols/learning-consolidation-archive.js +4 -3
  361. package/dist/coordination/workflow-builtin.js +1 -0
  362. package/dist/domains/defect-intelligence/interfaces.d.ts +2 -0
  363. package/dist/domains/defect-intelligence/prediction-history.d.ts +15 -1
  364. package/dist/domains/defect-intelligence/prediction-history.js +63 -7
  365. package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +1 -0
  366. package/dist/domains/defect-intelligence/services/defect-predictor.js +33 -13
  367. package/dist/domains/learning-optimization/coordinator.js +17 -10
  368. package/dist/domains/learning-optimization/domain-ranking.d.ts +26 -0
  369. package/dist/domains/learning-optimization/domain-ranking.js +28 -0
  370. package/dist/domains/learning-optimization/interfaces.d.ts +5 -0
  371. package/dist/domains/learning-optimization/pattern-archive.d.ts +55 -8
  372. package/dist/domains/learning-optimization/pattern-archive.js +90 -17
  373. package/dist/domains/learning-optimization/pattern-consolidation.js +18 -2
  374. package/dist/domains/learning-optimization/pattern-merge.d.ts +26 -0
  375. package/dist/domains/learning-optimization/pattern-merge.js +127 -0
  376. package/dist/domains/learning-optimization/services/learning-coordinator.js +21 -35
  377. package/dist/domains/test-execution/services/test-executor.js +6 -2
  378. package/dist/init/init-wizard-steps.js +3 -1
  379. package/dist/init/phases/07-hooks.js +97 -10
  380. package/dist/integrations/embeddings/cache/EmbeddingCache.js +1 -1
  381. package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +16 -1
  382. package/dist/integrations/ruvector/brain-rvf-exporter.js +18 -32
  383. package/dist/integrations/ruvector/brain-rvf-richness.d.ts +75 -0
  384. package/dist/integrations/ruvector/brain-rvf-richness.js +127 -0
  385. package/dist/kernel/unified-memory-migration.js +1 -1
  386. package/dist/learning/checkpoint-shrink-ack.d.ts +25 -0
  387. package/dist/learning/checkpoint-shrink-ack.js +57 -0
  388. package/dist/learning/dream/dream-engine.d.ts +44 -3
  389. package/dist/learning/dream/dream-engine.js +6 -2
  390. package/dist/learning/embedder-identity-store.js +3 -1
  391. package/dist/learning/embedding-space-legacy-adoption.d.ts +53 -0
  392. package/dist/learning/embedding-space-legacy-adoption.js +115 -0
  393. package/dist/learning/embedding-space-registry.d.ts +15 -0
  394. package/dist/learning/embedding-space-registry.js +50 -11
  395. package/dist/learning/experience-capture.d.ts +3 -1
  396. package/dist/learning/experience-capture.js +15 -5
  397. package/dist/learning/experience-space-verification.d.ts +2 -0
  398. package/dist/learning/experience-space-verification.js +3 -2
  399. package/dist/learning/learning-retention.js +4 -0
  400. package/dist/learning/pattern-promotion.d.ts +7 -0
  401. package/dist/learning/pattern-promotion.js +64 -12
  402. package/dist/learning/real-embeddings.js +31 -7
  403. package/dist/learning/rvf-pattern-store.js +6 -1
  404. package/dist/mcp/bundle.js +570 -558
  405. package/dist/mcp/handlers/domain-handler-configs.d.ts +3 -0
  406. package/dist/mcp/handlers/domain-handler-configs.js +1 -0
  407. package/dist/mcp/handlers/heartbeat-handlers.d.ts +4 -2
  408. package/dist/mcp/tools/learning-optimization/optimize.d.ts +6 -1
  409. package/dist/mcp/tools/learning-optimization/optimize.js +20 -11
  410. package/dist/planning/goap-planner.js +4 -0
  411. package/dist/planning/plan-executor.js +6 -2
  412. package/dist/shared/git/git-analyzer.d.ts +30 -11
  413. package/dist/shared/git/git-analyzer.js +95 -48
  414. package/dist/shared/io/confined-read.d.ts +32 -7
  415. package/dist/shared/io/confined-read.js +58 -25
  416. package/dist/shared/io/file-reader.js +4 -1
  417. package/dist/shared/safe-db.d.ts +1 -1
  418. package/dist/shared/safe-db.js +20 -5
  419. package/dist/shared/sqlite-journal-mode.d.ts +39 -0
  420. package/dist/shared/sqlite-journal-mode.js +53 -0
  421. package/dist/sync/claude-flow-bridge.js +1 -1
  422. package/dist/sync/readers/sqlite-reader.js +3 -4
  423. package/dist/sync/writers/sqlite-writer.js +1 -1
  424. package/dist/workers/interfaces.d.ts +2 -2
  425. package/dist/workers/quality-daemon/git-watcher.d.ts +8 -0
  426. package/dist/workers/quality-daemon/git-watcher.js +54 -12
  427. package/dist/workers/quality-daemon/index.js +1 -1
  428. package/dist/workers/quality-daemon/priority-queue.d.ts +2 -1
  429. package/dist/workers/workers/defect-predictor.d.ts +9 -4
  430. package/dist/workers/workers/defect-predictor.js +98 -37
  431. package/package.json +1 -1
  432. package/dist/cli/chunks/adapter-OMILP6KH.js +0 -2
  433. package/dist/cli/chunks/aqe-learning-engine-OXH5CCOS.js +0 -2
  434. package/dist/cli/chunks/base-MAK2BLTG.js +0 -2
  435. package/dist/cli/chunks/brain-handler-GCQZFZGQ.js +0 -95
  436. package/dist/cli/chunks/browser-workflow-IR3VF2TL.js +0 -2
  437. package/dist/cli/chunks/chunk-4EJLHNER.js +0 -12
  438. package/dist/cli/chunks/chunk-A4BVDYIL.js +0 -2
  439. package/dist/cli/chunks/chunk-BE7ZHM34.js +0 -3
  440. package/dist/cli/chunks/chunk-DHKSPOUQ.js +0 -16
  441. package/dist/cli/chunks/chunk-FAQ24UHB.js +0 -29
  442. package/dist/cli/chunks/chunk-IOWEBPXJ.js +0 -5
  443. package/dist/cli/chunks/chunk-KB34MTFZ.js +0 -3
  444. package/dist/cli/chunks/chunk-MCXW3DKE.js +0 -8
  445. package/dist/cli/chunks/chunk-O7VJ3VKD.js +0 -2
  446. package/dist/cli/chunks/chunk-PIWGKGWP.js +0 -3
  447. package/dist/cli/chunks/chunk-SFITYZLV.js +0 -7
  448. package/dist/cli/chunks/chunk-TIVKDIF7.js +0 -2
  449. package/dist/cli/chunks/client-NO5FOWT4.js +0 -2
  450. package/dist/cli/chunks/core-handlers-JNAZPXE2.js +0 -2
  451. package/dist/cli/chunks/cross-domain-router-HEBM767Z.js +0 -2
  452. package/dist/cli/chunks/daemon-JEBJGEUK.js +0 -18
  453. package/dist/cli/chunks/dream-GQDCEJMS.js +0 -2
  454. package/dist/cli/chunks/embed-and-insert-pattern-33KLHDD5.js +0 -3
  455. package/dist/cli/chunks/file-discovery-33USPLB5.js +0 -2
  456. package/dist/cli/chunks/heartbeat-scheduler-LIXLC5IH.js +0 -2
  457. package/dist/cli/chunks/hnsw-adapter-62D5UH27.js +0 -2
  458. package/dist/cli/chunks/hnsw-index-GSGUMQQC.js +0 -2
  459. package/dist/cli/chunks/hybrid-backend-FRWP4BOY.js +0 -2
  460. package/dist/cli/chunks/impact-analyzer-7KF3AQXV.js +0 -2
  461. package/dist/cli/chunks/init-wizard-XWWAXY25.js +0 -2
  462. package/dist/cli/chunks/kernel-ZEJPNDBW.js +0 -2
  463. package/dist/cli/chunks/knowledge-graph-RRZQS7KY.js +0 -2
  464. package/dist/cli/chunks/llm-router-service-3OSW67LC.js +0 -2
  465. package/dist/cli/chunks/load-test-7TRIH2WJ.js +0 -2
  466. package/dist/cli/chunks/memory-backend-G7ZW6Q2B.js +0 -2
  467. package/dist/cli/chunks/memory-handlers-TPF3KCO5.js +0 -2
  468. package/dist/cli/chunks/pattern-null-store-OU3ZC3NR.js +0 -2
  469. package/dist/cli/chunks/project-root-GMOFJEKD.js +0 -2
  470. package/dist/cli/chunks/protocol-executor-AD345XRO.js +0 -2
  471. package/dist/cli/chunks/qe-reasoning-bank-NLTP26RC.js +0 -2
  472. package/dist/cli/chunks/queen-coordinator-2TB4FWS6.js +0 -2
  473. package/dist/cli/chunks/real-embeddings-II6CXTCI.js +0 -2
  474. package/dist/cli/chunks/router-PLM3MWME.js +0 -2
  475. package/dist/cli/chunks/routing-feedback-I7VOX2HU.js +0 -2
  476. package/dist/cli/chunks/rvf-dual-writer-GQZHFWO2.js +0 -2
  477. package/dist/cli/chunks/rvf-migration-adapter-3TVKBCAM.js +0 -2
  478. package/dist/cli/chunks/rvf-migration-coordinator-XUHKLMT6.js +0 -2
  479. package/dist/cli/chunks/rvf-native-adapter-5GUTYOWS.js +0 -2
  480. package/dist/cli/chunks/safe-db-RZPQGLGQ.js +0 -2
  481. package/dist/cli/chunks/schedule-G7JMQDUX.js +0 -2
  482. package/dist/cli/chunks/scheduler-4SEGPCKD.js +0 -2
  483. package/dist/cli/chunks/sqlite-persistence-IVE4SQXR.js +0 -2
  484. package/dist/cli/chunks/sync-PM6D7EQF.js +0 -2
  485. package/dist/cli/chunks/test-runner-process-72YACW6M.js +0 -2
  486. package/dist/cli/chunks/token-bootstrap-DJNETMVW.js +0 -2
  487. package/dist/cli/chunks/tree-sitter-wasm-parser-UVWSDXFR.js +0 -2
  488. package/dist/cli/chunks/unified-memory-2VMGSGQL.js +0 -2
  489. package/dist/cli/chunks/unified-memory-hnsw-3KULVD3N.js +0 -2
  490. package/dist/cli/chunks/unified-persistence-QCSLU2SV.js +0 -2
  491. package/dist/cli/chunks/visual-security-ZYP2KPH7.js +0 -2
  492. package/dist/cli/chunks/witness-chain-5QRT7EMX.js +0 -2
  493. package/dist/cli/chunks/witness-chain-repair-CUF2AFQB.js +0 -2
  494. package/dist/cli/chunks/workflow-orchestrator-RYDDWIXN.js +0 -2
  495. package/dist/cli/chunks/wrappers-CYQBOMPL.js +0 -2
@@ -0,0 +1,127 @@
1
+ /**
2
+ * Agentic QE v3 - Committing one pattern merge (#1106, #1149)
3
+ *
4
+ * `LearningCoordinatorService.consolidatePatterns` builds the consolidated
5
+ * pattern; this module moves the sources out of the active set:
6
+ *
7
+ * 1. Every source pattern's archive copy is written and verified.
8
+ * 2. The consolidated pattern is stored and read back in full.
9
+ * 3. The sources are removed one by one with compare-and-delete.
10
+ *
11
+ * A failure in steps 1-2, or before the first source is removed, rolls the
12
+ * merge back: the consolidated pattern and the archive copies are deleted and
13
+ * every source stays active. A failure after a source was removed keeps the
14
+ * consolidated pattern (it now holds that source's data) and reports each
15
+ * source's real state. Callers run this under `withPatternMoveLock`.
16
+ */
17
+ import { err, ok } from '../../shared/types/index.js';
18
+ import { toError } from '../../shared/error-utils.js';
19
+ import { LEARNING_NS, LEARNING_PATTERN_KEY_PREFIX } from './active-patterns.js';
20
+ import { canonicalJson, copyPatternToArchive, discardArchiveCopy, removeArchivedPattern, } from './pattern-archive.js';
21
+ const LEFT_ACTIVE = 'nothing was merged and every source pattern was left active';
22
+ const REMOVE_REASONS = {
23
+ changed: 'changed after its archive copy',
24
+ failed: 'archive copy no longer verifies',
25
+ };
26
+ /**
27
+ * Archive `sources`, store `consolidated` with `store`, then remove the
28
+ * sources. Returns the consolidated pattern only when every source left the
29
+ * active set.
30
+ */
31
+ export async function commitPatternMerge(memory, sources, consolidated, store, archivedAt = new Date()) {
32
+ const copied = [];
33
+ let storeAttempted = false;
34
+ const rollBack = async (reason) => {
35
+ const problems = await undoMerge(memory, copied, storeAttempted ? consolidated : undefined);
36
+ return err(new Error(`${reason}; ${LEFT_ACTIVE}${problems.length ? ` (rollback incomplete: ${problems.join('; ')})` : ''}`));
37
+ };
38
+ try {
39
+ let notCopied = 0;
40
+ for (const source of sources) {
41
+ if ((await copyPatternToArchive(memory, source, archivedAt)) === 'copied')
42
+ copied.push(source);
43
+ else
44
+ notCopied++;
45
+ }
46
+ if (notCopied > 0) {
47
+ return rollBack(`${notCopied} of ${sources.length} source patterns could not be archived (archive copy not verified)`);
48
+ }
49
+ storeAttempted = true;
50
+ await store(consolidated);
51
+ const stored = await memory.get(`${LEARNING_PATTERN_KEY_PREFIX}${consolidated.id}`, LEARNING_NS);
52
+ if (!stored || canonicalJson(stored) !== canonicalJson(consolidated)) {
53
+ return rollBack('Consolidated pattern could not be read back');
54
+ }
55
+ }
56
+ catch (error) {
57
+ return rollBack(`Merge failed before any source pattern was removed: ${toError(error).message}`);
58
+ }
59
+ const removed = [];
60
+ for (let i = 0; i < sources.length; i++) {
61
+ let reason;
62
+ try {
63
+ const outcome = await removeArchivedPattern(memory, sources[i]);
64
+ if (outcome === 'removed' || outcome === 'missing') {
65
+ removed.push(outcome === 'missing' ? `${sources[i].id} (already gone)` : sources[i].id);
66
+ continue;
67
+ }
68
+ reason = REMOVE_REASONS[outcome];
69
+ }
70
+ catch (error) {
71
+ // A delete can fail after it took effect: report what is stored.
72
+ if (await isGone(memory, sources[i])) {
73
+ removed.push(sources[i].id);
74
+ continue;
75
+ }
76
+ reason = `delete failed: ${toError(error).message}`;
77
+ }
78
+ if (removed.length === 0)
79
+ return rollBack(`Source pattern ${sources[i].id} was not removed (${reason})`);
80
+ const leftActive = sources.slice(i);
81
+ const problems = [];
82
+ for (const source of leftActive) {
83
+ try {
84
+ await discardArchiveCopy(memory, source);
85
+ }
86
+ catch (error) {
87
+ problems.push(`archive copy of ${source.id} not removed: ${toError(error).message}`);
88
+ }
89
+ }
90
+ const states = leftActive.map((s, j) => `${s.id} (${j === 0 ? reason : 'not attempted'})`);
91
+ return err(new Error(`Merge partially applied: consolidated pattern ${consolidated.id} is active; ` +
92
+ `removed: ${removed.join(', ')}; left active: ${states.join(', ')}` +
93
+ (problems.length ? `; ${problems.join('; ')}` : '')));
94
+ }
95
+ return ok(consolidated);
96
+ }
97
+ /** True only when the source's active key is confirmed absent. */
98
+ async function isGone(memory, source) {
99
+ try {
100
+ return !(await memory.get(`${LEARNING_PATTERN_KEY_PREFIX}${source.id}`, LEARNING_NS));
101
+ }
102
+ catch {
103
+ return false;
104
+ }
105
+ }
106
+ /** Delete the consolidated pattern and the archive copies of sources that are still active. */
107
+ async function undoMerge(memory, copied, consolidated) {
108
+ const problems = [];
109
+ if (consolidated) {
110
+ try {
111
+ await memory.delete(`${LEARNING_PATTERN_KEY_PREFIX}${consolidated.id}`, LEARNING_NS);
112
+ }
113
+ catch (error) {
114
+ problems.push(`consolidated pattern ${consolidated.id} not removed: ${toError(error).message}`);
115
+ }
116
+ }
117
+ for (const source of copied) {
118
+ try {
119
+ await discardArchiveCopy(memory, source);
120
+ }
121
+ catch (error) {
122
+ problems.push(`archive copy of ${source.id} not removed: ${toError(error).message}`);
123
+ }
124
+ }
125
+ return problems;
126
+ }
127
+ //# sourceMappingURL=pattern-merge.js.map
@@ -9,7 +9,8 @@ import { rehydrateDates } from '../../../shared/utils/kv-date-rehydrate.js';
9
9
  import { toError } from '../../../shared/error-utils.js';
10
10
  import { readActivePatterns } from '../active-patterns.js';
11
11
  import { isMeasuredPattern, partitionByRewardSource, patternEvidenceOf } from '../reward-source.js';
12
- import { copyPatternToArchive, removeArchivedPattern } from '../pattern-archive.js';
12
+ import { withPatternMoveLock } from '../pattern-archive.js';
13
+ import { commitPatternMerge } from '../pattern-merge.js';
13
14
  import { buildConsolidatedPattern } from '../pattern-consolidation.js';
14
15
  import { createQEFlashAttention, } from '../../../integrations/ruvector/wrappers.js';
15
16
  import { getClaudeModelForTier } from '../../../shared/llm/model-registry.js';
@@ -346,41 +347,26 @@ Provide:
346
347
  if (patternIds.length < 2) {
347
348
  return err(new Error('Need at least 2 patterns to consolidate'));
348
349
  }
349
- const patterns = [];
350
- for (const id of patternIds) {
351
- const pattern = await this.memory.get(`learning:pattern:${id}`, LEARNING_NS);
352
- if (pattern) {
353
- patterns.push(pattern);
350
+ // #1149: one move at a time per backend. A second merge of the same ids
351
+ // reads its sources after the first has removed them, and stops.
352
+ return await withPatternMoveLock(this.memory, async () => {
353
+ const patterns = [];
354
+ for (const id of patternIds) {
355
+ const pattern = await this.memory.get(`learning:pattern:${id}`, LEARNING_NS);
356
+ if (pattern) {
357
+ patterns.push(pattern);
358
+ }
354
359
  }
355
- }
356
- if (patterns.length < 2) {
357
- return err(new Error('Not enough valid patterns found'));
358
- }
359
- // Merge patterns - take best template, combine contexts
360
- const consolidatedPattern = buildConsolidatedPattern(patterns, uuidv4());
361
- // #1106: all or nothing. Every source pattern's archive copy is written
362
- // and read back first; then the consolidated pattern is stored and read
363
- // back; only then are the source patterns removed from the active set.
364
- // If any step fails, no source pattern is deleted.
365
- const archivedAt = new Date();
366
- let notCopied = 0;
367
- for (const pattern of patterns) {
368
- if (await copyPatternToArchive(this.memory, pattern, archivedAt) !== 'copied')
369
- notCopied++;
370
- }
371
- if (notCopied > 0) {
372
- return err(new Error(`${notCopied} of ${patterns.length} source patterns could not be archived (archive copy not verified); ` +
373
- 'nothing was merged and every source pattern was left active'));
374
- }
375
- await this.storePattern(consolidatedPattern);
376
- const stored = await this.memory.get(`learning:pattern:${consolidatedPattern.id}`, LEARNING_NS);
377
- if (!stored || stored.id !== consolidatedPattern.id) {
378
- return err(new Error('Consolidated pattern could not be read back; nothing was merged and every source pattern was left active'));
379
- }
380
- for (const pattern of patterns) {
381
- await removeArchivedPattern(this.memory, pattern);
382
- }
383
- return ok(consolidatedPattern);
360
+ if (patterns.length < 2) {
361
+ return err(new Error('Not enough valid patterns found'));
362
+ }
363
+ // Merge patterns - take best template, combine contexts
364
+ const consolidatedPattern = buildConsolidatedPattern(patterns, uuidv4());
365
+ // #1106/#1149: every source is archived and verified, then the
366
+ // consolidated pattern is stored and verified, then the sources are
367
+ // removed with compare-and-delete; failures roll back (pattern-merge.ts).
368
+ return commitPatternMerge(this.memory, patterns, consolidatedPattern, (p) => this.storePattern(p));
369
+ });
384
370
  }
385
371
  catch (error) {
386
372
  return err(toError(error));
@@ -11,7 +11,7 @@ import { isDeepStrictEqual } from 'node:util';
11
11
  import { v4 as uuidv4 } from 'uuid';
12
12
  import { ok, err } from '../../../shared/types/index.js';
13
13
  import { TEST_EXECUTION_CONSTANTS, LLM_ANALYSIS_CONSTANTS } from '../../constants.js';
14
- import { toErrorMessage, toError } from '../../../shared/error-utils.js';
14
+ import { CallerInputError, isCallerInputError, toErrorMessage, toError } from '../../../shared/error-utils.js';
15
15
  import { safeJsonParse } from '../../../shared/safe-json.js';
16
16
  import { secureRandom, secureRandomInt } from '../../../shared/utils/crypto-random.js';
17
17
  import { writeTestRunEvidence } from '../../quality-assessment/quality-evidence.js';
@@ -442,6 +442,10 @@ Provide:
442
442
  // Runner/suite errors have no trustworthy assertion receipt to aggregate.
443
443
  if (result.error instanceof TestRunnerExecutionError)
444
444
  throw result.error;
445
+ // #1147: the caller's input (a test file that does not exist) is not a
446
+ // failed test, so it is never counted as a measured failure.
447
+ if (isCallerInputError(result.error))
448
+ throw result.error;
445
449
  // Return as a failed test rather than throwing — allows other files to still run
446
450
  return {
447
451
  total: files.length,
@@ -467,7 +471,7 @@ Provide:
467
471
  // Verify test file exists
468
472
  const missingFile = files.find(file => !existsSync(file));
469
473
  if (missingFile) {
470
- return err(new Error(`Test file not found: ${missingFile}`));
474
+ return err(new CallerInputError(`Test file not found: ${missingFile}`));
471
475
  }
472
476
  // Build command based on framework
473
477
  const { command, args, report, coverageDirectory } = this.buildTestCommand(files, framework);
@@ -13,6 +13,7 @@ import { createN8nInstaller } from './n8n-installer.js';
13
13
  import { toErrorMessage } from '../shared/error-utils.js';
14
14
  import { isNativeModuleLoadFailure, withNativeModuleRemedy } from '../shared/native-module-errors.js';
15
15
  import { openDatabase } from '../shared/safe-db.js';
16
+ import { setJournalModeWithRetry } from '../shared/sqlite-journal-mode.js';
16
17
  import { safeJsonParse } from '../shared/safe-json.js';
17
18
  // ============================================================================
18
19
  // Version Management
@@ -128,8 +129,9 @@ export async function initializePersistenceDatabase(projectRoot) {
128
129
  const dbPath = join(dataDir, 'memory.db');
129
130
  try {
130
131
  const db = new Database(dbPath);
131
- db.pragma('journal_mode = WAL');
132
+ // busy_timeout first; the WAL switch retries within it (#1164).
132
133
  db.pragma('busy_timeout = 5000');
134
+ setJournalModeWithRetry(db, 'WAL', 5000);
133
135
  db.exec(`
134
136
  CREATE TABLE IF NOT EXISTS kv_store (
135
137
  key TEXT NOT NULL,
@@ -408,6 +408,15 @@ const MAX_AGE_HOURS = 24;
408
408
  const SKIP_PATH = path.join(AQE_DIR, 'brain-checkpoint.skip.json');
409
409
  const RETRY_ENV = Number.parseFloat(process.env.AQE_BRAIN_CHECKPOINT_RETRY_HOURS || '');
410
410
  const TOO_LARGE_RETRY_HOURS = Number.isFinite(RETRY_ENV) && RETRY_ENV >= 0 ? RETRY_ENV : 6;
411
+ // #1251: refuse an export in which a table collapsed; a deliberate shrink
412
+ // (aqe learning prune --apply, dream retention) leaves this acknowledgement,
413
+ // which the CLI honours once, within 24h, while the brain holds its counts.
414
+ const SHRINK_ACK_PATH = path.join(AQE_DIR, 'brain-checkpoint.accept-shrink.json');
415
+ const SHRINK_ACK_MAX_AGE_HOURS = 24;
416
+ const MIRROR_REFUSAL = /RVF_MIRROR_(?:RICHER|INSPECTION_AMBIGUOUS):[^\\n]*/;
417
+ const SHRINK_ACK_VERDICT = /SHRINK_ACK_(HONOURED|IGNORED): ([^\\n]*)/;
418
+ // An older global aqe rejects the #1251 flags: back off rather than fail every turn.
419
+ const OUTDATED_CLI = /unknown option '(--(?:compare-with|richness-policy|accept-shrink))'/;
411
420
  // Windows (#872): never execFile aqe.cmd (EINVAL without a shell); reuse the
412
421
  // hook shim's resolver, which runs the AQE bundle via node instead.
413
422
  function aqeInvocation() {
@@ -441,6 +450,42 @@ function activeSkip() {
441
450
  return skip;
442
451
  }
443
452
 
453
+ function dropShrinkAck(why) {
454
+ try { fs.unlinkSync(SHRINK_ACK_PATH); } catch { /* best-effort */ }
455
+ log('Ignored the shrink acknowledgement (' + why + '); the normal checkpoint policy applies.');
456
+ }
457
+ // The deliberate-shrink acknowledgement, or null; drops one that is unreadable,
458
+ // over 24h old or older than aqe.rvf. The CLI checks its counts (--accept-shrink).
459
+ function pendingShrinkAck() {
460
+ let st; try { st = fs.lstatSync(SHRINK_ACK_PATH); } catch { return null; }
461
+ let ack = null;
462
+ if (st.isFile()) { try { ack = JSON.parse(fs.readFileSync(SHRINK_ACK_PATH, 'utf8')); } catch { /* unreadable */ } }
463
+ const at = ack ? Date.parse(ack.at) : NaN;
464
+ let rvfMtime = 0; try { rvfMtime = fs.lstatSync(RVF_PATH).mtimeMs; } catch { /* absent */ }
465
+ let why = null;
466
+ if (!Number.isFinite(at)) why = 'unreadable';
467
+ else if (Date.now() - at > SHRINK_ACK_MAX_AGE_HOURS * 3600000) why = 'older than 24h';
468
+ else if (rvfMtime > at) why = 'already checkpointed';
469
+ if (why) { dropShrinkAck(why); return null; }
470
+ return { at, producer: String(ack.producer) };
471
+ }
472
+ // The CLI's verdict on the acknowledgement: its producer when honoured. No
473
+ // verdict (the export failed first) keeps it for the next turn.
474
+ function settleShrinkAck(output) {
475
+ const verdict = String(output || '').match(SHRINK_ACK_VERDICT);
476
+ if (!verdict) return null;
477
+ if (verdict[1] === 'IGNORED') { dropShrinkAck(verdict[2].trim()); return null; }
478
+ return verdict[2].trim();
479
+ }
480
+ function resumeHint(skip) {
481
+ return MIRROR_REFUSAL.test(skip.reason)
482
+ ? 'To resume now, back up aqe.rvf and run \`aqe brain export -o .agentic-qe/aqe.rvf --force-overwrite-richer\`, '
483
+ + 'or delete .agentic-qe/brain-checkpoint.skip.json to retry.'
484
+ : skip.reason.includes('upgrade to enable the checkpoint guard')
485
+ ? 'Upgrade the global aqe (npm i -g agentic-qe), then delete .agentic-qe/brain-checkpoint.skip.json.'
486
+ : 'To retry now, delete .agentic-qe/brain-checkpoint.skip.json.';
487
+ }
488
+
444
489
  function writeSkip(reason) {
445
490
  const at = new Date();
446
491
  const skip = { reason, at: at.toISOString(), retryAfter: new Date(at.getTime() + TOO_LARGE_RETRY_HOURS * 3600000).toISOString() };
@@ -483,6 +528,17 @@ function promote(tmp) {
483
528
  }
484
529
  }
485
530
 
531
+ // Version of the installed aqe, for the outdated-CLI back-off.
532
+ function aqeVersion(aqe) {
533
+ try {
534
+ const out = execFileSync(aqe.cmd, [...aqe.args, '--version'],
535
+ { timeout: 10000, encoding: 'utf-8', windowsHide: true, stdio: ['ignore', 'pipe', 'ignore'] });
536
+ return out.trim().split(/\\s+/).pop() || 'unknown';
537
+ } catch {
538
+ return 'unknown';
539
+ }
540
+ }
541
+
486
542
  function exportBrain() {
487
543
  if (!fs.existsSync(DB_PATH)) { log('No memory.db, skipping'); return { exported: false }; }
488
544
  const aqe = aqeInvocation();
@@ -490,17 +546,22 @@ function exportBrain() {
490
546
  // Never write through a committed symlink: .agentic-qe must be a real dir.
491
547
  let st; try { st = fs.lstatSync(AQE_DIR); } catch { /* missing */ }
492
548
  if (!st || !st.isDirectory()) { log('Export skipped: .agentic-qe is a symlink'); return { exported: false }; }
549
+ const ack = pendingShrinkAck();
493
550
  const skip = activeSkip();
494
- if (skip) {
495
- log('Export skipped until ' + skip.retryAfter + ': ' + skip.reason);
551
+ // A shrink acknowledged after the back-off began is the answer to it.
552
+ if (skip && !(ack && ack.at > Date.parse(skip.at))) {
553
+ // Logged once, when the back-off began; session-start verify reports it.
496
554
  return { exported: false, skipped: true, reason: skip.reason, retryAfter: skip.retryAfter };
497
555
  }
498
556
  sweepStaleTmp();
499
557
  const tmp = path.join(AQE_DIR, TMP_PREFIX + process.pid + '-' + crypto.randomBytes(4).toString('hex'));
500
558
  try {
501
559
  for (const suffix of ['', ...RVF_SIDECARS]) removeEntry(tmp + suffix);
560
+ const args = [...aqe.args, 'brain', 'export', '-o', tmp, '--format', 'rvf'];
561
+ if (lexists(RVF_PATH)) args.push('--compare-with', RVF_PATH, '--richness-policy', 'checkpoint');
562
+ if (ack) args.push('--accept-shrink', SHRINK_ACK_PATH);
502
563
  const result = execFileSync(
503
- aqe.cmd, [...aqe.args, 'brain', 'export', '-o', tmp, '--format', 'rvf'],
564
+ aqe.cmd, args,
504
565
  { timeout: 60000, encoding: 'utf-8', windowsHide: true, stdio: ['ignore', 'pipe', 'pipe'] }
505
566
  );
506
567
  // A zero exit without a store is a failure, not an empty checkpoint.
@@ -509,9 +570,30 @@ function exportBrain() {
509
570
  const m = result.match(/Patterns:\\s+(\\d+)/);
510
571
  const p = m ? m[1] : '0';
511
572
  log('Exported ' + p + ' patterns to aqe.rvf');
512
- return { exported: true, patterns: parseInt(p) };
573
+ const accepted = ack ? settleShrinkAck(result) : null;
574
+ if (!accepted) return { exported: true, patterns: parseInt(p) };
575
+ try { removeEntry(SHRINK_ACK_PATH); removeEntry(SKIP_PATH); } catch { /* spent: older than aqe.rvf now */ }
576
+ log('Accepted the smaller brain (' + accepted + ')');
577
+ return { exported: true, patterns: parseInt(p), acceptedShrink: accepted };
513
578
  } catch (e) {
514
- const tooLarge = (String(e.stderr || '') + String(e.stdout || '')).match(/RVF_KERNEL_TOO_LARGE:[^\\n]*/);
579
+ const output = String(e.stderr || '') + String(e.stdout || '');
580
+ if (ack) settleShrinkAck(e.stdout);
581
+ const outdated = output.match(OUTDATED_CLI);
582
+ if (outdated) {
583
+ const skip = writeSkip('installed aqe ' + aqeVersion(aqe) + ' lacks ' + outdated[1] + '; upgrade to enable the checkpoint guard');
584
+ log('Export skipped, previous aqe.rvf kept: ' + skip.reason);
585
+ log('Skipping the checkpoint export until ' + skip.retryAfter + ' (logged once).');
586
+ return { exported: false, outdatedCli: true, reason: skip.reason, retryAfter: skip.retryAfter };
587
+ }
588
+ const refused = output.match(MIRROR_REFUSAL);
589
+ if (refused) {
590
+ const skip = writeSkip(refused[0].trim());
591
+ log('Export refused, previous aqe.rvf kept: ' + skip.reason);
592
+ log('Skipping the checkpoint export until ' + skip.retryAfter + ' (logged once). If the smaller brain is '
593
+ + 'intended, back up aqe.rvf and run: aqe brain export -o .agentic-qe/aqe.rvf --force-overwrite-richer');
594
+ return { exported: false, richer: true, reason: skip.reason, retryAfter: skip.retryAfter };
595
+ }
596
+ const tooLarge = output.match(/RVF_KERNEL_TOO_LARGE:[^\\n]*/);
515
597
  if (tooLarge) {
516
598
  const skip = writeSkip(tooLarge[0].trim());
517
599
  log('Export failed: ' + skip.reason);
@@ -529,18 +611,23 @@ function verifyBrain() {
529
611
  if (!fs.existsSync(RVF_PATH)) {
530
612
  const skip = activeSkip();
531
613
  if (skip) {
532
- log('No aqe.rvf found; checkpoint export paused until ' + skip.retryAfter + ': ' + skip.reason);
533
- return { valid: false, reason: 'missing', skippedUntil: skip.retryAfter };
614
+ log('No aqe.rvf found; checkpoint export paused until ' + skip.retryAfter + ': ' + skip.reason + ' ' + resumeHint(skip));
615
+ return { valid: false, reason: 'missing', skippedUntil: skip.retryAfter, resumeHint: resumeHint(skip) };
534
616
  }
535
617
  log('No aqe.rvf found');
536
618
  return { valid: false, reason: 'missing' };
537
619
  }
538
620
  const stat = fs.statSync(RVF_PATH);
621
+ const paused = activeSkip();
622
+ if (paused) log('Checkpoint export paused until ' + paused.retryAfter + ': ' + paused.reason + ' ' + resumeHint(paused));
623
+ const pause = paused
624
+ ? { pausedUntil: paused.retryAfter, pauseReason: paused.reason, resumeHint: resumeHint(paused) }
625
+ : {};
539
626
  const ageH = (Date.now() - stat.mtimeMs) / 3600000;
540
- if (stat.size < 1024) { log('aqe.rvf too small'); return { valid: false, reason: 'too-small' }; }
541
- if (ageH > MAX_AGE_HOURS) { log('aqe.rvf is ' + ageH.toFixed(1) + 'h old'); return { valid: true, stale: true }; }
627
+ if (stat.size < 1024) { log('aqe.rvf too small'); return { valid: false, reason: 'too-small', ...pause }; }
628
+ if (ageH > MAX_AGE_HOURS) { log('aqe.rvf is ' + ageH.toFixed(1) + 'h old'); return { valid: true, stale: true, ...pause }; }
542
629
  log('aqe.rvf OK (' + (stat.size/1048576).toFixed(1) + ' MB)');
543
- return { valid: true, stale: false };
630
+ return { valid: true, stale: false, ...pause };
544
631
  }
545
632
 
546
633
  const cmd = process.argv[2] || 'verify';
@@ -89,8 +89,8 @@ export class EmbeddingCache {
89
89
  if (!existsSync(dir)) {
90
90
  mkdirSync(dir, { recursive: true });
91
91
  }
92
+ // #1164: openDatabase() set the journal mode (retrying contention, honouring AQE_DISABLE_WAL).
92
93
  this.db = openDatabase(this.storagePath);
93
- this.db.pragma('journal_mode = WAL');
94
94
  this.db.pragma('synchronous = NORMAL');
95
95
  // Create table if not exists (only for legacy mode)
96
96
  this.db.exec(`
@@ -5,6 +5,7 @@
5
5
  */
6
6
  import Database from 'better-sqlite3';
7
7
  import { type MergeStrategy } from './brain-shared.js';
8
+ import { CODE_INDEX_VECTOR_ID_PREFIX, type RichnessPolicy, type ShrinkAckVerdict } from './brain-rvf-richness.js';
8
9
  export interface RvfBrainManifest {
9
10
  readonly version: '2.0' | '3.0';
10
11
  readonly format: 'rvf';
@@ -50,6 +51,20 @@ export interface RvfBrainExportOptions {
50
51
  readonly signerKeyId?: string;
51
52
  /** Explicit operator acknowledgement that a richer existing mirror may be replaced. */
52
53
  readonly allowOverwriteRicher?: boolean;
54
+ /**
55
+ * The mirror to compare richness against, when it is not `outputPath`
56
+ * (#1251: the checkpoint hook exports to a temp path, then renames).
57
+ */
58
+ readonly compareWithPath?: string;
59
+ /** How much shrinkage the richness guard tolerates. Defaults to 'strict'. */
60
+ readonly richnessPolicy?: RichnessPolicy;
61
+ /**
62
+ * A deliberate-shrink acknowledgement (parsed JSON, #1251). When it still
63
+ * vouches for this export, it replaces the mirror comparison.
64
+ */
65
+ readonly shrinkAck?: unknown;
66
+ /** Told whether `shrinkAck` was honoured, before the mirror comparison runs. */
67
+ readonly onShrinkAck?: (verdict: ShrinkAckVerdict) => void;
53
68
  /** Kernel size ceiling in bytes. Defaults to RVF_MAX_KERNEL_BYTES; lowered only by tests. */
54
69
  readonly maxKernelBytes?: number;
55
70
  }
@@ -74,7 +89,7 @@ export declare const RVF_MAX_KERNEL_BYTES: number;
74
89
  * index, C4 diagrams). They are derived from source code and rebuilt by
75
90
  * `aqe code index`, so they stay out of the brain kernel (#1238).
76
91
  */
77
- export declare const CODE_INDEX_VECTOR_ID_PREFIX = "code-intelligence:";
92
+ export { CODE_INDEX_VECTOR_ID_PREFIX };
78
93
  /** Thrown before any native call when the kernel would exceed the RVF limit. */
79
94
  export declare class RvfKernelTooLargeError extends Error {
80
95
  readonly kernelBytes: number;
@@ -8,6 +8,7 @@ import { basename, dirname, join, resolve } from 'path';
8
8
  import { createRvfStore, openRvfStore, openRvfStoreReadonly, isRvfNativeAvailable, } from './rvf-native-adapter.js';
9
9
  import { sha256, tableExists, queryAll, domainFilterForColumn, runImportTransaction, mergeGenericRow, remapPatternReferences, mergeAppendOnlyRow, TABLE_CONFIGS, TABLE_BLOB_COLUMNS, PK_COLUMNS, CONFIDENCE_COLUMNS, TIMESTAMP_COLUMNS, serializeRowBlobs, deserializeRowBlobs, } from './brain-shared.js';
10
10
  import { appendBrainImportWitness } from './brain-import-audit.js';
11
+ import { assertNotPoorerThanMirror, CODE_INDEX_VECTOR_ID_PREFIX, evaluateShrinkAck, RvfMirrorGuardError, } from './brain-rvf-richness.js';
11
12
  // --- Export ---
12
13
  /**
13
14
  * Largest kernel image @ruvector/rvf-node accepts. One byte more and
@@ -20,7 +21,7 @@ export const RVF_MAX_KERNEL_BYTES = 128 * 1024 * 1024;
20
21
  * index, C4 diagrams). They are derived from source code and rebuilt by
21
22
  * `aqe code index`, so they stay out of the brain kernel (#1238).
22
23
  */
23
- export const CODE_INDEX_VECTOR_ID_PREFIX = 'code-intelligence:';
24
+ export { CODE_INDEX_VECTOR_ID_PREFIX };
24
25
  const CODE_INDEX_VECTOR_MATCH = `substr(id, 1, ${CODE_INDEX_VECTOR_ID_PREFIX.length}) = ?`;
25
26
  function isCodeIndexVectorRow(tableName, row) {
26
27
  if (tableName !== 'vectors')
@@ -319,47 +320,32 @@ export function exportBrainToRvf(db, options, sourceDbLabel = 'memory.db') {
319
320
  // promotion. Inspection is fail-closed when the RVF itself remains readable
320
321
  // but its kernel cannot yield a complete table inventory. A genuinely
321
322
  // unreadable/corrupt RVF remains replaceable to preserve #563 recovery.
322
- if (existsSync(outPath) && !options.allowOverwriteRicher) {
323
+ // #1251: the Stop-hook checkpoint writes to a temp path and names the
324
+ // published checkpoint in `compareWithPath`, so it is compared here too.
325
+ const comparePath = options.compareWithPath ? resolve(options.compareWithPath) : outPath;
326
+ let allowOverwriteRicher = options.allowOverwriteRicher === true;
327
+ if (options.shrinkAck !== undefined && !allowOverwriteRicher) {
328
+ const verdict = evaluateShrinkAck(options.shrinkAck, TABLE_CONFIGS.map(({ tableName }) => tableName), manifest.stats.tableCounts);
329
+ options.onShrinkAck?.(verdict);
330
+ allowOverwriteRicher = verdict.honoured;
331
+ }
332
+ if (existsSync(comparePath) && !allowOverwriteRicher) {
323
333
  let existing;
324
334
  try {
325
335
  // Code-index vectors are no longer exported (#1238), so an older mirror
326
336
  // that still holds them is compared on the rows both exports carry.
327
- existing = readBrainInfo(outPath, true);
337
+ existing = readBrainInfo(comparePath, true);
328
338
  }
329
339
  catch (error) {
330
- if (hasReadableBrainKernel(outPath) || !isKnownUnusableRvfError(error)) {
340
+ if (hasReadableBrainKernel(comparePath) || !isKnownUnusableRvfError(error)) {
331
341
  const detail = error instanceof Error ? error.message : String(error);
332
- throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: the existing mirror is readable but its ` +
333
- `richness could not be established (${detail}). Preserve/import it before retrying, ` +
334
- `or repeat with --force-overwrite-richer after preserving a backup.`);
342
+ throw new RvfMirrorGuardError('RVF_MIRROR_INSPECTION_AMBIGUOUS', `the existing mirror is readable but its richness could not be established ` +
343
+ `(${detail}). Preserve/import it before retrying, or repeat with ` +
344
+ `--force-overwrite-richer after preserving a backup.`);
335
345
  }
336
346
  }
337
347
  if (existing) {
338
- const existingCounts = existing.stats.tableCounts;
339
- const candidateCounts = manifest.stats.tableCounts;
340
- const missing = TABLE_CONFIGS
341
- .map(({ tableName }) => tableName)
342
- .filter((tableName) => !existingCounts || !Number.isSafeInteger(existingCounts[tableName]));
343
- if (missing.length > 0) {
344
- throw new Error(`RVF_MIRROR_INSPECTION_AMBIGUOUS: existing mirror lacks trustworthy counts for ` +
345
- `${missing.join(', ')}. Preserve/import it before retrying, or repeat with ` +
346
- `--force-overwrite-richer after preserving a backup.`);
347
- }
348
- const richer = TABLE_CONFIGS
349
- .map(({ tableName }) => ({
350
- tableName,
351
- existing: existingCounts[tableName],
352
- candidate: candidateCounts[tableName],
353
- }))
354
- .filter(({ existing: existingCount, candidate }) => existingCount > candidate);
355
- if (richer.length > 0) {
356
- const differences = richer
357
- .map(({ tableName, existing: existingCount, candidate }) => `${tableName} ${existingCount} -> ${candidate}`)
358
- .join(', ');
359
- throw new Error(`RVF_MIRROR_RICHER: refusing to replace richer mirrored tables: ${differences}. ` +
360
- `Restore/import the mirror first, or repeat with --force-overwrite-richer after ` +
361
- `preserving a backup.`);
362
- }
348
+ assertNotPoorerThanMirror(TABLE_CONFIGS.map(({ tableName }) => tableName), existing.stats.tableCounts, manifest.stats.tableCounts, options.richnessPolicy);
363
349
  }
364
350
  }
365
351
  // Promote tmp → final. The store itself goes last: until it lands, the
@@ -0,0 +1,75 @@
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 type Database from 'better-sqlite3';
22
+ export type RichnessPolicy = 'strict' | 'checkpoint';
23
+ export declare const RICHNESS_POLICIES: readonly RichnessPolicy[];
24
+ /** Smallest loss the checkpoint policy refuses, so retention can trim a small table. */
25
+ export declare const CHECKPOINT_MIN_LOST_ROWS = 10;
26
+ /** A table emptied from at least this many rows is refused even under the minimum loss. */
27
+ export declare const CHECKPOINT_MIN_EMPTIED_ROWS = 3;
28
+ /**
29
+ * Largest share of a table the checkpoint policy lets go. Learned patterns
30
+ * are deduplicated at most 10% at a time (SQLitePatternStore), and captured
31
+ * experiences are never deleted (v3.9.22), so they get the 10% bound.
32
+ */
33
+ export declare const CHECKPOINT_MAX_LOSS: Readonly<Record<string, number>>;
34
+ /** Code-intelligence vectors are a regenerable cache, never exported (#1238). */
35
+ export declare const CODE_INDEX_VECTOR_ID_PREFIX = "code-intelligence:";
36
+ export type RvfMirrorGuardCode = 'RVF_MIRROR_RICHER' | 'RVF_MIRROR_INSPECTION_AMBIGUOUS';
37
+ /** Refusal to replace an existing mirror. The message starts with the code. */
38
+ export declare class RvfMirrorGuardError extends Error {
39
+ readonly code: RvfMirrorGuardCode;
40
+ constructor(code: RvfMirrorGuardCode, detail: string);
41
+ }
42
+ export declare function isRichnessPolicy(value: unknown): value is RichnessPolicy;
43
+ /**
44
+ * Throw when replacing a mirror with `existingCounts` by a candidate with
45
+ * `candidateCounts` would lose rows under `policy`. `existingCounts` is
46
+ * undefined when the mirror has no table inventory at all: that is ambiguous
47
+ * under every policy.
48
+ */
49
+ export declare function assertNotPoorerThanMirror(tableNames: readonly string[], existingCounts: Readonly<Record<string, number>> | undefined, candidateCounts: Readonly<Record<string, number>>, policy?: RichnessPolicy): void;
50
+ /** Row counts of every mirrored table, counted the way the RVF export counts them. */
51
+ export declare function mirroredTableCounts(db: Database.Database): Record<string, number>;
52
+ export type ShrinkProducer = 'prune' | 'dream';
53
+ /** What a deliberate shrink records for the checkpoint hook. */
54
+ export interface CheckpointShrinkAck {
55
+ readonly at: string;
56
+ readonly producer: ShrinkProducer;
57
+ /** mirroredTableCounts() right after the shrink. */
58
+ readonly tableCounts: Readonly<Record<string, number>>;
59
+ }
60
+ /** An acknowledgement is honoured for this long after the shrink. */
61
+ export declare const SHRINK_ACK_MAX_AGE_MS: number;
62
+ export type ShrinkAckVerdict = {
63
+ readonly honoured: true;
64
+ readonly producer: ShrinkProducer;
65
+ } | {
66
+ readonly honoured: false;
67
+ readonly reason: string;
68
+ };
69
+ /**
70
+ * Whether the acknowledgement `raw` (parsed JSON, or anything else) still
71
+ * vouches for an export with `candidateCounts`: under 24h old, and no table
72
+ * collapsed since the shrink, under the checkpoint policy. Growth is fine.
73
+ */
74
+ export declare function evaluateShrinkAck(raw: unknown, tableNames: readonly string[], candidateCounts: Readonly<Record<string, number>>, now?: number): ShrinkAckVerdict;
75
+ //# sourceMappingURL=brain-rvf-richness.d.ts.map