# Evolution 85 — Vertical Intelligence Architecture

**FIRME AI CORPORATION · CAIN-42 · Evolution 85** — branch `evolution-85`, baseline Evolution 84 (`2c419a042`). Development result. Not deployed. Not released. Built by the three-person team.

CAIN-42 is a Byzantine trust fabric. Its role in this roadmap is **the governor of vertical AGI**: the model-agnostic layer that establishes who an agent is, what it may do, enforces that at the boundary, can stop it at ten scopes, and leaves a record anyone can check offline. CAIN-42 does not claim to be an AGI, and nothing measured here is evidence of general intelligence.

This is a product-level layer over the seven canonical moats. It adds no moat and renames none.

    AGENT PROPOSES → CAIN DECIDES → MCPGATE ENFORCES → RESOURCE EXECUTES → CLAWX PRESERVES EVIDENCE

## 1. Current architecture: component map

Status vocabulary: IMPLEMENTED AND TESTED, IMPLEMENTED BUT INCOMPLETE, EXPERIMENTAL, SIMULATED, DESIGN ONLY, MISSING,
BLOCKED. "Tested" means tests exist in this repository; it never means third-party tested.

| Capability | Where it lives | Status | Note |
|---|---|---|---|
| Reasoning interface | `cain/cain2027/e85/reasoning.py` (new) | IMPLEMENTED AND TESTED | one contract for local models, remote models, tools; three local models driven through it |
| Model routing | `e85/reasoning.py` `ReasoningCore.select`; `e81/models.py`, `e81/routing.py` | IMPLEMENTED BUT INCOMPLETE | selects on measured accuracy, latency, cost, privacy; never exercised with a remote provider |
| Remote model providers | `e81/models.py` adapters | BLOCKED | no credential; nothing purchased; 0 remote calls ever |
| Mission planning | `e81/workforce.py` `plan_objective`; `cain/aos/v74/planner.py` | IMPLEMENTED BUT INCOMPLETE | template and lexical planning; no evaluated dynamic decomposition engine |
| Worker orchestration | `e81/durable.py` `MissionStore`; `cain_workforce/` | IMPLEMENTED AND TESTED | leases, fencing tokens, idempotent effects, dead letters, checkpoints |
| Agent identity | `e81/core.py` `IdentityStore`; `cain/identity_federation/` | IMPLEMENTED AND TESTED | durable Ed25519 identities; no external identity provider |
| Delegation | `cain/identity_federation/delegation.py` | IMPLEMENTED AND TESTED | signed, attenuating, expiring, revocable |
| Memory | `e81/memory.py` `OrgMemory`; `cain-microservices/aether33` | IMPLEMENTED AND TESTED | encrypted, provenance, temporal; lexical retrieval only |
| Knowledge and learning ledger | `e85/learning.py` (new) | IMPLEMENTED AND TESTED | six epistemic statuses, quarantine, versioned strategies, rollback |
| Retrieval | `e81/memory.py` search; AETHER-33 BM25 | IMPLEMENTED BUT INCOMPLETE | lexical; no semantic retrieval measured |
| Execution | `e85/governed.py` `GovernedExecutor` (new) over `cain/receipt` | IMPLEMENTED AND TESTED | local process and second-host resource |
| Verification | `scripts/evolution84/verify_action_receipt.py`; `scripts/evolution85/verify_e85_offline.py` | IMPLEMENTED AND TESTED | offline, imports no CAIN code; same project |
| Consensus | `scripts/cain42_bft/`, E83 bundle | IMPLEMENTED BUT INCOMPLETE | not used in the E85 path (`consensus.used=false`); live cluster quarantined since 2026-11-15 |
| Receipts | `cain/receipt` (E84) | IMPLEMENTED AND TESTED | reused unchanged |
| Evidence | E85 signed bundle + offline verifier | IMPLEMENTED AND TESTED | self-generated key |
| ClawX integration | `e85/clawx85.py` (new, local store) | IMPLEMENTED BUT INCOMPLETE | local, tenant-isolated; not the deployed ClawX service |
| MCP enforcement | `cain/mcp_proxy.py` | IMPLEMENTED AND TESTED | unmodified; run here in a sandboxed dev instance in front of E85 |
| MCP → receipt on the hosted path | — | MISSING | the hosted proxy does not emit E84/E85 receipts |
| Recovery | `e81/durable.py`; `e85/swarm.py` endurance | IMPLEMENTED BUT INCOMPLETE | process crash recovery measured for 1 h; host reboot not tested here |
| Kill switch | `e85/killswitch.py` (new) | IMPLEMENTED AND TESTED | ten scopes, epochs, signed events; one host / shared file |
| Independent witness | E82 witness server (operator-run) | BLOCKED | independent cosignatures: 0 |
| Hardware attestation | — | BLOCKED | no TEE on the host |
| Physical systems | `cain/argus/physical.py` | SIMULATED | no hardware |

## 2. Target architecture: six layers

| Layer | Purpose | Evolution 85 delivers | Still missing |
|---|---|---|---|
| 1. Intelligence core | reason, plan, select tools, self-check | provider contract, measured router, evaluation harness | frontier models, dynamic planner, uncertainty calibration |
| 2. Vertical intelligence | reusable domain packages | three narrow prototypes on real engines | the other seventeen domains; domain data and ontologies |
| 3. Agent workforce | identities, missions, leases, recovery | 10,000 identities, up to 500 worker processes, 1 h endurance | cross-host workforce at scale, long soaks |
| 4. Learning and memory | improve from verified experience | learning ledger with promotion rule and rollback | semantic memory, weight-level learning (not planned) |
| 5. Governance | CAIN decides, MCPGate enforces | kill switch at ten scopes bound into the receipt path | hosted-path integration, quorum in the path |
| 6. ClawX evidence fabric | operational interface and evidence | tenant-isolated local store, redacted public view | deployed interface, workforce console |

## 3. Reused components (not duplicated)

`cain.receipt`, `cain.action_commit`, `cain.identity_federation.delegation`, `cain.cain2027.e81` (`IdentityStore`,
`ModelRegistry`, `InferenceService`, `OrgMemory`, `MissionStore`), `cain.cain2027.e80.core` (`Gate`, statistics),
`cain/mcp_proxy.py`, `cainwitness/engine.py`, `mcp-security-scanner/engine.py`. Measured: 0
changed lines in the reused paths since Evolution 84.

## 4. Integration dependencies

- The hosted MCP proxy emitting receipts requires an owner-coordinated change to `cain/mcp_proxy.py` and a deploy.
- A frontier-model result requires a provider credential and an approved spend cap.
- An independent witness requires a second organization to run the witness and publish its key.
- The quorum in the receipt path requires the cluster repaired after the 2026-11-15 safety incident.

## 5. Security boundaries

Decision (authorizer key), enforcement (enforcement key, single-use store), resource (its own process and key),
receipt log (log key, per-tenant file), witness (operator-run), kill switch (operator key, SQLite file), learning
ledger (evaluator key). A model, a memory, a plan or a reputation score sits outside all of them: it may propose and
it may never authorize. Limits are in `THREAT_MODEL.md`.

## 6. Model dependencies

Measured in this evolution: `Qwen/Qwen2.5-0.5B-Instruct` (primary), `Qwen/Qwen2.5-1.5B-Instruct`,
`HuggingFaceTB/SmolLM2-135M-Instruct`, all on CPU from local weights. 2,122 real local calls, 0 remote. Nothing
in the governance path depends on which model is used.

## 7. Data dependencies

Evaluation tasks are generated from seeds; vertical fixtures are written in the repository. No customer data, no
external dataset and no network source was used. Domain knowledge sources for future verticals are listed in
`VERTICAL_WORKFORCE_CATALOG.md` as requirements, not as holdings.

## 8. Computational requirements (measured on one 8-vCPU, 30 GB host shared with production)

| Item | Measured |
|---|---|
| Local model call, 0.5B, short answer | 1,496 ms per task |
| Worker processes at the largest stage | 500 processes, 2608.9 MB PSS |
| Governed action with receipt, second host | 61.5 ms round trip |
| 1 h endurance storage | 8040 KB mission database |

## 9. Roadmap

See `2027_ROADMAP.md`. Gates, not evolution numbers.
