@vibe-agent-toolkit/agent-skills 0.2.0-rc.2 → 0.2.0-rc.3
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.
- package/dist/files-config.d.ts +34 -1
- package/dist/files-config.d.ts.map +1 -1
- package/dist/files-config.js +280 -36
- package/dist/files-config.js.map +1 -1
- package/dist/fs-attribution.d.ts +45 -0
- package/dist/fs-attribution.d.ts.map +1 -0
- package/dist/fs-attribution.js +57 -0
- package/dist/fs-attribution.js.map +1 -0
- package/dist/index.d.ts +5 -4
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +8 -2
- package/dist/index.js.map +1 -1
- package/dist/inventory/detectors/declared-but-missing.d.ts +1 -1
- package/dist/inventory/detectors/declared-but-missing.d.ts.map +1 -1
- package/dist/inventory/detectors/marketplace-source-missing.d.ts +1 -1
- package/dist/inventory/detectors/marketplace-source-missing.d.ts.map +1 -1
- package/dist/inventory/detectors/present-but-undeclared.d.ts +1 -1
- package/dist/inventory/detectors/present-but-undeclared.d.ts.map +1 -1
- package/dist/inventory/detectors/reference-target-missing.d.ts +1 -1
- package/dist/inventory/detectors/reference-target-missing.d.ts.map +1 -1
- package/dist/inventory/index.d.ts +1 -1
- package/dist/inventory/index.d.ts.map +1 -1
- package/dist/inventory/index.js +1 -1
- package/dist/inventory/index.js.map +1 -1
- package/dist/inventory/serialize.d.ts +4 -4
- package/dist/inventory/serialize.d.ts.map +1 -1
- package/dist/inventory/serialize.js +6 -6
- package/dist/inventory/serialize.js.map +1 -1
- package/dist/post-build-checks.d.ts +1 -1
- package/dist/post-build-checks.d.ts.map +1 -1
- package/dist/post-build-checks.js.map +1 -1
- package/dist/projection/skill-extent.d.ts +247 -0
- package/dist/projection/skill-extent.d.ts.map +1 -0
- package/dist/projection/skill-extent.js +558 -0
- package/dist/projection/skill-extent.js.map +1 -0
- package/dist/schemas/agent-skill-frontmatter.js +1 -1
- package/dist/schemas/agent-skill-frontmatter.js.map +1 -1
- package/dist/skill-packager.d.ts +34 -4
- package/dist/skill-packager.d.ts.map +1 -1
- package/dist/skill-packager.js +113 -23
- package/dist/skill-packager.js.map +1 -1
- package/dist/skill-source/git-clone.d.ts.map +1 -1
- package/dist/skill-source/git-clone.js +9 -8
- package/dist/skill-source/git-clone.js.map +1 -1
- package/dist/skill-test/baseline-delta.d.ts +1575 -0
- package/dist/skill-test/baseline-delta.d.ts.map +1 -0
- package/dist/skill-test/baseline-delta.js +272 -0
- package/dist/skill-test/baseline-delta.js.map +1 -0
- package/dist/skill-test/baseline-integrity.d.ts +944 -0
- package/dist/skill-test/baseline-integrity.d.ts.map +1 -0
- package/dist/skill-test/baseline-integrity.js +3083 -0
- package/dist/skill-test/baseline-integrity.js.map +1 -0
- package/dist/skill-test/eval-executor.d.ts +19 -3
- package/dist/skill-test/eval-executor.d.ts.map +1 -1
- package/dist/skill-test/eval-executor.js +3 -3
- package/dist/skill-test/eval-executor.js.map +1 -1
- package/dist/skill-test/eval-fragment.d.ts +80 -6
- package/dist/skill-test/eval-fragment.d.ts.map +1 -1
- package/dist/skill-test/eval-fragment.js +61 -7
- package/dist/skill-test/eval-fragment.js.map +1 -1
- package/dist/skill-test/eval-grader.d.ts.map +1 -1
- package/dist/skill-test/eval-grader.js +143 -7
- package/dist/skill-test/eval-grader.js.map +1 -1
- package/dist/skill-test/eval-inputs.d.ts +107 -6
- package/dist/skill-test/eval-inputs.d.ts.map +1 -1
- package/dist/skill-test/eval-inputs.js +173 -16
- package/dist/skill-test/eval-inputs.js.map +1 -1
- package/dist/skill-test/eval-lint.d.ts +13 -0
- package/dist/skill-test/eval-lint.d.ts.map +1 -1
- package/dist/skill-test/eval-lint.js +17 -4
- package/dist/skill-test/eval-lint.js.map +1 -1
- package/dist/skill-test/executor-prompt.d.ts +13 -5
- package/dist/skill-test/executor-prompt.d.ts.map +1 -1
- package/dist/skill-test/executor-prompt.js +8 -5
- package/dist/skill-test/executor-prompt.js.map +1 -1
- package/dist/skill-test/exit-codes.d.ts +53 -16
- package/dist/skill-test/exit-codes.d.ts.map +1 -1
- package/dist/skill-test/exit-codes.js +123 -40
- package/dist/skill-test/exit-codes.js.map +1 -1
- package/dist/skill-test/fragment-merge.d.ts +1 -18
- package/dist/skill-test/fragment-merge.d.ts.map +1 -1
- package/dist/skill-test/fragment-merge.js +63 -4
- package/dist/skill-test/fragment-merge.js.map +1 -1
- package/dist/skill-test/grader-prompt.d.ts +27 -7
- package/dist/skill-test/grader-prompt.d.ts.map +1 -1
- package/dist/skill-test/grader-prompt.js +253 -61
- package/dist/skill-test/grader-prompt.js.map +1 -1
- package/dist/skill-test/grader-text.d.ts +145 -0
- package/dist/skill-test/grader-text.d.ts.map +1 -0
- package/dist/skill-test/grader-text.js +410 -0
- package/dist/skill-test/grader-text.js.map +1 -0
- package/dist/skill-test/grading-adapter.d.ts +32 -0
- package/dist/skill-test/grading-adapter.d.ts.map +1 -1
- package/dist/skill-test/grading-adapter.js +50 -3
- package/dist/skill-test/grading-adapter.js.map +1 -1
- package/dist/skill-test/grading-schema.d.ts +160 -5
- package/dist/skill-test/grading-schema.d.ts.map +1 -1
- package/dist/skill-test/grading-schema.js +66 -7
- package/dist/skill-test/grading-schema.js.map +1 -1
- package/dist/skill-test/index.d.ts +1 -1
- package/dist/skill-test/index.d.ts.map +1 -1
- package/dist/skill-test/index.js +1 -1
- package/dist/skill-test/index.js.map +1 -1
- package/dist/skill-test/lock.d.ts +56 -0
- package/dist/skill-test/lock.d.ts.map +1 -1
- package/dist/skill-test/lock.js +75 -2
- package/dist/skill-test/lock.js.map +1 -1
- package/dist/skill-test/pipeline.d.ts +16 -0
- package/dist/skill-test/pipeline.d.ts.map +1 -1
- package/dist/skill-test/pipeline.js +16 -9
- package/dist/skill-test/pipeline.js.map +1 -1
- package/dist/skill-test/preflight.d.ts.map +1 -1
- package/dist/skill-test/preflight.js +58 -14
- package/dist/skill-test/preflight.js.map +1 -1
- package/dist/skill-test/run-harness.d.ts +578 -35
- package/dist/skill-test/run-harness.d.ts.map +1 -1
- package/dist/skill-test/run-harness.js +1278 -147
- package/dist/skill-test/run-harness.js.map +1 -1
- package/dist/skill-test/staging.d.ts +8 -2
- package/dist/skill-test/staging.d.ts.map +1 -1
- package/dist/skill-test/staging.js +8 -4
- package/dist/skill-test/staging.js.map +1 -1
- package/dist/skill-test/tool-eval-schema.d.ts +6 -6
- package/dist/test-input.d.ts +1 -1
- package/dist/test-input.d.ts.map +1 -1
- package/dist/validators/agent-instruction-presence.d.ts +1 -1
- package/dist/validators/agent-instruction-presence.d.ts.map +1 -1
- package/dist/validators/bundled-resource-link-detection.d.ts +1 -1
- package/dist/validators/bundled-resource-link-detection.d.ts.map +1 -1
- package/dist/validators/bundled-resource-link-detection.js +1 -1
- package/dist/validators/bundled-resource-link-detection.js.map +1 -1
- package/dist/validators/compat-detectors.d.ts +1 -1
- package/dist/validators/compat-detectors.d.ts.map +1 -1
- package/dist/validators/compat-detectors.js +1 -1
- package/dist/validators/compat-detectors.js.map +1 -1
- package/dist/validators/cross-skill-dependency-detection.d.ts +1 -1
- package/dist/validators/cross-skill-dependency-detection.d.ts.map +1 -1
- package/dist/validators/cross-skill-dependency-detection.js +1 -1
- package/dist/validators/cross-skill-dependency-detection.js.map +1 -1
- package/dist/validators/description-style-detection.d.ts +1 -1
- package/dist/validators/description-style-detection.d.ts.map +1 -1
- package/dist/validators/description-style-detection.js +1 -1
- package/dist/validators/description-style-detection.js.map +1 -1
- package/dist/validators/frontmatter-validation.d.ts +1 -1
- package/dist/validators/frontmatter-validation.d.ts.map +1 -1
- package/dist/validators/frontmatter-validation.js +1 -1
- package/dist/validators/frontmatter-validation.js.map +1 -1
- package/dist/validators/imperative-body-detection.d.ts +1 -1
- package/dist/validators/imperative-body-detection.d.ts.map +1 -1
- package/dist/validators/imperative-body-detection.js +1 -1
- package/dist/validators/imperative-body-detection.js.map +1 -1
- package/dist/validators/index.d.ts +1 -1
- package/dist/validators/index.d.ts.map +1 -1
- package/dist/validators/kebab-case-detection.d.ts +1 -1
- package/dist/validators/kebab-case-detection.d.ts.map +1 -1
- package/dist/validators/kebab-case-detection.js +1 -1
- package/dist/validators/kebab-case-detection.js.map +1 -1
- package/dist/validators/marketplace-validator.js +1 -1
- package/dist/validators/marketplace-validator.js.map +1 -1
- package/dist/validators/packaging-validator.d.ts +38 -5
- package/dist/validators/packaging-validator.d.ts.map +1 -1
- package/dist/validators/packaging-validator.js +87 -10
- package/dist/validators/packaging-validator.js.map +1 -1
- package/dist/validators/plugin-hosted-shape.d.ts +1 -1
- package/dist/validators/plugin-hosted-shape.d.ts.map +1 -1
- package/dist/validators/plugin-hosted-shape.js +1 -1
- package/dist/validators/plugin-hosted-shape.js.map +1 -1
- package/dist/validators/plugin-recommended-fields.d.ts +1 -1
- package/dist/validators/plugin-recommended-fields.d.ts.map +1 -1
- package/dist/validators/plugin-recommended-fields.js +1 -1
- package/dist/validators/plugin-recommended-fields.js.map +1 -1
- package/dist/validators/registry-validator.js +1 -1
- package/dist/validators/registry-validator.js.map +1 -1
- package/dist/validators/rule-engine/rule-engine.d.ts +1 -1
- package/dist/validators/rule-engine/rule-engine.d.ts.map +1 -1
- package/dist/validators/rule-engine/rule-engine.js +20 -9
- package/dist/validators/rule-engine/rule-engine.js.map +1 -1
- package/dist/validators/skill-validator.d.ts.map +1 -1
- package/dist/validators/skill-validator.js +21 -3
- package/dist/validators/skill-validator.js.map +1 -1
- package/dist/validators/types.d.ts +1 -1
- package/dist/validators/types.d.ts.map +1 -1
- package/dist/validators/unified-validator.js +1 -1
- package/dist/validators/unified-validator.js.map +1 -1
- package/dist/validators/validation-rules.d.ts +1 -1
- package/dist/validators/validation-rules.d.ts.map +1 -1
- package/dist/validators/walker-to-issues.d.ts +7 -3
- package/dist/validators/walker-to-issues.d.ts.map +1 -1
- package/dist/validators/walker-to-issues.js +37 -8
- package/dist/validators/walker-to-issues.js.map +1 -1
- package/dist/walk-link-graph.d.ts.map +1 -1
- package/dist/walk-link-graph.js +36 -2
- package/dist/walk-link-graph.js.map +1 -1
- package/package.json +7 -7
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { sanitizeGraderText } from './grader-text.js';
|
|
1
2
|
import { GradingReportSchema } from './grading-schema.js';
|
|
2
3
|
/**
|
|
3
4
|
* Thrown when grading.json does not match the canonical skill-creator shape
|
|
@@ -29,6 +30,27 @@ export class GradingNonceError extends Error {
|
|
|
29
30
|
this.name = 'GradingNonceError';
|
|
30
31
|
}
|
|
31
32
|
}
|
|
33
|
+
/**
|
|
34
|
+
* Thrown when a per-eval grader fragment's `arm` disagrees with the arm the
|
|
35
|
+
* merge was told it is assembling. Deliberately distinct from
|
|
36
|
+
* {@link GradingNonceError}: a fragment can carry a perfectly valid nonce for
|
|
37
|
+
* THIS run and still belong to the other arm, and that is a different failure —
|
|
38
|
+
* not a forgery, but a mix-up that would fold a control-arm verdict into the
|
|
39
|
+
* treatment number (or the reverse). Either way the merged total is no longer a
|
|
40
|
+
* measurement of one arm, which is the entire premise of the `--baseline` A/B,
|
|
41
|
+
* so the merge refuses rather than emit a mislabelled artifact that downstream
|
|
42
|
+
* readers would take as authoritative.
|
|
43
|
+
*/
|
|
44
|
+
export class GradingArmError extends Error {
|
|
45
|
+
constructor(message) {
|
|
46
|
+
super(`grader fragment arm mismatch: ${message}. Each --baseline arm is merged into its own ` +
|
|
47
|
+
'artifact (grading.json = the WITH arm, baseline.json = the WITHOUT/control arm), and ' +
|
|
48
|
+
'every fragment merged into one must come from that arm — a fragment with no `arm` ' +
|
|
49
|
+
"belongs to the default 'with' arm. Mixing arms would make the merged pass count a " +
|
|
50
|
+
'measurement of neither.');
|
|
51
|
+
this.name = 'GradingArmError';
|
|
52
|
+
}
|
|
53
|
+
}
|
|
32
54
|
/**
|
|
33
55
|
* Detect the common per-eval nested mistake: `{ evals: [ { expectations, ... } ] }`
|
|
34
56
|
* with no top-level `expectations`. The grader (an LLM) reaches for this when the
|
|
@@ -48,19 +70,44 @@ export function parseGradingJson(raw) {
|
|
|
48
70
|
'grading.json must be ONE flat object whose top-level `expectations` lists every ' +
|
|
49
71
|
'graded expectation across all evals');
|
|
50
72
|
}
|
|
73
|
+
// Both halves are attacker-reachable and land in an operator-facing message: a
|
|
74
|
+
// `.strict()` rejection puts the grader-CHOSEN KEY inside zod's own issue message,
|
|
75
|
+
// and `path` is built from that same key. Sanitize both — this is the route that
|
|
76
|
+
// has already been found twice in sibling modules, and it must not reopen here just
|
|
77
|
+
// because today's only callers are tests.
|
|
51
78
|
const firstIssue = result.error.issues[0];
|
|
52
|
-
const path = firstIssue?.path.join('.') ?? '(root)';
|
|
53
|
-
|
|
79
|
+
const path = sanitizeGraderText(firstIssue?.path.join('.') ?? '(root)');
|
|
80
|
+
const detail = sanitizeGraderText(firstIssue?.message ?? 'unknown');
|
|
81
|
+
throw new GradingSkewError(`missing/invalid field at "${path}" (${detail})`);
|
|
54
82
|
}
|
|
55
|
-
const { summary, expectations, runNonce } = result.data;
|
|
83
|
+
const { summary, expectations, runNonce, arm } = result.data;
|
|
84
|
+
// Pass `evalId`/`arm` through WHEN PRESENT. The docblocks on NormalizedGrading
|
|
85
|
+
// explain why they are optional — an externally produced grading.json legitimately
|
|
86
|
+
// carries no attribution, and inventing one would be a lie about provenance. That
|
|
87
|
+
// argues for omitting an ABSENT field, not for discarding a present one: the schema
|
|
88
|
+
// already parses both, so dropping them silently narrowed the declared type and
|
|
89
|
+
// threw away exactly the key a reader needs to line the two --baseline artifacts
|
|
90
|
+
// up per eval.
|
|
91
|
+
//
|
|
92
|
+
// 📌 STATE OF PLAY, so nobody mistakes this for load-bearing code: NOTHING IN
|
|
93
|
+
// SHIPPED CODE READS THESE TWO TODAY. `parseGradingJson` itself is reachable only
|
|
94
|
+
// from the package barrel and this module's own test file — the harness builds its
|
|
95
|
+
// NormalizedGrading from per-eval fragments, not by re-parsing an aggregate
|
|
96
|
+
// grading.json — so the two spreads are written-but-never-read outside tests. They
|
|
97
|
+
// stay anyway, because the cost of keeping a parsed field is zero and the cost of
|
|
98
|
+
// reopening the discard is a reader who cannot attribute an expectation to an eval
|
|
99
|
+
// or an arm. Treat "no production caller" as a reason to leave this alone, not as
|
|
100
|
+
// permission to delete it.
|
|
56
101
|
return {
|
|
57
102
|
summary: { passed: summary.passed, total: summary.total },
|
|
58
103
|
expectations: expectations.map(e => ({
|
|
59
104
|
text: e.text,
|
|
60
105
|
passed: e.passed,
|
|
61
106
|
...(e.evidence === undefined ? {} : { evidence: e.evidence }),
|
|
107
|
+
...(e.evalId === undefined ? {} : { evalId: e.evalId }),
|
|
62
108
|
})),
|
|
63
109
|
...(runNonce === undefined ? {} : { runNonce }),
|
|
110
|
+
...(arm === undefined ? {} : { arm }),
|
|
64
111
|
};
|
|
65
112
|
}
|
|
66
113
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grading-adapter.js","sourceRoot":"","sources":["../../src/skill-test/grading-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAe;QACzB,KAAK,CACH,4BAA4B,OAAO,gDAAgD;YACjF,0EAA0E;YAC1E,yFAAyF,CAC5F,CAAC;QACF,IAAI,CAAC,IAAI,GAAG,kBAAkB,CAAC;IACjC,CAAC;CACF;
|
|
1
|
+
{"version":3,"file":"grading-adapter.js","sourceRoot":"","sources":["../../src/skill-test/grading-adapter.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACtD,OAAO,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAC;AAE1D;;;;;GAKG;AACH,MAAM,OAAO,gBAAiB,SAAQ,KAAK;IACzC,YAAY,OAAe;QACzB,KAAK,CACH,4BAA4B,OAAO,gDAAgD;YACjF,0EAA0E;YAC1E,yFAAyF,CAC5F,CAAC;QACF,IAAI,CAAC,IAAI,GAA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,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,QAAQ,EAAE,CAAC;QAC/C,GAAG,CAAC,GAAG,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC;KACtC,CAAC;AACJ,CAAC;AASD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAyB;IACxD,MAAM,cAAc,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC;IACxE,MAAM,aAAa,GAAG,MAAM,CAAC,YAAY,CAAC,MAAM,CAAC;IAEjD,IAAI,aAAa,KAAK,CAAC,EAAE,CAAC;QACxB,MAAM,IAAI,gBAAgB,CACxB,2FAA2F;YACzF,iFAAiF,CACpF,CAAC;IACJ,CAAC;IAED,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,GAAG,MAAM,CAAC,OAAO,CAAC;IACzC,IAAI,MAAM,KAAK,cAAc,IAAI,KAAK,KAAK,aAAa,EAAE,CAAC;QACzD,MAAM,IAAI,gBAAgB,CACxB,yEAAyE,MAAM,UAAU,KAAK,IAAI;YAChG,yCAAyC,cAAc,UAAU,aAAa,KAAK;YACnF,4FAA4F,CAC/F,CAAC;IACJ,CAAC;IAED,OAAO,EAAE,MAAM,EAAE,cAAc,EAAE,KAAK,EAAE,aAAa,EAAE,SAAS,EAAE,cAAc,KAAK,aAAa,EAAE,CAAC;AACvG,CAAC"}
|
|
@@ -31,20 +31,51 @@ export declare const GradedExpectationSchema: z.ZodObject<{
|
|
|
31
31
|
text: z.ZodString;
|
|
32
32
|
passed: z.ZodBoolean;
|
|
33
33
|
evidence: z.ZodOptional<z.ZodString>;
|
|
34
|
+
/**
|
|
35
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
36
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
37
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
38
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
39
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
40
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
41
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
42
|
+
*/
|
|
43
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
34
44
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
35
45
|
text: z.ZodString;
|
|
36
46
|
passed: z.ZodBoolean;
|
|
37
47
|
evidence: z.ZodOptional<z.ZodString>;
|
|
48
|
+
/**
|
|
49
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
50
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
51
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
52
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
53
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
54
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
55
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
56
|
+
*/
|
|
57
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
38
58
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
39
59
|
text: z.ZodString;
|
|
40
60
|
passed: z.ZodBoolean;
|
|
41
61
|
evidence: z.ZodOptional<z.ZodString>;
|
|
62
|
+
/**
|
|
63
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
64
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
65
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
66
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
67
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
68
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
69
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
70
|
+
*/
|
|
71
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
42
72
|
}, z.ZodTypeAny, "passthrough">>;
|
|
43
73
|
export type GradedExpectation = z.infer<typeof GradedExpectationSchema>;
|
|
44
74
|
/**
|
|
45
75
|
* Aggregate pass/fail counts. `failed`/`pass_rate` are documented but optional.
|
|
46
76
|
* Counts are non-negative integers (a float or negative count is a grader bug),
|
|
47
|
-
* and `passed` can never exceed `total
|
|
77
|
+
* and `passed` can never exceed `total` — see {@link SUMMARY_SCHEMA_DESCRIPTION}
|
|
78
|
+
* for why that last one has to be stated twice.
|
|
48
79
|
*/
|
|
49
80
|
export declare const GradingSummarySchema: z.ZodEffects<z.ZodObject<{
|
|
50
81
|
passed: z.ZodNumber;
|
|
@@ -83,14 +114,44 @@ export declare const GradingReportSchema: z.ZodObject<{
|
|
|
83
114
|
text: z.ZodString;
|
|
84
115
|
passed: z.ZodBoolean;
|
|
85
116
|
evidence: z.ZodOptional<z.ZodString>;
|
|
117
|
+
/**
|
|
118
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
119
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
120
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
121
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
122
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
123
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
124
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
125
|
+
*/
|
|
126
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
86
127
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
87
128
|
text: z.ZodString;
|
|
88
129
|
passed: z.ZodBoolean;
|
|
89
130
|
evidence: z.ZodOptional<z.ZodString>;
|
|
131
|
+
/**
|
|
132
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
133
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
134
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
135
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
136
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
137
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
138
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
139
|
+
*/
|
|
140
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
90
141
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
91
142
|
text: z.ZodString;
|
|
92
143
|
passed: z.ZodBoolean;
|
|
93
144
|
evidence: z.ZodOptional<z.ZodString>;
|
|
145
|
+
/**
|
|
146
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
147
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
148
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
149
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
150
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
151
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
152
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
153
|
+
*/
|
|
154
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
94
155
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
95
156
|
summary: z.ZodEffects<z.ZodObject<{
|
|
96
157
|
passed: z.ZodNumber;
|
|
@@ -127,19 +188,58 @@ export declare const GradingReportSchema: z.ZodObject<{
|
|
|
127
188
|
* by untrusted skill code is rejected.
|
|
128
189
|
*/
|
|
129
190
|
runNonce: z.ZodOptional<z.ZodString>;
|
|
191
|
+
/**
|
|
192
|
+
* Which `--baseline` arm produced this report: `'with'` (the skill declared)
|
|
193
|
+
* or `'without'` (the control arm run with the skill withheld). vat writes
|
|
194
|
+
* the two arms to two files of the SAME shape — `grading.json` and
|
|
195
|
+
* `baseline.json` — so without this field a reader holding one of them
|
|
196
|
+
* cannot tell which arm it is looking at. Optional for the same reason
|
|
197
|
+
* `runNonce` is: an externally produced grading.json has no arm to declare.
|
|
198
|
+
*/
|
|
199
|
+
arm: z.ZodOptional<z.ZodEnum<["with", "without"]>>;
|
|
130
200
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
131
201
|
expectations: z.ZodArray<z.ZodObject<{
|
|
132
202
|
text: z.ZodString;
|
|
133
203
|
passed: z.ZodBoolean;
|
|
134
204
|
evidence: z.ZodOptional<z.ZodString>;
|
|
205
|
+
/**
|
|
206
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
207
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
208
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
209
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
210
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
211
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
212
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
213
|
+
*/
|
|
214
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
135
215
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
136
216
|
text: z.ZodString;
|
|
137
217
|
passed: z.ZodBoolean;
|
|
138
218
|
evidence: z.ZodOptional<z.ZodString>;
|
|
219
|
+
/**
|
|
220
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
221
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
222
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
223
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
224
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
225
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
226
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
227
|
+
*/
|
|
228
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
139
229
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
140
230
|
text: z.ZodString;
|
|
141
231
|
passed: z.ZodBoolean;
|
|
142
232
|
evidence: z.ZodOptional<z.ZodString>;
|
|
233
|
+
/**
|
|
234
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
235
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
236
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
237
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
238
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
239
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
240
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
241
|
+
*/
|
|
242
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
143
243
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
144
244
|
summary: z.ZodEffects<z.ZodObject<{
|
|
145
245
|
passed: z.ZodNumber;
|
|
@@ -176,19 +276,58 @@ export declare const GradingReportSchema: z.ZodObject<{
|
|
|
176
276
|
* by untrusted skill code is rejected.
|
|
177
277
|
*/
|
|
178
278
|
runNonce: z.ZodOptional<z.ZodString>;
|
|
279
|
+
/**
|
|
280
|
+
* Which `--baseline` arm produced this report: `'with'` (the skill declared)
|
|
281
|
+
* or `'without'` (the control arm run with the skill withheld). vat writes
|
|
282
|
+
* the two arms to two files of the SAME shape — `grading.json` and
|
|
283
|
+
* `baseline.json` — so without this field a reader holding one of them
|
|
284
|
+
* cannot tell which arm it is looking at. Optional for the same reason
|
|
285
|
+
* `runNonce` is: an externally produced grading.json has no arm to declare.
|
|
286
|
+
*/
|
|
287
|
+
arm: z.ZodOptional<z.ZodEnum<["with", "without"]>>;
|
|
179
288
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
180
289
|
expectations: z.ZodArray<z.ZodObject<{
|
|
181
290
|
text: z.ZodString;
|
|
182
291
|
passed: z.ZodBoolean;
|
|
183
292
|
evidence: z.ZodOptional<z.ZodString>;
|
|
293
|
+
/**
|
|
294
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
295
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
296
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
297
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
298
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
299
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
300
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
301
|
+
*/
|
|
302
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
184
303
|
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
185
304
|
text: z.ZodString;
|
|
186
305
|
passed: z.ZodBoolean;
|
|
187
306
|
evidence: z.ZodOptional<z.ZodString>;
|
|
307
|
+
/**
|
|
308
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
309
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
310
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
311
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
312
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
313
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
314
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
315
|
+
*/
|
|
316
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
188
317
|
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
189
318
|
text: z.ZodString;
|
|
190
319
|
passed: z.ZodBoolean;
|
|
191
320
|
evidence: z.ZodOptional<z.ZodString>;
|
|
321
|
+
/**
|
|
322
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
323
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
324
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
325
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
326
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
327
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
328
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
329
|
+
*/
|
|
330
|
+
evalId: z.ZodOptional<z.ZodString>;
|
|
192
331
|
}, z.ZodTypeAny, "passthrough">>, "many">;
|
|
193
332
|
summary: z.ZodEffects<z.ZodObject<{
|
|
194
333
|
passed: z.ZodNumber;
|
|
@@ -225,13 +364,29 @@ export declare const GradingReportSchema: z.ZodObject<{
|
|
|
225
364
|
* by untrusted skill code is rejected.
|
|
226
365
|
*/
|
|
227
366
|
runNonce: z.ZodOptional<z.ZodString>;
|
|
367
|
+
/**
|
|
368
|
+
* Which `--baseline` arm produced this report: `'with'` (the skill declared)
|
|
369
|
+
* or `'without'` (the control arm run with the skill withheld). vat writes
|
|
370
|
+
* the two arms to two files of the SAME shape — `grading.json` and
|
|
371
|
+
* `baseline.json` — so without this field a reader holding one of them
|
|
372
|
+
* cannot tell which arm it is looking at. Optional for the same reason
|
|
373
|
+
* `runNonce` is: an externally produced grading.json has no arm to declare.
|
|
374
|
+
*/
|
|
375
|
+
arm: z.ZodOptional<z.ZodEnum<["with", "without"]>>;
|
|
228
376
|
}, z.ZodTypeAny, "passthrough">>;
|
|
229
377
|
export type GradingReport = z.infer<typeof GradingReportSchema>;
|
|
230
378
|
/**
|
|
231
|
-
* Published JSON Schema for grading.json — generated from {@link GradingReportSchema}
|
|
232
|
-
* so
|
|
233
|
-
*
|
|
234
|
-
* docs/skill-test-grading-schema.md.
|
|
379
|
+
* Published JSON Schema for grading.json — generated from {@link GradingReportSchema},
|
|
380
|
+
* so its SHAPE (fields, types, required-ness, additionalProperties) cannot drift from
|
|
381
|
+
* the Zod schema. Importable by external tooling that wants to validate a grading.json
|
|
382
|
+
* without depending on Zod. Documented in docs/skill-test-grading-schema.md.
|
|
383
|
+
*
|
|
384
|
+
* It is NOT equivalent to the Zod schema, and never can be. `zodToJsonSchema` drops
|
|
385
|
+
* every `.refine()`, and the two refinements in this file are cross-field relations
|
|
386
|
+
* JSON Schema has no way to express — so the generated document is strictly weaker
|
|
387
|
+
* than the validator that generated it. That gap is stated, in the document itself,
|
|
388
|
+
* on the field it applies to (see {@link SUMMARY_SCHEMA_DESCRIPTION}); a consumer
|
|
389
|
+
* that needs the invariant enforced must re-implement it or use the Zod schema.
|
|
235
390
|
*/
|
|
236
391
|
export declare const GradingReportJsonSchema: import("zod-to-json-schema").JsonSchema7Type & {
|
|
237
392
|
$schema?: string | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grading-schema.d.ts","sourceRoot":"","sources":["../../src/skill-test/grading-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,sFAAsF;AACtF,eAAO,MAAM,uBAAuB
|
|
1
|
+
{"version":3,"file":"grading-schema.d.ts","sourceRoot":"","sources":["../../src/skill-test/grading-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,sFAAsF;AACtF,eAAO,MAAM,uBAAuB;;;;IAKhC;;;;;;;;OAQG;;;;;;IARH;;;;;;;;OAQG;;;;;;IARH;;;;;;;;OAQG;;gCAGS,CAAC;AAEjB,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,uBAAuB,CAAC,CAAC;AAiCxE;;;;;GAKG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;gCAcM,CAAC;AAExC,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAC;AAElE;;;;GAIG;AACH,eAAO,MAAM,mBAAmB;;;;;QA3E5B;;;;;;;;WAQG;;;;;;QARH;;;;;;;;WAQG;;;;;;QARH;;;;;;;;WAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuEH;;;;;;;OAOG;;IAEH;;;;;;;OAOG;;;;;;;QA/FH;;;;;;;;WAQG;;;;;;QARH;;;;;;;;WAQG;;;;;;QARH;;;;;;;;WAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuEH;;;;;;;OAOG;;IAEH;;;;;;;OAOG;;;;;;;QA/FH;;;;;;;;WAQG;;;;;;QARH;;;;;;;;WAQG;;;;;;QARH;;;;;;;;WAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAuEH;;;;;;;OAOG;;IAEH;;;;;;;OAOG;;gCAGS,CAAC;AAEjB,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;;;;;;;;;;GAYG;AACH,eAAO,MAAM,uBAAuB;;;;;CAAyD,CAAC"}
|
|
@@ -33,12 +33,51 @@ export const GradedExpectationSchema = z
|
|
|
33
33
|
text: z.string(),
|
|
34
34
|
passed: z.boolean(),
|
|
35
35
|
evidence: z.string().optional(),
|
|
36
|
+
/**
|
|
37
|
+
* Which eval this expectation was graded under. vat stamps it when it
|
|
38
|
+
* assembles the aggregate from per-eval grader fragments, so that a
|
|
39
|
+
* `--baseline` run's two artifacts can be lined up PER EVAL rather than only
|
|
40
|
+
* in aggregate — without it, a reader can compare two totals but cannot say
|
|
41
|
+
* which eval moved. Optional because a grading.json produced by external
|
|
42
|
+
* tooling (skill-creator's own) carries no per-eval attribution; the schema
|
|
43
|
+
* documents the field vat now emits rather than tightening the contract.
|
|
44
|
+
*/
|
|
45
|
+
evalId: z.string().optional(),
|
|
36
46
|
})
|
|
37
47
|
.passthrough();
|
|
48
|
+
/**
|
|
49
|
+
* The cross-field invariant, worded once and carried into BOTH surfaces that can
|
|
50
|
+
* state it: the Zod refine's failure message, and the `description` on `summary`
|
|
51
|
+
* in the published JSON Schema.
|
|
52
|
+
*
|
|
53
|
+
* It has to be carried explicitly because `zodToJsonSchema` DISCARDS `.refine()`.
|
|
54
|
+
* Without this, the published document said `{passed: integer≥0, total: integer≥0}`
|
|
55
|
+
* and nothing else — so external tooling validating against it accepted
|
|
56
|
+
* `{passed: 9, total: 3}`, the exact shape the Zod validator rejects and the exact
|
|
57
|
+
* shape that produced a confident `delta: -8`. The invariant was not enforced OR
|
|
58
|
+
* mentioned, which is worse than unenforced: a consumer reading the schema had no
|
|
59
|
+
* way to learn the check existed.
|
|
60
|
+
*
|
|
61
|
+
* JSON Schema cannot close the gap. No draft can compare one property against
|
|
62
|
+
* another (`maximum` takes a number, not a pointer; `if`/`then` can only test a
|
|
63
|
+
* value, not a relation), and the Ajv `$data` extension that could is not portable
|
|
64
|
+
* — a plain Ajv without `$data: true` FAILS TO COMPILE a schema containing it,
|
|
65
|
+
* which would break every conforming consumer to serve one. So the published
|
|
66
|
+
* schema records the constraint and says plainly that it is on the consumer to
|
|
67
|
+
* check, rather than pretending to enforce it.
|
|
68
|
+
*/
|
|
69
|
+
const SUMMARY_INVARIANT_MESSAGE = 'summary.passed must not exceed summary.total';
|
|
70
|
+
const SUMMARY_SCHEMA_DESCRIPTION = 'Aggregate pass/fail counts. INVARIANT: ' +
|
|
71
|
+
`${SUMMARY_INVARIANT_MESSAGE}. It is enforced by the Zod schema this document is generated from ` +
|
|
72
|
+
'and by vat when it merges grader fragments, but NOT by this document: JSON Schema cannot express ' +
|
|
73
|
+
'a comparison between two properties in any draft, so a validator running this schema alone will ' +
|
|
74
|
+
'accept {"passed": 9, "total": 3}. Check it yourself before trusting any figure derived from these ' +
|
|
75
|
+
'counts (a baseline delta subtracts them).';
|
|
38
76
|
/**
|
|
39
77
|
* Aggregate pass/fail counts. `failed`/`pass_rate` are documented but optional.
|
|
40
78
|
* Counts are non-negative integers (a float or negative count is a grader bug),
|
|
41
|
-
* and `passed` can never exceed `total
|
|
79
|
+
* and `passed` can never exceed `total` — see {@link SUMMARY_SCHEMA_DESCRIPTION}
|
|
80
|
+
* for why that last one has to be stated twice.
|
|
42
81
|
*/
|
|
43
82
|
export const GradingSummarySchema = z
|
|
44
83
|
.object({
|
|
@@ -49,8 +88,12 @@ export const GradingSummarySchema = z
|
|
|
49
88
|
})
|
|
50
89
|
.passthrough()
|
|
51
90
|
.refine(s => s.passed <= s.total, {
|
|
52
|
-
message:
|
|
53
|
-
})
|
|
91
|
+
message: SUMMARY_INVARIANT_MESSAGE,
|
|
92
|
+
})
|
|
93
|
+
// `.describe()` AFTER `.refine()`: zodToJsonSchema reads the description off the
|
|
94
|
+
// outermost node, and this is the only channel through which a Zod refinement's
|
|
95
|
+
// meaning can reach the emitted document at all.
|
|
96
|
+
.describe(SUMMARY_SCHEMA_DESCRIPTION);
|
|
54
97
|
/**
|
|
55
98
|
* The full grading.json contract. Required: top-level `expectations[]` and
|
|
56
99
|
* `summary`. Everything else passes through untouched (forward-compatible with
|
|
@@ -69,13 +112,29 @@ export const GradingReportSchema = z
|
|
|
69
112
|
* by untrusted skill code is rejected.
|
|
70
113
|
*/
|
|
71
114
|
runNonce: z.string().optional(),
|
|
115
|
+
/**
|
|
116
|
+
* Which `--baseline` arm produced this report: `'with'` (the skill declared)
|
|
117
|
+
* or `'without'` (the control arm run with the skill withheld). vat writes
|
|
118
|
+
* the two arms to two files of the SAME shape — `grading.json` and
|
|
119
|
+
* `baseline.json` — so without this field a reader holding one of them
|
|
120
|
+
* cannot tell which arm it is looking at. Optional for the same reason
|
|
121
|
+
* `runNonce` is: an externally produced grading.json has no arm to declare.
|
|
122
|
+
*/
|
|
123
|
+
arm: z.enum(['with', 'without']).optional(),
|
|
72
124
|
})
|
|
73
125
|
.passthrough();
|
|
74
126
|
/**
|
|
75
|
-
* Published JSON Schema for grading.json — generated from {@link GradingReportSchema}
|
|
76
|
-
* so
|
|
77
|
-
*
|
|
78
|
-
* docs/skill-test-grading-schema.md.
|
|
127
|
+
* Published JSON Schema for grading.json — generated from {@link GradingReportSchema},
|
|
128
|
+
* so its SHAPE (fields, types, required-ness, additionalProperties) cannot drift from
|
|
129
|
+
* the Zod schema. Importable by external tooling that wants to validate a grading.json
|
|
130
|
+
* without depending on Zod. Documented in docs/skill-test-grading-schema.md.
|
|
131
|
+
*
|
|
132
|
+
* It is NOT equivalent to the Zod schema, and never can be. `zodToJsonSchema` drops
|
|
133
|
+
* every `.refine()`, and the two refinements in this file are cross-field relations
|
|
134
|
+
* JSON Schema has no way to express — so the generated document is strictly weaker
|
|
135
|
+
* than the validator that generated it. That gap is stated, in the document itself,
|
|
136
|
+
* on the field it applies to (see {@link SUMMARY_SCHEMA_DESCRIPTION}); a consumer
|
|
137
|
+
* that needs the invariant enforced must re-implement it or use the Zod schema.
|
|
79
138
|
*/
|
|
80
139
|
export const GradingReportJsonSchema = zodToJsonSchema(GradingReportSchema, 'grading-report');
|
|
81
140
|
//# sourceMappingURL=grading-schema.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grading-schema.js","sourceRoot":"","sources":["../../src/skill-test/grading-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,IAAI,EAAE,CAAC,CAAC,MAAM,EAAE;IAChB,MAAM,EAAE,CAAC,CAAC,OAAO,EAAE;IACnB,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;
|
|
1
|
+
{"version":3,"file":"grading-schema.js","sourceRoot":"","sources":["../../src/skill-test/grading-schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AAErD;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,sFAAsF;AACtF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CAAC;KACrC,MAAM,CAAC;IACN,IAAI,EAAE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,EAAE,oBAAoB;IAC7B;;;;;;;OAOG;IACH,QAAQ,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC/B;;;;;;;OAOG;IACH,GAAG,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC,CAAC,QAAQ,EAAE;CAC5C,CAAC;KACD,WAAW,EAAE,CAAC;AAIjB;;;;;;;;;;;;GAYG;AACH,MAAM,CAAC,MAAM,uBAAuB,GAAG,eAAe,CAAC,mBAAmB,EAAE,gBAAgB,CAAC,CAAC"}
|
|
@@ -4,7 +4,7 @@ export { lintEvalExpectations, lintToolExpectationExecutables, type EvalLintWarn
|
|
|
4
4
|
export { FrictionCategorySchema, FrictionItemSchema, FrictionReportJsonSchema, FrictionReportSchema, FrictionSeveritySchema, type FrictionItem, type FrictionReport, } from './friction-schema.js';
|
|
5
5
|
export { mergeFragmentsToFriction, mergeFragmentsToGrading, mergeFragmentsToToolEval, } from './fragment-merge.js';
|
|
6
6
|
export { ToolEvalReportJsonSchema, ToolEvalReportSchema, ToolVerdictBodySchema, ToolVerdictSchema, type ToolEvalReport, type ToolVerdict, type ToolVerdictBody, } from './tool-eval-schema.js';
|
|
7
|
-
export { GradingNonceError, GradingSkewError, parseGradingJson, reconcileGrading, type GradingVerdict, type NormalizedGrading, } from './grading-adapter.js';
|
|
7
|
+
export { GradingArmError, GradingNonceError, GradingSkewError, parseGradingJson, reconcileGrading, type GradingVerdict, type NormalizedGrading, } from './grading-adapter.js';
|
|
8
8
|
export { GradedExpectationSchema, GradingReportJsonSchema, GradingReportSchema, GradingSummarySchema, type GradedExpectation, type GradingReport, type GradingSummary, } from './grading-schema.js';
|
|
9
9
|
export { assertSafeHarnessRoot, assertSafeWorkdir, deriveHarnessKey, HarnessLocationError, resolveHarnessRoot, } from './harness-location.js';
|
|
10
10
|
export { computeReconcilePlan, StagedEntrySchema, StagedManifestSchema, type ReconcilePlan, type StagedEntry, type StagedManifest, } from './manifest.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/skill-test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,KAAK,SAAS,EACd,KAAK,SAAS,EACd,KAAK,wBAAwB,GAC9B,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,EACjB,KAAK,YAAY,EACjB,KAAK,uBAAuB,GAC7B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,oBAAoB,EAAE,8BAA8B,EAAE,KAAK,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAC5G,OAAO,EACL,sBAAsB,EACtB,kBAAkB,EAClB,wBAAwB,EACxB,oBAAoB,EACpB,sBAAsB,EACtB,KAAK,YAAY,EACjB,KAAK,cAAc,GACpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,wBAAwB,EACxB,uBAAuB,EACvB,wBAAwB,GACzB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,wBAAwB,EACxB,oBAAoB,EACpB,qBAAqB,EACrB,iBAAiB,EACjB,KAAK,cAAc,EACnB,KAAK,WAAW,EAChB,KAAK,eAAe,GACrB,MAAM,uBAAuB,CAAC;AAC/B,OAAO,EACL,iBAAiB,EACjB,gBAAgB,EAChB,gBAAgB,EAChB,gBAAgB,EAChB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACvB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,uBAAuB,EACvB,uBAAuB,EACvB,mBAAmB,EACnB,oBAAoB,EACpB,KAAK,iBAAiB,EACtB,KAAK,aAAa,EAClB,KAAK,cAAc,GACpB,MAAM,qBAAqB,CAAC;AAC7B,OAAO,EACL,qBAAqB,EACrB,iBAAiB,EACjB,gBAAgB,EAChB,oBAAoB,EACpB,kBAA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7E,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,EACf,KAAK,kBAAkB,EACvB,KAAK,iBAAiB,EACtB,KAAK,gBAAgB,GACtB,MAAM,kBAAkB,CAAC"}
|
package/dist/skill-test/index.js
CHANGED
|
@@ -4,7 +4,7 @@ export { lintEvalExpectations, lintToolExpectationExecutables } from './eval-lin
|
|
|
4
4
|
export { FrictionCategorySchema, FrictionItemSchema, FrictionReportJsonSchema, FrictionReportSchema, FrictionSeveritySchema, } from './friction-schema.js';
|
|
5
5
|
export { mergeFragmentsToFriction, mergeFragmentsToGrading, mergeFragmentsToToolEval, } from './fragment-merge.js';
|
|
6
6
|
export { ToolEvalReportJsonSchema, ToolEvalReportSchema, ToolVerdictBodySchema, ToolVerdictSchema, } from './tool-eval-schema.js';
|
|
7
|
-
export { GradingNonceError, GradingSkewError, parseGradingJson, reconcileGrading, } from './grading-adapter.js';
|
|
7
|
+
export { GradingArmError, GradingNonceError, GradingSkewError, parseGradingJson, reconcileGrading, } from './grading-adapter.js';
|
|
8
8
|
export { GradedExpectationSchema, GradingReportJsonSchema, GradingReportSchema, GradingSummarySchema, } from './grading-schema.js';
|
|
9
9
|
export { assertSafeHarnessRoot, assertSafeWorkdir, deriveHarnessKey, HarnessLocationError, resolveHarnessRoot, } from './harness-location.js';
|
|
10
10
|
export { computeReconcilePlan, StagedEntrySchema, StagedManifestSchema, } from './manifest.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/skill-test/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,eAAe,EACf,cAAc,EACd,eAAe,EACf,cAAc,EACd,mBAAmB,GAIpB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,iBAAiB,EACjB,6BAA6B,EAC7B,kBAAkB,EAClB,iBAAiB,GAGlB,MAAM,oBAAoB,CAAC;AAC5B,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,gBAAgB,GAEjB,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EACL,8BAA8B,EAC9B,mBAAmB,GAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EACL,4BAA4B,EAC5B,iBAAiB,GAElB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,6BAA6B,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAC7F,OAAO,EAAE,kBAAkB,EAAE,oBAAoB,EAAoB,MAAM,WAAW,CAAC;AACvF,OAAO,EACL,qBAAqB,EACrB,kBAAkB,EAClB,aAAa,EACb,YAAY,GAIb,MAAM,cAAc,CAAC;AACtB,OAAO,EACL,iBAAiB,EACjB,gBAAgB,GAEjB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,sBAAsB,EAAE,MAAM,sBAAsB,CAAC;AAClH,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CAAC;AACzD,OAAO,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC7E,OAAO,EACL,kBAAkB,EAClB,0BAA0B,EAC1B,oBAAoB,EACpB,cAAc,EACd,mBAAmB,EACnB,uBAAuB,EACvB,eAAe,GAIhB,MAAM,kBAAkB,CAAC"}
|
|
@@ -1,7 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The harness root for a subject set is already locked.
|
|
3
|
+
*
|
|
4
|
+
* Exit 2 (PREFLIGHT), not 1. This is the most user-correctable condition in the
|
|
5
|
+
* command — the remedy is "wait, or delete one file" — and it was the ONE error
|
|
6
|
+
* class in this feature with no `exitCode`, so it fell through
|
|
7
|
+
* `mapErrorToExitCode`'s default to Internal (1). The published CI recipe reads 1
|
|
8
|
+
* as "the harness broke, fail the build", which is exactly the wrong verdict for a
|
|
9
|
+
* lock held by the operator's own second terminal.
|
|
10
|
+
*
|
|
11
|
+
* The field below is what `mapErrorToExitCode` READS — it is not decoration
|
|
12
|
+
* mirroring an `instanceof` row, which is what it was when it was added. Deleting it
|
|
13
|
+
* turns this back into an exit 1.
|
|
14
|
+
*
|
|
15
|
+
* The message names `lockPath` because the lockfile is created `O_EXCL` in the
|
|
16
|
+
* DETERMINISTIC harness root and released only on normal exit or SIGINT/SIGTERM —
|
|
17
|
+
* a SIGKILL, an OOM, or a crash leaves it behind and every later run of that skill
|
|
18
|
+
* fails here, with no `--force` to escape. Until the staleness protocol (pid +
|
|
19
|
+
* timestamp + liveness probe + `--force`) lands in its own lane, naming the path
|
|
20
|
+
* and saying to delete it IS the escape hatch, so it belongs in the message rather
|
|
21
|
+
* than in a doc the operator is not currently reading.
|
|
22
|
+
*/
|
|
1
23
|
export declare class HarnessLockBusyError extends Error {
|
|
24
|
+
readonly lockPath: string;
|
|
25
|
+
readonly exitCode: 2;
|
|
2
26
|
constructor(lockPath: string);
|
|
3
27
|
}
|
|
4
28
|
export interface HarnessLock {
|
|
29
|
+
/**
|
|
30
|
+
* Release the lock. NEVER THROWS — see {@link acquireHarnessLock}. Callers run
|
|
31
|
+
* this from a cleanup path and must be able to call it bare.
|
|
32
|
+
*/
|
|
5
33
|
release(): void;
|
|
6
34
|
}
|
|
7
35
|
/**
|
|
@@ -9,6 +37,34 @@ export interface HarnessLock {
|
|
|
9
37
|
* vat-vs-vat staging/result races for the same subject set. `wait: false`
|
|
10
38
|
* fails fast; the default `wait: true` is reserved for the CLI to poll (v1
|
|
11
39
|
* keeps the simple fail-fast — the CLI surfaces the busy message).
|
|
40
|
+
*
|
|
41
|
+
* ACQUIRING can throw (that is the whole point: EEXIST → {@link HarnessLockBusyError}).
|
|
42
|
+
* RELEASING cannot, and that asymmetry is deliberate. `rmSync(..., {force: true})`
|
|
43
|
+
* swallows only ENOENT, so an EPERM/EACCES/EROFS on the lockfile — a read-only
|
|
44
|
+
* volume, a `root`-owned temp dir, a Windows handle still open — threw out of the
|
|
45
|
+
* harness `finally` and REPLACED an already-good result (verdict computed, artifacts
|
|
46
|
+
* written, summary composed) with exit 1 and no summary, every artifact sitting
|
|
47
|
+
* unread on disk.
|
|
48
|
+
*
|
|
49
|
+
* The guard lives HERE rather than at the call site, where it originally went. A
|
|
50
|
+
* call-site wrapper is invisible to the compiler: reverting it to a bare
|
|
51
|
+
* `lock.release()` left the whole unit suite AND the integration suite green, so
|
|
52
|
+
* nothing but review stood between the fix and its own silent removal. Owning the
|
|
53
|
+
* contract in the definition — `release()` never throws — means there is no unwrapped
|
|
54
|
+
* call site left to lose. Note what that does NOT mean: `release(): void` encodes
|
|
55
|
+
* nothing about throwing, because TypeScript has no throws clause. The contract is
|
|
56
|
+
* held up by the two nested `try`s below and by the tests that pin each one, not by
|
|
57
|
+
* the signature.
|
|
58
|
+
*
|
|
59
|
+
* BOTH statements of the catch are guarded, and the second one is why: the warning
|
|
60
|
+
* write is itself an fd-level operation, and a synchronous EBADF/EPIPE on a file- or
|
|
61
|
+
* TTY-backed fd 2 threw straight back out — reinstating the exact failure the outer
|
|
62
|
+
* catch was added to prevent, on a path only reachable once something had already
|
|
63
|
+
* gone wrong. A test that mocks `process.stderr.write` to RETURN cannot see it.
|
|
64
|
+
*
|
|
65
|
+
* The failure is not silent: a lockfile that could not be removed will fail the NEXT
|
|
66
|
+
* run of this skill with a "busy" error, and an operator who saw nothing here has no
|
|
67
|
+
* way to connect the two.
|
|
12
68
|
*/
|
|
13
69
|
export declare function acquireHarnessLock(harnessRoot: string, opts?: {
|
|
14
70
|
wait?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/skill-test/lock.ts"],"names":[],"mappings":"AAIA,qBAAa,oBAAqB,SAAQ,KAAK;
|
|
1
|
+
{"version":3,"file":"lock.d.ts","sourceRoot":"","sources":["../../src/skill-test/lock.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,oBAAqB,SAAQ,KAAK;aAEjB,QAAQ,EAAE,MAAM;IAD5C,QAAQ,CAAC,QAAQ,EAAG,CAAC,CAAU;gBACH,QAAQ,EAAE,MAAM;CAS7C;AAED,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,OAAO,IAAI,IAAI,CAAC;CACjB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAiCG;AACH,wBAAgB,kBAAkB,CAAC,WAAW,EAAE,MAAM,EAAE,IAAI,GAAE;IAAE,IAAI,CAAC,EAAE,OAAO,CAAA;CAAO,GAAG,WAAW,CAyClG;AAWD,MAAM,WAAW,2BAA2B;IAC1C;;;;OAIG;IACH,QAAQ,EAAE,MAAM,IAAI,CAAC;IACrB;;;OAGG;IACH,IAAI,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,IAAI,CAAC;CAC/B;AAED;;;;;;;;GAQG;AACH,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,2BAA2B,GAAG,MAAM,IAAI,CAgBlF"}
|