@hawkeyexl/manni 4.4.1 → 4.6.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 (226) hide show
  1. package/README.md +1 -1
  2. package/dist/batch-OZOACN4G.js +41 -0
  3. package/dist/build-Z5VOVADH.js +32 -0
  4. package/dist/calibrate-TZYT42DR.js +36 -0
  5. package/dist/capture-SL4MNDDP.js +34 -0
  6. package/dist/check-5OMA42Y6.js +26 -0
  7. package/dist/{check-HYNGXYJV.js → check-OAJWC3WD.js} +7 -5
  8. package/dist/{check-ASPIHA6B.js → check-PKY7KTQE.js} +13 -14
  9. package/dist/check-WB2QDHJQ.js +880 -0
  10. package/dist/check-WB2QDHJQ.js.map +1 -0
  11. package/dist/{chunk-MWJLZMBL.js → chunk-2JFPBZJK.js} +11 -11
  12. package/dist/{chunk-QQUKGCAJ.js → chunk-2KRB3EG7.js} +2 -2
  13. package/dist/{chunk-DXNZS72W.js → chunk-2M6DVNI5.js} +10 -6
  14. package/dist/{chunk-DXNZS72W.js.map → chunk-2M6DVNI5.js.map} +1 -1
  15. package/dist/{chunk-QZ6LRSNV.js → chunk-3NWX34ZI.js} +19 -19
  16. package/dist/{chunk-IDV6HJCB.js → chunk-5G53XATW.js} +4 -4
  17. package/dist/{chunk-M2JCK5F6.js → chunk-6KKZXB2O.js} +19 -6
  18. package/dist/chunk-6KKZXB2O.js.map +1 -0
  19. package/dist/{chunk-PNPQTHBT.js → chunk-733Y2STG.js} +2 -2
  20. package/dist/{chunk-WB3QM6PP.js → chunk-73TC4DYH.js} +332 -2522
  21. package/dist/chunk-73TC4DYH.js.map +1 -0
  22. package/dist/{chunk-EPH54CAY.js → chunk-7WRP5FFP.js} +4 -4
  23. package/dist/{chunk-NXV7WE2D.js → chunk-APKH2T6E.js} +29 -591
  24. package/dist/chunk-APKH2T6E.js.map +1 -0
  25. package/dist/{chunk-I2AH3CJJ.js → chunk-B3TS4WRM.js} +17 -15
  26. package/dist/{chunk-I2AH3CJJ.js.map → chunk-B3TS4WRM.js.map} +1 -1
  27. package/dist/chunk-BWCWTHYS.js +146 -0
  28. package/dist/chunk-BWCWTHYS.js.map +1 -0
  29. package/dist/{chunk-MMTSSTG7.js → chunk-C3B2VJNC.js} +2 -2
  30. package/dist/{chunk-PU6DFJMY.js → chunk-C73RSUIC.js} +4 -4
  31. package/dist/chunk-CU57HT2E.js +116 -0
  32. package/dist/chunk-CU57HT2E.js.map +1 -0
  33. package/dist/chunk-CWXZ2MRT.js +222 -0
  34. package/dist/chunk-CWXZ2MRT.js.map +1 -0
  35. package/dist/{chunk-GCQRPUSB.js → chunk-DC5DDJVE.js} +6 -6
  36. package/dist/{chunk-6OYEI2VV.js → chunk-ECVQNGTH.js} +3 -3
  37. package/dist/chunk-FLAO4ZS3.js +502 -0
  38. package/dist/chunk-FLAO4ZS3.js.map +1 -0
  39. package/dist/chunk-FQGLRJGX.js +174 -0
  40. package/dist/chunk-FQGLRJGX.js.map +1 -0
  41. package/dist/{chunk-7UKO3ASZ.js → chunk-GAJIJKET.js} +3 -3
  42. package/dist/{chunk-6JSSEWBG.js → chunk-GREQKO6M.js} +202 -54
  43. package/dist/chunk-GREQKO6M.js.map +1 -0
  44. package/dist/chunk-HX44GB4Z.js +30 -0
  45. package/dist/chunk-HX44GB4Z.js.map +1 -0
  46. package/dist/{chunk-4IUC2MNL.js → chunk-IY7NYNPZ.js} +9 -11
  47. package/dist/{chunk-4IUC2MNL.js.map → chunk-IY7NYNPZ.js.map} +1 -1
  48. package/dist/{chunk-57NEQRVO.js → chunk-KCOFEWV5.js} +8 -6
  49. package/dist/{chunk-57NEQRVO.js.map → chunk-KCOFEWV5.js.map} +1 -1
  50. package/dist/chunk-M2RLHZ4J.js +849 -0
  51. package/dist/chunk-M2RLHZ4J.js.map +1 -0
  52. package/dist/{chunk-NLXTXE5Y.js → chunk-M6GSS72T.js} +185 -33
  53. package/dist/chunk-M6GSS72T.js.map +1 -0
  54. package/dist/{chunk-YTURO7SI.js → chunk-MHM4QEBV.js} +4 -4
  55. package/dist/{chunk-RL5XWQOL.js → chunk-MOWMCEOJ.js} +143 -54
  56. package/dist/chunk-MOWMCEOJ.js.map +1 -0
  57. package/dist/{chunk-C4SQM22E.js → chunk-MWBJ3KTF.js} +13 -11
  58. package/dist/chunk-MWBJ3KTF.js.map +1 -0
  59. package/dist/chunk-N7JSEDSC.js +233 -0
  60. package/dist/chunk-N7JSEDSC.js.map +1 -0
  61. package/dist/{chunk-JCDXE76J.js → chunk-NBMPHD4I.js} +2 -2
  62. package/dist/{chunk-37LP5HMZ.js → chunk-NHHOPZRA.js} +12 -10
  63. package/dist/{chunk-37LP5HMZ.js.map → chunk-NHHOPZRA.js.map} +1 -1
  64. package/dist/{chunk-YB4IBW3M.js → chunk-NTWW7J76.js} +2 -2
  65. package/dist/{chunk-UJCVAWP7.js → chunk-PCFG7E6B.js} +3 -3
  66. package/dist/{chunk-UJCVAWP7.js.map → chunk-PCFG7E6B.js.map} +1 -1
  67. package/dist/{chunk-FBEQCK47.js → chunk-PL4UAF4S.js} +73 -1304
  68. package/dist/chunk-PL4UAF4S.js.map +1 -0
  69. package/dist/chunk-QCHVR4ZM.js +286 -0
  70. package/dist/chunk-QCHVR4ZM.js.map +1 -0
  71. package/dist/{chunk-PIKOVN6W.js → chunk-QW77LCOU.js} +10 -10
  72. package/dist/{chunk-2B7ZNTPV.js → chunk-SM6NOMJS.js} +2 -2
  73. package/dist/chunk-SWSTHZBI.js +2464 -0
  74. package/dist/chunk-SWSTHZBI.js.map +1 -0
  75. package/dist/{chunk-JXLTXMJ7.js → chunk-T6SYGLWR.js} +3 -3
  76. package/dist/{chunk-CK7SKVHR.js → chunk-TBAMBLF3.js} +3 -12
  77. package/dist/chunk-TBAMBLF3.js.map +1 -0
  78. package/dist/chunk-TH4JVQPF.js +133 -0
  79. package/dist/chunk-TH4JVQPF.js.map +1 -0
  80. package/dist/{chunk-QRWGPQKO.js → chunk-TLXE7LYK.js} +4 -4
  81. package/dist/{chunk-M3W7J6MU.js → chunk-TUAAR3MM.js} +3280 -283
  82. package/dist/chunk-TUAAR3MM.js.map +1 -0
  83. package/dist/{chunk-SKSDRUUK.js → chunk-UAKNZVCD.js} +4 -4
  84. package/dist/{chunk-YJOGUXGP.js → chunk-UJSGS2Y5.js} +8 -6
  85. package/dist/{chunk-YJOGUXGP.js.map → chunk-UJSGS2Y5.js.map} +1 -1
  86. package/dist/{chunk-UQISLDAV.js → chunk-UWQ2UVHE.js} +8 -6
  87. package/dist/{chunk-UQISLDAV.js.map → chunk-UWQ2UVHE.js.map} +1 -1
  88. package/dist/chunk-WQWKYAAK.js +86 -0
  89. package/dist/chunk-WQWKYAAK.js.map +1 -0
  90. package/dist/{chunk-LJ2RDH3F.js → chunk-XG6PVB5S.js} +1 -23
  91. package/dist/chunk-XG6PVB5S.js.map +1 -0
  92. package/dist/{chunk-Q35YIDBV.js → chunk-XKBEHKWO.js} +29 -264
  93. package/dist/chunk-XKBEHKWO.js.map +1 -0
  94. package/dist/chunk-XPEWUK7J.js +532 -0
  95. package/dist/chunk-XPEWUK7J.js.map +1 -0
  96. package/dist/{chunk-MYMBCTDE.js → chunk-XXDXIIQ4.js} +2 -2
  97. package/dist/chunk-YGFIQ6Y5.js +17 -0
  98. package/dist/chunk-YGFIQ6Y5.js.map +1 -0
  99. package/dist/chunk-YLK2J5YK.js +610 -0
  100. package/dist/chunk-YLK2J5YK.js.map +1 -0
  101. package/dist/{chunk-3VK37OR2.js → chunk-Z4IZGEM3.js} +16 -12
  102. package/dist/{chunk-3VK37OR2.js.map → chunk-Z4IZGEM3.js.map} +1 -1
  103. package/dist/{cli-6HIDIFVT.js → cli-6EWVMEN6.js} +5 -3
  104. package/dist/{cli-6HIDIFVT.js.map → cli-6EWVMEN6.js.map} +1 -1
  105. package/dist/{cli-VI7VHWNZ.js → cli-6H7HVDMQ.js} +113 -20
  106. package/dist/{cli-VI7VHWNZ.js.map → cli-6H7HVDMQ.js.map} +1 -1
  107. package/dist/{cli-RPM5PELX.js → cli-EPVZHAZS.js} +24 -20
  108. package/dist/cli-EPVZHAZS.js.map +1 -0
  109. package/dist/{cli-MN7PYMBI.js → cli-LUCSGTVI.js} +17 -19
  110. package/dist/{cli-MN7PYMBI.js.map → cli-LUCSGTVI.js.map} +1 -1
  111. package/dist/{cli-LFP5ZGYS.js → cli-NIG4N3XM.js} +16 -15
  112. package/dist/{cli-LFP5ZGYS.js.map → cli-NIG4N3XM.js.map} +1 -1
  113. package/dist/{cli-PYPX6O6E.js → cli-PSKNB66T.js} +225 -58
  114. package/dist/cli-PSKNB66T.js.map +1 -0
  115. package/dist/{cli-3BIBYHFK.js → cli-UO4NHIB3.js} +17 -17
  116. package/dist/{cli-6UB5N6CU.js → cli-UQ7A3YA2.js} +17 -18
  117. package/dist/{cli-6UB5N6CU.js.map → cli-UQ7A3YA2.js.map} +1 -1
  118. package/dist/{cli-673OTRGE.js → cli-YHYDLQAF.js} +10 -10
  119. package/dist/cli.js +11 -11
  120. package/dist/config-P4HDNTYD.js +26 -0
  121. package/dist/conformance-ZFCMKM6M.js +18 -0
  122. package/dist/docmeta.js +9 -9
  123. package/dist/github-7ZCH5PSO.js +26 -0
  124. package/dist/github-POT6724K.js +31 -0
  125. package/dist/host-6GURH5HE.js +23 -0
  126. package/dist/index.d.ts +102 -12
  127. package/dist/index.js +185 -171
  128. package/dist/index.js.map +1 -1
  129. package/dist/{json-SY7KLNC7.js → json-KT2K62L5.js} +12 -13
  130. package/dist/lint-5AQ5C2BV.js +29 -0
  131. package/dist/list-5JZKX2NK.js +28 -0
  132. package/dist/list-SWPFXQMU.js +30 -0
  133. package/dist/{page-KSGV5RD4.js → page-UPSXRP75.js} +11 -12
  134. package/dist/prepare-6GNEWCNH.js +155 -0
  135. package/dist/prepare-6GNEWCNH.js.map +1 -0
  136. package/dist/{pretty-CXSDXNAS.js → pretty-Q6FQAOK4.js} +13 -14
  137. package/dist/{pretty-A5EGTN35.js → pretty-SQRPFPSQ.js} +12 -13
  138. package/dist/provider-AMGRDY6V.js +34 -0
  139. package/dist/release-IECYCLTD.js +36 -0
  140. package/dist/release-IECYCLTD.js.map +1 -0
  141. package/dist/{reporters-HUY7UXFS.js → reporters-45MMC2ID.js} +13 -13
  142. package/dist/{reporters-K2VUKSAK.js → reporters-XUV4MM64.js} +7 -5
  143. package/dist/reporters-XUV4MM64.js.map +1 -0
  144. package/dist/run-KMWY2IAN.js +32 -0
  145. package/dist/run-KMWY2IAN.js.map +1 -0
  146. package/dist/{term-BIQUPMOR.js → term-PCJUCWNF.js} +16 -17
  147. package/dist/{term-BIQUPMOR.js.map → term-PCJUCWNF.js.map} +1 -1
  148. package/dist/validate-IMNCZNWG.js +17 -0
  149. package/dist/validate-IMNCZNWG.js.map +1 -0
  150. package/package.json +2 -2
  151. package/plugin/manni/.claude-plugin/plugin.json +1 -1
  152. package/plugin/manni/hooks/hooks.json +47 -0
  153. package/dist/batch-GFNLTGOH.js +0 -36
  154. package/dist/build-COYIQ25L.js +0 -31
  155. package/dist/calibrate-MDBLJKEE.js +0 -31
  156. package/dist/capture-LRML2PKV.js +0 -32
  157. package/dist/check-EDLBYL5N.js +0 -27
  158. package/dist/chunk-6JSSEWBG.js.map +0 -1
  159. package/dist/chunk-A5ULMVHQ.js +0 -164
  160. package/dist/chunk-A5ULMVHQ.js.map +0 -1
  161. package/dist/chunk-C4SQM22E.js.map +0 -1
  162. package/dist/chunk-CK7SKVHR.js.map +0 -1
  163. package/dist/chunk-FBEQCK47.js.map +0 -1
  164. package/dist/chunk-LJ2RDH3F.js.map +0 -1
  165. package/dist/chunk-M2JCK5F6.js.map +0 -1
  166. package/dist/chunk-M3W7J6MU.js.map +0 -1
  167. package/dist/chunk-NLXTXE5Y.js.map +0 -1
  168. package/dist/chunk-NXV7WE2D.js.map +0 -1
  169. package/dist/chunk-Q35YIDBV.js.map +0 -1
  170. package/dist/chunk-RL5XWQOL.js.map +0 -1
  171. package/dist/chunk-TK3FC4RF.js +0 -3090
  172. package/dist/chunk-TK3FC4RF.js.map +0 -1
  173. package/dist/chunk-TU2WUBVZ.js +0 -2
  174. package/dist/chunk-WB3QM6PP.js.map +0 -1
  175. package/dist/cli-PYPX6O6E.js.map +0 -1
  176. package/dist/cli-RPM5PELX.js.map +0 -1
  177. package/dist/github-6QMYOHC3.js +0 -27
  178. package/dist/github-SXPGP5DB.js +0 -32
  179. package/dist/lint-ASMJLLPA.js +0 -28
  180. package/dist/list-KZNVTNVC.js +0 -31
  181. package/dist/list-Q57YTFUQ.js +0 -29
  182. package/dist/run-3DYJNRIG.js +0 -33
  183. package/dist/validate-53RKM2XG.js +0 -16
  184. /package/dist/{batch-GFNLTGOH.js.map → batch-OZOACN4G.js.map} +0 -0
  185. /package/dist/{build-COYIQ25L.js.map → build-Z5VOVADH.js.map} +0 -0
  186. /package/dist/{calibrate-MDBLJKEE.js.map → calibrate-TZYT42DR.js.map} +0 -0
  187. /package/dist/{capture-LRML2PKV.js.map → capture-SL4MNDDP.js.map} +0 -0
  188. /package/dist/{check-ASPIHA6B.js.map → check-5OMA42Y6.js.map} +0 -0
  189. /package/dist/{check-EDLBYL5N.js.map → check-OAJWC3WD.js.map} +0 -0
  190. /package/dist/{check-HYNGXYJV.js.map → check-PKY7KTQE.js.map} +0 -0
  191. /package/dist/{chunk-MWJLZMBL.js.map → chunk-2JFPBZJK.js.map} +0 -0
  192. /package/dist/{chunk-QQUKGCAJ.js.map → chunk-2KRB3EG7.js.map} +0 -0
  193. /package/dist/{chunk-QZ6LRSNV.js.map → chunk-3NWX34ZI.js.map} +0 -0
  194. /package/dist/{chunk-IDV6HJCB.js.map → chunk-5G53XATW.js.map} +0 -0
  195. /package/dist/{chunk-PNPQTHBT.js.map → chunk-733Y2STG.js.map} +0 -0
  196. /package/dist/{chunk-EPH54CAY.js.map → chunk-7WRP5FFP.js.map} +0 -0
  197. /package/dist/{chunk-MMTSSTG7.js.map → chunk-C3B2VJNC.js.map} +0 -0
  198. /package/dist/{chunk-PU6DFJMY.js.map → chunk-C73RSUIC.js.map} +0 -0
  199. /package/dist/{chunk-GCQRPUSB.js.map → chunk-DC5DDJVE.js.map} +0 -0
  200. /package/dist/{chunk-6OYEI2VV.js.map → chunk-ECVQNGTH.js.map} +0 -0
  201. /package/dist/{chunk-7UKO3ASZ.js.map → chunk-GAJIJKET.js.map} +0 -0
  202. /package/dist/{chunk-YTURO7SI.js.map → chunk-MHM4QEBV.js.map} +0 -0
  203. /package/dist/{chunk-JCDXE76J.js.map → chunk-NBMPHD4I.js.map} +0 -0
  204. /package/dist/{chunk-YB4IBW3M.js.map → chunk-NTWW7J76.js.map} +0 -0
  205. /package/dist/{chunk-PIKOVN6W.js.map → chunk-QW77LCOU.js.map} +0 -0
  206. /package/dist/{chunk-2B7ZNTPV.js.map → chunk-SM6NOMJS.js.map} +0 -0
  207. /package/dist/{chunk-JXLTXMJ7.js.map → chunk-T6SYGLWR.js.map} +0 -0
  208. /package/dist/{chunk-QRWGPQKO.js.map → chunk-TLXE7LYK.js.map} +0 -0
  209. /package/dist/{chunk-SKSDRUUK.js.map → chunk-UAKNZVCD.js.map} +0 -0
  210. /package/dist/{chunk-MYMBCTDE.js.map → chunk-XXDXIIQ4.js.map} +0 -0
  211. /package/dist/{cli-3BIBYHFK.js.map → cli-UO4NHIB3.js.map} +0 -0
  212. /package/dist/{chunk-TU2WUBVZ.js.map → cli-YHYDLQAF.js.map} +0 -0
  213. /package/dist/{cli-673OTRGE.js.map → config-P4HDNTYD.js.map} +0 -0
  214. /package/dist/{github-6QMYOHC3.js.map → conformance-ZFCMKM6M.js.map} +0 -0
  215. /package/dist/{github-SXPGP5DB.js.map → github-7ZCH5PSO.js.map} +0 -0
  216. /package/dist/{json-SY7KLNC7.js.map → github-POT6724K.js.map} +0 -0
  217. /package/dist/{lint-ASMJLLPA.js.map → host-6GURH5HE.js.map} +0 -0
  218. /package/dist/{list-KZNVTNVC.js.map → json-KT2K62L5.js.map} +0 -0
  219. /package/dist/{list-Q57YTFUQ.js.map → lint-5AQ5C2BV.js.map} +0 -0
  220. /package/dist/{page-KSGV5RD4.js.map → list-5JZKX2NK.js.map} +0 -0
  221. /package/dist/{pretty-A5EGTN35.js.map → list-SWPFXQMU.js.map} +0 -0
  222. /package/dist/{pretty-CXSDXNAS.js.map → page-UPSXRP75.js.map} +0 -0
  223. /package/dist/{reporters-HUY7UXFS.js.map → pretty-Q6FQAOK4.js.map} +0 -0
  224. /package/dist/{reporters-K2VUKSAK.js.map → pretty-SQRPFPSQ.js.map} +0 -0
  225. /package/dist/{run-3DYJNRIG.js.map → provider-AMGRDY6V.js.map} +0 -0
  226. /package/dist/{validate-53RKM2XG.js.map → reporters-45MMC2ID.js.map} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/tracevals/capture/manifest.ts","../src/tracevals/trace/availability.ts","../src/tracevals/artifacts/availability.ts","../src/tracevals/artifacts/fs.ts","../src/tracevals/artifacts/resolve.ts","../src/tracevals/evals/schema.ts","../src/tracevals/evals/extract.ts"],"sourcesContent":["/**\n * Reading, locating, and comparing session manifests (ADR 01024).\n *\n * The consuming half. Deliberately free of any dependency on\n * `artifacts/discover.ts`: `artifacts/resolve.ts` imports this module, and\n * discovery imports resolution, so producing and consuming a manifest have to\n * live in separate files or the two would form a cycle. Building one is\n * `capture/build.ts`.\n */\nimport { createHash } from \"node:crypto\";\nimport { mkdir, readFile, writeFile } from \"node:fs/promises\";\nimport {\n dirname,\n extname,\n isAbsolute,\n join,\n relative,\n resolve,\n sep,\n} from \"node:path\";\nimport {\n MANIFEST_VERSION,\n type ContentCheck,\n type SessionManifest,\n} from \"./types.js\";\n\nexport function sha256Hex(data: Buffer | string): string {\n return createHash(\"sha256\").update(data).digest(\"hex\");\n}\n\n/** sha256 of a file's bytes, or null when it cannot be read. */\nexport async function hashFile(path: string): Promise<string | null> {\n try {\n // The bytes, not the decoded string: the digest has to mean \"this file\",\n // and a decode-then-re-encode would quietly normalize a BOM.\n return sha256Hex(await readFile(path));\n } catch {\n return null;\n }\n}\n\n/** `path` relative to `root`, POSIX-separated, or null when it escapes. */\nexport function relPosix(root: string, path: string): string | null {\n const rel = relative(resolve(root), resolve(path));\n if (rel === \"\" || rel.startsWith(\"..\") || isAbsolute(rel)) return null;\n return rel.split(sep).join(\"/\");\n}\n\n/**\n * A session id is a filename here, so it may not carry path syntax. Claude Code\n * writes UUIDs; a hand-passed `--session-id` is the case this guards, and a\n * `../` in one would write the manifest outside the directory it was aimed at.\n */\nexport function safeSessionId(sessionId: string): string {\n const cleaned = sessionId.replace(/[^A-Za-z0-9._-]/g, \"-\").replace(/^\\.+/, \"\");\n return cleaned.length > 0 ? cleaned.slice(0, 128) : \"session\";\n}\n\nexport function manifestPathFor(dir: string, sessionId: string): string {\n return join(dir, `${safeSessionId(sessionId)}.json`);\n}\n\n/** The `<trace>.manifest.json` sibling — a manifest placed beside its trace. */\nexport function siblingManifestPath(tracePath: string): string {\n const ext = extname(tracePath);\n const stem = ext === \"\" ? tracePath : tracePath.slice(0, -ext.length);\n return `${stem}.manifest.json`;\n}\n\n// ── Persisting ───────────────────────────────────────────────────\n\nexport async function writeManifest(\n path: string,\n manifest: SessionManifest,\n): Promise<void> {\n await mkdir(dirname(resolve(path)), { recursive: true });\n await writeFile(path, `${JSON.stringify(manifest, null, 2)}\\n`, \"utf-8\");\n}\n\n/**\n * Every member `run` actually consumes, checked one by one.\n *\n * A partial read is the dangerous failure here, not a loud one. An artifact\n * entry with no `path` puts `undefined` in the comparison map's key, and one\n * whose `sha256` is not a string puts a value no real digest can equal — so a\n * half-read manifest reports **`mismatch`**, \"this artifact changed since the\n * session\", which is the most alarming thing this feature can say and would be\n * said off nothing but the file's own corruption. A manifest is optional\n * evidence, so anything malformed has to read as *no* evidence.\n */\nfunction isManifestArtifact(value: unknown): boolean {\n if (value === null || typeof value !== \"object\" || Array.isArray(value)) {\n return false;\n }\n const entry = value as Record<string, unknown>;\n return (\n typeof entry.path === \"string\" &&\n entry.path.length > 0 &&\n typeof entry.sha256 === \"string\" &&\n entry.sha256.length > 0 &&\n typeof entry.name === \"string\" &&\n typeof entry.type === \"string\" &&\n typeof entry.bytes === \"number\"\n );\n}\n\n/**\n * Read one manifest, or null. Absent, unreadable, unparseable, the wrong shape,\n * or written by a newer format version all produce null: consuming a manifest\n * is optional evidence-gathering, so every failure has to degrade to \"no\n * evidence\" rather than to a crash or, worse, to a partial read (ADR 01003).\n */\nexport async function readManifest(\n path: string,\n): Promise<SessionManifest | null> {\n let raw: string;\n try {\n raw = await readFile(path, \"utf-8\");\n } catch {\n return null;\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(raw);\n } catch {\n return null;\n }\n if (parsed === null || typeof parsed !== \"object\" || Array.isArray(parsed)) {\n return null;\n }\n const record = parsed as Record<string, unknown>;\n if (typeof record.version !== \"number\" || record.version > MANIFEST_VERSION) {\n return null;\n }\n if (typeof record.sessionId !== \"string\") return null;\n // `capturedAt` is printed in the report and `root` is a base the join is\n // keyed on; both are consumed, so neither may be half-there.\n if (typeof record.capturedAt !== \"string\") return null;\n if (typeof record.root !== \"string\") return null;\n if (!Array.isArray(record.artifacts)) return null;\n if (!record.artifacts.every(isManifestArtifact)) return null;\n return parsed as SessionManifest;\n}\n\nexport interface FindManifestOptions {\n tracePath: string;\n /** The trace's own session id, when it recorded one. */\n sessionId?: string;\n /** Project root; the canonical manifest lives under it. */\n projectDir: string;\n /** Directory manifests are written to, relative to the project root. */\n captureDir: string;\n /** An explicitly named manifest, which is used without searching. */\n explicit?: string;\n /**\n * Called for each candidate that was readable but refused, with why. A\n * refusal that leaves no trace is indistinguishable from never having\n * captured anything, which is the wrong thing for a reader to conclude.\n */\n onRefused?: (path: string, reason: string) => void;\n}\n\nexport interface FoundManifest {\n path: string;\n manifest: SessionManifest;\n}\n\n/**\n * Find the manifest for a trace, most-specific location first.\n *\n * 1. `<trace>.manifest.json` — someone put it there deliberately, which is a\n * stronger statement of intent than any convention.\n * 2. `<trace dir>/<captureDir>/<session-id>.json` — a trace copied out of the\n * session store together with the state directory.\n * 3. `<projectDir>/<captureDir>/<session-id>.json` — where `capture` writes.\n *\n * **A manifest that cannot be shown to belong to this trace is refused**, not\n * used. It is evidence about some other session, and letting it stand in here\n * would be the one way a manifest could produce a confidently wrong answer.\n *\n * Two ways that can happen, and the trace's own id decides which:\n *\n * - The ids **disagree** — refused outright, however the manifest was reached.\n * - The trace records **no id at all**. A Claude Code session file whose\n * records predate `sessionId`, or a `claude -p` stream-json transcript\n * captured without its `system`/`init` record, both parse fine and both\n * arrive here with nothing to check against. A manifest found *by\n * convention* beside such a trace is refused, because convention is not\n * provenance and the file could describe any session on the machine.\n *\n * An **explicitly named** `--manifest` is the exception to that second case,\n * and only that one. Naming a file is the caller's own assertion that it\n * belongs to this trace — the assertion the ADR already treats as\n * load-bearing when it makes an unusable named manifest an error rather than a\n * shrug — and it is the only assertion available for a trace format that\n * records no id. Refusing it would leave `--manifest` structurally unusable\n * there while buying no safety a discovered manifest does not already get.\n */\nexport async function findManifest(\n options: FindManifestOptions,\n): Promise<FoundManifest | null> {\n const explicit = options.explicit !== undefined;\n const candidates: string[] = [];\n if (options.explicit !== undefined) {\n candidates.push(options.explicit);\n } else {\n candidates.push(siblingManifestPath(options.tracePath));\n if (options.sessionId !== undefined) {\n candidates.push(\n manifestPathFor(\n resolve(dirname(options.tracePath), options.captureDir),\n options.sessionId,\n ),\n manifestPathFor(\n resolve(options.projectDir, options.captureDir),\n options.sessionId,\n ),\n );\n }\n }\n\n for (const path of candidates) {\n const manifest = await readManifest(path);\n if (manifest === null) continue;\n const refusal = refuse(manifest, options.sessionId, explicit);\n if (refusal !== null) {\n options.onRefused?.(path, refusal);\n continue;\n }\n return { path, manifest };\n }\n return null;\n}\n\n/** Why this manifest cannot be trusted for this trace, or null if it can. */\nfunction refuse(\n manifest: SessionManifest,\n sessionId: string | undefined,\n explicit: boolean,\n): string | null {\n if (sessionId === undefined) {\n if (explicit) return null;\n return (\n `the trace records no session id, so a manifest found by convention ` +\n `cannot be verified as belonging to it (it records \"${manifest.sessionId}\"). ` +\n `Pass --manifest to use it anyway.`\n );\n }\n if (manifest.sessionId !== sessionId) {\n return `it was recorded for a different session (\"${manifest.sessionId}\", not \"${sessionId}\")`;\n }\n return null;\n}\n\n// ── Comparing ────────────────────────────────────────────────────\n\n/**\n * Compare the files one coverage row covers against what the manifest recorded.\n *\n * `actual` maps each covered file's project-relative POSIX path to its current\n * sha256. A row usually covers one file; project rules aggregate several, which\n * is why the outcome is decided over a set:\n *\n * - **any** recorded file whose digest differs → `mismatch`. One changed file\n * makes the row's instructions different, whatever the others say.\n * - **every** covered file recorded and equal → `match`.\n * - otherwise → `skipped`, naming what the manifest could not speak to. A\n * partial answer is not a clean one.\n */\nexport function checkContent(\n manifest: SessionManifest,\n actual: ReadonlyMap<string, string>,\n): ContentCheck {\n const recorded = new Map(manifest.artifacts.map((a) => [a.path, a.sha256]));\n const missing: string[] = [];\n let matched = 0;\n /**\n * The first agreeing pair, captured where both halves are in hand. `expected`\n * means \"what the manifest claimed\" in every branch, so it has to be read off\n * the manifest in every branch — going back to `actual` afterwards would\n * report the file twice, and on a match the two are equal, so nothing would\n * ever catch it.\n */\n let agreed: { expected: string; actual: string } | undefined;\n\n for (const [path, digest] of actual) {\n const expected = recorded.get(path);\n if (expected === undefined) {\n missing.push(path);\n continue;\n }\n if (expected !== digest) {\n return { status: \"mismatch\", expected, actual: digest };\n }\n agreed ??= { expected, actual: digest };\n matched += 1;\n }\n\n if (matched === 0) {\n return {\n status: \"skipped\",\n reason:\n actual.size === 0\n ? \"no file to compare\"\n : \"not recorded in the session manifest\",\n };\n }\n if (missing.length > 0) {\n return {\n status: \"skipped\",\n reason: `not recorded in the session manifest: ${missing.join(\", \")}`,\n };\n }\n // Digests only for a row covering one file: an aggregated project-rules row\n // has no single pair to report, and picking one of several would be a claim\n // about the row that is not true of it.\n return {\n status: \"match\",\n ...(actual.size === 1 && agreed !== undefined ? agreed : {}),\n };\n}\n\nexport * from \"./types.js\";\n","/**\n * The availability roster (ADR 01016): what a session was *offered*, whether or\n * not it used any of it.\n *\n * Claude Code records the roster in the transcript as structured `attachment`\n * records rather than as the prose the model reads, so it is recoverable\n * deterministically and **retroactively, on every session already on disk**:\n *\n * | `attachment.type` | Carries |\n * |---|---|\n * | `skill_listing` | `names`, `skillCount`, `isInitial`, and `content` — one `- name: description` line per skill |\n * | `agent_listing_delta` | `addedTypes`, `addedLines` (description plus tool grants), `removedTypes`, `isInitial` |\n * | `deferred_tools_delta` | `addedNames`, `removedNames`, `readdedNames`, and the MCP server state lists |\n *\n * Two properties of the real data drive the shape of this module, both\n * confirmed across the 606 `skill_listing` records in a 281-session store:\n *\n * 1. **`content` is the description source, `names` is the identity source.**\n * A plugin skill is named `plugin:skill`, so splitting a listing line on its\n * first colon truncates the name; every line is instead matched against the\n * `names` array (longest match wins). On that corpus the rule leaves zero\n * lines unjoined. Descriptions also wrap onto continuation lines, and the\n * listing text is capped near 30,000 characters — past the cap Claude Code\n * emits bare `- name` lines, so a description is genuinely optional.\n * 2. **Deltas are not idempotent.** `isInitial: true` replaces the set;\n * `isInitial: false` adds (and, for agents and tools, removes). Replay is\n * therefore ordered by record index, and per-index history is kept so a\n * consumer can ask what was available when a window opened rather than only\n * what was available at some point.\n */\nimport type {\n AvailabilityEntry,\n AvailabilityKind,\n McpServerStatus,\n TraceAvailability,\n} from \"./types.js\";\n\nexport function newAvailability(): TraceAvailability {\n return { recorded: false, skills: [], agents: [], tools: [], mcpServers: [] };\n}\n\n/** Entries whose interval covers `index`. */\nexport function availableAt(\n entries: readonly AvailabilityEntry[],\n index: number,\n): AvailabilityEntry[] {\n return entries.filter(\n (e) => e.offeredAt <= index && (e.withdrawnAt === undefined || index < e.withdrawnAt),\n );\n}\n\n/** Every distinct name that was offered at any point. */\nexport function offeredNames(entries: readonly AvailabilityEntry[]): Set<string> {\n return new Set(entries.map((e) => e.name));\n}\n\n/**\n * Join a listing's `content` lines onto its `names`.\n *\n * A line belongs to the longest name it starts with, so `plugin:skill` survives\n * intact; a line that starts no name is a continuation of the description above\n * it. Names with no line at all keep an absent description.\n */\nexport function joinDescriptions(\n content: string,\n names: readonly string[],\n): Map<string, string | undefined> {\n const byName = new Map<string, string | undefined>(\n names.map((name) => [name, undefined]),\n );\n let current: string | undefined;\n for (const raw of content.split(\"\\n\")) {\n const line = raw.trimEnd();\n if (line.startsWith(\"- \")) {\n const body = line.slice(2);\n let best: string | undefined;\n for (const name of names) {\n if (body !== name && !body.startsWith(`${name}:`)) continue;\n if (best === undefined || name.length > best.length) best = name;\n }\n // A `- ` line that names nothing on the roster is not a skill entry, so\n // it must not become the target for the lines that follow it either.\n current = best;\n if (best === undefined) continue;\n const rest = body.slice(best.length).replace(/^:\\s*/, \"\").trim();\n byName.set(best, rest.length > 0 ? rest : undefined);\n continue;\n }\n if (current === undefined) continue;\n const continued = line.trim();\n if (continued.length === 0) continue;\n const previous = byName.get(current);\n byName.set(current, previous ? `${previous}\\n${continued}` : continued);\n }\n return byName;\n}\n\n/** `- name: description` in one string, as the agent-listing deltas ship it. */\nfunction describedLines(\n names: readonly string[],\n lines: readonly string[],\n): Map<string, string | undefined> {\n const byName = new Map<string, string | undefined>();\n names.forEach((name, i) => {\n const line = lines[i];\n if (typeof line !== \"string\") {\n byName.set(name, undefined);\n return;\n }\n const body = line.startsWith(\"- \") ? line.slice(2) : line;\n const rest = body.startsWith(`${name}:`)\n ? body.slice(name.length + 1).trim()\n : body === name\n ? \"\"\n : body.trim();\n byName.set(name, rest.length > 0 ? rest : undefined);\n });\n return byName;\n}\n\nconst asStrings = (value: unknown): string[] =>\n Array.isArray(value) ? value.filter((v): v is string => typeof v === \"string\") : [];\n\n/** Mutable replay state: the open interval per name, per kind. */\nexport interface AvailabilityReplay {\n roster: TraceAvailability;\n open: Map<AvailabilityKind, Map<string, AvailabilityEntry>>;\n}\n\nexport function newReplay(): AvailabilityReplay {\n return {\n roster: newAvailability(),\n open: new Map<AvailabilityKind, Map<string, AvailabilityEntry>>([\n [\"skill\", new Map()],\n [\"agent\", new Map()],\n [\"tool\", new Map()],\n [\"mcp-server\", new Map()],\n ]),\n };\n}\n\nfunction listFor(\n roster: TraceAvailability,\n kind: AvailabilityKind,\n): AvailabilityEntry[] {\n if (kind === \"skill\") return roster.skills;\n if (kind === \"agent\") return roster.agents;\n if (kind === \"tool\") return roster.tools;\n return roster.mcpServers;\n}\n\nfunction offer(\n replay: AvailabilityReplay,\n kind: AvailabilityKind,\n name: string,\n index: number,\n description?: string,\n status?: McpServerStatus,\n): void {\n const open = replay.open.get(kind) as Map<string, AvailabilityEntry>;\n const existing = open.get(name);\n if (existing !== undefined) {\n // Already offered: keep the one interval and let a later listing fill in a\n // description the earlier, truncated one omitted.\n if (existing.description === undefined && description !== undefined) {\n existing.description = description;\n }\n if (status !== undefined) existing.status = status;\n return;\n }\n const entry: AvailabilityEntry = { kind, name, offeredAt: index };\n if (description !== undefined) entry.description = description;\n if (status !== undefined) entry.status = status;\n open.set(name, entry);\n listFor(replay.roster, kind).push(entry);\n}\n\nfunction withdraw(\n replay: AvailabilityReplay,\n kind: AvailabilityKind,\n name: string,\n index: number,\n): void {\n const open = replay.open.get(kind) as Map<string, AvailabilityEntry>;\n const entry = open.get(name);\n if (entry === undefined) return;\n entry.withdrawnAt = index;\n open.delete(name);\n}\n\n/** Names currently offered for a kind, in offer order. */\nfunction openNames(replay: AvailabilityReplay, kind: AvailabilityKind): string[] {\n return [...(replay.open.get(kind) as Map<string, AvailabilityEntry>).keys()];\n}\n\n/**\n * Fold one `attachment` payload into the roster. Anything unrecognised, or\n * shaped unexpectedly, is ignored rather than thrown: a listing record is\n * bookkeeping, and losing one must never cost the run its trace (ADR 01003).\n *\n * Returns true when the record was a listing record — which is what makes\n * `recorded` mean \"a roster was present\", as opposed to \"the roster was empty\".\n */\nexport function applyAvailabilityRecord(\n replay: AvailabilityReplay,\n attachment: unknown,\n index: number,\n): boolean {\n if (typeof attachment !== \"object\" || attachment === null) return false;\n const record = attachment as Record<string, unknown>;\n const type = record.type;\n\n if (type === \"skill_listing\") {\n const names = asStrings(record.names);\n const content = typeof record.content === \"string\" ? record.content : \"\";\n // A skill listing carries no removal member of its own: an initial listing\n // is the set, and a delta only adds.\n if (record.isInitial === true) {\n for (const name of openNames(replay, \"skill\")) {\n if (!names.includes(name)) withdraw(replay, \"skill\", name, index);\n }\n }\n const described = joinDescriptions(content, names);\n for (const name of names) {\n offer(replay, \"skill\", name, index, described.get(name));\n }\n return true;\n }\n\n if (type === \"agent_listing_delta\") {\n const added = asStrings(record.addedTypes);\n const lines = asStrings(record.addedLines);\n if (record.isInitial === true) {\n for (const name of openNames(replay, \"agent\")) {\n if (!added.includes(name)) withdraw(replay, \"agent\", name, index);\n }\n }\n const described = describedLines(added, lines);\n for (const name of added) {\n offer(replay, \"agent\", name, index, described.get(name));\n }\n for (const name of asStrings(record.removedTypes)) {\n withdraw(replay, \"agent\", name, index);\n }\n return true;\n }\n\n if (type === \"deferred_tools_delta\") {\n // Tool deltas carry no `isInitial` at all — verified across 431 records —\n // so they are purely additive/subtractive.\n for (const name of asStrings(record.removedNames)) {\n withdraw(replay, \"tool\", name, index);\n }\n // `addedLines` is the tool's own name again rather than a description, and\n // is sometimes empty while `addedNames` is not; there is no description to\n // recover for a tool.\n // `readdedNames` is the shape a re-offer actually takes: a tool that was\n // withdrawn and is offered again arrives there, not in `addedNames`.\n // Reading only `addedNames` left it withdrawn for the rest of the\n // session, so `availableAt` answered false for a tool the session could\n // still call.\n for (const name of [\n ...asStrings(record.addedNames),\n ...asStrings(record.readdedNames),\n ]) {\n offer(replay, \"tool\", name, index);\n }\n const servers: Array<[string, McpServerStatus]> = [\n ...asStrings(record.pendingMcpServers).map(\n (n): [string, McpServerStatus] => [n, \"pending\"],\n ),\n ...asStrings(record.needsAuthMcpServers).map(\n (n): [string, McpServerStatus] => [n, \"needs-auth\"],\n ),\n ...asStrings(record.failedMcpServers).map(\n (n): [string, McpServerStatus] => [n, \"failed\"],\n ),\n ];\n for (const [name, status] of servers) {\n offer(replay, \"mcp-server\", name, index, undefined, status);\n }\n return true;\n }\n\n return false;\n}\n\n/** Shift every ordinal through a remap, for the sidecar splice (ADR 01014). */\nexport function remapAvailability(\n roster: TraceAvailability,\n at: (index: number) => number,\n): TraceAvailability {\n const shift = (entries: AvailabilityEntry[]): AvailabilityEntry[] =>\n entries.map((entry) => ({\n ...entry,\n offeredAt: at(entry.offeredAt),\n ...(entry.withdrawnAt !== undefined\n ? { withdrawnAt: at(entry.withdrawnAt) }\n : {}),\n }));\n return {\n recorded: roster.recorded,\n skills: shift(roster.skills),\n agents: shift(roster.agents),\n tools: shift(roster.tools),\n mcpServers: shift(roster.mcpServers),\n };\n}\n\n/**\n * Fold a subagent branch's own roster into the session's.\n *\n * A subagent is offered its own roster — every sidecar transcript checked\n * carries `skill_listing` and `deferred_tools_delta` records of its own — and\n * that roster is a *different* set from the parent's. Replaying it as if it\n * were the main chain's would churn the parent's intervals, since a sidecar's\n * listing is `isInitial: true` and would withdraw everything the parent had.\n *\n * So only names the session never saw at all are added, tagged with the branch\n * that saw them and never withdrawn. That keeps the main chain's intervals\n * exact while making \"was this ever on the menu?\" — the question coverage asks\n * — answer correctly for a skill only a subagent was offered.\n */\nexport function foldBranchAvailability(\n roster: TraceAvailability,\n branch: TraceAvailability,\n branchId: string,\n spawnIndex: number,\n): void {\n if (!branch.recorded) return;\n roster.recorded = true;\n const merge = (into: AvailabilityEntry[], from: AvailabilityEntry[]): void => {\n const known = offeredNames(into);\n for (const entry of from) {\n if (known.has(entry.name)) continue;\n known.add(entry.name);\n into.push({\n ...entry,\n offeredAt: spawnIndex,\n branchId,\n ...(entry.withdrawnAt !== undefined ? { withdrawnAt: undefined } : {}),\n });\n }\n };\n merge(roster.skills, branch.skills);\n merge(roster.agents, branch.agents);\n merge(roster.tools, branch.tools);\n merge(roster.mcpServers, branch.mcpServers);\n}\n","/**\n * Offered versus used (ADR 01016).\n *\n * Artifact resolution starts from what the trace *used*, so a skill that should\n * have been invoked and was not resolves to nothing and is reported nowhere.\n * The availability roster closes that blind spot without a filesystem scan:\n * the evidence travels inside the trace, so it works on any machine and on\n * every session already recorded.\n *\n * Three states, never collapsed:\n *\n * - **offered and used** — the ordinary case.\n * - **offered and not used** — a judgement call for a person to make. Counted\n * by default and listed only on request, because a real roster runs to\n * hundreds of skills and would drown the report.\n * - **not offered** — the session referenced it but it was never on the menu.\n * That is a *configuration* bug, not an adherence failure, and it is the\n * state that is invisible today.\n *\n * This is an observation. It never becomes an eval outcome and never moves the\n * exit code.\n *\n * `discoverArtifacts` is deliberately not used here: it scans the project tree\n * for authoring, and the roster makes a scan unnecessary anyway.\n */\nimport { offeredNames } from \"../trace/availability.js\";\nimport type { Trace } from \"../trace/types.js\";\nimport type {\n AvailabilityCounts,\n AvailabilityReport,\n CoverageEntry,\n} from \"./types.js\";\n\nexport interface AvailabilityOptions {\n /** Include a coverage row per offered-but-unused artifact, not just a count. */\n listUnused?: boolean;\n}\n\nexport interface AvailabilityCoverage {\n report: AvailabilityReport;\n /** The rows handed in, annotated, plus the unused ones when listed. */\n coverage: CoverageEntry[];\n}\n\n/**\n * A fresh zero row per call. One shared object assigned to both `skills` and\n * `agents` would make a mutation of either silently move the other; every\n * caller is read-only today, which is exactly why it would go unnoticed.\n */\nconst empty = (): AvailabilityCounts => ({ offered: 0, used: 0, unused: 0 });\n\n/**\n * Kinds the roster says nothing about, so no row of theirs may carry a state.\n *\n * Project rules are never *offered* — they are in force from the first turn.\n * Slash commands have no listing record of any kind, so `not-offered` would be\n * a confident accusation drawn from evidence that was never collected — which\n * is precisely what a built-in command looked like before it had its own type\n * (ADR 01016's recorded limitation, closed by ADR 01023).\n */\nconst UNROSTERED = new Set<CoverageEntry[\"kind\"]>([\n \"project-rules\",\n \"slash-command\",\n]);\n\nexport function coverAvailability(\n trace: Trace,\n coverage: CoverageEntry[],\n options: AvailabilityOptions = {},\n): AvailabilityCoverage {\n const roster = trace.availability;\n if (!roster.recorded) {\n // No listing records: unknown, not zero. Every row says so rather than\n // implying the session was offered nothing.\n return {\n report: { recorded: false, skills: empty(), agents: empty(), listed: false },\n coverage: coverage.map((entry) =>\n UNROSTERED.has(entry.kind)\n ? entry\n : { ...entry, availability: \"unknown\" as const },\n ),\n };\n }\n\n const offeredSkills = offeredNames(roster.skills);\n const offeredAgents = offeredNames(roster.agents);\n const offeredFor = (kind: CoverageEntry[\"kind\"]): Set<string> =>\n kind === \"skill\" ? offeredSkills : offeredAgents;\n\n const usedSkills = new Set<string>();\n const usedAgents = new Set<string>();\n\n const annotated = coverage.map((entry) => {\n if (UNROSTERED.has(entry.kind)) return entry;\n const offered = offeredFor(entry.kind).has(entry.ref);\n if (offered) {\n (entry.kind === \"skill\" ? usedSkills : usedAgents).add(entry.ref);\n }\n return {\n ...entry,\n availability: offered ? (\"offered-and-used\" as const) : (\"not-offered\" as const),\n };\n });\n\n const listUnused = options.listUnused === true;\n const unusedRows: CoverageEntry[] = [];\n const collect = (kind: \"skill\" | \"agent\", used: Set<string>): number => {\n let unused = 0;\n // Ordered by first offer, and deduplicated: a name withdrawn and\n // re-offered is two intervals but one artifact.\n const seen = new Set<string>();\n for (const entry of kind === \"skill\" ? roster.skills : roster.agents) {\n if (seen.has(entry.name)) continue;\n seen.add(entry.name);\n if (used.has(entry.name)) continue;\n unused += 1;\n if (!listUnused) continue;\n unusedRows.push({\n ref: entry.name,\n kind,\n resolved: false,\n tried: [],\n note:\n entry.description === undefined\n ? \"offered, never used\"\n : `offered, never used — ${firstLine(entry.description)}`,\n availability: \"offered-not-used\",\n });\n }\n return unused;\n };\n\n const skillsUnused = collect(\"skill\", usedSkills);\n const agentsUnused = collect(\"agent\", usedAgents);\n\n return {\n report: {\n recorded: true,\n skills: {\n offered: offeredSkills.size,\n used: usedSkills.size,\n unused: skillsUnused,\n },\n agents: {\n offered: offeredAgents.size,\n used: usedAgents.size,\n unused: agentsUnused,\n },\n listed: listUnused,\n },\n coverage: [...annotated, ...unusedRows],\n };\n}\n\n/** Descriptions wrap over several lines; a table cell wants the first one. */\nfunction firstLine(description: string): string {\n const line = description.split(\"\\n\")[0] ?? \"\";\n return line.length > 160 ? `${line.slice(0, 157)}...` : line;\n}\n","/**\n * Filesystem helpers shared by trace-driven artifact resolution and static\n * artifact discovery. Every function degrades to null/empty rather than\n * throwing: a missing or unreadable path is a coverage note, never a crash.\n */\nimport { access, readdir, readFile, stat } from \"node:fs/promises\";\nimport { dirname, join, resolve, sep } from \"node:path\";\n\n/**\n * Directory names never worth walking. `.git` alone can hold more entries than\n * the rest of a repo combined, and `node_modules` hides vendored skills that\n * are not the project's to edit.\n */\n/**\n * Path split into segments with separators normalised, so convention\n * matching (\"is this under `.claude/commands/`?\") agrees between\n * trace-driven resolution and static discovery. Both had their own\n * byte-identical copy; a drift between them would classify one file two\n * ways in `run` and `fill`.\n */\nexport function segments(path: string): string[] {\n return path.split(sep).join(\"/\").split(\"/\");\n}\n\nexport const PRUNED_DIRS = new Set([\n \"node_modules\",\n \".git\",\n \"dist\",\n \"build\",\n \"coverage\",\n \".manni\",\n \".tmp\",\n \".next\",\n \".venv\",\n]);\n\n/** Nearest ancestor containing `.git` (a directory *or* a worktree file). */\nexport async function findGitRoot(start: string): Promise<string | null> {\n let current = resolve(start);\n for (let depth = 0; depth < 64; depth += 1) {\n try {\n await access(join(current, \".git\"));\n return current;\n } catch {\n // keep walking\n }\n const parent = dirname(current);\n if (parent === current) return null;\n current = parent;\n }\n return null;\n}\n\nexport async function safeRead(path: string): Promise<string | null> {\n try {\n return await readFile(path, \"utf-8\");\n } catch {\n return null;\n }\n}\n\n/**\n * Last-modified time of `path` as an ISO-8601 string, or null when it cannot\n * be read. Used for the staleness heuristic (ADR 01021); like everything else\n * here it degrades rather than throwing — an artifact whose mtime is\n * unreadable is simply one the report says nothing about.\n */\nexport async function safeMtime(path: string): Promise<string | null> {\n try {\n const info = await stat(path);\n return info.mtime.toISOString();\n } catch {\n return null;\n }\n}\n\n/** First file under `root` matching `match`, or null. */\nexport async function findInTree(\n root: string,\n match: (path: string) => boolean,\n): Promise<string | null> {\n let entries;\n try {\n entries = await readdir(root, { withFileTypes: true, recursive: true });\n } catch {\n return null;\n }\n for (const entry of entries) {\n if (!entry.isFile()) continue;\n const full = join(entry.parentPath, entry.name);\n if (match(full)) return full;\n }\n return null;\n}\n\nexport interface ListOptions {\n /** Directory names to skip; defaults to PRUNED_DIRS. */\n prune?: Set<string>;\n maxDepth?: number;\n}\n\n/**\n * Every file under `root` matching `match`, sorted for stable output.\n *\n * Hand-rolled rather than `readdir({recursive:true})` because pruning has to\n * happen *during* the walk — a recursive readdir would enumerate all of\n * `node_modules` before we could filter it. Symlinked directories report\n * `isDirectory() === false`, so loops are not followed.\n */\nexport async function listInTree(\n root: string,\n match: (path: string) => boolean,\n options: ListOptions = {},\n): Promise<string[]> {\n const prune = options.prune ?? PRUNED_DIRS;\n const maxDepth = options.maxDepth ?? 24;\n const found: string[] = [];\n\n async function walk(dir: string, depth: number): Promise<void> {\n if (depth > maxDepth) return;\n let entries;\n try {\n entries = await readdir(dir, { withFileTypes: true });\n } catch {\n return; // unreadable directory is a skip, not a failure\n }\n for (const entry of entries) {\n const full = join(dir, entry.name);\n if (entry.isDirectory()) {\n if (prune.has(entry.name)) continue;\n await walk(full, depth + 1);\n } else if (entry.isFile() && match(full)) {\n found.push(full);\n }\n }\n }\n\n await walk(resolve(root), 0);\n return found.sort();\n}\n","/**\n * Deterministic artifact resolution: map every skill/agent/project-rule\n * reference in a trace to a file on disk. Trace content + filesystem lookup\n * only — no LLM guessing. Unresolved refs degrade to coverage entries and\n * warnings, never a crash (ADR 01003).\n */\nimport { basename, dirname, join, resolve } from \"node:path\";\nimport { configDir } from \"../trace/discover.js\";\nimport { coverAvailability } from \"./availability.js\";\nimport { findGitRoot, findInTree, safeMtime, safeRead, segments } from \"./fs.js\";\nimport { checkContent, hashFile, relPosix } from \"../capture/manifest.js\";\nimport type { SessionManifest } from \"../capture/types.js\";\nimport type { Trace } from \"../trace/types.js\";\nimport type {\n CoverageEntry,\n ResolvedArtifact,\n ResolvedArtifacts,\n} from \"./types.js\";\n\nexport interface ResolveOptions {\n /** Overrides the trace's recorded cwd (for deleted workspaces). */\n projectDir?: string;\n /** Ceiling for the parent-directory walk; defaults to the git root. */\n projectRoot?: string;\n env?: Record<string, string | undefined>;\n /**\n * List every offered-but-unused artifact in the coverage table rather than\n * only counting them (ADR 01016). Off by default: a real roster runs to\n * hundreds of skills.\n */\n reportUnusedArtifacts?: boolean;\n /**\n * The session manifest for this trace, when one was found (ADR 01024). It\n * makes staleness exact for the artifacts it recorded and changes nothing\n * else — no eval outcome, no exit code, no resolution decision.\n */\n manifest?: SessionManifest;\n}\n\n/**\n * Project-rules filenames, in the order they are checked. Different agent\n * tools use different names for the same artifact; all are read the same way.\n */\nexport const PROJECT_RULES_FILENAMES = [\n \"CLAUDE.md\",\n \"AGENTS.md\",\n \"GEMINI.md\",\n] as const;\n\n/** Agents that ship with Claude Code and have no definition file on disk. */\nconst BUILTIN_AGENTS = new Set([\n \"general-purpose\",\n \"claude\",\n \"Explore\",\n \"Plan\",\n \"statusline-setup\",\n \"fork\",\n]);\n\nexport async function resolveArtifacts(\n trace: Trace,\n options: ResolveOptions = {},\n): Promise<ResolvedArtifacts> {\n const projectDir = resolve(options.projectDir ?? trace.cwd);\n const userDir = configDir(options.env);\n const projectRoot = resolve(\n options.projectRoot ?? (await findGitRoot(projectDir)) ?? projectDir,\n );\n\n const artifacts: ResolvedArtifact[] = [];\n const coverage: CoverageEntry[] = [];\n const warnings: string[] = [];\n const seenPaths = new Set<string>();\n const seenRefs = new Set<string>();\n\n const add = (artifact: ResolvedArtifact): void => {\n if (seenPaths.has(artifact.path)) return;\n seenPaths.add(artifact.path);\n artifacts.push(artifact);\n };\n\n /** Record a resolved skill once, however many refs reached it. */\n const addSkill = (\n name: string,\n artifact: ResolvedArtifact,\n tried: string[],\n ): void => {\n const refKey = `skill:${name}`;\n if (seenRefs.has(refKey)) return;\n seenRefs.add(refKey);\n add(artifact);\n coverage.push({\n ref: name,\n kind: \"skill\",\n resolved: true,\n path: artifact.path,\n tried,\n });\n };\n\n for (const invocation of trace.skillInvocations) {\n // A `<command-name>` injection is the slash-command mechanism, and a slash\n // command is one of three things: a `.claude/commands/*.md` file, a skill\n // surfaced under its slash form, or a built-in with no file anywhere. Only\n // the filesystem can say which, so the shape of the reference decides\n // nothing on its own (ADR 01023).\n if (invocation.via === \"command-injection\") {\n const refKey = `command:${invocation.name}`;\n if (seenRefs.has(refKey)) continue;\n seenRefs.add(refKey);\n\n const command = await resolveSlashCommand(\n invocation.name,\n projectDir,\n userDir,\n );\n if (command.artifact) {\n add(command.artifact);\n coverage.push({\n ref: invocation.name,\n kind: \"slash-command\",\n resolved: true,\n path: command.artifact.path,\n tried: command.tried,\n });\n continue;\n }\n\n const skill = await resolveSkill(invocation.name, projectDir, userDir);\n if (skill.artifact) {\n addSkill(invocation.name, skill.artifact, skill.tried);\n // Resolved as a skill, so the slash-command lookup below must not\n // also record it — one reference yields one coverage row.\n continue;\n }\n\n // No definition file in any place a command or a skill could live. Claude\n // Code's own commands (`/model`, `/compact`) have no file by design, so\n // this is reported rather than warned about — and reported as what it is\n // rather than as a skill that went missing, which is the defect ADR 01016\n // recorded. A hard-coded list of built-in names was rejected: it would go\n // stale with every Claude Code release.\n coverage.push({\n ref: invocation.name,\n kind: \"slash-command\",\n resolved: false,\n tried: [...command.tried, ...skill.tried],\n note: \"built-in slash command, or not installed here (no definition file)\",\n });\n continue;\n }\n\n // A `Skill` tool call is unambiguous: it names a skill.\n const refKey = `skill:${invocation.name}`;\n if (seenRefs.has(refKey)) continue;\n const { artifact, tried } = await resolveSkill(\n invocation.name,\n projectDir,\n userDir,\n );\n if (artifact) {\n addSkill(invocation.name, artifact, tried);\n } else {\n seenRefs.add(refKey);\n coverage.push({ ref: invocation.name, kind: \"skill\", resolved: false, tried });\n warnings.push(\n `skill \"${invocation.name}\" was invoked but no SKILL.md was found (${tried.length} location(s) tried)`,\n );\n }\n }\n\n for (const spawn of trace.agentSpawns) {\n const refKey = `agent:${spawn.subagentType}`;\n if (seenRefs.has(refKey)) continue;\n seenRefs.add(refKey);\n if (BUILTIN_AGENTS.has(spawn.subagentType)) {\n coverage.push({\n ref: spawn.subagentType,\n kind: \"agent\",\n resolved: false,\n tried: [],\n note: \"built-in agent (no definition file)\",\n });\n continue;\n }\n const { artifact, tried } = await resolveAgent(\n spawn.subagentType,\n projectDir,\n userDir,\n );\n if (artifact) {\n add(artifact);\n coverage.push({\n ref: spawn.subagentType,\n kind: \"agent\",\n resolved: true,\n path: artifact.path,\n tried,\n });\n } else {\n coverage.push({\n ref: spawn.subagentType,\n kind: \"agent\",\n resolved: false,\n tried,\n });\n warnings.push(\n `agent \"${spawn.subagentType}\" was spawned but no definition file was found (${tried.length} location(s) tried)`,\n );\n }\n }\n\n const rules = await resolveProjectRules(projectDir, projectRoot);\n for (const rule of rules.artifacts) add(rule);\n const rulesEntry: CoverageEntry = {\n ref: \"project rules\",\n kind: \"project-rules\",\n resolved: rules.artifacts.length > 0,\n tried: rules.tried,\n ...(rules.artifacts.length === 0\n ? { note: \"no CLAUDE.md or AGENTS.md found\" }\n : {}),\n };\n coverage.push(rulesEntry);\n\n // One aggregated entry covers several files, so it has no single `path` to\n // stat; name them explicitly. Every other entry stats the file it resolved to.\n //\n // Before the roster pass, not after: staleness only has something to say\n // about rows that resolved to a file, and the roster's own offered-but-unused\n // rows never do. Annotating first also keeps these flags on the entries the\n // roster copies forward.\n await annotateStaleness(\n trace,\n coverage,\n new Map([[rulesEntry, rules.artifacts.map((a) => a.path)]]),\n warnings,\n projectRoot,\n projectDir,\n options.manifest,\n );\n\n // What the session was *offered* is the other half of coverage: resolution\n // only ever sees what it used (ADR 01016).\n const availability = coverAvailability(trace, coverage, {\n ...(options.reportUnusedArtifacts !== undefined\n ? { listUnused: options.reportUnusedArtifacts }\n : {}),\n });\n\n return {\n artifacts,\n coverage: availability.coverage,\n availability: availability.report,\n warnings,\n };\n}\n\n// ── Staleness ────────────────────────────────────────────────────\n\n/**\n * Say, for every resolved artifact, whether it is still the one the session\n * followed. Evals are read from the artifact *as it is now* while the session\n * followed it *as it was then*, so editing a SKILL.md after a session grades\n * that session against instructions it never saw.\n *\n * Two sources of evidence, and the better one wins **only on its own question**:\n *\n * - **A session manifest** (ADR 01024) recorded a sha256 per artifact when the\n * session started. A digest that differs is an exact \"this changed\"; a digest\n * that matches is an exact \"this did not\". Either one settles the row.\n * - **mtime** (ADR 01021) is the fallback, and a soft one: it is not content\n * identity, a fresh clone rewrites every mtime, and an unreadable mtime says\n * nothing.\n *\n * A manifest may therefore quiet the mtime warning for an artifact it covers —\n * that is the entire point, since a checkout otherwise flags everything in CI —\n * and it may do nothing else. It never reaches an eval outcome, never moves the\n * exit code, and it cannot silence a row it has no entry for. The observation\n * itself (`modifiedAt`) is reported either way, so nothing is hidden; only the\n * conclusion drawn from it changes.\n */\nasync function annotateStaleness(\n trace: Trace,\n coverage: CoverageEntry[],\n extraPaths: Map<CoverageEntry, string[]>,\n warnings: string[],\n projectRoot: string,\n projectDir: string,\n manifest?: SessionManifest,\n): Promise<void> {\n // No session end means no ground for the *heuristic* to stand on, and\n // guessing one would manufacture a warning out of no evidence. A manifest\n // supplies its own ground, so it still has something to say here.\n const endedAt =\n trace.endedAt !== undefined ? Date.parse(trace.endedAt) : Number.NaN;\n const haveEnd = Number.isFinite(endedAt);\n if (!haveEnd && manifest === undefined) return;\n\n const base =\n manifest === undefined\n ? projectRoot\n : joinBase(manifest, coverage, extraPaths, [\n projectDir,\n projectRoot,\n manifest.root,\n ]);\n\n /** Refs still resting on the mtime guess. */\n const guessed: string[] = [];\n /** Refs the manifest proved changed. */\n const changed: string[] = [];\n /** Whether the manifest spoke to any row at all. */\n let joined = false;\n\n for (const entry of coverage) {\n if (!entry.resolved) continue;\n const paths = extraPaths.get(entry) ?? (entry.path ? [entry.path] : []);\n if (paths.length === 0) continue;\n\n let newest: string | undefined;\n let outside = false;\n const digests = new Map<string, string>();\n for (const path of paths) {\n const mtime = await safeMtime(path);\n if (mtime !== null && (newest === undefined || mtime > newest)) {\n newest = mtime;\n }\n if (manifest === undefined) continue;\n // Keyed on the path relative to the base **both sides agree on**, so the\n // manifest still joins after the repository has been checked out\n // somewhere else. An artifact outside that base — a user-level or plugin\n // skill — has no relative path, and `capture` is project-scoped, so it\n // was never recordable in the first place. That is a different sentence\n // from \"it changed\" and gets one.\n const rel = relPosix(base, path);\n if (rel === null) {\n outside = true;\n continue;\n }\n const digest = await hashFile(path);\n if (digest !== null) digests.set(rel, digest);\n }\n if (newest !== undefined) entry.modifiedAt = newest;\n\n const check =\n manifest === undefined\n ? ({\n status: \"skipped\",\n reason: \"no session manifest for this trace\",\n } as const)\n : outside && digests.size === 0\n ? ({\n status: \"skipped\",\n reason:\n \"outside the project root, so no session manifest could record it\",\n } as const)\n : checkContent(manifest, digests);\n entry.contentCheck = check;\n if (check.status !== \"skipped\") joined = true;\n\n if (check.status === \"mismatch\") {\n entry.stale = true;\n changed.push(entry.ref);\n continue;\n }\n if (check.status === \"match\") {\n // Exact, and it answers mtime's own question — so the guess does not run.\n entry.stale = false;\n continue;\n }\n if (!haveEnd || newest === undefined) continue;\n entry.stale = Date.parse(newest) > endedAt;\n if (entry.stale) guessed.push(entry.ref);\n }\n\n if (changed.length > 0) {\n warnings.push(\n `${changed.length} artifact(s) changed since the session started ` +\n `(${changed.join(\", \")}) — the session manifest recorded a different ` +\n `sha256, so their evals are not the instructions this session followed.`,\n );\n }\n if (guessed.length > 0) {\n // One warning, not one per artifact: a fresh checkout flags everything, and\n // a wall of identical lines is how a real signal gets tuned out.\n warnings.push(\n `${guessed.length} artifact(s) were modified after the session ended ` +\n `(${guessed.join(\", \")}) — their evals may not be the instructions ` +\n `this session followed. mtime is a heuristic, not content identity.`,\n );\n }\n // A manifest that speaks to nothing is a different problem from a manifest\n // with a gap in it, and it degrades row by row into the same sentence — the\n // one an absent manifest produces. Say it once, at the top.\n //\n // Only when it recorded something: a manifest with no artifacts in it — a\n // project whose instruction files all live outside the capture scope — has\n // nothing to match, which is not a join failure.\n if (manifest !== undefined && manifest.artifacts.length > 0 && !joined) {\n warnings.push(\n `the session manifest matched no artifact in this run — it recorded ` +\n `${manifest.artifacts.length} artifact(s) relative to \"${manifest.root}\", ` +\n `and nothing resolved here lines up with them, so every hash check ` +\n `fell back to the mtime heuristic. Check that --project names the ` +\n `directory the session ran in.`,\n );\n }\n}\n\n/**\n * Pick the base to key the manifest join on.\n *\n * `capture` writes each path relative to *its* project root — the session's\n * cwd — while resolution keys on the git root when `--project` is absent. In a\n * monorepo those are different directories, so one file gets two different\n * relative paths and every hash check silently degraded to `skipped`: exactly\n * the guesswork a manifest exists to remove, and quietly, row by row.\n *\n * Rather than pick a side, ask the data. Each candidate base is scored by how\n * many resolved artifacts it turns into a path the manifest actually recorded,\n * and the best score wins — with candidate order as the tiebreak, so a tie\n * keeps today's behaviour. `manifest.root` joins the candidates because it is\n * the capturing machine's own answer; it may have been redacted, or the\n * repository may have moved since, in which case it simply scores zero.\n */\nfunction joinBase(\n manifest: SessionManifest,\n coverage: CoverageEntry[],\n extraPaths: Map<CoverageEntry, string[]>,\n candidates: string[],\n): string {\n const recorded = new Set(manifest.artifacts.map((a) => a.path));\n const paths = coverage\n .filter((entry) => entry.resolved)\n .flatMap((entry) => extraPaths.get(entry) ?? (entry.path ? [entry.path] : []));\n\n let best = candidates[0] as string;\n let bestScore = -1;\n for (const candidate of candidates) {\n if (typeof candidate !== \"string\" || candidate.length === 0) continue;\n let score = 0;\n for (const path of paths) {\n let rel: string | null;\n try {\n rel = relPosix(candidate, path);\n } catch {\n // A redacted `root` can be anything, including something `resolve`\n // refuses. A candidate that cannot be used simply does not win.\n continue;\n }\n if (rel !== null && recorded.has(rel)) score += 1;\n }\n if (score > bestScore) {\n best = candidate;\n bestScore = score;\n }\n }\n return best;\n}\n\n// ── Skills ───────────────────────────────────────────────────────\n\nasync function resolveSkill(\n name: string,\n projectDir: string,\n userDir: string,\n): Promise<{ artifact: ResolvedArtifact | null; tried: string[] }> {\n const tried: string[] = [];\n // `plugin:skill` refs look up the skill by its short name inside the\n // user plugin store; plain refs check project dirs then the user store.\n const [pluginName, shortName] = splitPluginRef(name);\n\n const candidates: Array<{ path: string; origin: ResolvedArtifact[\"origin\"] }> =\n [];\n if (pluginName === null) {\n for (const dir of [\"skills\", join(\"src\", \"skills\"), join(\".claude\", \"skills\")]) {\n candidates.push({\n path: join(projectDir, dir, shortName, \"SKILL.md\"),\n origin: \"project\",\n });\n }\n candidates.push({\n path: join(userDir, \"skills\", shortName, \"SKILL.md\"),\n origin: \"user\",\n });\n }\n\n for (const candidate of candidates) {\n tried.push(candidate.path);\n const content = await safeRead(candidate.path);\n if (content !== null) {\n return {\n artifact: {\n name,\n type: \"skill\",\n path: candidate.path,\n content,\n origin: candidate.origin,\n },\n tried,\n };\n }\n }\n\n // Plugin store: ~/.claude/plugins/**/skills/<shortName>/SKILL.md. The store\n // layout varies (marketplace caches nest deeper), so search recursively.\n const pluginRoot = join(userDir, \"plugins\");\n tried.push(join(pluginRoot, \"**\", \"skills\", shortName, \"SKILL.md\"));\n const found = await findInTree(\n pluginRoot,\n (path) =>\n basename(path) === \"SKILL.md\" &&\n basename(dirname(path)) === shortName &&\n (pluginName === null || hasPathSegment(path, pluginName)),\n );\n if (found) {\n const content = await safeRead(found);\n if (content !== null) {\n return {\n artifact: { name, type: \"skill\", path: found, content, origin: \"plugin\" },\n tried,\n };\n }\n }\n\n return { artifact: null, tried };\n}\n\n// ── Slash commands ───────────────────────────────────────────────\n\n/**\n * `.claude/commands/<name>.md`, in the three places Claude Code reads them:\n * the project, the user's config directory, and the plugin store.\n *\n * Two shapes matter and neither is guessed at. Subdirectories under\n * `commands/` **organize** rather than namespace — `commands/release/tag.md`\n * is still invoked as `/tag` — so a plain name falls back to a recursive\n * search after the direct hit misses. A `plugin:command` name is plugin\n * namespacing and is looked up in the store by its short name, exactly as\n * `resolveSkill` does for `plugin:skill`; project and user directories are not\n * checked, because a namespace is not something a local file can claim.\n */\nasync function resolveSlashCommand(\n name: string,\n projectDir: string,\n userDir: string,\n): Promise<{ artifact: ResolvedArtifact | null; tried: string[] }> {\n const tried: string[] = [];\n const [pluginName, shortName] = splitPluginRef(name);\n\n const made = (\n path: string,\n content: string,\n origin: ResolvedArtifact[\"origin\"],\n ): { artifact: ResolvedArtifact; tried: string[] } => ({\n artifact: { name, type: \"slash-command\", path, content, origin },\n tried,\n });\n\n if (pluginName === null) {\n const dirs: Array<{ dir: string; origin: ResolvedArtifact[\"origin\"] }> = [\n { dir: join(projectDir, \".claude\", \"commands\"), origin: \"project\" },\n { dir: join(userDir, \"commands\"), origin: \"user\" },\n ];\n for (const { dir, origin } of dirs) {\n const path = join(dir, `${shortName}.md`);\n tried.push(path);\n const content = await safeRead(path);\n if (content !== null) return made(path, content, origin);\n }\n for (const { dir, origin } of dirs) {\n tried.push(join(dir, \"**\", `${shortName}.md`));\n const found = await findInTree(\n dir,\n (path) => basename(path) === `${shortName}.md`,\n );\n if (found === null) continue;\n const content = await safeRead(found);\n if (content !== null) return made(found, content, origin);\n }\n return { artifact: null, tried };\n }\n\n const pluginRoot = join(userDir, \"plugins\");\n tried.push(join(pluginRoot, \"**\", \"commands\", `${shortName}.md`));\n const found = await findInTree(\n pluginRoot,\n (path) =>\n basename(path) === `${shortName}.md` &&\n segments(path).includes(\"commands\") &&\n hasPathSegment(path, pluginName),\n );\n if (found !== null) {\n const content = await safeRead(found);\n if (content !== null) return made(found, content, \"plugin\");\n }\n return { artifact: null, tried };\n}\n\n/** Path segments, separator-normalized, for convention matching. */\n/**\n * Split `plugin:name` into its two halves.\n *\n * On the **first** colon, keeping the remainder: `split(\":\", 2)` throws away\n * everything past the second field, so `myplugin:release:tag` resolved as a\n * lookup for `release` — a different artifact, reported as if it were the one\n * asked for. The namespace is the part before the first colon; everything\n * after it is the name, whatever it contains.\n */\nfunction splitPluginRef(name: string): [string | null, string] {\n const at = name.indexOf(\":\");\n if (at === -1) return [null, name];\n return [name.slice(0, at), name.slice(at + 1)];\n}\n\n/**\n * True when `pluginName` is a *segment* of `path`.\n *\n * `path.includes(pluginName)` was unanchored over the whole absolute path, so\n * a plugin named `docs` matched `~/.claude/plugins/other-plugin/commands/\n * docs-helper/x.md` — and, on Windows, matched every path under a home\n * directory of `C:\\Users\\docs\\`. A plugin is a directory, so the test is\n * whether the path passes through a directory of that name.\n */\nfunction hasPathSegment(path: string, pluginName: string): boolean {\n return segments(path).includes(pluginName);\n}\n\n// ── Agents ───────────────────────────────────────────────────────\n\nasync function resolveAgent(\n subagentType: string,\n projectDir: string,\n userDir: string,\n): Promise<{ artifact: ResolvedArtifact | null; tried: string[] }> {\n const tried: string[] = [];\n // Plugin agents are referenced as `plugin:agent`; the file is the short name.\n const shortName = splitPluginRef(subagentType)[1];\n\n const candidates: Array<{ path: string; origin: ResolvedArtifact[\"origin\"] }> = [\n { path: join(projectDir, \".claude\", \"agents\", `${shortName}.md`), origin: \"project\" },\n { path: join(projectDir, \"agents\", `${shortName}.md`), origin: \"project\" },\n { path: join(userDir, \"agents\", `${shortName}.md`), origin: \"user\" },\n ];\n\n for (const candidate of candidates) {\n tried.push(candidate.path);\n const content = await safeRead(candidate.path);\n if (content !== null) {\n return {\n artifact: {\n name: subagentType,\n type: \"agent\",\n path: candidate.path,\n content,\n origin: candidate.origin,\n },\n tried,\n };\n }\n }\n return { artifact: null, tried };\n}\n\n// ── Project rules ────────────────────────────────────────────────\n\nasync function resolveProjectRules(\n projectDir: string,\n projectRoot: string,\n): Promise<{ artifacts: ResolvedArtifact[]; tried: string[] }> {\n const artifacts: ResolvedArtifact[] = [];\n const tried: string[] = [];\n\n // Walk from the cwd up to the project root (inclusive), then check .claude/.\n const dirs: string[] = [];\n let current = projectDir;\n for (let depth = 0; depth < 32; depth += 1) {\n dirs.push(current);\n if (current === projectRoot) break;\n const parent = dirname(current);\n if (parent === current) break;\n current = parent;\n }\n dirs.push(join(projectRoot, \".claude\"));\n\n for (const dir of dirs) {\n for (const filename of PROJECT_RULES_FILENAMES) {\n const path = join(dir, filename);\n tried.push(path);\n const content = await safeRead(path);\n if (content !== null) {\n artifacts.push({\n name: filename,\n type: \"project-rules\",\n path,\n content,\n origin: \"project\",\n });\n }\n }\n }\n return { artifacts, tried };\n}\n\n// Filesystem helpers live in ./fs.js, shared with static discovery.\n","/**\n * The artifact vocabulary `manni tracevals` implements:\n * `manni:artifact-evals:1.1.0`, the built-in the metadata tool registers\n * under `src/meta/schemas/` (proposal 0076). Artifacts are validated against\n * that schema itself, imported and bundled into the build, so tracevals and\n * `manni meta validate` read the same bytes and the built CLI never reads a\n * `schemas/` directory at runtime.\n *\n * 1.1.0 rather than 1.0.0 because it names `tool-order`, a grader this tool\n * ships. The open vocabulary accepts any kebab grader name at either version.\n *\n * tracevals ships no copy of the schema. A copy is a second artifact to keep\n * in step, and the two it used to publish had drifted: they kept\n * `eval-provenance` and the `info` severity after 0046 removed both. A\n * consumer who wants to validate artifacts names `manni:artifact-evals:1.1.0`\n * to `manni meta validate`, or validates against the object below.\n *\n * The validator is this tool's own Ajv rather than meta's `Validator`, which\n * takes refs it can load rather than a schema object. Violations are converted\n * to `FieldError` here so everything downstream — the planner, the reporters —\n * sees the one finding shape the family reports.\n */\nimport { Ajv2020 } from \"ajv/dist/2020.js\";\nimport type { DefinedError, ErrorObject } from \"ajv\";\nimport type { FieldError } from \"../../meta/index.js\";\nimport schema from \"../../meta/schemas/artifact-evals/1.1.0.json\" with { type: \"json\" };\n\n/** The artifact-evals vocabulary, for validators that accept an inline schema. */\nexport const artifactEvalsSchema = schema as unknown as Record<string, unknown>;\n\n/** The vocabulary's `$id`: `manni:artifact-evals:1.1.0`. */\nexport const ARTIFACT_EVALS_SCHEMA_ID: string = schema.$id;\n\nconst ajv = new Ajv2020({ allErrors: true, allowUnionTypes: true });\n// The vocabulary marks `metadata` `x-manni-location: external` (0047). The\n// mark is an annotation for `manni meta relocate`, not a constraint, so it is\n// registered rather than validated — but it has to be registered, or Ajv's\n// strict mode refuses to compile the schema at all.\najv.addKeyword({ keyword: \"x-manni-location\" });\nconst validateArtifact = ajv.compile(artifactEvalsSchema);\n\n/**\n * The stable identifier inside a violation, when its keyword names a *thing*.\n * Keywords whose parameter is a schema-authored value (`pattern`'s regex,\n * `enum`'s list) are deliberately left without one: including those would\n * change a finding's identity every time the schema author edited the rule.\n */\nfunction subjectOf(e: DefinedError): string | undefined {\n switch (e.keyword) {\n case \"required\":\n return e.params.missingProperty;\n case \"additionalProperties\":\n return e.params.additionalProperty;\n case \"format\":\n return e.params.format;\n case \"type\":\n return e.params.type;\n default:\n return undefined;\n }\n}\n\n/**\n * Validate an artifact's whole front matter against the vocabulary. The schema is\n * document-rooted — `metadata` stays open so other tools' members pass\n * untouched — which is why it is handed the entire object rather than the\n * `evals` value alone.\n */\nexport function artifactEvalsErrors(\n data: Record<string, unknown>,\n lineFor: (pointer: string) => number | undefined,\n): FieldError[] {\n if (validateArtifact(data)) return [];\n const errors: FieldError[] = [];\n for (const raw of validateArtifact.errors ?? []) {\n errors.push(toFieldError(raw, lineFor));\n }\n return errors;\n}\n\nfunction toFieldError(\n e: ErrorObject,\n lineFor: (pointer: string) => number | undefined,\n): FieldError {\n const subject = subjectOf(e as DefinedError);\n // `required` and `additionalProperties` point `instancePath` at the *parent*\n // and name the property in the message, so the property is spelled out\n // rather than left to the reader to find.\n const message =\n subject !== undefined && (e.keyword === \"required\" || e.keyword === \"additionalProperties\")\n ? `${e.message ?? \"is invalid\"} (\"${subject}\")`\n : (e.message ?? \"is invalid\");\n const line = lineFor(e.instancePath);\n return {\n schema: ARTIFACT_EVALS_SCHEMA_ID,\n instancePath: e.instancePath,\n message,\n keyword: e.keyword,\n ...(subject !== undefined ? { subject } : {}),\n ...(line !== undefined ? { line } : {}),\n };\n}\n","/**\n * Eval extraction: read the `metadata.evals` block from an artifact via the\n * metadata library and validate the artifact's whole front matter against\n * `manni:artifact-evals:1.1.0`. Invalid blocks are reported as errors with\n * source line numbers, never silently ignored (ADR 01002).\n *\n * The vocabulary is the metadata tool's registered built-in; this tool\n * implements behavior against it (ADR 01010) and bundles it rather than\n * shipping a copy — see `schema.ts`. The schema is document-rooted, which is\n * why validation is handed the entire front matter object rather than the\n * `evals` value alone.\n */\nimport {\n extractFrontmatter,\n type ExtractedMetadata,\n type FieldError,\n} from \"../../meta/index.js\";\nimport { metaProvenanceEntries } from \"../../meta/internal.js\";\nimport type { ResolvedArtifact } from \"../artifacts/types.js\";\nimport type { TraceTarget } from \"../core/target.js\";\nimport { ARTIFACT_EVALS_SCHEMA_ID, artifactEvalsErrors } from \"./schema.js\";\n\nexport { ARTIFACT_EVALS_SCHEMA_ID };\n\n/**\n * The family scale (`src/shared/severity.ts`): `notice | warning | error`.\n * proposal.2 spelled the quietest level `info`; proposal.4 spells it the way\n * every other manni tool does, so a finding reads the same everywhere.\n */\nexport type { Severity } from \"../../shared/severity.js\";\nimport type { Severity } from \"../../shared/severity.js\";\n\n/**\n * `capability` probes a boundary and is expected to fail sometimes;\n * `regression` protects behavior that already works. Reported, not enforced.\n */\nexport type EvalType = \"capability\" | \"regression\";\n\nexport interface EvalEntry {\n /** Stable identifier. Required by the schema on object entries. */\n id: string;\n /** Absent on graders whose options say everything. */\n assertion?: string;\n type: EvalType;\n /** \"ai\", \"human\", \"command\", or a deterministic grader kind. */\n grader: string;\n /** Overrides the configured judge provider for this eval only. */\n provider?: string;\n /** Overrides the judge model for this eval only; a CLI --model still wins. */\n model?: string;\n /** Ensemble runs for this eval only; a CLI --runs still wins. */\n runs?: number;\n /** Which bytes the grader receives. Absent means the whole transcript. */\n target?: TraceTarget;\n /** Relative contribution to the run's pass rate. Never changes the outcome. */\n weight?: number;\n options?: Record<string, unknown>;\n severity: Severity;\n evidence?: string;\n examples?: { pass?: string[]; fail?: string[] };\n /** Per-entry opt-out; reported as skipped, never silently dropped. */\n skip?: boolean;\n /**\n * Maps a `tool:*` grader's own severities onto eval severities. Accepted so\n * one entry vocabulary ports across both docmeta eval schemas; ignored here,\n * because this repo implements no `tool:*` graders.\n */\n severityMap?: Record<string, Severity>;\n /** Command-graded evals: argv, with `{trace}` substituted at grade time. */\n command?: string[];\n successExitCodes?: number[];\n timeoutMs?: number;\n /** sha256 of `assertion` when the check script was generated. */\n generatedAssertionHash?: string;\n}\n\nexport interface ExtractedEvals {\n evals: EvalEntry[];\n /** Schema violations in the front matter, with line numbers when known. */\n errors: FieldError[];\n /** Whether a `metadata.evals` block was present. */\n declared: boolean;\n /** `metadata.eval-skip` — skip this artifact's evals entirely. */\n skip: boolean;\n /**\n * Which model proposed each eval, by eval id, from\n * `metadata.meta-provenance` — the family's attribution record (0046),\n * written by `fill` through the same merge `manni meta fill` uses. Reading\n * it is what lets the judge notice it is grading an assertion it wrote\n * itself, which is bias on the *criterion* rather than on the session.\n *\n * Names are bare model names, the same spelling a provider's `modelName()`\n * returns, so the two sides of that comparison can actually match.\n *\n * A list because one id may appear under several `generated-by` entries —\n * a re-fill by a second model extends the block rather than replacing it.\n */\n proposedBy: Map<string, string[]>;\n}\n\n/**\n * Members of `metadata` this vocabulary claims. The schema cannot reject the\n * rest: `metadata` is the host tool's extension bag and must stay open, so a\n * misspelled `eval-skpi` would validate and quietly do nothing. Reserving the\n * `eval-` prefix at run time restores the closed block's loud-typo property.\n */\nconst CLAIMED_KEYS = [\"evals\", \"eval-skip\", \"meta-provenance\"] as const;\n\n/**\n * The one member under the reserved prefix this vocabulary keeps. proposal.4\n * narrowed the guard to `^eval-(?!skip$)`, so `eval-provenance` — proposal.2's\n * name for the attribution trail — is now an error rather than a member\n * everything downstream would silently ignore.\n */\nconst PREFIX_EXCEPTION = \"eval-skip\";\n\n/** A YAML mapping, as opposed to a list, a scalar, or null. */\nfunction isPlainObject(value: unknown): value is Record<string, unknown> {\n return typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n\n/**\n * `metadata` and everything under it, for one artifact.\n *\n * `supplied` is the seam for the external trail (`evals/external.ts`): the\n * artifact's front matter with a manifest-supplied `metadata` block already\n * merged in, by meta's own merge. It is the whole extraction rather than the\n * block alone, because the schema is document-rooted and validates the entire\n * front matter — handing it the block would validate the wrong document.\n * Omitted, the artifact's own front matter is read, which is what every caller\n * with no collections does.\n */\nexport function extractEvals(\n artifact: ResolvedArtifact,\n supplied?: ExtractedMetadata,\n): ExtractedEvals {\n const extracted = supplied ?? extractFrontmatter(artifact.content, \"markdown\");\n const metadata = extracted.data.metadata;\n // The schema types `metadata` as an object. Anything else — a string, a\n // list, a number — is a fault the validator must report, so it is kept\n // distinct from \"absent\" rather than folded into it.\n const bag = isPlainObject(metadata) ? metadata : undefined;\n const declared = bag !== undefined && bag.evals !== undefined;\n\n // `present` describes the *page*, and the merge leaves it alone. An artifact\n // with no front matter at all whose block a manifest supplies therefore reads\n // as absent unless the merged `metadata` is consulted too — the case a\n // relocated `CLAUDE.md` is in, since project rules rarely carry front matter.\n if (!extracted.present && metadata === undefined) {\n return { evals: [], errors: [], declared: false, skip: false, proposedBy: new Map() };\n }\n\n const typoErrors = reservedPrefixErrors(bag, extracted.lineFor);\n if (typoErrors.length > 0) {\n return { evals: [], errors: typoErrors, declared, skip: false, proposedBy: new Map() };\n }\n\n // Skip the validator only for an artifact this vocabulary has nothing to say\n // about: `metadata` absent, or a well-formed object claiming none of its\n // keys. A `metadata` that is not an object still has to be validated (the\n // schema types it), and so does one carrying only `meta-provenance` — the\n // block is malformed-or-not either way, and a malformed one is never\n // silently ignored.\n const wellFormed = metadata === undefined || bag !== undefined;\n const claimsNothing =\n bag === undefined ||\n !CLAIMED_KEYS.some((key) => bag[key] !== undefined);\n if (wellFormed && claimsNothing) {\n return {\n evals: [],\n errors: [],\n declared: false,\n skip: false,\n proposedBy: new Map(),\n };\n }\n\n const errors = artifactEvalsErrors(extracted.data, extracted.lineFor);\n if (errors.length > 0) {\n return { evals: [], errors, declared, skip: false, proposedBy: new Map() };\n }\n\n // Validation passed, so `metadata` is an object if it is present at all.\n const valid = bag ?? {};\n const skip = valid[\"eval-skip\"] === true;\n return {\n evals: normalizeBlock(valid.evals),\n errors: [],\n declared,\n skip,\n proposedBy: readProvenance(valid[\"meta-provenance\"]),\n };\n}\n\n/**\n * `metadata.meta-provenance` as eval id → the models that proposed it.\n *\n * The entries come from `metaProvenanceEntries`, the family's reader (0046),\n * so the block is read exactly the way `fill` wrote it and the way docevals\n * reads its own. Tolerant by design: the block has already passed the schema,\n * and a shape it did not constrain is not worth failing a run over — the worst\n * outcome of ignoring a malformed entry is one missing bias warning, while the\n * worst outcome of throwing is a run that will not start.\n */\nfunction readProvenance(raw: unknown): Map<string, string[]> {\n const out = new Map<string, string[]>();\n for (const entry of metaProvenanceEntries(raw)) {\n const by = entry[\"generated-by\"];\n for (const id of entry.evals) {\n const list = out.get(id) ?? [];\n if (!list.includes(by)) list.push(by);\n out.set(id, list);\n }\n }\n return out;\n}\n\n/**\n * A key inside `metadata` under the reserved `eval-` prefix that is not the\n * one member this vocabulary claims there. Reported against the offending key\n * so the fix is obvious.\n *\n * proposal.4's guard is `^eval-(?!skip$)`: `eval-provenance`, which proposal.2\n * excepted, now lands here rather than being read by nothing.\n */\nfunction reservedPrefixErrors(\n bag: Record<string, unknown> | undefined,\n lineFor: (pointer: string) => number | undefined,\n): FieldError[] {\n if (bag === undefined) return [];\n const errors: FieldError[] = [];\n for (const key of Object.keys(bag)) {\n // Detection is case-insensitive while the exception is not, deliberately:\n // YAML keys are case-sensitive, so `Eval-skip` is never a valid spelling of\n // `eval-skip` and should be reported rather than accepted. Do not \"fix\" the\n // asymmetry by matching the exception case-insensitively — that would\n // silently accept exactly the misspellings this guard exists to catch.\n if (!/^eval-/i.test(key) || key === PREFIX_EXCEPTION) continue;\n const line = lineFor(`/metadata/${key}`);\n errors.push({\n schema: ARTIFACT_EVALS_SCHEMA_ID,\n instancePath: `/metadata/${key}`,\n message:\n `unrecognized \"eval-\" key; the only one this vocabulary claims under ` +\n `that prefix is ${PREFIX_EXCEPTION} (its other members are ` +\n `${CLAIMED_KEYS.filter((k) => k !== PREFIX_EXCEPTION).join(\" and \")})`,\n keyword: \"additionalProperties\",\n subject: key,\n ...(line !== undefined ? { line } : {}),\n });\n }\n return errors;\n}\n\n/**\n * The block is one assertion as a string, or a list of entries. An absent key\n * yields nothing — an artifact with no evals omits it rather than declaring an\n * empty list, which the schema also refuses.\n */\nfunction normalizeBlock(raw: unknown): EvalEntry[] {\n if (typeof raw === \"string\") return [normalizeEntry(raw, 0)];\n if (!Array.isArray(raw)) return [];\n return raw.map((entry, index) => normalizeEntry(entry, index));\n}\n\nfunction normalizeEntry(raw: unknown, index: number): EvalEntry {\n // The string shorthand is the legitimately id-less form, so its identity is\n // positional. Object entries carry a required `id` precisely because a\n // position-derived name breaks the history join whenever entries move.\n if (typeof raw === \"string\") {\n return {\n id: `eval-${index + 1}`,\n assertion: raw,\n type: \"regression\",\n grader: \"ai\",\n severity: \"error\",\n };\n }\n\n const obj = raw as Record<string, unknown>;\n const entry: EvalEntry = {\n id: obj.id as string,\n // Optional since artifact-evals proposal.2: a `tool-usage` criterion says\n // everything in `options`, and demanding a sentence no grader reads was\n // the one place this vocabulary disagreed with the page side. The schema\n // still requires it for `ai`, `human`, and a bare entry (which defaults to\n // `ai`), so anything that actually needs an assertion still has one.\n ...(typeof obj.assertion === \"string\" ? { assertion: obj.assertion } : {}),\n type: (obj.type as EvalType | undefined) ?? \"regression\",\n grader: typeof obj.grader === \"string\" ? obj.grader : \"ai\",\n severity: (obj.severity as Severity | undefined) ?? \"error\",\n };\n if (typeof obj.provider === \"string\") entry.provider = obj.provider;\n if (typeof obj.model === \"string\") entry.model = obj.model;\n if (typeof obj.runs === \"number\") entry.runs = obj.runs;\n if (typeof obj.weight === \"number\") entry.weight = obj.weight;\n if (typeof obj.target === \"string\" || (obj.target && typeof obj.target === \"object\")) {\n entry.target = obj.target as TraceTarget;\n }\n if (obj.options && typeof obj.options === \"object\") {\n entry.options = obj.options as Record<string, unknown>;\n }\n if (typeof obj.evidence === \"string\") entry.evidence = obj.evidence;\n if (obj.examples && typeof obj.examples === \"object\") {\n entry.examples = normalizeExamples(obj.examples as Record<string, unknown>);\n }\n if (obj.skip === true) entry.skip = true;\n if (obj[\"severity-map\"] && typeof obj[\"severity-map\"] === \"object\") {\n entry.severityMap = obj[\"severity-map\"] as Record<string, Severity>;\n }\n if (Array.isArray(obj.command)) entry.command = obj.command as string[];\n if (Array.isArray(obj[\"success-exit-codes\"])) {\n entry.successExitCodes = obj[\"success-exit-codes\"] as number[];\n }\n if (typeof obj[\"timeout-ms\"] === \"number\") {\n entry.timeoutMs = obj[\"timeout-ms\"];\n }\n if (typeof obj[\"generated-assertion-hash\"] === \"string\") {\n entry.generatedAssertionHash = obj[\"generated-assertion-hash\"];\n }\n return entry;\n}\n\n/** Anchors are one example or a list of them; downstream sees only the list. */\nfunction normalizeExamples(\n raw: Record<string, unknown>,\n): { pass?: string[]; fail?: string[] } {\n const out: { pass?: string[]; fail?: string[] } = {};\n const pass = anchorList(raw.pass);\n const fail = anchorList(raw.fail);\n if (pass) out.pass = pass;\n if (fail) out.fail = fail;\n return out;\n}\n\nfunction anchorList(raw: unknown): string[] | undefined {\n if (typeof raw === \"string\") return [raw];\n if (Array.isArray(raw)) return raw.filter((e): e is string => typeof e === \"string\");\n return undefined;\n}\n"],"mappings":";;;;;;;;;;;;;;;;AASA,SAAS,kBAAkB;AAC3B,SAAS,OAAO,UAAU,iBAAiB;AAC3C;AAAA,EACE;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAOA,SAAS,UAAU,MAA+B;AACvD,SAAO,WAAW,QAAQ,EAAE,OAAO,IAAI,EAAE,OAAO,KAAK;AACvD;AAGA,eAAsB,SAAS,MAAsC;AACnE,MAAI;AAGF,WAAO,UAAU,MAAM,SAAS,IAAI,CAAC;AAAA,EACvC,QAAQ;AACN,WAAO;AAAA,EACT;AACF;AAGO,SAAS,SAAS,MAAc,MAA6B;A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AM,UAAU;AACzC,UAAM,YAAY,IAAI,YAAY;AAAA,EACpC;AACA,MAAI,OAAO,IAAI,0BAA0B,MAAM,UAAU;AACvD,UAAM,yBAAyB,IAAI,0BAA0B;AAAA,EAC/D;AACA,SAAO;AACT;AAGA,SAAS,kBACP,KACsC;AACtC,QAAM,MAA4C,CAAC;AACnD,QAAM,OAAO,WAAW,IAAI,IAAI;AAChC,QAAM,OAAO,WAAW,IAAI,IAAI;AAChC,MAAI,KAAM,KAAI,OAAO;AACrB,MAAI,KAAM,KAAI,OAAO;AACrB,SAAO;AACT;AAEA,SAAS,WAAW,KAAoC;AACtD,MAAI,OAAO,QAAQ,SAAU,QAAO,CAAC,GAAG;AACxC,MAAI,MAAM,QAAQ,GAAG,EAAG,QAAO,IAAI,OAAO,CAAC,MAAmB,OAAO,MAAM,QAAQ;AACnF,SAAO;AACT;","names":["readFile","dirname","join","resolve","sep","dirname","join","resolve","resolve","refKey","join","dirname","found"]}
@@ -1,32 +1,34 @@
1
1
  #!/usr/bin/env node
2
- import {
3
- discoverArtifacts
4
- } from "./chunk-QQUKGCAJ.js";
5
2
  import {
6
3
  METADATA_KEY,
7
- assertProviderSelection,
8
- constructProvider,
9
4
  graderFor,
10
5
  keepNewerThan,
11
6
  loadExternalEvals,
12
7
  loadGraderPlugins,
13
8
  parseNewerThan,
14
- resolveProviderIdentity,
15
- selectProvider,
16
9
  urlManifestRefusal
17
- } from "./chunk-FBEQCK47.js";
10
+ } from "./chunk-PL4UAF4S.js";
18
11
  import {
19
- discoverConfig
20
- } from "./chunk-NXV7WE2D.js";
12
+ discoverArtifacts
13
+ } from "./chunk-2KRB3EG7.js";
21
14
  import {
22
15
  discoverTraces
23
16
  } from "./chunk-4TSWU2SU.js";
17
+ import {
18
+ discoverConfig
19
+ } from "./chunk-XPEWUK7J.js";
20
+ import {
21
+ assertProviderSelection,
22
+ constructProvider,
23
+ resolveProviderIdentity,
24
+ selectProvider
25
+ } from "./chunk-BWCWTHYS.js";
24
26
  import {
25
27
  TracevalsError
26
28
  } from "./chunk-UKZNLVJW.js";
27
29
  import {
28
30
  TURN_BUDGET_SKIP
29
- } from "./chunk-LJ2RDH3F.js";
31
+ } from "./chunk-XG6PVB5S.js";
30
32
  import {
31
33
  SEVERITIES
32
34
  } from "./chunk-77AINBYM.js";
@@ -34,7 +36,7 @@ import {
34
36
  externalWriteWarnings,
35
37
  mergeMetaProvenance,
36
38
  offerExternalHomes
37
- } from "./chunk-A5ULMVHQ.js";
39
+ } from "./chunk-GREQKO6M.js";
38
40
  import {
39
41
  keyHome,
40
42
  marksValidator,
@@ -42,12 +44,12 @@ import {
42
44
  readManifestOrEmpty,
43
45
  readManifestValue,
44
46
  spliceManifestValue
45
- } from "./chunk-M3W7J6MU.js";
47
+ } from "./chunk-TUAAR3MM.js";
46
48
  import {
47
49
  DocmetaError,
48
50
  extractFrontmatter,
49
51
  writeFileAtomic
50
- } from "./chunk-57NEQRVO.js";
52
+ } from "./chunk-KCOFEWV5.js";
51
53
  import {
52
54
  palette
53
55
  } from "./chunk-RNVYGWIC.js";
@@ -1189,4 +1191,4 @@ export {
1189
1191
  runFill,
1190
1192
  renderFill
1191
1193
  };
1192
- //# sourceMappingURL=chunk-I2AH3CJJ.js.map
1194
+ //# sourceMappingURL=chunk-B3TS4WRM.js.map