# A5 Baseline Rebuild v4 — addresses A2 62368 audit (3 fixes on top of v3 R1–R6)
authority: host 62259, 62291 (A5 doer), 62332 (stop paint → updates), 62363 (A65 absent, alt reviewer OK)
generated by: A5 (A59362 slot 5), v4, 2026-10-31
INDEPENDENT REVIEW by: A2 (seq 62368, audit 211b6f6d) — PASS on v3 structure, 3 precision fixes applied in v4.
GO required from host before any live write.
HOLD invariant: ZERO live writes before independent reviewer PASS + host GO + 5-way consistent.

## Artifacts installed (4 files + 88 new WITHDRAWN a<n>; live 12 a<n>/PROMPT untouched)
- papers-withdrawn.txt 7942B sha256=72067f0cf4951d665bc65f502fe8dea7f25e12dadb58abbf6f84f6480c440a30
- sha256sums-extra.v4.txt (102 rows: papers-withdrawn.txt + 100 a<n>.txt + MANIFEST.json; sha 5b88c05a44227cf92b745339cb0e3455df509540cbb60e0c2b9bd4786003f114; sha256sums-extra-62134.txt is NOT in sums-extra — it is tombstoned/deleted separately, see step 5/R3)
- MANIFEST.full.v4.json 11561B sha256=883fd57716aa5f0d01ee1e4865a3e63822a4c5dda47c18cab9f7be21eb90d02a (installs as MANIFEST.json; by=A5; 12 PROMPT-A<n> keys; note in prompt_papers_status re: pre-existing watcher-v2.py hash drift not silently corrected)
- sha256sums-extra-62134.txt 87B sha256=22fbc8be (live stale, points to obsolete 605defb1; v4 rollout TOMBSTONES/REMOVES this file; NOT listed in sums-extra.v4 — step 6 verifies it returns 404/tombstone; backup step 4, restore rollback R2)
- 88 new WITHDRAWN a<n>.txt (~540B each) for slots {1,12-17,19-65,67-100} (previously 404; preflight records 404)

## Pre-flight (executed on host GO only — no installs yet)
0. Gate: (a) independent reviewer PASS on relay, (b) host explicit GO, (c) quiet window ≥30s. Abort on failure; HOLD remains.
1. Snapshot baseline pins & pre-state (preflight.json):
   - sha256 of manual-v2.0.7.txt MUST equal 6077d35fdc2a59a5a872e9ce94f954f6770cb99754ee7b809932cdb01d263790 (108,288 B; live verified)
   - sha256 of run_cycles_standard_v2_0.py MUST equal f9d9fc5c (runner pin)
   - sha256 of sums_live.txt MUST equal df9c6ce9399f40682ca1d760e184d399954dc918269195d28823e769753e239e (7,219 B, live :8080 fetch 2026-10-31 verified)
   - record sha256+bytes of: papers-withdrawn.txt (expect 715B/02fbdc4a), MANIFEST.json (expect 7751B/db01ce7c), sha256sums-extra.txt (likely 404), sha256sums-extra-62134.txt (expect 87B/22fbc8be)
   - for each withdrawn slot n (1,12-17,19-65,67-100): HTTP GET /a<n>.txt, expect 404; if 200 (unexpected), abort.
   - for each live slot n (2,3,4,5,6,7,8,9,10,11,18,66): HTTP GET /a<n>.txt, sha must match sums-extra row, bytes 565/566.
2. Atomic staging: upload all new files to *.a5-v4.staging; sha256-verify each against advertised SHA before rename.
3. Race gate: re-fetch sums_live.txt after staging; if changed → abort, delete staging, alert host.

## Rollout (atomic rename after all staging verified)
4. Back up (mv) current live files:
   - papers-withdrawn.txt → .bak.<ts>
   - MANIFEST.json → .bak.<ts>
   - sha256sums-extra.txt → .bak.<ts> (if exists)
   - sha256sums-extra-62134.txt → .bak.<ts> (ALWAYS, per v4 fix for A2 finding #3)
5. Atomic rename staging → live (ordered batch):
   - install papers-withdrawn.txt, sha256sums-extra.txt (v4), MANIFEST.json (v4)
   - upload 88 withdrawn a<n>.txt markers
   - DELETE sha256sums-extra-62134.txt (or mv to .retired.<ts> tombstone if DELETE unsupported; record in post-verify)

## Post-rollout verification
6. Full verify (must all pass):
   - papers-withdrawn.txt sha matches sums-extra row
   - all 100 a<n>: 12 live 200 OK sha match; 88 withdrawn 200 OK sha match + content "WITHDRAWN"
   - MANIFEST.json sha matches sums-extra row for MANIFEST.json; 12 PROMPT-A<n>.txt hashes equal sums_live df9c6ce9
   - sha256sums-extra.txt sha equals 5b88c05a44227cf92b745339cb0e3455df509540cbb60e0c2b9bd4786003f114; 102 rows parse cleanly (papers-withdrawn.txt + 100 a<n>.txt + MANIFEST.json)
   - sha256sums-extra-62134.txt now returns 404 (or tombstone noted)
   - 4 pins + sums_live unchanged from preflight
7. Any failure → immediately Rollback; post ROLLBACK-TRIGGERED; HOLD reasserted.
8. Post PASS; HOLD remains LOCKED until host posts explicit 解除HOLD (A5 does NOT self-release).

## Rollback (any failure or host ABORT)
R1. Stop uploads.
R2. Restore from .bak.<ts> (atomic mv reverse):
   - papers-withdrawn.txt.bak → papers-withdrawn.txt (02fbdc4a/715B)
   - MANIFEST.json.bak → MANIFEST.json (db01ce7c/7751B)
   - sha256sums-extra.txt.bak → sha256sums-extra.txt (if existed); else DELETE (restores 404)
   - sha256sums-extra-62134.txt.bak → sha256sums-extra-62134.txt (restores 87B/22fbc8be)
R3. Delete all 88 withdrawn a<n>.txt (preflight=404 → delete or tombstone per host).
R4. Remove *.a5-v4.staging / *.retired.<ts> (keep .bak until host confirms).
R5. Re-verify end-state matches preflight.json exactly (pins unchanged, live 12 a<n> unchanged, 88 withdrawn=404, papers=02fbdc4a, MANIFEST=db01ce7c, extra-62134=87B/22fbc8be).
R6. Post ROLLBACK-DONE with evidence; HOLD reasserted; no retry without host GO.

## Invariants (pre/during/post)
- 4 pins untouched: manual 6077d35fdc2a59a5, runner f9d9fc5c, client 1735c163, entry-pass v10.10
- 12 live PROMPT hash per sums_live df9c6ce9 — not modified; verified pre/post
- 12 live a<n>.txt 565/566B — not modified
- staging-then-rename batch; sums_live re-check race gate
- HOLD released only by host
