# 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 O-positive: 4 paired case executions.

## before-O-recover1-75

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

- Holder 1328607: acquired at 2026-10-24T22:28:31.381248+00:00; changes=[]
- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A41af1185-6884-492e-8484-290ba0728fab%3Ad4c41de2-57e0-4b47-89fb-51d606afe47a:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A41af1185-6884-492e-8484-290ba0728fab%253Ad4c41de2-57e0-4b47-89fb-51d606afe47a%3A330743ba-98eb-4511-a9a5-3125f14ceb1a:7d68f22f-4b95-4bc1-a25d-8369d136d7b8", "type": "provider-thread.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1328607: released at 2026-10-24T22:28:31.459106+00:00; changes=[]
- Holder 1328607: closed at 2026-10-24T22:28:31.459632+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-O-recover2-75

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

- Holder 1328610: acquired at 2026-10-24T22:28:31.638742+00:00; changes=[]
- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A8a43e268-958c-4235-9425-faa6fad5fbcc%3A8410b3ba-5adf-4992-aeac-1475b8dcafae:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A8a43e268-958c-4235-9425-faa6fad5fbcc%253A8410b3ba-5adf-4992-aeac-1475b8dcafae%3Aa8a635ef-7d3c-41b3-a2df-4dc0447da8c1:6bfa8483-3409-450e-a02f-3a5775ac1b52", "type": "provider-thread.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1328610: released at 2026-10-24T22:28:31.716355+00:00; changes=[]
- Holder 1328610: closed at 2026-10-24T22:28:31.716843+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-O-recover1-75

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

- Holder 1329590: acquired at 2026-10-24T22:28:51.407476+00:00; changes=[]
- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad4aa6811-1656-4239-8d0e-4f1096628586%3A95bfd95a-d8ae-482b-992f-f904c51b986d:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad4aa6811-1656-4239-8d0e-4f1096628586%253A95bfd95a-d8ae-482b-992f-f904c51b986d%3Af1847d69-dc3b-461f-b096-75b78476ecc8:08f3cf4c-f7e6-468b-b840-7f9444609f93", "type": "provider-thread.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1329590: released at 2026-10-24T22:28:51.487102+00:00; changes=[]
- Attempt 2: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad4aa6811-1656-4239-8d0e-4f1096628586%3A95bfd95a-d8ae-482b-992f-f904c51b986d:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad4aa6811-1656-4239-8d0e-4f1096628586%253A95bfd95a-d8ae-482b-992f-f904c51b986d%3Af1847d69-dc3b-461f-b096-75b78476ecc8:08f3cf4c-f7e6-468b-b840-7f9444609f93", "type": "provider-thread.updated"}]
- Holder 1329590: closed at 2026-10-24T22:28:51.490656+00:00; changes=[]

Returned: `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad4aa6811-1656-4239-8d0e-4f1096628586%3A95bfd95a-d8ae-482b-992f-f904c51b986d:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad4aa6811-1656-4239-8d0e-4f1096628586%253A95bfd95a-d8ae-482b-992f-f904c51b986d%3Af1847d69-dc3b-461f-b096-75b78476ecc8:08f3cf4c-f7e6-468b-b840-7f9444609f93", "type": "provider-thread.updated"}]`.
Persisted since fixture seed (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad4aa6811-1656-4239-8d0e-4f1096628586%3A95bfd95a-d8ae-482b-992f-f904c51b986d:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad4aa6811-1656-4239-8d0e-4f1096628586%253A95bfd95a-d8ae-482b-992f-f904c51b986d%3Af1847d69-dc3b-461f-b096-75b78476ecc8:08f3cf4c-f7e6-468b-b840-7f9444609f93", "type": "provider-thread.updated"}]`.
Published (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad4aa6811-1656-4239-8d0e-4f1096628586%3A95bfd95a-d8ae-482b-992f-f904c51b986d:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad4aa6811-1656-4239-8d0e-4f1096628586%253A95bfd95a-d8ae-482b-992f-f904c51b986d%3Af1847d69-dc3b-461f-b096-75b78476ecc8:08f3cf4c-f7e6-468b-b840-7f9444609f93", "type": "provider-thread.updated"}]`.
Projected: `{"turns": [], "providerThreads": [{"id": "provider-thread:proof", "status": "active", "lastRunOrdinal": 1}], "runs": [{"id": "run:proof", "status": "running", "activeAttemptId": "attempt:proof"}], "childModel": null}`.

## after-O-recover2-75

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

- Holder 1329682: acquired at 2026-10-24T22:28:51.661815+00:00; changes=[]
- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%3A038159a4-a670-4d0e-a292-60ef987096cf:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%253A038159a4-a670-4d0e-a292-60ef987096cf%3A4a7d9aa6-6c24-46fd-8429-70d250419877:7e99a880-3266-4ef3-af23-bcfc0ff465d9", "type": "provider-thread.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Attempt 2: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%3A038159a4-a670-4d0e-a292-60ef987096cf:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%253A038159a4-a670-4d0e-a292-60ef987096cf%3A4a7d9aa6-6c24-46fd-8429-70d250419877:7e99a880-3266-4ef3-af23-bcfc0ff465d9", "type": "provider-thread.updated"}]
- Attempt 2: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1329682: released at 2026-10-24T22:28:51.816454+00:00; changes=[]
- Attempt 3: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%3A038159a4-a670-4d0e-a292-60ef987096cf:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%253A038159a4-a670-4d0e-a292-60ef987096cf%3A4a7d9aa6-6c24-46fd-8429-70d250419877:7e99a880-3266-4ef3-af23-bcfc0ff465d9", "type": "provider-thread.updated"}]
- Holder 1329682: closed at 2026-10-24T22:28:51.820754+00:00; changes=[]

Returned: `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%3A038159a4-a670-4d0e-a292-60ef987096cf:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%253A038159a4-a670-4d0e-a292-60ef987096cf%3A4a7d9aa6-6c24-46fd-8429-70d250419877:7e99a880-3266-4ef3-af23-bcfc0ff465d9", "type": "provider-thread.updated"}]`.
Persisted since fixture seed (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%3A038159a4-a670-4d0e-a292-60ef987096cf:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%253A038159a4-a670-4d0e-a292-60ef987096cf%3A4a7d9aa6-6c24-46fd-8429-70d250419877:7e99a880-3266-4ef3-af23-bcfc0ff465d9", "type": "provider-thread.updated"}]`.
Published (1 events): `[{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%3A038159a4-a670-4d0e-a292-60ef987096cf:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aac1c83e0-bbae-4a3d-b4dd-3ceee5514011%253A038159a4-a670-4d0e-a292-60ef987096cf%3A4a7d9aa6-6c24-46fd-8429-70d250419877:7e99a880-3266-4ef3-af23-bcfc0ff465d9", "type": "provider-thread.updated"}]`.
Projected: `{"turns": [], "providerThreads": [{"id": "provider-thread:proof", "status": "active", "lastRunOrdinal": 1}], "runs": [{"id": "run:proof", "status": "running", "activeAttemptId": "attempt:proof"}], "childModel": null}`.
