@@ -18,13 +18,13 @@ import {
1818 ProviderSessionId ,
1919 ProviderThreadId ,
2020 RunId ,
21- RuntimeRequestId ,
2221 ThreadId ,
2322} from "@t3tools/contracts" ;
2423import * as Effect from "effect/Effect" ;
2524import * as DateTime from "effect/DateTime" ;
2625import * as Deferred from "effect/Deferred" ;
2726import * as Fiber from "effect/Fiber" ;
27+ import * as FileSystem from "effect/FileSystem" ;
2828import * as Layer from "effect/Layer" ;
2929import * as Option from "effect/Option" ;
3030import * as Queue from "effect/Queue" ;
@@ -909,7 +909,7 @@ it.layer(LegacyImportTestLayer)("OrchestrationV2 legacy import", (it) => {
909909 ) ;
910910} ) ;
911911
912- it . layer ( TestLayer ) ( "OrchestrationV2LayerLive lifecycle" , ( it ) => {
912+ it . layer ( Layer . merge ( TestLayer , NodeServices . layer ) ) ( "OrchestrationV2LayerLive lifecycle" , ( it ) => {
913913 it . effect ( "applies lifecycle commands idempotently and emits archive/removal shell deltas" , ( ) =>
914914 Effect . gen ( function * ( ) {
915915 const orchestrator = yield * OrchestratorV2 ;
@@ -1414,6 +1414,10 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => {
14141414
14151415 it . effect ( "applies deferred settlement after safe completion and replays its receipt" , ( ) =>
14161416 Effect . gen ( function * ( ) {
1417+ const fileSystem = yield * FileSystem . FileSystem ;
1418+ const workspacePath = yield * fileSystem . makeTempDirectoryScoped ( {
1419+ prefix : "t3-runtime-layer-deferred-settle-" ,
1420+ } ) ;
14171421 const orchestrator = yield * OrchestratorV2 ;
14181422 const eventSink = yield * EventSinkV2 ;
14191423 const sql = yield * SqlClient . SqlClient ;
@@ -1434,7 +1438,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => {
14341438 runtimeMode : "full-access" ,
14351439 interactionMode : "default" ,
14361440 branch : null ,
1437- worktreePath : "/tmp/runtime-layer-deferred-settle" ,
1441+ worktreePath : workspacePath ,
14381442 } ) ;
14391443 yield * orchestrator . dispatch ( {
14401444 type : "thread.pin" ,
@@ -1465,7 +1469,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => {
14651469 providerSessionId,
14661470 modelSelection,
14671471 runtimePolicy : {
1468- cwd : "/tmp/runtime-layer-deferred-settle" ,
1472+ cwd : workspacePath ,
14691473 runtimeMode : "full-access" ,
14701474 interactionMode : "default" ,
14711475 } ,
@@ -1571,6 +1575,10 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => {
15711575
15721576 it . effect ( "archives after safe completion and discards stale or blocked deferred intents" , ( ) =>
15731577 Effect . gen ( function * ( ) {
1578+ const fileSystem = yield * FileSystem . FileSystem ;
1579+ const workspacePath = yield * fileSystem . makeTempDirectoryScoped ( {
1580+ prefix : "t3-runtime-layer-deferred-organization-" ,
1581+ } ) ;
15741582 const orchestrator = yield * OrchestratorV2 ;
15751583 const eventSink = yield * EventSinkV2 ;
15761584 const sql = yield * SqlClient . SqlClient ;
@@ -1592,7 +1600,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => {
15921600 runtimeMode : "full-access" ,
15931601 interactionMode : "default" ,
15941602 branch : null ,
1595- worktreePath : `/tmp/runtime-layer-deferred- ${ suffix } ` ,
1603+ worktreePath : workspacePath ,
15961604 } ) ;
15971605 yield * orchestrator . dispatch ( {
15981606 type : "message.dispatch" ,
@@ -1656,7 +1664,7 @@ it.layer(TestLayer)("OrchestrationV2LayerLive lifecycle", (it) => {
16561664 providerSessionId,
16571665 modelSelection,
16581666 runtimePolicy : {
1659- cwd : "/tmp/runtime-layer-deferred-archive" ,
1667+ cwd : workspacePath ,
16601668 runtimeMode : "full-access" ,
16611669 interactionMode : "default" ,
16621670 } ,
0 commit comments