@@ -38,18 +38,31 @@ const createFixtureSource = Effect.fn("createMigrateDevDbFixtureSource")(functio
3838
3939 const forkPayload =
4040 '{"lineage":{"parentThreadId":"stopped-thread","relationshipToParent":"fork","rootThreadId":"stopped-thread"}}' ;
41+ const subagentPayload =
42+ '{"lineage":{"parentThreadId":"subagent-parent","relationshipToParent":"subagent","rootThreadId":"subagent-parent"},"forkedFrom":{"type":"node","nodeId":"node-1"}}' ;
43+ // Excluded threads are newer than the kept family, so only the filters
44+ // can keep them out of a one-family-per-project clone.
4145 const threads = [
42- [ "stopped-thread" , "project-kept" , "completed" , "{}" ] ,
43- [ "fork-thread" , "project-kept" , "completed" , forkPayload ] ,
44- [ "running-thread" , "project-kept" , "running" , "{}" ] ,
45- [ "settled-thread" , "project-kept" , "completed" , '{"settledAt":"2026-08-01"}' ] ,
46- [ "limit-thread" , "project-kept" , "completed" , '{"limitRecovery":{"autoResume":true}}' ] ,
47- [ "deleted-project-thread" , "project-deleted" , "completed" , "{}" ] ,
46+ [ "stopped-thread" , "project-kept" , "completed" , "{}" , "2026-08-01" ] ,
47+ [ "fork-thread" , "project-kept" , "completed" , forkPayload , "2026-08-02" ] ,
48+ [ "running-thread" , "project-kept" , "running" , "{}" , "2026-08-05" ] ,
49+ [ "settled-thread" , "project-kept" , "completed" , '{"settledAt":"2026-08-01"}' , "2026-08-05" ] ,
50+ [
51+ "limit-thread" ,
52+ "project-kept" ,
53+ "completed" ,
54+ '{"limitRecovery":{"autoResume":true}}' ,
55+ "2026-08-05" ,
56+ ] ,
57+ // Its result never reached the parent, so startup would deliver it.
58+ [ "subagent-parent" , "project-kept" , "completed" , "{}" , "2026-08-05" ] ,
59+ [ "subagent-child" , "project-kept" , "completed" , subagentPayload , "2026-08-05" ] ,
60+ [ "deleted-project-thread" , "project-deleted" , "completed" , "{}" , "2026-08-05" ] ,
4861 ] as const ;
49- for ( const [ threadId , projectId , runStatus , payload ] of threads ) {
62+ for ( const [ threadId , projectId , runStatus , payload , updatedAt ] of threads ) {
5063 yield * sql `INSERT INTO orchestration_v2_projection_threads
5164 (thread_id, project_id, title, default_provider, runtime_mode, interaction_mode, created_at, updated_at, payload_json)
52- VALUES (${ threadId } , ${ projectId } , ${ threadId } , 'codex', 'full-access', 'default', '2026-08-01', '2026-08-01' , ${ payload } )` ;
65+ VALUES (${ threadId } , ${ projectId } , ${ threadId } , 'codex', 'full-access', 'default', '2026-08-01', ${ updatedAt } , ${ payload } )` ;
5366 yield * sql `INSERT INTO orchestration_v2_projection_runs
5467 (run_id, thread_id, ordinal, provider, status, requested_at, payload_json)
5568 VALUES (${ `run-${ threadId } ` } , ${ threadId } , 1, 'codex', ${ runStatus } , '2026-08-01', '{}')` ;
@@ -60,7 +73,7 @@ const createFixtureSource = Effect.fn("createMigrateDevDbFixtureSource")(functio
6073 // A provider session shared by two threads names its latest writer.
6174 yield * sql `INSERT INTO orchestration_v2_projection_provider_sessions
6275 (provider_session_id, thread_id, provider, status, updated_at, payload_json)
63- VALUES ('session-shared', 'running-thread', 'codex', 'ready ', '2026-08-01', '{}')` ;
76+ VALUES ('session-shared', 'running-thread', 'codex', 'stopped ', '2026-08-01', '{}')` ;
6477 yield * sql `INSERT INTO orchestration_v2_projection_provider_session_bindings
6578 (provider_session_id, thread_id)
6679 VALUES ('session-shared', 'running-thread'), ('session-shared', 'stopped-thread')` ;
0 commit comments