@fabricorg/gen-conformance 1.0.6 → 1.0.8

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
@@ -1,147 +1,146 @@
1
- import { GeneratorTarget } from '@fabricorg/compiler';
2
- import { ModuleManifest } from '@fabricorg/platform';
3
-
1
+ import { GeneratorTarget } from "@fabricorg/compiler";
2
+ import { ModuleManifest } from "@fabricorg/platform";
3
+ //#region index.d.ts
4
4
  /** Checks a single module's own behaviour, verifiable against a governed host. */
5
- declare const MODULE_CONFORMANCE_CHECKS: readonly ["fabric.idempotency.same-command-replay.v1", "fabric.idempotency.conflicting-payload.v1", "fabric.idempotency.concurrent-submission.v1", "fabric.authorization.governing-moment.v1", "fabric.authorization.offline-replay.v1", "fabric.events.compatibility.v1", "fabric.provenance.propagation.v1", "fabric.consumers.tolerant-envelope.v1"];
5
+ export declare const MODULE_CONFORMANCE_CHECKS: readonly ["fabric.idempotency.same-command-replay.v1", "fabric.idempotency.conflicting-payload.v1", "fabric.idempotency.concurrent-submission.v1", "fabric.authorization.governing-moment.v1", "fabric.authorization.offline-replay.v1", "fabric.events.compatibility.v1", "fabric.provenance.propagation.v1", "fabric.consumers.tolerant-envelope.v1"];
6
6
  /**
7
7
  * Checks that belong to a repository rather than a module. They are certification
8
8
  * evidence like any other check, but no per-module suite can produce them.
9
9
  */
10
- declare const PLATFORM_CONFORMANCE_CHECKS: readonly ["fabric.documentation.parity.v1", "fabric.documentation.llms-contract.v1"];
11
- declare const PHASE_1_CONFORMANCE_CHECKS: readonly ["fabric.idempotency.same-command-replay.v1", "fabric.idempotency.conflicting-payload.v1", "fabric.idempotency.concurrent-submission.v1", "fabric.authorization.governing-moment.v1", "fabric.authorization.offline-replay.v1", "fabric.events.compatibility.v1", "fabric.provenance.propagation.v1", "fabric.consumers.tolerant-envelope.v1", "fabric.documentation.parity.v1", "fabric.documentation.llms-contract.v1"];
12
- type ModuleConformanceCheckId = typeof MODULE_CONFORMANCE_CHECKS[number];
13
- type PlatformConformanceCheckId = typeof PLATFORM_CONFORMANCE_CHECKS[number];
14
- type Phase1ConformanceCheckId = ModuleConformanceCheckId | PlatformConformanceCheckId;
15
- interface ConformanceEvidence {
16
- id: Phase1ConformanceCheckId;
17
- status: "passed" | "failed";
18
- evidence: string[];
10
+ export declare const PLATFORM_CONFORMANCE_CHECKS: readonly ["fabric.documentation.parity.v1", "fabric.documentation.llms-contract.v1"];
11
+ export declare const PHASE_1_CONFORMANCE_CHECKS: readonly ["fabric.idempotency.same-command-replay.v1", "fabric.idempotency.conflicting-payload.v1", "fabric.idempotency.concurrent-submission.v1", "fabric.authorization.governing-moment.v1", "fabric.authorization.offline-replay.v1", "fabric.events.compatibility.v1", "fabric.provenance.propagation.v1", "fabric.consumers.tolerant-envelope.v1", "fabric.documentation.parity.v1", "fabric.documentation.llms-contract.v1"];
12
+ export type ModuleConformanceCheckId = typeof MODULE_CONFORMANCE_CHECKS[number];
13
+ export type PlatformConformanceCheckId = typeof PLATFORM_CONFORMANCE_CHECKS[number];
14
+ export type Phase1ConformanceCheckId = ModuleConformanceCheckId | PlatformConformanceCheckId;
15
+ export interface ConformanceEvidence {
16
+ id: Phase1ConformanceCheckId;
17
+ status: "passed" | "failed";
18
+ evidence: string[];
19
19
  }
20
- interface CertificationResult {
21
- formatVersion: 1;
22
- manifestDigest: string;
23
- compilerVersion: string;
24
- generatorDigests: Record<string, string>;
25
- checks: ConformanceEvidence[];
26
- passed: boolean;
20
+ export interface CertificationResult {
21
+ formatVersion: 1;
22
+ manifestDigest: string;
23
+ compilerVersion: string;
24
+ generatorDigests: Record<string, string>;
25
+ checks: ConformanceEvidence[];
26
+ passed: boolean;
27
27
  }
28
- interface PlannedAction {
29
- actionId: string;
30
- version: number;
31
- mutatesDomain: boolean;
32
- idempotent: boolean;
33
- idempotency?: "required" | "supported" | "prohibited";
34
- authorityMoment?: "capture" | "execution" | "both";
35
- connectivity?: "online-required" | "offline-capturable";
36
- consistency?: "authoritative-now" | "provisional-until-reconciled";
28
+ export interface PlannedAction {
29
+ actionId: string;
30
+ version: number;
31
+ mutatesDomain: boolean;
32
+ idempotent: boolean;
33
+ idempotency?: "required" | "supported" | "prohibited";
34
+ authorityMoment?: "capture" | "execution" | "both";
35
+ connectivity?: "online-required" | "offline-capturable";
36
+ consistency?: "authoritative-now" | "provisional-until-reconciled";
37
37
  }
38
- interface PlannedView {
39
- name: string;
40
- version: string;
41
- parameterSchema?: ModuleManifest["views"][number]["parameterSchema"];
42
- consumes: Array<{
43
- eventType: string;
44
- schemaVersions: number[];
45
- }>;
38
+ export interface PlannedView {
39
+ name: string;
40
+ version: string;
41
+ parameterSchema?: ModuleManifest["views"][number]["parameterSchema"];
42
+ consumes: Array<{
43
+ eventType: string;
44
+ schemaVersions: number[];
45
+ }>;
46
46
  }
47
- interface ModuleConformancePlan {
48
- formatVersion: 1;
49
- module: string;
50
- manifestDigest: string;
51
- requiredChecks: readonly ModuleConformanceCheckId[];
52
- platformChecks: readonly PlatformConformanceCheckId[];
53
- actions: PlannedAction[];
54
- views: PlannedView[];
55
- eventTypes: Array<{
56
- eventType: string;
57
- schemaVersion: number;
58
- }>;
47
+ export interface ModuleConformancePlan {
48
+ formatVersion: 1;
49
+ module: string;
50
+ manifestDigest: string;
51
+ requiredChecks: readonly ModuleConformanceCheckId[];
52
+ platformChecks: readonly PlatformConformanceCheckId[];
53
+ actions: PlannedAction[];
54
+ views: PlannedView[];
55
+ eventTypes: Array<{
56
+ eventType: string;
57
+ schemaVersion: number;
58
+ }>;
59
59
  }
60
- interface ConformanceScope {
61
- tenantId: string;
62
- spaceId: string;
63
- actorId: string;
64
- actorType: string;
60
+ export interface ConformanceScope {
61
+ tenantId: string;
62
+ spaceId: string;
63
+ actorId: string;
64
+ actorType: string;
65
65
  }
66
- interface ConformanceSubmitInput {
67
- actionId: string;
68
- parameters: Record<string, unknown>;
69
- idempotencyKey?: string;
70
- correlationId?: string;
71
- provenance?: {
72
- source: string;
73
- correlationId: string;
74
- auditAttributes?: Record<string, string>;
75
- };
76
- /**
77
- * Declares only the intent of the binding. The harness completes tenant, actor,
78
- * action and parameter-digest identity, because only it knows the command shape.
79
- */
80
- authorizationBinding?: {
81
- governingMoment: "capture" | "execution" | "both";
82
- capturedAt?: string;
83
- expiresAt?: string;
84
- };
85
- executionReason?: "initial" | "offline_replay";
66
+ export interface ConformanceSubmitInput {
67
+ actionId: string;
68
+ parameters: Record<string, unknown>;
69
+ idempotencyKey?: string;
70
+ correlationId?: string;
71
+ provenance?: {
72
+ source: string;
73
+ correlationId: string;
74
+ auditAttributes?: Record<string, string>;
75
+ };
76
+ /**
77
+ * Declares only the intent of the binding. The harness completes tenant, actor,
78
+ * action and parameter-digest identity, because only it knows the command shape.
79
+ */
80
+ authorizationBinding?: {
81
+ governingMoment: "capture" | "execution" | "both";
82
+ capturedAt?: string;
83
+ expiresAt?: string;
84
+ };
85
+ executionReason?: "initial" | "offline_replay";
86
86
  }
87
- interface ConformanceSubmitResult {
88
- actionInvocationId: string;
89
- status: string;
90
- reconciliation?: {
91
- kind: string;
92
- };
87
+ export interface ConformanceSubmitResult {
88
+ actionInvocationId: string;
89
+ status: string;
90
+ reconciliation?: {
91
+ kind: string;
92
+ };
93
93
  }
94
- interface ConformanceEventEnvelope {
95
- eventType: string;
96
- correlationId?: string;
97
- actionInvocationId?: string;
98
- tenantId?: string;
99
- spaceId?: string;
100
- subjectType?: string;
101
- subjectId?: string;
102
- sequence?: number;
103
- [key: string]: unknown;
94
+ export interface ConformanceEventEnvelope {
95
+ eventType: string;
96
+ correlationId?: string;
97
+ actionInvocationId?: string;
98
+ tenantId?: string;
99
+ spaceId?: string;
100
+ subjectType?: string;
101
+ subjectId?: string;
102
+ sequence?: number;
103
+ [key: string]: unknown;
104
104
  }
105
105
  /**
106
106
  * What an application supplies so its module's generated suite can run. Structural
107
107
  * by design: any store or host that satisfies it is a valid subject.
108
108
  */
109
- interface ConformanceHarness {
110
- scope: ConformanceScope;
111
- /** Representative parameters for an action; the module owns its own fixtures. */
112
- parameters(actionId: string): Record<string, unknown>;
113
- submit(input: ConformanceSubmitInput): Promise<ConformanceSubmitResult>;
114
- events(): Promise<ConformanceEventEnvelope[]>;
115
- /** Withdraw execution-time authority so a replay must be refused. */
116
- revokeAuthority(actionId: string): Promise<void>;
117
- /**
118
- * Observable effects an action has produced so far — events appended, rows written,
119
- * whatever the application counts. Supply it and the idempotency checks prove the
120
- * handler did not run twice, rather than only that the same identifier came back.
121
- */
122
- sideEffects?(actionId: string): Promise<number>;
123
- /**
124
- * Hand a real emitted envelope to a real consumer. Supply it and the
125
- * tolerant-envelope check stops being producer-side only: it proves a consumer
126
- * survives fields it does not recognise, which is what tolerance means.
127
- */
128
- acceptsEnvelope?(envelope: ConformanceEventEnvelope): Promise<boolean> | boolean;
109
+ export interface ConformanceHarness {
110
+ scope: ConformanceScope;
111
+ /** Representative parameters for an action; the module owns its own fixtures. */
112
+ parameters(actionId: string): Record<string, unknown>;
113
+ submit(input: ConformanceSubmitInput): Promise<ConformanceSubmitResult>;
114
+ events(): Promise<ConformanceEventEnvelope[]>;
115
+ /** Withdraw execution-time authority so a replay must be refused. */
116
+ revokeAuthority(actionId: string): Promise<void>;
117
+ /**
118
+ * Observable effects an action has produced so far — events appended, rows written,
119
+ * whatever the application counts. Supply it and the idempotency checks prove the
120
+ * handler did not run twice, rather than only that the same identifier came back.
121
+ */
122
+ sideEffects?(actionId: string): Promise<number>;
123
+ /**
124
+ * Hand a real emitted envelope to a real consumer. Supply it and the
125
+ * tolerant-envelope check stops being producer-side only: it proves a consumer
126
+ * survives fields it does not recognise, which is what tolerance means.
127
+ */
128
+ acceptsEnvelope?(envelope: ConformanceEventEnvelope): Promise<boolean> | boolean;
129
129
  }
130
- type ConformanceOutcome = {
131
- status: "passed";
132
- evidence: string[];
130
+ export type ConformanceOutcome = {
131
+ status: "passed";
132
+ evidence: string[];
133
133
  } | {
134
- status: "not-applicable";
135
- reason: string;
134
+ status: "not-applicable";
135
+ reason: string;
136
136
  };
137
- interface ConformanceCheck {
138
- id: ModuleConformanceCheckId;
139
- title: string;
140
- run(harness: ConformanceHarness, plan: ModuleConformancePlan): Promise<ConformanceOutcome>;
137
+ export interface ConformanceCheck {
138
+ id: ModuleConformanceCheckId;
139
+ title: string;
140
+ run(harness: ConformanceHarness, plan: ModuleConformancePlan): Promise<ConformanceOutcome>;
141
141
  }
142
- declare function moduleConformanceChecks(): ConformanceCheck[];
143
- declare function createCertificationResult(input: Omit<CertificationResult, "formatVersion" | "passed">): CertificationResult;
144
- declare function buildModuleConformancePlan(module: ModuleManifest, manifestDigest: string): ModuleConformancePlan;
145
- declare const conformanceGenerator: GeneratorTarget;
146
-
147
- export { type CertificationResult, type ConformanceCheck, type ConformanceEventEnvelope, type ConformanceEvidence, type ConformanceHarness, type ConformanceOutcome, type ConformanceScope, type ConformanceSubmitInput, type ConformanceSubmitResult, MODULE_CONFORMANCE_CHECKS, type ModuleConformanceCheckId, type ModuleConformancePlan, PHASE_1_CONFORMANCE_CHECKS, PLATFORM_CONFORMANCE_CHECKS, type Phase1ConformanceCheckId, type PlannedAction, type PlannedView, type PlatformConformanceCheckId, buildModuleConformancePlan, conformanceGenerator, createCertificationResult, moduleConformanceChecks };
142
+ export declare function moduleConformanceChecks(): ConformanceCheck[];
143
+ export declare function createCertificationResult(input: Omit<CertificationResult, "formatVersion" | "passed">): CertificationResult;
144
+ export declare function buildModuleConformancePlan(module: ModuleManifest, manifestDigest: string): ModuleConformancePlan;
145
+ export declare const conformanceGenerator: GeneratorTarget;
146
+ //#endregion