@hawkeyexl/manni 4.26.2 → 4.27.1

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 (270) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-4I5S6DXG.js → batch-FXJMZSYY.js} +14 -14
  3. package/dist/build-5O753VOV.js +37 -0
  4. package/dist/{calibrate-U4TQAXXD.js → calibrate-RF7YSQMK.js} +15 -15
  5. package/dist/{capture-ODSHL2XI.js → capture-EKYFKMBB.js} +14 -14
  6. package/dist/check-4YQUHDAP.js +58 -0
  7. package/dist/check-CG4UOXP7.js +34 -0
  8. package/dist/{check-YFLWJUZC.js → check-KI3HYODN.js} +15 -15
  9. package/dist/check-PWFSARDW.js +31 -0
  10. package/dist/check-VXTYP4XW.js +58 -0
  11. package/dist/{chunk-QNXNA2BR.js → chunk-35J3BP37.js} +300 -58
  12. package/dist/chunk-35J3BP37.js.map +1 -0
  13. package/dist/{chunk-SIDHDT4X.js → chunk-3G3TETDC.js} +8 -8
  14. package/dist/{chunk-4X3EH5VC.js → chunk-3VFYCN5N.js} +65 -47
  15. package/dist/chunk-3VFYCN5N.js.map +1 -0
  16. package/dist/{chunk-BREAC43H.js → chunk-43VLZO4W.js} +2 -2
  17. package/dist/{chunk-HJHDYROD.js → chunk-47CLJY6H.js} +4 -4
  18. package/dist/{chunk-RVATMGUL.js → chunk-4CBACRVT.js} +4 -4
  19. package/dist/{chunk-UT3CPOGN.js → chunk-4YTYUB77.js} +8 -8
  20. package/dist/{chunk-QWGAM3T6.js → chunk-5GQ7FF22.js} +3 -3
  21. package/dist/{chunk-B6YZINES.js → chunk-5UCBYX53.js} +173 -83
  22. package/dist/chunk-5UCBYX53.js.map +1 -0
  23. package/dist/{chunk-KHBOMLPS.js → chunk-6RGLJTXE.js} +4 -4
  24. package/dist/{chunk-KLTGAGB6.js → chunk-74E5D3DP.js} +3 -3
  25. package/dist/{chunk-UUGTQUKK.js → chunk-7DFAXPO6.js} +64 -11
  26. package/dist/chunk-7DFAXPO6.js.map +1 -0
  27. package/dist/{chunk-5KWMVAZZ.js → chunk-7VCMV247.js} +2 -2
  28. package/dist/{chunk-MC7U5IH4.js → chunk-BCRMMIY5.js} +1 -1
  29. package/dist/chunk-BCRMMIY5.js.map +1 -0
  30. package/dist/{chunk-3ZVRGBK6.js → chunk-BTFXOKCP.js} +2 -2
  31. package/dist/{chunk-4DFLLMIM.js → chunk-C2XLJICN.js} +3 -3
  32. package/dist/{chunk-JF4BC7ZD.js → chunk-CDX4QK6O.js} +29 -2
  33. package/dist/chunk-CDX4QK6O.js.map +1 -0
  34. package/dist/{chunk-PEZP4ZFP.js → chunk-CIGRVU5V.js} +31 -13
  35. package/dist/chunk-CIGRVU5V.js.map +1 -0
  36. package/dist/{chunk-K7UVWJJW.js → chunk-CUOJGVVA.js} +15 -7
  37. package/dist/chunk-CUOJGVVA.js.map +1 -0
  38. package/dist/{chunk-NTQ73IQL.js → chunk-D7V5MUXP.js} +2 -2
  39. package/dist/{chunk-NTQ73IQL.js.map → chunk-D7V5MUXP.js.map} +1 -1
  40. package/dist/{chunk-PX4QZLA2.js → chunk-F4CL337L.js} +3 -3
  41. package/dist/{chunk-KSDAAJJX.js → chunk-G2SEJDO6.js} +2 -2
  42. package/dist/{chunk-J7E4XAFG.js → chunk-GEBXLJKQ.js} +32 -22
  43. package/dist/chunk-GEBXLJKQ.js.map +1 -0
  44. package/dist/chunk-HMJZHUCJ.js +337 -0
  45. package/dist/chunk-HMJZHUCJ.js.map +1 -0
  46. package/dist/{chunk-GXC7SDLO.js → chunk-IHW7N3A6.js} +369 -89
  47. package/dist/chunk-IHW7N3A6.js.map +1 -0
  48. package/dist/{chunk-UOZZTK7T.js → chunk-JVWJYB7V.js} +6 -6
  49. package/dist/{chunk-P6QJPKZ2.js → chunk-K7742NWM.js} +31 -26
  50. package/dist/chunk-K7742NWM.js.map +1 -0
  51. package/dist/{chunk-PJ5YJS6L.js → chunk-KPXZZD66.js} +2 -2
  52. package/dist/{chunk-KLRTOQN4.js → chunk-KQ66NYWY.js} +13 -7
  53. package/dist/chunk-KQ66NYWY.js.map +1 -0
  54. package/dist/{chunk-GM5LWEDF.js → chunk-L7QHAAZC.js} +56 -27
  55. package/dist/chunk-L7QHAAZC.js.map +1 -0
  56. package/dist/{chunk-BAJ23I2H.js → chunk-LEGD33WJ.js} +14 -7
  57. package/dist/chunk-LEGD33WJ.js.map +1 -0
  58. package/dist/{chunk-Z2JBWLRF.js → chunk-M2XDU7QB.js} +9 -9
  59. package/dist/{chunk-H4JXCWLM.js → chunk-MHVS4LTZ.js} +7 -7
  60. package/dist/{chunk-7ODOTGU4.js → chunk-MRQTMVJZ.js} +3 -3
  61. package/dist/{chunk-RV2BYDJK.js → chunk-MZMVTI6Y.js} +24 -14
  62. package/dist/chunk-MZMVTI6Y.js.map +1 -0
  63. package/dist/{chunk-MMVT3ZP3.js → chunk-NFQH77XJ.js} +5 -5
  64. package/dist/{chunk-SHYEKYV4.js → chunk-OBZY2ZLQ.js} +2 -2
  65. package/dist/{chunk-TI4DA6DF.js → chunk-OPF3NOKF.js} +1 -1
  66. package/dist/chunk-OPF3NOKF.js.map +1 -0
  67. package/dist/{chunk-QFEEUI2Z.js → chunk-OVIWWR5N.js} +4 -4
  68. package/dist/{chunk-THFV3YVO.js → chunk-P3OV32LW.js} +4 -4
  69. package/dist/{chunk-NZ7RO6ZD.js → chunk-P4HSBQHG.js} +3 -3
  70. package/dist/{chunk-VNR7BQBZ.js → chunk-P6JCXNMG.js} +52 -4
  71. package/dist/chunk-P6JCXNMG.js.map +1 -0
  72. package/dist/{chunk-JDQFU2U6.js → chunk-QXSPGFT3.js} +9 -9
  73. package/dist/{chunk-BPVO3OED.js → chunk-RCP5V6KE.js} +6 -6
  74. package/dist/{chunk-P7MGBTY3.js → chunk-RHR64UXW.js} +3 -3
  75. package/dist/{chunk-A43A335C.js → chunk-RWGHG66G.js} +3 -3
  76. package/dist/{chunk-HAZQCHO5.js → chunk-S4ADL7Y4.js} +3 -3
  77. package/dist/{chunk-DPQAF2VR.js → chunk-SDUVH4J2.js} +2 -2
  78. package/dist/{chunk-LSH6HPKB.js → chunk-SJS6Z7JV.js} +4 -4
  79. package/dist/{chunk-K4X6GJKG.js → chunk-SJUEUKJD.js} +3 -3
  80. package/dist/{chunk-YG4GZXSA.js → chunk-TO6N7QVO.js} +2 -2
  81. package/dist/{chunk-OKLRZM2N.js → chunk-TXIZMTCQ.js} +5 -5
  82. package/dist/{chunk-LHFO4HF7.js → chunk-UGQPOFLW.js} +7 -7
  83. package/dist/{chunk-SJI7C7FY.js → chunk-VCJ6ZJDW.js} +14 -14
  84. package/dist/{chunk-EXCYL3S7.js → chunk-VH3X7GHC.js} +2 -2
  85. package/dist/{chunk-VDEE7AUI.js → chunk-VKIIG6DZ.js} +2 -2
  86. package/dist/{chunk-LURF4MTH.js → chunk-VPNKSEQU.js} +3 -3
  87. package/dist/{chunk-PWLUQLFH.js → chunk-W4RCGOLJ.js} +7 -7
  88. package/dist/{chunk-GCJPYCOV.js → chunk-WOCG36UV.js} +4 -4
  89. package/dist/{chunk-ZR33AQFW.js → chunk-XK3T6MKU.js} +10 -8
  90. package/dist/chunk-XK3T6MKU.js.map +1 -0
  91. package/dist/{chunk-A6LHTTNO.js → chunk-XOKLYJJT.js} +21 -12
  92. package/dist/chunk-XOKLYJJT.js.map +1 -0
  93. package/dist/{chunk-M6RB342K.js → chunk-YTW7A62V.js} +2 -2
  94. package/dist/{chunk-4IM6A2WK.js → chunk-YWJ453BG.js} +6 -6
  95. package/dist/{chunk-RZ65VMRW.js → chunk-ZBN2HEC2.js} +10 -10
  96. package/dist/{chunk-DGN4VVFG.js → chunk-ZMEDAKMB.js} +3 -3
  97. package/dist/{chunk-NXP3DG4L.js → chunk-ZMGME5NG.js} +4 -4
  98. package/dist/{chunk-XD4Z26HJ.js → chunk-ZMWQZF3F.js} +3 -3
  99. package/dist/{chunk-G5I2JTDK.js → chunk-ZWVYT2G6.js} +2 -2
  100. package/dist/{chunk-D4BGNAN5.js → chunk-ZZGHTXZ2.js} +159 -23
  101. package/dist/chunk-ZZGHTXZ2.js.map +1 -0
  102. package/dist/{cli-XM4F6ZC7.js → cli-545YXHOS.js} +26 -25
  103. package/dist/{cli-XM4F6ZC7.js.map → cli-545YXHOS.js.map} +1 -1
  104. package/dist/{cli-DKRISKSR.js → cli-6EPISRJR.js} +21 -21
  105. package/dist/{cli-WWNQFDMK.js → cli-6LJS32R2.js} +3 -3
  106. package/dist/{cli-RO4TNFXJ.js → cli-6N2VRKCW.js} +16 -15
  107. package/dist/{cli-RO4TNFXJ.js.map → cli-6N2VRKCW.js.map} +1 -1
  108. package/dist/{cli-SDW7JOTO.js → cli-6SDS7T2Q.js} +56 -55
  109. package/dist/{cli-SDW7JOTO.js.map → cli-6SDS7T2Q.js.map} +1 -1
  110. package/dist/{cli-3VAVQYQT.js → cli-DCGA5IQ4.js} +24 -42
  111. package/dist/cli-DCGA5IQ4.js.map +1 -0
  112. package/dist/{cli-AR6TOW7M.js → cli-E6JIYSKY.js} +20 -19
  113. package/dist/{cli-AR6TOW7M.js.map → cli-E6JIYSKY.js.map} +1 -1
  114. package/dist/{cli-CFDGH5HD.js → cli-K4SDAECI.js} +30 -29
  115. package/dist/{cli-CFDGH5HD.js.map → cli-K4SDAECI.js.map} +1 -1
  116. package/dist/{cli-6DOYYCTT.js → cli-KINREG4W.js} +29 -28
  117. package/dist/{cli-6DOYYCTT.js.map → cli-KINREG4W.js.map} +1 -1
  118. package/dist/{cli-7IPP6ZTQ.js → cli-XUWY3QTT.js} +37 -36
  119. package/dist/{cli-7IPP6ZTQ.js.map → cli-XUWY3QTT.js.map} +1 -1
  120. package/dist/{cli-C2OATF3N.js → cli-ZTYRATHT.js} +8 -8
  121. package/dist/cli.js +15 -15
  122. package/dist/{config-2YJPJ36T.js → config-Z3FYLJ6X.js} +3 -3
  123. package/dist/docmeta.js +7 -7
  124. package/dist/github-GW6UZTRR.js +29 -0
  125. package/dist/{github-GU23WNCU.js → github-IT66VVCM.js} +15 -14
  126. package/dist/github-UJTQPG6S.js +49 -0
  127. package/dist/index.d.ts +165 -6
  128. package/dist/index.js +55 -54
  129. package/dist/index.js.map +1 -1
  130. package/dist/{json-P4EDSVIC.js → json-KKNQHTAA.js} +13 -12
  131. package/dist/{json-YIZON5LE.js → json-X4XGVPXV.js} +16 -15
  132. package/dist/{labels-6RROJOYQ.js → labels-7UD5VT2S.js} +12 -11
  133. package/dist/{labels-6RROJOYQ.js.map → labels-7UD5VT2S.js.map} +1 -1
  134. package/dist/lint-L7QTMCCV.js +33 -0
  135. package/dist/list-R34MHZWK.js +31 -0
  136. package/dist/list-S6LJENZ3.js +49 -0
  137. package/dist/{list-UARFGS7C.js → list-URXKGZ5I.js} +15 -14
  138. package/dist/{page-JADAILE3.js → page-2H44PTPE.js} +10 -10
  139. package/dist/{prepare-B24HTUCX.js → prepare-ND2INKAJ.js} +13 -13
  140. package/dist/{pretty-XAMSAKAR.js → pretty-54GDW63J.js} +15 -14
  141. package/dist/{pretty-NHNYY7CP.js → pretty-BW6SLRBO.js} +25 -24
  142. package/dist/{pretty-5V3PWJ6L.js → pretty-ZVAM3XV6.js} +13 -12
  143. package/dist/{reporters-HTJKW7NG.js → reporters-6P74QNVX.js} +5 -5
  144. package/dist/{reporters-ULSSBAAG.js → reporters-LON6K3EN.js} +12 -12
  145. package/dist/run-KLO35LDY.js +52 -0
  146. package/dist/{sarif-LBODGUNE.js → sarif-2HOXOFAZ.js} +9 -9
  147. package/dist/sarif-DM5XJGBX.js +50 -0
  148. package/dist/{sarif-SOA76ESJ.js → sarif-WXGSULXG.js} +11 -11
  149. package/dist/{strategy-XI7QTY7T.js → strategy-FOZDCVLS.js} +22 -21
  150. package/dist/{term-UIBQBGMR.js → term-CAPJSZ6V.js} +19 -18
  151. package/dist/{term-UIBQBGMR.js.map → term-CAPJSZ6V.js.map} +1 -1
  152. package/dist/{validate-X257AMWS.js → validate-LSB6TBY6.js} +5 -5
  153. package/package.json +1 -1
  154. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  155. package/plugin/manni/hooks/page-metadata.mjs +1 -1
  156. package/dist/build-OPWHXPXE.js +0 -36
  157. package/dist/check-4VOOUC5E.js +0 -33
  158. package/dist/check-M3ORYGTW.js +0 -57
  159. package/dist/check-QJ35SM3K.js +0 -57
  160. package/dist/check-UXS5LVFJ.js +0 -30
  161. package/dist/chunk-4X3EH5VC.js.map +0 -1
  162. package/dist/chunk-A6LHTTNO.js.map +0 -1
  163. package/dist/chunk-B6YZINES.js.map +0 -1
  164. package/dist/chunk-BAJ23I2H.js.map +0 -1
  165. package/dist/chunk-D4BGNAN5.js.map +0 -1
  166. package/dist/chunk-GM5LWEDF.js.map +0 -1
  167. package/dist/chunk-GXC7SDLO.js.map +0 -1
  168. package/dist/chunk-J7E4XAFG.js.map +0 -1
  169. package/dist/chunk-JF4BC7ZD.js.map +0 -1
  170. package/dist/chunk-K7UVWJJW.js.map +0 -1
  171. package/dist/chunk-KLRTOQN4.js.map +0 -1
  172. package/dist/chunk-MC7U5IH4.js.map +0 -1
  173. package/dist/chunk-P6QJPKZ2.js.map +0 -1
  174. package/dist/chunk-PEZP4ZFP.js.map +0 -1
  175. package/dist/chunk-QNXNA2BR.js.map +0 -1
  176. package/dist/chunk-RV2BYDJK.js.map +0 -1
  177. package/dist/chunk-TI4DA6DF.js.map +0 -1
  178. package/dist/chunk-UUGTQUKK.js.map +0 -1
  179. package/dist/chunk-VNR7BQBZ.js.map +0 -1
  180. package/dist/chunk-ZR33AQFW.js.map +0 -1
  181. package/dist/cli-3VAVQYQT.js.map +0 -1
  182. package/dist/github-RPHQGICU.js +0 -48
  183. package/dist/github-VKUOQE77.js +0 -28
  184. package/dist/lint-VXM7UKPY.js +0 -32
  185. package/dist/list-2Y7AM5BW.js +0 -30
  186. package/dist/list-ILJJM7EL.js +0 -48
  187. package/dist/run-EVPJ7SDL.js +0 -51
  188. package/dist/sarif-3PHFVX7D.js +0 -49
  189. /package/dist/{batch-4I5S6DXG.js.map → batch-FXJMZSYY.js.map} +0 -0
  190. /package/dist/{build-OPWHXPXE.js.map → build-5O753VOV.js.map} +0 -0
  191. /package/dist/{calibrate-U4TQAXXD.js.map → calibrate-RF7YSQMK.js.map} +0 -0
  192. /package/dist/{capture-ODSHL2XI.js.map → capture-EKYFKMBB.js.map} +0 -0
  193. /package/dist/{check-4VOOUC5E.js.map → check-4YQUHDAP.js.map} +0 -0
  194. /package/dist/{check-M3ORYGTW.js.map → check-CG4UOXP7.js.map} +0 -0
  195. /package/dist/{check-YFLWJUZC.js.map → check-KI3HYODN.js.map} +0 -0
  196. /package/dist/{check-QJ35SM3K.js.map → check-PWFSARDW.js.map} +0 -0
  197. /package/dist/{check-UXS5LVFJ.js.map → check-VXTYP4XW.js.map} +0 -0
  198. /package/dist/{chunk-SIDHDT4X.js.map → chunk-3G3TETDC.js.map} +0 -0
  199. /package/dist/{chunk-BREAC43H.js.map → chunk-43VLZO4W.js.map} +0 -0
  200. /package/dist/{chunk-HJHDYROD.js.map → chunk-47CLJY6H.js.map} +0 -0
  201. /package/dist/{chunk-RVATMGUL.js.map → chunk-4CBACRVT.js.map} +0 -0
  202. /package/dist/{chunk-UT3CPOGN.js.map → chunk-4YTYUB77.js.map} +0 -0
  203. /package/dist/{chunk-QWGAM3T6.js.map → chunk-5GQ7FF22.js.map} +0 -0
  204. /package/dist/{chunk-KHBOMLPS.js.map → chunk-6RGLJTXE.js.map} +0 -0
  205. /package/dist/{chunk-KLTGAGB6.js.map → chunk-74E5D3DP.js.map} +0 -0
  206. /package/dist/{chunk-5KWMVAZZ.js.map → chunk-7VCMV247.js.map} +0 -0
  207. /package/dist/{chunk-3ZVRGBK6.js.map → chunk-BTFXOKCP.js.map} +0 -0
  208. /package/dist/{chunk-4DFLLMIM.js.map → chunk-C2XLJICN.js.map} +0 -0
  209. /package/dist/{chunk-PX4QZLA2.js.map → chunk-F4CL337L.js.map} +0 -0
  210. /package/dist/{chunk-KSDAAJJX.js.map → chunk-G2SEJDO6.js.map} +0 -0
  211. /package/dist/{chunk-UOZZTK7T.js.map → chunk-JVWJYB7V.js.map} +0 -0
  212. /package/dist/{chunk-PJ5YJS6L.js.map → chunk-KPXZZD66.js.map} +0 -0
  213. /package/dist/{chunk-Z2JBWLRF.js.map → chunk-M2XDU7QB.js.map} +0 -0
  214. /package/dist/{chunk-H4JXCWLM.js.map → chunk-MHVS4LTZ.js.map} +0 -0
  215. /package/dist/{chunk-7ODOTGU4.js.map → chunk-MRQTMVJZ.js.map} +0 -0
  216. /package/dist/{chunk-MMVT3ZP3.js.map → chunk-NFQH77XJ.js.map} +0 -0
  217. /package/dist/{chunk-SHYEKYV4.js.map → chunk-OBZY2ZLQ.js.map} +0 -0
  218. /package/dist/{chunk-QFEEUI2Z.js.map → chunk-OVIWWR5N.js.map} +0 -0
  219. /package/dist/{chunk-THFV3YVO.js.map → chunk-P3OV32LW.js.map} +0 -0
  220. /package/dist/{chunk-NZ7RO6ZD.js.map → chunk-P4HSBQHG.js.map} +0 -0
  221. /package/dist/{chunk-JDQFU2U6.js.map → chunk-QXSPGFT3.js.map} +0 -0
  222. /package/dist/{chunk-BPVO3OED.js.map → chunk-RCP5V6KE.js.map} +0 -0
  223. /package/dist/{chunk-P7MGBTY3.js.map → chunk-RHR64UXW.js.map} +0 -0
  224. /package/dist/{chunk-A43A335C.js.map → chunk-RWGHG66G.js.map} +0 -0
  225. /package/dist/{chunk-HAZQCHO5.js.map → chunk-S4ADL7Y4.js.map} +0 -0
  226. /package/dist/{chunk-DPQAF2VR.js.map → chunk-SDUVH4J2.js.map} +0 -0
  227. /package/dist/{chunk-LSH6HPKB.js.map → chunk-SJS6Z7JV.js.map} +0 -0
  228. /package/dist/{chunk-K4X6GJKG.js.map → chunk-SJUEUKJD.js.map} +0 -0
  229. /package/dist/{chunk-YG4GZXSA.js.map → chunk-TO6N7QVO.js.map} +0 -0
  230. /package/dist/{chunk-OKLRZM2N.js.map → chunk-TXIZMTCQ.js.map} +0 -0
  231. /package/dist/{chunk-LHFO4HF7.js.map → chunk-UGQPOFLW.js.map} +0 -0
  232. /package/dist/{chunk-SJI7C7FY.js.map → chunk-VCJ6ZJDW.js.map} +0 -0
  233. /package/dist/{chunk-EXCYL3S7.js.map → chunk-VH3X7GHC.js.map} +0 -0
  234. /package/dist/{chunk-VDEE7AUI.js.map → chunk-VKIIG6DZ.js.map} +0 -0
  235. /package/dist/{chunk-LURF4MTH.js.map → chunk-VPNKSEQU.js.map} +0 -0
  236. /package/dist/{chunk-PWLUQLFH.js.map → chunk-W4RCGOLJ.js.map} +0 -0
  237. /package/dist/{chunk-GCJPYCOV.js.map → chunk-WOCG36UV.js.map} +0 -0
  238. /package/dist/{chunk-M6RB342K.js.map → chunk-YTW7A62V.js.map} +0 -0
  239. /package/dist/{chunk-4IM6A2WK.js.map → chunk-YWJ453BG.js.map} +0 -0
  240. /package/dist/{chunk-RZ65VMRW.js.map → chunk-ZBN2HEC2.js.map} +0 -0
  241. /package/dist/{chunk-DGN4VVFG.js.map → chunk-ZMEDAKMB.js.map} +0 -0
  242. /package/dist/{chunk-NXP3DG4L.js.map → chunk-ZMGME5NG.js.map} +0 -0
  243. /package/dist/{chunk-XD4Z26HJ.js.map → chunk-ZMWQZF3F.js.map} +0 -0
  244. /package/dist/{chunk-G5I2JTDK.js.map → chunk-ZWVYT2G6.js.map} +0 -0
  245. /package/dist/{cli-DKRISKSR.js.map → cli-6EPISRJR.js.map} +0 -0
  246. /package/dist/{cli-WWNQFDMK.js.map → cli-6LJS32R2.js.map} +0 -0
  247. /package/dist/{cli-C2OATF3N.js.map → cli-ZTYRATHT.js.map} +0 -0
  248. /package/dist/{config-2YJPJ36T.js.map → config-Z3FYLJ6X.js.map} +0 -0
  249. /package/dist/{github-GU23WNCU.js.map → github-GW6UZTRR.js.map} +0 -0
  250. /package/dist/{github-RPHQGICU.js.map → github-IT66VVCM.js.map} +0 -0
  251. /package/dist/{github-VKUOQE77.js.map → github-UJTQPG6S.js.map} +0 -0
  252. /package/dist/{json-P4EDSVIC.js.map → json-KKNQHTAA.js.map} +0 -0
  253. /package/dist/{json-YIZON5LE.js.map → json-X4XGVPXV.js.map} +0 -0
  254. /package/dist/{lint-VXM7UKPY.js.map → lint-L7QTMCCV.js.map} +0 -0
  255. /package/dist/{list-2Y7AM5BW.js.map → list-R34MHZWK.js.map} +0 -0
  256. /package/dist/{list-ILJJM7EL.js.map → list-S6LJENZ3.js.map} +0 -0
  257. /package/dist/{list-UARFGS7C.js.map → list-URXKGZ5I.js.map} +0 -0
  258. /package/dist/{page-JADAILE3.js.map → page-2H44PTPE.js.map} +0 -0
  259. /package/dist/{prepare-B24HTUCX.js.map → prepare-ND2INKAJ.js.map} +0 -0
  260. /package/dist/{pretty-5V3PWJ6L.js.map → pretty-54GDW63J.js.map} +0 -0
  261. /package/dist/{pretty-NHNYY7CP.js.map → pretty-BW6SLRBO.js.map} +0 -0
  262. /package/dist/{pretty-XAMSAKAR.js.map → pretty-ZVAM3XV6.js.map} +0 -0
  263. /package/dist/{reporters-HTJKW7NG.js.map → reporters-6P74QNVX.js.map} +0 -0
  264. /package/dist/{reporters-ULSSBAAG.js.map → reporters-LON6K3EN.js.map} +0 -0
  265. /package/dist/{run-EVPJ7SDL.js.map → run-KLO35LDY.js.map} +0 -0
  266. /package/dist/{sarif-3PHFVX7D.js.map → sarif-2HOXOFAZ.js.map} +0 -0
  267. /package/dist/{sarif-LBODGUNE.js.map → sarif-DM5XJGBX.js.map} +0 -0
  268. /package/dist/{sarif-SOA76ESJ.js.map → sarif-WXGSULXG.js.map} +0 -0
  269. /package/dist/{strategy-XI7QTY7T.js.map → strategy-FOZDCVLS.js.map} +0 -0
  270. /package/dist/{validate-X257AMWS.js.map → validate-LSB6TBY6.js.map} +0 -0
@@ -4,7 +4,7 @@ import {
4
4
  listInTree,
5
5
  resolveArtifacts,
6
6
  safeRead
7
- } from "./chunk-M6RB342K.js";
7
+ } from "./chunk-YTW7A62V.js";
8
8
  import {
9
9
  configDir
10
10
  } from "./chunk-4TSWU2SU.js";
@@ -15,13 +15,13 @@ import {
15
15
  } from "./chunk-VHJ72YCD.js";
16
16
  import {
17
17
  extractEvals
18
- } from "./chunk-QWGAM3T6.js";
18
+ } from "./chunk-5GQ7FF22.js";
19
19
  import {
20
20
  makeRedactor
21
21
  } from "./chunk-6WJUZQQX.js";
22
22
  import {
23
23
  extractFrontmatter
24
- } from "./chunk-GXC7SDLO.js";
24
+ } from "./chunk-IHW7N3A6.js";
25
25
 
26
26
  // src/tracevals/rules/turn.ts
27
27
  var INJECTED = /<(system-reminder|task-notification|ci-monitor-event|local-command-stdout|local-command-stderr|local-command-caveat)>[\s\S]*?<\/\1>/g;
@@ -673,4 +673,4 @@ export {
673
673
  resolveTurnSources,
674
674
  pathKey
675
675
  };
676
- //# sourceMappingURL=chunk-KHBOMLPS.js.map
676
+ //# sourceMappingURL=chunk-6RGLJTXE.js.map
@@ -5,10 +5,10 @@ import {
5
5
  indexSet,
6
6
  loadStrategy,
7
7
  resolveSteps
8
- } from "./chunk-H4JXCWLM.js";
8
+ } from "./chunk-MHVS4LTZ.js";
9
9
  import {
10
10
  RECORD_TYPES
11
- } from "./chunk-KLRTOQN4.js";
11
+ } from "./chunk-KQ66NYWY.js";
12
12
 
13
13
  // src/strategy/commands/list.ts
14
14
  var LIST_FORMATS = ["pretty", "json"];
@@ -52,4 +52,4 @@ export {
52
52
  entriesOf,
53
53
  runList
54
54
  };
55
- //# sourceMappingURL=chunk-KLTGAGB6.js.map
55
+ //# sourceMappingURL=chunk-74E5D3DP.js.map
@@ -11,6 +11,7 @@ import {
11
11
  judgeCacheBody,
12
12
  leadingFrontmatterFormat,
13
13
  loadRunConfig,
14
+ markupFormat,
14
15
  readTarget,
15
16
  renderEvidence,
16
17
  runConfigOptions,
@@ -19,7 +20,7 @@ import {
19
20
  sha256,
20
21
  splitBody,
21
22
  urlManifestRefusal
22
- } from "./chunk-P6QJPKZ2.js";
23
+ } from "./chunk-K7742NWM.js";
23
24
  import {
24
25
  turnBudgetSkipReason
25
26
  } from "./chunk-XG6PVB5S.js";
@@ -30,10 +31,17 @@ import {
30
31
  import {
31
32
  DocevalsError
32
33
  } from "./chunk-OZH46DBT.js";
34
+ import {
35
+ parserForExtension,
36
+ plainText
37
+ } from "./chunk-35J3BP37.js";
38
+ import {
39
+ flareRun
40
+ } from "./chunk-HMJZHUCJ.js";
33
41
  import {
34
42
  externalWriteWarnings,
35
43
  offerExternalHomes
36
- } from "./chunk-KLRTOQN4.js";
44
+ } from "./chunk-KQ66NYWY.js";
37
45
  import {
38
46
  LOCATION_KEYWORD,
39
47
  Validator,
@@ -41,10 +49,10 @@ import {
41
49
  readManifestOrEmpty,
42
50
  readManifestValue,
43
51
  spliceManifestValue
44
- } from "./chunk-P7MGBTY3.js";
52
+ } from "./chunk-RHR64UXW.js";
45
53
  import {
46
54
  writeFileAtomic
47
- } from "./chunk-GXC7SDLO.js";
55
+ } from "./chunk-IHW7N3A6.js";
48
56
  import {
49
57
  noticeOnce,
50
58
  warn
@@ -135,6 +143,23 @@ function findReview(reviews, file, evalName, body) {
135
143
  return entry.contentHash === sha256(body) ? entry : void 0;
136
144
  }
137
145
 
146
+ // src/docevals/judge/page-text.ts
147
+ import { extname } from "node:path";
148
+ async function pageText(page, flare) {
149
+ const parser = parserForExtension(extname(page.absPath));
150
+ if (parser === void 0) return page.body;
151
+ const tree = await parser.parse(page.content, page.absPath, { absPath: page.absPath, flare });
152
+ return sectionsText(tree.sections).join("\n\n");
153
+ }
154
+ function sectionsText(sections) {
155
+ return sections.flatMap((s) => [
156
+ // A title made from the page's metadata is not in its body.
157
+ ...s.synthetic || s.title.trim() === "" ? [] : [s.title.trim()],
158
+ ...plainText(s.children),
159
+ ...sectionsText(s.sections)
160
+ ]);
161
+ }
162
+
138
163
  // src/docevals/judge/provider.ts
139
164
  import {
140
165
  makeProvider as makeInferenceProvider
@@ -239,6 +264,7 @@ function makeJudge(deps) {
239
264
  const reviews = loadReviews(root);
240
265
  const maxTurns = options.maxTurns ?? config.judge.maxTurns;
241
266
  let turnsSpent = 0;
267
+ let flare;
242
268
  const results = [];
243
269
  const configured = config.judge.concurrency;
244
270
  const concurrency = Number.isInteger(configured) && configured >= 1 ? configured : config.defaults.concurrency;
@@ -276,15 +302,32 @@ function makeJudge(deps) {
276
302
  durationMs: Date.now() - start
277
303
  };
278
304
  }
279
- const chunks = splitBody(selected.text, chunkChars);
280
- let judged = selected.text;
305
+ const asText = selected.label === "body" && markupFormat(plan.page.absPath) !== void 0;
306
+ let text = selected.text;
307
+ if (asText) {
308
+ try {
309
+ text = await pageText(plan.page, flare ??= flareRun(config.tools));
310
+ } catch (e) {
311
+ return {
312
+ evalName: ev.name,
313
+ type: ev.type,
314
+ grader: ev.grader,
315
+ file: plan.page.file,
316
+ outcome: "error",
317
+ skipReason: `the page could not be read as text: ${errorMessage(e)}`,
318
+ durationMs: Date.now() - start
319
+ };
320
+ }
321
+ }
322
+ const chunks = splitBody(text, chunkChars);
323
+ let judged = text;
281
324
  let judgedLabel = selected.label;
282
325
  const key = cacheKey(
283
326
  judgeProvider.provider(),
284
327
  judgeProvider.modelName(),
285
328
  runsPerEval,
286
329
  temperature,
287
- judgeCacheBody(chunkChars, selected.text),
330
+ judgeCacheBody(chunkChars, text),
288
331
  ev,
289
332
  ev.readers?.section
290
333
  );
@@ -353,7 +396,7 @@ function makeJudge(deps) {
353
396
  system: JUDGE_SYSTEM_PROMPT,
354
397
  // Readers enter only this final call. Evidence gathering above quotes
355
398
  // what bears on the assertion, whoever reads it (proposal 0111).
356
- user: buildUserContent(ev, judged, judgedLabel, ev.readers?.section),
399
+ user: buildUserContent(ev, judged, judgedLabel, ev.readers?.section, !asText),
357
400
  runs: runsPerEval,
358
401
  temperature,
359
402
  schema: verdictSchema,
@@ -404,7 +447,7 @@ function makeJudge(deps) {
404
447
 
405
448
  // src/docevals/graders/scriptgen.ts
406
449
  import { mkdirSync as mkdirSync2, readFileSync as readFileSync2, writeFileSync as writeFileSync2 } from "node:fs";
407
- import { basename, dirname as dirname2, extname, join as join2, relative, resolve as resolve2 } from "node:path";
450
+ import { basename, dirname as dirname2, extname as extname2, join as join2, relative, resolve as resolve2 } from "node:path";
408
451
 
409
452
  // src/docevals/core/frontmatter-edit.ts
410
453
  import { parseDocument, Document, YAMLSeq, isMap, isScalar } from "yaml";
@@ -593,6 +636,13 @@ function prefersExternal(key) {
593
636
  function noEntryMessage(label, join3, file, key) {
594
637
  return `${label} carries no ${join3}, which ${file} joins on, so its ${key} has no entry there.`;
595
638
  }
639
+ function markupRefusal(page) {
640
+ const format = markupFormat(page.absPath);
641
+ if (format === void 0) return void 0;
642
+ return new DocevalsError(
643
+ `${page.file} is ${format}, so its evals live in a manifest. Give its collection an externalMetadata entry that owns evals.`
644
+ );
645
+ }
596
646
  var EvalWriter = class _EvalWriter {
597
647
  constructor(ctx, configSource) {
598
648
  this.ctx = ctx;
@@ -806,7 +856,7 @@ function scriptLocationFor(target, config, root) {
806
856
  const pageDir = dirname2(page.absPath);
807
857
  const pattern = config.scripts.dir;
808
858
  const dir2 = pattern.includes("{docDir}") ? pattern.replaceAll("{docDir}", pageDir) : resolve2(root, pattern);
809
- const base = basename(page.absPath, extname(page.absPath));
859
+ const base = basename(page.absPath, extname2(page.absPath));
810
860
  const scriptAbsPath2 = join2(dir2, `${base}.${ev.name}.mjs`);
811
861
  const rel2 = relative(pageDir, scriptAbsPath2).replace(/\\/g, "/");
812
862
  return { scriptAbsPath: scriptAbsPath2, command: ["node", rel2, "{file}"] };
@@ -852,6 +902,8 @@ function makeGenerateScripts(deps) {
852
902
  refusals.push({ file: page.file, evalName: ev.name, message: home.message });
853
903
  continue;
854
904
  }
905
+ const markup = home.kind === "page" ? markupRefusal(page) : void 0;
906
+ if (markup !== void 0) throw markup;
855
907
  }
856
908
  if (provider === void 0) {
857
909
  try {
@@ -1036,6 +1088,7 @@ export {
1036
1088
  hasEditableEval,
1037
1089
  EVALS_KEY,
1038
1090
  META_PROVENANCE_KEY2 as META_PROVENANCE_KEY,
1091
+ markupRefusal,
1039
1092
  EvalWriter,
1040
1093
  manifestEvalList,
1041
1094
  updateManifestEval,
@@ -1045,4 +1098,4 @@ export {
1045
1098
  makeGenerateScripts,
1046
1099
  runRun
1047
1100
  };
1048
- //# sourceMappingURL=chunk-UUGTQUKK.js.map
1101
+ //# sourceMappingURL=chunk-7DFAXPO6.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/docevals/judge/judge.ts","../src/docevals/judge/verdict-schema.json","../src/docevals/core/reviews.ts","../src/docevals/judge/page-text.ts","../src/docevals/judge/provider.ts","../src/docevals/graders/scriptgen.ts","../src/docevals/core/frontmatter-edit.ts","../src/docevals/core/write-location.ts","../src/docevals/commands/run.ts"],"sourcesContent":["/**\n * The ensemble judge: N independent runs per (page, eval), each a fresh\n * request with no shared context (eval isolation), aggregated by consensus\n * and routed through confidence zones. Persisted human reviews resolve\n * needs-review outcomes for unchanged pages.\n *\n * The ensemble mechanics — retry-once, errored runs counting against\n * consensus, cache replay — live in `@hawkeyexl/inference` (ADR 01002). What\n * stays here is manni docevals' own orchestration: the bounded-concurrency pool\n * across targets, the turn budget, the self-judgment warning, and human-review\n * resolution.\n */\nimport {\n computeConsensus,\n runEnsemble,\n zoneFor,\n type InferenceProvider,\n} from \"@hawkeyexl/inference\";\nimport verdictSchemaJson from \"./verdict-schema.json\" with { type: \"json\" };\nimport type { EvalResult } from \"../types.js\";\nimport type { DocevalsConfig } from \"../core/config.js\";\nimport type { JudgeFn, JudgeOptions } from \"../core/engine.js\";\nimport type { GraderTarget } from \"../graders/types.js\";\nimport { findReview, loadReviews } from \"../core/reviews.js\";\nimport { cacheKey, judgeCacheBody, VerdictCache } from \"./cache.js\";\nimport { turnBudgetSkipReason } from \"./budget.js\";\nimport {\n JUDGE_SYSTEM_PROMPT,\n buildUserContent,\n EVIDENCE_SYSTEM_PROMPT,\n EVIDENCE_SCHEMA,\n buildEvidenceUser,\n renderEvidence,\n type PartEvidence,\n} from \"./prompt.js\";\nimport { splitBody } from \"../core/split.js\";\nimport { readTarget } from \"../core/target.js\";\nimport { selfPreferenceOf } from \"./self-preference.js\";\nimport { pageText } from \"./page-text.js\";\nimport { markupFormat } from \"../core/discover.js\";\nimport { flareRun, type FlareRun } from \"../../shared/flare/index.js\";\nimport {\n announceSelection,\n assertProviderSelection,\n makeProvider,\n selectProvider,\n} from \"./provider.js\";\nimport { DocevalsError } from \"../types.js\";\nimport type { ResolvedEval } from \"../core/resolve.js\";\nimport { resolve as resolvePath } from \"node:path\";\nimport { warn } from \"../../shared/warn.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\n\n/**\n * manni docevals' own verdict wording. Structurally identical to the library's\n * canonical schema, but the field descriptions talk about pages rather than\n * generic subjects — and descriptions are prompt surface that steers the\n * model, so they are worth keeping (the inference library's own ADR 01001,\n * not this repo's).\n */\nconst verdictSchema = verdictSchemaJson as Record<string, unknown>;\n\nexport interface JudgeStageDeps {\n /** Provider for evals that do not override `provider`/`model`. */\n provider: InferenceProvider;\n root: string;\n /**\n * Build a provider for an eval that overrides `provider` or `model`.\n *\n * Injected so the engine's tests can drive per-eval overrides with a mock.\n * When absent, one is built from the resolved config — without it `provider`\n * and `model` would validate, appear in the schema, and do nothing, which is\n * worse than not offering them.\n */\n providerFor?: (ev: ResolvedEval) => InferenceProvider | Promise<InferenceProvider>;\n}\n\n/** Build the engine's judge stage around a concrete provider. */\nexport function makeJudge(deps: JudgeStageDeps): JudgeFn {\n return async (\n targets: GraderTarget[],\n config: DocevalsConfig,\n options: JudgeOptions,\n ): Promise<EvalResult[]> => {\n const { provider, root } = deps;\n\n // CLI > eval > config, the same precedence `runsFor` uses, settled by\n // `selectProvider` so the run's provider and an eval's are chosen by one\n // rule. Providers are memoized on the selection an eval *resolves to*, not\n // on what it wrote: with `--provider anthropic` in force, an eval naming\n // `openai` and one naming `mock` both resolve to the same provider, and\n // keying on the authored value would build it twice. The effective pair is\n // also what decides the short-circuit — an eval whose selection is the\n // run's own needs no provider of its own.\n //\n // Memoized as a promise, so a selection that detects or fails does so\n // once, and every eval sharing it gets the same provider or the same error.\n const overridden = new Map<string, Promise<InferenceProvider>>();\n const buildProvider =\n deps.providerFor ??\n ((ev: ResolvedEval): Promise<InferenceProvider> => makeProvider(config, options, ev));\n const keyOf = (s: { provider: string; model: string | undefined }): string =>\n `${s.provider}:${s.model ?? \"\"}`;\n const defaultKey = keyOf(selectProvider(config, options));\n const providerFor = (ev: ResolvedEval, file: string): Promise<InferenceProvider> => {\n // Only the eval's own two fields: a `ResolvedEval` carries a `source` of\n // its own, and the origin a `--local` notice names is the page's.\n const selection = selectProvider(config, options, {\n ...(ev.provider !== undefined ? { provider: ev.provider } : {}),\n ...(ev.model !== undefined ? { model: ev.model } : {}),\n origin: `eval \"${ev.name}\" in ${file}`,\n });\n // Said before the short-circuit: under `--local` an eval naming a hosted\n // provider resolves to the run's own selection, and is still replaced.\n announceSelection(selection);\n const key = keyOf(selection);\n if (key === defaultKey) return Promise.resolve(provider);\n let p = overridden.get(key);\n if (p === undefined) {\n // The eval's own choice follows the run's rules: an unknown name or a\n // model with no provider to own it is refused before anything is built.\n p = (async () => {\n assertProviderSelection(selection);\n return buildProvider(ev);\n })();\n overridden.set(key, p);\n }\n return p;\n };\n // CLI > eval > config. The flag is an explicit operator act (\"run cheap\n // right now\"), so it outranks a page asking for more agreement; the page\n // outranks the corpus default, which is the point of having it.\n const runsFor = (ev: ResolvedEval): number =>\n options.runs ?? ev.runs ?? config.judge.ensembleRuns;\n const temperature = config.judge.temperature;\n const chunkChars = options.chunkChars ?? config.judge.chunkChars;\n const cache = new VerdictCache(\n resolvePath(root, config.judge.cacheDir),\n options.noCache !== true,\n \"manni-docevals\",\n );\n const reviews = loadReviews(root);\n const maxTurns = options.maxTurns ?? config.judge.maxTurns;\n let turnsSpent = 0;\n // One per judged run, so each Flare project is read once. `flareRun`\n // takes a missing `tools`, which an exported `makeJudge` caller may send.\n let flare: FlareRun | undefined;\n\n const results: EvalResult[] = [];\n // `makeJudge` is a published export taking a caller-supplied config, so a\n // JS consumer can hand us one shaped for a version before `judge.concurrency`\n // existed. The type says that cannot happen; at a package boundary it can.\n // Unguarded it is `Math.min(undefined, n)` -> NaN -> `Array.from({length:\n // NaN})` -> zero workers, and every AI eval vanishes from the results —\n // not skipped, not errored, absent — with the run exiting 0.\n //\n // Tested with `Number.isFinite` rather than `??` because the value is typed\n // non-optional: `??` is dead code to the compiler and the lint rejects it,\n // while the runtime hazard is real. This says what is actually being\n // checked (ADR 01039).\n // `Number.isInteger(n) && n >= 1`, not `Number.isFinite`: the hazard is a\n // worker pool of zero, and `Number.isFinite(0)` is `true`. A caller-supplied\n // `judge.concurrency: 0` sails past a finite check into\n // `Array.from({length: 0})`, which builds no workers at all — every AI eval\n // then vanishes from the results, not skipped and not errored but absent,\n // with the run exiting 0. The config file cannot express it (`minimum: 1`),\n // but `makeJudge` is exported and takes a caller-supplied config.\n const configured = config.judge.concurrency;\n const concurrency =\n Number.isInteger(configured) && configured >= 1\n ? configured\n : config.defaults.concurrency;\n let index = 0;\n\n const judgeTarget = async (target: GraderTarget): Promise<EvalResult> => {\n const { plan, eval: ev } = target;\n const start = Date.now();\n const runsPerEval = runsFor(ev);\n // A provider the eval chose that cannot be had is that eval's error, as a\n // target it cannot serve is below: the rest of the corpus still gets its\n // verdicts, and the run exits 1 rather than stopping.\n let judgeProvider: InferenceProvider;\n try {\n judgeProvider = await providerFor(ev, plan.page.file);\n } catch (e) {\n if (!(e instanceof DocevalsError)) throw e;\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"error\",\n skipReason: e.message,\n durationMs: Date.now() - start,\n };\n }\n\n // Self-preference, compared against the model that judges *this eval*,\n // not the run's default: an eval naming its own provider or model is\n // exactly the case a run-wide comparison would miss. Said per page and\n // eval rather than deduplicated by model name, so a corpus with several\n // affected pages names each one instead of only the first. Marked on the\n // result too: a verdict formed under self-preference must not look\n // identical to any other in JSON, SARIF, JUnit or the HTML report.\n const preference = selfPreferenceOf(plan, ev, judgeProvider.modelName());\n if (preference) warn(`${plan.page.file}: ${preference.message}`);\n\n // Read what the eval asked to be graded. A target that cannot be served\n // errors here rather than falling back to the page body: a verdict about\n // the wrong bytes is worse than no verdict (ADR 01022).\n const selected = readTarget(ev.target, plan);\n if (!selected.ok) {\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"error\",\n skipReason: selected.reason,\n durationMs: Date.now() - start,\n };\n }\n\n // An HTML or XML body is the page's source, which is what deterministic\n // graders count lines in. The judge reads its text instead, tags dropped\n // and a Flare topic resolved, and `cleanBody`, which strips MDX, stays\n // off it (proposal 0125, decision 21). Every other page is read as it\n // always was, so its prompt and cache key are unchanged.\n const asText = selected.label === \"body\" && markupFormat(plan.page.absPath) !== undefined;\n let text = selected.text;\n if (asText) {\n try {\n text = await pageText(plan.page, (flare ??= flareRun(config.tools)));\n } catch (e) {\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"error\",\n skipReason: `the page could not be read as text: ${errorMessage(e)}`,\n durationMs: Date.now() - start,\n };\n }\n }\n\n // A page longer than the chunk budget is read in parts: each part\n // contributes the passages bearing on the assertion, and one judge then\n // answers the original question against the collection. Merging\n // per-part *verdicts* would be unsound — see EVIDENCE_SYSTEM_PROMPT.\n //\n // Content that fits skips this entirely and is judged exactly as before,\n // so the common path costs nothing and its cached verdicts stay valid.\n const chunks = splitBody(text, chunkChars);\n let judged = text;\n let judgedLabel = selected.label;\n\n // The key is built from what was *selected*, never from the evidence.\n // Evidence is model output: keying on it would change every run, so a\n // split page could never hit its cached verdict — and the committed docs\n // fixtures for long pages would be dead weight. The chunk budget rides\n // along because it decides how the page was read.\n const key = cacheKey(\n judgeProvider.provider(),\n judgeProvider.modelName(),\n runsPerEval,\n temperature,\n judgeCacheBody(chunkChars, text),\n ev,\n ev.readers?.section,\n );\n const cached = cache.get(key) !== undefined;\n\n // Gathering evidence costs one call per part, so it happens only on a\n // miss. A cached ensemble must make no inference call at all (ADR 01019).\n if (chunks.length > 1 && !cached) {\n const gathered: PartEvidence[] = [];\n for (const [i, chunk] of chunks.entries()) {\n if (maxTurns != null && turnsSpent >= maxTurns) {\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"skipped\",\n skipReason: `${turnBudgetSkipReason(maxTurns)} (after ${String(i)} of ${String(chunks.length)} parts)`,\n durationMs: Date.now() - start,\n };\n }\n turnsSpent += 1;\n try {\n const res = await judgeProvider.completeJSON({\n system: EVIDENCE_SYSTEM_PROMPT,\n user: buildEvidenceUser(ev, chunk, {\n index: i,\n total: chunks.length,\n }),\n schema: EVIDENCE_SCHEMA,\n temperature,\n });\n const json = res.json as Partial<PartEvidence>;\n gathered.push({\n supports: json.supports ?? [],\n contradicts: json.contradicts ?? [],\n });\n } catch (e) {\n // A part that could not be read leaves the collection incomplete,\n // and a verdict over incomplete evidence is exactly the silent\n // wrong answer this stage exists to avoid (ADR 01022).\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"error\",\n skipReason: `gathering evidence from part ${String(i + 1)} of ${String(chunks.length)} failed: ${errorMessage(e)}`,\n durationMs: Date.now() - start,\n };\n }\n }\n judged = renderEvidence(gathered, chunks.length);\n judgedLabel = `${selected.label}, ${String(chunks.length)} parts`;\n }\n\n // A cached ensemble makes no inference call, so it never touches the\n // budget — the docs corpus replays committed fixtures under any cap.\n // For an uncached one the turns are claimed *before* dispatching, which\n // is the whole point of counting turns rather than dollars: the claim is\n // synchronous, so two workers cannot both clear an almost-exhausted\n // budget and then both spend. See ADR 01019.\n if (maxTurns != null && !cached) {\n if (turnsSpent + runsPerEval > maxTurns) {\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome: \"skipped\",\n skipReason: turnBudgetSkipReason(maxTurns),\n durationMs: 0,\n };\n }\n // One turn per ensemble run. A run can make a second provider call\n // when the first response fails schema validation (the inference\n // layer retries once), so this is a floor on calls, not an exact\n // count — the cap is exact in *runs*, which is the unit the ensemble\n // is configured in.\n turnsSpent += runsPerEval;\n }\n\n const runs = await runEnsemble({\n provider: judgeProvider,\n system: JUDGE_SYSTEM_PROMPT,\n // Readers enter only this final call. Evidence gathering above quotes\n // what bears on the assertion, whoever reads it (proposal 0111).\n user: buildUserContent(ev, judged, judgedLabel, ev.readers?.section, !asText),\n runs: runsPerEval,\n temperature,\n schema: verdictSchema,\n cache,\n cacheKey: key,\n label: \"manni-docevals\",\n });\n\n const consensusBase = computeConsensus(runs);\n const zone = zoneFor(consensusBase, config.judge.zones);\n const consensus = { ...consensusBase, zone };\n\n let outcome: EvalResult[\"outcome\"] =\n zone === \"auto-pass\" ? \"pass\" : zone === \"auto-fail\" ? \"fail\" : \"needs-review\";\n let via: EvalResult[\"via\"];\n if (outcome === \"needs-review\") {\n const review = findReview(reviews, plan.page.file, ev.name, plan.page.body);\n if (review) {\n outcome = review.verdict;\n via = \"human-review\";\n }\n }\n\n return {\n evalName: ev.name,\n type: ev.type,\n grader: ev.grader,\n file: plan.page.file,\n outcome,\n ...(ev.readers === undefined ? {} : { personas: ev.readers.personas }),\n consensus,\n via,\n ...(preference\n ? { selfPreference: { axis: preference.axis, model: preference.model } }\n : {}),\n durationMs: Date.now() - start,\n };\n };\n\n // Simple bounded-concurrency pool across targets; runs within one eval\n // stay sequential (independent requests, no shared context).\n const workers = Array.from(\n { length: Math.min(concurrency, targets.length) },\n async () => {\n while (index < targets.length) {\n const i = index++;\n const target = targets[i];\n if (target === undefined) break;\n results[i] = await judgeTarget(target);\n }\n },\n );\n await Promise.all(workers);\n return results;\n };\n}\n","{\n \"$schema\": \"https://json-schema.org/draft/2020-12/schema\",\n \"$id\": \"manni:docevals:verdict\",\n \"title\": \"manni docevals judge verdict\",\n \"type\": \"object\",\n \"required\": [\"claim\", \"observed\", \"match\", \"confidence\", \"reasoning\"],\n \"properties\": {\n \"claim\": {\n \"type\": \"string\",\n \"description\": \"The specific documented assertion under evaluation.\"\n },\n \"observed\": {\n \"type\": \"string\",\n \"description\": \"What was actually observed in the page, quoting evidence where possible.\"\n },\n \"match\": {\n \"enum\": [\"pass\", \"fail\", \"partial\"],\n \"description\": \"pass only if the assertion is fully satisfied; partial for partial compliance.\"\n },\n \"confidence\": {\n \"type\": \"number\",\n \"minimum\": 0,\n \"maximum\": 1,\n \"description\": \"Self-reported confidence in this verdict.\"\n },\n \"reasoning\": {\n \"type\": \"string\",\n \"description\": \"Why this conclusion was reached.\"\n }\n },\n \"additionalProperties\": false\n}\n","/**\n * Persisted human reviews (Level 3 grading). `.manni/docevals/reviews.yaml` records\n * human verdicts for evals that landed in the human-review zone. A review\n * applies only while the page body it reviewed is unchanged (contentHash);\n * stale reviews silently return the eval to needs-review.\n */\nimport { existsSync, mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { parse as parseYaml, stringify as stringifyYaml } from \"yaml\";\nimport { sha256 } from \"../judge/cache.js\";\n\nexport interface ReviewEntry {\n file: string;\n evalName: string;\n /** sha256 of the page body at review time. */\n contentHash: string;\n verdict: \"pass\" | \"fail\";\n reviewer?: string;\n date?: string;\n note?: string;\n}\n\nexport const REVIEWS_PATH = join(\".manni/docevals\", \"reviews.yaml\");\n\nexport function loadReviews(root: string): ReviewEntry[] {\n const path = join(root, REVIEWS_PATH);\n if (!existsSync(path)) return [];\n const raw = parseYaml(readFileSync(path, \"utf8\")) as unknown;\n if (!Array.isArray(raw)) return [];\n return raw as ReviewEntry[];\n}\n\nexport function saveReviews(root: string, reviews: ReviewEntry[]): void {\n const path = join(root, REVIEWS_PATH);\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, stringifyYaml(reviews));\n}\n\n/** Record (or replace) a review for a (file, eval) pair. */\nexport function recordReview(root: string, entry: ReviewEntry): void {\n const reviews = loadReviews(root).filter(\n (r) => !(r.file === entry.file && r.evalName === entry.evalName),\n );\n reviews.push(entry);\n saveReviews(root, reviews);\n}\n\n/** Find the applicable (non-stale) review for a page body, if any. */\nexport function findReview(\n reviews: ReviewEntry[],\n file: string,\n evalName: string,\n body: string,\n): ReviewEntry | undefined {\n const entry = reviews.find(\n (r) => r.file === file && r.evalName === evalName,\n );\n if (!entry) return undefined;\n return entry.contentHash === sha256(body) ? entry : undefined;\n}\n\nexport { sha256 as contentHash };\n","/**\n * What the judge reads for an HTML or XML page's body (proposal 0125,\n * decision 21): the page's text, with its tags dropped.\n *\n * The page's `body` stays its source, because deterministic graders count\n * the file's lines in it. A model reads markup as noise, so the judge is\n * handed the text lint's parser finds instead. A Flare topic is parsed with\n * its project, so variables, snippets and conditions read as the target\n * builds them. The text is assembled the way `manni graph`'s search index\n * assembles a non-Markdown document's: each block's plain text, a blank line\n * between. Markdown and MDX never come here, so their prompts and cache keys\n * are what they were.\n */\nimport { extname } from \"node:path\";\nimport { parserForExtension } from \"../../lint/parsers/index.js\";\nimport { plainText } from \"../../lint/parsers/sectionize.js\";\nimport type { SectionNode } from \"../../lint/types.js\";\nimport type { FlareRun } from \"../../shared/flare/index.js\";\nimport type { PageFile } from \"../core/discover.js\";\n\n/** The page's text: each section's title and blocks, in document order. */\nexport async function pageText(page: PageFile, flare: FlareRun): Promise<string> {\n const parser = parserForExtension(extname(page.absPath));\n // A guard, not a path taken today: every markup format meta reads has a\n // lint parser too. A format without one would be judged as its source.\n if (parser === undefined) return page.body;\n const tree = await parser.parse(page.content, page.absPath, { absPath: page.absPath, flare });\n return sectionsText(tree.sections).join(\"\\n\\n\");\n}\n\nfunction sectionsText(sections: readonly SectionNode[]): string[] {\n return sections.flatMap((s) => [\n // A title made from the page's metadata is not in its body.\n ...(s.synthetic || s.title.trim() === \"\" ? [] : [s.title.trim()]),\n ...plainText(s.children),\n ...sectionsText(s.sections),\n ]);\n}\n","/**\n * Choosing the provider and model, and building the shared inference\n * library's `ProviderSpec` for it.\n *\n * The providers themselves live in `@hawkeyexl/inference` (ADR 01002). The\n * names a provider may have, the two refusals, the detection call, the\n * level-bound precedence and the mapping of the family's `providers:`\n * connection settings are `src/shared/providers.ts`, the same code\n * `manni meta fill` runs. What stays here is what only manni docevals can\n * decide: which levels it reads (a flag, an eval's own `provider:`/`model:`,\n * `docevals.provider`/`model`, then the family's `providers:`), and the\n * judge-shaped options a verdict call wants.\n */\nimport {\n makeProvider as makeInferenceProvider,\n type InferenceProvider,\n type ProviderName as ConcreteProvider,\n type ProviderSelector,\n type ProviderSpec,\n} from \"@hawkeyexl/inference\";\nimport { DocevalsError } from \"../types.js\";\nimport type { DocevalsConfig } from \"../core/config.js\";\nimport {\n assertKnownProvider,\n assertLocalFlag,\n assertModelHasProvider,\n localNotice,\n providerSpecFor as sharedProviderSpecFor,\n resolveIdentity,\n selectProvider as selectFromLevels,\n type ProviderChoice,\n type ProviderFlags,\n type ProviderSelection,\n} from \"../../shared/providers.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { noticeOnce } from \"../../shared/warn.js\";\n\nexport type { ProviderChoice, ProviderFlags, ProviderSelection };\n\n/** The key a docevals user writes, named by the refusal a bare model gets. */\nconst CONFIG_KEY = \"docevals.provider\";\n\nconst toDocevalsError = (message: string): Error => new DocevalsError(message);\n\n/**\n * The provider and model in force: a flag, then the eval's own choice, then\n * `docevals.provider`/`model`, then the family's `providers.provider`/`model`,\n * then `auto`. A model is carried only to the provider its own level names,\n * so an eval that names a different provider takes that provider's default\n * instead of a model it cannot run (`selectProvider` in the shared module).\n *\n * `--local` runs llama-cpp over all of them. A `--provider` it contradicts is\n * refused here, so no path selects past it. `ev.origin` names the eval in the\n * notice for a provider `--local` replaced; the caller knows its page.\n */\nexport function selectProvider(\n config: DocevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): ProviderSelection {\n assertLocalFlag(flags, toDocevalsError);\n return selectFromLevels(flags, [\n {\n ...(ev.provider !== undefined ? { provider: ev.provider } : {}),\n ...(ev.model !== undefined ? { model: ev.model } : {}),\n ...(ev.origin !== undefined ? { origin: ev.origin } : {}),\n },\n {\n ...(config.provider !== null ? { provider: config.provider } : {}),\n ...(config.model !== null ? { model: config.model } : {}),\n origin: CONFIG_KEY,\n },\n {\n ...(config.providers.provider !== undefined ? { provider: config.providers.provider } : {}),\n ...(config.providers.model !== undefined ? { model: config.providers.model } : {}),\n origin: \"providers.provider\",\n },\n ]);\n}\n\n/**\n * Say what `--local` set aside, once per source. Called where a selection is\n * about to be used, never where it is only checked, so a run that sends\n * nothing to a model says nothing.\n */\nexport function announceSelection(selection: ProviderSelection): void {\n const message = localNotice(selection);\n if (message !== undefined) noticeOnce(message);\n}\n\n/**\n * Refuse a selection that cannot be right, with `manni meta fill`'s messages:\n * an unknown name, or a model under `auto`. Both are `DocevalsError`s.\n */\nexport function assertProviderSelection(selection: ProviderSelection): void {\n assertKnownProvider(selection.provider, toDocevalsError);\n assertModelHasProvider(selection.provider, selection.model, CONFIG_KEY, toDocevalsError);\n}\n\n/**\n * The spec for a selection, with the family's connection settings for the\n * provider it names, and under `auto` the settings detection reads.\n */\nexport function providerSpecFor(\n config: DocevalsConfig,\n selection: { provider: ProviderSelector; model: string | null },\n): ProviderSpec {\n const spec = sharedProviderSpecFor(config.providers, selection);\n switch (selection.provider) {\n case \"anthropic\":\n // A verdict-shaped tool name steers the model better than a generic\n // one, and it is free to keep.\n return { ...spec, anthropic: { toolName: \"record_verdict\" } };\n case \"openai\":\n return { ...spec, openai: { schemaName: \"verdict\" } };\n default:\n return spec;\n }\n}\n\n/**\n * The concrete provider and model, WITHOUT constructing the provider: cache\n * keys need it, and a fully cached run must not require an API key.\n *\n * Under `auto` this is where detection runs, exactly as `manni meta fill` runs\n * it, seeing the same connection settings. The model is the RESOLVED one (the\n * provider's default when none was named, a llama-cpp tier's concrete\n * weights), so a library default that changes changes every cache key built\n * from it.\n */\nexport async function resolveProviderIdentity(\n config: DocevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): Promise<{ provider: ConcreteProvider; model: string }> {\n const selection = selectProvider(config, flags, ev);\n const { provider, model } = selection;\n assertKnownProvider(provider, toDocevalsError);\n assertModelHasProvider(provider, model, CONFIG_KEY, toDocevalsError);\n announceSelection(selection);\n return resolveIdentity(providerSpecFor(config, { provider, model: model ?? null }), toDocevalsError);\n}\n\n/** Construct a provider for an identity already resolved. */\nexport function constructProvider(\n config: DocevalsConfig,\n identity: { provider: ConcreteProvider; model: string },\n): InferenceProvider {\n try {\n return makeInferenceProvider(providerSpecFor(config, identity));\n } catch (e) {\n // The library raises its own InferenceError (missing API key). It must\n // surface as a DocevalsError: `run` degrades to deterministic-only evals on\n // a DocevalsError and rethrows anything else, and cli.ts fail() maps only\n // DocevalsError to exit 2. Letting a foreign error type through turns \"no\n // API key configured\" from a warning into an unhandled stack trace.\n throw new DocevalsError(errorMessage(e));\n }\n}\n\n/** Select, check, detect and construct: the provider a verb sends pages to. */\nexport async function makeProvider(\n config: DocevalsConfig,\n flags: ProviderFlags = {},\n ev: ProviderChoice = {},\n): Promise<InferenceProvider> {\n return constructProvider(config, await resolveProviderIdentity(config, flags, ev));\n}\n","/**\n * Script generation: turns a plain-language deterministic assertion (a\n * command-graded eval with no command) into a standalone Node .mjs check\n * script written parallel to the documentation, then persists the command\n * reference back into the frontmatter (or config) — no inline scripts.\n * Generation is single-shot: the output is code, verified by execution and\n * version-control review rather than ensemble consensus.\n */\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { basename, dirname, extname, join, relative, resolve } from \"node:path\";\nimport type { DocevalsConfig } from \"../core/config.js\";\nimport type {\n GenerateFn,\n GenerationRefusal,\n JudgeOptions,\n} from \"../core/engine.js\";\nimport { updateConfigEval, updatePageEval } from \"../core/frontmatter-edit.js\";\nimport {\n EVALS_KEY,\n EvalWriter,\n manifestEvalList,\n markupRefusal,\n updateManifestEval,\n type WriteHome,\n} from \"../core/write-location.js\";\nimport { sha256 } from \"../judge/cache.js\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport type { GraderTarget } from \"./types.js\";\nimport { DocevalsError } from \"../types.js\";\n\nexport const SCRIPTGEN_VERSION = 2;\n\nexport const SCRIPTGEN_SYSTEM_PROMPT = [\n \"You write small, self-contained Node.js check scripts that verify a\",\n \"deterministic assertion about a documentation page.\",\n \"\",\n \"Contract for every script:\",\n \"- ES module (.mjs) using only Node.js built-in modules. No dependencies.\",\n \"- The page's absolute path arrives as process.argv[2] (also MANNI_DOCEVALS_FILE).\",\n \"- Exit 0 when the assertion holds, 1 when it fails, 2 on operational error.\",\n \"- On failure, print a short human-readable reason to stderr.\",\n \"- Deterministic: no network access, no spawning processes, no randomness.\",\n \"- The page content may start with a YAML frontmatter block fenced by ---\",\n \" lines; account for it when checking body content.\",\n \"- Prefer simple, reviewable logic (regex/string checks) over cleverness.\",\n \"Respond with JSON: { \\\"code\\\": \\\"<the full script source>\\\" }.\",\n].join(\"\\n\");\n\nconst SCRIPT_SCHEMA = {\n type: \"object\",\n required: [\"code\"],\n properties: {\n code: { type: \"string\", minLength: 1 },\n notes: { type: \"string\" },\n },\n additionalProperties: false,\n} as const;\n\nexport function buildScriptgenUser(\n assertion: string,\n evalName: string,\n file: string,\n body: string,\n): string {\n // No cap. Generation produces one script, so there is nothing to merge and\n // splitting has no meaning here — but truncating was worse than either: a\n // script generated from the first 6000 characters expresses an assertion\n // about a page whose rest the model never read, and nothing downstream could\n // tell that from a script generated with full sight of it. If the body\n // overflows the model's context the call fails, and a failed generation is\n // already an errored result (ADR 01022) rather than a half-informed script.\n return [\n `# Assertion to check`,\n assertion,\n \"\",\n `# Eval name`,\n evalName,\n \"\",\n `# Page path`,\n file,\n \"\",\n \"# Current page content (for grounding — the script must express the\",\n \"# assertion generally, not hardcode this exact content)\",\n \"\",\n body,\n ].join(\"\\n\");\n}\n\nexport interface ScriptLocation {\n /** Absolute path the script file is written to. */\n scriptAbsPath: string;\n /** Command array persisted into the eval (path relative to its cwd). */\n command: string[];\n}\n\n/** Where a generated script lives and how the eval invokes it. */\nexport function scriptLocationFor(\n target: GraderTarget,\n config: DocevalsConfig,\n root: string,\n): ScriptLocation {\n const ev = target.eval;\n const page = target.plan.page;\n if (ev.source === \"page\") {\n const pageDir = dirname(page.absPath);\n const pattern = config.scripts.dir;\n const dir = pattern.includes(\"{docDir}\")\n ? pattern.replaceAll(\"{docDir}\", pageDir)\n : resolve(root, pattern);\n const base = basename(page.absPath, extname(page.absPath));\n const scriptAbsPath = join(dir, `${base}.${ev.name}.mjs`);\n const rel = relative(pageDir, scriptAbsPath).replace(/\\\\/g, \"/\");\n return { scriptAbsPath, command: [\"node\", rel, \"{file}\"] };\n }\n const dir = resolve(config.configDir, config.scripts.configDir);\n const scriptAbsPath = join(dir, `${ev.name}.mjs`);\n const rel = relative(config.configDir, scriptAbsPath).replace(/\\\\/g, \"/\");\n return { scriptAbsPath, command: [\"node\", rel, \"{file}\"] };\n}\n\nfunction header(assertion: string, evalName: string): string {\n return [\n \"// manni docevals generated check\",\n `// Eval: ${evalName}`,\n `// Assertion: ${assertion.replace(/\\s+/g, \" \").trim()}`,\n \"// Exit 0 = pass, 1 = fail, 2 = operational error.\",\n \"\",\n ].join(\"\\n\");\n}\n\nexport interface ScriptgenDeps {\n /**\n * The provider, or how to get one. A function is called only when a target\n * actually needs a script, so a run with nothing to generate never resolves\n * (and, under `auto`, never detects) a provider.\n */\n provider: InferenceProvider | (() => Promise<InferenceProvider>);\n root: string;\n}\n\n/** Build the engine's generation stage around a concrete provider. */\nexport function makeGenerateScripts(deps: ScriptgenDeps): GenerateFn {\n return async (\n targets: GraderTarget[],\n config: DocevalsConfig,\n _options: JudgeOptions,\n ) => {\n const generatedPaths: string[] = [];\n const refusals: GenerationRefusal[] = [];\n // Config-sourced evals generate once even when used by many pages.\n const doneConfigEvals = new Set<string>();\n let provider: InferenceProvider | undefined;\n // Proposal 0047: the command reference goes where the eval lives. Built\n // once per generation pass, and only when a page-sourced eval needs it.\n let writer: EvalWriter | undefined;\n const getWriter = (): EvalWriter => (writer ??= EvalWriter.for(config, deps.root, []));\n\n for (const target of targets) {\n const ev = target.eval;\n if (!ev.assertion) continue; // Nothing to generate from.\n if (ev.source === \"config\" && doneConfigEvals.has(ev.name)) continue;\n\n // Where the reference will be persisted, decided before the model is\n // asked: a page whose manifest has no entry for it can hold no command,\n // and paying for a script that cannot be referenced helps nobody.\n const page = target.plan.page;\n let home: WriteHome | undefined;\n if (ev.source === \"page\") {\n home = await getWriter().homeFor(\n page.file,\n page.frontmatter.data,\n EVALS_KEY,\n );\n if (home.kind === \"url\") {\n throw getWriter().urlRefusal(home, EVALS_KEY);\n }\n if (home.kind === \"no-entry\") {\n refusals.push({ file: page.file, evalName: ev.name, message: home.message });\n continue;\n }\n // The command reference cannot go onto markup (proposal 0125).\n const markup = home.kind === \"page\" ? markupRefusal(page) : undefined;\n if (markup !== undefined) throw markup;\n }\n\n if (provider === undefined) {\n try {\n provider =\n typeof deps.provider === \"function\" ? await deps.provider() : deps.provider;\n } catch (e) {\n // No provider for any target: say why once, and let the engine\n // report each eval it could not generate for.\n if (!(e instanceof DocevalsError)) throw e;\n return { generatedPaths, refusals, unavailable: e.message };\n }\n }\n\n const location = scriptLocationFor(target, config, deps.root);\n let code: string;\n try {\n const response = await provider.completeJSON({\n system: SCRIPTGEN_SYSTEM_PROMPT,\n user: buildScriptgenUser(\n ev.assertion,\n ev.name,\n target.plan.page.file,\n target.plan.page.body,\n ),\n schema: SCRIPT_SCHEMA,\n temperature: 0,\n });\n const json = response.json as { code?: unknown };\n if (typeof json.code !== \"string\" || json.code.length === 0) {\n continue; // Generation failed; the engine reports the eval as errored.\n }\n code = json.code;\n } catch {\n continue;\n }\n\n mkdirSync(dirname(location.scriptAbsPath), { recursive: true });\n writeFileSync(\n location.scriptAbsPath,\n // Exactly one final newline, whatever the model sent: the script is\n // committed and reviewed, and a missing one shows in every diff.\n `${header(ev.assertion, ev.name)}${code.trim()}\\n`,\n );\n generatedPaths.push(\n relative(deps.root, location.scriptAbsPath).replace(/\\\\/g, \"/\"),\n );\n\n const updates = {\n command: location.command,\n \"generated-assertion-hash\": sha256(ev.assertion),\n };\n if (ev.source === \"page\" && home?.kind === \"manifest\") {\n // The evals live in the manifest, so the command reference does too:\n // the one entry is rewritten and no other byte of the file changes.\n const at = getWriter();\n const list = manifestEvalList(\n await at.readManifest(home, EVALS_KEY),\n home.file,\n home.entry,\n );\n const next = updateManifestEval(list, ev.name, updates);\n if (next === undefined) {\n throw new DocevalsError(\n `${home.file}: eval \"${ev.name}\" not found in the entry for ${home.entry}`,\n );\n }\n await at.writeManifest(home, EVALS_KEY, next);\n } else if (ev.source === \"page\") {\n const abs = page.absPath;\n const updated = updatePageEval(\n readFileSync(abs, \"utf8\"),\n page.file,\n ev.name,\n updates,\n );\n writeFileSync(abs, updated);\n } else {\n const updated = updateConfigEval(\n readFileSync(config.configPath, \"utf8\"),\n config.configPath,\n ev.name,\n updates,\n );\n writeFileSync(config.configPath, updated);\n doneConfigEvals.add(ev.name);\n }\n\n // Mutate the in-memory eval so this run executes the fresh script.\n if (ev.source === \"config\") {\n // A config-sourced eval appears once per page; every target shares\n // the same central definition and script.\n for (const t of targets) {\n if (t.eval.name === ev.name && t.eval.source === \"config\") {\n t.eval.command = scriptLocationFor(t, config, deps.root).command;\n t.eval.generatedAssertionHash =\n updates[\"generated-assertion-hash\"];\n }\n }\n } else {\n // Page-sourced evals are per-page: same-named inline evals on other\n // pages have their own assertions and generate independently.\n target.eval.command = location.command;\n target.eval.generatedAssertionHash = updates[\"generated-assertion-hash\"];\n }\n }\n return { generatedPaths, refusals };\n };\n}\n","/**\n * Surgical YAML edits. Only the frontmatter block (or the named config eval)\n * is re-serialized via the `yaml` Document API — the page body is carried\n * over byte-for-byte, and untouched YAML keeps its comments and ordering.\n * YAML frontmatter only; TOML/JSON frontmatter cannot be edited in place.\n */\nimport { parseDocument, Document, YAMLMap, YAMLSeq, isMap, isScalar } from \"yaml\";\nimport { DocevalsError } from \"../types.js\";\nimport { leadingFrontmatterFormat } from \"./discover.js\";\n\n/** Top-level key manni docevals owns inside the shared manni config. */\nconst NAMESPACE = \"docevals\";\n\n/** The byte-order mark a page may open with, carried through edits untouched. */\nconst BOM = \"\\uFEFF\";\n\nexport interface EvalUpdates {\n grader?: string;\n command?: string[];\n /** sha256 of the assertion at generation time; flat, per the vocabulary. */\n \"generated-assertion-hash\"?: string;\n}\n\ninterface Split {\n /** The opening fence line including its newline. */\n open: string;\n /** Raw YAML between the fences. */\n block: string;\n /** Everything from the closing fence to EOF, byte-identical. */\n suffix: string;\n /** Line ending style of the file. */\n eol: \"\\n\" | \"\\r\\n\";\n}\n\nfunction splitYamlFrontmatter(content: string, path: string): Split {\n const bom = content.startsWith(BOM) ? BOM : \"\";\n const body = bom ? content.slice(1) : content;\n const openMatch = /^---(\\r?\\n)/.exec(body);\n if (!openMatch) {\n throw new DocevalsError(\n `${path}: no YAML frontmatter block to edit (only YAML frontmatter is editable)`,\n );\n }\n const eol: \"\\n\" | \"\\r\\n\" = openMatch[1] === \"\\r\\n\" ? \"\\r\\n\" : \"\\n\";\n // Keep line endings. The match above guarantees an opening line.\n const [openLine = \"\", ...rest] = body.split(/(?<=\\n)/);\n let offset = openLine.length;\n for (const line of rest) {\n const stripped = line.replace(/\\r?\\n$/, \"\");\n if (stripped === \"---\" || stripped === \"...\") {\n const blockEnd = offset;\n return {\n open: bom + openLine,\n block: body.slice(openLine.length, blockEnd),\n suffix: body.slice(blockEnd),\n eol,\n };\n }\n offset += line.length;\n }\n throw new DocevalsError(`${path}: unterminated frontmatter block`);\n}\n\nfunction applyUpdates(\n doc: Document,\n node: YAMLMap,\n updates: EvalUpdates,\n): void {\n if (updates.grader !== undefined) node.set(\"grader\", updates.grader);\n if (updates.command !== undefined) {\n const seq = doc.createNode(updates.command) as YAMLSeq;\n seq.flow = true; // [\"node\", \"script.mjs\", \"{file}\"] on one line\n node.set(\"command\", seq);\n }\n const hash = updates[\"generated-assertion-hash\"];\n if (hash !== undefined) node.set(\"generated-assertion-hash\", hash);\n}\n\n/**\n * The eval list. `evals` is the list itself, or the single-assertion string\n * shorthand — which has no map node to edit, so it is not a sequence here.\n */\nfunction evalSeq(doc: Document): YAMLSeq | undefined {\n const node = doc.get(\"evals\", true);\n return node instanceof YAMLSeq ? node : undefined;\n}\n\nfunction findEvalNode(\n doc: Document,\n evalName: string,\n): YAMLMap | undefined {\n const evals = evalSeq(doc);\n if (!evals) return undefined;\n for (const item of evals.items) {\n if (isMap(item)) {\n const name = item.get(\"id\") ?? item.get(\"use\");\n if (name === evalName) return item;\n }\n }\n return undefined;\n}\n\n/**\n * Update an inline eval in a page's YAML frontmatter. Returns the new file\n * content; the body after the closing fence is byte-identical to the input.\n */\nexport function updatePageEval(\n content: string,\n path: string,\n evalName: string,\n updates: EvalUpdates,\n): string {\n const { open, block, suffix, eol } = splitYamlFrontmatter(content, path);\n const doc = parseDocument(block);\n if (doc.errors.length > 0) {\n throw new DocevalsError(\n `${path}: cannot edit frontmatter — ${doc.errors[0]?.message ?? \"parse error\"}`,\n );\n }\n const node = findEvalNode(doc, evalName);\n if (!node) {\n throw new DocevalsError(\n `${path}: eval \"${evalName}\" not found in frontmatter`,\n );\n }\n applyUpdates(doc, node, updates);\n let newBlock = doc.toString();\n if (eol === \"\\r\\n\") newBlock = newBlock.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return open + newBlock + suffix;\n}\n\n/**\n * Update a named eval in manni.config.yaml text.\n *\n * The eval library lives under the tool's own namespace — `manni.config.yaml`\n * is shared across the manni family. Navigating to a root `evals:` finds\n * nothing in a real config, so generation for a config-sourced eval failed\n * with \"eval not found in config\" against every file the loader accepts.\n */\nexport function updateConfigEval(\n configText: string,\n configPath: string,\n evalName: string,\n updates: EvalUpdates,\n): string {\n const doc = parseDocument(configText);\n if (doc.errors.length > 0) {\n throw new DocevalsError(\n `${configPath}: cannot edit config — ${doc.errors[0]?.message ?? \"parse error\"}`,\n );\n }\n const node = doc.getIn([NAMESPACE, \"evals\", evalName]);\n if (!isMap(node)) {\n throw new DocevalsError(\n `${configPath}: eval \"${evalName}\" not found in config`,\n );\n }\n applyUpdates(doc, node, updates);\n return doc.toString();\n}\n\nexport interface NewEvalEntry {\n /** Kebab-case id. Required on object entries — position-derived names\n * orphan cached verdicts whenever entries move. */\n id: string;\n assertion: string;\n type?: string;\n grader?: string;\n evidence?: string;\n examples?: { pass?: string | string[]; fail?: string | string[] };\n severity?: string;\n}\n\n/**\n * Ordered plain object for a new inline eval, with undefined fields dropped.\n * Exported because an eval whose location puts it in a manifest is written as\n * this same object, spliced into the page's entry rather than appended here.\n */\nexport function entryObject(entry: NewEvalEntry): Record<string, unknown> {\n const obj: Record<string, unknown> = { id: entry.id, assertion: entry.assertion };\n if (entry.type !== undefined) obj.type = entry.type;\n if (entry.grader !== undefined) obj.grader = entry.grader;\n if (entry.evidence !== undefined) obj.evidence = entry.evidence;\n if (entry.examples !== undefined) obj.examples = entry.examples;\n if (entry.severity !== undefined) obj.severity = entry.severity;\n return obj;\n}\n\n/** The page-level key `fill` records machine-proposed evals in (proposal 0046). */\nconst META_PROVENANCE_KEY = \"meta-provenance\";\n\nfunction assertNoCollision(seq: YAMLSeq, name: string, path: string): void {\n for (const item of seq.items) {\n const existing = isMap(item)\n ? item.get(\"id\") ?? item.get(\"use\")\n : isScalar(item)\n ? item.value\n : undefined;\n if (existing === name) {\n throw new DocevalsError(\n `${path}: eval \"${name}\" already exists in frontmatter`,\n );\n }\n }\n}\n\n/**\n * Append inline evals to a page's YAML frontmatter, creating the `evals` key\n * — or the frontmatter block itself — when missing. The body stays\n * byte-identical; existing evals are never modified or reordered.\n *\n * `metaProvenance`, when given, is the page's whole `meta-provenance` list with\n * the new evals already merged in, written in the same edit. The merge is the\n * caller's, as `manni meta fill`'s is, so both tools record attribution one\n * way.\n */\nexport function appendPageEvals(\n content: string,\n path: string,\n entries: NewEvalEntry[],\n metaProvenance?: readonly unknown[],\n): string {\n const format = leadingFrontmatterFormat(content);\n if (format === \"toml\" || format === \"json\") {\n // Synthesizing a YAML block here would leave the page with two\n // frontmatter blocks. Only YAML frontmatter can be edited in place.\n throw new DocevalsError(\n `${path}: only YAML frontmatter can be edited (found ${format} frontmatter)`,\n );\n }\n\n const bom = content.startsWith(BOM) ? BOM : \"\";\n const stripped = bom ? content.slice(1) : content;\n const eol: \"\\n\" | \"\\r\\n\" = stripped.includes(\"\\r\\n\") ? \"\\r\\n\" : \"\\n\";\n\n if (format === undefined) {\n // No frontmatter: synthesize a block above the untouched body.\n const doc = new Document(\n entries.length === 0 ? {} : { evals: entries.map(entryObject) },\n );\n if (metaProvenance) doc.set(META_PROVENANCE_KEY, doc.createNode(metaProvenance));\n let block = doc.toString();\n if (eol === \"\\r\\n\") block = block.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return `${bom}---${eol}${block}---${eol}${stripped}`;\n }\n\n const { open, block, suffix, eol: blockEol } = splitYamlFrontmatter(content, path);\n const doc = parseDocument(block);\n if (doc.errors.length > 0) {\n throw new DocevalsError(\n `${path}: cannot edit frontmatter — ${doc.errors[0]?.message ?? \"parse error\"}`,\n );\n }\n\n // Nothing to append: the evals of this page went to the manifest that owns\n // them, and only `meta-provenance` is left for the page. Creating an empty\n // `evals:` here would put the key in both places, which is exactly the\n // collision routing the write exists to avoid.\n if (entries.length === 0) {\n if (metaProvenance) doc.set(META_PROVENANCE_KEY, doc.createNode(metaProvenance));\n let onlyEntry = doc.toString();\n if (blockEol === \"\\r\\n\") onlyEntry = onlyEntry.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return open + onlyEntry + suffix;\n }\n\n let seq = evalSeq(doc);\n if (!seq) {\n const node = doc.get(\"evals\", true);\n if (node !== undefined) {\n // A single-assertion string, or something else entirely. Appending would\n // have to rewrite the existing declaration, which is the caller's call to\n // make, not a silent side effect of adding one eval.\n throw new DocevalsError(\n `${path}: the evals key in frontmatter is not a list — expand the ` +\n `string shorthand into a list before appending`,\n );\n }\n seq = doc.createNode([]);\n doc.set(\"evals\", seq);\n }\n for (const entry of entries) {\n assertNoCollision(seq, entry.id, path);\n seq.add(doc.createNode(entryObject(entry)));\n }\n if (metaProvenance) doc.set(META_PROVENANCE_KEY, doc.createNode(metaProvenance));\n let newBlock = doc.toString();\n if (blockEol === \"\\r\\n\") newBlock = newBlock.replace(/(?<!\\r)\\n/g, \"\\r\\n\");\n return open + newBlock + suffix;\n}\n\n/** True when the eval exists as an editable (map) entry in the frontmatter. */\nexport function hasEditableEval(content: string, evalName: string): boolean {\n try {\n const { block } = splitYamlFrontmatter(content, \"\");\n const doc = parseDocument(block);\n return findEvalNode(doc, evalName) !== undefined;\n } catch {\n return false;\n }\n}\n\n/** Used by promote: check a string-shorthand eval entry (not editable in place). */\nexport function isScalarEvalEntry(content: string, evalName: string): boolean {\n try {\n const { block } = splitYamlFrontmatter(content, \"\");\n const doc = parseDocument(block);\n const evals = evalSeq(doc);\n if (!evals) return false;\n return evals.items.some((i) => isScalar(i) && i.value === evalName);\n } catch {\n return false;\n }\n}\n","/**\n * Where docevals writes each key it owns (proposal 0047, §3 and §4).\n *\n * Chunk 1 made reading follow a key's location: a manifest that owns `evals`\n * supplies them, and everything downstream sees them as the page's own. A\n * tool that reads that way and writes to the page anyway puts the value in\n * two places at once, which `meta validate` then reports as an\n * `external:owned` collision on every page it touched.\n *\n * So every write goes through the rule `manni meta fill` already follows:\n *\n * - a **local manifest** of one of the page's collections owns the key: the\n * value is spliced into the page's entry there, and nothing else in the\n * file changes;\n * - the manifest **joins on a field the page lacks**: there is no entry to\n * hold the value, and the write is refused for that file, in meta's own\n * sentence;\n * - a **URL manifest** owns it: nothing can be written to a fetched file,\n * and for an eval key that is the refusal chunk 1 already makes at load;\n * - **no manifest owns it**: the page keeps it, with the offer (P1) and the\n * warnings (W1, W2) meta's writers use when the schema prefers external\n * metadata.\n *\n * The rule is meta's, and so is every helper that decides it: `keyHome`,\n * `offerExternalHomes`, `externalWriteWarnings` and `spliceManifestValue`,\n * all reached through `src/meta/internal.ts`. What is docevals' own is the\n * preference, which comes from the evals vocabulary rather than a validator:\n * the vocabulary this tool implements marks its three keys, so the answer is\n * in the schema docevals already bundles.\n */\nimport { resolve } from \"node:path\";\nimport {\n LOCATION_KEYWORD,\n Validator,\n writeFileAtomic,\n} from \"../../meta/index.js\";\nimport {\n externalWriteWarnings,\n keyHome,\n offerExternalHomes,\n readManifestValue,\n spliceManifestValue,\n type ExternalWrite,\n type ProposedHome,\n type RelocateResult,\n type RelocationContext,\n} from \"../../meta/internal.js\";\nimport { readManifestOrEmpty } from \"../../shared/manifest-cas.js\";\nimport type { Confirm } from \"../../shared/prompt.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { DocevalsError } from \"../types.js\";\nimport { frontmatterSchema } from \"../schema.js\";\nimport type { DocevalsConfig } from \"./config.js\";\nimport { markupFormat, type PageFile } from \"./discover.js\";\nimport { urlManifestRefusal } from \"./external.js\";\n\n/** The page key holding the eval list, the one docevals appends to and edits. */\nexport const EVALS_KEY = \"evals\";\n\n/** The key `fill` records machine-proposed evals in (proposal 0046). */\nexport const META_PROVENANCE_KEY = \"meta-provenance\";\n\n/**\n * Whether `manni:evals:1.0.0` marks `key` as belonging in external metadata.\n *\n * Read from the bundled vocabulary rather than from a resolved schema set.\n * Every docevals page is validated against it (`core/resolve.ts`), so it is\n * the schema that governs these keys, and a preference read from it cannot\n * disagree with the one `meta validate` reads. A key it does not mark stays\n * on the page with no warning.\n */\nexport function prefersExternal(key: string): boolean {\n const properties = frontmatterSchema.properties;\n if (typeof properties !== \"object\" || properties === null) return false;\n const property = (properties as Record<string, unknown>)[key];\n if (typeof property !== \"object\" || property === null) return false;\n return (property as Record<string, unknown>)[LOCATION_KEYWORD] === \"external\";\n}\n\n/** Where one key of one page goes. */\nexport type WriteHome =\n /** The page's own frontmatter. `proposed` is the home relocation would give it. */\n | { kind: \"page\"; prefersExternal: boolean; proposed: ProposedHome }\n /** The page's entry in a local manifest. */\n | {\n kind: \"manifest\";\n /** As the run reports it. */\n file: string;\n absPath: string;\n /** `path`, or the page field the manifest joins on. */\n join: string;\n entry: string;\n /**\n * The manifest is the page's own, resolved from a `{page}` pattern\n * (proposal 0058). It may not exist yet: the first write creates it,\n * and a read of it before then holds nothing.\n */\n perPage: boolean;\n }\n /** A manifest joins on a field this page does not carry. */\n | { kind: \"no-entry\"; message: string }\n /** A URL manifest owns the key; nothing fetched can be written. */\n | { kind: \"url\"; collection: string; file: string };\n\n/** meta's sentence for a page a joined manifest has no entry for. */\nexport function noEntryMessage(\n label: string,\n join: string,\n file: string,\n key: string,\n): string {\n return `${label} carries no ${join}, which ${file} joins on, so its ${key} has no entry there.`;\n}\n\n/**\n * The refusal for an eval write that would land on an HTML or XML page itself\n * (proposal 0125, decision 21). Its metadata is markup, so a YAML block above\n * it would corrupt it; the evals belong in a manifest. `undefined` for a page\n * in any other format, which keeps the key.\n */\nexport function markupRefusal(page: Pick<PageFile, \"file\" | \"absPath\">): DocevalsError | undefined {\n const format = markupFormat(page.absPath);\n if (format === undefined) return undefined;\n return new DocevalsError(\n `${page.file} is ${format}, so its evals live in a manifest. Give its collection an externalMetadata entry that owns evals.`,\n );\n}\n\n/** What `offer` reports back while it asks. */\nexport interface OfferHooks {\n confirm: Confirm;\n onNotice?: (message: string) => void;\n onRelocated?: (result: RelocateResult) => void;\n}\n\n/**\n * The run's writer: where each key goes, and the manifest splices that put it\n * there. One per run, because the relocation context it reads is the config\n * as the run found it, and an accepted offer changes that config.\n */\nexport class EvalWriter {\n private readonly landed: ExternalWrite[] = [];\n\n private constructor(\n private readonly ctx: RelocationContext,\n private readonly configSource: string,\n ) {}\n\n /**\n * Build the writer for a run. `targets` are the positional paths as typed,\n * which is where a page in no collection gets its proposed home from; a run\n * that took its paths from the collections passes none.\n *\n * The context is built from the config docevals already loaded rather than\n * by loading it again through meta. A `manni.config.yaml` carrying only a\n * `docevals:` key is a single-tool file to the metadata tool, which refuses\n * it; docevals reads it every run, and where its own evals go cannot depend\n * on whether a sibling can read the same file. The collections are the\n * declared ones, since a page named by path is still a member of whatever\n * contains it. `config: null` leaves the page's schema set to the page,\n * which is enough: the keys this writer homes are named outright in the\n * relocation it plans.\n */\n static for(\n config: DocevalsConfig,\n cwd: string,\n targets: readonly string[],\n ): EvalWriter {\n const noConfig = config.configSource === null;\n const collections = config.collections;\n return new EvalWriter(\n {\n cwd,\n // Page labels are relative to the run's discovery root, so a manifest\n // path this writer reports is spelled against the same directory\n // `core/external.ts` reports a merged value's source against.\n base: cwd,\n noConfig,\n config: null,\n ...(noConfig ? {} : { configDir: config.configDir, configPath: config.configPath }),\n collections,\n declaredCollections: collections,\n targets,\n validator: new Validator(),\n },\n config.configSource ?? cwd,\n );\n }\n\n /** Where `key` of the page labelled `label` goes. `data` is its metadata. */\n async homeFor(\n label: string,\n data: Readonly<Record<string, unknown>>,\n key: string,\n ): Promise<WriteHome> {\n const home = await keyHome(this.ctx, label, data, key);\n if (home.kind === \"url\") {\n return { kind: \"url\", collection: home.collection, file: home.file };\n }\n if (home.kind === \"manifest\") {\n if (home.entry === undefined) {\n return {\n kind: \"no-entry\",\n message: noEntryMessage(label, home.join, home.file, key),\n };\n }\n return {\n kind: \"manifest\",\n file: home.file,\n absPath: home.absPath,\n join: home.join,\n entry: home.entry,\n perPage: home.perPage,\n };\n }\n return { kind: \"page\", prefersExternal: prefersExternal(key), proposed: home.home };\n }\n\n /**\n * The refusal for an eval key a URL manifest owns, in chunk 1's wording. A\n * run reaches it only where the load-time refusal could not: a manifest\n * declared for a collection whose pages this run never merged.\n */\n urlRefusal(home: { collection: string }, key: string): DocevalsError {\n return new DocevalsError(urlManifestRefusal(this.configSource, home.collection, key));\n }\n\n /** Record that `key` stayed on the page, for the W1 and W2 lines. */\n stayedOnPage(label: string, key: string, proposed: ProposedHome): void {\n this.landed.push({ label, key, home: proposed });\n }\n\n /** The W1 and W2 lines for everything that stayed on a page. Without the prefix. */\n warnings(dryRun: boolean): string[] {\n return this.landed.length === 0 ? [] : externalWriteWarnings(this.landed, dryRun);\n }\n\n /**\n * Ask P1 once per collection the flagged writes would be homed in. Returns\n * true when a relocation was applied, which leaves the caller's config,\n * pages and this writer stale: rebuild all three before writing.\n */\n async offer(writes: readonly ExternalWrite[], hooks: OfferHooks): Promise<boolean> {\n if (writes.length === 0) return false;\n const applied = await offerExternalHomes(this.ctx, writes, hooks);\n return applied.size > 0;\n }\n\n /** The value the manifest holds for this page's entry, or `undefined`. */\n async readManifest(\n home: { absPath: string; entry: string; join: string; perPage: boolean },\n key: string,\n ): Promise<unknown> {\n return readManifestValue(await this.text(home.absPath, home.perPage), {\n entry: home.entry,\n key,\n join: home.join,\n });\n }\n\n /** Write `value` into this page's entry, changing no other byte of the file. */\n async writeManifest(\n home: { absPath: string; entry: string; join: string; file: string; perPage: boolean },\n key: string,\n value: unknown,\n ): Promise<void> {\n const text = await this.text(home.absPath, home.perPage);\n let spliced: string;\n try {\n spliced = spliceManifestValue(text, {\n entry: home.entry,\n key,\n value,\n join: home.join,\n file: home.file,\n }).text;\n } catch (e) {\n // meta's refusal, in this tool's error class, exactly as cite reports it.\n throw new DocevalsError(errorMessage(e));\n }\n // A per-page manifest may be the first file in its directory.\n if (spliced !== text) {\n await writeFileAtomic(home.absPath, spliced, { createParents: true });\n }\n }\n\n /**\n * The manifest's bytes. A per-page manifest that is not on disk yet is a\n * page with nothing recorded, held as empty text and created by the write,\n * exactly as `manni meta fill` holds one. A missing concrete manifest is\n * refused, as it always was.\n */\n private async text(absPath: string, perPage: boolean): Promise<string> {\n try {\n return await readManifestOrEmpty(absPath, perPage);\n } catch (e) {\n throw new DocevalsError(\n `${resolve(absPath)} could not be read: ${errorMessage(e)}`,\n );\n }\n }\n}\n\n/**\n * The eval list a manifest holds, as a list. An entry whose `evals` is a\n * string shorthand, or anything else, is refused rather than rewritten: the\n * page's own shorthand is refused the same way, and expanding one is the\n * author's call rather than a silent side effect of adding an eval.\n */\nexport function manifestEvalList(value: unknown, file: string, entry: string): unknown[] {\n if (value === undefined || value === null) return [];\n if (Array.isArray(value)) return [...(value as readonly unknown[])];\n throw new DocevalsError(\n `${file}: the evals key of ${entry} is not a list — expand the string ` +\n `shorthand into a list before appending`,\n );\n}\n\n/** The updates `generate` and `promote` persist onto one eval entry. */\nexport interface ManifestEvalUpdates {\n grader?: string;\n command?: string[];\n \"generated-assertion-hash\"?: string;\n}\n\n/**\n * Apply `updates` to the entry named `name` in a manifest's eval list, and\n * return the new list. `undefined` when the list holds no such entry, which\n * is a caller's refusal rather than a silent no-op.\n */\nexport function updateManifestEval(\n list: readonly unknown[],\n name: string,\n updates: ManifestEvalUpdates,\n): unknown[] | undefined {\n const index = list.findIndex((item) => named(item) === name);\n const held = index === -1 ? undefined : list[index];\n if (held === undefined) return undefined;\n // Only the fields actually being set. An `undefined` in the value would be\n // dropped on the way to YAML and then fail the splice's read-back, which\n // compares what it wrote against what the file now holds.\n const set: Record<string, unknown> = { ...(held as Record<string, unknown>) };\n if (updates.grader !== undefined) set.grader = updates.grader;\n if (updates.command !== undefined) set.command = updates.command;\n const hash = updates[\"generated-assertion-hash\"];\n if (hash !== undefined) set[\"generated-assertion-hash\"] = hash;\n const next = [...list];\n next[index] = set;\n return next;\n}\n\n/** The id a manifest's eval entry answers to, or `undefined` for a shorthand. */\nfunction named(item: unknown): string | undefined {\n if (typeof item !== \"object\" || item === null || Array.isArray(item)) return undefined;\n const entry = item as Record<string, unknown>;\n const id = entry.id ?? entry.use;\n return typeof id === \"string\" ? id : undefined;\n}\n","/**\n * `manni docevals run` — execute the full pipeline. Deterministic graders run\n * first (cheap-first ordering); the AI judge stage runs when a provider is\n * available and not disabled.\n */\nimport { runEvals, type EngineReport, type JudgeFn, type RunOptions } from \"../core/engine.js\";\nimport { loadRunConfig, type DocevalsConfig } from \"../core/config.js\";\nimport { runConfigOptions, type DocumentInputOptions } from \"../core/discover.js\";\nimport { render, type ReportFormat } from \"../reporters/index.js\";\nimport { makeJudge } from \"../judge/judge.js\";\nimport {\n assertProviderSelection,\n makeProvider,\n selectProvider,\n} from \"../judge/provider.js\";\nimport type { InferenceProvider } from \"@hawkeyexl/inference\";\nimport { makeGenerateScripts } from \"../graders/scriptgen.js\";\nimport type { GenerateFn } from \"../core/engine.js\";\nimport { DocevalsError } from \"../types.js\";\nimport {\n isExecutionGrant,\n unknownGrantsMessage,\n type ExecutionGrant,\n} from \"../../shared/execution.js\";\nimport { warn } from \"../../shared/warn.js\";\n\nexport interface RunCommandOptions extends DocumentInputOptions {\n format?: ReportFormat;\n deterministicOnly?: boolean;\n aiOnly?: boolean;\n /**\n * Run only these execution grants, of those the config holds. Absent keeps\n * every grant `execution.allow` holds, which is every grant by default.\n */\n allowExecution?: string[];\n /** `false` clears every grant for this run. */\n execution?: boolean;\n generate?: boolean;\n cache?: boolean;\n failOnReview?: boolean;\n provider?: string;\n model?: string;\n /** Run inference on this machine, with llama-cpp, over any configured or eval-level provider. */\n local?: boolean;\n runs?: number;\n chunkChars?: number;\n maxTurns?: number;\n evalNames?: string[];\n suite?: string;\n /** Evaluate only pages that differ between this git ref and HEAD (ADR 01040). */\n since?: string;\n /**\n * Evaluate only pages whose file or eval manifest changed within this\n * duration back from now, such as `7d`. With `since`, a page must satisfy both.\n */\n newerThan?: string;\n baseline?: string | boolean;\n writeBaseline?: string | boolean;\n toolVersion?: string;\n cwd?: string;\n}\n\n/**\n * Grants, checked rather than asserted.\n *\n * The CLI validates in `collectGrant`, but this is also the entry point for\n * programmatic callers. An unknown grant that silently matched nothing would\n * narrow the run to no grant at all: every command eval skipped, exit 0, which\n * reads as a clean corpus rather than a misspelled grant.\n */\nfunction asGrants(values: string[] | undefined): ExecutionGrant[] | undefined {\n if (values === undefined) return undefined;\n const unknown = values.filter((v) => !isExecutionGrant(v));\n if (unknown.length > 0) {\n throw new DocevalsError(unknownGrantsMessage(unknown));\n }\n return values as ExecutionGrant[];\n}\n\nexport async function runRun(\n paths: string[],\n options: RunCommandOptions = {},\n engineOverrides: Partial<RunOptions> = {},\n): Promise<EngineReport> {\n const cwd = options.cwd ?? process.cwd();\n const judgeOptions = {\n provider: options.provider,\n model: options.model,\n local: options.local,\n runs: options.runs,\n chunkChars: options.chunkChars,\n noCache: options.cache === false,\n maxTurns: options.maxTurns ?? null,\n };\n\n // Loaded once and passed through to the engine — a run must not validate\n // the config twice or observe two different versions of it.\n const config: DocevalsConfig = loadRunConfig(runConfigOptions(paths, options), cwd);\n\n // A selection that cannot be right is a usage error, exit 2, whatever else\n // the run was asked to do: an unknown name or a model with no provider to\n // own it is a typo to fix, not a missing provider to degrade around.\n assertProviderSelection(selectProvider(config, judgeOptions));\n\n // Build the judge and generation stages unless deterministic-only or an\n // override supplies them. Both share one provider, resolved at most once.\n let judge: JudgeFn | undefined;\n let generateScripts: GenerateFn | undefined;\n let resolving: Promise<InferenceProvider> | undefined;\n const provider = (): Promise<InferenceProvider> =>\n (resolving ??= makeProvider(config, judgeOptions));\n // Per key, not per pair: an override supplying `judge` but not\n // `generateScripts` used to resolve a provider and build a judge that the\n // spread below then threw away.\n const wantsJudge = !(\"judge\" in engineOverrides);\n const wantsGeneration = !(\"generateScripts\" in engineOverrides);\n if (wantsJudge || wantsGeneration) {\n if (!options.deterministicOnly) {\n try {\n const resolved = await provider();\n if (wantsJudge) judge = makeJudge({ provider: resolved, root: cwd });\n if (wantsGeneration && options.generate !== false) {\n generateScripts = makeGenerateScripts({ provider: resolved, root: cwd });\n }\n } catch (e) {\n if (options.aiOnly || !(e instanceof DocevalsError)) throw e;\n // The warning is about the *judge*, and only the judge (ADR 01043).\n //\n // It used to read `|| options.generate === true`, meaning to fire when\n // generation had been explicitly requested. Commander cannot express\n // that: there is no `--generate` flag, so it defaults a `--no-generate`\n // key to `true` and the clause held on every invocation that was not\n // `--no-generate`. The only silent combination was the accidental\n // `--deterministic-only --no-generate`, and the standard no-key CI run\n // warned about the provider it had just been told to skip.\n warn(`provider unavailable — ${e.message}. Running deterministic evals only.`);\n }\n } else if (wantsGeneration && options.generate !== false) {\n // No judge, so the provider is wanted only if the corpus holds a command\n // eval with no command, which is not knowable here. It is resolved when\n // generation first needs it, so a deterministic run never detects a\n // provider — never probes the machine, never spawns the Claude CLI — to\n // generate nothing. Generation's own need for a provider it cannot have\n // is reported by the engine, where it is, as an `error` result naming\n // the eval and exiting 1.\n generateScripts = makeGenerateScripts({ provider, root: cwd });\n }\n }\n\n return runEvals({\n judge,\n generateScripts,\n config,\n configPath: options.config,\n noConfig: options.noConfig,\n paths,\n collection: options.collection,\n exclude: options.exclude,\n cwd: options.cwd,\n deterministicOnly: options.deterministicOnly,\n aiOnly: options.aiOnly,\n allowExecution: asGrants(options.allowExecution),\n execution: options.execution,\n generate: options.generate,\n failOnReview: options.failOnReview,\n evalNames: options.evalNames,\n suite: options.suite,\n since: options.since,\n newerThan: options.newerThan,\n baseline: options.baseline,\n writeBaseline: options.writeBaseline,\n toolVersion: options.toolVersion,\n judgeOptions,\n ...engineOverrides,\n });\n}\n\nexport { render };\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,OAEK;;;ACjBP;AAAA,EACE,SAAW;AAAA,EACX,KAAO;AAAA,EACP,OAAS;AAAA,EACT,MAAQ;AAAA,EACR,UAAY,CAAC,SAAS,YAAY,SAAS,cAAc,WAAW;AAAA,EACpE,YAAc;AAAA,IACZ,OAAS;AAAA,MACP,MAAQ;AAAA,MACR,aAAe;AAAA,IACjB;AAAA,IACA,UAAY;AAAA,MACV,MAAQ;AAAA,MACR,aAAe;AAAA,IACjB;AAAA,IACA,OAAS;AAAA,MACP,MAAQ,CAAC,QAAQ,QAAQ,SAAS;AAAA,MAClC,aAAe;AAAA,IACjB;AAAA,IACA,YAAc;AAAA,MACZ,MAAQ;AAAA,MACR,SAAW;AAAA,MACX,SAAW;AAAA,MACX,a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AAQ;AAAA,IAClB,cAAc,QAAQ;AAAA,IACtB,WAAW,QAAQ;AAAA,IACnB,OAAO,QAAQ;AAAA,IACf,OAAO,QAAQ;AAAA,IACf,WAAW,QAAQ;AAAA,IACnB,UAAU,QAAQ;AAAA,IAClB,eAAe,QAAQ;AAAA,IACvB,aAAa,QAAQ;AAAA,IACrB;AAAA,IACA,GAAG;AAAA,EACL,CAAC;AACH;","names":["selectProvider","providerSpecFor","selectProvider","mkdirSync","readFileSync","writeFileSync","dirname","extname","join","resolve","doc","block","META_PROVENANCE_KEY","join","dirname","dir","resolve","extname","scriptAbsPath","join","rel","mkdirSync","writeFileSync","readFileSync","selectProvider"]}
@@ -1,7 +1,7 @@
1
1
  #!/usr/bin/env node
2
2
  import {
3
3
  pathKey
4
- } from "./chunk-KHBOMLPS.js";
4
+ } from "./chunk-6RGLJTXE.js";
5
5
  import {
6
6
  DEFAULT_CAPTURE_DIR,
7
7
  makeRedactor
@@ -230,4 +230,4 @@ export {
230
230
  rollup,
231
231
  writeLedger
232
232
  };
233
- //# sourceMappingURL=chunk-5KWMVAZZ.js.map
233
+ //# sourceMappingURL=chunk-7VCMV247.js.map
@@ -123,4 +123,4 @@ export {
123
123
  TERM_WRITE_FORMATS,
124
124
  TERM_RULES
125
125
  };
126
- //# sourceMappingURL=chunk-MC7U5IH4.js.map
126
+ //# sourceMappingURL=chunk-BCRMMIY5.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/term/types.ts"],"sourcesContent":["/**\n * The term tool's contract (proposal 0052). Every reader produces a `Term`,\n * every writer consumes one, and `check` and `lint` work on a `TermSet`. So a\n * new construct is one reader and one writer, and nothing after reading\n * changes, the same rule `MetadataExtractor` keeps for metadata.\n *\n * A term's record keeps the vocabulary's own kebab-case spelling\n * (`alt-labels`, `scope-note`), because it is the same record a page carries\n * and the one `term list -f json` prints. docevals keeps its eval entries in\n * frontmatter spelling for the same reason.\n */\nimport type { CollectionConfig } from \"../shared/collections.js\";\nimport type { ConfigFile } from \"../shared/config-file.js\";\nimport type { ConditionExpression } from \"../shared/flare/index.js\";\nimport type { Guidance } from \"../shared/guidance.js\";\nimport type { Severity } from \"../shared/severity.js\";\nimport type { ToolsConfig } from \"../shared/tools.js\";\n\n// ---------------------------------------------------------------------------\n// The record\n\n/**\n * The root fields of `manni:terminology:1.2.0`: the ten 1.0.0 fields in the\n * order the reference lists them, then `notation` and the five match keys\n * (proposal 0086), then the TBX data categories (proposal 0084), then the\n * three blocks.\n */\nexport const TERM_FIELDS = [\n \"label\",\n \"definition\",\n \"abstract\",\n \"alt-labels\",\n \"hidden-labels\",\n \"broader\",\n \"narrower\",\n \"related-terms\",\n \"see\",\n \"scope-note\",\n \"notation\",\n \"exact-matches\",\n \"close-matches\",\n \"broad-matches\",\n \"narrow-matches\",\n \"related-matches\",\n \"subject-field\",\n \"contexts\",\n \"notes\",\n \"sources\",\n \"customer-subsets\",\n \"project-subsets\",\n \"cross-references\",\n \"external-cross-references\",\n \"graphics\",\n \"transactions\",\n \"tbx-elements\",\n \"concept-entry\",\n \"designations\",\n \"tbx-markup\",\n] as const;\nexport type TermField = (typeof TERM_FIELDS)[number];\n\n/** The fields that hold a list of labels. The vocabulary accepts a string or a list; a reader always yields a list. */\nexport const TERM_LIST_FIELDS = [\n \"alt-labels\",\n \"hidden-labels\",\n \"broader\",\n \"narrower\",\n \"related-terms\",\n] as const satisfies readonly TermField[];\nexport type TermListField = (typeof TERM_LIST_FIELDS)[number];\n\n/**\n * The mapping fields, in the order a finding names them: each holds the IRIs\n * of concepts in other vocabularies. The vocabulary accepts an IRI or a list;\n * a reader always yields a list.\n */\nexport const TERM_MATCH_FIELDS = [\n \"exact-matches\",\n \"close-matches\",\n \"broad-matches\",\n \"narrow-matches\",\n \"related-matches\",\n] as const satisfies readonly TermField[];\nexport type TermMatchField = (typeof TERM_MATCH_FIELDS)[number];\n\n/**\n * The aux fields: valid at the root (language level), in `concept-entry`\n * (concept level) and in a `designations` item (term level). The level of a\n * value is where it sits.\n */\nexport const TERM_AUX_FIELDS = [\n \"definition\",\n \"subject-field\",\n \"contexts\",\n \"notes\",\n \"sources\",\n \"customer-subsets\",\n \"project-subsets\",\n \"cross-references\",\n \"external-cross-references\",\n \"graphics\",\n \"transactions\",\n \"tbx-elements\",\n] as const satisfies readonly TermField[];\nexport type TermAuxField = (typeof TERM_AUX_FIELDS)[number];\n\n/** The term-level keys, valid only in a `designations` item, beside its `term`. Each holds one string. */\nexport const TERM_DESIGNATION_FIELDS = [\n \"administrative-status\",\n \"part-of-speech\",\n \"grammatical-gender\",\n \"grammatical-number\",\n \"term-type\",\n \"term-location\",\n \"geographical-usage\",\n \"register\",\n \"reading\",\n \"reading-note\",\n] as const;\nexport type TermDesignationField = (typeof TERM_DESIGNATION_FIELDS)[number];\n\n/** A `cross-references`, `external-cross-references` or `graphics` item. A bare string reads as its target. */\nexport interface TermLink {\n target: string;\n text?: string;\n}\n\n/** A `transactions` item. `date` is kept as written. */\nexport interface TermTransaction {\n type: string;\n date?: string;\n responsibility?: string;\n}\n\n/** The aux fields, as every level holds them. A list field is a non-empty list, or absent. */\nexport interface TermAuxRecord {\n definition?: string;\n \"subject-field\"?: string;\n contexts?: string[];\n notes?: string[];\n sources?: string[];\n \"customer-subsets\"?: string[];\n \"project-subsets\"?: string[];\n \"cross-references\"?: TermLink[];\n \"external-cross-references\"?: TermLink[];\n graphics?: TermLink[];\n transactions?: TermTransaction[];\n /** Elements no named field maps, as XML strings in source order. */\n \"tbx-elements\"?: string[];\n}\n\n/** A `designations` item: one of the term's labels, with what is said about that designation alone. */\nexport interface TermDesignation extends TermAuxRecord {\n /** The label, alt-label or hidden-label the item describes. */\n term: string;\n \"administrative-status\"?: string;\n \"part-of-speech\"?: string;\n \"grammatical-gender\"?: string;\n \"grammatical-number\"?: string;\n \"term-type\"?: string;\n \"term-location\"?: string;\n \"geographical-usage\"?: string;\n register?: string;\n reading?: string;\n \"reading-note\"?: string;\n /** Notes for the translator. A list, and term level only: TBX-Linguist makes it a termNote. */\n \"transfer-comments\"?: string[];\n}\n\n/**\n * One term's fields, as the vocabulary names them.\n *\n * Normalized by every reader: a list field is a non-empty array of non-empty\n * strings, or absent. A string field is a non-empty string, or absent. An\n * empty value is never carried, so two sets read from different constructs\n * compare equal when they say the same thing. `definition` is required by the\n * vocabulary but absent here when a construct cannot hold one: an HTML `<dfn>`\n * names a term without defining it.\n */\nexport interface TermRecord extends TermAuxRecord {\n label: string;\n abstract?: string;\n \"alt-labels\"?: string[];\n \"hidden-labels\"?: string[];\n broader?: string[];\n narrower?: string[];\n \"related-terms\"?: string[];\n see?: string;\n \"scope-note\"?: string;\n /** A code that identifies the concept in another system. */\n notation?: string;\n \"exact-matches\"?: string[];\n \"close-matches\"?: string[];\n \"broad-matches\"?: string[];\n \"narrow-matches\"?: string[];\n \"related-matches\"?: string[];\n /** Concept level: what every language's term of this id says. */\n \"concept-entry\"?: TermAuxRecord;\n /** Per-designation detail, in source order. */\n designations?: TermDesignation[];\n /** The marked-up form of any value whose text it matches, as inline XML. */\n \"tbx-markup\"?: string[];\n}\n\n/** Every construct a term is read from. Each has exactly one reader. */\nexport const TERM_CONSTRUCTS = [\n /** The metadata channel of a one-term file, in any of the six formats. */\n \"page\",\n /** A YAML or JSON file listed under `term.manifests`. */\n \"manifest\",\n \"dita-glossentry\",\n \"dita-glossgroup\",\n \"docbook-glossary\",\n \"html-dl\",\n \"html-dfn\",\n /** Markdown and MDX. */\n \"markdown-deflist\",\n \"asciidoc-glossary\",\n \"rst-glossary\",\n /** One `termEntry` (TBX v2) or `conceptEntry` (TBX v3): a term per language it holds. */\n \"tbx-entry\",\n /** One `skos:Concept` in Turtle or JSON-LD: a term per language its `skos:prefLabel` holds. */\n \"skos\",\n /** One `GlossaryEntry` in a MadCap Flare `.flglo`. */\n \"flare-glossary\",\n] as const;\nexport type TermConstruct = (typeof TERM_CONSTRUCTS)[number];\n\n/** Where a term was read from, precisely enough to report on it and to write it back. */\nexport interface TermLocation {\n /** The file as the user would name it: posix, relative to where it was resolved. `<stdin>` for stdin. */\n file: string;\n /** Absolute path. Absent for stdin, which has nowhere to write back to. */\n path?: string;\n construct: TermConstruct;\n /** 1-based line the entry starts on. */\n line: number;\n /**\n * 1-based line of each field the reader could place. A lint finding sits on\n * its field's line; a field with no entry here sits on `line`.\n */\n fieldLines: Partial<Record<TermField, number>>;\n /**\n * The entry's UTF-16 offsets in the file's content, `[start, end)`, for a\n * body construct that is written back in place. Absent for `page` and\n * `manifest`, which are written through their own channel.\n */\n span?: { start: number; end: number };\n}\n\nexport interface Term {\n /**\n * The term's identity: the record's `id` where it has one, else the\n * construct's own identifier (`<dt id>`, `xml:id`, a DITA topic `@id`), else\n * the GitHub slug of `label`.\n */\n id: string;\n record: TermRecord;\n /** `language` from the file's metadata, or from a manifest entry, when it carries one. */\n language?: string;\n location: TermLocation;\n}\n\n// ---------------------------------------------------------------------------\n// Reading\n\n/** One loaded file, as every reader sees it. */\nexport interface TermInput {\n content: string;\n /** As `TermLocation.file`. */\n file: string;\n /** As `TermLocation.path`. */\n path?: string;\n /** The extractor that read the file (`markdown`, `mdx`, `asciidoc`, `rst`, `html`, `xml`), or `manifest`, `tbx`, `skos` or `flare-glossary`. */\n format: string;\n /** The file's extracted metadata. `{}` for a manifest, which has none. */\n metadata: Record<string, unknown>;\n /** The extractor's JSON-Pointer line lookup for `metadata`. */\n lineFor: (pointer: string) => number | undefined;\n /**\n * The condition expression of the Flare target the file's project builds,\n * for a Flare glossary. Absent with no project, no target or no expression,\n * and then every entry is read.\n */\n conditions?: ConditionExpression;\n}\n\nexport interface TermReadResult {\n terms: Term[];\n /**\n * An entry the reader skipped, and why, said once per entry: a `<dt>` with no\n * term text, a glossentry with no `<glossterm>`. Reported as a notice, not a\n * finding, because no rule governs a construct manni could not read.\n */\n notices: string[];\n}\n\n/**\n * The read seam for one construct, and its in-place write where it has one.\n * Writability is derived from `apply` being present, as it is for an extractor.\n */\nexport interface TermReader {\n construct: TermConstruct;\n /** What `term formats` prints for it: `page`, `definition list`, `DITA glossentry`. */\n label: string;\n /** The `TermInput.format` values this construct appears in. */\n formats: readonly string[];\n /**\n * Every entry this construct holds in one file. `{ terms: [], notices: [] }`\n * when the file holds none, which is most files: the loader offers every file\n * of a matching format to every reader. Throws `TermError` only for a file\n * the construct claims and cannot parse.\n */\n read(this: void, input: TermInput): TermReadResult;\n /**\n * Rewrite this construct's entries in `input.content` from `terms`, which are\n * the terms this reader read from the same file, possibly edited. Returns the\n * new content. Absent for a construct that is not written in place. A\n * construct that writes a value once for terms that each carry it pushes\n * onto `conflicts` every field the terms disagree on, keeping the first's.\n */\n apply?(this: void, input: TermInput, terms: readonly Term[], conflicts?: MergeConflict[]): string;\n}\n\n// ---------------------------------------------------------------------------\n// Writing\n\n/** Every `term write -f` value. */\nexport const TERM_WRITE_FORMATS = [\n \"markdown\",\n \"mdx\",\n \"asciidoc\",\n \"rst\",\n \"html\",\n \"dita\",\n \"docbook\",\n \"tbx\",\n \"tbx3\",\n \"skos\",\n \"skos-ttl\",\n \"csv\",\n \"json\",\n \"vale\",\n] as const;\nexport type TermWriteFormat = (typeof TERM_WRITE_FORMATS)[number];\n\n/** The path decides the shape: a directory gets one file per term, a file gets every term. */\nexport type TermShape = \"file\" | \"directory\";\n\nexport interface TermTarget {\n /** Absolute. */\n path: string;\n shape: TermShape;\n}\n\nexport interface TermRenderContext {\n /**\n * The files already under the target, absolute path to content. A writer that\n * owns a directory reads it: the Vale writer finds its own marked files to\n * remove, and refuses to replace a file it did not write.\n */\n existing: ReadonlyMap<string, string>;\n}\n\nexport interface RenderedFile {\n /** Absolute. */\n path: string;\n content: string;\n}\n\nexport interface DroppedField {\n id: string;\n field: TermField;\n}\n\n/** A field the terms sharing an id disagree on, where a render that joins them on id kept the first term's value. */\nexport interface MergeConflict {\n id: string;\n /** The record key, dotted below the root: `broader`, `concept-entry.subject-field`. */\n field: string;\n}\n\n/** A term a construct holding one language left out, with its own language. */\nexport interface OtherLanguageTerm {\n id: string;\n language: string;\n}\n\nexport interface TermRender {\n files: RenderedFile[];\n /** Absolute paths the render owns and no longer produces. */\n removals: string[];\n /** Fields the target construct cannot hold, per term written. */\n dropped: DroppedField[];\n /**\n * Ids of the terms left out, in set order, because the target construct's\n * reader could not read them back: a definition list entry with no\n * definition. `[]` when every term was written.\n */\n skipped: string[];\n /**\n * Set when the target construct holds one language and the set holds more:\n * the language written, the first term's, and the terms left out, in set\n * order.\n */\n otherLanguages?: { written: string; terms: OtherLanguageTerm[] };\n /** Set when a render joins terms on id and they disagree on a field the joined entry holds once. */\n conflicts?: MergeConflict[];\n /**\n * The TBX files, as their terms name them, whose header the render did not\n * carry. Set by a TBX render; for any other, every TBX file a term came\n * from.\n */\n droppedHeaders?: string[];\n}\n\n/**\n * The render seam for one `-f` value. Pure: it computes files and never touches\n * the disk, so `--dry-run` and `--check` run the same code as a write.\n */\nexport interface TermWriter {\n format: TermWriteFormat;\n /** The shapes this format is written in. `tbx` is a file only; `vale` is a directory only. */\n shapes: readonly TermShape[];\n /** The fields a render in `shape` keeps. Everything else lands in `dropped`. */\n holds(this: void, shape: TermShape): readonly TermField[];\n /** Throws `TermError` for a target it refuses, such as a Vale style it did not write. */\n render(this: void, terms: readonly Term[], target: TermTarget, context: TermRenderContext): TermRender;\n}\n\n// ---------------------------------------------------------------------------\n// The set\n\n/** A page's claim that it is about a term: one value of `concepts:` or `graph.concepts`. */\nexport interface TermReference {\n file: string;\n line?: number;\n label: string;\n /** The field it was read from, dotted. `concepts` when absent. */\n field?: string;\n /** The page's `language`, which a label resolves in first. */\n language?: string;\n}\n\n/** A page's `graph:` block, as far as the concept hierarchy reads it. */\nexport interface TermBlock {\n file: string;\n /** The line of `graph:`. */\n line?: number;\n language?: string;\n /** The block's `label`: the concept the page is about. */\n label: string;\n /** One per value of `broader`, `narrower` and `related-concepts`, on its field's line. */\n edges: { field: \"broader\" | \"narrower\" | \"related-concepts\"; value: string; line?: number }[];\n /** The block's `alt-labels`, when it has any. */\n altLabels?: string[];\n /** The block's `definition`, when it has one. */\n definition?: string;\n}\n\nexport interface TermSet {\n terms: Term[];\n /** Every `concepts:` and `graph.concepts` value in every file the run loaded. */\n references: TermReference[];\n /** Every labelled `graph:` block in every file the run loaded. */\n blocks: TermBlock[];\n /** Every `keywords:` value on every page the run loaded but a term page, `field` `keywords`. */\n keywords?: TermReference[];\n /** Readers' notices, in load order. */\n notices: string[];\n}\n\n// ---------------------------------------------------------------------------\n// Findings\n\n/** Every rule `term check` reports, stated once. The default severities derive from this order. */\nexport const TERM_RULES = [\n \"undefined-term\",\n \"duplicate-id\",\n \"label-collision\",\n \"alt-label-collision\",\n \"label-overlap\",\n \"dangling-reference\",\n \"broader-cycle\",\n \"see-not-empty\",\n \"missing-definition\",\n \"conflicting-matches\",\n \"asymmetric-hierarchy\",\n \"asymmetric-related\",\n \"related-in-hierarchy\",\n \"alt-label-reference\",\n \"ambiguous-alt-label\",\n \"deprecated-label\",\n \"abstract-too-long\",\n \"unused-term\",\n \"hierarchy-outside-termbase\",\n \"related-siblings\",\n \"orphan-term\",\n \"keyword-candidate\",\n] as const;\nexport type TermRule = (typeof TERM_RULES)[number];\n\n/** A rule's level: the family scale plus `off`, which drops the rule's findings. */\nexport type TermSeverity = Severity | \"off\";\n\n/** Vale's own severity scale, kept beside the family's on a lint finding. */\nexport type ValeSeverity = \"error\" | \"warning\" | \"suggestion\";\n\nexport interface TermFinding {\n /** `manni:term/<rule>` from `check`; `manni:term/prose/<Style.Rule>` from `lint`. */\n ruleId: string;\n severity: Severity;\n /** What happened, then what to do about it. */\n message: string;\n /**\n * A `check` finding's message as 4.13 spelled it, before any advice. The\n * baseline fingerprint reads it, so rewording the advice moves no\n * baseline. Absent when the message is the whole of it. Never printed.\n */\n key?: string;\n /** The rule behind the finding: what it means, and where to read more. */\n guidance?: Guidance | null;\n file: string;\n line?: number;\n /** The entry the finding is about, when it is about one. */\n id?: string;\n /** Set on a `check` finding. */\n rule?: TermRule;\n /** Set on a `lint` finding: the tool that raised it. */\n tool?: \"vale\";\n /** Set on a `lint` finding: the tool's own rule name, `Direct.Length`. */\n check?: string;\n /** Set on a `lint` finding: the tool's own severity, before the fold. */\n toolSeverity?: ValeSeverity;\n /**\n * The field the finding concerns: on a `lint` finding, the field the prose\n * came from; on a `check` finding, the field that breaks the rule. Absent\n * for a finding about a whole entry (`duplicate-id`, `unused-term`) or about\n * a page (`undefined-term`).\n */\n field?: TermField;\n}\n\n// ---------------------------------------------------------------------------\n// Config\n\n/** The `term:` section. Every key is optional; a docset with none needs no section. */\nexport interface TermConfig {\n manifests?: string[];\n abstractMaxLength?: number;\n baseline?: string;\n severity?: Partial<Record<TermRule, TermSeverity>>;\n allowEmpty?: boolean;\n respectGitignore?: boolean;\n /** `term.provider`: the provider `term fill` drafts with. */\n provider?: string;\n /** `term.model`. */\n model?: string;\n fill?: TermFillConfig;\n}\n\n/** `term.fill`. */\nexport interface TermFillConfig {\n /** Where new term pages go, as written: resolved from the config directory. */\n out?: string;\n confidenceThreshold?: number;\n /** Inference calls per run; `null` is unbounded. */\n maxTurns?: number | null;\n cacheDir?: string;\n crawl?: { minPages?: number };\n}\n\nexport interface LoadedTermConfig {\n config: TermConfig;\n path: string;\n dir: string;\n /** The file as the user would name it, for messages. */\n source: string;\n collections: CollectionConfig[];\n tools: ToolsConfig;\n}\n\n/** One `term.manifests` entry. */\nexport interface TermManifest {\n /** Absolute, resolved against the config directory. */\n path: string;\n /** As the config spells it, for messages. */\n written: string;\n}\n\n/** What every command core resolves before touching a file. */\nexport interface TermRun {\n config: TermConfig | null;\n /** The positional inputs, or the selected collections' `paths:` in declaration order. */\n inputs: string[];\n /** Directory `inputs` resolve from: cwd for positional inputs, the config directory for collections. */\n base: string;\n collections: CollectionConfig[];\n fromCollections: boolean;\n /** The `term.manifests` files, in the order the config lists them. */\n manifests: TermManifest[];\n /** The family `tools:`. `{}` when no config governs the run. */\n tools: ToolsConfig;\n configDir?: string;\n configPath?: string;\n configSource?: string;\n configFile?: ConfigFile;\n}\n"],"mappings":";;;AA2BO,IAAM,cAAc;AAAA,EACzB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,IAAM,mBAAmB;AAAA,EAC9B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,IAAM,oBAAoB;AAAA,EAC/B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAQO,IAAM,kBAAkB;AAAA,EAC7B;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAIO,IAAM,0BAA0B;AAAA,EACrC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAkNO,IAAM,qBAAqB;AAAA,EAChC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;AAqIO,IAAM,aAAa;AAAA,EACxB;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF;","names":[]}
@@ -20,7 +20,7 @@ import {
20
20
  FAMILY_CONFIG_NAMES,
21
21
  findConfigFileSync,
22
22
  readConfigFileSync
23
- } from "./chunk-JF4BC7ZD.js";
23
+ } from "./chunk-CDX4QK6O.js";
24
24
  import {
25
25
  assertKnownProvider
26
26
  } from "./chunk-NVYDWVXN.js";
@@ -532,4 +532,4 @@ export {
532
532
  discoverConfig,
533
533
  loadConfig
534
534
  };
535
- //# sourceMappingURL=chunk-3ZVRGBK6.js.map
535
+ //# sourceMappingURL=chunk-BTFXOKCP.js.map
@@ -4,10 +4,10 @@ import {
4
4
  listInTree,
5
5
  safeRead,
6
6
  segments
7
- } from "./chunk-M6RB342K.js";
7
+ } from "./chunk-YTW7A62V.js";
8
8
  import {
9
9
  extractEvals
10
- } from "./chunk-QWGAM3T6.js";
10
+ } from "./chunk-5GQ7FF22.js";
11
11
  import {
12
12
  TracevalsError
13
13
  } from "./chunk-ZINZTHWO.js";
@@ -173,4 +173,4 @@ async function discoverArtifacts(options) {
173
173
  export {
174
174
  discoverArtifacts
175
175
  };
176
- //# sourceMappingURL=chunk-4DFLLMIM.js.map
176
+ //# sourceMappingURL=chunk-C2XLJICN.js.map