# Sovereign Evolution 4 — Authoritative Evidence Pipeline Design
## Multi-Dimensional Evidence Contract, Deterministic Pipeline, and Multi-Site Synchronization

**Version:** 1.0.0  
**Schema:** `cain42.sovereign.evidence.v1`  
**Governing Contract:**  
$$\text{AGENT PROPOSES} \longrightarrow \text{CAIN AUTHENTICATES \& VERIFIES} \longrightarrow \text{POLICY DECIDES} \longrightarrow \text{MCPGATE ENFORCES} \longrightarrow \text{ISOLATED RUNTIME EXECUTES} \longrightarrow \text{SIGNED EVIDENCE RECORDS}$$

---

### 1. The 10 Evidence Evaluation Dimensions

To prevent the dangerous collapsing of distinct safety claims into a single "green badge", every evidence record must explicitly assess ten separate dimensions:

| Dimension | Scope & Question | Allowed Statuses |
|---|---|---|
| **A. SOURCE_VERIFIED** | Does the inspected source code implement the specified control? | `PASS`, `FAIL`, `PARTIAL` |
| **B. LOCAL_TEST_VERIFIED** | Did local automated unit, integration, and adversarial tests pass on this machine? | `PASS`, `FAIL` |
| **C. FORMAL_MODEL_VERIFIED** | Was the claim proven in a formal model (e.g., Z3 SMT UNSAT, TLA+ TLC model check)? | `PASS`, `FAIL`, `UNKNOWN` |
| **D. ARTIFACT_INTEGRITY_VERIFIED** | Does the published artifact match its SHA-256 digest in the manifest byte-for-byte? | `PASS`, `FAIL` |
| **E. SIGNATURE_VERIFIED** | Is the artifact signed by an authorized key in the trust root? | `PASS`, `FAIL`, `UNKNOWN` |
| **F. HOSTED_CI_VERIFIED** | Was the regression gate executed and passed by an independent hosted CI runner? | `PASS`, `FAIL`, `BLOCKED`, `NOT_RUN` |
| **G. LIVE_ENDPOINT_CHECKED** | Were public HTTP endpoints probed and verified reachable and non-tampered? | `PASS`, `FAIL`, `NOT_RUN` |
| **H. DEPLOYED_REVISION_VERIFIED** | Does the running production server match the committed source revision? | `PASS`, `FAIL`, `BLOCKED`, `UNKNOWN` |
| **I. PRODUCTION_TRAFFIC_PATH_VERIFIED** | Does actual customer traffic traverse the enforcement boundary in production? | `PASS`, `FAIL`, `BLOCKED` |
| **J. INDEPENDENT_HUMAN_REVIEWED** | Has an independent, unaffiliated human security auditor examined and certified the control? | `PASS`, `FAIL`, `BLOCKED`, `NOT_RUN` |

> **Critical Rule:** Integrity does not prove truth. A valid signature proves possession of a private key, not claim accuracy. A passing local test does not prove production behavior.

---

### 2. Pipeline Execution Architecture

The pipeline orchestrator (`scripts/sovereign/evidence_pipeline.py`) follows an unbroken 12-stage execution flow:

```
[ 1. Capture Environment & Git Provenance ]
                      │
[ 2. Run Test Suites & Collect JUnit XML / JSON ]
                      │
[ 3. Execute Z3 SMT Formal Proof Invariants ]
                      │
[ 4. Parse Model Checking (TLA+ / TLC) Results ]
                      │
[ 5. Execute Mutation Tests & Verify 100% Killed ]
                      │
[ 6. Generate Isolated Sample Ledger & Tampered Canaries ]
                      │
[ 7. Probe Live HTTPS Endpoints across Three Sites ]
                      │
[ 8. Scan Public Bundles for Secrets / Internal Models ]
                      │
[ 9. Build Authoritative Manifest with SHA-256 & RFC 6962 ]
                      │
[ 10. Generate 4-Dimension Release Gate Record ]
                      │
[ 11. Synchronize Authoritative Evidence to IHVRK & Verification Center ]
                      │
[ 12. Run Standalone Verification on Staged Bundle ]
```

---

### 3. Customer Data & Production Ledger Isolation Invariant

- **Canary Enforcement:** Evidence generation routines are mathematically prohibited from opening, writing to, or modifying any live customer database or production append-only ledger (`/var/data/cain_production_ledger.db` or similar).
- **Temporary Chroot / Scratch Directory:** All test ledgers and checkpoints are created in isolated temporary directories (`tempfile.mkdtemp()`) and destroyed or archived into disposable fixtures.

---

### 4. Cross-Site Synchronization Contract

All three public sites share one canonical snapshot identity:
- **Canonical Run ID:** `run-evo04-<timestamp>-<hash>`
- **Manifest Digest:** SHA-256 over canonical JSON of `manifest.json`.
- **Public URL Projections:**
  - `https://cainstudio.online/verification-center/`
  - `https://mcpgate.online/evidence/`
  - `https://clawx.click/evidence/`
- **Homepage Integration:** A first-time visitor landing on `https://cainstudio.online` sees an immediate, prominent link and status banner leading directly to `/verification-center/`.
