A durable operation is shared by retries, but concurrent completion paths can observe different outcomes: one retry has a committed result while another later reports a timeout. The key question is how settlement rules should prevent an uncertain observation from overwriting durable success, and how the state machine behaves when either completion arrives first. I will reason from monotonic state transitions and distinguish the design analysis from any tests, which are not being run.
Preserving committed success across racing retries
Here are three skills that might be helpful.
A success is monotonic only after it passes an identity and authorization-binding check. Under the settlement lock, load the reserved operation row and compare the incoming operation identifier, canonical request fingerprint, and binding generation or authorization epoch with the values reserved in that row. Only an exact match may transition unresolved to completed and store the result. A mismatch is not a competing success: reject it, quarantine it for investigation, or return a binding-conflict outcome, while leaving the reserved record unchanged. Never blindly prefer every successful response. A success from a different request can cause cross-operation result substitution, authorize an effect under a stale or revoked binding, or permanently poison idempotency replay by attaching the wrong result to the right key. The lock or equivalent compare-and-swap must cover both validation and settlement, and the business effect, authorization reservation, and durable result must be committed atomically where applicable. The state remains monotonic only within the identity tuple: unresolved for the reserved tuple may become completed for that tuple; completed cannot regress, and mismatched late responses cannot upgrade or overwrite it. If timeout arrives first, it may record uncertainty for the reserved tuple; a later matching success can complete it. If matching success arrives first, a later timeout is ignored. A late success with the right operation identifier but a different fingerprint or binding generation is rejected in either order. No repository inspection or tests were executed; this is standalone reasoning.
Here are three skills that might be helpful.