Delivery writer races prove five lock waits with a bounded sixth rejection
The isolated six-case tranche produced five passing cases with actual database-observed blocking. The sixth rejected completion before recovery and reached the safe canceled state, but failed its blocking assertion. The original run exited 1 and its failure trace is preserved. This is not a six-pass suite.
Scope and results
The executed Delivery source baseline was 24119b54f1cda747c7b420ce7894dd735f2a8884, with the exact private database allowance and harness captured in Delivery checkpoint f4d7cde1ec5e6900c2d82ace9e5a1d2661a0c9d2 (local, not pushed or deployed). Its parent f4efafc9a39a01ba4308f5f7bcaa6724bbb3fa5d contains the scoped allowance, tests, five harness scripts and evidence; the final commit preserves exact evidence bytes through a directory-local Git attribute. Unrelated local mesh changes are excluded. The database is adr0048_delivery_writers_86b017007b374b8ca81d3edced7d4470, Delivery schema delivery_adr0048_test. Its six newly allocated histories remain intact.
| Case | Observed result |
|---|---|
| Completion before preparation | Actual repository completion commits; preparation rejects incompatible outcome; one delivered event. |
| Preparation before completion | Prepared intent commits; completion is fenced; no completion event. |
| Binding before preparation | Actual binding commits; soft-hold cancellation preparation rejects; one hold event. |
| Preparation before binding | Prepared intent commits; actual binder rolls back under the fence. |
| Inbox recovery before completion | Recovery finalizes the prepared cancellation; completion is fenced; one cancellation event and receipt. |
| Completion attempt before inbox recovery | Completion raises onboarding_closure_fenced; recovery finalizes one cancellation. No blocking was observed, so the harness assertion fails. |
The first five cases used two private Prisma clients, real transaction boundaries and the actual dispatcher publisher, with an independent PostgreSQL observer recording pg_blocking_pids and ungranted locks. The completion entry point was updateLessonOutcome, not the complete lesson service with financial admission. Binding used bindReservationToSoftHold; recovery used processDispatcherInboxEnvelope. Internal entry points bypass HTTP authorization. Revenue direct reads and Coaching eligibility were explicitly synthetic contract-consumer responses, with all other fetches rejected. These cases do not prove Revenue financial writer races, Coaching eligibility, signed route authorization or production readiness.
Sixth-case limitation
Completion acquires its real advisory lock inside the same UPDATE trigger that rejects the prepared intent. PostgreSQL aborts the transaction and releases locks before JavaScript reaches the error barrier. Holding that JavaScript barrier cannot establish an actual database wait. The final preserved readback has a canceled lesson at outcome version 1, released lock at version 2, one completed closure receipt, one cancellation outbox event and one recovery journal entry, with no completion event.
A proposed seventh case was assessed and stopped because no genuine JavaScript pause exists between that real lock acquisition and the rejected statement. No test-only lock was added to manufacture ordering. An unused file-only allocation is retained and marked fixtures_seeded: false; it never connected to or mutated the database. No seventh case was executed, and none of the original six was reset or retried.
Evidence and boundaries
The original trace SHA-256 is bb4960bc45b26359fd7e1ca39b969b4a5e33e04808640b9fb298dbbe775d11d1. The immutable worker manifest SHA-256 is e3a0074da7236b6b5818673d29dee3b55d286bfc56ba843ded022929aa786952. Delivery's accompanying docs/evidence/adr0048-writers-20260929/ preserves the trace, case results, sixth analysis, source hashes and cleanup evidence.
Validation passed: 836 Vitest tests with 15 skipped, eight audit mapping tests, typecheck, smoke and static Airtable guardrail. The focused database-target suite passed 56 tests, and all five harness scripts passed syntax checks. These code checks do not change the failed sixth integration assertion.
No deployment, production financial validation, external provider action or ADR-0050 lineage acceptance occurred. The earlier response-loss and Sales lease-recovery evidence remains distinct. This memo does not create or complete a new cross-domain commitment.
Local committed evidence links: README, original failure trace, unused allocation, artifact and source hashes, and final read-only state. These are local checkout links; no remote Delivery publication is claimed.