> ## Documentation Index
> Fetch the complete documentation index at: https://docs.jaantonio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Retry safety rules

> Hard guarantees Lambda keeps when recovering or correcting stamp work.

These rules are why stamp retry is deliberate instead of a casual “try again” button. They protect against duplicate CFDIs, silent remaps, and correcting the wrong problem.

## Non-negotiables

<AccordionGroup>
  <Accordion title="Original CargoWise captures are immutable">
    Retry never edits the original accounting XML. Remapping always starts from the stored capture.
    The capture is evidence; the invoice row is Lambda's claim.
  </Accordion>

  <Accordion title="Successful and cancelled documents do not retry">
    A stamped or completed CFDI is finished. Active or completed cancellation blocks stamp retry.
    Replacing a Lambda-owned stamp is a separate, support-owned operation — not an everyday
    workspace path.
  </Accordion>

  <Accordion title="In-flight and parent-waiting work is left alone">
    Documents that are validating, ready, stamping, pending, workflow-owned, or waiting on a parent
    are not open for a second stamp lane. Lambda returns the active operation instead of stacking
    another.
  </Accordion>

  <Accordion title="Unknown provider outcomes never become new attempts">
    If Lambda cannot prove create never happened, it resumes the exact request and key. Remapping
    into a fresh create is blocked.
  </Accordion>

  <Accordion title="Failed documents need proven correction">
    An unchanged rejected request cannot open another attempt. Corrective retry on `failed` requires
    proof the fiscal projection changed, or that a policy-approved prerequisite was corrected. Most
    of that lane is support-owned.
  </Accordion>

  <Accordion title="Preview hash must still match at apply">
    Apply recomputes the plan. A stale hash fails closed. Hashes are not hand-edited, and one plan
    stays scoped to one invoice (or an explicit bulk fiscal-correction plan that still previews
    first).
  </Accordion>

  <Accordion title="Stamp truth stays on stamp events">
    Retry records resume or reprocess claims. Terminal fiscal truth remains stamp completed, webhook
    stamped, or stamp failed — not a second “retry succeeded” fiscal event.
  </Accordion>

  <Accordion title="Delivery retry is not stamp retry">
    **Retry CargoWise delivery** only re-sends artifacts. It never issues another CFDI. See [How
    stamping works](/stamping/how-it-works).
  </Accordion>
</AccordionGroup>

## What automatic recovery may do

Automatic recovery may:

* Re-enqueue work that never started, from the **persisted** intent
* Resume the **current** durable attempt with the same request and key
* Replay a terminal attempt proven `known not created` by cloning that exact private request under a new key

It may not:

* Remap a newer CargoWise capture into new fiscal intent
* Invent a corrective category or skip preview/apply for support corrections
* Quietly re-stamp to match post-stamp CargoWise drift

When recovery budgets are exhausted, the document moves to [system error](/stamping/system-errors). Support then uses a fresh corrective plan and reason.

## What corrective retry may do

Corrective retry may change course only under categories Lambda derives from evidence:

| Category                     | Meaning in plain language                                                                    |
| ---------------------------- | -------------------------------------------------------------------------------------------- |
| **Lambda version change**    | Deployed mapping/reconcile code would produce a meaningfully different safe projection       |
| **Client fiscal correction** | A complete, validated fiscal profile overlays specific client fields for one planned attempt |
| **Source correction**        | Accepted source-change evidence justifies remapping the original capture                     |

Operators do not free-pick a category to force a stamp.

## External stamps

Documents observed as stamped outside Lambda (**Stamped externally**) have no Lambda stamp retry or cancellation action here. They are recorded evidence, not Lambda-owned CFDIs to remake.

## How this reads in the workspace

* If Lambda offers **Retry stamp**, policy already allows a safe continuation for that classification.
* If the workspace withholds retry, that is usually the product working — see [Failures](/stamping/failures), [System errors](/stamping/system-errors), and [Recovery paths](/stamping/retry/paths).
* Post-stamp CargoWise disagreement is not a silent re-stamp. Matching evidence or deliberate support review owns that path — see [Rules](/stamping/rules).
