# E86 — AGI Infrastructure Architecture

CAIN-42 is a Byzantine trust fabric and the governed execution substrate for autonomous
intelligence. E86 builds the **infrastructure planes** on which increasingly general systems can
reason, remember, coordinate, act and prove. It does not claim that general intelligence has been
achieved.

## The six planes

```
┌──────────────────────────────────────────────────────────────────────┐
│  A. GENERAL INTELLIGENCE RUNTIME                                    │
│  provider-neutral adapters · capability profiles · budgets · routing │
├──────────────────────────────────────────────────────────────────────┤
│  B. COGNITION & MISSION INTELLIGENCE                                │
│  objective · constraints · plan · dependencies · evidence criteria   │
├──────────────────────────────────────────────────────────────────────┤
│  C. CONTINUAL LEARNING & GOVERNED MEMORY                            │
│  episodic · procedural · semantic · causal · mission · org · agent   │
├──────────────────────────────────────────────────────────────────────┤
│  D. AUTONOMOUS WORKFORCE                                            │
│  identity · delegation · capability assignment · processes · recovery│
├──────────────────────────────────────────────────────────────────────┤
│  E. VERTICAL INTELLIGENCE                                           │
│  domain ontology · tools · tasks · ground truth · escalation         │
├──────────────────────────────────────────────────────────────────────┤
│  F. GOVERNANCE, EXECUTION & EVIDENCE                                │
│  identity · authority · policy · MCPGate · grant · receipt · verify  │
└──────────────────────────────────────────────────────────────────────┘
```

## A. General intelligence runtime

`cain/cain2027/e86/providers.py`

- `ProviderSpec`: key, provider, model, version, class, context, capabilities, cost, availability.
- `ProviderRuntime`: register providers, health, capability selection, budgets, invocation records.
- Classes: `REAL_LOCAL_MODEL`, `REAL_REMOTE_MODEL`, `DETERMINISTIC_TOOL`, `MOCK`.
- Remote is **BLOCKED** unless a credential is injected through the environment and a dollar ceiling
  is approved. No silent fallback.
- A provider returns text; it never authorizes. Calls still pass through the E80 Gate.

## B. Mission intelligence

`mission.py`

A mission is durable and inspectable:

```
id, objective, constraints, success_criteria, required_capabilities,
knowledge_requirements, subgoals, dependencies, assignments, authorized_actions,
evidence_requirements, risk, verification_conditions, recovery, state
```

States:

`PROPOSED → PLANNED → AUTHORIZED → EXECUTING → AWAITING_EVIDENCE → VERIFYING →
COMPLETED_VERIFIED | VERIFICATION_FAILED | RECOVERY_REQUIRED | HUMAN_APPROVAL_REQUIRED | ABORTED`

`COMPLETED_VERIFIED` requires every criterion to have evidence and a verifier result. An agent's
message alone is never completion.

## C. Memory and learning

`memory.py` and `learning.py`

Memory types: epistemic (episodic, semantic, procedural, causal), mission, organizational, agent,
evidence. Every item carries id, tenant, domain, source, producer, evidence reference, confidence,
verification status, version, approval, validity, hash and previous hash.

Learning pipeline:

```
EXPERIENCE → OBSERVATION → CANDIDATE → VALIDATION → COMPARISON →
APPROVAL (not the proposer) → PROMOTION → MONITORING → ROLLBACK
```

Promotion requires a measured held-out comparison and an approver different from the proposer.
Retrieved memory is data: `grants_authority=false`, `authority_effect="none"`, `executable=false`.

## D. Workforce

`workforce.py`

Separates: registered identity, provisioned record, running OS process, active worker, concurrent
inference request, completed task, verified outcome and external effect.

Capability-based assignment, signed delegation, attenuation, budgets, leases, fencing, idempotency,
revocation and mission-wide stop are inherited from E80/E81/E85. E86 adds a dispatcher that refuses
work when authority, capability or budget is missing.

## E. Vertical intelligence

`verticals.py`

Three working prototypes over objective fixtures:

1. **Software defect repair** — failing test before, passing test after, independent check.
2. **Security/MCP review** — deterministic scanner verdict on a labelled fixture.
3. **Evidence pack** — signed receipt and offline verifier.

A vertical is not "deep expertise" because a profile exists. It is a real input, plan, governed
tool, verifiable output, failure path and evidence.

## F. Governance and evidence

`gates.py`, `evidence.py`

- Every consequential action passes identity → authority → intent → policy → risk → single-use
  grant → enforcement → effect → receipt.
- E86 evidence is canonical JSON, SHA-256 chained, Merkle-rooted, Ed25519-signed, with a standalone
  verifier that imports no CAIN code.
- A local verifier is not independent. Independent witness/audit remains **NOT PERFORMED** unless a
  named external party acts.

## External agent interface

`interop.py` exposes:

```
register(identity, capabilities) -> agent_id
request_authority(agent_id, scope, mission) -> signed grant
submit_mission(contract) -> mission_id
authorize_tool(grant, tool, args) -> ALLOW | DENY
execute(grant, tool, args) -> result + receipt
submit_evidence(mission_id, evidence)
verify_receipt(receipt) -> VALID | INVALID
revoke(agent_id)
```

The flow is tested locally. No public deployment is claimed.

## Non-negotiable invariants

1. No authorization → no execution.
2. Unknown/error never becomes ALLOW.
3. A child cannot exceed its parent's authority.
4. Memory never grants authority.
5. A model or agent cannot approve its own promotion.
6. Completion requires evidence against criteria.
7. A local witness is not an independent witness.
8. A registered identity is not a running worker.
9. A passing unit test is not production reliability.
10. A webpage is not a deployed service.
