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,417 @@
|
|
|
1
|
+
/** permitted interfaces and the per-operation declaration inventory. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/** AD-19's closed four-member set, declared per pointer the descriptor names. */
|
|
4
|
+
export declare const ChannelRole: z.ZodEnum<{
|
|
5
|
+
collection: "collection";
|
|
6
|
+
diagnostic: "diagnostic";
|
|
7
|
+
payload: "payload";
|
|
8
|
+
"success-indicator": "success-indicator";
|
|
9
|
+
}>;
|
|
10
|
+
/**
|
|
11
|
+
* AD-19's closed mode set. `page-bounded` is what makes AD-20 rule 6's
|
|
12
|
+
* injection form the required satisfaction and its bijection form an error,
|
|
13
|
+
* rather than a coin toss between two forms with opposite outcomes.
|
|
14
|
+
*/
|
|
15
|
+
export declare const ExpectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
16
|
+
mode: z.ZodLiteral<"exact">;
|
|
17
|
+
count: z.ZodInt;
|
|
18
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
19
|
+
mode: z.ZodLiteral<"at-most">;
|
|
20
|
+
max: z.ZodInt;
|
|
21
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
22
|
+
mode: z.ZodLiteral<"page-bounded">;
|
|
23
|
+
max: z.ZodInt;
|
|
24
|
+
}, z.core.$strict>], "mode">;
|
|
25
|
+
export declare const CollectionLocation: z.ZodObject<{
|
|
26
|
+
pointer: z.ZodString;
|
|
27
|
+
expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
28
|
+
mode: z.ZodLiteral<"exact">;
|
|
29
|
+
count: z.ZodInt;
|
|
30
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
31
|
+
mode: z.ZodLiteral<"at-most">;
|
|
32
|
+
max: z.ZodInt;
|
|
33
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
34
|
+
mode: z.ZodLiteral<"page-bounded">;
|
|
35
|
+
max: z.ZodInt;
|
|
36
|
+
}, z.core.$strict>], "mode">;
|
|
37
|
+
referenceSet: z.ZodNullable<z.ZodString>;
|
|
38
|
+
}, z.core.$strict>;
|
|
39
|
+
/**
|
|
40
|
+
* AD-19's closed response descriptor, scoped per operation rather than per
|
|
41
|
+
* interface: an interface-wide union is vacuous in the ordinary multi-shape
|
|
42
|
+
* case, since a job resource, a page of rows, and an error share no required
|
|
43
|
+
* key, leaving rule 2 no truthful denominator.
|
|
44
|
+
*/
|
|
45
|
+
export declare const ResponseDescriptor: z.ZodObject<{
|
|
46
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
47
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
48
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
49
|
+
array: "array";
|
|
50
|
+
boolean: "boolean";
|
|
51
|
+
null: "null";
|
|
52
|
+
number: "number";
|
|
53
|
+
object: "object";
|
|
54
|
+
string: "string";
|
|
55
|
+
}>>>;
|
|
56
|
+
successIndicator: z.ZodNullable<z.ZodString>;
|
|
57
|
+
channelRoles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
58
|
+
collection: "collection";
|
|
59
|
+
diagnostic: "diagnostic";
|
|
60
|
+
payload: "payload";
|
|
61
|
+
"success-indicator": "success-indicator";
|
|
62
|
+
}>>>;
|
|
63
|
+
collectionLocations: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
64
|
+
pointer: z.ZodString;
|
|
65
|
+
expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
66
|
+
mode: z.ZodLiteral<"exact">;
|
|
67
|
+
count: z.ZodInt;
|
|
68
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
69
|
+
mode: z.ZodLiteral<"at-most">;
|
|
70
|
+
max: z.ZodInt;
|
|
71
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
72
|
+
mode: z.ZodLiteral<"page-bounded">;
|
|
73
|
+
max: z.ZodInt;
|
|
74
|
+
}, z.core.$strict>], "mode">;
|
|
75
|
+
referenceSet: z.ZodNullable<z.ZodString>;
|
|
76
|
+
}, z.core.$strict>>>;
|
|
77
|
+
}, z.core.$strict>;
|
|
78
|
+
/**
|
|
79
|
+
* AD-19's four transport channels, spelled as a four-key strict object rather
|
|
80
|
+
* than a record over a channel enum: a record over an enum key demands every
|
|
81
|
+
* member at parse time, and `z.partialRecord` accepts the partial only by
|
|
82
|
+
* reintroducing the omitted-key spelling the Consistency Conventions ban.
|
|
83
|
+
*
|
|
84
|
+
* Each channel is a declared triple rather than nullable: a request channel's
|
|
85
|
+
* "declared, no keys" state already has a spelling (an empty required list,
|
|
86
|
+
* an empty permitted list, an empty type map), unlike an input-binding
|
|
87
|
+
* channel, where that state is indistinguishable from unused.
|
|
88
|
+
*/
|
|
89
|
+
export declare const RequestShape: z.ZodObject<{
|
|
90
|
+
path: z.ZodObject<{
|
|
91
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
92
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
93
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
94
|
+
array: "array";
|
|
95
|
+
boolean: "boolean";
|
|
96
|
+
null: "null";
|
|
97
|
+
number: "number";
|
|
98
|
+
object: "object";
|
|
99
|
+
string: "string";
|
|
100
|
+
}>>>;
|
|
101
|
+
}, z.core.$strict>;
|
|
102
|
+
query: z.ZodObject<{
|
|
103
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
104
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
105
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
106
|
+
array: "array";
|
|
107
|
+
boolean: "boolean";
|
|
108
|
+
null: "null";
|
|
109
|
+
number: "number";
|
|
110
|
+
object: "object";
|
|
111
|
+
string: "string";
|
|
112
|
+
}>>>;
|
|
113
|
+
}, z.core.$strict>;
|
|
114
|
+
header: z.ZodObject<{
|
|
115
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
116
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
117
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
118
|
+
array: "array";
|
|
119
|
+
boolean: "boolean";
|
|
120
|
+
null: "null";
|
|
121
|
+
number: "number";
|
|
122
|
+
object: "object";
|
|
123
|
+
string: "string";
|
|
124
|
+
}>>>;
|
|
125
|
+
}, z.core.$strict>;
|
|
126
|
+
body: z.ZodObject<{
|
|
127
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
128
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
129
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
130
|
+
array: "array";
|
|
131
|
+
boolean: "boolean";
|
|
132
|
+
null: "null";
|
|
133
|
+
number: "number";
|
|
134
|
+
object: "object";
|
|
135
|
+
string: "string";
|
|
136
|
+
}>>>;
|
|
137
|
+
}, z.core.$strict>;
|
|
138
|
+
}, z.core.$strict>;
|
|
139
|
+
/** AD-19's closed seven, uppercase; AD-40 compares against them. */
|
|
140
|
+
export declare const HttpMethod: z.ZodEnum<{
|
|
141
|
+
DELETE: "DELETE";
|
|
142
|
+
GET: "GET";
|
|
143
|
+
HEAD: "HEAD";
|
|
144
|
+
OPTIONS: "OPTIONS";
|
|
145
|
+
PATCH: "PATCH";
|
|
146
|
+
POST: "POST";
|
|
147
|
+
PUT: "PUT";
|
|
148
|
+
}>;
|
|
149
|
+
export declare const PATH_TEMPLATE_PATTERN: RegExp;
|
|
150
|
+
export declare const PathTemplate: z.ZodString;
|
|
151
|
+
export declare const Operation: z.ZodObject<{
|
|
152
|
+
operationId: z.ZodString;
|
|
153
|
+
method: z.ZodEnum<{
|
|
154
|
+
DELETE: "DELETE";
|
|
155
|
+
GET: "GET";
|
|
156
|
+
HEAD: "HEAD";
|
|
157
|
+
OPTIONS: "OPTIONS";
|
|
158
|
+
PATCH: "PATCH";
|
|
159
|
+
POST: "POST";
|
|
160
|
+
PUT: "PUT";
|
|
161
|
+
}>;
|
|
162
|
+
pathTemplate: z.ZodString;
|
|
163
|
+
stateChangeMarker: z.ZodBoolean;
|
|
164
|
+
requestShape: z.ZodObject<{
|
|
165
|
+
path: z.ZodObject<{
|
|
166
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
167
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
168
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
169
|
+
array: "array";
|
|
170
|
+
boolean: "boolean";
|
|
171
|
+
null: "null";
|
|
172
|
+
number: "number";
|
|
173
|
+
object: "object";
|
|
174
|
+
string: "string";
|
|
175
|
+
}>>>;
|
|
176
|
+
}, z.core.$strict>;
|
|
177
|
+
query: z.ZodObject<{
|
|
178
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
179
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
180
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
181
|
+
array: "array";
|
|
182
|
+
boolean: "boolean";
|
|
183
|
+
null: "null";
|
|
184
|
+
number: "number";
|
|
185
|
+
object: "object";
|
|
186
|
+
string: "string";
|
|
187
|
+
}>>>;
|
|
188
|
+
}, z.core.$strict>;
|
|
189
|
+
header: z.ZodObject<{
|
|
190
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
191
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
192
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
193
|
+
array: "array";
|
|
194
|
+
boolean: "boolean";
|
|
195
|
+
null: "null";
|
|
196
|
+
number: "number";
|
|
197
|
+
object: "object";
|
|
198
|
+
string: "string";
|
|
199
|
+
}>>>;
|
|
200
|
+
}, z.core.$strict>;
|
|
201
|
+
body: z.ZodObject<{
|
|
202
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
203
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
204
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
205
|
+
array: "array";
|
|
206
|
+
boolean: "boolean";
|
|
207
|
+
null: "null";
|
|
208
|
+
number: "number";
|
|
209
|
+
object: "object";
|
|
210
|
+
string: "string";
|
|
211
|
+
}>>>;
|
|
212
|
+
}, z.core.$strict>;
|
|
213
|
+
}, z.core.$strict>;
|
|
214
|
+
responseDescriptor: z.ZodObject<{
|
|
215
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
216
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
217
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
218
|
+
array: "array";
|
|
219
|
+
boolean: "boolean";
|
|
220
|
+
null: "null";
|
|
221
|
+
number: "number";
|
|
222
|
+
object: "object";
|
|
223
|
+
string: "string";
|
|
224
|
+
}>>>;
|
|
225
|
+
successIndicator: z.ZodNullable<z.ZodString>;
|
|
226
|
+
channelRoles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
227
|
+
collection: "collection";
|
|
228
|
+
diagnostic: "diagnostic";
|
|
229
|
+
payload: "payload";
|
|
230
|
+
"success-indicator": "success-indicator";
|
|
231
|
+
}>>>;
|
|
232
|
+
collectionLocations: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
233
|
+
pointer: z.ZodString;
|
|
234
|
+
expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
235
|
+
mode: z.ZodLiteral<"exact">;
|
|
236
|
+
count: z.ZodInt;
|
|
237
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
238
|
+
mode: z.ZodLiteral<"at-most">;
|
|
239
|
+
max: z.ZodInt;
|
|
240
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
241
|
+
mode: z.ZodLiteral<"page-bounded">;
|
|
242
|
+
max: z.ZodInt;
|
|
243
|
+
}, z.core.$strict>], "mode">;
|
|
244
|
+
referenceSet: z.ZodNullable<z.ZodString>;
|
|
245
|
+
}, z.core.$strict>>>;
|
|
246
|
+
}, z.core.$strict>;
|
|
247
|
+
volatilePointers: z.ZodArray<z.ZodString>;
|
|
248
|
+
sensitivityWitness: z.ZodNullable<z.ZodObject<{
|
|
249
|
+
witnessId: z.ZodString;
|
|
250
|
+
channel: z.ZodEnum<{
|
|
251
|
+
body: "body";
|
|
252
|
+
path: "path";
|
|
253
|
+
query: "query";
|
|
254
|
+
}>;
|
|
255
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
256
|
+
legId: z.ZodString;
|
|
257
|
+
inputs: z.ZodObject<{
|
|
258
|
+
path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
259
|
+
query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
260
|
+
header: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
261
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
262
|
+
kind: z.ZodLiteral<"json">;
|
|
263
|
+
value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
264
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
265
|
+
kind: z.ZodLiteral<"absent">;
|
|
266
|
+
}, z.core.$strict>], "kind">;
|
|
267
|
+
}, z.core.$strict>;
|
|
268
|
+
}, z.core.$strict>>;
|
|
269
|
+
relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
|
|
270
|
+
}, z.core.$strict>>;
|
|
271
|
+
}, z.core.$strict>;
|
|
272
|
+
export type Operation = z.infer<typeof Operation>;
|
|
273
|
+
/**
|
|
274
|
+
* AD-19's four interface kinds, exported once so nothing else respells them:
|
|
275
|
+
* the sealed evaluator brief carries interface identity without the operation
|
|
276
|
+
* inventory (AD-16) and needs this vocabulary. Naming the array changes no
|
|
277
|
+
* exported byte, since an enum with no `.meta({ id })` inlines at each use
|
|
278
|
+
* site exactly as the literal did.
|
|
279
|
+
*/
|
|
280
|
+
export declare const INTERFACE_KINDS: readonly ['api', 'web', 'cli', 'mcp'];
|
|
281
|
+
export declare const InterfaceKind: z.ZodEnum<{
|
|
282
|
+
api: "api";
|
|
283
|
+
cli: "cli";
|
|
284
|
+
mcp: "mcp";
|
|
285
|
+
web: "web";
|
|
286
|
+
}>;
|
|
287
|
+
export declare const PermittedInterface: z.ZodObject<{
|
|
288
|
+
logicalId: z.ZodString;
|
|
289
|
+
kind: z.ZodEnum<{
|
|
290
|
+
api: "api";
|
|
291
|
+
cli: "cli";
|
|
292
|
+
mcp: "mcp";
|
|
293
|
+
web: "web";
|
|
294
|
+
}>;
|
|
295
|
+
operations: z.ZodArray<z.ZodObject<{
|
|
296
|
+
operationId: z.ZodString;
|
|
297
|
+
method: z.ZodEnum<{
|
|
298
|
+
DELETE: "DELETE";
|
|
299
|
+
GET: "GET";
|
|
300
|
+
HEAD: "HEAD";
|
|
301
|
+
OPTIONS: "OPTIONS";
|
|
302
|
+
PATCH: "PATCH";
|
|
303
|
+
POST: "POST";
|
|
304
|
+
PUT: "PUT";
|
|
305
|
+
}>;
|
|
306
|
+
pathTemplate: z.ZodString;
|
|
307
|
+
stateChangeMarker: z.ZodBoolean;
|
|
308
|
+
requestShape: z.ZodObject<{
|
|
309
|
+
path: z.ZodObject<{
|
|
310
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
311
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
312
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
313
|
+
array: "array";
|
|
314
|
+
boolean: "boolean";
|
|
315
|
+
null: "null";
|
|
316
|
+
number: "number";
|
|
317
|
+
object: "object";
|
|
318
|
+
string: "string";
|
|
319
|
+
}>>>;
|
|
320
|
+
}, z.core.$strict>;
|
|
321
|
+
query: z.ZodObject<{
|
|
322
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
323
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
324
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
325
|
+
array: "array";
|
|
326
|
+
boolean: "boolean";
|
|
327
|
+
null: "null";
|
|
328
|
+
number: "number";
|
|
329
|
+
object: "object";
|
|
330
|
+
string: "string";
|
|
331
|
+
}>>>;
|
|
332
|
+
}, z.core.$strict>;
|
|
333
|
+
header: z.ZodObject<{
|
|
334
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
335
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
336
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
337
|
+
array: "array";
|
|
338
|
+
boolean: "boolean";
|
|
339
|
+
null: "null";
|
|
340
|
+
number: "number";
|
|
341
|
+
object: "object";
|
|
342
|
+
string: "string";
|
|
343
|
+
}>>>;
|
|
344
|
+
}, z.core.$strict>;
|
|
345
|
+
body: z.ZodObject<{
|
|
346
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
347
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
348
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
349
|
+
array: "array";
|
|
350
|
+
boolean: "boolean";
|
|
351
|
+
null: "null";
|
|
352
|
+
number: "number";
|
|
353
|
+
object: "object";
|
|
354
|
+
string: "string";
|
|
355
|
+
}>>>;
|
|
356
|
+
}, z.core.$strict>;
|
|
357
|
+
}, z.core.$strict>;
|
|
358
|
+
responseDescriptor: z.ZodObject<{
|
|
359
|
+
requiredKeys: z.ZodArray<z.ZodString>;
|
|
360
|
+
permittedKeys: z.ZodArray<z.ZodString>;
|
|
361
|
+
types: z.ZodRecord<z.ZodString, z.ZodNullable<z.ZodEnum<{
|
|
362
|
+
array: "array";
|
|
363
|
+
boolean: "boolean";
|
|
364
|
+
null: "null";
|
|
365
|
+
number: "number";
|
|
366
|
+
object: "object";
|
|
367
|
+
string: "string";
|
|
368
|
+
}>>>;
|
|
369
|
+
successIndicator: z.ZodNullable<z.ZodString>;
|
|
370
|
+
channelRoles: z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodEnum<{
|
|
371
|
+
collection: "collection";
|
|
372
|
+
diagnostic: "diagnostic";
|
|
373
|
+
payload: "payload";
|
|
374
|
+
"success-indicator": "success-indicator";
|
|
375
|
+
}>>>;
|
|
376
|
+
collectionLocations: z.ZodNullable<z.ZodArray<z.ZodObject<{
|
|
377
|
+
pointer: z.ZodString;
|
|
378
|
+
expectedCardinality: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
379
|
+
mode: z.ZodLiteral<"exact">;
|
|
380
|
+
count: z.ZodInt;
|
|
381
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
382
|
+
mode: z.ZodLiteral<"at-most">;
|
|
383
|
+
max: z.ZodInt;
|
|
384
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
385
|
+
mode: z.ZodLiteral<"page-bounded">;
|
|
386
|
+
max: z.ZodInt;
|
|
387
|
+
}, z.core.$strict>], "mode">;
|
|
388
|
+
referenceSet: z.ZodNullable<z.ZodString>;
|
|
389
|
+
}, z.core.$strict>>>;
|
|
390
|
+
}, z.core.$strict>;
|
|
391
|
+
volatilePointers: z.ZodArray<z.ZodString>;
|
|
392
|
+
sensitivityWitness: z.ZodNullable<z.ZodObject<{
|
|
393
|
+
witnessId: z.ZodString;
|
|
394
|
+
channel: z.ZodEnum<{
|
|
395
|
+
body: "body";
|
|
396
|
+
path: "path";
|
|
397
|
+
query: "query";
|
|
398
|
+
}>;
|
|
399
|
+
legs: z.ZodArray<z.ZodObject<{
|
|
400
|
+
legId: z.ZodString;
|
|
401
|
+
inputs: z.ZodObject<{
|
|
402
|
+
path: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
403
|
+
query: z.ZodType<import("./primitives.ts").JsonObject, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonObject, unknown>>;
|
|
404
|
+
header: z.ZodRecord<z.ZodString, z.ZodString>;
|
|
405
|
+
body: z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
406
|
+
kind: z.ZodLiteral<"json">;
|
|
407
|
+
value: z.ZodType<import("./primitives.ts").JsonValue, unknown, z.core.$ZodTypeInternals<import("./primitives.ts").JsonValue, unknown>>;
|
|
408
|
+
}, z.core.$strict>, z.ZodObject<{
|
|
409
|
+
kind: z.ZodLiteral<"absent">;
|
|
410
|
+
}, z.core.$strict>], "kind">;
|
|
411
|
+
}, z.core.$strict>;
|
|
412
|
+
}, z.core.$strict>>;
|
|
413
|
+
relation: z.ZodType<import("./expression.ts").Expression, unknown, z.core.$ZodTypeInternals<import("./expression.ts").Expression, unknown>>;
|
|
414
|
+
}, z.core.$strict>>;
|
|
415
|
+
}, z.core.$strict>>;
|
|
416
|
+
}, z.core.$strict>;
|
|
417
|
+
export type PermittedInterface = z.infer<typeof PermittedInterface>;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
/** permitted interfaces and the per-operation declaration inventory. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { DescriptorPointer } from './pointer.js';
|
|
4
|
+
import { Identifier, KeyedShapeDescriptor, KeyName, KeyTypeMap, } from './primitives.js';
|
|
5
|
+
import { SensitivityWitness } from './sensitivity-witness.js';
|
|
6
|
+
/** AD-19's closed four-member set, declared per pointer the descriptor names. */
|
|
7
|
+
export const ChannelRole = z.enum([
|
|
8
|
+
'success-indicator',
|
|
9
|
+
'diagnostic',
|
|
10
|
+
'payload',
|
|
11
|
+
'collection',
|
|
12
|
+
]);
|
|
13
|
+
/**
|
|
14
|
+
* AD-19's closed mode set. `page-bounded` is what makes AD-20 rule 6's
|
|
15
|
+
* injection form the required satisfaction and its bijection form an error,
|
|
16
|
+
* rather than a coin toss between two forms with opposite outcomes.
|
|
17
|
+
*/
|
|
18
|
+
export const ExpectedCardinality = z.discriminatedUnion('mode', [
|
|
19
|
+
z.strictObject({ mode: z.literal('exact'), count: z.int().min(0) }),
|
|
20
|
+
z.strictObject({ mode: z.literal('at-most'), max: z.int().min(0) }),
|
|
21
|
+
z.strictObject({ mode: z.literal('page-bounded'), max: z.int().min(0) }),
|
|
22
|
+
]);
|
|
23
|
+
export const CollectionLocation = z.strictObject({
|
|
24
|
+
pointer: DescriptorPointer,
|
|
25
|
+
expectedCardinality: ExpectedCardinality,
|
|
26
|
+
referenceSet: Identifier.nullable().describe('AD-20 rule 6 is relevant when a declared collection location names a reference set, so `null` is the shape that makes the rule irrelevant and must stay representable.'),
|
|
27
|
+
});
|
|
28
|
+
/**
|
|
29
|
+
* AD-19's closed response descriptor, scoped per operation rather than per
|
|
30
|
+
* interface: an interface-wide union is vacuous in the ordinary multi-shape
|
|
31
|
+
* case, since a job resource, a page of rows, and an error share no required
|
|
32
|
+
* key, leaving rule 2 no truthful denominator.
|
|
33
|
+
*/
|
|
34
|
+
export const ResponseDescriptor = z.strictObject({
|
|
35
|
+
requiredKeys: z
|
|
36
|
+
.array(KeyName)
|
|
37
|
+
.describe('No minimum of two anywhere in this shape: AD-20 rule 2 relevance is "the descriptor declares more than one pointer", so a one-pointer descriptor must parse in order to be the irrelevant case.'),
|
|
38
|
+
permittedKeys: z.array(KeyName),
|
|
39
|
+
types: KeyTypeMap.describe('Caller-keyed by plain key name, never by pointer: this is the shape where that trap bites, since `requiredKeys` sits beside a pointer-keyed `channelRoles` and a pointer-valued `successIndicator`, and the descriptor-relative spelling must not be extended here by analogy. A missing key means "not declared"; an explicit `null` value means "declared, type not stated", which is AD-31\'s enumerated indeterminate descriptor state and the shape `quantifier-over-non-collection` reads.'),
|
|
40
|
+
successIndicator: DescriptorPointer.nullable().describe('AD-20 rule 1 relevance reads this as its first conjunct, so `null` must stay representable.'),
|
|
41
|
+
channelRoles: z
|
|
42
|
+
.record(DescriptorPointer, ChannelRole)
|
|
43
|
+
.nullable()
|
|
44
|
+
.describe('Caller-keyed, and expected to be partial: a missing key means "no role declared for that pointer". AD-31 grades absent and explicitly empty differently, so `null`, `{}`, and a populated map are three distinct answers. Deliberately not refined to require a role for every descriptor key: no AD-5 code names that rule, the AD-31 predicates degrade gracefully on partial roles, and a refinement buys nothing an export can carry.'),
|
|
45
|
+
collectionLocations: z
|
|
46
|
+
.array(CollectionLocation)
|
|
47
|
+
.nullable()
|
|
48
|
+
.describe('AD-20 rule 4 relevance reads this, and AD-31 grades an absent declaration and an explicit empty one differently, so `null` and `[]` are distinct answers.'),
|
|
49
|
+
});
|
|
50
|
+
/**
|
|
51
|
+
* AD-19's four transport channels, spelled as a four-key strict object rather
|
|
52
|
+
* than a record over a channel enum: a record over an enum key demands every
|
|
53
|
+
* member at parse time, and `z.partialRecord` accepts the partial only by
|
|
54
|
+
* reintroducing the omitted-key spelling the Consistency Conventions ban.
|
|
55
|
+
*
|
|
56
|
+
* Each channel is a declared triple rather than nullable: a request channel's
|
|
57
|
+
* "declared, no keys" state already has a spelling (an empty required list,
|
|
58
|
+
* an empty permitted list, an empty type map), unlike an input-binding
|
|
59
|
+
* channel, where that state is indistinguishable from unused.
|
|
60
|
+
*/
|
|
61
|
+
export const RequestShape = z.strictObject({
|
|
62
|
+
path: KeyedShapeDescriptor,
|
|
63
|
+
query: KeyedShapeDescriptor,
|
|
64
|
+
header: KeyedShapeDescriptor.describe('AD-18: a header channel declaration names a header and its type and never carries a credential value.'),
|
|
65
|
+
body: KeyedShapeDescriptor,
|
|
66
|
+
});
|
|
67
|
+
/** AD-19's closed seven, uppercase; AD-40 compares against them. */
|
|
68
|
+
export const HttpMethod = z.enum([
|
|
69
|
+
'GET',
|
|
70
|
+
'HEAD',
|
|
71
|
+
'POST',
|
|
72
|
+
'PUT',
|
|
73
|
+
'PATCH',
|
|
74
|
+
'DELETE',
|
|
75
|
+
'OPTIONS',
|
|
76
|
+
]);
|
|
77
|
+
// AD-19: parameters are spelled `{name}` in braces only, because AD-40
|
|
78
|
+
// compares templates as literal segments plus parameter positions, and two
|
|
79
|
+
// implementations must not disagree over whether `/notes/{id}` and
|
|
80
|
+
// `/notes/:id` are one template. A colon is excluded from a literal segment,
|
|
81
|
+
// so `:name` is a syntax error rather than a segment that merely starts with
|
|
82
|
+
// one.
|
|
83
|
+
export const PATH_TEMPLATE_PATTERN = /^(?:\/(?:[^/{}:]|\{[A-Za-z0-9_-]+\})*)+$/;
|
|
84
|
+
export const PathTemplate = z
|
|
85
|
+
.string()
|
|
86
|
+
.regex(PATH_TEMPLATE_PATTERN)
|
|
87
|
+
.describe('A path template whose parameters are spelled `{name}` in braces. The `:name` spelling is rejected: AD-40 resolves a defect signature by comparing method and path template, and that comparison is not implementable against an unstated syntax.');
|
|
88
|
+
export const Operation = z.strictObject({
|
|
89
|
+
operationId: Identifier,
|
|
90
|
+
method: HttpMethod,
|
|
91
|
+
pathTemplate: PathTemplate,
|
|
92
|
+
stateChangeMarker: z
|
|
93
|
+
.boolean()
|
|
94
|
+
.describe('AD-19: whether the operation is intended to change state. AD-20 rule 7 relevance reads it, and AD-10 selects the sensitivity channel by it. Both values are legal and neither is a default.'),
|
|
95
|
+
requestShape: RequestShape,
|
|
96
|
+
responseDescriptor: ResponseDescriptor,
|
|
97
|
+
volatilePointers: z.array(DescriptorPointer),
|
|
98
|
+
sensitivityWitness: SensitivityWitness.nullable().describe('AD-10, mandatory per declared operation rather than per interface. `null` is legal only for an operation declaring no keys in any request channel; AD-10 exempts that operation and requires the exemption to be recorded, which pre-flight does as an `exempt` check. An input-bearing operation declaring `null` fails a strict compilation under `undeclared-mandatory-input`, alongside the other declaration-completeness check that code already gates.'),
|
|
99
|
+
});
|
|
100
|
+
/**
|
|
101
|
+
* AD-19's four interface kinds, exported once so nothing else respells them:
|
|
102
|
+
* the sealed evaluator brief carries interface identity without the operation
|
|
103
|
+
* inventory (AD-16) and needs this vocabulary. Naming the array changes no
|
|
104
|
+
* exported byte, since an enum with no `.meta({ id })` inlines at each use
|
|
105
|
+
* site exactly as the literal did.
|
|
106
|
+
*/
|
|
107
|
+
export const INTERFACE_KINDS = ['api', 'web', 'cli', 'mcp'];
|
|
108
|
+
export const InterfaceKind = z.enum(INTERFACE_KINDS);
|
|
109
|
+
export const PermittedInterface = z.strictObject({
|
|
110
|
+
logicalId: Identifier.describe("AD-35: a logical identifier for the interface, never a URL, host, or port. Mapping it to a target is the caller's, outside the contract."),
|
|
111
|
+
kind: InterfaceKind.describe('All four kinds are admitted so `unsupported-interface-kind` stays fireable. v0 supports `api`; the other three fail compilation under that code rather than failing to parse.'),
|
|
112
|
+
operations: z
|
|
113
|
+
.array(Operation)
|
|
114
|
+
.describe('No uniqueness constraint: two operations colliding on method plus path template after parameter-name erasure is `duplicate-operation-signature`, a coded compile-time error, and a schema that deduped them would delete it.'),
|
|
115
|
+
});
|
|
@@ -0,0 +1,136 @@
|
|
|
1
|
+
/** the per-run isolation audit, and the forbidden-input accounting AD-16 adds. */
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
/**
|
|
4
|
+
* The harness's record of what it actually enforced, deliberately not
|
|
5
|
+
* `Budgets`: `Budgets` is the contract's three-key declared ceiling that AD-16
|
|
6
|
+
* puts on the brief so the caller knows what it may spend, while this carries
|
|
7
|
+
* the two token counts the contract never declares. One shape for both would
|
|
8
|
+
* conflate a declaration with an observation.
|
|
9
|
+
*/
|
|
10
|
+
export declare const ResourceCeilings: z.ZodObject<{
|
|
11
|
+
maxToolCalls: z.ZodInt;
|
|
12
|
+
maxInputTokens: z.ZodInt;
|
|
13
|
+
maxOutputTokens: z.ZodInt;
|
|
14
|
+
maxWallClockMinutes: z.ZodNumber;
|
|
15
|
+
maxCostUsd: z.ZodString;
|
|
16
|
+
}, z.core.$strict>;
|
|
17
|
+
/** the prior art's five-member actual-use record, with money as a string. */
|
|
18
|
+
export declare const ActualResourceUse: z.ZodObject<{
|
|
19
|
+
toolCalls: z.ZodInt;
|
|
20
|
+
inputTokens: z.ZodInt;
|
|
21
|
+
outputTokens: z.ZodInt;
|
|
22
|
+
wallClockSeconds: z.ZodNumber;
|
|
23
|
+
costUsd: z.ZodString;
|
|
24
|
+
}, z.core.$strict>;
|
|
25
|
+
/**
|
|
26
|
+
* AD-16 requires the manifest to "account for each forbidden input by name".
|
|
27
|
+
* `withheld: false` must parse: a prohibited input is an invalidating condition
|
|
28
|
+
* at ingest, never a parse failure.
|
|
29
|
+
*/
|
|
30
|
+
export declare const ForbiddenInputAccounting: z.ZodObject<{
|
|
31
|
+
withheld: z.ZodBoolean;
|
|
32
|
+
note: z.ZodNullable<z.ZodString>;
|
|
33
|
+
}, z.core.$strict>;
|
|
34
|
+
/**
|
|
35
|
+
* A strict object rather than `z.record(ForbiddenInput, …)`: the record does
|
|
36
|
+
* demand every enum member at parse time, but only as TypeScript behaviour.
|
|
37
|
+
* Its export carries `propertyNames` plus a schema-valued
|
|
38
|
+
* `additionalProperties` but never a `required` array, so the constraint
|
|
39
|
+
* would be invisible to the non-TypeScript consumer AD-13 protects, the same
|
|
40
|
+
* reasoning behind `RequestShape`'s four-key object.
|
|
41
|
+
*/
|
|
42
|
+
export declare const ForbiddenInputAccountingMap: z.ZodObject<{
|
|
43
|
+
"builder-transcript": z.ZodObject<{
|
|
44
|
+
withheld: z.ZodBoolean;
|
|
45
|
+
note: z.ZodNullable<z.ZodString>;
|
|
46
|
+
}, z.core.$strict>;
|
|
47
|
+
"comparator-results": z.ZodObject<{
|
|
48
|
+
withheld: z.ZodBoolean;
|
|
49
|
+
note: z.ZodNullable<z.ZodString>;
|
|
50
|
+
}, z.core.$strict>;
|
|
51
|
+
"human-labels": z.ZodObject<{
|
|
52
|
+
withheld: z.ZodBoolean;
|
|
53
|
+
note: z.ZodNullable<z.ZodString>;
|
|
54
|
+
}, z.core.$strict>;
|
|
55
|
+
"implementation-logs": z.ZodObject<{
|
|
56
|
+
withheld: z.ZodBoolean;
|
|
57
|
+
note: z.ZodNullable<z.ZodString>;
|
|
58
|
+
}, z.core.$strict>;
|
|
59
|
+
"original-spec": z.ZodObject<{
|
|
60
|
+
withheld: z.ZodBoolean;
|
|
61
|
+
note: z.ZodNullable<z.ZodString>;
|
|
62
|
+
}, z.core.$strict>;
|
|
63
|
+
repository: z.ZodObject<{
|
|
64
|
+
withheld: z.ZodBoolean;
|
|
65
|
+
note: z.ZodNullable<z.ZodString>;
|
|
66
|
+
}, z.core.$strict>;
|
|
67
|
+
"source-code": z.ZodObject<{
|
|
68
|
+
withheld: z.ZodBoolean;
|
|
69
|
+
note: z.ZodNullable<z.ZodString>;
|
|
70
|
+
}, z.core.$strict>;
|
|
71
|
+
}, z.core.$strict>;
|
|
72
|
+
export declare const IsolationManifest: z.ZodObject<{
|
|
73
|
+
schemaVersion: z.ZodInt;
|
|
74
|
+
parentDigest: z.ZodNullable<z.ZodString>;
|
|
75
|
+
revisionCount: z.ZodInt;
|
|
76
|
+
runId: z.ZodString;
|
|
77
|
+
contractId: z.ZodString;
|
|
78
|
+
conditionArm: z.ZodString;
|
|
79
|
+
modelSnapshot: z.ZodString;
|
|
80
|
+
systemPromptDigest: z.ZodString;
|
|
81
|
+
contractDigest: z.ZodString;
|
|
82
|
+
evaluatorConfigurationDigest: z.ZodString;
|
|
83
|
+
workspaceIdentity: z.ZodString;
|
|
84
|
+
allowedMounts: z.ZodArray<z.ZodString>;
|
|
85
|
+
observedMounts: z.ZodArray<z.ZodString>;
|
|
86
|
+
networkAllowlist: z.ZodArray<z.ZodString>;
|
|
87
|
+
observedNetworkTargets: z.ZodArray<z.ZodString>;
|
|
88
|
+
toolAllowlist: z.ZodArray<z.ZodString>;
|
|
89
|
+
observedToolCalls: z.ZodArray<z.ZodString>;
|
|
90
|
+
resourceCeilings: z.ZodObject<{
|
|
91
|
+
maxToolCalls: z.ZodInt;
|
|
92
|
+
maxInputTokens: z.ZodInt;
|
|
93
|
+
maxOutputTokens: z.ZodInt;
|
|
94
|
+
maxWallClockMinutes: z.ZodNumber;
|
|
95
|
+
maxCostUsd: z.ZodString;
|
|
96
|
+
}, z.core.$strict>;
|
|
97
|
+
actualResourceUse: z.ZodObject<{
|
|
98
|
+
toolCalls: z.ZodInt;
|
|
99
|
+
inputTokens: z.ZodInt;
|
|
100
|
+
outputTokens: z.ZodInt;
|
|
101
|
+
wallClockSeconds: z.ZodNumber;
|
|
102
|
+
costUsd: z.ZodString;
|
|
103
|
+
}, z.core.$strict>;
|
|
104
|
+
forbiddenInputAccounting: z.ZodObject<{
|
|
105
|
+
"builder-transcript": z.ZodObject<{
|
|
106
|
+
withheld: z.ZodBoolean;
|
|
107
|
+
note: z.ZodNullable<z.ZodString>;
|
|
108
|
+
}, z.core.$strict>;
|
|
109
|
+
"comparator-results": z.ZodObject<{
|
|
110
|
+
withheld: z.ZodBoolean;
|
|
111
|
+
note: z.ZodNullable<z.ZodString>;
|
|
112
|
+
}, z.core.$strict>;
|
|
113
|
+
"human-labels": z.ZodObject<{
|
|
114
|
+
withheld: z.ZodBoolean;
|
|
115
|
+
note: z.ZodNullable<z.ZodString>;
|
|
116
|
+
}, z.core.$strict>;
|
|
117
|
+
"implementation-logs": z.ZodObject<{
|
|
118
|
+
withheld: z.ZodBoolean;
|
|
119
|
+
note: z.ZodNullable<z.ZodString>;
|
|
120
|
+
}, z.core.$strict>;
|
|
121
|
+
"original-spec": z.ZodObject<{
|
|
122
|
+
withheld: z.ZodBoolean;
|
|
123
|
+
note: z.ZodNullable<z.ZodString>;
|
|
124
|
+
}, z.core.$strict>;
|
|
125
|
+
repository: z.ZodObject<{
|
|
126
|
+
withheld: z.ZodBoolean;
|
|
127
|
+
note: z.ZodNullable<z.ZodString>;
|
|
128
|
+
}, z.core.$strict>;
|
|
129
|
+
"source-code": z.ZodObject<{
|
|
130
|
+
withheld: z.ZodBoolean;
|
|
131
|
+
note: z.ZodNullable<z.ZodString>;
|
|
132
|
+
}, z.core.$strict>;
|
|
133
|
+
}, z.core.$strict>;
|
|
134
|
+
violation: z.ZodNullable<z.ZodString>;
|
|
135
|
+
}, z.core.$strict>;
|
|
136
|
+
export type IsolationManifest = z.infer<typeof IsolationManifest>;
|