Skip to content

refactor(schedule): 23503 race mapping moves behind the repository seam (gh-#406 slice 1) - #508

Merged
genwave-radio merged 2 commits into
mainfrom
refactor/gh-406-s1-schedule-error-contract
Aug 14, 2026
Merged

refactor(schedule): 23503 race mapping moves behind the repository seam (gh-#406 slice 1)#508
genwave-radio merged 2 commits into
mainfrom
refactor/gh-406-s1-schedule-error-contract

Conversation

@genwave-radio

Copy link
Copy Markdown
Collaborator

gh-#406 L2 burn-down, slice 1 of 5 (stack: merge this first; merge commits, not squash — each later slice's PR is based on the previous branch).

⚖️ ScheduleController was L2-exempt for catching PostgresException 23503 (the validated-persona-deleted-mid-PUT race). The catch moves into ScheduleRepository.ReplaceWeekAsync (mirroring PersonaRepository's idiom), which logs the WARN with the full exception — the zero-information-loss placement, since only the repository sees it now — and returns the new ScheduleReplaceResult.PersonaVanished case. Controller switches on the case → byte-identical 409. using Npgsql gone from Host.

📉 Baseline row deleted (5 debt rows → 4). Also retires Story317's stale "unlike Story240's PostgresException-scripting idiom" prose — Story240 now scripts the typed case like everything else.

🧪 New db spec maps a real 23503 to the case deterministically (via the unvalidated show_id FK — same SQLSTATE, no cross-connection race choreography needed; the catch matches SQLSTATE only).

✅ At stack tip: build 0 warnings; Architecture 104/104; MediaLibrary 763/763 (full db suite); Host 1723/1723 (full); Core 144/144.

@genwave-radio
genwave-radio merged commit 5a29570 into main Aug 14, 2026
11 checks passed
@genwave-radio
genwave-radio deleted the refactor/gh-406-s1-schedule-error-contract branch August 14, 2026 01:35
@github-actions github-actions Bot locked and limited conversation to collaborators Aug 14, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant