# E248 — Robust Recursive Intelligence Architecture (Tracks A–H)

**Entity:** FIRME AI CORPORATION · **Status:** **AGI: NOT ESTABLISHED · RSI: EXPERIMENTAL**

## 1. Five-Module Typed Sandboxed `ResearchProgramAST` (`cain/cain2027/e248/ast_engine.py`)
Upgrading E245's rigid breadth-first beam loop, E248 elevates **search architecture itself** into the typed, resource-bounded, pure-interpreted AST (`MAX_NODES = 24`, `MAX_DEPTH = 5`, zero `eval`/`exec`/I/O):
1. `priority_expr`: State-ranking AST using runtime features (`match_frac`, `closeness`, `macro_len`, `depth_frac`, `novelty`, `is_deep`, `budget_rem_frac`, `parent_gain`).
2. `schedule_expr`: **Structural search-scheduler AST** controlling best-first priority-queue vs breadth-layer blending, per-parent branching cap `k_branch` (eliminating E245's branching-factor budget starvation!), depth-adaptive beam tapering, and progress-gated pruning.
3. `macro_gate_expr`: Abstraction admission & library-size cap AST (admitting high-compression 2-op & compositional 4-op macros ONLY when compression-to-branching ratio stays positive!).
4. `budget_alloc_expr`: POMDP active-probe, shift-detection, and contradiction-pruning allocation AST.
5. `knowledge_policy_expr`: Cross-task knowledge retention & negative-transfer rejection AST.

All 11 comparison arms in Track B execute through the **identical** AST interpreter, identical grammar, identical per-task `eval_budget = 480` (except explicit `2× Compute` frozen control at `960`), and identical total evolution candidate-evaluation compute!

## 2. Credit-Assigned Archive Recursive AST Researcher (`CA-DGM-AST`)
Directly remedies E245's three `H01` failure mechanisms:
- **Diagnostic Failure Credit Assignment:** Attributes every failed `dev_salt` task to a specific failure cause (`budget_starved_shallow`, `branching_bloat`, `heuristic_misrank`, `missing_compositional_macro`, `pomdp_shift_miss`) and routes mutation specifically to the responsible AST sub-program (`schedule_expr`, `macro_gate_expr`, `priority_expr`, or `budget_alloc_expr`) while **freezing high-performing sub-programs**.
- **Stepping-Stone Archive & Cross-Domain Sub-Program Recombination:** Retains top domain specialists in an open-ended archive and recombines winning sub-programs across domains (e.g., merging a `schedule_expr` that unlocks deep `algebra`/`grid_ca` synthesis with a `budget_alloc_expr` that solves shifted `pomdp_plan`).
- **Strict Non-Regression Calibration Gate (`cal_salt`):** Promotions require strictly higher aggregate `cal_salt` performance AND zero per-domain regression on `cal_salt` — completely isolated from the 3 sealed salts (`salt_main`, `salt_rep1`, `salt_rep2`).

## 3. Sparse-Shift Bayesian Model Averaging Causal Adapter (`cain/cain2027/e248/causal_bma.py`)
Directly remedies E245's `H05` post-shift regression:
- Preserves pre-shift interventional posterior `(mu_pre[i], var_pre[i])` across all invariant ancestors.
- Performs per-node change-point detection (`z_shift[i]`) from post-shift observational slope/residual shifts.
- Allocates strict equal post-shift cost budget (`7.5` units) via shift-weighted Value-of-Information per unit cost, using variance-cancelling symmetric `do(+v)/do(-v)` contrastive interventions (identical sample count `m=24`: `12` at `+2.5`, `12` at `-2.5`, cancelling confounder baseline `base_y` bias!).
- Applies **Bayesian Model Averaging (BMA)** with Bayes-factor shift probability `p_shift[i]`: **refuses unsupported updates** when evidence is weak or shift is null (`p_shift < tau` → retains frozen estimate), and smoothly blends `(1 - p_shift)*mu_pre + p_shift*mu_post` with calibrated total variance (including between-model disagreement) when shift is detected!

## 4. Expanded 8-Domain Substrate (Including Brand-New Unseen Domain 8 `stack_vm`)
Preserves all 7 prior domains (`algebra`, `graph_rules`, `causal_scm`, `pomdp_plan`, `sequence_dsl`, `bool_circuit`, `grid_ca`) and adds brand-new unseen Domain 8 **`stack_vm`** (6-instruction modular stack/register transformation DSL) for genuine zero-leakage unseen generalization and compositional transfer.
