agentic-qe 3.15.16 → 3.15.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (539) 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 +201 -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-45NWEKVS.js → agent-booster-wasm-UFNJNF3M.js} +2 -2
  32. package/dist/cli/chunks/{agent-handler-LVHMYFEF.js → agent-handler-EAYVRJXN.js} +2 -2
  33. package/dist/cli/chunks/{agent-memory-branch-YDWOJFEQ.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-ELDZH3CZ.js → arena-2GDICP6R.js} +4 -4
  36. package/dist/cli/chunks/{arena-CZKHXDDS.js → arena-CG3X67OE.js} +2 -2
  37. package/dist/cli/chunks/{audit-5MT4T47Z.js → audit-F4FSPJPL.js} +3 -3
  38. package/dist/cli/chunks/base-J2FXOE77.js +2 -0
  39. package/dist/cli/chunks/{better-sqlite3-6TGYPC2B.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-WVILM4SO.js → branch-enumerator-KL7C535H.js} +2 -2
  42. package/dist/cli/chunks/{browser-RX5ALU3H.js → browser-SJEXDVHS.js} +2 -2
  43. package/dist/cli/chunks/browser-workflow-LXGER6ZD.js +2 -0
  44. package/dist/cli/chunks/{chunk-2H4XH6FT.js → chunk-244RKAEP.js} +2 -2
  45. package/dist/cli/chunks/{chunk-SI6DPU5D.js → chunk-27TUMXPD.js} +1 -1
  46. package/dist/cli/chunks/{chunk-YNMJEDN5.js → chunk-2MBYDPCP.js} +2 -2
  47. package/dist/cli/chunks/{chunk-24QHCVX6.js → chunk-2Q6DTBMT.js} +1 -1
  48. package/dist/cli/chunks/{chunk-XWUWX7BV.js → chunk-355MI7RV.js} +13 -13
  49. package/dist/cli/chunks/{chunk-NQXXI77K.js → chunk-3LX5OKBD.js} +2 -2
  50. package/dist/cli/chunks/{chunk-63GMRQ25.js → chunk-3RPDKJGV.js} +1 -1
  51. package/dist/cli/chunks/chunk-3YMIT73A.js +4 -0
  52. package/dist/cli/chunks/{chunk-P3EYRILV.js → chunk-43KUVBSU.js} +2 -2
  53. package/dist/cli/chunks/chunk-477FKXSS.js +2 -0
  54. package/dist/cli/chunks/{chunk-HGWXF45W.js → chunk-4BIMTRRX.js} +1 -1
  55. package/dist/cli/chunks/{chunk-SSUAAX3F.js → chunk-4CVNVBX5.js} +2 -2
  56. package/dist/cli/chunks/{chunk-5V3TI2LG.js → chunk-4HL3SD4A.js} +1 -1
  57. package/dist/cli/chunks/{chunk-KKU2QGSJ.js → chunk-4PEG4DU2.js} +2 -2
  58. package/dist/cli/chunks/{chunk-J4ELZNLY.js → chunk-4QSQKFED.js} +2 -2
  59. package/dist/cli/chunks/chunk-53ZBETYR.js +16 -0
  60. package/dist/cli/chunks/{chunk-7TE5ONQQ.js → chunk-544KDWL4.js} +1 -1
  61. package/dist/cli/chunks/chunk-54RCGMLB.js +8 -0
  62. package/dist/cli/chunks/{chunk-KU2AUFGX.js → chunk-5AGXIZQ5.js} +2 -2
  63. package/dist/cli/chunks/{chunk-LQLPB2T6.js → chunk-5M24X6W7.js} +2 -2
  64. package/dist/cli/chunks/{chunk-YU2BDRSD.js → chunk-5O5T4LEU.js} +1 -1
  65. package/dist/cli/chunks/{chunk-NAEWCFQT.js → chunk-5RFXX4IF.js} +2 -2
  66. package/dist/cli/chunks/{chunk-MD43XRX5.js → chunk-62MLAQRJ.js} +1 -1
  67. package/dist/cli/chunks/{chunk-PEQDY4BO.js → chunk-6D6TGL2E.js} +2 -2
  68. package/dist/cli/chunks/{chunk-IOYG4VFL.js → chunk-6IHZDSDL.js} +2 -2
  69. package/dist/cli/chunks/{chunk-C5FP5GW3.js → chunk-6P3Y45QL.js} +2 -2
  70. package/dist/cli/chunks/{chunk-4LQFBY5L.js → chunk-6TEVM3X3.js} +10 -10
  71. package/dist/cli/chunks/{chunk-YPBSUGMI.js → chunk-7XTUKKRA.js} +1 -1
  72. package/dist/cli/chunks/chunk-A3GDX6UF.js +2 -0
  73. package/dist/cli/chunks/{chunk-HLUXXCHF.js → chunk-A5YTKKNA.js} +1 -1
  74. package/dist/cli/chunks/{chunk-Y4PFUMOU.js → chunk-ADNGZAT2.js} +1 -1
  75. package/dist/cli/chunks/{chunk-KNSRL6NO.js → chunk-AWQAE3SW.js} +2 -2
  76. package/dist/cli/chunks/{chunk-BY5OF7OH.js → chunk-AXDBQFR4.js} +2 -2
  77. package/dist/cli/chunks/{chunk-525CFDUE.js → chunk-AXVD7O3F.js} +2 -2
  78. package/dist/cli/chunks/{chunk-JHQCRRJI.js → chunk-B52ULNYO.js} +2 -2
  79. package/dist/cli/chunks/chunk-B6S4FC7M.js +3 -0
  80. package/dist/cli/chunks/{chunk-AJMJNQMP.js → chunk-BDVFSMOQ.js} +1 -1
  81. package/dist/cli/chunks/{chunk-DXD6K2ZP.js → chunk-BGXXMX3Y.js} +2 -2
  82. package/dist/cli/chunks/{chunk-EK7OLYOZ.js → chunk-BKMQQY5T.js} +2 -2
  83. package/dist/cli/chunks/{chunk-VWPM27GU.js → chunk-BN2FROBQ.js} +2 -2
  84. package/dist/cli/chunks/{chunk-J7I6PABJ.js → chunk-BO6EQNOC.js} +2 -2
  85. package/dist/cli/chunks/{chunk-4D4DENG6.js → chunk-BOVAKCDC.js} +2 -2
  86. package/dist/cli/chunks/{chunk-ZFL436FN.js → chunk-BSXKZDKO.js} +2 -2
  87. package/dist/cli/chunks/{chunk-J442IZLE.js → chunk-C5QVJ5XQ.js} +1 -1
  88. package/dist/cli/chunks/{chunk-ZB3LEFYG.js → chunk-CFQLLF3D.js} +2 -2
  89. package/dist/cli/chunks/{chunk-UHEOGZLX.js → chunk-DUCVLT3F.js} +7 -7
  90. package/dist/cli/chunks/{chunk-TVGI32MB.js → chunk-E4RMJCGA.js} +3 -3
  91. package/dist/cli/chunks/{chunk-TIUKLYAI.js → chunk-EONDCWY4.js} +1 -1
  92. package/dist/cli/chunks/{chunk-ZJH5MU2I.js → chunk-F4AGNKL2.js} +2 -2
  93. package/dist/cli/chunks/{chunk-N7HL5PHH.js → chunk-F6YD3BOW.js} +1 -1
  94. package/dist/cli/chunks/{chunk-5VZL4UVN.js → chunk-FQRS7WVA.js} +2 -2
  95. package/dist/cli/chunks/{chunk-SHKOCGNK.js → chunk-FT24SSDG.js} +2 -2
  96. package/dist/cli/chunks/chunk-FV4YNSAJ.js +5 -0
  97. package/dist/cli/chunks/{chunk-KXCLACFG.js → chunk-FVDM3X42.js} +2 -2
  98. package/dist/cli/chunks/{chunk-32BPDLRZ.js → chunk-FVH7TXWU.js} +2 -2
  99. package/dist/cli/chunks/{chunk-72XSEQMW.js → chunk-FWR5QY37.js} +2 -2
  100. package/dist/cli/chunks/chunk-FYINK2B7.js +6 -0
  101. package/dist/cli/chunks/{chunk-5JZRZI4S.js → chunk-GGISVPOZ.js} +2 -2
  102. package/dist/cli/chunks/{chunk-5LAVKGLH.js → chunk-GPIJIZJQ.js} +2 -2
  103. package/dist/cli/chunks/{chunk-5QO3R3TU.js → chunk-GXEVOT5F.js} +2 -2
  104. package/dist/cli/chunks/{chunk-IHRXZZQM.js → chunk-GZ4VB5RI.js} +1 -1
  105. package/dist/cli/chunks/chunk-HBDSCYSK.js +2 -0
  106. package/dist/cli/chunks/{chunk-GSKMOPL7.js → chunk-HGG4HR7C.js} +2 -2
  107. package/dist/cli/chunks/{chunk-AR67RJPY.js → chunk-HSCKWWO2.js} +2 -2
  108. package/dist/cli/chunks/{chunk-6XXZDV2C.js → chunk-HSQ3GUYJ.js} +2 -2
  109. package/dist/cli/chunks/{chunk-AAMLQ2LF.js → chunk-HZQBW5EM.js} +3 -3
  110. package/dist/cli/chunks/{chunk-O5W3FIO6.js → chunk-IGIYANVT.js} +2 -2
  111. package/dist/cli/chunks/{chunk-C6D5AHBO.js → chunk-IPWMSXBF.js} +2 -2
  112. package/dist/cli/chunks/{chunk-NDJ7P2EP.js → chunk-IWVNC7VY.js} +1 -1
  113. package/dist/cli/chunks/{chunk-FDDC72IA.js → chunk-IZODXKZD.js} +2 -2
  114. package/dist/cli/chunks/{chunk-NO3IV5Q5.js → chunk-J2MT2OJV.js} +1 -1
  115. package/dist/cli/chunks/{chunk-GQ6TUIKY.js → chunk-JKIJVVSP.js} +1 -1
  116. package/dist/cli/chunks/{chunk-LE4QJREF.js → chunk-JMRDT2XK.js} +1 -1
  117. package/dist/cli/chunks/{chunk-2YZ4G6NW.js → chunk-JR2UMTKG.js} +1 -1
  118. package/dist/cli/chunks/{chunk-RJIEG3NA.js → chunk-K6CH4CFF.js} +2 -2
  119. package/dist/cli/chunks/{chunk-5NNNEWLS.js → chunk-K7KW5QB5.js} +81 -88
  120. package/dist/cli/chunks/chunk-KFCQP434.js +2 -0
  121. package/dist/cli/chunks/{chunk-A5GBXCP5.js → chunk-KH4T6STG.js} +2 -2
  122. package/dist/cli/chunks/{chunk-VMDFFTCK.js → chunk-KJBYZO57.js} +1 -1
  123. package/dist/cli/chunks/{chunk-GJYHWYXR.js → chunk-KP4OKOKV.js} +2 -2
  124. package/dist/cli/chunks/chunk-L2MBKVSE.js +2 -0
  125. package/dist/cli/chunks/{chunk-XIQW7EFL.js → chunk-L3IPUIT3.js} +2 -2
  126. package/dist/cli/chunks/{chunk-W5HQUIML.js → chunk-L7PSU2YN.js} +2 -2
  127. package/dist/cli/chunks/{chunk-6DPYNAOK.js → chunk-LA3JPGQA.js} +2 -2
  128. package/dist/cli/chunks/{chunk-5PBLPQ5T.js → chunk-LC2QRN7V.js} +14 -13
  129. package/dist/cli/chunks/{chunk-SSYAQZXA.js → chunk-LHY7TMTM.js} +2 -2
  130. package/dist/cli/chunks/{chunk-QQWBWEJS.js → chunk-LLQ2UMF6.js} +3 -3
  131. package/dist/cli/chunks/{chunk-DTMAS2GB.js → chunk-LOJ7OO6W.js} +2 -2
  132. package/dist/cli/chunks/{chunk-32GN3JKR.js → chunk-LPUSH3VF.js} +1 -1
  133. package/dist/cli/chunks/{chunk-SDLWKRVL.js → chunk-LSEC2BU7.js} +2 -2
  134. package/dist/cli/chunks/{chunk-IOKYCMTJ.js → chunk-LTGB7OIU.js} +2 -2
  135. package/dist/cli/chunks/{chunk-6ZBXSOX6.js → chunk-LUG7YNVZ.js} +2 -2
  136. package/dist/cli/chunks/{chunk-CAKMOVZ6.js → chunk-LWAFRYKE.js} +2 -2
  137. package/dist/cli/chunks/{chunk-FLNAW7C4.js → chunk-M24ZAZ4U.js} +2 -2
  138. package/dist/cli/chunks/{chunk-L2DWPVNJ.js → chunk-MKRKRXTX.js} +1 -1
  139. package/dist/cli/chunks/{chunk-YTHTQPWR.js → chunk-MNNLONAD.js} +1 -1
  140. package/dist/cli/chunks/{chunk-V5NHZV7S.js → chunk-MQM37KAR.js} +2 -2
  141. package/dist/cli/chunks/{chunk-PPUZWYUG.js → chunk-MSX2OHYT.js} +2 -2
  142. package/dist/cli/chunks/{chunk-YRAX7SFJ.js → chunk-MVYQRVLP.js} +2 -2
  143. package/dist/cli/chunks/{chunk-QVDCVD5D.js → chunk-MZC5WM2P.js} +2 -2
  144. package/dist/cli/chunks/{chunk-S75SOOZL.js → chunk-MZRBNBB3.js} +2 -2
  145. package/dist/cli/chunks/{chunk-FL64OUBA.js → chunk-N3KQU4UC.js} +2 -2
  146. package/dist/cli/chunks/{chunk-G5RHFBAY.js → chunk-NKU3FFM4.js} +2 -2
  147. package/dist/cli/chunks/chunk-O5EWFR76.js +2 -0
  148. package/dist/cli/chunks/{chunk-63ZKI4PX.js → chunk-O5RDHD5T.js} +2 -2
  149. package/dist/cli/chunks/chunk-O6UWIXME.js +3 -0
  150. package/dist/cli/chunks/{chunk-HCH4Y6XX.js → chunk-OA4EQDC4.js} +2 -2
  151. package/dist/cli/chunks/{chunk-QPEOLAAS.js → chunk-OBCXCRXK.js} +1 -1
  152. package/dist/cli/chunks/{chunk-6ICX3FEG.js → chunk-OHU5P25N.js} +22 -22
  153. package/dist/cli/chunks/{chunk-GFWHUQSF.js → chunk-OOSV2RIA.js} +2 -2
  154. package/dist/cli/chunks/{chunk-MO55CVMT.js → chunk-OW23N2Y5.js} +14 -14
  155. package/dist/cli/chunks/{chunk-M7WJCTG3.js → chunk-OXOO3YDL.js} +2 -2
  156. package/dist/cli/chunks/{chunk-KQYJ4VQ5.js → chunk-OYGKSSSI.js} +1 -1
  157. package/dist/cli/chunks/chunk-PGO46IIW.js +2 -0
  158. package/dist/cli/chunks/{chunk-NVEWF4JV.js → chunk-PZOYQHWS.js} +1 -1
  159. package/dist/cli/chunks/{chunk-IESR7TNB.js → chunk-Q2BZSG7Z.js} +2 -2
  160. package/dist/cli/chunks/{chunk-XIIQ5QTT.js → chunk-Q7V722K5.js} +2 -2
  161. package/dist/cli/chunks/{chunk-F742SZAX.js → chunk-QZU6M5IO.js} +2 -2
  162. package/dist/cli/chunks/{chunk-PINSJCM3.js → chunk-R55Y76SJ.js} +1 -1
  163. package/dist/cli/chunks/{chunk-5B5QPCNU.js → chunk-RMEQYJPU.js} +4 -4
  164. package/dist/cli/chunks/{chunk-ZQ2XW3IP.js → chunk-RTYXFXTI.js} +2 -2
  165. package/dist/cli/chunks/{chunk-DVYHMDFR.js → chunk-SJF3O4FX.js} +374 -371
  166. package/dist/cli/chunks/{chunk-AG2EWGXS.js → chunk-SOUS7Z2H.js} +2 -2
  167. package/dist/cli/chunks/{chunk-3HD7E6HN.js → chunk-SRVNR3R3.js} +2 -2
  168. package/dist/cli/chunks/{chunk-KITOPKRG.js → chunk-SU3SXMVG.js} +2 -2
  169. package/dist/cli/chunks/chunk-SWGPLXWW.js +32 -0
  170. package/dist/cli/chunks/{chunk-ZR2TKVXQ.js → chunk-TRB3EVH3.js} +2 -2
  171. package/dist/cli/chunks/{chunk-OCV2XEWQ.js → chunk-TVBDUMKT.js} +2 -2
  172. package/dist/cli/chunks/{chunk-IOQ6ZQ5W.js → chunk-TWTXPSFU.js} +1 -1
  173. package/dist/cli/chunks/{chunk-CJSHWQXP.js → chunk-ULYUVUL2.js} +2 -2
  174. package/dist/cli/chunks/{chunk-PHT5N7SC.js → chunk-UNTBVJ5X.js} +2 -2
  175. package/dist/cli/chunks/{chunk-LKTTUHLF.js → chunk-UQAA4PHU.js} +2 -2
  176. package/dist/cli/chunks/{chunk-SR52XP5F.js → chunk-UWSJVKTE.js} +1 -1
  177. package/dist/cli/chunks/{chunk-L6QSTQME.js → chunk-V2LJ54KP.js} +2 -2
  178. package/dist/cli/chunks/{chunk-FBDVGRSC.js → chunk-VCCTTKP3.js} +7 -7
  179. package/dist/cli/chunks/{chunk-YLMNVLDK.js → chunk-VEGUYUVS.js} +1 -1
  180. package/dist/cli/chunks/{chunk-ASEOFRIG.js → chunk-VUQPVWNK.js} +2 -2
  181. package/dist/cli/chunks/{chunk-VXFLJNCA.js → chunk-VVGUE2T2.js} +2 -2
  182. package/dist/cli/chunks/{chunk-4NFQLP6R.js → chunk-W5ASDHJQ.js} +1 -1
  183. package/dist/cli/chunks/{chunk-I7MQIM2U.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-SASBO5Y5.js → chunk-WQNLXUWA.js} +6 -6
  187. package/dist/cli/chunks/{chunk-5SPCGMBB.js → chunk-WZVRMKG2.js} +2 -2
  188. package/dist/cli/chunks/{chunk-MI5MFHRA.js → chunk-X27IUWTD.js} +2 -2
  189. package/dist/cli/chunks/{chunk-HJ6ZGVTB.js → chunk-X4B345B6.js} +2 -2
  190. package/dist/cli/chunks/{chunk-HVRRLYX6.js → chunk-X5I2Y4VO.js} +2 -2
  191. package/dist/cli/chunks/{chunk-SUDMM5SO.js → chunk-X7IQIFTS.js} +2 -2
  192. package/dist/cli/chunks/chunk-XJN3RKUD.js +3 -0
  193. package/dist/cli/chunks/{chunk-E3D4GPLP.js → chunk-XQMGXTHJ.js} +3 -3
  194. package/dist/cli/chunks/{chunk-67Z5R7RJ.js → chunk-XTSAMB2Q.js} +2 -2
  195. package/dist/cli/chunks/{chunk-KVF4NXGQ.js → chunk-XZLIF4O2.js} +2 -2
  196. package/dist/cli/chunks/{chunk-EA4YQVKS.js → chunk-Y4LSEOZ3.js} +1 -1
  197. package/dist/cli/chunks/{chunk-OAEE6JWQ.js → chunk-Y4YN2RXR.js} +2 -2
  198. package/dist/cli/chunks/{chunk-CEYSYSK5.js → chunk-YDI56L35.js} +2 -2
  199. package/dist/cli/chunks/{chunk-JDIYMZCQ.js → chunk-YFILS5D5.js} +2 -2
  200. package/dist/cli/chunks/{chunk-GAHNO6JJ.js → chunk-YISDX6WB.js} +2 -2
  201. package/dist/cli/chunks/{chunk-AGRV5B3T.js → chunk-YP2GHQSV.js} +2 -2
  202. package/dist/cli/chunks/{chunk-UNGBRZDK.js → chunk-YSX756AM.js} +4 -4
  203. package/dist/cli/chunks/{chunk-BEKDKVQT.js → chunk-YWANOASW.js} +2 -2
  204. package/dist/cli/chunks/{chunk-JQ3DYUMS.js → chunk-YYIJLG7S.js} +2 -2
  205. package/dist/cli/chunks/{chunk-CRPIYUTJ.js → chunk-Z7SD7LXM.js} +2 -2
  206. package/dist/cli/chunks/{chunk-U2A7NHZA.js → chunk-ZDWD73UF.js} +2 -2
  207. package/dist/cli/chunks/{chunk-WP4RETKG.js → chunk-ZFT3RLA4.js} +2 -2
  208. package/dist/cli/chunks/{chunk-VJCIEHEF.js → chunk-ZNTHX5G3.js} +1 -1
  209. package/dist/cli/chunks/{chunk-PF7RBAYL.js → chunk-ZS27R7VL.js} +2 -2
  210. package/dist/cli/chunks/{chunk-24OX5TQJ.js → chunk-ZXHHHR7K.js} +1 -1
  211. package/dist/cli/chunks/{ci-MFUR4CWV.js → ci-N5MOMNXH.js} +2 -2
  212. package/dist/cli/chunks/{ci-config-PNDLQ6XV.js → ci-config-6L2ROQCW.js} +2 -2
  213. package/dist/cli/chunks/{ci-output-PFZ4M7NC.js → ci-output-DSRBYEIK.js} +2 -2
  214. package/dist/cli/chunks/{circuit-breaker-5HH6NLZN.js → circuit-breaker-VRPTNBL7.js} +2 -2
  215. package/dist/cli/chunks/{claude-flow-setup-QCKYLGLC.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-EASVPFXR.js → cline-installer-7RGYJWGN.js} +2 -2
  218. package/dist/cli/chunks/{code-UJXDVYRK.js → code-ISC6NW2K.js} +3 -3
  219. package/dist/cli/chunks/{code-index-extractor-BZJ3UDP4.js → code-index-extractor-2FID75YV.js} +2 -2
  220. package/dist/cli/chunks/{codex-installer-XSQZUVOZ.js → codex-installer-DZ7OG6KM.js} +2 -2
  221. package/dist/cli/chunks/{completions-OWOOJFI2.js → completions-SM3LICWK.js} +2 -2
  222. package/dist/cli/chunks/{complexity-analyzer-KP5TOHDT.js → complexity-analyzer-ZWD2CTAD.js} +2 -2
  223. package/dist/cli/chunks/{continuedev-installer-IFKQXLHM.js → continuedev-installer-AGASOA26.js} +2 -2
  224. package/dist/cli/chunks/copilot-installer-CLPZYTQC.js +3 -0
  225. package/dist/cli/chunks/core-handlers-5EFOJ37H.js +2 -0
  226. package/dist/cli/chunks/{cost-tracker-MMDDNKZB.js → cost-tracker-7PIGQYDV.js} +2 -2
  227. package/dist/cli/chunks/{coverage-LUH2B7NT.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-4YLM5GWM.js → cursor-installer-KXBID4MB.js} +2 -2
  230. package/dist/cli/chunks/daemon-43MXIVH3.js +18 -0
  231. package/dist/cli/chunks/{daemon-MZKVM4CJ.js → daemon-VAMJLQJ5.js} +3 -3
  232. package/dist/cli/chunks/{dag-attention-scheduler-X4CYW665.js → dag-attention-scheduler-UBP4VHTA.js} +2 -2
  233. package/dist/cli/chunks/{detect-7BM2XINO.js → detect-QWFIQRKI.js} +2 -2
  234. package/dist/cli/chunks/{dist-node-Y5APLEYB.js → dist-node-I2GICS3W.js} +2 -2
  235. package/dist/cli/chunks/{domain-handler-X3ZRJNAH.js → domain-handler-Z66ISB2A.js} +2 -2
  236. package/dist/cli/chunks/{domain-plugins-2UW5KQJB.js → domain-plugins-KHMD3FKT.js} +2 -2
  237. package/dist/cli/chunks/{domain-transfer-35W4CIBV.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-SBM2MZD2.js → embedding-space-KHG6TITM.js} +2 -2
  241. package/dist/cli/chunks/{eval-4QA2SROK.js → eval-43OHU7EI.js} +2 -2
  242. package/dist/cli/chunks/{experience-capture-middleware-Z6BF6KYM.js → experience-capture-middleware-KXD47H6P.js} +3 -3
  243. package/dist/cli/chunks/{fast-paths-FIORX6GN.js → fast-paths-6D75D5KD.js} +2 -2
  244. package/dist/cli/chunks/{feature-flags-6LYI2T4G.js → feature-flags-IE35Y55N.js} +2 -2
  245. package/dist/cli/chunks/{feature-flags-ZOO7LMIC.js → feature-flags-OYYHY7LS.js} +2 -2
  246. package/dist/cli/chunks/file-discovery-LGBTY3ID.js +2 -0
  247. package/dist/cli/chunks/{fleet-7WF53H4F.js → fleet-AGVJMFGD.js} +16 -16
  248. package/dist/cli/chunks/{gnn-wrapper-KJ6B7BRM.js → gnn-wrapper-5L66A7LW.js} +2 -2
  249. package/dist/cli/chunks/{heartbeat-handler-DEKKMOVW.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-L27WS27N.js → hnsw-legacy-bridge-RYMWFNAH.js} +2 -2
  254. package/dist/cli/chunks/{hnswlib-node-4YOQC6L4.js → hnswlib-node-GG47HP2P.js} +2 -2
  255. package/dist/cli/chunks/{hooks-TAOKV4EJ.js → hooks-FQNACS24.js} +10 -10
  256. package/dist/cli/chunks/hybrid-backend-AS2PNHOD.js +2 -0
  257. package/dist/cli/chunks/{hypergraph-engine-BODRJLHL.js → hypergraph-engine-6BYNJQEP.js} +2 -2
  258. package/dist/cli/chunks/{hypergraph-handler-RKMYJNTU.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-MXHSLSB2.js → init-guard-METTAV5O.js} +2 -2
  261. package/dist/cli/chunks/{init-handler-HUE57IFW.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-S333IKYQ.js → kilocode-installer-GZV2D3FF.js} +2 -2
  265. package/dist/cli/chunks/{kiro-installer-WM5DLQWC.js → kiro-installer-Q4ZXUFC7.js} +2 -2
  266. package/dist/cli/chunks/knowledge-graph-CNL77CSZ.js +2 -0
  267. package/dist/cli/chunks/{learning-LNHMQLH5.js → learning-WA2QEYL7.js} +35 -34
  268. package/dist/cli/chunks/{llm-router-EWFXYZZR.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-FGYGWVDK.js → load-WXN3Q7Y5.js} +2 -2
  271. package/dist/cli/chunks/load-test-PXLW4A5B.js +2 -0
  272. package/dist/cli/chunks/{mcp-2FHNAAOM.js → mcp-LIQCPSJN.js} +2 -2
  273. package/dist/cli/chunks/{memory-DZMQ73AB.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-6F2UAEUW.js → multi-model-executor-H54DEVRZ.js} +2 -2
  277. package/dist/cli/chunks/{opencode-installer-XY3BGOTZ.js → opencode-installer-BSQV6UAT.js} +2 -2
  278. package/dist/cli/chunks/{orchestrator-B4CNKUOS.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-R4GUFNMD.js → pattern-usage-recorder-FOVS4M5L.js} +2 -2
  281. package/dist/cli/chunks/{pipeline-FG5RKVRO.js → pipeline-4AY2ZIC6.js} +2 -2
  282. package/dist/cli/chunks/{platform-3BT4KEVJ.js → platform-FCSITYMR.js} +2 -2
  283. package/dist/cli/chunks/{plugin-WI4RIN7O.js → plugin-E56TV5S2.js} +2 -2
  284. package/dist/cli/chunks/{prime-radiant-advanced-wasm-7ECDNQFS.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-WNODKPGW.js → protocol-handler-KRVXF4LS.js} +2 -2
  288. package/dist/cli/chunks/{prove-5RHAEPYZ.js → prove-KMFPSKGD.js} +2 -2
  289. package/dist/cli/chunks/qe-reasoning-bank-UEGQ3O7F.js +2 -0
  290. package/dist/cli/chunks/{quality-WPHR7BGQ.js → quality-6DBI3HLB.js} +2 -2
  291. package/dist/cli/chunks/{quality-gate-4RKTEZMX.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-TPAWHOHH.js → ref-validation-EYIP7DHW.js} +2 -2
  295. package/dist/cli/chunks/{roocode-installer-7AVHFNDI.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-YKEDVJSH.js → routing-handler-BWNHBYDC.js} +2 -2
  299. package/dist/cli/chunks/{ruvector-commands-JUAMM354.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-VJDUIRTX.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-ORDN3RD2.js → security-DCRGOTWU.js} +3 -3
  309. package/dist/cli/chunks/{shared-rvf-adapter-CF4BCIO7.js → shared-rvf-adapter-GKD74QUB.js} +2 -2
  310. package/dist/cli/chunks/{shared-rvf-dual-writer-C32UBR6D.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-OXRJYZXN.js → standalone-memory-O7O2U5N4.js} +2 -2
  313. package/dist/cli/chunks/{status-handler-BCX5D4HY.js → status-handler-BQTPJJTL.js} +2 -2
  314. package/dist/cli/chunks/{structural-health-LFG7RUU6.js → structural-health-4H6J4OHK.js} +2 -2
  315. package/dist/cli/chunks/sync-DJ4TF6QX.js +2 -0
  316. package/dist/cli/chunks/{sync-YJEE2K2L.js → sync-WW5TAVYW.js} +2 -2
  317. package/dist/cli/chunks/{task-handler-6LXKPTXJ.js → task-handler-HEM4IEOW.js} +2 -2
  318. package/dist/cli/chunks/{task-handlers-CILP36I7.js → task-handlers-JRA3NXIR.js} +3 -3
  319. package/dist/cli/chunks/test-772ZXVG2.js +34 -0
  320. package/dist/cli/chunks/test-runner-process-XGF2U3NG.js +2 -0
  321. package/dist/cli/chunks/{test-scheduling-ISI2O4Q5.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-XOC5KG7S.js → token-usage-B7PEKE2G.js} +2 -2
  324. package/dist/cli/chunks/{transformers-LSLQAARK.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-5BLCGLCR.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-RQJYLK3J.js → upgrade-DZ4DLUQ5.js} +2 -2
  331. package/dist/cli/chunks/{validate-QBHWXXCK.js → validate-4DTLIDJE.js} +2 -2
  332. package/dist/cli/chunks/{validate-swarm-IKXBKFB5.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-ZF6FIE5R.js → web-tree-sitter-F2C7QRYT.js} +2 -2
  335. package/dist/cli/chunks/{windsurf-installer-HQGDZT5D.js → windsurf-installer-OOBTDA6W.js} +2 -2
  336. package/dist/cli/chunks/{witness-chain-DCHCAMSQ.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-PX2OQ6XT.js → witness-chain-verifier-OB7ZZOI3.js} +2 -2
  340. package/dist/cli/chunks/{witness-key-manager-RXYQNFJB.js → witness-key-manager-YCKGKGQI.js} +2 -2
  341. package/dist/cli/chunks/{workflow-FBKCA4H6.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/commands/test.js +26 -4
  347. package/dist/cli/handlers/brain-handler.js +32 -2
  348. package/dist/cli/handlers/heartbeat-handler.js +3 -1
  349. package/dist/cli/utils/coverage-data.js +5 -1
  350. package/dist/cli/utils/coverage-verdict.d.ts +10 -2
  351. package/dist/cli/utils/coverage-verdict.js +23 -8
  352. package/dist/cli/utils/fleet-operation.js +9 -3
  353. package/dist/coordination/handlers/code-intelligence-handlers.js +17 -3
  354. package/dist/coordination/handlers/coverage-handlers.js +22 -9
  355. package/dist/coordination/handlers/coverage-target.d.ts +22 -2
  356. package/dist/coordination/handlers/coverage-target.js +45 -9
  357. package/dist/coordination/handlers/handler-utils.d.ts +19 -0
  358. package/dist/coordination/handlers/handler-utils.js +22 -8
  359. package/dist/coordination/handlers/test-execution-handlers.js +64 -20
  360. package/dist/coordination/protocols/code-intelligence-index.js +6 -3
  361. package/dist/coordination/protocols/learning-consolidation-archive.d.ts +6 -3
  362. package/dist/coordination/protocols/learning-consolidation-archive.js +4 -3
  363. package/dist/coordination/workflow-builtin.js +1 -0
  364. package/dist/domains/code-intelligence/services/semantic-analyzer.d.ts +8 -3
  365. package/dist/domains/code-intelligence/services/semantic-analyzer.js +39 -25
  366. package/dist/domains/code-intelligence/services/text-relevance.d.ts +32 -0
  367. package/dist/domains/code-intelligence/services/text-relevance.js +63 -0
  368. package/dist/domains/defect-intelligence/interfaces.d.ts +2 -0
  369. package/dist/domains/defect-intelligence/prediction-history.d.ts +15 -1
  370. package/dist/domains/defect-intelligence/prediction-history.js +63 -7
  371. package/dist/domains/defect-intelligence/services/defect-predictor.d.ts +1 -0
  372. package/dist/domains/defect-intelligence/services/defect-predictor.js +33 -13
  373. package/dist/domains/learning-optimization/coordinator.js +17 -10
  374. package/dist/domains/learning-optimization/domain-ranking.d.ts +26 -0
  375. package/dist/domains/learning-optimization/domain-ranking.js +28 -0
  376. package/dist/domains/learning-optimization/interfaces.d.ts +5 -0
  377. package/dist/domains/learning-optimization/pattern-archive.d.ts +55 -8
  378. package/dist/domains/learning-optimization/pattern-archive.js +90 -17
  379. package/dist/domains/learning-optimization/pattern-consolidation.js +18 -2
  380. package/dist/domains/learning-optimization/pattern-merge.d.ts +26 -0
  381. package/dist/domains/learning-optimization/pattern-merge.js +127 -0
  382. package/dist/domains/learning-optimization/services/learning-coordinator.js +21 -35
  383. package/dist/domains/test-execution/coordinator.d.ts +3 -1
  384. package/dist/domains/test-execution/coordinator.js +13 -4
  385. package/dist/domains/test-execution/interfaces.d.ts +5 -0
  386. package/dist/domains/test-execution/plugin.js +2 -0
  387. package/dist/domains/test-execution/services/flaky-detector.d.ts +9 -1
  388. package/dist/domains/test-execution/services/flaky-detector.js +26 -8
  389. package/dist/domains/test-execution/services/retry-handler.d.ts +7 -1
  390. package/dist/domains/test-execution/services/retry-handler.js +44 -5
  391. package/dist/domains/test-execution/services/runner-test-cases.d.ts +2 -0
  392. package/dist/domains/test-execution/services/runner-test-cases.js +7 -3
  393. package/dist/domains/test-execution/services/test-executor.d.ts +5 -1
  394. package/dist/domains/test-execution/services/test-executor.js +85 -17
  395. package/dist/init/copilot-installer.d.ts +6 -0
  396. package/dist/init/copilot-installer.js +37 -17
  397. package/dist/init/init-wizard-steps.js +3 -1
  398. package/dist/init/phases/07-hooks.js +97 -10
  399. package/dist/init/platform-config-generator.d.ts +10 -0
  400. package/dist/init/platform-config-generator.js +26 -1
  401. package/dist/integrations/embeddings/cache/EmbeddingCache.js +1 -1
  402. package/dist/integrations/ruvector/brain-rvf-exporter.d.ts +16 -1
  403. package/dist/integrations/ruvector/brain-rvf-exporter.js +18 -32
  404. package/dist/integrations/ruvector/brain-rvf-richness.d.ts +75 -0
  405. package/dist/integrations/ruvector/brain-rvf-richness.js +127 -0
  406. package/dist/kernel/unified-memory-migration.js +1 -1
  407. package/dist/kernel/unified-memory.d.ts +8 -0
  408. package/dist/kernel/unified-memory.js +13 -0
  409. package/dist/learning/checkpoint-shrink-ack.d.ts +25 -0
  410. package/dist/learning/checkpoint-shrink-ack.js +57 -0
  411. package/dist/learning/dream/dream-engine.d.ts +44 -3
  412. package/dist/learning/dream/dream-engine.js +6 -2
  413. package/dist/learning/embedder-endpoint-client.d.ts +45 -0
  414. package/dist/learning/embedder-endpoint-client.js +98 -3
  415. package/dist/learning/embedder-identity-store.js +3 -1
  416. package/dist/learning/embedding-space-legacy-adoption.d.ts +53 -0
  417. package/dist/learning/embedding-space-legacy-adoption.js +115 -0
  418. package/dist/learning/embedding-space-registry.d.ts +90 -0
  419. package/dist/learning/embedding-space-registry.js +181 -0
  420. package/dist/learning/experience-capture.d.ts +3 -1
  421. package/dist/learning/experience-capture.js +15 -5
  422. package/dist/learning/experience-space-verification.d.ts +2 -0
  423. package/dist/learning/experience-space-verification.js +3 -2
  424. package/dist/learning/learning-retention.js +4 -0
  425. package/dist/learning/pattern-promotion.d.ts +7 -0
  426. package/dist/learning/pattern-promotion.js +64 -12
  427. package/dist/learning/real-embeddings.d.ts +3 -0
  428. package/dist/learning/real-embeddings.js +73 -11
  429. package/dist/learning/rvf-pattern-store.js +6 -1
  430. package/dist/mcp/bundle.js +558 -537
  431. package/dist/mcp/handlers/domain-handler-configs.d.ts +3 -0
  432. package/dist/mcp/handlers/domain-handler-configs.js +1 -0
  433. package/dist/mcp/handlers/heartbeat-handlers.d.ts +4 -2
  434. package/dist/mcp/protocol-server.js +1 -1
  435. package/dist/mcp/tools/learning-optimization/optimize.d.ts +6 -1
  436. package/dist/mcp/tools/learning-optimization/optimize.js +20 -11
  437. package/dist/planning/goap-planner.js +4 -0
  438. package/dist/planning/plan-executor.js +6 -2
  439. package/dist/shared/embeddings/index.d.ts +2 -2
  440. package/dist/shared/embeddings/index.js +1 -1
  441. package/dist/shared/embeddings/nomic-embedder.d.ts +8 -2
  442. package/dist/shared/embeddings/nomic-embedder.js +19 -11
  443. package/dist/shared/embeddings/ollama-client.d.ts +28 -2
  444. package/dist/shared/embeddings/ollama-client.js +84 -22
  445. package/dist/shared/embeddings/types.d.ts +15 -0
  446. package/dist/shared/embeddings/types.js +4 -0
  447. package/dist/shared/git/git-analyzer.d.ts +30 -11
  448. package/dist/shared/git/git-analyzer.js +95 -48
  449. package/dist/shared/io/confined-read.d.ts +32 -7
  450. package/dist/shared/io/confined-read.js +58 -25
  451. package/dist/shared/io/file-reader.js +4 -1
  452. package/dist/shared/pytest-junit-report.d.ts +93 -0
  453. package/dist/shared/pytest-junit-report.js +241 -0
  454. package/dist/shared/safe-db.d.ts +1 -1
  455. package/dist/shared/safe-db.js +20 -5
  456. package/dist/shared/sqlite-journal-mode.d.ts +39 -0
  457. package/dist/shared/sqlite-journal-mode.js +53 -0
  458. package/dist/shared/test-runner-project.d.ts +51 -1
  459. package/dist/shared/test-runner-project.js +140 -25
  460. package/dist/sync/claude-flow-bridge.js +1 -1
  461. package/dist/sync/readers/sqlite-reader.js +3 -4
  462. package/dist/sync/writers/sqlite-writer.js +1 -1
  463. package/dist/workers/interfaces.d.ts +2 -2
  464. package/dist/workers/quality-daemon/git-watcher.d.ts +8 -0
  465. package/dist/workers/quality-daemon/git-watcher.js +54 -12
  466. package/dist/workers/quality-daemon/index.js +1 -1
  467. package/dist/workers/quality-daemon/priority-queue.d.ts +2 -1
  468. package/dist/workers/workers/defect-predictor.d.ts +9 -4
  469. package/dist/workers/workers/defect-predictor.js +98 -37
  470. package/package.json +1 -1
  471. package/dist/cli/chunks/adapter-6CQ2PIP5.js +0 -2
  472. package/dist/cli/chunks/aqe-learning-engine-73RR52VS.js +0 -2
  473. package/dist/cli/chunks/base-SMCMMVGP.js +0 -2
  474. package/dist/cli/chunks/brain-handler-HQWZFO52.js +0 -95
  475. package/dist/cli/chunks/browser-workflow-A2MEZ66K.js +0 -2
  476. package/dist/cli/chunks/chunk-CGGUM2YJ.js +0 -3
  477. package/dist/cli/chunks/chunk-D6COXLYE.js +0 -8
  478. package/dist/cli/chunks/chunk-EGYE5UPQ.js +0 -2
  479. package/dist/cli/chunks/chunk-IUBJVHNB.js +0 -3
  480. package/dist/cli/chunks/chunk-KL7OKSU2.js +0 -4
  481. package/dist/cli/chunks/chunk-KPRCB5LT.js +0 -7
  482. package/dist/cli/chunks/chunk-LRSX2FJM.js +0 -2
  483. package/dist/cli/chunks/chunk-M4FRQ4TE.js +0 -12
  484. package/dist/cli/chunks/chunk-MAFQV4U4.js +0 -16
  485. package/dist/cli/chunks/chunk-NZU4ACBZ.js +0 -2
  486. package/dist/cli/chunks/chunk-RV74I3YO.js +0 -3
  487. package/dist/cli/chunks/chunk-SJ6Y4725.js +0 -5
  488. package/dist/cli/chunks/chunk-UE5ZOZR2.js +0 -2
  489. package/dist/cli/chunks/chunk-VSIKHWZ4.js +0 -29
  490. package/dist/cli/chunks/chunk-YAPLJR7K.js +0 -2
  491. package/dist/cli/chunks/client-MHQRTZM4.js +0 -2
  492. package/dist/cli/chunks/copilot-installer-IGJ6KGQY.js +0 -3
  493. package/dist/cli/chunks/core-handlers-UAK3LLJE.js +0 -2
  494. package/dist/cli/chunks/cross-domain-router-WTRZQPNQ.js +0 -2
  495. package/dist/cli/chunks/daemon-CAVZ7OFV.js +0 -18
  496. package/dist/cli/chunks/dream-EJY24JN6.js +0 -2
  497. package/dist/cli/chunks/embed-and-insert-pattern-COG4C7ZI.js +0 -3
  498. package/dist/cli/chunks/file-discovery-UZSFSS4V.js +0 -2
  499. package/dist/cli/chunks/heartbeat-scheduler-NVR356I7.js +0 -2
  500. package/dist/cli/chunks/hnsw-adapter-LFMPLUJU.js +0 -2
  501. package/dist/cli/chunks/hnsw-index-POCPMVJH.js +0 -2
  502. package/dist/cli/chunks/hybrid-backend-4STAO7CV.js +0 -2
  503. package/dist/cli/chunks/impact-analyzer-3VIIISBQ.js +0 -2
  504. package/dist/cli/chunks/init-wizard-PL6QN6RQ.js +0 -2
  505. package/dist/cli/chunks/kernel-CCDWT7KS.js +0 -2
  506. package/dist/cli/chunks/knowledge-graph-KFOMEN3H.js +0 -2
  507. package/dist/cli/chunks/llm-router-service-7NBE2EX6.js +0 -2
  508. package/dist/cli/chunks/load-test-UNZUWY3F.js +0 -2
  509. package/dist/cli/chunks/memory-backend-DFGKWA2Q.js +0 -2
  510. package/dist/cli/chunks/memory-handlers-MP426XRJ.js +0 -2
  511. package/dist/cli/chunks/pattern-null-store-SSVF5TE5.js +0 -2
  512. package/dist/cli/chunks/project-root-BEANNYWU.js +0 -2
  513. package/dist/cli/chunks/protocol-executor-FQVIHXZ7.js +0 -2
  514. package/dist/cli/chunks/qe-reasoning-bank-5TFYSE24.js +0 -2
  515. package/dist/cli/chunks/queen-coordinator-Y2OUL7IN.js +0 -2
  516. package/dist/cli/chunks/real-embeddings-OXLYU7JW.js +0 -2
  517. package/dist/cli/chunks/router-EP34O3KB.js +0 -2
  518. package/dist/cli/chunks/routing-feedback-FJCRKXNG.js +0 -2
  519. package/dist/cli/chunks/rvf-dual-writer-ILITJSFG.js +0 -2
  520. package/dist/cli/chunks/rvf-migration-adapter-XF6W4C2N.js +0 -2
  521. package/dist/cli/chunks/rvf-migration-coordinator-CMKG56AR.js +0 -2
  522. package/dist/cli/chunks/rvf-native-adapter-7YFW6S4Y.js +0 -2
  523. package/dist/cli/chunks/safe-db-TCAU4FUT.js +0 -2
  524. package/dist/cli/chunks/schedule-NB5KV435.js +0 -2
  525. package/dist/cli/chunks/scheduler-JKXGKVK6.js +0 -2
  526. package/dist/cli/chunks/sqlite-persistence-IXCNZRTW.js +0 -2
  527. package/dist/cli/chunks/sync-OSF7C2NL.js +0 -2
  528. package/dist/cli/chunks/test-SD457QJ6.js +0 -34
  529. package/dist/cli/chunks/test-runner-process-VKD65QQU.js +0 -2
  530. package/dist/cli/chunks/token-bootstrap-VUELSBOS.js +0 -2
  531. package/dist/cli/chunks/tree-sitter-wasm-parser-YAIPHRIL.js +0 -2
  532. package/dist/cli/chunks/unified-memory-GI76TXFV.js +0 -2
  533. package/dist/cli/chunks/unified-memory-hnsw-GXJ5BTZO.js +0 -2
  534. package/dist/cli/chunks/unified-persistence-OP7FDQPD.js +0 -2
  535. package/dist/cli/chunks/visual-security-GZ2MOKWB.js +0 -2
  536. package/dist/cli/chunks/witness-chain-P3XXXA62.js +0 -2
  537. package/dist/cli/chunks/witness-chain-repair-PUX2NFDL.js +0 -2
  538. package/dist/cli/chunks/workflow-orchestrator-P2APAJAA.js +0 -2
  539. package/dist/cli/chunks/wrappers-TWSKBTWD.js +0 -2
@@ -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 { type ActivationConfig } from './spreading-activation.js';
24
- import { type InsightConfig, type DreamInsight } from './insight-generator.js';
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
- byType[node.conceptType] = (byType[node.conceptType] ?? 0) + 1;
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;
@@ -15,6 +15,8 @@
15
15
  * - Bearer auth from env only; URL userinfo stripped + warned on construct.
16
16
  * - Probe + identity fingerprint required before `embed()`; breaker recovery
17
17
  * invalidates identity so re-probe runs against a fresh endpoint.
18
+ * - The first identity is bound for the client's lifetime: a re-probe that
19
+ * finds another model is refused, never adopted (#1282).
18
20
  * - True TCP connect timeout via socket-level setTimeout (not req.setTimeout).
19
21
  * - TLS knobs (ca / cert / key / rejectUnauthorized / servername) for self-hosted.
20
22
  */
@@ -64,6 +66,8 @@ export interface EmbedderEndpointClientOptions {
64
66
  /** TLS overrides for https transport. Ignored for http/unix. */
65
67
  tlsOptions?: EmbedderTlsOptions;
66
68
  }
69
+ /** The text every probe embeds; its vector is the endpoint's identity evidence. */
70
+ export declare const ENDPOINT_IDENTITY_CANARY = "AQE embedder endpoint identity canary v1";
67
71
  /**
68
72
  * Parsed endpoint — either an HTTP(S) URL or a Unix socket path.
69
73
  */
@@ -92,6 +96,17 @@ export declare class EmbedderEndpointTimeoutError extends Error {
92
96
  readonly limitMs: number;
93
97
  constructor(phase: 'connect' | 'request', limitMs: number);
94
98
  }
99
+ /**
100
+ * #1282: a probe found a different endpoint identity than the one the client
101
+ * bound to. Vectors from the new identity are not comparable with stored ones,
102
+ * so the client refuses to embed until the endpoint serves the bound identity
103
+ * again or the process restarts.
104
+ */
105
+ export declare class EmbedderEndpointIdentityChangedError extends Error {
106
+ readonly bound: EndpointIdentity;
107
+ readonly current: EndpointIdentity;
108
+ constructor(bound: EndpointIdentity, current: EndpointIdentity);
109
+ }
95
110
  /**
96
111
  * OpenAI-compatible embeddings client with keep-alive, circuit breaker, and identity probe.
97
112
  */
@@ -101,6 +116,15 @@ export declare class EmbedderEndpointClient {
101
116
  private readonly breaker;
102
117
  private readonly opts;
103
118
  private cachedIdentity;
119
+ /**
120
+ * #1282: the first identity a probe found. Every embedding this client
121
+ * returns belongs to it; later probes must find it again.
122
+ */
123
+ private boundIdentity;
124
+ /** #1282: the canary vector behind `boundIdentity`. */
125
+ private boundCanary;
126
+ /** #1282: set while the endpoint serves an identity other than the bound one. */
127
+ private identityChange;
104
128
  /** True while a probe is in flight — prevents the embed() lazy-probe race. */
105
129
  private probeInFlight;
106
130
  /**
@@ -146,7 +170,28 @@ export declare class EmbedderEndpointClient {
146
170
  probe(): Promise<EndpointIdentity>;
147
171
  private ensureProbed;
148
172
  private doProbe;
173
+ /**
174
+ * #1282: true when a re-probe found the bound model. The int16 fingerprint
175
+ * flips on noise of about 3e-5 per component, which the same model restarted
176
+ * on other hardware or kernels can produce, so a changed hash alone is not a
177
+ * changed model: the canary must also have moved below the ADR-097
178
+ * round-trip cosine.
179
+ */
180
+ private isBoundModel;
181
+ /**
182
+ * #1282: the endpoint answers, but as a different model than the one this
183
+ * client bound to (an endpoint restarted with another model of the same
184
+ * dimension, typically seen when the breaker recovers). Treat it as down:
185
+ * open the breaker so every caller fast-fails with this error, and retry
186
+ * as a half-open trial after each window, in case the bound model returns.
187
+ * Reported once per new identity.
188
+ */
189
+ private refuseIdentityChange;
149
190
  getCachedIdentity(): EndpointIdentity | null;
191
+ /** #1282: the identity every vector from this client belongs to. */
192
+ getBoundIdentity(): EndpointIdentity | null;
193
+ /** #1298: the canary vector behind the bound identity (ENDPOINT_IDENTITY_CANARY). */
194
+ getBoundCanary(): readonly number[] | null;
150
195
  getBreakerState(): {
151
196
  open: boolean;
152
197
  failures: number;
@@ -15,6 +15,8 @@
15
15
  * - Bearer auth from env only; URL userinfo stripped + warned on construct.
16
16
  * - Probe + identity fingerprint required before `embed()`; breaker recovery
17
17
  * invalidates identity so re-probe runs against a fresh endpoint.
18
+ * - The first identity is bound for the client's lifetime: a re-probe that
19
+ * finds another model is refused, never adopted (#1282).
18
20
  * - True TCP connect timeout via socket-level setTimeout (not req.setTimeout).
19
21
  * - TLS knobs (ca / cert / key / rejectUnauthorized / servername) for self-hosted.
20
22
  */
@@ -22,7 +24,8 @@ import * as http from 'node:http';
22
24
  import * as https from 'node:https';
23
25
  import { createHash } from 'node:crypto';
24
26
  import { URL } from 'node:url';
25
- import { normalize as l2Normalize } from '../shared/utils/vector-math.js';
27
+ import { cosineSimilarity, normalize as l2Normalize } from '../shared/utils/vector-math.js';
28
+ import { EMBEDDING_ROUND_TRIP_MIN_COSINE } from './embedding-space.js';
26
29
  const DEFAULT_OPTIONS = {
27
30
  model: 'Xenova/all-MiniLM-L6-v2',
28
31
  expectedDim: 384,
@@ -31,7 +34,9 @@ const DEFAULT_OPTIONS = {
31
34
  failureThreshold: 3,
32
35
  failureWindowMs: 60_000,
33
36
  };
34
- const CANARY_TEXT = 'AQE embedder endpoint identity canary v1';
37
+ /** The text every probe embeds; its vector is the endpoint's identity evidence. */
38
+ export const ENDPOINT_IDENTITY_CANARY = 'AQE embedder endpoint identity canary v1';
39
+ const CANARY_TEXT = ENDPOINT_IDENTITY_CANARY;
35
40
  const EMBEDDINGS_PATH = '/v1/embeddings';
36
41
  /**
37
42
  * Strip user:password@ from a URL for safe logging.
@@ -97,6 +102,25 @@ export class EmbedderEndpointTimeoutError extends Error {
97
102
  this.name = 'EmbedderEndpointTimeoutError';
98
103
  }
99
104
  }
105
+ /**
106
+ * #1282: a probe found a different endpoint identity than the one the client
107
+ * bound to. Vectors from the new identity are not comparable with stored ones,
108
+ * so the client refuses to embed until the endpoint serves the bound identity
109
+ * again or the process restarts.
110
+ */
111
+ export class EmbedderEndpointIdentityChangedError extends Error {
112
+ bound;
113
+ current;
114
+ constructor(bound, current) {
115
+ super(`[EmbedderEndpointClient] endpoint identity changed since this process bound to it ` +
116
+ `(fingerprint ${bound.fingerprint} -> ${current.fingerprint}, ` +
117
+ `dim ${bound.dim} -> ${current.dim}) at ${current.endpoint}; ` +
118
+ `restart to use the new embedding space`);
119
+ this.bound = bound;
120
+ this.current = current;
121
+ this.name = 'EmbedderEndpointIdentityChangedError';
122
+ }
123
+ }
100
124
  /**
101
125
  * Circuit breaker state.
102
126
  *
@@ -160,6 +184,9 @@ class CircuitBreaker {
160
184
  return { open: this.isOpen(), failures: this.failures.length, trippedAt: this.trippedAt };
161
185
  }
162
186
  }
187
+ function sameIdentity(a, b) {
188
+ return a.fingerprint === b.fingerprint && a.dim === b.dim;
189
+ }
163
190
  /**
164
191
  * OpenAI-compatible embeddings client with keep-alive, circuit breaker, and identity probe.
165
192
  */
@@ -169,6 +196,15 @@ export class EmbedderEndpointClient {
169
196
  breaker;
170
197
  opts;
171
198
  cachedIdentity = null;
199
+ /**
200
+ * #1282: the first identity a probe found. Every embedding this client
201
+ * returns belongs to it; later probes must find it again.
202
+ */
203
+ boundIdentity = null;
204
+ /** #1282: the canary vector behind `boundIdentity`. */
205
+ boundCanary = null;
206
+ /** #1282: set while the endpoint serves an identity other than the bound one. */
207
+ identityChange = null;
172
208
  /** True while a probe is in flight — prevents the embed() lazy-probe race. */
173
209
  probeInFlight = null;
174
210
  /**
@@ -260,6 +296,9 @@ export class EmbedderEndpointClient {
260
296
  if (texts.length === 0)
261
297
  return [];
262
298
  if (this.breaker.isOpen()) {
299
+ // #1282: say why the breaker is open when the cause is a changed model.
300
+ if (this.identityChange)
301
+ throw this.identityChange;
263
302
  throw new Error(`[EmbedderEndpointClient] circuit breaker open for ${this.parsed.safeUrl} — fast-failing`);
264
303
  }
265
304
  // Identity gate: every embed call must have a verified identity behind it.
@@ -328,17 +367,73 @@ export class EmbedderEndpointClient {
328
367
  buf.writeInt16LE(q, i * 2);
329
368
  }
330
369
  const fingerprint = createHash('sha256').update(buf).digest('hex').slice(0, 16);
331
- this.cachedIdentity = {
370
+ const identity = {
332
371
  dim: vec.length,
333
372
  fingerprint,
334
373
  endpoint: this.parsed.safeUrl,
335
374
  };
375
+ if (this.boundIdentity && this.boundCanary) {
376
+ if (!this.isBoundModel(identity, vec))
377
+ this.refuseIdentityChange(identity);
378
+ }
379
+ else {
380
+ this.boundIdentity = identity;
381
+ this.boundCanary = vec;
382
+ }
383
+ this.identityChange = null;
384
+ // The bound identity stays the one callers see, also when fp noise moved
385
+ // the hash: the embedding space did not change.
386
+ this.cachedIdentity = this.boundIdentity;
336
387
  this.trialPending = false;
337
388
  return this.cachedIdentity;
338
389
  }
390
+ /**
391
+ * #1282: true when a re-probe found the bound model. The int16 fingerprint
392
+ * flips on noise of about 3e-5 per component, which the same model restarted
393
+ * on other hardware or kernels can produce, so a changed hash alone is not a
394
+ * changed model: the canary must also have moved below the ADR-097
395
+ * round-trip cosine.
396
+ */
397
+ isBoundModel(identity, canary) {
398
+ const bound = this.boundIdentity;
399
+ if (identity.dim !== bound.dim)
400
+ return false;
401
+ if (identity.fingerprint === bound.fingerprint)
402
+ return true;
403
+ return (cosineSimilarity(this.boundCanary, canary) >= EMBEDDING_ROUND_TRIP_MIN_COSINE);
404
+ }
405
+ /**
406
+ * #1282: the endpoint answers, but as a different model than the one this
407
+ * client bound to (an endpoint restarted with another model of the same
408
+ * dimension, typically seen when the breaker recovers). Treat it as down:
409
+ * open the breaker so every caller fast-fails with this error, and retry
410
+ * as a half-open trial after each window, in case the bound model returns.
411
+ * Reported once per new identity.
412
+ */
413
+ refuseIdentityChange(current) {
414
+ const bound = this.boundIdentity;
415
+ const previous = this.identityChange;
416
+ const change = new EmbedderEndpointIdentityChangedError(bound, current);
417
+ this.identityChange = change;
418
+ this.cachedIdentity = null;
419
+ this.trialPending = true;
420
+ this.breaker.trip();
421
+ if (!previous || !sameIdentity(previous.current, current)) {
422
+ console.warn(`${change.message}. Embedding requests are refused.`);
423
+ }
424
+ throw change;
425
+ }
339
426
  getCachedIdentity() {
340
427
  return this.cachedIdentity;
341
428
  }
429
+ /** #1282: the identity every vector from this client belongs to. */
430
+ getBoundIdentity() {
431
+ return this.boundIdentity;
432
+ }
433
+ /** #1298: the canary vector behind the bound identity (ENDPOINT_IDENTITY_CANARY). */
434
+ getBoundCanary() {
435
+ return this.boundCanary;
436
+ }
342
437
  getBreakerState() {
343
438
  return this.breaker.getState();
344
439
  }
@@ -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
- db.pragma('journal_mode = WAL');
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