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

## before-O-missing-75

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

- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A6eb5a7d2-a09f-4323-a62e-8a0b27d8e55c%3A8db61f0c-c53a-4db1-90e8-be667bf34e0a:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A6eb5a7d2-a09f-4323-a62e-8a0b27d8e55c%253A8db61f0c-c53a-4db1-90e8-be667bf34e0a%3A46dcbcf0-e466-4d78-9c53-acbe1a1903fb:51120343-9a75-4330-9067-49f724a801f6", "type": "provider-thread.updated"}]

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

## before-O-wrongAttempt-75

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

- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Aa92315c1-aa6f-4463-a658-f05807b81c3a%3A8d9d8874-7db0-4095-bc16-42acf5a656c2:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Aa92315c1-aa6f-4463-a658-f05807b81c3a%253A8d9d8874-7db0-4095-bc16-42acf5a656c2%3Adb89828d-06c2-4d53-9d38-a6fd65cce162:63d87689-fee5-4090-97d4-18465cc79619", "type": "provider-thread.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-O-wrongOrdinal-75

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

- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad28888dd-fd48-4693-8b52-3a03fe9aa92d%3Ae73205ce-1d83-4cc1-aeb5-869cbdb6da9b:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad28888dd-fd48-4693-8b52-3a03fe9aa92d%253Ae73205ce-1d83-4cc1-aeb5-869cbdb6da9b%3A4f706fc5-e039-449d-9e74-4f9b493c4288:a4b2fd5c-5df2-42f5-be0d-5b13df977b13", "type": "provider-thread.updated"}]

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

## before-O-supersede-75

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

- Holder 1328906: acquired at 2026-10-24T22:28:41.248242+00:00; changes=[]
- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A3d42c9ff-2099-4311-92a4-7e30f0436ff7%3Aea57a5ca-6d9b-4b85-86ab-8a8d2e052e28:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A3d42c9ff-2099-4311-92a4-7e30f0436ff7%253Aea57a5ca-6d9b-4b85-86ab-8a8d2e052e28%3A37095ef6-7c46-4525-b73f-90a97c3e4a5d:2749c0a7-bac4-424b-8d75-23df98bfd5cc", "type": "provider-thread.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1328906: released at 2026-10-24T22:28:41.331559+00:00; changes=["UPDATE orchestration_v2_projection_provider_threads SET last_run_ordinal=2,payload_json=json_set(payload_json,'$.lastRunOrdinal',2) WHERE provider_thread_id='provider-thread:proof'"]
- Holder 1328906: closed at 2026-10-24T22:28:41.332206+00:00; changes=[]

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

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

## after-O-missing-75

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

- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Ad4c78050-ce15-4459-971f-13bd3bef70bc%3A568379d5-90ca-4ef3-bf96-a06e915d5bb9:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Ad4c78050-ce15-4459-971f-13bd3bef70bc%253A568379d5-90ca-4ef3-bf96-a06e915d5bb9%3Afcaec38f-3879-42d1-8540-17def7180c6d:c09cce10-5093-478d-97c5-4ba67ec6ad50", "type": "provider-thread.updated"}]

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

## after-O-wrongAttempt-75

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

- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A03c1c3f6-4ca1-45bc-b7ea-8297804787c2%3Ada80a585-f57a-41ee-9e23-21f0f8a4d91c:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A03c1c3f6-4ca1-45bc-b7ea-8297804787c2%253Ada80a585-f57a-41ee-9e23-21f0f8a4d91c%3A08966231-0941-4691-b08e-677c2c534b70:b8e12682-9e42-4427-bd17-ae077c1c85b1", "type": "provider-thread.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-O-wrongOrdinal-75

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

- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253Afaeb43d2-9caa-4eb7-937c-3ce6ca4a6bb4%3A6541986f-fef3-4622-b17e-b39202cdf5c8:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253Afaeb43d2-9caa-4eb7-937c-3ce6ca4a6bb4%253A6541986f-fef3-4622-b17e-b39202cdf5c8%3A42cfd561-860b-4f7e-be0b-24b477b82614:0bb7a294-f25e-44e1-a9aa-b9b65cb5b05c", "type": "provider-thread.updated"}]

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

## after-O-supersede-75

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

- Holder 1329740: acquired at 2026-10-24T22:29:01.411224+00:00; changes=[]
- Attempt 1: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A7fbd638c-5176-498f-94cb-1c4b9add0cab%3Aa536d33f-5e51-4b7d-8d28-7732b6bd8a12:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A7fbd638c-5176-498f-94cb-1c4b9add0cab%253Aa536d33f-5e51-4b7d-8d28-7732b6bd8a12%3Ad1afb326-c073-4ed2-89c1-154c4ea4f7f9:3c490e4b-dedf-48e9-9cc1-b5e492ce1693", "type": "provider-thread.updated"}]
- Attempt 1: actual-error: EventSinkWriteError → SqlError → LockTimeoutError
- Holder 1329740: released at 2026-10-24T22:29:01.493275+00:00; changes=["UPDATE orchestration_v2_projection_provider_threads SET last_run_ordinal=2,payload_json=json_set(payload_json,'$.lastRunOrdinal',2) WHERE provider_thread_id='provider-thread:proof'"]
- Attempt 2: writeIfProviderThreadOwner, event IDs: [{"id": "event:thread:thread%3Afixture%3Aprovider-event-ingestor%3Aproject%3Aproject%253Afixture%253Aprovider-event-ingestor%253A7fbd638c-5176-498f-94cb-1c4b9add0cab%3Aa536d33f-5e51-4b7d-8d28-7732b6bd8a12:provider-session:provider-session%3Aprovider-instance%3Acodex%3Athread%3Athread%253Afixture%253Aprovider-event-ingestor%253Aproject%253Aproject%25253Afixture%25253Aprovider-event-ingestor%25253A7fbd638c-5176-498f-94cb-1c4b9add0cab%253Aa536d33f-5e51-4b7d-8d28-7732b6bd8a12%3Ad1afb326-c073-4ed2-89c1-154c4ea4f7f9:3c490e4b-dedf-48e9-9cc1-b5e492ce1693", "type": "provider-thread.updated"}]
- Holder 1329740: closed at 2026-10-24T22:29:01.495555+00:00; changes=[]

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