# Short real runtime before/after

Final HEAD 83ef5cf0b67c915b0db262e8089c84c6eb71a669; current main and merge-base 3cc31ed27c8956b36cee35a50509fb7c6869592b. Same public driver and cases, only revisions/scratch paths replaced. Real ingestor, EventSink, SQLite persistence, projections and initial-ingestion subscriber; separate IPC lock holder. Production busy_timeout=5000; supporting cases=75ms. No provider CLI/UI.

## before

Revision: 3cc31ed27c8956b36cee35a50509fb7c6869592b
Database: /tmp/ev-21092-capture-final/before-P-recover1-5000.sqlite
busy_timeout: [{"timeout": 5000}]
Ingestion: 2026-10-24T22:28:34.970Z → 2026-10-24T22:28:40.029Z
Holder: {"milestone": "acquired", "database": "/tmp/ev-21092-capture-final/before-P-recover1-5000.sqlite", "time": "2026-10-24T22:28:35.005864+00:00", "pid": 1328887}
Observed actual error: {"key": "before-P-recover1-5000", "milestone": "actual-error", "attempt": 1, "error": {"tag": "EventSinkWriteError", "message": "Failed to write 1 orchestration V2 event(s).", "cause": {"tag": "SqlError", "message": "Failed to execute statement", "cause": {"tag": "LockTimeoutError", "message": "Failed to execute statement", "cause": {"message": "database is locked", "code": "ERR_SQLITE_ERROR"}}, "reason": {"tag": "LockTimeoutError", "message": "Failed to execute statement", "cause": {"message": "database is locked", "code": "ERR_SQLITE_ERROR"}}}}, "time": "2026-10-24T22:28:40.017Z"}
Holder: {"milestone": "released", "changes": [], "time": "2026-10-24T22:28:40.017534+00:00", "pid": 1328887}
Holder: {"milestone": "closed", "time": "2026-10-24T22:28:40.018036+00:00", "pid": 1328887}
Attempts: 1
Returned: {"success": false, "error": "ProviderEventPublishError: Failed to publish 1 normalized provider event(s).\n    at mapWriteError (/home/ubuntu/wt/pr-21092/apps/server/src/orchestration-v2/EvidenceBefore.ts:741:15)\n    at file:///home/ubuntu/wt/pr-21092/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/effect.js:1483:96 {\n  [cause]: EventSinkWriteError: Failed to write 1 orchestration V2 event(s).\n      at /home/ubuntu/wt/pr-21092/apps/server/src/orchestration-v2/EventSink.ts:885:15\n      at file:///home/ubuntu/wt/pr-21092/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/internal/effect.js:1483:96 {\n    [cause]: effect/sql/SqlError: Failed to execute statement\n        at execute (/home/ubuntu/wt/pr-21092/packages/shared/src/nodeSqliteClient.ts:1038:15) {\n      [cause]: effect/sql/SqlError/LockTimeoutError: Failed to execute statement\n          at classifySqliteError (file:///home/ubuntu/wt/pr-21092/node_modules/.pnpm/effect@4.0.5/node_modules/effect/dist/sql/SqlError.js:482:16)\n          at classifyError (/home/ubuntu/wt/pr-21092/packages/shared/src/nodeSqliteClient.ts:172:10)\n          at execute (/home/ubuntu/wt/pr-21092/packages/shared/src/nodeSqliteClient.ts:1039:25) {\n        [cause]: Error: database is locked\n            at /home/ubuntu/wt/pr-21092/packages/shared/src/nodeSqliteClient.ts:1032:40\n            at withClassification (/home/ubuntu/wt/pr-21092/packages/shared/src/nodeSqliteClient.ts:946:16)\n            at execute (/home/ubuntu/wt/pr-21092/packages/shared/src/nodeSqliteClient.ts:1025:27)\n      }\n    }\n  }\n}", "reasons": [{"tag": "ProviderEventPublishError", "message": "Failed to publish 1 normalized provider event(s).", "cause": {"tag": "EventSinkWriteError", "message": "Failed to write 1 orchestration V2 event(s).", "cause": {"tag": "SqlError", "message": "Failed to execute statement", "cause": {"tag": "LockTimeoutError", "message": "Failed to execute statement", "cause": {"message": "database is locked", "code": "ERR_SQLITE_ERROR"}}, "reason": {"tag": "LockTimeoutError", "message": "Failed to execute statement", "cause": {"message": "database is locked", "code": "ERR_SQLITE_ERROR"}}}}}]}
Persisted target count: 0
Published target count: 0
Publication equals durable IDs/types: True
Projected: {"turns": [], "providerThreads": [{"id": "provider-thread:proof", "driver": "codex", "providerInstanceId": "codex", "providerSessionId": "provider-session:provider-instance:codex:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A09a49455-38c5-4bd6-9fbe-be325d272296%3A165513a7-7fb4-465e-a59b-2e5d5c333d9f:610539e4-7881-40f2-a5b4-e8ab40f9b668", "appThreadId": "thread:fixture:provider-event-ingestor:project:project%3Afixture%3Aprovider-event-ingestor%3A09a49455-38c5-4bd6-9fbe-be325d272296:165513a7-7fb4-465e-a59b-2e5d5c333d9f", "ownerNodeId": null, "nativeThreadRef": {"driver": "codex", "nativeId": "proof", "strength": "strong"}, "nativeConversationHeadRef": null, "status": "idle", "firstRunOrdinal": 1, "lastRunOrdinal": 1, "handoffIds": [], "forkedFrom": null, "pendingBackgroundTasks": [], "contextUsage": null, "nativeMetadata": null, "goal": null, "createdAt": "1970-01-01T00:00:00.000Z", "updatedAt": "1970-01-01T00:00:00.000Z"}], "runs": [{"id": "run:proof", "threadId": "thread:fixture:provider-event-ingestor:project:project%3Afixture%3Aprovider-event-ingestor%3A09a49455-38c5-4bd6-9fbe-be325d272296:165513a7-7fb4-465e-a59b-2e5d5c333d9f", "ordinal": 1, "providerInstanceId": "codex", "modelSelection": {"instanceId": "codex", "model": "gpt-5.4"}, "providerThreadId": "provider-thread:proof", "userMessageId": "message:proof", "rootNodeId": "node:proof", "activeAttemptId": "attempt:proof", "status": "running", "requestedAt": "1970-01-01T00:00:00.000Z", "startedAt": "1970-01-01T00:00:00.000Z", "completedAt": null, "checkpointId": null, "contextHandoffId": null}]}

## after

Revision: 83ef5cf0b67c915b0db262e8089c84c6eb71a669
Database: /tmp/ev-21092-capture-final/after-P-recover1-5000.sqlite
busy_timeout: [{"timeout": 5000}]
Ingestion: 2026-10-24T22:28:55.117Z → 2026-10-24T22:29:00.183Z
Holder: {"milestone": "acquired", "database": "/tmp/ev-21092-capture-final/after-P-recover1-5000.sqlite", "time": "2026-10-24T22:28:55.149913+00:00", "pid": 1329721}
Observed actual error: {"key": "after-P-recover1-5000", "milestone": "actual-error", "attempt": 1, "error": {"tag": "EventSinkWriteError", "message": "Failed to write 1 orchestration V2 event(s).", "cause": {"tag": "SqlError", "message": "Failed to execute statement", "cause": {"tag": "LockTimeoutError", "message": "Failed to execute statement", "cause": {"message": "database is locked", "code": "ERR_SQLITE_ERROR"}}, "reason": {"tag": "LockTimeoutError", "message": "Failed to execute statement", "cause": {"message": "database is locked", "code": "ERR_SQLITE_ERROR"}}}}, "time": "2026-10-24T22:29:00.167Z"}
Holder: {"milestone": "released", "changes": [], "time": "2026-10-24T22:29:00.167986+00:00", "pid": 1329721}
Holder: {"milestone": "closed", "time": "2026-10-24T22:29:00.171530+00:00", "pid": 1329721}
Attempts: 2
Returned: {"success": true, "returned": [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aaf6fa327-5089-458a-a39d-fc599536f7f1%3Ad9eef93b-23e5-4e4c-840c-57de88b99d9a:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aaf6fa327-5089-458a-a39d-fc599536f7f1%253Ad9eef93b-23e5-4e4c-840c-57de88b99d9a%3A738c0f7a-76cb-4fc9-aadf-19fe67b41236:63aaf3c1-3e81-4acf-a3ca-799f384e5835", "type": "provider-turn.updated"}]}
Persisted target count: 1
Published target count: 1
Publication equals durable IDs/types: True
Projected: {"turns": [{"id": "turn:proof", "providerThreadId": "provider-thread:proof", "nodeId": "node:proof", "runAttemptId": null, "nativeTurnRef": null, "ordinal": 1, "status": "completed", "startedAt": "1970-01-01T00:00:00.000Z", "completedAt": "1970-01-01T00:00:00.000Z"}], "providerThreads": [{"id": "provider-thread:proof", "driver": "codex", "providerInstanceId": "codex", "providerSessionId": "provider-session:provider-instance:codex:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aaf6fa327-5089-458a-a39d-fc599536f7f1%3Ad9eef93b-23e5-4e4c-840c-57de88b99d9a:738c0f7a-76cb-4fc9-aadf-19fe67b41236", "appThreadId": "thread:fixture:provider-event-ingestor:project:project%3Afixture%3Aprovider-event-ingestor%3Aaf6fa327-5089-458a-a39d-fc599536f7f1:d9eef93b-23e5-4e4c-840c-57de88b99d9a", "ownerNodeId": null, "nativeThreadRef": {"driver": "codex", "nativeId": "proof", "strength": "strong"}, "nativeConversationHeadRef": null, "status": "idle", "firstRunOrdinal": 1, "lastRunOrdinal": 1, "handoffIds": [], "forkedFrom": null, "pendingBackgroundTasks": [], "contextUsage": null, "nativeMetadata": null, "goal": null, "createdAt": "1970-01-01T00:00:00.000Z", "updatedAt": "1970-01-01T00:00:00.000Z"}], "runs": [{"id": "run:proof", "threadId": "thread:fixture:provider-event-ingestor:project:project%3Afixture%3Aprovider-event-ingestor%3Aaf6fa327-5089-458a-a39d-fc599536f7f1:d9eef93b-23e5-4e4c-840c-57de88b99d9a", "ordinal": 1, "providerInstanceId": "codex", "modelSelection": {"instanceId": "codex", "model": "gpt-5.4"}, "providerThreadId": "provider-thread:proof", "userMessageId": "message:proof", "rootNodeId": "node:proof", "activeAttemptId": "attempt:proof", "status": "running", "requestedAt": "1970-01-01T00:00:00.000Z", "startedAt": "1970-01-01T00:00:00.000Z", "completedAt": null, "checkpointId": null, "contextHandoffId": null}]}

Run status remains running in this fixture. This proves provider-event write recovery only. Subscriber counts cover initial calls; repeat calls assert durable event counts and unchanged selection.
