@vibe-agent-toolkit/agent-skills 0.1.42 → 0.2.0-rc.10

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 (322) hide show
  1. package/README.md +5 -5
  2. package/dist/builder.d.ts.map +1 -1
  3. package/dist/builder.js +7 -17
  4. package/dist/builder.js.map +1 -1
  5. package/dist/content-type-routing.d.ts +32 -0
  6. package/dist/content-type-routing.d.ts.map +1 -1
  7. package/dist/content-type-routing.js +23 -0
  8. package/dist/content-type-routing.js.map +1 -1
  9. package/dist/files-config.d.ts +34 -1
  10. package/dist/files-config.d.ts.map +1 -1
  11. package/dist/files-config.js +277 -39
  12. package/dist/files-config.js.map +1 -1
  13. package/dist/fs-attribution.d.ts +45 -0
  14. package/dist/fs-attribution.d.ts.map +1 -0
  15. package/dist/fs-attribution.js +57 -0
  16. package/dist/fs-attribution.js.map +1 -0
  17. package/dist/import.d.ts.map +1 -1
  18. package/dist/import.js +0 -4
  19. package/dist/import.js.map +1 -1
  20. package/dist/index.d.ts +13 -8
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +25 -7
  23. package/dist/index.js.map +1 -1
  24. package/dist/inventory/detectors/declared-but-missing.d.ts +1 -1
  25. package/dist/inventory/detectors/declared-but-missing.d.ts.map +1 -1
  26. package/dist/inventory/detectors/marketplace-source-missing.d.ts +1 -1
  27. package/dist/inventory/detectors/marketplace-source-missing.d.ts.map +1 -1
  28. package/dist/inventory/detectors/present-but-undeclared.d.ts +1 -1
  29. package/dist/inventory/detectors/present-but-undeclared.d.ts.map +1 -1
  30. package/dist/inventory/detectors/reference-target-missing.d.ts +1 -1
  31. package/dist/inventory/detectors/reference-target-missing.d.ts.map +1 -1
  32. package/dist/inventory/index.d.ts +1 -1
  33. package/dist/inventory/index.d.ts.map +1 -1
  34. package/dist/inventory/index.js +1 -1
  35. package/dist/inventory/index.js.map +1 -1
  36. package/dist/inventory/serialize.d.ts +4 -4
  37. package/dist/inventory/serialize.d.ts.map +1 -1
  38. package/dist/inventory/serialize.js +6 -6
  39. package/dist/inventory/serialize.js.map +1 -1
  40. package/dist/inventory/types.d.ts +8 -0
  41. package/dist/inventory/types.d.ts.map +1 -1
  42. package/dist/inventory/types.js.map +1 -1
  43. package/dist/link-graph-members.d.ts +18 -0
  44. package/dist/link-graph-members.d.ts.map +1 -0
  45. package/dist/link-graph-members.js +18 -0
  46. package/dist/link-graph-members.js.map +1 -0
  47. package/dist/parsers/frontmatter-parser.d.ts.map +1 -1
  48. package/dist/parsers/frontmatter-parser.js +30 -6
  49. package/dist/parsers/frontmatter-parser.js.map +1 -1
  50. package/dist/plugin-distribution-layout.d.ts +70 -6
  51. package/dist/plugin-distribution-layout.d.ts.map +1 -1
  52. package/dist/plugin-distribution-layout.js +84 -11
  53. package/dist/plugin-distribution-layout.js.map +1 -1
  54. package/dist/post-build-checks.d.ts +38 -1
  55. package/dist/post-build-checks.d.ts.map +1 -1
  56. package/dist/post-build-checks.js +68 -17
  57. package/dist/post-build-checks.js.map +1 -1
  58. package/dist/projection/skill-extent.d.ts +247 -0
  59. package/dist/projection/skill-extent.d.ts.map +1 -0
  60. package/dist/projection/skill-extent.js +560 -0
  61. package/dist/projection/skill-extent.js.map +1 -0
  62. package/dist/schemas/agent-skill-frontmatter.js +1 -1
  63. package/dist/schemas/agent-skill-frontmatter.js.map +1 -1
  64. package/dist/schemas/allowed-tools.d.ts +31 -0
  65. package/dist/schemas/allowed-tools.d.ts.map +1 -0
  66. package/dist/schemas/allowed-tools.js +88 -0
  67. package/dist/schemas/allowed-tools.js.map +1 -0
  68. package/dist/schemas/index.d.ts +1 -0
  69. package/dist/schemas/index.d.ts.map +1 -1
  70. package/dist/schemas/index.js +1 -0
  71. package/dist/schemas/index.js.map +1 -1
  72. package/dist/schemas/installed-plugins-registry.d.ts.map +1 -1
  73. package/dist/schemas/installed-plugins-registry.js +7 -1
  74. package/dist/schemas/installed-plugins-registry.js.map +1 -1
  75. package/dist/schemas/marketplace-manifest.d.ts.map +1 -1
  76. package/dist/schemas/marketplace-manifest.js +17 -6
  77. package/dist/schemas/marketplace-manifest.js.map +1 -1
  78. package/dist/skill-identity.d.ts +18 -3
  79. package/dist/skill-identity.d.ts.map +1 -1
  80. package/dist/skill-identity.js +25 -6
  81. package/dist/skill-identity.js.map +1 -1
  82. package/dist/skill-packager.d.ts +144 -20
  83. package/dist/skill-packager.d.ts.map +1 -1
  84. package/dist/skill-packager.js +447 -105
  85. package/dist/skill-packager.js.map +1 -1
  86. package/dist/skill-source/content-hash.d.ts.map +1 -1
  87. package/dist/skill-source/content-hash.js +21 -10
  88. package/dist/skill-source/content-hash.js.map +1 -1
  89. package/dist/skill-source/fetch-cache.d.ts.map +1 -1
  90. package/dist/skill-source/fetch-cache.js +0 -5
  91. package/dist/skill-source/fetch-cache.js.map +1 -1
  92. package/dist/skill-source/git-clone.d.ts +1 -1
  93. package/dist/skill-source/git-clone.d.ts.map +1 -1
  94. package/dist/skill-source/git-clone.js +10 -10
  95. package/dist/skill-source/git-clone.js.map +1 -1
  96. package/dist/skill-source/sources/url-source.d.ts.map +1 -1
  97. package/dist/skill-source/sources/url-source.js +2 -2
  98. package/dist/skill-source/sources/url-source.js.map +1 -1
  99. package/dist/skill-source/stage.d.ts.map +1 -1
  100. package/dist/skill-source/stage.js +0 -6
  101. package/dist/skill-source/stage.js.map +1 -1
  102. package/dist/skill-test/baseline-delta.d.ts +1575 -0
  103. package/dist/skill-test/baseline-delta.d.ts.map +1 -0
  104. package/dist/skill-test/baseline-delta.js +272 -0
  105. package/dist/skill-test/baseline-delta.js.map +1 -0
  106. package/dist/skill-test/baseline-integrity.d.ts +944 -0
  107. package/dist/skill-test/baseline-integrity.d.ts.map +1 -0
  108. package/dist/skill-test/baseline-integrity.js +3090 -0
  109. package/dist/skill-test/baseline-integrity.js.map +1 -0
  110. package/dist/skill-test/build-hook.d.ts +3 -2
  111. package/dist/skill-test/build-hook.d.ts.map +1 -1
  112. package/dist/skill-test/build-hook.js +4 -5
  113. package/dist/skill-test/build-hook.js.map +1 -1
  114. package/dist/skill-test/configure-writer.js +1 -1
  115. package/dist/skill-test/configure-writer.js.map +1 -1
  116. package/dist/skill-test/declared-env.d.ts +5 -4
  117. package/dist/skill-test/declared-env.d.ts.map +1 -1
  118. package/dist/skill-test/declared-env.js +8 -9
  119. package/dist/skill-test/declared-env.js.map +1 -1
  120. package/dist/skill-test/eval-executor.d.ts +21 -5
  121. package/dist/skill-test/eval-executor.d.ts.map +1 -1
  122. package/dist/skill-test/eval-executor.js +6 -6
  123. package/dist/skill-test/eval-executor.js.map +1 -1
  124. package/dist/skill-test/eval-fragment.d.ts +106 -28
  125. package/dist/skill-test/eval-fragment.d.ts.map +1 -1
  126. package/dist/skill-test/eval-fragment.js +78 -16
  127. package/dist/skill-test/eval-fragment.js.map +1 -1
  128. package/dist/skill-test/eval-grader.d.ts +65 -7
  129. package/dist/skill-test/eval-grader.d.ts.map +1 -1
  130. package/dist/skill-test/eval-grader.js +263 -64
  131. package/dist/skill-test/eval-grader.js.map +1 -1
  132. package/dist/skill-test/eval-inputs.d.ts +110 -8
  133. package/dist/skill-test/eval-inputs.d.ts.map +1 -1
  134. package/dist/skill-test/eval-inputs.js +177 -22
  135. package/dist/skill-test/eval-inputs.js.map +1 -1
  136. package/dist/skill-test/eval-lint.d.ts +17 -4
  137. package/dist/skill-test/eval-lint.d.ts.map +1 -1
  138. package/dist/skill-test/eval-lint.js +22 -9
  139. package/dist/skill-test/eval-lint.js.map +1 -1
  140. package/dist/skill-test/eval-suite-isolation.d.ts.map +1 -1
  141. package/dist/skill-test/eval-suite-isolation.js +8 -5
  142. package/dist/skill-test/eval-suite-isolation.js.map +1 -1
  143. package/dist/skill-test/evals-template.d.ts +1 -1
  144. package/dist/skill-test/evals-template.d.ts.map +1 -1
  145. package/dist/skill-test/evals-template.js +1 -3
  146. package/dist/skill-test/evals-template.js.map +1 -1
  147. package/dist/skill-test/executor-prompt.d.ts +15 -7
  148. package/dist/skill-test/executor-prompt.d.ts.map +1 -1
  149. package/dist/skill-test/executor-prompt.js +10 -7
  150. package/dist/skill-test/executor-prompt.js.map +1 -1
  151. package/dist/skill-test/failure-reason.d.ts +113 -0
  152. package/dist/skill-test/failure-reason.d.ts.map +1 -0
  153. package/dist/skill-test/failure-reason.js +124 -0
  154. package/dist/skill-test/failure-reason.js.map +1 -0
  155. package/dist/skill-test/fragment-merge.d.ts +3 -20
  156. package/dist/skill-test/fragment-merge.d.ts.map +1 -1
  157. package/dist/skill-test/fragment-merge.js +67 -8
  158. package/dist/skill-test/fragment-merge.js.map +1 -1
  159. package/dist/skill-test/grader-prompt.d.ts +29 -9
  160. package/dist/skill-test/grader-prompt.d.ts.map +1 -1
  161. package/dist/skill-test/grader-prompt.js +264 -68
  162. package/dist/skill-test/grader-prompt.js.map +1 -1
  163. package/dist/skill-test/grader-text.d.ts +145 -0
  164. package/dist/skill-test/grader-text.d.ts.map +1 -0
  165. package/dist/skill-test/grader-text.js +410 -0
  166. package/dist/skill-test/grader-text.js.map +1 -0
  167. package/dist/skill-test/grading-adapter.d.ts +38 -2
  168. package/dist/skill-test/grading-adapter.d.ts.map +1 -1
  169. package/dist/skill-test/grading-adapter.js +57 -9
  170. package/dist/skill-test/grading-adapter.js.map +1 -1
  171. package/dist/skill-test/grading-schema.d.ts +160 -5
  172. package/dist/skill-test/grading-schema.d.ts.map +1 -1
  173. package/dist/skill-test/grading-schema.js +66 -7
  174. package/dist/skill-test/grading-schema.js.map +1 -1
  175. package/dist/skill-test/harness-location.d.ts +3 -2
  176. package/dist/skill-test/harness-location.d.ts.map +1 -1
  177. package/dist/skill-test/harness-location.js +5 -16
  178. package/dist/skill-test/harness-location.js.map +1 -1
  179. package/dist/skill-test/index.d.ts +2 -2
  180. package/dist/skill-test/index.d.ts.map +1 -1
  181. package/dist/skill-test/index.js +2 -2
  182. package/dist/skill-test/index.js.map +1 -1
  183. package/dist/skill-test/lock.d.ts +58 -1
  184. package/dist/skill-test/lock.d.ts.map +1 -1
  185. package/dist/skill-test/lock.js +78 -6
  186. package/dist/skill-test/lock.js.map +1 -1
  187. package/dist/skill-test/pipeline.d.ts +19 -1
  188. package/dist/skill-test/pipeline.d.ts.map +1 -1
  189. package/dist/skill-test/pipeline.js +21 -10
  190. package/dist/skill-test/pipeline.js.map +1 -1
  191. package/dist/skill-test/preflight.d.ts +1 -1
  192. package/dist/skill-test/preflight.d.ts.map +1 -1
  193. package/dist/skill-test/preflight.js +59 -16
  194. package/dist/skill-test/preflight.js.map +1 -1
  195. package/dist/skill-test/prompt-invariants.d.ts +4 -2
  196. package/dist/skill-test/prompt-invariants.d.ts.map +1 -1
  197. package/dist/skill-test/prompt-invariants.js +5 -4
  198. package/dist/skill-test/prompt-invariants.js.map +1 -1
  199. package/dist/skill-test/run-harness.d.ts +665 -85
  200. package/dist/skill-test/run-harness.d.ts.map +1 -1
  201. package/dist/skill-test/run-harness.js +1522 -237
  202. package/dist/skill-test/run-harness.js.map +1 -1
  203. package/dist/skill-test/staging.d.ts +20 -8
  204. package/dist/skill-test/staging.d.ts.map +1 -1
  205. package/dist/skill-test/staging.js +25 -18
  206. package/dist/skill-test/staging.js.map +1 -1
  207. package/dist/skill-test/tier-plan.d.ts +1 -1
  208. package/dist/skill-test/tier-plan.js +1 -1
  209. package/dist/skill-test/tool-eval-schema.d.ts +6 -6
  210. package/dist/skill-test/tool-eval-schema.js +2 -2
  211. package/dist/skill-test/vendor-manifest.d.ts +2 -1
  212. package/dist/skill-test/vendor-manifest.d.ts.map +1 -1
  213. package/dist/skill-test/vendor-manifest.js +10 -10
  214. package/dist/skill-test/vendor-manifest.js.map +1 -1
  215. package/dist/test-input.d.ts +59 -8
  216. package/dist/test-input.d.ts.map +1 -1
  217. package/dist/test-input.js +64 -19
  218. package/dist/test-input.js.map +1 -1
  219. package/dist/validators/agent-instruction-presence.d.ts +1 -1
  220. package/dist/validators/agent-instruction-presence.d.ts.map +1 -1
  221. package/dist/validators/agent-instruction-presence.js +45 -2
  222. package/dist/validators/agent-instruction-presence.js.map +1 -1
  223. package/dist/validators/bundled-resource-link-detection.d.ts +6 -4
  224. package/dist/validators/bundled-resource-link-detection.d.ts.map +1 -1
  225. package/dist/validators/bundled-resource-link-detection.js +39 -39
  226. package/dist/validators/bundled-resource-link-detection.js.map +1 -1
  227. package/dist/validators/compat-detectors.d.ts +18 -1
  228. package/dist/validators/compat-detectors.d.ts.map +1 -1
  229. package/dist/validators/compat-detectors.js +47 -20
  230. package/dist/validators/compat-detectors.js.map +1 -1
  231. package/dist/validators/cross-skill-dependency-detection.d.ts +1 -1
  232. package/dist/validators/cross-skill-dependency-detection.d.ts.map +1 -1
  233. package/dist/validators/cross-skill-dependency-detection.js +1 -1
  234. package/dist/validators/cross-skill-dependency-detection.js.map +1 -1
  235. package/dist/validators/description-style-detection.d.ts +1 -1
  236. package/dist/validators/description-style-detection.d.ts.map +1 -1
  237. package/dist/validators/description-style-detection.js +1 -1
  238. package/dist/validators/description-style-detection.js.map +1 -1
  239. package/dist/validators/format-detection.d.ts +3 -0
  240. package/dist/validators/format-detection.d.ts.map +1 -1
  241. package/dist/validators/format-detection.js +41 -26
  242. package/dist/validators/format-detection.js.map +1 -1
  243. package/dist/validators/frontmatter-validation.d.ts +1 -1
  244. package/dist/validators/frontmatter-validation.d.ts.map +1 -1
  245. package/dist/validators/frontmatter-validation.js +2 -2
  246. package/dist/validators/frontmatter-validation.js.map +1 -1
  247. package/dist/validators/imperative-body-detection.d.ts +1 -1
  248. package/dist/validators/imperative-body-detection.d.ts.map +1 -1
  249. package/dist/validators/imperative-body-detection.js +1 -1
  250. package/dist/validators/imperative-body-detection.js.map +1 -1
  251. package/dist/validators/index.d.ts +1 -1
  252. package/dist/validators/index.d.ts.map +1 -1
  253. package/dist/validators/kebab-case-detection.d.ts +1 -1
  254. package/dist/validators/kebab-case-detection.d.ts.map +1 -1
  255. package/dist/validators/kebab-case-detection.js +1 -1
  256. package/dist/validators/kebab-case-detection.js.map +1 -1
  257. package/dist/validators/marketplace-validator.d.ts.map +1 -1
  258. package/dist/validators/marketplace-validator.js +7 -2
  259. package/dist/validators/marketplace-validator.js.map +1 -1
  260. package/dist/validators/mcp-tool-qualification.d.ts +158 -0
  261. package/dist/validators/mcp-tool-qualification.d.ts.map +1 -0
  262. package/dist/validators/mcp-tool-qualification.js +467 -0
  263. package/dist/validators/mcp-tool-qualification.js.map +1 -0
  264. package/dist/validators/packaged-size-limit.d.ts +296 -0
  265. package/dist/validators/packaged-size-limit.d.ts.map +1 -0
  266. package/dist/validators/packaged-size-limit.js +492 -0
  267. package/dist/validators/packaged-size-limit.js.map +1 -0
  268. package/dist/validators/packaging-validator.d.ts +149 -10
  269. package/dist/validators/packaging-validator.d.ts.map +1 -1
  270. package/dist/validators/packaging-validator.js +371 -55
  271. package/dist/validators/packaging-validator.js.map +1 -1
  272. package/dist/validators/plugin-hosted-shape.d.ts +4 -2
  273. package/dist/validators/plugin-hosted-shape.d.ts.map +1 -1
  274. package/dist/validators/plugin-hosted-shape.js +6 -7
  275. package/dist/validators/plugin-hosted-shape.js.map +1 -1
  276. package/dist/validators/plugin-recommended-fields.d.ts +1 -1
  277. package/dist/validators/plugin-recommended-fields.d.ts.map +1 -1
  278. package/dist/validators/plugin-recommended-fields.js +1 -1
  279. package/dist/validators/plugin-recommended-fields.js.map +1 -1
  280. package/dist/validators/referenced-path-missing.d.ts +211 -0
  281. package/dist/validators/referenced-path-missing.d.ts.map +1 -0
  282. package/dist/validators/referenced-path-missing.js +378 -0
  283. package/dist/validators/referenced-path-missing.js.map +1 -0
  284. package/dist/validators/registry-validator.d.ts.map +1 -1
  285. package/dist/validators/registry-validator.js +1 -2
  286. package/dist/validators/registry-validator.js.map +1 -1
  287. package/dist/validators/rule-engine/index.d.ts +1 -1
  288. package/dist/validators/rule-engine/rule-context.d.ts +20 -3
  289. package/dist/validators/rule-engine/rule-context.d.ts.map +1 -1
  290. package/dist/validators/rule-engine/rule-context.js +3 -1
  291. package/dist/validators/rule-engine/rule-context.js.map +1 -1
  292. package/dist/validators/rule-engine/rule-engine.d.ts +2 -2
  293. package/dist/validators/rule-engine/rule-engine.d.ts.map +1 -1
  294. package/dist/validators/rule-engine/rule-engine.js +52 -13
  295. package/dist/validators/rule-engine/rule-engine.js.map +1 -1
  296. package/dist/validators/skill-validator.d.ts.map +1 -1
  297. package/dist/validators/skill-validator.js +91 -54
  298. package/dist/validators/skill-validator.js.map +1 -1
  299. package/dist/validators/source-only-codes.js +1 -1
  300. package/dist/validators/source-only-codes.js.map +1 -1
  301. package/dist/validators/types.d.ts +21 -1
  302. package/dist/validators/types.d.ts.map +1 -1
  303. package/dist/validators/unified-validator.d.ts.map +1 -1
  304. package/dist/validators/unified-validator.js +4 -5
  305. package/dist/validators/unified-validator.js.map +1 -1
  306. package/dist/validators/validation-rules.d.ts +4 -4
  307. package/dist/validators/validation-rules.d.ts.map +1 -1
  308. package/dist/validators/validation-rules.js +9 -38
  309. package/dist/validators/validation-rules.js.map +1 -1
  310. package/dist/validators/walker-to-issues.d.ts +9 -3
  311. package/dist/validators/walker-to-issues.d.ts.map +1 -1
  312. package/dist/validators/walker-to-issues.js +64 -19
  313. package/dist/validators/walker-to-issues.js.map +1 -1
  314. package/dist/walk-link-graph.d.ts +64 -5
  315. package/dist/walk-link-graph.d.ts.map +1 -1
  316. package/dist/walk-link-graph.js +376 -92
  317. package/dist/walk-link-graph.js.map +1 -1
  318. package/package.json +14 -22
  319. package/dist/skill-test/exit-codes.d.ts +0 -97
  320. package/dist/skill-test/exit-codes.d.ts.map +0 -1
  321. package/dist/skill-test/exit-codes.js +0 -141
  322. package/dist/skill-test/exit-codes.js.map +0 -1
@@ -1,24 +1,27 @@
1
1
  import { PromptInvariantError } from './prompt-invariants.js';
2
2
  /**
3
- * Build the prompt handed to the blind executor subagent (issue #145 —
4
- * transcript-grounded eval rewrite). The executor is a real worker, not a
3
+ * Build the prompt handed to the blind executor subagent (the
4
+ * transcript-grounded eval design). The executor is a real worker, not a
5
5
  * participant in an eval: it receives the task and its working context ONLY,
6
6
  * phrased exactly as a genuine user request. It must NEVER be told (directly
7
7
  * or by implication) that it is being tested, evaluated, or graded — that
8
8
  * knowledge would change its behavior and invalidate the eval.
9
9
  *
10
10
  * `subjectPath` is where the skill/plugin under test is staged (context the
11
- * executor's environment provides); `workspaceDir`, when the eval declares
12
- * input `files`, is the project the executor is actually meant to operate on.
11
+ * executor's environment provides) and is OMITTED for the skill-absent arm;
12
+ * `workspaceDir` is the project the executor is actually meant to operate on.
13
13
  *
14
14
  * Pure function: same inputs always produce the same prompt.
15
15
  */
16
16
  export function buildExecutorPrompt(opts) {
17
- const lines = [opts.task, '', `The relevant files are located at ${opts.subjectPath}.`];
17
+ const context = [];
18
+ if (opts.subjectPath !== undefined) {
19
+ context.push(`The relevant files are located at ${opts.subjectPath}.`);
20
+ }
18
21
  if (opts.workspaceDir !== undefined) {
19
- lines.push(`Your working directory is ${opts.workspaceDir} — the project to operate on.`);
22
+ context.push(`Your working directory is ${opts.workspaceDir} — the project to operate on.`);
20
23
  }
21
- return lines.join('\n');
24
+ return context.length === 0 ? opts.task : [opts.task, '', ...context].join('\n');
22
25
  }
23
26
  /**
24
27
  * Phrases that, if present in an executor prompt, would break the blind
@@ -1 +1 @@
1
- {"version":3,"file":"executor-prompt.js","sourceRoot":"","sources":["../../src/skill-test/executor-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAW9D;;;;;;;;;;;;;GAaG;AACH,MAAM,UAAU,mBAAmB,CAAC,IAAgC;IAClE,MAAM,KAAK,GAAG,CAAC,IAAI,CAAC,IAAI,EAAE,EAAE,EAAE,qCAAqC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IACxF,IAAI,IAAI,CAAC,YAAY,KAAK,SAAS,EAAE,CAAC;QACpC,KAAK,CAAC,IAAI,CAAC,6BAA6B,IAAI,CAAC,YAAY,+BAA+B,CAAC,CAAC;IAC5F,CAA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 /**
3
+ * WHY a `vat skill test run` ended on `ExitCode.ERROR`.
4
+ *
5
+ * This used to be three exit codes — 1 internal, 2 preflight, 3 bootstrap —
6
+ * beside 4 for "an eval failed". Under the one exit-code contract every verb
7
+ * shares (`ExitCode` in `@vibe-agent-toolkit/schema`) a failed eval is
8
+ * `FINDINGS` (1) like every other gate that ran and did not pass, and every way
9
+ * the harness could NOT run is `ERROR` (2). The distinction a CI author still
10
+ * needs — "did the harness break, or is my environment wrong?" — is said on
11
+ * stderr as `Reason: <reason>`, never in a fourth number a wrapper would have
12
+ * to look up per command.
13
+ *
14
+ * - `internal` — the harness broke: a spawn failure, a watchdog stall, a grader
15
+ * fragment that did not parse, a forged nonce. VAT's fault until proven
16
+ * otherwise.
17
+ * - `preflight` — the operator can fix it: a bad config, a missing binary, an
18
+ * absent security ack, a held lock, a companion that would not build.
19
+ * - `bootstrap` — nothing was wrong; the run scaffolded an `evals.json`
20
+ * template and stopped so the author can fill it in.
21
+ */
22
+ export type SkillTestFailureReason = 'internal' | 'preflight' | 'bootstrap';
23
+ /**
24
+ * The reason an error, thrown out of the harness, gives for the run's `ERROR`.
25
+ *
26
+ * An error DECLARES its reason with a `readonly reason` field — every VAT error
27
+ * class in this feature carries one — and this reads it. Only a VAT error is
28
+ * consulted (the `Symbol.for('vat.error')` brand, which survives the
29
+ * `src`/`dist` boundary that `instanceof` does not): a foreign error carrying
30
+ * `reason` is not opting in to anything, and a foreign error carrying nothing
31
+ * is the harness's own fault, `internal`. That closes the residual the old
32
+ * `exitCode` read left open, where `commander`'s `CommanderError` carried a 2
33
+ * and would have reported "your environment is wrong" for a crash.
34
+ *
35
+ * The read is guarded: a getter or `Proxy` that throws on `reason` is a foreign
36
+ * object misbehaving, and this runs inside the CLI's own `catch`, where a
37
+ * rethrow escapes the handler entirely — no summary, no exit code, a bare
38
+ * stack.
39
+ */
40
+ export declare function skillTestFailureReason(err: unknown): SkillTestFailureReason;
41
+ /**
42
+ * A required input is absent in a way vat can scaffold (missing evals.json).
43
+ * Reason `bootstrap`, NOT a failure. `expectedPath` is the persistent location
44
+ * of the annotated starter template.
45
+ *
46
+ * In a real run the harness has already written that template, and the message
47
+ * says so. Under `--dry-run` the TEMPLATE is not written, so the message instead
48
+ * describes what a real run *would* scaffold and where, while surfacing the same
49
+ * "bootstrap needed" signal.
50
+ *
51
+ * That scope is exact, and it used to read "a dry run must never touch the
52
+ * filesystem", which is not true of this command. A dry run is not a read-only
53
+ * mode: it takes the harness lock, creates the harness root, stages BOTH arms'
54
+ * per-eval workspaces, and — once `--i-understand-this-runs-skill-code` is passed —
55
+ * runs the repo's `test.build` hook and builds the subject. What it never does is
56
+ * SPAWN: no executor session, no grader session, no tokens.
57
+ *
58
+ * It also never touches `results/`: it neither creates the directory, nor writes
59
+ * `provenance.json`, nor wipes the previous run's artifacts. That last one is the
60
+ * reason the ordering matters — the wipe used to sit AHEAD of the dry-run
61
+ * short-circuit, so a free `--dry-run` (or any failure after it) destroyed the
62
+ * `grading.json` / `baseline.json` / `friction.json` / `tool-eval.json` of the
63
+ * expensive real run an operator was about to read. The summary now names the
64
+ * provenance path it WOULD write rather than writing it.
65
+ *
66
+ * The scaffold is the other filesystem effect a dry run deliberately withholds,
67
+ * and for a different reason: that write lands in the AUTHOR's source
68
+ * tree rather than in vat's own scratch space.
69
+ */
70
+ export declare class BootstrapNeededError extends VatError {
71
+ readonly expectedPath: string;
72
+ readonly reason: "bootstrap";
73
+ constructor(expectedPath: string, opts?: {
74
+ dryRun?: boolean;
75
+ });
76
+ }
77
+ /** Thrown when building a declared skill (pool packageSkill or plugin build) fails. Reason `preflight`. */
78
+ export declare class SkillBuildError extends VatError {
79
+ readonly reason: "preflight";
80
+ constructor(message: string);
81
+ }
82
+ /**
83
+ * The §12 security acknowledgment is required but absent, thrown BEFORE any
84
+ * build/pre-stage command (which executes untrusted repo code) runs for a
85
+ * buildable subject. Reason `preflight`. Mirrors the harness Step-6 ack
86
+ * message wording so the two enforcement points read identically.
87
+ */
88
+ export declare class SecurityAckError extends VatError {
89
+ readonly reason: "preflight";
90
+ constructor();
91
+ }
92
+ /**
93
+ * A skill name is staged more than once in a single run — the subject, a
94
+ * `--with` companion, and a `--with-optional` companion must all have distinct
95
+ * names. Both `--with` and `--with-optional` STAGE the named companion and make
96
+ * it invocable (they differ only in required-vs-optional resolution, not in
97
+ * whether they are staged), so a colliding name would silently overwrite an
98
+ * earlier staged copy under the same slot — never an error, never a manifest
99
+ * trace — which makes a routing/deferral eval look correct while testing
100
+ * something else. Reason `preflight`: user-correctable input, like a bad env
101
+ * token or missing security ack.
102
+ */
103
+ export declare class DuplicateStagedSkillError extends VatError {
104
+ readonly skillName: string;
105
+ readonly reason: "preflight";
106
+ constructor(skillName: string);
107
+ }
108
+ /** Internal harness failure (an executor/grader spawn error, watchdog timeout/stall, or a missing grader fragment). Reason `internal`. */
109
+ export declare class InternalHarnessError extends VatError {
110
+ readonly reason: "internal";
111
+ constructor(message: string);
112
+ }
113
+ //# sourceMappingURL=failure-reason.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failure-reason.d.ts","sourceRoot":"","sources":["../../src/skill-test/failure-reason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAEjE;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,MAAM,sBAAsB,GAAG,UAAU,GAAG,WAAW,GAAG,WAAW,CAAC;AAQ5E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,OAAO,GAAG,sBAAsB,CAY3E;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;aAEpB,YAAY,EAAE,MAAM;IADhD,QAAQ,CAAC,MAAM,EAAG,WAAW,CAAU;gBACX,YAAY,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,OAAO,CAAA;KAAE;CAQ9E;AAED,2GAA2G;AAC3G,qBAAa,eAAgB,SAAQ,QAAQ;IAC3C,QAAQ,CAAC,MAAM,EAAG,WAAW,CAAU;gBAC3B,OAAO,EAAE,MAAM;CAG5B;AAED;;;;;GAKG;AACH,qBAAa,gBAAiB,SAAQ,QAAQ;IAC5C,QAAQ,CAAC,MAAM,EAAG,WAAW,CAAU;;CAOxC;AAED;;;;;;;;;;GAUG;AACH,qBAAa,yBAA0B,SAAQ,QAAQ;aAEzB,SAAS,EAAE,MAAM;IAD7C,QAAQ,CAAC,MAAM,EAAG,WAAW,CAAU;gBACX,SAAS,EAAE,MAAM;CAO9C;AAED,0IAA0I;AAC1I,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,QAAQ,CAAC,MAAM,EAAG,UAAU,CAAU;gBAC1B,OAAO,EAAE,MAAM;CAG5B"}
@@ -0,0 +1,124 @@
1
+ import { isVatError, VatError } from '@vibe-agent-toolkit/utils';
2
+ const FAILURE_REASONS = new Set([
3
+ 'internal',
4
+ 'preflight',
5
+ 'bootstrap',
6
+ ]);
7
+ /**
8
+ * The reason an error, thrown out of the harness, gives for the run's `ERROR`.
9
+ *
10
+ * An error DECLARES its reason with a `readonly reason` field — every VAT error
11
+ * class in this feature carries one — and this reads it. Only a VAT error is
12
+ * consulted (the `Symbol.for('vat.error')` brand, which survives the
13
+ * `src`/`dist` boundary that `instanceof` does not): a foreign error carrying
14
+ * `reason` is not opting in to anything, and a foreign error carrying nothing
15
+ * is the harness's own fault, `internal`. That closes the residual the old
16
+ * `exitCode` read left open, where `commander`'s `CommanderError` carried a 2
17
+ * and would have reported "your environment is wrong" for a crash.
18
+ *
19
+ * The read is guarded: a getter or `Proxy` that throws on `reason` is a foreign
20
+ * object misbehaving, and this runs inside the CLI's own `catch`, where a
21
+ * rethrow escapes the handler entirely — no summary, no exit code, a bare
22
+ * stack.
23
+ */
24
+ export function skillTestFailureReason(err) {
25
+ if (!isVatError(err))
26
+ return 'internal';
27
+ let declared;
28
+ try {
29
+ declared = err.reason;
30
+ // eslint-disable-next-line local/no-blind-catch -- a property read throws only from a getter or Proxy trap on a misbehaving object, and "the read itself threw" is exactly "declared nothing": there is no second case to tell apart, and this runs inside the CLI's own catch, where a rethrow escapes the handler entirely (pinned in failure-reason.test.ts).
31
+ }
32
+ catch {
33
+ return 'internal';
34
+ }
35
+ return typeof declared === 'string' && FAILURE_REASONS.has(declared)
36
+ ? declared
37
+ : 'internal';
38
+ }
39
+ /**
40
+ * A required input is absent in a way vat can scaffold (missing evals.json).
41
+ * Reason `bootstrap`, NOT a failure. `expectedPath` is the persistent location
42
+ * of the annotated starter template.
43
+ *
44
+ * In a real run the harness has already written that template, and the message
45
+ * says so. Under `--dry-run` the TEMPLATE is not written, so the message instead
46
+ * describes what a real run *would* scaffold and where, while surfacing the same
47
+ * "bootstrap needed" signal.
48
+ *
49
+ * That scope is exact, and it used to read "a dry run must never touch the
50
+ * filesystem", which is not true of this command. A dry run is not a read-only
51
+ * mode: it takes the harness lock, creates the harness root, stages BOTH arms'
52
+ * per-eval workspaces, and — once `--i-understand-this-runs-skill-code` is passed —
53
+ * runs the repo's `test.build` hook and builds the subject. What it never does is
54
+ * SPAWN: no executor session, no grader session, no tokens.
55
+ *
56
+ * It also never touches `results/`: it neither creates the directory, nor writes
57
+ * `provenance.json`, nor wipes the previous run's artifacts. That last one is the
58
+ * reason the ordering matters — the wipe used to sit AHEAD of the dry-run
59
+ * short-circuit, so a free `--dry-run` (or any failure after it) destroyed the
60
+ * `grading.json` / `baseline.json` / `friction.json` / `tool-eval.json` of the
61
+ * expensive real run an operator was about to read. The summary now names the
62
+ * provenance path it WOULD write rather than writing it.
63
+ *
64
+ * The scaffold is the other filesystem effect a dry run deliberately withholds,
65
+ * and for a different reason: that write lands in the AUTHOR's source
66
+ * tree rather than in vat's own scratch space.
67
+ */
68
+ export class BootstrapNeededError extends VatError {
69
+ expectedPath;
70
+ reason = 'bootstrap';
71
+ constructor(expectedPath, opts) {
72
+ super('SKILL_TEST_BOOTSTRAP_NEEDED', opts?.dryRun === true
73
+ ? `[dry-run] No evals.json found. A real run would scaffold an annotated template at ${expectedPath} — fill it in and re-run. (dry-run: nothing was written to your source tree.)`
74
+ : `Wrote an evals.json template at ${expectedPath} — fill it in and re-run.`);
75
+ this.expectedPath = expectedPath;
76
+ }
77
+ }
78
+ /** Thrown when building a declared skill (pool packageSkill or plugin build) fails. Reason `preflight`. */
79
+ export class SkillBuildError extends VatError {
80
+ reason = 'preflight';
81
+ constructor(message) {
82
+ super('SKILL_TEST_BUILD_FAILED', message);
83
+ }
84
+ }
85
+ /**
86
+ * The §12 security acknowledgment is required but absent, thrown BEFORE any
87
+ * build/pre-stage command (which executes untrusted repo code) runs for a
88
+ * buildable subject. Reason `preflight`. Mirrors the harness Step-6 ack
89
+ * message wording so the two enforcement points read identically.
90
+ */
91
+ export class SecurityAckError extends VatError {
92
+ reason = 'preflight';
93
+ constructor() {
94
+ super('SKILL_TEST_SECURITY_ACK_MISSING', 'Security acknowledgment required. Pass --i-understand-this-runs-skill-code to proceed.');
95
+ }
96
+ }
97
+ /**
98
+ * A skill name is staged more than once in a single run — the subject, a
99
+ * `--with` companion, and a `--with-optional` companion must all have distinct
100
+ * names. Both `--with` and `--with-optional` STAGE the named companion and make
101
+ * it invocable (they differ only in required-vs-optional resolution, not in
102
+ * whether they are staged), so a colliding name would silently overwrite an
103
+ * earlier staged copy under the same slot — never an error, never a manifest
104
+ * trace — which makes a routing/deferral eval look correct while testing
105
+ * something else. Reason `preflight`: user-correctable input, like a bad env
106
+ * token or missing security ack.
107
+ */
108
+ export class DuplicateStagedSkillError extends VatError {
109
+ skillName;
110
+ reason = 'preflight';
111
+ constructor(skillName) {
112
+ super('SKILL_TEST_DUPLICATE_STAGED_SKILL', `Skill name "${skillName}" is staged more than once (subject / --with / --with-optional). ` +
113
+ `Each staged skill must have a unique name.`);
114
+ this.skillName = skillName;
115
+ }
116
+ }
117
+ /** Internal harness failure (an executor/grader spawn error, watchdog timeout/stall, or a missing grader fragment). Reason `internal`. */
118
+ export class InternalHarnessError extends VatError {
119
+ reason = 'internal';
120
+ constructor(message) {
121
+ super('SKILL_TEST_INTERNAL', message);
122
+ }
123
+ }
124
+ //# sourceMappingURL=failure-reason.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"failure-reason.js","sourceRoot":"","sources":["../../src/skill-test/failure-reason.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AAwBjE,MAAM,eAAe,GAAwB,IAAI,GAAG,CAAyB;IAC3E,UAAU;IACV,WAAW;IACX,WAAW;CACZ,CAAC,CAAC;AAEH;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,sBAAsB,CAAC,GAAY;IACjD,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;QAAE,OAAO,UAAU,CAAC;IACxC,IAAI,QAAiB,CAAC;IACtB,IAAI,CAAC;QACH,QAAQ,GAAI,GAA4B,CAAC,MAAM,CAAC;QAChD,iWAAiW;IACnW,CAAC;IAAC,MAAM,CAAC;QACP,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,OAAO,QAAQ,KAAK,QAAQ,IAAI,eAAe,CAAC,GAAG,CAAC,QAAQ,CAAC;QAClE,CAAC,CAAE,QAAmC;QACtC,CAAC,CAAC,UAAU,CAAC;AACjB,CAAC;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,oBAAqB,SAAQ,QAAQ;IAEpB;IADnB,MAAM,GAAG,WAAoB,CAAC;IACvC,YAA4B,YAAoB,EAAE,IAA2B;QAC3E,KAAK,CACH,6BAA6B,EAC7B,IAAI,EAAE,MAAM,KAAK,IAAI;YACnB,CAAC,CAAC,qFAAqF,YAAY,+EAA+E;YAClL,CAAC,CAAC,mCAAmC,YAAY,2BAA2B,CAC/E,CAAC;QANwB,iBAAY,GAAZ,YAAY,CAAQ;IAOhD,CAAC;CACF;AAED,2GAA2G;AAC3G,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAClC,MAAM,GAAG,WAAoB,CAAC;IACvC,YAAY,OAAe;QACzB,KAAK,CAAC,yBAAyB,EAAE,OAAO,CAAC,CAAC;IAC5C,CAAC;CACF;AAED;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,QAAQ;IACnC,MAAM,GAAG,WAAoB,CAAC;IACvC;QACE,KAAK,CACH,iCAAiC,EACjC,wFAAwF,CACzF,CAAC;IACJ,CAAC;CACF;AAED;;;;;;;;;;GAUG;AACH,MAAM,OAAO,yBAA0B,SAAQ,QAAQ;IAEzB;IADnB,MAAM,GAAG,WAAoB,CAAC;IACvC,YAA4B,SAAiB;QAC3C,KAAK,CACH,mCAAmC,EACnC,eAAe,SAAS,mEAAmE;YACzF,4CAA4C,CAC/C,CAAC;QALwB,cAAS,GAAT,SAAS,CAAQ;IAM7C,CAAC;CACF;AAED,0IAA0I;AAC1I,MAAM,OAAO,oBAAqB,SAAQ,QAAQ;IACvC,MAAM,GAAG,UAAmB,CAAC;IACtC,YAAY,OAAe;QACzB,KAAK,CAAC,qBAAqB,EAAE,OAAO,CAAC,CAAC;IACxC,CAAC;CACF"}
@@ -2,24 +2,7 @@ import type { EvalFragment } from './eval-fragment.js';
2
2
  import { type FrictionReport } from './friction-schema.js';
3
3
  import { type NormalizedGrading } from './grading-adapter.js';
4
4
  import { type ToolEvalReport } from './tool-eval-schema.js';
5
- /**
6
- * Assemble the run's aggregate grading result (skill-creator's flat
7
- * `grading.json` shape) from every eval's per-eval grader fragment (issue #145
8
- * Task 4/5). vat is the SOLE writer of the aggregate; this is that assembly
9
- * step — the result feeds {@link import('./grading-adapter.js').reconcileGrading}
10
- * unchanged.
11
- *
12
- * Every fragment must carry the SAME `runNonce` the harness stamped for this
13
- * run — a mismatch means a fragment was not produced for this run (forged,
14
- * stale, or left behind by untrusted skill code in the shared sandbox) and is
15
- * rejected via {@link GradingNonceError}, never silently dropped.
16
- *
17
- * Zero fragments in → zero expectations out. This is deliberate: the existing
18
- * "graded nothing" guard in `reconcileGrading` already throws
19
- * `GradingSkewError` on an empty `expectations[]`, so that case is NOT
20
- * special-cased here.
21
- */
22
- export declare function mergeFragmentsToGrading(fragments: EvalFragment[], runNonce: string): NormalizedGrading;
5
+ export declare function mergeFragmentsToGrading(fragments: EvalFragment[], runNonce: string, arm: 'with' | 'without'): NormalizedGrading;
23
6
  /**
24
7
  * Assemble the run's aggregate friction report from every eval's fragment
25
8
  * (vat-owned; see friction-schema.ts). Concatenates each fragment's
@@ -30,8 +13,8 @@ export declare function mergeFragmentsToGrading(fragments: EvalFragment[], runNo
30
13
  */
31
14
  export declare function mergeFragmentsToFriction(fragments: EvalFragment[]): FrictionReport;
32
15
  /**
33
- * Assemble vat's `tool-eval.json` from every eval's fragment (issue #145
34
- * Phase T; see tool-eval-schema.ts). A SEPARATE channel from `grading.json`
16
+ * Assemble vat's `tool-eval.json` from every eval's fragment (see
17
+ * tool-eval-schema.ts). A SEPARATE channel from `grading.json`
35
18
  * and from friction (C2) — tool verdicts judge declared `toolExpectations`
36
19
  * against the transcript, not prose expectations or packaging friction.
37
20
  *
@@ -1 +1 @@
1
- {"version":3,"file":"fragment-merge.d.ts","sourceRoot":"","sources":["../../src/skill-test/fragment-merge.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAqB,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAElF;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,uBAAuB,CAAC,SAAS,EAAE,YAAY,EAAE,EAAE,QAAQ,EAAE,MAAM,GAAG,iBAAiB,CAoBtG;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,cAAc,CAYlF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,cAAc,CAMlF"}
1
+ {"version":3,"file":"fragment-merge.d.ts","sourceRoot":"","sources":["../../src/skill-test/fragment-merge.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AACvD,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAsC,KAAK,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAAwB,KAAK,cAAc,EAAE,MAAM,uBAAuB,CAAC;AAkElF,wBAAgB,uBAAuB,CACrC,SAAS,EAAE,YAAY,EAAE,EACzB,QAAQ,EAAE,MAAM,EAChB,GAAG,EAAE,MAAM,GAAG,SAAS,GACtB,iBAAiB,CAmCnB;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,cAAc,CAYlF;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,wBAAwB,CAAC,SAAS,EAAE,YAAY,EAAE,GAAG,cAAc,CAMlF"}
@@ -1,10 +1,11 @@
1
+ import { createHash } from 'node:crypto';
1
2
  import { FrictionReportSchema } from './friction-schema.js';
2
- import { GradingNonceError } from './grading-adapter.js';
3
+ import { GradingArmError, GradingNonceError } from './grading-adapter.js';
3
4
  import { ToolEvalReportSchema } from './tool-eval-schema.js';
4
5
  /**
5
6
  * Assemble the run's aggregate grading result (skill-creator's flat
6
- * `grading.json` shape) from every eval's per-eval grader fragment (issue #145
7
- * Task 4/5). vat is the SOLE writer of the aggregate; this is that assembly
7
+ * `grading.json` shape) from every eval's per-eval grader fragment.
8
+ * vat is the SOLE writer of the aggregate; this is that assembly
8
9
  * step — the result feeds {@link import('./grading-adapter.js').reconcileGrading}
9
10
  * unchanged.
10
11
  *
@@ -13,27 +14,85 @@ import { ToolEvalReportSchema } from './tool-eval-schema.js';
13
14
  * stale, or left behind by untrusted skill code in the shared sandbox) and is
14
15
  * rejected via {@link GradingNonceError}, never silently dropped.
15
16
  *
17
+ * The nonce is CONSUMED here, not republished: the returned report carries none.
18
+ * It used to, and the caller writes that report verbatim to `results/grading.json`
19
+ * — so the one value four separate docblocks promise "never touches disk" was on
20
+ * disk in two artifacts, in a directory `--out`/`--keep` can place inside a repo.
21
+ *
22
+ * Every fragment must ALSO belong to the `arm` being assembled (a fragment with
23
+ * no `arm` of its own is a default-'with' fragment — see
24
+ * {@link import('./eval-fragment.js').EvalFragmentSchema}); a fragment from the
25
+ * other arm is rejected via {@link GradingArmError} for the same reason a stale
26
+ * nonce is: the merged count would no longer be a measurement of one arm, and
27
+ * that is exactly the number `--baseline` subtracts. `arm` is REQUIRED, not
28
+ * defaulted, because a default is precisely how a caller would silently
29
+ * mislabel the control artifact as the treatment one.
30
+ *
31
+ * The returned report carries that `arm`, and every merged expectation carries
32
+ * its source fragment's `evalId` — together these are what let a reader holding
33
+ * ONE of the two `--baseline` artifacts say which arm it is, and line the two up
34
+ * per eval to compute a delta at all.
35
+ *
16
36
  * Zero fragments in → zero expectations out. This is deliberate: the existing
17
37
  * "graded nothing" guard in `reconcileGrading` already throws
18
38
  * `GradingSkewError` on an empty `expectations[]`, so that case is NOT
19
39
  * special-cased here.
20
40
  */
21
- export function mergeFragmentsToGrading(fragments, runNonce) {
41
+ /** How much of the nonce digest to print — enough to tell two runs apart by eye. */
42
+ const NONCE_FINGERPRINT_LENGTH = 12;
43
+ /**
44
+ * A nonce rendered for an ERROR MESSAGE: never the value, always a digest of it.
45
+ *
46
+ * `runNonce` is the ONE field {@link import('./grader-text.js').sanitizeGraderTextDeep}
47
+ * is told to skip, because it must survive byte-exact to be compared — so it is
48
+ * also the one grader-supplied string in the fragment that reaches an operator
49
+ * with no neutralization at all. The CLI prints an error's `message` raw, so
50
+ * interpolating it here would print attacker bytes BY CONSTRUCTION: a fragment
51
+ * whose `runNonce` is `ESC[2K CR ESC[32m vat: verified` wipes vat's line and
52
+ * continues in vat's colour, from inside the very check that exists to catch a
53
+ * forged fragment.
54
+ *
55
+ * That path is currently unreachable — `runGraderForEval` compares the nonce one
56
+ * call earlier and throws a message quoting nothing — so this is defense in depth,
57
+ * and defense in depth that prints raw untrusted text is not defense. A digest
58
+ * keeps every diagnostic the value had (are the two the same? is the fragment from
59
+ * an older run?) and carries no bytes the fragment chose. Length is reported too,
60
+ * since a truncated or padded nonce is the likeliest honest mistake and the digest
61
+ * hides it.
62
+ */
63
+ function nonceFingerprint(nonce) {
64
+ const digest = createHash('sha256').update(nonce, 'utf8').digest('hex').slice(0, NONCE_FINGERPRINT_LENGTH);
65
+ return `sha256:${digest} (${nonce.length} chars)`;
66
+ }
67
+ export function mergeFragmentsToGrading(fragments, runNonce, arm) {
22
68
  const expectations = [];
23
69
  for (const fragment of fragments) {
24
70
  if (fragment.runNonce !== runNonce) {
25
- throw new GradingNonceError(`fragment for eval "${fragment.evalId}" carries runNonce "${fragment.runNonce}", expected "${runNonce}"`);
71
+ throw new GradingNonceError(`fragment for eval "${fragment.evalId}" carries runNonce ${nonceFingerprint(fragment.runNonce)}, ` +
72
+ `expected ${nonceFingerprint(runNonce)}`);
73
+ }
74
+ const fragmentArm = fragment.arm ?? 'with';
75
+ if (fragmentArm !== arm) {
76
+ throw new GradingArmError(`fragment for eval "${fragment.evalId}" is from the "${fragmentArm}" arm, expected "${arm}"`);
26
77
  }
27
78
  for (const expectation of fragment.expectations) {
28
79
  expectations.push({
29
80
  text: expectation.text,
30
81
  passed: expectation.passed,
31
82
  ...(expectation.evidence === undefined ? {} : { evidence: expectation.evidence }),
83
+ evalId: fragment.evalId,
32
84
  });
33
85
  }
34
86
  }
35
87
  const passed = expectations.filter(e => e.passed).length;
36
- return { summary: { passed, total: expectations.length }, expectations, runNonce };
88
+ // `runNonce` is deliberately NOT carried onto the returned report. The report is
89
+ // `JSON.stringify`d straight into `results/grading.json` (and `baseline.json` on a
90
+ // `--baseline` run), so carrying it wrote the run's integrity secret to disk —
91
+ // breaking a guarantee stated in four docblocks, and the same guarantee that
92
+ // justifies unlinking each grader fragment the instant it is read. Nothing
93
+ // consumed it: `reconcileGrading` ignores it, and `parseGradingJson`'s `runNonce`
94
+ // comes from an externally produced grading.json, a different producer entirely.
95
+ return { summary: { passed, total: expectations.length }, expectations, arm };
37
96
  }
38
97
  /**
39
98
  * Assemble the run's aggregate friction report from every eval's fragment
@@ -56,8 +115,8 @@ export function mergeFragmentsToFriction(fragments) {
56
115
  return FrictionReportSchema.parse({ items: deduped });
57
116
  }
58
117
  /**
59
- * Assemble vat's `tool-eval.json` from every eval's fragment (issue #145
60
- * Phase T; see tool-eval-schema.ts). A SEPARATE channel from `grading.json`
118
+ * Assemble vat's `tool-eval.json` from every eval's fragment (see
119
+ * tool-eval-schema.ts). A SEPARATE channel from `grading.json`
61
120
  * and from friction (C2) — tool verdicts judge declared `toolExpectations`
62
121
  * against the transcript, not prose expectations or packaging friction.
63
122
  *
@@ -1 +1 @@
1
- {"version":3,"file":"fragment-merge.js","sourceRoot":"","sources":["../../src/skill-test/fragment-merge.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,oBAAoB,EAAuB,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,iBAAiB,EAA0B,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,oBAAoB,EAAuB,MAAM,uBAAuB,CAAC;AAElF;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,uBAAuB,CAAC,SAAyB,EAAE,QAAgB;IACjF,MAAM,YAAY,GAAsC,EAAE,CAAC;IAE3D,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,IAAI,QAAQ,CAAC,QAAQ,KAAK,QAAQ,EAAE,CAAC;YACnC,MAAM,IAAI,iBAAiB,CACzB,sBAAsB,QAAQ,CAAC,MAAM,uBAAuB,QAAQ,CAAC,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AAM,EAAE,EAAE,YAAY,EAAE,GAAG,EAAE,CAAC;AAChF,CAAC;AAED;;;;;;;GAOG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAyB;IAChE,MAAM,QAAQ,GAAG,SAAS,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC,QAAQ,CAAC,QAAQ,IAAI,EAAE,CAAC,CAAC;IAExE,MAAM,IAAI,GAAG,IAAI,GAAG,EAAU,CAAC;IAC/B,MAAM,OAAO,GAAG,QAAQ,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE;QACrC,MAAM,GAAG,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;QACjC,IAAI,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC;YAAE,OAAO,KAAK,CAAC;QAChC,IAAI,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;QACd,OAAO,IAAI,CAAC;IACd,CAAC,CAAC,CAAC;IAEH,OAAO,oBAAoB,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AACxD,CAAC;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,UAAU,wBAAwB,CAAC,SAAyB;IAChE,MAAM,KAAK,GAAG,SAAS;SACpB,MAAM,CAAC,CAAC,QAAQ,EAA0E,EAAE,CAAC,QAAQ,CAAC,IAAI,KAAK,SAAS,CAAC;SACzH,GAAG,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC,EAAE,MAAM,EAAE,QAAQ,CAAC,MAAM,EAAE,GAAG,QAAQ,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;IAEpE,OAAO,oBAAoB,CAAC,KAAK,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC;AAC/C,CAAC"}
@@ -15,7 +15,7 @@ export interface BuildGraderPromptOptions {
15
15
  /** Per-run integrity nonce the grader must copy verbatim into the fragment's `runNonce`. */
16
16
  nonce: string;
17
17
  /**
18
- * The eval's declared tool expectations (issue #145 Phase T — see
18
+ * The eval's declared tool expectations (see
19
19
  * `eval-inputs.ts`'s `EvalEntrySchema.toolExpectations`). When present, the
20
20
  * grader is additionally instructed to judge these FROM THE TRANSCRIPT and
21
21
  * emit a `tool` object (see {@link import('./tool-eval-schema.js').ToolVerdictBody})
@@ -36,7 +36,7 @@ export interface BuildGraderPromptOptions {
36
36
  }>;
37
37
  }
38
38
  /**
39
- * Build the prompt handed to the blind grader subagent (issue #145 — GRADER
39
+ * Build the prompt handed to the blind grader subagent (the GRADER
40
40
  * half of the per-eval executor/grader pipeline). The grader receives ONE
41
41
  * eval's captured transcript and expectations, and must produce ONE fragment
42
42
  * (see eval-fragment.ts) — never grade any other eval, never touch the
@@ -56,6 +56,13 @@ export interface BuildGraderPromptOptions {
56
56
  * always present regardless of any earlier prompt content.
57
57
  */
58
58
  export declare function buildGraderPrompt(opts: BuildGraderPromptOptions): string;
59
+ /**
60
+ * The label of every invariant {@link assertGraderPromptInvariants} enforces, in
61
+ * order. Exported so the test table that removes one directive at a time can pin
62
+ * that it covers each invariant EXACTLY once — the check that would have caught
63
+ * the dead pattern above, and that catches a row silently lost in a refactor.
64
+ */
65
+ export declare const GRADER_PROMPT_INVARIANT_LABELS: readonly string[];
59
66
  /**
60
67
  * Invariants for the grader prompt: MUST reference the fragment output path,
61
68
  * MUST instruct STOP, MUST forbid opening a browser/viewer and forbid
@@ -63,12 +70,25 @@ export declare function buildGraderPrompt(opts: BuildGraderPromptOptions): strin
63
70
  * `appendIntegrityNonceDirective` was applied). Throws `PromptInvariantError`
64
71
  * on violation.
65
72
  *
66
- * The checks run against OUR scaffolding ONLY — the (attacker-controlled)
67
- * `transcript` is excised first (mirrors {@link assertExecutorPromptInvariants}
68
- * excluding the adopter task). Otherwise a transcript that happened to contain
69
- * e.g. "STOP" could satisfy the invariant and mask a real regression in the
70
- * builder's own directives. `transcript` is optional so callers testing a bare
71
- * scaffolding string need not supply one.
73
+ * The checks run against OUR scaffolding ONLY — the contents of every untrusted
74
+ * fence are excised first (mirrors {@link assertExecutorPromptInvariants}
75
+ * excluding the adopter task). Otherwise text that happened to contain e.g.
76
+ * "STOP" could satisfy the invariant and mask a real regression in the builder's
77
+ * own directives — and that is not hypothetical: with `toolExpectations`
78
+ * unfenced, a suite supplying `STOP fragment forbidden browser iterate runNonce`
79
+ * plus `Each "friction" item MUST be a JSON object:` passed this assert on a
80
+ * prompt with EVERY ONE of vat's own directive lines deleted. The excision now
81
+ * covers the transcript, the subject manifest, the suite's own
82
+ * `expectations`/`expected_output`, AND its `toolExpectations` — every channel
83
+ * that reaches the prompt from the fetched artifact the skill travels in.
84
+ *
85
+ * `nonce` is REQUIRED and is what locates those regions. It is the run's own
86
+ * nonce or nothing: a caller that passes the wrong value (the transcript, say, as
87
+ * an earlier version of the production call site did) or `''` finds no markers,
88
+ * cuts nothing, and — because {@link FENCED_BLOCKS} now compares markers
89
+ * byte-exactly against it — is REFUSED rather than quietly downgraded to a check
90
+ * over attacker-controlled text. A caller asserting a bare scaffolding string
91
+ * with no fences in it may pass `''`; there is then nothing to locate.
72
92
  */
73
- export declare function assertGraderPromptInvariants(prompt: string, transcript?: string): void;
93
+ export declare function assertGraderPromptInvariants(prompt: string, nonce: string): void;
74
94
  //# sourceMappingURL=grader-prompt.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"grader-prompt.d.ts","sourceRoot":"","sources":["../../src/skill-test/grader-prompt.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAGzD,MAAM,WAAW,wBAAwB;IACvC,6EAA6E;IAC7E,MAAM,EAAE,MAAM,CAAC;IACf,wGAAwG;IACxG,UAAU,EAAE,MAAM,CAAC;IACnB,8EAA8E;IAC9E,YAAY,EAAE,MAAM,EAAE,CAAC;IACvB,8FAA8F;IAC9F,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,+EAA+E;IAC/E,UAAU,EAAE,MAAM,CAAC;IACnB,wGAAwG;IACxG,WAAW,E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