# E114 implementation report

Branch `evolution-114`, worktree `/root/cain-e114`, started from E112 head `fd9e0e9fb`; built at commit `fd9e0e9fb50b` (see MANIFEST for the final commit).
Run: `nice -n 15 python3 -m cain.e114.lab artifacts/e114/run`, wall 409.9 s, CPU 320.56 s, single thread,
0 model inference calls, 0 external API calls, no GPU.

**Gates:** 1 FAIL, 1 NOT TESTED, 14 PARTIAL, 6 PASS. Overall **PARTIAL**. **CAIN-42 is not AGI.** These are early, bounded results on constructed tasks.

**What changed:** E114 runs a research loop, not a feature build. A director keeps objectives, questions and hypotheses.
Experiments run only under a governance grant. An independent verifier recomputes every claim from raw rows and signs the verdict.
Evidence-native memory keeps only what validates. The measured limitations become a ranked backlog, and the lab then
executed its own top two backlog items as a second research cycle (both came back negative).

## Code (`cain/e114/`)
| Module | Role |
|---|---|
| `common.py` | canonical JSON, SHA-256, Ed25519 signer, hash chain, Wilson/mean CIs, exact sign test |
| `memory.py` | Evidence-Native Memory 3.0: 7 layers, immutable sources, stage -> validate -> version -> revert, poisoning/fabrication/injection checks, integrity audit, self-organisation proposals |
| `envgen.py` | hidden-rule causal worlds; dev/val/sealed/transfer/shift/val_shift/adversarial splits; leakage report |
| `worldmodel.py` | static / logistic / MLP / symbolic-causal / hybrid models; grammar growth; prediction error; abstention |
| `active.py` | expected-information-gain experiment selection, random and fixed-sweep baselines, memory priors |
| `continual.py` | naive / replay / kNN-memory / routed experts; inner and outer loop; training records |
| `skills.py` | skill lifecycle DISCOVER…ROLLBACK over a list DSL; context gating |
| `governance.py` | DecisionPoint, Enforcer, KillSwitch (separate keys), spawn attenuation, revocation cascade, approval, info-flow, model/tool hooks, a2a |
| `governance_lab.py` | 44-scenario adversarial suite, multi-process KILL race, replay race |
| `selfimprove.py` | 9-stage candidate pipeline with pinned evaluator and human-approver promotion |
| `mission.py` | persistent mission: journal, checkpoints, idempotent effects, reconciliation, SIGKILL/resume test |
| `director.py` | Cognitive Research Director: objectives, questions, hypotheses, epistemic status, Beta uncertainty, stall detection, backlog |
| `verifier.py` | independent verification engine with its own key |
| `lab.py` | the integrated research cycle (cycle 1 + cycle 2) |

Tests: `tests/test_e114_*.py`. Offline verifier and bundle builder (`scripts/e114/verify_e114_offline.py`, `build_bundle.py`)
were written by the E113 session so that the lab's author did not write its own checker.

## Engineering decisions
1. **No inference in E114.** The E113 session was running CPU model inference on the same 8-vCPU host. E114 runs single-threaded under `nice -n 15`,
   and collective intelligence is E113's experiment of record.
2. **The KILL order and effect admission share one lock**, and the order writes a fence marker into the effect ledger. A first draft used separate locks;
   that would have let an admitted effect land after the order. It was fixed before any measurement.
3. **Missions reconcile from the resource ledger.** An effect admitted before a crash is never executed twice.
4. **No human approver key exists in the run.** An earlier draft passed a lab-generated key as "approver". That was removed, and stage 9 is now tested directly.
5. **Memory caught one of the lab's own claims:** a backlog record cited "24 h" without a source (`FABRICATED_NUMBER:24`). It was re-proposed citing the brief.
