@decionis/agent-safe-pipeline 0.3.4 → 0.3.6
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/README.md +5 -4
- package/dist/Index.d.ts +7 -0
- package/dist/Index.d.ts.map +1 -1
- package/dist/Index.js +7 -0
- package/dist/Index.js.map +1 -1
- package/dist/audit/AuditRecorder.d.ts +1 -1
- package/dist/audit/AuditRecorder.d.ts.map +1 -1
- package/dist/audit/AuditRecorder.js.map +1 -1
- package/dist/decision/DecionisGate.d.ts +11 -1
- package/dist/decision/DecionisGate.d.ts.map +1 -1
- package/dist/decision/DecionisGate.js +52 -4
- package/dist/decision/DecionisGate.js.map +1 -1
- package/dist/decision/DecisionAuthority.d.ts +15 -1
- package/dist/decision/DecisionAuthority.d.ts.map +1 -1
- package/dist/decision/DecisionAuthority.js.map +1 -1
- package/dist/decision/edge/BundleWindow.d.ts +43 -0
- package/dist/decision/edge/BundleWindow.d.ts.map +1 -0
- package/dist/decision/edge/BundleWindow.js +41 -0
- package/dist/decision/edge/BundleWindow.js.map +1 -0
- package/dist/decision/edge/EdgeBundleManager.d.ts +87 -0
- package/dist/decision/edge/EdgeBundleManager.d.ts.map +1 -0
- package/dist/decision/edge/EdgeBundleManager.js +175 -0
- package/dist/decision/edge/EdgeBundleManager.js.map +1 -0
- package/dist/decision/edge/EdgeBundleSource.d.ts +59 -0
- package/dist/decision/edge/EdgeBundleSource.d.ts.map +1 -0
- package/dist/decision/edge/EdgeBundleSource.js +99 -0
- package/dist/decision/edge/EdgeBundleSource.js.map +1 -0
- package/dist/decision/edge/EdgeDecisionAuthority.d.ts +104 -0
- package/dist/decision/edge/EdgeDecisionAuthority.d.ts.map +1 -0
- package/dist/decision/edge/EdgeDecisionAuthority.js +197 -0
- package/dist/decision/edge/EdgeDecisionAuthority.js.map +1 -0
- package/dist/decision/edge/EdgeModule.d.ts +63 -0
- package/dist/decision/edge/EdgeModule.d.ts.map +1 -0
- package/dist/decision/edge/EdgeModule.js +147 -0
- package/dist/decision/edge/EdgeModule.js.map +1 -0
- package/dist/execution/ActionRegistry.d.ts +23 -0
- package/dist/execution/ActionRegistry.d.ts.map +1 -1
- package/dist/execution/ActionRegistry.js +32 -2
- package/dist/execution/ActionRegistry.js.map +1 -1
- package/dist/execution/AuthorizationVerifier.d.ts.map +1 -1
- package/dist/execution/AuthorizationVerifier.js +7 -2
- package/dist/execution/AuthorizationVerifier.js.map +1 -1
- package/dist/execution/LocalAuthorizationVerifier.d.ts +70 -0
- package/dist/execution/LocalAuthorizationVerifier.d.ts.map +1 -0
- package/dist/execution/LocalAuthorizationVerifier.js +119 -0
- package/dist/execution/LocalAuthorizationVerifier.js.map +1 -0
- package/dist/execution/PostgresReplayStore.d.ts +57 -0
- package/dist/execution/PostgresReplayStore.d.ts.map +1 -0
- package/dist/execution/PostgresReplayStore.js +81 -0
- package/dist/execution/PostgresReplayStore.js.map +1 -0
- package/dist/execution/ReplayStore.d.ts +14 -0
- package/dist/execution/ReplayStore.d.ts.map +1 -1
- package/dist/execution/ReplayStore.js +8 -0
- package/dist/execution/ReplayStore.js.map +1 -1
- package/dist/execution/SafeExecutor.d.ts +125 -3
- package/dist/execution/SafeExecutor.d.ts.map +1 -1
- package/dist/execution/SafeExecutor.js +242 -68
- package/dist/execution/SafeExecutor.js.map +1 -1
- package/dist/intent/ExecutionIntent.d.ts +32 -0
- package/dist/intent/ExecutionIntent.d.ts.map +1 -1
- package/dist/intent/ExecutionIntent.js +7 -0
- package/dist/intent/ExecutionIntent.js.map +1 -1
- package/dist/intent/ExecutionSignals.d.ts +124 -0
- package/dist/intent/ExecutionSignals.d.ts.map +1 -0
- package/dist/intent/ExecutionSignals.js +124 -0
- package/dist/intent/ExecutionSignals.js.map +1 -0
- package/dist/intent/IntentCapture.d.ts.map +1 -1
- package/dist/intent/IntentCapture.js +9 -2
- package/dist/intent/IntentCapture.js.map +1 -1
- package/dist/testing/LocalAuthority.d.ts +17 -2
- package/dist/testing/LocalAuthority.d.ts.map +1 -1
- package/dist/testing/LocalAuthority.js +38 -1
- package/dist/testing/LocalAuthority.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthorizationVerifier.js","sourceRoot":"","sources":["../../src/execution/AuthorizationVerifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AACxB,OAAO,EAAE,gBAAgB,EAAE,MAAM,6BAA6B,CAAC;AAC/D,OAAO,EAAE,gBAAgB,EAAmB,MAAM,uBAAuB,CAAC;AAC1E,OAAO,EAAE,mBAAmB,EAAE,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAqJ3E,MAAM,iBAAiB,GAAG,CAAC;KACxB,MAAM,EAAE;KACR,GAAG,CAAC,CAAC,CAAC;KACN,GAAG,CAAC,GAAG,CAAC;KACR,MAAM,CAAC,sBAAsB,EAAE,EAAE,OAAO,EAAE,oBAAoB,EAAE,CAAC,CAAC;AACrE,MAAM,YAAY,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,uBAAuB,CAAC,CAAC;AAC/D,MAAM,UAAU,GAAG,YAAY,CAAC;AAChC,MAAM,mBAAmB,GAAG,iBAAiB,CAAC;AAC9C,MAAM,mBAAmB,GAAG,0BAA0B,CAAC;AACvD,iFAAiF;AACjF,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;AAE3D;;;;;;;;GAQG;AACH,MAAM,oBAAoB,GAAG,CAAC,CAAC,YAAY,CAAC;IAC1C,OAAO,EAAE,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;IACzB,MAAM,EAAE,CAAC,CAAC,IAAI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IAAI;YAAE,OAAO,KAAK,CAAC;IAC1D,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import type { GateDecision } from "../decision/DecisionAuthority.js";
|
|
2
|
+
import type { CapturedIntent } from "../intent/ExecutionIntent.js";
|
|
3
|
+
import type { AuthorizationFinalizationInput, AuthorizationVerifier, ExecutionCommitOutcome, VerifiedAuthorization } from "./AuthorizationVerifier.js";
|
|
4
|
+
import type { ReplayStore } from "./ReplayStore.js";
|
|
5
|
+
/** What an in-process authority decided, held until the executor consumes it. */
|
|
6
|
+
export interface LocalGrant {
|
|
7
|
+
readonly intentId: string;
|
|
8
|
+
readonly intentHash: string;
|
|
9
|
+
readonly decisionId: string;
|
|
10
|
+
readonly dossierId: string;
|
|
11
|
+
readonly expiresAt: string;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Authorizations issued in this process. A token is 256 random bits that
|
|
15
|
+
* never leave the process except inside the decision the executor is handed,
|
|
16
|
+
* and it names nothing: what it authorizes is held here, so a token cannot be
|
|
17
|
+
* forged, edited, or carried to another process. A token is taken at most
|
|
18
|
+
* once.
|
|
19
|
+
*/
|
|
20
|
+
export declare class LocalGrants {
|
|
21
|
+
private readonly clock;
|
|
22
|
+
private readonly maxEntries;
|
|
23
|
+
private readonly grants;
|
|
24
|
+
constructor(clock?: () => number, maxEntries?: number);
|
|
25
|
+
/** Holds `grant` and returns the token that names it. Lapsed grants are dropped first. */
|
|
26
|
+
issue(grant: LocalGrant): string;
|
|
27
|
+
/** The grant `token` names, removed so that no second caller can take it. */
|
|
28
|
+
take(token: string): LocalGrant | undefined;
|
|
29
|
+
}
|
|
30
|
+
/** What the local finalization writes: the outcome against the local decision, nothing else. */
|
|
31
|
+
export interface LocalFinalizationRecord {
|
|
32
|
+
readonly event: "EDGE_EXECUTION_FINALIZED";
|
|
33
|
+
readonly intent_id: string;
|
|
34
|
+
readonly intent_hash: string;
|
|
35
|
+
readonly decision_id: string;
|
|
36
|
+
readonly outcome: ExecutionCommitOutcome;
|
|
37
|
+
}
|
|
38
|
+
export interface LocalAuthorizationVerifierOptions {
|
|
39
|
+
readonly grants: LocalGrants;
|
|
40
|
+
/** Single use, keyed by `intent_id`, for local and delegated grants alike. */
|
|
41
|
+
readonly replay: ReplayStore;
|
|
42
|
+
/** The verifier for every authorization this process did not issue: the hosted one. */
|
|
43
|
+
readonly delegate?: AuthorizationVerifier;
|
|
44
|
+
readonly clock?: () => number;
|
|
45
|
+
/** Where a local attempt's outcome is recorded; it is the only record the outcome has. */
|
|
46
|
+
readonly record: (record: LocalFinalizationRecord) => void;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* The `AuthorizationVerifier` for an executor whose authority decides
|
|
50
|
+
* locally. An authorization this process issued is checked against the grant
|
|
51
|
+
* it names and consumed here, once: the grant is taken from the store, and
|
|
52
|
+
* the intent is claimed in the replay store, so neither the same token nor a
|
|
53
|
+
* second decision about the same intent can run it again. Anything else is
|
|
54
|
+
* handed to the delegate unchanged, and a delegated authorization claims the
|
|
55
|
+
* intent too, so an intent is executable once whichever path allowed it.
|
|
56
|
+
*/
|
|
57
|
+
export declare class LocalAuthorizationVerifier implements AuthorizationVerifier {
|
|
58
|
+
private readonly options;
|
|
59
|
+
private readonly clock;
|
|
60
|
+
private readonly local;
|
|
61
|
+
constructor(options: LocalAuthorizationVerifierOptions);
|
|
62
|
+
verifyAndConsume(captured: CapturedIntent, decision: GateDecision): Promise<VerifiedAuthorization | null>;
|
|
63
|
+
/**
|
|
64
|
+
* A local attempt's outcome is recorded where its decision was: in this
|
|
65
|
+
* process's evidence. A delegated one is finalized by its own verifier.
|
|
66
|
+
*/
|
|
67
|
+
finalize(input: AuthorizationFinalizationInput): Promise<"RECORDED" | "PENDING">;
|
|
68
|
+
private delegated;
|
|
69
|
+
}
|
|
70
|
+
//# sourceMappingURL=LocalAuthorizationVerifier.d.ts.map
|
|
@@ -0,0 +1 @@
|
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AQ,CAAC,OAAO,EAAE,sBAAsB,CAAC;CAC1C;AAED,MAAM,WAAW,iCAAiC;IAChD,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,8EAA8E;IAC9E,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC;IAC7B,uFAAuF;IACvF,QAAQ,CAAC,QAAQ,CAAC,EAAE,qBAAqB,CAAC;IAC1C,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;IAC9B,0FAA0F;IAC1F,QAAQ,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,uBAAuB,KAAK,IAAI,CAAC;CAC5D;AAED;;;;;;;;GAQG;AACH,qBAAa,0BAA2B,YAAW,qBAAqB;IAInD,OAAO,CAAC,QAAQ,CAAC,OAAO;IAH3C,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAwC;gBAE1B,OAAO,EAAE,iCAAiC;IAIjE,gBAAgB,CAC3B,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,YAAY,GACrB,OAAO,CAAC,qBAAqB,GAAG,IAAI,CAAC;IA6BxC;;;OAGG;IACU,QAAQ,CAAC,KAAK,EAAE,8BAA8B,GAAG,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC;YAoB/E,SAAS;CAcxB"}
|
|
@@ -0,0 +1,119 @@
|
|
|
1
|
+
import { randomBytes } from "node:crypto";
|
|
2
|
+
/**
|
|
3
|
+
* Authorizations issued in this process. A token is 256 random bits that
|
|
4
|
+
* never leave the process except inside the decision the executor is handed,
|
|
5
|
+
* and it names nothing: what it authorizes is held here, so a token cannot be
|
|
6
|
+
* forged, edited, or carried to another process. A token is taken at most
|
|
7
|
+
* once.
|
|
8
|
+
*/
|
|
9
|
+
export class LocalGrants {
|
|
10
|
+
clock;
|
|
11
|
+
maxEntries;
|
|
12
|
+
grants = new Map();
|
|
13
|
+
constructor(clock = Date.now, maxEntries = 10_000) {
|
|
14
|
+
this.clock = clock;
|
|
15
|
+
this.maxEntries = maxEntries;
|
|
16
|
+
}
|
|
17
|
+
/** Holds `grant` and returns the token that names it. Lapsed grants are dropped first. */
|
|
18
|
+
issue(grant) {
|
|
19
|
+
const now = this.clock();
|
|
20
|
+
for (const [token, held] of this.grants) {
|
|
21
|
+
if (Date.parse(held.expiresAt) <= now)
|
|
22
|
+
this.grants.delete(token);
|
|
23
|
+
}
|
|
24
|
+
if (this.grants.size >= this.maxEntries)
|
|
25
|
+
throw new Error("LOCAL_GRANTS_CAPACITY_EXCEEDED");
|
|
26
|
+
const token = randomBytes(32).toString("base64url");
|
|
27
|
+
this.grants.set(token, Object.freeze({ ...grant }));
|
|
28
|
+
return token;
|
|
29
|
+
}
|
|
30
|
+
/** The grant `token` names, removed so that no second caller can take it. */
|
|
31
|
+
take(token) {
|
|
32
|
+
const grant = this.grants.get(token);
|
|
33
|
+
this.grants.delete(token);
|
|
34
|
+
return grant;
|
|
35
|
+
}
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The `AuthorizationVerifier` for an executor whose authority decides
|
|
39
|
+
* locally. An authorization this process issued is checked against the grant
|
|
40
|
+
* it names and consumed here, once: the grant is taken from the store, and
|
|
41
|
+
* the intent is claimed in the replay store, so neither the same token nor a
|
|
42
|
+
* second decision about the same intent can run it again. Anything else is
|
|
43
|
+
* handed to the delegate unchanged, and a delegated authorization claims the
|
|
44
|
+
* intent too, so an intent is executable once whichever path allowed it.
|
|
45
|
+
*/
|
|
46
|
+
export class LocalAuthorizationVerifier {
|
|
47
|
+
options;
|
|
48
|
+
clock;
|
|
49
|
+
local = new WeakSet();
|
|
50
|
+
constructor(options) {
|
|
51
|
+
this.options = options;
|
|
52
|
+
this.clock = options.clock ?? Date.now;
|
|
53
|
+
}
|
|
54
|
+
async verifyAndConsume(captured, decision) {
|
|
55
|
+
if (decision.authorization === null)
|
|
56
|
+
return null;
|
|
57
|
+
const grant = this.options.grants.take(decision.authorization.token);
|
|
58
|
+
if (grant === undefined)
|
|
59
|
+
return await this.delegated(captured, decision);
|
|
60
|
+
if (decision.verdict !== "ALLOW" ||
|
|
61
|
+
decision.failClosed ||
|
|
62
|
+
decision.decisionId !== grant.decisionId ||
|
|
63
|
+
decision.dossierId !== grant.dossierId ||
|
|
64
|
+
decision.intentHash !== grant.intentHash ||
|
|
65
|
+
decision.authorization.expiresAt !== grant.expiresAt ||
|
|
66
|
+
captured.intentHash !== grant.intentHash ||
|
|
67
|
+
captured.intent.intentId !== grant.intentId ||
|
|
68
|
+
Date.parse(grant.expiresAt) <= this.clock()) {
|
|
69
|
+
return null;
|
|
70
|
+
}
|
|
71
|
+
if (!(await this.options.replay.claim(grant.intentId, new Date(grant.expiresAt))))
|
|
72
|
+
return null;
|
|
73
|
+
const authorization = Object.freeze({
|
|
74
|
+
decisionId: grant.decisionId,
|
|
75
|
+
dossierId: grant.dossierId,
|
|
76
|
+
grantId: `edge:${grant.intentId}`,
|
|
77
|
+
intentHash: grant.intentHash,
|
|
78
|
+
expiresAt: grant.expiresAt,
|
|
79
|
+
});
|
|
80
|
+
this.local.add(authorization);
|
|
81
|
+
return authorization;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
84
|
+
* A local attempt's outcome is recorded where its decision was: in this
|
|
85
|
+
* process's evidence. A delegated one is finalized by its own verifier.
|
|
86
|
+
*/
|
|
87
|
+
async finalize(input) {
|
|
88
|
+
if (!this.local.has(input.authorization)) {
|
|
89
|
+
const finalize = this.options.delegate?.finalize;
|
|
90
|
+
if (finalize === undefined)
|
|
91
|
+
return "PENDING";
|
|
92
|
+
return await finalize.call(this.options.delegate, input);
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
this.options.record({
|
|
96
|
+
event: "EDGE_EXECUTION_FINALIZED",
|
|
97
|
+
intent_id: input.captured.intent.intentId,
|
|
98
|
+
intent_hash: input.authorization.intentHash,
|
|
99
|
+
decision_id: input.authorization.decisionId,
|
|
100
|
+
outcome: input.outcome,
|
|
101
|
+
});
|
|
102
|
+
return "RECORDED";
|
|
103
|
+
}
|
|
104
|
+
catch {
|
|
105
|
+
return "PENDING";
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
async delegated(captured, decision) {
|
|
109
|
+
const delegate = this.options.delegate;
|
|
110
|
+
if (delegate === undefined)
|
|
111
|
+
return null;
|
|
112
|
+
const authorization = await delegate.verifyAndConsume(captured, decision);
|
|
113
|
+
if (authorization === null)
|
|
114
|
+
return null;
|
|
115
|
+
const claimed = await this.options.replay.claim(captured.intent.intentId, new Date(authorization.expiresAt));
|
|
116
|
+
return claimed ? authorization : null;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=LocalAuthorizationVerifier.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"LocalAuthorizationVerifier.js","sourceRoot":"","sources":["../../src/execution/LocalAuthorizationVerifier.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAoB1C;;;;;;GAMG;AACH,MAAM,OAAO,WAAW;IAIH;IACA;IAJF,MAAM,GAAG,IAAI,GAAG,EAAsB,CAAC;IAExD,YACmB,QAAsB,IAAI,CAAC,GAAG,EAC9B,aAAa,MAAM;QADnB,UAAK,GAAL,KAAK,CAAyB;QAC9B,eAAU,GAAV,UAAU,CAAS;IACnC,CAAC;IAEJ,0FAA0F;IACnF,KAAK,CAAC,KAAiB;QAC5B,MAAM,GAAG,GAAG,IAAI,CAAC,KAAK,EAAE,CAAC;QACzB,KAAK,MAAM,CAAC,KAAK,EAAE,IAAI,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxC,IAAI,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,GAAG;gBAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QACnE,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,IA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
|
|
4
|
+
* and the number of rows it touched. A `pg` `Pool` is one; this package does
|
|
5
|
+
* not depend on `pg`, so a deployment that never names the store never loads
|
|
6
|
+
* a database driver.
|
|
7
|
+
*/
|
|
8
|
+
export interface SqlClient {
|
|
9
|
+
query(text: string, values: readonly unknown[]): Promise<{
|
|
10
|
+
readonly rowCount: number | null;
|
|
11
|
+
readonly rows?: readonly unknown[];
|
|
12
|
+
}>;
|
|
13
|
+
}
|
|
14
|
+
export interface PostgresReplayStoreOptions {
|
|
15
|
+
readonly client: SqlClient;
|
|
16
|
+
/**
|
|
17
|
+
* Whose claims these are: the organisation the executor decides for. Two
|
|
18
|
+
* deployments that share a database never see each other's keys.
|
|
19
|
+
*/
|
|
20
|
+
readonly namespace: string;
|
|
21
|
+
/** The claims table, optionally schema-qualified; `agentsafe_edge_replay` by default. */
|
|
22
|
+
readonly table?: string;
|
|
23
|
+
/** How long a lapsed claim is kept before `cleanup` removes it; a day by default. */
|
|
24
|
+
readonly retentionMs?: number;
|
|
25
|
+
readonly clock?: () => number;
|
|
26
|
+
}
|
|
27
|
+
export declare const DEFAULT_REPLAY_TABLE = "agentsafe_edge_replay";
|
|
28
|
+
/**
|
|
29
|
+
* Single use shared by every replica: a claim is one row, unique on
|
|
30
|
+
* `(namespace, intent_id)`, inserted with `ON CONFLICT DO NOTHING`. The
|
|
31
|
+
* database's unique index decides which of two concurrent claims wins, so
|
|
32
|
+
* the same intent decided on two replicas executes once.
|
|
33
|
+
*
|
|
34
|
+
* A row stays until `cleanup` removes it, a retention period after its
|
|
35
|
+
* expiry: a key is never claimable again while its row exists, which is
|
|
36
|
+
* stricter than the in-memory store and never weaker. The operator creates
|
|
37
|
+
* the table (`PostgresReplayStore.schema()`); the executor's role needs
|
|
38
|
+
* SELECT, INSERT and DELETE on it and nothing else.
|
|
39
|
+
*/
|
|
40
|
+
export declare class PostgresReplayStore implements ReplayStore {
|
|
41
|
+
private readonly client;
|
|
42
|
+
private readonly namespace;
|
|
43
|
+
private readonly table;
|
|
44
|
+
private readonly retentionMs;
|
|
45
|
+
private readonly clock;
|
|
46
|
+
constructor(options: PostgresReplayStoreOptions);
|
|
47
|
+
/** The DDL an operator runs once, before the first replica starts. */
|
|
48
|
+
static schema(table?: string): string;
|
|
49
|
+
claim(key: string, expiresAt: Date): Promise<boolean>;
|
|
50
|
+
/** Whether a row holds `key`, lapsed or not: exactly when `claim` would refuse it. */
|
|
51
|
+
consumed(key: string): Promise<boolean>;
|
|
52
|
+
/** Removes every claim that lapsed more than the retention period ago; returns how many. */
|
|
53
|
+
cleanup(): Promise<number>;
|
|
54
|
+
/** Throws unless the table exists with the columns this store uses. */
|
|
55
|
+
probe(): Promise<void>;
|
|
56
|
+
}
|
|
57
|
+
//# sourceMappingURL=PostgresReplayStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresReplayStore.d.ts","sourceRoot":"","sources":["../../src/execution/PostgresReplayStore.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAEpD;;;;;GAKG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CACH,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,SAAS,OAAO,EAAE,GACzB,OAAO,CAAC;QAAE,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,OAAO,EAAE,CAAA;KAAE,CAAC,CAAC;CACtF;AAED,MAAM,WAAW,0BAA0B;IACzC,QAAQ,CAAC,MAAM,EAAE,SAAS,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,yFAAyF;IACzF,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,qFAAqF;IACrF,QAAQ,CAAC,WAAW,CAAC,EAAE,MAAM,CAAC;IAC9B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,MAAM,CAAC;CAC/B;AAED,eAAO,MAAM,oBAAoB,0BAA0B,CAAC;AAM5D;;;;;;;;;;;GAWG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IACrD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAY;IACnC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAS;IAC/B,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAS;IACrC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAe;gBAElB,OAAO,EAAE,0BAA0B;IAiBtD,sEAAsE;WACxD,MAAM,CAAC,KAAK,SAAuB,GAAG,MAAM;IAe7C,KAAK,CAAC,GAAG,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAUlE,sFAAsF;IACzE,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAQpD,4FAA4F;IAC/E,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAQvC,uEAAuE;IAC1D,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC;CAMpC"}
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
export const DEFAULT_REPLAY_TABLE = "agentsafe_edge_replay";
|
|
2
|
+
/** A lowercase SQL identifier, or `schema.table`: interpolated into SQL, so nothing else is. */
|
|
3
|
+
const TABLE = /^[a-z_][a-z0-9_]{0,62}(?:\.[a-z_][a-z0-9_]{0,62})?$/;
|
|
4
|
+
const DAY_MS = 86_400_000;
|
|
5
|
+
/**
|
|
6
|
+
* Single use shared by every replica: a claim is one row, unique on
|
|
7
|
+
* `(namespace, intent_id)`, inserted with `ON CONFLICT DO NOTHING`. The
|
|
8
|
+
* database's unique index decides which of two concurrent claims wins, so
|
|
9
|
+
* the same intent decided on two replicas executes once.
|
|
10
|
+
*
|
|
11
|
+
* A row stays until `cleanup` removes it, a retention period after its
|
|
12
|
+
* expiry: a key is never claimable again while its row exists, which is
|
|
13
|
+
* stricter than the in-memory store and never weaker. The operator creates
|
|
14
|
+
* the table (`PostgresReplayStore.schema()`); the executor's role needs
|
|
15
|
+
* SELECT, INSERT and DELETE on it and nothing else.
|
|
16
|
+
*/
|
|
17
|
+
export class PostgresReplayStore {
|
|
18
|
+
client;
|
|
19
|
+
namespace;
|
|
20
|
+
table;
|
|
21
|
+
retentionMs;
|
|
22
|
+
clock;
|
|
23
|
+
constructor(options) {
|
|
24
|
+
const table = options.table ?? DEFAULT_REPLAY_TABLE;
|
|
25
|
+
if (!TABLE.test(table))
|
|
26
|
+
throw new Error("REPLAY_TABLE_INVALID");
|
|
27
|
+
if (options.namespace.length === 0 || options.namespace.length > 200) {
|
|
28
|
+
throw new Error("REPLAY_NAMESPACE_INVALID");
|
|
29
|
+
}
|
|
30
|
+
const retentionMs = options.retentionMs ?? DAY_MS;
|
|
31
|
+
if (!Number.isSafeInteger(retentionMs) || retentionMs < 0) {
|
|
32
|
+
throw new Error("REPLAY_RETENTION_INVALID");
|
|
33
|
+
}
|
|
34
|
+
this.client = options.client;
|
|
35
|
+
this.namespace = options.namespace;
|
|
36
|
+
this.table = table;
|
|
37
|
+
this.retentionMs = retentionMs;
|
|
38
|
+
this.clock = options.clock ?? Date.now;
|
|
39
|
+
}
|
|
40
|
+
/** The DDL an operator runs once, before the first replica starts. */
|
|
41
|
+
static schema(table = DEFAULT_REPLAY_TABLE) {
|
|
42
|
+
if (!TABLE.test(table))
|
|
43
|
+
throw new Error("REPLAY_TABLE_INVALID");
|
|
44
|
+
return [
|
|
45
|
+
`CREATE TABLE IF NOT EXISTS ${table} (`,
|
|
46
|
+
" namespace text NOT NULL,",
|
|
47
|
+
" intent_id text NOT NULL,",
|
|
48
|
+
" expires_at timestamptz NOT NULL,",
|
|
49
|
+
" claimed_at timestamptz NOT NULL DEFAULT now(),",
|
|
50
|
+
" PRIMARY KEY (namespace, intent_id)",
|
|
51
|
+
");",
|
|
52
|
+
`CREATE INDEX IF NOT EXISTS ${table.replace(".", "_")}_expires_at ON ${table} (expires_at);`,
|
|
53
|
+
"",
|
|
54
|
+
].join("\n");
|
|
55
|
+
}
|
|
56
|
+
async claim(key, expiresAt) {
|
|
57
|
+
const expiry = expiresAt.valueOf();
|
|
58
|
+
if (key.length === 0 || key.length > 200 || !(expiry > this.clock()))
|
|
59
|
+
return false;
|
|
60
|
+
const result = await this.client.query(`INSERT INTO ${this.table} (namespace, intent_id, expires_at) VALUES ($1, $2, $3) ON CONFLICT (namespace, intent_id) DO NOTHING`, [this.namespace, key, new Date(expiry).toISOString()]);
|
|
61
|
+
return result.rowCount === 1;
|
|
62
|
+
}
|
|
63
|
+
/** Whether a row holds `key`, lapsed or not: exactly when `claim` would refuse it. */
|
|
64
|
+
async consumed(key) {
|
|
65
|
+
const result = await this.client.query(`SELECT 1 FROM ${this.table} WHERE namespace = $1 AND intent_id = $2`, [this.namespace, key]);
|
|
66
|
+
return result.rowCount === 1;
|
|
67
|
+
}
|
|
68
|
+
/** Removes every claim that lapsed more than the retention period ago; returns how many. */
|
|
69
|
+
async cleanup() {
|
|
70
|
+
const before = new Date(this.clock() - this.retentionMs).toISOString();
|
|
71
|
+
const result = await this.client.query(`DELETE FROM ${this.table} WHERE expires_at <= $1`, [
|
|
72
|
+
before,
|
|
73
|
+
]);
|
|
74
|
+
return result.rowCount ?? 0;
|
|
75
|
+
}
|
|
76
|
+
/** Throws unless the table exists with the columns this store uses. */
|
|
77
|
+
async probe() {
|
|
78
|
+
await this.client.query(`SELECT namespace, intent_id, expires_at FROM ${this.table} LIMIT 0`, []);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
//# sourceMappingURL=PostgresReplayStore.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostgresReplayStore.js","sourceRoot":"","sources":["../../src/execution/PostgresReplayStore.ts"],"names":[],"mappings":"AA6BA,MAAM,CAAC,MAAM,oBAAoB,GAAG,uBAAuB,C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AG,IAAI,CAAC,WAAW,CAAC,CAAC,WAAW,EAAE,CAAC;QACvE,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,eAAe,IAAI,CAAC,KAAK,yBAAyB,EAAE;YACzF,MAAM;SACP,CAAC,CAAC;QACH,OAAO,MAAM,CAAC,QAAQ,IAAI,CAAC,CAAC;IAC9B,CAAC;IAED,uEAAuE;IAChE,KAAK,CAAC,KAAK;QAChB,MAAM,IAAI,CAAC,MAAM,CAAC,KAAK,CACrB,gDAAgD,IAAI,CAAC,KAAK,UAAU,EACpE,EAAE,CACH,CAAC;IACJ,CAAC;CACF"}
|
|
@@ -1,10 +1,24 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single use. `claim` takes a key once until its expiry; a second claim of
|
|
3
|
+
* the same key, from this process or, for a shared store, from any replica,
|
|
4
|
+
* answers false. `consumed` asks without claiming, so a decision about an
|
|
5
|
+
* intent that has already run can be refused before it is made.
|
|
6
|
+
*/
|
|
1
7
|
export interface ReplayStore {
|
|
2
8
|
claim(grantId: string, expiresAt: Date): Promise<boolean>;
|
|
9
|
+
/** Whether `key` holds an unexpired claim. Optional: a store without it is never asked. */
|
|
10
|
+
consumed?(key: string): Promise<boolean>;
|
|
3
11
|
}
|
|
12
|
+
/**
|
|
13
|
+
* The claims of one process. Single use holds within that process only: a
|
|
14
|
+
* deployment with more than one replica needs a shared store (the Postgres
|
|
15
|
+
* one), or the same intent decided on two replicas runs twice.
|
|
16
|
+
*/
|
|
4
17
|
export declare class InMemoryReplayStore implements ReplayStore {
|
|
5
18
|
private readonly maxEntries;
|
|
6
19
|
private readonly claims;
|
|
7
20
|
constructor(maxEntries?: number);
|
|
8
21
|
claim(grantId: string, expiresAt: Date): Promise<boolean>;
|
|
22
|
+
consumed(key: string): Promise<boolean>;
|
|
9
23
|
}
|
|
10
24
|
//# sourceMappingURL=ReplayStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplayStore.d.ts","sourceRoot":"","sources":["../../src/execution/ReplayStore.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"ReplayStore.d.ts","sourceRoot":"","sources":["../../src/execution/ReplayStore.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AACH,MAAM,WAAW,WAAW;IAC1B,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;IAC1D,2FAA2F;IAC3F,QAAQ,CAAC,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC,CAAC;CAC1C;AAED;;;;GAIG;AACH,qBAAa,mBAAoB,YAAW,WAAW;IAGlC,OAAO,CAAC,QAAQ,CAAC,UAAU;IAF9C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAA6B;gBAEhB,UAAU,SAAS;IAM1C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC;IAezD,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;CAGrD"}
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The claims of one process. Single use holds within that process only: a
|
|
3
|
+
* deployment with more than one replica needs a shared store (the Postgres
|
|
4
|
+
* one), or the same intent decided on two replicas runs twice.
|
|
5
|
+
*/
|
|
1
6
|
export class InMemoryReplayStore {
|
|
2
7
|
maxEntries;
|
|
3
8
|
claims = new Map();
|
|
@@ -24,5 +29,8 @@ export class InMemoryReplayStore {
|
|
|
24
29
|
this.claims.set(grantId, expiry);
|
|
25
30
|
return true;
|
|
26
31
|
}
|
|
32
|
+
async consumed(key) {
|
|
33
|
+
return (this.claims.get(key) ?? 0) > Date.now();
|
|
34
|
+
}
|
|
27
35
|
}
|
|
28
36
|
//# sourceMappingURL=ReplayStore.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ReplayStore.js","sourceRoot":"","sources":["../../src/execution/ReplayStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ReplayStore.js","sourceRoot":"","sources":["../../src/execution/ReplayStore.ts"],"names":[],"mappings":"AAYA;;;;GAIG;AACH,MAAM,OAAO,mBAAmB;IAGM;IAFnB,MAAM,GAAG,IAAI,GAAG,EAAkB,CAAC;IAEpD,YAAoC,aAAa,MAAM;QAAnB,eAAU,GAAV,UAAU,CAAS;QACrD,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,UAAU,CAAC,IAAI,UAAU,GAAG,CAAC,EAAE,CAAC;YACxD,MAAM,IAAI,KAAK,CAAC,+BAA+B,CAAC,CAAC;QACnD,CAAC;IACH,CAAC;IAEM,KAAK,CAAC,KAAK,CAAC,OAAe,EAAE,SAAe;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;QACvB,MAAM,MAAM,GAAG,SAAS,CAAC,OAAO,EAAE,CAAC;QACnC,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,IAAI,OAAO,CAAC,MAAM,GAAG,GAAG,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,MAAM,IAAI,GAAG,EAAE,CAAC;YAC9F,OAAO,KAAK,CAAC;QACf,CAAC;QACD,KAAK,MAAM,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;YACxC,IAAI,MAAM,IAAI,GAAG;gBAAE,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7C,CAAC;QACD,IAAI,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC;YAAE,OAAO,KAAK,CAAC;QAC3C,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI,CAAC,UAAU;YAAE,MAAM,IAAI,KAAK,CAAC,gCAAgC,CAAC,CAAC;QAC3F,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QACjC,OAAO,IAAI,CAAC;IACd,CAAC;IAEM,KAAK,CAAC,QAAQ,CAAC,GAAW;QAC/B,OAAO,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,IAAI,CAAC,GAAG,EAAE,CAAC;IAClD,CAAC;CACF"}
|
|
@@ -2,8 +2,43 @@ import type { GateDecision } from "../decision/DecisionAuthority.js";
|
|
|
2
2
|
import type { AuditRecorder } from "../audit/AuditRecorder.js";
|
|
3
3
|
import type { CapturedIntent } from "../intent/ExecutionIntent.js";
|
|
4
4
|
import type { ActionRegistry } from "./ActionRegistry.js";
|
|
5
|
-
import type { AuthorizationVerifier, ExecutionFinalization, VerifiedAuthorization } from "./AuthorizationVerifier.js";
|
|
6
|
-
export type ExecutionBlockReason = "DECISION_NOT_AUTHORITATIVE" | "DECISION_NOT_ALLOW" | "INTENT_BINDING_MISMATCH" | "INTENT_CONFORMANCE_FAILED" | "AUTHORIZATION_MISSING" | "AUTHORIZATION_INVALID" | "RECOVERY_BINDING_MISMATCH" | "AUDIT_UNAVAILABLE";
|
|
5
|
+
import type { AuthorizationVerifier, ExecutionCommitOutcome, ExecutionFinalization, VerifiedAuthorization } from "./AuthorizationVerifier.js";
|
|
6
|
+
export type ExecutionBlockReason = "DECISION_NOT_AUTHORITATIVE" | "DECISION_NOT_ALLOW" | "INTENT_BINDING_MISMATCH" | "INTENT_CONFORMANCE_FAILED" | "AUTHORIZATION_MISSING" | "AUTHORIZATION_INVALID" | "RECOVERY_BINDING_MISMATCH" | "RECOVERY_ATTEMPT_UNKNOWN" | "BOUNDARY_MISMATCH" | "WORKLOAD_MISMATCH" | "AUDIT_UNAVAILABLE";
|
|
7
|
+
/**
|
|
8
|
+
* What this executor is, beyond the registry and the verifier it was given.
|
|
9
|
+
*
|
|
10
|
+
* `boundaryId` names the enforcement boundary this process is. When it is
|
|
11
|
+
* set, an intent is executable here only if it was captured here: an
|
|
12
|
+
* authority issued through one boundary cannot be presented at another, and
|
|
13
|
+
* an intent that names no boundary at all is not executable by a boundary
|
|
14
|
+
* that expects to be named. Leaving it unset is the existing behaviour
|
|
15
|
+
* exactly, which is what a deployment with one gateway wants.
|
|
16
|
+
*/
|
|
17
|
+
export interface SafeExecutorOptions {
|
|
18
|
+
readonly boundaryId?: string;
|
|
19
|
+
/**
|
|
20
|
+
* The digest of the workload this executor runs as. When it is set, an
|
|
21
|
+
* intent proposed by a different artifact is refused: authority granted to
|
|
22
|
+
* one signed workload is not authority for the next one to reuse. Absent,
|
|
23
|
+
* as it is wherever no runtime describes the artifact, nothing is checked —
|
|
24
|
+
* a policy that requires provenance refuses at the authority instead.
|
|
25
|
+
*/
|
|
26
|
+
readonly workloadDigest?: string;
|
|
27
|
+
/**
|
|
28
|
+
* This executor's own record of the attempts it dispatched. A recovery
|
|
29
|
+
* reference is something a caller presents, so its decision and grant are
|
|
30
|
+
* claims; with a record to hold them against, reconciliation proceeds only
|
|
31
|
+
* for a binding this executor journaled before dispatch. Absent, the
|
|
32
|
+
* lookup still runs, and its audit events say `NON_AUTHORITATIVE`, because
|
|
33
|
+
* nothing here vouches for a binding it was only told about.
|
|
34
|
+
*/
|
|
35
|
+
readonly attempts?: DispatchedAttempts;
|
|
36
|
+
}
|
|
37
|
+
/** Where an executor reads back the authorizations it dispatched an intent under. */
|
|
38
|
+
export interface DispatchedAttempts {
|
|
39
|
+
/** Every authorization journaled for this intent, oldest first; none when it was never dispatched here. */
|
|
40
|
+
authorizationsOf(captured: CapturedIntent): Promise<readonly VerifiedAuthorization[]>;
|
|
41
|
+
}
|
|
7
42
|
export type ExecutionPreDispatchFailureReason = "HANDLER_FAILED_BEFORE_DISPATCH" | "AUDIT_UNAVAILABLE";
|
|
8
43
|
/**
|
|
9
44
|
* What a caller presents back to reconcile an attempt whose outcome was
|
|
@@ -68,6 +103,8 @@ export type SafeExecutionResult<TResult = unknown> = {
|
|
|
68
103
|
readonly outcome: "FAILED_BEFORE_DISPATCH";
|
|
69
104
|
readonly executed: false;
|
|
70
105
|
readonly reason: ExecutionPreDispatchFailureReason;
|
|
106
|
+
/** Why the handler refused, when it threw a `PreDispatchRefusal`. */
|
|
107
|
+
readonly code?: string;
|
|
71
108
|
readonly result: null;
|
|
72
109
|
readonly authorization: VerifiedAuthorization;
|
|
73
110
|
readonly finalization: ExecutionFinalization;
|
|
@@ -90,13 +127,84 @@ export type ExecutionReconciliationResult<TResult = unknown> = {
|
|
|
90
127
|
readonly result: null;
|
|
91
128
|
readonly authorization: VerifiedAuthorization;
|
|
92
129
|
} | ExecutionBlockedResult | ProviderOutcomeUnknownResult;
|
|
130
|
+
/**
|
|
131
|
+
* A grant admitted for a later claim. Every check `run` makes before it
|
|
132
|
+
* consumes a grant has passed, and nothing has been consumed: the grant is
|
|
133
|
+
* still the authority's to hand out once. Only `hold` issues one, only the
|
|
134
|
+
* executor that issued it can claim it, and it is claimed at most once.
|
|
135
|
+
*
|
|
136
|
+
* This is for an effect that another system performs at a moment this
|
|
137
|
+
* process does not choose, such as a card authorization the issuer asks
|
|
138
|
+
* about in milliseconds: the decision is made before, the grant waits here,
|
|
139
|
+
* and the claim happens when that system asks for it.
|
|
140
|
+
*/
|
|
141
|
+
export interface HeldExecution {
|
|
142
|
+
readonly captured: CapturedIntent;
|
|
143
|
+
readonly decision: GateDecision;
|
|
144
|
+
/** The grant's own expiry: after it there is nothing left to claim. */
|
|
145
|
+
readonly expiresAt: string;
|
|
146
|
+
}
|
|
147
|
+
export interface ExecutionHeldResult {
|
|
148
|
+
readonly outcome: "HELD";
|
|
149
|
+
readonly executed: false;
|
|
150
|
+
readonly result: null;
|
|
151
|
+
readonly authorization: null;
|
|
152
|
+
readonly held: HeldExecution;
|
|
153
|
+
}
|
|
154
|
+
export type HeldClaimResult = {
|
|
155
|
+
readonly outcome: "CLAIMED";
|
|
156
|
+
readonly authorization: VerifiedAuthorization;
|
|
157
|
+
} | ExecutionBlockedResult | Extract<SafeExecutionResult<never>, {
|
|
158
|
+
outcome: "FAILED_BEFORE_DISPATCH";
|
|
159
|
+
}>;
|
|
93
160
|
export declare class SafeExecutor {
|
|
94
161
|
private readonly registry;
|
|
95
162
|
private readonly verifier;
|
|
96
163
|
private readonly audit?;
|
|
97
164
|
private readonly hasher;
|
|
98
|
-
|
|
165
|
+
private readonly boundaryId;
|
|
166
|
+
private readonly workloadDigest;
|
|
167
|
+
/** The holds this executor issued and nobody has claimed, keyed by the frozen handle. */
|
|
168
|
+
private readonly holds;
|
|
169
|
+
/** The holds claimed and not yet settled, with the authorization each one consumed. */
|
|
170
|
+
private readonly claims;
|
|
171
|
+
private readonly attempts;
|
|
172
|
+
constructor(registry: ActionRegistry, verifier: AuthorizationVerifier, audit?: AuditRecorder | undefined, options?: SafeExecutorOptions);
|
|
99
173
|
run<TResult = unknown>(captured: CapturedIntent, decision: GateDecision): Promise<SafeExecutionResult<TResult>>;
|
|
174
|
+
/**
|
|
175
|
+
* Every check made before a grant may be consumed, with the evidence that
|
|
176
|
+
* the intent was captured and decided. A refusal is recorded and returned;
|
|
177
|
+
* null means the decision passed, and so carries a grant.
|
|
178
|
+
*/
|
|
179
|
+
private admit;
|
|
180
|
+
/**
|
|
181
|
+
* Consumes the grant through the verifier, checks what came back against
|
|
182
|
+
* the decision and the intent, and records the consumption and the start
|
|
183
|
+
* of execution. Nothing here dispatches.
|
|
184
|
+
*/
|
|
185
|
+
private consume;
|
|
186
|
+
/**
|
|
187
|
+
* Admits a decision exactly as `run` would and holds its grant instead of
|
|
188
|
+
* consuming it. The intent, the decision and the hold are recorded; the
|
|
189
|
+
* grant stays unclaimed until `claimHeld` is called with the handle, and an
|
|
190
|
+
* unclaimed hold simply expires with its grant.
|
|
191
|
+
*/
|
|
192
|
+
hold(captured: CapturedIntent, decision: GateDecision): Promise<ExecutionHeldResult | ExecutionBlockedResult>;
|
|
193
|
+
/**
|
|
194
|
+
* Claims a held grant, once. The handle is forgotten before the verifier
|
|
195
|
+
* is asked, so a second claim of the same hold, concurrent or later, is
|
|
196
|
+
* refused here without reaching the authority; a handle this executor did
|
|
197
|
+
* not issue is refused the same way. What the claim returns is checked
|
|
198
|
+
* exactly as `run` checks it.
|
|
199
|
+
*/
|
|
200
|
+
claimHeld(held: HeldExecution): Promise<HeldClaimResult>;
|
|
201
|
+
/**
|
|
202
|
+
* Reports how a claimed hold ended, once: `COMMITTED` when the effect
|
|
203
|
+
* happened, `FAILED` when it definitively did not, `INDETERMINATE` when
|
|
204
|
+
* nobody can say. The terminal record names the outcome, as `run`'s do.
|
|
205
|
+
*/
|
|
206
|
+
settleHeld(held: HeldExecution, outcome: ExecutionCommitOutcome, receipt?: string | null): Promise<ExecutionFinalization>;
|
|
207
|
+
private static settledEvent;
|
|
100
208
|
/**
|
|
101
209
|
* Reports the attempt outcome to the verifier's authority, with the
|
|
102
210
|
* provider's effect receipt when the attempt brought one back. A missing,
|
|
@@ -111,11 +219,25 @@ export declare class SafeExecutor {
|
|
|
111
219
|
* or a JSON round trip.
|
|
112
220
|
*/
|
|
113
221
|
private static isAuthoritativeDecision;
|
|
222
|
+
/**
|
|
223
|
+
* Whether this boundary is the one the intent was captured through. The
|
|
224
|
+
* boundary is read back out of the hashed context, so an intent whose
|
|
225
|
+
* boundary was edited after capture fails conformance before it reaches
|
|
226
|
+
* here, and one that never named a boundary cannot acquire one now.
|
|
227
|
+
*/
|
|
228
|
+
private boundaryMatches;
|
|
229
|
+
/**
|
|
230
|
+
* Whether the workload that proposed the intent is the one running it. Like
|
|
231
|
+
* the boundary, the digest is read back out of the hashed context, so an
|
|
232
|
+
* intent whose workload was edited after capture fails conformance first.
|
|
233
|
+
*/
|
|
234
|
+
private workloadMatches;
|
|
114
235
|
private intentConforms;
|
|
115
236
|
private block;
|
|
116
237
|
private failedBeforeDispatch;
|
|
117
238
|
private record;
|
|
118
239
|
private static recoveryReference;
|
|
240
|
+
private static sameBinding;
|
|
119
241
|
private static authorizationFrom;
|
|
120
242
|
}
|
|
121
243
|
//# sourceMappingURL=SafeExecutor.d.ts.map
|