@@ -30,14 +30,13 @@ import type {
3030} from "../src/orchestration/Services/RuntimeReceiptBus.ts" ;
3131import * as NodeServices from "@effect/platform-node/NodeServices" ;
3232
33- const asMessageId = ( value : string ) : MessageId => MessageId . makeUnsafe ( value ) ;
34- const asProjectId = ( value : string ) : ProjectId => ProjectId . makeUnsafe ( value ) ;
35- const asEventId = ( value : string ) : EventId => EventId . makeUnsafe ( value ) ;
36- const asApprovalRequestId = ( value : string ) : ApprovalRequestId =>
37- ApprovalRequestId . makeUnsafe ( value ) ;
33+ const asMessageId = ( value : string ) : MessageId => MessageId . make ( value ) ;
34+ const asProjectId = ( value : string ) : ProjectId => ProjectId . make ( value ) ;
35+ const asEventId = ( value : string ) : EventId => EventId . make ( value ) ;
36+ const asApprovalRequestId = ( value : string ) : ApprovalRequestId => ApprovalRequestId . make ( value ) ;
3837
3938const PROJECT_ID = asProjectId ( "project-1" ) ;
40- const THREAD_ID = ThreadId . makeUnsafe ( "thread-1" ) ;
39+ const THREAD_ID = ThreadId . make ( "thread-1" ) ;
4140const FIXTURE_TURN_ID = "fixture-turn" ;
4241const APPROVAL_REQUEST_ID = asApprovalRequestId ( "req-approval-1" ) ;
4342type IntegrationProvider = ProviderKind ;
@@ -112,7 +111,7 @@ const seedProjectAndThread = (harness: OrchestrationIntegrationHarness) =>
112111
113112 yield * harness . engine . dispatch ( {
114113 type : "project.create" ,
115- commandId : CommandId . makeUnsafe ( "cmd-project-create" ) ,
114+ commandId : CommandId . make ( "cmd-project-create" ) ,
116115 projectId : PROJECT_ID ,
117116 title : "Integration Project" ,
118117 workspaceRoot : harness . workspaceDir ,
@@ -125,7 +124,7 @@ const seedProjectAndThread = (harness: OrchestrationIntegrationHarness) =>
125124
126125 yield * harness . engine . dispatch ( {
127126 type : "thread.create" ,
128- commandId : CommandId . makeUnsafe ( "cmd-thread-create" ) ,
127+ commandId : CommandId . make ( "cmd-thread-create" ) ,
129128 threadId : THREAD_ID ,
130129 projectId : PROJECT_ID ,
131130 title : "Integration Thread" ,
@@ -150,7 +149,7 @@ const startTurn = (input: {
150149} ) =>
151150 input . harness . engine . dispatch ( {
152151 type : "thread.turn.start" ,
153- commandId : CommandId . makeUnsafe ( input . commandId ) ,
152+ commandId : CommandId . make ( input . commandId ) ,
154153 threadId : THREAD_ID ,
155154 message : {
156155 messageId : asMessageId ( input . messageId ) ,
@@ -261,7 +260,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
261260
262261 yield * harness . engine . dispatch ( {
263262 type : "project.create" ,
264- commandId : CommandId . makeUnsafe ( "cmd-project-create-real-codex" ) ,
263+ commandId : CommandId . make ( "cmd-project-create-real-codex" ) ,
265264 projectId : PROJECT_ID ,
266265 title : "Integration Project" ,
267266 workspaceRoot : harness . workspaceDir ,
@@ -274,7 +273,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
274273
275274 yield * harness . engine . dispatch ( {
276275 type : "thread.create" ,
277- commandId : CommandId . makeUnsafe ( "cmd-thread-create-real-codex" ) ,
276+ commandId : CommandId . make ( "cmd-thread-create-real-codex" ) ,
278277 threadId : THREAD_ID ,
279278 projectId : PROJECT_ID ,
280279 title : "Integration Thread" ,
@@ -291,7 +290,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
291290
292291 yield * harness . engine . dispatch ( {
293292 type : "thread.turn.start" ,
294- commandId : CommandId . makeUnsafe ( "cmd-turn-start-real-codex-1" ) ,
293+ commandId : CommandId . make ( "cmd-turn-start-real-codex-1" ) ,
295294 threadId : THREAD_ID ,
296295 message : {
297296 messageId : asMessageId ( "msg-real-codex-1" ) ,
@@ -318,7 +317,7 @@ it.live.skipIf(!process.env.CODEX_BINARY_PATH)(
318317
319318 yield * harness . engine . dispatch ( {
320319 type : "thread.turn.start" ,
321- commandId : CommandId . makeUnsafe ( "cmd-turn-start-real-codex-2" ) ,
320+ commandId : CommandId . make ( "cmd-turn-start-real-codex-2" ) ,
322321 threadId : THREAD_ID ,
323322 message : {
324323 messageId : asMessageId ( "msg-real-codex-2" ) ,
@@ -583,7 +582,7 @@ it.live("tracks approval requests and resolves pending approvals on user respons
583582
584583 yield * harness . engine . dispatch ( {
585584 type : "thread.approval.respond" ,
586- commandId : CommandId . makeUnsafe ( "cmd-approval-respond" ) ,
585+ commandId : CommandId . make ( "cmd-approval-respond" ) ,
587586 threadId : THREAD_ID ,
588587 requestId : APPROVAL_REQUEST_ID ,
589588 decision : "accept" ,
@@ -815,7 +814,7 @@ it.live("reverts to an earlier checkpoint and trims checkpoint projections + git
815814
816815 yield * harness . engine . dispatch ( {
817816 type : "thread.checkpoint.revert" ,
818- commandId : CommandId . makeUnsafe ( "cmd-checkpoint-revert" ) ,
817+ commandId : CommandId . make ( "cmd-checkpoint-revert" ) ,
819818 threadId : THREAD_ID ,
820819 turnCount : 1 ,
821820 createdAt : nowIso ( ) ,
@@ -875,7 +874,7 @@ it.live(
875874
876875 yield * harness . engine . dispatch ( {
877876 type : "thread.checkpoint.revert" ,
878- commandId : CommandId . makeUnsafe ( "cmd-checkpoint-revert-no-session" ) ,
877+ commandId : CommandId . make ( "cmd-checkpoint-revert-no-session" ) ,
879878 threadId : THREAD_ID ,
880879 turnCount : 0 ,
881880 createdAt : nowIso ( ) ,
@@ -1119,7 +1118,7 @@ it.live("forwards claudeAgent approval responses to the provider session", () =>
11191118
11201119 yield * harness . engine . dispatch ( {
11211120 type : "thread.approval.respond" ,
1122- commandId : CommandId . makeUnsafe ( "cmd-claude-approval-respond" ) ,
1121+ commandId : CommandId . make ( "cmd-claude-approval-respond" ) ,
11231122 threadId : THREAD_ID ,
11241123 requestId : APPROVAL_REQUEST_ID ,
11251124 decision : "accept" ,
@@ -1192,7 +1191,7 @@ it.live("forwards thread.turn.interrupt to claudeAgent provider sessions", () =>
11921191
11931192 yield * harness . engine . dispatch ( {
11941193 type : "thread.turn.interrupt" ,
1195- commandId : CommandId . makeUnsafe ( "cmd-turn-interrupt-claude" ) ,
1194+ commandId : CommandId . make ( "cmd-turn-interrupt-claude" ) ,
11961195 threadId : THREAD_ID ,
11971196 createdAt : nowIso ( ) ,
11981197 } ) ;
@@ -1309,7 +1308,7 @@ it.live("reverts claudeAgent turns and rolls back provider conversation state",
13091308
13101309 yield * harness . engine . dispatch ( {
13111310 type : "thread.checkpoint.revert" ,
1312- commandId : CommandId . makeUnsafe ( "cmd-checkpoint-revert-claude" ) ,
1311+ commandId : CommandId . make ( "cmd-checkpoint-revert-claude" ) ,
13131312 threadId : THREAD_ID ,
13141313 turnCount : 1 ,
13151314 createdAt : nowIso ( ) ,
0 commit comments