# Final server evidence refresh

Evidence for [#21092](https://git.cafe/pingdotgg/t3code/pulls/21092) ([GitHub mirror](https://github.com/pingdotgg/t3code/pull/21092)). Original [AnobleSCM/t3code](https://github.com/AnobleSCM/t3code), `fix/15542-retry-locked-event-write`. Workspace `/home/ubuntu/wt/pr-21092`, branch `takeover/pr-21092`.

Before/current origin/main/merge-base: [3cc31ed27c](https://github.com/pingdotgg/t3code/commit/3cc31ed27c8956b36cee35a50509fb7c6869592b), full SHA `3cc31ed27c8956b36cee35a50509fb7c6869592b`. After/final HEAD: [83ef5cf0b6](https://github.com/pingdotgg/t3code/commit/83ef5cf0b67c915b0db262e8089c84c6eb71a669), full SHA `83ef5cf0b67c915b0db262e8089c84c6eb71a669`. Every runtime row uses these revisions; every ingestion-start raw trace includes its full revision.

**112/112 runtime executions (56 before, 56 after); 28/28 focused tests; 11/11 groups, 20/20 route-expanded obligations.** Same public 112-case driver, with only source revision and scratch-path substitutions; byte comparison verified. Holder unchanged. Old `/tmp/ev-21092-capture` preserved; fresh evidence under `/tmp/ev-21092-capture-final`.

The merged upstream changes leave the entire orchestration-v2, persistence and nodeSqliteClient boundaries unchanged. Current main versus final HEAD remains exactly the ingestor and its test file. Before source is obtained by `git show 3cc31ed27c8956b36cee35a50509fb7c6869592b:apps/server/src/orchestration-v2/ProviderEventIngestor.ts`; after uses the real current source alongside unchanged real dependencies. [merge-scope.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bf0b742b0564018e/merge-scope.txt); [provenance.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/db7575953d596fe8/provenance.txt).

Short pair: [before-after.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d0cc99725bbff478/before-after.md). Updated unchanged-obligation matrix: [matrix.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b01f933f14fce6c2/matrix.md).

## Runtime rows

Each row below binds before to `3cc31ed27c8956b36cee35a50509fb7c6869592b` and after to `83ef5cf0b67c915b0db262e8089c84c6eb71a669`. Unlocked and negative controls are unchanged.

| Group | Paired row proof | Coverage |
|---|---|---|
| P | [proof-P.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/655c4e9bf782b137/proof-P.md) | Plain-write recovery after one/two actual lock errors; includes production 5000ms pair. |
| R+ | [proof-R-positive.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b03af6794b8a43d7/proof-R-positive.md) | Matching stored run commits once after recovery. |
| R0 | [proof-R-stale.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a159d1ca7abd6799/proof-R-stale.md) | Missing/wrong status/wrong attempt and concurrent supersession; stale retries commit nothing. |
| O+ | [proof-O-positive.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/02442ebd2f5b3701/proof-O-positive.md) | Matching owner/run/ordinal; late provider_thread.updated commits once. |
| O0 | [proof-O-stale.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1c2c61845fc9498a/proof-O-stale.md) | Missing join/wrong attempt/wrong ordinal and concurrent supersession; stale retries commit nothing. |
| S+ | [proof-S-positive.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5d08fc143ac62ba5/proof-S-positive.md) | Secondary model/options recovery after primary commit; primary never repeats; explicit reported selection. |
| S0 | [proof-S-skip.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/587e70e9d00de52a/proof-S-skip.md) | Origin/null/missing/equal/recheck skips; repeated success adds no durable model event. |
| L | [proof-L.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/6d6e83d15785239d/proof-L.md) | All four routes: persistent real lock exhausts at three attempts after, one before. |
| E | [proof-E.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/695832fc045285b7/proof-E.md) | All four routes: real scoped SQLite constraint fails once; separately labeled synthetic non-SQL/absent-cause controls. |
| M | [proof-M.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d2dc5bf01d4f7452/proof-M.md) | All four routes: real lock then real constraint stops at second attempt after; separate injected sequence controls. |
| C | [proof-C.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a14f7f9ddabc3c45/proof-C.md) | All four unlocked controls; empty output; both-guard owner priority and no fallback. |

## Protocol and interpretation

Real ProviderEventIngestor, EventSink, file SQLite persistence, durable event log and projections. Separate Python sqlite3 OS processes acquire BEGIN IMMEDIATE on each same canonical database. Release follows observed actual failed-write IPC milestones; no timers, sleeps or polling. Production pair retains server busy_timeout=5000ms; supporting cases explicitly set that server connection to 75ms. Real contention and constraint errors are recorded separately from labeled synthetic classifier cases.

Real EventSink subscribers are ready before initial ingestion, then drained through committed completion markers using Deferred barriers. Initial-ingestion publication IDs/types equal durable log entries in order with no duplicates. Readiness/completion markers are excluded from target counts. **Repeat calls assert durable log counts and unchanged model selection only; they do not claim repeat-call subscriber coverage.** Guard rejection, attempts, primary/secondary counts and model/options are asserted by the unchanged driver.

Production pair: before fails on the first actual LockTimeoutError with zero target events; after retries and persists/publishes exactly one provider-turn.updated. Turn projection completes while fixture run remains running. This is shared-server ingestor evidence, not whole-run or turn-start recovery.

## Artifacts and reproduction

- [before-after.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d0cc99725bbff478/before-after.md)
- [transcript.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/372b767b072ea541/transcript.md)
- [runtime.jsonl](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/cffc3cf74a6b06f2/runtime.jsonl)
- [results.json](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/18cbe8fe2db25134/results.json)
- [focused-tests.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/33895ea7b1d70df3/focused-tests.txt)
- [runtime-tests.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/8825a66f52781eb0/runtime-tests.txt)
- [environment.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/3640e1cc474cf1dd/environment.txt)
- [provenance.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/db7575953d596fe8/provenance.txt)
- [capture-audit.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/ce7a3b8523a42435/capture-audit.txt)
- [EvidenceCapture.test.ts](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5a2642a12284750f/EvidenceCapture.test.ts)
- [EvidenceBefore.ts](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/6444c41efd347080/EvidenceBefore.ts)
- [holder.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/fdb8e3454b85732b/holder.py)
- [replay.sh](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/9886a4bc102de66c/replay.sh)
- [summarize.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/2d2b9372a11d58fb/summarize.py)
- [package-evidence.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/85b3de9b28225062/package-evidence.py)
- [finish-refresh.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/50ae6690791e6c60/finish-refresh.py)
- [merge-scope.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/bf0b742b0564018e/merge-scope.txt)
- [matrix.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b01f933f14fce6c2/matrix.md)
- [proof-C.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a14f7f9ddabc3c45/proof-C.md)
- [proof-E.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/695832fc045285b7/proof-E.md)
- [proof-L.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/6d6e83d15785239d/proof-L.md)
- [proof-M.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/d2dc5bf01d4f7452/proof-M.md)
- [proof-O-positive.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/02442ebd2f5b3701/proof-O-positive.md)
- [proof-O-stale.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/1c2c61845fc9498a/proof-O-stale.md)
- [proof-P.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/655c4e9bf782b137/proof-P.md)
- [proof-R-positive.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/b03af6794b8a43d7/proof-R-positive.md)
- [proof-R-stale.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/a159d1ca7abd6799/proof-R-stale.md)
- [proof-S-positive.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5d08fc143ac62ba5/proof-S-positive.md)
- [proof-S-skip.md](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/587e70e9d00de52a/proof-S-skip.md)
- [cleanup.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/9ec8d1f3b4ddebe5/cleanup.txt)
- [readback-verification.txt](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/65fdc6312648158f/readback-verification.txt)
- [readback.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/26f6fbfaf699ea61/readback.py)
- [build-final-index.py](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/5715709f881a2eed/build-final-index.py)

Download `EvidenceCapture.test.ts`, `holder.py`, `replay.sh`, `summarize.py`, and `package-evidence.py` to a fresh `/tmp/ev-21092-capture-final` with the pinned clean checkout. Replay refuses an existing first database, installs two temporary source modules, runs both focused and runtime suites, summarizes/packages while modules exist, and removes them through its EXIT trap. Preserve current evidence first. `EvidenceBefore.ts` is included for inspection, but replay obtains it independently through git show. Scripts are never committed.

[Artifact readback verification](https://gh-file-drop-api-prod-mi5fy3sowv63ufte.pinglabs.workers.dev/f/65fdc6312648158f/readback-verification.txt) confirms all 30 primary uploaded artifacts were downloaded and read in full, byte-identical to local copies; structured trace/results and scripts parsed.

## Scope and cleanup

Shared normalized server event ingestion only: plain, run-guarded, owner-guarded and secondary native-subagent model-sync writes. No provider CLI, client transport delivery beyond internal subscriber, turn-start persistence, orphan cleanup, failed-COMMIT recovery, input cancellation batches, warning-only branch-metadata follow-up, UI/browser or full app lifecycle. No broadening beyond the original matrix.

All 38 fresh lock holders exited, replay exited, temporary source modules removed, and checkout clean at final HEAD. No production edits, commits, push, comments, watch, browser, dev server, or live userdata use. Prior findings/resolutions: none blocking. Final independent audit/replay remains a separate step; this refresh does not claim that verdict.

## FRICTION category|problem|prevention

- REVISION|Previous artifacts bound to pre-merge revisions.|Refresh every runtime row against exact final head and current main/merge-base; verify unchanged source boundaries and driver substitutions.
- PUBLICATION|Repeat durable assertions could be read as repeat subscriber proof.|Explicitly restrict subscriber claims to initial ingestion; label repeat log/model assertions.
- TIMING|Synchronous SQLite waits require independent lock release.|Retain unchanged IPC holder protocol and actual-error milestones; disclose production/support timeouts.
- DELIVERY|Public artifact reads can reject the default Python user agent.|Use curl with accepted user agent and compare every byte after upload.

No blocking friction in this refresh. Evidence produced by GPT-6.1 Sol through Codex in T3 Code. Uploads use the [ghdrop skill](/home/ubuntu/.codex/skills/ghdrop/SKILL.md).
