<!-- @requirements REQ-PRODUCT-EVIDENCE-LIFECYCLE REQ-PRODUCT-CONTRACT-ACTIONS REQ-PRODUCT-ORDER-CONFIRMATION REQ-PRODUCT-PAID-ORDER-ARCHIVES -->
# Transaction recovery verification

`npm run cf:recovery:transactions` runs `scripts/check-transaction-recovery.mjs` against three disposable Wrangler SQLite Durable Objects. The separate provider object's durable job IDs are never restored. Test controls live in `scripts/fixtures/transaction-recovery-worker.mjs`, outside the shipped packages and starter.

The run passed again on 23 October 2026 with eight contexts: four contract declarations and four admitted orders with personally addressed confirmation files. A pre-delivery KV snapshot is restored to a different empty object after source-side deliveries, lost responses, new holds and completed retirement/purge. The fixture's ordinary reads, capture/admission replay, dispatch and file calls stay closed before hydration, after hydration and across reconciliation/purge restarts. Source-only seed routing, a second hydration, a wrong journal target and premature opening are refused.

Later hold-only decisions are applied through the revision-checked API before retirement manifests. After a restart, holds still reject retirement. Manifest replay restarts the purge; a one-key batch's progress survives another process restart. After completion, retired contract/order events, legacy head locations and the order intent subtree are physically absent. The updated fixture seeds four synthetic legacy-shaped contract heads containing the original request. It checks their presence before backup, restoration of the retired head, its physical deletion by the existing lifecycle purge, and preservation of the three surviving heads across restarts. These are deliberate test inputs, not records written by the current contract recorder. The opening check also requires the retired head to be absent and surviving heads to match their expected content. Retired admission is tested with `admitPaidOrder` and a sentinel callback that must not run. The old declaration capture is rejected; neither retired context can invoke the provider. Retired order files are inaccessible.

Two direct regression tests first failed against the old readiness helper: a reinserted retired head and a missing or changed surviving head incorrectly allowed reopening. The helper now refuses each case without changing storage. This fixes the maintainer fixture’s acceptance check; the existing package purge already deleted the correctly bound populated head.

Surviving records and receipts match their original capture. The restored historical pending jobs retry under their original delivery IDs and immutable payload digests. The simulated provider records nine distinct jobs, eighteen attempts and nine commits, with exact per-job attempt counts. A lost response after provider acceptance leaves `uncertain` persisted; its entire inspection result matches after restart before retry. All surviving primary files and 150 KB attachments match byte for byte after restore and retry, exercising multiple archive chunks and the fixed destination version.

Backup, later decisions and report are separate owner-only files; disk bytes and SHA-256 are recorded and checked. The capability/configuration also stays in the private ignored run directory. The runner refuses an occupied loopback port and stops only its own Worker. No Cloudflare deployment, real provider delivery, production credential or package publication occurs.

This local check does not prove provider-native restore or in-place rollback; those have a [separate native six-family rehearsal](</guide/verification/cloudflare-remote-recovery/index.md>). Neither check proves real idempotency retention, journal authentication/completeness, recovery of every evidence family, payment/stock/fulfillment recovery, external-copy deletion or legal compliance. The isolated fixture serializes whole operations; real hosts must fence and drain every access path. The deployment and evidence features remain partial. See the [host recovery recipe](</guide/cloudflare-recovery/index.md#recover-declarations-and-order-confirmations>).
