# Replay guide

Run these commands from the release directory. The exact-arithmetic readers
use Python 3 and the pinned SymPy release in `requirements.txt`.
`crosscheck_paper.py` also reads the PDFs through Poppler's `pdftotext`.

## 0. Prepare the exact Python reader

```bash
python3 -m venv .venv
. .venv/bin/activate
python3 -m pip install -r requirements.txt
```

## 1. Verify the release bytes

```bash
sha256sum -c SHA256SUMS
```

Each listed file reports `OK`.

## 2. Replay the exact UFT receipt

```bash
PYTHONHASHSEED=0 python3 -I check_uft.py | cmp - RESULTS.txt
PYTHONHASHSEED=1 python3 -I check_uft.py | cmp - RESULTS.txt
python3 -I check_card.py
python3 -I check_ci_artifact.py
python3 -I crosscheck_paper.py
```

The two seeded runs are byte-identical to `RESULTS.txt`. The reader card, Lean
CI artifact reader, and printed-paper crosscheck end in `RESULT PASS`.

## 3. Replay the source-bound closure ledger

```bash
git clone -b main coppalini-architecture-312aedb.bundle source
git -C source checkout 312aedb76dc04216245a2a2f3f0d23f9727ca0be
python3 -I check_closure.py source
```

The source reader requires the declared commit and a clean worktree before it
checks the 25 pinned source files.  It replays the local action receipts and
reports:

```text
STATUS KERNEL_REPLAYED=10 OPEN=1
RESULT PASS
```

## 4. Reproduce the pinned Lean path

The source checkout carries `lean-toolchain` with
`leanprover/lean4:v4.33.0` and its pinned `lake-manifest.json`.  In a Lean
environment matching that pin, run:

```bash
cd source
python3 scripts/verify_archive.py
python3 scripts/compile_lean_011.py
python3 scripts/verify_lean_011.py --log build/011-lean.log
python3 scripts/replay_lean_011.py
lake env leanchecker --fresh --verbose proofs.RootToPhysicsManifest011j
```

The retained CI artifact `lean-011-ci-46299956623.zip` holds the successful
fresh replay receipt, logs, root-usage report, and input hashes for this exact
path.  [CI_RECEIPT.json](CI_RECEIPT.json) binds those files to the source
commit and workflow run.
