# E258 — Architecture: Bidirectional MITM `ResearchProgramAST6`, Multi-Island Consensus & 9-Domain Governed Organism

**Entity:** FIRME AI CORPORATION · **Canonical Identity:** CAIN-42 is an AGI–RSI research organism.  
**Mandatory Public Status:** **AGI: NOT ESTABLISHED · RSI: EXPERIMENTAL**  
**Invariants:** `neural_weight_modification = false` · Unauthorized API spend: `$0.00` · OMEGA SEAL + MCPGate mandatory.

## 1. Attacking E248's Exact Remaining RSI Bottlenecks
Forensic autopsy of E248 (`OMEGA-000000200`) identified why `H01` beat all 10/10 controls statistically (`Holm p <= 0.032`) yet tied on `salt_rep1` (`35/76` vs `35/76`) and scored only `2/36` on depth-8 modular `algebra`:
- Forward-only macro search over `6` macros at depth 8 spans `6^4 = 1,296` compositions, exceeding `eval_budget = 480` and forcing premature pruning under uninformative modular/bitwise closeness heuristics.
- Single-lineage evolution exhibited run-to-run seed variance (`lineage_2` stalled at `p1 = 0.40`).

## 2. Six-Module Sandboxed `ResearchProgramAST6` (`cain/cain2027/e258/ast_engine.py`)
E258 elevates **Bidirectional Meet-in-the-Middle Compositional Macro Search (`mitm_expr`)** into the typed, sandboxed AST alongside `priority_expr`, `schedule_expr`, `macro_gate_expr`, `budget_alloc_expr`, and `knowledge_policy_expr`:
- Splits depth-8 compositional search into forward depth-4 (`6 + 36 = 42` evals -> hash index) + backward depth-4 (`6 + 36 = 42` evals -> `O(1)` collision check), solving depth-8 modular `algebra`, `bool_circuit`, `grid_ca`, `stack_vm`, and brand-new unseen Domain 9 **`perm_cipher`** ($S_8$ permutation cipher) in `~84` evaluations — **15× faster than forward-only macro search** with zero heuristic noise!
- Available symmetrically to ALL AST comparison arms (`random_ast_search`, `evolutionary_ast_search`, `beam_ast_search`, `no_knowledge_ablation`, `knowledge_enabled_nonrecursive_control`, and `e258_island_mitm_recursive_ast`) under strict equal `eval_budget = 480` per task and strict equal evolution compute (`18` dev evaluations/arm).
- **10/10** adversarial/malformed AST attack classes rejected fail-closed.

## 3. Immutable Predecessor Benchmark (12 Arms, 7 Sealed Domains, 4 Unseen Domains)
Freezes **`CHAMPION_E248_AST`** (`cfa5ae826cf2346e`, `OMEGA-000000200`) alongside `CHAMPION_E245` and `CHAMPION_E243` as immutable predecessors. Evolution sees ONLY `dev_salt` and `cal_salt` (`algebra`, `graph_rules`, `pomdp_plan`). Sealed confirmation tests `264` tasks across 3 fresh salts including **4 completely unseen domains** (`bool_circuit`, `grid_ca`, `stack_vm`, and brand-new `perm_cipher`). Retains E248's proven **Sparse-Shift BMA Causal Adapter** (96 3-confounder SCMs across 4 shift regimes), 4-stage Scientific Discovery, Collective Specialist+Falsifier, and 12-Drill Continuity.
