@decionis/agent-safe-pipeline 0.3.7 → 0.4.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.
Files changed (85) hide show
  1. package/README.md +31 -0
  2. package/dist/Index.d.ts +12 -0
  3. package/dist/Index.d.ts.map +1 -1
  4. package/dist/Index.js +12 -0
  5. package/dist/Index.js.map +1 -1
  6. package/dist/decision/DecionisGate.d.ts +6 -1
  7. package/dist/decision/DecionisGate.d.ts.map +1 -1
  8. package/dist/decision/DecionisGate.js +61 -11
  9. package/dist/decision/DecionisGate.js.map +1 -1
  10. package/dist/decision/DecisionAuthority.d.ts +16 -0
  11. package/dist/decision/DecisionAuthority.d.ts.map +1 -1
  12. package/dist/decision/DecisionAuthority.js.map +1 -1
  13. package/dist/execution/AuthorizationVerifier.d.ts +33 -4
  14. package/dist/execution/AuthorizationVerifier.d.ts.map +1 -1
  15. package/dist/execution/AuthorizationVerifier.js +74 -10
  16. package/dist/execution/AuthorizationVerifier.js.map +1 -1
  17. package/dist/execution/EffectAdapter.d.ts +117 -0
  18. package/dist/execution/EffectAdapter.d.ts.map +1 -0
  19. package/dist/execution/EffectAdapter.js +22 -0
  20. package/dist/execution/EffectAdapter.js.map +1 -0
  21. package/dist/execution/ExecutionDeadline.d.ts +35 -0
  22. package/dist/execution/ExecutionDeadline.d.ts.map +1 -0
  23. package/dist/execution/ExecutionDeadline.js +52 -0
  24. package/dist/execution/ExecutionDeadline.js.map +1 -0
  25. package/dist/execution/ExecutionJournal.d.ts +148 -0
  26. package/dist/execution/ExecutionJournal.d.ts.map +1 -0
  27. package/dist/execution/ExecutionJournal.js +157 -0
  28. package/dist/execution/ExecutionJournal.js.map +1 -0
  29. package/dist/execution/ExecutionOutcome.d.ts +186 -0
  30. package/dist/execution/ExecutionOutcome.d.ts.map +1 -0
  31. package/dist/execution/ExecutionOutcome.js +2 -0
  32. package/dist/execution/ExecutionOutcome.js.map +1 -0
  33. package/dist/execution/ExecutionPosture.d.ts +50 -0
  34. package/dist/execution/ExecutionPosture.d.ts.map +1 -0
  35. package/dist/execution/ExecutionPosture.js +20 -0
  36. package/dist/execution/ExecutionPosture.js.map +1 -0
  37. package/dist/execution/ExecutorEvidence.d.ts +64 -0
  38. package/dist/execution/ExecutorEvidence.d.ts.map +1 -0
  39. package/dist/execution/ExecutorEvidence.js +14 -0
  40. package/dist/execution/ExecutorEvidence.js.map +1 -0
  41. package/dist/execution/GovernedExecutionRunner.d.ts +309 -0
  42. package/dist/execution/GovernedExecutionRunner.d.ts.map +1 -0
  43. package/dist/execution/GovernedExecutionRunner.js +1341 -0
  44. package/dist/execution/GovernedExecutionRunner.js.map +1 -0
  45. package/dist/execution/NativeExecutor.d.ts +220 -0
  46. package/dist/execution/NativeExecutor.d.ts.map +1 -0
  47. package/dist/execution/NativeExecutor.js +22 -0
  48. package/dist/execution/NativeExecutor.js.map +1 -0
  49. package/dist/execution/NativeExecutorSchema.d.ts +387 -0
  50. package/dist/execution/NativeExecutorSchema.d.ts.map +1 -0
  51. package/dist/execution/NativeExecutorSchema.js +261 -0
  52. package/dist/execution/NativeExecutorSchema.js.map +1 -0
  53. package/dist/execution/PostgresExecutionJournal.d.ts +54 -0
  54. package/dist/execution/PostgresExecutionJournal.d.ts.map +1 -0
  55. package/dist/execution/PostgresExecutionJournal.js +131 -0
  56. package/dist/execution/PostgresExecutionJournal.js.map +1 -0
  57. package/dist/execution/RegistryExecutor.d.ts +35 -0
  58. package/dist/execution/RegistryExecutor.d.ts.map +1 -0
  59. package/dist/execution/RegistryExecutor.js +84 -0
  60. package/dist/execution/RegistryExecutor.js.map +1 -0
  61. package/dist/execution/SafeExecutor.d.ts +22 -193
  62. package/dist/execution/SafeExecutor.d.ts.map +1 -1
  63. package/dist/execution/SafeExecutor.js +49 -521
  64. package/dist/execution/SafeExecutor.js.map +1 -1
  65. package/dist/http/AuthorityPaths.d.ts +51 -0
  66. package/dist/http/AuthorityPaths.d.ts.map +1 -0
  67. package/dist/http/AuthorityPaths.js +84 -0
  68. package/dist/http/AuthorityPaths.js.map +1 -0
  69. package/dist/shadow/ShadowPipeline.d.ts +3 -1
  70. package/dist/shadow/ShadowPipeline.d.ts.map +1 -1
  71. package/dist/shadow/ShadowPipeline.js +3 -3
  72. package/dist/shadow/ShadowPipeline.js.map +1 -1
  73. package/dist/testing/Index.d.ts +2 -1
  74. package/dist/testing/Index.d.ts.map +1 -1
  75. package/dist/testing/Index.js +2 -1
  76. package/dist/testing/Index.js.map +1 -1
  77. package/dist/testing/LocalAuthority.d.ts +35 -1
  78. package/dist/testing/LocalAuthority.d.ts.map +1 -1
  79. package/dist/testing/LocalAuthority.js +122 -2
  80. package/dist/testing/LocalAuthority.js.map +1 -1
  81. package/dist/testing/SignedSignals.d.ts +150 -0
  82. package/dist/testing/SignedSignals.d.ts.map +1 -0
  83. package/dist/testing/SignedSignals.js +291 -0
  84. package/dist/testing/SignedSignals.js.map +1 -0
  85. package/package.json +1 -1
@@ -1,210 +1,39 @@
1
- import { CanonicalIntentHasher } from "../intent/CanonicalIntentHasher.js";
2
- import { boundaryOf, workloadOf } from "../intent/ExecutionSignals.js";
1
+ import { GovernedExecutionRunner } from "./GovernedExecutionRunner.js";
2
+ import { RegistryExecutor } from "./RegistryExecutor.js";
3
+ /**
4
+ * The registry-shaped face of `GovernedExecutionRunner`, kept so that every
5
+ * caller written against it keeps its signatures and its outcomes exactly.
6
+ * Each method is the runner's, with the registry as the executor: admission,
7
+ * the claim, finalization, holds and reconciliation all happen in the
8
+ * runner, and nothing here decides anything.
9
+ *
10
+ * Two runner behaviours stay off behind this face, because they did not
11
+ * exist when it was written: the runner does not refuse a dispatch whose
12
+ * window closed (the registry's handlers bound their own dispatch), and it
13
+ * does not report reconciliations to the authority. Code that wants either
14
+ * uses the runner, with a `NativeExecutor`, directly.
15
+ */
3
16
  export class SafeExecutor {
4
- registry;
5
- verifier;
6
- audit;
7
- hasher = new CanonicalIntentHasher();
8
- boundaryId;
9
- workloadDigest;
10
- /** The holds this executor issued and nobody has claimed, keyed by the frozen handle. */
11
- holds = new WeakMap();
12
- /** The holds claimed and not yet settled, with the authorization each one consumed. */
13
- claims = new WeakMap();
14
- attempts;
17
+ runner;
18
+ executor;
15
19
  constructor(registry, verifier, audit, options) {
16
- this.registry = registry;
17
- this.verifier = verifier;
18
- this.audit = audit;
19
- this.boundaryId = options?.boundaryId ?? null;
20
- this.workloadDigest = options?.workloadDigest ?? null;
21
- this.attempts = options?.attempts ?? null;
22
- }
23
- async run(captured, decision) {
24
- const startedAt = Date.now();
25
- const refused = await this.admit(captured, decision, startedAt);
26
- if (refused !== null)
27
- return refused;
28
- const claim = await this.consume(captured, decision, startedAt);
29
- if (claim.outcome !== "CLAIMED")
30
- return claim;
31
- const authorization = claim.authorization;
32
- const attempt = await this.registry.executeTracked(captured, authorization);
33
- if (attempt.status === "FAILED_BEFORE_DISPATCH") {
34
- return await this.failedBeforeDispatch(captured, decision, authorization, "HANDLER_FAILED_BEFORE_DISPATCH", startedAt, attempt.code);
35
- }
36
- if (attempt.status === "REFUSED_AFTER_DISPATCH") {
37
- // The provider said no. That is an outcome, so it is finalized `FAILED`
38
- // rather than left indeterminate, and `executed` is false rather than
39
- // null: nothing about it is unknown.
40
- const finalization = await this.finalize(captured, decision, authorization, "FAILED", attempt.receipt);
41
- const result = {
42
- outcome: "DEFINITELY_NOT_EXECUTED",
43
- executed: false,
44
- recovered: false,
45
- reason: attempt.reason,
46
- result: null,
47
- authorization,
48
- finalization,
49
- };
50
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
51
- await this.record({
52
- eventType: "EXECUTION_REFUSED_AFTER_DISPATCH",
53
- captured,
54
- decision,
55
- authorization,
56
- reasonCodes: [attempt.reason, SafeExecutor.finalizationCode(finalization)],
57
- durationMs: Date.now() - startedAt,
58
- });
59
- // Stryker restore all
60
- return result;
61
- }
62
- if (attempt.status === "UNKNOWN_AFTER_DISPATCH") {
63
- const finalization = await this.finalize(captured, decision, authorization, "INDETERMINATE", attempt.receipt);
64
- const result = {
65
- outcome: "UNKNOWN_AFTER_DISPATCH",
66
- executed: null,
67
- reason: "PROVIDER_OUTCOME_UNKNOWN",
68
- result: null,
69
- authorization,
70
- recovery: SafeExecutor.recoveryReference(captured, authorization),
71
- finalization,
72
- };
73
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
74
- await this.record({
75
- eventType: "EXECUTION_OUTCOME_UNKNOWN",
76
- captured,
77
- decision,
78
- authorization,
79
- reasonCodes: [result.reason, SafeExecutor.finalizationCode(finalization)],
80
- durationMs: Date.now() - startedAt,
81
- });
82
- // Stryker restore all
83
- return result;
84
- }
85
- const finalization = await this.finalize(captured, decision, authorization, "COMMITTED", attempt.receipt);
86
- const result = {
87
- outcome: "COMPLETED",
88
- executed: true,
89
- recovered: false,
90
- result: attempt.result,
91
- authorization,
92
- finalization,
93
- };
94
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
95
- await this.record({
96
- eventType: "EXECUTION_COMPLETED",
97
- captured,
98
- decision,
99
- authorization,
100
- reasonCodes: [SafeExecutor.finalizationCode(finalization)],
101
- durationMs: Date.now() - startedAt,
20
+ this.executor = new RegistryExecutor(registry);
21
+ this.runner = new GovernedExecutionRunner({
22
+ verifier,
23
+ audit,
24
+ ...(options?.boundaryId === undefined ? {} : { boundaryId: options.boundaryId }),
25
+ ...(options?.workloadDigest === undefined ? {} : { workloadDigest: options.workloadDigest }),
26
+ ...(options?.attempts === undefined ? {} : { attempts: options.attempts }),
27
+ enforceDispatchWindow: false,
28
+ reportReconciliations: false,
102
29
  });
103
- // Stryker restore all
104
- return result;
105
30
  }
106
- /**
107
- * Every check made before a grant may be consumed, with the evidence that
108
- * the intent was captured and decided. A refusal is recorded and returned;
109
- * null means the decision passed, and so carries a grant.
110
- */
111
- async admit(captured, decision, startedAt) {
112
- // Stryker disable next-line all: Audit payload mapping is covered by lifecycle event assertions.
113
- const intentRecorded = await this.record({ eventType: "INTENT_CAPTURED", captured });
114
- // An observational artifact (shadow observation, serialized audit event) is
115
- // rejected before it is recorded or inspected as if it were a decision.
116
- if (!SafeExecutor.isAuthoritativeDecision(decision)) {
117
- return await this.block(captured, undefined, "DECISION_NOT_AUTHORITATIVE", startedAt);
118
- }
119
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
120
- const decisionRecorded = await this.record({
121
- eventType: decision.failClosed ? "AUTHORITY_FAILED_CLOSED" : "AUTHORITY_DECISION",
122
- captured,
123
- decision,
124
- });
125
- // Stryker restore all
126
- if (this.audit?.requiresDeliveryBeforeExecution === true &&
127
- (!intentRecorded || !decisionRecorded)) {
128
- return await this.block(captured, decision, "AUDIT_UNAVAILABLE", startedAt);
129
- }
130
- if (decision.verdict !== "ALLOW" || decision.failClosed) {
131
- return await this.block(captured, decision, "DECISION_NOT_ALLOW", startedAt);
132
- }
133
- if (decision.intentHash !== captured.intentHash) {
134
- return await this.block(captured, decision, "INTENT_BINDING_MISMATCH", startedAt);
135
- }
136
- if (decision.authorization === null || typeof decision.authorization !== "object") {
137
- return await this.block(captured, decision, "AUTHORIZATION_MISSING", startedAt);
138
- }
139
- if (!this.intentConforms(captured)) {
140
- return await this.block(captured, decision, "INTENT_CONFORMANCE_FAILED", startedAt);
141
- }
142
- // Before the grant is consumed, not after: a boundary that refuses an
143
- // intent must leave the authority intact for the boundary that owns it.
144
- if (!this.boundaryMatches(captured)) {
145
- return await this.block(captured, decision, "BOUNDARY_MISMATCH", startedAt);
146
- }
147
- if (!this.workloadMatches(captured)) {
148
- return await this.block(captured, decision, "WORKLOAD_MISMATCH", startedAt);
149
- }
150
- this.registry.validate(captured);
151
- return null;
152
- }
153
- /**
154
- * Consumes the grant through the verifier, checks what came back against
155
- * the decision and the intent, and records the consumption and the start
156
- * of execution. Nothing here dispatches.
157
- */
158
- async consume(captured, decision, startedAt) {
159
- let authorization;
160
- try {
161
- authorization = await this.verifier.verifyAndConsume(captured, decision);
162
- }
163
- catch {
164
- return await this.block(captured, decision, "AUTHORIZATION_INVALID", startedAt);
165
- }
166
- if (authorization === null) {
167
- return await this.block(captured, decision, "AUTHORIZATION_INVALID", startedAt);
168
- }
169
- const authorizationExpiry = Date.parse(authorization.expiresAt);
170
- if (authorization.decisionId !== decision.decisionId ||
171
- authorization.dossierId !== decision.dossierId ||
172
- authorization.grantId.length === 0 ||
173
- authorization.intentHash !== captured.intentHash ||
174
- Math.floor(authorizationExpiry / 1_000) !==
175
- Math.floor(Date.parse(decision.authorization.expiresAt) / 1_000) ||
176
- authorizationExpiry <= Date.now() ||
177
- authorizationExpiry > Date.parse(captured.intent.expiresAt)) {
178
- return await this.block(captured, decision, "AUTHORIZATION_INVALID", startedAt);
179
- }
180
- if (!this.intentConforms(captured)) {
181
- return await this.block(captured, decision, "INTENT_CONFORMANCE_FAILED", startedAt);
182
- }
183
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
184
- const grantRecorded = await this.record({
185
- eventType: "GRANT_CONSUMED",
186
- captured,
187
- decision,
188
- authorization,
189
- durationMs: Date.now() - startedAt,
190
- });
191
- // Stryker restore all
192
- if (this.audit?.requiresDeliveryBeforeExecution === true && !grantRecorded) {
193
- return await this.failedBeforeDispatch(captured, decision, authorization, "AUDIT_UNAVAILABLE", startedAt);
194
- }
195
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
196
- const executionRecorded = await this.record({
197
- eventType: "EXECUTION_STARTED",
31
+ async run(captured, decision) {
32
+ return (await this.runner.dispatch(this.executor, {
198
33
  captured,
199
34
  decision,
200
- authorization,
201
- durationMs: Date.now() - startedAt,
202
- });
203
- // Stryker restore all
204
- if (this.audit?.requiresDeliveryBeforeExecution === true && !executionRecorded) {
205
- return await this.failedBeforeDispatch(captured, decision, authorization, "AUDIT_UNAVAILABLE", startedAt);
206
- }
207
- return { outcome: "CLAIMED", authorization };
35
+ action: captured,
36
+ }));
208
37
  }
209
38
  /**
210
39
  * Admits a decision exactly as `run` would and holds its grant instead of
@@ -213,46 +42,25 @@ export class SafeExecutor {
213
42
  * unclaimed hold simply expires with its grant.
214
43
  */
215
44
  async hold(captured, decision) {
216
- return await this.holdWith(captured, decision, []);
45
+ return await this.runner.hold(this.executor, { captured, decision, action: captured });
217
46
  }
218
47
  /**
219
48
  * Admits a hold this executor did not make: one another replica made, or
220
49
  * this process made before a restart, read back from a store the replicas
221
50
  * share. Every check `hold` makes is made again on the way in, and the
222
- * record says the hold was adopted. Adoption adds no authority: the grant
223
- * is still the authority's to hand out once, so a hold claimed elsewhere
224
- * is refused at the claim by the authority or the shared replay store,
225
- * never admitted twice by this executor's own memory.
51
+ * record says the hold was adopted.
226
52
  */
227
53
  async adoptHold(captured, decision) {
228
- return await this.holdWith(captured, decision, ["HOLD_ADOPTED"]);
54
+ return await this.runner.adoptHold(this.executor, { captured, decision, action: captured });
229
55
  }
230
56
  /**
231
57
  * Registers a claim this executor did not make, so that `settleHeld` can
232
- * finalize it here: the hold's intent and decision, and the authorization
233
- * the claim returned, as the store that shared them kept them. Nothing is
234
- * consumed and nothing is checked against the authority; the finalization
235
- * is, as always, the authority's to accept or refuse.
58
+ * finalize it here. Nothing is consumed and nothing is checked against the
59
+ * authority; the finalization is, as always, the authority's to accept or
60
+ * refuse.
236
61
  */
237
62
  adoptClaim(captured, decision, authorization, material = null) {
238
- if (!SafeExecutor.isAuthoritativeDecision(decision) ||
239
- decision.intentHash !== captured.intentHash ||
240
- authorization.intentHash !== captured.intentHash) {
241
- throw new Error("CLAIM_ADOPTION_MISMATCH");
242
- }
243
- if (material !== null) {
244
- const adopt = this.verifier.adoptClaim;
245
- if (adopt === undefined || !adopt.call(this.verifier, authorization, material)) {
246
- throw new Error("CLAIM_MATERIAL_REFUSED");
247
- }
248
- }
249
- const held = Object.freeze({
250
- captured,
251
- decision,
252
- expiresAt: authorization.expiresAt,
253
- });
254
- this.claims.set(held, authorization);
255
- return held;
63
+ return this.runner.adoptClaim(this.executor, { captured, decision, action: captured }, authorization, material);
256
64
  }
257
65
  /**
258
66
  * What another process needs to finalize a claim this executor's verifier
@@ -260,53 +68,15 @@ export class SafeExecutor {
260
68
  * verifier keeps its claims to itself or did not make this one.
261
69
  */
262
70
  claimMaterial(authorization) {
263
- const material = this.verifier.claimMaterial;
264
- return material === undefined ? null : material.call(this.verifier, authorization);
265
- }
266
- async holdWith(captured, decision, reasonCodes) {
267
- const startedAt = Date.now();
268
- const refused = await this.admit(captured, decision, startedAt);
269
- if (refused !== null)
270
- return refused;
271
- const admitted = decision;
272
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
273
- const heldRecorded = await this.record({
274
- eventType: "GRANT_HELD",
275
- captured,
276
- decision,
277
- ...(reasonCodes.length === 0 ? {} : { reasonCodes: [...reasonCodes] }),
278
- durationMs: Date.now() - startedAt,
279
- });
280
- // Stryker restore all
281
- if (this.audit?.requiresDeliveryBeforeExecution === true && !heldRecorded) {
282
- return await this.block(captured, decision, "AUDIT_UNAVAILABLE", startedAt);
283
- }
284
- const held = Object.freeze({
285
- captured,
286
- decision,
287
- expiresAt: admitted.authorization.expiresAt,
288
- });
289
- this.holds.set(held, admitted);
290
- return { outcome: "HELD", executed: false, result: null, authorization: null, held };
71
+ return this.runner.claimMaterial(authorization);
291
72
  }
292
73
  /**
293
- * Claims a held grant, once. The handle is forgotten before the verifier
294
- * is asked, so a second claim of the same hold, concurrent or later, is
295
- * refused here without reaching the authority; a handle this executor did
296
- * not issue is refused the same way. What the claim returns is checked
297
- * exactly as `run` checks it.
74
+ * Claims a held grant, once. A second claim of the same hold, concurrent or
75
+ * later, is refused without reaching the authority; a handle this executor
76
+ * did not issue is refused the same way.
298
77
  */
299
78
  async claimHeld(held) {
300
- const startedAt = Date.now();
301
- const decision = this.holds.get(held);
302
- if (decision === undefined) {
303
- return await this.block(held.captured, held.decision, "AUTHORIZATION_INVALID", startedAt);
304
- }
305
- this.holds.delete(held);
306
- const claim = await this.consume(held.captured, decision, startedAt);
307
- if (claim.outcome === "CLAIMED")
308
- this.claims.set(held, claim.authorization);
309
- return claim;
79
+ return (await this.runner.present(held));
310
80
  }
311
81
  /**
312
82
  * Reports how a claimed hold ended, once: `COMMITTED` when the effect
@@ -314,259 +84,17 @@ export class SafeExecutor {
314
84
  * nobody can say. The terminal record names the outcome, as `run`'s do.
315
85
  */
316
86
  async settleHeld(held, outcome, receipt = null) {
317
- const startedAt = Date.now();
318
- const authorization = this.claims.get(held);
319
- if (authorization === undefined)
87
+ const settlement = await this.runner.settle(held, { outcome, signedReceipt: receipt });
88
+ if (settlement.status !== "SETTLED")
320
89
  throw new Error("HELD_EXECUTION_NOT_CLAIMED");
321
- this.claims.delete(held);
322
- const finalization = await this.finalize(held.captured, held.decision, authorization, outcome, receipt);
323
- const eventType = SafeExecutor.settledEvent(outcome);
324
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
325
- await this.record({
326
- eventType,
327
- captured: held.captured,
328
- decision: held.decision,
329
- authorization,
330
- reasonCodes: [SafeExecutor.finalizationCode(finalization)],
331
- durationMs: Date.now() - startedAt,
332
- });
333
- // Stryker restore all
334
- return finalization;
335
- }
336
- static settledEvent(outcome) {
337
- if (outcome === "COMMITTED")
338
- return "EXECUTION_COMPLETED";
339
- if (outcome === "FAILED")
340
- return "EXECUTION_REFUSED_AFTER_DISPATCH";
341
- return "EXECUTION_OUTCOME_UNKNOWN";
342
- }
343
- /**
344
- * Reports the attempt outcome to the verifier's authority, with the
345
- * provider's effect receipt when the attempt brought one back. A missing,
346
- * failing, or malformed finalization can never alter the execution result.
347
- */
348
- async finalize(captured, decision, authorization, outcome, receipt = null) {
349
- const finalize = this.verifier.finalize;
350
- if (finalize === undefined)
351
- return "UNSUPPORTED";
352
- try {
353
- const status = await finalize.call(this.verifier, {
354
- captured,
355
- decision,
356
- authorization,
357
- outcome,
358
- ...(receipt === null ? {} : { effectReceipt: receipt }),
359
- });
360
- return status === "RECORDED" ? "RECORDED" : "PENDING";
361
- }
362
- catch {
363
- return "PENDING";
364
- }
365
- }
366
- static finalizationCode(finalization) {
367
- return `COMMIT_FINALIZATION_${finalization}`;
90
+ return settlement.finalization;
368
91
  }
369
92
  async reconcile(captured, recovery) {
370
- const startedAt = Date.now();
371
- if (recovery.version !== "agent-safe.recovery/1" ||
372
- recovery.intentHash !== captured.intentHash ||
373
- recovery.idempotencyKey !== captured.intent.idempotencyKey ||
374
- !this.intentConforms(captured)) {
375
- return await this.block(captured, undefined, "RECOVERY_BINDING_MISMATCH", startedAt);
376
- }
377
- // The decision and grant are the caller's claim until the executor's own
378
- // record confirms them; the provider is not asked about a binding that
379
- // was never dispatched here.
380
- let authority = "NON_AUTHORITATIVE";
381
- if (this.attempts !== null) {
382
- const recorded = await this.attempts.authorizationsOf(captured);
383
- if (recorded.length === 0) {
384
- return await this.block(captured, undefined, "RECOVERY_ATTEMPT_UNKNOWN", startedAt);
385
- }
386
- if (!recorded.some((candidate) => SafeExecutor.sameBinding(candidate, recovery))) {
387
- return await this.block(captured, undefined, "RECOVERY_BINDING_MISMATCH", startedAt);
388
- }
389
- authority = "AUTHORITATIVE";
390
- }
391
- const authorization = SafeExecutor.authorizationFrom(recovery);
392
- const reconciliation = await this.registry.reconcile(captured, recovery.idempotencyKey);
393
- if (reconciliation.status === "COMPLETED") {
394
- const result = {
395
- outcome: "COMPLETED",
396
- executed: true,
397
- recovered: true,
398
- result: reconciliation.result,
399
- authorization,
400
- };
401
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
402
- await this.record({
403
- eventType: "RECONCILIATION_COMPLETED",
404
- captured,
405
- authorization,
406
- authority,
407
- durationMs: Date.now() - startedAt,
408
- });
409
- // Stryker restore all
410
- return result;
411
- }
412
- if (reconciliation.status === "NOT_EXECUTED") {
413
- const result = {
414
- outcome: "DEFINITELY_NOT_EXECUTED",
415
- executed: false,
416
- recovered: true,
417
- reason: "PROVIDER_CONFIRMED_NOT_EXECUTED",
418
- result: null,
419
- authorization,
420
- };
421
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
422
- await this.record({
423
- eventType: "RECONCILIATION_NOT_EXECUTED",
424
- captured,
425
- authorization,
426
- authority,
427
- reasonCodes: [result.reason],
428
- durationMs: Date.now() - startedAt,
429
- });
430
- // Stryker restore all
431
- return result;
432
- }
433
- const result = {
434
- outcome: "UNKNOWN_AFTER_DISPATCH",
435
- executed: null,
436
- reason: "PROVIDER_OUTCOME_UNKNOWN",
437
- result: null,
438
- authorization,
439
- recovery,
440
- };
441
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
442
- await this.record({
443
- eventType: "RECONCILIATION_UNKNOWN",
93
+ return (await this.runner.reconcile(this.executor, {
444
94
  captured,
445
- authorization,
446
- authority,
447
- reasonCodes: [result.reason],
448
- durationMs: Date.now() - startedAt,
449
- });
450
- // Stryker restore all
451
- return result;
452
- }
453
- /**
454
- * Observational artifacts carry an explicit non-authoritative marker. They
455
- * must never be interpreted as a `DecisionGate`, even after an unsafe cast
456
- * or a JSON round trip.
457
- */
458
- static isAuthoritativeDecision(decision) {
459
- const candidate = decision;
460
- return candidate.authority !== "OBSERVATIONAL" && candidate.mode !== "SHADOW";
461
- }
462
- /**
463
- * Whether this boundary is the one the intent was captured through. The
464
- * boundary is read back out of the hashed context, so an intent whose
465
- * boundary was edited after capture fails conformance before it reaches
466
- * here, and one that never named a boundary cannot acquire one now.
467
- */
468
- boundaryMatches(captured) {
469
- if (this.boundaryId === null)
470
- return true;
471
- return boundaryOf(captured.intent.context)?.boundary_id === this.boundaryId;
472
- }
473
- /**
474
- * Whether the workload that proposed the intent is the one running it. Like
475
- * the boundary, the digest is read back out of the hashed context, so an
476
- * intent whose workload was edited after capture fails conformance first.
477
- */
478
- workloadMatches(captured) {
479
- if (this.workloadDigest === null)
480
- return true;
481
- return workloadOf(captured.intent.context)?.digest === this.workloadDigest;
482
- }
483
- intentConforms(captured) {
484
- let recomputed = null;
485
- try {
486
- recomputed = this.hasher.capture(captured.intent);
487
- }
488
- catch {
489
- // Malformed runtime objects are non-conformant.
490
- }
491
- return (recomputed !== null &&
492
- recomputed.intentHash === captured.intentHash &&
493
- recomputed.canonicalIntent === captured.canonicalIntent &&
494
- recomputed.byteLength === captured.byteLength);
495
- }
496
- async block(captured, decision, reason, startedAt) {
497
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
498
- await this.record({
499
- eventType: "EXECUTION_BLOCKED",
500
- captured,
501
- ...(decision === undefined ? {} : { decision }),
502
- reasonCodes: [reason],
503
- durationMs: Date.now() - startedAt,
504
- });
505
- // Stryker restore all
506
- return { outcome: "BLOCKED", executed: false, reason, result: null, authorization: null };
507
- }
508
- async failedBeforeDispatch(captured, decision, authorization, reason, startedAt, code) {
509
- // The grant was consumed but no side effect was attempted.
510
- const finalization = await this.finalize(captured, decision, authorization, "FAILED");
511
- // Stryker disable all: Audit payload mapping is covered by lifecycle event assertions.
512
- await this.record({
513
- eventType: "EXECUTION_FAILED_BEFORE_DISPATCH",
514
- captured,
515
- decision,
516
- authorization,
517
- reasonCodes: [
518
- reason,
519
- ...(code === undefined ? [] : [code]),
520
- SafeExecutor.finalizationCode(finalization),
521
- ],
522
- durationMs: Date.now() - startedAt,
523
- });
524
- // Stryker restore all
525
- return {
526
- outcome: "FAILED_BEFORE_DISPATCH",
527
- executed: false,
528
- reason,
529
- ...(code === undefined ? {} : { code }),
530
- result: null,
531
- authorization,
532
- finalization,
533
- };
534
- }
535
- async record(input) {
536
- // Stryker disable next-line BooleanLiteral: The value is irrelevant when no audit policy exists.
537
- return this.audit === undefined ? true : await this.audit.record(input);
538
- }
539
- static recoveryReference(captured, authorization) {
540
- // Named field by field rather than spread: `agent-safe.recovery/1` is a
541
- // wire object a caller presents back, so a field added to the
542
- // authorization must not appear here by accident. The claim lease in
543
- // particular has no business being here — it is the window this attempt
544
- // had, and it has certainly closed by the time anyone reconciles.
545
- return Object.freeze({
546
- version: "agent-safe.recovery/1",
547
- decisionId: authorization.decisionId,
548
- dossierId: authorization.dossierId,
549
- grantId: authorization.grantId,
550
- intentHash: authorization.intentHash,
551
- expiresAt: authorization.expiresAt,
552
- idempotencyKey: captured.intent.idempotencyKey,
553
- });
554
- }
555
- static sameBinding(recorded, recovery) {
556
- return (recorded.decisionId === recovery.decisionId &&
557
- recorded.dossierId === recovery.dossierId &&
558
- recorded.grantId === recovery.grantId &&
559
- recorded.intentHash === recovery.intentHash &&
560
- recorded.expiresAt === recovery.expiresAt);
561
- }
562
- static authorizationFrom(recovery) {
563
- return Object.freeze({
564
- decisionId: recovery.decisionId,
565
- dossierId: recovery.dossierId,
566
- grantId: recovery.grantId,
567
- intentHash: recovery.intentHash,
568
- expiresAt: recovery.expiresAt,
569
- });
95
+ recovery,
96
+ action: captured,
97
+ }));
570
98
  }
571
99
  }
572
100
  //# sourceMappingURL=SafeExecutor.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"SafeExecutor.js","sourceRoot":"","sources":["../../src/execution/SafeExecutor.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAE3E,OAAO,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAqMvE,MAAM,OAAO,YAAY;IAYJ;IACA;IACA;IAbF,MAAM,GAAG,IAAI,qBAAqB,EAAE,CAAC;IAErC,UAAU,CAAgB;IAC1B,cAAc,CAAgB;IAC/C,yFAAyF;IACxE,KAAK,GAAG,IAAI,OAAO,EAAmC,CAAC;IACxE,uFAAuF;IACtE,MAAM,GAAG,IAAI,OAAO,EAAwC,CAAC;IAC7D,QAAQ,CAA4B;IAErD,YACmB,QAAwB,EACxB,QAA+B,EAC/B,KAAqB,EACtC,OAA6B;QAHZ,aAAQ,GAAR,QAAQ,CAAgB;QACxB,aAAQ,GAAR,QAAQ,CAAuB;QAC/B,UAAK,GAAL,KAAK,CAAgB;QAGtC,IAAI,CAAC,UAAU,GAAG,OAAO,EAAE,UAAU,IAAI,IAAI,CAAC;QAC9C,IAAI,CAAC,cAAc,GAAG,OAAO,EAAE,cAAc,IAAI,IAAI,CAAC;QACt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