# 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-stale: 8 paired case executions.

## before-R-missing-75

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

- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A4b31e6cf-cfaf-4236-aab7-3410e628e18f%3A2e17424a-88bc-408c-92a4-7fec5fe56d8e:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A4b31e6cf-cfaf-4236-aab7-3410e628e18f%253A2e17424a-88bc-408c-92a4-7fec5fe56d8e%3Aef171f52-7aad-42a1-84c5-ac59ae232775:3ce27cea-213d-4639-9c89-b8a6226d383e", "type": "provider-turn.updated"}]

Returned: `[]`.
Persisted since fixture seed (0 events): `[]`.
Published (0 events): `[]`.
Projected: `{"turns": [], "providerThreads": [], "runs": [], "childModel": null}`.

## before-R-wrongAttempt-75

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

- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A85b2c726-093d-4035-bfc5-7c407dc1fb91%3A58360c64-49e2-4e08-a8d8-4dd31b4dfe99:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A85b2c726-093d-4035-bfc5-7c407dc1fb91%253A58360c64-49e2-4e08-a8d8-4dd31b4dfe99%3A5dc1aa1f-307b-4e54-b91e-8b97347232eb:0e34ed1e-0482-472d-a2c5-339a0a387cb8", "type": "provider-turn.updated"}]

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:new"}], "childModel": null}`.

## before-R-wrongStatus-75

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

- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad8f742b9-7ef9-4eba-b128-ff7ce0a3e5e5%3A3afe9ca9-6d0a-41f2-b9b8-2018f8c6aaac:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad8f742b9-7ef9-4eba-b128-ff7ce0a3e5e5%253A3afe9ca9-6d0a-41f2-b9b8-2018f8c6aaac%3A7c282acb-53fc-4d2a-9a96-0ca7775626ae:6b845a47-40fc-4abc-87bc-e112eb9c17eb", "type": "provider-turn.updated"}]

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": "completed", "activeAttemptId": "attempt:proof"}], "childModel": null}`.

## before-R-supersede-75

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

- Holder 1328897: acquired at 2026-10-24T22:28:40.601634+00:00; changes=[]
- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Abc7586ad-f71d-404b-8342-dd755f4eb4df%3A5b727bca-61fb-422e-b291-05aa69c96dd9:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Abc7586ad-f71d-404b-8342-dd755f4eb4df%253A5b727bca-61fb-422e-b291-05aa69c96dd9%3Ab0ccd40c-aff6-40f7-8319-9cc0954e8b6d:551114e2-3836-4948-8b5d-d243cc962248", "type": "provider-turn.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1328897: released at 2026-10-24T22:28:40.687679+00:00; changes=["UPDATE orchestration_v2_projection_runs SET status='completed',payload_json=json_set(payload_json,'$.activeAttemptId','attempt:new','$.status','completed') WHERE run_id='run:proof'"]
- Holder 1328897: closed at 2026-10-24T22:28:40.688728+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": "completed", "activeAttemptId": "attempt:new"}], "childModel": null}`.

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

## after-R-missing-75

Database: `/tmp/ev-21092-capture-final/after-R-missing-75.sqlite`; effective busy_timeout: `[{'timeout': 75}]`.
Ingest: 2026-10-24T22:29:00.303Z → 2026-10-24T22:29:00.308Z (0.005s). Attempts: 1; primary subagent writes: 0; success: True.

- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A531ac848-2765-4ecf-81c5-b86e8d9d6371%3A60e7d088-d1b4-4ca4-8b7a-d91754747252:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A531ac848-2765-4ecf-81c5-b86e8d9d6371%253A60e7d088-d1b4-4ca4-8b7a-d91754747252%3Ac20f6286-86ce-4372-95f0-c05ede41b2cc:a579dde1-346e-427f-9784-bde8c359fb6a", "type": "provider-turn.updated"}]

Returned: `[]`.
Persisted since fixture seed (0 events): `[]`.
Published (0 events): `[]`.
Projected: `{"turns": [], "providerThreads": [], "runs": [], "childModel": null}`.

## after-R-wrongAttempt-75

Database: `/tmp/ev-21092-capture-final/after-R-wrongAttempt-75.sqlite`; effective busy_timeout: `[{'timeout': 75}]`.
Ingest: 2026-10-24T22:29:00.426Z → 2026-10-24T22:29:00.431Z (0.005s). Attempts: 1; primary subagent writes: 0; success: True.

- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Af92f49ff-1893-49ef-ab28-c02d16b35ce0%3Af57133bc-c03c-44d7-9245-9e9323759afb:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Af92f49ff-1893-49ef-ab28-c02d16b35ce0%253Af57133bc-c03c-44d7-9245-9e9323759afb%3A7d44d60b-2a56-45d7-a2ea-baff1ab39978:80881e96-c9c8-4b85-ab4e-f1b5236a103f", "type": "provider-turn.updated"}]

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:new"}], "childModel": null}`.

## after-R-wrongStatus-75

Database: `/tmp/ev-21092-capture-final/after-R-wrongStatus-75.sqlite`; effective busy_timeout: `[{'timeout': 75}]`.
Ingest: 2026-10-24T22:29:00.617Z → 2026-10-24T22:29:00.622Z (0.005s). Attempts: 1; primary subagent writes: 0; success: True.

- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ae4fbd4d9-91b4-49b1-a22c-5b6d25cc6e4b%3Afc99f802-fae0-4dce-8d5f-f6cd7d10b6ae:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ae4fbd4d9-91b4-49b1-a22c-5b6d25cc6e4b%253Afc99f802-fae0-4dce-8d5f-f6cd7d10b6ae%3Ac831e26a-a2d2-4de0-966b-f18034cda24e:9b488f0a-7750-4863-927a-4b8cb5e9e8b6", "type": "provider-turn.updated"}]

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": "completed", "activeAttemptId": "attempt:proof"}], "childModel": null}`.

## after-R-supersede-75

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

- Holder 1329731: acquired at 2026-10-24T22:29:00.773205+00:00; changes=[]
- Attempt 1: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A2f64dcdd-63ff-4863-ab66-66d92ded4cbb%3A913dc0e6-4341-4168-894f-ca130a8cdb2d:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A2f64dcdd-63ff-4863-ab66-66d92ded4cbb%253A913dc0e6-4341-4168-894f-ca130a8cdb2d%3A7bb73438-d14c-4ca0-b553-63736480a56c:ced8f8a9-0b2e-4c41-bb81-961160454816", "type": "provider-turn.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1329731: released at 2026-10-24T22:29:00.858576+00:00; changes=["UPDATE orchestration_v2_projection_runs SET status='completed',payload_json=json_set(payload_json,'$.activeAttemptId','attempt:new','$.status','completed') WHERE run_id='run:proof'"]
- Attempt 2: writeIfRunCurrent, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A2f64dcdd-63ff-4863-ab66-66d92ded4cbb%3A913dc0e6-4341-4168-894f-ca130a8cdb2d:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A2f64dcdd-63ff-4863-ab66-66d92ded4cbb%253A913dc0e6-4341-4168-894f-ca130a8cdb2d%3A7bb73438-d14c-4ca0-b553-63736480a56c:ced8f8a9-0b2e-4c41-bb81-961160454816", "type": "provider-turn.updated"}]
- Holder 1329731: closed at 2026-10-24T22:29:00.861801+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": "completed", "activeAttemptId": "attempt:new"}], "childModel": null}`.
