@code-yeongyu/senpi-agent-core 2026.11.3-3 → 2026.11.5-1

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 (167) hide show
  1. package/dist/agent-loop.js +20 -186
  2. package/dist/agent.d.ts +4 -0
  3. package/dist/agent.js +4 -0
  4. package/dist/conformance/index.d.ts +30 -0
  5. package/dist/conformance/index.js +21 -0
  6. package/dist/conformance/loop-core-manifest.d.ts +1 -1
  7. package/dist/conformance/loop-core-manifest.js +18 -0
  8. package/dist/conformance/registry.js +20 -18
  9. package/dist/egress/types.d.ts +102 -0
  10. package/dist/egress/types.js +7 -0
  11. package/dist/execution/canonical-digest.d.ts +10 -0
  12. package/dist/execution/canonical-digest.js +20 -0
  13. package/dist/execution/canonical-json.d.ts +3 -0
  14. package/dist/execution/canonical-json.js +12 -0
  15. package/dist/execution/chain-count.d.ts +26 -0
  16. package/dist/execution/chain-count.js +45 -0
  17. package/dist/execution/coordinator-codec.js +13 -2
  18. package/dist/execution/coordinator-consent.d.ts +29 -0
  19. package/dist/execution/coordinator-consent.js +63 -0
  20. package/dist/execution/coordinator-plan.d.ts +1 -2
  21. package/dist/execution/coordinator-plan.js +4 -17
  22. package/dist/execution/coordinator-sequential.d.ts +15 -0
  23. package/dist/execution/coordinator-sequential.js +34 -0
  24. package/dist/execution/coordinator-types.d.ts +45 -0
  25. package/dist/execution/coordinator.d.ts +3 -1
  26. package/dist/execution/coordinator.js +35 -3
  27. package/dist/execution/device-files-node.d.ts +8 -0
  28. package/dist/execution/device-files-node.js +150 -0
  29. package/dist/execution/device-files.d.ts +109 -0
  30. package/dist/execution/device-files.js +124 -0
  31. package/dist/execution/ledger-types.d.ts +3 -1
  32. package/dist/execution/ledger.d.ts +9 -3
  33. package/dist/execution/ledger.js +8 -2
  34. package/dist/execution/loop-hook-host-hand.d.ts +33 -0
  35. package/dist/execution/loop-hook-host-hand.js +71 -0
  36. package/dist/execution/loop-hook-host-protocol.d.ts +46 -0
  37. package/dist/execution/loop-hook-host-protocol.js +47 -0
  38. package/dist/execution/loop-hook-host.d.ts +40 -0
  39. package/dist/execution/loop-hook-host.js +87 -0
  40. package/dist/execution/nested-codec.d.ts +5 -0
  41. package/dist/execution/nested-codec.js +41 -0
  42. package/dist/execution/nested-types.d.ts +92 -0
  43. package/dist/execution/nested-types.js +3 -0
  44. package/dist/execution/nested.d.ts +48 -0
  45. package/dist/execution/nested.js +206 -0
  46. package/dist/execution/plane-model.d.ts +33 -0
  47. package/dist/execution/plane-model.js +80 -0
  48. package/dist/execution/plane-session.d.ts +56 -0
  49. package/dist/execution/plane-session.js +178 -0
  50. package/dist/execution/plane.d.ts +75 -0
  51. package/dist/execution/plane.js +172 -0
  52. package/dist/execution/prepared/executor-body.d.ts +22 -0
  53. package/dist/execution/prepared/executor-body.js +73 -0
  54. package/dist/execution/prepared/executor-freeze.d.ts +17 -0
  55. package/dist/execution/prepared/executor-freeze.js +42 -0
  56. package/dist/execution/prepared/executor-pipeline.d.ts +11 -0
  57. package/dist/execution/prepared/executor-pipeline.js +26 -0
  58. package/dist/execution/prepared/executor-types.d.ts +131 -0
  59. package/dist/execution/prepared/executor-types.js +2 -0
  60. package/dist/execution/prepared/executor.d.ts +8 -0
  61. package/dist/execution/prepared/executor.js +261 -0
  62. package/dist/execution/prepared/memory-batch-store.d.ts +4 -0
  63. package/dist/execution/prepared/memory-batch-store.js +4 -0
  64. package/dist/execution/prepared/pipeline-prepared-batch.d.ts +27 -0
  65. package/dist/execution/prepared/pipeline-prepared-batch.js +175 -0
  66. package/dist/execution/prepared/pipeline-prepared.d.ts +10 -0
  67. package/dist/execution/prepared/pipeline-prepared.js +54 -0
  68. package/dist/execution/remote-device-files.d.ts +12 -0
  69. package/dist/execution/remote-device-files.js +113 -0
  70. package/dist/execution/remote-epoch-gate.d.ts +19 -0
  71. package/dist/execution/remote-epoch-gate.js +46 -0
  72. package/dist/execution/remote-epoch.d.ts +53 -0
  73. package/dist/execution/remote-epoch.js +74 -0
  74. package/dist/execution/remote-executor.d.ts +17 -0
  75. package/dist/execution/remote-executor.js +70 -18
  76. package/dist/execution/remote-file-call.d.ts +14 -0
  77. package/dist/execution/remote-file-call.js +31 -0
  78. package/dist/execution/remote-hand-ledger.d.ts +11 -3
  79. package/dist/execution/remote-hand-ledger.js +31 -15
  80. package/dist/execution/remote-link.d.ts +41 -0
  81. package/dist/execution/remote-link.js +153 -0
  82. package/dist/execution/remote-protocol.d.ts +50 -4
  83. package/dist/execution/remote-protocol.js +48 -2
  84. package/dist/execution/remote-tool-host.d.ts +23 -3
  85. package/dist/execution/remote-tool-host.js +25 -64
  86. package/dist/execution/scope-lifecycle.d.ts +81 -0
  87. package/dist/execution/scope-lifecycle.js +173 -0
  88. package/dist/execution/testing/batch-executor.js +32 -3
  89. package/dist/execution/testing/batch-harness.d.ts +25 -3
  90. package/dist/execution/testing/batch-harness.js +83 -5
  91. package/dist/execution/testing/cancel-cases.d.ts +8 -0
  92. package/dist/execution/testing/cancel-cases.js +64 -0
  93. package/dist/execution/testing/consent-cases.d.ts +14 -0
  94. package/dist/execution/testing/consent-cases.js +66 -0
  95. package/dist/execution/testing/epoch-cases.d.ts +8 -0
  96. package/dist/execution/testing/epoch-cases.js +84 -0
  97. package/dist/execution/testing/epoch-harness.d.ts +47 -0
  98. package/dist/execution/testing/epoch-harness.js +172 -0
  99. package/dist/execution/testing/epoch-registry.d.ts +3 -0
  100. package/dist/execution/testing/epoch-registry.js +17 -0
  101. package/dist/execution/testing/hand-harness.d.ts +3 -0
  102. package/dist/execution/testing/hand-harness.js +27 -22
  103. package/dist/execution/testing/hand-registry.d.ts +3 -0
  104. package/dist/execution/testing/hand-registry.js +20 -0
  105. package/dist/execution/testing/kill-epoch.d.ts +9 -0
  106. package/dist/execution/testing/kill-epoch.js +71 -0
  107. package/dist/execution/testing/kill-hook.d.ts +14 -0
  108. package/dist/execution/testing/kill-hook.js +117 -0
  109. package/dist/execution/testing/kill-nest.d.ts +6 -0
  110. package/dist/execution/testing/kill-nest.js +55 -0
  111. package/dist/execution/testing/kill-wakex.d.ts +6 -0
  112. package/dist/execution/testing/kill-wakex.js +81 -0
  113. package/dist/execution/testing/lifecycle-cases.d.ts +9 -0
  114. package/dist/execution/testing/lifecycle-cases.js +60 -0
  115. package/dist/execution/testing/lifecycle-registry.d.ts +3 -0
  116. package/dist/execution/testing/lifecycle-registry.js +19 -0
  117. package/dist/execution/testing/multi-epoch-cases.d.ts +4 -0
  118. package/dist/execution/testing/multi-epoch-cases.js +29 -0
  119. package/dist/execution/testing/multi-lifecycle-cases.d.ts +4 -0
  120. package/dist/execution/testing/multi-lifecycle-cases.js +34 -0
  121. package/dist/execution/testing/multi-seq-cases.d.ts +4 -0
  122. package/dist/execution/testing/multi-seq-cases.js +46 -0
  123. package/dist/execution/testing/nest-cases.d.ts +39 -0
  124. package/dist/execution/testing/nest-cases.js +181 -0
  125. package/dist/execution/testing/nest-registry.d.ts +3 -0
  126. package/dist/execution/testing/nest-registry.js +27 -0
  127. package/dist/execution/testing/scope-cases.d.ts +6 -0
  128. package/dist/execution/testing/scope-cases.js +49 -0
  129. package/dist/execution/testing/seq-cases.d.ts +6 -0
  130. package/dist/execution/testing/seq-cases.js +71 -0
  131. package/dist/execution/testing/seq-registry.d.ts +3 -0
  132. package/dist/execution/testing/seq-registry.js +32 -0
  133. package/dist/execution/testing/wake-exec-cases.d.ts +20 -0
  134. package/dist/execution/testing/wake-exec-cases.js +147 -0
  135. package/dist/execution/testing/wake-registry.d.ts +3 -0
  136. package/dist/execution/testing/wake-registry.js +26 -0
  137. package/dist/execution/tool-host.d.ts +23 -3
  138. package/dist/execution/tool-host.js +18 -1
  139. package/dist/execution/tool-outcome-events.d.ts +11 -0
  140. package/dist/execution/tool-outcome-events.js +47 -0
  141. package/dist/execution/wake-inbox.d.ts +25 -0
  142. package/dist/execution/wake-inbox.js +85 -0
  143. package/dist/execution/wake-outbox.d.ts +30 -0
  144. package/dist/execution/wake-outbox.js +87 -0
  145. package/dist/execution/wake-types.d.ts +45 -0
  146. package/dist/execution/wake-types.js +3 -0
  147. package/dist/harness/agent-harness.d.ts +6 -0
  148. package/dist/harness/execution/tool-host-call.d.ts +13 -0
  149. package/dist/harness/execution/tool-host-call.js +55 -0
  150. package/dist/harness/execution/tools.d.ts +2 -1
  151. package/dist/harness/execution/tools.js +32 -17
  152. package/dist/harness/runtime/drive/tools.js +1 -1
  153. package/dist/harness/runtime/harness.js +1 -0
  154. package/dist/harness/runtime/types.d.ts +1 -0
  155. package/dist/index.d.ts +27 -2
  156. package/dist/index.js +24 -1
  157. package/dist/node.d.ts +1 -0
  158. package/dist/node.js +1 -0
  159. package/dist/public-entry.d.ts +10 -0
  160. package/dist/public-entry.js +23 -0
  161. package/dist/step-commit.d.ts +24 -0
  162. package/dist/step-commit.js +24 -0
  163. package/dist/tool-name-alias.d.ts +1 -7
  164. package/dist/tool-name-alias.js +0 -17
  165. package/dist/transport/testing/multi-cases.js +8 -8
  166. package/dist/types.d.ts +37 -1
  167. package/package.json +3 -3
@@ -0,0 +1,71 @@
1
+ import { expectEqual } from "../../durable/testing/store-harness.js";
2
+ import { texts } from "./epoch-cases.js";
3
+ import { floorCommit, openEpochRig, stepCommit } from "./epoch-harness.js";
4
+ import { call } from "./hand-harness.js";
5
+ const OLD = { name: "brain-old", epoch: 1 };
6
+ const NEW = { name: "brain-new", epoch: 2 };
7
+ const FENCED = "the old owner stays fenced";
8
+ const POINTS = [
9
+ {
10
+ id: "KILL-EPOCH-01-B",
11
+ match: floorCommit("s", NEW.epoch),
12
+ at: "before",
13
+ floorAfterKill: OLD.epoch,
14
+ newCallRuns: true,
15
+ expected: `kill before the floor raise is durable: no ACK; the re-sent floor is acked after restart, the new call runs once, ${FENCED}`,
16
+ },
17
+ {
18
+ id: "KILL-EPOCH-01-D",
19
+ match: floorCommit("s", NEW.epoch),
20
+ at: "durable",
21
+ floorAfterKill: NEW.epoch,
22
+ newCallRuns: true,
23
+ expected: `kill once the floor is durable, before its ACK: the restarted hand holds the floor, the new call runs once, ${FENCED}`,
24
+ },
25
+ {
26
+ id: "KILL-EPOCH-02-B",
27
+ match: stepCommit(NEW.name, "admit"),
28
+ at: "before",
29
+ floorAfterKill: NEW.epoch,
30
+ newCallRuns: true,
31
+ expected: `kill after the ACK, before the new owner's first call is recorded: the floor survives, the call runs once, ${FENCED}`,
32
+ },
33
+ {
34
+ id: "KILL-EPOCH-02-D",
35
+ match: stepCommit(NEW.name, "admit"),
36
+ at: "durable",
37
+ floorAfterKill: NEW.epoch,
38
+ newCallRuns: false,
39
+ expected: `kill once the new owner's first call is recorded: the floor survives, the call ends hand_restarted and never runs, ${FENCED}`,
40
+ },
41
+ ];
42
+ const cases = POINTS.map((point) => {
43
+ const run = async (adapters) => {
44
+ const what = point.id;
45
+ const rig = await openEpochRig(adapters, { brains: [OLD, NEW], kill: { match: point.match, at: point.at } });
46
+ rig.setOwner("s", OLD.name);
47
+ await rig.settle(rig.execute(OLD.name, "s", [call("c0")]), `${what}: the old owner's first call`);
48
+ rig.setOwner("s", NEW.name);
49
+ const moved = rig.execute(NEW.name, "s", [call("c1")]);
50
+ await rig.settle(rig.killed, `${what}: the kill point fired`);
51
+ expectEqual(await rig.floor("s"), { epoch: point.floorAfterKill, owner: point.floorAfterKill === NEW.epoch ? NEW.name : OLD.name }, `${what}: the floor durable at the kill`);
52
+ await rig.restart();
53
+ const result = await rig.settle(moved, `${what}: the new owner's call`);
54
+ if (point.newCallRuns)
55
+ expectEqual(texts(result), ["ran:c1"], `${what}: the new owner's call ran`);
56
+ else
57
+ expectEqual(result.messages[0]?.details, { outcome: "hand_restarted", uncertain: false, hooksRan: false }, `${what}: the recorded call ended hand_restarted, not uncertain`);
58
+ const delayed = await rig.settle(rig.execute(OLD.name, "s", [call("c2")]), `${what}: a delayed old-owner call`);
59
+ expectEqual(delayed.messages[0]?.isError, true, `${what}: the old owner's delayed call is refused`);
60
+ await rig.advance(200);
61
+ expectEqual(rig.bodies, point.newCallRuns ? ["s:c0", "s:c1"] : ["s:c0"], `${what}: tool body runs`);
62
+ expectEqual((await rig.rows()).map(({ commandId, progress }) => [commandId, progress.state]), [
63
+ ["brain-new-1", "acked"],
64
+ ["brain-old-1", "acked"],
65
+ ], `${what}: one durable record per call that reached the ledger, acknowledged`);
66
+ };
67
+ return { declaration: { id: point.id, expected: point.expected }, run };
68
+ });
69
+ export const KILL_EPOCH_DECLARATIONS = cases.map(({ declaration }) => declaration);
70
+ export const KILL_EPOCH_CASES = new Map(cases.map(({ declaration, run }) => [declaration.id, run]));
71
+ //# sourceMappingURL=kill-epoch.js.map
@@ -0,0 +1,14 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import type { TransportCaseAdapters } from "../../transport/testing/transport-harness.ts";
3
+ import { type LoopHookPoint } from "../loop-hook-host-hand.ts";
4
+ /** Where the kill lands: a point of the call on the hand, or after the loop host committed the reply. */
5
+ type KillAt = LoopHookPoint | "committed";
6
+ export interface KillHookDeclaration {
7
+ readonly id: string;
8
+ readonly at: KillAt;
9
+ readonly expected: string;
10
+ }
11
+ export declare const KILL_HOOK_DECLARATIONS: readonly KillHookDeclaration[];
12
+ export declare const KILL_HOOK_CASES: ReadonlyMap<string, CaseImplementation<TransportCaseAdapters>>;
13
+ export {};
14
+ //# sourceMappingURL=kill-hook.d.ts.map
@@ -0,0 +1,117 @@
1
+ import { createManualTimers } from "../../durable/testing/manual-timers.js";
2
+ import { expectEqual } from "../../durable/testing/store-harness.js";
3
+ import { createInProcessNetwork } from "../../transport/in-process-carrier.js";
4
+ import { localEndpoint } from "../../transport/local-endpoint.js";
5
+ import { createLoopHookHost, LoopHookRestartedError } from "../loop-hook-host.js";
6
+ import { serveLoopHooks } from "../loop-hook-host-hand.js";
7
+ /**
8
+ * KILL-HOOK (brain/hand split S33): the user's machine is killed around one forwarded hook call and its reply, then a new
9
+ * process starts on the same link. Each case declares what the loop host's turn sees: the hook result (and exactly one
10
+ * provider request carrying it), or a restarted call that is never run again and issues no provider request. These
11
+ * placements only exist where the hook host is engaged (a hosted loop, or any loop away from the user's machine); a
12
+ * fused or split-local session never forwards its hooks.
13
+ */
14
+ const LANE = "loop-hooks:session";
15
+ const TICK_MS = 5;
16
+ const KILLS = [
17
+ { at: "received", outcome: "result", runs: 1 },
18
+ { at: "started", outcome: "restarted", runs: 0 },
19
+ { at: "ran", outcome: "restarted", runs: 1 },
20
+ { at: "replied", outcome: "result", runs: 1 },
21
+ { at: "committed", outcome: "result", runs: 1 },
22
+ ];
23
+ const WHERE = {
24
+ received: "after the hand received the hook call, before it started it",
25
+ started: "after the hand said it started the hooks, before they ran",
26
+ ran: "after the hooks ran, before the hand sent the reply",
27
+ replied: "after the hand sent the reply, before the loop host committed it",
28
+ committed: "after the loop host committed the reply, before the provider request",
29
+ };
30
+ const expectedOf = ({ at, outcome, runs }) => {
31
+ const result = outcome === "result"
32
+ ? "the turn gets the hook result and issues exactly one provider request with it"
33
+ : "the call ends restarted (uncertain), is never sent again, and no provider request is issued";
34
+ return `cross-machine and hosted: kill ${WHERE[at]}; ${result}; the hooks ran ${runs === 0 ? "never" : "once"}`;
35
+ };
36
+ const drain = async () => {
37
+ for (let turn = 0; turn < 32; turn++)
38
+ await Promise.resolve();
39
+ };
40
+ async function runKillCase(adapters, kill, what) {
41
+ const timers = createManualTimers(1_000);
42
+ const network = createInProcessNetwork({ schedule: (deliver) => void timers.setTimer(deliver, 0) });
43
+ const loopSide = adapters.transport.createSide(timers);
44
+ const handSide = adapters.transport.createSide(timers);
45
+ const endpoint = localEndpoint(adapters.platform, "loop-hook-conformance", "/run/senpi-conformance");
46
+ network.listen(endpoint, handSide);
47
+ network.dial(endpoint, loopSide).connect();
48
+ const runs = [];
49
+ const requests = [];
50
+ const killed = Promise.withResolvers();
51
+ const startHand = (killAt) => serveLoopHooks({
52
+ transport: handSide,
53
+ lane: LANE,
54
+ run: async (event, payload) => {
55
+ runs.push(event);
56
+ return { context: `hook saw ${JSON.stringify(payload)}` };
57
+ },
58
+ onPoint: (point) => {
59
+ if (point !== killAt)
60
+ return;
61
+ killed.resolve();
62
+ throw new Error(`hand killed ${point}`);
63
+ },
64
+ });
65
+ const until = async (done, label) => {
66
+ const end = timers.now() + 600_000;
67
+ await drain();
68
+ while (!done() && timers.now() < end) {
69
+ await timers.advanceTo(timers.now() + TICK_MS);
70
+ await drain();
71
+ }
72
+ if (!done())
73
+ throw new Error(`${what}: ${label} not reached`);
74
+ };
75
+ let hand = startHand(kill.at === "committed" ? undefined : kill.at);
76
+ const host = createLoopHookHost({ transport: loopSide, lane: LANE });
77
+ let outcome;
78
+ host.run("before_agent_start", { prompt: "go" }).then(async (result) => {
79
+ if (kill.at === "committed") {
80
+ hand.close();
81
+ killed.resolve();
82
+ hand = startHand();
83
+ }
84
+ requests.push(result);
85
+ outcome = { result };
86
+ }, (error) => void (outcome = { error }));
87
+ let didKill = false;
88
+ void killed.promise.then(() => void (didKill = true));
89
+ await until(() => didKill, "the kill point fired");
90
+ if (kill.at !== "committed")
91
+ hand = startHand();
92
+ await until(() => outcome !== undefined, "the turn got the hook call's outcome");
93
+ // Let any second dispatch the restart could cause surface before the run count is checked.
94
+ for (let step = 0; step < 40; step++) {
95
+ await timers.advanceTo(timers.now() + TICK_MS);
96
+ await drain();
97
+ }
98
+ if (kill.outcome === "result") {
99
+ expectEqual(outcome !== undefined && "result" in outcome ? outcome.result : outcome, { context: 'hook saw {"prompt":"go"}' }, `${what}: the hook result`);
100
+ expectEqual(requests.length, 1, `${what}: provider requests`);
101
+ }
102
+ else {
103
+ expectEqual(outcome !== undefined && "error" in outcome && outcome.error instanceof LoopHookRestartedError, true, `${what}: the call ended restarted`);
104
+ expectEqual(requests.length, 0, `${what}: provider requests`);
105
+ }
106
+ expectEqual(runs.length, kill.runs, `${what}: hook runs`);
107
+ expectEqual(host.waiting(), [], `${what}: nothing left waiting`);
108
+ }
109
+ const cases = KILLS.map((kill, index) => {
110
+ const id = `KILL-HOOK-${String(index + 1).padStart(2, "0")}`;
111
+ const declaration = { id, at: kill.at, expected: expectedOf(kill) };
112
+ const run = (adapters) => runKillCase(adapters, kill, `${id} (${kill.at})`);
113
+ return { declaration, run };
114
+ });
115
+ export const KILL_HOOK_DECLARATIONS = cases.map(({ declaration }) => declaration);
116
+ export const KILL_HOOK_CASES = new Map(cases.map(({ declaration, run }) => [declaration.id, run]));
117
+ //# sourceMappingURL=kill-hook.js.map
@@ -0,0 +1,6 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import type { BatchCaseAdapters } from "./batch-executor.ts";
3
+ type KillNestCase = CaseImplementation<BatchCaseAdapters>;
4
+ export declare const KILL_NEST_CASES: ReadonlyMap<string, KillNestCase>;
5
+ export {};
6
+ //# sourceMappingURL=kill-nest.d.ts.map
@@ -0,0 +1,55 @@
1
+ import { expectEqual } from "../../durable/testing/store-harness.js";
2
+ import { nestedChildId } from "../nested.js";
3
+ import { BrainKilledError, batchHarness, expectRejects } from "./batch-harness.js";
4
+ import { cancelTargetOf } from "./cancel-cases.js";
5
+ import { admitted, debited, nestParent, nestRequest } from "./nest-cases.js";
6
+ async function killedAround(adapters, label, at) {
7
+ const h = await batchHarness(adapters);
8
+ await (await h.nested()).open(nestParent);
9
+ await (await h.nested()).release("p");
10
+ return { h, dying: await h.nested({ label, at }) };
11
+ }
12
+ /** KILL-NEST-01: the brain dies before the admission is durable: nothing was debited, the retry admits it once. */
13
+ const beforeAdmission = async (adapters) => {
14
+ const { h, dying } = await killedAround(adapters, `admit:${nestedChildId("p", "c1")}`, "before");
15
+ await expectRejects(dying.admit(nestRequest()), BrainKilledError, "the dying admission");
16
+ const restarted = await h.nested();
17
+ expectEqual(await debited(restarted), 0, "nothing durable");
18
+ expectEqual(await restarted.admit(nestRequest()), admitted("c1", "model", false), "admitted on the retry");
19
+ expectEqual(await debited(restarted), 1, "debited once");
20
+ };
21
+ /** KILL-NEST-02: the brain dies after the admission is durable, before replying: the retry gets the same child. */
22
+ const afterAdmission = async (adapters) => {
23
+ const { h, dying } = await killedAround(adapters, `admit:${nestedChildId("p", "c1")}`, "after");
24
+ await expectRejects(dying.admit(nestRequest()), BrainKilledError, "the dying admission");
25
+ const restarted = await h.nested();
26
+ expectEqual(await restarted.admit(nestRequest()), admitted("c1", "model", true), "the same child");
27
+ expectEqual(await debited(restarted), 1, "never debited twice");
28
+ };
29
+ /**
30
+ * KILL-NEST-03: the brain dies after the cancel is durable (before any delivery), then again after a delivery was sent
31
+ * but before it was recorded: each restart re-sends the cascade until it is recorded, and nothing else is sent.
32
+ */
33
+ const aroundCascade = async (adapters) => {
34
+ const h = await batchHarness(adapters);
35
+ const nested = await h.nested();
36
+ await nested.open(nestParent);
37
+ await nested.release("p");
38
+ await nested.admit(nestRequest({ target: "e2" }));
39
+ await expectRejects((await h.nested({ label: "cancel", at: "after" })).cancel("p"), BrainKilledError, "dies after the cancel");
40
+ expectEqual((await (await h.nested()).read("p"))?.cancels, { [nestedChildId("p", "c1")]: "queued" }, "the cascade is durable");
41
+ const sent = [];
42
+ const send = async (target) => {
43
+ sent.push(target);
44
+ };
45
+ await expectRejects((await h.nested({ label: `cancel_delivered:${nestedChildId("p", "c1")}`, at: "before" })).deliverCancels("p", send), BrainKilledError, "dies after sending, before recording");
46
+ expectEqual(await (await h.nested()).deliverCancels("p", send), 1, "the restart re-sends it");
47
+ expectEqual(await (await h.nested()).deliverCancels("p", send), 0, "recorded: never sent again");
48
+ expectEqual(sent, [cancelTargetOf("c1", "e2"), cancelTargetOf("c1", "e2")], "sent until recorded");
49
+ };
50
+ export const KILL_NEST_CASES = new Map([
51
+ ["KILL-NEST-01", beforeAdmission],
52
+ ["KILL-NEST-02", afterAdmission],
53
+ ["KILL-NEST-03", aroundCascade],
54
+ ]);
55
+ //# sourceMappingURL=kill-nest.js.map
@@ -0,0 +1,6 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import type { BatchCaseAdapters } from "./batch-executor.ts";
3
+ type KillWakeCase = CaseImplementation<BatchCaseAdapters>;
4
+ export declare const KILL_WAKEX_CASES: ReadonlyMap<string, KillWakeCase>;
5
+ export {};
6
+ //# sourceMappingURL=kill-wakex.d.ts.map
@@ -0,0 +1,81 @@
1
+ import { expectEqual } from "../../durable/testing/store-harness.js";
2
+ import { BrainKilledError, batchHarness, expectRejects } from "./batch-harness.js";
3
+ import { ids, linkTo, scopeOwner, wakeOf } from "./wake-exec-cases.js";
4
+ /** KILL-WAKEX-01: the hand dies before the offer is durable: there is nothing to re-offer and nothing reached the brain. */
5
+ const beforeOffer = async (adapters) => {
6
+ const h = await batchHarness(adapters);
7
+ await expectRejects((await h.wakeOutbox("e1", { label: "offer", at: "before" })).offer(wakeOf(1)), BrainKilledError, "the dying offer");
8
+ expectEqual(await (await h.wakeOutbox("e1")).pending(), [], "nothing durable");
9
+ };
10
+ /** KILL-WAKEX-02: the hand dies after the offer is durable, before sending it: its restart re-offers it once. */
11
+ const afterOffer = async (adapters) => {
12
+ const h = await batchHarness(adapters);
13
+ await expectRejects((await h.wakeOutbox("e1", { label: "offer", at: "after" })).offer(wakeOf(1)), BrainKilledError, "the dying offer");
14
+ const outbox = await h.wakeOutbox("e1");
15
+ const inbox = await h.wakeInbox(scopeOwner);
16
+ expectEqual(await outbox.reoffer(linkTo(inbox)), 1, "re-offered after the restart");
17
+ expectEqual((await inbox.read()).pending.length, 1, "delivered once");
18
+ expectEqual(await outbox.pending(), [], "acked");
19
+ };
20
+ /** KILL-WAKEX-03: the brain dies before the inbox commit: no ack was sent, so the re-offer delivers it once. */
21
+ const beforeCommit = async (adapters) => {
22
+ const h = await batchHarness(adapters);
23
+ const outbox = await h.wakeOutbox("e1");
24
+ const wake = await outbox.offer(wakeOf(1));
25
+ const dying = await h.wakeInbox(scopeOwner, { label: `commit:${wake.eventId}`, at: "before" });
26
+ await expectRejects(outbox.reoffer(linkTo(dying)), BrainKilledError, "the dying commit");
27
+ expectEqual(ids(await outbox.pending()), [wake.eventId], "never acked");
28
+ const inbox = await h.wakeInbox(scopeOwner);
29
+ await outbox.reoffer(linkTo(inbox));
30
+ expectEqual(ids((await inbox.read()).pending), [wake.eventId], "committed once");
31
+ expectEqual(await outbox.pending(), [], "acked after the commit");
32
+ };
33
+ /** KILL-WAKEX-04: the brain dies after the inbox commit, before its ack left: the re-offer is a duplicate, then acked. */
34
+ const afterCommit = async (adapters) => {
35
+ const h = await batchHarness(adapters);
36
+ const outbox = await h.wakeOutbox("e1");
37
+ const wake = await outbox.offer(wakeOf(1));
38
+ const dying = await h.wakeInbox(scopeOwner, { label: `commit:${wake.eventId}`, at: "after" });
39
+ await expectRejects(outbox.reoffer(linkTo(dying)), BrainKilledError, "the dying ack");
40
+ const inbox = await h.wakeInbox(scopeOwner);
41
+ await outbox.reoffer(linkTo(inbox));
42
+ expectEqual(ids((await inbox.read()).pending), [wake.eventId], "one wake on the brain");
43
+ expectEqual(await outbox.pending(), [], "the duplicate's ack removed it");
44
+ };
45
+ /** KILL-WAKEX-05: the hand dies after the ack arrived, before recording it: the re-offer is a duplicate, acked again. */
46
+ const beforeAckRecord = async (adapters) => {
47
+ const h = await batchHarness(adapters);
48
+ const offered = await (await h.wakeOutbox("e1")).offer(wakeOf(1));
49
+ const inbox = await h.wakeInbox(scopeOwner);
50
+ await expectRejects((await h.wakeOutbox("e1", { label: "ack", at: "before" })).reoffer(linkTo(inbox)), BrainKilledError, "the dying ack record");
51
+ const outbox = await h.wakeOutbox("e1");
52
+ expectEqual(ids(await outbox.pending()), [offered.eventId], "still pending on the hand");
53
+ await outbox.reoffer(linkTo(inbox));
54
+ expectEqual(await outbox.pending(), [], "acked by the duplicate");
55
+ expectEqual(ids((await inbox.read()).pending), [offered.eventId], "never a second wake");
56
+ };
57
+ /**
58
+ * KILL-WAKEX-06: the brain dies after the loop took a wake, before recording it: the restart hands the same wake (same
59
+ * id) over again, so the loop's consumer must be idempotent by event id; nothing is lost.
60
+ */
61
+ const beforeTakeRecord = async (adapters) => {
62
+ const h = await batchHarness(adapters);
63
+ const outbox = await h.wakeOutbox("e1");
64
+ const wake = await outbox.offer(wakeOf(1));
65
+ await outbox.reoffer(linkTo(await h.wakeInbox(scopeOwner)));
66
+ const taken = [];
67
+ const consume = async (got) => void taken.push(got);
68
+ await expectRejects((await h.wakeInbox(scopeOwner, { label: `take:${wake.eventId}`, at: "before" })).drain(consume), BrainKilledError, "the dying take");
69
+ expectEqual(await (await h.wakeInbox(scopeOwner)).drain(consume), 1, "handed over again after the restart");
70
+ expectEqual(ids(taken), [wake.eventId, wake.eventId], "the same wake, by the same id");
71
+ expectEqual(await (await h.wakeInbox(scopeOwner)).drain(consume), 0, "then recorded");
72
+ };
73
+ export const KILL_WAKEX_CASES = new Map([
74
+ ["KILL-WAKEX-01", beforeOffer],
75
+ ["KILL-WAKEX-02", afterOffer],
76
+ ["KILL-WAKEX-03", beforeCommit],
77
+ ["KILL-WAKEX-04", afterCommit],
78
+ ["KILL-WAKEX-05", beforeAckRecord],
79
+ ["KILL-WAKEX-06", beforeTakeRecord],
80
+ ]);
81
+ //# sourceMappingURL=kill-wakex.js.map
@@ -0,0 +1,9 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import type { ScopeBinding } from "../scope-lifecycle.ts";
3
+ import type { BatchCaseAdapters } from "./batch-executor.ts";
4
+ type LifecycleCase = CaseImplementation<BatchCaseAdapters>;
5
+ export declare const IDLE_TTL_MS = 30000;
6
+ export declare const bindingOf: (scope: string, issuer?: string) => ScopeBinding;
7
+ export declare const LIFECYCLE_CASES: ReadonlyMap<string, LifecycleCase>;
8
+ export {};
9
+ //# sourceMappingURL=lifecycle-cases.d.ts.map
@@ -0,0 +1,60 @@
1
+ import { expectEqual } from "../../durable/testing/store-harness.js";
2
+ import { batchHarness } from "./batch-harness.js";
3
+ export const IDLE_TTL_MS = 30_000;
4
+ export const bindingOf = (scope, issuer = "brain") => ({
5
+ issuer,
6
+ workspace: "workspace",
7
+ scope,
8
+ generation: 1,
9
+ allowedRoots: ["/work"],
10
+ });
11
+ /** LIFECYCLE-01: a call submitted after a lifecycle event runs only once the event's handler effect is committed. */
12
+ const commitBeforeNextCall = async (adapters) => {
13
+ const h = await batchHarness(adapters);
14
+ const scopes = await h.scopes(IDLE_TTL_MS);
15
+ await scopes.open(bindingOf("A"));
16
+ const order = [];
17
+ const handlerHeld = Promise.withResolvers();
18
+ const event = scopes.lifecycle("brain", "A", "agent_end", async () => {
19
+ order.push("handler");
20
+ await handlerHeld.promise;
21
+ return { revoked: true };
22
+ });
23
+ const call = scopes.call("A", async () => {
24
+ order.push(`call sees ${(await scopes.read("A"))?.events.length ?? 0} committed event(s)`);
25
+ return "ran";
26
+ });
27
+ handlerHeld.resolve();
28
+ expectEqual(await event, { kind: "committed", seq: 1 }, "the event committed");
29
+ expectEqual(await call, "ran", "the call ran");
30
+ expectEqual(order, ["handler", "call sees 1 committed event(s)"], "the next call follows the commit");
31
+ };
32
+ /** LIFECYCLE-02: only the scope's issuer submits lifecycle events or closes it. */
33
+ const issuerOnly = async (adapters) => {
34
+ const h = await batchHarness(adapters);
35
+ const scopes = await h.scopes(IDLE_TTL_MS);
36
+ await scopes.open(bindingOf("A"));
37
+ let ran = false;
38
+ expectEqual(await scopes.lifecycle("intruder", "A", "turn_start", async () => {
39
+ ran = true;
40
+ return null;
41
+ }), { kind: "refused", reason: "not_issuer" }, "a lifecycle event from another party");
42
+ expectEqual(ran, false, "its handler never ran");
43
+ expectEqual(await scopes.close("intruder", "A"), { kind: "refused", reason: "not_issuer" }, "a close from another party");
44
+ expectEqual((await scopes.read("A"))?.state, "open", "still open");
45
+ };
46
+ /** LIFECYCLE-03: a closed scope admits no lifecycle event and is not reopened under another binding. */
47
+ const closedIsTerminal = async (adapters) => {
48
+ const h = await batchHarness(adapters);
49
+ const scopes = await h.scopes(IDLE_TTL_MS);
50
+ await scopes.open(bindingOf("A"));
51
+ expectEqual(await scopes.close("brain", "A"), { kind: "closed" }, "closed by its issuer");
52
+ expectEqual(await scopes.lifecycle("brain", "A", "turn_start", async () => null), { kind: "refused", reason: "closed" }, "no event after the close");
53
+ expectEqual(await scopes.open(bindingOf("A")), { kind: "refused", reason: "conflicting_scope" }, "not reopened");
54
+ };
55
+ export const LIFECYCLE_CASES = new Map([
56
+ ["LIFECYCLE-01", commitBeforeNextCall],
57
+ ["LIFECYCLE-02", issuerOnly],
58
+ ["LIFECYCLE-03", closedIsTerminal],
59
+ ]);
60
+ //# sourceMappingURL=lifecycle-cases.js.map
@@ -0,0 +1,3 @@
1
+ import type { RegisteredCase } from "../../conformance/registry.ts";
2
+ export declare const LIFECYCLE_REGISTRY: readonly RegisteredCase[];
3
+ //# sourceMappingURL=lifecycle-registry.d.ts.map
@@ -0,0 +1,19 @@
1
+ const LIFECYCLE_IMPL = "packages/agent/src/execution/testing/lifecycle-cases.ts";
2
+ const SCOPE_IMPL = "packages/agent/src/execution/testing/scope-cases.ts";
3
+ const MULTI_LIFE_IMPL = "packages/agent/src/execution/testing/multi-lifecycle-cases.ts";
4
+ const lifecycleCase = (id, impl, expected) => ({
5
+ id,
6
+ impl,
7
+ intro: "#5681",
8
+ adapters: ["store", "executor"],
9
+ expected,
10
+ });
11
+ export const LIFECYCLE_REGISTRY = [
12
+ lifecycleCase("LIFECYCLE-01", LIFECYCLE_IMPL, "a call after a lifecycle event runs only once the event's effect committed"),
13
+ lifecycleCase("LIFECYCLE-02", LIFECYCLE_IMPL, "only the scope's issuer submits lifecycle events or closes it"),
14
+ lifecycleCase("LIFECYCLE-03", LIFECYCLE_IMPL, "a closed scope admits no lifecycle event and is not reopened"),
15
+ lifecycleCase("SCOPE-01", SCOPE_IMPL, "the idle TTL never closes a scope that holds live resources"),
16
+ lifecycleCase("SCOPE-02", SCOPE_IMPL, "a forced close writes every live resource's outcome before the scope closes"),
17
+ lifecycleCase("MULTI-LIFE-01", MULTI_LIFE_IMPL, "A's agent_end and turn_start effects stay in A; B is untouched"),
18
+ ];
19
+ //# sourceMappingURL=lifecycle-registry.js.map
@@ -0,0 +1,4 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import { type HandCaseAdapters } from "./hand-harness.ts";
3
+ export declare const MULTI_EPOCH_CASES: ReadonlyMap<string, CaseImplementation<HandCaseAdapters>>;
4
+ //# sourceMappingURL=multi-epoch-cases.d.ts.map
@@ -0,0 +1,29 @@
1
+ import { expectEqual } from "../../durable/testing/store-harness.js";
2
+ import { texts } from "./epoch-cases.js";
3
+ import { openEpochRig } from "./epoch-harness.js";
4
+ import { call } from "./hand-harness.js";
5
+ const SCOPES = ["a", "b", "c"];
6
+ /** Z2: one session moves (its scope's floor rises); the other sessions' scopes on the same hand keep running. */
7
+ const oneSessionMoves = async (adapters) => {
8
+ const rig = await openEpochRig(adapters, {
9
+ brains: [
10
+ { name: "brain-old", epoch: 1 },
11
+ { name: "brain-new", epoch: 2 },
12
+ ],
13
+ });
14
+ for (const scope of SCOPES)
15
+ rig.setOwner(scope, "brain-old");
16
+ await rig.settle(Promise.all(SCOPES.map((scope) => rig.execute("brain-old", scope, [call(`${scope}1`)]))), "MULTI-EPOCH-01: every scope ran on the old owner");
17
+ rig.setOwner("a", "brain-new");
18
+ const moved = await rig.settle(rig.execute("brain-new", "a", [call("a2")]), "MULTI-EPOCH-01: scope a moved");
19
+ expectEqual(texts(moved), ["ran:a2"], "MULTI-EPOCH-01: the moved scope runs on its new owner");
20
+ const after = await rig.settle(Promise.all(SCOPES.map((scope) => rig.execute("brain-old", scope, [call(`${scope}3`)]))), "MULTI-EPOCH-01: the old owner's next calls");
21
+ expectEqual(after.map(texts), [["The hand refused this tool call: epoch_fenced"], ["ran:b3"], ["ran:c3"]], "MULTI-EPOCH-01: only the moved scope fences the old owner; the others run untouched");
22
+ for (const scope of ["b", "c"])
23
+ expectEqual(await rig.floor(scope), { epoch: 1, owner: "brain-old" }, `MULTI-EPOCH-01: scope ${scope}'s floor`);
24
+ expectEqual([...rig.bodies].sort(), ["a1", "a2", "b1", "b3", "c1", "c3"].map((id) => `${id.charAt(0)}:${id}`), "MULTI-EPOCH-01: every scope's calls ran once; the fenced one never ran");
25
+ };
26
+ export const MULTI_EPOCH_CASES = new Map([
27
+ ["MULTI-EPOCH-01", oneSessionMoves],
28
+ ]);
29
+ //# sourceMappingURL=multi-epoch-cases.js.map
@@ -0,0 +1,4 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import type { BatchCaseAdapters } from "./batch-executor.ts";
3
+ export declare const MULTI_LIFECYCLE_CASES: ReadonlyMap<string, CaseImplementation<BatchCaseAdapters>>;
4
+ //# sourceMappingURL=multi-lifecycle-cases.d.ts.map
@@ -0,0 +1,34 @@
1
+ import { expectEqual } from "../../durable/testing/store-harness.js";
2
+ import { batchHarness } from "./batch-harness.js";
3
+ import { bindingOf, IDLE_TTL_MS } from "./lifecycle-cases.js";
4
+ /**
5
+ * MULTI-LIFE-01 (Z2, S15): sessions A and B on one endpoint. A's agent_end and turn_start effects are committed to A
6
+ * only; B's events and resources are untouched, and B's calls do not wait on A's lifecycle handler.
7
+ */
8
+ const lifecycleStaysInSession = async (adapters) => {
9
+ const h = await batchHarness(adapters);
10
+ const scopes = await h.scopes(IDLE_TTL_MS);
11
+ await scopes.open(bindingOf("A", "brain-a"));
12
+ await scopes.open(bindingOf("B", "brain-b"));
13
+ await scopes.hold("B", "computer", "lease");
14
+ const held = Promise.withResolvers();
15
+ const endA = scopes.lifecycle("brain-a", "A", "agent_end", async () => {
16
+ await held.promise;
17
+ return { revoked: "computer" };
18
+ });
19
+ expectEqual(await scopes.call("B", async () => "B ran"), "B ran", "B's call does not wait on A's handler");
20
+ held.resolve();
21
+ await endA;
22
+ await scopes.lifecycle("brain-a", "A", "turn_start", async () => ({ reset: "comment-checker" }));
23
+ expectEqual((await scopes.read("A"))?.events.map(({ kind, effect }) => [kind, effect]), [
24
+ ["agent_end", { revoked: "computer" }],
25
+ ["turn_start", { reset: "comment-checker" }],
26
+ ], "A's effects in A");
27
+ const b = await scopes.read("B");
28
+ expectEqual([b?.events, b?.resources], [[], { computer: "lease" }], "B is untouched");
29
+ expectEqual(await scopes.lifecycle("brain-a", "B", "agent_end", async () => null), { kind: "refused", reason: "not_issuer" }, "A's brain cannot end B");
30
+ };
31
+ export const MULTI_LIFECYCLE_CASES = new Map([
32
+ ["MULTI-LIFE-01", lifecycleStaysInSession],
33
+ ]);
34
+ //# sourceMappingURL=multi-lifecycle-cases.js.map
@@ -0,0 +1,4 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import type { BatchCaseAdapters } from "./batch-executor.ts";
3
+ export declare const MULTI_SEQ_CASES: ReadonlyMap<string, CaseImplementation<BatchCaseAdapters>>;
4
+ //# sourceMappingURL=multi-seq-cases.d.ts.map
@@ -0,0 +1,46 @@
1
+ import { expectEqual } from "../../durable/testing/store-harness.js";
2
+ import { createSequentialCoordinator } from "../coordinator-sequential.js";
3
+ import { batchHarness, batchPlan, resultOf } from "./batch-harness.js";
4
+ /**
5
+ * MULTI-FAIR-02 (Z2, S11): session A runs a long sequential batch on executor e1 and its first call is held inside its
6
+ * body; session B's batch on the same executor runs to completion meanwhile, and A then continues in its own order.
7
+ */
8
+ /**
9
+ * The bound on B's run: it only turns a starved B into a named failure instead of a hung case, never paces it. It stays
10
+ * under the package's 30 s test timeout, so the named failure, not the generic timeout, is what a starved B reports.
11
+ */
12
+ const STARVED_MS = 20_000;
13
+ const longSequentialDoesNotStarve = async (adapters) => {
14
+ const h = await batchHarness(adapters);
15
+ const held = h.hold("a1", "body");
16
+ const sessionA = createSequentialCoordinator(await h.brain(undefined, "brain-a"));
17
+ const runA = sessionA.run(batchPlan("multi-fair-02-a", [
18
+ ["a1", "e1"],
19
+ ["a2", "e1"],
20
+ ["a3", "e1"],
21
+ ]));
22
+ await held.reached;
23
+ const sessionB = await h.brain(undefined, "brain-b");
24
+ const runB = sessionB.run(batchPlan("multi-fair-02-b", [
25
+ ["b1", "e1"],
26
+ ["b2", "e1"],
27
+ ]));
28
+ let bound;
29
+ const starved = new Promise((_, reject) => {
30
+ bound = setTimeout(() => reject(new Error("MULTI-FAIR-02: B did not finish while A's call was held")), STARVED_MS);
31
+ });
32
+ const resultB = await Promise.race([runB, starved]).finally(() => clearTimeout(bound));
33
+ expectEqual(resultB.outcomes, [resultOf("b1"), resultOf("b2")], "B finishes while A's call is held");
34
+ expectEqual(h.count("shim:a2"), 0, "A's next call waits for its own held call, not for B");
35
+ held.open();
36
+ expectEqual((await runA).outcomes, [resultOf("a1"), resultOf("a2"), resultOf("a3")], "A finishes in its order");
37
+ const order = (step) => h.trace.indexOf(step);
38
+ if (!(order("done:b2") < order("done:a1") &&
39
+ order("done:a1") < order("shim:a2") &&
40
+ order("done:a2") < order("shim:a3")))
41
+ throw new Error(`MULTI-FAIR-02: unexpected order ${h.trace.join(",")}`);
42
+ };
43
+ export const MULTI_SEQ_CASES = new Map([
44
+ ["MULTI-FAIR-02", longSequentialDoesNotStarve],
45
+ ]);
46
+ //# sourceMappingURL=multi-seq-cases.js.map
@@ -0,0 +1,39 @@
1
+ import type { CaseImplementation } from "../../conformance/runner.ts";
2
+ import { type NestedAdmissionControl } from "../nested.ts";
3
+ import type { NestedAdmission, NestedParent, NestedRequest } from "../nested-types.ts";
4
+ import type { BatchCaseAdapters } from "./batch-executor.ts";
5
+ type NestCase = CaseImplementation<BatchCaseAdapters>;
6
+ export declare const nestParent: NestedParent;
7
+ export declare const nestRequest: (over?: Partial<NestedRequest>) => NestedRequest;
8
+ export declare const admitted: (childRequestId: string, target: string, replayed: boolean) => NestedAdmission;
9
+ export declare const refusedWith: (reason: string) => {
10
+ kind: string;
11
+ reason: string;
12
+ };
13
+ export declare function openedParent(adapters: BatchCaseAdapters): Promise<{
14
+ h: {
15
+ trace: string[];
16
+ count: (event: string) => number;
17
+ written: (label: string) => Promise<readonly string[]>;
18
+ hold: (executionId: string, point: import("./batch-executor.ts").PausePoint) => {
19
+ reached: Promise<void>;
20
+ open: () => void;
21
+ };
22
+ brain: (dieAt?: import("./batch-harness.ts").BrainKill, issuer?: string, consent?: import("../coordinator-types.ts").BatchConsent) => Promise<import("../coordinator.ts").BatchCoordinator>;
23
+ nested: (dieAt?: import("./batch-harness.ts").BrainKill, issuer?: string) => Promise<NestedAdmissionControl>;
24
+ wakeOutbox: (hand: string, dieAt?: import("./batch-harness.ts").BrainKill) => Promise<import("../wake-outbox.ts").WakeOutbox>;
25
+ scopes: (idleTtlMs: number, dieAt?: import("./batch-harness.ts").BrainKill) => Promise<import("../scope-lifecycle.ts").ScopeLifecycle>;
26
+ wakeLog: (hand: string) => Promise<readonly import("../../durable/store.ts").StoreValue[]>;
27
+ wakeInbox: (owner: (scope: string) => string | undefined, dieAt?: import("./batch-harness.ts").BrainKill) => Promise<import("../wake-inbox.ts").WakeInbox>;
28
+ advance: (ms: number) => void;
29
+ executor: (id: string) => import("../coordinator-types.ts").BatchExecutor;
30
+ restartExecutor: (id: string) => Promise<void>;
31
+ loseExecutor: (id: string) => Promise<void>;
32
+ ledgerState: (id: string, executionId: string) => Promise<string | undefined>;
33
+ };
34
+ nested: NestedAdmissionControl;
35
+ }>;
36
+ export declare const debited: (nested: NestedAdmissionControl) => Promise<number | undefined>;
37
+ export declare const NEST_CASES: ReadonlyMap<string, NestCase>;
38
+ export {};
39
+ //# sourceMappingURL=nest-cases.d.ts.map