@affiant/core 0.1.0-alpha.1 → 0.1.0-alpha.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -18,7 +18,7 @@
18
18
  * supplies (see `ports.ts`), which is what lets one gate sit in front of any model,
19
19
  * any database and any approval surface.
20
20
  *
21
- * **What is here at `0.1.0-alpha.1`:** the turn context (GT-2), the port
21
+ * **What is here at `0.1.0-alpha.3`:** the turn context (GT-2), the port
22
22
  * interfaces, the error-code registry (CV-1), the telemetry-key registry (TL-1) and
23
23
  * the Affidavit model — the provenance ladder with its bindings and merge rule
24
24
  * (PV-1..PV-3, PV-5), the Affidavit and its three confidence numbers (AF-1..AF-3),
@@ -33,7 +33,12 @@
33
33
  * the gate: fail-closed tenant-scoped authorization, the three attestation kinds with
34
34
  * a relay's identity mapped to `member-via-relay`, amendments with the recompute they
35
35
  * force, the execution outcome a host reports, resubmission lineage and rehydration
36
- * order (AZ-1..AZ-3, AZ-5..AZ-7, DK-1, DK-2, DK-5, AF-4, PV-2).
36
+ * order (AZ-1..AZ-3, AZ-5..AZ-7, DK-1, DK-2, DK-5, AF-4, PV-2); and **the read
37
+ * side** — `cardFor`, the Evidence Card for a row a review queue already holds
38
+ * (SR-1, DK-1, DK-5, AZ-4, CV-4, AF-2, AF-4), `decisionResultOf`, the decision
39
+ * report a decided row makes (SR-4, AZ-1), and `AffiantCallerError` with
40
+ * `isCallerError`, the typed form of the errors the rulebook classes as a caller's
41
+ * own (DK-2, GT-1).
37
42
  *
38
43
  * Three checks stand between a policy's verdict and a write with no person present, and
39
44
  * each degrades to asking a person rather than refusing: a proposed field marked
@@ -41,18 +46,20 @@
41
46
  * pointing at nothing (PV-4), and a host risk score above the policy's threshold (GT-5).
42
47
  *
43
48
  * The fixtures for both v0.1 sequences and the runner that executes them are behind
44
- * `@affiant/core/testing`, which a host can point at its own ports.
49
+ * `@affiant/core/testing`, which a host can point at its own ports — and beside them the
50
+ * parametrised store contract every `DocketStore` and `SessionStore` implementation is
51
+ * measured by, the same assertions the in-memory reference passes.
45
52
  *
46
- * **On npm at `0.1.0-alpha.1`**, under the `alpha` dist-tag and with a provenance
47
- * attestation, since 2026-09-06. The same version string is what a conformance driver
48
- * pins. Publishing is a separate, deliberate step — a workflow a maintainer dispatches
53
+ * **On npm at `0.1.0-alpha.3`**, under the `alpha` dist-tag and with a provenance
54
+ * attestation, since 2026-09-18; `alpha` points at it. The version
55
+ * above is what a conformance driver pins. Publishing is a separate, deliberate step — a workflow a maintainer dispatches
49
56
  * by hand, which defaults to a dry run, and a `prepack` guard that refuses to pack at
50
57
  * all until an override is set. See the package README.
51
58
  *
52
59
  * @packageDocumentation
53
60
  */
54
61
  /** The version of this package, and the version of it that is on npm. */
55
- export declare const CORE_VERSION = "0.1.0-alpha.1";
62
+ export declare const CORE_VERSION = "0.1.0-alpha.3";
56
63
  /**
57
64
  * The protocol tag the wire types are pinned to, re-exported from
58
65
  * `@affiant/contract` so a host that only depends on the gate can still assert
@@ -60,8 +67,8 @@ export declare const CORE_VERSION = "0.1.0-alpha.1";
60
67
  */
61
68
  export { PROTOCOL_VERSION } from "@affiant/contract";
62
69
  export type { ChannelIdentity, Principal, RelayAssertion, Turn, TurnContext } from "./context.js";
63
- export { AffiantError, ERROR_CODES, ErrorCode, isAffiantError, isErrorCode } from "./errors.js";
64
- export type { AffiantErrorDetails } from "./errors.js";
70
+ export { AffiantCallerError, AffiantError, ERROR_CODES, ErrorCode, isAffiantError, isCallerError, isErrorCode, } from "./errors.js";
71
+ export type { AffiantCallerErrorDetails, AffiantErrorDetails, CallerErrorKind } from "./errors.js";
65
72
  export { isTelemetryKey, noopTelemetry, TELEMETRY_KEYS, TELEMETRY_REGISTRY_VERSION, } from "./telemetry.js";
66
73
  export type { TelemetryAttributes, TelemetryEvent, TelemetryKey, TelemetryKeyEntry, TelemetryPort, } from "./telemetry.js";
67
74
  export { AFFIDAVIT_FIELD_KINDS, buildAffidavit, computeConfidence, fromWire, isJsonValue, isMoney, toWire, wireCarryOf, withConfidence, } from "./model/affidavit.js";
@@ -88,6 +95,10 @@ export { emptyMandatoryFields, evaluatePolicies, unboundDeclaredInput } from "./
88
95
  export type { ApprovalPolicy, PolicyChainDeps, PolicyOutcome, StandingOrderBlockedReason, UnboundInput, Verdict, } from "./gate/policy.js";
89
96
  export { assessCoverage, coverageRefusedMarker, createCoverageRegistry, declareUncovered, isUncoveredCategory, UNCOVERED_CATEGORIES, } from "./gate/coverage.js";
90
97
  export type { CoverageAssessment, CoverageRegistry, ToolDefinition, UncoveredCategory, UncoveredDeclaration, } from "./gate/coverage.js";
98
+ export { cardFor } from "./gate/card.js";
99
+ export type { CardForOptions } from "./gate/card.js";
100
+ export { decisionResultOf } from "./gate/decision-result.js";
101
+ export type { DecisionOutcome, DecisionResult } from "./gate/decision-result.js";
91
102
  export { deriveEntryId, runPipeline } from "./gate/pipeline.js";
92
103
  export type { EvidenceCardRequest, FiledEntry, PipelineDeps, PipelineProposal, PreparedField, } from "./gate/pipeline.js";
93
104
  export { wrapTool } from "./gate/wrap.js";
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,yEAAyE;AACzE,eAAO,MAAM,YAAY,kBAAkB,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAIrD,YAAY,EAAE,eAAe,EAAE,SAAS,EAAE,cAAc,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAIlG,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAChG,YAAY,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAIvD,OAAO,EACL,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,MAAM,oBAAoB,CAAC;AAE5B,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAC1C,YAAY,EAAE,SAAS,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC"}
package/dist/index.js CHANGED
@@ -18,7 +18,7 @@
18
18
  * supplies (see `ports.ts`), which is what lets one gate sit in front of any model,
19
19
  * any database and any approval surface.
20
20
  *
21
- * **What is here at `0.1.0-alpha.1`:** the turn context (GT-2), the port
21
+ * **What is here at `0.1.0-alpha.3`:** the turn context (GT-2), the port
22
22
  * interfaces, the error-code registry (CV-1), the telemetry-key registry (TL-1) and
23
23
  * the Affidavit model — the provenance ladder with its bindings and merge rule
24
24
  * (PV-1..PV-3, PV-5), the Affidavit and its three confidence numbers (AF-1..AF-3),
@@ -33,7 +33,12 @@
33
33
  * the gate: fail-closed tenant-scoped authorization, the three attestation kinds with
34
34
  * a relay's identity mapped to `member-via-relay`, amendments with the recompute they
35
35
  * force, the execution outcome a host reports, resubmission lineage and rehydration
36
- * order (AZ-1..AZ-3, AZ-5..AZ-7, DK-1, DK-2, DK-5, AF-4, PV-2).
36
+ * order (AZ-1..AZ-3, AZ-5..AZ-7, DK-1, DK-2, DK-5, AF-4, PV-2); and **the read
37
+ * side** — `cardFor`, the Evidence Card for a row a review queue already holds
38
+ * (SR-1, DK-1, DK-5, AZ-4, CV-4, AF-2, AF-4), `decisionResultOf`, the decision
39
+ * report a decided row makes (SR-4, AZ-1), and `AffiantCallerError` with
40
+ * `isCallerError`, the typed form of the errors the rulebook classes as a caller's
41
+ * own (DK-2, GT-1).
37
42
  *
38
43
  * Three checks stand between a policy's verdict and a write with no person present, and
39
44
  * each degrades to asking a person rather than refusing: a proposed field marked
@@ -41,18 +46,20 @@
41
46
  * pointing at nothing (PV-4), and a host risk score above the policy's threshold (GT-5).
42
47
  *
43
48
  * The fixtures for both v0.1 sequences and the runner that executes them are behind
44
- * `@affiant/core/testing`, which a host can point at its own ports.
49
+ * `@affiant/core/testing`, which a host can point at its own ports — and beside them the
50
+ * parametrised store contract every `DocketStore` and `SessionStore` implementation is
51
+ * measured by, the same assertions the in-memory reference passes.
45
52
  *
46
- * **On npm at `0.1.0-alpha.1`**, under the `alpha` dist-tag and with a provenance
47
- * attestation, since 2026-09-06. The same version string is what a conformance driver
48
- * pins. Publishing is a separate, deliberate step — a workflow a maintainer dispatches
53
+ * **On npm at `0.1.0-alpha.3`**, under the `alpha` dist-tag and with a provenance
54
+ * attestation, since 2026-09-18; `alpha` points at it. The version
55
+ * above is what a conformance driver pins. Publishing is a separate, deliberate step — a workflow a maintainer dispatches
49
56
  * by hand, which defaults to a dry run, and a `prepack` guard that refuses to pack at
50
57
  * all until an override is set. See the package README.
51
58
  *
52
59
  * @packageDocumentation
53
60
  */
54
61
  /** The version of this package, and the version of it that is on npm. */
55
- export const CORE_VERSION = "0.1.0-alpha.1";
62
+ export const CORE_VERSION = "0.1.0-alpha.3";
56
63
  /**
57
64
  * The protocol tag the wire types are pinned to, re-exported from
58
65
  * `@affiant/contract` so a host that only depends on the gate can still assert
@@ -60,7 +67,7 @@ export const CORE_VERSION = "0.1.0-alpha.1";
60
67
  */
61
68
  export { PROTOCOL_VERSION } from "@affiant/contract";
62
69
  // -------------------------------------------------------------------- errors
63
- export { AffiantError, ERROR_CODES, ErrorCode, isAffiantError, isErrorCode } from "./errors.js";
70
+ export { AffiantCallerError, AffiantError, ERROR_CODES, ErrorCode, isAffiantError, isCallerError, isErrorCode, } from "./errors.js";
64
71
  // ----------------------------------------------------------------- telemetry
65
72
  export { isTelemetryKey, noopTelemetry, TELEMETRY_KEYS, TELEMETRY_REGISTRY_VERSION, } from "./telemetry.js";
66
73
  // model
@@ -104,6 +111,8 @@ export { attestorOf, decide, markExecuted, resubmit } from "./gate/decide.js";
104
111
  // ---------------------------------------------------------------------------
105
112
  export { emptyMandatoryFields, evaluatePolicies, unboundDeclaredInput } from "./gate/policy.js";
106
113
  export { assessCoverage, coverageRefusedMarker, createCoverageRegistry, declareUncovered, isUncoveredCategory, UNCOVERED_CATEGORIES, } from "./gate/coverage.js";
114
+ export { cardFor } from "./gate/card.js";
115
+ export { decisionResultOf } from "./gate/decision-result.js";
107
116
  export { deriveEntryId, runPipeline } from "./gate/pipeline.js";
108
117
  export { wrapTool } from "./gate/wrap.js";
109
118
  // end gate
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAoDG;AAEH,yEAAyE;AACzE,MAAM,CAAC,MAAM,YAAY,GAAG,eAAe,CAAC;AAE5C;;;;GAIG;AACH,OAAO,EAAE,gBAAgB,EAAE,MAAM,mBAAmB,CAAC;AAMrD,8EAA8E;AAE9E,OAAO,EAAE,YAAY,EAAE,WAAW,EAAE,SAAS,EAAE,cAAc,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAGhG,8EAA8E;AAE9E,OAAO,EACL,cAAc,EACd,aAAa,EACb,cAAc,EACd,0BAA0B,GAC3B,MAAM,gBAAgB,CAAC;AASxB,QAAQ;AACR,8EAA8E;AAC9E,kFAAkF;AAClF,oEAAoE;AAEpE,OAAO,EACL,qBAAqB,EACrB,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,WAAW,EACX,OAAO,EACP,MAAM,EACN,WAAW,EACX,cAAc,GACf,MAAM,sBAAsB,CAAC;AAc9B,OAAO,EACL,YAAY,EACZ,eAAe,EACf,YAAY,EACZ,iBAAiB,GAClB,MAAM,uBAAuB,CAAC;AAQ/B,OAAO,EACL,aAAa,EACb,OAAO,EACP,eAAe,EACf,QAAQ,EACR,OAAO,EACP,YAAY,EACZ,KAAK,EACL,gBAAgB,EAChB,aAAa,EACb,YAAY,EACZ,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,SAAS,EACT,MAAM,GACP,MAAM,uBAAuB,CAAC;AAmB/B,YAAY;A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AAC;AAGzC,OAAO,EAAE,gBAAgB,EAAE,MAAM,2BAA2B,CAAC;AAG7D,OAAO,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAShE,OAAO,EAAE,QAAQ,EAAE,MAAM,gBAAgB,CAAC;AAG1C,WAAW;AACX,8EAA8E"}
@@ -150,11 +150,13 @@ export declare function amendmentTag(amendment: Amendment, act: ReviewerAct, con
150
150
  *
151
151
  * The three numbers are recomputed over the amended fields (AF-4).
152
152
  *
153
- * @throws RangeError if `map` names a field the Affidavit does not propose. Not an
154
- * {@link AffiantError}: the error-code registry names refusals the gate
153
+ * @throws AffiantCallerError of kind `amendment-unknown-field` still a
154
+ * `RangeError` if `map` names a field the Affidavit does not propose. Not
155
+ * an {@link AffiantError}: the error-code registry names refusals the gate
155
156
  * makes at runtime about a proposal's substance or a decider's identity,
156
157
  * and this is a caller passing a field name that is not there — a
157
- * programming error, in the same class as an out-of-range index.
158
+ * programming error, in the same class as an out-of-range index (DK-2),
159
+ * which changes no state.
158
160
  */
159
161
  export declare function applyAmendments(affidavit: Affidavit, map: AmendmentMap, act: ReviewerAct): Affidavit;
160
162
  //# sourceMappingURL=amendments.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"amendments.d.ts","sourceRoot":"","sources":["../../src/model/amendments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAEH,OAAO,EAAsB,KAAK,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAEzE,OAAO,EAEL,KAAK,SAAS,EAEd,KAAK,SAAS,EACf,MAAM,gBAAgB,CAAC;AAExB;;;;;;GAMG;AACH,MAAM,MAAM,YAAY,GAAG;IAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,GAAG,SAAS,GAAG,IAAI,CAAA;CAAE,CAAC;AAE9E;;;;;;GAMG;AACH,MAAM,MAAM,SAAS,GACnB;IAAE,QAAQ,CAAC,IAAI,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AS,EAAE,SAAS,EACpB,GAAG,EAAE,YAAY,EACjB,GAAG,EAAE,WAAW,GACf,SAAS,CAsDX"}
@@ -46,6 +46,7 @@
46
46
  *
47
47
  * @packageDocumentation
48
48
  */
49
+ import { AffiantCallerError } from "../errors.js";
49
50
  import { mintTag, supersede } from "./provenance.js";
50
51
  import { withConfidence, } from "./affidavit.js";
51
52
  /** Whether `map` says anything at all about `fieldName` (DK-2). */
@@ -129,11 +130,13 @@ export function amendmentTag(amendment, act, conversationTurn) {
129
130
  *
130
131
  * The three numbers are recomputed over the amended fields (AF-4).
131
132
  *
132
- * @throws RangeError if `map` names a field the Affidavit does not propose. Not an
133
- * {@link AffiantError}: the error-code registry names refusals the gate
133
+ * @throws AffiantCallerError of kind `amendment-unknown-field` still a
134
+ * `RangeError` if `map` names a field the Affidavit does not propose. Not
135
+ * an {@link AffiantError}: the error-code registry names refusals the gate
134
136
  * makes at runtime about a proposal's substance or a decider's identity,
135
137
  * and this is a caller passing a field name that is not there — a
136
- * programming error, in the same class as an out-of-range index.
138
+ * programming error, in the same class as an out-of-range index (DK-2),
139
+ * which changes no state.
137
140
  */
138
141
  export function applyAmendments(affidavit, map, act) {
139
142
  const resolved = resolveAmendments(map);
@@ -142,7 +145,7 @@ export function applyAmendments(affidavit, map, act) {
142
145
  const byName = new Map(resolved.map((entry) => [entry.name, entry.amendment]));
143
146
  for (const name of byName.keys()) {
144
147
  if (!affidavit.fields.some((field) => field.name === name)) {
145
- throw new RangeError(`amendment names field ${JSON.stringify(name)}, which this Affidavit does not propose`);
148
+ throw new AffiantCallerError("amendment-unknown-field", `amendment names field ${JSON.stringify(name)}, which this Affidavit does not propose`, { field: name, entryId: act.entryId });
146
149
  }
147
150
  }
148
151
  const fields = affidavit.fields.flatMap((field) => {
@@ -1 +1 @@
1
- {"version":3,"file":"amendments.js","sourceRoot":"","sources":["../../src/model/amendments.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,UAAU,EAAE,SAAS,CAAC,UAAU;QAChC,QAAQ,EAAE,SAAS,CAAC,QAAQ;QAC5B,gBAAgB,EAAE,SAAS,CAAC,gBAAgB;QAC5C,SAAS,EAAE,SAAS,CAAC,SAAS;KAC/B,EACD,MAAM,CACP,CAAC;AACJ,CAAC"}
@@ -0,0 +1,214 @@
1
+ /**
2
+ * The store contract — every assertion a Docket store has to pass, written once and
3
+ * parametrised over the store under test.
4
+ *
5
+ * `@affiant/core` ships an in-memory reference store, and a host running on a
6
+ * database ships its own. The two are only interchangeable if they are measured by
7
+ * the same assertions, so the assertions live here rather than in the reference
8
+ * store's own suite: {@link runDocketStoreContract} and
9
+ * {@link runSessionStoreContract} register them against whatever factory they are
10
+ * handed, and the reference store is simply the first caller.
11
+ *
12
+ * ```ts
13
+ * import { describe, it, expect, beforeAll, afterAll } from "vitest";
14
+ * import { InMemoryDocketStore } from "@affiant/core/store-memory";
15
+ * import { runDocketStoreContract } from "@affiant/core/testing";
16
+ *
17
+ * runDocketStoreContract((clock) => new InMemoryDocketStore({ clock }), {
18
+ * api: { describe, it, expect, beforeAll, afterAll },
19
+ * });
20
+ * ```
21
+ *
22
+ * **The test runner comes in as a parameter.** Nothing here imports `vitest`, and
23
+ * `@affiant/core` gains no dependency — runtime, peer or optional — from carrying
24
+ * the contract. The caller passes the four functions it already has in scope, which
25
+ * is also what lets a store built on another runner run the same assertions.
26
+ *
27
+ * **A store is built once per block, and every case owns a tenant.** The factory is
28
+ * called from the block's `beforeAll`, because a store backed by a database is
29
+ * expensive to build and a fresh instance would not give a fresh database anyway.
30
+ * Isolation comes from tenancy instead: each case files under a tenant id of its
31
+ * own, which is a property the contract requires regardless (AZ-2). A case that
32
+ * needs a second tenant is handed one.
33
+ *
34
+ * **The clock is the case's.** A store is built with a {@link Clock} rather than
35
+ * handed an instant per call, so the harness owns a settable one, hands it to the
36
+ * factory, and resets it before every case.
37
+ *
38
+ * Rules the cases serve: DK-1 (idempotent filing, the guarded compare-and-set,
39
+ * expiry as queryable state, preserved amendments, execution recorded once,
40
+ * lineage), DK-2 (an amendment's `null` clears a field and an absent key leaves it
41
+ * alone), DK-3 (a bounded, paged, host-scheduled sweep and an opaque cursor on
42
+ * every list), DK-4 (retention, purge and export as hooks, and a row that reads
43
+ * forward), DK-5 (rehydration order), AZ-2 (a wrong-tenant lookup is a miss),
44
+ * AZ-5 (an approved write nobody has reported on is never aged out), GT-4 (a
45
+ * re-file never refreshes the deadline).
46
+ *
47
+ * @packageDocumentation
48
+ */
49
+ import type { DocketEntry, NewEntryInit } from "./docket/entry.js";
50
+ import type { DocketStore, Scope, SessionStore } from "./docket/store.js";
51
+ import type { Affidavit, AffidavitField, JsonValue } from "./model/affidavit.js";
52
+ import type { Clock } from "./ports.js";
53
+ /**
54
+ * The matchers the contract uses.
55
+ *
56
+ * Declared here rather than imported so that this module names no test runner. The
57
+ * shape is a subset of what `vitest`, `jest` and `bun:test` all expose, so passing
58
+ * any of their `expect` functions satisfies it.
59
+ */
60
+ export interface ContractMatchers {
61
+ toBe(expected: unknown): void;
62
+ toEqual(expected: unknown): void;
63
+ toBeNull(): void;
64
+ toHaveLength(length: number): void;
65
+ toContain(item: unknown): void;
66
+ }
67
+ /** One assertion, with its negation and its rejection form. */
68
+ export interface ContractAssertion extends ContractMatchers {
69
+ /** The same matchers, inverted. */
70
+ readonly not: ContractMatchers;
71
+ /** Assertions about a rejected promise. */
72
+ readonly rejects: {
73
+ toThrow(expected?: ErrorConstructor): Promise<unknown>;
74
+ };
75
+ }
76
+ /** The `expect` function the contract is written against. */
77
+ export interface ContractExpect {
78
+ (actual: unknown, message?: string): ContractAssertion;
79
+ }
80
+ /**
81
+ * The test runner's own API, handed in by the caller.
82
+ *
83
+ * Every member is declared as a method so that a runner's richer signature — a
84
+ * `describe` that also carries `.skip`, an `it` that takes a timeout — is accepted
85
+ * as it stands.
86
+ */
87
+ export interface ContractRunnerApi {
88
+ describe(name: string, fn: () => void): void;
89
+ it(name: string, fn: () => Promise<void> | void): void;
90
+ beforeAll(fn: () => Promise<void> | void): void;
91
+ afterAll(fn: () => Promise<void> | void): void;
92
+ expect: ContractExpect;
93
+ }
94
+ /** How a contract run is configured. */
95
+ export interface StoreContractOptions<TStore, TSection extends string> {
96
+ /** The test runner's `describe`, `it`, `beforeAll`, `afterAll` and `expect`. */
97
+ readonly api: ContractRunnerApi;
98
+ /** A label put in front of every block, when one store runs the contract twice. */
99
+ readonly name?: string;
100
+ /**
101
+ * Case ids not to register, each of which must be one this contract defines — an
102
+ * id nothing matches is a {@link RangeError}, because a skip that silently matches
103
+ * nothing is a case a store stopped running and nobody noticed.
104
+ */
105
+ readonly skip?: readonly string[];
106
+ /**
107
+ * The sections to register, defaulting to all of them. Same rule as `skip`: a
108
+ * section name this contract does not define is a {@link RangeError}.
109
+ */
110
+ readonly sections?: readonly TSection[];
111
+ /**
112
+ * Released in the block's `afterAll`, once per store the factory produced — where
113
+ * a store holds a database handle its owner has to close.
114
+ */
115
+ readonly dispose?: (store: TStore) => void | Promise<void>;
116
+ }
117
+ /** Builds the store under test on the harness's own clock. */
118
+ export type DocketStoreFactory = (clock: Clock) => DocketStore | Promise<DocketStore>;
119
+ /** Builds a store that is both a Docket and the rehydration surface over it. */
120
+ export type SessionStoreFactory = (clock: Clock) => (DocketStore & SessionStore) | Promise<DocketStore & SessionStore>;
121
+ /** A {@link Clock} a test drives by hand, so a deadline can be pinned to the millisecond. */
122
+ export interface StubClock extends Clock {
123
+ /** Move the clock to `instant`. */
124
+ set(instant: string): void;
125
+ }
126
+ /** A {@link Clock} that reads `start` until a test moves it. */
127
+ export declare function stubClock(start: string): StubClock;
128
+ /** One sworn field, filled in enough to be a real Affidavit field. */
129
+ export declare function sampleField(name: string, value: JsonValue): AffidavitField;
130
+ /**
131
+ * An Affidavit over `names`, shaped like something a pipeline would actually file.
132
+ *
133
+ * Built through `withConfidence` rather than as an object literal so the three
134
+ * numbers on it are the ones AF-2 computes, never numbers a test author typed.
135
+ */
136
+ export declare function sampleAffidavit(names?: readonly string[]): Affidavit;
137
+ /** A filed entry with `entryId`, overridable field by field. */
138
+ export declare function sampleEntry(entryId: string, overrides?: Partial<Omit<NewEntryInit, "entryId">>): DocketEntry;
139
+ /** The ids of `entries`, in the order they were returned. */
140
+ export declare function entryIds(entries: readonly DocketEntry[]): string[];
141
+ /**
142
+ * One object that is both a Docket and the rehydration surface over it.
143
+ *
144
+ * A store built on a database implements both interfaces itself; the reference
145
+ * pair is two objects, and this is what hands them to
146
+ * {@link runSessionStoreContract} as one.
147
+ */
148
+ export declare function withSessionStore(docket: DocketStore, sessions: SessionStore): DocketStore & SessionStore;
149
+ /** What one contract case is handed. */
150
+ export interface ContractCaseContext<TStore> {
151
+ /** The store under test, shared with the other cases of the same block. */
152
+ readonly store: TStore;
153
+ /** The harness's clock, reset to a fixed instant before this case. */
154
+ readonly clock: StubClock;
155
+ /** The runner's `expect`. */
156
+ readonly expect: ContractExpect;
157
+ /** This case's own tenant: nothing another case filed is visible in it. */
158
+ readonly scope: Scope;
159
+ /** A second tenant, for the cases that need one. */
160
+ readonly otherScope: Scope;
161
+ /** This case's tenant narrowed to one conversation. */
162
+ conversation(conversationId: string): Scope;
163
+ /** An entry in this case's tenant, overridable field by field. */
164
+ entry(entryId: string, overrides?: Partial<Omit<NewEntryInit, "entryId">>): DocketEntry;
165
+ }
166
+ /** The blocks {@link runDocketStoreContract} registers. */
167
+ export type DocketContractSection = "filing" | "transition" | "deadline" | "execution" | "lineage" | "sweep" | "paging" | "retention" | "purge" | "export" | "tenancy";
168
+ /** The blocks {@link runSessionStoreContract} registers. */
169
+ export type SessionContractSection = "rehydration";
170
+ /** The rehydration sequence DK-5 fixes, for the store the harness was handed. */
171
+ type SessionStoreUnderTest = DocketStore & SessionStore;
172
+ /** Every block {@link runDocketStoreContract} registers, in registration order. */
173
+ export declare const DOCKET_CONTRACT_SECTIONS: readonly DocketContractSection[];
174
+ /** Every block {@link runSessionStoreContract} registers, in registration order. */
175
+ export declare const SESSION_CONTRACT_SECTIONS: readonly SessionContractSection[];
176
+ /**
177
+ * One case of a contract, as a caller sees it from outside.
178
+ *
179
+ * `id` is what `skip` names; `block` and `title` are the two names the case is
180
+ * registered under, which is what lets a caller check that a suite registered the
181
+ * cases it was supposed to rather than that it meant to.
182
+ */
183
+ export interface ContractCaseSummary {
184
+ /** The id `skip` names. Stable across releases. */
185
+ readonly id: string;
186
+ /** The block the case belongs to, which `sections` names. */
187
+ readonly section: string;
188
+ /** The name of the `describe` the case is registered under, without any label. */
189
+ readonly block: string;
190
+ /** The name the case is registered as. */
191
+ readonly title: string;
192
+ }
193
+ /** Every case {@link runDocketStoreContract} registers, in registration order. */
194
+ export declare const DOCKET_CONTRACT_CASES: readonly ContractCaseSummary[];
195
+ /** Every case {@link runSessionStoreContract} registers, in registration order. */
196
+ export declare const SESSION_CONTRACT_CASES: readonly ContractCaseSummary[];
197
+ /**
198
+ * Register the Docket store contract against `factory`.
199
+ *
200
+ * The factory is called once per block with the harness's clock, and may be async —
201
+ * a store backed by a database is built from a connection the caller opened. Pass
202
+ * `dispose` to release it when the block ends.
203
+ */
204
+ export declare function runDocketStoreContract(factory: DocketStoreFactory, options: StoreContractOptions<DocketStore, DocketContractSection>): void;
205
+ /**
206
+ * Register the rehydration contract (DK-5) against `factory`.
207
+ *
208
+ * The factory returns one object that is both the Docket and the rehydration
209
+ * surface over it, because the cases file the rows they then rehydrate. A pair of
210
+ * separate reference objects is joined by {@link withSessionStore}.
211
+ */
212
+ export declare function runSessionStoreContract(factory: SessionStoreFactory, options: StoreContractOptions<SessionStoreUnderTest, SessionContractSection>): void;
213
+ export {};
214
+ //# sourceMappingURL=testing-store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"testing-store.d.ts","sourceRoot":"","sources":["../src/testing-store.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+CG;AAIH,OAAO,KAAK,EAAe,WAAW,EAAE,Y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