Skip to content

fix: diagnostics survive recovery races end-to-end; exactly-once per recovery window (2.0.3, published) - #25

Merged
palermo-git merged 1 commit into
mainfrom
diagnostics-races-2.0.3
Oct 7, 2026
Merged

palermo-git merged 1 commit into
mainfrom
diagnostics-races-2.0.3

Conversation

@palermo-git

Copy link
Copy Markdown
Contributor

Closes the sirtify-routed last_error-wipe finding WITH its whole race family, three codex rounds + a claude final pass deep. (1) A successful release replays the row's admission-time diagnostic; (2) every fate-resolving outcome releases the enqueue claim in the same statement; (3) a zero-row release on a cleared claim classifies as benign completion, with genuine contention and vanished rows as distinguishable labels; (4) the claim gate is the lease alone and successful admissions park it for one 30s horizon — exactly-once per recovery window at the seam, previously upheld only by SQLite statement serialization (the final PG coverage gate caught a true-concurrency double-admit; a forced-interleaving test now pins it structurally). Full gate on final source: SQLite 787, PG coverage 823/100%, dialyzer 0, credo strict, docs, package bytes-match, livebook vs archive, Ash-floor qualification. The 2.0.3 package is already published (hex.pm/packages/ash_hooks/2.0.3, checksum e8701e22…) from this exact tree; the tag is pushed; this PR lands protected main.

…n is exactly-once per window (2.0.3) — the sirtify-routed last_error-wipe closed with its whole race family: a successful release now REPLAYS the row's admission-time diagnostic (http_503 stays visible through re-admission; only a fresh enqueue failure writes a new error); every fate-resolving outcome (mark_succeeded, mark_send_failed both forms, finalize_disable, and the stored 410 obligation itself) releases the enqueue claim in the same statement, so a reconciler whose enqueue raced the outcome finds the token gone; a release matching zero rows on a CLEARED claim classifies as benign completion (:reconciled, never :endpoint_error) via reload, with genuine contention (:stale_enqueue_claim) and a vanished row (:enqueue_reload_failed) as distinguishable labels; and the claim gate is the LEASE ALONE — a successful admission parks enqueue_lease_expires_at for one 30s horizon (release_enqueue/5 takes the explicit enqueue outcome; the error string carries the preserved diagnostic on success), so a concurrent sweep inside the horizon reports a contended :duplicate instead of re-admitting (the exactly-once contract was previously upheld only by SQLite statement serialization — the final PG coverage gate caught a true-concurrency double-admit; the forced-interleaving test now pins it structurally, and the horizon-passed re-claim keeps crashed-claim recovery). The reconcile_pending docstring states the new contract; the changelog names the consumer-observable consequence (sub-30s sweeps see :duplicate where 2.0.2 re-admitted). Three codex rounds + a claude final pass (receipts under .kimosabe/reviews + scratch), every finding fixed — including two of mine the round-3 review caught (the park keyed on is_nil(error) while success carries the diagnostic; the claim gate's token arm bypassing the parked lease) and the gate's own catches (an uncovered-clause collapse, a duplicate reload/3, three struct-bound lease fixtures). Gate on final source: format, compile --warnings-as-errors, credo --strict, hex.audit, currency, SQLite suite 787, PG coverage 823 passed / 100.00% total against the ephemeral-area PG + the real receiver, dialyzer 0, cheat-sheets --check, docs --warnings-as-errors, check-package bytes-match, the tour notebook executed green against the 2.0.3 archive, and the exact-Ash-floor qualification passed.
@palermo-git
palermo-git requested a review from corepay as a code owner October 7, 2026 12:24
@coderabbitai

coderabbitai Bot commented Oct 7, 2026

Copy link
Copy Markdown

Important

  • 🔍 Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 2b3831d7-b025-4d49-b367-aed6ac363bb1
  • Autopilot · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@palermo-git
palermo-git merged commit 0a0c2d7 into main Oct 7, 2026
19 checks passed
@palermo-git
palermo-git deleted the diagnostics-races-2.0.3 branch October 7, 2026 12:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant