# Paired real server runtime transcript

Synthetic server fixtures only; no provider CLI, UI, live userdata, or dev server. Before is the exact ingestor source from 3cc31ed27c8956b36cee35a50509fb7c6869592b; after is 83ef5cf0b67c915b0db262e8089c84c6eb71a669. Other production source is identical between these commits. TestClock controls domain fixture dates (1970); trace and lock-holder timestamps are actual UTC wall time.

P=plain write; R=writeIfRunCurrent; O=writeIfProviderThreadOwner (late provider_thread.updated); S=secondary thread.model-selection-updated after primary subagent.updated. C=controls.

Representative P recover1 uses production PRAGMA busy_timeout=5000 on the real server connection. Supporting cases deliberately set that connection to 75ms. Separate Python sqlite3 process on the same canonical file holds BEGIN IMMEDIATE. Release is IPC-triggered only after an observed real LockTimeoutError (two for recover2); persistent releases after ingestion exhausts. No timers/sleeps/polling.

All outcomes below passed assertions for success/failure, target-event count, unique log IDs, projection state, and exact bounded attempts for the retry/error modes. `injected*` cases are explicitly synthetic classification tests; never real-lock evidence. `recheck` commits a concurrent model update through the real sink while holding the thread lock before the second model-selection read. Its event is excluded from the target secondary-write count.

A real EventSink stream subscribes before ingestion. Ready and completion domain-event markers use Deferred milestones; marker IDs are excluded from target/log counts. For the initial ingestion, every published event ID/type between markers equals the persisted log in order, with no duplicate IDs. The completion marker drains prior publications without sleeps or polling. Repeat-call assertions separately check the durable log and unchanged child selection.


MIN group R-positive: 4 paired case executions.

## before-R-recover1-75

Database: `/tmp/ev-21092-capture-final/before-R-recover1-75.sqlite`; effective busy_timeout: `[{'timeout': 75}]`.
Ingest: 2026-10-24T22:28:29.603Z → 2026-10-24T22:28:29.727Z (0.124s). Attempts: 1; primary subagent writes: 0; success: False.

- Holder 1328585: acquired at 2026-10-24T22:28:29.637184+00:00; changes=[]
- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Acd625c80-0d44-4fb0-8130-c1f6effe06b5%3A61fbab00-fb10-466e-abfa-54581e99c82c:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Acd625c80-0d44-4fb0-8130-c1f6effe06b5%253A61fbab00-fb10-466e-abfa-54581e99c82c%3A19e5aabf-1254-480e-8064-06a4be5aeacf:3b3de4d5-8531-4d6f-ba16-363da514290c", "type": "provider-turn.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1328585: released at 2026-10-24T22:28:29.715288+00:00; changes=[]
- Holder 1328585: closed at 2026-10-24T22:28:29.715844+00:00; changes=[]

Returned: `[]`.
Persisted since fixture seed (0 events): `[]`.
Published (0 events): `[]`.
Projected: `{"turns": [], "providerThreads": [{"id": "provider-thread:proof", "status": "idle", "lastRunOrdinal": 1}], "runs": [{"id": "run:proof", "status": "running", "activeAttemptId": "attempt:proof"}], "childModel": null}`.

Returned failure chain: `ProviderEventPublishError → EventSinkWriteError → SqlError → LockTimeoutError`.

## before-R-recover2-75

Database: `/tmp/ev-21092-capture-final/before-R-recover2-75.sqlite`; effective busy_timeout: `[{'timeout': 75}]`.
Ingest: 2026-10-24T22:28:29.862Z → 2026-10-24T22:28:29.991Z (0.129s). Attempts: 1; primary subagent writes: 0; success: False.

- Holder 1328588: acquired at 2026-10-24T22:28:29.899114+00:00; changes=[]
- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae3462c9b-7f1a-4c04-803f-598725bf80a9%3A435daf55-71d0-4662-8498-0465e3dbf919:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae3462c9b-7f1a-4c04-803f-598725bf80a9%253A435daf55-71d0-4662-8498-0465e3dbf919%3Afe4c075f-4501-4f6e-8a6a-afc932bd29ba:37e13ce4-5bc4-4217-8d30-363643eac06f", "type": "provider-turn.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1328588: released at 2026-10-24T22:28:29.977279+00:00; changes=[]
- Holder 1328588: closed at 2026-10-24T22:28:29.977710+00:00; changes=[]

Returned: `[]`.
Persisted since fixture seed (0 events): `[]`.
Published (0 events): `[]`.
Projected: `{"turns": [], "providerThreads": [{"id": "provider-thread:proof", "status": "idle", "lastRunOrdinal": 1}], "runs": [{"id": "run:proof", "status": "running", "activeAttemptId": "attempt:proof"}], "childModel": null}`.

Returned failure chain: `ProviderEventPublishError → EventSinkWriteError → SqlError → LockTimeoutError`.

## after-R-recover1-75

Database: `/tmp/ev-21092-capture-final/after-R-recover1-75.sqlite`; effective busy_timeout: `[{'timeout': 75}]`.
Ingest: 2026-10-24T22:28:49.428Z → 2026-10-24T22:28:49.566Z (0.138s). Attempts: 2; primary subagent writes: 0; success: True.

- Holder 1329426: acquired at 2026-10-24T22:28:49.473283+00:00; changes=[]
- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A31d9cefe-51bc-4309-8e41-e072c83e0e70%3Ab2fadf14-4da6-4a40-8722-d205ba7b8f97:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A31d9cefe-51bc-4309-8e41-e072c83e0e70%253Ab2fadf14-4da6-4a40-8722-d205ba7b8f97%3A40ae34d0-a1c2-423f-8303-73269c3acbde:fcf50976-63c0-4f65-b524-daf5c731b7e1", "type": "provider-turn.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1329426: released at 2026-10-24T22:28:49.551579+00:00; changes=[]
- Attempt 2: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A31d9cefe-51bc-4309-8e41-e072c83e0e70%3Ab2fadf14-4da6-4a40-8722-d205ba7b8f97:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A31d9cefe-51bc-4309-8e41-e072c83e0e70%253Ab2fadf14-4da6-4a40-8722-d205ba7b8f97%3A40ae34d0-a1c2-423f-8303-73269c3acbde:fcf50976-63c0-4f65-b524-daf5c731b7e1", "type": "provider-turn.updated"}]
- Holder 1329426: closed at 2026-10-24T22:28:49.555337+00:00; changes=[]

Returned: `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A31d9cefe-51bc-4309-8e41-e072c83e0e70%3Ab2fadf14-4da6-4a40-8722-d205ba7b8f97:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A31d9cefe-51bc-4309-8e41-e072c83e0e70%253Ab2fadf14-4da6-4a40-8722-d205ba7b8f97%3A40ae34d0-a1c2-423f-8303-73269c3acbde:fcf50976-63c0-4f65-b524-daf5c731b7e1", "type": "provider-turn.updated"}]`.
Persisted since fixture seed (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A31d9cefe-51bc-4309-8e41-e072c83e0e70%3Ab2fadf14-4da6-4a40-8722-d205ba7b8f97:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A31d9cefe-51bc-4309-8e41-e072c83e0e70%253Ab2fadf14-4da6-4a40-8722-d205ba7b8f97%3A40ae34d0-a1c2-423f-8303-73269c3acbde:fcf50976-63c0-4f65-b524-daf5c731b7e1", "type": "provider-turn.updated"}]`.
Published (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A31d9cefe-51bc-4309-8e41-e072c83e0e70%3Ab2fadf14-4da6-4a40-8722-d205ba7b8f97:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A31d9cefe-51bc-4309-8e41-e072c83e0e70%253Ab2fadf14-4da6-4a40-8722-d205ba7b8f97%3A40ae34d0-a1c2-423f-8303-73269c3acbde:fcf50976-63c0-4f65-b524-daf5c731b7e1", "type": "provider-turn.updated"}]`.
Projected: `{"turns": [{"id": "turn:proof", "status": "completed"}], "providerThreads": [{"id": "provider-thread:proof", "status": "idle", "lastRunOrdinal": 1}], "runs": [{"id": "run:proof", "status": "running", "activeAttemptId": "attempt:proof"}], "childModel": null}`.

## after-R-recover2-75

Database: `/tmp/ev-21092-capture-final/after-R-recover2-75.sqlite`; effective busy_timeout: `[{'timeout': 75}]`.
Ingest: 2026-10-24T22:28:49.688Z → 2026-10-24T22:28:49.896Z (0.208s). Attempts: 3; primary subagent writes: 0; success: True.

- Holder 1329429: acquired at 2026-10-24T22:28:49.724225+00:00; changes=[]
- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%3Adb83e13e-1517-4279-b7ba-c9558037a5c6:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%253Adb83e13e-1517-4279-b7ba-c9558037a5c6%3Abf7d59e8-607e-4bfc-8f50-54dd7f30e8bf:9e25e6e0-8979-4da9-b91e-384fb4bd822f", "type": "provider-turn.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Attempt 2: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%3Adb83e13e-1517-4279-b7ba-c9558037a5c6:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%253Adb83e13e-1517-4279-b7ba-c9558037a5c6%3Abf7d59e8-607e-4bfc-8f50-54dd7f30e8bf:9e25e6e0-8979-4da9-b91e-384fb4bd822f", "type": "provider-turn.updated"}]
- Attempt 2: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1329429: released at 2026-10-24T22:28:49.879050+00:00; changes=[]
- Attempt 3: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%3Adb83e13e-1517-4279-b7ba-c9558037a5c6:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%253Adb83e13e-1517-4279-b7ba-c9558037a5c6%3Abf7d59e8-607e-4bfc-8f50-54dd7f30e8bf:9e25e6e0-8979-4da9-b91e-384fb4bd822f", "type": "provider-turn.updated"}]
- Holder 1329429: closed at 2026-10-24T22:28:49.882737+00:00; changes=[]

Returned: `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%3Adb83e13e-1517-4279-b7ba-c9558037a5c6:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%253Adb83e13e-1517-4279-b7ba-c9558037a5c6%3Abf7d59e8-607e-4bfc-8f50-54dd7f30e8bf:9e25e6e0-8979-4da9-b91e-384fb4bd822f", "type": "provider-turn.updated"}]`.
Persisted since fixture seed (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%3Adb83e13e-1517-4279-b7ba-c9558037a5c6:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%253Adb83e13e-1517-4279-b7ba-c9558037a5c6%3Abf7d59e8-607e-4bfc-8f50-54dd7f30e8bf:9e25e6e0-8979-4da9-b91e-384fb4bd822f", "type": "provider-turn.updated"}]`.
Published (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%3Adb83e13e-1517-4279-b7ba-c9558037a5c6:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae3a9f87c-ae9d-459a-a66a-398f2f4b28f4%253Adb83e13e-1517-4279-b7ba-c9558037a5c6%3Abf7d59e8-607e-4bfc-8f50-54dd7f30e8bf:9e25e6e0-8979-4da9-b91e-384fb4bd822f", "type": "provider-turn.updated"}]`.
Projected: `{"turns": [{"id": "turn:proof", "status": "completed"}], "providerThreads": [{"id": "provider-thread:proof", "status": "idle", "lastRunOrdinal": 1}], "runs": [{"id": "run:proof", "status": "running", "activeAttemptId": "attempt:proof"}], "childModel": null}`.
