@hawkeyexl/manni 4.30.0 → 4.31.0

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 (244) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-23GVYKFP.js → batch-P6LTMOZP.js} +12 -12
  3. package/dist/{build-CRK3HT5F.js → build-V5JPMFTR.js} +14 -14
  4. package/dist/{calibrate-2RFP3QX2.js → calibrate-YS4NLIC3.js} +13 -13
  5. package/dist/{capture-267IEE6B.js → capture-YQDJSSKZ.js} +12 -12
  6. package/dist/check-DVMU74U3.js +58 -0
  7. package/dist/{check-2HIBGMXD.js → check-FVL7G5PJ.js} +13 -13
  8. package/dist/{check-5QX33J6O.js → check-OWGSBBU7.js} +13 -13
  9. package/dist/{check-6FCVYM62.js → check-QAVEMKP2.js} +10 -10
  10. package/dist/{check-VKQ6GM5D.js → check-TUP4RG7G.js} +23 -23
  11. package/dist/{chunk-5MKSZSXH.js → chunk-2KGDXZMS.js} +3 -3
  12. package/dist/{chunk-K5VWSQ4K.js → chunk-2NB7MT5I.js} +2 -2
  13. package/dist/{chunk-5DER6O26.js → chunk-3WX73ME2.js} +3 -3
  14. package/dist/{chunk-TU7T6YRR.js → chunk-4JDOHAHR.js} +6 -6
  15. package/dist/{chunk-VCIC7XJB.js → chunk-66A5PPWF.js} +4 -4
  16. package/dist/{chunk-MWWPADYI.js → chunk-66U7KHZE.js} +5 -5
  17. package/dist/{chunk-ERXM4UF7.js → chunk-672TCM2Q.js} +4 -4
  18. package/dist/{chunk-OZH46DBT.js → chunk-7OMLNFP7.js} +6 -1
  19. package/dist/chunk-7OMLNFP7.js.map +1 -0
  20. package/dist/{chunk-NIXJOL7G.js → chunk-7S6H5UML.js} +2 -2
  21. package/dist/{chunk-VGGIJMDA.js → chunk-7URMU7S5.js} +2 -2
  22. package/dist/{chunk-GBZVXEVE.js → chunk-AD7IRC5T.js} +3 -3
  23. package/dist/{chunk-RKZ2NPO4.js → chunk-AXIYZIHN.js} +4 -4
  24. package/dist/{chunk-GK3F3FIP.js → chunk-AXSCHC34.js} +5 -5
  25. package/dist/{chunk-MYYTLNO5.js → chunk-BBIEWUO6.js} +6 -6
  26. package/dist/{chunk-4YCPB67J.js → chunk-BKLXSWGX.js} +3 -3
  27. package/dist/{chunk-YLWI7FR2.js → chunk-BR6NGHRG.js} +3 -3
  28. package/dist/{chunk-DKV6BVW5.js → chunk-BVQEOF23.js} +3 -3
  29. package/dist/{chunk-U4CWWG2Y.js → chunk-CCBIO2CB.js} +2 -2
  30. package/dist/{chunk-67GJRC62.js → chunk-CEPNSI4V.js} +2 -2
  31. package/dist/{chunk-2FGWZH7A.js → chunk-CY4RNLFN.js} +3 -3
  32. package/dist/{chunk-WMI2RDSG.js → chunk-D2N3SAV6.js} +4 -4
  33. package/dist/{chunk-V52AGLNN.js → chunk-DLIQJJAE.js} +3 -3
  34. package/dist/{chunk-AP3PCNKS.js → chunk-DO5CJVXR.js} +3 -3
  35. package/dist/{chunk-TAGYZJQA.js → chunk-DOXZ3U4O.js} +50 -20
  36. package/dist/chunk-DOXZ3U4O.js.map +1 -0
  37. package/dist/{chunk-77U6NQKQ.js → chunk-DSHAY6YM.js} +3 -3
  38. package/dist/{chunk-LGHJFEEH.js → chunk-EZBWGI25.js} +2 -2
  39. package/dist/{chunk-F76DU7FH.js → chunk-F6FDIOKE.js} +3 -3
  40. package/dist/{chunk-O2STKCTP.js → chunk-FJZZYY7Q.js} +8 -8
  41. package/dist/{chunk-YGUAY67B.js → chunk-GTT7EQEV.js} +2 -2
  42. package/dist/{chunk-3YA6TGWH.js → chunk-GWOVEW53.js} +5 -5
  43. package/dist/{chunk-JG2QWMDX.js → chunk-HVYVIGBP.js} +10 -10
  44. package/dist/{chunk-ZE3BXQED.js → chunk-I52GL7N6.js} +3 -3
  45. package/dist/{chunk-6U3XF5VY.js → chunk-ICUKYSPX.js} +2 -2
  46. package/dist/{chunk-6KNIQ2SK.js → chunk-INDMEKFB.js} +6 -6
  47. package/dist/{chunk-RRAJMTHV.js → chunk-J7OFPDCD.js} +4 -4
  48. package/dist/{chunk-HXILODV5.js → chunk-JVZAJBSS.js} +2 -2
  49. package/dist/{chunk-SXMTWMZZ.js → chunk-KPQFF62T.js} +40 -12
  50. package/dist/chunk-KPQFF62T.js.map +1 -0
  51. package/dist/{chunk-7INXFEI7.js → chunk-KWK6VVK2.js} +7 -7
  52. package/dist/{chunk-7ZRX2OPC.js → chunk-LU6HSA2N.js} +10 -10
  53. package/dist/{chunk-KNMDIR7D.js → chunk-M5HDMQCI.js} +2 -2
  54. package/dist/{chunk-OPF3NOKF.js → chunk-M77SIRUX.js} +1 -1
  55. package/dist/{chunk-OPF3NOKF.js.map → chunk-M77SIRUX.js.map} +1 -1
  56. package/dist/{chunk-UYKRP3M3.js → chunk-MCUN2JP3.js} +3 -3
  57. package/dist/{chunk-OXFNU2IO.js → chunk-MQ34D4OP.js} +4 -4
  58. package/dist/{chunk-UUZJP47H.js → chunk-MREXYXMW.js} +8 -8
  59. package/dist/{chunk-4MD2JG2F.js → chunk-N7VIVL42.js} +2 -2
  60. package/dist/{chunk-SWCFJC7W.js → chunk-NH4RQUSD.js} +3 -3
  61. package/dist/{chunk-4L62A7YB.js → chunk-P676AEK6.js} +4 -4
  62. package/dist/{chunk-QEFVMOWF.js → chunk-QYKTIRRE.js} +2 -2
  63. package/dist/{chunk-3VBEUMKQ.js → chunk-R64PJYCT.js} +2 -2
  64. package/dist/{chunk-KAIJHQR2.js → chunk-SORYKTNP.js} +2 -2
  65. package/dist/{chunk-KAIJHQR2.js.map → chunk-SORYKTNP.js.map} +1 -1
  66. package/dist/{chunk-O632I7AB.js → chunk-SPYYVEWP.js} +8 -8
  67. package/dist/{chunk-CZFP6Q5O.js → chunk-STPT3WEC.js} +7 -7
  68. package/dist/{chunk-5S5DYW7W.js → chunk-TE6SQVNO.js} +8 -8
  69. package/dist/{chunk-7PF47O3H.js → chunk-TX7NPCCT.js} +6 -6
  70. package/dist/{chunk-XZFJAVX7.js → chunk-UH7KFBBM.js} +9 -8
  71. package/dist/chunk-UH7KFBBM.js.map +1 -0
  72. package/dist/{chunk-E6S3VGN6.js → chunk-VKAE3W6H.js} +4 -4
  73. package/dist/{chunk-Z3YNYZR2.js → chunk-VXZ2CIH7.js} +2 -2
  74. package/dist/{chunk-ZI7RMN3H.js → chunk-WX77JHTU.js} +3 -3
  75. package/dist/{chunk-SXNK6FPC.js → chunk-X7UWDGQQ.js} +11 -8
  76. package/dist/chunk-X7UWDGQQ.js.map +1 -0
  77. package/dist/{chunk-7YDGDI26.js → chunk-XIEUUETR.js} +6 -6
  78. package/dist/{chunk-OJZOKTTX.js → chunk-YH6MWLDA.js} +2 -2
  79. package/dist/{chunk-CMJEB5V5.js → chunk-YT55M4VQ.js} +6 -6
  80. package/dist/{chunk-N3J22ZRL.js → chunk-Z7HBBFSZ.js} +578 -28
  81. package/dist/chunk-Z7HBBFSZ.js.map +1 -0
  82. package/dist/{chunk-C5NE3ZIC.js → chunk-ZGLLJSL7.js} +2 -2
  83. package/dist/{chunk-5RCCJ446.js → chunk-ZMFSFXQX.js} +7 -7
  84. package/dist/chunk-ZMFSFXQX.js.map +1 -0
  85. package/dist/{chunk-MBJINPKU.js → chunk-ZY2XP3AS.js} +13 -13
  86. package/dist/{cli-B7QCMRWR.js → cli-5NIVQZIE.js} +31 -31
  87. package/dist/{cli-MT4EPC63.js → cli-7TW4HTQN.js} +14 -14
  88. package/dist/{cli-KUMDTVHH.js → cli-BG6WXYWT.js} +56 -56
  89. package/dist/{cli-2MHUVZH2.js → cli-ME4U7S7Q.js} +28 -28
  90. package/dist/{cli-A5TGO26R.js → cli-NKGQZKXS.js} +34 -34
  91. package/dist/{cli-NKRJ5C4G.js → cli-R5XYFIOY.js} +14 -14
  92. package/dist/{cli-S5CSPYEZ.js → cli-T2AZSUSY.js} +19 -19
  93. package/dist/{cli-NIHSHMIV.js → cli-TA2IQRYK.js} +7 -7
  94. package/dist/{cli-CCUZFOPQ.js → cli-UAM4MBRM.js} +17 -17
  95. package/dist/{cli-GKRMSA26.js → cli-XVJ5G4EO.js} +27 -27
  96. package/dist/{cli-Y4ARUWKJ.js → cli-YKM5YZHY.js} +2 -2
  97. package/dist/cli.js +15 -15
  98. package/dist/docmeta.js +6 -6
  99. package/dist/{github-2PYSX7EK.js → github-SQ2ATTLV.js} +10 -10
  100. package/dist/{github-POT6K5GH.js → github-X6F2FQL3.js} +13 -13
  101. package/dist/github-ZCA7TOJO.js +49 -0
  102. package/dist/index.d.ts +55 -3
  103. package/dist/index.js +57 -55
  104. package/dist/index.js.map +1 -1
  105. package/dist/{json-ZWSUMRI5.js → json-L7QDREEX.js} +10 -10
  106. package/dist/{json-3HPHYGQC.js → json-NSLJFPWD.js} +14 -14
  107. package/dist/{labels-5P4CKGPW.js → labels-C4HCKZMZ.js} +9 -9
  108. package/dist/{lint-K7R4WNMG.js → lint-ODALAI2I.js} +12 -12
  109. package/dist/list-4JLKJOGX.js +56 -0
  110. package/dist/{list-HOTRWPC7.js → list-CAE7T5HA.js} +10 -10
  111. package/dist/{list-3C7Q6VMU.js → list-TQK3FWC2.js} +13 -13
  112. package/dist/{page-6U3CEGTB.js → page-GB5LHRHX.js} +9 -9
  113. package/dist/{prepare-PZVX2VVT.js → prepare-VCJRE3EY.js} +11 -11
  114. package/dist/{pretty-ODBO2IIJ.js → pretty-GP4R3UII.js} +10 -10
  115. package/dist/{pretty-53N5ZMM3.js → pretty-GXLKMUT4.js} +13 -13
  116. package/dist/{pretty-ENVCHUYG.js → pretty-KZPED6KN.js} +23 -23
  117. package/dist/{reporters-3GE5FK5L.js → reporters-GGP4YLIM.js} +11 -11
  118. package/dist/{reporters-FWSJ3O4V.js → reporters-GQ2PUWQA.js} +4 -4
  119. package/dist/{reporters-MK62LRGW.js → reporters-Y2AUVODK.js} +4 -4
  120. package/dist/run-SVH32CBO.js +59 -0
  121. package/dist/sarif-CFQJ5HHP.js +50 -0
  122. package/dist/{sarif-2L4MLVF5.js → sarif-UG7F3WQD.js} +8 -8
  123. package/dist/{sarif-IFFO37SO.js → sarif-UHZD2CJ3.js} +8 -8
  124. package/dist/{strategy-BCRB4A55.js → strategy-Y4NEJRSH.js} +20 -20
  125. package/dist/{term-HPRQBB2A.js → term-LQ2F5WEN.js} +15 -15
  126. package/dist/{types-GV2THIRC.js → types-YREQ2DQG.js} +6 -4
  127. package/dist/{validate-TEYFOGI5.js → validate-6WBRKEV5.js} +4 -4
  128. package/package.json +1 -1
  129. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  130. package/dist/check-MYUFZGKO.js +0 -58
  131. package/dist/chunk-5RCCJ446.js.map +0 -1
  132. package/dist/chunk-N3J22ZRL.js.map +0 -1
  133. package/dist/chunk-OZH46DBT.js.map +0 -1
  134. package/dist/chunk-SXMTWMZZ.js.map +0 -1
  135. package/dist/chunk-SXNK6FPC.js.map +0 -1
  136. package/dist/chunk-TAGYZJQA.js.map +0 -1
  137. package/dist/chunk-XZFJAVX7.js.map +0 -1
  138. package/dist/github-M4QRPNXT.js +0 -49
  139. package/dist/list-O7IREFT2.js +0 -56
  140. package/dist/run-GUHRZ3OX.js +0 -59
  141. package/dist/sarif-2BGXPVSR.js +0 -50
  142. /package/dist/{batch-23GVYKFP.js.map → batch-P6LTMOZP.js.map} +0 -0
  143. /package/dist/{build-CRK3HT5F.js.map → build-V5JPMFTR.js.map} +0 -0
  144. /package/dist/{calibrate-2RFP3QX2.js.map → calibrate-YS4NLIC3.js.map} +0 -0
  145. /package/dist/{capture-267IEE6B.js.map → capture-YQDJSSKZ.js.map} +0 -0
  146. /package/dist/{check-2HIBGMXD.js.map → check-DVMU74U3.js.map} +0 -0
  147. /package/dist/{check-6FCVYM62.js.map → check-FVL7G5PJ.js.map} +0 -0
  148. /package/dist/{check-5QX33J6O.js.map → check-OWGSBBU7.js.map} +0 -0
  149. /package/dist/{check-MYUFZGKO.js.map → check-QAVEMKP2.js.map} +0 -0
  150. /package/dist/{check-VKQ6GM5D.js.map → check-TUP4RG7G.js.map} +0 -0
  151. /package/dist/{chunk-5MKSZSXH.js.map → chunk-2KGDXZMS.js.map} +0 -0
  152. /package/dist/{chunk-K5VWSQ4K.js.map → chunk-2NB7MT5I.js.map} +0 -0
  153. /package/dist/{chunk-5DER6O26.js.map → chunk-3WX73ME2.js.map} +0 -0
  154. /package/dist/{chunk-TU7T6YRR.js.map → chunk-4JDOHAHR.js.map} +0 -0
  155. /package/dist/{chunk-VCIC7XJB.js.map → chunk-66A5PPWF.js.map} +0 -0
  156. /package/dist/{chunk-MWWPADYI.js.map → chunk-66U7KHZE.js.map} +0 -0
  157. /package/dist/{chunk-ERXM4UF7.js.map → chunk-672TCM2Q.js.map} +0 -0
  158. /package/dist/{chunk-NIXJOL7G.js.map → chunk-7S6H5UML.js.map} +0 -0
  159. /package/dist/{chunk-VGGIJMDA.js.map → chunk-7URMU7S5.js.map} +0 -0
  160. /package/dist/{chunk-GBZVXEVE.js.map → chunk-AD7IRC5T.js.map} +0 -0
  161. /package/dist/{chunk-RKZ2NPO4.js.map → chunk-AXIYZIHN.js.map} +0 -0
  162. /package/dist/{chunk-GK3F3FIP.js.map → chunk-AXSCHC34.js.map} +0 -0
  163. /package/dist/{chunk-MYYTLNO5.js.map → chunk-BBIEWUO6.js.map} +0 -0
  164. /package/dist/{chunk-4YCPB67J.js.map → chunk-BKLXSWGX.js.map} +0 -0
  165. /package/dist/{chunk-YLWI7FR2.js.map → chunk-BR6NGHRG.js.map} +0 -0
  166. /package/dist/{chunk-DKV6BVW5.js.map → chunk-BVQEOF23.js.map} +0 -0
  167. /package/dist/{chunk-U4CWWG2Y.js.map → chunk-CCBIO2CB.js.map} +0 -0
  168. /package/dist/{chunk-67GJRC62.js.map → chunk-CEPNSI4V.js.map} +0 -0
  169. /package/dist/{chunk-2FGWZH7A.js.map → chunk-CY4RNLFN.js.map} +0 -0
  170. /package/dist/{chunk-WMI2RDSG.js.map → chunk-D2N3SAV6.js.map} +0 -0
  171. /package/dist/{chunk-V52AGLNN.js.map → chunk-DLIQJJAE.js.map} +0 -0
  172. /package/dist/{chunk-AP3PCNKS.js.map → chunk-DO5CJVXR.js.map} +0 -0
  173. /package/dist/{chunk-77U6NQKQ.js.map → chunk-DSHAY6YM.js.map} +0 -0
  174. /package/dist/{chunk-LGHJFEEH.js.map → chunk-EZBWGI25.js.map} +0 -0
  175. /package/dist/{chunk-F76DU7FH.js.map → chunk-F6FDIOKE.js.map} +0 -0
  176. /package/dist/{chunk-O2STKCTP.js.map → chunk-FJZZYY7Q.js.map} +0 -0
  177. /package/dist/{chunk-YGUAY67B.js.map → chunk-GTT7EQEV.js.map} +0 -0
  178. /package/dist/{chunk-3YA6TGWH.js.map → chunk-GWOVEW53.js.map} +0 -0
  179. /package/dist/{chunk-JG2QWMDX.js.map → chunk-HVYVIGBP.js.map} +0 -0
  180. /package/dist/{chunk-ZE3BXQED.js.map → chunk-I52GL7N6.js.map} +0 -0
  181. /package/dist/{chunk-6U3XF5VY.js.map → chunk-ICUKYSPX.js.map} +0 -0
  182. /package/dist/{chunk-6KNIQ2SK.js.map → chunk-INDMEKFB.js.map} +0 -0
  183. /package/dist/{chunk-RRAJMTHV.js.map → chunk-J7OFPDCD.js.map} +0 -0
  184. /package/dist/{chunk-HXILODV5.js.map → chunk-JVZAJBSS.js.map} +0 -0
  185. /package/dist/{chunk-7INXFEI7.js.map → chunk-KWK6VVK2.js.map} +0 -0
  186. /package/dist/{chunk-7ZRX2OPC.js.map → chunk-LU6HSA2N.js.map} +0 -0
  187. /package/dist/{chunk-KNMDIR7D.js.map → chunk-M5HDMQCI.js.map} +0 -0
  188. /package/dist/{chunk-UYKRP3M3.js.map → chunk-MCUN2JP3.js.map} +0 -0
  189. /package/dist/{chunk-OXFNU2IO.js.map → chunk-MQ34D4OP.js.map} +0 -0
  190. /package/dist/{chunk-UUZJP47H.js.map → chunk-MREXYXMW.js.map} +0 -0
  191. /package/dist/{chunk-4MD2JG2F.js.map → chunk-N7VIVL42.js.map} +0 -0
  192. /package/dist/{chunk-SWCFJC7W.js.map → chunk-NH4RQUSD.js.map} +0 -0
  193. /package/dist/{chunk-4L62A7YB.js.map → chunk-P676AEK6.js.map} +0 -0
  194. /package/dist/{chunk-QEFVMOWF.js.map → chunk-QYKTIRRE.js.map} +0 -0
  195. /package/dist/{chunk-3VBEUMKQ.js.map → chunk-R64PJYCT.js.map} +0 -0
  196. /package/dist/{chunk-O632I7AB.js.map → chunk-SPYYVEWP.js.map} +0 -0
  197. /package/dist/{chunk-CZFP6Q5O.js.map → chunk-STPT3WEC.js.map} +0 -0
  198. /package/dist/{chunk-5S5DYW7W.js.map → chunk-TE6SQVNO.js.map} +0 -0
  199. /package/dist/{chunk-7PF47O3H.js.map → chunk-TX7NPCCT.js.map} +0 -0
  200. /package/dist/{chunk-E6S3VGN6.js.map → chunk-VKAE3W6H.js.map} +0 -0
  201. /package/dist/{chunk-Z3YNYZR2.js.map → chunk-VXZ2CIH7.js.map} +0 -0
  202. /package/dist/{chunk-ZI7RMN3H.js.map → chunk-WX77JHTU.js.map} +0 -0
  203. /package/dist/{chunk-7YDGDI26.js.map → chunk-XIEUUETR.js.map} +0 -0
  204. /package/dist/{chunk-OJZOKTTX.js.map → chunk-YH6MWLDA.js.map} +0 -0
  205. /package/dist/{chunk-CMJEB5V5.js.map → chunk-YT55M4VQ.js.map} +0 -0
  206. /package/dist/{chunk-C5NE3ZIC.js.map → chunk-ZGLLJSL7.js.map} +0 -0
  207. /package/dist/{chunk-MBJINPKU.js.map → chunk-ZY2XP3AS.js.map} +0 -0
  208. /package/dist/{cli-B7QCMRWR.js.map → cli-5NIVQZIE.js.map} +0 -0
  209. /package/dist/{cli-MT4EPC63.js.map → cli-7TW4HTQN.js.map} +0 -0
  210. /package/dist/{cli-KUMDTVHH.js.map → cli-BG6WXYWT.js.map} +0 -0
  211. /package/dist/{cli-2MHUVZH2.js.map → cli-ME4U7S7Q.js.map} +0 -0
  212. /package/dist/{cli-A5TGO26R.js.map → cli-NKGQZKXS.js.map} +0 -0
  213. /package/dist/{cli-NKRJ5C4G.js.map → cli-R5XYFIOY.js.map} +0 -0
  214. /package/dist/{cli-S5CSPYEZ.js.map → cli-T2AZSUSY.js.map} +0 -0
  215. /package/dist/{cli-NIHSHMIV.js.map → cli-TA2IQRYK.js.map} +0 -0
  216. /package/dist/{cli-CCUZFOPQ.js.map → cli-UAM4MBRM.js.map} +0 -0
  217. /package/dist/{cli-GKRMSA26.js.map → cli-XVJ5G4EO.js.map} +0 -0
  218. /package/dist/{cli-Y4ARUWKJ.js.map → cli-YKM5YZHY.js.map} +0 -0
  219. /package/dist/{github-2PYSX7EK.js.map → github-SQ2ATTLV.js.map} +0 -0
  220. /package/dist/{github-M4QRPNXT.js.map → github-X6F2FQL3.js.map} +0 -0
  221. /package/dist/{github-POT6K5GH.js.map → github-ZCA7TOJO.js.map} +0 -0
  222. /package/dist/{json-3HPHYGQC.js.map → json-L7QDREEX.js.map} +0 -0
  223. /package/dist/{json-ZWSUMRI5.js.map → json-NSLJFPWD.js.map} +0 -0
  224. /package/dist/{labels-5P4CKGPW.js.map → labels-C4HCKZMZ.js.map} +0 -0
  225. /package/dist/{lint-K7R4WNMG.js.map → lint-ODALAI2I.js.map} +0 -0
  226. /package/dist/{list-3C7Q6VMU.js.map → list-4JLKJOGX.js.map} +0 -0
  227. /package/dist/{list-HOTRWPC7.js.map → list-CAE7T5HA.js.map} +0 -0
  228. /package/dist/{list-O7IREFT2.js.map → list-TQK3FWC2.js.map} +0 -0
  229. /package/dist/{page-6U3CEGTB.js.map → page-GB5LHRHX.js.map} +0 -0
  230. /package/dist/{prepare-PZVX2VVT.js.map → prepare-VCJRE3EY.js.map} +0 -0
  231. /package/dist/{pretty-53N5ZMM3.js.map → pretty-GP4R3UII.js.map} +0 -0
  232. /package/dist/{pretty-ENVCHUYG.js.map → pretty-GXLKMUT4.js.map} +0 -0
  233. /package/dist/{pretty-ODBO2IIJ.js.map → pretty-KZPED6KN.js.map} +0 -0
  234. /package/dist/{reporters-3GE5FK5L.js.map → reporters-GGP4YLIM.js.map} +0 -0
  235. /package/dist/{reporters-FWSJ3O4V.js.map → reporters-GQ2PUWQA.js.map} +0 -0
  236. /package/dist/{reporters-MK62LRGW.js.map → reporters-Y2AUVODK.js.map} +0 -0
  237. /package/dist/{run-GUHRZ3OX.js.map → run-SVH32CBO.js.map} +0 -0
  238. /package/dist/{sarif-2BGXPVSR.js.map → sarif-CFQJ5HHP.js.map} +0 -0
  239. /package/dist/{sarif-2L4MLVF5.js.map → sarif-UG7F3WQD.js.map} +0 -0
  240. /package/dist/{sarif-IFFO37SO.js.map → sarif-UHZD2CJ3.js.map} +0 -0
  241. /package/dist/{strategy-BCRB4A55.js.map → strategy-Y4NEJRSH.js.map} +0 -0
  242. /package/dist/{term-HPRQBB2A.js.map → term-LQ2F5WEN.js.map} +0 -0
  243. /package/dist/{types-GV2THIRC.js.map → types-YREQ2DQG.js.map} +0 -0
  244. /package/dist/{validate-TEYFOGI5.js.map → validate-6WBRKEV5.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/docevals/types.ts"],"sourcesContent":["/**\n * Shared result model for manni docevals.\n *\n * Vocabulary follows the \"Docs as Evals\" methodology (Docs as Tests with AI):\n * every check is an *eval*; what differs is its *grader* (code-based, LLM-as-\n * judge, or human). Verdicts are binary pass/fail — aggregate rates emerge from\n * binary judgments, they are never assigned per item.\n */\nimport { ToolError } from \"../shared/errors.js\";\nimport type { Severity } from \"../shared/severity.js\";\nimport type { Guidance } from \"../shared/guidance.js\";\n\n// The judge vocabulary is shared with the inference layer and is re-exported\n// here so manni docevals code and its consumers keep one import site. A second local\n// definition would be a second thing to keep in sync.\n//\n// Match — a single run's verdict; `partial` counts as fail\n// Zone — confidence-zone routing for AI-judged evals\n// JudgeVerdict — the structured verdict of one run (the book's shape)\n// JudgeRun — one run within an ensemble\n// ConsensusResult — the aggregated outcome for one (page, eval) pair\nimport type { ConsensusResult } from \"@hawkeyexl/inference\";\n\nexport type {\n ConsensusResult,\n JudgeRun,\n JudgeVerdict,\n Match,\n Zone,\n} from \"@hawkeyexl/inference\";\n\n/**\n * Regression evals guard behavior that must keep working (~100% target pass\n * rate). Capability evals probe what the docs/system can do (~70% target).\n */\nexport type EvalType = \"capability\" | \"regression\";\n\n/**\n * Finding severity for deterministically graded evals: the family scale,\n * `notice | warning | error`, from `src/shared/severity.ts`. Only `error`\n * affects exit codes.\n */\nexport type { Severity };\n\n/** The page every docevals finding links to. */\nexport const FIX_GUIDE = \"https://hawkeyexl.github.io/manni/docevals/fix/\";\n\n/** How an eval is graded. `tool:regex` is the built-in `tool:*` kind; `registerGrader` adds others. */\nexport type GraderKind = \"ai\" | \"command\" | \"human\" | `tool:${string}`;\n\n/** A normalized finding from a deterministically graded eval (command or tool). */\nexport interface Finding {\n /** Name of the eval that produced this finding. */\n evalName: string;\n /** Repo-relative path of the page the finding applies to. */\n file: string;\n /** Grader-specific rule id (e.g. \"regex/found\"), when available. */\n ruleId?: string;\n message: string;\n severity: Severity;\n /**\n * This finding is about the *grader*, not the page: the tool could not be\n * run, or its output could not be read. It fails the eval whatever severity\n * the eval is configured at, because an eval configured `severity: warning`\n * would otherwise pass while its check never executed (ADR 01022).\n *\n * A finding about the page carries the eval's severity as usual.\n */\n diagnostic?: boolean;\n line?: number;\n col?: number;\n}\n\n/** Result of one eval applied to one page. */\nexport interface EvalResult {\n evalName: string;\n /**\n * Suite this result reports under. Stamped centrally by the engine, which\n * already computes the mapping for the suite summaries — the alternative is\n * threading it through every one of the ~30 places a result is constructed.\n */\n suite?: string;\n type: EvalType;\n grader: GraderKind;\n file: string;\n /**\n * Where the page declares the eval: the item of its `evals` key that names\n * it, in the page or in the manifest that supplied the key (proposal 0037).\n * A suite eval the page never names points at its `eval-suite` key, or at\n * the page alone when the suite is the config's default. `file` is spelled\n * like `file`, and `line` is 1-based and absent when nothing records one.\n *\n * Stamped centrally by the engine, like `suite`, on every result it\n * reports.\n */\n location?: { file: string; line?: number };\n /**\n * The page content this result judged, as `sha256-<hex>`: the SHA-256 of\n * the whole file as the run read it, frontmatter included (proposal 0090).\n * Every result for one page carries the same value. Stamped centrally by\n * the engine, like `suite`.\n */\n integrity?: string;\n /**\n * What the eval asks for (proposal 0089): `id` is the file that declares\n * it, `rule` its name, `description` its assertion, and `guide` the fix\n * page. Stamped centrally by the engine on every result, passing ones too.\n */\n guidance?: Guidance | null;\n outcome: \"pass\" | \"fail\" | \"needs-review\" | \"skipped\" | \"error\";\n /**\n * The persona record ids the judge read the page as, in the page's order\n * (proposal 0111). Present only on a judged result of an eval with\n * `readers: personas` whose page names a persona record.\n */\n personas?: string[];\n /** Present for ai-graded evals. */\n consensus?: ConsensusResult;\n /** Present for command/tool-graded evals that produced findings. */\n findings?: Finding[];\n /** True when this run generated the eval's check script. */\n generated?: boolean;\n /** Set when a persisted human review resolved a needs-review outcome. */\n via?: \"human-review\";\n /**\n * Findings the baseline already recorded and this run therefore suppressed\n * (ADR 01017). Present only on a run with a baseline in effect, so its\n * absence means \"no baseline\", not \"nothing was forgiven\".\n */\n baselined?: number;\n skipReason?: string;\n /**\n * The eval's weight in its suite's pass rate. Stamped centrally by the\n * engine alongside `suite`, and for the same reason: threading it through\n * the ~30 sites that construct a result would be thirty chances to forget.\n */\n weight?: number;\n /**\n * Set when the model that judged this eval also produced what it graded.\n *\n * `content` — the machines attributed for what the eval's `target` reads\n * name this model (`provenance` for the body, the `fields` of\n * `meta-provenance` for the frontmatter, both for `raw`): the judge wrote\n * what it grades. `criterion` — a `meta-provenance` entry for this model\n * lists this eval under `evals`: the judge wrote the question. Both bias a\n * verdict without invalidating it, so this rides along with a real outcome\n * rather than replacing it, and reaches every reporter instead of stderr.\n */\n selfPreference?: { axis: \"content\" | \"criterion\"; model: string };\n durationMs: number;\n}\n\n/** Per-suite aggregate. Pass rates emerge from binary outcomes. */\nexport interface SuiteSummary {\n suite: string;\n total: number;\n passed: number;\n failed: number;\n needsReview: number;\n skipped: number;\n errored: number;\n /**\n * Weighted share of the graded set that passed, 1 when nothing ran.\n *\n * The graded set is pass + fail + error, as it has always been —\n * `needs-review` and `skipped` are in neither half, so a page awaiting review\n * neither helps nor hurts. Each eval contributes its `weight` (1 unless it\n * says otherwise), and an eval that belongs to a criterion contributes\n * nothing on its own: the criterion contributes once, for the group.\n */\n passRate: number;\n /** From config: ~1.0 for regression suites, ~0.7 for capability suites. */\n targetPassRate: number;\n meetsTarget: boolean;\n /**\n * Set when a selection filter (`--eval` / `--suite`) was active, meaning the\n * run measured part of this suite. `meetsTarget` is then always false and the\n * suite cannot fail the run either: it has numbers, but no verdict.\n */\n partial?: boolean;\n /**\n * Criteria scored in this suite. Present only when the suite declares any,\n * so its absence means \"none\", never \"none passed\".\n *\n * `suspended` counts criteria whose members were not all graded in this run.\n * They are out of the rate entirely rather than counted as failures — the\n * same reasoning as `partial` one level down (ADR 01018): a group measured\n * in part has numbers but no verdict.\n */\n criteria?: {\n total: number;\n passed: number;\n failed: number;\n suspended: number;\n };\n}\n\n/** Full run output consumed by reporters. */\nexport interface RunReport {\n pages: number;\n evalResults: EvalResult[];\n suites: SuiteSummary[];\n /**\n * Judge telemetry. Counts, not money: the dollar figure this block used to\n * carry was only as good as a price table this repo does not own, and was\n * absent entirely for `claude-cli` and self-hosted endpoints (ADR 01019).\n */\n usage: {\n totalTokens: number;\n cachedEvals: number;\n judgedEvals: number;\n };\n /** Script generations performed during this run (paths written). */\n generated: string[];\n exitCode: 0 | 1;\n}\n\n/** Operational/usage error → exit code 2. */\nexport class DocevalsError extends ToolError {\n constructor(\n message: string,\n /**\n * Set where a caller acts on the kind of error rather than reporting it.\n * `nothing-resolved`: no page this run would check resolves an eval,\n * including when it finds no page it reads.\n */\n readonly code?: \"nothing-resolved\",\n ) {\n super(message);\n this.name = \"DocevalsError\";\n }\n}\n"],"mappings":";;;;;;AA6CO,IAAM,YAAY;AA6KlB,IAAM,gBAAN,cAA4B,UAAU;AAAA,EAC3C,YACE,SAMS,MACT;AACA,UAAM,OAAO;AAFJ;AAGT,SAAK,OAAO;AAAA,EACd;AAAA,EAJW;AAKb;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/lint/core/rule-id.ts","../src/lint/reporters/junit.ts","../src/lint/reporters/sarif.ts","../src/lint/reporters/alignment.ts","../src/lint/reporters/index.ts"],"sourcesContent":["/**\n * A finding's **rule identity**: `manni:lint/<job>/<rule>`.\n *\n * One id, in one place, for every consumer that files or correlates findings -\n * the SARIF `ruleId`, the JUnit `<failure type>`, the GitHub annotation's\n * `title`, and the `ruleId` the JSON reporter carries beside `type`. A rule id\n * is durable by contract: rename one and every historical alert in a\n * dashboard closes, then reopens as new.\n *\n * Three segments rather than cite's two. The job is what makes a second lint\n * tool possible without collisions: a prose job will report\n * `manni:lint/prose/Google.Passive`, keeping Vale's own rule name because that\n * is the name Vale's documentation uses, and nothing about it can be confused\n * with a structure rule. Proposal 0050 records the shape, and warns that\n * anything parsing family rule ids must not assume two segments.\n *\n * The rule half is derived from the finding's `type` rather than authored\n * beside it. `type` is already the machine-readable name the JSON reporter\n * publishes - manni docevals' grader reads it - so a hand-maintained second\n * table would be one more thing to keep in step, and the derivation cannot\n * drift. `_error` is dropped because it says only that a finding is a finding;\n * `heading_pattern_error` is the rule \"heading-pattern\".\n */\nimport type { LintJob } from \"./config.js\";\n\n/** Every lint rule id starts here. */\nexport const RULE_ID_PREFIX = \"manni:lint\";\n\n/** The tool that performs the structure job, reported beside every finding. */\nexport const TOOL_NAME = \"manni\";\n\n/** The job every finding in this pipeline reports under. */\nexport const STRUCTURE_JOB: LintJob = \"structure\";\n\n/**\n * `heading_pattern_error` -> `heading-pattern`; `parse_error` -> `parse`.\n *\n * Only a trailing `_error` is dropped, so a rule that is genuinely *about*\n * errors keeps the word.\n */\nexport function ruleName(type: string): string {\n return type.replace(/_error$/, \"\").replace(/_/g, \"-\");\n}\n\n/** `manni:lint/<job>/<rule>` for one finding `type`. */\nexport function ruleId(type: string, job: LintJob = STRUCTURE_JOB): string {\n return `${RULE_ID_PREFIX}/${job}/${ruleName(type)}`;\n}\n","/**\n * JUnit XML, rendered through **meta's** writer rather than a second one.\n *\n * There is no authoritative JUnit schema, and the escaping is the part a\n * hand-rolled writer gets wrong - XML 1.0 forbids characters that sit quite\n * happily in a JavaScript string, and one of them makes the whole document\n * unparseable rather than merely mis-rendered. That work is done once, in\n * `src/meta/reporters/junit.ts`, and cite already rides it. So does lint:\n * adapt the run onto meta's `ValidationResult`, hand it to that writer, and\n * the family ships one XML writer, one escaping rule, and one\n * testcase-per-file convention.\n *\n * What is lint's is the two strings that identify the findings as lint's:\n * the `classname` on every `<testcase>`, and the `<failure type>`, which is\n * the namespaced rule id. A finding's template rides along as meta's\n * `guidance`, so each `<failure>` body says what the template asks for.\n */\nimport {\n isErrorSeverity,\n renderJunit as renderJunitXml,\n type FieldError,\n type ValidationResult,\n} from \"../../meta/index.js\";\nimport { RULE_ID_PREFIX, ruleName, STRUCTURE_JOB } from \"../core/rule-id.js\";\nimport type { LintRun } from \"../commands/lint.js\";\n\n/** JUnit `classname` for this tool's findings, as cite's is `manni.cite`. */\nconst JUNIT_CLASSNAME = \"manni.lint\";\n\n/**\n * One finding as a `FieldError`.\n *\n * `schema` and `keyword` are split where they are because meta's `ruleIdFor`\n * joins them with a `/`, and the id it has to produce is\n * `manni:lint/<job>/<rule>`. The prefix is the schema half and stays one\n * segment, which is what keeps it a built-in-shaped ref: a ref containing a\n * slash classifies as a local file, and a caller that passed a path frame\n * would see it rewritten into a relative path. The job and the rule travel\n * together as the keyword.\n *\n * `instancePath` is `\"\"`, the whole document. A structural finding is about a\n * document's shape and not about a pointer into its metadata, so there is no\n * honest pointer to give; meta spells that `(root)`, as it does for its own\n * parse failures. The section the finding is anchored to is already in the\n * message.\n */\nfunction toFieldError(\n finding: LintRun[\"results\"][number][\"findings\"][number],\n): FieldError {\n return {\n schema: RULE_ID_PREFIX,\n instancePath: \"\",\n message:\n finding.heading != null\n ? `${finding.heading}: ${finding.message}`\n : finding.message,\n keyword: `${STRUCTURE_JOB}/${ruleName(finding.type)}`,\n severity: finding.severity,\n line: finding.position.start.line,\n col: finding.position.start.column,\n // What the template asks for, which meta's writer prints in the\n // `<failure>` body, as pretty, GitHub and SARIF print it under the finding.\n guidance: finding.template ?? null,\n };\n}\n\n/**\n * The files this run actually checked, as meta's results.\n *\n * The skipped ones are **not** here, and that is the one place this reporter\n * parts company with the others. A skip has to be reported, or a file nothing\n * looked at is indistinguishable from a file that passed - so pretty says so\n * in words and SARIF files a `toolExecutionNotification`. JUnit has neither:\n * meta's writer emits a testcase or a testcase with a failure, so a skipped\n * file can only arrive as a green test. That is worse than absent. It claims a\n * pass on evidence nobody gathered, and it puts the suite's `tests` count three\n * above the `2 files checked, 3 skipped` the same run prints.\n *\n * So the count here is the run's `checked`, by construction: one testcase per\n * file that was linted.\n */\nexport function toValidationResults(run: LintRun): ValidationResult[] {\n return run.results\n .filter((result) => result.skipped == null)\n .map((result) => ({\n file: result.file,\n // meta's `format` is the extractor that read the file. A lint result does\n // not carry the parser that produced its tree, and no reporter reached\n // through here reads the field, so it names the domain rather than\n // inventing a format the run never recorded.\n format: \"lint\",\n // meta's invariant, not a count: `ok` is \"no error-severity finding\".\n // Read as \"no findings at all\", a file whose only finding is a warning\n // renders as a `✗` through meta's own pretty reporter - which is a\n // legitimate consumer, since this function is exported - while lint's\n // exit code says the run passed.\n ok: !result.findings.some(isErrorSeverity),\n schemas: [RULE_ID_PREFIX],\n errors: result.findings.map(toFieldError),\n }));\n}\n\n/**\n * Straight to meta's JUnit writer rather than through its `render`, which\n * takes a `RunSummary` its junit branch does not forward. Building one here\n * only to have it dropped read as though the suite's counts came from the run,\n * and they do not: they are the length of the list above and how much of it\n * carries an error-severity finding.\n */\nexport function renderJunit(run: LintRun): string {\n return renderJunitXml(toValidationResults(run), {\n classname: JUNIT_CLASSNAME,\n });\n}\n","/**\n * SARIF 2.1.0, the format GitHub code scanning ingests.\n *\n * `github` annotations live and die with one check run: no history, nothing to\n * query, and nothing outside GitHub Actions reads them at all. SARIF is the\n * same findings as a durable artifact - uploaded once, tracked across commits,\n * and understood by every dashboard that speaks the standard.\n *\n * The format's failure mode is silence. A SARIF file with a malformed URI, or\n * with results whose `ruleId` names no declared rule, uploads successfully and\n * then annotates nothing: a green check and an empty dashboard. So the two\n * things most likely to be wrong are the two things this module is most\n * careful about - rule descriptors, and URIs.\n */\nimport type {\n Finding,\n FindingTemplate,\n Position,\n Severity,\n SkipReason,\n} from \"../types.js\";\nimport type { LintFileResult, LintRun } from \"../commands/lint.js\";\nimport { ruleId, ruleName } from \"../core/rule-id.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport {\n artifactLocation,\n fileUri,\n normalizeRoot,\n URI_BASE_ID,\n type ArtifactLocation,\n} from \"../../shared/sarif-location.js\";\n\nconst SARIF_VERSION = \"2.1.0\";\nconst SARIF_SCHEMA =\n \"https://docs.oasis-open.org/sarif/sarif/v2.1.0/errata01/os/schemas/sarif-schema-2.1.0.json\";\n/**\n * Where code scanning sends someone who clicks \"more information\" on an alert.\n *\n * Deliberately the post-rename URL, which 404s until `doc-structure-lint` is\n * renamed on GitHub - a manual step outside this repo. Pointing it at the\n * current name instead would mean every SARIF report published from the day of\n * the rename onward links somewhere that has moved, and reports outlive the\n * rename; a link that is briefly wrong beats one that is permanently wrong.\n * `package.json`'s `repository` and `bugs` URLs are forward-looking for the\n * same reason, so all three flip together or not at all.\n */\nconst INFORMATION_URI = \"https://github.com/hawkeyexl/manni\";\n\ntype SarifLevel = \"error\" | \"warning\" | \"note\" | \"none\";\n\ninterface SarifMessage {\n text: string;\n}\n\ninterface ReportingDescriptor {\n id: string;\n name: string;\n shortDescription: SarifMessage;\n defaultConfiguration?: { level: SarifLevel };\n}\n\ninterface Region {\n startLine: number;\n startColumn: number;\n endLine: number;\n endColumn: number;\n}\n\ninterface SarifLocation {\n physicalLocation: { artifactLocation: ArtifactLocation; region?: Region };\n}\n\ninterface SarifResult {\n ruleId: string;\n ruleIndex?: number;\n level: SarifLevel;\n message: SarifMessage;\n locations: SarifLocation[];\n properties?: { heading?: string; template?: FindingTemplate };\n}\n\ninterface SarifNotification {\n descriptor: { id: string; index: number };\n level: SarifLevel;\n message: SarifMessage;\n locations: SarifLocation[];\n}\n\ninterface SarifInvocation {\n executionSuccessful: boolean;\n toolExecutionNotifications?: SarifNotification[];\n}\n\ninterface SarifDriver {\n name: string;\n informationUri: string;\n version: string;\n rules: ReportingDescriptor[];\n notifications?: ReportingDescriptor[];\n}\n\ninterface SarifLog {\n $schema: string;\n version: string;\n runs: {\n tool: { driver: SarifDriver };\n originalUriBaseIds: Record<string, { uri: string }>;\n invocations: SarifInvocation[];\n results: SarifResult[];\n }[];\n}\n\nexport interface SarifOptions {\n /**\n * Directory the relative paths in `LintRun` are relative to - the lint run's\n * `cwd`. Defaults to the process cwd, which is what `runLint` itself\n * defaults to. It is a parameter rather than a bare read of `process.cwd()`\n * so the URI mapping, the part most likely to be silently wrong, is testable\n * without moving the whole process into a fixture directory.\n */\n root?: string;\n}\n\n/**\n * The family scale -> SARIF `level`. A total map rather than a ternary, so a\n * fourth severity fails to compile here instead of quietly becoming `error`.\n *\n * The family's three values were chosen to be GitHub's, and SARIF agrees on\n * two of them; it spells the lowest one `note`. meta's reporter folds\n * `notice` onto `note` the same way, so a repository uploading both tools'\n * reports sees one scale. SARIF's `none` has no `Severity` that means it.\n */\nconst LEVELS: Record<Severity, SarifLevel> = {\n notice: \"note\",\n warning: \"warning\",\n error: \"error\",\n};\n\n/**\n * Why a file went unlinted, in words. `Record<SkipReason, ...>` on purpose: a\n * new skip reason should fail to compile until someone has decided what the\n * report says about it.\n */\nconst SKIP_DESCRIPTIONS: Record<SkipReason, string> = {\n \"no-template\": \"File was not linted: no template resolved for it.\",\n \"unsupported-format\": \"File was not linted: no parser handles its format.\",\n unreadable: \"File was not linted: it could not be read.\",\n excluded: \"File was not linted: the Flare target excludes it by its conditions.\",\n};\n\n/**\n * Positions map straight across, with no arithmetic.\n *\n * Both sides are 1-based in line and column. Both also treat the end column as\n * exclusive: SARIF defines `endColumn` as \"the column number of the character\n * following the end of the region\", and `Position` in types.ts is documented\n * as a half-open span with `end` exclusive. Checked against what the parser\n * actually emits rather than taken on trust - remark gives `# Hi`, four\n * characters on line 1, an `end.column` of 5, one past the last character,\n * which is precisely SARIF's convention. So no +1 and no -1 in either\n * direction. A zero-width span (`origin()`, used by findings with nowhere\n * better to point) becomes a zero-length region, which SARIF allows.\n */\nfunction region(position: Position): Region {\n return {\n startLine: position.start.line,\n startColumn: position.start.column,\n endLine: position.end.line,\n endColumn: position.end.column,\n };\n}\n\nfunction location(\n file: string,\n root: string,\n position?: Position,\n): SarifLocation {\n return {\n physicalLocation: {\n artifactLocation: artifactLocation(file, root),\n region: position ? region(position) : undefined,\n },\n };\n}\n\n/**\n * The heading goes in the message *and* in `properties`.\n *\n * In the message because most SARIF viewers show the message and nothing else\n * beside the line: \"Expected at least 2 paragraphs, found 1\" is a different\n * sentence depending on which section it is about, and dropping the heading\n * would make the SARIF annotation less informative than the `github` one for\n * the very same finding. In `properties.heading` because a message is prose\n * and nothing can group or filter on it - a consumer asking for \"every finding\n * under Prerequisites\" should not have to parse English back out.\n *\n * Unlike `renderGithub`, newlines are left intact. A workflow command is one\n * line by definition; a SARIF message is a JSON string with no such limit.\n */\nfunction messageText(finding: Finding): string {\n const text =\n finding.heading != null ? `${finding.heading}: ${finding.message}` : finding.message;\n return [text, ...guidanceLines(finding.template)].join(\"\\n\");\n}\n\nfunction words(id: string): string[] {\n return id.split(/[^A-Za-z0-9]+/).filter(Boolean);\n}\n\n/**\n * `missing_section` -> `MissingSection`. SARIF asks a descriptor `name` to be\n * a single Pascal-case identifier, and GitHub shows it in the rule list.\n */\nfunction pascalCase(id: string): string {\n return words(id)\n .map((w) => w.charAt(0).toUpperCase() + w.slice(1))\n .join(\"\");\n}\n\n/**\n * `missing_section` -> `Missing section`. Derived from the id, not authored:\n * there is no rule catalog to draw a real description from, and the first\n * finding's message describes one occurrence rather than the rule. Restating\n * the id in prose says nothing new, but it beats an empty column in GitHub's\n * rule list and it can never drift out of step with the rule it describes.\n */\nfunction humanize(id: string): string {\n const text = words(id).join(\" \");\n return text.charAt(0).toUpperCase() + text.slice(1);\n}\n\ninterface RuleIndex {\n descriptors: ReportingDescriptor[];\n indexOf: Map<string, number>;\n}\n\n/**\n * One `reportingDescriptor` per distinct finding type, in order of first\n * appearance.\n *\n * This is not optional decoration. A result carrying a `ruleId` that matches\n * no descriptor is accepted by GitHub code scanning and then rendered without\n * a rule name, a description, or a working filter - the alert arrives stripped\n * of everything that makes a dashboard usable, and with no error to explain\n * why.\n */\nfunction buildRules(run: LintRun): RuleIndex {\n const indexOf = new Map<string, number>();\n const order: string[] = [];\n const severities = new Map<string, Set<Severity>>();\n\n for (const result of run.results) {\n for (const finding of result.findings) {\n let seen = severities.get(finding.type);\n if (!seen) {\n seen = new Set<Severity>();\n severities.set(finding.type, seen);\n indexOf.set(finding.type, order.length);\n order.push(finding.type);\n }\n seen.add(finding.severity);\n }\n }\n\n const descriptors = order.map((type) => {\n // The descriptor id is the **family** rule id, not the internal `type`:\n // it is what an alert is filed and de-duplicated under, and it has to be\n // the string every other reporter uses for the same finding. `name` and\n // `shortDescription` are derived from the rule half alone, so GitHub's\n // rule list reads \"MissingSection\", not \"ManniLintStructureMissingSection\".\n const rule = ruleName(type);\n const descriptor: ReportingDescriptor = {\n id: ruleId(type),\n name: pascalCase(rule),\n shortDescription: { text: humanize(rule) },\n };\n // Only when every finding of this type agreed on a severity. Severity is\n // per finding, not per rule, so a type that appeared as both an error and\n // a warning has no honest default - and every result states its own\n // `level` regardless, which is what a consumer actually reads.\n const [only, ...rest] = [...(severities.get(type) ?? [])];\n if (only !== undefined && rest.length === 0) {\n descriptor.defaultConfiguration = { level: LEVELS[only] };\n }\n return descriptor;\n });\n\n return { descriptors, indexOf };\n}\n\nfunction propertiesOf(finding: Finding): SarifResult[\"properties\"] {\n const properties: NonNullable<SarifResult[\"properties\"]> = {};\n if (finding.heading != null) properties.heading = finding.heading;\n if (finding.template != null) properties.template = finding.template;\n return Object.keys(properties).length > 0 ? properties : undefined;\n}\n\nfunction toResult(\n finding: Finding,\n file: string,\n rules: RuleIndex,\n root: string,\n): SarifResult {\n return {\n ruleId: ruleId(finding.type),\n // Always populated in practice, since the index is built from these same\n // findings. Omitted rather than faked if it ever is not: a wrong index\n // points the alert at somebody else's rule, which is worse than none.\n ruleIndex: rules.indexOf.get(finding.type),\n level: LEVELS[finding.severity],\n message: { text: messageText(finding) },\n locations: [location(file, root, finding.position)],\n properties: propertiesOf(finding),\n };\n}\n\ninterface SkipReport {\n descriptors: ReportingDescriptor[];\n notifications: SarifNotification[];\n}\n\n/**\n * Skipped files become `toolExecutionNotifications`, not results.\n *\n * They cannot simply be dropped - the pretty reporter's rule applies here too:\n * a file that leaves no trace in the report is indistinguishable from a file\n * that passed, and a docset mid-onboarding is mostly unrouted pages. Reading\n * that as a clean bill of health is the exact failure this format exists to\n * prevent.\n *\n * They are not results either. A result is a statement about the content of a\n * document; a skip is a statement about the tool, which declined to look. As\n * results they would open code-scanning alerts against files nothing has\n * examined, and each of those would then have to be triaged and dismissed by\n * hand. `toolExecutionNotifications` is the slot SARIF defines for \"the tool\n * has something to say about its own execution\", which is what a skip is.\n *\n * Level `note` rather than SARIF's default of `warning`: on a repository that\n * has not adopted doctypes yet nearly every page is skipped, and a warning\n * stream that long is one nobody reads.\n */\nfunction buildSkips(run: LintRun, root: string): SkipReport {\n const indexOf = new Map<string, number>();\n const descriptors: ReportingDescriptor[] = [];\n const notifications: SarifNotification[] = [];\n\n for (const result of run.results) {\n const reason = result.skipped;\n if (reason == null) continue;\n\n let index = indexOf.get(reason);\n if (index === undefined) {\n index = descriptors.length;\n indexOf.set(reason, index);\n descriptors.push({\n id: reason,\n name: pascalCase(reason),\n shortDescription: { text: SKIP_DESCRIPTIONS[reason] },\n });\n }\n\n notifications.push({\n // Declared in `tool.driver.notifications` and referenced by id *and*\n // index, for the same reason results reference their rules both ways.\n descriptor: { id: reason, index },\n level: \"note\",\n message: { text: skipMessage(result, reason) },\n locations: [location(result.file, root)],\n });\n }\n\n return { descriptors, notifications };\n}\n\n/** The specific reason when the run recorded one, the generic one otherwise. */\nfunction skipMessage(result: LintFileResult, reason: SkipReason): string {\n return result.reason ?? SKIP_DESCRIPTIONS[reason];\n}\n\nexport function renderSarif(run: LintRun, opts: SarifOptions = {}): string {\n const root = normalizeRoot(opts.root ?? process.cwd());\n const rules = buildRules(run);\n const skips = buildSkips(run, root);\n\n const results = run.results.flatMap((result) =>\n result.findings.map((finding) =>\n toResult(finding, result.file, rules, root),\n ),\n );\n\n const driver: SarifDriver = {\n name: \"manni-lint\",\n informationUri: INFORMATION_URI,\n version: pkg.version,\n // Emitted even when empty: results point into this array, so a consumer\n // always looks here, and a stable shape is cheaper than a special case.\n rules: rules.descriptors,\n notifications: skips.descriptors.length > 0 ? skips.descriptors : undefined,\n };\n\n const invocation: SarifInvocation = {\n // Findings are the tool doing its job, not failing at it. This would only\n // be false if manni lint itself could not run, and that path exits 2\n // before any report is rendered.\n executionSuccessful: true,\n toolExecutionNotifications:\n skips.notifications.length > 0 ? skips.notifications : undefined,\n };\n\n const log: SarifLog = {\n $schema: SARIF_SCHEMA,\n version: SARIF_VERSION,\n runs: [\n {\n tool: { driver },\n // Declared unconditionally: it is what makes every relative `uri` in\n // this report mean anything, and a reader should not have to infer the\n // base from whether some result happened to use it.\n originalUriBaseIds: { [URI_BASE_ID]: { uri: fileUri(root) } },\n invocations: [invocation],\n results,\n },\n ],\n };\n\n return JSON.stringify(log, null, 2);\n}\n","/**\n * The alignment block `--explain` prints under each routed file: which rule\n * claimed which section, and why. It is lint's answer to \"why did it say\n * that\" for the matcher in `core/match.ts` - proposal 0061's stress test 3\n * names this as the cost of an alignment matcher over a left-to-right one: a\n * tie is invisible unless something prints the pairing it chose.\n *\n * This module recomputes the alignment itself by calling the matcher's own,\n * already-exported `matchSections` - it does not reach into `align()`'s\n * internal step sequence, which is module-private. That has one visible\n * consequence: this file has no way to know the *document position* a missing\n * rule or an unexpected section falls at relative to the other, so a missing\n * rule is placed among the sections that did match using rule order alone\n * (`insertMissing` below), which is exact whenever - as in every template this\n * repository ships - the missing rule is not sandwiched between two unexpected\n * sections with nothing matched between them. `core/match.ts` is read-only\n * from here; exporting the step sequence, if this ever needs to be exact, is a\n * change to that file rather than to this one.\n *\n * The other thing this module cannot get from an export: which key in a\n * page's frontmatter is its title. It assumes `title`, the same key\n * `manni meta`'s own schemas require, and re-reads `tree.frontmatter`\n * directly rather than asking a caller to resolve it, so the assumption lives\n * in exactly one place.\n *\n * **The seam this depends on.** `commands/lint.ts` parses every file and\n * loads its template before `--explain` returns - both already exist at that\n * point in `lintOne` - but neither is currently attached to the\n * `LintFileResult` it returns. `render()` (`reporters/index.ts`) reads them\n * off a result through `ExplainSource`, structurally: a result carrying\n * `tree` and `template` gets an alignment block, and one that does not is\n * printed exactly as before. Wiring `commands/lint.ts` to attach them is\n * outside this chunk's files (`src/lint/commands/lint.ts` is not among them).\n */\nimport { LintError, type DocumentTree, type SectionNode } from \"../types.js\";\nimport { matchSections, type Match } from \"../core/match.js\";\nimport { occurrenceRange, type Rule, type Template } from \"../core/template.js\";\n\n/** What a caller must attach to a `LintFileResult` for the block to render. */\nexport interface ExplainSource {\n tree: DocumentTree;\n template: Template;\n}\n\n/** One line of the block, before indentation is joined on. */\nexport interface AlignmentRow {\n depth: number;\n text: string;\n}\n\nconst LABEL_WIDTH = 22;\nconst ARROW = \"←\"; // ←\nconst ELLIPSIS = \"…\"; // …\nconst TIMES = \"×\"; // ×\n\nfunction pad(label: string): string {\n return label.length >= LABEL_WIDTH ? `${label} ` : label.padEnd(LABEL_WIDTH + 1);\n}\n\n/** A section's title, quoted, or `(no heading)` for one that has none. */\nfunction titleText(title: string | null): string {\n return title === null ? \"(no heading)\" : `\"${title}\"`;\n}\n\n/**\n * A rule's display name: its `id` where it has one, else a literal string\n * `heading`, else `(any)` for anything else - an array, a `{ pattern }`,\n * `heading: false`, or a bare wildcard. Mirrors the priority `--explain`'s\n * spec states, which is not the same order `missingMessage` in `match.ts`\n * uses for its prose: that picks the heading first because it is read as a\n * sentence, and this picks the id first because it is a column header.\n */\nfunction ruleLabel(rule: Rule): string {\n if (rule.id !== undefined) return rule.id;\n if (typeof rule.heading === \"string\") return rule.heading;\n return \"(any)\";\n}\n\n/**\n * The page's own heading, and the note explaining where it came from.\n *\n * Mirrors `validator.ts`'s private `pageSection`: a lone top-level heading\n * *is* the page. Most of the time that heading is not literal, though - every\n * parser with both frontmatter and headings (`parsers/metadata.ts`'s\n * `withMetadataTitle`) already synthesizes an H1 from `frontmatter.title` when\n * the body has none, positioned on the frontmatter block itself, precisely so\n * a template written against \"the page's title is its outermost rule\" does\n * not have to know the difference. By the time a tree reaches here that\n * difference is gone from the section's own fields - so it is recovered the\n * same way `titlePosition` was set: a synthesized heading's position is\n * `tree.frontmatterPosition`, verbatim.\n *\n * `frontmatter.title` is read directly only as a fallback, for a tree a\n * caller built by some other means - the programmatic API accepts one from\n * anywhere - where no such synthesis ran at all.\n */\nfunction pageHeading(tree: DocumentTree): { text: string | null; note: string | null } {\n const [only] = tree.sections;\n if (tree.sections.length === 1 && only && only.level <= 1) {\n const text = only.title || null;\n if (text === null) return { text: null, note: \"no heading\" };\n const synthesized =\n only.titlePosition !== null &&\n tree.frontmatterPosition !== null &&\n only.titlePosition.start.offset === tree.frontmatterPosition.start.offset &&\n only.titlePosition.end.offset === tree.frontmatterPosition.end.offset;\n return { text, note: synthesized ? \"synthesized from frontmatter\" : null };\n }\n const raw = tree.frontmatter?.[\"title\"];\n const text = typeof raw === \"string\" && raw !== \"\" ? raw : null;\n return { text, note: text === null ? \"no heading\" : \"synthesized from frontmatter\" };\n}\n\n/** The sections a template's `sections:` rules describe - `pageSection`'s subject. */\nfunction pageSections(tree: DocumentTree): SectionNode[] {\n const [only] = tree.sections;\n if (tree.sections.length === 1 && only && only.level <= 1) return only.sections;\n return tree.sections;\n}\n\n/**\n * One matched or collapsed run of matches, rendered as a single row.\n *\n * Both call sites build `run` by pushing one already-known `Match` before\n * ever calling this, so it is never empty; the guard below exists to let the\n * checker see that rather than to handle a real empty-run case.\n */\nfunction matchedRow(depth: number, run: Match[]): AlignmentRow {\n const head = run[0];\n if (!head) return { depth, text: `${pad(\"(empty run)\")}${ARROW} (missing)` };\n const rule = head.rule;\n const first = head.section;\n const last = (run[run.length - 1] ?? head).section;\n const label = run.length === 1 ? ruleLabel(rule) : `${ruleLabel(rule)} ${TIMES}${run.length}`;\n // Coercion can only ever land on a run of length 1: `ALIGNMENT_COSTS.coerce`\n // is open only to a required occurrence whose `max` is 1 (`match.ts`'s\n // header explains why), and a rule with `max: 1` can never contribute a\n // second match to a run.\n const coerced = run.length === 1 && head.coerced ? \" (coerced)\" : \"\";\n const arrow =\n run.length === 1\n ? `${titleText(first.title || null)}${coerced}`\n : `${titleText(first.title || null)} ${ELLIPSIS} ${titleText(last.title || null)}`;\n return { depth, text: `${pad(label)}${ARROW} ${arrow}` };\n}\n\n/**\n * What an absent rule is called.\n *\n * `(missing)` means exactly what produces a `missing_section` finding, so it\n * is reserved for a rule that had to appear. An optional rule that took\n * nothing is `(none)`: absent, and fine. Sharing one word made a page that\n * lints clean print a row saying something was missing from it, which is the\n * opposite of what `--explain` is for.\n */\nfunction absentLabel(rule: Rule): string {\n return occurrenceRange(rule).min > 0 ? \"(missing)\" : \"(none)\";\n}\n\n/** A rule with nothing to show, or a `repeat` group with nothing at all. */\nfunction missingRows(depth: number, rule: Rule): AlignmentRow[] {\n if (!rule.repeat) {\n return [{ depth, text: `${pad(ruleLabel(rule))}${ARROW} ${absentLabel(rule)}` }];\n }\n // A group's members inherit the group's own occurrence: a member of an\n // optional group is not missing when the whole group never ran.\n const label = absentLabel(rule);\n const rows: AlignmentRow[] = [{ depth, text: pad(rule.id ?? \"(repeat)\").trimEnd() }];\n for (const member of rule.repeat) {\n rows.push({ depth: depth + 1, text: `${pad(ruleLabel(member))}${ARROW} ${label}` });\n }\n return rows;\n}\n\n/**\n * Insert `missing`, each tagged with the index of the rule it is about, among\n * `matched` entries tagged the same way (`null` for one that has no rule -\n * an unexpected section). A missing rule never displaces an unexpected\n * section: only a matched entry's index gates it, so an unexpected section is\n * carried along in whichever position document order already put it in.\n */\nfunction insertMissing(\n matched: { index: number | null; rows: AlignmentRow[] }[],\n missing: { index: number; rows: AlignmentRow[] }[],\n): AlignmentRow[] {\n const out: AlignmentRow[] = [];\n let mi = 0;\n for (const entry of matched) {\n while (mi < missing.length) {\n // `mi < missing.length` just guarded this, so `next` is always here;\n // the check only lets the type checker see the invariant the loop\n // bound already established.\n const next = missing[mi];\n if (!next || (entry.index !== null && next.index >= entry.index)) break;\n out.push(...next.rows);\n mi++;\n }\n out.push(...entry.rows);\n }\n while (mi < missing.length) {\n const next = missing[mi];\n if (!next) break;\n out.push(...next.rows);\n mi++;\n }\n return out;\n}\n\n/**\n * One level: `rules` against `sections`, and every matched pair's own\n * subsections.\n *\n * A `repeat` member's `Match.rule` is the member itself, never the group\n * (`match.ts`'s `compile` only ever assigns an occurrence to a leaf rule), so\n * a group is never a key in `matches`. `rootOf` recovers \"which top-level\n * rule is this a member of\" - itself, for a rule with no group - which is\n * what lets a group be judged matched or missing as one thing while still\n * naming which of its members carried the section.\n */\nfunction alignLevel(\n rules: Rule[] | undefined,\n sections: SectionNode[],\n parent: SectionNode | null,\n depth: number,\n): AlignmentRow[] {\n // `undefined` is the template saying nothing about this level - silence,\n // not \"no sections allowed\" - so there is nothing to align and nothing to\n // print. `matchSections` draws the same line; this mirrors it rather than\n // passing `[]` through, which would turn silence into every section here\n // reading as unexpected.\n if (rules === undefined) return [];\n\n const { matches } = matchSections(sections, rules, { parent });\n const ruleIndex = new Map<Rule, number>(rules.map((r, i) => [r, i]));\n const rootOf = new Map<Rule, Rule>();\n for (const rule of rules) {\n if (rule.repeat) for (const member of rule.repeat) rootOf.set(member, rule);\n else rootOf.set(rule, rule);\n }\n const rootOfRule = (rule: Rule): Rule => rootOf.get(rule) ?? rule;\n const matchedRoots = new Set(matches.map((m) => rootOfRule(m.rule)));\n const bySection = new Map<SectionNode, Match>(matches.map((m) => [m.section, m]));\n\n const matched: { index: number | null; rows: AlignmentRow[] }[] = [];\n let i = 0;\n while (i < sections.length) {\n // `i < sections.length` just guarded this; `section` always exists.\n const section = sections[i];\n if (!section) break;\n const match = bySection.get(section);\n if (!match) {\n matched.push({\n index: null,\n rows: [{ depth, text: `(unexpected) ${titleText(section.title || null)}` }],\n });\n i++;\n continue;\n }\n\n const root = rootOfRule(match.rule);\n if (root.repeat) {\n // Every section, in this run, that belongs to this same group - by\n // whichever member took it, not necessarily the same one twice.\n const taken: Match[] = [];\n while (i < sections.length) {\n const here = sections[i];\n if (!here) break;\n const next = bySection.get(here);\n if (!next || rootOfRule(next.rule) !== root) break;\n taken.push(next);\n i++;\n }\n const rows: AlignmentRow[] = [{ depth, text: pad(root.id ?? \"(repeat)\").trimEnd() }];\n let run: Match[] = [];\n const flushMember = (): void => {\n if (run.length === 0) return;\n rows.push(matchedRow(depth + 1, run));\n for (const m of run) {\n rows.push(...alignLevel(m.rule.sections, m.section.sections, m.section, depth + 2));\n }\n run = [];\n };\n for (const m of taken) {\n const first = run[0];\n if (first && first.rule !== m.rule) flushMember();\n run.push(m);\n }\n flushMember();\n // A member this occurrence never reached prints missing beside the\n // members it did, the same information `missingRows` gives a group with\n // nothing at all.\n const takenMembers = new Set(taken.map((m) => m.rule));\n for (const member of root.repeat) {\n if (takenMembers.has(member)) continue;\n rows.push({ depth: depth + 1, text: `${pad(ruleLabel(member))}${ARROW} (missing)` });\n }\n matched.push({ index: ruleIndex.get(root) ?? null, rows });\n continue;\n }\n\n // A plain rule: gather the run of consecutive sections it claimed.\n const run: Match[] = [match];\n i++;\n while (i < sections.length) {\n const here = sections[i];\n if (!here) break;\n const next = bySection.get(here);\n if (!next || next.rule !== match.rule) break;\n run.push(next);\n i++;\n }\n const rows = [matchedRow(depth, run)];\n for (const m of run) {\n rows.push(...alignLevel(m.rule.sections, m.section.sections, m.section, depth + 1));\n }\n matched.push({ index: ruleIndex.get(match.rule) ?? null, rows });\n }\n\n const missing = rules\n .filter((rule) => !matchedRoots.has(rule))\n .map((rule) => {\n const index = ruleIndex.get(rule);\n if (index === undefined) {\n // `ruleIndex` is built from this exact `rules` array above, so every\n // rule reached here (it came from filtering `rules` itself) has an\n // entry; this is unreachable.\n //\n // `LintError` rather than `Error` even so. Everything this tool throws\n // is caught by the bin runner and exits 2, an operational error; a bare\n // `Error` would escape that and exit 1, which means \"the documents have\n // findings\". An internal fault must never be reported as a lint result.\n throw new LintError(\"alignLevel: rule missing from its own index\");\n }\n return { index, rows: missingRows(depth, rule) };\n });\n\n return insertMissing(matched, missing);\n}\n\n/** The full alignment block for one file: the page row, then its sections. */\nexport function explainAlignment(tree: DocumentTree, template: Template): AlignmentRow[] {\n const heading = pageHeading(tree);\n const arrow =\n heading.text !== null\n ? `${titleText(heading.text)}${heading.note ? ` (${heading.note})` : \"\"}`\n : `(${heading.note ?? \"no heading\"})`;\n const rows: AlignmentRow[] = [{ depth: 0, text: `${pad(\"(page)\")}${ARROW} ${arrow}` }];\n rows.push(...alignLevel(template.sections, pageSections(tree), null, 1));\n return rows;\n}\n\n/** `AlignmentRow[]` as the indented text `renderExplain` prints, two spaces per depth. */\nexport function formatAlignment(rows: AlignmentRow[]): string[] {\n return rows.map((row) => `${\" \".repeat(row.depth)}${row.text}`);\n}\n","/**\n * Reporters render a run to a string. The CLI writes the result to stdout;\n * diagnostics go to stderr separately, so a report is never interleaved with\n * anything a consumer has to parse around.\n */\nimport { LintError, type Finding } from \"../types.js\";\nimport type { LintFileResult, LintRun } from \"../commands/lint.js\";\nimport type { FormatInfo, ToolInfo } from \"../commands/tools.js\";\nimport type { TemplateInfo, TemplatesInfo } from \"../commands/templates.js\";\nimport { palette, type Colors } from \"../../shared/color.js\";\nimport {\n escapeWorkflowCommandMessage,\n escapeWorkflowCommandProperty,\n} from \"../../shared/github.js\";\nimport type { ReportFormat as FamilyFormat } from \"../../meta/index.js\";\nimport { REPORT_FORMAT_LIST } from \"../../meta/internal.js\";\nimport { ruleId, TOOL_NAME } from \"../core/rule-id.js\";\nimport { renderJunit } from \"./junit.js\";\nimport { renderSarif } from \"./sarif.js\";\nimport { guidanceLines } from \"../../shared/guidance.js\";\nimport { explainAlignment, formatAlignment, type ExplainSource } from \"./alignment.js\";\n\nexport { renderJunit, toValidationResults } from \"./junit.js\";\n\n/**\n * Every `-f` value, plus `--explain`.\n *\n * The findings formats are the family's, taken from meta rather than restated,\n * so a format added there is available here the moment lint's `render` grows a\n * case for it - and a value lint does not handle is a compile error instead of\n * a silent fall-through to pretty. `explain` is lint's own: it is reachable\n * through `--explain` and never through `-f`, because it reports on\n * configuration rather than on documents.\n */\nexport type ReportFormat = FamilyFormat | \"explain\";\n\n/** Listing commands have nothing to annotate, so they offer no `github`. */\nexport type ListFormat = \"pretty\" | \"json\";\n\nexport interface ReportOptions {\n color?: boolean;\n /**\n * Directory the run's relative paths are relative to, forwarded to the SARIF\n * reporter and ignored by the others. Defaults to the process cwd, which is\n * right for the CLI because `runLint` defaults its `cwd` the same way.\n *\n * It is here rather than only on `renderSarif` because `render` is the entry\n * point a library caller reaches for, and without it that caller was pinned\n * to the process cwd with no way out short of bypassing `render` entirely -\n * for the one reporter whose whole output is paths.\n */\n root?: string;\n}\n\nfunction plural(n: number, word: string): string {\n return `${n} ${word}${n === 1 ? \"\" : \"s\"}`;\n}\n\n/** `line:column` of a finding, the anchor an editor can jump to. */\nfunction locate(finding: Finding): string {\n return `${finding.position.start.line}:${finding.position.start.column}`;\n}\n\n/** A finding as prose: the heading it is about, then what is wrong with it. */\nfunction describeFinding(finding: Finding): string {\n return finding.heading != null\n ? `${finding.heading}: ${finding.message}`\n : finding.message;\n}\n\n/**\n * A finding's level prefix, meta's shape: nothing for an error, since the\n * `✗`/`✓` mark already says that; the word itself, coloured, for anything\n * milder. Keeps a passing file's warning from reading as just another\n * anonymous line once it is printed beside real errors on a failing one.\n */\nfunction levelPrefix(c: Colors, severity: Finding[\"severity\"]): string {\n if (severity === \"error\") return \"\";\n return `${severity === \"notice\" ? c.dim(\"notice\") : c.yellow(\"warning\")} `;\n}\n\nexport function renderPretty(run: LintRun, opts: ReportOptions = {}): string {\n const c = palette(opts.color ?? false);\n const lines: string[] = [];\n let warnings = 0;\n let notices = 0;\n\n for (const result of run.results) {\n // A skip is reported, never silently dropped: an unreadable format that\n // leaves no trace is indistinguishable from a file that passed.\n if (result.skipped != null) {\n const why = result.reason ?? result.skipped;\n lines.push(`${c.yellow(\"-\")} ${result.file} ${c.dim(`skipped: ${why}`)}`);\n continue;\n }\n if (result.success && result.findings.length === 0) {\n lines.push(`${c.green(\"✓\")} ${result.file}`);\n continue;\n }\n // `success` means \"no error-severity finding\", not \"no findings\" - a\n // passing file can still hold a warning, such as\n // `unsupported_content_kind`. Reusing `✓` for it would hide the warning\n // behind the same glyph a clean file gets; reusing `✗` would fail a file\n // nothing actually failed. `⚠` (meta's and cite's mark for the same case)\n // says \"passing, but read this\" without claiming either extreme.\n const mark = result.success ? c.yellow(\"⚠\") : c.red(\"✗\");\n lines.push(`${mark} ${result.file}`);\n for (const finding of result.findings) {\n // Counted apart, because they are not the same thing to a reader. Every\n // structure finding used to be an `error` or the occasional `warning`,\n // so \"not an error\" and \"a warning\" were the same set. DITA-OT reports an\n // undefined key reference at `notice`, and calling that a warning on the\n // summary line overstates it.\n if (finding.severity === \"warning\") warnings++;\n else if (finding.severity === \"notice\") notices++;\n // The namespaced id rather than the bare `type`: it is what SARIF,\n // JUnit and the GitHub annotation file the finding under, so the string\n // a reader copies out of the terminal is the one they can search for.\n lines.push(\n ` ${c.dim(locate(finding))} ${c.cyan(ruleId(finding.type))} ` +\n `${levelPrefix(c, finding.severity)}${describeFinding(finding)}`,\n );\n // What the template asks for, under the rule id it explains.\n const indent = \" \".repeat(6 + locate(finding).length);\n for (const line of guidanceLines(finding.template)) lines.push(`${indent}${c.dim(line)}`);\n }\n }\n\n const { checked, passed, failed, skipped } = run.summary;\n // Named only when there are any, as meta and cite do: every run against a\n // format that reports every content kind has none.\n const warningsText = warnings > 0 ? `, ${plural(warnings, \"warning\")}` : \"\";\n const noticesText = notices > 0 ? `, ${plural(notices, \"notice\")}` : \"\";\n const summary = `${plural(checked, \"file\")} checked, ${passed} passed, ${failed} failed, ${skipped} skipped${warningsText}${noticesText}`;\n if (lines.length > 0) lines.push(\"\");\n lines.push(failed > 0 ? c.red(summary) : c.green(summary));\n return lines.join(\"\\n\");\n}\n\n/**\n * The published JSON shape, and the reason this builds objects by hand rather\n * than stringifying `run.results` directly.\n *\n * manni docevals reads `[{ file, success, errors: [{ type, heading, message,\n * position: { start: { line, column } } }] }]` off stdout, and it parses\n * rather than validates - a renamed key produces zero findings, not an error.\n * So: a bare array at the top level, and `errors`, even though the internal\n * field is `findings`. Adding keys is safe; renaming or nesting is not.\n */\nexport function renderJson(run: LintRun): string {\n const results = run.results.map((result) => ({\n file: result.file,\n success: result.success,\n errors: result.findings.map((finding) => ({\n type: finding.type,\n // Additive, and deliberately beside `type` rather than instead of it.\n // `ruleId` is the family id every other reporter files this finding\n // under; `tool` names which tool produced it, the question a second\n // lint job makes worth asking.\n ruleId: ruleId(finding.type),\n tool: TOOL_NAME,\n heading: finding.heading,\n message: finding.message,\n position: finding.position,\n // Additive too, and the reason it has to be: `success: true` beside a\n // non-empty `errors` array is exactly what a warning-only file looks\n // like now that `success` means \"no error-severity finding\" rather than\n // \"no findings\". Without this key a consumer has no way to tell that\n // apart from an error the JSON shape simply forgot to fail on.\n severity: finding.severity,\n // Additive: the template that judged the page and the rule this finding\n // is about, or null when no template stands behind it.\n template: finding.template ?? null,\n })),\n // Additive, and the one thing this shape could not say. A skipped file is\n // `{success: false, errors: []}`, which is also what a failure whose\n // finding vanished looks like - so a consumer counting failures counted a\n // file nothing read as a file that was read and found wanting. Null rather\n // than absent, because a key that comes and goes makes \"not skipped\" and\n // \"an older manni\" the same observation. The prose `reason` stays off the\n // wire; it is a diagnostic for the pretty and SARIF reports.\n skipped: result.skipped ?? null,\n }));\n return JSON.stringify(results, null, 2);\n}\n\n/**\n * GitHub workflow commands: one annotation per finding, shaped as cite's are -\n * `::<severity> file=…,line=…,col=…,title=<ruleId>::<message>`.\n *\n * The rule id is a `title=` property rather than a `[type]` prefix inside the\n * message. GitHub renders the title as the alert's own heading, so the prefix\n * spelled the rule's name a second time; and `title` is the field a reader can\n * group and filter on, which prose can never be.\n *\n * The level is the severity, not a constant `error`. The family scale was\n * chosen to be GitHub's for exactly this: `::warning` and `::notice` render\n * inline like `::error` but do not fail the check, which is the severity\n * invariant in GitHub's terms, and it is load-bearing rather than theoretical:\n * `unsupported_content_kind` is a `warning`, so it annotates the file without\n * failing the job.\n *\n * Line breaks are escaped rather than collapsed to spaces, as this once did.\n * `%0A` is the format's own answer and GitHub renders it as a multi-line\n * annotation, so the message arrives whole; collapsing threw away the author's\n * line breaks to solve a problem the escape already solves, and its `\\r?\\n`\n * pattern let a bare carriage return through into the command untouched.\n *\n * The escaping itself is the family's, from `src/shared/github.ts`. It lives\n * there precisely so a second renderer cannot re-derive it: the replacements\n * are order-dependent (`%` first, or the escape sequences get escaped again),\n * and a local copy that got the order wrong would look identical in review and\n * only show itself on a message carrying a literal `%`.\n */\nexport function renderGithub(run: LintRun): string {\n const lines: string[] = [];\n for (const result of run.results) {\n for (const finding of result.findings) {\n const params = [\n `file=${escapeWorkflowCommandProperty(result.file)}`,\n `line=${finding.position.start.line}`,\n `col=${finding.position.start.column}`,\n `title=${escapeWorkflowCommandProperty(ruleId(finding.type))}`,\n ];\n const message = escapeWorkflowCommandMessage(\n [describeFinding(finding), ...guidanceLines(finding.template)].join(\"\\n\"),\n );\n lines.push(`::${finding.severity} ${params.join(\",\")}::${message}`);\n }\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * `--explain`: the resolution chain per file, rather than findings.\n *\n * Printing every stage, including the ones that had nothing to say, is the\n * point. \"Which template linted this page?\" is usually asked because the answer\n * was surprising, and the surprising part is almost always a stage the reader\n * forgot applies - a stray `$template`, an override glob matching more than\n * intended. A report that showed only the winning stage would hide exactly the\n * thing being looked for.\n */\n/**\n * The alignment block riding on a result. `commands/lint.ts` attaches the tree\n * and the loaded template under `alignment` when `--explain` asked for them,\n * and only for a file that routed; a result without it prints as it always did.\n *\n * It is a nested key rather than two flat ones because `template` at the top\n * level is already the template's *ref*, the string the routing line shows.\n */\nfunction alignmentFor(result: LintFileResult): string[] | null {\n const source: ExplainSource | undefined = result.alignment;\n if (!source) return null;\n return formatAlignment(explainAlignment(source.tree, source.template));\n}\n\nexport function renderExplain(run: LintRun, opts: ReportOptions = {}): string {\n const c = palette(opts.color ?? false);\n const lines: string[] = [];\n\n for (const result of run.results) {\n // Not the pass/fail glyphs: `--explain` reports whether a page was routed,\n // and a routed page may still be full of findings. Reusing the tick would\n // read as a clean bill of health for a document nothing has looked at yet.\n const chosen = result.template;\n lines.push(`${chosen ? c.cyan(\"▸\") : c.dim(\"-\")} ${c.bold(result.file)}`);\n\n // What a Flare topic resolved against, ahead of the routing it fed.\n if (result.flare !== undefined) {\n const { project, target } = result.flare;\n const detail =\n target === undefined\n ? `${project}, no target`\n : `${project}, target ${target.name} (${target.from})`;\n lines.push(` ${c.dim(\"·\")} ${\"flare\".padEnd(20)} ${c.dim(detail)}`);\n }\n\n const steps = result.resolution?.steps ?? [];\n if (steps.length === 0) {\n lines.push(` ${c.dim(\"(no resolution recorded)\")}`);\n }\n for (const step of steps) {\n const mark = step.ref ? c.green(\"→\") : c.dim(\"·\");\n const label = step.ref ? c.bold(step.ref) : c.dim(step.detail);\n const suffix = step.ref ? ` ${c.dim(step.detail)}` : \"\";\n lines.push(` ${mark} ${step.stage.padEnd(20)} ${label}${suffix}`);\n }\n\n const alignment = chosen ? alignmentFor(result) : null;\n if (alignment && alignment.length > 0) {\n lines.push(` ${c.dim(\"alignment\")}`);\n for (const row of alignment) lines.push(` ${row}`);\n }\n\n const cause = result.resolution?.cause;\n if (cause === \"unknown-type\") {\n const type = result.resolution?.unknownType ?? \"(none recorded)\";\n const near = result.resolution?.suggestions ?? [];\n const known = result.resolution?.knownTypes ?? [];\n // The same fallback the pretty reporter gives. Without it a typo with no\n // near miss - which is most of them, since a near miss needs the typo to\n // be close - printed the failure and nothing to act on, while the plain\n // lint output for that page listed every doctype available.\n const hint = near.length\n ? `; did you mean ${near.join(\", \")}?`\n : known.length\n ? `; known doctypes: ${known.join(\", \")}`\n : \"\";\n lines.push(` ${c.red(\"✗\")} no template serves type \"${type}\"${hint}`);\n } else if (result.skipped === \"excluded\") {\n lines.push(` ${c.dim(`skipped: ${result.reason ?? \"excluded\"}`)}`);\n } else if (cause === \"no-type\") {\n lines.push(` ${c.dim(\"skipped: the page declares no type\")}`);\n }\n lines.push(\"\");\n }\n\n const routed = run.results.filter((r) => r.template != null).length;\n lines.push(\n `${run.results.length} file${run.results.length === 1 ? \"\" : \"s\"}, ` +\n `${routed} routed, ${run.results.length - routed} unrouted`,\n );\n return lines.join(\"\\n\");\n}\n\nexport function render(\n run: LintRun,\n format: ReportFormat,\n opts: ReportOptions = {},\n): string {\n switch (format) {\n case \"json\":\n return renderJson(run);\n case \"github\":\n return renderGithub(run);\n case \"sarif\":\n return renderSarif(run, opts.root === undefined ? {} : { root: opts.root });\n case \"junit\":\n return renderJunit(run);\n case \"explain\":\n return renderExplain(run, opts);\n case \"pretty\":\n return renderPretty(run, opts);\n default: {\n // Exhaustive, and the guard is what makes the claim true: sharing an arm\n // with `pretty` narrowed nothing, so a format added to meta's\n // `REPORT_FORMATS` - which is what the CLI validates `-f` against - was\n // accepted here and silently rendered as a human report. Now it is a\n // compile error, and this is its runtime half for library callers.\n const unreachable: never = format;\n throw new LintError(\n `Unknown report format ${JSON.stringify(unreachable)}. Use ${REPORT_FORMAT_LIST}.`,\n );\n }\n }\n}\n\n/** One template per line: the ref to pass, its title, and the types it serves. */\nfunction templateLine(c: Colors, entry: TemplateInfo): string {\n const title = entry.title !== \"\" ? ` ${c.dim(\"—\")} ${entry.title}` : \"\";\n const types =\n entry.types.length > 0 ? entry.types.join(\", \") : \"(no types declared)\";\n return ` ${c.cyan(entry.id)}${title} ${c.dim(`types: ${types}`)} ${c.dim(`[${entry.source}]`)}`;\n}\n\nexport function renderTemplates(\n info: TemplatesInfo,\n format: ListFormat,\n opts: ReportOptions = {},\n): string {\n if (format === \"json\") return JSON.stringify(info, null, 2);\n\n const c = palette(opts.color ?? false);\n const lines: string[] = [c.bold(\"Templates:\")];\n if (info.templates.length === 0) {\n lines.push(c.dim(\" (none)\"));\n } else {\n for (const entry of info.templates) lines.push(templateLine(c, entry));\n }\n return lines.join(\"\\n\");\n}\n\n/**\n * One input format as `markdown Markdown (.md, .markdown) kinds: paragraph,\n * codeBlock, list`.\n *\n * The kinds are left out entirely when there are none, rather than printed as\n * an empty list. A tool outside the package answers the job without parsing\n * into the content model, so it has no kinds to report, and a bare `kinds:`\n * label reads as a rendering fault rather than as the answer.\n */\nfunction formatLine(c: Colors, entry: FormatInfo): string {\n const head = ` ${c.cyan(entry.name)} ${entry.label} (${entry.extensions.join(\", \")})`;\n if (entry.kinds.length === 0) return head;\n return `${head} ${c.dim(`kinds: ${entry.kinds.join(\", \")}`)}`;\n}\n\n/**\n * `manni lint tools`: one block per job. Every column is printed for every\n * job, the negatives included - \"not configured\" beside a job that still runs\n * on defaults is the answer someone ran this command to get.\n */\nexport function renderTools(\n tools: ToolInfo[],\n format: ListFormat,\n opts: ReportOptions = {},\n): string {\n if (format === \"json\") return JSON.stringify(tools, null, 2);\n\n const c = palette(opts.color ?? false);\n const lines: string[] = [c.bold(\"Jobs:\")];\n for (const entry of tools) {\n const state = [\n entry.configured ? \"configured\" : \"not configured\",\n entry.available ? \"available\" : \"unavailable\",\n ].join(\", \");\n // A tool that is not here has no version to report, and the row still\n // prints: \"unavailable\" beside a blank cell reads as a rendering fault\n // rather than as the answer. The dash is a cell standing in for a missing\n // value, which is why it is an em dash in a house style that bans them in\n // prose.\n const version = entry.version ?? \"—\";\n lines.push(\n ` ${c.cyan(entry.job)} tool: ${c.bold(entry.tool)} ${version} [${state}]`,\n );\n lines.push(` config: ${c.dim(entry.config)}`);\n lines.push(` ${c.dim(\"formats:\")}`);\n for (const info of entry.formats) lines.push(formatLine(c, info));\n }\n return lines.join(\"\\n\");\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA0BO,IAAM,iBAAiB;AAGvB,IAAM,YAAY;AAGlB,IAAM,gBAAyB;AAQ/B,SAAS,SAAS,MAAsB;AAC7C,SAAO,KAAK,QAAQ,WAAW,EAAE,EAAE,QAAQ,MAAM,GAAG;AACtD;AAGO,SAAS,OAAO,MAAc,MAAe,eAAuB;AACzE,SAAO,GAAG,cAAc,IAAI,GAAG,IAAI,SAAS,IAAI,CAAC;AACnD;;;ACpBA,IAAM,kBAAkB;AAmBxB,SAAS,aACP,SACY;AACZ,SAAO;AAAA,IACL,QAAQ;AAAA,IACR,cAAc;AAAA,IACd,SACE,QAAQ,WAAW,OACf,GAAG,QAAQ,OAAO,KAAK,QAAQ,OAAO,KACtC,QAAQ;AAAA,IACd,SAAS,GAAG,aAAa,IAAI,SAAS,QAAQ,IAAI,CAAC;AAAA,IACnD,UAAU,QAAQ;AAAA,IAClB,MAAM,QAAQ,SAAS,MAAM;AAAA,IAC7B,KAAK,QAAQ,SAAS,MAAM;AAAA;AAAA;AAAA,IAG5B,UAAU,QAAQ,YAAY;AAAA,EAChC;AACF;AAiBO,SAAS,oBAAoB,KAAkC;AACpE,SAAO,IAAI,QACR,OAAO,CAAC,WAAW,OAAO,WAAW,IAAI,EACzC,IAAI,CAAC,YAAY;AAAA,IAChB,MAAM,OAAO;AAAA;AAAA;AAAA;AAAA;AAAA,IAKb,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,IAMR,I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,QAAO,KAAK,UAAU,OAAO,MAAM,CAAC;AAE3D,QAAM,IAAI,QAAQ,KAAK,SAAS,KAAK;AACrC,QAAM,QAAkB,CAAC,EAAE,KAAK,OAAO,CAAC;AACxC,aAAW,SAAS,OAAO;AACzB,UAAM,QAAQ;AAAA,MACZ,MAAM,aAAa,eAAe;AAAA,MAClC,MAAM,YAAY,cAAc;AAAA,IAClC,EAAE,KAAK,IAAI;AAMX,UAAM,UAAU,MAAM,WAAW;AACjC,UAAM;AAAA,MACJ,KAAK,EAAE,KAAK,MAAM,GAAG,CAAC,WAAW,EAAE,KAAK,MAAM,IAAI,CAAC,IAAI,OAAO,MAAM,KAAK;AAAA,IAC3E;AACA,UAAM,KAAK,eAAe,EAAE,IAAI,MAAM,MAAM,CAAC,EAAE;AAC/C,UAAM,KAAK,OAAO,EAAE,IAAI,UAAU,CAAC,EAAE;AACrC,eAAW,QAAQ,MAAM,QAAS,OAAM,KAAK,WAAW,GAAG,IAAI,CAAC;AAAA,EAClE;AACA,SAAO,MAAM,KAAK,IAAI;AACxB;","names":["renderJunit","text","i","rows","run","renderJunit"]}
@@ -1 +0,0 @@
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 // Never a template's: lint refuses a command eval in one, and the\n // config write path below must not receive an eval the config lacks.\n if (ev.source === \"template\") continue;\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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAY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,EAAE,aAAa,eAAgB,OAAM;AAU3D,aAAK,+BAA0B,EAAE,OAAO,qCAAqC;AAAA,MAC/E;AAAA,IACF,WAAW,mBAAmB,QAAQ,aAAa,OAAO;AAQxD,wBAAkB,oBAAoB,EAAE,UAAU,MAAM,IAAI,CAAC;AAAA,IAC/D;AAAA,EACF;AAEA,SAAO,SAAS;AAAA,IACd;AAAA,IACA;AAAA,IACA;AAAA,IACA,YAAY,QAAQ;AAAA,IACpB,UAAU,QAAQ;AAAA,IAClB;AAAA,IACA,YAAY,QAAQ;AAAA,IACpB,SAAS,QAAQ;AAAA,IACjB,KAAK,QAAQ;AAAA,IACb,mBAAmB,QAAQ;AAAA,IAC3B,QAAQ,QAAQ;AAAA,IAChB,gBAAgB,SAAS,QAAQ,cAAc;AAAA,IAC/C,WAAW,QAAQ;AAAA,IACnB,UAAU,QAAQ;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"]}