# Sovereign Evolution 4 — Publication and Rollback Protocol
## Standard Operating Procedure for Atomic Evidence Staging, Public Deployment, and Forensic Rollback

**Status:** APPROVED FOR STAGING (Production deployment requires explicit project-owner authorization)  
**Scope:** `cainstudio.online`, `mcpgate.online`, `clawx.click`  

---

### 1. Staging & Pre-Publication Protocol

All evidence artifacts are produced and validated in a strictly isolated staging environment prior to publication:
1. **Pipeline Execution:** Run `python3 scripts/sovereign/evidence_pipeline.py`.
2. **Integrity Validation:** Every artifact in `reports/sovereign/evolution-04/` is hashed with SHA-256 and verified against `manifest.json`.
3. **Secret Scanning:** Run automated scanner to verify zero private keys, bearer tokens, or internal model definitions exist in public-bound files.
4. **Standalone Verification:** Run `python3 ihvrk/evidence/verify_ihvrk_evidence.py` to confirm 9/9 PASS.

---

### 2. Atomic Publication Workflow

Publication across public-serving surfaces must be atomic:
1. **Stage Target Directory:**
   ```bash
   mkdir -p platform-gateway/frontend/evidence/sovereign-evolution-04
   mkdir -p clawx-site/evidence/sovereign-evolution-04
   mkdir -p ihvrk/evidence/evolution_04
   ```
2. **Copy Artifacts:**
   Atomic copy using `rsync` or `cp -a` preserving permissions and timestamps.
3. **Update Canonical Version Pointers:**
   Update `evidence-slots.json`, `public_evidence_index.json`, and `cross_site_status.json`.
4. **Post-Publication Digest Verification:**
   Query each served URL via `curl` and verify the returned SHA-256 matches the manifest digest exactly.

---

### 3. Forensic Rollback Procedure

If any post-publication check fails (hash mismatch, broken link, or regression reported):
1. **Immediate Halt:** Do not attempt in-place edits on public paths.
2. **Revert Version Pointer:** Point `latest` and active indexes back to `sovereign-evolution-03` or `auditor-kit-8.3.1`.
3. **Withdrawn Notice:** If an artifact was withdrawn due to defect or confidentiality, publish a cryptographic `WITHDRAWN.json` citing the reason, timestamp, and replacement hash. Never leave dangling 500 errors or silently remove history.
4. **Preserve Forensic Archive:** The withdrawn or defective bundle must be preserved in git history and offline forensic storage for auditor review.
5. **Log Rollback Action:** Record rollback timestamp, operator ID, and reason in the append-only deployment ledger.
