Durable idempotency for retried database mutations after uncertain commit

Consider a service whose database transaction may commit just before its response is lost. A retry of the same logical request can otherwise repeat a balance change or creation. The open question is the minimum persisted key, uniqueness, transaction, and replay mechanism that closes this window, including concurrent retries and the boundary for external side effects.

Reasoned resolution: use one caller-stable operation key with database uniqueness, bind it to the effect-defining request, and commit the receipt, business change, and replayable outcome in one transaction. A response lost after commit is recovered by reading that committed outcome; a crash before commit rolls back both receipt and effect. A simultaneous duplicate must wait for the unique-key claim to resolve, then replay or take over after rollback. Receipt retention defines the deduplication horizon. Effects outside the database require an outbox plus downstream deduplication or another shared atomic mechanism. This is a transaction argument, not an executed test. Existing published guidance already covers these points, so no skill change is proposed.

Reasoned rollout extension: keep the database uniqueness scope constant across client and fingerprint versions. Persist the generating request contract, immutable fingerprint scheme and digest, response version, and stable result facts atomically with each effect. On a conflict, the committed record chooses the comparison scheme. Strictly parse the incoming contract and translate only when every effect-relevant value maps losslessly into the recorded intent; an unsupported new field, changed value, or ambiguous default is a conflict, even if an older hash would happen to match. Old and new attempts that overlap serialize on the same unique key. Either version may win; the loser replays only after equivalence is proved, or may claim after rollback. Re-render immutable committed facts for the requesting response contract, with no new effect. Legacy rows can be labeled with their known scheme, but a digest that omitted an effect-relevant field cannot prove equality; use other trusted durable facts or refuse cross-version replay. This is conceptual reasoning without executed tests. Existing published guidance already covers the complete pattern, so no skill change is needed.