# Sovereign Evolution 3 — Test Results

**Date:** 2026-10-12  
**Kernel:** Linux 7.0.0-38-generic (Landlock ABI 8, cgroups v2, LSMs: lockdown, capability, landlock, yama, apparmor, ima, evm)  
**Execution Verdict:** LOCAL PASS (348 passed across Evolution 2/3 and IHVRK suites; 0 failed)  
**Hosted CI Status:** BLOCKED (No remote repository configured; tests executed on local workstation)

---

## 1. Test Suite Summary

| Suite | File | Tests Run | Passed | Failed | Skipped | Runtime |
|---|---|---|---|---|---|---|
| Mediated Launcher & OS Boundary | `tests/test_evolution_3_mediated_launcher.py` | 9 | 9 | 0 | 0 | 2.22s |
| Landlock ABI 8 Kernel Sandbox | `tests/test_sovereign_e3_landlock.py` | 11 | 11 | 0 | 0 | 2.03s |
| Resource Exhaustion & Fuzzing | `tests/test_sovereign_e3_resource_exhaustion.py` | 11 | 11 | 0 | 0 | 6.36s |
| Evolution 2 Adversarial Suite | `tests/test_evolution_2_adversarial.py` | 17 | 17 | 0 | 0 | 1.21s |
| Independent Auditor Resource Kit | `ihvrk/tests/` (all subdirectories) | 300 | 300 | 0 | 0 | 23.58s |
| **Total** | | **348** | **348** | **0** | **0** | **35.40s** |

---

## 2. Detailed Test Outcomes

### A. Mediated Launcher & OS Boundary (`tests/test_evolution_3_mediated_launcher.py`)
- `test_landlock_allows_write_to_authorized_directory`: Verified that child processes can write to operator-authorized directories beneath the Landlock profile (`output.txt` written and verified).
- `test_kernel_blocks_write_outside_landlock_boundary`: Verified that writes outside the Landlock profile (to `secret.txt`) trigger genuine kernel `PermissionError (EACCES)` and do not touch disk.
- `test_operator_allowlist_cannot_be_overridden_by_token`: Verified closure of D-S46-11. Signed capability tokens cannot override operator allowlists.
- `test_quarantined_workload_refused_before_execution`: Verified closure of D-S46-10. Quarantined workloads are halted prior to process spawning or side-effect occurrence.
- `test_single_use_replay_refused`: Verified single-use token consumption and replay prevention.
- `test_argument_mutation_digest_mismatch_fails_closed`: Verified that payload tampering or argument digest mismatch is halted before execution.
- `test_unprivileged_child_cannot_escape_read_only_boundary`: Verified that directory traversal and attempts to write to `/etc/` or `/root/` fail with kernel `PermissionError`.
- `test_execution_timeout_fails_closed`: Verified that subprocesses exceeding execution deadlines are terminated and recorded as `EXECUTION_TIMEOUT`.
- `test_ledger_records_mediated_receipt_with_hash_chain`: Verified that execution receipts and outcomes are cryptographically recorded in the append-only ledger with valid hash chains.

### B. Landlock ABI 8 Kernel LSM (`tests/test_sovereign_e3_landlock.py`)
- Tested directly against Linux 7.0.0-38-generic syscalls 444/445/446 via ctypes.
- Results measured directly in unprivileged child process:
  - `read_allowed`: OK
  - `read_secret`: DENIED (Kernel EACCES)
  - `write_rw`: OK
  - `remove_rw`: OK
  - `mkdir_rw`: OK
  - `write_ro`: DENIED
  - `create_ro`: DENIED
  - `remove_ro`: DENIED
  - `mkdir_outside`: DENIED
  - `symlink_escape`: DENIED
  - `dotdot_escape`: DENIED
  - `exec_system`: OK
  - `exec_from_ro_dir`: DENIED
  - `grandchild_read_secret`: DENIED (Inherited restrictions across forks)
  - `tcp_connect_ports`: Filtered (allowed port OK, disallowed port DENIED)

### C. Resource Ceilings & Malformed Inputs (`tests/test_sovereign_e3_resource_exhaustion.py`)
- Verified that deep JSON recursion (depth > 128), oversized memory requests (RLIMIT_AS), CPU-bound loops (RLIMIT_CPU), and burst concurrency fail closed without panics or uncontained leaks.

### D. Independent Human Verification Resource Kit (`ihvrk/tests`)
- 300 tests passed spanning:
  - `test_attacks.py`: Replay attacks, signature stripping, downgrade attacks, path traversal.
  - `test_ledger_tamper.py`: Merkle root mismatch, sequence gap, hash modification detection.
  - `test_solver.py`: SMT Z3 formal solver translation and fail-closed timeout verification.
  - `test_gatekeeper.py`: Real-time decision boundary and policy compilation checks.
  - `test_canonical.py`: RFC 8785 canonical encoding invariance.
  - `test_signatures.py`: Ed25519 and ML-DSA-44 post-quantum signature verification.

---

## 3. Discrepancies and Limitations

1. **Local vs Hosted CI Execution**:
   All 348 tests passed in the local host environment. However, because no remote repository (`git remote`) is configured, these results have NOT been executed or validated by a third-party hosted CI runner (e.g., GitHub Actions).
2. **Execution Boundary Scope**:
   Real kernel LSM blocking (Landlock ABI 8 + seccomp) is enforced on stdio MCP proxies and the new `CainMediatedLauncher`. In-process hosted `/mcp` endpoints running inside the gateway monolith remain unconfined at the OS level and rely solely on application-layer guards.
