@hawkeyexl/manni 4.30.0 → 4.32.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 (276) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-23GVYKFP.js → batch-EXTFKUAM.js} +14 -14
  3. package/dist/{build-CRK3HT5F.js → build-GADI674Y.js} +15 -15
  4. package/dist/{calibrate-2RFP3QX2.js → calibrate-UC4DGHYL.js} +15 -15
  5. package/dist/{capture-267IEE6B.js → capture-HIBYY5R3.js} +14 -14
  6. package/dist/{check-6FCVYM62.js → check-F7HHGF3D.js} +11 -11
  7. package/dist/{check-5QX33J6O.js → check-FQ7N5Z2F.js} +32 -32
  8. package/dist/check-KF453CLV.js +58 -0
  9. package/dist/{check-2HIBGMXD.js → check-PPNKOK37.js} +14 -14
  10. package/dist/check-QA3FIAPV.js +58 -0
  11. package/dist/{chunk-AP3PCNKS.js → chunk-2EA6MOCN.js} +3 -3
  12. package/dist/{chunk-7PF47O3H.js → chunk-2HKNDIP3.js} +6 -6
  13. package/dist/{chunk-4YCPB67J.js → chunk-2JQPC5RK.js} +7 -7
  14. package/dist/chunk-2JQPC5RK.js.map +1 -0
  15. package/dist/{chunk-SWCFJC7W.js → chunk-2KCIETVY.js} +4 -4
  16. package/dist/{chunk-UYKRP3M3.js → chunk-2YV6K44B.js} +6 -6
  17. package/dist/{chunk-DKV6BVW5.js → chunk-3AB4UPAH.js} +3 -3
  18. package/dist/{chunk-SXNK6FPC.js → chunk-3Q2GJERD.js} +11 -8
  19. package/dist/chunk-3Q2GJERD.js.map +1 -0
  20. package/dist/{chunk-7INXFEI7.js → chunk-3SHTLHQ6.js} +7 -7
  21. package/dist/{chunk-WMI2RDSG.js → chunk-3WUATOHK.js} +4 -4
  22. package/dist/{chunk-CMJEB5V5.js → chunk-5LLPUOYC.js} +6 -6
  23. package/dist/{chunk-67GJRC62.js → chunk-5YCFOK6Y.js} +2 -2
  24. package/dist/{chunk-O2STKCTP.js → chunk-6SB3IQWD.js} +9 -9
  25. package/dist/{chunk-OZH46DBT.js → chunk-7OMLNFP7.js} +6 -1
  26. package/dist/chunk-7OMLNFP7.js.map +1 -0
  27. package/dist/{chunk-4L62A7YB.js → chunk-7PMYQS5K.js} +5 -5
  28. package/dist/{cli-A5TGO26R.js → chunk-A2KXDBRL.js} +177 -227
  29. package/dist/chunk-A2KXDBRL.js.map +1 -0
  30. package/dist/{chunk-6KNIQ2SK.js → chunk-B5DAXZLE.js} +7 -7
  31. package/dist/{chunk-VGGIJMDA.js → chunk-BHVVKRVV.js} +2 -2
  32. package/dist/{chunk-C5NE3ZIC.js → chunk-C3WYV3L4.js} +3 -3
  33. package/dist/{chunk-KAIJHQR2.js → chunk-CWDUIJJX.js} +2 -2
  34. package/dist/{chunk-KAIJHQR2.js.map → chunk-CWDUIJJX.js.map} +1 -1
  35. package/dist/{chunk-VCIC7XJB.js → chunk-DUKZLNBC.js} +4 -4
  36. package/dist/{chunk-U4CWWG2Y.js → chunk-DVHVNTP7.js} +2 -2
  37. package/dist/{chunk-TU7T6YRR.js → chunk-EESOMRVW.js} +7 -7
  38. package/dist/{chunk-2FGWZH7A.js → chunk-EOFXK7ON.js} +3 -3
  39. package/dist/{chunk-5S5DYW7W.js → chunk-GC7FAGRL.js} +10 -10
  40. package/dist/{chunk-CZFP6Q5O.js → chunk-GEA5SVJU.js} +8 -8
  41. package/dist/{chunk-ZZGHTXZ2.js → chunk-GY3RMN64.js} +2 -2
  42. package/dist/{chunk-OJZOKTTX.js → chunk-GYEP6KX7.js} +2 -2
  43. package/dist/{chunk-GBZVXEVE.js → chunk-HD4IZVVX.js} +3 -3
  44. package/dist/{chunk-O632I7AB.js → chunk-HG7O47EK.js} +13 -11
  45. package/dist/chunk-HG7O47EK.js.map +1 -0
  46. package/dist/{chunk-ERXM4UF7.js → chunk-IFHB4QBS.js} +5 -5
  47. package/dist/{chunk-77U6NQKQ.js → chunk-IPS3B5WV.js} +3 -3
  48. package/dist/{chunk-3YA6TGWH.js → chunk-J2PUJFA4.js} +5 -5
  49. package/dist/{chunk-ZI7RMN3H.js → chunk-J6QJ7T6M.js} +4 -4
  50. package/dist/{chunk-HXILODV5.js → chunk-JXGJLJOP.js} +2 -2
  51. package/dist/{chunk-MBJINPKU.js → chunk-KJOF3TAE.js} +14 -14
  52. package/dist/{chunk-3VBEUMKQ.js → chunk-KU7MRVTB.js} +2 -2
  53. package/dist/{chunk-OXFNU2IO.js → chunk-L7WBKQ2R.js} +4 -4
  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-JG2QWMDX.js → chunk-MBPDZWYI.js} +457 -366
  57. package/dist/chunk-MBPDZWYI.js.map +1 -0
  58. package/dist/{chunk-4MD2JG2F.js → chunk-MRFSWEJA.js} +2 -2
  59. package/dist/{chunk-BTFXOKCP.js → chunk-MSLBEN74.js} +2 -2
  60. package/dist/chunk-NFZE4MXL.js +14 -0
  61. package/dist/chunk-NFZE4MXL.js.map +1 -0
  62. package/dist/{chunk-ZE3BXQED.js → chunk-OILHKIBL.js} +3 -3
  63. package/dist/{chunk-LGHJFEEH.js → chunk-PKLRFHO5.js} +2 -2
  64. package/dist/{chunk-GK3F3FIP.js → chunk-POPJ4INH.js} +94 -169
  65. package/dist/chunk-POPJ4INH.js.map +1 -0
  66. package/dist/{chunk-NIXJOL7G.js → chunk-PXUAUKLB.js} +3 -3
  67. package/dist/{chunk-E6S3VGN6.js → chunk-Q6INPRTC.js} +5 -5
  68. package/dist/{chunk-CDX4QK6O.js → chunk-QMYR4OI5.js} +29 -2
  69. package/dist/chunk-QMYR4OI5.js.map +1 -0
  70. package/dist/{chunk-SXMTWMZZ.js → chunk-QVDRRK5K.js} +40 -12
  71. package/dist/chunk-QVDRRK5K.js.map +1 -0
  72. package/dist/{chunk-QEFVMOWF.js → chunk-QYKTIRRE.js} +2 -2
  73. package/dist/{chunk-MYYTLNO5.js → chunk-RC7TM74Z.js} +7 -7
  74. package/dist/{chunk-5RCCJ446.js → chunk-RNXOPBBD.js} +9 -9
  75. package/dist/chunk-RNXOPBBD.js.map +1 -0
  76. package/dist/{chunk-K5VWSQ4K.js → chunk-RRXIIMKU.js} +3 -3
  77. package/dist/{chunk-MWWPADYI.js → chunk-RV5GZTXH.js} +6 -6
  78. package/dist/{chunk-KNMDIR7D.js → chunk-SHTMF6PC.js} +3 -4
  79. package/dist/chunk-SHTMF6PC.js.map +1 -0
  80. package/dist/{chunk-YGUAY67B.js → chunk-SMQMGAP3.js} +2 -2
  81. package/dist/{chunk-5MKSZSXH.js → chunk-SVUF42MI.js} +3 -3
  82. package/dist/{chunk-F76DU7FH.js → chunk-TZOBQ3TA.js} +3 -3
  83. package/dist/{chunk-XZFJAVX7.js → chunk-UH7KFBBM.js} +9 -8
  84. package/dist/chunk-UH7KFBBM.js.map +1 -0
  85. package/dist/{chunk-V52AGLNN.js → chunk-UKWWA4T7.js} +3 -3
  86. package/dist/{chunk-YLWI7FR2.js → chunk-UMCTYM7L.js} +3 -3
  87. package/dist/{chunk-TAGYZJQA.js → chunk-VLUJ46LV.js} +51 -21
  88. package/dist/chunk-VLUJ46LV.js.map +1 -0
  89. package/dist/{chunk-6U3XF5VY.js → chunk-VQ3FZVNM.js} +2 -2
  90. package/dist/{chunk-Z3YNYZR2.js → chunk-VXZ2CIH7.js} +2 -2
  91. package/dist/{chunk-RKZ2NPO4.js → chunk-WWP6Y7S7.js} +4 -4
  92. package/dist/{chunk-UUZJP47H.js → chunk-WX7NURTP.js} +8 -8
  93. package/dist/{chunk-7YDGDI26.js → chunk-XWVXPXWI.js} +6 -6
  94. package/dist/{chunk-N3J22ZRL.js → chunk-YAPFEDGW.js} +579 -29
  95. package/dist/chunk-YAPFEDGW.js.map +1 -0
  96. package/dist/{chunk-7ZRX2OPC.js → chunk-Z6T7UX7R.js} +70 -33
  97. package/dist/chunk-Z6T7UX7R.js.map +1 -0
  98. package/dist/{chunk-RRAJMTHV.js → chunk-ZIXRI5XY.js} +4 -4
  99. package/dist/{chunk-5DER6O26.js → chunk-ZWL5ST2M.js} +3 -3
  100. package/dist/{cli-NIHSHMIV.js → cli-5UAQT4OU.js} +8 -8
  101. package/dist/{cli-GKRMSA26.js → cli-67XDE7Q7.js} +28 -28
  102. package/dist/{cli-Y4ARUWKJ.js → cli-EDXJFE5T.js} +3 -3
  103. package/dist/{cli-CCUZFOPQ.js → cli-GJ6GRHZN.js} +19 -19
  104. package/dist/{cli-NKRJ5C4G.js → cli-LQFBUP6H.js} +16 -16
  105. package/dist/{cli-MT4EPC63.js → cli-MXEFSQJC.js} +15 -15
  106. package/dist/{cli-S5CSPYEZ.js → cli-OZ4YL6WS.js} +22 -22
  107. package/dist/{cli-2MHUVZH2.js → cli-PG6Z6YXW.js} +29 -29
  108. package/dist/cli-SSK7GS43.js +80 -0
  109. package/dist/cli-TIQNAQJA.js +133 -0
  110. package/dist/cli-TIQNAQJA.js.map +1 -0
  111. package/dist/{cli-B7QCMRWR.js → cli-W7QU573I.js} +32 -32
  112. package/dist/{cli-KUMDTVHH.js → cli-XXJQS3F3.js} +63 -58
  113. package/dist/cli-XXJQS3F3.js.map +1 -0
  114. package/dist/cli.js +21 -15
  115. package/dist/cli.js.map +1 -1
  116. package/dist/{config-Z3FYLJ6X.js → config-ISXGJ4XM.js} +3 -3
  117. package/dist/docmeta.js +7 -7
  118. package/dist/{github-2PYSX7EK.js → github-IKC7EPZ6.js} +11 -11
  119. package/dist/{github-POT6K5GH.js → github-LUJDHQRN.js} +14 -14
  120. package/dist/github-Z6S7HS6X.js +49 -0
  121. package/dist/graph/embed.d.ts +1 -1
  122. package/dist/graph/embed.js.map +1 -1
  123. package/dist/graph/runtime.d.ts +2 -2
  124. package/dist/graph/runtime.js +4 -4
  125. package/dist/graph/runtime.js.map +1 -1
  126. package/dist/index.d.ts +854 -787
  127. package/dist/index.js +85 -72
  128. package/dist/index.js.map +1 -1
  129. package/dist/{json-ZWSUMRI5.js → json-FBYXDIQQ.js} +11 -11
  130. package/dist/{json-3HPHYGQC.js → json-OZKTEKPS.js} +15 -15
  131. package/dist/{labels-5P4CKGPW.js → labels-MFHU6ZPR.js} +10 -10
  132. package/dist/{lint-K7R4WNMG.js → lint-2TA4DFLT.js} +13 -13
  133. package/dist/list-3RIITWCX.js +56 -0
  134. package/dist/{list-3C7Q6VMU.js → list-JLBUOBV5.js} +14 -14
  135. package/dist/{list-HOTRWPC7.js → list-YO3W3VKA.js} +11 -11
  136. package/dist/{page-6U3CEGTB.js → page-4MZGF2N2.js} +10 -10
  137. package/dist/{prepare-PZVX2VVT.js → prepare-PKGPBUNT.js} +17 -17
  138. package/dist/{pretty-ENVCHUYG.js → pretty-7PT7ETKZ.js} +24 -24
  139. package/dist/{pretty-ODBO2IIJ.js → pretty-YHIPZV5I.js} +11 -11
  140. package/dist/{pretty-53N5ZMM3.js → pretty-YIWBO6C3.js} +14 -14
  141. package/dist/{release-EFLQT3FW.js → release-VQQXI4XB.js} +4 -4
  142. package/dist/{reporters-3GE5FK5L.js → reporters-QJ7QC3XA.js} +12 -12
  143. package/dist/{reporters-MK62LRGW.js → reporters-Y2AUVODK.js} +4 -4
  144. package/dist/{reporters-FWSJ3O4V.js → reporters-ZUKUAWKX.js} +5 -5
  145. package/dist/run-ZK6EY5V7.js +59 -0
  146. package/dist/sarif-HYGCKXCT.js +50 -0
  147. package/dist/{sarif-IFFO37SO.js → sarif-PIUCN7PT.js} +9 -9
  148. package/dist/{sarif-2L4MLVF5.js → sarif-YP2DCLLU.js} +9 -9
  149. package/dist/{strategy-BCRB4A55.js → strategy-E2YCBTAW.js} +21 -21
  150. package/dist/{term-HPRQBB2A.js → term-RLQ6WZUD.js} +16 -16
  151. package/dist/{types-GV2THIRC.js → types-YREQ2DQG.js} +6 -4
  152. package/dist/{validate-TEYFOGI5.js → validate-OPLT7USL.js} +5 -5
  153. package/dist/validate-OPLT7USL.js.map +1 -0
  154. package/package.json +1 -1
  155. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  156. package/dist/check-MYUFZGKO.js +0 -58
  157. package/dist/check-VKQ6GM5D.js +0 -58
  158. package/dist/chunk-4YCPB67J.js.map +0 -1
  159. package/dist/chunk-5RCCJ446.js.map +0 -1
  160. package/dist/chunk-7ZRX2OPC.js.map +0 -1
  161. package/dist/chunk-CDX4QK6O.js.map +0 -1
  162. package/dist/chunk-GK3F3FIP.js.map +0 -1
  163. package/dist/chunk-JG2QWMDX.js.map +0 -1
  164. package/dist/chunk-KNMDIR7D.js.map +0 -1
  165. package/dist/chunk-N3J22ZRL.js.map +0 -1
  166. package/dist/chunk-O632I7AB.js.map +0 -1
  167. package/dist/chunk-OZH46DBT.js.map +0 -1
  168. package/dist/chunk-SXMTWMZZ.js.map +0 -1
  169. package/dist/chunk-SXNK6FPC.js.map +0 -1
  170. package/dist/chunk-TAGYZJQA.js.map +0 -1
  171. package/dist/chunk-XZFJAVX7.js.map +0 -1
  172. package/dist/cli-A5TGO26R.js.map +0 -1
  173. package/dist/cli-KUMDTVHH.js.map +0 -1
  174. package/dist/github-M4QRPNXT.js +0 -49
  175. package/dist/list-O7IREFT2.js +0 -56
  176. package/dist/run-GUHRZ3OX.js +0 -59
  177. package/dist/sarif-2BGXPVSR.js +0 -50
  178. /package/dist/{batch-23GVYKFP.js.map → batch-EXTFKUAM.js.map} +0 -0
  179. /package/dist/{build-CRK3HT5F.js.map → build-GADI674Y.js.map} +0 -0
  180. /package/dist/{calibrate-2RFP3QX2.js.map → calibrate-UC4DGHYL.js.map} +0 -0
  181. /package/dist/{capture-267IEE6B.js.map → capture-HIBYY5R3.js.map} +0 -0
  182. /package/dist/{check-2HIBGMXD.js.map → check-F7HHGF3D.js.map} +0 -0
  183. /package/dist/{check-5QX33J6O.js.map → check-FQ7N5Z2F.js.map} +0 -0
  184. /package/dist/{check-6FCVYM62.js.map → check-KF453CLV.js.map} +0 -0
  185. /package/dist/{check-MYUFZGKO.js.map → check-PPNKOK37.js.map} +0 -0
  186. /package/dist/{check-VKQ6GM5D.js.map → check-QA3FIAPV.js.map} +0 -0
  187. /package/dist/{chunk-AP3PCNKS.js.map → chunk-2EA6MOCN.js.map} +0 -0
  188. /package/dist/{chunk-7PF47O3H.js.map → chunk-2HKNDIP3.js.map} +0 -0
  189. /package/dist/{chunk-SWCFJC7W.js.map → chunk-2KCIETVY.js.map} +0 -0
  190. /package/dist/{chunk-UYKRP3M3.js.map → chunk-2YV6K44B.js.map} +0 -0
  191. /package/dist/{chunk-DKV6BVW5.js.map → chunk-3AB4UPAH.js.map} +0 -0
  192. /package/dist/{chunk-7INXFEI7.js.map → chunk-3SHTLHQ6.js.map} +0 -0
  193. /package/dist/{chunk-WMI2RDSG.js.map → chunk-3WUATOHK.js.map} +0 -0
  194. /package/dist/{chunk-CMJEB5V5.js.map → chunk-5LLPUOYC.js.map} +0 -0
  195. /package/dist/{chunk-67GJRC62.js.map → chunk-5YCFOK6Y.js.map} +0 -0
  196. /package/dist/{chunk-O2STKCTP.js.map → chunk-6SB3IQWD.js.map} +0 -0
  197. /package/dist/{chunk-4L62A7YB.js.map → chunk-7PMYQS5K.js.map} +0 -0
  198. /package/dist/{chunk-6KNIQ2SK.js.map → chunk-B5DAXZLE.js.map} +0 -0
  199. /package/dist/{chunk-VGGIJMDA.js.map → chunk-BHVVKRVV.js.map} +0 -0
  200. /package/dist/{chunk-C5NE3ZIC.js.map → chunk-C3WYV3L4.js.map} +0 -0
  201. /package/dist/{chunk-VCIC7XJB.js.map → chunk-DUKZLNBC.js.map} +0 -0
  202. /package/dist/{chunk-U4CWWG2Y.js.map → chunk-DVHVNTP7.js.map} +0 -0
  203. /package/dist/{chunk-TU7T6YRR.js.map → chunk-EESOMRVW.js.map} +0 -0
  204. /package/dist/{chunk-2FGWZH7A.js.map → chunk-EOFXK7ON.js.map} +0 -0
  205. /package/dist/{chunk-5S5DYW7W.js.map → chunk-GC7FAGRL.js.map} +0 -0
  206. /package/dist/{chunk-CZFP6Q5O.js.map → chunk-GEA5SVJU.js.map} +0 -0
  207. /package/dist/{chunk-ZZGHTXZ2.js.map → chunk-GY3RMN64.js.map} +0 -0
  208. /package/dist/{chunk-OJZOKTTX.js.map → chunk-GYEP6KX7.js.map} +0 -0
  209. /package/dist/{chunk-GBZVXEVE.js.map → chunk-HD4IZVVX.js.map} +0 -0
  210. /package/dist/{chunk-ERXM4UF7.js.map → chunk-IFHB4QBS.js.map} +0 -0
  211. /package/dist/{chunk-77U6NQKQ.js.map → chunk-IPS3B5WV.js.map} +0 -0
  212. /package/dist/{chunk-3YA6TGWH.js.map → chunk-J2PUJFA4.js.map} +0 -0
  213. /package/dist/{chunk-ZI7RMN3H.js.map → chunk-J6QJ7T6M.js.map} +0 -0
  214. /package/dist/{chunk-HXILODV5.js.map → chunk-JXGJLJOP.js.map} +0 -0
  215. /package/dist/{chunk-MBJINPKU.js.map → chunk-KJOF3TAE.js.map} +0 -0
  216. /package/dist/{chunk-3VBEUMKQ.js.map → chunk-KU7MRVTB.js.map} +0 -0
  217. /package/dist/{chunk-OXFNU2IO.js.map → chunk-L7WBKQ2R.js.map} +0 -0
  218. /package/dist/{chunk-4MD2JG2F.js.map → chunk-MRFSWEJA.js.map} +0 -0
  219. /package/dist/{chunk-BTFXOKCP.js.map → chunk-MSLBEN74.js.map} +0 -0
  220. /package/dist/{chunk-ZE3BXQED.js.map → chunk-OILHKIBL.js.map} +0 -0
  221. /package/dist/{chunk-LGHJFEEH.js.map → chunk-PKLRFHO5.js.map} +0 -0
  222. /package/dist/{chunk-NIXJOL7G.js.map → chunk-PXUAUKLB.js.map} +0 -0
  223. /package/dist/{chunk-E6S3VGN6.js.map → chunk-Q6INPRTC.js.map} +0 -0
  224. /package/dist/{chunk-QEFVMOWF.js.map → chunk-QYKTIRRE.js.map} +0 -0
  225. /package/dist/{chunk-MYYTLNO5.js.map → chunk-RC7TM74Z.js.map} +0 -0
  226. /package/dist/{chunk-K5VWSQ4K.js.map → chunk-RRXIIMKU.js.map} +0 -0
  227. /package/dist/{chunk-MWWPADYI.js.map → chunk-RV5GZTXH.js.map} +0 -0
  228. /package/dist/{chunk-YGUAY67B.js.map → chunk-SMQMGAP3.js.map} +0 -0
  229. /package/dist/{chunk-5MKSZSXH.js.map → chunk-SVUF42MI.js.map} +0 -0
  230. /package/dist/{chunk-F76DU7FH.js.map → chunk-TZOBQ3TA.js.map} +0 -0
  231. /package/dist/{chunk-V52AGLNN.js.map → chunk-UKWWA4T7.js.map} +0 -0
  232. /package/dist/{chunk-YLWI7FR2.js.map → chunk-UMCTYM7L.js.map} +0 -0
  233. /package/dist/{chunk-6U3XF5VY.js.map → chunk-VQ3FZVNM.js.map} +0 -0
  234. /package/dist/{chunk-Z3YNYZR2.js.map → chunk-VXZ2CIH7.js.map} +0 -0
  235. /package/dist/{chunk-RKZ2NPO4.js.map → chunk-WWP6Y7S7.js.map} +0 -0
  236. /package/dist/{chunk-UUZJP47H.js.map → chunk-WX7NURTP.js.map} +0 -0
  237. /package/dist/{chunk-7YDGDI26.js.map → chunk-XWVXPXWI.js.map} +0 -0
  238. /package/dist/{chunk-RRAJMTHV.js.map → chunk-ZIXRI5XY.js.map} +0 -0
  239. /package/dist/{chunk-5DER6O26.js.map → chunk-ZWL5ST2M.js.map} +0 -0
  240. /package/dist/{cli-NIHSHMIV.js.map → cli-5UAQT4OU.js.map} +0 -0
  241. /package/dist/{cli-GKRMSA26.js.map → cli-67XDE7Q7.js.map} +0 -0
  242. /package/dist/{cli-Y4ARUWKJ.js.map → cli-EDXJFE5T.js.map} +0 -0
  243. /package/dist/{cli-CCUZFOPQ.js.map → cli-GJ6GRHZN.js.map} +0 -0
  244. /package/dist/{cli-NKRJ5C4G.js.map → cli-LQFBUP6H.js.map} +0 -0
  245. /package/dist/{cli-MT4EPC63.js.map → cli-MXEFSQJC.js.map} +0 -0
  246. /package/dist/{cli-S5CSPYEZ.js.map → cli-OZ4YL6WS.js.map} +0 -0
  247. /package/dist/{cli-2MHUVZH2.js.map → cli-PG6Z6YXW.js.map} +0 -0
  248. /package/dist/{config-Z3FYLJ6X.js.map → cli-SSK7GS43.js.map} +0 -0
  249. /package/dist/{cli-B7QCMRWR.js.map → cli-W7QU573I.js.map} +0 -0
  250. /package/dist/{github-2PYSX7EK.js.map → config-ISXGJ4XM.js.map} +0 -0
  251. /package/dist/{github-M4QRPNXT.js.map → github-IKC7EPZ6.js.map} +0 -0
  252. /package/dist/{github-POT6K5GH.js.map → github-LUJDHQRN.js.map} +0 -0
  253. /package/dist/{json-3HPHYGQC.js.map → github-Z6S7HS6X.js.map} +0 -0
  254. /package/dist/{json-ZWSUMRI5.js.map → json-FBYXDIQQ.js.map} +0 -0
  255. /package/dist/{lint-K7R4WNMG.js.map → json-OZKTEKPS.js.map} +0 -0
  256. /package/dist/{labels-5P4CKGPW.js.map → labels-MFHU6ZPR.js.map} +0 -0
  257. /package/dist/{list-3C7Q6VMU.js.map → lint-2TA4DFLT.js.map} +0 -0
  258. /package/dist/{list-HOTRWPC7.js.map → list-3RIITWCX.js.map} +0 -0
  259. /package/dist/{list-O7IREFT2.js.map → list-JLBUOBV5.js.map} +0 -0
  260. /package/dist/{page-6U3CEGTB.js.map → list-YO3W3VKA.js.map} +0 -0
  261. /package/dist/{pretty-53N5ZMM3.js.map → page-4MZGF2N2.js.map} +0 -0
  262. /package/dist/{prepare-PZVX2VVT.js.map → prepare-PKGPBUNT.js.map} +0 -0
  263. /package/dist/{pretty-ENVCHUYG.js.map → pretty-7PT7ETKZ.js.map} +0 -0
  264. /package/dist/{pretty-ODBO2IIJ.js.map → pretty-YHIPZV5I.js.map} +0 -0
  265. /package/dist/{reporters-3GE5FK5L.js.map → pretty-YIWBO6C3.js.map} +0 -0
  266. /package/dist/{release-EFLQT3FW.js.map → release-VQQXI4XB.js.map} +0 -0
  267. /package/dist/{reporters-FWSJ3O4V.js.map → reporters-QJ7QC3XA.js.map} +0 -0
  268. /package/dist/{reporters-MK62LRGW.js.map → reporters-Y2AUVODK.js.map} +0 -0
  269. /package/dist/{run-GUHRZ3OX.js.map → reporters-ZUKUAWKX.js.map} +0 -0
  270. /package/dist/{sarif-2BGXPVSR.js.map → run-ZK6EY5V7.js.map} +0 -0
  271. /package/dist/{sarif-2L4MLVF5.js.map → sarif-HYGCKXCT.js.map} +0 -0
  272. /package/dist/{sarif-IFFO37SO.js.map → sarif-PIUCN7PT.js.map} +0 -0
  273. /package/dist/{strategy-BCRB4A55.js.map → sarif-YP2DCLLU.js.map} +0 -0
  274. /package/dist/{types-GV2THIRC.js.map → strategy-E2YCBTAW.js.map} +0 -0
  275. /package/dist/{term-HPRQBB2A.js.map → term-RLQ6WZUD.js.map} +0 -0
  276. /package/dist/{validate-TEYFOGI5.js.map → types-YREQ2DQG.js.map} +0 -0
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/graph/commands/build.ts","../src/graph/core/analyze-cache.ts","../src/graph/core/concepts.ts","../src/graph/core/derive.ts","../src/graph/core/emit.ts","../src/graph/core/harvest.ts","../src/graph/core/git.ts"],"sourcesContent":["/**\n * `manni graph build` — derive the knowledge graph from discovered docs and write\n * deterministic Turtle. Running twice over unchanged inputs produces\n * byte-identical output.\n */\nimport { mkdirSync, readFileSync, writeFileSync } from \"node:fs\";\nimport { dirname, resolve } from \"node:path\";\nimport { GraphError } from \"../types.js\";\nimport { analyzeDoc } from \"../core/analyze.js\";\nimport { ANALYZE_CACHE_DIR, AnalyzeCache } from \"../core/analyze-cache.js\";\nimport { loadRunConfig } from \"../core/config.js\";\nimport { deriveGraph, strategyRecords, termConceptCount } from \"../core/derive.js\";\nimport {\n assertInputFormat,\n documentBase,\n documentSetPatterns,\n noInputMessage,\n parseContexts,\n resolveDocumentSet,\n routesFrom,\n STDIN,\n type DocumentInputOptions,\n} from \"../core/discover.js\";\nimport { STDIN_PATH } from \"../core/iri.js\";\nimport { emitTurtle } from \"../core/emit.js\";\nimport { harvestWarnings } from \"../core/harvest.js\";\nimport { collectGitHistory } from \"../core/git.js\";\nimport { suppressGraphOutput, userFacing } from \"../core/graph-output.js\";\nimport { openMetaView, withExternalMetadata } from \"../core/external.js\";\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { termLabelSource, type TermLabel } from \"../../shared/term-labels.js\";\nimport { NS, RDF_TYPE } from \"../core/vocab.js\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\n\nexport interface BuildOptions extends DocumentInputOptions {\n /** Output path override (default: config `out`). */\n out?: string;\n cwd?: string;\n /**\n * What `-` reads: the document from stdin, read by the caller. Required\n * when `paths` holds `-`. Its display path is `<stdin>`, its node is\n * `{baseIri}stdin`, and its links resolve from `cwd`.\n */\n stdinContent?: string;\n /** `--allow-empty`: zero matched files writes an empty graph, not an error. */\n allowEmpty?: boolean;\n /**\n * `--no-authoring` passes `false` (proposal 0110). Overrides\n * `graph.authoring`. `false` leaves the strategy records out of the\n * document set, and every value a page's schemas mark\n * `x-manni-location: external` out of every page.\n */\n authoring?: boolean;\n}\n\n/**\n * What a run that wanted git history and could not have it is told. Said once,\n * through `warn()` at the CLI edge: git is detected now rather than switched\n * (proposal 0051 §6), so the degradation graph ADR 01010 built the warnings\n * channel for is all that is left of the tri-state.\n *\n * The reason travels with the sentence. Detection removed the user's way of\n * saying \"I require this\", so the warning is the only thing standing between a\n * CI runner that lost git and a quietly thinner graph — and \"not a repository\"\n * wants a different fix from \"git is not on PATH\" or \"`git log` timed out\".\n */\nexport const GIT_ABSENT_WARNING =\n \"the graph has no revision history or commit agents\";\n\nexport function gitAbsentWarning(reason: string): string {\n return `${GIT_ABSENT_WARNING}: ${reason}`;\n}\n\nexport interface BuildResult {\n outPath: string;\n docs: number;\n quads: number;\n /**\n * The concepts the graph holds, and how many of them the termbase defines\n * (proposal 0086 §1). `fromTermbase` is 0 when the `terms` derive source\n * is off or no termbase is set up.\n */\n concepts: { total: number; fromTermbase: number };\n /** The strategy records the graph types (proposal 0110). `0` when none is in the build. */\n strategyRecords: number;\n /**\n * Non-fatal diagnostics: the build succeeded, but something it would have\n * done by default could not run (see ADR 01010). Rendered to stderr by the\n * CLI; never affects the exit code.\n */\n warnings: string[];\n}\n\n/** The build with its Turtle in hand, before anything is written. */\nexport interface BuiltGraph extends BuildResult {\n turtle: string;\n}\n\nexport async function runBuild(opts: BuildOptions = {}): Promise<BuildResult> {\n const { turtle, ...result } = await buildGraph(opts);\n mkdirSync(dirname(result.outPath), { recursive: true });\n writeFileSync(result.outPath, turtle, \"utf8\");\n return result;\n}\n\n/**\n * `runBuild` without the write: the graph as Turtle, in memory. `manni check`\n * builds the graph this way and checks it, writing no file.\n */\nexport async function buildGraph(opts: BuildOptions = {}): Promise<BuiltGraph> {\n const cwd = opts.cwd ?? process.cwd();\n const config = loadRunConfig(\n {\n ...(opts.config === undefined ? {} : { configPath: opts.config }),\n ...(opts.noConfig === undefined ? {} : { noConfig: opts.noConfig }),\n ...(opts.paths === undefined ? {} : { paths: opts.paths }),\n ...(opts.collection === undefined ? {} : { collection: opts.collection }),\n },\n cwd,\n );\n\n const format = assertInputFormat(opts.paths ?? [], opts.as);\n // Collection pages are labelled from the config's directory and typed paths\n // from cwd, as meta labels them. Every read below resolves from `base`.\n const base = documentBase(config, opts, cwd);\n const files = resolveDocumentSet(config, opts, \"build\", cwd, base);\n const usingStdin = (opts.paths ?? []).includes(STDIN);\n const outPath = resolve(cwd, opts.out ?? config.out);\n if (files.length === 0 && !usingStdin) {\n if (opts.allowEmpty) {\n // Zero documents is an empty graph, written where the graph goes, so a\n // later step that reads it finds a file rather than a stale one.\n return {\n outPath,\n docs: 0,\n quads: 0,\n concepts: { total: 0, fromTermbase: 0 },\n strategyRecords: 0,\n warnings: [],\n turtle: emitTurtle([]),\n };\n }\n throw new GraphError(noInputMessage(documentSetPatterns(config, opts), cwd));\n }\n if (usingStdin && opts.stdinContent === undefined) {\n throw new GraphError(\"graph build was given `-` but no stdin content.\");\n }\n\n // Each page's body parse is cached across runs (`analyze-cache.ts`). Link\n // resolution against the document set and `routes` still runs on every build.\n const cache = new AnalyzeCache(resolve(cwd, ANALYZE_CACHE_DIR));\n const analyzeOptions = {\n routes: routesFrom(config, base),\n ...(format === undefined ? {} : { format }),\n parse: cache.parse,\n context: parseContexts(config, base),\n };\n /** Every page of `set`, its links resolved against `set`. `<stdin>` is the page `-` read. */\n const analyzeAll = (set: readonly string[]) => {\n const allPaths = new Set(set);\n // `async`, so a read that throws rejects inside `Promise.all` rather than\n // escaping `map` and leaving earlier pages' rejections unhandled.\n return Promise.all(\n set.map(async (path) =>\n analyzeDoc(\n path === STDIN_PATH ? (opts.stdinContent ?? \"\") : readFileSync(resolve(base, path), \"utf8\"),\n path,\n allPaths,\n analyzeOptions,\n ),\n ),\n );\n };\n const documentSet = usingStdin ? [...files, STDIN_PATH] : files;\n const read = await analyzeAll(documentSet);\n\n // A page's metadata is what `manni meta validate` reads: its frontmatter\n // plus every key a manifest of its collections owns (proposal 0047), merged\n // through meta's own merge. Read from meta's section of the same config the\n // output marks come from, so one file answers both.\n const view = await openMetaView(\n {\n ...(opts.config === undefined ? {} : { configPath: opts.config }),\n ...(opts.noConfig === undefined ? {} : { noConfig: opts.noConfig }),\n },\n cwd,\n files,\n base,\n );\n let merged = await withExternalMetadata(read, view);\n\n // Author-facing content (proposal 0110) is on unless `--no-authoring` or\n // `graph.authoring: false` says otherwise. Off, a strategy record leaves\n // the document set, so the pages are read again without it and a link to\n // one resolves as a link outside the build. Then every value a page's\n // schemas prefer in a sidecar leaves the page, at any depth.\n if (!(opts.authoring ?? config.authoring)) {\n const records = new Set(strategyRecords(merged, config.baseIri).map((r) => r.path));\n if (records.size > 0) {\n merged = await withExternalMetadata(await analyzeAll(documentSet.filter((p) => !records.has(p))), view);\n }\n merged = await userFacing(merged, view);\n }\n\n // What the graph carries is the schema's call (proposal 0051 §5): a top-level\n // field marked `x-manni-graph-output: false` is dropped here, before derivation,\n // and the schemas are the set `manni meta validate` resolves (proposal 0074),\n // so it reaches none of Turtle, JSON-LD, iiRDS or the search index. All four\n // read what `deriveGraph` produces, so one filter at the fan-in is the whole\n // mechanism; suppressing a field downstream would be triple surgery in four\n // places. It runs after the merge, so a field kept in a manifest is filtered\n // by the same mark as one kept on the page.\n const docs = await suppressGraphOutput(merged, view);\n\n // Page-level keys that look like harvest inputs but are not. The graph block\n // is schema-strict, so a typo there is a hard error; at the page level\n // nothing validates, and a near miss derives silently nothing (ADR 01028).\n const warnings: string[] = harvestWarnings(docs);\n // The git pass only feeds the provenance derive source, so the subprocess is\n // skipped entirely when that source is off. Otherwise git is *detected*\n // (proposal 0051 §6): history is used wherever git can run over a\n // repository, and a run that would have used it and cannot says so once and\n // builds the rest — graph ADR 01010's degradation, without its switch.\n let gitHistory: Awaited<ReturnType<typeof collectGitHistory>> | undefined;\n if (config.build.derive.includes(\"provenance\")) {\n try {\n gitHistory = await collectGitHistory(base);\n } catch (e) {\n warnings.push(gitAbsentWarning(errorMessage(e)));\n }\n }\n\n // The termbase `manni term check` reads, from the same config, under the\n // `terms` derive source (proposal 0086 §1). Nothing registers a source\n // under a library call, and then the graph builds as it always did. A\n // termbase that cannot be read is `term check`'s failure to report, so the\n // graph warns once and builds the rest, as it does without git.\n const source = termLabelSource();\n let termbase: readonly TermLabel[] = [];\n if (config.build.derive.includes(\"terms\") && source !== undefined) {\n try {\n termbase = await source({\n cwd,\n ...(opts.config === undefined ? {} : { configPath: opts.config }),\n ...(opts.noConfig === true ? { noConfig: true } : {}),\n });\n } catch (e) {\n warnings.push(\n `the graph holds no termbase concepts: the termbase could not be read — ${errorMessage(e)}`,\n );\n }\n }\n\n const quads = deriveGraph(docs, {\n baseIri: config.baseIri,\n derive: config.build.derive,\n // The package version, stamped on the build agent (graph:version). One\n // package, one version: the tool no longer has one of its own.\n toolVersion: pkg.version,\n gitHistory,\n qualified: config.provenance.qualified,\n termbase,\n });\n const concept = `${NS.skos}Concept`;\n const concepts = {\n total: quads.filter((q) => q.p === RDF_TYPE && q.o.value === concept).length,\n fromTermbase: termConceptCount(termbase),\n };\n const turtle = emitTurtle(quads);\n await cache.flush();\n\n return {\n outPath,\n docs: docs.length,\n quads: quads.length,\n concepts,\n strategyRecords: strategyRecords(docs, config.baseIri).length,\n warnings,\n turtle,\n };\n}\n","/**\n * The cross-run cache for page parses.\n *\n * Parsing the body is most of what `graph build` spends on a page, and most\n * pages do not change between runs. `manni check` builds the graph on every\n * agent stop, so the parse is cached: one JSON file per page label under\n * `.manni/graph/analyze-cache/`, overwritten when the page changes. The\n * cache therefore holds about one entry per page ever built here.\n *\n * Only `parseBody`'s output is stored, which is a pure function of the bytes\n * and the format. Frontmatter, link resolution against the corpus, routes,\n * the meta view and git history all run on every build, so nothing a cache\n * entry holds depends on another page or on the clock. A Flare topic resolved\n * against its project does depend on other files, so it is never stored.\n *\n * A cache is an optimization: an unreadable, unparseable or malformed entry\n * is a miss, and a write that fails is dropped. Neither can fail a run.\n * Node-only: the runtime and embed bundles never import it.\n */\nimport { createHash } from \"node:crypto\";\nimport { mkdir } from \"node:fs/promises\";\nimport { readFileSync } from \"node:fs\";\nimport { join } from \"node:path\";\nimport { writeTextAtomic } from \"../../shared/write-file.js\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport { isFlare } from \"../../shared/xhtml.js\";\nimport type { ParseContext } from \"../../lint/types.js\";\nimport { parseBody, type DocBody, type DocFormat } from \"./analyze.js\";\n\n/**\n * Where the cache lives, relative to the working directory, beside the\n * `fill` proposal cache (`.manni/graph/cache`) and the `embed` vector cache.\n */\nexport const ANALYZE_CACHE_DIR = \".manni/graph/analyze-cache\";\n\n/**\n * The entry format. Bump it when `parseBody` changes what it returns, so a\n * development build does not read entries an older parse wrote under the\n * same package version.\n */\nconst ENTRY_VERSION = 4;\n\nfunction sha256(text: string): string {\n return createHash(\"sha256\").update(text, \"utf8\").digest(\"hex\");\n}\n\nconst isStrings = (value: unknown): value is string[] =>\n Array.isArray(value) && value.every((v) => typeof v === \"string\");\n\nfunction isSection(value: unknown): boolean {\n if (typeof value !== \"object\" || value === null) return false;\n const s = value as Record<string, unknown>;\n return (\n typeof s.slug === \"string\" &&\n typeof s.title === \"string\" &&\n typeof s.level === \"number\" &&\n typeof s.order === \"number\" &&\n (s.parentSlug === null || typeof s.parentSlug === \"string\") &&\n (s.line === null || typeof s.line === \"number\")\n );\n}\n\nfunction isDocBody(value: unknown): value is DocBody {\n if (typeof value !== \"object\" || value === null) return false;\n const b = value as Record<string, unknown>;\n return (\n (b.firstH1 === undefined || typeof b.firstH1 === \"string\") &&\n Array.isArray(b.sections) &&\n b.sections.every(isSection) &&\n isStrings(b.linkTargets) &&\n isStrings(b.imageTargets) &&\n isStrings(b.codeLanguages)\n );\n}\n\nexport class AnalyzeCache {\n /** Pages this run served from the cache. */\n hits = 0;\n /** Pages this run parsed. */\n misses = 0;\n private readonly writes: Promise<void>[] = [];\n\n constructor(\n private readonly dir: string,\n private readonly version: string = pkg.version,\n ) {}\n\n /** `parseBody`, served from the entry for `path` when its key matches. */\n readonly parse = async (\n content: string,\n path: string,\n format: DocFormat,\n context?: ParseContext,\n ): Promise<DocBody> => {\n // A Flare topic resolved against its project reads its snippets, variable\n // sets and target too, so its bytes alone do not key it (proposal 0125).\n // ponytail: Flare topics are reparsed every build; key on dependency hashes if large projects get slow.\n if (context?.flare !== undefined && isFlare(content)) {\n this.misses++;\n return parseBody(content, path, format, context);\n }\n const key = sha256(JSON.stringify([ENTRY_VERSION, this.version, format, path, content]));\n // Named by a digest, so a label's `..` or `:` cannot choose where it lands.\n const file = join(this.dir, `${sha256(path)}.json`);\n const cached = readEntry(file, key);\n if (cached !== undefined) {\n this.hits++;\n return cached;\n }\n const body = await parseBody(content, path, format, context);\n this.misses++;\n this.writes.push(this.write(file, JSON.stringify({ key, body })));\n return body;\n };\n\n /** Wait for this run's writes. Never rejects. */\n async flush(): Promise<void> {\n await Promise.all(this.writes);\n }\n\n private async write(file: string, text: string): Promise<void> {\n try {\n // A directory this created ignores itself, so a cache write never shows in `git status`.\n if ((await mkdir(this.dir, { recursive: true })) !== undefined) {\n await writeTextAtomic(join(this.dir, \".gitignore\"), \"*\\n\");\n }\n await writeTextAtomic(file, text);\n } catch {\n // Best-effort: the next run parses this page again.\n }\n }\n}\n\nfunction readEntry(file: string, key: string): DocBody | undefined {\n try {\n const entry = JSON.parse(readFileSync(file, \"utf8\")) as unknown;\n if (typeof entry !== \"object\" || entry === null) return undefined;\n const { key: stored, body } = entry as Record<string, unknown>;\n return stored === key && isDocBody(body) ? body : undefined;\n } catch {\n return undefined;\n }\n}\n","/**\n * The termbase as the graph reads it (proposal 0086 §1): one concept per term\n * id, and one resolver every concept label in derivation goes through.\n *\n * A label resolves to a term by its label, then its id, then an alt-label,\n * ignoring case. The page's own language is tried first, then the same\n * primary language (`en` for `en-US`), then any. A `see:` entry is a\n * redirect, not a concept: it resolves to its target.\n */\nimport type { TermLabel } from \"../../shared/term-labels.js\";\nimport { canonicalLanguageTag } from \"./localizations.js\";\nimport { byCodeUnit } from \"./sort.js\";\n\n/** What a key names: a term id, or a redirect to resolve in turn. */\ntype Target = { id: string } | { see: string; language: string | undefined };\n\ninterface Key {\n language: string | undefined;\n target: Target;\n}\n\nexport interface TermIndex {\n /** Each concept's entries, one per language, keyed by id in code-unit order. */\n groups: ReadonlyMap<string, readonly TermLabel[]>;\n /** The `see:` entries, in a stable order. */\n redirects: readonly TermLabel[];\n /** The term id a label names, or `undefined` for a freeform label. */\n resolve(label: string, language?: string): string | undefined;\n}\n\n/** A term's or a page's language, canonical, or `undefined` when it has none. */\nexport function canonicalLanguage(tag: string | undefined): string | undefined {\n return tag === undefined || tag === \"\" ? undefined : canonicalLanguageTag(tag);\n}\n\n// `split` always yields at least one element; the `?? \"\"` only satisfies the\n// index type.\nconst primary = (tag: string): string => (tag.split(\"-\")[0] ?? \"\").toLowerCase();\n\n/** A redirect chain longer than this is a loop, and names nothing. */\nconst MAX_REDIRECTS = 8;\n\n/**\n * Each termbase's index, by the array it was built from: one `graph build`\n * asks for it twice (the concept count and the derivation), and builds it once.\n */\nconst built = new WeakMap<readonly TermLabel[], TermIndex>();\n\nexport function termIndex(terms: readonly TermLabel[]): TermIndex {\n const cached = built.get(terms);\n if (cached !== undefined) return cached;\n const index = buildTermIndex(terms);\n built.set(terms, index);\n return index;\n}\n\nfunction buildTermIndex(terms: readonly TermLabel[]): TermIndex {\n const sorted = [...terms]\n .map((t) => ({ term: t, language: canonicalLanguage(t.language) }))\n .sort(\n (a, b) =>\n byCodeUnit(a.term.id, b.term.id) ||\n byCodeUnit(a.language ?? \"\", b.language ?? \"\") ||\n byCodeUnit(a.term.label, b.term.label),\n );\n\n const groups = new Map<string, TermLabel[]>();\n const redirects: TermLabel[] = [];\n const byLabel = new Map<string, Key[]>();\n const byId = new Map<string, Key[]>();\n const byAlt = new Map<string, Key[]>();\n const put = (map: Map<string, Key[]>, value: string, key: Key) => {\n const k = value.toLowerCase();\n const list = map.get(k);\n if (list) list.push(key);\n else map.set(k, [key]);\n };\n\n for (const { term, language } of sorted) {\n const target: Target =\n term.see === undefined ? { id: term.id } : { see: term.see, language };\n if (term.see === undefined) {\n const group = groups.get(term.id);\n if (group) group.push(term);\n else groups.set(term.id, [term]);\n } else {\n redirects.push(term);\n }\n put(byLabel, term.label, { language, target });\n put(byId, term.id, { language, target });\n for (const alt of term.altLabels ?? []) put(byAlt, alt, { language, target });\n }\n\n const tiers = [byLabel, byId, byAlt];\n\n const resolve = (label: string, language: string | undefined, depth: number): string | undefined => {\n const wanted = canonicalLanguage(language);\n const passes: Array<(k: Key) => boolean> =\n wanted === undefined\n ? [() => true]\n : [\n (k) => k.language === wanted,\n (k) => k.language !== undefined && primary(k.language) === primary(wanted),\n () => true,\n ];\n const needle = label.toLowerCase();\n for (const pass of passes) {\n for (const tier of tiers) {\n const hit = tier.get(needle)?.find(pass);\n if (hit === undefined) continue;\n if (\"id\" in hit.target) return hit.target.id;\n if (depth >= MAX_REDIRECTS) return undefined;\n return resolve(hit.target.see, hit.target.language ?? wanted, depth + 1);\n }\n }\n return undefined;\n };\n\n return {\n groups,\n redirects,\n resolve: (label, language) => (groups.size === 0 ? undefined : resolve(label, language, 0)),\n };\n}\n","/**\n * Graph derivation: DocModel[] → deduplicated Quad[]. This file is the\n * vocabulary mapping — the deterministic rules for what documentation\n * structure becomes which triples.\n */\nimport type { DocModel } from \"../types.js\";\nimport type { TermLabel } from \"../../shared/term-labels.js\";\nimport { spellLines } from \"../../shared/pin.js\";\nimport { readRecord, sameRecordId, type RecordType } from \"../../shared/reference-fields.js\";\nimport { canonicalLanguage, termIndex } from \"./concepts.js\";\nimport type { DeriveSource } from \"./config.js\";\nimport type { GitHistory } from \"./git.js\";\nimport { hasScheme, resolveRelative } from \"./analyze.js\";\nimport type { AgentKind } from \"./iri.js\";\nimport {\n conceptSlug,\n encodeSegment,\n mintAgentIri,\n mintBuildActivityIri,\n mintConceptIri,\n mintDocIri,\n mintGraphIri,\n mintProductIri,\n mintSchemeIri,\n mintSectionIri,\n mintStrategyIri,\n mintTermConceptIri,\n normalizeDocPath,\n} from \"./iri.js\";\nimport { readSampleQuestions } from \"./questions.js\";\nimport { byCodeUnit } from \"./sort.js\";\nimport { NS, RDF_TYPE, ROLE } from \"./vocab.js\";\nimport {\n GRAPH_NOT_APPLICABLE_TO_VARIANT,\n GRAPH_NOT_SOFTWARE_SUBJECT,\n IIRDS_HAS_SUBJECT,\n IIRDS_HAS_TOPIC_TYPE,\n IIRDS_PRODUCT_VARIANT,\n IIRDS_RELATES_TO_LIFECYCLE_PHASE,\n IIRDS_RELATES_TO_PRODUCT_VARIANT,\n PAGE_TYPE_TO_TOPIC_TYPE,\n SOFTWARE_LIFECYCLE_IRIS,\n SOFTWARE_SUBJECT_IRIS,\n TOPIC_TYPE_IRIS,\n} from \"./iirds.js\";\n\n/**\n * Resolve a provenance target (a `graph.derived-from` / `graph.revision-of`\n * entry) to a corpus doc path: doc-relative first, then repo-relative; null\n * when neither names a discovered doc.\n */\nfunction resolveProvDocPath(\n docPath: string,\n raw: string,\n docByPath: ReadonlyMap<string, DocModel>,\n): string | null {\n const docRelative = resolveRelative(docPath, raw);\n if (docRelative !== null && docByPath.has(docRelative)) return docRelative;\n const repoRelative = normalizeDocPath(raw);\n return docByPath.has(repoRelative) ? repoRelative : null;\n}\n\nexport type Term =\n | { kind: \"iri\"; value: string }\n | {\n kind: \"literal\";\n value: string;\n datatype?: string;\n /** A language tag, for a literal that carries one. Never set with `datatype`. */\n language?: string;\n };\n\nexport interface Quad {\n s: string;\n p: string;\n o: Term;\n}\n\nexport interface DeriveOptions {\n baseIri: string;\n derive: DeriveSource[];\n /** dockg's own version, stamped on the build agent (provenance source). */\n toolVersion?: string;\n /** Per-file git history; set only under `provenance.git`. */\n gitHistory?: GitHistory;\n /** Emit qualified attribution/association nodes (`provenance.qualified`). */\n qualified?: boolean;\n /**\n * The termbase, as the family term source reads it (proposal 0086 §1).\n * Read only under the `terms` derive source.\n */\n termbase?: readonly TermLabel[];\n}\n\n/**\n * How many concepts the termbase contributes: one per term id. A `see:`\n * entry is a redirect, not a concept.\n */\nexport function termConceptCount(termbase: readonly TermLabel[]): number {\n return termIndex(termbase).groups.size;\n}\n\n/** A SKOS hierarchy predicate and the one emitted back from its object. */\nconst INVERSE = {\n broader: \"narrower\",\n narrower: \"broader\",\n related: \"related\",\n} as const;\n\n/** Each strategy record type's class (proposal 0110). */\nconst RECORD_CLASS: Record<RecordType, string> = {\n audience: `${NS.schema}Audience`,\n persona: `${NS.schema}PeopleAudience`,\n journey: `${NS.graph}Journey`,\n};\n\n/**\n * The strategy records among `docs` (proposal 0110), each with its node's\n * IRI. A record is a page whose metadata declares `type: audience`,\n * `persona` or `journey`, read by the family's one rule.\n */\nexport function strategyRecords(\n docs: readonly DocModel[],\n baseIri: string,\n): { path: string; type: RecordType; id: string; iri: string }[] {\n return docs.flatMap((doc) => {\n const record = readRecord(doc.frontmatter, doc.path);\n return record === undefined\n ? []\n : [{ path: doc.path, ...record, iri: mintStrategyIri(baseIri, record.type, record.id) }];\n });\n}\n\n/** The one concept scheme's title (proposal 0086). */\nexport const CONCEPT_SCHEME_TITLE = \"manni graph concepts\";\n\nconst iri = (value: string): Term => ({ kind: \"iri\", value });\nconst lit = (value: string): Term => ({ kind: \"literal\", value });\nconst typedLit = (value: string, datatype: string): Term => ({\n kind: \"literal\",\n value,\n datatype,\n});\n\nconst DATE_RE = /^\\d{4}-\\d{2}-\\d{2}$/;\nconst DATETIME_RE = /^\\d{4}-\\d{2}-\\d{2}[T ]\\d{2}:\\d{2}/;\n\n/** Type a frontmatter date value; plain literal when unrecognized. */\nfunction dateTerm(value: string): Term {\n if (DATE_RE.test(value)) return typedLit(value, `${NS.xsd}date`);\n if (DATETIME_RE.test(value)) return typedLit(value, `${NS.xsd}dateTime`);\n return lit(value);\n}\n\nfunction asString(v: unknown): string | undefined {\n if (typeof v === \"string\" && v.length > 0) return v;\n if (typeof v === \"number\") return String(v);\n // TOML frontmatter yields Date instances (smol-toml TomlDate). String(date)\n // is locale/timezone-dependent and would break byte-identical output;\n // ISO 8601 is stable everywhere.\n if (v instanceof Date) {\n return Number.isNaN(v.getTime()) ? undefined : v.toISOString();\n }\n return undefined;\n}\n\nfunction asStringArray(v: unknown): string[] {\n if (typeof v === \"string\") return v.length > 0 ? [v] : [];\n if (Array.isArray(v)) {\n return v.flatMap((item) => {\n const s = asString(item);\n return s === undefined ? [] : [s];\n });\n }\n return [];\n}\n\n/**\n * The names in an `author`/`authors` value. Stewardship allows a name, a\n * person object with a `name` (the MyST and Docusaurus shape), or a list of\n * either. A person object with no name names no one.\n */\nfunction asPersonNames(v: unknown): string[] {\n const one = (item: unknown): string[] => {\n const name =\n item != null && typeof item === \"object\" && !Array.isArray(item)\n ? asString(asRecord(item).name)\n : asString(item);\n return name === undefined ? [] : [name];\n };\n return Array.isArray(v) ? v.flatMap(one) : one(v);\n}\n\n/** A plain object as a string-keyed record; anything else becomes `{}`. */\nfunction asRecord(v: unknown): Record<string, unknown> {\n return v != null && typeof v === \"object\" && !Array.isArray(v)\n ? (v as Record<string, unknown>)\n : {};\n}\n\n/** First defined frontmatter value among aliases. */\nfunction fmValue(fm: Record<string, unknown>, keys: string[]): unknown {\n for (const key of keys) {\n if (fm[key] !== undefined && fm[key] !== null) return fm[key];\n }\n return undefined;\n}\n\n/** PROV-O's three prov:Agent subclasses, and their IRI path segments. */\ntype ProvAgentClass = \"Person\" | \"Organization\" | \"SoftwareAgent\";\n\nconst AGENT_KIND: Record<ProvAgentClass, AgentKind> = {\n Person: \"person\",\n Organization: \"org\",\n SoftwareAgent: \"software\",\n};\n\n/** The `graph` block of frontmatter, or undefined. */\nfunction graphBlock(\n fm: Record<string, unknown>,\n): Record<string, unknown> | undefined {\n const block = fm[\"graph\"];\n return block && typeof block === \"object\" && !Array.isArray(block)\n ? (block as Record<string, unknown>)\n : undefined;\n}\n\n/**\n * The harvest rule (ADR 01024): **deeper wins; the page level is the fallback**\n * — per fact, not per page. A `graph` block that speaks to a fact owns it\n * outright; where the block is silent, the page-level twin feeds the graph.\n *\n * Only the facts the `graph` block has a twin for are resolved here. Page-level\n * `prerequisites` / `next-steps` / `related-pages` belong to `docmeta:structure`\n * and are deliberately not harvested — that is a separate vocabulary, not this\n * one's fallback.\n *\n * Returns a graph-shaped object even when the page carries no `graph` block at\n * all, so a page typed only at the top level still derives its iiRDS typing.\n */\nfunction resolveGraph(\n block: Record<string, unknown> | undefined,\n fm: Record<string, unknown>,\n): Record<string, unknown> {\n const k: Record<string, unknown> = { ...(block ?? {}) };\n\n const fallback = (key: string, pageKeys: string[]) => {\n if (k[key] !== undefined && k[key] !== null) return;\n const pageValue = fmValue(fm, pageKeys);\n if (pageValue !== undefined) k[key] = pageValue;\n };\n\n fallback(\"concepts\", [\"concepts\"]);\n fallback(\"applies-to\", [\"applies-to\"]);\n fallback(\"not-applicable-to\", [\"not-applicable-to\"]);\n fallback(\"revision-of\", [\"supersedes\"]);\n\n // `type` is the one fact whose two altitudes speak different vocabularies:\n // the page's is open (docmeta:core), `graph.type` is the closed iiRDS enum. A\n // page type with no iiRDS counterpart derives nothing rather than inventing\n // one.\n if (k[\"type\"] === undefined || k[\"type\"] === null) {\n const pageType = asString(fmValue(fm, [\"type\"]));\n // hasOwn guards the prototype chain: `type: constructor` would otherwise\n // resolve to Object and pass the truthiness check below, writing a\n // function into graph.type.\n const derived =\n pageType && Object.hasOwn(PAGE_TYPE_TO_TOPIC_TYPE, pageType)\n ? PAGE_TYPE_TO_TOPIC_TYPE[pageType]\n : undefined;\n if (derived) k[\"type\"] = derived;\n }\n\n return k;\n}\n\n/**\n * The mapping entries of a `provenance` / `meta-provenance` list. Both are\n * lists of entries keyed by `generated-by` (proposal 0046), and a list is all\n * either of them may be — anything else names no machine, so it derives\n * nothing rather than being guessed at.\n *\n * Not `metaProvenanceEntries` from meta's barrel: that reader narrows an entry\n * to its model, `fields` and `evals`, and the harvest also needs `confidence`,\n * which it drops.\n */\nfunction recordEntries(value: unknown): Array<Record<string, unknown>> {\n if (!Array.isArray(value)) return [];\n return value.filter(\n (e): e is Record<string, unknown> =>\n !!e && typeof e === \"object\" && !Array.isArray(e),\n );\n}\n\n/** A JSON Pointer's reference tokens, each unescaped per RFC 6901. */\nfunction pointerSegments(pointer: string): string[] {\n return pointer\n .split(\"/\")\n .slice(1)\n .map((s) => s.replace(/~1/g, \"/\").replace(/~0/g, \"~\"));\n}\n\nexport function deriveGraph(docs: DocModel[], options: DeriveOptions): Quad[] {\n const { baseIri } = options;\n const sources = new Set(options.derive);\n const quads: Quad[] = [];\n const add = (s: string, p: string, o: Term) => quads.push({ s, p, o });\n /**\n * Concept IRIs minted while deriving. A set rather than a flag because\n * `concept()` is a closure: a captured `let` assigned only inside one stays\n * narrowed to its initializer at the read below, which would make the\n * scheme node unreachable as far as the compiler is concerned.\n */\n const mintedConcepts = new Set<string>();\n const terms = termIndex(sources.has(\"terms\") ? (options.termbase ?? []) : []);\n\n /**\n * The concept a label names (proposal 0086 §1). A label the termbase\n * defines names that term's concept, which the termbase pass below emits,\n * so the reference adds no label of its own. Any other label is a freeform\n * concept, minted from its slug with the label as its prefLabel.\n */\n const concept = (label: string, language?: string): string => {\n const id = terms.resolve(label, language);\n if (id !== undefined) return mintTermConceptIri(baseIri, id);\n const c = mintConceptIri(baseIri, label);\n add(c, RDF_TYPE, iri(`${NS.skos}Concept`));\n add(c, `${NS.skos}prefLabel`, lit(label));\n add(c, `${NS.skos}inScheme`, iri(mintSchemeIri(baseIri)));\n mintedConcepts.add(c);\n return c;\n };\n\n /** One hierarchy edge, emitted both ways round. */\n const hierarchy = (s: string, relation: keyof typeof INVERSE, o: string) => {\n add(s, `${NS.skos}${relation}`, iri(o));\n add(o, `${NS.skos}${INVERSE[relation]}`, iri(s));\n };\n\n /** ProductVariant node (type + label); returns its IRI. Positive and\n * negative applicability converge on one node per label. */\n const variantNode = (label: string): string => {\n const variant = mintProductIri(baseIri, label);\n add(variant, RDF_TYPE, iri(IIRDS_PRODUCT_VARIANT));\n add(variant, `${NS.dcterms}title`, lit(label));\n return variant;\n };\n\n /**\n * Emit the iiRDS typing fields (type, applies-to, about-product-lifecycle,\n * about-product-aspect) plus the negative-scope fields (not-applicable-to,\n * not-about-product-aspect) for `subjectIri` from a graph-like object. Shared\n * by the document `graph` block and the per-section `graph.sections` block so\n * the mapping cannot drift between them (ADR 01012/01013/01014).\n */\n const emitIirdsTyping = (subjectIri: string, k: Record<string, unknown>) => {\n const topicType = asString(k[\"type\"]);\n const topicTypeIri = topicType && TOPIC_TYPE_IRIS[topicType];\n if (topicTypeIri) add(subjectIri, IIRDS_HAS_TOPIC_TYPE, iri(topicTypeIri));\n\n for (const label of asStringArray(k[\"applies-to\"])) {\n add(\n subjectIri,\n IIRDS_RELATES_TO_PRODUCT_VARIANT,\n iri(variantNode(label)),\n );\n }\n for (const label of asStringArray(k[\"not-applicable-to\"])) {\n add(subjectIri, GRAPH_NOT_APPLICABLE_TO_VARIANT, iri(variantNode(label)));\n }\n\n for (const value of asStringArray(k[\"about-product-lifecycle\"])) {\n const phase = SOFTWARE_LIFECYCLE_IRIS[value];\n if (phase) add(subjectIri, IIRDS_RELATES_TO_LIFECYCLE_PHASE, iri(phase));\n }\n for (const value of asStringArray(k[\"about-product-aspect\"])) {\n const subject = SOFTWARE_SUBJECT_IRIS[value];\n if (subject) add(subjectIri, IIRDS_HAS_SUBJECT, iri(subject));\n }\n for (const value of asStringArray(k[\"not-about-product-aspect\"])) {\n const subject = SOFTWARE_SUBJECT_IRIS[value];\n if (subject) add(subjectIri, GRAPH_NOT_SOFTWARE_SUBJECT, iri(subject));\n }\n };\n\n /** Verification nodes minted per subject, so two statements on one section never share one. */\n const verifications = new Map<string, number>();\n\n /**\n * `last-verified` and `verified-by` (proposal 0098), on a document, a section\n * or a block alike (proposal 0099). Each `verified-by` entry is one\n * graph:Verification. It gets an IRI under the subject's fragment, never a\n * blank node: `<doc>#/verified-by/1`, `<doc>#slug/verified-by/1`,\n * `<doc>#slug.2/verified-by/1`. A slug never holds a `/`, so none collide.\n */\n const emitVerification = (subject: string, fields: Record<string, unknown>) => {\n const last = asString(fields[\"last-verified\"]);\n if (last) add(subject, `${NS.graph}lastVerified`, dateTerm(last));\n const prefix = subject.includes(\"#\") ? subject : `${subject}#`;\n for (const entry of recordEntries(fields[\"verified-by\"])) {\n const n = (verifications.get(subject) ?? 0) + 1;\n verifications.set(subject, n);\n const node = `${prefix}/verified-by/${String(n)}`;\n add(subject, `${NS.graph}verifiedBy`, iri(node));\n add(node, RDF_TYPE, iri(`${NS.graph}Verification`));\n const tool = asString(entry[\"tool\"]);\n if (tool) add(node, `${NS.graph}tool`, lit(tool));\n const check = asString(entry[\"check\"]);\n if (check) add(node, `${NS.graph}check`, lit(check));\n const version = asString(entry[\"version\"]);\n if (version) add(node, `${NS.graph}version`, lit(version));\n const passed = asString(entry[\"passed\"]);\n if (passed) add(node, `${NS.graph}passed`, dateTerm(passed));\n }\n };\n\n /**\n * A node under `subject`: `<doc>#<suffix>` for a document, and\n * `<subject>.<suffix>` for a section or block, which already has a fragment.\n * github-slugger never emits a dot, so none collides with a heading slug.\n */\n const partIri = (subject: string, suffix: string): string =>\n subject.includes(\"#\") ? `${subject}.${suffix}` : `${subject}#${suffix}`;\n\n const docByPath = new Map(docs.map((d) => [normalizeDocPath(d.path), d]));\n const prov = sources.has(\"provenance\");\n\n // The strategy records in the build (proposal 0110). A reference derives an\n // edge only to one of them, so an id no record declares derives nothing.\n const records = strategyRecords(docs, baseIri);\n const recordByPath = new Map(records.map((r) => [r.path, r]));\n const recordIri = (type: RecordType, id: string): string | undefined =>\n records.find((r) => r.type === type && sameRecordId(r.id, id))?.iri;\n /** `subject predicate <record>` for each value of `fm[key]` that names a record of `type`. */\n const recordEdges = (subject: string, predicate: string, fm: Record<string, unknown>, key: string, type: RecordType) => {\n for (const value of asStringArray(fm[key])) {\n const target = recordIri(type, value);\n if (target !== undefined) add(subject, predicate, iri(target));\n }\n };\n\n /**\n * Agent node; dedupe converges repeats of the same name AND kind. The IRI\n * is segmented by kind (`agent/person/…`, `agent/software/…`) so a human\n * and a model whose names slug alike stay distinct nodes.\n */\n const agentNode = (name: string, type: ProvAgentClass): string => {\n const a = mintAgentIri(baseIri, AGENT_KIND[type], name);\n add(a, RDF_TYPE, iri(`${NS.prov}${type}`));\n add(a, `${NS.foaf}name`, lit(name));\n return a;\n };\n\n const qualified = options.qualified === true;\n\n // Qualification node IRIs use \".\" separators (github-slugger can never emit\n // a dot, so heading slugs cannot collide) and carry the agent slug, so two\n // agents on one activity/doc never merge into a single node.\n\n /** doc ↔ author qualification: {docIri}#prov.attribution.{agentSlug}. */\n const qualifyAttribution = (\n docIri: string,\n agentIri: string,\n name: string,\n ): void => {\n if (!qualified) return;\n const node = partIri(docIri, `prov.attribution.${conceptSlug(name)}`);\n add(docIri, `${NS.prov}qualifiedAttribution`, iri(node));\n add(node, RDF_TYPE, iri(`${NS.prov}Attribution`));\n add(node, `${NS.prov}agent`, iri(agentIri));\n add(node, `${NS.prov}hadRole`, iri(ROLE.author));\n };\n\n /** activity ↔ agent qualification: {activityIri}.assoc.{agentSlug}. */\n const qualifyAssociation = (\n activityIri: string,\n agentIri: string,\n role: string,\n ): void => {\n if (!qualified) return;\n const agentSlug = agentIri.slice(agentIri.lastIndexOf(\"/\") + 1);\n const node = `${activityIri}.assoc.${agentSlug}`;\n add(activityIri, `${NS.prov}qualifiedAssociation`, iri(node));\n add(node, RDF_TYPE, iri(`${NS.prov}Association`));\n add(node, `${NS.prov}agent`, iri(agentIri));\n add(node, `${NS.prov}hadRole`, iri(role));\n };\n\n /** Author agent + creator/attribution edges (+ qualification when on). */\n const attributeAuthor = (docIri: string, name: string): void => {\n const a = agentNode(name, \"Person\");\n add(docIri, `${NS.dcterms}creator`, iri(a));\n add(docIri, `${NS.prov}wasAttributedTo`, iri(a));\n qualifyAttribution(docIri, a, name);\n };\n\n /**\n * Shared mapping for graph.derived-from / graph.revision-of / page\n * `translation-of` entries.\n *\n * `inverse`, when given, is also emitted back from the resolved target — but\n * only for a target inside the corpus. A URL names a resource dockg has not\n * analyzed and does not speak for, so it gains an inbound edge and never an\n * outbound claim (ADR 01037).\n */\n const provTargetEdge = (\n doc: DocModel,\n docIri: string,\n raw: string,\n predicate: string,\n inverse?: string,\n ): void => {\n if (hasScheme(raw)) {\n add(docIri, predicate, iri(raw));\n return;\n }\n const target = resolveProvDocPath(\n normalizeDocPath(doc.path),\n raw,\n docByPath,\n );\n if (target) {\n const targetIri = mintDocIri(baseIri, target);\n add(docIri, predicate, iri(targetIri));\n if (inverse) add(targetIri, inverse, iri(docIri));\n } else {\n // On the document even when a statement wrote it: a broken link is the\n // page's to fix, and only a Document carries graph:brokenLink.\n add(mintDocIri(baseIri, doc.path), `${NS.graph}brokenLink`, lit(raw));\n }\n };\n\n /**\n * The front-matter mapping. A page's front matter derives onto its document\n * through it, and an inline `meta` statement's fields derive onto its\n * section or block through it too (proposal 0099, decisions 10a and 10c),\n * so the levels cannot drift. A section keeps its heading as its title, and\n * only a document falls back to its first H1. `language` is what the node\n * itself declares, and `labels` is the language its concepts and questions\n * are read in. Returns which dates it wrote, so git fills only the gaps.\n */\n const deriveFields = (\n subject: string,\n doc: DocModel,\n fm: Record<string, unknown>,\n level: \"document\" | \"section\" | \"block\",\n language: string | undefined,\n labels: string | undefined,\n ): { created: boolean; modified: boolean } => {\n const block = graphBlock(fm);\n // `block` is the `graph` block as written (block-only facts: provenance,\n // the SKOS hierarchy); `harvested` folds in the page-level fallbacks.\n const harvested = resolveGraph(block, fm);\n const blockLabel = block ? asString(block[\"label\"]) : undefined;\n let created = false;\n let modified = false;\n\n if (sources.has(\"frontmatter\")) {\n const title =\n level === \"section\"\n ? undefined\n : (asString(fmValue(fm, [\"title\"])) ??\n (level === \"document\" ? doc.firstH1 : undefined));\n if (title) add(subject, `${NS.dcterms}title`, lit(title));\n\n const description = asString(fmValue(fm, [\"description\"]));\n if (description) add(subject, `${NS.dcterms}description`, lit(description));\n\n for (const author of asPersonNames(fmValue(fm, [\"author\", \"authors\"]))) {\n if (prov) {\n attributeAuthor(subject, author);\n } else {\n add(subject, `${NS.dcterms}creator`, lit(author));\n }\n }\n\n // Stewardship's spelling first (`created`, `last-updated`), then the\n // aliases other generators write. One value per predicate: the first\n // key present wins and the rest are ignored.\n const createdOn = asString(fmValue(fm, [\"created\", \"date\"]));\n if (createdOn) {\n add(subject, `${NS.dcterms}created`, dateTerm(createdOn));\n if (prov) add(subject, `${NS.prov}generatedAtTime`, dateTerm(createdOn));\n created = true;\n }\n\n const modifiedOn = asString(\n fmValue(fm, [\"last-updated\", \"updated\", \"lastmod\", \"modified\"]),\n );\n if (modifiedOn) {\n add(subject, `${NS.dcterms}modified`, dateTerm(modifiedOn));\n modified = true;\n }\n\n // Written in its canonical spelling: tags are case-insensitive, and\n // `en-us` beside `en-US` would otherwise split one locale into two\n // indexes and miss a `--lang` filter typed the other way.\n if (language) add(subject, `${NS.dcterms}language`, lit(language));\n\n // ai-context's questions this page should be found for (proposal 0086\n // §7), in the page's language. Only the text: an item's answer pins and\n // review state are test data `check` reads from the source (0087).\n for (const { question } of readSampleQuestions(fmValue(fm, [\"sample-questions\"]))) {\n add(\n subject,\n `${NS.graph}sampleQuestion`,\n labels ? { kind: \"literal\", value: question, language: labels } : lit(question),\n );\n }\n\n // Page-level only: the `graph` block is closed and carries no\n // translation key, so this fact lives at the altitude `lang` already\n // does (ADR 01023, ADR 01037). Both directions are materialized, so\n // \"every localization of this page\" is one lookup for a consumer with no\n // inbound index of its own.\n for (const raw of asStringArray(fmValue(fm, [\"translation-of\"]))) {\n provTargetEdge(\n doc,\n subject,\n raw,\n `${NS.schema}translationOfWork`,\n `${NS.schema}workTranslation`,\n );\n }\n\n // The graph block: the SKOS hierarchy has no page-level twin, so it reads\n // the block as written (frontmatter key `graph`, RDF prefix `graph:`).\n if (block && blockLabel) {\n const topic = concept(blockLabel, labels);\n add(subject, `${NS.foaf}primaryTopic`, iri(topic));\n for (const alt of asStringArray(block[\"alt-labels\"])) {\n add(topic, `${NS.skos}altLabel`, lit(alt));\n }\n // Frontmatter key → SKOS predicate. `related-concepts` is spelled for\n // what it points at (in step with the page-level `related-pages`);\n // the predicate it emits is still plain skos:related.\n for (const [key, predicate] of [\n [\"broader\", \"broader\"],\n [\"narrower\", \"narrower\"],\n [\"related-concepts\", \"related\"],\n ] as const) {\n for (const value of asStringArray(block[key])) {\n hierarchy(topic, predicate, concept(value, labels));\n }\n }\n }\n\n // A term page always links to its term. An explicit graph label keeps\n // primaryTopic; the term remains a topic alongside it. Its id names the\n // term, and its label does when the id is absent or names no term.\n if (asString(fm[\"type\"]) === \"term\") {\n const id = asString(fm[\"id\"]);\n const label = asString(fm[\"label\"]);\n const termId =\n (id !== undefined && terms.groups.has(id) ? id : undefined) ??\n (label === undefined ? undefined : terms.resolve(label, labels));\n if (termId !== undefined) {\n add(subject, `${NS.foaf}${blockLabel ? \"topic\" : \"primaryTopic\"}`, iri(mintTermConceptIri(baseIri, termId)));\n }\n }\n\n // iiRDS Core + Software typing (ADR 01012), over the harvested block so a\n // page typed only at the top level still types its document (ADR 01024).\n emitIirdsTyping(subject, harvested);\n emitVerification(subject, fm);\n }\n\n if (sources.has(\"tags\")) {\n // Two distinct facts, both landing on dcterms:subject: dockg's own\n // tag harvest (`tags`/`keywords`), and the concepts fact — where\n // `graph.concepts` beats the page-level `concepts` outright rather than\n // adding to it (ADR 01024).\n const tagged = [\n ...asStringArray(fmValue(fm, [\"tags\", \"keywords\"])),\n ...asStringArray(harvested[\"concepts\"]),\n ];\n for (const label of tagged) {\n add(subject, `${NS.dcterms}subject`, iri(concept(label, labels)));\n }\n }\n\n if (prov) {\n // graph.derived-from / graph.revision-of: doc-relative path,\n // repo-relative path, or URL — one shared resolution. `derived-from` is block-only\n // (document lineage is curated by hand); `revision-of` harvests the\n // page-level `supersedes` when the block is silent (ADR 01024).\n for (const raw of block ? asStringArray(block[\"derived-from\"]) : []) {\n provTargetEdge(doc, subject, raw, `${NS.prov}wasDerivedFrom`);\n }\n for (const raw of asStringArray(harvested[\"revision-of\"])) {\n provTargetEdge(doc, subject, raw, `${NS.prov}wasRevisionOf`);\n }\n\n // Whole-page generation. There is no page-level `generated-by` any more\n // (proposal 0046): the machines that wrote a page are the DISTINCT\n // `generated-by` values across its page-level `provenance` entries, each\n // of which pins a line range. The activity stays one per page, so a\n // single-model page emits exactly what it always did. Its fragment uses\n // a \".\" separator, which github-slugger can never produce — heading\n // slugs cannot collide with provenance fragments.\n const machines = [\n ...new Set(\n recordEntries(fmValue(fm, [\"provenance\"])).flatMap((e) => {\n const m = asString(e[\"generated-by\"]);\n return m === undefined ? [] : [m];\n }),\n ),\n ].sort(byCodeUnit);\n if (machines.length > 0) {\n const activity = partIri(subject, \"prov.generation\");\n add(subject, `${NS.prov}wasGeneratedBy`, iri(activity));\n add(activity, RDF_TYPE, iri(`${NS.prov}Activity`));\n for (const machine of machines) {\n const model = agentNode(machine, \"SoftwareAgent\");\n add(activity, `${NS.prov}wasAssociatedWith`, iri(model));\n qualifyAssociation(activity, model, ROLE.generator);\n }\n }\n\n // Page-level `meta-provenance` (written by `manni graph fill`): one\n // activity PER MODEL so multiple fills by different models keep truthful\n // attribution. Only the doc's own topic concept is prov:generated —\n // shared subject/tag concepts are never attributed, or one doc's LLM\n // would taint every doc using the same tag.\n for (const entry of recordEntries(fmValue(fm, [\"meta-provenance\"]))) {\n const model = asString(entry[\"generated-by\"]);\n if (!model) continue;\n // A pointer names a value anywhere on the page, so only the ones under\n // `/graph/` are graph's business. The filled field is the first segment\n // after it: `/graph/sections/install/type` attributes `sections`, the\n // field a reviewer would look at. First pointer wins on confidence,\n // which 0046 keys by the whole pointer rather than by the field.\n const pointers = asStringArray(entry[\"fields\"]);\n const confidence = asRecord(entry[\"confidence\"]);\n const filled = new Map<string, string>();\n for (const pointer of pointers) {\n if (!pointer.startsWith(\"/graph/\")) continue;\n const field = pointerSegments(pointer)[1];\n if (field === undefined || field === \"\") continue;\n if (!filled.has(field)) filled.set(field, pointer);\n }\n if (filled.size === 0) continue;\n const activity = partIri(subject, `prov.graph-fill.${conceptSlug(model)}`);\n const modelAgent = agentNode(model, \"SoftwareAgent\");\n add(activity, RDF_TYPE, iri(`${NS.prov}Activity`));\n add(activity, `${NS.prov}wasAssociatedWith`, iri(modelAgent));\n qualifyAssociation(activity, modelAgent, ROLE.generator);\n // Each filled field is reified as an entry node carrying its name and\n // (when fill recorded one) the model's confidence — a plain,\n // blank-node-free per-field audit edge (ADR 01015).\n for (const [field, pointer] of filled) {\n const fieldNode = `${activity}.field.${field}`;\n add(activity, `${NS.graph}filledFieldEntry`, iri(fieldNode));\n add(fieldNode, `${NS.graph}filledField`, lit(field));\n const c = confidence[pointer];\n if (typeof c === \"number\") {\n add(\n fieldNode,\n `${NS.graph}confidence`,\n typedLit(String(Math.round(c * 100) / 100), `${NS.xsd}decimal`),\n );\n }\n }\n if (blockLabel && filled.has(\"label\")) {\n const id = terms.resolve(blockLabel, labels);\n add(\n activity,\n `${NS.prov}generated`,\n iri(\n id === undefined\n ? mintConceptIri(baseIri, blockLabel)\n : mintTermConceptIri(baseIri, id),\n ),\n );\n }\n }\n }\n return { created, modified };\n };\n\n for (const doc of docs) {\n const docIri = mintDocIri(baseIri, doc.path);\n const fm = doc.frontmatter;\n // The `graph` block as written, for the section typing it carries.\n const block = graphBlock(fm);\n // The page's own key outranks the route it sits under (ADR 01037): a\n // single English page inside a translated tree can correct its label,\n // and a corpus that declares nothing keeps deriving nothing. A Flare\n // project's `xml:lang` comes last: a setting someone wrote wins over\n // one manni detects (proposal 0125, decision 10).\n const pageLanguage = canonicalLanguage(\n asString(fmValue(fm, [\"lang\", \"language\"])) ?? doc.routeLanguage ?? doc.projectLanguage,\n );\n\n add(docIri, RDF_TYPE, iri(`${NS.graph}Document`));\n if (prov) add(docIri, RDF_TYPE, iri(`${NS.prov}Entity`));\n add(docIri, `${NS.graph}path`, lit(normalizeDocPath(doc.path)));\n // Intrinsic like path, not gated behind a derive source (ADR 01036): a hash\n // present only sometimes cannot tell \"unchanged\" from \"not stamped\", which\n // is the whole question it exists to answer.\n add(docIri, `${NS.graph}contentHash`, lit(doc.contentHash));\n\n const dated = deriveFields(docIri, doc, fm, \"document\", pageLanguage, pageLanguage);\n\n // The content strategy (proposal 0110), page level only, every edge\n // pointing away from the page. A record's file always links to its record,\n // even when its graph block names a different primary topic.\n if (sources.has(\"frontmatter\")) {\n const record = recordByPath.get(doc.path);\n if (record !== undefined) {\n add(record.iri, RDF_TYPE, iri(RECORD_CLASS[record.type]));\n const title = asString(fm[\"title\"]);\n if (title) add(record.iri, `${NS.dcterms}title`, lit(title));\n add(docIri, `${NS.foaf}${block && asString(block[\"label\"]) ? \"topic\" : \"primaryTopic\"}`, iri(record.iri));\n if (record.type === \"persona\") recordEdges(record.iri, `${NS.dcterms}isPartOf`, fm, \"audience\", \"audience\");\n if (record.type === \"journey\") recordEdges(record.iri, `${NS.schema}audience`, fm, \"personas\", \"persona\");\n } else {\n recordEdges(docIri, `${NS.schema}audience`, fm, \"audiences\", \"audience\");\n recordEdges(docIri, `${NS.schema}audience`, fm, \"personas\", \"persona\");\n recordEdges(docIri, `${NS.dcterms}isPartOf`, fm, \"journeys\", \"journey\");\n }\n }\n\n if (sources.has(\"sections\")) {\n // graph.sections: slug-keyed iiRDS typing attached to section nodes\n // (ADR 01013). Explicit-only — a section gets nothing from the doc.\n const sectionMeta = asRecord(block?.[\"sections\"]);\n const sectionSlugs = new Set(doc.sections.map((s) => s.slug));\n\n for (const section of doc.sections) {\n const secIri = mintSectionIri(docIri, section.slug);\n const parentIri = section.parentSlug\n ? mintSectionIri(docIri, section.parentSlug)\n : docIri;\n add(secIri, RDF_TYPE, iri(`${NS.graph}Section`));\n add(secIri, `${NS.dcterms}title`, lit(section.title));\n add(\n secIri,\n `${NS.graph}level`,\n typedLit(String(section.level), `${NS.xsd}integer`),\n );\n add(\n secIri,\n `${NS.graph}order`,\n typedLit(String(section.order), `${NS.xsd}integer`),\n );\n add(parentIri, `${NS.dcterms}hasPart`, iri(secIri));\n\n const meta = asRecord(sectionMeta[section.slug]);\n emitIirdsTyping(secIri, meta);\n for (const label of asStringArray(meta[\"concepts\"])) {\n add(secIri, `${NS.dcterms}subject`, iri(concept(label, pageLanguage)));\n }\n }\n\n // A graph.sections key naming no heading is a broken reference (surfaced\n // by stats, gated by stats --check) — never a silent drop.\n for (const slug of Object.keys(sectionMeta)) {\n if (!sectionSlugs.has(slug)) {\n add(docIri, `${NS.graph}brokenSectionRef`, lit(slug));\n }\n }\n\n // Inline `meta` statements (proposal 0099). One on a heading describes\n // that section. Any other mints a graph:Block, `<doc>#<slug>.<n>`, the\n // nth statement in its section, or `<doc>#.<n>` before any heading. A\n // heading statement whose heading graph does not find is a block. Its\n // fields derive as front matter does (decisions 10a and 10c), and nothing\n // is copied from the page (ADR 01013), not even its language.\n const headed = doc.sections.filter((s) => s.line !== null);\n const blocksIn = new Map<string, number>();\n for (const statement of doc.statements ?? []) {\n const { start, end } = statement.anchor;\n const own = canonicalLanguage(asString(fmValue(statement.data, [\"lang\", \"language\"])));\n const heading =\n statement.scope === \"section\"\n ? headed.find((s) => s.line !== null && s.line >= start && s.line <= end)\n : undefined;\n if (heading) {\n const secIri = mintSectionIri(docIri, heading.slug);\n deriveFields(secIri, doc, statement.data, \"section\", own, own ?? pageLanguage);\n continue;\n }\n const owner = headed.filter((s) => s.line !== null && s.line <= start).at(-1);\n const slug = owner?.slug ?? \"\";\n const n = (blocksIn.get(slug) ?? 0) + 1;\n blocksIn.set(slug, n);\n const blockIri = mintSectionIri(docIri, `${slug}.${String(n)}`);\n add(owner ? mintSectionIri(docIri, slug) : docIri, `${NS.dcterms}hasPart`, iri(blockIri));\n add(blockIri, RDF_TYPE, iri(`${NS.graph}Block`));\n add(blockIri, `${NS.graph}lines`, lit(spellLines(statement.anchor)));\n if (statement.pin !== undefined) add(blockIri, `${NS.graph}pin`, lit(statement.pin));\n add(blockIri, `${NS.graph}pinStatus`, lit(statement.status));\n deriveFields(blockIri, doc, statement.data, \"block\", own, own ?? pageLanguage);\n }\n }\n\n if (sources.has(\"links\")) {\n for (const link of doc.links) {\n if (link.kind === \"external\" && link.url) {\n add(docIri, `${NS.dcterms}references`, iri(link.url));\n } else if (link.kind === \"internal\" && link.resolvedPath) {\n const targetIri = mintDocIri(baseIri, link.resolvedPath);\n const target = docByPath.get(link.resolvedPath);\n // Bound first, so the anchor the test found is the anchor the IRI is\n // minted from rather than a second read the type cannot connect to\n // the first.\n const anchor = link.anchor;\n const anchorResolves =\n anchor !== undefined &&\n target !== undefined &&\n target.sections.some((s) => s.slug === anchor);\n add(\n docIri,\n `${NS.dcterms}references`,\n iri(\n anchorResolves ? mintSectionIri(targetIri, anchor) : targetIri,\n ),\n );\n } else if (link.kind === \"broken\") {\n add(docIri, `${NS.graph}brokenLink`, lit(link.raw));\n }\n }\n }\n\n if (sources.has(\"images\")) {\n for (const image of doc.images) {\n const target = image.external\n ? image.target\n : `${baseIri}file/${normalizeDocPath(image.target)\n .split(\"/\")\n .map(encodeSegment)\n .join(\"/\")}`;\n add(docIri, `${NS.schema}image`, iri(target));\n }\n }\n\n if (sources.has(\"code\")) {\n for (const language of doc.codeLanguages) {\n add(docIri, `${NS.graph}codeLanguage`, lit(language));\n }\n }\n\n if (prov) {\n // Per-file git history (provenance.git): frontmatter always wins on\n // dates; authors merge; renames become revision edges to the\n // historical-path entities.\n const gitFile = options.gitHistory?.files.get(normalizeDocPath(doc.path));\n if (gitFile) {\n if (!dated.created && gitFile.created) {\n add(docIri, `${NS.dcterms}created`, dateTerm(gitFile.created));\n add(docIri, `${NS.prov}generatedAtTime`, dateTerm(gitFile.created));\n }\n if (!dated.modified && gitFile.modified) {\n add(docIri, `${NS.dcterms}modified`, dateTerm(gitFile.modified));\n }\n for (const author of gitFile.authors) {\n attributeAuthor(docIri, author);\n }\n for (const oldPath of gitFile.renamedFrom) {\n const oldIri = mintDocIri(baseIri, oldPath);\n add(docIri, `${NS.prov}wasRevisionOf`, iri(oldIri));\n add(oldIri, RDF_TYPE, iri(`${NS.prov}Entity`));\n }\n }\n }\n }\n\n if (prov) {\n const graphIri = mintGraphIri(baseIri);\n const activity = mintBuildActivityIri(baseIri);\n const tool = agentNode(\"manni\", \"SoftwareAgent\");\n add(graphIri, RDF_TYPE, iri(`${NS.prov}Entity`));\n add(graphIri, `${NS.prov}wasGeneratedBy`, iri(activity));\n add(activity, RDF_TYPE, iri(`${NS.prov}Activity`));\n add(activity, `${NS.prov}wasAssociatedWith`, iri(tool));\n qualifyAssociation(activity, tool, ROLE.tool);\n if (options.toolVersion) {\n add(tool, `${NS.graph}version`, lit(options.toolVersion));\n }\n for (const doc of docs) {\n add(activity, `${NS.prov}used`, iri(mintDocIri(baseIri, doc.path)));\n }\n const headTime = options.gitHistory?.headTime;\n if (headTime) {\n add(\n activity,\n `${NS.prov}endedAtTime`,\n typedLit(headTime, `${NS.xsd}dateTime`),\n );\n }\n }\n\n // The termbase's concepts (proposal 0086 §1): one per id, each language of a\n // term joining it, and every label tagged with the term's language.\n const tagged = (value: string, language: string | undefined): Term =>\n language === undefined ? lit(value) : { kind: \"literal\", value, language };\n for (const [id, entries] of terms.groups) {\n const c = mintTermConceptIri(baseIri, id);\n add(c, RDF_TYPE, iri(`${NS.skos}Concept`));\n add(c, `${NS.skos}inScheme`, iri(mintSchemeIri(baseIri)));\n mintedConcepts.add(c);\n for (const entry of entries) {\n const language = canonicalLanguage(entry.language);\n add(c, `${NS.skos}prefLabel`, tagged(entry.label, language));\n for (const [values, predicate] of [\n [entry.altLabels, \"altLabel\"],\n [entry.hiddenLabels, \"hiddenLabel\"],\n [entry.definition, \"definition\"],\n [entry.scopeNote, \"scopeNote\"],\n ] as const) {\n for (const value of asStringArray(values)) {\n add(c, `${NS.skos}${predicate}`, tagged(value, language));\n }\n }\n for (const relation of [\"broader\", \"narrower\", \"related\"] as const) {\n for (const value of entry[relation] ?? []) {\n hierarchy(c, relation, concept(value, language));\n }\n }\n // A code and the mappings out of the scheme belong to no language.\n if (entry.notation !== undefined) add(c, `${NS.skos}notation`, lit(entry.notation));\n for (const [values, predicate] of [\n [entry.exactMatches, \"exactMatch\"],\n [entry.closeMatches, \"closeMatch\"],\n [entry.broadMatches, \"broadMatch\"],\n [entry.narrowMatches, \"narrowMatch\"],\n [entry.relatedMatches, \"relatedMatch\"],\n ] as const) {\n for (const value of values ?? []) add(c, `${NS.skos}${predicate}`, iri(value));\n }\n }\n }\n // A `see:` entry is no concept of its own. Its label is another way to say\n // its target, so it becomes an altLabel there.\n for (const entry of terms.redirects) {\n const language = canonicalLanguage(entry.language);\n const target =\n entry.see === undefined ? undefined : terms.resolve(entry.see, language);\n if (target === undefined) continue;\n add(\n mintTermConceptIri(baseIri, target),\n `${NS.skos}altLabel`,\n tagged(entry.label, language),\n );\n }\n\n if (mintedConcepts.size > 0) {\n const scheme = mintSchemeIri(baseIri);\n add(scheme, RDF_TYPE, iri(`${NS.skos}ConceptScheme`));\n add(scheme, `${NS.dcterms}title`, lit(CONCEPT_SCHEME_TITLE));\n // A concept with no broader concept is a top concept of the scheme, both\n // ways round. Read off the quads, so every source of hierarchy counts.\n const broader = `${NS.skos}broader`;\n const hasBroader = new Set(\n quads.filter((q) => q.p === broader).map((q) => q.s),\n );\n for (const c of mintedConcepts) {\n if (hasBroader.has(c)) continue;\n add(c, `${NS.skos}topConceptOf`, iri(scheme));\n add(scheme, `${NS.skos}hasTopConcept`, iri(c));\n }\n }\n\n return dedupe(quads);\n}\n\nfunction quadKey(q: Quad): string {\n const o =\n q.o.kind === \"iri\"\n ? `i:${q.o.value}`\n : `l:${q.o.value}|${q.o.datatype ?? \"\"}|${q.o.language ?? \"\"}`;\n return `${q.s}|${q.p}|${o}`;\n}\n\nfunction dedupe(quads: Quad[]): Quad[] {\n const seen = new Set<string>();\n const out: Quad[] = [];\n for (const q of quads) {\n const key = quadKey(q);\n if (seen.has(key)) continue;\n seen.add(key);\n out.push(q);\n }\n return out;\n}\n","/**\n * Deterministic Turtle serialization — the git-diff contract. Canonical form:\n * fixed sorted prefix header; subjects sorted by full IRI; within a subject,\n * rdf:type first (as `a`), then predicates sorted by full IRI; objects sorted\n * (IRIs before literals, each lexicographic); LF line endings, UTF-8, exactly\n * one trailing newline. Byte-identical output for any input quad order.\n *\n * Deliberately not N3.Writer: its formatting is incidental library behavior.\n * Correctness of escaping is guarded by a round-trip test through n3's parser.\n */\nimport type { Quad, Term } from \"./derive.js\";\nimport { byCodeUnit } from \"./sort.js\";\nimport { NS, PREFIXES, RDF_TYPE } from \"./vocab.js\";\n\n/** Conservative PN_LOCAL: shorten only when the local name is trivially safe. */\nconst SAFE_LOCAL = /^[A-Za-z_][A-Za-z0-9_-]*$/;\n\n/**\n * Percent-encode characters the Turtle IRIREF production forbids\n * (controls, space, <>\"{}|^` and backslash) so output always parses,\n * whatever made it into a node value.\n */\n// Forbidden by IRIREF: <>\"{}|^ plus backtick and backslash.\nconst ILLEGAL_IRI_CHARS = '<>\"{}|^\\x60\\x5c';\n\nfunction sanitizeIri(iriValue: string): string {\n let out = \"\";\n for (const ch of iriValue) {\n const code = ch.codePointAt(0) as number;\n const illegal = code <= 0x20 || ILLEGAL_IRI_CHARS.includes(ch);\n out += illegal\n ? \"%\" + code.toString(16).toUpperCase().padStart(2, \"0\")\n : ch;\n }\n return out;\n}\n\n/**\n * Memo: the same predicates/objects recur once per quad; shorten each once.\n * Cleared at the start of every emit so long-lived embedders don't accumulate\n * every IRI ever serialized.\n */\nconst shortenMemo = new Map<string, string>();\n\nfunction shorten(iriValue: string): string {\n const memoized = shortenMemo.get(iriValue);\n if (memoized !== undefined) return memoized;\n let result: string | undefined;\n for (const [prefix, ns] of PREFIXES) {\n if (iriValue.startsWith(ns)) {\n const local = iriValue.slice(ns.length);\n if (SAFE_LOCAL.test(local)) {\n result = `${prefix}:${local}`;\n break;\n }\n }\n }\n result ??= `<${sanitizeIri(iriValue)}>`;\n shortenMemo.set(iriValue, result);\n return result;\n}\n\nfunction escapeLiteral(value: string): string {\n return value\n .replace(/\\\\/g, \"\\\\\\\\\")\n .replace(/\"/g, '\\\\\"')\n .replace(/\\n/g, \"\\\\n\")\n .replace(/\\r/g, \"\\\\r\")\n .replace(/\\t/g, \"\\\\t\");\n}\n\nconst INTEGER = `${NS.xsd}integer`;\nconst INTEGER_RE = /^-?\\d+$/;\n\nfunction renderTerm(term: Term): string {\n if (term.kind === \"iri\") return shorten(term.value);\n if (term.datatype === INTEGER && INTEGER_RE.test(term.value))\n return term.value;\n const quoted = `\"${escapeLiteral(term.value)}\"`;\n if (term.language) return `${quoted}@${term.language}`;\n return term.datatype ? `${quoted}^^${shorten(term.datatype)}` : quoted;\n}\n\n/** Sort objects: IRIs before literals, each lexicographically. */\nfunction compareTerms(a: Term, b: Term): number {\n if (a.kind !== b.kind) return a.kind === \"iri\" ? -1 : 1;\n const byValue = byCodeUnit(a.value, b.value);\n if (byValue !== 0) return byValue;\n const da = a.kind === \"literal\" ? (a.datatype ?? \"\") : \"\";\n const db = b.kind === \"literal\" ? (b.datatype ?? \"\") : \"\";\n const la = a.kind === \"literal\" ? (a.language ?? \"\") : \"\";\n const lb = b.kind === \"literal\" ? (b.language ?? \"\") : \"\";\n return byCodeUnit(da, db) || byCodeUnit(la, lb);\n}\n\nexport function emitTurtle(quads: Quad[]): string {\n shortenMemo.clear();\n const lines: string[] = [];\n for (const [prefix, ns] of PREFIXES) {\n lines.push(`@prefix ${prefix}: <${ns}> .`);\n }\n\n // subject → predicate → terms\n const subjects = new Map<string, Map<string, Term[]>>();\n for (const quad of quads) {\n let preds = subjects.get(quad.s);\n if (!preds) {\n preds = new Map();\n subjects.set(quad.s, preds);\n }\n let terms = preds.get(quad.p);\n if (!terms) {\n terms = [];\n preds.set(quad.p, terms);\n }\n terms.push(quad.o);\n }\n\n // Sorting the *entries* rather than the keys: each predicate map comes out\n // of the map with the subject it belongs to, and each term list with its\n // predicate, so nothing is looked up again and nothing has to be asserted.\n const sortedSubjects = [...subjects.entries()].sort(([a], [b]) =>\n byCodeUnit(a, b),\n );\n for (const [subject, preds] of sortedSubjects) {\n const sortedPreds = [...preds.entries()].sort(([a], [b]) => {\n if (a === RDF_TYPE) return b === RDF_TYPE ? 0 : -1;\n if (b === RDF_TYPE) return 1;\n return byCodeUnit(a, b);\n });\n\n const entries = sortedPreds.map(([p, terms], i) => {\n const objects = [...terms].sort(compareTerms).map(renderTerm).join(\", \");\n const pred = p === RDF_TYPE ? \"a\" : shorten(p);\n const terminator = i === sortedPreds.length - 1 ? \" .\" : \" ;\";\n return { pred, objects, terminator };\n });\n\n // A subject is in the map only because a quad put a predicate under it, so\n // `entries` is never empty; the destructuring says so and leaves the rest\n // of the block unreachable if it ever were.\n const [first, ...rest] = entries;\n if (first === undefined) continue;\n lines.push(\"\");\n lines.push(\n `${shorten(subject)} ${first.pred} ${first.objects}${first.terminator}`,\n );\n for (const entry of rest) {\n lines.push(` ${entry.pred} ${entry.objects}${entry.terminator}`);\n }\n }\n\n return `${lines.join(\"\\n\")}\\n`;\n}\n","/**\n * Near-miss detection for the page-level keys the harvest rule reads\n * (ADR 01024, ADR 01028).\n *\n * Five page-level keys are graph inputs — `type`, `concepts`, `applies-to`,\n * `not-applicable-to`, `supersedes` — and unlike the `graph` block, nothing\n * validates them. The `graph` block is `additionalProperties: false`, so a typo\n * inside it is a hard schema error; the same typo at the page level derives\n * silently nothing, because a page may legitimately carry any other key it\n * likes (a site generator's, a linter's, an author's).\n *\n * A schema is therefore the wrong instrument: rejecting unknown page keys would\n * reject every page. What is wrong with `applies_to` is not that dockg does not\n * know it — it is that it is one character from a key dockg *does* know, on a\n * page that declares nothing else of the kind. That is what this detects, and\n * it is the whole scope: dockg does not implement the vocabularies these keys\n * belong to and must not start claiming their facts (ADR 01024).\n *\n * Warnings only. A near miss is a suspicion, not a finding, and a suspicion\n * must never fail a build.\n */\nimport { PAGE_TYPE_TO_TOPIC_TYPE } from \"./iirds.js\";\nimport { byCodeUnit } from \"./sort.js\";\nimport type { DocModel } from \"../types.js\";\n\n/**\n * The page-level keys dockg reads, in the spelling it expects.\n *\n * Five are `resolveGraph`'s harvest inputs (ADR 01024). The localization three\n * are read straight by the emitter — `lang`/`language` into `dcterms:language`,\n * `translation-of` into the schema.org translation pair (ADR 01037) — and are\n * listed here for the same reason: a typo in any of them derives nothing while\n * looking exactly like a declared fact.\n */\nexport const HARVESTED_KEYS: readonly string[] = [\n \"applies-to\",\n \"concepts\",\n \"lang\",\n \"language\",\n \"not-applicable-to\",\n \"supersedes\",\n \"translation-of\",\n \"type\",\n];\n\n/**\n * Levenshtein distance, capped: anything past `max` returns `max + 1`, since\n * the caller only cares whether a candidate is *close*.\n */\nfunction distance(a: string, b: string, max: number): number {\n if (a === b) return 0;\n if (Math.abs(a.length - b.length) > max) return max + 1;\n let prev = Array.from({ length: b.length + 1 }, (_, i) => i);\n for (let i = 1; i <= a.length; i++) {\n const row = [i];\n for (let j = 1; j <= b.length; j++) {\n row[j] = Math.min(\n (prev[j] ?? 0) + 1,\n (row[j - 1] ?? 0) + 1,\n (prev[j - 1] ?? 0) + (a[i - 1] === b[j - 1] ? 0 : 1),\n );\n }\n prev = row;\n }\n return prev[b.length] ?? max + 1;\n}\n\n/**\n * The known name a candidate was probably meant to be, or undefined.\n *\n * Distance 1 for short names, 2 for longer ones: `type` and `types` differ by\n * one and mean different things, while `not-applicable-to` can absorb two typos\n * and still be unmistakable. Separator-only differences (`applies_to`,\n * `appliesTo`) normalize to an exact match and are always caught.\n */\nfunction nearestKnown(\n candidate: string,\n known: readonly string[],\n): string | undefined {\n // Split camelCase BEFORE lowercasing — doing it after is a no-op, because\n // there is no uppercase left to match. `appliesTo` then reaches `applies-to`\n // exactly, instead of relying on the distance fallback to rescue it, and\n // `notApplicabelTo` (two typos plus a case boundary) becomes reachable at\n // all.\n const normalize = (s: string): string =>\n s\n .replace(/([a-z0-9])([A-Z])/g, \"$1-$2\")\n .toLowerCase()\n .replace(/[_\\s]+/g, \"-\");\n const c = normalize(candidate);\n for (const k of known) {\n if (c === normalize(k) && candidate !== k) return k;\n }\n let best: { key: string; d: number } | undefined;\n for (const k of known) {\n const max = k.length > 8 ? 2 : 1;\n const d = distance(c, normalize(k), max);\n if (d > max) continue;\n if (!best || d < best.d) best = { key: k, d };\n }\n return best?.key;\n}\n\n/**\n * Warnings for page-level keys and page `type` values that look like harvest\n * inputs but are not. Sorted, so the output is deterministic like everything\n * else dockg emits.\n */\nexport function harvestWarnings(docs: readonly DocModel[]): string[] {\n const out: string[] = [];\n const mappedTypes = Object.keys(PAGE_TYPE_TO_TOPIC_TYPE);\n\n for (const doc of docs) {\n const fm = doc.frontmatter;\n const present = new Set(Object.keys(fm));\n\n for (const key of present) {\n if (HARVESTED_KEYS.includes(key)) continue;\n const meant = nearestKnown(key, HARVESTED_KEYS);\n // Only suspicious if the page does not already declare the real key: a\n // page carrying both `applies-to` and `applies_to` has made its choice.\n if (meant === undefined || present.has(meant)) continue;\n out.push(\n `${doc.path}: page key \"${key}\" is not read by manni graph and looks like \"${meant}\" — nothing was derived from it`,\n );\n }\n\n // A page `type` outside the map derives nothing, by design: dockg\n // references iiRDS terms and never mints them. That is correct for\n // `blog-post`, and almost never what the author meant for `how to`.\n const type = fm[\"type\"];\n // Object.hasOwn, not `in`: `type: constructor` and `type: toString` walk\n // the prototype chain and would be read as mapped types, silently skipping\n // the check.\n if (\n typeof type === \"string\" &&\n !Object.hasOwn(PAGE_TYPE_TO_TOPIC_TYPE, type)\n ) {\n const meant = nearestKnown(type, mappedTypes);\n if (meant !== undefined) {\n out.push(\n `${doc.path}: page type \"${type}\" maps to no iiRDS topic type and looks like \"${meant}\" — no graph.type was derived`,\n );\n }\n }\n }\n\n return out.sort(byCodeUnit);\n}\n","/**\n * One-pass git history collection for provenance derivation. A single\n * `git log` subprocess covers the whole corpus: per-file creation and\n * last-modification committer dates, author names, and rename chains\n * (followed backward so history accrues to the file's current path).\n * Deterministic per commit — the wall clock never enters the result.\n *\n * Author emails are deliberately not collected into the result (privacy):\n * names only, matching frontmatter author handling.\n */\nimport { GraphError } from \"../types.js\";\nimport { realExec, type ExecFn } from \"@hawkeyexl/inference\";\nimport { posix, resolve } from \"node:path\";\nimport { normalizeDocPath } from \"./iri.js\";\n\nexport interface GitFileHistory {\n /** Committer ISO date of the oldest commit touching the file (or its earlier names). */\n created?: string;\n /** Committer ISO date of the newest commit touching it. */\n modified?: string;\n /** Unique author names, newest contribution first. */\n authors: string[];\n /** Earlier paths of this file, nearest rename first (git -M heuristic; best-effort). */\n renamedFrom: string[];\n}\n\nexport interface GitHistory {\n /** HEAD committer ISO date — stamps the build activity's prov:endedAtTime. */\n headTime?: string;\n files: Map<string, GitFileHistory>;\n}\n\n/**\n * Git versions print a UTC committer date from `%cI` as either `+00:00` or\n * `Z`. Both name the same instant, so one spelling keeps the graph identical\n * whichever git wrote it. Other offsets pass through unchanged.\n */\nexport function canonicalGitTime(time: string): string {\n return time.replace(/[+-]00:00$/, \"Z\");\n}\n\n/** Record line marker: %x01 keeps commit headers unambiguous in the stream. */\nconst RECORD = \"\\u0001\";\nconst STATUS_LINE = /^([AMDRC])\\d*\\t(.+)$/;\n\n/**\n * Undo git's C-style path quoting. Even with core.quotepath=off, paths\n * containing double quotes, backslashes, or control characters arrive as\n * `\"docs/a\\\"b.md\"` — quotepath only disables quoting of non-ASCII bytes.\n * Octal escapes are raw UTF-8 bytes, decoded together at the end.\n */\nexport function unquoteGitPath(path: string): string {\n if (path.length < 2 || !path.startsWith('\"') || !path.endsWith('\"')) {\n return path;\n }\n const inner = path.slice(1, -1);\n const bytes: number[] = [];\n for (let i = 0; i < inner.length; i++) {\n // `?? \"\"` cannot fire under the loop's own bound; it is how that is said\n // without an assertion, and an empty chunk contributes no bytes anyway.\n const ch = inner[i] ?? \"\";\n if (ch !== \"\\\\\") {\n for (const byte of Buffer.from(ch, \"utf8\")) bytes.push(byte);\n continue;\n }\n const next = inner[++i];\n if (next === undefined) break;\n if (next >= \"0\" && next <= \"7\") {\n let octal = next;\n while (octal.length < 3) {\n const digit = inner[i + 1];\n if (digit === undefined || digit < \"0\" || digit > \"7\") break;\n octal += digit;\n i++;\n }\n bytes.push(Number.parseInt(octal, 8));\n } else {\n const map: Record<string, string> = { n: \"\\n\", t: \"\\t\", r: \"\\r\" };\n for (const byte of Buffer.from(map[next] ?? next, \"utf8\"))\n bytes.push(byte);\n }\n }\n return Buffer.from(bytes).toString(\"utf8\");\n}\n\n/**\n * Unset every inherited `GIT_*` variable for the child process.\n *\n * git exports GIT_DIR, GIT_INDEX_FILE, GIT_WORK_TREE and friends to the\n * subprocesses it runs — every hook, and anything spawned from one. Inheriting\n * them makes `git log` read *that* repository instead of `cwd`, so the same\n * inputs would yield a different graph depending on who invoked dockg, and a\n * build outside a repo would silently succeed against an unrelated one. Both\n * break the determinism contract, so the ambient state is dropped wholesale\n * rather than enumerated: git keeps adding variables to this namespace.\n */\nfunction clearedGitEnv(): Record<string, string | undefined> {\n const cleared: Record<string, string | undefined> = {};\n for (const key of Object.keys(process.env)) {\n if (key.startsWith(\"GIT_\")) cleared[key] = undefined;\n }\n return cleared;\n}\n\n/** HEAD, the work tree's root, and each path `git status` lists. */\nexport interface CheckoutStatus {\n head: string;\n /** Absolute, spelled from `cwd`. */\n root: string;\n /** Relative to `root`, untracked files included. */\n paths: string[];\n}\n\n/** The checkout `cwd` sits in, or `null` outside git or before the first commit. */\nexport async function checkoutStatus(cwd: string, exec: ExecFn = realExec): Promise<CheckoutStatus | null> {\n const git = async (args: string[]): Promise<string | null> => {\n const r = await exec([\"git\", ...args], { cwd, timeoutMs: 60000, env: clearedGitEnv() });\n return r.spawnError !== undefined || r.timedOut || r.code !== 0 ? null : r.stdout;\n };\n // The root as a path up from `cwd`, not `--show-toplevel`: that one is git's spelling, which can\n // differ from the caller's (a Windows 8.3 short name, a symlink), so paths would not compare.\n const [up, head] = (await git([\"rev-parse\", \"--show-cdup\", \"HEAD\"]))?.split(/\\r?\\n/) ?? [];\n if (up === undefined || head === undefined || head === \"\") return null;\n const root = resolve(cwd, up);\n const status = await git([\"status\", \"--porcelain=v1\", \"-z\", \"--untracked-files=all\"]);\n if (status === null) return null;\n const paths: string[] = [];\n const entries = status.split(\"\\0\");\n for (let i = 0; i < entries.length; i++) {\n const entry = entries[i] ?? \"\";\n if (entry.length < 4) continue;\n // A rename names its source in the next field.\n if (entry[0] === \"R\" || entry[0] === \"C\") i++;\n paths.push(entry.slice(3));\n }\n return { head, root, paths };\n}\n\nexport async function collectGitHistory(\n cwd: string,\n exec: ExecFn = realExec,\n): Promise<GitHistory> {\n const git = async (args: string[]): Promise<string> => {\n const result = await exec([\"git\", ...args], {\n cwd,\n timeoutMs: 60000,\n env: clearedGitEnv(),\n });\n // Messages stay neutral about *why* git provenance was requested; the\n // caller frames the failure as an error or a warning.\n if (result.spawnError) {\n throw new GraphError(\n `git could not be run: ${result.spawnError} (is git installed and on PATH?)`,\n );\n }\n if (result.timedOut) {\n throw new GraphError(\n \"`git log` timed out after 60s — the repo history may be too large for whole-history provenance\",\n );\n }\n if (result.code !== 0) {\n const detail = result.stderr.trim().slice(-300);\n throw new GraphError(\n `git history could not be read (is ${cwd} a git repo with at least one commit?)${detail ? ` — git said: ${detail}` : \"\"}`,\n );\n }\n return result.stdout;\n };\n // Keys are relative to `cwd`, the directory the caller's labels count from\n // (`documentBase`). git reports paths from the repository root, so each is\n // rebased by `cwd`'s own place in the repository. `--relative` would do that\n // too, but it drops every path outside `cwd`: a page labelled `../x.md`, and\n // a rename from outside, whose fold into the current name is the point.\n const prefix = `/${(await git([\"rev-parse\", \"--show-prefix\"])).trim()}`;\n const label = (raw: string): string =>\n posix.relative(prefix, `/${normalizeDocPath(unquoteGitPath(raw))}`);\n const stdout = await git([\n \"-c\",\n \"core.quotepath=off\",\n \"log\",\n `--format=${RECORD}%H%x09%an%x09%cI`,\n \"--name-status\",\n \"-M\",\n ]);\n if (stdout.trim() === \"\") {\n throw new GraphError(\n `git history could not be read (is ${cwd} a git repo with at least one commit?)`,\n );\n }\n\n const files = new Map<string, GitFileHistory>();\n /** Maps a historical path to the file's current (newest) path. */\n const currentName = new Map<string, string>();\n let headTime: string | undefined;\n let commitAuthor = \"\";\n let commitTime = \"\";\n\n const entry = (path: string): GitFileHistory => {\n let file = files.get(path);\n if (!file) {\n file = { authors: [], renamedFrom: [] };\n files.set(path, file);\n }\n return file;\n };\n\n /** Register that the commit being parsed touched `path` (as known at that time). */\n const touch = (pathThen: string): GitFileHistory => {\n const path = label(pathThen);\n const current = currentName.get(path) ?? path;\n const file = entry(current);\n // Walking newest→oldest: first touch wins `modified`, every touch pushes\n // `created` older, authors keep first-appearance (newest) order.\n file.modified ??= commitTime;\n file.created = commitTime;\n if (!file.authors.includes(commitAuthor)) file.authors.push(commitAuthor);\n return file;\n };\n\n for (const line of stdout.split(\"\\n\")) {\n if (line.startsWith(RECORD)) {\n const [, author = \"\", rawTime = \"\"] = line.slice(1).split(\"\\t\");\n const time = canonicalGitTime(rawTime);\n commitAuthor = author;\n commitTime = time;\n headTime ??= time;\n continue;\n }\n const match = STATUS_LINE.exec(line);\n // Both groups are mandatory in the pattern, so a match carries both;\n // requiring them subsumes the bare `if (!match) continue` this replaces.\n const status = match?.[1];\n const rest = match?.[2];\n if (status === undefined || rest === undefined) continue;\n if (status === \"R\" || status === \"C\") {\n const [oldPath, newPath] = rest.split(\"\\t\");\n if (!oldPath || !newPath) continue;\n if (status === \"C\") {\n // Copies create a new file from an old one; the old file's own history\n // is separate. Record the touch on the copy only.\n touch(newPath);\n continue;\n }\n const file = touch(newPath);\n const normalizedOld = label(oldPath);\n file.renamedFrom.push(normalizedOld);\n // Older commits refer to the pre-rename path; fold them into this file.\n const normalizedNew = label(newPath);\n currentName.set(\n normalizedOld,\n currentName.get(normalizedNew) ?? normalizedNew,\n );\n } else {\n touch(rest);\n }\n }\n\n return { headTime, files };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAKA,SAAS,WAAW,gBAAAA,eAAc,qBAAqB;AACvD,SAAS,SAAS,WAAAC,gBAAe;;;ACajC,SAAS,kBAAkB;AAC3B,SAAS,aAAa;AACtB,SAAS,oBAAoB;AAC7B,SAAS,YAAY;AAWd,IAAM,oBAAoB;AAOjC,IAAM,gBAAgB;AAEtB,SAAS,OAAO,MAAsB;AACpC,SAAO,WAAW,QAAQ,EAAE,OAAO,MAAM,MAAM,EAAE,OAAO,KAAK;AAC/D;AAEA,IAAM,YAAY,CAAC,UACjB,MAAM,QAAQ,KAAK,KAAK,MAAM,MAAM,CAAC,MAAM,OAAO,MAAM,QAAQ;AAElE,SAAS,UAAU,OAAyB;AAC1C,MAAI,OAAO,UAAU,YAAY,UAAU,KAAM,QAAO;AACxD,QAAM,IAAI;AACV,SACE,OAAO,EAAE,SAAS,YAClB,OAAO,EAAE,UAAU,YACnB,OAAO,EAAE,UAAU,YACnB,OAAO,EAAE,UAAU,aAClB,EAAE,eAAe,QAAQ,OAAO,EAAE,eAAe,cACjD,EAAE,SAAS,QAAQ,OAAO,EAAE,S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AAE,YAAY,KAAK,OAAO;AAAA,QAC/D,GAAI,KAAK,aAAa,OAAO,EAAE,UAAU,KAAK,IAAI,CAAC;AAAA,MACrD,CAAC;AAAA,IACH,SAAS,GAAG;AACV,eAAS;AAAA,QACP,+EAA0E,aAAa,CAAC,CAAC;AAAA,MAC3F;AAAA,IACF;AAAA,EACF;AAEA,QAAM,QAAQ,YAAY,MAAM;AAAA,IAC9B,SAAS,OAAO;AAAA,IAChB,QAAQ,OAAO,MAAM;AAAA;AAAA;AAAA,IAGrB,aAAa,gBAAI;AAAA,IACjB;AAAA,IACA,WAAW,OAAO,WAAW;AAAA,IAC7B;AAAA,EACF,CAAC;AACD,QAAM,UAAU,GAAG,GAAG,IAAI;AAC1B,QAAM,WAAW;AAAA,IACf,OAAO,MAAM,OAAO,CAAC,MAAM,EAAE,MAAM,YAAY,EAAE,EAAE,UAAU,OAAO,EAAE;AAAA,IACtE,cAAc,iBAAiB,QAAQ;AAAA,EACzC;AACA,QAAM,SAAS,WAAW,KAAK;AAC/B,QAAM,MAAM,MAAM;AAElB,SAAO;AAAA,IACL;AAAA,IACA,MAAM,KAAK;AAAA,IACX,OAAO,MAAM;AAAA,IACb;AAAA,IACA,iBAAiB,gBAAgB,MAAM,OAAO,OAAO,EAAE;AAAA,IACvD;AAAA,IACA;AAAA,EACF;AACF;","names":["readFileSync","resolve","resolve","tagged","resolve","readFileSync"]}
@@ -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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