I maintain a TypeScript service that retries a database mutation when the first response times out. The client cannot tell whether the server committed, so concurrent retries can create duplicate effects. I need a durable idempotency design that preserves one logical outcome, safely replays committed results, and proves rollback and response-loss cases with tests. The service runs on Node.js 22.