flowchart LR accTitle: Recovering the export on either side of commit accDescr: The caller sees the same silence in two different database states. Follow the original request key through rollback, a committed-but-lost reply or a conflicting retry. %% journal-retry-crash-map (en) %% https://www.thebsq.com/blog/prototype-to-production-checklist/ subgraph g1 ["Request contract"] %% n_intent — Before sending, the client stores key K for snapshot 7 and the requested format. It keeps the key across timeouts for this same operation. n_intent["One intended export"] %% n_validate — Authorize the tenant and snapshot, apply defaults and normalize the validated fields. Trace IDs are transport metadata and do not change the export identity. n_validate["Validate and scope"] %% n_key — The unique tenant, operation and key identify the receipt. A concurrent insert may wait for the first transaction. A bounded wait can end in a retry with the same K. n_key["Claim or find K"] end subgraph g2 ["Crash windows"] %% n_writes — Stage the request receipt, conditional credit debit, job for the immutable input and outbox dispatch intent inside the same database transaction. n_writes["Uncommitted writes"] %% n_before — After restart the uncommitted request, debit, job and outbox are absent. A valid retry can win admission and perform all four writes together. n_before["Cut A · before commit"] %% n_after — All four changes exist before the HTTP receipt reaches the client. If the reply is lost, the caller cannot infer whether a credit has been spent. n_after["Cut B · after commit"] %% n_retry — An unknown commit outcome takes the same recovery route as a missing reply. Reconnect, check permission again and look up the original intent. n_retry["Repeat with the same key"] end subgraph g3 ["Observable outcomes"] %% n_compare — For an existing key, read the winning row and compare the normalized fingerprint. Under the described Read Committed design, the subsequent lookup gets a new statement snapshot. n_compare["Compare the input"] %% n_receipt — Return the recorded job ID and stable status URL. Recovery adds no new job, debit or outbox entry. A separate status read reports later progress. n_receipt["Same 202 receipt"] %% n_conflict — The same scoped key with a different snapshot or format conflicts with the accepted request. The original durable state and remaining credit are preserved. n_conflict["409 on changed intent"] end n_intent -->|"Send K with the immutable input"| n_validate n_validate -->|"Attempt the scoped claim"| n_key n_key -->|"New identity wins"| n_writes n_key -->|"A committed identity exists"| n_compare n_writes -->|"Process stops before commit"| n_before n_writes -->|"Database commits before the reply"| n_after n_before -->|"Client still has no receipt"| n_retry n_after -->|"Acknowledgement is lost"| n_retry n_after -->|"Acknowledgement reaches the client"| n_receipt n_retry -->|"Authorize the original intention again"| n_validate n_compare -->|"Normalized payload matches"| n_receipt n_compare -->|"Normalized payload differs"| n_conflict %% Recover a committed export — n_writes → n_after → n_retry → n_validate → n_key → n_compare → n_receipt %% Retry before commit — n_before → n_retry → n_validate → n_key → n_writes → n_after → n_receipt %% Detect changed intent — n_intent → n_validate → n_key → n_compare → n_conflict