# E86 Implementation Plan

## Stage 0 — Baseline (complete)

- E85 40 tests passed; verifier 43/43; bundle Merkle `f5098de9…`.
- E85 preserved; E86 worktree clean at `06da643ff`.
- Baseline report, architecture audit, research review written.

## Stage 1 — Infrastructure primitives (E86 core)

Files: `cain/cain2027/e86/{core,providers,mission}.py`, `tests/test_e86_core.py`.

- Provider-neutral runtime with explicit execution classes, health and budgets.
- Local adapters over E85 reasoning; remote BLOCKED without credential.
- Durable mission contract with explicit states and evidence-gated completion.
- Unit tests: remote blocked, budget refusal, mission cannot complete without evidence, illegal
  transitions refused.

## Stage 2 — Memory and governed learning

Files: `memory.py`, `learning.py`, `tests/test_e86_memory.py`.

- Typed memory: episodic, procedural, semantic, causal, mission, organizational, agent, evidence.
- Provenance, confidence, verification, version, approval, validity, tenant, hash chain.
- Retrieval never grants authority; cross-tenant refused; poison quarantined.
- Learning pipeline: candidate → validation → comparison → external approval → promotion →
  rollback. Proposer cannot approve.
- Experiments: memory A/B on held-out tasks; retention/forgetting checks; poisoned lesson rejected.

## Stage 3 — Workforce and interoperability

Files: `workforce.py`, `interop.py`, `tests/test_e86_workforce.py`.

- Dispatcher separates registered identity from OS process and verified outcome.
- Capability-based assignment; missing capability, expired grant, revoked identity and exhausted
  budget refuse.
- External-agent 10-step flow: register → capability → authority → mission → tool decision →
  execute → evidence → verify → revoke.
- Local only; no public production integration.

## Stage 4 — Vertical missions

Files: `verticals.py`, `tests/test_e86_verticals.py`.

- Reuse E85's three objective prototypes: code defect repair, security/MCP review, evidence pack.
- Execute in an isolated work directory; produce a receipt and a verification result.
- A failing/refused case is preserved; no success is fabricated.

## Stage 5 — Evaluation

Files: `evaluation.py`, `scripts/evolution86/run_eval.py`.

- Reuse E85 task generators; 10 families, held-out only, small scale to fit the host.
- Arms: deterministic floor, single, tools, memory, learned, specialist+verifier, hierarchical,
  recovery.
- Paired exact McNemar, Wilson intervals, per-family results; no aggregate hiding.
- Pre-registration before the run; raw rows preserved.

## Stage 6 — Governance, evidence, release

Files: `gates.py`, `evidence.py`, `scripts/evolution86/verify_e86_offline.py`, `scripts/evolution86/run_all.py`.

- Artifact-derived acceptance matrix with PASS/PARTIAL/FAIL/BLOCKED/NOT EVALUABLE.
- Signed evidence bundle, standalone verifier, tamper tests.
- Final report, limitations, release decision.

## Non-goals for E86

- No AGI claim.
- No remote model call without a credential and approved spend.
- No production deployment, DNS, Stripe, firewall or customer-data change.
- No claim of independent witness or third-party audit.
- No 500-worker kill-switch pass: E85's in-flight effect gap remains a known limitation.

## Definition of done

A reviewer can clone `evolution-86`, run the tests, run the evidence verifier, inspect raw rows and
see exactly which gates passed, which are partial and which are blocked.
