> **CORRECTION 2026-10-05 (supersedes the claims below; original text kept as published).**
> The version of this layer published on 2026-10-04 (commit 64888b0) did **not** enforce a quorum:
> `GovernanceStateMachine.apply` and `recover` accepted a caller-written dict
> `{"valid": true, "signers": [...], "threshold": k}`, so a single node could commit any state (and choose
> `threshold: 1`). Invariant S-04 and the clean-room `state_verifier.py` reported PASS against those dicts.
> State roots also admitted floats, which have no single cross-language encoding.
> Fixed: certificates are now Ed25519 signatures over the transition commit digest from >= ceil((n+f+1)/2)
> members of a membership pinned at construction; the verifier takes the pinned membership as a separate
> input; floats are rejected (`NON_CANONICAL`). `GovernedMemory.write` no longer overwrites, `reconcile`
> counts distinct sources. The `quorum=`/`verified=` arguments of `trust.apply_outcome` and
> `GovernedMemory.promote` remain **caller-asserted** in this single-process library.
> The replicated, quorum-certified implementation of Evolution 03 is `cain/acp` -- see
> `docs/evolution03/E03_STATE_FABRIC_REPORT.md`.

# CAIN-42 — Byzantine Autonomous State Fabric (this evolution) — Report

## A. Current architecture
Kernel (E01) + Authority Continuity (E02) + Authority Boundary/Formal/Performance (E03) already in
`cain/govkernel/`. This pass adds the **distributed governance state layer**.

## B. Architecture added
`cain/govkernel/`: `state.py` (canonical GovernanceState + state machine + state root) · `reality.py`
(conflicting realities) · `behavior.py` (agent behavior consistency) · `memory.py` (governed memory) ·
`trust.py` (trust transitions) · `containment.py` (incident containment) · `recovery.py` ·
`state_invariants.py` (S-01…S-12) · clean-room `state_verifier.py`.

## C. Byzantine state model
21 governance dimensions; deterministic serialization; `state_root` commits to all dimensions;
`GovernanceStateMachine` applies transitions through PROPOSE→VALIDATE→PREPARE→QUORUM→COMMIT→STATE_ROOT→
EVIDENCE and refuses stale parent, bad sequence, wrong epoch, invalid quorum, and any recomputed root
mismatch. A single node cannot unilaterally commit.

## D. Authority-state integration
Transitions bind `authority_hash`, `policy_version`, `trust_state_hash`, `risk_state_hash` and
`governance_epoch`; an epoch or policy mismatch is refused (`EPOCH_INVALID` / `POLICY_INVALIDATED`).

## E. Cryptographic design
Canonical JSON (RFC-8785 profile) → SHA-256 state roots; Ed25519 used by the authority/kernel layers;
quorum certificate hashes bound into transitions. Merkle-style dimension commitments via per-dimension
roots. No cryptography without a stated purpose.

## F. Causal graph
Reuses the E02 Causal Authority Graph; every state transition records `causal_parent` and evidence ref.

## G. Byzantine-agent model
`behavior.consistency_check` compares PROPOSED / AUTHORIZED / EXECUTED / OBSERVED / REPORTED; a report
that differs from the observed effect is a material discrepancy recorded as evidence.

## H. Byzantine-memory model
`GovernedMemory` layers UNVERIFIED / OBSERVED / VERIFIED / AUTHORITATIVE; promotion requires evidence
(and quorum for AUTHORITATIVE); UNVERIFIED→AUTHORITATIVE is forbidden; conflicts (distinct verified
hashes for a key) are surfaced; memory never grants authority.

## I. Trust transition system
`apply_outcome`: verified success may raise trust (quorum required above a threshold); an agent claim
without evidence cannot raise trust; incidents lower trust to PROBATION/SUSPENDED; REVOKED is immutable.

## J. Incident containment
`ContainmentEngine`: DETECT→CLASSIFY→ISOLATE→REVOKE→CONTAIN→PRESERVE_EVIDENCE→REASSESS→RECOVER→REVERIFY→
RESTORE across 9 scopes; missing evidence triggers a fail-closed emergency halt; restore requires
re-verification.

## K. Recovery
`recover` verifies quorum certificates, chain continuity, monotone sequence/epoch and an evidence chain;
a replica cannot self-authorize.

## L. Formal verification
Two TLC-checked bounded models: `AuthorityContinuity.tla` (E02) and `GovernanceState.tla` (this pass).
`GovernanceState`: **"Model checking completed. No error has been found."** (318 states, depth 9);
invariants `TypeOK`, `NoCommitWithoutQuorum`, `CommitStrictlyIncreasing`; properties `SeqMonotone`,
`EpochMonotone`. Classification: **MODEL-CHECKED (bounded)** — not a proof of the code.

## M. Adversarial testing
12/12 state invariants; 86/86 govkernel tests (E01+E02+this). See the authority attack matrix (E02) and
the E26 combined chaos (105) for the broader Byzantine corpus.

## N. Performance
State-root generation and transition latency are recorded per gate run. Full baseline-vs-this benchmark
is **NOT_MEASURED** (the E03 authority benchmark stands).

## O. Independent verification
`verification/govkernel/cleanroom/state_verifier.py` (zero CAIN imports): recomputes every state root,
chain continuity, monotone sequence/epoch, quorum per transition, and resulting-root binding. Positive
PASS + negative FAIL.

## P. IP Candidate Register
`docs/evolution03b/IP_CANDIDATE_REGISTER.md` (S-IP-01…). Engineering inventory only; **no legal claim**.

## Q. Reproduction cost
`docs/evolution03b/REPRODUCTION_COST.md`.

## R. Security findings
No authorization bypass found in the tested scope. Fail-closed verified for quorum, epoch, policy,
stale-parent, sequence, memory promotion and containment.

## S. Known limitations
- Bounded model checks, not code proofs. Baseline performance for the state layer NOT_MEASURED.
- Not yet the live authority/state boundary (the E03 feature-flagged boundary is EVALUATE).
- Multi-host state convergence and cross-region Byzantine testing NOT_MEASURED for this layer.
- No independent third-party verification.

## T. Production readiness by component
State machine/state root/memory/trust/containment/recovery: **library, tested, not deployed**.
Clean-room verifiers: **operational (offline)**. Live boundary: **EVALUATE**.

## U. Demonstrably true
Deterministic state roots; quorum-gated commit; chain continuity; conflicting realities surfaced;
agent-report discrepancy detection; memory non-authority; trust non-claim increase; containment
fail-closed; recovery no self-authorize; two TLC-clean bounded models; clean-room state proof verified.

## V. Unverified
Live ENFORCE of the state layer; multi-host state convergence; baseline performance for the state layer;
independent third-party verification; generalization beyond tested fault models.

## W. Recommended EVOLUTION 04
Enable the state/authority boundary in ENFORCE for a narrow canary with measured blocking; add a TLA+
refinement tying the model to the implementation; multi-host state convergence with measured agreement;
and independent third-party verification.
