# EVOLUTION7_ARCHITECTURE.md

```
AGENT PROPOSES
  -> CANONICALIZE           cain/action_commit/canonical.py      (RFC 8785 JCS + equivalence rules)
  -> AUTHENTICATE           (principal/workload identity; caller-supplied, fail closed if absent)
  -> EVALUATE POLICY        cain/action_commit/policy.py         (versioned, default-DENY, deterministic)
  -> CHECK HISTORY/RISK     cain/action_commit/trajectory.py     (hash-chained cumulative budgets)
  -> OBTAIN APPROVAL        cain/action_commit/approval.py       (bound to exact action digest)
  -> BIND AUTHORIZATION     cain/action_commit/reference_monitor.py (single-use, TTL, policy digest)
  -> REVALIDATE             (policy version + revocation re-checked immediately before the effect)
  -> COMMIT                 (the ONLY path to execute_fn; enforcement, not logging)
  -> REAL EFFECT            (execution backend performs)
  -> INDEPENDENT OBSERVATION
  -> RECEIPT                cain/action_commit/receipt.py        (EFFECT_VERIFIED needs an observation)
  -> CLEAN-ROOM VERIFY      cain-action-commit-verify/verify.py   (zero CAIN imports)
  -> HOSTED STAGES          cain/action_commit/hosted_stages.py   (default_stages_v29, RESTRICTION_ONLY)
```

## Non-bypassability (honest)
The reference monitor is non-bypassable **only for execution surfaces that route through it**. In this repository the
real enforcement point is `cain.mcp_proxy`; the `MCPAdapter` wraps that path. Shell/HTTP/filesystem adapters are
**OBSERVER** adapters (labelled). `DIRECT_BACKEND_BYPASS_CONTROLLED = False`.

## Composition (no new moat, no second CAIN)
Composes existing CAIN (`cain45.canon` signing, identity, `cain.mcp_proxy`) and the Evolution 1–6 substrate. It adds one
governance capability: binding the exact canonical action to authority, execution, effect and evidence.
