@hawkeyexl/manni 4.20.1 → 4.21.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (244) hide show
  1. package/README.md +1 -1
  2. package/dist/{batch-J626LZ22.js → batch-C534YIAU.js} +14 -14
  3. package/dist/{build-AYLD6V6Y.js → build-SVKT7QFU.js} +15 -14
  4. package/dist/{calibrate-2HZFACIX.js → calibrate-AL3MH7TY.js} +15 -15
  5. package/dist/{capture-NMDIPC6S.js → capture-2F7B4DAD.js} +14 -14
  6. package/dist/check-BI7OGIVE.js +48 -0
  7. package/dist/{check-RCSQARQE.js → check-JZINDP3F.js} +13 -13
  8. package/dist/{check-PQ7S5I3I.js → check-LKPQPQWJ.js} +15 -15
  9. package/dist/check-OPUMZEVK.js +35 -0
  10. package/dist/{check-KNQV7GLU.js → check-OW7UD73D.js} +12 -12
  11. package/dist/{chunk-N3DYE6LJ.js → chunk-22WGKOQ7.js} +5 -5
  12. package/dist/{chunk-TAJYMXMM.js → chunk-2HOWRAWK.js} +2 -2
  13. package/dist/{chunk-ROZDHPKA.js → chunk-2NGFDLIM.js} +3 -3
  14. package/dist/{chunk-GGTCSMNX.js → chunk-2YKUSTHS.js} +4 -4
  15. package/dist/{chunk-S2HW3CBF.js → chunk-3SFAB75L.js} +5 -5
  16. package/dist/{chunk-E6JYRVR5.js → chunk-5LE4NH3Z.js} +24 -7
  17. package/dist/chunk-5LE4NH3Z.js.map +1 -0
  18. package/dist/{chunk-NDPQ2GQ4.js → chunk-5UJKXOAD.js} +5 -5
  19. package/dist/chunk-6XK3NTL5.js +706 -0
  20. package/dist/chunk-6XK3NTL5.js.map +1 -0
  21. package/dist/{chunk-XPO655IX.js → chunk-762MM6NA.js} +3 -3
  22. package/dist/{chunk-FIR2MAGS.js → chunk-A4QNKEX4.js} +2 -2
  23. package/dist/{chunk-YIHIRMXN.js → chunk-AE6KBAAU.js} +4 -4
  24. package/dist/{chunk-UVC3BUKU.js → chunk-APAF4VWW.js} +3 -3
  25. package/dist/{chunk-D54BQM5P.js → chunk-ARNI3SJT.js} +7 -7
  26. package/dist/{chunk-OXCWCEVV.js → chunk-BHGFLRXM.js} +5 -5
  27. package/dist/{chunk-WRWW6SGG.js → chunk-BJUEOC4G.js} +2 -2
  28. package/dist/{chunk-MPXMQGJI.js → chunk-BKY6GAFA.js} +8 -8
  29. package/dist/{chunk-ACJUZFRT.js → chunk-BLXRIAV2.js} +4 -4
  30. package/dist/{chunk-H3C3UXTA.js → chunk-BXCVOHEX.js} +7 -7
  31. package/dist/{chunk-ODSIHEIW.js → chunk-BXE4L52Q.js} +2 -2
  32. package/dist/{chunk-YM2W43DI.js → chunk-CLPC3LKX.js} +13 -9
  33. package/dist/chunk-CLPC3LKX.js.map +1 -0
  34. package/dist/{chunk-P6XZ44C2.js → chunk-CREFJCWZ.js} +4 -4
  35. package/dist/{chunk-OQR3VVAX.js → chunk-CZIO37J5.js} +3 -3
  36. package/dist/{chunk-OVUQNM7Y.js → chunk-D4QHRVDJ.js} +2 -2
  37. package/dist/{chunk-WI3PPQQX.js → chunk-D5GBYKDU.js} +2 -2
  38. package/dist/{chunk-A633WB3N.js → chunk-DENZLZ3Z.js} +22 -20
  39. package/dist/{chunk-A633WB3N.js.map → chunk-DENZLZ3Z.js.map} +1 -1
  40. package/dist/{chunk-P5DWBG6T.js → chunk-DMVBIIP3.js} +3 -3
  41. package/dist/{chunk-LPJ3IB26.js → chunk-DPDG3FHL.js} +17 -3
  42. package/dist/chunk-DPDG3FHL.js.map +1 -0
  43. package/dist/{chunk-MTMR65NM.js → chunk-E23KWEPL.js} +2 -2
  44. package/dist/{chunk-5E3ABFOQ.js → chunk-E7OG5F6S.js} +3 -3
  45. package/dist/{chunk-5CJ3P5O3.js → chunk-FHJIH6XP.js} +8 -98
  46. package/dist/chunk-FHJIH6XP.js.map +1 -0
  47. package/dist/{chunk-O4O6JOGD.js → chunk-GMLOAKOA.js} +16 -4
  48. package/dist/chunk-GMLOAKOA.js.map +1 -0
  49. package/dist/{chunk-YYWZ2MSL.js → chunk-H5YWCCBO.js} +16 -11
  50. package/dist/chunk-H5YWCCBO.js.map +1 -0
  51. package/dist/{chunk-2GTR24SA.js → chunk-HHJ2HFPP.js} +8 -8
  52. package/dist/{chunk-Z2T5U7HN.js → chunk-IN5T22FP.js} +2 -2
  53. package/dist/{chunk-RA2BER5P.js → chunk-IOJD2RFG.js} +2 -2
  54. package/dist/{chunk-MJZ5HYYL.js → chunk-JQA6RF4R.js} +2 -2
  55. package/dist/{chunk-MJZ5HYYL.js.map → chunk-JQA6RF4R.js.map} +1 -1
  56. package/dist/{chunk-ZB3OFSRB.js → chunk-JUUCCML3.js} +4 -4
  57. package/dist/{chunk-TDG2S5UE.js → chunk-KBSTXL6L.js} +3 -3
  58. package/dist/{chunk-MJZK7G4B.js → chunk-KCWNJMSS.js} +3 -3
  59. package/dist/{chunk-EOJEPEYY.js → chunk-KQDRO6N6.js} +2 -2
  60. package/dist/{chunk-ISDFYXLA.js → chunk-LWBNHK72.js} +15 -13
  61. package/dist/{chunk-ISDFYXLA.js.map → chunk-LWBNHK72.js.map} +1 -1
  62. package/dist/{chunk-HGUCJ3K3.js → chunk-MTCOBRCX.js} +4 -4
  63. package/dist/{chunk-N2VB6UUE.js → chunk-NLJ3XIKT.js} +7 -5
  64. package/dist/{chunk-N2VB6UUE.js.map → chunk-NLJ3XIKT.js.map} +1 -1
  65. package/dist/{chunk-FKELQCGN.js → chunk-OWJLB2AF.js} +2 -2
  66. package/dist/{chunk-D4XQX4W7.js → chunk-P7HAXMFN.js} +2 -2
  67. package/dist/{chunk-4F5WGZRP.js → chunk-PACZEDOH.js} +5 -5
  68. package/dist/{chunk-QSPH4F56.js → chunk-PTGXEZQD.js} +2 -2
  69. package/dist/chunk-PTGXEZQD.js.map +1 -0
  70. package/dist/{chunk-SUTY4VCZ.js → chunk-Q76T6Y6X.js} +6 -6
  71. package/dist/{chunk-CXL6ES7O.js → chunk-R2CR62JV.js} +4 -4
  72. package/dist/{chunk-RN7IA742.js → chunk-RKACUTY5.js} +7 -7
  73. package/dist/{chunk-JPXC62SD.js → chunk-RQPEKHZH.js} +8 -6
  74. package/dist/{chunk-JPXC62SD.js.map → chunk-RQPEKHZH.js.map} +1 -1
  75. package/dist/{chunk-CT5WSUUZ.js → chunk-RWXR3GJI.js} +2 -2
  76. package/dist/{chunk-4H3IOF52.js → chunk-S5G6T4VC.js} +3 -3
  77. package/dist/chunk-SHXPE4D4.js +100 -0
  78. package/dist/chunk-SHXPE4D4.js.map +1 -0
  79. package/dist/{chunk-6FY573GB.js → chunk-TFVNEPMF.js} +3 -3
  80. package/dist/{chunk-BM43RJIS.js → chunk-U4OJ7U45.js} +8 -8
  81. package/dist/{chunk-LXJ4FZ7Y.js → chunk-V2XJJEEF.js} +4 -4
  82. package/dist/{chunk-QGBNWEWS.js → chunk-VLRIP4BQ.js} +2 -2
  83. package/dist/{chunk-BY4THWAQ.js → chunk-WHVFHBL3.js} +3 -3
  84. package/dist/{chunk-KERICP5Y.js → chunk-XBJKYXOR.js} +6 -6
  85. package/dist/{chunk-C5BXSQDO.js → chunk-XI3BNZG4.js} +5 -5
  86. package/dist/{chunk-4DFBBU4A.js → chunk-YSZNJ2ID.js} +2 -2
  87. package/dist/{cli-IIFCE6GY.js → cli-3PBRPPMQ.js} +14 -14
  88. package/dist/{cli-ISKXSN3P.js → cli-6NKE6RMT.js} +18 -18
  89. package/dist/{cli-FTSJQSB4.js → cli-77A46SB2.js} +17 -17
  90. package/dist/{cli-PCZ7XNCO.js → cli-AVHLY2AI.js} +61 -45
  91. package/dist/cli-AVHLY2AI.js.map +1 -0
  92. package/dist/{cli-DQRFSU7U.js → cli-FDXU7CGZ.js} +15 -14
  93. package/dist/{cli-DQRFSU7U.js.map → cli-FDXU7CGZ.js.map} +1 -1
  94. package/dist/{cli-6J4P5MLU.js → cli-FSDJY5OC.js} +2 -2
  95. package/dist/{cli-K5635N25.js → cli-JNYL6LB7.js} +14 -14
  96. package/dist/{cli-TCHSYJLB.js → cli-K47XWDLJ.js} +21 -21
  97. package/dist/{cli-TM2JCTQT.js → cli-LP5OE3BL.js} +9 -9
  98. package/dist/{cli-4RTNEVVX.js → cli-MOKRUHZT.js} +9 -9
  99. package/dist/{cli-K5QWXB7H.js → cli-MQXOK64K.js} +26 -25
  100. package/dist/{cli-K5QWXB7H.js.map → cli-MQXOK64K.js.map} +1 -1
  101. package/dist/cli.js +15 -15
  102. package/dist/{config-7I5CHHRZ.js → config-BMWDC66C.js} +2 -2
  103. package/dist/docmeta.js +8 -8
  104. package/dist/github-6GYTPSGV.js +35 -0
  105. package/dist/{github-CMAZWS76.js → github-DJOLVNDD.js} +12 -12
  106. package/dist/{github-NXR4QMMM.js → github-ZF2TQ3RP.js} +14 -14
  107. package/dist/index.d.ts +2 -1
  108. package/dist/index.js +49 -47
  109. package/dist/index.js.map +1 -1
  110. package/dist/json-Y7625EFE.js +42 -0
  111. package/dist/{json-7Z2IFGB3.js → json-YIK72XAL.js} +12 -12
  112. package/dist/{labels-SE2WL7WD.js → labels-X633ZPK7.js} +11 -11
  113. package/dist/{lint-VUYM5PPM.js → lint-RF3B55W7.js} +12 -12
  114. package/dist/{list-WD3TZS5R.js → list-5DW4QZ7P.js} +12 -12
  115. package/dist/list-7CHWJ633.js +39 -0
  116. package/dist/{list-LTF25DQE.js → list-UNWG6NPD.js} +12 -12
  117. package/dist/{page-A2Y4ZMV4.js → page-OMPEACUN.js} +11 -11
  118. package/dist/{prepare-M2COBP5O.js → prepare-B4JVDVOV.js} +13 -13
  119. package/dist/{pretty-SFFOMSG5.js → pretty-PPNHHOEN.js} +13 -13
  120. package/dist/{pretty-D3DZFC5U.js → pretty-U7ATCFBN.js} +12 -12
  121. package/dist/pretty-XGYQ25PH.js +43 -0
  122. package/dist/{reporters-UTLJVSWX.js → reporters-FAIEOTC4.js} +11 -11
  123. package/dist/{reporters-TO7Q6JYF.js → reporters-KE7AZR6C.js} +4 -4
  124. package/dist/{run-BDGYRUXJ.js → run-MHJ3AYKG.js} +12 -12
  125. package/dist/{sarif-IAGMXA6C.js → sarif-DOGRSGTB.js} +10 -10
  126. package/dist/{sarif-GJYLRXLS.js → sarif-MIEMQOIK.js} +11 -11
  127. package/dist/{sarif-EHAMGCVR.js → sarif-RGRG7VFX.js} +15 -15
  128. package/dist/{strategy-UKRA6WO4.js → strategy-EK5VY5DG.js} +24 -23
  129. package/dist/{strategy-UKRA6WO4.js.map → strategy-EK5VY5DG.js.map} +1 -1
  130. package/dist/{term-AMORBEO7.js → term-MDN3NJDW.js} +17 -17
  131. package/dist/{validate-CDTKFZUV.js → validate-QDYQ642J.js} +5 -5
  132. package/package.json +1 -1
  133. package/plugin/manni/.claude-plugin/plugin.json +11 -3
  134. package/plugin/manni/hooks/hooks.json +4 -4
  135. package/plugin/manni/hooks/manni.mjs +18 -5
  136. package/plugin/manni/hooks/tracevals.mjs +7 -0
  137. package/plugin/manni/skills/fix/SKILL.md +5 -1
  138. package/dist/check-OH4KKXP3.js +0 -33
  139. package/dist/check-PRAMKQCI.js +0 -47
  140. package/dist/chunk-5CJ3P5O3.js.map +0 -1
  141. package/dist/chunk-DNF42MK7.js +0 -326
  142. package/dist/chunk-DNF42MK7.js.map +0 -1
  143. package/dist/chunk-E6JYRVR5.js.map +0 -1
  144. package/dist/chunk-LPJ3IB26.js.map +0 -1
  145. package/dist/chunk-O4O6JOGD.js.map +0 -1
  146. package/dist/chunk-QSPH4F56.js.map +0 -1
  147. package/dist/chunk-SIREOHLW.js +0 -233
  148. package/dist/chunk-SIREOHLW.js.map +0 -1
  149. package/dist/chunk-YM2W43DI.js.map +0 -1
  150. package/dist/chunk-YYWZ2MSL.js.map +0 -1
  151. package/dist/cli-PCZ7XNCO.js.map +0 -1
  152. package/dist/github-BUK5CVQW.js +0 -27
  153. package/dist/json-NZSGRYOE.js +0 -34
  154. package/dist/list-4JGOXLOZ.js +0 -33
  155. package/dist/pretty-R67YU6TU.js +0 -35
  156. /package/dist/{batch-J626LZ22.js.map → batch-C534YIAU.js.map} +0 -0
  157. /package/dist/{build-AYLD6V6Y.js.map → build-SVKT7QFU.js.map} +0 -0
  158. /package/dist/{calibrate-2HZFACIX.js.map → calibrate-AL3MH7TY.js.map} +0 -0
  159. /package/dist/{capture-NMDIPC6S.js.map → capture-2F7B4DAD.js.map} +0 -0
  160. /package/dist/{check-KNQV7GLU.js.map → check-BI7OGIVE.js.map} +0 -0
  161. /package/dist/{check-OH4KKXP3.js.map → check-JZINDP3F.js.map} +0 -0
  162. /package/dist/{check-PQ7S5I3I.js.map → check-LKPQPQWJ.js.map} +0 -0
  163. /package/dist/{check-PRAMKQCI.js.map → check-OPUMZEVK.js.map} +0 -0
  164. /package/dist/{check-RCSQARQE.js.map → check-OW7UD73D.js.map} +0 -0
  165. /package/dist/{chunk-N3DYE6LJ.js.map → chunk-22WGKOQ7.js.map} +0 -0
  166. /package/dist/{chunk-TAJYMXMM.js.map → chunk-2HOWRAWK.js.map} +0 -0
  167. /package/dist/{chunk-ROZDHPKA.js.map → chunk-2NGFDLIM.js.map} +0 -0
  168. /package/dist/{chunk-GGTCSMNX.js.map → chunk-2YKUSTHS.js.map} +0 -0
  169. /package/dist/{chunk-S2HW3CBF.js.map → chunk-3SFAB75L.js.map} +0 -0
  170. /package/dist/{chunk-NDPQ2GQ4.js.map → chunk-5UJKXOAD.js.map} +0 -0
  171. /package/dist/{chunk-XPO655IX.js.map → chunk-762MM6NA.js.map} +0 -0
  172. /package/dist/{chunk-FIR2MAGS.js.map → chunk-A4QNKEX4.js.map} +0 -0
  173. /package/dist/{chunk-YIHIRMXN.js.map → chunk-AE6KBAAU.js.map} +0 -0
  174. /package/dist/{chunk-UVC3BUKU.js.map → chunk-APAF4VWW.js.map} +0 -0
  175. /package/dist/{chunk-D54BQM5P.js.map → chunk-ARNI3SJT.js.map} +0 -0
  176. /package/dist/{chunk-OXCWCEVV.js.map → chunk-BHGFLRXM.js.map} +0 -0
  177. /package/dist/{chunk-WRWW6SGG.js.map → chunk-BJUEOC4G.js.map} +0 -0
  178. /package/dist/{chunk-MPXMQGJI.js.map → chunk-BKY6GAFA.js.map} +0 -0
  179. /package/dist/{chunk-ACJUZFRT.js.map → chunk-BLXRIAV2.js.map} +0 -0
  180. /package/dist/{chunk-H3C3UXTA.js.map → chunk-BXCVOHEX.js.map} +0 -0
  181. /package/dist/{chunk-ODSIHEIW.js.map → chunk-BXE4L52Q.js.map} +0 -0
  182. /package/dist/{chunk-P6XZ44C2.js.map → chunk-CREFJCWZ.js.map} +0 -0
  183. /package/dist/{chunk-OQR3VVAX.js.map → chunk-CZIO37J5.js.map} +0 -0
  184. /package/dist/{chunk-OVUQNM7Y.js.map → chunk-D4QHRVDJ.js.map} +0 -0
  185. /package/dist/{chunk-WI3PPQQX.js.map → chunk-D5GBYKDU.js.map} +0 -0
  186. /package/dist/{chunk-P5DWBG6T.js.map → chunk-DMVBIIP3.js.map} +0 -0
  187. /package/dist/{chunk-MTMR65NM.js.map → chunk-E23KWEPL.js.map} +0 -0
  188. /package/dist/{chunk-5E3ABFOQ.js.map → chunk-E7OG5F6S.js.map} +0 -0
  189. /package/dist/{chunk-2GTR24SA.js.map → chunk-HHJ2HFPP.js.map} +0 -0
  190. /package/dist/{chunk-Z2T5U7HN.js.map → chunk-IN5T22FP.js.map} +0 -0
  191. /package/dist/{chunk-RA2BER5P.js.map → chunk-IOJD2RFG.js.map} +0 -0
  192. /package/dist/{chunk-ZB3OFSRB.js.map → chunk-JUUCCML3.js.map} +0 -0
  193. /package/dist/{chunk-TDG2S5UE.js.map → chunk-KBSTXL6L.js.map} +0 -0
  194. /package/dist/{chunk-MJZK7G4B.js.map → chunk-KCWNJMSS.js.map} +0 -0
  195. /package/dist/{chunk-EOJEPEYY.js.map → chunk-KQDRO6N6.js.map} +0 -0
  196. /package/dist/{chunk-HGUCJ3K3.js.map → chunk-MTCOBRCX.js.map} +0 -0
  197. /package/dist/{chunk-FKELQCGN.js.map → chunk-OWJLB2AF.js.map} +0 -0
  198. /package/dist/{chunk-D4XQX4W7.js.map → chunk-P7HAXMFN.js.map} +0 -0
  199. /package/dist/{chunk-4F5WGZRP.js.map → chunk-PACZEDOH.js.map} +0 -0
  200. /package/dist/{chunk-SUTY4VCZ.js.map → chunk-Q76T6Y6X.js.map} +0 -0
  201. /package/dist/{chunk-CXL6ES7O.js.map → chunk-R2CR62JV.js.map} +0 -0
  202. /package/dist/{chunk-RN7IA742.js.map → chunk-RKACUTY5.js.map} +0 -0
  203. /package/dist/{chunk-CT5WSUUZ.js.map → chunk-RWXR3GJI.js.map} +0 -0
  204. /package/dist/{chunk-4H3IOF52.js.map → chunk-S5G6T4VC.js.map} +0 -0
  205. /package/dist/{chunk-6FY573GB.js.map → chunk-TFVNEPMF.js.map} +0 -0
  206. /package/dist/{chunk-BM43RJIS.js.map → chunk-U4OJ7U45.js.map} +0 -0
  207. /package/dist/{chunk-LXJ4FZ7Y.js.map → chunk-V2XJJEEF.js.map} +0 -0
  208. /package/dist/{chunk-QGBNWEWS.js.map → chunk-VLRIP4BQ.js.map} +0 -0
  209. /package/dist/{chunk-BY4THWAQ.js.map → chunk-WHVFHBL3.js.map} +0 -0
  210. /package/dist/{chunk-KERICP5Y.js.map → chunk-XBJKYXOR.js.map} +0 -0
  211. /package/dist/{chunk-C5BXSQDO.js.map → chunk-XI3BNZG4.js.map} +0 -0
  212. /package/dist/{chunk-4DFBBU4A.js.map → chunk-YSZNJ2ID.js.map} +0 -0
  213. /package/dist/{cli-IIFCE6GY.js.map → cli-3PBRPPMQ.js.map} +0 -0
  214. /package/dist/{cli-ISKXSN3P.js.map → cli-6NKE6RMT.js.map} +0 -0
  215. /package/dist/{cli-FTSJQSB4.js.map → cli-77A46SB2.js.map} +0 -0
  216. /package/dist/{cli-6J4P5MLU.js.map → cli-FSDJY5OC.js.map} +0 -0
  217. /package/dist/{cli-K5635N25.js.map → cli-JNYL6LB7.js.map} +0 -0
  218. /package/dist/{cli-TCHSYJLB.js.map → cli-K47XWDLJ.js.map} +0 -0
  219. /package/dist/{cli-TM2JCTQT.js.map → cli-LP5OE3BL.js.map} +0 -0
  220. /package/dist/{cli-4RTNEVVX.js.map → cli-MOKRUHZT.js.map} +0 -0
  221. /package/dist/{config-7I5CHHRZ.js.map → config-BMWDC66C.js.map} +0 -0
  222. /package/dist/{github-BUK5CVQW.js.map → github-6GYTPSGV.js.map} +0 -0
  223. /package/dist/{github-CMAZWS76.js.map → github-DJOLVNDD.js.map} +0 -0
  224. /package/dist/{github-NXR4QMMM.js.map → github-ZF2TQ3RP.js.map} +0 -0
  225. /package/dist/{json-7Z2IFGB3.js.map → json-Y7625EFE.js.map} +0 -0
  226. /package/dist/{json-NZSGRYOE.js.map → json-YIK72XAL.js.map} +0 -0
  227. /package/dist/{labels-SE2WL7WD.js.map → labels-X633ZPK7.js.map} +0 -0
  228. /package/dist/{lint-VUYM5PPM.js.map → lint-RF3B55W7.js.map} +0 -0
  229. /package/dist/{list-4JGOXLOZ.js.map → list-5DW4QZ7P.js.map} +0 -0
  230. /package/dist/{list-LTF25DQE.js.map → list-7CHWJ633.js.map} +0 -0
  231. /package/dist/{list-WD3TZS5R.js.map → list-UNWG6NPD.js.map} +0 -0
  232. /package/dist/{page-A2Y4ZMV4.js.map → page-OMPEACUN.js.map} +0 -0
  233. /package/dist/{prepare-M2COBP5O.js.map → prepare-B4JVDVOV.js.map} +0 -0
  234. /package/dist/{pretty-D3DZFC5U.js.map → pretty-PPNHHOEN.js.map} +0 -0
  235. /package/dist/{pretty-R67YU6TU.js.map → pretty-U7ATCFBN.js.map} +0 -0
  236. /package/dist/{pretty-SFFOMSG5.js.map → pretty-XGYQ25PH.js.map} +0 -0
  237. /package/dist/{reporters-TO7Q6JYF.js.map → reporters-FAIEOTC4.js.map} +0 -0
  238. /package/dist/{reporters-UTLJVSWX.js.map → reporters-KE7AZR6C.js.map} +0 -0
  239. /package/dist/{run-BDGYRUXJ.js.map → run-MHJ3AYKG.js.map} +0 -0
  240. /package/dist/{sarif-EHAMGCVR.js.map → sarif-DOGRSGTB.js.map} +0 -0
  241. /package/dist/{sarif-GJYLRXLS.js.map → sarif-MIEMQOIK.js.map} +0 -0
  242. /package/dist/{sarif-IAGMXA6C.js.map → sarif-RGRG7VFX.js.map} +0 -0
  243. /package/dist/{term-AMORBEO7.js.map → term-MDN3NJDW.js.map} +0 -0
  244. /package/dist/{validate-CDTKFZUV.js.map → validate-QDYQ642J.js.map} +0 -0
@@ -1,233 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- PAGE_FIELDS,
4
- PARENTS,
5
- guidanceFor,
6
- resolveSeverity,
7
- ruleId
8
- } from "./chunk-O4O6JOGD.js";
9
- import {
10
- closestName
11
- } from "./chunk-XTKJNRJ6.js";
12
-
13
- // src/strategy/core/check.ts
14
- var fold = (value) => value.toLowerCase();
15
- var FIELD_TYPES = {
16
- audiences: "audience",
17
- personas: "persona",
18
- journeys: "journey",
19
- audience: "audience"
20
- };
21
- var parentTypeOf = (type) => FIELD_TYPES[PARENTS[type]];
22
- function indexSet(set) {
23
- const byType = /* @__PURE__ */ new Map();
24
- const byId = /* @__PURE__ */ new Map();
25
- for (const record of set.records) {
26
- const ids = byType.get(record.type) ?? /* @__PURE__ */ new Map();
27
- if (!ids.has(fold(record.id))) ids.set(fold(record.id), record);
28
- byType.set(record.type, ids);
29
- if (!byId.has(fold(record.id))) byId.set(fold(record.id), record);
30
- }
31
- const resolveIn = (type, value) => byType.get(type)?.get(fold(value));
32
- const parentsOf = (record) => {
33
- if (record.type === "audience") return [];
34
- const type = parentTypeOf(record.type);
35
- const found = record.parents.map((p) => resolveIn(type, p.value)).filter((r) => r !== void 0);
36
- return [...new Set(found)];
37
- };
38
- const children = /* @__PURE__ */ new Map();
39
- for (const record of set.records) {
40
- for (const parent of parentsOf(record)) children.set(parent, [...children.get(parent) ?? [], record]);
41
- }
42
- const pages = /* @__PURE__ */ new Map();
43
- for (const reference of set.references) {
44
- if (reference.record) continue;
45
- const target = resolveIn(FIELD_TYPES[reference.field], reference.value);
46
- if (target === void 0) continue;
47
- const named = pages.get(target) ?? /* @__PURE__ */ new Set();
48
- named.add(reference.page);
49
- pages.set(target, named);
50
- }
51
- return {
52
- has: (type) => (byType.get(type)?.size ?? 0) > 0,
53
- resolve: resolveIn,
54
- anyWithId: (value) => byId.get(fold(value)),
55
- parentsOf,
56
- childrenOf: (record) => children.get(record) ?? [],
57
- pagesNaming: (record) => [...pages.get(record) ?? []].sort()
58
- };
59
- }
60
- function article(type) {
61
- return `${type === "audience" ? "an" : "a"} ${type}`;
62
- }
63
- function onRecord(record) {
64
- return record.idAt ?? { file: record.file, line: record.line };
65
- }
66
- function located(at) {
67
- return { file: at.file, ...at.line === void 0 ? {} : { line: at.line } };
68
- }
69
- function ancestorOf(index, record, type) {
70
- let current = index.parentsOf(record)[0];
71
- while (current !== void 0 && current.type !== type) current = index.parentsOf(current)[0];
72
- return current;
73
- }
74
- function checkStrategySet(set, opts = {}) {
75
- const levels = resolveSeverity(opts.severity);
76
- const index = indexSet(set);
77
- const drafts = [];
78
- const unresolved = (field, value, onRecordField) => {
79
- const type = FIELD_TYPES[field];
80
- const other = index.anyWithId(value);
81
- if (other !== void 0) {
82
- const ancestor = ancestorOf(index, other, type);
83
- const fix2 = ancestor !== void 0 ? `Did you mean its ${type}, "${ancestor.id}"?` : onRecordField ? "Correct the value." : `Move it to ${PAGE_FIELDS[other.type]}:.`;
84
- return { message: `${field}: "${value}" is ${article(other.type)}, not ${article(type)}.`, fix: fix2 };
85
- }
86
- const ids = set.records.filter((r) => r.type === type).map((r) => r.id);
87
- const nearest = closestName(fold(value), ids.map(fold));
88
- const suggestion = nearest === void 0 ? void 0 : ids.find((id) => fold(id) === nearest);
89
- const add = `Correct the value, or add a record with type: ${type} and id: ${value}.`;
90
- const fix = suggestion === void 0 ? add : onRecordField ? `Did you mean "${suggestion}"?` : `Did you mean "${suggestion}"? ${add}`;
91
- return { message: `${field}: "${value}" names no ${type}.`, fix };
92
- };
93
- for (const reference of set.references) {
94
- const type = FIELD_TYPES[reference.field];
95
- if (!index.has(type) || index.resolve(type, reference.value) !== void 0) continue;
96
- drafts.push({
97
- rule: "undefined-reference",
98
- ...unresolved(reference.field, reference.value, false),
99
- ...located(reference),
100
- field: reference.field
101
- });
102
- }
103
- for (const record of set.records) {
104
- if (record.type === "audience") continue;
105
- const field = PARENTS[record.type];
106
- const type = parentTypeOf(record.type);
107
- if (!index.has(type)) continue;
108
- for (const parent of record.parents) {
109
- if (index.resolve(type, parent.value) !== void 0) continue;
110
- drafts.push({
111
- rule: "undefined-reference",
112
- ...unresolved(field, parent.value, true),
113
- ...located(parent),
114
- id: record.id,
115
- field
116
- });
117
- }
118
- }
119
- const sharing = /* @__PURE__ */ new Map();
120
- for (const record of set.records) sharing.set(fold(record.id), [...sharing.get(fold(record.id)) ?? [], record]);
121
- for (const group of sharing.values()) {
122
- if (group.length < 2) continue;
123
- for (const record of group) {
124
- const others = group.filter((other) => other !== record).map((other) => {
125
- const at = onRecord(other);
126
- return at.line === void 0 ? at.file : `${at.file}:${String(at.line)}`;
127
- });
128
- drafts.push({
129
- rule: "duplicate-id",
130
- message: `id: "${record.id}" is also the id of ${others.join(", ")}.`,
131
- fix: "Give each record its own id.",
132
- ...located(onRecord(record)),
133
- id: record.id
134
- });
135
- }
136
- }
137
- const byPage = /* @__PURE__ */ new Map();
138
- for (const reference of set.references) {
139
- if (reference.record) continue;
140
- byPage.set(reference.page, [...byPage.get(reference.page) ?? [], reference]);
141
- }
142
- for (const references of byPage.values()) {
143
- const named = (field) => new Set(references.filter((r) => r.field === field).map((r) => fold(r.value)));
144
- const reported = /* @__PURE__ */ new Set();
145
- for (const childType of ["journey", "persona"]) {
146
- const parentType = parentTypeOf(childType);
147
- const parentField = PAGE_FIELDS[parentType];
148
- const has = named(parentField);
149
- for (const reference of references) {
150
- if (reference.field !== PAGE_FIELDS[childType]) continue;
151
- const child = index.resolve(childType, reference.value);
152
- if (child === void 0) continue;
153
- const parents = index.parentsOf(child);
154
- const ids = parents.map((p) => `"${p.id}"`).join(", ");
155
- const key = `${parentType} ${ids}`;
156
- if (parents.length === 0 || parents.some((p) => has.has(fold(p.id))) || reported.has(key)) continue;
157
- reported.add(key);
158
- const one = parents.length === 1;
159
- drafts.push({
160
- rule: "missing-parent",
161
- message: one ? `${parentField}: does not name ${ids}, the ${parentType} of ${childType} "${child.id}".` : `${parentField}: names none of ${ids}, the ${parentField} of ${childType} "${child.id}".`,
162
- fix: `Add ${one ? "it" : "one"}, or drop "${child.id}" from ${PAGE_FIELDS[childType]}:.`,
163
- ...located(reference),
164
- field: parentField
165
- });
166
- }
167
- }
168
- }
169
- for (const record of set.records) {
170
- const at = located(onRecord(record));
171
- if (record.type !== "audience" && record.parents.length === 0 && index.has(parentTypeOf(record.type))) {
172
- const field = PARENTS[record.type];
173
- drafts.push({
174
- rule: "orphan-record",
175
- message: `${field}: missing, so this ${record.type} belongs to no ${parentTypeOf(record.type)}.`,
176
- fix: `Name one with ${field}:.`,
177
- ...at,
178
- id: record.id,
179
- field
180
- });
181
- }
182
- if (index.resolve(record.type, record.id) !== record) continue;
183
- const pages = index.pagesNaming(record);
184
- const live = record.lifecycle !== "draft" && record.lifecycle !== "archived";
185
- if (record.type === "journey" && live && pages.length === 0) {
186
- drafts.push({
187
- rule: "unserved-journey",
188
- message: "no page names this journey in journeys:.",
189
- fix: "Name it on the pages that serve it.",
190
- ...at,
191
- id: record.id
192
- });
193
- }
194
- if (record.type !== "journey" && pages.length === 0 && index.childrenOf(record).length === 0) {
195
- drafts.push({
196
- rule: "unused-record",
197
- message: `no page and no record names this ${record.type}.`,
198
- ...at,
199
- id: record.id
200
- });
201
- }
202
- }
203
- const findings = [];
204
- for (const draft of drafts) {
205
- const level = levels[draft.rule];
206
- if (level === "off") continue;
207
- findings.push({
208
- rule: draft.rule,
209
- ruleId: ruleId(draft.rule),
210
- severity: level,
211
- message: draft.fix === void 0 ? draft.message : `${draft.message} ${draft.fix}`,
212
- ...draft.fix === void 0 ? {} : { key: draft.message },
213
- guidance: guidanceFor(draft.rule),
214
- file: draft.file,
215
- ...draft.line === void 0 ? {} : { line: draft.line },
216
- ...draft.id === void 0 ? {} : { id: draft.id },
217
- ...draft.field === void 0 ? {} : { field: draft.field }
218
- });
219
- }
220
- return findings.sort(compareFindings);
221
- }
222
- function compareText(a, b) {
223
- return a < b ? -1 : a > b ? 1 : 0;
224
- }
225
- function compareFindings(a, b) {
226
- return compareText(a.file, b.file) || (a.line ?? 0) - (b.line ?? 0) || compareText(a.ruleId, b.ruleId) || compareText(a.message, b.message);
227
- }
228
-
229
- export {
230
- indexSet,
231
- checkStrategySet
232
- };
233
- //# sourceMappingURL=chunk-SIREOHLW.js.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/strategy/core/check.ts"],"sourcesContent":["/**\n * `strategy check`'s rules (proposal 0102). Pure: it reads records and\n * references and returns findings, so the command core owns every file and\n * the rules are tested on sets built inline.\n *\n * Ids compare case-folded. A reference field is checked only when the set\n * holds a record of that field's type, so a repo that keeps no audience\n * records keeps free-form `audiences:`. `missing-parent` and the use counts\n * read pages that are not records: a record's own `journeys:` serves nobody.\n */\nimport { closestName } from \"../../shared/closest-name.js\";\nimport {\n PAGE_FIELDS,\n PARENTS,\n type At,\n type ChildType,\n type RecordType,\n type ReferenceField,\n type StrategyFinding,\n type StrategyRecord,\n type StrategyRule,\n type StrategySet,\n type StrategySeverity,\n} from \"../types.js\";\nimport { guidanceFor, resolveSeverity, ruleId } from \"./severity.js\";\n\nconst fold = (value: string): string => value.toLowerCase();\n\n/** The type each page field names. */\nconst FIELD_TYPES: Readonly<Record<ReferenceField, RecordType>> = {\n audiences: \"audience\",\n personas: \"persona\",\n journeys: \"journey\",\n audience: \"audience\",\n};\n\n/** The type of a child's parents: an audience for a persona, a persona for a journey. */\nconst parentTypeOf = (type: ChildType): RecordType => FIELD_TYPES[PARENTS[type]];\n\n/** What a set's records and pages say about each other, resolved once for `check`, `list` and `get`. */\nexport interface StrategyIndex {\n /** Whether the set holds a record of this type. */\n has(type: RecordType): boolean;\n /** The record of `type` a value names, case-folded. The first one read wins. */\n resolve(type: RecordType, value: string): StrategyRecord | undefined;\n /** The first record of any type with this id, case-folded. */\n anyWithId(value: string): StrategyRecord | undefined;\n /** The records of the parent type the record's parent field names, each once, in the field's order. */\n parentsOf(record: StrategyRecord): StrategyRecord[];\n /** The records whose parent field names this record, in set order. */\n childrenOf(record: StrategyRecord): StrategyRecord[];\n /** The pages that name this record directly, sorted. Records do not count. */\n pagesNaming(record: StrategyRecord): string[];\n}\n\nexport function indexSet(set: StrategySet): StrategyIndex {\n const byType = new Map<RecordType, Map<string, StrategyRecord>>();\n const byId = new Map<string, StrategyRecord>();\n for (const record of set.records) {\n const ids = byType.get(record.type) ?? new Map<string, StrategyRecord>();\n if (!ids.has(fold(record.id))) ids.set(fold(record.id), record);\n byType.set(record.type, ids);\n if (!byId.has(fold(record.id))) byId.set(fold(record.id), record);\n }\n const resolveIn = (type: RecordType, value: string): StrategyRecord | undefined => byType.get(type)?.get(fold(value));\n const parentsOf = (record: StrategyRecord): StrategyRecord[] => {\n if (record.type === \"audience\") return [];\n const type = parentTypeOf(record.type);\n const found = record.parents.map((p) => resolveIn(type, p.value)).filter((r) => r !== undefined);\n return [...new Set(found)];\n };\n\n const children = new Map<StrategyRecord, StrategyRecord[]>();\n for (const record of set.records) {\n for (const parent of parentsOf(record)) children.set(parent, [...(children.get(parent) ?? []), record]);\n }\n const pages = new Map<StrategyRecord, Set<string>>();\n for (const reference of set.references) {\n if (reference.record) continue;\n const target = resolveIn(FIELD_TYPES[reference.field], reference.value);\n if (target === undefined) continue;\n const named = pages.get(target) ?? new Set<string>();\n named.add(reference.page);\n pages.set(target, named);\n }\n\n return {\n has: (type) => (byType.get(type)?.size ?? 0) > 0,\n resolve: resolveIn,\n anyWithId: (value) => byId.get(fold(value)),\n parentsOf,\n childrenOf: (record) => children.get(record) ?? [],\n pagesNaming: (record) => [...(pages.get(record) ?? [])].sort(),\n };\n}\n\n/** A finding before its level is known: `message` is its identity, `fix` the advice after it. */\ninterface Draft {\n rule: StrategyRule;\n message: string;\n fix?: string;\n file: string;\n line?: number;\n id?: string;\n field?: ReferenceField;\n}\n\n/** `a journey`, `an audience`. */\nfunction article(type: RecordType): string {\n return `${type === \"audience\" ? \"an\" : \"a\"} ${type}`;\n}\n\n/** Where a finding about a whole record sits: its `id:` line, else its first line. */\nfunction onRecord(record: StrategyRecord): At {\n return record.idAt ?? { file: record.file, line: record.line };\n}\n\nfunction located(at: At): At {\n return { file: at.file, ...(at.line === undefined ? {} : { line: at.line }) };\n}\n\n/** The ancestor of `record` of type `type`, walking up each record's first parent. */\nfunction ancestorOf(index: StrategyIndex, record: StrategyRecord, type: RecordType): StrategyRecord | undefined {\n let current = index.parentsOf(record)[0];\n while (current !== undefined && current.type !== type) current = index.parentsOf(current)[0];\n return current;\n}\n\nexport interface CheckStrategySetOptions {\n severity?: Partial<Record<StrategyRule, StrategySeverity>>;\n}\n\nexport function checkStrategySet(set: StrategySet, opts: CheckStrategySetOptions = {}): StrategyFinding[] {\n const levels = resolveSeverity(opts.severity);\n const index = indexSet(set);\n const drafts: Draft[] = [];\n\n /** The finding for a value that names no record of `type`, or the wrong type of record. */\n const unresolved = (field: ReferenceField, value: string, onRecordField: boolean): Pick<Draft, \"message\" | \"fix\"> => {\n const type = FIELD_TYPES[field];\n const other = index.anyWithId(value);\n if (other !== undefined) {\n const ancestor = ancestorOf(index, other, type);\n const fix =\n ancestor !== undefined\n ? `Did you mean its ${type}, \"${ancestor.id}\"?`\n : onRecordField\n ? \"Correct the value.\"\n : `Move it to ${PAGE_FIELDS[other.type]}:.`;\n return { message: `${field}: \"${value}\" is ${article(other.type)}, not ${article(type)}.`, fix };\n }\n const ids = set.records.filter((r) => r.type === type).map((r) => r.id);\n const nearest = closestName(fold(value), ids.map(fold));\n const suggestion = nearest === undefined ? undefined : ids.find((id) => fold(id) === nearest);\n const add = `Correct the value, or add a record with type: ${type} and id: ${value}.`;\n const fix =\n suggestion === undefined ? add : onRecordField ? `Did you mean \"${suggestion}\"?` : `Did you mean \"${suggestion}\"? ${add}`;\n return { message: `${field}: \"${value}\" names no ${type}.`, fix };\n };\n\n // undefined-reference, on every page's fields, records included.\n for (const reference of set.references) {\n const type = FIELD_TYPES[reference.field];\n if (!index.has(type) || index.resolve(type, reference.value) !== undefined) continue;\n drafts.push({\n rule: \"undefined-reference\",\n ...unresolved(reference.field, reference.value, false),\n ...located(reference),\n field: reference.field,\n });\n }\n // ...and on each value of a record's parent field.\n for (const record of set.records) {\n if (record.type === \"audience\") continue;\n const field = PARENTS[record.type];\n const type = parentTypeOf(record.type);\n if (!index.has(type)) continue;\n for (const parent of record.parents) {\n if (index.resolve(type, parent.value) !== undefined) continue;\n drafts.push({\n rule: \"undefined-reference\",\n ...unresolved(field, parent.value, true),\n ...located(parent),\n id: record.id,\n field,\n });\n }\n }\n\n // duplicate-id: on every record sharing the id, each naming the others.\n const sharing = new Map<string, StrategyRecord[]>();\n for (const record of set.records) sharing.set(fold(record.id), [...(sharing.get(fold(record.id)) ?? []), record]);\n for (const group of sharing.values()) {\n if (group.length < 2) continue;\n for (const record of group) {\n const others = group\n .filter((other) => other !== record)\n .map((other) => {\n const at = onRecord(other);\n return at.line === undefined ? at.file : `${at.file}:${String(at.line)}`;\n });\n drafts.push({\n rule: \"duplicate-id\",\n message: `id: \"${record.id}\" is also the id of ${others.join(\", \")}.`,\n fix: \"Give each record its own id.\",\n ...located(onRecord(record)),\n id: record.id,\n });\n }\n }\n\n // missing-parent: per page, one finding per set of parents the page names none of.\n const byPage = new Map<string, typeof set.references>();\n for (const reference of set.references) {\n if (reference.record) continue;\n byPage.set(reference.page, [...(byPage.get(reference.page) ?? []), reference]);\n }\n for (const references of byPage.values()) {\n const named = (field: ReferenceField): Set<string> =>\n new Set(references.filter((r) => r.field === field).map((r) => fold(r.value)));\n const reported = new Set<string>();\n for (const childType of [\"journey\", \"persona\"] as const satisfies readonly ChildType[]) {\n const parentType = parentTypeOf(childType);\n const parentField = PAGE_FIELDS[parentType];\n const has = named(parentField);\n for (const reference of references) {\n if (reference.field !== PAGE_FIELDS[childType]) continue;\n const child = index.resolve(childType, reference.value);\n if (child === undefined) continue;\n const parents = index.parentsOf(child);\n const ids = parents.map((p) => `\"${p.id}\"`).join(\", \");\n const key = `${parentType} ${ids}`;\n if (parents.length === 0 || parents.some((p) => has.has(fold(p.id))) || reported.has(key)) continue;\n reported.add(key);\n const one = parents.length === 1;\n drafts.push({\n rule: \"missing-parent\",\n message: one\n ? `${parentField}: does not name ${ids}, the ${parentType} of ${childType} \"${child.id}\".`\n : `${parentField}: names none of ${ids}, the ${parentField} of ${childType} \"${child.id}\".`,\n fix: `Add ${one ? \"it\" : \"one\"}, or drop \"${child.id}\" from ${PAGE_FIELDS[childType]}:.`,\n ...located(reference),\n field: parentField,\n });\n }\n }\n }\n\n // orphan-record, unserved-journey and unused-record: about whole records.\n for (const record of set.records) {\n const at = located(onRecord(record));\n if (record.type !== \"audience\" && record.parents.length === 0 && index.has(parentTypeOf(record.type))) {\n const field = PARENTS[record.type];\n drafts.push({\n rule: \"orphan-record\",\n message: `${field}: missing, so this ${record.type} belongs to no ${parentTypeOf(record.type)}.`,\n fix: `Name one with ${field}:.`,\n ...at,\n id: record.id,\n field,\n });\n }\n // Only the first record with an id is the one references resolve to.\n if (index.resolve(record.type, record.id) !== record) continue;\n const pages = index.pagesNaming(record);\n // A draft journey is not live yet, and an archived one no longer is, so neither owes a page.\n const live = record.lifecycle !== \"draft\" && record.lifecycle !== \"archived\";\n if (record.type === \"journey\" && live && pages.length === 0) {\n drafts.push({\n rule: \"unserved-journey\",\n message: \"no page names this journey in journeys:.\",\n fix: \"Name it on the pages that serve it.\",\n ...at,\n id: record.id,\n });\n }\n if (record.type !== \"journey\" && pages.length === 0 && index.childrenOf(record).length === 0) {\n drafts.push({\n rule: \"unused-record\",\n message: `no page and no record names this ${record.type}.`,\n ...at,\n id: record.id,\n });\n }\n }\n\n const findings: StrategyFinding[] = [];\n for (const draft of drafts) {\n const level = levels[draft.rule];\n if (level === \"off\") continue;\n findings.push({\n rule: draft.rule,\n ruleId: ruleId(draft.rule),\n severity: level,\n message: draft.fix === undefined ? draft.message : `${draft.message} ${draft.fix}`,\n ...(draft.fix === undefined ? {} : { key: draft.message }),\n guidance: guidanceFor(draft.rule),\n file: draft.file,\n ...(draft.line === undefined ? {} : { line: draft.line }),\n ...(draft.id === undefined ? {} : { id: draft.id }),\n ...(draft.field === undefined ? {} : { field: draft.field }),\n });\n }\n return findings.sort(compareFindings);\n}\n\nfunction compareText(a: string, b: string): number {\n return a < b ? -1 : a > b ? 1 : 0;\n}\n\nexport function compareFindings(a: StrategyFinding, b: StrategyFinding): number {\n return (\n compareText(a.file, b.file) ||\n (a.line ?? 0) - (b.line ?? 0) ||\n compareText(a.ruleId, b.ruleId) ||\n compareText(a.message, b.message)\n );\n}\n"],"mappings":";;;;;;;;;;;;;AA0BA,IAAM,OAAO,CAAC,UAA0B,MAAM,YAAY;AAG1D,IAAM,cAA4D;AAAA,EAChE,WAAW;AAAA,EACX,UAAU;AAAA,EACV,UAAU;AAAA,EACV,UAAU;AACZ;AAGA,IAAM,eAAe,CAAC,SAAgC,YAAY,QAAQ,IAAI,CAAC;AAkBxE,SAAS,SAAS,KAAiC;AACxD,QAAM,SAAS,oBAAI,IAA6C;AAChE,QAAM,OAAO,oBAAI,IAA4B;AAC7C,aAAW,UAAU,IAAI,SAAS;AAChC,UAAM,MAAM,OAAO,IAAI,OAAO,IAAI,KAAK,oBAAI,IAA4B;AACvE,QAAI,CAAC,IAAI,IAAI,KAAK,OAAO,EAAE,CAAC,EAAG,KAAI,IAAI,KAAK,OAAO,EAAE,GAAG,MAAM;AAC9D,WAAO,IAAI,OAAO,MAAM,GAAG;AAC3B,QAAI,CAAC,KAAK,IAAI,KAAK,OAAO,EAAE,CAAC,EAAG,MAAK,IAAI,KAAK,OAAO,EAAE,GAAG,MA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,SAAS,KAAK,eAAe;AACtC;AAEA,SAAS,YAAY,GAAW,GAAmB;AACjD,SAAO,IAAI,IAAI,KAAK,IAAI,IAAI,IAAI;AAClC;AAEO,SAAS,gBAAgB,GAAoB,GAA4B;AAC9E,SACE,YAAY,EAAE,MAAM,EAAE,IAAI,MACzB,EAAE,QAAQ,MAAM,EAAE,QAAQ,MAC3B,YAAY,EAAE,QAAQ,EAAE,MAAM,KAC9B,YAAY,EAAE,SAAS,EAAE,OAAO;AAEpC;","names":["fix"]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/strategy/commands/check.ts","../src/strategy/commands/findings.ts"],"sourcesContent":["/**\n * `manni strategy check`: the pages against the records, and the records\n * against each other, with the baseline ratchet term and cite use.\n *\n * `--baseline` records the findings when the file is not there yet, and after\n * that fails only on findings it does not hold. A configured\n * `strategy.baseline` compares without the flag.\n */\nimport { existsSync } from \"node:fs\";\nimport { resolveBaselineRequest, settleBaseline } from \"../../meta/internal.js\";\nimport { checkStrategySet } from \"../core/check.js\";\nimport { DEFAULT_STRATEGY_BASELINE_PATH } from \"../core/config.js\";\nimport { StrategyError } from \"../errors.js\";\nimport { reportedFindings, summarize, toResults, type StrategyReport } from \"./findings.js\";\nimport { loadStrategy, type StrategyCommandOptions } from \"./run.js\";\n\nexport interface CheckOptions extends StrategyCommandOptions {\n /** `--baseline`. */\n baseline?: boolean;\n}\n\nexport async function runCheck(opts: CheckOptions): Promise<StrategyReport> {\n const { cwd, run, set } = await loadStrategy(opts);\n const config = run.config;\n const findings = checkStrategySet(set, config?.severity === undefined ? {} : { severity: config.severity });\n const { results, origin } = toResults(set, findings);\n\n // Fingerprints must not depend on where the command was run from.\n const frame = { cwd, base: run.configDir ?? cwd, runBase: run.base };\n let request = resolveBaselineRequest(\n opts.baseline === true ? { baseline: true } : {},\n config?.baseline,\n run.configDir,\n cwd,\n { current: DEFAULT_STRATEGY_BASELINE_PATH },\n );\n if (request !== null && !existsSync(request.absPath)) {\n if (opts.baseline !== true) {\n throw new StrategyError(`Baseline \"${request.label}\" not found. Record one with \\`manni strategy check --baseline\\`.`);\n }\n request = { ...request, write: true };\n }\n const { results: reported, baseline } = await settleBaseline(results, request, frame);\n\n const parents = set.records.reduce((n, r) => n + r.parents.length, 0);\n return {\n findings: reportedFindings(reported, origin, findings),\n results: reported,\n origin,\n summary: summarize(reported, baseline),\n frame,\n records: set.records.length,\n // Two kinds, both resolved: every audiences:, personas: and journeys:\n // value (pages and records alike), plus each value of a record's own\n // parent field, which load-set keeps out of the references.\n references: set.references.length + parents,\n ...(baseline === undefined ? {} : { baseline }),\n found: findings.length,\n cwd,\n base: run.base,\n };\n}\n","/**\n * The report `check` returns, and the bridge from strategy findings to meta's\n * `ValidationResult`, so the SARIF and JUnit renderers and the baseline\n * ratchet work unchanged, as term's adapter does.\n *\n * FieldError: schema `manni:strategy`, keyword = the rule, instancePath\n * `/<field>` when the finding concerns one field and `\"\"` when it concerns a\n * whole record. The subject is the record, the field and what the finding\n * says before its advice, with any `file:line` taken out, so a moved line or\n * a reworded fix moves no baseline.\n */\nimport {\n isErrorSeverity,\n type BaselineSummary,\n type FieldError,\n type FingerprintContext,\n type RunSummary,\n type ValidationResult,\n} from \"../../meta/index.js\";\nimport { RULE_ID_PREFIX } from \"../core/severity.js\";\nimport type { StrategyFinding, StrategySet } from \"../types.js\";\n\nexport const FINDING_FORMATS = [\"pretty\", \"json\", \"github\", \"sarif\", \"junit\"] as const;\nexport type FindingFormat = (typeof FINDING_FORMATS)[number];\n\n/** JUnit `classname` for the strategy tool's findings. */\nexport const JUNIT_CLASSNAME = \"manni.strategy\";\n\nexport interface StrategyReport {\n /** The findings reported: a baselined one is not among them. */\n findings: StrategyFinding[];\n /** The same findings as meta's results, for SARIF and JUnit. One per file. */\n results: ValidationResult[];\n /** Each error in `results` to the finding it came from. */\n origin: ReadonlyMap<FieldError, StrategyFinding>;\n summary: RunSummary;\n frame: FingerprintContext;\n /** Records in the set. */\n records: number;\n /** Values of audiences:, personas:, journeys: and audience: the run read. */\n references: number;\n baseline?: BaselineSummary;\n /** Findings before the baseline, for the line a recording run prints. */\n found: number;\n /** Where the run stood, for the paths the reporters print. */\n cwd: string;\n /** What finding files are relative to. */\n base: string;\n}\n\nconst LINE_REFERENCE = /:\\d+\\b/g;\n\nfunction toFieldError(finding: StrategyFinding): FieldError {\n const said = finding.key ?? finding.message;\n const subject = [finding.id ?? \"\", finding.field ?? \"\", said.replace(LINE_REFERENCE, \"\")].join(\"\\u0000\");\n const error: FieldError = {\n schema: RULE_ID_PREFIX,\n instancePath: finding.field === undefined ? \"\" : `/${finding.field}`,\n message: finding.message,\n keyword: finding.rule,\n subject,\n severity: finding.severity,\n };\n if (finding.line !== undefined) error.line = finding.line;\n return error;\n}\n\n/** One result per file: every record's file, every file a reference was read from, and every file a finding sits in. */\nexport function toResults(\n set: StrategySet,\n findings: readonly StrategyFinding[],\n): { results: ValidationResult[]; origin: Map<FieldError, StrategyFinding> } {\n const origin = new Map<FieldError, StrategyFinding>();\n const byFile = new Map<string, FieldError[]>();\n for (const { file } of [...set.records, ...set.references]) if (!byFile.has(file)) byFile.set(file, []);\n for (const finding of findings) {\n const error = toFieldError(finding);\n origin.set(error, finding);\n byFile.set(finding.file, [...(byFile.get(finding.file) ?? []), error]);\n }\n const results = [...byFile.keys()].sort().map((file): ValidationResult => {\n const errors = byFile.get(file) ?? [];\n return { file, format: \"strategy\", ok: !errors.some(isErrorSeverity), schemas: [RULE_ID_PREFIX], errors };\n });\n return { results, origin };\n}\n\n/** The run summary meta's renderers read, from results a baseline may have thinned. */\nexport function summarize(results: readonly ValidationResult[], baseline?: BaselineSummary): RunSummary {\n const failed = results.filter((r) => !r.ok).length;\n const count = (keep: (e: FieldError) => boolean): number => results.reduce((n, r) => n + r.errors.filter(keep).length, 0);\n const warnings = count((e) => e.severity === \"warning\");\n const notices = count((e) => e.severity === \"notice\");\n return {\n files: results.length,\n passed: results.length - failed,\n failed,\n errors: count(isErrorSeverity),\n ...(warnings > 0 ? { warnings } : {}),\n ...(notices > 0 ? { notices } : {}),\n ...(baseline ? { baseline } : {}),\n };\n}\n\n/** The findings still reported once a baseline has thinned the results, in report order. */\nexport function reportedFindings(\n results: readonly ValidationResult[],\n origin: ReadonlyMap<FieldError, StrategyFinding>,\n order: readonly StrategyFinding[],\n): StrategyFinding[] {\n const kept = new Set<StrategyFinding>();\n for (const result of results) {\n for (const error of result.errors) {\n const finding = origin.get(error);\n if (finding !== undefined) kept.add(finding);\n }\n }\n return order.filter((finding) => kept.has(finding));\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;AAQA,SAAS,kBAAkB;;;ACcpB,IAAM,kBAAkB,CAAC,UAAU,QAAQ,UAAU,SAAS,OAAO;AAIrE,IAAM,kBAAkB;AAwB/B,IAAM,iBAAiB;AAEvB,SAAS,aAAa,SAAsC;AAC1D,QAAM,OAAO,QAAQ,OAAO,QAAQ;AACpC,QAAM,UAAU,CAAC,QAAQ,MAAM,IAAI,QAAQ,SAAS,IAAI,KAAK,QAAQ,gBAAgB,EAAE,CAAC,EAAE,KAAK,IAAQ;AACvG,QAAM,QAAoB;AAAA,IACxB,QAAQ;AAAA,IACR,cAAc,QAAQ,UAAU,SAAY,KAAK,IAAI,QAAQ,KAAK;AAAA,IAClE,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,IACjB;AAAA,IACA,UAAU,QAAQ;AAAA,EACpB;AACA,MAAI,QAAQ,SAAS,OAAW,OAAM,OAAO,QAAQ;AACrD,SAAO;AACT;AAGO,SAAS,UACd,KACA,UAC2E;AAC3E,QAAM,SAAS,oBAAI,IAAiC;AACpD,QAAM,SAAS,oBAAI,IAA0B;AAC7C,aAAW,EAAE,KAAK,KAAK,CAAC,GAAG,IAAI,SAAS,GAAG,IAAI,UAAU,EAAG,KAAI,CAAC,OAAO,IAAI,IAAI,EAAG,QAAO,IAAI,MAAM,CAAC,CAAC;AACtG,aAAW,WAAW,UAAU;AAC9B,UAAM,QAAQ,aAAa,O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AC,IAAI,EAAE,SAAS;AAAA,IAC7C,OAAO,SAAS;AAAA,IAChB;AAAA,IACA,MAAM,IAAI;AAAA,EACZ;AACF;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/strategy/commands/list.ts"],"sourcesContent":["/**\n * `manni strategy list`: the records as a tree, audience then persona then\n * journey. A record with several parents sits under each of them, and one\n * whose parents are not in the set sits at the top level.\n */\nimport { indexSet, type StrategyIndex } from \"../core/check.js\";\nimport { RECORD_TYPES, type StrategyRecord, type StrategySet } from \"../types.js\";\nimport { displayPath, loadStrategy, type StrategyCommandOptions } from \"./run.js\";\n\nexport const LIST_FORMATS = [\"pretty\", \"json\"] as const;\nexport type ListFormat = (typeof LIST_FORMATS)[number];\n\n/** One record with what the set says about it. Paths are relative to the working directory. */\nexport interface RecordEntry {\n record: StrategyRecord;\n /** The records its parent field names that the set holds. */\n parents: StrategyRecord[];\n /** The records whose parent field names this one: personas of an audience, journeys of a persona. */\n children: StrategyRecord[];\n /** The pages that name the record directly. */\n pages: string[];\n /** The record's file, relative to the working directory. */\n file: string;\n /** Its depth in the tree. */\n depth: number;\n}\n\nexport interface ListReport {\n /** In tree order. */\n entries: RecordEntry[];\n set: StrategySet;\n}\n\nconst byId = new Intl.Collator(\"en\", { numeric: true });\n\nfunction sorted(records: readonly StrategyRecord[]): StrategyRecord[] {\n return [...records].sort((a, b) => byId.compare(a.id, b.id));\n}\n\n/** Every record, each with its parents, children and pages, parents before their children. */\nexport function entriesOf(set: StrategySet, cwd: string, base: string, index: StrategyIndex = indexSet(set)): RecordEntry[] {\n const entries: RecordEntry[] = [];\n const visit = (record: StrategyRecord, depth: number): void => {\n const children = sorted(index.childrenOf(record));\n entries.push({\n record,\n parents: index.parentsOf(record),\n children,\n pages: index.pagesNaming(record).map((page) => displayPath(page, cwd, base)),\n file: displayPath(record.file, cwd, base),\n depth,\n });\n for (const child of children) visit(child, depth + 1);\n };\n for (const type of RECORD_TYPES) {\n for (const record of sorted(set.records.filter((r) => r.type === type && index.parentsOf(r).length === 0))) {\n visit(record, 0);\n }\n }\n return entries;\n}\n\nexport async function runList(opts: StrategyCommandOptions): Promise<ListReport> {\n const { cwd, run, set } = await loadStrategy(opts);\n return { entries: entriesOf(set, cwd, run.base), set };\n}\n"],"mappings":";;;;;;;;;;;;;AASO,IAAM,eAAe,CAAC,UAAU,MAAM;AAwB7C,IAAM,OAAO,IAAI,KAAK,SAAS,MAAM,EAAE,SAAS,KAAK,CAAC;AAEtD,SAAS,OAAO,SAAsD;AACpE,SAAO,CAAC,GAAG,OAAO,EAAE,KAAK,CAAC,GAAG,MAAM,KAAK,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;AAC7D;AAGO,SAAS,UAAU,KAAkB,KAAa,MAAc,QAAuB,SAAS,GAAG,GAAkB;AAC1H,QAAM,UAAyB,CAAC;AAChC,QAAM,QAAQ,CAAC,QAAwB,UAAwB;AAC7D,UAAM,WAAW,OAAO,MAAM,WAAW,MAAM,CAAC;AAChD,YAAQ,KAAK;AAAA,MACX;AAAA,MACA,SAAS,MAAM,UAAU,MAAM;AAAA,MAC/B;AAAA,MACA,OAAO,MAAM,YAAY,MAAM,EAAE,IAAI,CAAC,SAAS,YAAY,MAAM,KAAK,IAAI,CAAC;AAAA,MAC3E,MAAM,YAAY,OAAO,MAAM,KAAK,IAAI;AAAA,MACxC;AAAA,IACF,CAAC;AACD,eAAW,SAAS,SAAU,OAAM,OAAO,QAAQ,CAAC;AAAA,EACtD;AACA,aAAW,QAAQ,cAAc;AAC/B,eAAW,UAAU,OAAO,IAAI,QAAQ,OAAO,CAAC,MAAM,EAAE,SAAS,QAAQ,MAAM,UAAU,CAAC,EAAE,WAAW,CAAC,CAAC,GAAG;AAC1G,YAAM,QAAQ,CAAC;AAAA,IACjB;AAAA,EACF;AACA,SAAO;AACT;AAEA,eAAsB,QAAQ,MAAmD;AAC/E,QAAM,EAAE,KAAK,KAAK,IAAI,IAAI,MAAM,aAAa,IAAI;AACjD,SAAO,EAAE,SAAS,UAAU,KAAK,KAAK,IAAI,IAAI,GAAG,IAAI;AACvD;","names":[]}
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../src/family/cli.ts","../src/family/core/envelope.ts","../src/family/core/in-play.ts","../src/family/commands/check.ts","../src/family/core/changed.ts","../src/family/core/said-once.ts","../src/family/commands/status.ts"],"sourcesContent":["/**\n * The two family verbs, `manni check` and `manni status`, mounted on the\n * umbrella with `addCommand`. They are the only verbs it carries: each\n * orchestrates other domains' command cores and owns no checks of its own.\n *\n * Run by hand or in CI they follow the family contract: 0 clean, 1 errors, 2\n * operational, the report on stdout and notices on stderr. Under a Claude\n * Code hook envelope on stdin they speak the hook protocol instead, which\n * changes where output goes and what the exit code means, never what is\n * checked beyond the scope.\n */\nimport { resolve } from \"node:path\";\nimport { Command, Option } from \"commander\";\nimport { shouldColor } from \"../shared/color.js\";\nimport { errorMessage } from \"../shared/errors.js\";\nimport { programName } from \"../shared/program-name.js\";\nimport { fail } from \"../shared/run.js\";\nimport { notice } from \"../shared/warn.js\";\nimport { readEnvelope, type Envelope } from \"./core/envelope.js\";\nimport { FamilyError, labelFrom } from \"./core/in-play.js\";\nimport {\n CHECK_FORMATS,\n EDIT_TOOLS,\n exitCodeFor,\n hookFailure,\n hookReply,\n render,\n runFamilyCheck,\n runTurnCheck,\n turnReply,\n type CheckFormat,\n type FamilyCheckRun,\n type HookReply,\n type Scope,\n} from \"./commands/check.js\";\nimport {\n STATUS_FORMATS,\n agentLines,\n exportGeneratedBy,\n renderStatus,\n runStatus,\n type StatusFormat,\n} from \"./commands/status.js\";\n\ninterface CheckCliOptions {\n config?: string;\n format: CheckFormat;\n /** `--no-color`: `false` when given. */\n color: boolean;\n}\n\ninterface StatusCliOptions {\n config?: string;\n format: StatusFormat;\n}\n\nfunction send(reply: HookReply): void {\n if (reply.stdout !== undefined) process.stdout.write(reply.stdout);\n if (reply.stderr !== undefined) process.stderr.write(reply.stderr);\n process.exitCode = reply.exitCode;\n}\n\n/**\n * The file checks a hook asks for, or `undefined` when this event runs none.\n * A SubagentStop runs none: its subagent's turn is judged alone.\n */\nexport function hookScope(envelope: Envelope, cwd: string): { scope: Scope; file?: string } | undefined {\n if (envelope.event === \"Stop\") return { scope: { kind: \"changed\" } };\n if (envelope.event !== \"PostToolUse\") return undefined;\n if (envelope.toolName === undefined || !EDIT_TOOLS.includes(envelope.toolName)) return undefined;\n if (envelope.filePath === undefined) return undefined;\n const file = labelFrom(cwd, resolve(cwd, envelope.filePath));\n return { scope: { kind: \"paths\", paths: [file] }, file };\n}\n\n/** The events that end a turn, which tracevals judges (proposal 0079). */\nconst TURN_EVENTS: readonly string[] = [\"Stop\", \"SubagentStop\"];\n\nasync function checkUnderHook(paths: string[], options: CheckCliOptions, envelope: Envelope): Promise<void> {\n const cwd = resolve(envelope.cwd ?? process.cwd());\n // Positional paths win over the envelope's own scope.\n const asked: { scope: Scope; file?: string } | undefined =\n paths.length > 0 ? { scope: { kind: \"paths\", paths }, file: paths.join(\", \") } : hookScope(envelope, cwd);\n const turnEvent = TURN_EVENTS.includes(envelope.event);\n if (asked === undefined && !turnEvent) return;\n let run: FamilyCheckRun | undefined;\n if (asked !== undefined) {\n try {\n run = await runFamilyCheck({\n cwd,\n scope: asked.scope,\n allowMissing: true,\n ...(options.config === undefined ? {} : { configPath: options.config }),\n // stdout and stderr are the hook's channels; a notice is not for the agent.\n onNotice: () => undefined,\n });\n } catch (err) {\n // Nothing set up for the file checks is not the end of a turn's judgement.\n if (!(err instanceof FamilyError && err.quiet) && !turnEvent) {\n send(hookFailure(errorMessage(err), envelope, asked.file));\n return;\n }\n }\n }\n if (!turnEvent) {\n if (run !== undefined) send(hookReply(run, envelope));\n return;\n }\n send(turnReply(run, await runTurnCheck(envelope, cwd), envelope));\n}\n\nexport function buildCheck(): Command {\n return new Command(\"check\")\n .description(\"Run every check this repository has set up, and nothing else\")\n .argument(\"[paths...]\", \"files, directories, or globs; the per-file checks run on the collection members among them\")\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .addOption(\n new Option(\"-f, --format <format>\", \"output (not read under a hook)\")\n .choices(CHECK_FORMATS)\n .default(\"pretty\"),\n )\n .option(\"--no-color\", \"disable colored output\")\n .showHelpAfterError(\"(add --help for usage)\")\n .exitOverride()\n .addHelpText(\n \"after\",\n [\n \"\",\n \"Examples:\",\n \" manni check # every in-play check, the CI gate\",\n \" manni check docs/limits.md # per-file checks on one page\",\n \" manni check -f github # in a GitHub workflow\",\n \" manni check -f sarif > manni.sarif # one SARIF log for code scanning\",\n \" manni check docs/ -f json # scripting form\",\n ].join(\"\\n\"),\n )\n .action(async (paths: string[], options: CheckCliOptions) => {\n const envelope = await readEnvelope();\n if (envelope !== undefined) {\n await checkUnderHook(paths, options, envelope);\n return;\n }\n try {\n const run = await runFamilyCheck({\n scope: paths.length > 0 ? { kind: \"paths\", paths } : { kind: \"all\" },\n ...(options.config === undefined ? {} : { configPath: options.config }),\n onNotice: notice,\n });\n for (const check of run.checks) {\n if (check.status === \"error\") {\n process.stderr.write(`${programName()} ${check.command} could not run: ${check.message}\\n`);\n }\n }\n const color = shouldColor({ noColor: !options.color, isTTY: process.stdout.isTTY });\n const text = render(run, options.format, color);\n if (text.length > 0) process.stdout.write(`${text}\\n`);\n process.exitCode = exitCodeFor(run);\n } catch (err) {\n fail(err);\n }\n });\n}\n\nexport function buildStatus(): Command {\n return new Command(\"status\")\n .description(\"Say what is set up here, and so what manni check runs\")\n .option(\"-c, --config <path>\", \"path to a manni config file\")\n .addOption(\n new Option(\"-f, --format <format>\", \"output\").choices(STATUS_FORMATS).default(\"pretty\"),\n )\n .showHelpAfterError(\"(add --help for usage)\")\n .exitOverride()\n .action(async (options: StatusCliOptions) => {\n const envelope = await readEnvelope();\n const configOption = options.config === undefined ? {} : { configPath: options.config };\n if (envelope?.event === \"SessionStart\") {\n try {\n const report = await runStatus({ cwd: resolve(envelope.cwd ?? process.cwd()), ...configOption });\n // The agent lines promise checks, so they need a domain in play to be true.\n const lines = report.domains.some((d) => d.status === \"in-play\") ? `\\n\\n${agentLines(report)}` : \"\";\n // The next steps are advice for whoever owns the config, not the agent.\n process.stdout.write(`${renderStatus(report, \"pretty\", { next: false })}${lines}\\n`);\n exportGeneratedBy(envelope);\n } catch {\n // No config, or one that cannot be read: the session starts without a word.\n }\n return;\n }\n try {\n const report = await runStatus(configOption);\n process.stdout.write(`${renderStatus(report, options.format)}\\n`);\n } catch (err) {\n fail(err);\n }\n });\n}\n","/**\n * The Claude Code hook envelope, detected rather than switched.\n *\n * A hook command gets one JSON object on stdin, and Claude Code closes the\n * stream after it. When stdin is not a terminal and parses as an object with a\n * string `hook_event_name`, `manni check` and `manni status` speak the hook\n * protocol. Anything else is a run by hand, and stdin is left unread beyond\n * that one look. The look never hangs: `readStdin` gives up on a stream that\n * stays silent, which is what an inherited pipe nobody writes to looks like.\n */\nimport { readStdin } from \"../../tracevals/capture/hook.js\";\n\nexport interface Envelope {\n /** `hook_event_name`: `PostToolUse`, `Stop`, `SessionStart`, … */\n event: string;\n /** The directory the hook fired in; relative paths resolve from it. */\n cwd?: string;\n /** `tool_name`, on a tool event. */\n toolName?: string;\n /** `tool_input.file_path`, or `tool_input.notebook_path` for a notebook. */\n filePath?: string;\n /** `stop_hook_active`: this stop already follows one repair pass. */\n stopHookActive: boolean;\n /** `model`, on `SessionStart`: a string, or an object carrying `id`. */\n model?: string;\n /** `session_id`. */\n sessionId?: string;\n /** `transcript_path`: the session's own transcript. */\n transcriptPath?: string;\n /** `agent_transcript_path`, on `SubagentStop`: the subagent's own transcript. */\n agentTranscriptPath?: string;\n /** `agent_id`, on `SubagentStop`. */\n agentId?: string;\n /** `agent_type`, on `SubagentStop`. */\n agentType?: string;\n /** `last_assistant_message`, on `Stop` and `SubagentStop`. */\n lastAssistantMessage?: string;\n}\n\nfunction str(value: unknown): string | undefined {\n return typeof value === \"string\" && value.length > 0 ? value : undefined;\n}\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** The envelope in `text`, or `undefined` when `text` is not one. */\nexport function parseEnvelope(text: string): Envelope | undefined {\n let parsed: unknown;\n try {\n parsed = JSON.parse(text);\n } catch {\n return undefined;\n }\n const doc = record(parsed);\n const event = str(doc?.hook_event_name);\n if (doc === undefined || event === undefined) return undefined;\n const input = record(doc.tool_input);\n const filePath = str(input?.file_path) ?? str(input?.notebook_path);\n const cwd = str(doc.cwd);\n const toolName = str(doc.tool_name);\n const model = str(doc.model) ?? str(record(doc.model)?.id);\n const strings = {\n sessionId: str(doc.session_id),\n transcriptPath: str(doc.transcript_path),\n agentTranscriptPath: str(doc.agent_transcript_path),\n agentId: str(doc.agent_id),\n agentType: str(doc.agent_type),\n lastAssistantMessage: str(doc.last_assistant_message),\n };\n const given = Object.fromEntries(Object.entries(strings).filter(([, v]) => v !== undefined)) as Partial<\n Record<keyof typeof strings, string>\n >;\n return {\n event,\n stopHookActive: doc.stop_hook_active === true,\n ...(cwd === undefined ? {} : { cwd }),\n ...(toolName === undefined ? {} : { toolName }),\n ...(filePath === undefined ? {} : { filePath }),\n ...(model === undefined ? {} : { model }),\n ...given,\n };\n}\n\n/** The envelope on stdin, or `undefined` for a run by hand. */\nexport async function readEnvelope(\n stream: NodeJS.ReadStream = process.stdin,\n): Promise<Envelope | undefined> {\n if (stream.isTTY) return undefined;\n try {\n return parseEnvelope(await readStdin(stream));\n } catch {\n // Too large to be an envelope: a run by hand with something piped in.\n return undefined;\n }\n}\n","/**\n * What is set up, and so what `manni check` runs.\n *\n * There are no keys of the family's own. A domain is in play when its own\n * section of `manni.config.yaml` exists, or when the content carries its\n * declarations. Nothing manni would apply by default counts as set up:\n *\n * | Domain | In play when |\n * |---|---|\n * | meta | a file's schema set is more than the built-in defaults: `meta:` covers it, or it names its own `$schema` |\n * | cite | a page carries citations |\n * | lint | `lint:` exists |\n * | docevals | a page resolves evals, from `docevals:` or its own declarations |\n * | term | the collections hold a term |\n * | strategy | the collections hold a record of type audience, persona or journey |\n * | graph | `graph:` exists |\n * | tracevals | `tracevals.runtime` exists; it judges the turn a Stop or SubagentStop hook ends |\n * | a11y | never run by `check`: it needs a running site |\n * | test | never run by `check`: Doc Detective runs the pages' shell steps |\n *\n * Only members of a declared collection are file-checked. tracevals judges a\n * turn, not files, so it needs no collection.\n */\nimport { relative, resolve, sep } from \"node:path\";\nimport { parse as parseYaml } from \"yaml\";\nimport type { CollectionConfig } from \"../../shared/collections.js\";\nimport {\n findFamilyConfigFile,\n readFamilyConfigFile,\n type ConfigFile,\n} from \"../../shared/config-file.js\";\nimport { ToolError } from \"../../shared/errors.js\";\nimport { memberOf, retainMembers } from \"../../meta/core/collections.js\";\nimport { resolveTargetSet } from \"../../meta/internal.js\";\n\n/** An operational error of `manni check` or `manni status`: exit 2. */\nexport class FamilyError extends ToolError {\n constructor(\n message: string,\n /** Set for the two conditions a hook answers with silence. */\n readonly quiet = false,\n ) {\n super(message);\n this.name = \"FamilyError\";\n }\n}\n\nexport function noConfigError(cwd: string): FamilyError {\n return new FamilyError(\n `No manni.config.yaml found from ${cwd} up to the repository root. Create one there with a collections: entry for your docs.`,\n true,\n );\n}\n\nexport function nothingSetUpError(): FamilyError {\n return new FamilyError(\n \"Nothing is set up to check in manni.config.yaml. Run manni status to see what each domain needs.\",\n true,\n );\n}\n\n/** The domains `check` can run, in the order it runs and reports them. */\nexport const DOMAINS = [\"meta\", \"cite\", \"lint\", \"docevals\", \"term\", \"strategy\", \"graph\"] as const;\nexport type Domain = (typeof DOMAINS)[number];\n\n/** Each domain's check, as `check` names it. */\nexport const COMMANDS: Readonly<Record<Domain, string>> = {\n meta: \"meta validate\",\n cite: \"cite check\",\n lint: \"lint check\",\n docevals: \"docevals run\",\n term: \"term check\",\n strategy: \"strategy check\",\n graph: \"graph check\",\n};\n\n/** Why a domain is not in play, as both `check` and `status` say it. */\nexport const NOT_SET_UP: Readonly<Record<Domain, string>> = {\n meta: \"no meta: section\",\n cite: \"no page carries citations\",\n lint: \"no lint: section\",\n docevals: \"no page resolves any evals\",\n term: \"no terms in any collection\",\n strategy: \"no strategy records in any collection\",\n graph: \"no graph: section\",\n};\n\n/**\n * What would put each domain in play, as `status` says it. It is advice for\n * whoever owns the config, so the SessionStart briefing leaves it out.\n */\nexport const NEXT: Readonly<Record<Domain, string>> = {\n meta: \"Add a meta: section that names your schemas. manni meta schemas lists the built-in ones.\",\n cite: \"Pin a sentence to its source with manni cite add.\",\n lint: \"Add a lint: section. manni lint templates lists the templates it can apply.\",\n docevals: \"Add a docevals: section, or declare evals in a page's frontmatter.\",\n term: \"Add a page with type: term to a collection.\",\n strategy: \"Add a page with type: journey to a collection.\",\n graph: \"Run manni graph init to add a starter graph: section.\",\n};\n\n/** Why every domain is not set up when the config declares no collections, and what to do. */\nexport const NO_COLLECTIONS = \"no collections: in manni.config.yaml\";\nexport const NO_COLLECTIONS_NEXT = \"Add a collections: entry that names your docs.\";\n\n/** Why `meta` skips files when `meta:` exists but covers none of them. */\nexport const META_DEFAULTS_ONLY = \"only the built-in default schemas cover these files\";\n\n/**\n * The domains `check` does not run here: why, and what to run instead.\n * tracevals leaves this list when `tracevals.runtime` exists (`Family.runtime`).\n */\nexport const NOT_CHECKED: ReadonlyArray<readonly [name: string, reason: string, next: string]> = [\n [\"a11y\", \"needs a running site and a browser\", \"Run manni site preview, then manni a11y check.\"],\n // Doc Detective runs the shell steps pages carry, so a hook never starts it.\n [\"test\", \"runs the shell steps the pages carry\", \"Run manni test run with Doc Detective installed.\"],\n [\n \"tracevals\",\n \"judges recorded sessions with a model\",\n \"Run manni tracevals run over sessions, or add tracevals.runtime to judge each turn.\",\n ],\n];\n\n/** `1 page`, `2 pages`. */\nexport function plural(n: number, one: string, many = `${one}s`): string {\n return `${String(n)} ${n === 1 ? one : many}`;\n}\n\nexport interface Family {\n file: ConfigFile;\n /**\n * The config each domain core is handed, so every one reads this file\n * rather than discovering its own: as typed, or as discovery found it,\n * relative to `cwd`.\n */\n configPath: string;\n /** The top-level keys of the file: `meta`, `lint`, `graph`, … */\n sections: ReadonlySet<string>;\n /** `tracevals.runtime` exists: tracevals judges each turn under the hooks. */\n runtime: boolean;\n collections: readonly CollectionConfig[];\n}\n\nfunction toError(message: string): FamilyError {\n return new FamilyError(message);\n}\n\nexport async function loadFamily(cwd: string, configPath?: string): Promise<Family> {\n const file =\n configPath === undefined\n ? await findFamilyConfigFile(cwd, toError)\n : await readFamilyConfigFile(configPath, cwd, toError);\n if (file === null) throw noConfigError(cwd);\n // Already parsed once by the loader, which would have thrown on bad YAML.\n const doc = parseYaml(file.text) as unknown;\n const top = record(doc);\n const sections = new Set(top === undefined ? [] : Object.keys(top));\n const tracevals = record(top?.tracevals);\n // The old `conformance` key counts too. tracevals' loader refuses it and\n // names `runtime`, and only a tracevals in play loads that config, so a\n // config not yet migrated reaches `status` as an error, not as a silent skip.\n const runtime = tracevals?.runtime !== undefined || tracevals?.conformance !== undefined;\n return { file, configPath: configPath ?? file.source, sections, runtime, collections: file.collections };\n}\n\nfunction record(value: unknown): Record<string, unknown> | undefined {\n return value !== null && typeof value === \"object\" && !Array.isArray(value)\n ? (value as Record<string, unknown>)\n : undefined;\n}\n\n/** A path as a label relative to `cwd`, posix, the way the domains print one. */\nexport function labelFrom(cwd: string, path: string): string {\n return relative(cwd, path).split(sep).join(\"/\");\n}\n\n/** The collections a file at `label` (relative to `cwd`) belongs to. */\nexport function collectionsOf(family: Family, cwd: string, label: string): string[] {\n return memberOf(family.collections, family.file.dir, cwd, label);\n}\n\n/** Every member of every collection, labelled from `cwd`. */\nexport async function listMembers(family: Family, cwd: string): Promise<string[]> {\n const dir = family.file.dir;\n const { files } = await resolveTargetSet({\n inputs: family.collections.flatMap((c) => c.paths),\n cwd: dir,\n allowEmpty: true,\n });\n return retainMembers(files, (label) => memberOf(family.collections, dir, dir, label)).map(\n (label) => labelFrom(cwd, resolve(dir, label)),\n );\n}\n","/**\n * `manni check`: every check the repository has set up, and nothing else.\n *\n * It owns no checks. Each one is a domain's own command core, run in process\n * with the family config handed to it, and each report is that domain's own\n * reporter's output. What this adds is the choice of what runs (`in-play.ts`),\n * the scope, and one verdict over all of it.\n *\n * Scope:\n *\n * - `all`: every in-play check over every collection, per-file and set-wide.\n * Each domain runs bare, exactly as its own CI step would.\n * - `paths`: the per-file checks on the collection members among the paths.\n * - `changed`: the per-file checks on the git working tree's changes, plus\n * `cite` and `strategy` set-wide. `term` runs set-wide too when a\n * collection document changed or was removed. `graph` never runs here;\n * only `all` checks it. A clean tree runs nothing.\n *\n * `cite` is per-file on paths and set-wide otherwise: a source edit can drift\n * any page's citation, so after a session the whole set is what is checked.\n * `strategy` never runs on paths, and runs on any change: a page's\n * `personas:` and `journeys:` mostly sit in its `{page}.meta.yaml`, which is\n * neither a document nor a collection member.\n */\nimport { basename, extname, resolve } from \"node:path\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport { ToolError, errorMessage } from \"../../shared/errors.js\";\nimport { warn } from \"../../shared/warn.js\";\nimport { resolveTargetSet } from \"../../meta/internal.js\";\nimport { supportedExtensions } from \"../../meta/extractors/index.js\";\nimport type { TurnCheckInput, TurnCheckResult } from \"../../tracevals/commands/check.js\";\nimport { changedFiles } from \"../core/changed.js\";\nimport { sayOnce } from \"../core/said-once.js\";\nimport type { Envelope } from \"../core/envelope.js\";\nimport {\n COMMANDS,\n DOMAINS,\n META_DEFAULTS_ONLY,\n NOT_SET_UP,\n collectionsOf,\n labelFrom,\n listMembers,\n loadFamily,\n nothingSetUpError,\n plural,\n type Domain,\n type Family,\n} from \"../core/in-play.js\";\nimport { withSharedWalks } from \"../../meta/core/load-files.js\";\nimport { FIX_SENTENCE } from \"./status.js\";\n\nexport const CHECK_FORMATS = [\"pretty\", \"json\", \"github\", \"sarif\"] as const;\nexport type CheckFormat = (typeof CHECK_FORMATS)[number];\n\nexport type Scope =\n | { kind: \"all\" }\n | { kind: \"paths\"; paths: string[] }\n | { kind: \"changed\" };\n\nexport interface FamilyCheckOptions {\n /** Where paths resolve and the domains run. Default `process.cwd()`. */\n cwd?: string;\n /** `-c, --config`. */\n configPath?: string;\n scope: Scope;\n /**\n * Leave out a named path that does not exist, rather than failing on it. A\n * hook names a file the edit may have just removed.\n */\n allowMissing?: boolean;\n /** Diagnostics: the outside-every-collection notice, and the domains' own. */\n onNotice?: (message: string) => void;\n}\n\n/** A check that ran. `render` is the domain's own reporter. */\nexport interface RanCheck {\n command: string;\n status: \"pass\" | \"fail\";\n render: (format: CheckFormat, color: boolean) => string;\n}\n\n/** A check that did not run: not in play, or it could not. */\nexport interface NotRunCheck {\n command: string;\n status: \"skipped\" | \"error\";\n message: string;\n}\n\nexport type CheckOutcome = RanCheck | NotRunCheck;\n\nexport interface FamilyCheckRun {\n status: \"pass\" | \"fail\";\n /** The collection members the per-file checks covered, labelled from `cwd`. */\n files: string[];\n checks: CheckOutcome[];\n}\n\ntype Outcome =\n | { skipped: string }\n | { failed: boolean; render: (format: CheckFormat, color: boolean) => string };\n\ninterface Context {\n family: Family;\n cwd: string;\n /** The per-file inputs, or `[]` for a bare run over the collections. */\n inputs: string[];\n onNotice: (message: string) => void;\n}\n\n/**\n * Each domain's command core and reporter are imported where it runs: a hook\n * checks one page with four domains, and the other two (the RDF stack among\n * them) are worth not loading.\n */\nasync function runDomain(domain: Domain, ctx: Context): Promise<Outcome> {\n const { family, cwd, inputs, onNotice } = ctx;\n const configPath = family.configPath;\n switch (domain) {\n case \"meta\": {\n const [{ runValidate }, { render: renderMeta }] = await Promise.all([\n import(\"../../meta/commands/validate.js\"),\n import(\"../../meta/reporters/index.js\"),\n ]);\n const run = await runValidate({ inputs, configPath, cwd, skipDefaultOnly: true, onNotice });\n if (run.results.length === 0) {\n return { skipped: family.sections.has(\"meta\") ? META_DEFAULTS_ONLY : NOT_SET_UP.meta };\n }\n return {\n failed: run.summary.failed > 0,\n render: (format, color) =>\n renderMeta(format, run.results, run.summary, { color, quiet: true, frame: run.frame, onNotice }),\n };\n }\n case \"cite\": {\n const [\n { runCheck: runCite },\n { renderCheckPretty: citePretty },\n { renderCheckJson: citeJson },\n { renderCheckGithub: citeGithub },\n { renderCheckSarif: citeSarif },\n ] = await Promise.all([\n import(\"../../cite/commands/check.js\"),\n import(\"../../cite/reporters/pretty.js\"),\n import(\"../../cite/reporters/json.js\"),\n import(\"../../cite/reporters/github.js\"),\n import(\"../../cite/reporters/sarif.js\"),\n ]);\n const run = await runCite({ inputs, configPath, cwd, onNotice });\n if (!run.pages.some((p) => p.citations.length > 0 || p.findings.length > 0)) {\n return { skipped: NOT_SET_UP.cite };\n }\n return {\n failed: run.summary.failed > 0,\n render: (format, color) => {\n switch (format) {\n case \"pretty\":\n return citePretty(run, { color, quiet: true });\n case \"json\":\n return citeJson(run);\n case \"github\":\n return citeGithub(run);\n case \"sarif\":\n return citeSarif(run, { onNotice });\n }\n },\n };\n }\n case \"lint\": {\n if (!family.sections.has(\"lint\")) return { skipped: NOT_SET_UP.lint };\n const [{ runLint }, { render: renderLint }] = await Promise.all([\n import(\"../../lint/commands/lint.js\"),\n import(\"../../lint/reporters/index.js\"),\n ]);\n const run = await runLint({ inputs, configPath, cwd, onNotice });\n return {\n failed: run.summary.failed > 0,\n // SARIF locations resolve from `root`, which is where the run's labels\n // start: the config's directory for a bare run, else the working one.\n render: (format, color) =>\n renderLint(run, format, { color, root: inputs.length === 0 ? resolve(cwd, family.file.dir) : cwd }),\n };\n }\n case \"docevals\": {\n const [{ runRun: runDocevals }, { render: renderDocevals }, { DocevalsError }] = await Promise.all([\n import(\"../../docevals/commands/run.js\"),\n import(\"../../docevals/reporters/index.js\"),\n import(\"../../docevals/types.js\"),\n ]);\n let report;\n try {\n report = await runDocevals(inputs, {\n config: configPath,\n cwd,\n deterministicOnly: true,\n generate: false,\n execution: false,\n toolVersion: pkg.version,\n });\n } catch (err) {\n if (err instanceof DocevalsError && err.code === \"nothing-resolved\") {\n return { skipped: NOT_SET_UP.docevals };\n }\n throw err;\n }\n return {\n failed: report.exitCode !== 0,\n render: (format, color) => renderDocevals(report, format, { color }),\n };\n }\n case \"term\": {\n const [\n { runCheck: runTerm },\n { renderFindingsPretty: termPretty },\n { renderFindingsJson: termJson },\n { renderFindingsGithub: termGithub },\n { renderFindingsSarif: termSarif },\n ] = await Promise.all([\n import(\"../../term/commands/check.js\"),\n import(\"../../term/reporters/pretty.js\"),\n import(\"../../term/reporters/json.js\"),\n import(\"../../term/reporters/github.js\"),\n import(\"../../term/reporters/sarif.js\"),\n ]);\n const report = await runTerm({ inputs, configPath, cwd, allowEmpty: true, onNotice });\n if (report.terms === 0) return { skipped: NOT_SET_UP.term };\n return {\n failed: report.summary.failed > 0,\n render: (format, color) => {\n switch (format) {\n case \"pretty\":\n return termPretty(report, { color, references: true });\n case \"json\":\n return termJson(report);\n case \"github\":\n return termGithub(report);\n case \"sarif\":\n return termSarif(report, { onNotice });\n }\n },\n };\n }\n case \"strategy\": {\n const [\n { runCheck: runStrategy },\n { renderFindingsPretty: strategyPretty },\n { renderFindingsJson: strategyJson },\n { renderFindingsGithub: strategyGithub },\n { renderFindingsSarif: strategySarif },\n ] = await Promise.all([\n import(\"../../strategy/commands/check.js\"),\n import(\"../../strategy/reporters/pretty.js\"),\n import(\"../../strategy/reporters/json.js\"),\n import(\"../../strategy/reporters/github.js\"),\n import(\"../../strategy/reporters/sarif.js\"),\n ]);\n const report = await runStrategy({ inputs, configPath, cwd, allowEmpty: true, onNotice });\n if (report.records === 0) return { skipped: NOT_SET_UP.strategy };\n return {\n failed: report.summary.failed > 0,\n render: (format, color) => {\n switch (format) {\n case \"pretty\":\n return strategyPretty(report, { color });\n case \"json\":\n return strategyJson(report);\n case \"github\":\n return strategyGithub(report);\n case \"sarif\":\n return strategySarif(report, { onNotice });\n }\n },\n };\n }\n case \"graph\": {\n if (!family.sections.has(\"graph\")) return { skipped: NOT_SET_UP.graph };\n const [{ buildGraph }, { runCheck: runGraph, renderCheck: renderGraph }] = await Promise.all([\n import(\"../../graph/commands/build.js\"),\n import(\"../../graph/commands/check.js\"),\n ]);\n const built = await buildGraph({ config: configPath, cwd });\n for (const warning of built.warnings) onNotice(warning);\n const report = await runGraph({ config: configPath, cwd, turtle: built.turtle });\n return {\n failed: report.exitCode !== 0,\n render: (format) => renderGraph(report, format),\n };\n }\n }\n}\n\nasync function outcome(domain: Domain, ctx: Context): Promise<CheckOutcome> {\n const command = COMMANDS[domain];\n try {\n const result = await runDomain(domain, ctx);\n if (\"skipped\" in result) return { command, status: \"skipped\", message: result.skipped };\n return { command, status: result.failed ? \"fail\" : \"pass\", render: result.render };\n } catch (err) {\n return { command, status: \"error\", message: errorMessage(err) };\n }\n}\n\n/** A hook or a git status names files by any extension; a walk keeps the documents. */\nfunction isDocument(label: string): boolean {\n return supportedExtensions().includes(extname(label).toLowerCase());\n}\n\n/** Every domain walks the same collections, so the run shares one walk per target set. */\nexport function runFamilyCheck(opts: FamilyCheckOptions): Promise<FamilyCheckRun> {\n return withSharedWalks(() => checkUnshared(opts));\n}\n\nasync function checkUnshared(opts: FamilyCheckOptions): Promise<FamilyCheckRun> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const onNotice = opts.onNotice ?? ((): void => undefined);\n const family = await loadFamily(cwd, opts.configPath);\n if (family.collections.length === 0) throw nothingSetUpError();\n const isMember = (label: string): boolean => collectionsOf(family, cwd, label).length > 0;\n\n let files: string[];\n let domains: Domain[];\n let inputs: string[];\n switch (opts.scope.kind) {\n case \"all\":\n files = await listMembers(family, cwd);\n inputs = [];\n domains = [...DOMAINS];\n break;\n case \"paths\": {\n const { files: named } = await resolveTargetSet({\n inputs: opts.scope.paths,\n cwd,\n ...(opts.allowMissing === true ? { allowEmpty: true } : {}),\n });\n const outside = named.filter((label) => !isMember(label));\n if (outside.length > 0) {\n onNotice(`Skipped ${plural(outside.length, \"file\")} outside every collection: ${outside.join(\", \")}`);\n }\n // A collection globbed wide holds assets too; only documents are checked.\n files = named.filter((label) => isMember(label) && isDocument(label));\n inputs = files;\n domains = files.length > 0 ? [\"meta\", \"cite\", \"lint\", \"docevals\"] : [];\n break;\n }\n case \"changed\": {\n const changed = await changedFiles(cwd);\n if (!changed.dirty) return { status: \"pass\", files: [], checks: [] };\n const memberDocuments = (paths: string[]): string[] =>\n paths.map((path) => labelFrom(cwd, path)).filter((l) => isDocument(l) && isMember(l));\n files = memberDocuments(changed.files);\n inputs = files;\n // term reads only collection documents, so a session that changed or\n // removed none of them leaves the glossary as it was. graph never runs\n // here: it is the slowest set-wide check, and its findings span pages\n // rather than the one an agent just wrote, so a bare run (CI) owns it.\n // strategy runs on any change, as cite does: a sidecar edit alone can\n // move a page's personas: or journeys:.\n const pageChanged = files.length > 0 || memberDocuments(changed.removed).length > 0;\n domains = [\n ...(files.length > 0 ? ([\"meta\", \"lint\", \"docevals\"] as const) : []),\n \"cite\",\n ...(pageChanged ? ([\"term\"] as const) : []),\n \"strategy\",\n ];\n break;\n }\n }\n\n const checks: CheckOutcome[] = [];\n for (const domain of domains) {\n // The set-wide checks run bare, over every collection, whatever the scope.\n const setWide =\n domain === \"term\" ||\n domain === \"strategy\" ||\n domain === \"graph\" ||\n (domain === \"cite\" && opts.scope.kind !== \"paths\");\n checks.push(await outcome(domain, { family, cwd, inputs: setWide ? [] : inputs, onNotice }));\n }\n if (opts.scope.kind === \"all\" && checks.every((c) => c.status === \"skipped\")) {\n throw nothingSetUpError();\n }\n return { status: checks.some((c) => c.status === \"fail\") ? \"fail\" : \"pass\", files, checks };\n}\n\n/** The exit code a run by hand ends with: 2 when a check could not run. */\nexport function exitCodeFor(run: FamilyCheckRun): 0 | 1 | 2 {\n if (run.checks.some((c) => c.status === \"error\")) return 2;\n return run.status === \"fail\" ? 1 : 0;\n}\n\nfunction isRan(check: CheckOutcome): check is RanCheck {\n return check.status === \"pass\" || check.status === \"fail\";\n}\n\n/** The first line of a message, for a one-line context. */\nfunction firstLine(message: string): string {\n return message.split(\"\\n\", 1)[0] ?? \"\";\n}\n\n/**\n * What an agent is told when a check could not run. The cause is the\n * config owner's to fix, so the agent reports it rather than editing config.\n */\nfunction couldNotCheck(command: string, files: string, message: string): string {\n return (\n `manni ${command} could not check ${files}. The cause is in manni's setup, not in the file. ` +\n `Tell the user what it says, and leave manni.config.yaml as it is.\\n${message}`\n );\n}\n\n/** What an agent is handed when a hook blocks: the failing checks' reports, nothing else. */\nfunction renderFailures(run: FamilyCheckRun): string {\n return run.checks\n .filter((c): c is RanCheck => c.status === \"fail\")\n .map((c) => `${c.command}\\n${c.render(\"pretty\", false)}`)\n .join(\"\\n\\n\");\n}\n\nexport function renderPretty(run: FamilyCheckRun, color: boolean): string {\n const blocks: string[] = [];\n for (const check of run.checks) {\n if (isRan(check)) blocks.push(`${check.command}\\n${check.render(\"pretty\", color)}`);\n }\n const notRun = run.checks.filter((c): c is NotRunCheck => !isRan(c));\n if (notRun.length > 0) {\n const width = Math.max(...notRun.map((c) => c.command.length)) + 3;\n blocks.push(\n notRun\n .map((c) => `${c.status.padEnd(9)}${c.command.padEnd(width)}${firstLine(c.message)}`)\n .join(\"\\n\"),\n );\n }\n const count = (status: CheckOutcome[\"status\"]): number =>\n run.checks.filter((c) => c.status === status).length;\n const errors = count(\"error\");\n blocks.push(\n `${plural(run.checks.length, \"check\")} over ${plural(run.files.length, \"file\")}: ` +\n `${String(count(\"fail\"))} failed, ${String(count(\"skipped\"))} skipped` +\n (errors > 0 ? `, ${String(errors)} could not run` : \"\"),\n );\n return blocks.join(\"\\n\\n\");\n}\n\n/** A check's JSON entry: its own report, or why there is none. */\nfunction jsonEntry(c: CheckOutcome): object {\n if (!isRan(c)) return { command: c.command, status: c.status, message: c.message };\n try {\n return { command: c.command, status: c.status, report: JSON.parse(c.render(\"json\", false)) as unknown };\n } catch {\n // One reporter's bad output must not take the other checks' reports with it.\n // `error` on purpose, whatever the run's own status: with no report to\n // embed, a `pass` or `fail` here would be a verdict nobody can inspect.\n // The reference documents `error` for this case too.\n return { command: c.command, status: \"error\", message: `${c.command} -f json printed output that is not JSON` };\n }\n}\n\nexport function renderJson(run: FamilyCheckRun): string {\n return JSON.stringify(\n {\n status: run.status,\n files: run.files,\n checks: run.checks.map(jsonEntry),\n },\n null,\n 2,\n );\n}\n\nexport function renderGithub(run: FamilyCheckRun): string {\n return run.checks\n .filter(isRan)\n .map((c) => c.render(\"github\", false))\n .filter((text) => text.length > 0)\n .join(\"\\n\");\n}\n\ninterface SarifRun {\n automationDetails?: { id: string };\n invocations?: unknown[];\n [key: string]: unknown;\n}\n\ninterface SarifNotification {\n level: \"note\" | \"error\";\n message: { text: string };\n}\n\n/**\n * One SARIF 2.1.0 log for the whole run. Each check that ran contributes its\n * domain's own runs, each under the category `manni/<domain>/`: meta, cite,\n * term and strategy share the driver `manni`, so the category is what tells\n * them apart.\n * A last `manni-check` run, with no results, names the checks that were\n * skipped or could not run. A check that could not run gets no run of its\n * own: an empty run would tell code scanning every open alert in its\n * category is fixed.\n */\nexport function renderSarif(run: FamilyCheckRun): string {\n const runs: SarifRun[] = [];\n const notifications: SarifNotification[] = [];\n const say = (level: SarifNotification[\"level\"], text: string): void => {\n notifications.push({ level, message: { text } });\n };\n for (const c of run.checks) {\n if (!isRan(c)) {\n if (c.status === \"skipped\") say(\"note\", `${c.command} skipped: ${c.message}.`);\n else say(\"error\", `${c.command} could not run: ${c.message}`);\n continue;\n }\n const domain = c.command.split(\" \", 1)[0] ?? c.command;\n let own: SarifRun[];\n try {\n // Parsed output is untrusted: `runs` may be missing or not an array. An\n // empty `runs` would drop the domain from the log without a word, so it\n // counts as bad output too.\n const runs = (JSON.parse(c.render(\"sarif\", false)) as { runs?: unknown }).runs;\n if (!Array.isArray(runs) || runs.length === 0) throw new TypeError(\"no runs\");\n own = runs as SarifRun[];\n } catch {\n // As in JSON: one reporter's bad output must not take the others with it.\n say(\"error\", `${c.command} -f sarif printed output that is not SARIF.`);\n continue;\n }\n for (const r of own) {\n runs.push({\n ...r,\n automationDetails: { id: `manni/${domain}/` },\n invocations: r.invocations ?? [{ executionSuccessful: true }],\n });\n }\n }\n runs.push({\n tool: {\n driver: {\n name: \"manni-check\",\n version: pkg.version,\n informationUri: \"https://hawkeyexl.github.io/manni/family/reference/cli/\",\n },\n },\n automationDetails: { id: \"manni/check/\" },\n invocations: [\n {\n executionSuccessful: !notifications.some((n) => n.level === \"error\"),\n ...(notifications.length > 0 ? { toolExecutionNotifications: notifications } : {}),\n },\n ],\n results: [],\n });\n return JSON.stringify(\n { $schema: \"https://json.schemastore.org/sarif-2.1.0.json\", version: \"2.1.0\", runs },\n null,\n 2,\n );\n}\n\nexport function render(run: FamilyCheckRun, format: CheckFormat, color: boolean): string {\n switch (format) {\n case \"pretty\":\n return renderPretty(run, color);\n case \"json\":\n return renderJson(run);\n case \"github\":\n return renderGithub(run);\n case \"sarif\":\n return renderSarif(run);\n }\n}\n\n/** What a hook command ends with: its exit code, and what it prints where. */\nexport interface HookReply {\n exitCode: 0 | 2;\n stdout?: string;\n stderr?: string;\n}\n\n/** The PostToolUse tools whose edit `check` answers. */\nexport const EDIT_TOOLS: readonly string[] = [\"Edit\", \"Write\", \"MultiEdit\", \"NotebookEdit\"];\n\n/**\n * The hook protocol's answer to a run. Never exit 2 for a check that could\n * not run: 2 means \"block\" to Claude Code, and an operational error is not\n * the agent's to fix.\n */\nexport function hookReply(run: FamilyCheckRun, envelope: Envelope): HookReply {\n const failed = run.status === \"fail\";\n if (envelope.event === \"PostToolUse\") {\n const files = run.files.join(\", \");\n if (failed) {\n return {\n exitCode: 2,\n stderr: `manni found errors in ${files}. Fix them before you continue. ${FIX_SENTENCE}\\n\\n${renderFailures(run)}\\n`,\n };\n }\n const errors = run.checks.filter((c): c is NotRunCheck => c.status === \"error\");\n if (errors.length === 0) return { exitCode: 0 };\n const additionalContext = errors.map((c) => couldNotCheck(c.command, files, c.message)).join(\"\\n\");\n return {\n exitCode: 0,\n stdout: `${JSON.stringify({ hookSpecificOutput: { hookEventName: \"PostToolUse\", additionalContext } })}\\n`,\n };\n }\n if (envelope.event === \"Stop\") return turnReply(run, undefined, envelope);\n return { exitCode: 0 };\n}\n\n/** What tracevals found in the turn a Stop or SubagentStop ended, for the reply. */\nexport interface TurnVerdict {\n /** Rules broken with a confident verdict: how many, the report, the trace judged. */\n broken?: { rules: number; report: string; trace: string };\n /** A skip not yet said this session. */\n skipMessage?: string;\n}\n\n/**\n * The reply to a Stop or a SubagentStop: 0078's file checks first, then the\n * turn. One block carries both reasons; after the repair pass, one message\n * carries both sentences. Always exit 0, as 0078's Stop is.\n */\nexport function turnReply(\n run: FamilyCheckRun | undefined,\n turn: TurnVerdict | undefined,\n envelope: Envelope,\n): HookReply {\n const reasons: string[] = [];\n const messages: string[] = [];\n if (run?.status === \"fail\") {\n if (envelope.stopHookActive) {\n messages.push(\"manni still reports errors after one repair pass. Run manni check to see them.\");\n } else {\n reasons.push(\n `manni found errors in the files you changed. Fix them, then finish. ${FIX_SENTENCE}\\n\\n${renderFailures(run)}`,\n );\n }\n }\n if (turn?.broken !== undefined) {\n const { rules, report, trace } = turn.broken;\n if (envelope.stopHookActive) {\n messages.push(\n `tracevals still finds broken rules after one repair pass. Run manni tracevals check ${trace} to see them.`,\n );\n } else {\n reasons.push(\n `This turn broke ${plural(rules, \"rule\")} from the files and requests that governed it. ` +\n `Fix the work, or say why the rule does not apply here, then finish.\\n\\n${report}`,\n );\n }\n }\n if (turn?.skipMessage !== undefined) messages.push(turn.skipMessage);\n if (reasons.length === 0 && messages.length === 0) return { exitCode: 0 };\n const reply = {\n ...(reasons.length > 0 ? { decision: \"block\", reason: reasons.join(\"\\n\\n\") } : {}),\n ...(messages.length > 0 ? { systemMessage: messages.join(\" \") } : {}),\n };\n return { exitCode: 0, stdout: `${JSON.stringify(reply)}\\n` };\n}\n\n/** Test seams `checkTurn` takes; production builds each from config. */\nexport type TurnSeams = Partial<Pick<TurnCheckInput, \"judge\" | \"extractor\" | \"localModels\" | \"env\">>;\n\n/**\n * Judge the turn a Stop or SubagentStop ended, with every gate of proposal\n * 0079. Silent (`undefined`) when tracevals is not in play, the turn is clean\n * or only needs review, a skip was already said this session, or the run\n * could not happen: an operational failure is not the agent's to fix.\n */\nexport async function runTurnCheck(\n envelope: Envelope,\n cwd: string,\n seams: TurnSeams = {},\n): Promise<TurnVerdict | undefined> {\n const subagent = envelope.event === \"SubagentStop\";\n const judged = subagent ? envelope.agentTranscriptPath : envelope.transcriptPath;\n if (judged === undefined) return undefined;\n const trace = resolve(cwd, judged);\n const sessionId = envelope.sessionId ?? basename(trace, \".jsonl\");\n let result: TurnCheckResult;\n let renderTurn: (typeof import(\"../../tracevals/reporters/runtime.js\"))[\"renderCheck\"];\n try {\n // Loaded here, as every domain is, so a run that never judges a turn never\n // loads tracevals.\n const [{ checkTurn }, reporters] = await Promise.all([\n import(\"../../tracevals/commands/check.js\"),\n import(\"../../tracevals/reporters/runtime.js\"),\n ]);\n renderTurn = reporters.renderCheck;\n result = await checkTurn({\n transcriptPath: resolve(cwd, envelope.transcriptPath ?? judged),\n ...(subagent ? { agentTranscriptPath: trace } : {}),\n ...(subagent && envelope.agentId !== undefined ? { agentId: envelope.agentId } : {}),\n ...(subagent && envelope.agentType !== undefined ? { agentType: envelope.agentType } : {}),\n ...(envelope.lastAssistantMessage !== undefined\n ? { lastAssistantMessage: envelope.lastAssistantMessage }\n : {}),\n sessionId,\n cwd,\n inLoop: true,\n ...seams,\n });\n } catch (err) {\n // An operational failure is not the agent's to fix, so it stays silent, as\n // 0078's Stop failures do. Anything else is a bug: say so on stderr, which\n // a hook that exits 0 sends to the debug log, and still never block.\n if (!(err instanceof ToolError)) warn(`the turn check failed unexpectedly: ${errorMessage(err)}`);\n return undefined;\n }\n const { skipped } = result;\n if (skipped?.message !== undefined) {\n return sayOnce(cwd, sessionId, skipped.gate) ? { skipMessage: skipped.message } : undefined;\n }\n if (result.exitCode !== 1 || result.report === undefined) return undefined;\n return {\n broken: {\n rules: result.report.summary.fail,\n report: renderTurn(result.report, { color: false }),\n trace: judged,\n },\n };\n}\n\n/** The reply when the run itself could not happen, under a hook. */\nexport function hookFailure(message: string, envelope: Envelope, file: string | undefined): HookReply {\n if (envelope.event !== \"PostToolUse\" || file === undefined) return { exitCode: 0 };\n const additionalContext = couldNotCheck(\"check\", file, message);\n return {\n exitCode: 0,\n stdout: `${JSON.stringify({ hookSpecificOutput: { hookEventName: \"PostToolUse\", additionalContext } })}\\n`,\n };\n}\n","/**\n * The files a session changed: the git working tree against `HEAD`.\n *\n * Modified, added, renamed (by the new name) and untracked files, staged or\n * not. A deleted file, or a renamed one's old name, is named apart, since\n * there is nothing left to check. Paths come back absolute, resolved from\n * `cwd`: porcelain status names them from the repository root whatever\n * directory git ran in.\n */\nimport { execFile } from \"node:child_process\";\nimport { posix, resolve } from \"node:path\";\nimport { promisify } from \"node:util\";\n\nconst run = promisify(execFile);\n\nasync function git(args: string[], cwd: string): Promise<string> {\n // shell:false: nothing here is ever parsed as shell syntax.\n const { stdout } = await run(\"git\", args, {\n cwd,\n shell: false,\n windowsHide: true,\n maxBuffer: 64 * 1024 * 1024,\n });\n return stdout;\n}\n\n/** Parse `git status --porcelain=v1 -z` into repository-relative paths. */\nexport function parsePorcelain(output: string): { files: string[]; removed: string[] } {\n const fields = output.split(\"\\0\");\n const files: string[] = [];\n const removed: string[] = [];\n for (let i = 0; i < fields.length; i++) {\n const entry = fields[i] ?? \"\";\n if (entry.length < 4) continue;\n const xy = entry.slice(0, 2);\n const path = entry.slice(3);\n // A rename or copy is followed by its old name, which is not a change to\n // check. A rename's old name is gone; a copy's is still there.\n if (xy.includes(\"R\") || xy.includes(\"C\")) {\n i++;\n if (xy.includes(\"R\")) removed.push(fields[i] ?? \"\");\n }\n // `RD`, a staged rename then deleted in the tree, removes both names:\n // the old one above and the new one here. Two files, not one twice.\n if (xy.includes(\"D\")) removed.push(path);\n else files.push(path);\n }\n return { files, removed };\n}\n\nexport interface ChangedTree {\n /** The changed files left to check, absolute. */\n files: string[];\n /** The files the tree no longer has: deleted, or renamed away. Absolute. */\n removed: string[];\n /**\n * Whether the tree differs from `HEAD` at all. A deletion alone leaves no\n * file to check, but it can still break a citation to what it removed.\n */\n dirty: boolean;\n}\n\nexport async function changedFiles(cwd: string): Promise<ChangedTree> {\n // Rebased through `cwd`'s own prefix rather than resolved from the\n // top-level git prints: on Windows that is the long spelling of a path the\n // caller may hold in its 8.3 short form, and the two would never compare.\n const prefix = (await git([\"rev-parse\", \"--show-prefix\"], cwd)).trim();\n const status = await git(\n [\"status\", \"--porcelain=v1\", \"-z\", \"--untracked-files=all\"],\n cwd,\n );\n const { files, removed } = parsePorcelain(status);\n const absolute = (path: string): string => resolve(cwd, posix.relative(prefix, path));\n return { files: files.map(absolute), removed: removed.map(absolute), dirty: status.length > 0 };\n}\n","/**\n * What a hook has already told the user this session (proposal 0079: \"A skip\n * message is said once per session\").\n *\n * Each hook is a process of its own, and parallel subagents end in parallel\n * SubagentStop hooks, so the memory is one marker file per message, created\n * exclusively. The process whose create succeeds is the one that says it, so\n * no two hooks can both read \"not said yet\".\n */\nimport { mkdirSync, writeFileSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { DEFAULT_CAPTURE_DIR } from \"../../tracevals/capture/types.js\";\nimport { idHash } from \"../../tracevals/rules/ledger.js\";\n\n/**\n * `<project>/.manni/tracevals/sessions/<session hash>.<key>.said`. The session\n * id is hashed, so nothing in it can climb out of the directory and two ids\n * never share a marker. The key is a gate name, which is already safe.\n */\nexport function saidPath(projectDir: string, sessionId: string, key: string): string {\n return join(projectDir, DEFAULT_CAPTURE_DIR, `${idHash(sessionId)}.${key}.said`);\n}\n\n/**\n * True the first time `key` comes up in a session, and records it. A marker\n * that cannot be written says the message rather than lose it.\n */\nexport function sayOnce(projectDir: string, sessionId: string, key: string): boolean {\n const path = saidPath(projectDir, sessionId, key);\n try {\n mkdirSync(dirname(path), { recursive: true });\n writeFileSync(path, \"\", { flag: \"wx\" });\n return true;\n } catch (err) {\n // EEXIST: another hook said it first. Anything else is an unwritable\n // project, which repeats the message each stop rather than lose it.\n return (err as NodeJS.ErrnoException).code !== \"EEXIST\";\n }\n}\n","/**\n * `manni status`: what is set up here, and so what `manni check` runs.\n *\n * It reads the same table `check` does (`in-play.ts`), counting what the\n * content declares where a domain is in play by declaration: the pages that\n * name their own `$schema`, carry citations or resolve evals, the terms, and\n * the strategy records.\n * It checks nothing, so it exits 0 whatever it finds.\n */\nimport { appendFileSync, existsSync, readFileSync } from \"node:fs\";\nimport { extname, resolve } from \"node:path\";\nimport pkg from \"../../../package.json\" with { type: \"json\" };\nimport { errorMessage } from \"../../shared/errors.js\";\nimport { extractorForExtension } from \"../../meta/extractors/index.js\";\nimport type { HostStatus } from \"../../tracevals/rules/host.js\";\nimport type { Envelope } from \"../core/envelope.js\";\nimport {\n COMMANDS,\n DOMAINS,\n NEXT,\n NOT_CHECKED,\n NOT_SET_UP,\n NO_COLLECTIONS,\n NO_COLLECTIONS_NEXT,\n collectionsOf,\n listMembers,\n loadFamily,\n plural,\n type Domain,\n type Family,\n} from \"../core/in-play.js\";\nimport { withSharedWalks } from \"../../meta/core/load-files.js\";\n\nexport const STATUS_FORMATS = [\"pretty\", \"json\"] as const;\nexport type StatusFormat = (typeof STATUS_FORMATS)[number];\n\nexport type DomainState = \"in-play\" | \"not-set-up\" | \"not-checked\" | \"unknown\";\n\nexport interface ModelRole {\n provider: string;\n model: string;\n}\n\nexport interface DomainRow {\n name: string;\n status: DomainState;\n reason: string;\n /** What to do about it. Absent on an `in-play` row. */\n next?: string;\n /** tracevals in play: the model judging inside a hook, and the one extracting rules. */\n models?: { hook: ModelRole; extraction: ModelRole };\n /** tracevals in play with a model host running: each model it holds. */\n host?: HostStatus[\"models\"];\n}\n\nexport interface StatusReport {\n version: string;\n /** The config file, as discovery found it or as it was typed. */\n config: string;\n collections: { name: string; files: number }[];\n domains: DomainRow[];\n}\n\nexport interface StatusOptions {\n cwd?: string;\n configPath?: string;\n /** Test seam: the running model host. Default: ask the inference library. */\n hostStatus?: () => Promise<HostStatus | null>;\n}\n\n/**\n * tracevals' row when `tracevals.runtime` exists: both models, resolved\n * the way `check` and `prepare` resolve them, and the host when one runs.\n */\nasync function tracevalsRow(cwd: string, opts: StatusOptions): Promise<DomainRow> {\n try {\n const [\n { discoverConfig },\n { assertProviderSelection, resolveSelectionIdentity, selectHookProvider, selectProvider },\n { hostStatus },\n ] = await Promise.all([\n import(\"../../tracevals/core/config.js\"),\n import(\"../../tracevals/judge/provider.js\"),\n import(\"../../tracevals/rules/host.js\"),\n ]);\n const { config } = await discoverConfig(cwd, opts.configPath === undefined ? {} : { configPath: opts.configPath });\n const hook = await resolveSelectionIdentity(config, selectHookProvider(config));\n const selection = selectProvider(config);\n assertProviderSelection(selection);\n const extraction = await resolveSelectionIdentity(config, selection);\n const host = await (opts.hostStatus ?? hostStatus)().catch(() => null);\n return {\n name: \"tracevals\",\n status: \"in-play\",\n reason: `hook: ${hook.provider} ${hook.model} · extraction: ${extraction.provider} ${extraction.model}`,\n models: {\n hook: { provider: hook.provider, model: hook.model },\n extraction: { provider: extraction.provider, model: extraction.model },\n },\n ...(host === null || host.models.length === 0 ? {} : { host: host.models }),\n };\n } catch (err) {\n const message = errorMessage(err).split(\"\\n\", 1)[0] ?? \"\";\n // `tracevals check` needs a trace, so running it again is no way to see more.\n return {\n name: \"tracevals\",\n status: \"unknown\",\n reason: `manni tracevals check could not run: ${message}`,\n next: \"Fix what the reason names, then run manni status again.\",\n };\n }\n}\n\n/** `1 page names`, `3 pages name`: a count and the verb that agrees with it. */\nfunction pages(n: number, one: string, many: string): string {\n return n === 1 ? `1 page ${one}` : `${String(n)} pages ${many}`;\n}\n\n/** The pages naming their own `$schema`, read the way `meta validate` extracts them. */\nfunction ownSchemaCount(cwd: string, members: readonly string[]): number {\n let n = 0;\n for (const label of members) {\n const extractor = extractorForExtension(extname(label));\n if (extractor === undefined) continue;\n try {\n const { data } = extractor.extract(readFileSync(resolve(cwd, label), \"utf8\"), label);\n if (data.$schema !== undefined) n++;\n } catch {\n // A page that does not parse names nothing; `meta validate` reports it.\n }\n }\n return n;\n}\n\n/**\n * The pages carrying citations, read the way `cite check` reads them: its\n * targets, its manifests, its entry rules. Nothing is classified, so no claim\n * or source is looked at and no git history is read.\n */\nasync function citedPages(cwd: string, configPath: string): Promise<number> {\n // Imported where they run, so `manni check` never loads them.\n const { prepareRun, readTarget } = await import(\"../../cite/commands/check.js\");\n const { readPage } = await import(\"../../cite/core/page.js\");\n const prepared = await prepareRun({ inputs: [], configPath, cwd, checkSources: false }, \"checked\", \"check\");\n let n = 0;\n for (const file of prepared.files) {\n const content = await readTarget(prepared.run, file);\n const { citations } = (await prepared.setupFor(file, content)).options;\n const read = readPage(file, content, { markers: false, ...(citations === undefined ? {} : { citations }) });\n if (read.citations.length > 0) n++;\n }\n return n;\n}\n\nasync function row(domain: Domain, family: Family, cwd: string, members: readonly string[]): Promise<DomainRow> {\n const configPath = family.configPath;\n const inPlay = (reason: string): DomainRow => ({ name: domain, status: \"in-play\", reason });\n const notSetUp: DomainRow = { name: domain, status: \"not-set-up\", reason: NOT_SET_UP[domain], next: NEXT[domain] };\n const section = family.sections.has(domain);\n switch (domain) {\n case \"meta\": {\n if (section) return inPlay(\"meta: section\");\n const n = ownSchemaCount(cwd, members);\n return n > 0 ? inPlay(pages(n, \"names its own $schema\", \"name their own $schema\")) : notSetUp;\n }\n case \"cite\": {\n const n = await citedPages(cwd, configPath);\n return n > 0 ? inPlay(pages(n, \"carries citations\", \"carry citations\")) : notSetUp;\n }\n case \"docevals\": {\n const { runList: listEvals } = await import(\"../../docevals/commands/list.js\");\n const { plans } = await listEvals([], { config: configPath, cwd });\n const n = plans.filter((p) => !p.skip && p.evals.length > 0).length;\n if (n === 0) return notSetUp;\n return inPlay(section ? \"docevals: section\" : pages(n, \"declares evals\", \"declare evals\"));\n }\n case \"term\": {\n const { runList: listTerms } = await import(\"../../term/commands/list.js\");\n const { terms } = await listTerms({ inputs: [], configPath, cwd, allowEmpty: true });\n return terms.length > 0 ? inPlay(plural(terms.length, \"term\")) : notSetUp;\n }\n case \"strategy\": {\n const [{ runList: listStrategy }, { countsLine }] = await Promise.all([\n import(\"../../strategy/commands/list.js\"),\n import(\"../../strategy/reporters/pretty.js\"),\n ]);\n const { set } = await listStrategy({ inputs: [], configPath, cwd, allowEmpty: true });\n return set.records.length > 0 ? inPlay(countsLine(set.records)) : notSetUp;\n }\n case \"lint\":\n case \"graph\":\n return section ? inPlay(`${domain}: section`) : notSetUp;\n }\n}\n\n/** Every domain walks the same collections, so the run shares one walk per target set. */\nexport function runStatus(opts: StatusOptions = {}): Promise<StatusReport> {\n return withSharedWalks(() => statusUnshared(opts));\n}\n\nasync function statusUnshared(opts: StatusOptions): Promise<StatusReport> {\n const cwd = resolve(opts.cwd ?? process.cwd());\n const family = await loadFamily(cwd, opts.configPath);\n const members = family.collections.length === 0 ? [] : await listMembers(family, cwd);\n const domains: DomainRow[] = [];\n for (const domain of DOMAINS) {\n // `check` only reads collection members, so with no collections every\n // domain has nothing to check, whatever sections the config carries.\n if (family.collections.length === 0) {\n domains.push({ name: domain, status: \"not-set-up\", reason: NO_COLLECTIONS, next: NO_COLLECTIONS_NEXT });\n continue;\n }\n try {\n domains.push(await row(domain, family, cwd, members));\n } catch (err) {\n // Status checks nothing, so a domain that cannot read its own setup is\n // reported in its row rather than ending the run, as unknown: whether it is\n // set up is the thing it could not read.\n const message = errorMessage(err).split(\"\\n\", 1)[0] ?? \"\";\n domains.push({\n name: domain,\n status: \"unknown\",\n reason: `manni ${COMMANDS[domain]} could not run: ${message}`,\n next: `Run manni ${COMMANDS[domain]} to see the whole error.`,\n });\n }\n }\n for (const [name, reason, next] of NOT_CHECKED) {\n domains.push(\n name === \"tracevals\" && family.runtime\n ? await tracevalsRow(cwd, opts)\n : { name, status: \"not-checked\", reason, next },\n );\n }\n return {\n version: pkg.version,\n config: family.file.source,\n collections: family.collections.map((c) => ({\n name: c.name,\n files: members.filter((label) => collectionsOf(family, cwd, label).includes(c.name)).length,\n })),\n domains,\n };\n}\n\nconst STATE_LABEL: Readonly<Record<DomainState, string>> = {\n \"in-play\": \"in play\",\n \"not-set-up\": \"not set up\",\n \"not-checked\": \"not checked\",\n unknown: \"unknown\",\n};\n\nexport interface RenderStatusOptions {\n /** Print each row's next step. Default true; the SessionStart briefing turns it off. */\n next?: boolean;\n}\n\nexport function renderStatus(report: StatusReport, format: StatusFormat, opts: RenderStatusOptions = {}): string {\n if (format === \"json\") return JSON.stringify(report, null, 2);\n const head = [\n `manni ${report.version}`,\n `config ${report.config}`,\n ...report.collections.map((c) => `collection ${c.name} (${plural(c.files, \"file\")})`),\n ].join(\" \");\n // tracevals in play judges each turn, which is what its row says.\n const label = (d: DomainRow): string => (d.models !== undefined ? \"judges each turn\" : STATE_LABEL[d.status]);\n const width = Math.max(14, ...report.domains.map((d) => label(d).length + 3));\n const indent = \"\".padEnd(11 + width);\n const rows = report.domains.flatMap((d, i) => [\n `${d.name.padEnd(11)}${label(d).padEnd(width)}${d.reason}`,\n ...(d.host ?? []).map(\n (m) =>\n `${\"\".padEnd(11)}${\"model host\".padEnd(width)}${m.model} loaded, ${plural(m.sessions, \"session\")}, ` +\n `idle ${String(Math.floor(m.idleMs / 60_000))}m`,\n ),\n // A next step a run of rows shares is said once, under the last of them.\n ...(opts.next !== false && d.next !== undefined && report.domains[i + 1]?.next !== d.next\n ? [`${indent}${d.next}`]\n : []),\n ]);\n return [head, \"\", ...rows].join(\"\\n\");\n}\n\n/**\n * The plugin skill the briefing points an agent at, as `<plugin>:<skill>`.\n * `test/plugin.test.ts` checks both halves against `plugin/manni`.\n */\nexport const FIX_SKILL = \"manni:fix\";\n\n/** The sentence the briefing and every hook block end on. */\nexport const FIX_SENTENCE = `The ${FIX_SKILL} skill says how to repair each finding.`;\n\n/** The set-wide checks a stop runs whenever the tree changed, as the briefing names them. */\nconst TREE_WIDE: ReadonlyArray<readonly [Domain, string]> = [\n // A source edit can drift any citation.\n [\"cite\", \"every citation\"],\n // A sidecar edit alone can move a page's personas: or journeys:.\n [\"strategy\", \"the content strategy\"],\n];\n\n/** The set-wide checks a stop runs when a collection document changed, as the briefing names them. */\nconst PAGE_WIDE: ReadonlyArray<readonly [Domain, string]> = [[\"term\", \"the glossary\"]];\n\n/** `a`, `a or b`, `a, b or c`: a list in prose, joined by `conjunction`. */\nfunction prose(items: readonly string[], conjunction: string): string {\n return items.length <= 1\n ? (items[0] ?? \"\")\n : `${items.slice(0, -1).join(\", \")} ${conjunction} ${items.at(-1) ?? \"\"}`;\n}\n\n/** What an agent is told at the start of a session, after the table. */\nexport function agentLines(report: StatusReport): string {\n const names = prose(report.collections.map((c) => c.name), \"or\");\n const inPlay = new Set(report.domains.filter((d) => d.status === \"in-play\").map((d) => d.name));\n const treeWide = TREE_WIDE.filter(([domain]) => inPlay.has(domain)).map(([, what]) => what);\n const plus = treeWide.length === 0 ? \"\" : `, plus ${prose(treeWide, \"and\")}`;\n const pageWide = PAGE_WIDE.filter(([domain]) => inPlay.has(domain)).map(([, what]) => what);\n const also = pageWide.length === 0 ? \"\" : ` It checks ${prose(pageWide, \"and\")} too when you changed a page.`;\n return [\n `After you edit a file in ${names}, manni check runs on it, and errors come back to you at once.`,\n `Before you finish, manni check runs on every file you changed${plus}.${also} You get one repair pass.`,\n FIX_SENTENCE,\n ].join(\"\\n\");\n}\n\n/** A model id as Claude Code spells one, and nothing a shell would read as more. */\nconst MODEL_ID = /^[A-Za-z0-9._:/@-]+$/;\n\n/**\n * Append `export MANNI_GENERATED_BY=<model>` to `$CLAUDE_ENV_FILE`, so every\n * command the session runs records which model wrote what. Only when the\n * envelope names the model, the file is offered, and nobody set the variable.\n */\nexport function exportGeneratedBy(envelope: Envelope, env: NodeJS.ProcessEnv = process.env): boolean {\n const file = env.CLAUDE_ENV_FILE;\n // A context-window suffix such as `[1m]` is a session setting, not the model.\n const model = envelope.model?.replace(/\\[[^\\]]*\\]$/, \"\");\n if (model === undefined || !MODEL_ID.test(model)) return false;\n if (file === undefined || file === \"\" || env.MANNI_GENERATED_BY !== undefined) return false;\n const existing = existsSync(file) ? readFileSync(file, \"utf8\") : \"\";\n const lead = existing === \"\" || existing.endsWith(\"\\n\") ? \"\" : \"\\n\";\n appendFileSync(file, `${lead}export MANNI_GENERATED_BY=${model}\\n`, \"utf8\");\n return true;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAWA,SAAS,WAAAA,gBAAe;AACxB,SAAS,SAAS,cAAc;;;AC2BhC,SAAS,IAAI,OAAoC;AAC/C,SAAO,OAAO,UAAU,YAAY,MAAM,SAAS,IAAI,QAAQ;AACjE;AAEA,SAAS,OAAO,OAAqD;AACnE,SAAO,UAAU,QAAQ,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,KAAK,IACrE,QACD;AACN;AAGO,SAAS,cAAc,MAAoC;AAChE,MAAI;AACJ,MAAI;AACF,aAAS,KAAK,MAAM,IAAI;AAAA,EAC1B,QAAQ;AACN,WAAO;AAAA,EACT;AACA,QAAM,MAAM,OAAO,MAAM;AACzB,QAAM,QAAQ,IAAI,KAAK,eAAe;AACtC,MAAI,QAAQ,UAAa,UAAU,OAAW,QAAO;AACrD,QAAM,QAAQ,OAAO,IAAI,UAAU;AACnC,QAAM,WAAW,IAAI,OAAO,SAAS,KAAK,IAAI,OAAO,aAAa;AAClE,QAAM,MAAM,IAAI,IAAI,GAAG;AACvB,QAAM,WAAW,IAAI,IAAI,SAAS;AAClC,QAAM,QAAQ,IAAI,IAAI,KAAK,KAAK,IAAI,OAAO,IAAI,KAAK,GAAG,EAAE;AACzD,QAAM,UAAU;AAAA,IACd,WAAW,IAAI,IAAI,UAAU;AAAA,IAC7B,gBAAgB,IAAI,IAAI,eAAe;AAAA,IACvC,qBAAqB,IAAI,IAAI,qBAAqB;AAAA,IAClD,SAAS,IAAI,IAAI,QAAQ;AAAA,IACzB,WAAW,IAAI,IAAI,UAAU;AAAA,IAC7B,sBAAsB,IAAI,IAAI,sBAAsB;AAAA,EACtD;AACA,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AE,QAAQ,cAAc,EAAE,QAAQ,QAAQ;AAAA,EACxF,EACC,mBAAmB,wBAAwB,EAC3C,aAAa,EACb,OAAO,OAAO,YAA8B;AAC3C,UAAM,WAAW,MAAM,aAAa;AACpC,UAAM,eAAe,QAAQ,WAAW,SAAY,CAAC,IAAI,EAAE,YAAY,QAAQ,OAAO;AACtF,QAAI,UAAU,UAAU,gBAAgB;AACtC,UAAI;AACF,cAAM,SAAS,MAAM,UAAU,EAAE,KAAKD,SAAQ,SAAS,OAAO,QAAQ,IAAI,CAAC,GAAG,GAAG,aAAa,CAAC;AAE/F,cAAM,QAAQ,OAAO,QAAQ,KAAK,CAAC,MAAM,EAAE,WAAW,SAAS,IAAI;AAAA;AAAA,EAAO,WAAW,MAAM,CAAC,KAAK;AAEjG,gBAAQ,OAAO,MAAM,GAAG,aAAa,QAAQ,UAAU,EAAE,MAAM,MAAM,CAAC,CAAC,GAAG,KAAK;AAAA,CAAI;AACnF,0BAAkB,QAAQ;AAAA,MAC5B,QAAQ;AAAA,MAER;AACA;AAAA,IACF;AACA,QAAI;AACF,YAAM,SAAS,MAAM,UAAU,YAAY;AAC3C,cAAQ,OAAO,MAAM,GAAG,aAAa,QAAQ,QAAQ,MAAM,CAAC;AAAA,CAAI;AAAA,IAClE,SAAS,KAAK;AACZ,WAAK,GAAG;AAAA,IACV;AAAA,EACF,CAAC;AACL;","names":["resolve","record","extname","resolve","resolve","resolve","resolve","run","resolve","extname","runs","resolve","run"]}
@@ -1,27 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- renderFindingsGithub
4
- } from "./chunk-FKELQCGN.js";
5
- import "./chunk-DNF42MK7.js";
6
- import "./chunk-O4O6JOGD.js";
7
- import "./chunk-MJZK7G4B.js";
8
- import "./chunk-ROZDHPKA.js";
9
- import "./chunk-WI3PPQQX.js";
10
- import "./chunk-XPO655IX.js";
11
- import "./chunk-ODSIHEIW.js";
12
- import "./chunk-WRWW6SGG.js";
13
- import "./chunk-77AINBYM.js";
14
- import "./chunk-QK6VYJHV.js";
15
- import "./chunk-RNVYGWIC.js";
16
- import "./chunk-YEUYKR62.js";
17
- import "./chunk-B2242FYO.js";
18
- import "./chunk-HX44GB4Z.js";
19
- import "./chunk-VM7VAFJW.js";
20
- import "./chunk-MJZ5HYYL.js";
21
- import "./chunk-OWBRDNRZ.js";
22
- import "./chunk-G3T47CFV.js";
23
- import "./chunk-2H7UOFLK.js";
24
- export {
25
- renderFindingsGithub
26
- };
27
- //# sourceMappingURL=github-BUK5CVQW.js.map
@@ -1,34 +0,0 @@
1
- #!/usr/bin/env node
2
- import {
3
- recordJson,
4
- renderFindingsJson,
5
- renderGetJson,
6
- renderListJson
7
- } from "./chunk-LPJ3IB26.js";
8
- import "./chunk-E6JYRVR5.js";
9
- import "./chunk-DNF42MK7.js";
10
- import "./chunk-O4O6JOGD.js";
11
- import "./chunk-MJZK7G4B.js";
12
- import "./chunk-ROZDHPKA.js";
13
- import "./chunk-WI3PPQQX.js";
14
- import "./chunk-XPO655IX.js";
15
- import "./chunk-ODSIHEIW.js";
16
- import "./chunk-WRWW6SGG.js";
17
- import "./chunk-77AINBYM.js";
18
- import "./chunk-QK6VYJHV.js";
19
- import "./chunk-RNVYGWIC.js";
20
- import "./chunk-YEUYKR62.js";
21
- import "./chunk-B2242FYO.js";
22
- import "./chunk-HX44GB4Z.js";
23
- import "./chunk-VM7VAFJW.js";
24
- import "./chunk-MJZ5HYYL.js";
25
- import "./chunk-OWBRDNRZ.js";
26
- import "./chunk-G3T47CFV.js";
27
- import "./chunk-2H7UOFLK.js";
28
- export {
29
- recordJson,
30
- renderFindingsJson,
31
- renderGetJson,
32
- renderListJson
33
- };
34
- //# sourceMappingURL=json-NZSGRYOE.js.map