@fabricorg/platform 0.7.0 → 0.9.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/CHANGELOG.md CHANGED
@@ -1,5 +1,17 @@
1
1
  # @fabricorg/platform
2
2
 
3
+ ## 0.9.0
4
+
5
+ - Add versioned runtime-governance evidence shared by TypeScript and .NET hosts.
6
+ - Publish the canonical governance contract generation and validation helpers.
7
+ - Add language-neutral Fabric-family compatibility and conformance contracts.
8
+
9
+ ## 0.8.0 — 2026-07-20
10
+
11
+ - Add provider-neutral external mutation governance contracts for footprints, delegated execution
12
+ principals, policy obligations, execution attestations, and reconciliation observations.
13
+ - Add the `@fabricorg/platform/governance` public subpath.
14
+
3
15
  ## 0.7.0 — 2026-07-19
4
16
 
5
17
  ### Minor
package/README.md CHANGED
@@ -53,6 +53,7 @@ That's what this package gives you. Nothing more.
53
53
  | `@fabricorg/platform/displays` | `DisplayRendererRegistration` |
54
54
  | `@fabricorg/platform/privacy` | Redaction + data classification |
55
55
  | `@fabricorg/platform/evidence` | Compliance evidence packets |
56
+ | `@fabricorg/platform/governance` | External footprints, delegated principals, obligations, attestations, and reconciliation |
56
57
  | `@fabricorg/platform/objects` | Shared object-type contracts |
57
58
  | `@fabricorg/platform/testing` | In-memory adapter registry, fake `ActionContext`, deterministic IDs |
58
59
 
@@ -0,0 +1,30 @@
1
+ // governance/index.ts
2
+ var FABRIC_GOVERNANCE_CONTRACT_VERSION = 1;
3
+ function assertMutationGovernanceContext(value) {
4
+ if (!Number.isInteger(value.footprint.version) || value.footprint.version < 1) {
5
+ throw new Error("Mutation footprint version must be a positive integer");
6
+ }
7
+ for (const entry of value.footprint.resources) {
8
+ if (!entry.resource.provider.trim()) throw new Error("Resource provider is required");
9
+ if (!entry.resource.resourceType.trim()) throw new Error("Resource type is required");
10
+ if (!entry.resource.resourceId.trim()) throw new Error("Resource id is required");
11
+ }
12
+ if (!value.executionPrincipal.principalId.trim()) {
13
+ throw new Error("Execution principal id is required");
14
+ }
15
+ }
16
+ function assertGovernanceRuntimeEvidence(value) {
17
+ if (!Number.isInteger(value.governanceContractVersion) || value.governanceContractVersion < 1) {
18
+ throw new Error("Governance contract version must be a positive integer");
19
+ }
20
+ if (!Number.isInteger(value.hostContractVersion) || value.hostContractVersion < 1) {
21
+ throw new Error("Host contract version must be a positive integer");
22
+ }
23
+ if (value.providerBridge && (!value.providerBridge.name.trim() || !value.providerBridge.version.trim())) {
24
+ throw new Error("Provider bridge name and version are required");
25
+ }
26
+ }
27
+
28
+ export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext };
29
+ //# sourceMappingURL=chunk-3OWMPDBD.js.map
30
+ //# sourceMappingURL=chunk-3OWMPDBD.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../governance/index.ts"],"names":[],"mappings":";AAIO,IAAM,kCAAA,GAAqC;AA4G3C,SAAS,gCACf,KAAA,EACO;AACP,EAAA,IAAI,CAAC,MAAA,CAAO,SAAA,CAAU,KAAA,CAAM,SAAA,CAAU,OAAO,CAAA,IAAK,KAAA,CAAM,SAAA,CAAU,OAAA,GAAU,CAAA,EAAG;AAC9E,IAAA,MAAM,IAAI,MAAM,uDAAuD,CAAA;AAAA,EACxE;AACA,EAAA,KAAA,MAAW,KAAA,IAAS,KAAA,CAAM,SAAA,CAAU,SAAA,EAAW;AAC9C,IAAA,IAAI,CAAC,MAAM,QAAA,CAAS,QAAA,CAAS,MAAK,EAAG,MAAM,IAAI,KAAA,CAAM,+BAA+B,CAAA;AACpF,IAAA,IAAI,CAAC,MAAM,QAAA,CAAS,YAAA,CAAa,MAAK,EAAG,MAAM,IAAI,KAAA,CAAM,2BAA2B,CAAA;AACpF,IAAA,IAAI,CAAC,MAAM,QAAA,CAAS,UAAA,CAAW,MAAK,EAAG,MAAM,IAAI,KAAA,CAAM,yBAAyB,CAAA;AAAA,EACjF;AACA,EAAA,IAAI,CAAC,KAAA,CAAM,kBAAA,CAAmB,WAAA,CAAY,MAAK,EAAG;AACjD,IAAA,MAAM,IAAI,MAAM,oCAAoC,CAAA;AAAA,EACrD;AACD;AAEO,SAAS,gCAAgC,KAAA,EAAwC;AACvF,EAAA,IAAI,CAAC,OAAO,SAAA,CAAU,KAAA,CAAM,yBAAyB,CAAA,IAAK,KAAA,CAAM,4BAA4B,CAAA,EAAG;AAC9F,IAAA,MAAM,IAAI,MAAM,wDAAwD,CAAA;AAAA,EACzE;AACA,EAAA,IAAI,CAAC,OAAO,SAAA,CAAU,KAAA,CAAM,mBAAmB,CAAA,IAAK,KAAA,CAAM,sBAAsB,CAAA,EAAG;AAClF,IAAA,MAAM,IAAI,MAAM,kDAAkD,CAAA;AAAA,EACnE;AACA,EAAA,IAAI,KAAA,CAAM,cAAA,KAAmB,CAAC,KAAA,CAAM,cAAA,CAAe,IAAA,CAAK,IAAA,EAAK,IAAK,CAAC,KAAA,CAAM,cAAA,CAAe,OAAA,CAAQ,MAAK,CAAA,EAAI;AACxG,IAAA,MAAM,IAAI,MAAM,+CAA+C,CAAA;AAAA,EAChE;AACD","file":"chunk-3OWMPDBD.js","sourcesContent":["import type { ActorType } from \"../actions\";\nimport type { EvidencePacketReference } from \"../evidence\";\n\n/** Language-neutral governance contract version shared by TypeScript and .NET. */\nexport const FABRIC_GOVERNANCE_CONTRACT_VERSION = 1 as const;\n\nexport type ExternalResourceOperation =\n\t| \"read\"\n\t| \"create\"\n\t| \"update\"\n\t| \"delete\"\n\t| \"execute\"\n\t| \"publish\";\n\n/** Provider-neutral identity for infrastructure touched by a governed mutation. */\nexport interface ExternalResourceRef {\n\tprovider: string;\n\tresourceType: string;\n\tresourceId: string;\n\tdisplayName?: string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface MutationFootprintEntry {\n\tresource: ExternalResourceRef;\n\toperation: ExternalResourceOperation;\n\tdataClassifications?: string[];\n}\n\n/** Durable declaration of the external effects an invocation is allowed to produce. */\nexport interface MutationFootprint {\n\tversion: number;\n\tresources: MutationFootprintEntry[];\n}\n\n/** Effective execution identity, including the delegation chain that produced it. */\nexport interface ExecutionPrincipal {\n\tprincipalId: string;\n\tprincipalType: ActorType | string;\n\tprovider?: string;\n\tdelegatedBy?: ExecutionPrincipal;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport type PolicyObligationStatus = \"pending\" | \"satisfied\" | \"waived\" | \"failed\";\n\nexport interface PolicyObligation {\n\tid: string;\n\ttype: string;\n\tstatus: PolicyObligationStatus;\n\trequired?: boolean;\n\tdescription?: string;\n\tevidenceReferences?: EvidencePacketReference[];\n\tmetadata?: Record<string, unknown>;\n}\n\n/** Audit-safe proof returned by an external execution provider. */\nexport interface ExecutionAttestation {\n\tprovider: string;\n\toperation: string;\n\texternalOperationId?: string;\n\tresource?: ExternalResourceRef;\n\tevidenceReferences: EvidencePacketReference[];\n\tsatisfiesObligations?: string[];\n\tstartedAt: Date | string;\n\tcompletedAt?: Date | string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport type ReconciliationStatus = \"not_required\" | \"pending\" | \"reconciled\" | \"failed\";\n\nexport interface ExternalReconciliation {\n\tstatus: ReconciliationStatus;\n\tprovider: string;\n\texternalOperationId?: string;\n\tattempt: number;\n\treason?: string;\n\tevidenceReferences?: EvidencePacketReference[];\n\tobservedAt: Date | string;\n}\n\nexport interface MutationGovernanceContext {\n\tfootprint: MutationFootprint;\n\texecutionPrincipal: ExecutionPrincipal;\n}\n\n/** Runtime generations durably attached to every new hosted invocation. */\nexport interface GovernanceRuntimeEvidence {\n\tgovernanceContractVersion: number;\n\thostContractVersion: number;\n\thostPackageVersion?: string;\n\tproviderBridge?: {\n\t\tname: string;\n\t\tversion: string;\n\t};\n\tpolicyRulesetVersion?: string;\n}\n\nexport interface MutationGovernanceResolutionInput {\n\tactionInvocationId: string;\n\tactionId: string;\n\ttenantId: string;\n\tspaceId: string;\n\tactorId: string;\n\tactorType: ActorType;\n\tparameters: unknown;\n}\n\nexport type MutationGovernanceResolver = (\n\tinput: MutationGovernanceResolutionInput,\n) => Promise<MutationGovernanceContext> | MutationGovernanceContext;\n\nexport function assertMutationGovernanceContext(\n\tvalue: MutationGovernanceContext,\n): void {\n\tif (!Number.isInteger(value.footprint.version) || value.footprint.version < 1) {\n\t\tthrow new Error(\"Mutation footprint version must be a positive integer\");\n\t}\n\tfor (const entry of value.footprint.resources) {\n\t\tif (!entry.resource.provider.trim()) throw new Error(\"Resource provider is required\");\n\t\tif (!entry.resource.resourceType.trim()) throw new Error(\"Resource type is required\");\n\t\tif (!entry.resource.resourceId.trim()) throw new Error(\"Resource id is required\");\n\t}\n\tif (!value.executionPrincipal.principalId.trim()) {\n\t\tthrow new Error(\"Execution principal id is required\");\n\t}\n}\n\nexport function assertGovernanceRuntimeEvidence(value: GovernanceRuntimeEvidence): void {\n\tif (!Number.isInteger(value.governanceContractVersion) || value.governanceContractVersion < 1) {\n\t\tthrow new Error(\"Governance contract version must be a positive integer\");\n\t}\n\tif (!Number.isInteger(value.hostContractVersion) || value.hostContractVersion < 1) {\n\t\tthrow new Error(\"Host contract version must be a positive integer\");\n\t}\n\tif (value.providerBridge && (!value.providerBridge.name.trim() || !value.providerBridge.version.trim())) {\n\t\tthrow new Error(\"Provider bridge name and version are required\");\n\t}\n}\n"]}
@@ -0,0 +1,34 @@
1
+ 'use strict';
2
+
3
+ // governance/index.ts
4
+ var FABRIC_GOVERNANCE_CONTRACT_VERSION = 1;
5
+ function assertMutationGovernanceContext(value) {
6
+ if (!Number.isInteger(value.footprint.version) || value.footprint.version < 1) {
7
+ throw new Error("Mutation footprint version must be a positive integer");
8
+ }
9
+ for (const entry of value.footprint.resources) {
10
+ if (!entry.resource.provider.trim()) throw new Error("Resource provider is required");
11
+ if (!entry.resource.resourceType.trim()) throw new Error("Resource type is required");
12
+ if (!entry.resource.resourceId.trim()) throw new Error("Resource id is required");
13
+ }
14
+ if (!value.executionPrincipal.principalId.trim()) {
15
+ throw new Error("Execution principal id is required");
16
+ }
17
+ }
18
+ function assertGovernanceRuntimeEvidence(value) {
19
+ if (!Number.isInteger(value.governanceContractVersion) || value.governanceContractVersion < 1) {
20
+ throw new Error("Governance contract version must be a positive integer");
21
+ }
22
+ if (!Number.isInteger(value.hostContractVersion) || value.hostContractVersion < 1) {
23
+ throw new Error("Host contract version must be a positive integer");
24
+ }
25
+ if (value.providerBridge && (!value.providerBridge.name.trim() || !value.providerBridge.version.trim())) {
26
+ throw new Error("Provider bridge name and version are required");
27
+ }
28
+ }
29
+
30
+ exports.FABRIC_GOVERNANCE_CONTRACT_VERSION = FABRIC_GOVERNANCE_CONTRACT_VERSION;
31
+ exports.assertGovernanceRuntimeEvidence = assertGovernanceRuntimeEvidence;
32
+ exports.assertMutationGovernanceContext = assertMutationGovernanceContext;
33
+ //# sourceMappingURL=chunk-ANPJYXBK.cjs.map
34
+ //# sourceMappingURL=chunk-ANPJYXBK.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../governance/index.ts"],"names":[],"mappings":";;;AAIO,IAAM,kCAAA,GAAqC;AA4G3C,SAAS,gCACf,KAAA,EACO;AACP,EAAA,IAAI,CAAC,MAAA,CAAO,SAAA,CAAU,KAAA,CAAM,SAAA,CAAU,OAAO,CAAA,IAAK,KAAA,CAAM,SAAA,CAAU,OAAA,GAAU,CAAA,EAAG;AAC9E,IAAA,MAAM,IAAI,MAAM,uDAAuD,CAAA;AAAA,EACxE;AACA,EAAA,KAAA,MAAW,KAAA,IAAS,KAAA,CAAM,SAAA,CAAU,SAAA,EAAW;AAC9C,IAAA,IAAI,CAAC,MAAM,QAAA,CAAS,QAAA,CAAS,MAAK,EAAG,MAAM,IAAI,KAAA,CAAM,+BAA+B,CAAA;AACpF,IAAA,IAAI,CAAC,MAAM,QAAA,CAAS,YAAA,CAAa,MAAK,EAAG,MAAM,IAAI,KAAA,CAAM,2BAA2B,CAAA;AACpF,IAAA,IAAI,CAAC,MAAM,QAAA,CAAS,UAAA,CAAW,MAAK,EAAG,MAAM,IAAI,KAAA,CAAM,yBAAyB,CAAA;AAAA,EACjF;AACA,EAAA,IAAI,CAAC,KAAA,CAAM,kBAAA,CAAmB,WAAA,CAAY,MAAK,EAAG;AACjD,IAAA,MAAM,IAAI,MAAM,oCAAoC,CAAA;AAAA,EACrD;AACD;AAEO,SAAS,gCAAgC,KAAA,EAAwC;AACvF,EAAA,IAAI,CAAC,OAAO,SAAA,CAAU,KAAA,CAAM,yBAAyB,CAAA,IAAK,KAAA,CAAM,4BAA4B,CAAA,EAAG;AAC9F,IAAA,MAAM,IAAI,MAAM,wDAAwD,CAAA;AAAA,EACzE;AACA,EAAA,IAAI,CAAC,OAAO,SAAA,CAAU,KAAA,CAAM,mBAAmB,CAAA,IAAK,KAAA,CAAM,sBAAsB,CAAA,EAAG;AAClF,IAAA,MAAM,IAAI,MAAM,kDAAkD,CAAA;AAAA,EACnE;AACA,EAAA,IAAI,KAAA,CAAM,cAAA,KAAmB,CAAC,KAAA,CAAM,cAAA,CAAe,IAAA,CAAK,IAAA,EAAK,IAAK,CAAC,KAAA,CAAM,cAAA,CAAe,OAAA,CAAQ,MAAK,CAAA,EAAI;AACxG,IAAA,MAAM,IAAI,MAAM,+CAA+C,CAAA;AAAA,EAChE;AACD","file":"chunk-ANPJYXBK.cjs","sourcesContent":["import type { ActorType } from \"../actions\";\nimport type { EvidencePacketReference } from \"../evidence\";\n\n/** Language-neutral governance contract version shared by TypeScript and .NET. */\nexport const FABRIC_GOVERNANCE_CONTRACT_VERSION = 1 as const;\n\nexport type ExternalResourceOperation =\n\t| \"read\"\n\t| \"create\"\n\t| \"update\"\n\t| \"delete\"\n\t| \"execute\"\n\t| \"publish\";\n\n/** Provider-neutral identity for infrastructure touched by a governed mutation. */\nexport interface ExternalResourceRef {\n\tprovider: string;\n\tresourceType: string;\n\tresourceId: string;\n\tdisplayName?: string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport interface MutationFootprintEntry {\n\tresource: ExternalResourceRef;\n\toperation: ExternalResourceOperation;\n\tdataClassifications?: string[];\n}\n\n/** Durable declaration of the external effects an invocation is allowed to produce. */\nexport interface MutationFootprint {\n\tversion: number;\n\tresources: MutationFootprintEntry[];\n}\n\n/** Effective execution identity, including the delegation chain that produced it. */\nexport interface ExecutionPrincipal {\n\tprincipalId: string;\n\tprincipalType: ActorType | string;\n\tprovider?: string;\n\tdelegatedBy?: ExecutionPrincipal;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport type PolicyObligationStatus = \"pending\" | \"satisfied\" | \"waived\" | \"failed\";\n\nexport interface PolicyObligation {\n\tid: string;\n\ttype: string;\n\tstatus: PolicyObligationStatus;\n\trequired?: boolean;\n\tdescription?: string;\n\tevidenceReferences?: EvidencePacketReference[];\n\tmetadata?: Record<string, unknown>;\n}\n\n/** Audit-safe proof returned by an external execution provider. */\nexport interface ExecutionAttestation {\n\tprovider: string;\n\toperation: string;\n\texternalOperationId?: string;\n\tresource?: ExternalResourceRef;\n\tevidenceReferences: EvidencePacketReference[];\n\tsatisfiesObligations?: string[];\n\tstartedAt: Date | string;\n\tcompletedAt?: Date | string;\n\tmetadata?: Record<string, unknown>;\n}\n\nexport type ReconciliationStatus = \"not_required\" | \"pending\" | \"reconciled\" | \"failed\";\n\nexport interface ExternalReconciliation {\n\tstatus: ReconciliationStatus;\n\tprovider: string;\n\texternalOperationId?: string;\n\tattempt: number;\n\treason?: string;\n\tevidenceReferences?: EvidencePacketReference[];\n\tobservedAt: Date | string;\n}\n\nexport interface MutationGovernanceContext {\n\tfootprint: MutationFootprint;\n\texecutionPrincipal: ExecutionPrincipal;\n}\n\n/** Runtime generations durably attached to every new hosted invocation. */\nexport interface GovernanceRuntimeEvidence {\n\tgovernanceContractVersion: number;\n\thostContractVersion: number;\n\thostPackageVersion?: string;\n\tproviderBridge?: {\n\t\tname: string;\n\t\tversion: string;\n\t};\n\tpolicyRulesetVersion?: string;\n}\n\nexport interface MutationGovernanceResolutionInput {\n\tactionInvocationId: string;\n\tactionId: string;\n\ttenantId: string;\n\tspaceId: string;\n\tactorId: string;\n\tactorType: ActorType;\n\tparameters: unknown;\n}\n\nexport type MutationGovernanceResolver = (\n\tinput: MutationGovernanceResolutionInput,\n) => Promise<MutationGovernanceContext> | MutationGovernanceContext;\n\nexport function assertMutationGovernanceContext(\n\tvalue: MutationGovernanceContext,\n): void {\n\tif (!Number.isInteger(value.footprint.version) || value.footprint.version < 1) {\n\t\tthrow new Error(\"Mutation footprint version must be a positive integer\");\n\t}\n\tfor (const entry of value.footprint.resources) {\n\t\tif (!entry.resource.provider.trim()) throw new Error(\"Resource provider is required\");\n\t\tif (!entry.resource.resourceType.trim()) throw new Error(\"Resource type is required\");\n\t\tif (!entry.resource.resourceId.trim()) throw new Error(\"Resource id is required\");\n\t}\n\tif (!value.executionPrincipal.principalId.trim()) {\n\t\tthrow new Error(\"Execution principal id is required\");\n\t}\n}\n\nexport function assertGovernanceRuntimeEvidence(value: GovernanceRuntimeEvidence): void {\n\tif (!Number.isInteger(value.governanceContractVersion) || value.governanceContractVersion < 1) {\n\t\tthrow new Error(\"Governance contract version must be a positive integer\");\n\t}\n\tif (!Number.isInteger(value.hostContractVersion) || value.hostContractVersion < 1) {\n\t\tthrow new Error(\"Host contract version must be a positive integer\");\n\t}\n\tif (value.providerBridge && (!value.providerBridge.name.trim() || !value.providerBridge.version.trim())) {\n\t\tthrow new Error(\"Provider bridge name and version are required\");\n\t}\n}\n"]}
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ var chunkANPJYXBK_cjs = require('../chunk-ANPJYXBK.cjs');
4
+
5
+
6
+
7
+ Object.defineProperty(exports, "FABRIC_GOVERNANCE_CONTRACT_VERSION", {
8
+ enumerable: true,
9
+ get: function () { return chunkANPJYXBK_cjs.FABRIC_GOVERNANCE_CONTRACT_VERSION; }
10
+ });
11
+ Object.defineProperty(exports, "assertGovernanceRuntimeEvidence", {
12
+ enumerable: true,
13
+ get: function () { return chunkANPJYXBK_cjs.assertGovernanceRuntimeEvidence; }
14
+ });
15
+ Object.defineProperty(exports, "assertMutationGovernanceContext", {
16
+ enumerable: true,
17
+ get: function () { return chunkANPJYXBK_cjs.assertMutationGovernanceContext; }
18
+ });
19
+ //# sourceMappingURL=index.cjs.map
20
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,93 @@
1
+ import { ActorType } from '../actions/index.cjs';
2
+ import { EvidencePacketReference } from '../evidence/index.cjs';
3
+
4
+ /** Language-neutral governance contract version shared by TypeScript and .NET. */
5
+ declare const FABRIC_GOVERNANCE_CONTRACT_VERSION: 1;
6
+ type ExternalResourceOperation = "read" | "create" | "update" | "delete" | "execute" | "publish";
7
+ /** Provider-neutral identity for infrastructure touched by a governed mutation. */
8
+ interface ExternalResourceRef {
9
+ provider: string;
10
+ resourceType: string;
11
+ resourceId: string;
12
+ displayName?: string;
13
+ metadata?: Record<string, unknown>;
14
+ }
15
+ interface MutationFootprintEntry {
16
+ resource: ExternalResourceRef;
17
+ operation: ExternalResourceOperation;
18
+ dataClassifications?: string[];
19
+ }
20
+ /** Durable declaration of the external effects an invocation is allowed to produce. */
21
+ interface MutationFootprint {
22
+ version: number;
23
+ resources: MutationFootprintEntry[];
24
+ }
25
+ /** Effective execution identity, including the delegation chain that produced it. */
26
+ interface ExecutionPrincipal {
27
+ principalId: string;
28
+ principalType: ActorType | string;
29
+ provider?: string;
30
+ delegatedBy?: ExecutionPrincipal;
31
+ metadata?: Record<string, unknown>;
32
+ }
33
+ type PolicyObligationStatus = "pending" | "satisfied" | "waived" | "failed";
34
+ interface PolicyObligation {
35
+ id: string;
36
+ type: string;
37
+ status: PolicyObligationStatus;
38
+ required?: boolean;
39
+ description?: string;
40
+ evidenceReferences?: EvidencePacketReference[];
41
+ metadata?: Record<string, unknown>;
42
+ }
43
+ /** Audit-safe proof returned by an external execution provider. */
44
+ interface ExecutionAttestation {
45
+ provider: string;
46
+ operation: string;
47
+ externalOperationId?: string;
48
+ resource?: ExternalResourceRef;
49
+ evidenceReferences: EvidencePacketReference[];
50
+ satisfiesObligations?: string[];
51
+ startedAt: Date | string;
52
+ completedAt?: Date | string;
53
+ metadata?: Record<string, unknown>;
54
+ }
55
+ type ReconciliationStatus = "not_required" | "pending" | "reconciled" | "failed";
56
+ interface ExternalReconciliation {
57
+ status: ReconciliationStatus;
58
+ provider: string;
59
+ externalOperationId?: string;
60
+ attempt: number;
61
+ reason?: string;
62
+ evidenceReferences?: EvidencePacketReference[];
63
+ observedAt: Date | string;
64
+ }
65
+ interface MutationGovernanceContext {
66
+ footprint: MutationFootprint;
67
+ executionPrincipal: ExecutionPrincipal;
68
+ }
69
+ /** Runtime generations durably attached to every new hosted invocation. */
70
+ interface GovernanceRuntimeEvidence {
71
+ governanceContractVersion: number;
72
+ hostContractVersion: number;
73
+ hostPackageVersion?: string;
74
+ providerBridge?: {
75
+ name: string;
76
+ version: string;
77
+ };
78
+ policyRulesetVersion?: string;
79
+ }
80
+ interface MutationGovernanceResolutionInput {
81
+ actionInvocationId: string;
82
+ actionId: string;
83
+ tenantId: string;
84
+ spaceId: string;
85
+ actorId: string;
86
+ actorType: ActorType;
87
+ parameters: unknown;
88
+ }
89
+ type MutationGovernanceResolver = (input: MutationGovernanceResolutionInput) => Promise<MutationGovernanceContext> | MutationGovernanceContext;
90
+ declare function assertMutationGovernanceContext(value: MutationGovernanceContext): void;
91
+ declare function assertGovernanceRuntimeEvidence(value: GovernanceRuntimeEvidence): void;
92
+
93
+ export { type ExecutionAttestation, type ExecutionPrincipal, type ExternalReconciliation, type ExternalResourceOperation, type ExternalResourceRef, FABRIC_GOVERNANCE_CONTRACT_VERSION, type GovernanceRuntimeEvidence, type MutationFootprint, type MutationFootprintEntry, type MutationGovernanceContext, type MutationGovernanceResolutionInput, type MutationGovernanceResolver, type PolicyObligation, type PolicyObligationStatus, type ReconciliationStatus, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext };
@@ -0,0 +1,93 @@
1
+ import { ActorType } from '../actions/index.js';
2
+ import { EvidencePacketReference } from '../evidence/index.js';
3
+
4
+ /** Language-neutral governance contract version shared by TypeScript and .NET. */
5
+ declare const FABRIC_GOVERNANCE_CONTRACT_VERSION: 1;
6
+ type ExternalResourceOperation = "read" | "create" | "update" | "delete" | "execute" | "publish";
7
+ /** Provider-neutral identity for infrastructure touched by a governed mutation. */
8
+ interface ExternalResourceRef {
9
+ provider: string;
10
+ resourceType: string;
11
+ resourceId: string;
12
+ displayName?: string;
13
+ metadata?: Record<string, unknown>;
14
+ }
15
+ interface MutationFootprintEntry {
16
+ resource: ExternalResourceRef;
17
+ operation: ExternalResourceOperation;
18
+ dataClassifications?: string[];
19
+ }
20
+ /** Durable declaration of the external effects an invocation is allowed to produce. */
21
+ interface MutationFootprint {
22
+ version: number;
23
+ resources: MutationFootprintEntry[];
24
+ }
25
+ /** Effective execution identity, including the delegation chain that produced it. */
26
+ interface ExecutionPrincipal {
27
+ principalId: string;
28
+ principalType: ActorType | string;
29
+ provider?: string;
30
+ delegatedBy?: ExecutionPrincipal;
31
+ metadata?: Record<string, unknown>;
32
+ }
33
+ type PolicyObligationStatus = "pending" | "satisfied" | "waived" | "failed";
34
+ interface PolicyObligation {
35
+ id: string;
36
+ type: string;
37
+ status: PolicyObligationStatus;
38
+ required?: boolean;
39
+ description?: string;
40
+ evidenceReferences?: EvidencePacketReference[];
41
+ metadata?: Record<string, unknown>;
42
+ }
43
+ /** Audit-safe proof returned by an external execution provider. */
44
+ interface ExecutionAttestation {
45
+ provider: string;
46
+ operation: string;
47
+ externalOperationId?: string;
48
+ resource?: ExternalResourceRef;
49
+ evidenceReferences: EvidencePacketReference[];
50
+ satisfiesObligations?: string[];
51
+ startedAt: Date | string;
52
+ completedAt?: Date | string;
53
+ metadata?: Record<string, unknown>;
54
+ }
55
+ type ReconciliationStatus = "not_required" | "pending" | "reconciled" | "failed";
56
+ interface ExternalReconciliation {
57
+ status: ReconciliationStatus;
58
+ provider: string;
59
+ externalOperationId?: string;
60
+ attempt: number;
61
+ reason?: string;
62
+ evidenceReferences?: EvidencePacketReference[];
63
+ observedAt: Date | string;
64
+ }
65
+ interface MutationGovernanceContext {
66
+ footprint: MutationFootprint;
67
+ executionPrincipal: ExecutionPrincipal;
68
+ }
69
+ /** Runtime generations durably attached to every new hosted invocation. */
70
+ interface GovernanceRuntimeEvidence {
71
+ governanceContractVersion: number;
72
+ hostContractVersion: number;
73
+ hostPackageVersion?: string;
74
+ providerBridge?: {
75
+ name: string;
76
+ version: string;
77
+ };
78
+ policyRulesetVersion?: string;
79
+ }
80
+ interface MutationGovernanceResolutionInput {
81
+ actionInvocationId: string;
82
+ actionId: string;
83
+ tenantId: string;
84
+ spaceId: string;
85
+ actorId: string;
86
+ actorType: ActorType;
87
+ parameters: unknown;
88
+ }
89
+ type MutationGovernanceResolver = (input: MutationGovernanceResolutionInput) => Promise<MutationGovernanceContext> | MutationGovernanceContext;
90
+ declare function assertMutationGovernanceContext(value: MutationGovernanceContext): void;
91
+ declare function assertGovernanceRuntimeEvidence(value: GovernanceRuntimeEvidence): void;
92
+
93
+ export { type ExecutionAttestation, type ExecutionPrincipal, type ExternalReconciliation, type ExternalResourceOperation, type ExternalResourceRef, FABRIC_GOVERNANCE_CONTRACT_VERSION, type GovernanceRuntimeEvidence, type MutationFootprint, type MutationFootprintEntry, type MutationGovernanceContext, type MutationGovernanceResolutionInput, type MutationGovernanceResolver, type PolicyObligation, type PolicyObligationStatus, type ReconciliationStatus, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext };
@@ -0,0 +1,3 @@
1
+ export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from '../chunk-3OWMPDBD.js';
2
+ //# sourceMappingURL=index.js.map
3
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/dist/index.cjs CHANGED
@@ -1,5 +1,6 @@
1
1
  'use strict';
2
2
 
3
+ var chunkLZSE6QGQ_cjs = require('./chunk-LZSE6QGQ.cjs');
3
4
  var chunkSSYKDXR4_cjs = require('./chunk-SSYKDXR4.cjs');
4
5
  var chunkQETQGAXJ_cjs = require('./chunk-QETQGAXJ.cjs');
5
6
  var chunkNJL3US7H_cjs = require('./chunk-NJL3US7H.cjs');
@@ -13,10 +14,26 @@ var chunkF3E5SXPN_cjs = require('./chunk-F3E5SXPN.cjs');
13
14
  var chunkEO4VSB2O_cjs = require('./chunk-EO4VSB2O.cjs');
14
15
  var chunkJAXDEK5Z_cjs = require('./chunk-JAXDEK5Z.cjs');
15
16
  require('./chunk-PG5LYTUX.cjs');
16
- var chunkLZSE6QGQ_cjs = require('./chunk-LZSE6QGQ.cjs');
17
+ var chunkANPJYXBK_cjs = require('./chunk-ANPJYXBK.cjs');
17
18
 
18
19
 
19
20
 
21
+ Object.defineProperty(exports, "FABRIC_ID_PREFIXES", {
22
+ enumerable: true,
23
+ get: function () { return chunkLZSE6QGQ_cjs.FABRIC_ID_PREFIXES; }
24
+ });
25
+ Object.defineProperty(exports, "createFabricId", {
26
+ enumerable: true,
27
+ get: function () { return chunkLZSE6QGQ_cjs.createFabricId; }
28
+ });
29
+ Object.defineProperty(exports, "isFabricId", {
30
+ enumerable: true,
31
+ get: function () { return chunkLZSE6QGQ_cjs.isFabricId; }
32
+ });
33
+ Object.defineProperty(exports, "parseFabricId", {
34
+ enumerable: true,
35
+ get: function () { return chunkLZSE6QGQ_cjs.parseFabricId; }
36
+ });
20
37
  Object.defineProperty(exports, "createModuleRegistry", {
21
38
  enumerable: true,
22
39
  get: function () { return chunkSSYKDXR4_cjs.createModuleRegistry; }
@@ -289,21 +306,17 @@ Object.defineProperty(exports, "registerSubjectType", {
289
306
  enumerable: true,
290
307
  get: function () { return chunkJAXDEK5Z_cjs.registerSubjectType; }
291
308
  });
292
- Object.defineProperty(exports, "FABRIC_ID_PREFIXES", {
293
- enumerable: true,
294
- get: function () { return chunkLZSE6QGQ_cjs.FABRIC_ID_PREFIXES; }
295
- });
296
- Object.defineProperty(exports, "createFabricId", {
309
+ Object.defineProperty(exports, "FABRIC_GOVERNANCE_CONTRACT_VERSION", {
297
310
  enumerable: true,
298
- get: function () { return chunkLZSE6QGQ_cjs.createFabricId; }
311
+ get: function () { return chunkANPJYXBK_cjs.FABRIC_GOVERNANCE_CONTRACT_VERSION; }
299
312
  });
300
- Object.defineProperty(exports, "isFabricId", {
313
+ Object.defineProperty(exports, "assertGovernanceRuntimeEvidence", {
301
314
  enumerable: true,
302
- get: function () { return chunkLZSE6QGQ_cjs.isFabricId; }
315
+ get: function () { return chunkANPJYXBK_cjs.assertGovernanceRuntimeEvidence; }
303
316
  });
304
- Object.defineProperty(exports, "parseFabricId", {
317
+ Object.defineProperty(exports, "assertMutationGovernanceContext", {
305
318
  enumerable: true,
306
- get: function () { return chunkLZSE6QGQ_cjs.parseFabricId; }
319
+ get: function () { return chunkANPJYXBK_cjs.assertMutationGovernanceContext; }
307
320
  });
308
321
  //# sourceMappingURL=index.cjs.map
309
322
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -10,5 +10,6 @@ export { ReplayEventsOptions, ReplayEventsResult, ReplayScope, ReplaySnapshot, R
10
10
  export { CachedDisplayDescriptor, DisplayContext, DisplayDatabaseClient, DisplayDescriptor, DisplayRenderer, DisplayRendererRegistration, denormalizeDisplaySnapshot, registerDisplayRenderer, renderEventDisplay, resolveDisplayRenderer } from './displays/index.cjs';
11
11
  export { ANONYMIZATION_POLICY_VERSION, AnalyticsDataContract, AnalyticsDataContractSource, AnalyticsEligibilityDecision, AnonymizationContext, AnonymizationEngine, AnonymizationFieldMetadata, AnonymizationLifecycleEvidence, AnonymizationMetadata, AnonymizationResult, AssetEventLike, DataClassificationRule, EvidencePacketLike, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, PlatformDataClass, RedactionMethod, RedactionRule, RetentionRule, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum } from './privacy/index.cjs';
12
12
  export { EvidenceGenerationContext, EvidencePacketEnvelope, EvidencePacketReference, EvidencePacketStatus, EvidencePacketSubject, EvidenceRenderer } from './evidence/index.cjs';
13
+ export { ExecutionAttestation, ExecutionPrincipal, ExternalReconciliation, ExternalResourceOperation, ExternalResourceRef, FABRIC_GOVERNANCE_CONTRACT_VERSION, GovernanceRuntimeEvidence, MutationFootprint, MutationFootprintEntry, MutationGovernanceContext, MutationGovernanceResolutionInput, MutationGovernanceResolver, PolicyObligation, PolicyObligationStatus, ReconciliationStatus, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from './governance/index.cjs';
13
14
  export { AgentActionPolicyContext, AgentActionPolicyDecision, AgentActionPolicyDefinition, AgentActionPolicyEvaluator, AgentActionPolicyRegistry, AgentActionRiskTier, AgentActionRoute } from './agent-hitl/index.cjs';
14
15
  export { FakeActionContextOptions, createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from './testing/index.cjs';
package/dist/index.d.ts CHANGED
@@ -10,5 +10,6 @@ export { ReplayEventsOptions, ReplayEventsResult, ReplayScope, ReplaySnapshot, R
10
10
  export { CachedDisplayDescriptor, DisplayContext, DisplayDatabaseClient, DisplayDescriptor, DisplayRenderer, DisplayRendererRegistration, denormalizeDisplaySnapshot, registerDisplayRenderer, renderEventDisplay, resolveDisplayRenderer } from './displays/index.js';
11
11
  export { ANONYMIZATION_POLICY_VERSION, AnalyticsDataContract, AnalyticsDataContractSource, AnalyticsEligibilityDecision, AnonymizationContext, AnonymizationEngine, AnonymizationFieldMetadata, AnonymizationLifecycleEvidence, AnonymizationMetadata, AnonymizationResult, AssetEventLike, DataClassificationRule, EvidencePacketLike, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, PlatformDataClass, RedactionMethod, RedactionRule, RetentionRule, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum } from './privacy/index.js';
12
12
  export { EvidenceGenerationContext, EvidencePacketEnvelope, EvidencePacketReference, EvidencePacketStatus, EvidencePacketSubject, EvidenceRenderer } from './evidence/index.js';
13
+ export { ExecutionAttestation, ExecutionPrincipal, ExternalReconciliation, ExternalResourceOperation, ExternalResourceRef, FABRIC_GOVERNANCE_CONTRACT_VERSION, GovernanceRuntimeEvidence, MutationFootprint, MutationFootprintEntry, MutationGovernanceContext, MutationGovernanceResolutionInput, MutationGovernanceResolver, PolicyObligation, PolicyObligationStatus, ReconciliationStatus, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from './governance/index.js';
13
14
  export { AgentActionPolicyContext, AgentActionPolicyDecision, AgentActionPolicyDefinition, AgentActionPolicyEvaluator, AgentActionPolicyRegistry, AgentActionRiskTier, AgentActionRoute } from './agent-hitl/index.js';
14
15
  export { FakeActionContextOptions, createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from './testing/index.js';
package/dist/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ export { FABRIC_ID_PREFIXES, createFabricId, isFabricId, parseFabricId } from './chunk-RALMUSOX.js';
1
2
  export { createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateModuleNamespace } from './chunk-35DD3H55.js';
2
3
  export { assertObjectType, getRegisteredObjectTypes, isValidObjectType, registerObjectType } from './chunk-I35B576X.js';
3
4
  export { aggregatePolicyOutcomes, assertPolicyId, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, getRegisteredPolicyIds, registerPolicy, registerPolicyIfMissing, resolvePolicy, validateDataPolicyDefinition, validatePolicyGuidance } from './chunk-6ER62UUN.js';
@@ -11,6 +12,6 @@ export { AgentActionPolicyRegistry } from './chunk-OFCCZ27Z.js';
11
12
  export { denormalizeDisplaySnapshot, registerDisplayRenderer, renderEventDisplay, resolveDisplayRenderer } from './chunk-O5WVBQ7P.js';
12
13
  export { createEventTypeRegistry, getRegisteredEventTypes, getRegisteredSubjectTypes, isValidEventType, isValidSubjectType, registerEventType, registerSubjectType } from './chunk-4YQOGV7H.js';
13
14
  import './chunk-OZLZHISS.js';
14
- export { FABRIC_ID_PREFIXES, createFabricId, isFabricId, parseFabricId } from './chunk-RALMUSOX.js';
15
+ export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from './chunk-3OWMPDBD.js';
15
16
  //# sourceMappingURL=index.js.map
16
17
  //# sourceMappingURL=index.js.map
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabricorg/platform",
3
- "version": "0.7.0",
3
+ "version": "0.9.0",
4
4
  "description": "Generic, vertical-agnostic runtime for ontology-based business applications. Provides actions, modules, events, policies, state machines, adapters, displays, projections, privacy, and evidence contracts. Zero runtime dependencies; portable across any database client and any vertical (lending, insurance, healthcare, legal, etc.).",
5
5
  "keywords": [
6
6
  "fabric",
@@ -98,6 +98,16 @@
98
98
  "default": "./dist/evidence/index.cjs"
99
99
  }
100
100
  },
101
+ "./governance": {
102
+ "import": {
103
+ "types": "./dist/governance/index.d.ts",
104
+ "default": "./dist/governance/index.js"
105
+ },
106
+ "require": {
107
+ "types": "./dist/governance/index.d.cts",
108
+ "default": "./dist/governance/index.cjs"
109
+ }
110
+ },
101
111
  "./ids": {
102
112
  "import": {
103
113
  "types": "./dist/ids/index.d.ts",