@affiant/core 0.1.0-alpha.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 +202 -0
- package/README.md +354 -0
- package/dist/context.d.ts +136 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/context.js +30 -0
- package/dist/context.js.map +1 -0
- package/dist/docket/entry.d.ts +421 -0
- package/dist/docket/entry.d.ts.map +1 -0
- package/dist/docket/entry.js +155 -0
- package/dist/docket/entry.js.map +1 -0
- package/dist/docket/expiry.d.ts +82 -0
- package/dist/docket/expiry.d.ts.map +1 -0
- package/dist/docket/expiry.js +106 -0
- package/dist/docket/expiry.js.map +1 -0
- package/dist/docket/memory.d.ts +163 -0
- package/dist/docket/memory.d.ts.map +1 -0
- package/dist/docket/memory.js +528 -0
- package/dist/docket/memory.js.map +1 -0
- package/dist/docket/store.d.ts +387 -0
- package/dist/docket/store.d.ts.map +1 -0
- package/dist/docket/store.js +51 -0
- package/dist/docket/store.js.map +1 -0
- package/dist/errors.d.ts +153 -0
- package/dist/errors.d.ts.map +1 -0
- package/dist/errors.js +164 -0
- package/dist/errors.js.map +1 -0
- package/dist/gate/coverage.d.ts +152 -0
- package/dist/gate/coverage.d.ts.map +1 -0
- package/dist/gate/coverage.js +114 -0
- package/dist/gate/coverage.js.map +1 -0
- package/dist/gate/decide.d.ts +207 -0
- package/dist/gate/decide.d.ts.map +1 -0
- package/dist/gate/decide.js +559 -0
- package/dist/gate/decide.js.map +1 -0
- package/dist/gate/gate.d.ts +212 -0
- package/dist/gate/gate.d.ts.map +1 -0
- package/dist/gate/gate.js +175 -0
- package/dist/gate/gate.js.map +1 -0
- package/dist/gate/pipeline.d.ts +285 -0
- package/dist/gate/pipeline.d.ts.map +1 -0
- package/dist/gate/pipeline.js +515 -0
- package/dist/gate/pipeline.js.map +1 -0
- package/dist/gate/policy.d.ts +272 -0
- package/dist/gate/policy.d.ts.map +1 -0
- package/dist/gate/policy.js +396 -0
- package/dist/gate/policy.js.map +1 -0
- package/dist/gate/wrap.d.ts +107 -0
- package/dist/gate/wrap.d.ts.map +1 -0
- package/dist/gate/wrap.js +164 -0
- package/dist/gate/wrap.js.map +1 -0
- package/dist/index.d.ts +95 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +111 -0
- package/dist/index.js.map +1 -0
- package/dist/model/affidavit.d.ts +354 -0
- package/dist/model/affidavit.d.ts.map +1 -0
- package/dist/model/affidavit.js +417 -0
- package/dist/model/affidavit.js.map +1 -0
- package/dist/model/amendments.d.ts +160 -0
- package/dist/model/amendments.d.ts.map +1 -0
- package/dist/model/amendments.js +183 -0
- package/dist/model/amendments.js.map +1 -0
- package/dist/model/canonical.d.ts +311 -0
- package/dist/model/canonical.d.ts.map +1 -0
- package/dist/model/canonical.js +665 -0
- package/dist/model/canonical.js.map +1 -0
- package/dist/model/money.d.ts +127 -0
- package/dist/model/money.d.ts.map +1 -0
- package/dist/model/money.js +177 -0
- package/dist/model/money.js.map +1 -0
- package/dist/model/provenance.d.ts +315 -0
- package/dist/model/provenance.d.ts.map +1 -0
- package/dist/model/provenance.js +223 -0
- package/dist/model/provenance.js.map +1 -0
- package/dist/ports.d.ts +269 -0
- package/dist/ports.d.ts.map +1 -0
- package/dist/ports.js +34 -0
- package/dist/ports.js.map +1 -0
- package/dist/store-memory.d.ts +21 -0
- package/dist/store-memory.d.ts.map +1 -0
- package/dist/store-memory.js +20 -0
- package/dist/store-memory.js.map +1 -0
- package/dist/telemetry-keys.d.ts +65 -0
- package/dist/telemetry-keys.d.ts.map +1 -0
- package/dist/telemetry-keys.js +72 -0
- package/dist/telemetry-keys.js.map +1 -0
- package/dist/telemetry.d.ts +77 -0
- package/dist/telemetry.d.ts.map +1 -0
- package/dist/telemetry.js +43 -0
- package/dist/telemetry.js.map +1 -0
- package/dist/testing.d.ts +574 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +1291 -0
- package/dist/testing.js.map +1 -0
- package/package.json +75 -0
- package/telemetry-keys.json +92 -0
|
@@ -0,0 +1,574 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* `@affiant/core/testing` — the declarative fixture format, the runner that
|
|
3
|
+
* executes it against a real gate, and the stub ports a fixture is wired from.
|
|
4
|
+
*
|
|
5
|
+
* ## What a fixture is
|
|
6
|
+
*
|
|
7
|
+
* One JSON document describing **a wiring, a sequence of acts, and what must be
|
|
8
|
+
* true afterwards**:
|
|
9
|
+
*
|
|
10
|
+
* ```jsonc
|
|
11
|
+
* {
|
|
12
|
+
* "id": "gate/standing-order-by-the-book",
|
|
13
|
+
* "rules": ["GT-5", "AZ-1"],
|
|
14
|
+
* "title": "A Standing Order with no threshold fires on the verdict alone",
|
|
15
|
+
* "given": {
|
|
16
|
+
* "clock": "2026-09-04T09:00:00.000Z",
|
|
17
|
+
* "gate": { "defaultTtlMs": 1800000, "authorization": { "allow": ["*"] } },
|
|
18
|
+
* "ctx": { "tenantId": "tenant-a", "conversationId": "conv-1", "channel": "chat" },
|
|
19
|
+
* "prior": [],
|
|
20
|
+
* "step": { "kind": "file", "toolName": "capture", "operation": { … } }
|
|
21
|
+
* },
|
|
22
|
+
* "expect": { "entry": { "status": "approved" } }
|
|
23
|
+
* }
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* ## The runner is strict about the document, not only about the gate
|
|
27
|
+
*
|
|
28
|
+
* A fixture is checked against the format **before** it is run, and a fixture that
|
|
29
|
+
* fails that check is not run at all: an unknown key at any level fails the fixture
|
|
30
|
+
* naming its path, and an `expect` clause that states no fact — `{}`,
|
|
31
|
+
* `{ entry: {} }`, `{ telemetryAbsent: [] }` — fails as vacuous. Both are the same
|
|
32
|
+
* defect wearing different clothes: a fixture that asserts nothing, or asserts it in
|
|
33
|
+
* a key nothing reads, is passed by every implementation including a broken one, and
|
|
34
|
+
* the rulebook's negative-oracle clause exists to forbid exactly that. Since this
|
|
35
|
+
* runner is what a conformance driver executes against a second implementation and
|
|
36
|
+
* what its parity manifest is derived from, a silently-ignored key would be a rule
|
|
37
|
+
* silently unchecked in both implementations at once.
|
|
38
|
+
*
|
|
39
|
+
* **One shape for every rule.** The gate's whole surface is reachable from
|
|
40
|
+
* {@link FixtureStep} — `wrap-execute`, `file`, `decide`, `resubmit`,
|
|
41
|
+
* `markExecuted`, `expireDue`, `get`, `rehydrate` — so a fixture about a decision
|
|
42
|
+
* and a fixture about a filing differ in their steps, not in their format. A single
|
|
43
|
+
* format is what lets one runner serve three consumers: this package's own suites,
|
|
44
|
+
* a host checking its ports against the reference behaviour, and the conformance
|
|
45
|
+
* driver that will run the same documents against a second implementation.
|
|
46
|
+
*
|
|
47
|
+
* ## What the expectations are, and what they are not
|
|
48
|
+
*
|
|
49
|
+
* Every expectation is a **partial** matcher: a fixture states the facts its rule is
|
|
50
|
+
* about and says nothing about the rest, so an unrelated addition to `DocketEntry`
|
|
51
|
+
* does not break thirty documents. What a fixture may not do is state something the
|
|
52
|
+
* implementation computed for it — every value in a fixture is authored, and the
|
|
53
|
+
* generator that mirrors these files into a TypeScript module computes nothing.
|
|
54
|
+
*
|
|
55
|
+
* ## Reading the results
|
|
56
|
+
*
|
|
57
|
+
* {@link runFixture} never throws for a failed expectation: it returns a
|
|
58
|
+
* {@link FixtureResult} carrying every failure it found, each with the path it was
|
|
59
|
+
* found at and the two values. A suite turns that into one assertion; a conformance
|
|
60
|
+
* driver turns the same structure into a parity manifest naming what an
|
|
61
|
+
* implementation does not yet pass. A runner that threw on the first mismatch could
|
|
62
|
+
* do neither.
|
|
63
|
+
*
|
|
64
|
+
* @packageDocumentation
|
|
65
|
+
*/
|
|
66
|
+
import type { Principal } from "./context.js";
|
|
67
|
+
import type { Attestor, BlockedMarker, ExecutionOutcome, RequirementKind } from "./docket/entry.js";
|
|
68
|
+
import type { DocketStore } from "./docket/store.js";
|
|
69
|
+
import type { UncoveredCategory } from "./gate/coverage.js";
|
|
70
|
+
import type { Verdict } from "./gate/policy.js";
|
|
71
|
+
import type { JsonValue } from "./model/affidavit.js";
|
|
72
|
+
import type { AmendmentMap } from "./model/amendments.js";
|
|
73
|
+
import type { Binding, ProvenanceSource } from "./model/provenance.js";
|
|
74
|
+
import type { AuthorizationPort, Clock, InferencePort, InterceptorBinding, Operation, ProjectionPort, RiskScorer } from "./ports.js";
|
|
75
|
+
/** One declarative fixture: what to wire, what to do, and what must then be true. */
|
|
76
|
+
export interface Fixture {
|
|
77
|
+
/** A stable id, unique across the set. Never renamed — a parity manifest cites it. */
|
|
78
|
+
readonly id: string;
|
|
79
|
+
/** The rulebook ids this fixture checks. At least one. */
|
|
80
|
+
readonly rules: readonly string[];
|
|
81
|
+
/** What the fixture asserts, in a sentence a reviewer can read without the JSON. */
|
|
82
|
+
readonly title: string;
|
|
83
|
+
/** The wiring, the acts and the context they happen in. */
|
|
84
|
+
readonly given: FixtureGiven;
|
|
85
|
+
/** What must be true afterwards. Every clause optional; a fixture states its own rule. */
|
|
86
|
+
readonly expect: FixtureExpectation;
|
|
87
|
+
}
|
|
88
|
+
/** The wiring and the acts. */
|
|
89
|
+
export interface FixtureGiven {
|
|
90
|
+
/** How the gate is built. */
|
|
91
|
+
readonly gate: FixtureGate;
|
|
92
|
+
/** Which reference store to file into. Only the in-memory one exists at v0.1. */
|
|
93
|
+
readonly store?: "memory";
|
|
94
|
+
/** The instant the clock starts at. Every step may move it forward. */
|
|
95
|
+
readonly clock: string;
|
|
96
|
+
/** The turn every step runs in, unless the step overrides part of it. */
|
|
97
|
+
readonly ctx: FixtureContext;
|
|
98
|
+
/** Acts performed before the one under test. Their refusals are declared inline. */
|
|
99
|
+
readonly prior?: readonly FixtureStep[];
|
|
100
|
+
/** The act under test. {@link FixtureExpectation.error} is about this one. */
|
|
101
|
+
readonly step: FixtureStep;
|
|
102
|
+
}
|
|
103
|
+
/** Everything `createGate` is given. */
|
|
104
|
+
export interface FixtureGate {
|
|
105
|
+
/** The approval chain, in order (AZ-4). */
|
|
106
|
+
readonly policies?: readonly FixturePolicy[];
|
|
107
|
+
/** What the host's risk function returns, or `null` for no scorer wired (GT-5). */
|
|
108
|
+
readonly riskScorer?: number | null;
|
|
109
|
+
/** Deterministic resolvers (PV-2, GT-1 step 2). */
|
|
110
|
+
readonly interceptors?: readonly FixtureInterceptor[];
|
|
111
|
+
/** The deadline applied when neither the verdict nor the policy names one (GT-4). */
|
|
112
|
+
readonly defaultTtlMs: number;
|
|
113
|
+
/** Who may decide (AZ-2). */
|
|
114
|
+
readonly authorization: FixtureAuthorization;
|
|
115
|
+
/** What the host's inference reports, keyed by field name (GT-1 step 3). */
|
|
116
|
+
readonly inference?: {
|
|
117
|
+
readonly [fieldName: string]: FixtureInferredField;
|
|
118
|
+
} | null;
|
|
119
|
+
/**
|
|
120
|
+
* What the host's entities hold now, keyed `"<entityType>/<entityId>"` (AF-3).
|
|
121
|
+
*
|
|
122
|
+
* The projection port reads this table, so a fixture states the world rather than
|
|
123
|
+
* the answer: an update names an entity, and the previous values are whatever the
|
|
124
|
+
* table says that entity holds. An entity that is not in the table does not exist,
|
|
125
|
+
* and the port answers `null`.
|
|
126
|
+
*/
|
|
127
|
+
readonly entities?: {
|
|
128
|
+
readonly [entityKey: string]: {
|
|
129
|
+
readonly [field: string]: JsonValue;
|
|
130
|
+
};
|
|
131
|
+
};
|
|
132
|
+
/** Tools the host declared it cannot intercept (CV-4). */
|
|
133
|
+
readonly uncovered?: readonly {
|
|
134
|
+
readonly tool: string;
|
|
135
|
+
readonly category: UncoveredCategory;
|
|
136
|
+
}[];
|
|
137
|
+
/** Whether a rehydration surface is wired (DK-5). Defaults to `true`. */
|
|
138
|
+
readonly sessions?: boolean;
|
|
139
|
+
}
|
|
140
|
+
/**
|
|
141
|
+
* The host's answer to "may this principal act on this entry" (AZ-2).
|
|
142
|
+
*
|
|
143
|
+
* An allowlist of principal ids, `"*"` admitting everyone. `throws` makes the port
|
|
144
|
+
* fall over instead of answering, which the gate must read as a refusal.
|
|
145
|
+
*/
|
|
146
|
+
export interface FixtureAuthorization {
|
|
147
|
+
/** Principal ids admitted. `"*"` admits every principal. */
|
|
148
|
+
readonly allow: readonly string[];
|
|
149
|
+
/** Whether the port throws rather than answering. */
|
|
150
|
+
readonly throws?: boolean;
|
|
151
|
+
}
|
|
152
|
+
/** One field the scripted inference port reports. */
|
|
153
|
+
export interface FixtureInferredField {
|
|
154
|
+
/** The extracted value. */
|
|
155
|
+
readonly value: JsonValue;
|
|
156
|
+
/** How confident the port claims to be. Clamped by the pipeline (PV-1). */
|
|
157
|
+
readonly confidence: number;
|
|
158
|
+
/** Literally present in the turn (`Conversation`) or reasoned to (`Inferred`). */
|
|
159
|
+
readonly presence: "literal" | "inferred";
|
|
160
|
+
/** Where in the utterance, when the port can say. */
|
|
161
|
+
readonly utteranceSpan?: {
|
|
162
|
+
readonly start: number;
|
|
163
|
+
readonly end: number;
|
|
164
|
+
} | null;
|
|
165
|
+
}
|
|
166
|
+
/** One deterministic resolver (PV-2). */
|
|
167
|
+
export interface FixtureInterceptor {
|
|
168
|
+
/** A name for the record. */
|
|
169
|
+
readonly name: string;
|
|
170
|
+
/** The fields it resolves, keyed by field name. */
|
|
171
|
+
readonly fields: {
|
|
172
|
+
readonly [fieldName: string]: {
|
|
173
|
+
readonly value: JsonValue;
|
|
174
|
+
readonly source: "External" | "Computed";
|
|
175
|
+
readonly confidence: number;
|
|
176
|
+
readonly binding: InterceptorBinding;
|
|
177
|
+
readonly evidence?: string | null;
|
|
178
|
+
};
|
|
179
|
+
};
|
|
180
|
+
}
|
|
181
|
+
/** One approval policy, as a fixture states it. */
|
|
182
|
+
export interface FixturePolicy {
|
|
183
|
+
/** The host's id, written into a Standing Order attestation (AZ-1). */
|
|
184
|
+
readonly id: string;
|
|
185
|
+
/** The version that is speaking. */
|
|
186
|
+
readonly version: string;
|
|
187
|
+
/** The provenance sources it predicates on (PV-4). */
|
|
188
|
+
readonly declaredInputs?: readonly ProvenanceSource[];
|
|
189
|
+
/** Whether any verdict it can return names a threshold (GT-5, CV-1). */
|
|
190
|
+
readonly declaresThreshold?: boolean;
|
|
191
|
+
/** Its own default deadline (GT-4). */
|
|
192
|
+
readonly defaultTtlMs?: number | null;
|
|
193
|
+
/** What it says, or `null` for no opinion. */
|
|
194
|
+
readonly verdict: Verdict | null;
|
|
195
|
+
}
|
|
196
|
+
/** The turn every step runs in. */
|
|
197
|
+
export interface FixtureContext {
|
|
198
|
+
readonly tenantId: string;
|
|
199
|
+
readonly conversationId: string;
|
|
200
|
+
readonly channel: string;
|
|
201
|
+
/** The principal, or `null` for an unresolved identity (AZ-2). */
|
|
202
|
+
readonly principal?: FixturePrincipal | null;
|
|
203
|
+
readonly utterance?: string;
|
|
204
|
+
readonly messageId?: string;
|
|
205
|
+
}
|
|
206
|
+
/** A principal, as a fixture states it. Structurally the core's own {@link Principal}. */
|
|
207
|
+
export type FixturePrincipal = Principal;
|
|
208
|
+
/** A field the host has already tagged, for a capture whose provenance is settled. */
|
|
209
|
+
export interface FixturePreparedField {
|
|
210
|
+
readonly name: string;
|
|
211
|
+
readonly kind: "text" | "number" | "date" | "enum";
|
|
212
|
+
readonly value: JsonValue;
|
|
213
|
+
readonly isMandatory?: boolean;
|
|
214
|
+
/** The tag in force, or absent for "proposed, provenance unknown" (AF-1). */
|
|
215
|
+
readonly provenance?: {
|
|
216
|
+
readonly source: ProvenanceSource;
|
|
217
|
+
readonly confidence: number;
|
|
218
|
+
readonly binding?: Binding | null;
|
|
219
|
+
readonly note?: string | null;
|
|
220
|
+
} | null;
|
|
221
|
+
}
|
|
222
|
+
/** A tool definition, as a `wrap-execute` step states it. */
|
|
223
|
+
export interface FixtureTool {
|
|
224
|
+
readonly name: string;
|
|
225
|
+
readonly description?: string;
|
|
226
|
+
readonly entityType: string;
|
|
227
|
+
/** `null` for a create-shaped tool. */
|
|
228
|
+
readonly entityId?: string | null;
|
|
229
|
+
readonly writeCapable?: boolean;
|
|
230
|
+
readonly executedBy?: "host" | "provider";
|
|
231
|
+
readonly hostedMcp?: boolean;
|
|
232
|
+
/** Whether the tool carries no `execute` at all — the `no-execute` category (CV-4). */
|
|
233
|
+
readonly omitExecute?: boolean;
|
|
234
|
+
/** The host's own verb, carried onto the card. */
|
|
235
|
+
readonly operationLabel?: string;
|
|
236
|
+
/** The fields the tool declares, with their reviewer-facing shape. */
|
|
237
|
+
readonly fields: readonly {
|
|
238
|
+
readonly name: string;
|
|
239
|
+
readonly kind: "text" | "number" | "date" | "enum";
|
|
240
|
+
readonly description?: string | null;
|
|
241
|
+
readonly required?: boolean;
|
|
242
|
+
readonly allowedValues?: readonly string[] | null;
|
|
243
|
+
readonly pattern?: string | null;
|
|
244
|
+
}[];
|
|
245
|
+
}
|
|
246
|
+
/** What every step may say about when it happens and who performs it. */
|
|
247
|
+
interface StepCommon {
|
|
248
|
+
/** A label later steps and expectations can name this step's entry by. */
|
|
249
|
+
readonly as?: string;
|
|
250
|
+
/** Moves the clock before the step runs. Defaults to wherever the clock is. */
|
|
251
|
+
readonly at?: string;
|
|
252
|
+
/** The principal for this step, overriding the fixture's. `null` is unresolved. */
|
|
253
|
+
readonly principal?: FixturePrincipal | null;
|
|
254
|
+
/** The tenant this step is performed from, when it is not the fixture's (AZ-2). */
|
|
255
|
+
readonly tenantId?: string;
|
|
256
|
+
/** The conversation this step is performed in, when it is not the fixture's (GT-2). */
|
|
257
|
+
readonly conversationId?: string;
|
|
258
|
+
/** The entry this step acts on: a label from `as`, or the last one filed. */
|
|
259
|
+
readonly entry?: string;
|
|
260
|
+
/**
|
|
261
|
+
* The refusal code this step is expected to produce, for a step in `prior`.
|
|
262
|
+
*
|
|
263
|
+
* Declared on the step rather than in a parallel array so a reader sees the refusal
|
|
264
|
+
* beside the act that caused it. The step under test states its refusal in
|
|
265
|
+
* {@link FixtureExpectation.error} instead.
|
|
266
|
+
*/
|
|
267
|
+
readonly refusal?: string | null;
|
|
268
|
+
}
|
|
269
|
+
/** One act on the gate. */
|
|
270
|
+
export type FixtureStep = (StepCommon & {
|
|
271
|
+
/** Sequence A's way in: a model calls a wrapped tool (GT-6, CV-4). */
|
|
272
|
+
readonly kind: "wrap-execute";
|
|
273
|
+
readonly tool: FixtureTool;
|
|
274
|
+
readonly args: {
|
|
275
|
+
readonly [field: string]: JsonValue;
|
|
276
|
+
};
|
|
277
|
+
}) | (StepCommon & {
|
|
278
|
+
/** Sequence C's way in: a capture the host assembled (GT-1). */
|
|
279
|
+
readonly kind: "file";
|
|
280
|
+
readonly toolName: string;
|
|
281
|
+
readonly operation: Operation;
|
|
282
|
+
readonly schema?: FixtureTool["fields"] | null;
|
|
283
|
+
readonly preparedFields?: readonly FixturePreparedField[] | null;
|
|
284
|
+
readonly args?: JsonValue;
|
|
285
|
+
readonly operationLabel?: string | null;
|
|
286
|
+
}) | (StepCommon & {
|
|
287
|
+
/** Approve, amend or reject (DK-1, AZ-1, AZ-2). */
|
|
288
|
+
readonly kind: "decide";
|
|
289
|
+
readonly decision: {
|
|
290
|
+
readonly kind: "approve" | "reject";
|
|
291
|
+
readonly amendments?: AmendmentMap | null;
|
|
292
|
+
readonly reason?: string | null;
|
|
293
|
+
};
|
|
294
|
+
}) | (StepCommon & {
|
|
295
|
+
/** File an expired entry again (DK-1). */
|
|
296
|
+
readonly kind: "resubmit";
|
|
297
|
+
}) | (StepCommon & {
|
|
298
|
+
/** Report what the host's executor did (DK-1, AZ-5, AZ-7). */
|
|
299
|
+
readonly kind: "markExecuted";
|
|
300
|
+
readonly outcome: Exclude<ExecutionOutcome, "unexecuted">;
|
|
301
|
+
readonly detail?: string | null;
|
|
302
|
+
}) | (StepCommon & {
|
|
303
|
+
/** The host-scheduled sweep (DK-3). */
|
|
304
|
+
readonly kind: "expireDue";
|
|
305
|
+
readonly limit: number;
|
|
306
|
+
readonly scope?: {
|
|
307
|
+
readonly tenantId?: string;
|
|
308
|
+
readonly conversationId?: string;
|
|
309
|
+
};
|
|
310
|
+
}) | (StepCommon & {
|
|
311
|
+
/** Read the entry as it stands, with expiry applied (DK-1). */
|
|
312
|
+
readonly kind: "get";
|
|
313
|
+
}) | (StepCommon & {
|
|
314
|
+
/** One page of what a reconnecting client needs (DK-5). */
|
|
315
|
+
readonly kind: "rehydrate";
|
|
316
|
+
readonly page: {
|
|
317
|
+
readonly limit: number;
|
|
318
|
+
readonly cursor?: string | null;
|
|
319
|
+
};
|
|
320
|
+
readonly scope?: {
|
|
321
|
+
readonly tenantId?: string;
|
|
322
|
+
readonly conversationId?: string;
|
|
323
|
+
};
|
|
324
|
+
});
|
|
325
|
+
/** What must be true after the step under test. Every clause is optional. */
|
|
326
|
+
export interface FixtureExpectation {
|
|
327
|
+
/** The refusal the step under test must produce, or `null`/absent for none. */
|
|
328
|
+
readonly error?: {
|
|
329
|
+
readonly code: string;
|
|
330
|
+
readonly messageContains?: string;
|
|
331
|
+
} | null;
|
|
332
|
+
/** The row the step acted on, or the row it filed. */
|
|
333
|
+
readonly entry?: EntryExpectation | null;
|
|
334
|
+
/** The Evidence Card a filing produced. */
|
|
335
|
+
readonly card?: CardExpectation | null;
|
|
336
|
+
/** The row a `resubmit` superseded. */
|
|
337
|
+
readonly superseded?: EntryExpectation | null;
|
|
338
|
+
/** Telemetry keys that must have been emitted at some point (TL-1). */
|
|
339
|
+
readonly telemetry?: readonly string[] | null;
|
|
340
|
+
/** Telemetry keys that must **never** have been emitted. */
|
|
341
|
+
readonly telemetryAbsent?: readonly string[] | null;
|
|
342
|
+
/** What the Docket holds afterwards. */
|
|
343
|
+
readonly store?: {
|
|
344
|
+
readonly count?: number;
|
|
345
|
+
readonly pending?: number;
|
|
346
|
+
readonly approvedUnexecuted?: number;
|
|
347
|
+
} | null;
|
|
348
|
+
/** What an `expireDue` step reported (DK-3). */
|
|
349
|
+
readonly expired?: {
|
|
350
|
+
readonly count?: number;
|
|
351
|
+
readonly more?: boolean;
|
|
352
|
+
} | null;
|
|
353
|
+
/** What a `rehydrate` step returned (DK-5). */
|
|
354
|
+
readonly page?: {
|
|
355
|
+
readonly count?: number;
|
|
356
|
+
readonly more?: boolean;
|
|
357
|
+
readonly statuses?: readonly string[];
|
|
358
|
+
} | null;
|
|
359
|
+
/** Whether the row a `get` step read was found. */
|
|
360
|
+
readonly found?: boolean;
|
|
361
|
+
/**
|
|
362
|
+
* The row's canonical hash, as 64 lowercase hex characters (SR-1).
|
|
363
|
+
*
|
|
364
|
+
* **This is the value a host's execution grant binds to**, taken through the
|
|
365
|
+
* package's own `canonicalHashEntry` — the Affidavit ⊕ its accepted amendments,
|
|
366
|
+
* never the proposal alone once an amendment has been accepted. Stating it pins
|
|
367
|
+
* the binding as a byte vector rather than as a property: an implementation that
|
|
368
|
+
* bound a grant to the unamended proposal would produce a different hash here and
|
|
369
|
+
* fail, where a `canonicalDiffersFromProposal` flag alone would not notice a
|
|
370
|
+
* second implementation that canonicalised the same two Affidavits differently.
|
|
371
|
+
*
|
|
372
|
+
* A fixture that states it is stating a value this implementation must reproduce
|
|
373
|
+
* byte for byte, which is what SR-1 asks conformance fixtures to carry.
|
|
374
|
+
*/
|
|
375
|
+
readonly canonicalHash?: string;
|
|
376
|
+
}
|
|
377
|
+
/** A partial matcher over a Docket row. */
|
|
378
|
+
export interface EntryExpectation {
|
|
379
|
+
readonly status?: string;
|
|
380
|
+
readonly execution?: string | null;
|
|
381
|
+
/**
|
|
382
|
+
* What the executor said, beside the outcome.
|
|
383
|
+
*
|
|
384
|
+
* Stated where a fixture is about a row being *unchanged*: a refused second
|
|
385
|
+
* execution report has to leave both halves of the first one standing, and an
|
|
386
|
+
* outcome alone would not show that the detail had been overwritten (DK-4).
|
|
387
|
+
*/
|
|
388
|
+
readonly executionDetail?: string | null;
|
|
389
|
+
readonly requirement?: RequirementKind;
|
|
390
|
+
readonly blocked?: BlockedMarker | null;
|
|
391
|
+
readonly toolName?: string;
|
|
392
|
+
readonly channel?: string;
|
|
393
|
+
readonly tenantId?: string;
|
|
394
|
+
readonly conversationId?: string;
|
|
395
|
+
/** The attestor as it must read (AZ-1, AZ-3), or `null` for no attestation. */
|
|
396
|
+
readonly attestation?: Attestor | null;
|
|
397
|
+
readonly decision?: {
|
|
398
|
+
readonly kind: string;
|
|
399
|
+
readonly reason: string | null;
|
|
400
|
+
} | null;
|
|
401
|
+
readonly amendments?: AmendmentMap | null;
|
|
402
|
+
readonly preservedAmendments?: {
|
|
403
|
+
readonly amendments: AmendmentMap;
|
|
404
|
+
readonly at: string;
|
|
405
|
+
readonly by: string;
|
|
406
|
+
} | null;
|
|
407
|
+
/** `supersedes` / `supersededBy`, where `"@filed"` means "the entry this step filed". */
|
|
408
|
+
readonly lineage?: {
|
|
409
|
+
readonly supersedes?: string | null;
|
|
410
|
+
readonly supersededBy?: string | null;
|
|
411
|
+
};
|
|
412
|
+
/** The deadline, as milliseconds after the instant the entry was filed (GT-4). */
|
|
413
|
+
readonly expiresAtOffsetMs?: number;
|
|
414
|
+
/** The Affidavit as proposed — never edited by a decision (DK-4). */
|
|
415
|
+
readonly affidavit?: AffidavitExpectation;
|
|
416
|
+
/** The state an accepted amendment produced, or `null` while none has (AF-4). */
|
|
417
|
+
readonly amendedAffidavit?: AffidavitExpectation | null;
|
|
418
|
+
/**
|
|
419
|
+
* Whether the row's canonical form differs from its proposal's (SR-1).
|
|
420
|
+
*
|
|
421
|
+
* `true` is the substitution guard: a grant minted over the Affidavit a reviewer
|
|
422
|
+
* was shown must not validate the one they amended.
|
|
423
|
+
*/
|
|
424
|
+
readonly canonicalDiffersFromProposal?: boolean;
|
|
425
|
+
}
|
|
426
|
+
/** A partial matcher over an Affidavit. */
|
|
427
|
+
export interface AffidavitExpectation {
|
|
428
|
+
readonly operationType?: "create" | "update";
|
|
429
|
+
readonly entityType?: string;
|
|
430
|
+
readonly entityId?: string | null;
|
|
431
|
+
readonly aggregateConfidence?: number;
|
|
432
|
+
readonly populatedConfidence?: number | null;
|
|
433
|
+
readonly emptyFieldCount?: number;
|
|
434
|
+
/** The fields, in order. Stating this asserts the field list exactly (AF-1). */
|
|
435
|
+
readonly fields?: readonly FieldExpectation[];
|
|
436
|
+
}
|
|
437
|
+
/** A partial matcher over one sworn field. */
|
|
438
|
+
export interface FieldExpectation {
|
|
439
|
+
readonly name: string;
|
|
440
|
+
readonly value?: JsonValue;
|
|
441
|
+
readonly previousValue?: JsonValue | null;
|
|
442
|
+
readonly kind?: string;
|
|
443
|
+
readonly isMandatory?: boolean;
|
|
444
|
+
/** The grade in force. */
|
|
445
|
+
readonly source?: ProvenanceSource;
|
|
446
|
+
/** Whether the tag in force points at something checkable (PV-2, PV-4). */
|
|
447
|
+
readonly bound?: boolean;
|
|
448
|
+
/** The kind of binding, when the fixture is about which one. */
|
|
449
|
+
readonly bindingKind?: string | null;
|
|
450
|
+
readonly confidence?: number;
|
|
451
|
+
/** The grades the chain displaced, newest first. */
|
|
452
|
+
readonly priorSources?: readonly ProvenanceSource[];
|
|
453
|
+
}
|
|
454
|
+
/** A partial matcher over an Evidence Card. */
|
|
455
|
+
export interface CardExpectation {
|
|
456
|
+
readonly requiresConfirmation?: boolean;
|
|
457
|
+
readonly warningsContain?: readonly string[];
|
|
458
|
+
readonly priorAmendments?: AmendmentMap | null;
|
|
459
|
+
readonly blocked?: BlockedMarker | null;
|
|
460
|
+
readonly protocolVersion?: string;
|
|
461
|
+
readonly aggregateConfidence?: number;
|
|
462
|
+
readonly populatedConfidence?: number | null;
|
|
463
|
+
readonly emptyFieldCount?: number;
|
|
464
|
+
/** The reviewer-facing shape of each field, in order (the typed-input rule). */
|
|
465
|
+
readonly fields?: readonly {
|
|
466
|
+
readonly name: string;
|
|
467
|
+
readonly kind?: string;
|
|
468
|
+
readonly value?: JsonValue;
|
|
469
|
+
readonly isMandatory?: boolean;
|
|
470
|
+
}[];
|
|
471
|
+
/**
|
|
472
|
+
* The envelope's rendering hints, as the whole array and in the card's own order.
|
|
473
|
+
*
|
|
474
|
+
* Presentation, never substance: a closed value set and an input mask say how a
|
|
475
|
+
* surface should render a field, and nothing here is part of the canonical form
|
|
476
|
+
* (SR-1). A card that carries no hints omits the property, and a fixture that
|
|
477
|
+
* states an empty array asserts exactly that.
|
|
478
|
+
*/
|
|
479
|
+
readonly presentation?: readonly {
|
|
480
|
+
readonly name: string;
|
|
481
|
+
readonly kind?: string;
|
|
482
|
+
readonly allowedValues?: readonly JsonValue[];
|
|
483
|
+
readonly pattern?: string;
|
|
484
|
+
}[];
|
|
485
|
+
}
|
|
486
|
+
/** One thing a fixture expected that the gate did not do. */
|
|
487
|
+
export interface FixtureFailure {
|
|
488
|
+
/** Where, as a dotted path into the expectation — `"entry.status"`, `"card.fields[1].kind"`. */
|
|
489
|
+
readonly at: string;
|
|
490
|
+
/** What the fixture said. */
|
|
491
|
+
readonly expected: unknown;
|
|
492
|
+
/** What the gate did. */
|
|
493
|
+
readonly actual: unknown;
|
|
494
|
+
}
|
|
495
|
+
/** What running one fixture produced. */
|
|
496
|
+
export interface FixtureResult {
|
|
497
|
+
readonly id: string;
|
|
498
|
+
readonly rules: readonly string[];
|
|
499
|
+
readonly title: string;
|
|
500
|
+
/** `true` when `failures` is empty. */
|
|
501
|
+
readonly pass: boolean;
|
|
502
|
+
readonly failures: readonly FixtureFailure[];
|
|
503
|
+
}
|
|
504
|
+
/** What running a set of fixtures produced. */
|
|
505
|
+
export interface FixtureRunResult {
|
|
506
|
+
readonly total: number;
|
|
507
|
+
readonly passed: number;
|
|
508
|
+
readonly failed: number;
|
|
509
|
+
readonly results: readonly FixtureResult[];
|
|
510
|
+
/** The ids that failed, for a parity manifest. */
|
|
511
|
+
readonly failedIds: readonly string[];
|
|
512
|
+
}
|
|
513
|
+
/** A {@link Clock} a fixture drives by hand. */
|
|
514
|
+
export interface FixtureClock extends Clock {
|
|
515
|
+
/** Move the clock to `instant`. */
|
|
516
|
+
set(instant: string): void;
|
|
517
|
+
}
|
|
518
|
+
/** A {@link Clock} that reads `start` until a step moves it. */
|
|
519
|
+
export declare function fixedClock(start: string): FixtureClock;
|
|
520
|
+
/**
|
|
521
|
+
* An {@link InferencePort} that reports exactly what the fixture scripted, for every
|
|
522
|
+
* turn.
|
|
523
|
+
*
|
|
524
|
+
* Scripted rather than computed: the gate's contract is that it asks the host for
|
|
525
|
+
* values and tags whatever it gets, so a fixture that also decided *how* the values
|
|
526
|
+
* were found would be testing a model the framework does not ship.
|
|
527
|
+
*/
|
|
528
|
+
export declare function scriptedInference(fields: {
|
|
529
|
+
readonly [fieldName: string]: FixtureInferredField;
|
|
530
|
+
} | null): InferencePort;
|
|
531
|
+
/**
|
|
532
|
+
* A {@link ProjectionPort} reading the fixture's entity table (AF-3).
|
|
533
|
+
*
|
|
534
|
+
* An entity the table does not name does not exist, and the port answers `null` —
|
|
535
|
+
* which the pipeline treats as "nothing to project", not as "every field was empty".
|
|
536
|
+
*/
|
|
537
|
+
export declare function entityProjection(entities: FixtureGate["entities"]): ProjectionPort;
|
|
538
|
+
/**
|
|
539
|
+
* An {@link AuthorizationPort} over an allowlist of principal ids (AZ-2).
|
|
540
|
+
*
|
|
541
|
+
* `"*"` admits everyone. A port configured to throw is the AZ-2 case that matters
|
|
542
|
+
* most: the gate must read a port that fell over as a refusal, never as an approval.
|
|
543
|
+
*/
|
|
544
|
+
export declare function allowlistAuthorization(config: FixtureAuthorization): AuthorizationPort;
|
|
545
|
+
/** A {@link RiskScorer} that always returns `score` (GT-5). */
|
|
546
|
+
export declare function fixedRiskScorer(score: number): RiskScorer;
|
|
547
|
+
/** The ports a fixture is wired from. Every one has a default; a driver may replace any. */
|
|
548
|
+
export interface FixturePorts {
|
|
549
|
+
/** The Docket. Defaults to the in-memory reference store. */
|
|
550
|
+
readonly store?: (clock: Clock) => DocketStore;
|
|
551
|
+
readonly inference?: (fixture: Fixture) => InferencePort;
|
|
552
|
+
readonly projection?: (fixture: Fixture) => ProjectionPort;
|
|
553
|
+
readonly authorization?: (fixture: Fixture) => AuthorizationPort;
|
|
554
|
+
readonly clock?: (fixture: Fixture) => FixtureClock;
|
|
555
|
+
}
|
|
556
|
+
/**
|
|
557
|
+
* Run `fixture` against a real gate and report what it did.
|
|
558
|
+
*
|
|
559
|
+
* Never throws for a failed expectation — see the module note. It **does** propagate
|
|
560
|
+
* a `RangeError` or a `TypeError`, because those are programming errors in the
|
|
561
|
+
* fixture or in a port, not behaviours a rule is about, and swallowing them into a
|
|
562
|
+
* failure list would hide a broken document behind a red test.
|
|
563
|
+
*/
|
|
564
|
+
export declare function runFixture(fixture: Fixture, ports?: FixturePorts): Promise<FixtureResult>;
|
|
565
|
+
/**
|
|
566
|
+
* Run every fixture and summarise.
|
|
567
|
+
*
|
|
568
|
+
* Takes the documents rather than a directory: this module runs inside workerd and
|
|
569
|
+
* under Bun as well as on Node, and none of those three read a directory the same
|
|
570
|
+
* way. A caller that has files loads them and passes them here.
|
|
571
|
+
*/
|
|
572
|
+
export declare function runFixtureDir(fixtures: readonly Fixture[], ports?: FixturePorts): Promise<FixtureRunResult>;
|
|
573
|
+
export {};
|
|
574
|
+
//# sourceMappingURL=testing.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../src/testing.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AAEH,OAAO,KAAK,EAAE,SAAS,EAAe,MAAM,cAAc,CAAC;AAC3D,OAAO,KAAK,EACV,QAAQ,EACR,aAAa,EAEb,gBAAgB,EAChB,eAAe,EAChB,MAAM,mBAAmB,CAAC;AAG3B,OAAO,KAAK,EAAE,WAAW,EAAe,MAAM,mBAAmB,CAAC;AAElE,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAK5D,OAAO,KAAK,EAAkB,OAAO,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,KAAK,EAAa,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AAE1D,OAAO,KAAK,EAAE,OAAO,EAAE,gBAAgB,EAAE,MAAM,uBAAuB,CA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