# CAIN-42 — Master Architecture (reconstructed from source, this session's scope)

This document reconstructs the planes actually present in the repository and states their real state.
It is deliberately narrower than the full 23-phase directive: it records what was inspected and
measured, and marks the rest `NOT_REVIEWED`.

## Planes discovered

| Plane | Primary locations | State |
|---|---|---|
| Control / API | `platform-gateway/main.py`, `platform-gateway/routers/*` | IMPLEMENTED, live on :8088 |
| Authorization (E8) | `platform-gateway/main.py` `frontier20_gate` + E8 authorize/commit | IMPLEMENTED, live |
| Product surface (Frontier-20) | `platform-gateway/routers/subdomains.py` | IMPLEMENTED, live (20/20) |
| Frontier runtime | `cain/frontier/*` (runtime, gate, suite, pipelines) | IMPLEMENTED |
| E20 substrate | `cain/e20/*` (state, temporal, capability, delegation, evidence, governance, formal, fleet) | IMPLEMENTED this session |
| Consensus / BFT | `cain/substrate/cain_bft_consensus.py`, cluster containers | PRESENT; not re-hardened this session |
| Evidence | SCITT (`cain/cain_scitt_clearinghouse.py`), WORM export | IMPLEMENTED (product) |
| Identity | RIG (`cain/cain_rig_identity.py`) | IMPLEMENTED (product) |
| Memory | MemVault, `cain/memory.py` | IMPLEMENTED (product) |
| Policy | PolicyForge, OPA (`cain/opa.py`) | IMPLEMENTED (product) |
| Federation / transactions / policy-lab | — | NOT_IMPLEMENTED in E20 this session |
| Observability / chaos / performance harness | partial | NOT_MEASURED this session |

## E20 control chain (as implemented)

```
agent proposes
  -> GovernedStateEngine.transition            (state/  hash-chained, authority-refusing)
  -> TemporalAuthorization / AuthorizationTimeline (temporal_trust/  validity + replay)
  -> CapabilityLedger.check_execute            (capability/  continuous attestation)
  -> DelegationGraph.check                     (delegation/  attenuation + trace)
  -> evidence sufficiency                      (evidence_quality/  EXISTS != SUFFICIENT != TRUE)
  -> E8 authorization                          (unchanged canonical boundary)
  -> MCPGate enforcement                       (unchanged)
  -> EvidenceCertificate (fleet + gate results)
```

The E20 layer is **read/decision-support**: it refuses and records, but it does not itself grant
authority. Wiring it into the live authorization path is left as the top next step (feature-flagged).

## Limitations

No architectural deletion or deduplication was performed; this session added an isolated E20 package
and evidence tooling. Avoid treating this document as a full repository reconstruction.
