eval-quality 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +190 -0
- package/README.md +355 -0
- package/corpus/dev/README.md +36 -0
- package/corpus/dev/compile-seal-example/brief.json +1 -0
- package/corpus/dev/compile-seal-example/contract.json +1 -0
- package/corpus/dev/contracts/absent-collection-locations.json +1 -0
- package/corpus/dev/contracts/absent-sibling-groups.json +1 -0
- package/corpus/dev/contracts/absent-success-indicator.json +1 -0
- package/corpus/dev/contracts/empty-channel-roles.json +1 -0
- package/corpus/dev/contracts/empty-collection-locations.json +1 -0
- package/corpus/dev/contracts/empty-request-shapes.json +1 -0
- package/corpus/dev/contracts/empty-sibling-groups.json +1 -0
- package/corpus/dev/contracts/no-collection-quantifier.json +1 -0
- package/corpus/dev/contracts/no-operation-inventory.json +1 -0
- package/corpus/dev/contracts/no-read-back-relation.json +1 -0
- package/corpus/dev/contracts/no-state-change-marker.json +1 -0
- package/corpus/dev/contracts/no-type-violating-step.json +1 -0
- package/corpus/dev/contracts/per-key-split-oracles.json +1 -0
- package/corpus/dev/contracts/satisfied-declarations.json +1 -0
- package/corpus/dev/contracts/single-required-response-key.json +1 -0
- package/corpus/dev/contracts/split-indicator-oracle.json +1 -0
- package/corpus/dev/contracts/unaddressed-parameter-sibling.json +1 -0
- package/corpus/dev/contracts/unnamed-reference-set.json +1 -0
- package/corpus/dev/contracts/wrong-cardinality-form.json +1 -0
- package/corpus/dev/index.json +1 -0
- package/dist/adapters/index.d.ts +12 -0
- package/dist/adapters/index.js +3 -0
- package/dist/adapters/local-corpus-adapter.d.ts +7 -0
- package/dist/adapters/local-corpus-adapter.js +78 -0
- package/dist/adapters/node-file-system-adapter.d.ts +7 -0
- package/dist/adapters/node-file-system-adapter.js +39 -0
- package/dist/adapters/port-boundary.d.ts +18 -0
- package/dist/adapters/port-boundary.js +83 -0
- package/dist/adapters/system-clock-adapter.d.ts +10 -0
- package/dist/adapters/system-clock-adapter.js +18 -0
- package/dist/application/compile.d.ts +4 -0
- package/dist/application/compile.js +24 -0
- package/dist/application/diagnostics.d.ts +22 -0
- package/dist/application/diagnostics.js +18 -0
- package/dist/application/index.d.ts +23 -0
- package/dist/application/index.js +17 -0
- package/dist/application/invoke-port.d.ts +2 -0
- package/dist/application/invoke-port.js +45 -0
- package/dist/application/preflight.d.ts +27 -0
- package/dist/application/preflight.js +131 -0
- package/dist/application/seal.d.ts +4 -0
- package/dist/application/seal.js +28 -0
- package/dist/application/serialize.d.ts +6 -0
- package/dist/application/serialize.js +9 -0
- package/dist/cli/arguments.d.ts +28 -0
- package/dist/cli/arguments.js +167 -0
- package/dist/cli/exit-codes.d.ts +36 -0
- package/dist/cli/exit-codes.js +39 -0
- package/dist/cli/main.d.ts +2 -0
- package/dist/cli/main.js +143 -0
- package/dist/cli/render.d.ts +26 -0
- package/dist/cli/render.js +53 -0
- package/dist/cli/run.d.ts +41 -0
- package/dist/cli/run.js +203 -0
- package/dist/core/canonical/canonicalize.d.ts +1 -0
- package/dist/core/canonical/canonicalize.js +113 -0
- package/dist/core/canonical/digest.d.ts +7 -0
- package/dist/core/canonical/digest.js +81 -0
- package/dist/core/canonical/scan-json.d.ts +1 -0
- package/dist/core/canonical/scan-json.js +298 -0
- package/dist/core/canonical/value-domain.d.ts +4 -0
- package/dist/core/canonical/value-domain.js +113 -0
- package/dist/core/compile/compile.d.ts +24 -0
- package/dist/core/compile/compile.js +67 -0
- package/dist/core/compile/declarations.d.ts +5 -0
- package/dist/core/compile/declarations.js +22 -0
- package/dist/core/compile/expression-legality.d.ts +14 -0
- package/dist/core/compile/expression-legality.js +346 -0
- package/dist/core/compile/forbidden-inputs.d.ts +5 -0
- package/dist/core/compile/forbidden-inputs.js +19 -0
- package/dist/core/compile/interface-inventory.d.ts +10 -0
- package/dist/core/compile/interface-inventory.js +55 -0
- package/dist/core/compile/oracle-alignment.d.ts +14 -0
- package/dist/core/compile/oracle-alignment.js +93 -0
- package/dist/core/compile/reachability.d.ts +17 -0
- package/dist/core/compile/reachability.js +177 -0
- package/dist/core/compile/rubrics.d.ts +55 -0
- package/dist/core/compile/rubrics.js +198 -0
- package/dist/core/compile/scripting-bound.d.ts +5 -0
- package/dist/core/compile/scripting-bound.js +151 -0
- package/dist/core/compile/sensitivity-witness.d.ts +73 -0
- package/dist/core/compile/sensitivity-witness.js +232 -0
- package/dist/core/compile/waivers.d.ts +3 -0
- package/dist/core/compile/waivers.js +21 -0
- package/dist/core/coverage/coverage.d.ts +18 -0
- package/dist/core/coverage/coverage.js +47 -0
- package/dist/core/coverage/relevance.d.ts +75 -0
- package/dist/core/coverage/relevance.js +186 -0
- package/dist/core/coverage/rules.d.ts +7 -0
- package/dist/core/coverage/rules.js +18 -0
- package/dist/core/coverage/satisfaction.d.ts +107 -0
- package/dist/core/coverage/satisfaction.js +415 -0
- package/dist/core/coverage/table.d.ts +26 -0
- package/dist/core/coverage/table.js +222 -0
- package/dist/core/declared-inputs.d.ts +16 -0
- package/dist/core/declared-inputs.js +18 -0
- package/dist/core/evaluate/evidence-resolution.d.ts +54 -0
- package/dist/core/evaluate/evidence-resolution.js +153 -0
- package/dist/core/evaluate/operators.d.ts +87 -0
- package/dist/core/evaluate/operators.js +350 -0
- package/dist/core/evaluate/resolution.d.ts +40 -0
- package/dist/core/evaluate/resolution.js +336 -0
- package/dist/core/evaluate/resolved-value.d.ts +9 -0
- package/dist/core/evaluate/resolved-value.js +6 -0
- package/dist/core/failure-codes.d.ts +18 -0
- package/dist/core/failure-codes.js +50 -0
- package/dist/core/lineage/chain.d.ts +49 -0
- package/dist/core/lineage/chain.js +210 -0
- package/dist/core/lineage/freeze.d.ts +12 -0
- package/dist/core/lineage/freeze.js +35 -0
- package/dist/core/lineage/stage-table.d.ts +43 -0
- package/dist/core/lineage/stage-table.js +106 -0
- package/dist/core/preflight/plan.d.ts +67 -0
- package/dist/core/preflight/plan.js +313 -0
- package/dist/core/preflight/projection.d.ts +40 -0
- package/dist/core/preflight/projection.js +96 -0
- package/dist/core/preflight/reduce.d.ts +8 -0
- package/dist/core/preflight/reduce.js +180 -0
- package/dist/core/preflight/witness-evidence.d.ts +42 -0
- package/dist/core/preflight/witness-evidence.js +88 -0
- package/dist/core/probe/target-policy.d.ts +63 -0
- package/dist/core/probe/target-policy.js +328 -0
- package/dist/core/schemas/artifact-reference.d.ts +19 -0
- package/dist/core/schemas/artifact-reference.js +30 -0
- package/dist/core/schemas/artifact.d.ts +1153 -0
- package/dist/core/schemas/artifact.js +84 -0
- package/dist/core/schemas/constraint-ledger.d.ts +57 -0
- package/dist/core/schemas/constraint-ledger.js +143 -0
- package/dist/core/schemas/eval-contract.d.ts +402 -0
- package/dist/core/schemas/eval-contract.js +147 -0
- package/dist/core/schemas/evaluator-configuration.d.ts +37 -0
- package/dist/core/schemas/evaluator-configuration.js +43 -0
- package/dist/core/schemas/evidence-artifact.d.ts +471 -0
- package/dist/core/schemas/evidence-artifact.js +232 -0
- package/dist/core/schemas/expression.d.ts +197 -0
- package/dist/core/schemas/expression.js +284 -0
- package/dist/core/schemas/faults.d.ts +9 -0
- package/dist/core/schemas/faults.js +32 -0
- package/dist/core/schemas/interface.d.ts +417 -0
- package/dist/core/schemas/interface.js +115 -0
- package/dist/core/schemas/isolation-manifest.d.ts +136 -0
- package/dist/core/schemas/isolation-manifest.js +92 -0
- package/dist/core/schemas/lineage.d.ts +21 -0
- package/dist/core/schemas/lineage.js +28 -0
- package/dist/core/schemas/oracle.d.ts +72 -0
- package/dist/core/schemas/oracle.js +35 -0
- package/dist/core/schemas/plan.d.ts +115 -0
- package/dist/core/schemas/plan.js +58 -0
- package/dist/core/schemas/pointer.d.ts +63 -0
- package/dist/core/schemas/pointer.js +94 -0
- package/dist/core/schemas/port-messages.d.ts +103 -0
- package/dist/core/schemas/port-messages.js +90 -0
- package/dist/core/schemas/preflight-verdict.d.ts +60 -0
- package/dist/core/schemas/preflight-verdict.js +38 -0
- package/dist/core/schemas/primitives.d.ts +78 -0
- package/dist/core/schemas/primitives.js +121 -0
- package/dist/core/schemas/private-artifact-manifest.d.ts +56 -0
- package/dist/core/schemas/private-artifact-manifest.js +46 -0
- package/dist/core/schemas/probe-body.d.ts +25 -0
- package/dist/core/schemas/probe-body.js +23 -0
- package/dist/core/schemas/probe-policy.d.ts +76 -0
- package/dist/core/schemas/probe-policy.js +33 -0
- package/dist/core/schemas/probe.d.ts +189 -0
- package/dist/core/schemas/probe.js +82 -0
- package/dist/core/schemas/publish.d.ts +30 -0
- package/dist/core/schemas/publish.js +135 -0
- package/dist/core/schemas/reference-set.d.ts +18 -0
- package/dist/core/schemas/reference-set.js +27 -0
- package/dist/core/schemas/rubric.d.ts +62 -0
- package/dist/core/schemas/rubric.js +68 -0
- package/dist/core/schemas/scoring-policy.d.ts +28 -0
- package/dist/core/schemas/scoring-policy.js +51 -0
- package/dist/core/schemas/sealed-evaluator-brief.d.ts +80 -0
- package/dist/core/schemas/sealed-evaluator-brief.js +59 -0
- package/dist/core/schemas/sealed-run-record.d.ts +382 -0
- package/dist/core/schemas/sealed-run-record.js +215 -0
- package/dist/core/schemas/sensitivity-witness.d.ts +138 -0
- package/dist/core/schemas/sensitivity-witness.js +86 -0
- package/dist/core/schemas/verdict.d.ts +25 -0
- package/dist/core/schemas/verdict.js +20 -0
- package/dist/core/schemas/waiver.d.ts +17 -0
- package/dist/core/schemas/waiver.js +24 -0
- package/dist/core/seal/derived-reference.d.ts +36 -0
- package/dist/core/seal/derived-reference.js +383 -0
- package/dist/core/seal/direction-prose.d.ts +13 -0
- package/dist/core/seal/direction-prose.js +120 -0
- package/dist/core/seal/plan-index.d.ts +63 -0
- package/dist/core/seal/plan-index.js +155 -0
- package/dist/core/seal/scripting-audit.d.ts +15 -0
- package/dist/core/seal/scripting-audit.js +51 -0
- package/dist/core/seal/seal.d.ts +18 -0
- package/dist/core/seal/seal.js +155 -0
- package/dist/core/stage-contracts.d.ts +30 -0
- package/dist/core/stage-contracts.js +1 -0
- package/dist/index.d.ts +15 -0
- package/dist/index.js +22 -0
- package/dist/ports/clock-port.d.ts +13 -0
- package/dist/ports/clock-port.js +7 -0
- package/dist/ports/corpus-port.d.ts +16 -0
- package/dist/ports/corpus-port.js +7 -0
- package/dist/ports/environment-probe-port.d.ts +76 -0
- package/dist/ports/environment-probe-port.js +32 -0
- package/dist/ports/file-system-port.d.ts +27 -0
- package/dist/ports/file-system-port.js +11 -0
- package/dist/ports/port.d.ts +33 -0
- package/dist/ports/port.js +14 -0
- package/dist/testing/conformance.d.ts +88 -0
- package/dist/testing/conformance.js +281 -0
- package/dist/testing/index.d.ts +26 -0
- package/dist/testing/index.js +18 -0
- package/dist/testing/probe-conformance.d.ts +45 -0
- package/dist/testing/probe-conformance.js +186 -0
- package/package.json +130 -0
- package/schemas/artifact-reference.schema.json +64 -0
- package/schemas/eval-contract.schema.json +2145 -0
- package/schemas/evaluator-configuration.schema.json +199 -0
- package/schemas/evidence-artifact.schema.json +1229 -0
- package/schemas/isolation-manifest.schema.json +394 -0
- package/schemas/preflight-verdict.schema.json +114 -0
- package/schemas/private-artifact-manifest.schema.json +103 -0
- package/schemas/probe.schema.json +1151 -0
- package/schemas/rubric.schema.json +148 -0
- package/schemas/scoring-policy.schema.json +90 -0
- package/schemas/sealed-evaluator-brief.schema.json +268 -0
- package/schemas/sealed-run-record.schema.json +875 -0
|
@@ -0,0 +1,402 @@
|
|
|
1
|
+
/** the Eval Contract: every declaration AD-19 requires, in one shape. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* Consistency Conventions: external requirement and risk linkage is an opaque
|
|
5
|
+
* caller-supplied string paired with its scheme, so the entries are objects
|
|
6
|
+
* rather than bare identifiers.
|
|
7
|
+
*/
|
|
8
|
+
export declare const ExternalLink: z.ZodObject<{
|
|
9
|
+
scheme: z.ZodString;
|
|
10
|
+
id: z.ZodString;
|
|
11
|
+
}, z.core.$strict>;
|
|
12
|
+
/**
|
|
13
|
+
* AD-19's three severity levels, exported so they are spelled once (six
|
|
14
|
+
* copies across the finding, seeded defect, outcome, coverage gap, and
|
|
15
|
+
* scoring-policy-floor sites would be the drift the Consistency Conventions
|
|
16
|
+
* warn about). Naming it changes no exported byte: an enum with no
|
|
17
|
+
* `.meta({ id })` inlines at each use site exactly as the literal did.
|
|
18
|
+
*/
|
|
19
|
+
export declare const SEVERITY_LEVELS: readonly ['low', 'material', 'critical'];
|
|
20
|
+
export declare const Severity: z.ZodEnum<{
|
|
21
|
+
critical: "critical";
|
|
22
|
+
low: "low";
|
|
23
|
+
material: "material";
|
|
24
|
+
}>;
|
|
25
|
+
/** the three levels as a type, so a derived severity is declared once. */
|
|
26
|
+
export type Severity = (typeof SEVERITY_LEVELS)[number];
|
|
27
|
+
/**
|
|
28
|
+
* Coin flip (c), settled: linkage lives per behaviour rather than at contract
|
|
29
|
+
* level. See `requirementLinks` below for why; the Gate C fixture's
|
|
30
|
+
* contract-level `linkage` array does not survive that decision.
|
|
31
|
+
*/
|
|
32
|
+
export declare const Behavior: z.ZodObject<{
|
|
33
|
+
id: z.ZodString;
|
|
34
|
+
description: z.ZodString;
|
|
35
|
+
severity: z.ZodEnum<{
|
|
36
|
+
critical: "critical";
|
|
37
|
+
low: "low";
|
|
38
|
+
material: "material";
|
|
39
|
+
}>;
|
|
40
|
+
observableSuccessCriterion: z.ZodNullable<z.ZodString>;
|
|
41
|
+
requirementLinks: z.ZodArray<z.ZodObject<{
|
|
42
|
+
scheme: z.ZodString;
|
|
43
|
+
id: z.ZodString;
|
|
44
|
+
}, z.core.$strict>>;
|
|
45
|
+
riskLinks: z.ZodArray<z.ZodObject<{
|
|
46
|
+
scheme: z.ZodString;
|
|
47
|
+
id: z.ZodString;
|
|
48
|
+
}, z.core.$strict>>;
|
|
49
|
+
oracles: z.ZodArray<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
/**
|
|
52
|
+
* AD-16's scoped resource references. AD-19's declaration list omits them,
|
|
53
|
+
* AD-16 puts them on the sealed brief, and `scoped-reference-resolves-forbidden`
|
|
54
|
+
* fires on one, so a contract with no place for them makes that code
|
|
55
|
+
* unreachable. Both fields are opaque: no AD supplies a value space for `kind`,
|
|
56
|
+
* and inventing one here is the unshaped-declaration defect in reverse.
|
|
57
|
+
*/
|
|
58
|
+
export declare const ScopedResource: z.ZodObject<{
|
|
59
|
+
reference: z.ZodString;
|
|
60
|
+
kind: z.ZodString;
|
|
61
|
+
}, z.core.$strict>;
|
|
62
|
+
/** AD-16's mandatory floor, closed at the prior art's seven members. */
|
|
63
|
+
export declare const FORBIDDEN_INPUT_FLOOR: readonly ['original-spec', 'source-code', 'repository', 'builder-transcript', 'implementation-logs', 'comparator-results', 'human-labels'];
|
|
64
|
+
export declare const ForbiddenInput: z.ZodEnum<{
|
|
65
|
+
"builder-transcript": "builder-transcript";
|
|
66
|
+
"comparator-results": "comparator-results";
|
|
67
|
+
"human-labels": "human-labels";
|
|
68
|
+
"implementation-logs": "implementation-logs";
|
|
69
|
+
"original-spec": "original-spec";
|
|
70
|
+
repository: "repository";
|
|
71
|
+
"source-code": "source-code";
|
|
72
|
+
}>;
|
|
73
|
+
/** the seven members as a type, so `forbiddenInputAccounting` can key by them. */
|
|
74
|
+
export type ForbiddenInput = (typeof FORBIDDEN_INPUT_FLOOR)[number];
|
|
75
|
+
/**
|
|
76
|
+
* A sibling group's minimum membership. AD-19 permits "an explicit empty
|
|
77
|
+
* sibling group", which is read here as the empty group *list*: a group of one
|
|
78
|
+
* has no sibling to cross-check against, so it cannot make AD-20 rule 5
|
|
79
|
+
* relevant, while `[]` is the explicit answer that makes a genuinely
|
|
80
|
+
* sibling-free contract decidably clean.
|
|
81
|
+
*/
|
|
82
|
+
export declare const SIBLING_GROUP_MINIMUM = 2;
|
|
83
|
+
export declare const SiblingGroups: z.ZodObject<{
|
|
84
|
+
operations: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
85
|
+
parameters: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
86
|
+
}, z.core.$strict>;
|
|
87
|
+
export declare const TestData: z.ZodObject<{
|
|
88
|
+
setup: z.ZodNullable<z.ZodString>;
|
|
89
|
+
cleanup: z.ZodNullable<z.ZodString>;
|
|
90
|
+
}, z.core.$strict>;
|
|
91
|
+
export declare const Budgets: z.ZodObject<{
|
|
92
|
+
maxToolCalls: z.ZodInt;
|
|
93
|
+
maxWallClockMinutes: z.ZodInt;
|
|
94
|
+
maxCostUsd: z.ZodString;
|
|
95
|
+
}, z.core.$strict>;
|
|
96
|
+
export declare const EvalContract: z.ZodObject<{
|
|
97
|
+
schemaVersion: z.ZodInt;
|
|
98
|
+
parentDigest: z.ZodNullable<z.ZodString>;
|
|
99
|
+
revisionCount: z.ZodInt;
|
|
100
|
+
contractId: z.ZodString;
|
|
101
|
+
sourceSpecDigest: z.ZodNullable<z.ZodString>;
|
|
102
|
+
behaviors: z.ZodArray<z.ZodObject<{
|
|
103
|
+
id: z.ZodString;
|
|
104
|
+
description: z.ZodString;
|
|
105
|
+
severity: z.ZodEnum<{
|
|
106
|
+
critical: "critical";
|
|
107
|
+
low: "low";
|
|
108
|
+
material: "material";
|
|
109
|
+
}>;
|
|
110
|
+
observableSuccessCriterion: z.ZodNullable<z.ZodString>;
|
|
111
|
+
requirementLinks: z.ZodArray<z.ZodObject<{
|
|
112
|
+
scheme: z.ZodString;
|
|
113
|
+
id: z.ZodString;
|
|
114
|
+
}, z.core.$strict>>;
|
|
115
|
+
riskLinks: z.ZodArray<z.ZodObject<{
|
|
116
|
+
scheme: z.ZodString;
|
|
117
|
+
id: z.ZodString;
|
|
118
|
+
}, z.core.$strict>>;
|
|
119
|
+
oracles: z.ZodArray<z.ZodString>;
|
|
120
|
+
}, z.core.$strict>>;
|
|
121
|
+
oracles: z.ZodArray<z.ZodObject<{
|
|
122
|
+
id: z.ZodString;
|
|
123
|
+
direction: z.ZodNullable<z.ZodObject<{
|
|
124
|
+
evidenceTargets: z.ZodArray<z.ZodString>;
|
|
125
|
+
relation: z.ZodEnum<{
|
|
126
|
+
absence: "absence";
|
|
127
|
+
all: "all";
|
|
128
|
+
any: "any";
|
|
129
|
+
containment: "containment";
|
|
130
|
+
"count-tolerance": "count-tolerance";
|
|
131
|
+
"covers-by-key": "covers-by-key";
|
|
132
|
+
"deep-equality": "deep-equality";
|
|
133
|
+
equality: "equality";
|
|
134
|
+
existence: "existence";
|
|
135
|
+
"for-all": "for-all";
|
|
136
|
+
"for-any": "for-any";
|
|
137
|
+
not: "not";
|
|
138
|
+
ordering: "ordering";
|
|
139
|
+
regex: "regex";
|
|
140
|
+
"set-membership": "set-membership";
|
|
141
|
+
shape: "shape";
|
|
142
|
+
}>;
|
|
143
|
+
polarity: z.ZodEnum<{
|
|
144
|
+
"expects-hold": "expects-hold";
|
|
145
|
+
"expects-violation": "expects-violation";
|
|
146
|
+
}>;
|
|
147
|
+
scope: z.ZodNullable<z.ZodString>;
|
|
148
|
+
negativeDomain: z.ZodNullable<z.ZodString>;
|
|
149
|
+
}, z.core.$strict>>;
|
|
150
|
+
check: z.ZodNullable<z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>>;
|
|
151
|
+
polarity: z.ZodEnum<{
|
|
152
|
+
"expects-hold": "expects-hold";
|
|
153
|
+
"expects-violation": "expects-violation";
|
|
154
|
+
}>;
|
|
155
|
+
commentary: z.ZodNullable<z.ZodString>;
|
|
156
|
+
}, z.core.$strict>>;
|
|
157
|
+
rubrics: z.ZodArray<z.ZodObject<{
|
|
158
|
+
id: z.ZodString;
|
|
159
|
+
scaleLevels: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
160
|
+
level: z.ZodInt;
|
|
161
|
+
anchor: z.ZodString;
|
|
162
|
+
}, z.core.$strict>>>;
|
|
163
|
+
failureModePenalties: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
164
|
+
name: z.ZodString;
|
|
165
|
+
description: z.ZodString;
|
|
166
|
+
}, z.core.$strict>>>;
|
|
167
|
+
maxLength: z.ZodNullable<z.ZodInt>;
|
|
168
|
+
criteria: z.ZodArray<z.ZodObject<{
|
|
169
|
+
id: z.ZodString;
|
|
170
|
+
text: z.ZodString;
|
|
171
|
+
evidence: z.ZodString;
|
|
172
|
+
}, z.core.$strict>>;
|
|
173
|
+
}, z.core.$strict>>;
|
|
174
|
+
waivers: z.ZodArray<z.ZodObject<{
|
|
175
|
+
id: z.ZodString;
|
|
176
|
+
rule: z.ZodNullable<z.ZodString>;
|
|
177
|
+
rationale: z.ZodNullable<z.ZodString>;
|
|
178
|
+
condition: z.ZodNullable<z.ZodString>;
|
|
179
|
+
approval: z.ZodNullable<z.ZodString>;
|
|
180
|
+
expiresAt: z.ZodNullable<z.ZodISODateTime>;
|
|
181
|
+
}, z.core.$strict>>;
|
|
182
|
+
permittedInterfaces: z.ZodArray<z.ZodObject<{
|
|
183
|
+
logicalId: z.ZodString;
|
|
184
|
+
kind: z.ZodEnum<{
|
|
185
|
+
api: "api";
|
|
186
|
+
cli: "cli";
|
|
187
|
+
mcp: "mcp";
|
|
188
|
+
web: "web";
|
|
189
|
+
}>;
|
|
190
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
191
|
+
operationId: z.ZodString;
|
|
192
|
+
method: z.ZodEnum<{
|
|
193
|
+
DELETE: "DELETE";
|
|
194
|
+
GET: "GET";
|
|
195
|
+
HEAD: "HEAD";
|
|
196
|
+
OPTIONS: "OPTIONS";
|
|
197
|
+
PATCH: "PATCH";
|
|
198
|
+
POST: "POST";
|
|
199
|
+
PUT: "PUT";
|
|
200
|
+
}>;
|
|
201
|
+
pathTemplate: z.ZodString;
|
|
202
|
+
stateChangeMarker: z.ZodBoolean;
|
|
203
|
+
requestShape: z.ZodObject<{
|
|
204
|
+
path: z.ZodObject<{
|
|
205
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
206
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
207
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
208
|
+
array: "array";
|
|
209
|
+
boolean: "boolean";
|
|
210
|
+
null: "null";
|
|
211
|
+
number: "number";
|
|
212
|
+
object: "object";
|
|
213
|
+
string: "string";
|
|
214
|
+
}>>>;
|
|
215
|
+
}, z.core.$strict>;
|
|
216
|
+
query: z.ZodObject<{
|
|
217
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
218
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
219
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
220
|
+
array: "array";
|
|
221
|
+
boolean: "boolean";
|
|
222
|
+
null: "null";
|
|
223
|
+
number: "number";
|
|
224
|
+
object: "object";
|
|
225
|
+
string: "string";
|
|
226
|
+
}>>>;
|
|
227
|
+
}, z.core.$strict>;
|
|
228
|
+
header: z.ZodObject<{
|
|
229
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
230
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
231
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
232
|
+
array: "array";
|
|
233
|
+
boolean: "boolean";
|
|
234
|
+
null: "null";
|
|
235
|
+
number: "number";
|
|
236
|
+
object: "object";
|
|
237
|
+
string: "string";
|
|
238
|
+
}>>>;
|
|
239
|
+
}, z.core.$strict>;
|
|
240
|
+
body: z.ZodObject<{
|
|
241
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
242
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
243
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
244
|
+
array: "array";
|
|
245
|
+
boolean: "boolean";
|
|
246
|
+
null: "null";
|
|
247
|
+
number: "number";
|
|
248
|
+
object: "object";
|
|
249
|
+
string: "string";
|
|
250
|
+
}>>>;
|
|
251
|
+
}, z.core.$strict>;
|
|
252
|
+
}, z.core.$strict>;
|
|
253
|
+
responseDescriptor: z.ZodObject<{
|
|
254
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
255
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
256
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
257
|
+
array: "array";
|
|
258
|
+
boolean: "boolean";
|
|
259
|
+
null: "null";
|
|
260
|
+
number: "number";
|
|
261
|
+
object: "object";
|
|
262
|
+
string: "string";
|
|
263
|
+
}>>>;
|
|
264
|
+
successIndicator: z.ZodNullable<z.ZodString>;
|
|
265
|
+
channelRoles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
266
|
+
collection: "collection";
|
|
267
|
+
diagnostic: "diagnostic";
|
|
268
|
+
payload: "payload";
|
|
269
|
+
"success-indicator": "success-indicator";
|
|
270
|
+
}>>>;
|
|
271
|
+
collectionLocations: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
272
|
+
pointer: z.ZodString;
|
|
273
|
+
expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
274
|
+
mode: z.ZodLiteral<"exact">;
|
|
275
|
+
count: z.ZodInt;
|
|
276
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
277
|
+
mode: z.ZodLiteral<"at-most">;
|
|
278
|
+
max: z.ZodInt;
|
|
279
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
280
|
+
mode: z.ZodLiteral<"page-bounded">;
|
|
281
|
+
max: z.ZodInt;
|
|
282
|
+
}, z.core.$strict>], "mode">;
|
|
283
|
+
referenceSet: z.ZodNullable<z.ZodString>;
|
|
284
|
+
}, z.core.$strict>>>;
|
|
285
|
+
}, z.core.$strict>;
|
|
286
|
+
volatilePointers: z.ZodArray<z.ZodString>;
|
|
287
|
+
sensitivityWitness: z.ZodNullable<z.ZodObject<{
|
|
288
|
+
witnessId: z.ZodString;
|
|
289
|
+
channel: z.ZodEnum<{
|
|
290
|
+
body: "body";
|
|
291
|
+
path: "path";
|
|
292
|
+
query: "query";
|
|
293
|
+
}>;
|
|
294
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
295
|
+
legId: z.ZodString;
|
|
296
|
+
inputs: z.ZodObject<{
|
|
297
|
+
path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
298
|
+
query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
299
|
+
header: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
300
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
301
|
+
kind: z.ZodLiteral<"json">;
|
|
302
|
+
value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
303
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
304
|
+
kind: z.ZodLiteral<"absent">;
|
|
305
|
+
}, z.core.$strict>], "kind">;
|
|
306
|
+
}, z.core.$strict>;
|
|
307
|
+
}, z.core.$strict>>;
|
|
308
|
+
relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
|
|
309
|
+
}, z.core.$strict>>;
|
|
310
|
+
}, z.core.$strict>>;
|
|
311
|
+
}, z.core.$strict>>;
|
|
312
|
+
referenceSets: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodObject<{
|
|
313
|
+
keys: z.ZodArray<z.ZodString>;
|
|
314
|
+
members: z.ZodArray<z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>>;
|
|
315
|
+
commentary: z.ZodNullable<z.ZodString>;
|
|
316
|
+
}, z.core.$strict>>>;
|
|
317
|
+
siblingGroups: z.ZodNullable<z.ZodObject<{
|
|
318
|
+
operations: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
319
|
+
parameters: z.ZodArray<z.ZodArray<z.ZodString>>;
|
|
320
|
+
}, z.core.$strict>>;
|
|
321
|
+
interactionPlan: z.ZodArray<z.ZodObject<{
|
|
322
|
+
stepId: z.ZodString;
|
|
323
|
+
operationId: z.ZodString;
|
|
324
|
+
inputBinding: z.ZodObject<{
|
|
325
|
+
path: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
326
|
+
literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
327
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
328
|
+
matcher: z.ZodEnum<{
|
|
329
|
+
any: "any";
|
|
330
|
+
"type-violating": "type-violating";
|
|
331
|
+
}>;
|
|
332
|
+
}, z.core.$strict>]>>>;
|
|
333
|
+
query: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
334
|
+
literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
335
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
336
|
+
matcher: z.ZodEnum<{
|
|
337
|
+
any: "any";
|
|
338
|
+
"type-violating": "type-violating";
|
|
339
|
+
}>;
|
|
340
|
+
}, z.core.$strict>]>>>;
|
|
341
|
+
header: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
342
|
+
literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
343
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
344
|
+
matcher: z.ZodEnum<{
|
|
345
|
+
any: "any";
|
|
346
|
+
"type-violating": "type-violating";
|
|
347
|
+
}>;
|
|
348
|
+
}, z.core.$strict>]>>>;
|
|
349
|
+
body: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodObject<{
|
|
350
|
+
literal: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
351
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
352
|
+
matcher: z.ZodEnum<{
|
|
353
|
+
any: "any";
|
|
354
|
+
"type-violating": "type-violating";
|
|
355
|
+
}>;
|
|
356
|
+
}, z.core.$strict>]>>>;
|
|
357
|
+
}, z.core.$strict>;
|
|
358
|
+
after: z.ZodNullable<z.ZodString>;
|
|
359
|
+
}, z.core.$strict>>;
|
|
360
|
+
scopedResources: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
361
|
+
reference: z.ZodString;
|
|
362
|
+
kind: z.ZodString;
|
|
363
|
+
}, z.core.$strict>>>;
|
|
364
|
+
forbiddenInputs: z.ZodArray<z.ZodEnum<{
|
|
365
|
+
"builder-transcript": "builder-transcript";
|
|
366
|
+
"comparator-results": "comparator-results";
|
|
367
|
+
"human-labels": "human-labels";
|
|
368
|
+
"implementation-logs": "implementation-logs";
|
|
369
|
+
"original-spec": "original-spec";
|
|
370
|
+
repository: "repository";
|
|
371
|
+
"source-code": "source-code";
|
|
372
|
+
}>>;
|
|
373
|
+
testData: z.ZodObject<{
|
|
374
|
+
setup: z.ZodNullable<z.ZodString>;
|
|
375
|
+
cleanup: z.ZodNullable<z.ZodString>;
|
|
376
|
+
}, z.core.$strict>;
|
|
377
|
+
budgets: z.ZodObject<{
|
|
378
|
+
maxToolCalls: z.ZodInt;
|
|
379
|
+
maxWallClockMinutes: z.ZodInt;
|
|
380
|
+
maxCostUsd: z.ZodString;
|
|
381
|
+
}, z.core.$strict>;
|
|
382
|
+
safetyLimits: z.ZodArray<z.ZodString>;
|
|
383
|
+
requiredEvidence: z.ZodArray<z.ZodString>;
|
|
384
|
+
probeStepBound: z.ZodNullable<z.ZodInt>;
|
|
385
|
+
fixtureReset: z.ZodNullable<z.ZodObject<{
|
|
386
|
+
legId: z.ZodString;
|
|
387
|
+
interfaceId: z.ZodString;
|
|
388
|
+
operationId: z.ZodString;
|
|
389
|
+
inputs: z.ZodObject<{
|
|
390
|
+
path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
391
|
+
query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
392
|
+
header: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
393
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
394
|
+
kind: z.ZodLiteral<"json">;
|
|
395
|
+
value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
396
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
397
|
+
kind: z.ZodLiteral<"absent">;
|
|
398
|
+
}, z.core.$strict>], "kind">;
|
|
399
|
+
}, z.core.$strict>;
|
|
400
|
+
}, z.core.$strict>>;
|
|
401
|
+
}, z.core.$strict>;
|
|
402
|
+
export type EvalContract = z.infer<typeof EvalContract>;
|
|
@@ -0,0 +1,147 @@
|
|
|
1
|
+
/** the Eval Contract: every declaration AD-19 requires, in one shape. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { PermittedInterface } from './interface.js';
|
|
4
|
+
import { lineageFields } from './lineage.js';
|
|
5
|
+
import { Oracle } from './oracle.js';
|
|
6
|
+
import { InteractionStep } from './plan.js';
|
|
7
|
+
import { BehaviorId, Digest, Identifier, KeyName, OracleId, UnsignedDecimalString, } from './primitives.js';
|
|
8
|
+
import { ReferenceSetDeclaration } from './reference-set.js';
|
|
9
|
+
import { RubricBody } from './rubric.js';
|
|
10
|
+
import { FixtureReset } from './sensitivity-witness.js';
|
|
11
|
+
import { Waiver } from './waiver.js';
|
|
12
|
+
/**
|
|
13
|
+
* Consistency Conventions: external requirement and risk linkage is an opaque
|
|
14
|
+
* caller-supplied string paired with its scheme, so the entries are objects
|
|
15
|
+
* rather than bare identifiers.
|
|
16
|
+
*/
|
|
17
|
+
export const ExternalLink = z.strictObject({
|
|
18
|
+
scheme: z.string().min(1),
|
|
19
|
+
id: z.string().min(1),
|
|
20
|
+
});
|
|
21
|
+
/**
|
|
22
|
+
* AD-19's three severity levels, exported so they are spelled once (six
|
|
23
|
+
* copies across the finding, seeded defect, outcome, coverage gap, and
|
|
24
|
+
* scoring-policy-floor sites would be the drift the Consistency Conventions
|
|
25
|
+
* warn about). Naming it changes no exported byte: an enum with no
|
|
26
|
+
* `.meta({ id })` inlines at each use site exactly as the literal did.
|
|
27
|
+
*/
|
|
28
|
+
export const SEVERITY_LEVELS = ['low', 'material', 'critical'];
|
|
29
|
+
export const Severity = z.enum(SEVERITY_LEVELS);
|
|
30
|
+
/**
|
|
31
|
+
* Coin flip (c), settled: linkage lives per behaviour rather than at contract
|
|
32
|
+
* level. See `requirementLinks` below for why; the Gate C fixture's
|
|
33
|
+
* contract-level `linkage` array does not survive that decision.
|
|
34
|
+
*/
|
|
35
|
+
export const Behavior = z.strictObject({
|
|
36
|
+
id: BehaviorId,
|
|
37
|
+
description: z.string(),
|
|
38
|
+
severity: Severity,
|
|
39
|
+
observableSuccessCriterion: z
|
|
40
|
+
.string()
|
|
41
|
+
.nullable()
|
|
42
|
+
.describe('AD-19: what observable condition means this behaviour was met, which is not the nominated success indicator of any one operation. `null` is the shape `no-observable-success-criterion` fires on, and that code fires on exactly this condition and never on an empty oracle list.'),
|
|
43
|
+
requirementLinks: z
|
|
44
|
+
.array(ExternalLink)
|
|
45
|
+
.describe('Coin flip (c), settled: requirement and risk linkage lives per behaviour rather than at contract level, because `missing-requirement-linkage` fires when "a behaviour declares no requirement or risk identifier" and a contract-level array cannot make that predicate decidable per behaviour. Empty is legal, and both link arrays empty is exactly what the code fires on; a schema demanding non-empty makes it fire never.'),
|
|
46
|
+
riskLinks: z.array(ExternalLink),
|
|
47
|
+
oracles: z
|
|
48
|
+
.array(OracleId)
|
|
49
|
+
.describe("Identifiers of the oracles this behaviour is discharged by. Deliberately not refined against the contract's declared oracles: no AD-5 code names a behaviour citing an undeclared oracle, so it joins the cross-field rules with no code, unenforced in v0 rather than silently pushed into the schema."),
|
|
50
|
+
});
|
|
51
|
+
/**
|
|
52
|
+
* AD-16's scoped resource references. AD-19's declaration list omits them,
|
|
53
|
+
* AD-16 puts them on the sealed brief, and `scoped-reference-resolves-forbidden`
|
|
54
|
+
* fires on one, so a contract with no place for them makes that code
|
|
55
|
+
* unreachable. Both fields are opaque: no AD supplies a value space for `kind`,
|
|
56
|
+
* and inventing one here is the unshaped-declaration defect in reverse.
|
|
57
|
+
*/
|
|
58
|
+
export const ScopedResource = z.strictObject({
|
|
59
|
+
reference: z.string().min(1),
|
|
60
|
+
kind: z.string().min(1),
|
|
61
|
+
});
|
|
62
|
+
/** AD-16's mandatory floor, closed at the prior art's seven members. */
|
|
63
|
+
export const FORBIDDEN_INPUT_FLOOR = [
|
|
64
|
+
'original-spec',
|
|
65
|
+
'source-code',
|
|
66
|
+
'repository',
|
|
67
|
+
'builder-transcript',
|
|
68
|
+
'implementation-logs',
|
|
69
|
+
'comparator-results',
|
|
70
|
+
'human-labels',
|
|
71
|
+
];
|
|
72
|
+
export const ForbiddenInput = z.enum(FORBIDDEN_INPUT_FLOOR);
|
|
73
|
+
/**
|
|
74
|
+
* A sibling group's minimum membership. AD-19 permits "an explicit empty
|
|
75
|
+
* sibling group", which is read here as the empty group *list*: a group of one
|
|
76
|
+
* has no sibling to cross-check against, so it cannot make AD-20 rule 5
|
|
77
|
+
* relevant, while `[]` is the explicit answer that makes a genuinely
|
|
78
|
+
* sibling-free contract decidably clean.
|
|
79
|
+
*/
|
|
80
|
+
export const SIBLING_GROUP_MINIMUM = 2;
|
|
81
|
+
export const SiblingGroups = z.strictObject({
|
|
82
|
+
operations: z.array(z.array(Identifier).min(SIBLING_GROUP_MINIMUM)),
|
|
83
|
+
parameters: z.array(z.array(KeyName).min(SIBLING_GROUP_MINIMUM)),
|
|
84
|
+
});
|
|
85
|
+
export const TestData = z.strictObject({
|
|
86
|
+
setup: z.string().nullable(),
|
|
87
|
+
cleanup: z.string().nullable(),
|
|
88
|
+
});
|
|
89
|
+
export const Budgets = z.strictObject({
|
|
90
|
+
maxToolCalls: z.int().min(0),
|
|
91
|
+
maxWallClockMinutes: z.int().min(0),
|
|
92
|
+
maxCostUsd: UnsignedDecimalString.describe('Money, so AD-36 carries it as a string in a declared format rather than as a JSON number. Constrained to the unsigned form: a negative ceiling is not a ceiling.'),
|
|
93
|
+
});
|
|
94
|
+
export const EvalContract = z
|
|
95
|
+
.strictObject({
|
|
96
|
+
// AD-11's schemaVersion and AD-29's lineage pair, spread from the leaf
|
|
97
|
+
// module every lineage-bearing artifact spreads from; the descriptions
|
|
98
|
+
// moved verbatim since rewriting them would change the export bytes.
|
|
99
|
+
// Spread rather than nested, so this shape and the reject fixtures
|
|
100
|
+
// naming `['schemaVersion']` or `['parentDigest']` stay unchanged.
|
|
101
|
+
...lineageFields,
|
|
102
|
+
contractId: Identifier,
|
|
103
|
+
sourceSpecDigest: Digest.nullable().describe('AD-18 permits a digest where the content is forbidden, so the contract may name the specification it was authored against without carrying it.'),
|
|
104
|
+
behaviors: z
|
|
105
|
+
.array(Behavior)
|
|
106
|
+
.min(1)
|
|
107
|
+
.describe('US spelling, matching the prior art and both hand-authored contracts. A contract with no behaviour declares nothing to evaluate.'),
|
|
108
|
+
oracles: z
|
|
109
|
+
.array(Oracle)
|
|
110
|
+
.describe('No minimum. AD-19 is explicit that `no-observable-success-criterion` "never fires on an empty oracle list", so an empty list must parse.'),
|
|
111
|
+
rubrics: z
|
|
112
|
+
.array(RubricBody)
|
|
113
|
+
.describe('Empty is legal: a zero-rubric contract compiles clean.'),
|
|
114
|
+
waivers: z.array(Waiver),
|
|
115
|
+
permittedInterfaces: z
|
|
116
|
+
.array(PermittedInterface)
|
|
117
|
+
.describe('AD-35: logical identifiers only. No entry here is ever a URL, a host, or a port.'),
|
|
118
|
+
referenceSets: z
|
|
119
|
+
.record(Identifier, ReferenceSetDeclaration)
|
|
120
|
+
.nullable()
|
|
121
|
+
.describe('Caller-keyed by reference-set identifier. AD-31 grades an absent declaration and an explicit empty one differently, so `null`, `{}`, and a populated map are three distinct answers.'),
|
|
122
|
+
siblingGroups: SiblingGroups.nullable().describe('AD-20 rule 5 relevance reads this. `null` is absent, `{ "operations": [], "parameters": [] }` is the explicit empty answer AD-19 calls a declaration, and a populated group makes the rule relevant.'),
|
|
123
|
+
interactionPlan: z
|
|
124
|
+
.array(InteractionStep)
|
|
125
|
+
.describe('No maximum and no bound on `after` chains. `plan-exceeds-scripting-bound` needs the sixty-four-pair and eight-chain plans representable, and the compiler owns the graph predicate. An empty plan is the cheapest `unreachable-check-evidence` fixture.'),
|
|
126
|
+
scopedResources: z
|
|
127
|
+
.array(ScopedResource)
|
|
128
|
+
.nullable()
|
|
129
|
+
.describe('Absent, empty, and populated are three distinct answers. A reference at all is what `scoped-reference-resolves-forbidden` fires on.'),
|
|
130
|
+
forbiddenInputs: z
|
|
131
|
+
.array(ForbiddenInput)
|
|
132
|
+
.describe('A list short of the seven is `forbidden-input-floor-incomplete`, a coded compile-time error, so a short list must parse.'),
|
|
133
|
+
testData: TestData,
|
|
134
|
+
budgets: Budgets,
|
|
135
|
+
safetyLimits: z.array(z.string()),
|
|
136
|
+
requiredEvidence: z.array(z.string()),
|
|
137
|
+
probeStepBound: z
|
|
138
|
+
.int()
|
|
139
|
+
.min(0)
|
|
140
|
+
.nullable()
|
|
141
|
+
.describe("AD-16's declared bound on enumerated probe steps, which the brief-side scripting audit reads. No AD gives it a home and the Configuration convention's policy-artifact list omits it, so it lands here beside the other ceilings. The AD-5 code that audit fires is `brief-exceeds-scripting-bound`."),
|
|
142
|
+
fixtureReset: FixtureReset.nullable().describe("AD-10's per-run state reset, declared as the operation that performs it, so the reset is one more probe leg through the environment-probe port. `null` selects AD-10's repeated-read immutability branch, which is also the check that catches a volatile response field the contract failed to declare."),
|
|
143
|
+
})
|
|
144
|
+
.meta({
|
|
145
|
+
id: 'EvalContract',
|
|
146
|
+
description: "The Eval Contract. Succeeds the prior-art `eval-contract` schema per AD-24. It carries every declaration AD-19 requires so that AD-31's fourteen relevance and satisfaction predicates are decidable from declarations alone. AD-10's sensitivity witnesses arrived in this version, on each operation, as the additive `schemaVersion` bump AD-11 requires; the bump is recorded in each new field's own description, since no reader in this version declares an expected version constant to compare against.",
|
|
147
|
+
});
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
/** the evaluator's own configuration, digested into the scoring version. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* AD-17's judge configuration. `modelSnapshot` is required and non-nullable
|
|
5
|
+
* here because the no-judge state is spelled once, as `null` on
|
|
6
|
+
* `judgeConfiguration` itself; letting this field be `null` too would create a
|
|
7
|
+
* second, indistinguishable way to say "no judge". `systemPromptDigest` stays
|
|
8
|
+
* nullable: a judge invoked with no system prompt of its own is still
|
|
9
|
+
* configured.
|
|
10
|
+
*/
|
|
11
|
+
export declare const JudgeConfiguration: z.ZodObject<{
|
|
12
|
+
modelSnapshot: z.ZodString;
|
|
13
|
+
systemPromptDigest: z.ZodNullable<z.ZodString>;
|
|
14
|
+
}, z.core.$strict>;
|
|
15
|
+
export declare const EvaluatorConfiguration: z.ZodObject<{
|
|
16
|
+
schemaVersion: z.ZodInt;
|
|
17
|
+
parentDigest: z.ZodNullable<z.ZodString>;
|
|
18
|
+
revisionCount: z.ZodInt;
|
|
19
|
+
sealedBriefDigest: z.ZodString;
|
|
20
|
+
evaluatorIdentity: z.ZodString;
|
|
21
|
+
modelSnapshot: z.ZodString;
|
|
22
|
+
systemPromptDigest: z.ZodString;
|
|
23
|
+
decodingParameters: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
24
|
+
toolInventory: z.ZodArray<z.ZodString>;
|
|
25
|
+
permissionInventory: z.ZodArray<z.ZodString>;
|
|
26
|
+
budgets: z.ZodObject<{
|
|
27
|
+
maxToolCalls: z.ZodInt;
|
|
28
|
+
maxWallClockMinutes: z.ZodInt;
|
|
29
|
+
maxCostUsd: z.ZodString;
|
|
30
|
+
}, z.core.$strict>;
|
|
31
|
+
seed: z.ZodNullable<z.ZodInt>;
|
|
32
|
+
judgeConfiguration: z.ZodNullable<z.ZodObject<{
|
|
33
|
+
modelSnapshot: z.ZodString;
|
|
34
|
+
systemPromptDigest: z.ZodNullable<z.ZodString>;
|
|
35
|
+
}, z.core.$strict>>;
|
|
36
|
+
}, z.core.$strict>;
|
|
37
|
+
export type EvaluatorConfiguration = z.infer<typeof EvaluatorConfiguration>;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
/** the evaluator's own configuration, digested into the scoring version. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { Budgets } from './eval-contract.js';
|
|
4
|
+
import { lineageFields } from './lineage.js';
|
|
5
|
+
import { Digest, JsonObjectValue } from './primitives.js';
|
|
6
|
+
/**
|
|
7
|
+
* AD-17's judge configuration. `modelSnapshot` is required and non-nullable
|
|
8
|
+
* here because the no-judge state is spelled once, as `null` on
|
|
9
|
+
* `judgeConfiguration` itself; letting this field be `null` too would create a
|
|
10
|
+
* second, indistinguishable way to say "no judge". `systemPromptDigest` stays
|
|
11
|
+
* nullable: a judge invoked with no system prompt of its own is still
|
|
12
|
+
* configured.
|
|
13
|
+
*/
|
|
14
|
+
export const JudgeConfiguration = z.strictObject({
|
|
15
|
+
modelSnapshot: z.string().min(1),
|
|
16
|
+
systemPromptDigest: Digest.nullable().describe('`null` for a judge configured with no system prompt of its own. This is the only nullable member: the absent-judge state belongs to the field above, not to this shape.'),
|
|
17
|
+
});
|
|
18
|
+
export const EvaluatorConfiguration = z
|
|
19
|
+
.strictObject({
|
|
20
|
+
...lineageFields,
|
|
21
|
+
sealedBriefDigest: Digest,
|
|
22
|
+
evaluatorIdentity: z
|
|
23
|
+
.string()
|
|
24
|
+
.min(1)
|
|
25
|
+
.describe('Opaque, and named so by AD-24. AD-18 excludes credentials, tokens, real names, email addresses, account identifiers, and transaction content from every artifact; no schema over an opaque string enforces that, so the prohibition is stated and recorded in the constraint ledger as not expressible.'),
|
|
26
|
+
modelSnapshot: z.string().min(1),
|
|
27
|
+
systemPromptDigest: Digest,
|
|
28
|
+
decodingParameters: JsonObjectValue.describe("AD-24's \"decoding and sampling parameters\", carried in the value container under the caller's own keys rather than as a minted enum of temperature and top-p. AD-2 forbids provider or model SDK knowledge in this package, so a closed parameter vocabulary would be knowledge the package is not allowed to have. `JsonObjectValue` sits inside AD-36's value domain, which matters because this artifact's digest enters the scoring version. One field, not two: \"decoding and sampling parameters\" is one concern under two words, and splitting it would draw a boundary no AD draws. Caller-keyed, but inside the value container rather than a control map, so it does not join the Conventions' caller-keyed list."),
|
|
29
|
+
toolInventory: z
|
|
30
|
+
.array(z.string())
|
|
31
|
+
.describe('AD-18 binds this field and `permissionInventory` hardest: a tool and permission inventory is exactly where a caller would paste an API key. The prohibition is not expressible over opaque strings and is recorded in the ledger.'),
|
|
32
|
+
permissionInventory: z.array(z.string()),
|
|
33
|
+
budgets: Budgets,
|
|
34
|
+
seed: z
|
|
35
|
+
.int()
|
|
36
|
+
.nullable()
|
|
37
|
+
.describe('AD-24\'s "seed where supported". "Where supported" is spelled `null`; an omitted key is not the convention.'),
|
|
38
|
+
judgeConfiguration: JudgeConfiguration.nullable().describe('`null` where no judge is configured, which is the ordinary case for a contract declaring no rubric.'),
|
|
39
|
+
})
|
|
40
|
+
.meta({
|
|
41
|
+
id: 'EvaluatorConfiguration',
|
|
42
|
+
description: 'The evaluator\'s configuration, a first-class published artifact with no prior art. AD-24 fixes its field list: the sealed-brief digest, opaque evaluator identity, model snapshot, system-prompt digest, decoding and sampling parameters, tool and permission inventory, budgets, seed where supported, and judge configuration, "with the trial index deliberately excluded so trials pool into one scoring version". That exclusion is a requirement rather than an omission: because this object is strict, a `trialIndex` key fails with `unrecognized_keys` at the root, and a test asserts exactly that. The trial index lives on the Sealed Run Record instead. Ingest computes this artifact\'s digest and invalidates the run when it is absent or incomplete.',
|
|
43
|
+
});
|