@vibe-agent-toolkit/agent-skills 0.2.0-rc.7 → 0.2.0-rc.8

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 (208) 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/files-config.d.ts +2 -2
  6. package/dist/files-config.d.ts.map +1 -1
  7. package/dist/files-config.js +1 -7
  8. package/dist/files-config.js.map +1 -1
  9. package/dist/import.d.ts.map +1 -1
  10. package/dist/import.js +0 -4
  11. package/dist/import.js.map +1 -1
  12. package/dist/inventory/types.d.ts +8 -0
  13. package/dist/inventory/types.d.ts.map +1 -1
  14. package/dist/inventory/types.js.map +1 -1
  15. package/dist/plugin-distribution-layout.d.ts.map +1 -1
  16. package/dist/plugin-distribution-layout.js +0 -2
  17. package/dist/plugin-distribution-layout.js.map +1 -1
  18. package/dist/post-build-checks.d.ts.map +1 -1
  19. package/dist/post-build-checks.js +12 -11
  20. package/dist/post-build-checks.js.map +1 -1
  21. package/dist/schemas/installed-plugins-registry.d.ts.map +1 -1
  22. package/dist/schemas/installed-plugins-registry.js +7 -1
  23. package/dist/schemas/installed-plugins-registry.js.map +1 -1
  24. package/dist/skill-identity.d.ts +8 -3
  25. package/dist/skill-identity.d.ts.map +1 -1
  26. package/dist/skill-identity.js +13 -6
  27. package/dist/skill-identity.js.map +1 -1
  28. package/dist/skill-packager.d.ts +2 -1
  29. package/dist/skill-packager.d.ts.map +1 -1
  30. package/dist/skill-packager.js +47 -40
  31. package/dist/skill-packager.js.map +1 -1
  32. package/dist/skill-source/content-hash.d.ts.map +1 -1
  33. package/dist/skill-source/content-hash.js +21 -10
  34. package/dist/skill-source/content-hash.js.map +1 -1
  35. package/dist/skill-source/fetch-cache.d.ts.map +1 -1
  36. package/dist/skill-source/fetch-cache.js +0 -5
  37. package/dist/skill-source/fetch-cache.js.map +1 -1
  38. package/dist/skill-source/git-clone.d.ts.map +1 -1
  39. package/dist/skill-source/git-clone.js +0 -2
  40. package/dist/skill-source/git-clone.js.map +1 -1
  41. package/dist/skill-source/sources/url-source.d.ts.map +1 -1
  42. package/dist/skill-source/sources/url-source.js +0 -1
  43. package/dist/skill-source/sources/url-source.js.map +1 -1
  44. package/dist/skill-source/stage.d.ts.map +1 -1
  45. package/dist/skill-source/stage.js +0 -6
  46. package/dist/skill-source/stage.js.map +1 -1
  47. package/dist/skill-test/baseline-integrity.d.ts.map +1 -1
  48. package/dist/skill-test/baseline-integrity.js +8 -2
  49. package/dist/skill-test/baseline-integrity.js.map +1 -1
  50. package/dist/skill-test/build-hook.d.ts +3 -2
  51. package/dist/skill-test/build-hook.d.ts.map +1 -1
  52. package/dist/skill-test/build-hook.js +4 -4
  53. package/dist/skill-test/build-hook.js.map +1 -1
  54. package/dist/skill-test/declared-env.d.ts +5 -4
  55. package/dist/skill-test/declared-env.d.ts.map +1 -1
  56. package/dist/skill-test/declared-env.js +7 -9
  57. package/dist/skill-test/declared-env.js.map +1 -1
  58. package/dist/skill-test/eval-executor.d.ts +1 -1
  59. package/dist/skill-test/eval-executor.js +2 -2
  60. package/dist/skill-test/eval-executor.js.map +1 -1
  61. package/dist/skill-test/eval-fragment.d.ts +7 -5
  62. package/dist/skill-test/eval-fragment.d.ts.map +1 -1
  63. package/dist/skill-test/eval-fragment.js +13 -7
  64. package/dist/skill-test/eval-fragment.js.map +1 -1
  65. package/dist/skill-test/eval-grader.d.ts +56 -4
  66. package/dist/skill-test/eval-grader.d.ts.map +1 -1
  67. package/dist/skill-test/eval-grader.js +138 -73
  68. package/dist/skill-test/eval-grader.js.map +1 -1
  69. package/dist/skill-test/eval-inputs.d.ts +8 -7
  70. package/dist/skill-test/eval-inputs.d.ts.map +1 -1
  71. package/dist/skill-test/eval-inputs.js +9 -11
  72. package/dist/skill-test/eval-inputs.js.map +1 -1
  73. package/dist/skill-test/eval-lint.d.ts +4 -4
  74. package/dist/skill-test/eval-lint.js +5 -5
  75. package/dist/skill-test/eval-lint.js.map +1 -1
  76. package/dist/skill-test/eval-suite-isolation.d.ts.map +1 -1
  77. package/dist/skill-test/eval-suite-isolation.js +8 -5
  78. package/dist/skill-test/eval-suite-isolation.js.map +1 -1
  79. package/dist/skill-test/evals-template.d.ts +1 -1
  80. package/dist/skill-test/evals-template.d.ts.map +1 -1
  81. package/dist/skill-test/evals-template.js +1 -3
  82. package/dist/skill-test/evals-template.js.map +1 -1
  83. package/dist/skill-test/executor-prompt.d.ts +2 -2
  84. package/dist/skill-test/executor-prompt.js +2 -2
  85. package/dist/skill-test/failure-reason.d.ts +113 -0
  86. package/dist/skill-test/failure-reason.d.ts.map +1 -0
  87. package/dist/skill-test/failure-reason.js +124 -0
  88. package/dist/skill-test/failure-reason.js.map +1 -0
  89. package/dist/skill-test/fragment-merge.d.ts +2 -2
  90. package/dist/skill-test/fragment-merge.js +4 -4
  91. package/dist/skill-test/grader-prompt.d.ts +2 -2
  92. package/dist/skill-test/grader-prompt.d.ts.map +1 -1
  93. package/dist/skill-test/grader-prompt.js +12 -8
  94. package/dist/skill-test/grader-prompt.js.map +1 -1
  95. package/dist/skill-test/grading-adapter.d.ts +7 -3
  96. package/dist/skill-test/grading-adapter.d.ts.map +1 -1
  97. package/dist/skill-test/grading-adapter.js +10 -9
  98. package/dist/skill-test/grading-adapter.js.map +1 -1
  99. package/dist/skill-test/harness-location.d.ts +3 -2
  100. package/dist/skill-test/harness-location.d.ts.map +1 -1
  101. package/dist/skill-test/harness-location.js +5 -16
  102. package/dist/skill-test/harness-location.js.map +1 -1
  103. package/dist/skill-test/index.d.ts +1 -1
  104. package/dist/skill-test/index.d.ts.map +1 -1
  105. package/dist/skill-test/index.js +1 -1
  106. package/dist/skill-test/index.js.map +1 -1
  107. package/dist/skill-test/lock.d.ts +11 -10
  108. package/dist/skill-test/lock.d.ts.map +1 -1
  109. package/dist/skill-test/lock.js +13 -14
  110. package/dist/skill-test/lock.js.map +1 -1
  111. package/dist/skill-test/pipeline.d.ts +3 -1
  112. package/dist/skill-test/pipeline.d.ts.map +1 -1
  113. package/dist/skill-test/pipeline.js +5 -1
  114. package/dist/skill-test/pipeline.js.map +1 -1
  115. package/dist/skill-test/preflight.d.ts.map +1 -1
  116. package/dist/skill-test/preflight.js +0 -1
  117. package/dist/skill-test/preflight.js.map +1 -1
  118. package/dist/skill-test/prompt-invariants.d.ts +4 -2
  119. package/dist/skill-test/prompt-invariants.d.ts.map +1 -1
  120. package/dist/skill-test/prompt-invariants.js +5 -4
  121. package/dist/skill-test/prompt-invariants.js.map +1 -1
  122. package/dist/skill-test/run-harness.d.ts +160 -123
  123. package/dist/skill-test/run-harness.d.ts.map +1 -1
  124. package/dist/skill-test/run-harness.js +309 -173
  125. package/dist/skill-test/run-harness.js.map +1 -1
  126. package/dist/skill-test/staging.d.ts +12 -6
  127. package/dist/skill-test/staging.d.ts.map +1 -1
  128. package/dist/skill-test/staging.js +15 -12
  129. package/dist/skill-test/staging.js.map +1 -1
  130. package/dist/skill-test/tier-plan.d.ts +1 -1
  131. package/dist/skill-test/tier-plan.js +1 -1
  132. package/dist/skill-test/tool-eval-schema.js +2 -2
  133. package/dist/skill-test/vendor-manifest.d.ts +2 -1
  134. package/dist/skill-test/vendor-manifest.d.ts.map +1 -1
  135. package/dist/skill-test/vendor-manifest.js +10 -10
  136. package/dist/skill-test/vendor-manifest.js.map +1 -1
  137. package/dist/test-input.d.ts +2 -2
  138. package/dist/test-input.d.ts.map +1 -1
  139. package/dist/test-input.js +4 -5
  140. package/dist/test-input.js.map +1 -1
  141. package/dist/validators/agent-instruction-presence.d.ts.map +1 -1
  142. package/dist/validators/agent-instruction-presence.js +0 -1
  143. package/dist/validators/agent-instruction-presence.js.map +1 -1
  144. package/dist/validators/bundled-resource-link-detection.d.ts +5 -3
  145. package/dist/validators/bundled-resource-link-detection.d.ts.map +1 -1
  146. package/dist/validators/bundled-resource-link-detection.js +38 -38
  147. package/dist/validators/bundled-resource-link-detection.js.map +1 -1
  148. package/dist/validators/format-detection.d.ts +3 -0
  149. package/dist/validators/format-detection.d.ts.map +1 -1
  150. package/dist/validators/format-detection.js +41 -26
  151. package/dist/validators/format-detection.js.map +1 -1
  152. package/dist/validators/frontmatter-validation.js +1 -1
  153. package/dist/validators/frontmatter-validation.js.map +1 -1
  154. package/dist/validators/marketplace-validator.d.ts.map +1 -1
  155. package/dist/validators/marketplace-validator.js +0 -1
  156. package/dist/validators/marketplace-validator.js.map +1 -1
  157. package/dist/validators/mcp-tool-qualification.d.ts +1 -1
  158. package/dist/validators/mcp-tool-qualification.js +1 -1
  159. package/dist/validators/packaged-size-limit.d.ts.map +1 -1
  160. package/dist/validators/packaged-size-limit.js +0 -2
  161. package/dist/validators/packaged-size-limit.js.map +1 -1
  162. package/dist/validators/packaging-validator.d.ts +2 -2
  163. package/dist/validators/packaging-validator.d.ts.map +1 -1
  164. package/dist/validators/packaging-validator.js +8 -11
  165. package/dist/validators/packaging-validator.js.map +1 -1
  166. package/dist/validators/plugin-hosted-shape.d.ts +3 -1
  167. package/dist/validators/plugin-hosted-shape.d.ts.map +1 -1
  168. package/dist/validators/plugin-hosted-shape.js +5 -6
  169. package/dist/validators/plugin-hosted-shape.js.map +1 -1
  170. package/dist/validators/referenced-path-missing.d.ts.map +1 -1
  171. package/dist/validators/referenced-path-missing.js +0 -1
  172. package/dist/validators/referenced-path-missing.js.map +1 -1
  173. package/dist/validators/registry-validator.d.ts.map +1 -1
  174. package/dist/validators/registry-validator.js +0 -1
  175. package/dist/validators/registry-validator.js.map +1 -1
  176. package/dist/validators/rule-engine/index.d.ts +1 -1
  177. package/dist/validators/rule-engine/rule-context.d.ts +3 -3
  178. package/dist/validators/rule-engine/rule-context.js +1 -1
  179. package/dist/validators/rule-engine/rule-engine.d.ts +1 -1
  180. package/dist/validators/rule-engine/rule-engine.js +5 -5
  181. package/dist/validators/rule-engine/rule-engine.js.map +1 -1
  182. package/dist/validators/skill-validator.d.ts.map +1 -1
  183. package/dist/validators/skill-validator.js +41 -51
  184. package/dist/validators/skill-validator.js.map +1 -1
  185. package/dist/validators/source-only-codes.js +1 -1
  186. package/dist/validators/source-only-codes.js.map +1 -1
  187. package/dist/validators/types.d.ts +7 -1
  188. package/dist/validators/types.d.ts.map +1 -1
  189. package/dist/validators/unified-validator.d.ts.map +1 -1
  190. package/dist/validators/unified-validator.js +3 -4
  191. package/dist/validators/unified-validator.js.map +1 -1
  192. package/dist/validators/validation-rules.d.ts +3 -3
  193. package/dist/validators/validation-rules.d.ts.map +1 -1
  194. package/dist/validators/validation-rules.js +9 -38
  195. package/dist/validators/validation-rules.js.map +1 -1
  196. package/dist/validators/walker-to-issues.d.ts +2 -0
  197. package/dist/validators/walker-to-issues.d.ts.map +1 -1
  198. package/dist/validators/walker-to-issues.js +17 -12
  199. package/dist/validators/walker-to-issues.js.map +1 -1
  200. package/dist/walk-link-graph.d.ts +2 -0
  201. package/dist/walk-link-graph.d.ts.map +1 -1
  202. package/dist/walk-link-graph.js +20 -8
  203. package/dist/walk-link-graph.js.map +1 -1
  204. package/package.json +11 -19
  205. package/dist/skill-test/exit-codes.d.ts +0 -134
  206. package/dist/skill-test/exit-codes.d.ts.map +0 -1
  207. package/dist/skill-test/exit-codes.js +0 -224
  208. package/dist/skill-test/exit-codes.js.map +0 -1
@@ -1,3 +1,4 @@
1
+ import { VatError } from '@vibe-agent-toolkit/utils';
1
2
  import { z } from 'zod';
2
3
  import { BaselineContaminationHitSchema, BaselineScanDegradationSchema } from './baseline-integrity.js';
3
4
  import { FrictionItemSchema } from './friction-schema.js';
@@ -10,7 +11,7 @@ export const EvalFragmentExpectationSchema = z.object({
10
11
  evidence: z.string().optional(),
11
12
  }).strict();
12
13
  /**
13
- * Strict shape of a single grader subagent's output (issue #145 Task 4). One
14
+ * Strict shape of a single grader subagent's output. One
14
15
  * GRADER spawn grades ONE eval's expectations from that eval's captured
15
16
  * transcript and writes exactly one fragment matching this schema; vat reads
16
17
  * every eval's fragment back and merges them into the run's aggregate grading
@@ -23,7 +24,7 @@ export const EvalFragmentExpectationSchema = z.object({
23
24
  * `arm` distinguishes a WITH/WITHOUT baseline run's fragment; absent means the
24
25
  * default 'with' (skill present) arm.
25
26
  *
26
- * `tool` (issue #145 Phase T) carries this eval's tool-expectation verdict —
27
+ * `tool` carries this eval's tool-expectation verdict —
27
28
  * a SEPARATE channel from `expectations[]` and from `friction` (see
28
29
  * tool-eval-schema.ts). It is {@link ToolVerdictBodySchema}, i.e. a
29
30
  * {@link import('./tool-eval-schema.js').ToolVerdict} WITHOUT `evalId`: the
@@ -33,7 +34,10 @@ export const EvalFragmentExpectationSchema = z.object({
33
34
  */
34
35
  export const EvalFragmentSchema = z.object({
35
36
  runNonce: z.string().min(1),
36
- evalId: z.string().min(1),
37
+ // evals.json allows an integer id and every other layer carries it as a
38
+ // string; a grader that echoes the number names the same eval, so it is
39
+ // normalised here rather than refused as a forged fragment.
40
+ evalId: z.union([z.string().min(1), z.number().int()]).transform(String),
37
41
  arm: z.enum(['with', 'without']).optional(),
38
42
  expectations: z.array(EvalFragmentExpectationSchema).min(1),
39
43
  friction: z.array(FrictionItemSchema).optional(),
@@ -72,10 +76,10 @@ export const EvalFragmentSchema = z.object({
72
76
  * should point at the offending eval, not at "Re-sync the vendored
73
77
  * skill-creator".
74
78
  */
75
- export class EvalFragmentError extends Error {
79
+ export class EvalFragmentError extends VatError {
80
+ reason = 'internal';
76
81
  constructor(message) {
77
- super(message);
78
- this.name = 'EvalFragmentError';
82
+ super('EVAL_FRAGMENT', message);
79
83
  }
80
84
  }
81
85
  /**
@@ -88,6 +92,8 @@ export class EvalFragmentError extends Error {
88
92
  function extractRawEvalId(raw) {
89
93
  if (typeof raw === 'object' && raw !== null && 'evalId' in raw) {
90
94
  const value = raw['evalId'];
95
+ if (typeof value === 'number')
96
+ return `"${String(value)}"`;
91
97
  if (typeof value === 'string' && value.length > 0)
92
98
  return `"${sanitizeGraderText(value)}"`;
93
99
  }
@@ -106,7 +112,7 @@ const UNSANITIZED_FRAGMENT_KEYS = new Set(['runNonce']);
106
112
  * Sanitize ONLY the (non-verdict-bearing) `friction` field before the strict
107
113
  * fragment parse. Friction is auxiliary advisory data, not a verdict channel —
108
114
  * so a grader that wobbles on the friction shape (e.g. emits bare strings, the
109
- * common failure mode — PR #147) must NOT be allowed to discard the
115
+ * common failure mode) must NOT be allowed to discard the
110
116
  * verdict-bearing grading for the whole run. We drop friction items that don't
111
117
  * match {@link FrictionItemSchema} (and a `friction` that isn't an array at
112
118
  * all), then hand the rest to the STRICT fragment parse — so the verdict
@@ -1 +1 @@
1
- {"version":3,"file":"eval-fragment.js","sourceRoot":"","sources":["../../src/skill-test/eval-fragment.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,EAAE,8BAA8B,EAAE,6BAA6B,EAAE,MAAM,yBAAyB,CAAC;AACxG,OAAO,EAAE,kBAAkB,EAAE,MAAM,sBAAsB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,sBAAsB,EAAE,MAAM,kBAAkB,CAAC;AAC9E,OAAO,EAAE,qBAAqB,EAAE,MAAM,uBAAuB,CAAC;AAE9D,gEAAgE;AAChE,MAAM,CAAC,MAAM,6BAA6B,GAAG,CAAC,CAAC,MAAM,CAAC;IACpD,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CAChC,CAAC,CAAC,MAAM,EAAE,CAAC;AAIZ;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAM,CAAC,MAAM,kBAAkB,GAAG,CAAC,CAAC,MAAM,CAAC;IACzC,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC;IAC3B,MAAM,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,G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AAE,OAAO,EAAE,GAAG,qBAAqB,CAAC,SAAS,CAAC,CAAC;IAC5D,IAAI,OAAO,GAAG,CAAC,EAAE,CAAC;QAChB,MAAM,CACJ,4BAA4B,gBAAgB,CAAC,SAAS,CAAC,QAAQ,OAAO,gCAAgC;YACpG,6DAA6D,CAChE,CAAC;IACJ,CAAC;IACD,MAAM,MAAM,GAAG,kBAAkB,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;IACnD,IAAI,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC;QACpB,MAAM,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC;QAC1C,4EAA4E;QAC5E,0EAA0E;QAC1E,6EAA6E;QAC7E,4EAA4E;QAC5E,uEAAuE;QACvE,MAAM,IAAI,GAAG,kBAAkB,CAAC,UAAU,EAAE,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,IAAI,QAAQ,CAAC,CAAC;QACxE,MAAM,KAAK,GAAG,kBAAkB,CAAC,UAAU,EAAE,OAAO,IAAI,SAAS,CAAC,CAAC;QACnE,MAAM,MAAM,GAAG,gBAAgB,CAAC,SAAS,CAAC,CAAC;QAC3C,MAAM,IAAI,iBAAiB,CACzB,4BAA4B,MAAM,4CAA4C,IAAI,MAAM,KAAK,GAAG,CACjG,CAAC;IACJ,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC"}
@@ -1,3 +1,4 @@
1
+ import { VatError } from '@vibe-agent-toolkit/utils';
1
2
  import { spawnHeadlessClaude } from '@vibe-agent-toolkit/utils/skill-test';
2
3
  import { type EvalFragment } from './eval-fragment.js';
3
4
  import type { ToolExpectations } from './eval-inputs.js';
@@ -10,7 +11,7 @@ export interface RunGraderInput {
10
11
  /** Path to the vendored skill-creator grader rubric (references/grader.md). */
11
12
  rubricPath: string;
12
13
  /**
13
- * The eval's declared tool expectations (issue #145 Phase T). Optional — when
14
+ * The eval's declared tool expectations. Optional — when
14
15
  * absent, `buildGraderPrompt` emits no tool-verdict instruction and the
15
16
  * returned fragment omits `tool`. See `grader-prompt.ts`'s
16
17
  * `BuildGraderPromptOptions.toolExpectations`.
@@ -49,12 +50,63 @@ export interface RunGraderInput {
49
50
  */
50
51
  onProgress: (chunk: string) => void;
51
52
  /**
52
- * Reports this grader session's `total_cost_usd` (parsed from its stream-json
53
+ * Reports each grader session's `total_cost_usd` (parsed from its stream-json
53
54
  * transcript's terminal result; `undefined` when the transcript carried none,
54
- * e.g. a mock spawn). Called once after a successful grader spawn so the run can
55
- * aggregate total spend across all executor+grader sessions (adopter follow-up).
55
+ * e.g. a mock spawn). Called once per successful grader spawn — twice when the
56
+ * unparseable-fragment re-grade fires — so the run can aggregate total spend
57
+ * across all executor+grader sessions (adopter follow-up).
56
58
  */
57
59
  costSink?: (totalCostUsd: number | undefined) => void;
58
60
  }
61
+ /** The reason named in {@link GraderFragmentUnparseableError}'s message and in every `evidence` of the failing fragment vat synthesizes from it. */
62
+ export declare const GRADER_FRAGMENT_UNPARSEABLE = "grader-fragment-unparseable";
63
+ /**
64
+ * Thrown when the grader's fragment was not valid JSON on BOTH attempts (see
65
+ * {@link runGraderForEval}). A per-eval GRADING failure, deliberately neither
66
+ * {@link InternalHarnessError} nor `EvalFragmentError`: the harness did its
67
+ * job twice and the model could not write strict JSON, which is a verdict about
68
+ * this eval's grading, not about the suite — so it ends on the verdict path
69
+ * (`FINDINGS`), never on `ERROR` with `Reason: internal`. `runEvalWorker` (run-harness.ts)
70
+ * turns it into that eval's failing fragment (reason
71
+ * {@link GRADER_FRAGMENT_UNPARSEABLE}) on the treatment arm, and into a recorded
72
+ * control-arm failure on the other — where a fabricated `fail` would read as
73
+ * skill lift. `detail` is already sanitized. Carries no `reason` on purpose:
74
+ * `skillTestFailureReason` would read it only if this escaped, and escaping IS
75
+ * the bug — the worker catches it on both arms.
76
+ */
77
+ export declare class GraderFragmentUnparseableError extends VatError {
78
+ readonly evalId: string;
79
+ readonly detail: string;
80
+ constructor(evalId: string, detail: string);
81
+ }
82
+ /**
83
+ * Run ONE eval's grader: a blind `claude -p` spawn (grader model, NO
84
+ * skill/plugin loaded) that reads the executor's captured transcript via its
85
+ * prompt and writes a nonce'd fragment JSON to `graderOutDir`.
86
+ * `graderOutDir` is vat-only and separate from the skill sandbox the
87
+ * executor ran in — the grader's `sandboxDir` --add-dir is
88
+ * `graderOutDir` itself, and `pluginDirs: []` means no skill code ever runs
89
+ * inside the grader's process, so skill code cannot forge or tamper with the
90
+ * fragment this run trusts.
91
+ *
92
+ * The grader is vat infrastructure, not the thing under test: unlike the
93
+ * executor (see eval-executor.ts), there is NO clean-failure path here. A
94
+ * spawn rejection, watchdog kill (`timedOut`/`stalled`), non-zero exit, or a
95
+ * missing fragment file all mean the grader failed to do its ONE job and are
96
+ * thrown as {@link InternalHarnessError} (`ERROR`, `Reason: internal`) — never laundered into a
97
+ * passing (or even a valid failing) verdict.
98
+ *
99
+ * A fragment that exists but is not valid JSON is the one exception, because
100
+ * the grader MODEL writes it: one bad escape in a free-text `evidence` took a
101
+ * six-eval suite down as harness-broke after five evals had graded fine. That
102
+ * attempt is re-run ONCE — same transcript, a FRESH nonce (so the stale file, or
103
+ * anything left behind, cannot satisfy the retry), the bad file consumed first,
104
+ * and the prompt told what went wrong. Only a second unparseable fragment
105
+ * surfaces, as {@link GraderFragmentUnparseableError}. Once a fragment parses,
106
+ * shape problems throw `EvalFragmentError` (via {@link parseEvalFragment})
107
+ * and a nonce that doesn't match the nonce THAT attempt was prompted with throws
108
+ * {@link GradingNonceError} — both fail-closed with no retry, because the grader
109
+ * DID produce JSON, just not JSON we can trust.
110
+ */
59
111
  export declare function runGraderForEval(input: RunGraderInput): Promise<EvalFragment>;
60
112
  //# sourceMappingURL=eval-grader.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"eval-grader.d.ts","sourceRoot":"","sources":["../../src/skill-test/eval-grader.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,mBAAmB,EACpB,MA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,KAAK,IAAI,CAAC;CACvD;AAED,oJAAoJ;AACpJ,eAAO,MAAM,2BAA2B,gCAAgC,CAAC;AAEzE;;;;;;;;;;;;;GAaG;AACH,qBAAa,8BAA+B,SAAQ,QAAQ;aAExC,MAAM,EAAE,MAAM;aACd,MAAM,EAAE,MAAM;gBADd,MAAM,EAAE,MAAM,EACd,MAAM,EAAE,MAAM;CAQjC;AAWD;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAsB,gBAAgB,CAAC,KAAK,EAAE,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC,CAwDnF"}
@@ -1,18 +1,53 @@
1
- import { existsSync, readFileSync, unlinkSync } from 'node:fs';
2
- import { mkdirSyncReal, safePath } from '@vibe-agent-toolkit/utils';
1
+ import { randomBytes } from 'node:crypto';
2
+ import { existsSync, readFileSync, rmSync } from 'node:fs';
3
+ import { mkdirSyncReal, safePath, VatError } from '@vibe-agent-toolkit/utils';
3
4
  import { parseStreamJsonTranscript, spawnHeadlessClaude, } from '@vibe-agent-toolkit/utils/skill-test';
4
- import { EvalFragmentError, parseEvalFragment } from './eval-fragment.js';
5
- import { InternalHarnessError } from './exit-codes.js';
5
+ import { parseEvalFragment } from './eval-fragment.js';
6
+ import { InternalHarnessError } from './failure-reason.js';
6
7
  import { assertGraderPromptInvariants, buildGraderPrompt } from './grader-prompt.js';
7
8
  import { sanitizeGraderText } from './grader-text.js';
8
9
  import { GradingNonceError } from './grading-adapter.js';
9
10
  import { computeToolPassed } from './tool-eval-schema.js';
11
+ /** The reason named in {@link GraderFragmentUnparseableError}'s message and in every `evidence` of the failing fragment vat synthesizes from it. */
12
+ export const GRADER_FRAGMENT_UNPARSEABLE = 'grader-fragment-unparseable';
13
+ /**
14
+ * Thrown when the grader's fragment was not valid JSON on BOTH attempts (see
15
+ * {@link runGraderForEval}). A per-eval GRADING failure, deliberately neither
16
+ * {@link InternalHarnessError} nor `EvalFragmentError`: the harness did its
17
+ * job twice and the model could not write strict JSON, which is a verdict about
18
+ * this eval's grading, not about the suite — so it ends on the verdict path
19
+ * (`FINDINGS`), never on `ERROR` with `Reason: internal`. `runEvalWorker` (run-harness.ts)
20
+ * turns it into that eval's failing fragment (reason
21
+ * {@link GRADER_FRAGMENT_UNPARSEABLE}) on the treatment arm, and into a recorded
22
+ * control-arm failure on the other — where a fabricated `fail` would read as
23
+ * skill lift. `detail` is already sanitized. Carries no `reason` on purpose:
24
+ * `skillTestFailureReason` would read it only if this escaped, and escaping IS
25
+ * the bug — the worker catches it on both arms.
26
+ */
27
+ export class GraderFragmentUnparseableError extends VatError {
28
+ evalId;
29
+ detail;
30
+ constructor(evalId, detail) {
31
+ super('SKILL_TEST_GRADER_FRAGMENT_UNPARSEABLE', `${GRADER_FRAGMENT_UNPARSEABLE}: the grader for eval "${evalId}" wrote a fragment that was not valid JSON ` +
32
+ `on either attempt (${detail}).`);
33
+ this.evalId = evalId;
34
+ this.detail = detail;
35
+ }
36
+ }
37
+ /**
38
+ * Adapt the grader's stdout `onProgress` sink into the `onWarn` callback
39
+ * {@link parseEvalFragment} requires (called only when it drops malformed
40
+ * friction items).
41
+ */
42
+ function fragmentWarnRouter(onProgress) {
43
+ return (message) => onProgress(`[skill-test] ${message}\n`);
44
+ }
10
45
  /**
11
46
  * Run ONE eval's grader: a blind `claude -p` spawn (grader model, NO
12
47
  * skill/plugin loaded) that reads the executor's captured transcript via its
13
- * prompt and writes a nonce'd fragment JSON to `graderOutDir` (issue #145
14
- * Task 8). `graderOutDir` is vat-only and separate from the skill sandbox the
15
- * executor ran in (Task 7) — the grader's `sandboxDir` --add-dir is
48
+ * prompt and writes a nonce'd fragment JSON to `graderOutDir`.
49
+ * `graderOutDir` is vat-only and separate from the skill sandbox the
50
+ * executor ran in — the grader's `sandboxDir` --add-dir is
16
51
  * `graderOutDir` itself, and `pluginDirs: []` means no skill code ever runs
17
52
  * inside the grader's process, so skill code cannot forge or tamper with the
18
53
  * fragment this run trusts.
@@ -21,23 +56,21 @@ import { computeToolPassed } from './tool-eval-schema.js';
21
56
  * executor (see eval-executor.ts), there is NO clean-failure path here. A
22
57
  * spawn rejection, watchdog kill (`timedOut`/`stalled`), non-zero exit, or a
23
58
  * missing fragment file all mean the grader failed to do its ONE job and are
24
- * thrown as {@link InternalHarnessError} (exit 1) — never laundered into a
59
+ * thrown as {@link InternalHarnessError} (`ERROR`, `Reason: internal`) — never laundered into a
25
60
  * passing (or even a valid failing) verdict.
26
61
  *
27
- * Once the fragment file exists, shape/JSON problems throw
28
- * {@link EvalFragmentError} (via {@link parseEvalFragment}) and a nonce that
29
- * doesn't match this run's expected nonce throws {@link GradingNonceError} —
30
- * both distinct from harness breakage because the grader DID run and produce
31
- * *something*, just not something we can trust.
62
+ * A fragment that exists but is not valid JSON is the one exception, because
63
+ * the grader MODEL writes it: one bad escape in a free-text `evidence` took a
64
+ * six-eval suite down as harness-broke after five evals had graded fine. That
65
+ * attempt is re-run ONCE — same transcript, a FRESH nonce (so the stale file, or
66
+ * anything left behind, cannot satisfy the retry), the bad file consumed first,
67
+ * and the prompt told what went wrong. Only a second unparseable fragment
68
+ * surfaces, as {@link GraderFragmentUnparseableError}. Once a fragment parses,
69
+ * shape problems throw `EvalFragmentError` (via {@link parseEvalFragment})
70
+ * and a nonce that doesn't match the nonce THAT attempt was prompted with throws
71
+ * {@link GradingNonceError} — both fail-closed with no retry, because the grader
72
+ * DID produce JSON, just not JSON we can trust.
32
73
  */
33
- /**
34
- * Adapt the grader's stdout `onProgress` sink into the `onWarn` callback
35
- * {@link parseEvalFragment} requires (called only when it drops malformed
36
- * friction items).
37
- */
38
- function fragmentWarnRouter(onProgress) {
39
- return (message) => onProgress(`[skill-test] ${message}\n`);
40
- }
41
74
  export async function runGraderForEval(input) {
42
75
  // 0700, like every other vat-only directory this codebase creates (the grader
43
76
  // root in `resolveGraderOutDir`, the workspaces root and every eval workspace in
@@ -53,17 +86,60 @@ export async function runGraderForEval(input) {
53
86
  // join is safe, but `joinUnderRoot` is used defensively — it costs nothing
54
87
  // and closes off any future path where an unvalidated id reaches here.
55
88
  const fragmentOut = safePath.joinUnderRoot(input.graderOutDir, `${input.evalId}.json`);
56
- const prompt = buildGraderPrompt({
89
+ let attempt = await runGraderAttempt(input, fragmentOut, input.nonce, undefined);
90
+ if (attempt.unparseable !== undefined) {
91
+ input.onProgress(`[skill-test] grader fragment for eval "${input.evalId}" was not valid JSON (${attempt.unparseable}); re-grading once.\n`);
92
+ // Minted here, not derived from the run nonce: the retry must accept nothing
93
+ // written under the first prompt.
94
+ attempt = await runGraderAttempt(input, fragmentOut, randomBytes(16).toString('hex'), attempt.unparseable);
95
+ if (attempt.unparseable !== undefined) {
96
+ throw new GraderFragmentUnparseableError(input.evalId, attempt.unparseable);
97
+ }
98
+ }
99
+ const fragment = parseEvalFragment(attempt.parsed, fragmentWarnRouter(input.onProgress));
100
+ // Integrity gate: a missing/wrong nonce means this fragment was not produced
101
+ // by the grader we prompted for THIS attempt — most likely forged or left
102
+ // behind by untrusted skill code — so the verdict cannot be trusted, hard error.
103
+ if (fragment.runNonce !== attempt.nonce) {
104
+ throw new GradingNonceError(`eval "${input.evalId}" fragment \`runNonce\` does not match this run`);
105
+ }
106
+ assertExpectationCountDeclared(input.evalId, input.expectations, fragment.expectations);
107
+ assertToolVerdictConsistent(input.evalId, input.toolExpectations, fragment.tool);
108
+ // The grader's only input is the executor transcript, which untrusted skill code
109
+ // controls, and `evalId` is schema-typed as any non-empty string. It is echoed
110
+ // verbatim into the run summary and into `baseline.json` — including the
111
+ // CONTAMINATED banner — so a grader talked into emitting an id containing
112
+ // newlines and ANSI escapes can paint a reassuring "known false positive, the
113
+ // delta is valid" line directly beneath vat's own warning. VAT knows which eval
114
+ // it asked about; take the id from the request, never from the answer.
115
+ //
116
+ // `runNonce` is re-stamped for the same reason: the merge re-verifies every
117
+ // fragment against the ONE nonce the run minted, and a re-graded fragment has
118
+ // already passed the gate above against the nonce its own prompt carried.
119
+ return { ...fragment, evalId: input.evalId, runNonce: input.nonce };
120
+ }
121
+ /**
122
+ * ONE grader spawn under `nonce`: build and assert the prompt, spawn, apply the
123
+ * harness-breakage gates, report cost, consume the fragment file. `previousFailure`
124
+ * is the re-grade's only difference — a trailing line telling the grader what its
125
+ * first fragment got wrong (sanitized where it was caught, at the bottom of this
126
+ * function). Required, not defaulted, so both call sites say which attempt they are.
127
+ */
128
+ async function runGraderAttempt(input, fragmentOut, nonce, previousFailure) {
129
+ const built = buildGraderPrompt({
57
130
  evalId: input.evalId,
58
131
  transcript: input.transcript,
59
132
  expectations: input.expectations,
60
133
  ...(input.expectedOutput === undefined ? {} : { expectedOutput: input.expectedOutput }),
61
134
  rubricPath: input.rubricPath,
62
135
  fragmentOut,
63
- nonce: input.nonce,
136
+ nonce,
64
137
  ...(input.toolExpectations === undefined ? {} : { toolExpectations: input.toolExpectations }),
65
138
  ...(input.declaredExecutables === undefined ? {} : { declaredExecutables: input.declaredExecutables }),
66
139
  });
140
+ const prompt = previousFailure === undefined
141
+ ? built
142
+ : `${built}\n\nYour previous fragment was not valid JSON: ${previousFailure}. Write strict JSON.`;
67
143
  // Defense-in-depth (parity with eval-executor.ts's build→assert→use pattern):
68
144
  // re-verify the built grader prompt still carries its required invariants
69
145
  // (STOP, fragment path, browser/iteration forbids, nonce directive, and the
@@ -73,7 +149,7 @@ export async function runGraderForEval(input) {
73
149
  // manifest, and the suite's own expectations/expected_output — and none of
74
150
  // that attacker-controlled text can satisfy an invariant on the builder's
75
151
  // behalf.
76
- assertGraderPromptInvariants(prompt, input.nonce);
152
+ assertGraderPromptInvariants(prompt, nonce);
77
153
  const spawn = input.spawn ?? spawnHeadlessClaude;
78
154
  // Accumulate the grader's stream-json stdout so we can read its terminal
79
155
  // `total_cost_usd` for run-wide spend aggregation (adopter follow-up). Held in
@@ -121,70 +197,59 @@ export async function runGraderForEval(input) {
121
197
  // the in-memory transcript (not the fragment) so it reflects real API spend even
122
198
  // under subscription auth; `undefined` when the transcript carried no result.
123
199
  input.costSink?.(parseStreamJsonTranscript(graderTranscript).result?.totalCostUsd);
124
- const raw = readAndConsumeFragmentFile(fragmentOut, input.evalId, spawnResult.status);
125
- const fragment = parseEvalFragment(raw, fragmentWarnRouter(input.onProgress));
126
- // Integrity gate: a missing/wrong nonce means this fragment was not produced
127
- // by the grader we prompted for THIS run — most likely forged or left behind
128
- // by untrusted skill code — so the verdict cannot be trusted, hard error.
129
- if (fragment.runNonce !== input.nonce) {
130
- throw new GradingNonceError(`eval "${input.evalId}" fragment \`runNonce\` does not match this run`);
200
+ const warn = fragmentWarnRouter(input.onProgress);
201
+ const text = readAndConsumeFragmentFile(fragmentOut, input.evalId, spawnResult.status, warn);
202
+ try {
203
+ return { nonce, parsed: JSON.parse(text) };
204
+ }
205
+ catch (err) {
206
+ if (!(err instanceof SyntaxError))
207
+ throw err;
208
+ // V8 embeds a VERBATIM slice of the offending bytes in its SyntaxError
209
+ // message, unescaped — and this is one of the few grader-controlled strings
210
+ // that reaches an operator WITHOUT passing `parseEvalFragment`, the
211
+ // documented text boundary, because the parse it would have gone through is
212
+ // the one that just failed. It lands in a thrown message (which the CLI writes
213
+ // as `Error: ${err.message}`, so an unsanitized `ESC[2K CR ESC[32m…` wipes the
214
+ // line vat just printed and continues in vat's own colour) AND in the re-grade
215
+ // prompt.
216
+ return { nonce, unparseable: sanitizeGraderText(err.message) };
131
217
  }
132
- assertExpectationCountDeclared(input.evalId, input.expectations, fragment.expectations);
133
- assertToolVerdictConsistent(input.evalId, input.toolExpectations, fragment.tool);
134
- // The grader's only input is the executor transcript, which untrusted skill code
135
- // controls, and `evalId` is schema-typed as any non-empty string. It is echoed
136
- // verbatim into the run summary and into `baseline.json` — including the
137
- // CONTAMINATED banner — so a grader talked into emitting an id containing
138
- // newlines and ANSI escapes can paint a reassuring "known false positive, the
139
- // delta is valid" line directly beneath vat's own warning. VAT knows which eval
140
- // it asked about; take the id from the request, never from the answer.
141
- return { ...fragment, evalId: input.evalId };
142
218
  }
143
219
  /**
144
- * Read the grader's fragment JSON into memory and unlink it immediately —
145
- * consume-on-read. Split out of {@link runGraderForEval} to keep its cognitive
146
- * complexity within budget. Throws {@link InternalHarnessError} if the grader
147
- * wrote no fragment, {@link EvalFragmentError} if it is not valid JSON.
220
+ * Read the grader's fragment file into memory and remove it immediately —
221
+ * consume-on-read, whether or not it will parse. Throws {@link InternalHarnessError}
222
+ * if the grader wrote no fragment.
148
223
  *
149
- * The unlink is the security-relevant half: the grader dir is same-uid (see
224
+ * The removal is the security-relevant half: the grader dir is same-uid (see
150
225
  * `resolveGraderOutDir`), so a fragment left on disk lets skill code that
151
226
  * survived the process-group kill read the echoed nonce at leisure and forge
152
227
  * LATER fragments. Consuming it on read leaves no persisted copy — exposure
153
- * shrinks to each fragment's own read window (no cross-eval harvest). The read
154
- * here is the ONLY read of the file; all downstream logic runs off the returned
155
- * value. Best-effort: a failed unlink is not a run failure (end-of-run cleanup
156
- * removes the whole dir), and true isolation from same-uid code is issue #149.
228
+ * shrinks to each fragment's own read window (no cross-eval harvest). It is also
229
+ * what makes the re-grade honest: a retry that writes nothing finds no file, not
230
+ * the unparseable one. The read here is the ONLY read of the file; all downstream
231
+ * logic runs off the returned text. A failed removal is not a run failure
232
+ * (end-of-run cleanup removes the whole dir) but it IS the one degradation this
233
+ * design exists to prevent, so it is reported through `onWarn` rather than
234
+ * swallowed: the operator learns the fragment lingered, with the errno. True
235
+ * isolation from same-uid code is a separate, unbuilt mechanism (a different uid
236
+ * or a sandbox), not this removal.
157
237
  */
158
- function readAndConsumeFragmentFile(fragmentOut, evalId, status) {
159
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- fragmentOut is our own derived path (joinUnderRoot-guarded)
238
+ function readAndConsumeFragmentFile(fragmentOut, evalId, status, onWarn) {
160
239
  if (!existsSync(fragmentOut)) {
161
240
  throw new InternalHarnessError(`Grader exited (status ${status}) without writing a fragment at ${fragmentOut} for eval "${evalId}".`);
162
241
  }
163
- let raw;
242
+ const text = readFileSync(fragmentOut, 'utf-8');
164
243
  try {
165
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- fragmentOut is our own derived path (joinUnderRoot-guarded)
166
- raw = JSON.parse(readFileSync(fragmentOut, 'utf-8'));
244
+ // `force` covers the one benign case — the file is already gone — so what the
245
+ // catch sees is a refusal (EACCES/EPERM/EBUSY), never an absence.
246
+ rmSync(fragmentOut, { force: true });
167
247
  }
168
248
  catch (err) {
169
- // V8 embeds a VERBATIM slice of the offending bytes in its SyntaxError
170
- // message, unescaped — and this is one of the few grader-controlled strings
171
- // that reaches an operator WITHOUT passing `parseEvalFragment`, the
172
- // documented text boundary, because the parse it would have gone through is
173
- // the one that just failed. The CLI writes it as `Error: ${err.message}`, so
174
- // an unsanitized fragment of `ESC[2K CR ESC[32m…` wipes the line vat just
175
- // printed and continues in vat's own colour (and a <=16-byte file gets its
176
- // whole `ESC[2J ESC[H` echoed, clearing the screen).
177
- throw new EvalFragmentError(`grader fragment for eval "${evalId}" at ${fragmentOut} is not valid JSON: ` +
178
- sanitizeGraderText(err instanceof Error ? err.message : String(err)));
179
- }
180
- try {
181
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- fragmentOut is our own derived path (joinUnderRoot-guarded)
182
- unlinkSync(fragmentOut);
183
- }
184
- catch {
185
- // Swallow: cleanup removes the grader dir regardless.
249
+ onWarn(`grader fragment for eval "${evalId}" at ${fragmentOut} could not be removed after it was read ` +
250
+ `(${err instanceof Error ? err.message : String(err)}); it stays on disk until end-of-run cleanup.`);
186
251
  }
187
- return raw;
252
+ return text;
188
253
  }
189
254
  /**
190
255
  * The OUTPUT channel's declared-vs-reported check — the exact thing
@@ -1 +1 @@
1
- {"version":3,"file":"eval-grader.js","sourceRoot":"","sources":["../../src/skill-test/eval-grader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AAE/D,OAAO,EAAE,aAAa,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAC;AACp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,CAAC,GAAG,CAAC,kBAAkB,CAAC,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,IAAI,GAAG,CAAC,QAAQ,CAAC,CAAC;IACtC,MAAM,QAAQ,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC3E,MAAM,OAAO,GAAG,CAAC,GAAG,WAAW,CAAC,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,WAAW,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,CAAC;IAC1E,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO;IAC1D,MAAM,QAAQ,GAAa,EAAE,CAAC;IAC9B,IAAI,QAAQ,CAAC,MAAM,GAAG,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,YAAY,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC,CAAC;IAC3E,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC;QAAE,QAAQ,CAAC,IAAI,CAAC,WAAW,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC;IACxE,MAAM,IAAI,oBAAoB,CAC5B,oBAAoB,MAAM,oBAAoB,OAAO,yCAAyC;QAC5F,8BAA8B,QAAQ,CAAC,IAAI,CAAC,IAAI,CAAC,gDAAgD;QACjG,qEAAqE,CACxE,CAAC;AACJ,CAAC"}
@@ -1,18 +1,19 @@
1
+ import { VatError } from '@vibe-agent-toolkit/utils';
1
2
  import { z } from 'zod';
2
3
  /**
3
4
  * Raised for any eval-input problem (bad JSON, schema failure, missing input file).
4
- * Maps to exit 2.
5
+ * Reason `preflight`.
5
6
  *
6
7
  * The FIELD is what makes that sentence true, and until it was added only one of this
7
8
  * class's two routes delivered it. `attemptStageWorkspaces` catches the staging
8
9
  * instance and maps it explicitly; the instance thrown from {@link armDirSegment}
9
10
  * fires deep in the eval loop, outside that handler, and reached
10
- * `mapErrorToExitCode`'s Internal default — reporting 1 for a preflight-class
11
- * problem while the docblock above claimed 2. Exit 2 for the internal-invariant case
12
- * too is consistent with every sibling in this feature.
11
+ * `skillTestFailureReason`'s `internal` default — reporting a harness bug for a
12
+ * preflight-class problem while the docblock above claimed otherwise. `preflight`
13
+ * for the internal-invariant case too is consistent with every sibling in this feature.
13
14
  */
14
- export declare class EvalInputError extends Error {
15
- readonly exitCode: 2;
15
+ export declare class EvalInputError extends VatError {
16
+ readonly reason: "preflight";
16
17
  constructor(message: string);
17
18
  }
18
19
  /**
@@ -528,7 +529,7 @@ export declare const EvalSuiteSchema: z.ZodObject<{
528
529
  export type EvalEntry = z.infer<typeof EvalEntrySchema>;
529
530
  export type EvalSuite = z.infer<typeof EvalSuiteSchema>;
530
531
  /**
531
- * The declared tool expectations of ONE eval (issue #145 Phase T). Derived from
532
+ * The declared tool expectations of ONE eval. Derived from
532
533
  * {@link EvalEntry} so the grader input + prompt builder share the EXACT shape the
533
534
  * parser produces — no drift, and no duplicated inline `{ mustRun?; mustNotRun?;
534
535
  * sequence? }` literal across those consumers.
@@ -1 +1 @@
1
- {"version":3,"file":"eval-inputs.d.ts","sourceRoot":"","sources":["../../src/skill-test/eval-inputs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAIxB;;;;;;;;;;;GAWG;AACH,qBAAa,cAAe,SAAQ,KAAK;IACvC,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAU;gBACnB,OAAO,EAAE,MAAM;CAI5B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEpD;AA2CD;;;;;;GAMG;AACH,wBAAgB,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,OAAO,CAUrE;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AQ,EAAE,MAAM,CAAC;IACjB,+EAA+E;IAC/E,cAAc,EAAE,MAAM,CAAC;IACvB;;;;OAIG;IACH,OAAO,EAAE,gBAAgB,CAAC;CAC3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,wBAAwB,GAAG,MAAM,CAK3E"}
@@ -1,24 +1,23 @@
1
1
  import { cpSync, existsSync } from 'node:fs';
2
- import { mkdirSyncReal, safePath } from '@vibe-agent-toolkit/utils';
2
+ import { mkdirSyncReal, safePath, VatError } from '@vibe-agent-toolkit/utils';
3
3
  import { z } from 'zod';
4
4
  import { sanitizeGraderText, sanitizeTextPreservingLines } from './grader-text.js';
5
5
  /**
6
6
  * Raised for any eval-input problem (bad JSON, schema failure, missing input file).
7
- * Maps to exit 2.
7
+ * Reason `preflight`.
8
8
  *
9
9
  * The FIELD is what makes that sentence true, and until it was added only one of this
10
10
  * class's two routes delivered it. `attemptStageWorkspaces` catches the staging
11
11
  * instance and maps it explicitly; the instance thrown from {@link armDirSegment}
12
12
  * fires deep in the eval loop, outside that handler, and reached
13
- * `mapErrorToExitCode`'s Internal default — reporting 1 for a preflight-class
14
- * problem while the docblock above claimed 2. Exit 2 for the internal-invariant case
15
- * too is consistent with every sibling in this feature.
13
+ * `skillTestFailureReason`'s `internal` default — reporting a harness bug for a
14
+ * preflight-class problem while the docblock above claimed otherwise. `preflight`
15
+ * for the internal-invariant case too is consistent with every sibling in this feature.
16
16
  */
17
- export class EvalInputError extends Error {
18
- exitCode = 2;
17
+ export class EvalInputError extends VatError {
18
+ reason = 'preflight';
19
19
  constructor(message) {
20
- super(message);
21
- this.name = 'EvalInputError';
20
+ super('EVAL_INPUT', message);
22
21
  }
23
22
  }
24
23
  /**
@@ -187,7 +186,7 @@ export const EvalEntrySchema = z
187
186
  mustRun: z.array(z.string().min(1)).optional(),
188
187
  mustNotRun: z.array(z.string().min(1)).optional(),
189
188
  // Each named executable must have RUN and its invoking tool_result must
190
- // NOT be an error (feature #148). Judged from the transcript by the
189
+ // NOT be an error. Judged from the transcript by the
191
190
  // grader — see tool-eval-schema.ts's ToolSucceedCheckSchema.
192
191
  mustSucceed: z.array(z.string().min(1)).optional(),
193
192
  sequence: z.array(z.string().min(1)).optional(),
@@ -323,7 +322,6 @@ function stageEvalWorkspacesForArm(input, arm) {
323
322
  throw new EvalInputError(`eval ${entry.id} declares input file "${quoteSuiteText(rel)}" that escapes the eval directory: ` +
324
323
  quoteSuiteText(err.message));
325
324
  }
326
- // eslint-disable-next-line security/detect-non-literal-fs-filename -- src is contained under evalsDir via joinUnderRoot; suite is developer-authored
327
325
  if (!existsSync(src)) {
328
326
  throw new EvalInputError(`eval ${entry.id} declares input file "${quoteSuiteText(rel)}" but it is absent at ${quoteSuiteText(src)}`);
329
327
  }