@fabricorg/platform 0.8.0 → 0.10.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.
@@ -1,6 +1,8 @@
1
1
  import { ActorType } from '../actions/index.cjs';
2
2
  import { EvidencePacketReference } from '../evidence/index.cjs';
3
3
 
4
+ /** Language-neutral governance contract version shared by TypeScript and .NET. */
5
+ declare const FABRIC_GOVERNANCE_CONTRACT_VERSION: 1;
4
6
  type ExternalResourceOperation = "read" | "create" | "update" | "delete" | "execute" | "publish";
5
7
  /** Provider-neutral identity for infrastructure touched by a governed mutation. */
6
8
  interface ExternalResourceRef {
@@ -64,6 +66,17 @@ interface MutationGovernanceContext {
64
66
  footprint: MutationFootprint;
65
67
  executionPrincipal: ExecutionPrincipal;
66
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
+ }
67
80
  interface MutationGovernanceResolutionInput {
68
81
  actionInvocationId: string;
69
82
  actionId: string;
@@ -75,5 +88,6 @@ interface MutationGovernanceResolutionInput {
75
88
  }
76
89
  type MutationGovernanceResolver = (input: MutationGovernanceResolutionInput) => Promise<MutationGovernanceContext> | MutationGovernanceContext;
77
90
  declare function assertMutationGovernanceContext(value: MutationGovernanceContext): void;
91
+ declare function assertGovernanceRuntimeEvidence(value: GovernanceRuntimeEvidence): void;
78
92
 
79
- export { type ExecutionAttestation, type ExecutionPrincipal, type ExternalReconciliation, type ExternalResourceOperation, type ExternalResourceRef, type MutationFootprint, type MutationFootprintEntry, type MutationGovernanceContext, type MutationGovernanceResolutionInput, type MutationGovernanceResolver, type PolicyObligation, type PolicyObligationStatus, type ReconciliationStatus, assertMutationGovernanceContext };
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 };
@@ -1,6 +1,8 @@
1
1
  import { ActorType } from '../actions/index.js';
2
2
  import { EvidencePacketReference } from '../evidence/index.js';
3
3
 
4
+ /** Language-neutral governance contract version shared by TypeScript and .NET. */
5
+ declare const FABRIC_GOVERNANCE_CONTRACT_VERSION: 1;
4
6
  type ExternalResourceOperation = "read" | "create" | "update" | "delete" | "execute" | "publish";
5
7
  /** Provider-neutral identity for infrastructure touched by a governed mutation. */
6
8
  interface ExternalResourceRef {
@@ -64,6 +66,17 @@ interface MutationGovernanceContext {
64
66
  footprint: MutationFootprint;
65
67
  executionPrincipal: ExecutionPrincipal;
66
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
+ }
67
80
  interface MutationGovernanceResolutionInput {
68
81
  actionInvocationId: string;
69
82
  actionId: string;
@@ -75,5 +88,6 @@ interface MutationGovernanceResolutionInput {
75
88
  }
76
89
  type MutationGovernanceResolver = (input: MutationGovernanceResolutionInput) => Promise<MutationGovernanceContext> | MutationGovernanceContext;
77
90
  declare function assertMutationGovernanceContext(value: MutationGovernanceContext): void;
91
+ declare function assertGovernanceRuntimeEvidence(value: GovernanceRuntimeEvidence): void;
78
92
 
79
- export { type ExecutionAttestation, type ExecutionPrincipal, type ExternalReconciliation, type ExternalResourceOperation, type ExternalResourceRef, type MutationFootprint, type MutationFootprintEntry, type MutationGovernanceContext, type MutationGovernanceResolutionInput, type MutationGovernanceResolver, type PolicyObligation, type PolicyObligationStatus, type ReconciliationStatus, assertMutationGovernanceContext };
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 };
@@ -1,3 +1,3 @@
1
- export { assertMutationGovernanceContext } from '../chunk-WGJBT66A.js';
1
+ export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from '../chunk-3OWMPDBD.js';
2
2
  //# sourceMappingURL=index.js.map
3
3
  //# sourceMappingURL=index.js.map
package/dist/index.cjs CHANGED
@@ -1,23 +1,36 @@
1
1
  'use strict';
2
2
 
3
+ var chunkYZKUEC2J_cjs = require('./chunk-YZKUEC2J.cjs');
3
4
  var chunkLZSE6QGQ_cjs = require('./chunk-LZSE6QGQ.cjs');
5
+ var chunk54EQTOH6_cjs = require('./chunk-54EQTOH6.cjs');
4
6
  var chunkSSYKDXR4_cjs = require('./chunk-SSYKDXR4.cjs');
5
7
  var chunkQETQGAXJ_cjs = require('./chunk-QETQGAXJ.cjs');
6
8
  var chunkNJL3US7H_cjs = require('./chunk-NJL3US7H.cjs');
7
9
  var chunkYQEXO3IQ_cjs = require('./chunk-YQEXO3IQ.cjs');
8
10
  var chunkQ3WYIWCN_cjs = require('./chunk-Q3WYIWCN.cjs');
9
11
  var chunkUV252FLT_cjs = require('./chunk-UV252FLT.cjs');
10
- var chunkYZKUEC2J_cjs = require('./chunk-YZKUEC2J.cjs');
11
12
  var chunkBWNPGRRV_cjs = require('./chunk-BWNPGRRV.cjs');
12
13
  var chunkNPVIFZQV_cjs = require('./chunk-NPVIFZQV.cjs');
13
14
  var chunkF3E5SXPN_cjs = require('./chunk-F3E5SXPN.cjs');
14
15
  var chunkEO4VSB2O_cjs = require('./chunk-EO4VSB2O.cjs');
15
16
  var chunkJAXDEK5Z_cjs = require('./chunk-JAXDEK5Z.cjs');
16
17
  require('./chunk-PG5LYTUX.cjs');
17
- var chunkC72F6IRQ_cjs = require('./chunk-C72F6IRQ.cjs');
18
+ var chunkANPJYXBK_cjs = require('./chunk-ANPJYXBK.cjs');
18
19
 
19
20
 
20
21
 
22
+ Object.defineProperty(exports, "createDeterministicIdFactory", {
23
+ enumerable: true,
24
+ get: function () { return chunkYZKUEC2J_cjs.createDeterministicIdFactory; }
25
+ });
26
+ Object.defineProperty(exports, "createFakeActionContext", {
27
+ enumerable: true,
28
+ get: function () { return chunkYZKUEC2J_cjs.createFakeActionContext; }
29
+ });
30
+ Object.defineProperty(exports, "createInMemoryAdapterRegistry", {
31
+ enumerable: true,
32
+ get: function () { return chunkYZKUEC2J_cjs.createInMemoryAdapterRegistry; }
33
+ });
21
34
  Object.defineProperty(exports, "FABRIC_ID_PREFIXES", {
22
35
  enumerable: true,
23
36
  get: function () { return chunkLZSE6QGQ_cjs.FABRIC_ID_PREFIXES; }
@@ -34,6 +47,22 @@ Object.defineProperty(exports, "parseFabricId", {
34
47
  enumerable: true,
35
48
  get: function () { return chunkLZSE6QGQ_cjs.parseFabricId; }
36
49
  });
50
+ Object.defineProperty(exports, "MODULE_MANIFEST_VERSION", {
51
+ enumerable: true,
52
+ get: function () { return chunk54EQTOH6_cjs.MODULE_MANIFEST_VERSION; }
53
+ });
54
+ Object.defineProperty(exports, "exportModuleManifest", {
55
+ enumerable: true,
56
+ get: function () { return chunk54EQTOH6_cjs.exportModuleManifest; }
57
+ });
58
+ Object.defineProperty(exports, "exportModuleManifestBundle", {
59
+ enumerable: true,
60
+ get: function () { return chunk54EQTOH6_cjs.exportModuleManifestBundle; }
61
+ });
62
+ Object.defineProperty(exports, "isJsonSchemaExportableValidator", {
63
+ enumerable: true,
64
+ get: function () { return chunk54EQTOH6_cjs.isJsonSchemaExportableValidator; }
65
+ });
37
66
  Object.defineProperty(exports, "createModuleRegistry", {
38
67
  enumerable: true,
39
68
  get: function () { return chunkSSYKDXR4_cjs.createModuleRegistry; }
@@ -186,18 +215,6 @@ Object.defineProperty(exports, "validateTransition", {
186
215
  enumerable: true,
187
216
  get: function () { return chunkUV252FLT_cjs.validateTransition; }
188
217
  });
189
- Object.defineProperty(exports, "createDeterministicIdFactory", {
190
- enumerable: true,
191
- get: function () { return chunkYZKUEC2J_cjs.createDeterministicIdFactory; }
192
- });
193
- Object.defineProperty(exports, "createFakeActionContext", {
194
- enumerable: true,
195
- get: function () { return chunkYZKUEC2J_cjs.createFakeActionContext; }
196
- });
197
- Object.defineProperty(exports, "createInMemoryAdapterRegistry", {
198
- enumerable: true,
199
- get: function () { return chunkYZKUEC2J_cjs.createInMemoryAdapterRegistry; }
200
- });
201
218
  Object.defineProperty(exports, "ACTOR_TYPES", {
202
219
  enumerable: true,
203
220
  get: function () { return chunkBWNPGRRV_cjs.ACTOR_TYPES; }
@@ -306,9 +323,17 @@ Object.defineProperty(exports, "registerSubjectType", {
306
323
  enumerable: true,
307
324
  get: function () { return chunkJAXDEK5Z_cjs.registerSubjectType; }
308
325
  });
326
+ Object.defineProperty(exports, "FABRIC_GOVERNANCE_CONTRACT_VERSION", {
327
+ enumerable: true,
328
+ get: function () { return chunkANPJYXBK_cjs.FABRIC_GOVERNANCE_CONTRACT_VERSION; }
329
+ });
330
+ Object.defineProperty(exports, "assertGovernanceRuntimeEvidence", {
331
+ enumerable: true,
332
+ get: function () { return chunkANPJYXBK_cjs.assertGovernanceRuntimeEvidence; }
333
+ });
309
334
  Object.defineProperty(exports, "assertMutationGovernanceContext", {
310
335
  enumerable: true,
311
- get: function () { return chunkC72F6IRQ_cjs.assertMutationGovernanceContext; }
336
+ get: function () { return chunkANPJYXBK_cjs.assertMutationGovernanceContext; }
312
337
  });
313
338
  //# sourceMappingURL=index.cjs.map
314
339
  //# sourceMappingURL=index.cjs.map
package/dist/index.d.cts CHANGED
@@ -2,6 +2,7 @@ export { ACTOR_TYPES, ActionContext, ActionDefinition, ActionHandler, ActionId,
2
2
  export { AdapterAttempt, AdapterCircuitBreakerConfig, AdapterExecutionContext, AdapterExecutionResult, AdapterExecutor, AdapterImplementation, AdapterRegistry, AdapterRetryPolicy, ExecuteWithRetryOptions, MissingAdapterRegistrationError, ResolvedAdapterRetryPolicy, executeWithAdapterRetry, getRetryDelayMs, resolveAdapterRetryPolicy } from './adapters/index.cjs';
3
3
  export { AssetEventActorType, AssetEventEnvelope, AssetEventSubjectType, AssetEventType, EventTypeRegistry, createEventTypeRegistry, getRegisteredEventTypes, getRegisteredSubjectTypes, isValidEventType, isValidSubjectType, registerEventType, registerSubjectType } from './events/index.cjs';
4
4
  export { FABRIC_ID_PREFIXES, FabricIdPrefix, createFabricId, isFabricId, parseFabricId } from './ids/index.cjs';
5
+ export { JsonSchemaExportableValidator, MODULE_MANIFEST_VERSION, ModuleManifest, ModuleManifestAction, ModuleManifestActionStateMachine, ModuleManifestAdapterStep, ModuleManifestBundle, ModuleManifestCodePolicy, ModuleManifestDataPolicy, ModuleManifestEventType, ModuleManifestIdPrefix, ModuleManifestObjectType, ModuleManifestPolicy, ModuleManifestStateMachine, ModuleManifestStateMachineTransition, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator } from './manifest/index.cjs';
5
6
  export { EventTypeRegistration, EventTypeRegistrationInput, FabricModule, IdPrefixRegistration, ModuleDependency, ModuleDependencyInput, ModuleDisplayRendererRegistration, ModuleRegistry, ObjectTypeRegistration, ObjectTypeRegistrationInput, PolicyRegistration, StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateModuleNamespace } from './modules/index.cjs';
6
7
  export { FabricObjectType, assertObjectType, getRegisteredObjectTypes, isValidObjectType, registerObjectType } from './objects/index.cjs';
7
8
  export { DataPolicyComparisonOperator, DataPolicyCondition, DataPolicyConditionResult, DataPolicyDefinition, DataPolicyLiteral, DataPolicySource, DataPolicySourceReference, DataPolicyValidationResult, PolicyContext, PolicyCorrectiveAction, PolicyCorrectiveActionBase, PolicyCorrectiveActionKind, PolicyDispatchEvidence, PolicyEvaluationMode, PolicyEvaluationResult, PolicyEvaluator, PolicyFact, PolicyFallbackDefinition, PolicyFallbackTrigger, PolicyGuidance, PolicyGuidanceValidationResult, PolicyId, PolicyInvokeActionCorrectiveAction, PolicyKind, PolicyManualCorrectiveAction, PolicyNavigateCorrectiveAction, PolicyOutcome, RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, getRegisteredPolicyIds, registerPolicy, registerPolicyIfMissing, resolvePolicy, validateDataPolicyDefinition, validatePolicyGuidance } from './policies/index.cjs';
@@ -10,6 +11,6 @@ export { ReplayEventsOptions, ReplayEventsResult, ReplayScope, ReplaySnapshot, R
10
11
  export { CachedDisplayDescriptor, DisplayContext, DisplayDatabaseClient, DisplayDescriptor, DisplayRenderer, DisplayRendererRegistration, denormalizeDisplaySnapshot, registerDisplayRenderer, renderEventDisplay, resolveDisplayRenderer } from './displays/index.cjs';
11
12
  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
13
  export { EvidenceGenerationContext, EvidencePacketEnvelope, EvidencePacketReference, EvidencePacketStatus, EvidencePacketSubject, EvidenceRenderer } from './evidence/index.cjs';
13
- export { ExecutionAttestation, ExecutionPrincipal, ExternalReconciliation, ExternalResourceOperation, ExternalResourceRef, MutationFootprint, MutationFootprintEntry, MutationGovernanceContext, MutationGovernanceResolutionInput, MutationGovernanceResolver, PolicyObligation, PolicyObligationStatus, ReconciliationStatus, assertMutationGovernanceContext } from './governance/index.cjs';
14
+ 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';
14
15
  export { AgentActionPolicyContext, AgentActionPolicyDecision, AgentActionPolicyDefinition, AgentActionPolicyEvaluator, AgentActionPolicyRegistry, AgentActionRiskTier, AgentActionRoute } from './agent-hitl/index.cjs';
15
16
  export { FakeActionContextOptions, createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from './testing/index.cjs';
package/dist/index.d.ts CHANGED
@@ -2,6 +2,7 @@ export { ACTOR_TYPES, ActionContext, ActionDefinition, ActionHandler, ActionId,
2
2
  export { AdapterAttempt, AdapterCircuitBreakerConfig, AdapterExecutionContext, AdapterExecutionResult, AdapterExecutor, AdapterImplementation, AdapterRegistry, AdapterRetryPolicy, ExecuteWithRetryOptions, MissingAdapterRegistrationError, ResolvedAdapterRetryPolicy, executeWithAdapterRetry, getRetryDelayMs, resolveAdapterRetryPolicy } from './adapters/index.js';
3
3
  export { AssetEventActorType, AssetEventEnvelope, AssetEventSubjectType, AssetEventType, EventTypeRegistry, createEventTypeRegistry, getRegisteredEventTypes, getRegisteredSubjectTypes, isValidEventType, isValidSubjectType, registerEventType, registerSubjectType } from './events/index.js';
4
4
  export { FABRIC_ID_PREFIXES, FabricIdPrefix, createFabricId, isFabricId, parseFabricId } from './ids/index.js';
5
+ export { JsonSchemaExportableValidator, MODULE_MANIFEST_VERSION, ModuleManifest, ModuleManifestAction, ModuleManifestActionStateMachine, ModuleManifestAdapterStep, ModuleManifestBundle, ModuleManifestCodePolicy, ModuleManifestDataPolicy, ModuleManifestEventType, ModuleManifestIdPrefix, ModuleManifestObjectType, ModuleManifestPolicy, ModuleManifestStateMachine, ModuleManifestStateMachineTransition, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator } from './manifest/index.js';
5
6
  export { EventTypeRegistration, EventTypeRegistrationInput, FabricModule, IdPrefixRegistration, ModuleDependency, ModuleDependencyInput, ModuleDisplayRendererRegistration, ModuleRegistry, ObjectTypeRegistration, ObjectTypeRegistrationInput, PolicyRegistration, StateMachineRegistration, createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateModuleNamespace } from './modules/index.js';
6
7
  export { FabricObjectType, assertObjectType, getRegisteredObjectTypes, isValidObjectType, registerObjectType } from './objects/index.js';
7
8
  export { DataPolicyComparisonOperator, DataPolicyCondition, DataPolicyConditionResult, DataPolicyDefinition, DataPolicyLiteral, DataPolicySource, DataPolicySourceReference, DataPolicyValidationResult, PolicyContext, PolicyCorrectiveAction, PolicyCorrectiveActionBase, PolicyCorrectiveActionKind, PolicyDispatchEvidence, PolicyEvaluationMode, PolicyEvaluationResult, PolicyEvaluator, PolicyFact, PolicyFallbackDefinition, PolicyFallbackTrigger, PolicyGuidance, PolicyGuidanceValidationResult, PolicyId, PolicyInvokeActionCorrectiveAction, PolicyKind, PolicyManualCorrectiveAction, PolicyNavigateCorrectiveAction, PolicyOutcome, RuntimePolicyDefinition, aggregatePolicyOutcomes, assertPolicyId, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, getRegisteredPolicyIds, registerPolicy, registerPolicyIfMissing, resolvePolicy, validateDataPolicyDefinition, validatePolicyGuidance } from './policies/index.js';
@@ -10,6 +11,6 @@ export { ReplayEventsOptions, ReplayEventsResult, ReplayScope, ReplaySnapshot, R
10
11
  export { CachedDisplayDescriptor, DisplayContext, DisplayDatabaseClient, DisplayDescriptor, DisplayRenderer, DisplayRendererRegistration, denormalizeDisplaySnapshot, registerDisplayRenderer, renderEventDisplay, resolveDisplayRenderer } from './displays/index.js';
11
12
  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
13
  export { EvidenceGenerationContext, EvidencePacketEnvelope, EvidencePacketReference, EvidencePacketStatus, EvidencePacketSubject, EvidenceRenderer } from './evidence/index.js';
13
- export { ExecutionAttestation, ExecutionPrincipal, ExternalReconciliation, ExternalResourceOperation, ExternalResourceRef, MutationFootprint, MutationFootprintEntry, MutationGovernanceContext, MutationGovernanceResolutionInput, MutationGovernanceResolver, PolicyObligation, PolicyObligationStatus, ReconciliationStatus, assertMutationGovernanceContext } from './governance/index.js';
14
+ 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';
14
15
  export { AgentActionPolicyContext, AgentActionPolicyDecision, AgentActionPolicyDefinition, AgentActionPolicyEvaluator, AgentActionPolicyRegistry, AgentActionRiskTier, AgentActionRoute } from './agent-hitl/index.js';
15
16
  export { FakeActionContextOptions, createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from './testing/index.js';
package/dist/index.js CHANGED
@@ -1,17 +1,18 @@
1
+ export { createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from './chunk-IFMZPLM4.js';
1
2
  export { FABRIC_ID_PREFIXES, createFabricId, isFabricId, parseFabricId } from './chunk-RALMUSOX.js';
3
+ export { MODULE_MANIFEST_VERSION, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator } from './chunk-N72WJ4AU.js';
2
4
  export { createModuleRegistry, getEventTypeName, getModuleDependencyNamespace, getObjectTypeName, registerFabricModule, registerFabricModules, validateModuleNamespace } from './chunk-35DD3H55.js';
3
5
  export { assertObjectType, getRegisteredObjectTypes, isValidObjectType, registerObjectType } from './chunk-I35B576X.js';
4
6
  export { aggregatePolicyOutcomes, assertPolicyId, evaluatePolicyDefinition, evaluatePolicyDefinitions, evaluateRegisteredPolicies, getRegisteredPolicyIds, registerPolicy, registerPolicyIfMissing, resolvePolicy, validateDataPolicyDefinition, validatePolicyGuidance } from './chunk-6ER62UUN.js';
5
7
  export { ANONYMIZATION_POLICY_VERSION, AnonymizationEngine, FieldRedactor, PLATFORM_PRIVACY_POLICY_VERSION, anonymizeAssetEventPayload, anonymizeEvidencePacket, anonymizeJsonValue, buildAnonymizationLifecycleEvidence, stableChecksum } from './chunk-X7WC4AYC.js';
6
8
  export { replayEvents } from './chunk-JSTGOT6P.js';
7
9
  export { getAllowedTransitions, getEntityStateClass, registerStateMachine, registerStateMachineIfMissing, resolveStateMachine, validateTransition } from './chunk-T2JLSZN6.js';
8
- export { createDeterministicIdFactory, createFakeActionContext, createInMemoryAdapterRegistry } from './chunk-IFMZPLM4.js';
9
10
  export { ACTOR_TYPES, assertActionId, assertActorType, getRegisteredActionIds, isActorType, isRegisteredActionId, registerAction, registerActionIfMissing, resolveAction, resolveRegisteredAction } from './chunk-4SMPJPJ6.js';
10
11
  export { AdapterRegistry, MissingAdapterRegistrationError, executeWithAdapterRetry, getRetryDelayMs, resolveAdapterRetryPolicy } from './chunk-3ZW5USXF.js';
11
12
  export { AgentActionPolicyRegistry } from './chunk-OFCCZ27Z.js';
12
13
  export { denormalizeDisplaySnapshot, registerDisplayRenderer, renderEventDisplay, resolveDisplayRenderer } from './chunk-O5WVBQ7P.js';
13
14
  export { createEventTypeRegistry, getRegisteredEventTypes, getRegisteredSubjectTypes, isValidEventType, isValidSubjectType, registerEventType, registerSubjectType } from './chunk-4YQOGV7H.js';
14
15
  import './chunk-OZLZHISS.js';
15
- export { assertMutationGovernanceContext } from './chunk-WGJBT66A.js';
16
+ export { FABRIC_GOVERNANCE_CONTRACT_VERSION, assertGovernanceRuntimeEvidence, assertMutationGovernanceContext } from './chunk-3OWMPDBD.js';
16
17
  //# sourceMappingURL=index.js.map
17
18
  //# sourceMappingURL=index.js.map
@@ -0,0 +1,31 @@
1
+ 'use strict';
2
+
3
+ var chunk54EQTOH6_cjs = require('../chunk-54EQTOH6.cjs');
4
+ require('../chunk-SSYKDXR4.cjs');
5
+ require('../chunk-QETQGAXJ.cjs');
6
+ require('../chunk-NJL3US7H.cjs');
7
+ require('../chunk-UV252FLT.cjs');
8
+ require('../chunk-BWNPGRRV.cjs');
9
+ require('../chunk-EO4VSB2O.cjs');
10
+ require('../chunk-JAXDEK5Z.cjs');
11
+
12
+
13
+
14
+ Object.defineProperty(exports, "MODULE_MANIFEST_VERSION", {
15
+ enumerable: true,
16
+ get: function () { return chunk54EQTOH6_cjs.MODULE_MANIFEST_VERSION; }
17
+ });
18
+ Object.defineProperty(exports, "exportModuleManifest", {
19
+ enumerable: true,
20
+ get: function () { return chunk54EQTOH6_cjs.exportModuleManifest; }
21
+ });
22
+ Object.defineProperty(exports, "exportModuleManifestBundle", {
23
+ enumerable: true,
24
+ get: function () { return chunk54EQTOH6_cjs.exportModuleManifestBundle; }
25
+ });
26
+ Object.defineProperty(exports, "isJsonSchemaExportableValidator", {
27
+ enumerable: true,
28
+ get: function () { return chunk54EQTOH6_cjs.isJsonSchemaExportableValidator; }
29
+ });
30
+ //# sourceMappingURL=index.cjs.map
31
+ //# sourceMappingURL=index.cjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.cjs"}
@@ -0,0 +1,145 @@
1
+ import { SchemaValidator, AdapterStepRetryPolicy } from '../actions/index.cjs';
2
+ import { ModuleDependency, FabricModule } from '../modules/index.cjs';
3
+ import { PolicyKind, DataPolicyDefinition, PolicyFallbackDefinition } from '../policies/index.cjs';
4
+ import { StateDefinition } from '../state-machines/index.cjs';
5
+ import '../displays/index.cjs';
6
+
7
+ /**
8
+ * Version of the module manifest contract. Bump when the serialized shape
9
+ * changes in a way consumers must detect.
10
+ */
11
+ declare const MODULE_MANIFEST_VERSION: 1;
12
+ interface ModuleManifestObjectType {
13
+ type: string;
14
+ displayName?: string;
15
+ idPrefix?: string;
16
+ }
17
+ interface ModuleManifestIdPrefix {
18
+ prefix: string;
19
+ name: string;
20
+ }
21
+ interface ModuleManifestEventType {
22
+ eventType: string;
23
+ schemaVersion: number;
24
+ description?: string;
25
+ }
26
+ interface ModuleManifestActionStateMachine {
27
+ entityType: string;
28
+ /** Present only when the binding declares a static target state. */
29
+ targetState?: string;
30
+ }
31
+ interface ModuleManifestAdapterStep {
32
+ adapterType: string;
33
+ operation: string;
34
+ retryPolicy?: AdapterStepRetryPolicy;
35
+ }
36
+ interface ModuleManifestAction {
37
+ actionId: string;
38
+ version: number;
39
+ kind: "atomic" | "saga";
40
+ idempotent: boolean;
41
+ mutatesDomain: boolean;
42
+ emitsEvents: string[];
43
+ policies?: string[];
44
+ requiredRoles?: string[];
45
+ requiredPermissions?: string[];
46
+ eventPhase?: "before_adapters" | "after_adapters";
47
+ /**
48
+ * JSON Schema for the action parameters, present only when the action's
49
+ * `schema` validator implements {@link JsonSchemaExportableValidator}.
50
+ */
51
+ parameterSchema?: unknown;
52
+ parameterSchemaFormat?: "json-schema";
53
+ stateMachine?: ModuleManifestActionStateMachine;
54
+ adapterSteps?: ModuleManifestAdapterStep[];
55
+ }
56
+ interface ModuleManifestCodePolicy {
57
+ type: "code";
58
+ policyId: string;
59
+ version: number;
60
+ previewSafe?: boolean;
61
+ }
62
+ interface ModuleManifestDataPolicy {
63
+ type: "data";
64
+ policyId: string;
65
+ policyVersion: number;
66
+ kind: PolicyKind;
67
+ dataDefinition?: DataPolicyDefinition;
68
+ codeEvaluatorPolicyId?: string;
69
+ fallback?: PolicyFallbackDefinition;
70
+ }
71
+ type ModuleManifestPolicy = ModuleManifestCodePolicy | ModuleManifestDataPolicy;
72
+ interface ModuleManifestStateMachineTransition {
73
+ from: string;
74
+ to: string;
75
+ causedByAction: string;
76
+ /** `true` when the transition declares a guard function. The guard itself is never serialized. */
77
+ hasGuard: boolean;
78
+ }
79
+ interface ModuleManifestStateMachine {
80
+ entityType: string;
81
+ /** States in declaration order (`Object.values` order of the definition record). */
82
+ states: StateDefinition[];
83
+ transitions: ModuleManifestStateMachineTransition[];
84
+ }
85
+ /**
86
+ * Stable, JSON-serializable description of a {@link FabricModule}'s ontology:
87
+ * object types, subject types, id prefixes, event types, actions, policies,
88
+ * and state machines. Intended for downstream tooling (semantics exporters,
89
+ * docs generators, tool generators) that cannot consume live module code.
90
+ *
91
+ * The manifest contains definitions only — never raw parameter values,
92
+ * secrets, or runtime data. Function fields (`handler`, `evaluate`, `guard`,
93
+ * dynamic `targetState`, adapter `getInput`) are never serialized.
94
+ */
95
+ interface ModuleManifest {
96
+ manifestVersion: typeof MODULE_MANIFEST_VERSION;
97
+ namespace: string;
98
+ version?: string;
99
+ displayName?: string;
100
+ description?: string;
101
+ dependencies: ModuleDependency[];
102
+ objectTypes: ModuleManifestObjectType[];
103
+ subjectTypes: string[];
104
+ idPrefixes: ModuleManifestIdPrefix[];
105
+ eventTypes: ModuleManifestEventType[];
106
+ actions: ModuleManifestAction[];
107
+ policies: ModuleManifestPolicy[];
108
+ stateMachines: ModuleManifestStateMachine[];
109
+ }
110
+ interface ModuleManifestBundle {
111
+ manifestVersion: typeof MODULE_MANIFEST_VERSION;
112
+ /** Manifests in the input module order. */
113
+ modules: ModuleManifest[];
114
+ }
115
+ /**
116
+ * A {@link SchemaValidator} that can also export its parameter schema as JSON
117
+ * Schema (for example a Zod 4 schema via `z.toJSONSchema`). Keeps the platform
118
+ * zero-dependency while letting schema-bearing actions flow into manifests.
119
+ */
120
+ interface JsonSchemaExportableValidator extends SchemaValidator {
121
+ toJSONSchema(): Record<string, unknown>;
122
+ }
123
+ declare function isJsonSchemaExportableValidator(schema: SchemaValidator): schema is JsonSchemaExportableValidator;
124
+ /**
125
+ * Export a stable, JSON-serializable manifest of a module's ontology.
126
+ *
127
+ * This is a pure function of the module object: it does not read or mutate the
128
+ * global module/action/policy/state-machine registries, and the module does
129
+ * not need to be registered first. Declaration order is preserved everywhere
130
+ * (nothing is sorted), so the same module object always produces a
131
+ * byte-identical `JSON.stringify` result.
132
+ *
133
+ * The manifest contains definitions only — never raw parameter values,
134
+ * secrets, or runtime data. Function fields are elided (`handler`,
135
+ * policy `evaluate`, transition `guard` → `hasGuard`, dynamic `targetState`,
136
+ * adapter `getInput`).
137
+ */
138
+ declare function exportModuleManifest(module: FabricModule<unknown>): ModuleManifest;
139
+ /**
140
+ * Export manifests for a set of modules, preserving the input order.
141
+ * Like {@link exportModuleManifest}, this is pure and registry-free.
142
+ */
143
+ declare function exportModuleManifestBundle(modules: FabricModule<unknown>[]): ModuleManifestBundle;
144
+
145
+ export { type JsonSchemaExportableValidator, MODULE_MANIFEST_VERSION, type ModuleManifest, type ModuleManifestAction, type ModuleManifestActionStateMachine, type ModuleManifestAdapterStep, type ModuleManifestBundle, type ModuleManifestCodePolicy, type ModuleManifestDataPolicy, type ModuleManifestEventType, type ModuleManifestIdPrefix, type ModuleManifestObjectType, type ModuleManifestPolicy, type ModuleManifestStateMachine, type ModuleManifestStateMachineTransition, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator };
@@ -0,0 +1,145 @@
1
+ import { SchemaValidator, AdapterStepRetryPolicy } from '../actions/index.js';
2
+ import { ModuleDependency, FabricModule } from '../modules/index.js';
3
+ import { PolicyKind, DataPolicyDefinition, PolicyFallbackDefinition } from '../policies/index.js';
4
+ import { StateDefinition } from '../state-machines/index.js';
5
+ import '../displays/index.js';
6
+
7
+ /**
8
+ * Version of the module manifest contract. Bump when the serialized shape
9
+ * changes in a way consumers must detect.
10
+ */
11
+ declare const MODULE_MANIFEST_VERSION: 1;
12
+ interface ModuleManifestObjectType {
13
+ type: string;
14
+ displayName?: string;
15
+ idPrefix?: string;
16
+ }
17
+ interface ModuleManifestIdPrefix {
18
+ prefix: string;
19
+ name: string;
20
+ }
21
+ interface ModuleManifestEventType {
22
+ eventType: string;
23
+ schemaVersion: number;
24
+ description?: string;
25
+ }
26
+ interface ModuleManifestActionStateMachine {
27
+ entityType: string;
28
+ /** Present only when the binding declares a static target state. */
29
+ targetState?: string;
30
+ }
31
+ interface ModuleManifestAdapterStep {
32
+ adapterType: string;
33
+ operation: string;
34
+ retryPolicy?: AdapterStepRetryPolicy;
35
+ }
36
+ interface ModuleManifestAction {
37
+ actionId: string;
38
+ version: number;
39
+ kind: "atomic" | "saga";
40
+ idempotent: boolean;
41
+ mutatesDomain: boolean;
42
+ emitsEvents: string[];
43
+ policies?: string[];
44
+ requiredRoles?: string[];
45
+ requiredPermissions?: string[];
46
+ eventPhase?: "before_adapters" | "after_adapters";
47
+ /**
48
+ * JSON Schema for the action parameters, present only when the action's
49
+ * `schema` validator implements {@link JsonSchemaExportableValidator}.
50
+ */
51
+ parameterSchema?: unknown;
52
+ parameterSchemaFormat?: "json-schema";
53
+ stateMachine?: ModuleManifestActionStateMachine;
54
+ adapterSteps?: ModuleManifestAdapterStep[];
55
+ }
56
+ interface ModuleManifestCodePolicy {
57
+ type: "code";
58
+ policyId: string;
59
+ version: number;
60
+ previewSafe?: boolean;
61
+ }
62
+ interface ModuleManifestDataPolicy {
63
+ type: "data";
64
+ policyId: string;
65
+ policyVersion: number;
66
+ kind: PolicyKind;
67
+ dataDefinition?: DataPolicyDefinition;
68
+ codeEvaluatorPolicyId?: string;
69
+ fallback?: PolicyFallbackDefinition;
70
+ }
71
+ type ModuleManifestPolicy = ModuleManifestCodePolicy | ModuleManifestDataPolicy;
72
+ interface ModuleManifestStateMachineTransition {
73
+ from: string;
74
+ to: string;
75
+ causedByAction: string;
76
+ /** `true` when the transition declares a guard function. The guard itself is never serialized. */
77
+ hasGuard: boolean;
78
+ }
79
+ interface ModuleManifestStateMachine {
80
+ entityType: string;
81
+ /** States in declaration order (`Object.values` order of the definition record). */
82
+ states: StateDefinition[];
83
+ transitions: ModuleManifestStateMachineTransition[];
84
+ }
85
+ /**
86
+ * Stable, JSON-serializable description of a {@link FabricModule}'s ontology:
87
+ * object types, subject types, id prefixes, event types, actions, policies,
88
+ * and state machines. Intended for downstream tooling (semantics exporters,
89
+ * docs generators, tool generators) that cannot consume live module code.
90
+ *
91
+ * The manifest contains definitions only — never raw parameter values,
92
+ * secrets, or runtime data. Function fields (`handler`, `evaluate`, `guard`,
93
+ * dynamic `targetState`, adapter `getInput`) are never serialized.
94
+ */
95
+ interface ModuleManifest {
96
+ manifestVersion: typeof MODULE_MANIFEST_VERSION;
97
+ namespace: string;
98
+ version?: string;
99
+ displayName?: string;
100
+ description?: string;
101
+ dependencies: ModuleDependency[];
102
+ objectTypes: ModuleManifestObjectType[];
103
+ subjectTypes: string[];
104
+ idPrefixes: ModuleManifestIdPrefix[];
105
+ eventTypes: ModuleManifestEventType[];
106
+ actions: ModuleManifestAction[];
107
+ policies: ModuleManifestPolicy[];
108
+ stateMachines: ModuleManifestStateMachine[];
109
+ }
110
+ interface ModuleManifestBundle {
111
+ manifestVersion: typeof MODULE_MANIFEST_VERSION;
112
+ /** Manifests in the input module order. */
113
+ modules: ModuleManifest[];
114
+ }
115
+ /**
116
+ * A {@link SchemaValidator} that can also export its parameter schema as JSON
117
+ * Schema (for example a Zod 4 schema via `z.toJSONSchema`). Keeps the platform
118
+ * zero-dependency while letting schema-bearing actions flow into manifests.
119
+ */
120
+ interface JsonSchemaExportableValidator extends SchemaValidator {
121
+ toJSONSchema(): Record<string, unknown>;
122
+ }
123
+ declare function isJsonSchemaExportableValidator(schema: SchemaValidator): schema is JsonSchemaExportableValidator;
124
+ /**
125
+ * Export a stable, JSON-serializable manifest of a module's ontology.
126
+ *
127
+ * This is a pure function of the module object: it does not read or mutate the
128
+ * global module/action/policy/state-machine registries, and the module does
129
+ * not need to be registered first. Declaration order is preserved everywhere
130
+ * (nothing is sorted), so the same module object always produces a
131
+ * byte-identical `JSON.stringify` result.
132
+ *
133
+ * The manifest contains definitions only — never raw parameter values,
134
+ * secrets, or runtime data. Function fields are elided (`handler`,
135
+ * policy `evaluate`, transition `guard` → `hasGuard`, dynamic `targetState`,
136
+ * adapter `getInput`).
137
+ */
138
+ declare function exportModuleManifest(module: FabricModule<unknown>): ModuleManifest;
139
+ /**
140
+ * Export manifests for a set of modules, preserving the input order.
141
+ * Like {@link exportModuleManifest}, this is pure and registry-free.
142
+ */
143
+ declare function exportModuleManifestBundle(modules: FabricModule<unknown>[]): ModuleManifestBundle;
144
+
145
+ export { type JsonSchemaExportableValidator, MODULE_MANIFEST_VERSION, type ModuleManifest, type ModuleManifestAction, type ModuleManifestActionStateMachine, type ModuleManifestAdapterStep, type ModuleManifestBundle, type ModuleManifestCodePolicy, type ModuleManifestDataPolicy, type ModuleManifestEventType, type ModuleManifestIdPrefix, type ModuleManifestObjectType, type ModuleManifestPolicy, type ModuleManifestStateMachine, type ModuleManifestStateMachineTransition, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator };
@@ -0,0 +1,10 @@
1
+ export { MODULE_MANIFEST_VERSION, exportModuleManifest, exportModuleManifestBundle, isJsonSchemaExportableValidator } from '../chunk-N72WJ4AU.js';
2
+ import '../chunk-35DD3H55.js';
3
+ import '../chunk-I35B576X.js';
4
+ import '../chunk-6ER62UUN.js';
5
+ import '../chunk-T2JLSZN6.js';
6
+ import '../chunk-4SMPJPJ6.js';
7
+ import '../chunk-O5WVBQ7P.js';
8
+ import '../chunk-4YQOGV7H.js';
9
+ //# sourceMappingURL=index.js.map
10
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":[],"names":[],"mappings":"","file":"index.js"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fabricorg/platform",
3
- "version": "0.8.0",
3
+ "version": "0.10.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",
@@ -118,6 +118,16 @@
118
118
  "default": "./dist/ids/index.cjs"
119
119
  }
120
120
  },
121
+ "./manifest": {
122
+ "import": {
123
+ "types": "./dist/manifest/index.d.ts",
124
+ "default": "./dist/manifest/index.js"
125
+ },
126
+ "require": {
127
+ "types": "./dist/manifest/index.d.cts",
128
+ "default": "./dist/manifest/index.cjs"
129
+ }
130
+ },
121
131
  "./modules": {
122
132
  "import": {
123
133
  "types": "./dist/modules/index.d.ts",
@@ -1,20 +0,0 @@
1
- 'use strict';
2
-
3
- // governance/index.ts
4
- function assertMutationGovernanceContext(value) {
5
- if (!Number.isInteger(value.footprint.version) || value.footprint.version < 1) {
6
- throw new Error("Mutation footprint version must be a positive integer");
7
- }
8
- for (const entry of value.footprint.resources) {
9
- if (!entry.resource.provider.trim()) throw new Error("Resource provider is required");
10
- if (!entry.resource.resourceType.trim()) throw new Error("Resource type is required");
11
- if (!entry.resource.resourceId.trim()) throw new Error("Resource id is required");
12
- }
13
- if (!value.executionPrincipal.principalId.trim()) {
14
- throw new Error("Execution principal id is required");
15
- }
16
- }
17
-
18
- exports.assertMutationGovernanceContext = assertMutationGovernanceContext;
19
- //# sourceMappingURL=chunk-C72F6IRQ.cjs.map
20
- //# sourceMappingURL=chunk-C72F6IRQ.cjs.map
@@ -1 +0,0 @@
1
- {"version":3,"sources":["../governance/index.ts"],"names":[],"mappings":";;;AAiGO,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","file":"chunk-C72F6IRQ.cjs","sourcesContent":["import type { ActorType } from \"../actions\";\nimport type { EvidencePacketReference } from \"../evidence\";\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\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"]}