@fabricorg/platform-host 0.4.3 → 0.5.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 +6 -0
- package/README.md +12 -0
- package/dist/index.cjs +260 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +80 -4
- package/dist/index.d.ts +80 -4
- package/dist/index.js +261 -3
- package/dist/index.js.map +1 -1
- package/package.json +66 -62
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, PolicyOutcome, AssetEventEnvelope, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
1
|
+
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, MutationFootprint, ExecutionPrincipal, PolicyOutcome, AssetEventEnvelope, ExecutionAttestation, ExternalReconciliation, PolicyObligation, PolicyObligationStatus, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, MutationGovernanceResolver, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
2
2
|
|
|
3
3
|
interface PendingAssetEvent {
|
|
4
4
|
eventType: string;
|
|
@@ -29,6 +29,8 @@ interface ActionInvocationRecord {
|
|
|
29
29
|
hitlReason?: string;
|
|
30
30
|
hitlPolicyVersion?: string;
|
|
31
31
|
approvalDecision?: PersistedActionApprovalDecision;
|
|
32
|
+
mutationFootprint?: MutationFootprint;
|
|
33
|
+
executionPrincipal?: ExecutionPrincipal;
|
|
32
34
|
error?: string;
|
|
33
35
|
createdAt: Date;
|
|
34
36
|
updatedAt: Date;
|
|
@@ -59,6 +61,27 @@ interface PolicyEvaluationRecord {
|
|
|
59
61
|
outcome: PolicyOutcome;
|
|
60
62
|
createdAt: Date;
|
|
61
63
|
}
|
|
64
|
+
interface PolicyObligationRecord extends PolicyObligation {
|
|
65
|
+
actionInvocationId: string;
|
|
66
|
+
tenantId: string;
|
|
67
|
+
spaceId: string;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
updatedAt: Date;
|
|
70
|
+
}
|
|
71
|
+
interface ExecutionAttestationRecord extends ExecutionAttestation {
|
|
72
|
+
id: string;
|
|
73
|
+
actionInvocationId: string;
|
|
74
|
+
tenantId: string;
|
|
75
|
+
spaceId: string;
|
|
76
|
+
adapterInvocationId?: string;
|
|
77
|
+
recordedAt: Date;
|
|
78
|
+
}
|
|
79
|
+
interface ExternalReconciliationRecord extends ExternalReconciliation {
|
|
80
|
+
id: string;
|
|
81
|
+
actionInvocationId: string;
|
|
82
|
+
tenantId: string;
|
|
83
|
+
spaceId: string;
|
|
84
|
+
}
|
|
62
85
|
type AdapterInvocationStatus = "running" | "succeeded" | "failed";
|
|
63
86
|
interface AdapterInvocationRecord {
|
|
64
87
|
id: string;
|
|
@@ -110,6 +133,19 @@ interface ApprovalPlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
|
110
133
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
111
134
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
112
135
|
}
|
|
136
|
+
/** Optional durable capabilities used when external-governance enrichment is configured. */
|
|
137
|
+
interface GovernancePlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
138
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
139
|
+
footprint: MutationFootprint;
|
|
140
|
+
executionPrincipal: ExecutionPrincipal;
|
|
141
|
+
}): Promise<ActionInvocationRecord>;
|
|
142
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
143
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
144
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationStatus, evidenceReferences?: PolicyObligation["evidenceReferences"]): Promise<void>;
|
|
145
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
146
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
147
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
148
|
+
}
|
|
113
149
|
interface ListActionInvocationsInput {
|
|
114
150
|
tenantId?: string;
|
|
115
151
|
spaceId?: string;
|
|
@@ -227,6 +263,21 @@ interface PlatformHostOptions<TDb> {
|
|
|
227
263
|
hitlEvaluator?: AgentActionPolicyEvaluator;
|
|
228
264
|
/** Durable evaluator/ruleset version recorded with every HITL decision. */
|
|
229
265
|
hitlPolicyVersion?: string;
|
|
266
|
+
/** Optional portable resolver; provider-specific implementations belong in integration packages. */
|
|
267
|
+
resolveMutationGovernance?: MutationGovernanceResolver;
|
|
268
|
+
/** Translate policy outcomes into durable, enforceable obligations. */
|
|
269
|
+
resolvePolicyObligations?: (outcomes: readonly PolicyOutcome[]) => Promise<PolicyObligation[]> | PolicyObligation[];
|
|
270
|
+
/** Translate a successful adapter result into audit-safe external execution evidence. */
|
|
271
|
+
extractExecutionAttestation?: (input: {
|
|
272
|
+
actionInvocationId: string;
|
|
273
|
+
adapterInvocationId: string;
|
|
274
|
+
adapterType: string;
|
|
275
|
+
operation: string;
|
|
276
|
+
vendor: string;
|
|
277
|
+
startedAt: Date;
|
|
278
|
+
completedAt: Date;
|
|
279
|
+
output: Record<string, unknown>;
|
|
280
|
+
}) => Promise<ExecutionAttestation | undefined> | ExecutionAttestation | undefined;
|
|
230
281
|
/** Lease held while an approved invocation resumes; defaults to five minutes. */
|
|
231
282
|
approvalResumeLeaseDurationMs?: number;
|
|
232
283
|
/** Remove forbidden/sensitive fields before durable invocation persistence. */
|
|
@@ -248,16 +299,21 @@ interface GovernedActionHost {
|
|
|
248
299
|
submitAction(input: SubmitActionInput): Promise<SubmitActionResult>;
|
|
249
300
|
executeInvocation(actionInvocationId: string, tenantId: string, spaceId: string, options?: ExecuteInvocationOptions): Promise<ExecuteActionResult>;
|
|
250
301
|
resumeApprovedInvocation(actionInvocationId: string, tenantId: string, spaceId: string, decision: ActionApprovalDecision): Promise<ExecuteActionResult>;
|
|
302
|
+
recordExecutionAttestation(actionInvocationId: string, tenantId: string, spaceId: string, attestation: ExecutionAttestation): Promise<void>;
|
|
303
|
+
recordExternalReconciliation(actionInvocationId: string, tenantId: string, spaceId: string, reconciliation: ExternalReconciliation): Promise<void>;
|
|
251
304
|
}
|
|
252
305
|
|
|
253
306
|
declare function createGovernedActionHost<TDb>(options: PlatformHostOptions<TDb>): GovernedActionHost;
|
|
254
307
|
|
|
255
|
-
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
308
|
+
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
256
309
|
readonly db: TDb;
|
|
257
310
|
readonly invocations: ActionInvocationRecord[];
|
|
258
311
|
readonly policyEvaluations: PolicyEvaluationRecord[];
|
|
259
312
|
readonly adapterInvocations: AdapterInvocationRecord[];
|
|
260
313
|
readonly events: AssetEventEnvelope[];
|
|
314
|
+
readonly policyObligations: PolicyObligationRecord[];
|
|
315
|
+
readonly executionAttestations: ExecutionAttestationRecord[];
|
|
316
|
+
readonly externalReconciliations: ExternalReconciliationRecord[];
|
|
261
317
|
constructor(db: TDb);
|
|
262
318
|
transaction<TResult>(run: (db: TDb) => Promise<TResult>): Promise<TResult>;
|
|
263
319
|
createActionInvocation(input: CreateActionInvocationInput): Promise<ActionInvocationRecord>;
|
|
@@ -266,6 +322,16 @@ declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostSto
|
|
|
266
322
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
267
323
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
268
324
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
325
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: Pick<ActionInvocationRecord, "mutationFootprint" | "executionPrincipal"> & {
|
|
326
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
327
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
328
|
+
}): Promise<ActionInvocationRecord>;
|
|
329
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
330
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
331
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
332
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
333
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
334
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
269
335
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
270
336
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
271
337
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -285,7 +351,7 @@ interface PlatformHostSqlClient {
|
|
|
285
351
|
query<Row = Record<string, unknown>>(sql: string, values?: unknown[]): Promise<PlatformHostSqlResult<Row>>;
|
|
286
352
|
}
|
|
287
353
|
/** Durable mutation-pipeline ledger for Databricks Lakebase or standard Postgres. */
|
|
288
|
-
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
354
|
+
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
289
355
|
readonly db: TDb;
|
|
290
356
|
private readonly sql;
|
|
291
357
|
constructor(db: TDb, sql: PlatformHostSqlClient);
|
|
@@ -297,6 +363,16 @@ declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostS
|
|
|
297
363
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
298
364
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
299
365
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
366
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
367
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
368
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
369
|
+
}): Promise<ActionInvocationRecord>;
|
|
370
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
371
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
372
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
373
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
374
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
375
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
300
376
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
301
377
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
302
378
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -318,4 +394,4 @@ declare function runPlatformActionWorkerCycle<TDb>(options: PlatformActionWorker
|
|
|
318
394
|
/** Poll until aborted. Each iteration is bounded and waits without busy-spinning. */
|
|
319
395
|
declare function runPlatformActionWorker<TDb>(options: PlatformActionWorkerOptions<TDb>): Promise<void>;
|
|
320
396
|
|
|
321
|
-
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|
|
397
|
+
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type ExecutionAttestationRecord, type ExternalReconciliationRecord, type GovernancePlatformHostStore, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, type PolicyObligationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, PolicyOutcome, AssetEventEnvelope, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
1
|
+
import { ActorType, ActionId, ActionStatus, AgentActionRoute, AgentActionRiskTier, MutationFootprint, ExecutionPrincipal, PolicyOutcome, AssetEventEnvelope, ExecutionAttestation, ExternalReconciliation, PolicyObligation, PolicyObligationStatus, ActionDefinition, AdapterImplementation, FabricRuntimeServices, AgentActionPolicyEvaluator, MutationGovernanceResolver, RuntimePolicyDefinition } from '@fabricorg/platform';
|
|
2
2
|
|
|
3
3
|
interface PendingAssetEvent {
|
|
4
4
|
eventType: string;
|
|
@@ -29,6 +29,8 @@ interface ActionInvocationRecord {
|
|
|
29
29
|
hitlReason?: string;
|
|
30
30
|
hitlPolicyVersion?: string;
|
|
31
31
|
approvalDecision?: PersistedActionApprovalDecision;
|
|
32
|
+
mutationFootprint?: MutationFootprint;
|
|
33
|
+
executionPrincipal?: ExecutionPrincipal;
|
|
32
34
|
error?: string;
|
|
33
35
|
createdAt: Date;
|
|
34
36
|
updatedAt: Date;
|
|
@@ -59,6 +61,27 @@ interface PolicyEvaluationRecord {
|
|
|
59
61
|
outcome: PolicyOutcome;
|
|
60
62
|
createdAt: Date;
|
|
61
63
|
}
|
|
64
|
+
interface PolicyObligationRecord extends PolicyObligation {
|
|
65
|
+
actionInvocationId: string;
|
|
66
|
+
tenantId: string;
|
|
67
|
+
spaceId: string;
|
|
68
|
+
createdAt: Date;
|
|
69
|
+
updatedAt: Date;
|
|
70
|
+
}
|
|
71
|
+
interface ExecutionAttestationRecord extends ExecutionAttestation {
|
|
72
|
+
id: string;
|
|
73
|
+
actionInvocationId: string;
|
|
74
|
+
tenantId: string;
|
|
75
|
+
spaceId: string;
|
|
76
|
+
adapterInvocationId?: string;
|
|
77
|
+
recordedAt: Date;
|
|
78
|
+
}
|
|
79
|
+
interface ExternalReconciliationRecord extends ExternalReconciliation {
|
|
80
|
+
id: string;
|
|
81
|
+
actionInvocationId: string;
|
|
82
|
+
tenantId: string;
|
|
83
|
+
spaceId: string;
|
|
84
|
+
}
|
|
62
85
|
type AdapterInvocationStatus = "running" | "succeeded" | "failed";
|
|
63
86
|
interface AdapterInvocationRecord {
|
|
64
87
|
id: string;
|
|
@@ -110,6 +133,19 @@ interface ApprovalPlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
|
110
133
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
111
134
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
112
135
|
}
|
|
136
|
+
/** Optional durable capabilities used when external-governance enrichment is configured. */
|
|
137
|
+
interface GovernancePlatformHostStore<TDb> extends PlatformHostStore<TDb> {
|
|
138
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
139
|
+
footprint: MutationFootprint;
|
|
140
|
+
executionPrincipal: ExecutionPrincipal;
|
|
141
|
+
}): Promise<ActionInvocationRecord>;
|
|
142
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
143
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
144
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationStatus, evidenceReferences?: PolicyObligation["evidenceReferences"]): Promise<void>;
|
|
145
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
146
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
147
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
148
|
+
}
|
|
113
149
|
interface ListActionInvocationsInput {
|
|
114
150
|
tenantId?: string;
|
|
115
151
|
spaceId?: string;
|
|
@@ -227,6 +263,21 @@ interface PlatformHostOptions<TDb> {
|
|
|
227
263
|
hitlEvaluator?: AgentActionPolicyEvaluator;
|
|
228
264
|
/** Durable evaluator/ruleset version recorded with every HITL decision. */
|
|
229
265
|
hitlPolicyVersion?: string;
|
|
266
|
+
/** Optional portable resolver; provider-specific implementations belong in integration packages. */
|
|
267
|
+
resolveMutationGovernance?: MutationGovernanceResolver;
|
|
268
|
+
/** Translate policy outcomes into durable, enforceable obligations. */
|
|
269
|
+
resolvePolicyObligations?: (outcomes: readonly PolicyOutcome[]) => Promise<PolicyObligation[]> | PolicyObligation[];
|
|
270
|
+
/** Translate a successful adapter result into audit-safe external execution evidence. */
|
|
271
|
+
extractExecutionAttestation?: (input: {
|
|
272
|
+
actionInvocationId: string;
|
|
273
|
+
adapterInvocationId: string;
|
|
274
|
+
adapterType: string;
|
|
275
|
+
operation: string;
|
|
276
|
+
vendor: string;
|
|
277
|
+
startedAt: Date;
|
|
278
|
+
completedAt: Date;
|
|
279
|
+
output: Record<string, unknown>;
|
|
280
|
+
}) => Promise<ExecutionAttestation | undefined> | ExecutionAttestation | undefined;
|
|
230
281
|
/** Lease held while an approved invocation resumes; defaults to five minutes. */
|
|
231
282
|
approvalResumeLeaseDurationMs?: number;
|
|
232
283
|
/** Remove forbidden/sensitive fields before durable invocation persistence. */
|
|
@@ -248,16 +299,21 @@ interface GovernedActionHost {
|
|
|
248
299
|
submitAction(input: SubmitActionInput): Promise<SubmitActionResult>;
|
|
249
300
|
executeInvocation(actionInvocationId: string, tenantId: string, spaceId: string, options?: ExecuteInvocationOptions): Promise<ExecuteActionResult>;
|
|
250
301
|
resumeApprovedInvocation(actionInvocationId: string, tenantId: string, spaceId: string, decision: ActionApprovalDecision): Promise<ExecuteActionResult>;
|
|
302
|
+
recordExecutionAttestation(actionInvocationId: string, tenantId: string, spaceId: string, attestation: ExecutionAttestation): Promise<void>;
|
|
303
|
+
recordExternalReconciliation(actionInvocationId: string, tenantId: string, spaceId: string, reconciliation: ExternalReconciliation): Promise<void>;
|
|
251
304
|
}
|
|
252
305
|
|
|
253
306
|
declare function createGovernedActionHost<TDb>(options: PlatformHostOptions<TDb>): GovernedActionHost;
|
|
254
307
|
|
|
255
|
-
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
308
|
+
declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
256
309
|
readonly db: TDb;
|
|
257
310
|
readonly invocations: ActionInvocationRecord[];
|
|
258
311
|
readonly policyEvaluations: PolicyEvaluationRecord[];
|
|
259
312
|
readonly adapterInvocations: AdapterInvocationRecord[];
|
|
260
313
|
readonly events: AssetEventEnvelope[];
|
|
314
|
+
readonly policyObligations: PolicyObligationRecord[];
|
|
315
|
+
readonly executionAttestations: ExecutionAttestationRecord[];
|
|
316
|
+
readonly externalReconciliations: ExternalReconciliationRecord[];
|
|
261
317
|
constructor(db: TDb);
|
|
262
318
|
transaction<TResult>(run: (db: TDb) => Promise<TResult>): Promise<TResult>;
|
|
263
319
|
createActionInvocation(input: CreateActionInvocationInput): Promise<ActionInvocationRecord>;
|
|
@@ -266,6 +322,16 @@ declare class MemoryPlatformHostStore<TDb> implements RecoverablePlatformHostSto
|
|
|
266
322
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
267
323
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
268
324
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
325
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: Pick<ActionInvocationRecord, "mutationFootprint" | "executionPrincipal"> & {
|
|
326
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
327
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
328
|
+
}): Promise<ActionInvocationRecord>;
|
|
329
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
330
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
331
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
332
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
333
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
334
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
269
335
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
270
336
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
271
337
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -285,7 +351,7 @@ interface PlatformHostSqlClient {
|
|
|
285
351
|
query<Row = Record<string, unknown>>(sql: string, values?: unknown[]): Promise<PlatformHostSqlResult<Row>>;
|
|
286
352
|
}
|
|
287
353
|
/** Durable mutation-pipeline ledger for Databricks Lakebase or standard Postgres. */
|
|
288
|
-
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb> {
|
|
354
|
+
declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostStore<TDb>, ApprovalPlatformHostStore<TDb>, GovernancePlatformHostStore<TDb> {
|
|
289
355
|
readonly db: TDb;
|
|
290
356
|
private readonly sql;
|
|
291
357
|
constructor(db: TDb, sql: PlatformHostSqlClient);
|
|
@@ -297,6 +363,16 @@ declare class PostgresPlatformHostStore<TDb> implements RecoverablePlatformHostS
|
|
|
297
363
|
recordHitlDecision(actionInvocationId: string, tenantId: string, spaceId: string, decision: HitlDecisionEvidence): Promise<ActionInvocationRecord>;
|
|
298
364
|
beginApprovalDecision(input: BeginApprovalDecisionInput): Promise<ApprovalDecisionTransitionResult>;
|
|
299
365
|
appendPolicyEvaluation(record: PolicyEvaluationRecord): Promise<void>;
|
|
366
|
+
recordMutationGovernance(actionInvocationId: string, tenantId: string, spaceId: string, context: {
|
|
367
|
+
footprint: NonNullable<ActionInvocationRecord["mutationFootprint"]>;
|
|
368
|
+
executionPrincipal: NonNullable<ActionInvocationRecord["executionPrincipal"]>;
|
|
369
|
+
}): Promise<ActionInvocationRecord>;
|
|
370
|
+
appendPolicyObligations(records: PolicyObligationRecord[]): Promise<void>;
|
|
371
|
+
listPolicyObligations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<PolicyObligationRecord[]>;
|
|
372
|
+
updatePolicyObligation(actionInvocationId: string, obligationId: string, status: PolicyObligationRecord["status"], evidenceReferences?: PolicyObligationRecord["evidenceReferences"]): Promise<void>;
|
|
373
|
+
appendExecutionAttestation(record: ExecutionAttestationRecord): Promise<void>;
|
|
374
|
+
listExecutionAttestations(actionInvocationId: string, tenantId: string, spaceId: string): Promise<ExecutionAttestationRecord[]>;
|
|
375
|
+
appendExternalReconciliation(record: ExternalReconciliationRecord): Promise<void>;
|
|
300
376
|
createAdapterInvocation(record: AdapterInvocationRecord): Promise<void>;
|
|
301
377
|
getAdapterInvocation(id: string): Promise<AdapterInvocationRecord | undefined>;
|
|
302
378
|
updateAdapterInvocation(id: string, patch: Partial<Pick<AdapterInvocationRecord, "status" | "output" | "error" | "attempt" | "updatedAt">>): Promise<void>;
|
|
@@ -318,4 +394,4 @@ declare function runPlatformActionWorkerCycle<TDb>(options: PlatformActionWorker
|
|
|
318
394
|
/** Poll until aborted. Each iteration is bounded and waits without busy-spinning. */
|
|
319
395
|
declare function runPlatformActionWorker<TDb>(options: PlatformActionWorkerOptions<TDb>): Promise<void>;
|
|
320
396
|
|
|
321
|
-
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|
|
397
|
+
export { type ActionApprovalDecision, type ActionAuthorizationInput, type ActionInvocationRecord, type AdapterInvocationRecord, type AdapterInvocationStatus, type ApprovalDecisionTransitionResult, type ApprovalPlatformHostStore, type BeginApprovalDecisionInput, type ClaimActionInvocationsInput, type CreateActionInvocationInput, type DispatchActionInput, type DispatchActionResult, type ExecuteActionResult, type ExecuteInvocationOptions, type ExecutionAttestationRecord, type ExternalReconciliationRecord, type GovernancePlatformHostStore, type GovernedActionHost, type HitlDecisionEvidence, type ListActionInvocationsInput, MemoryPlatformHostStore, type PendingAssetEvent, type PersistedActionApprovalDecision, type PlatformActionDispatcher, type PlatformActionWorkerCycleResult, type PlatformActionWorkerOptions, type PlatformHostAuthorization, type PlatformHostOptions, type PlatformHostSqlClient, type PlatformHostSqlResult, type PlatformHostStore, type PolicyEvaluationRecord, type PolicyObligationRecord, PostgresPlatformHostStore, type RecoverablePlatformHostStore, type SubmitActionInput, type SubmitActionResult, createGovernedActionHost, createStoreBackedActionDispatcher, runPlatformActionWorker, runPlatformActionWorkerCycle };
|