| @@ -24,6 +24,7 @@ import * as Effect from "effect/Effect"; · 23 unmodified lines |
| 24 | import * as DateTime from "effect/DateTime"; | 24 | import * as DateTime from "effect/DateTime"; |
| 25 | import * as Deferred from "effect/Deferred"; | 25 | import * as Deferred from "effect/Deferred"; |
| 26 | import * as Fiber from "effect/Fiber"; | 26 | import * as Fiber from "effect/Fiber"; |
| | 27 | import * as FileSystem from "effect/FileSystem"; |
| 27 | import * as Layer from "effect/Layer"; | 28 | import * as Layer from "effect/Layer"; |
| 28 | import * as Option from "effect/Option"; | 29 | import * as Option from "effect/Option"; |
| 29 | import * as Queue from "effect/Queue"; | 30 | import * as Queue from "effect/Queue"; |
| @@ -908,7 +909,7 @@ it.layer(LegacyImportTestLayer)("OrchestrationV2 legacy import", (it) => { · 878 unmodified lines |
| 908 | ); | 909 | ); |
| 909 | }); | 910 | }); |
| 910 | | 911 | |
| 911 | it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => { | 912 | it.layer(Layer.merge(TestLayer, NodeServices.layer))("OrchestrationV2LayerLive lifecycle", (it) => { |
| 912 | it.effect("applies lifecycle commands idempotently and emits archive/removal shell deltas", () => | 913 | it.effect("applies lifecycle commands idempotently and emits archive/removal shell deltas", () => |
| 913 | Effect.gen(function* () { | 914 | Effect.gen(function* () { |
| 914 | const orchestrator = yield* OrchestratorV2; | 915 | const orchestrator = yield* OrchestratorV2; |
| @@ -1474,6 +1475,10 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => { · 559 unmodified lines |
| 1474 | | 1475 | |
| 1475 | it.effect("applies deferred settlement after safe completion and replays its receipt", () => | 1476 | it.effect("applies deferred settlement after safe completion and replays its receipt", () => |
| 1476 | Effect.gen(function* () { | 1477 | Effect.gen(function* () { |
| | 1478 | const fileSystem = yield* FileSystem.FileSystem; |
| | 1479 | const workspacePath = yield* fileSystem.makeTempDirectoryScoped({ |
| | 1480 | prefix: "t3-runtime-layer-deferred-settle-", |
| | 1481 | }); |
| 1477 | const orchestrator = yield* OrchestratorV2; | 1482 | const orchestrator = yield* OrchestratorV2; |
| 1478 | const eventSink = yield* EventSinkV2; | 1483 | const eventSink = yield* EventSinkV2; |
| 1479 | const sql = yield* SqlClient.SqlClient; | 1484 | const sql = yield* SqlClient.SqlClient; |
| @@ -1494,7 +1499,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => { · 14 unmodified lines |
| 1494 | runtimeMode: "full-access", | 1499 | runtimeMode: "full-access", |
| 1495 | interactionMode: "default", | 1500 | interactionMode: "default", |
| 1496 | branch: null, | 1501 | branch: null, |
| 1497 | worktreePath: "/tmp/runtime-layer-deferred-settle", | 1502 | worktreePath: workspacePath, |
| 1498 | }); | 1503 | }); |
| 1499 | yield* orchestrator.dispatch({ | 1504 | yield* orchestrator.dispatch({ |
| 1500 | type: "thread.pin", | 1505 | type: "thread.pin", |
| @@ -1525,7 +1530,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => { · 24 unmodified lines |
| 1525 | providerSessionId, | 1530 | providerSessionId, |
| 1526 | modelSelection, | 1531 | modelSelection, |
| 1527 | runtimePolicy: { | 1532 | runtimePolicy: { |
| 1528 | cwd: "/tmp/runtime-layer-deferred-settle", | 1533 | cwd: workspacePath, |
| 1529 | runtimeMode: "full-access", | 1534 | runtimeMode: "full-access", |
| 1530 | interactionMode: "default", | 1535 | interactionMode: "default", |
| 1531 | }, | 1536 | }, |
| @@ -1631,6 +1636,10 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => { · 99 unmodified lines |
| 1631 | | 1636 | |
| 1632 | it.effect("archives after safe completion and discards stale or blocked deferred intents", () => | 1637 | it.effect("archives after safe completion and discards stale or blocked deferred intents", () => |
| 1633 | Effect.gen(function* () { | 1638 | Effect.gen(function* () { |
| | 1639 | const fileSystem = yield* FileSystem.FileSystem; |
| | 1640 | const workspacePath = yield* fileSystem.makeTempDirectoryScoped({ |
| | 1641 | prefix: "t3-runtime-layer-deferred-organization-", |
| | 1642 | }); |
| 1634 | const orchestrator = yield* OrchestratorV2; | 1643 | const orchestrator = yield* OrchestratorV2; |
| 1635 | const eventSink = yield* EventSinkV2; | 1644 | const eventSink = yield* EventSinkV2; |
| 1636 | const sql = yield* SqlClient.SqlClient; | 1645 | const sql = yield* SqlClient.SqlClient; |
| @@ -1652,7 +1661,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => { · 15 unmodified lines |
| 1652 | runtimeMode: "full-access", | 1661 | runtimeMode: "full-access", |
| 1653 | interactionMode: "default", | 1662 | interactionMode: "default", |
| 1654 | branch: null, | 1663 | branch: null, |
| 1655 | worktreePath: `/tmp/runtime-layer-deferred-${suffix}`, | 1664 | worktreePath: workspacePath, |
| 1656 | }); | 1665 | }); |
| 1657 | yield* orchestrator.dispatch({ | 1666 | yield* orchestrator.dispatch({ |
| 1658 | type: "message.dispatch", | 1667 | type: "message.dispatch", |
| @@ -1716,7 +1725,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => { · 57 unmodified lines |
| 1716 | providerSessionId, | 1725 | providerSessionId, |
| 1717 | modelSelection, | 1726 | modelSelection, |
| 1718 | runtimePolicy: { | 1727 | runtimePolicy: { |
| 1719 | cwd: "/tmp/runtime-layer-deferred-archive", | 1728 | cwd: workspacePath, |
| 1720 | runtimeMode: "full-access", | 1729 | runtimeMode: "full-access", |
| 1721 | interactionMode: "default", | 1730 | interactionMode: "default", |
| 1722 | }, | 1731 | }, |