# Sovereign Evolution 2 — test results

All runs below were executed in this session on 2026-10-12 (Python 3.14.4, z3 5.1.0, Linux 7.0.0-38-generic).
Command prefix unless stated: `python3 -m pytest -q -p no:cacheprovider -o addopts=""`.
Unit and integration tests run locally only. "Clean checkout" means a fresh `git worktree` of a commit plus a fresh
venv. Nothing here is CI-service or production evidence unless it says so.

## 1. Allowlist precedence and quarantine, end to end (new: `tests/test_sovereign_e2_token_precedence_side_effects.py`)

The HTTP proxy (with a mock transport) and the stdio proxy (with a real child process) each count the tool calls
the tool server actually executed.

| Revision | Exit | Passed | Failed | Failing tests |
|---|---|---|---|---|
| eaf8d4fa (fix) | 0 | 20 | 0 | — |
| d906baf8 (containment fixed, precedence not) | 1 | 16 | 4 | http/stdio `token_for_tool_outside_allowlist`, http/stdio `token_cannot_skip_mandatory_approval` |
| 6cfa3b9e (Evolution 1 start) | 1 | 13 | 7 | the 4 above + http/stdio `quarantined_token_holder`, `http_unreadable_containment_state` |

On every denial the counter stays at 0: the tool never runs. Concurrency: 12 threads sending one token produce
exactly one execution. Retries with fresh tokens on a non-allowlisted tool produce 0 executions. A replayed token
on stdio produces 1 execution.

## 2. Tests whose expectations changed (owner decision D-S46-11)

Each of these 5 files now allowlists the tool under test. `test_matching_parameters_at_execution_is_allowed` moved
its ALLOW case to a low-risk tool. The new `test_matching_parameters_on_destructive_tool_still_require_approval`
asserts that `delete_file` (HIGH risk, quorum required) gets REQUIRE_APPROVAL and that the parameter binding still
passes. Affected files: `test_identity_trust_decay.py`, `test_mcp_proxy_capability_forgery.py`,
`test_mcp_proxy_model_continuity.py`, `test_mcp_proxy_parameter_binding.py`,
`test_mcp_proxy_self_issued_capability.py`. Result: 45 passed across these files plus the E1 boundary file.

## 3. Measured kernel sandbox (new: `tests/test_sovereign_e2_stdio_seccomp_reality.py`)

`MEASURED {"setuid": "EPERM", "chroot": "EPERM", "bpf": "EPERM", "ptrace": "EPERM", "exec": "OK", "file_write": "OK", "unlink": "OK", "tcp_connect": "OK"}`. 1 passed.

## 4. Broad run, current tree (HEAD bf5a0038)

| Command | Exit | Result |
|---|---|---|
| 60 MCPGate / guard / capability / JIT / sovereign / continuum / hosted files, `-m "not live_host"` | 0 | **1198 passed, 0 failed**, 4 deselected (live_host) |
| `-m live_host tests/test_cain_sentinel_guardian.py` | 1 | 2 passed, **2 failed**: the host really is DEGRADED (below) |

The live hosted decision ledger stayed at 1166 rows across every run.

## 5. Sentinel failures (Evolution 1's "2 failures")

The tests read `/run/cain-sentinel-guardian.json` and the served copies, which the live guardian rewrites every
few seconds. On 2026-10-12T04:06Z it reported `cluster_cain-mr-01: DEGRADED` and `docker_cain-mr-node-1: FAILED`
(492 consecutive failures). The snapshot was 6 s old, so it wasn't stale: **this is real host state, not a code
regression.** Evolution 1 saw the same failures on 6cfa3b9e.

Change: the report-structure assertions run everywhere, and the health assertions are kept unchanged and marked
`live_host`. They still fail on this host while it is degraded, and skip with a stated reason where the host files
are absent. No snapshot was fabricated and no failure was allowlisted.

## 6. CI gate (`scripts/ci/run_authorization_suite.py`, job `authorization-regression-gate`)

| Run | Exit | Result |
|---|---|---|
| `--self-test` | 0 | canary write detected |
| local tree | 0 | 264 passed, 0 skipped, canaries unchanged |
| clean checkout of 4a78bfb8, first lock | 1 | **ResolutionImpossible** (fastapi 0.118 vs starlette 0.50); the runner then reported every suite as "collected no tests" |
| clean checkout, after resolving + prometheus_client | 1 | 24 failed (numpy missing; Rust enforcer not built; pytest-asyncio missing), 1 skipped |
| clean checkout, after numpy | 1 | 13 failed, 1 skipped |
| **clean checkout, final lock + `cargo build --release --locked`** | **0** | **263 passed, 0 skipped, canaries unchanged** |

The clean checkout exposed 5 dependency gaps that the shared working tree had hidden. All are fixed in 2712f485.
**GitHub Actions has never executed this job: the repository has no git remote.**

## 7. Formal model (`formal/authorization_model_v2.py` → `formal/z3_results.json`)

`python3 -I authorization_model_v2.py` gives exit 0 and **28/28 results match**. See FINAL_REPORT.md section H.
