# Suite14 Authority-Safe Collaborative Evidence MoE Implementation Plan

> **For agentic workers:** REQUIRED SUB-SKILL: Use superpowers:subagent-driven-development (recommended) or superpowers:executing-plans to implement this plan task-by-task. Steps use checkbox (`- [ ]`) syntax for tracking.

**Goal:** Build Suite14 so specialist collaboration can only modify a strong E0 when chronology-safe evidence supports that authority, while retaining the Suite13 heterogeneous E1-E4 evidence pathways and evaluation protocol.

**Architecture:** Start from Suite13. Replace the absolute final fusion head with an identity-preserving collaborative correction around E0: `z14 = z0 + authority * alpha_row * delta_collab`, where the correction head is zero-initialized and authority can be exactly zero. Remove absolute semester ordinal from gate input; let the rowwise controller use neutral evidence support plus expert prediction/disagreement signals. Select deployment authority from chronology-safe historical selection blocks, with `0` always in the grid and broad-success/faculty-local evidence controlling deployment.

**Tech Stack:** Python 3, PyTorch, NumPy, pandas, scikit-learn, joblib, pytest.

**Spec:** Approved Suite13 postmortem in conversation: identity/no-op collaboration, explicit authority, competence-based control instead of raw semester extrapolation, operational broad-success fallback, and predictive-aware Phase1 selection.

## Global Constraints

- Canonical rows, labels, Committee OOF predictions, and temporal blocks remain the existing expanding-fold/Suite5 cache.
- Reuse Suite12 schema-v4 structured cache; do not add raw database tables or change E1-E4 evidence construction.
- No target-fold labels may affect training, epoch selection, authority selection, thresholds, or fallback.
- Final Suite14 score must equal E0 exactly when deployment authority is zero.
- `authority=0` must be available at Phase2 initialization and historical deployment selection.
- Remove absolute `target_semester_ordinal` from learned gate inputs.
- Keep direct E0 Committee evidence and protected E0 fine-tuning from Suite13.
- Report raw full-authority candidate, calibrated-authority candidate, final deployed score, E0, Committee, private experts, and prior suites under the same evaluator.

---

### Task 1: Identity-preserving collaborative correction

**Files:**
- Modify: `suite14_models.py`
- Test: `tests/test_suite14_core.py`

**Interfaces:**
- Produces model outputs `full_collab_logit`, `final_logit`, `collab_delta_logit`, `row_authority`, and `gate_weights`.
- `final_logit == private_logits[:,0]` at initialization when correction head is zero.

- [ ] Write failing tests for exact identity at initialization and for explicit external authority zero.
- [ ] Implement zero-initialized bounded collaborative correction and row-authority controller.
- [ ] Run focused tests.

### Task 2: Remove absolute semester extrapolation and add local evidence signals

**Files:**
- Modify: `suite14_pipeline.py`
- Modify: `suite14_models.py`
- Test: `tests/test_suite14_core.py`

**Interfaces:**
- `gate_context` contains neutral support only; target semester ordinal is absent.
- Gate/controller additionally consume current expert probabilities, deviations from E0, entropy/confidence, and availability.

- [ ] Write failing tests asserting semester invariance of gate context and score-signal dimensionality.
- [ ] Implement new gate context and local expert evidence features.
- [ ] Run focused tests.

### Task 3: Predictive-aware specialist checkpoint selection

**Files:**
- Modify: `suite14_training.py`
- Test: `tests/test_suite14_core.py`

**Interfaces:**
- Phase1 validation score combines faculty-median mechanism BCE with faculty-median private failure AP of E1-E4.
- E3 remains supervised on true failure; E1/E2/E4 retain chronology-safe mechanism targets.

- [ ] Write failing test where better mechanism reconstruction but worse failure AP must not automatically win.
- [ ] Implement composite Phase1 stats with configurable predictive weight.
- [ ] Run focused tests.

### Task 4: Chronology-safe authority calibration and operational broad-success fallback

**Files:**
- Create/modify: `suite14_authority.py`
- Modify: `train_suite14_authority_safe_collaborative_moe.py`
- Test: `tests/test_suite14_core.py`

**Interfaces:**
- `select_authority(...)` evaluates grid including 0 on selection rows against E0, by faculty and globally.
- Deployment returns per-faculty authority values and a broad-success flag.
- If broad success is false, only faculties with sufficiently positive local evidence may retain nonzero authority; otherwise authority is zero.

- [ ] Write failing tests for zero fallback, positive local authority, and no target-label dependence.
- [ ] Implement grid calibration and conservative deployment policy.
- [ ] Run focused tests.

### Task 5: Refit, reporting, and comparisons

**Files:**
- Modify: `suite14_reporting.py`
- Modify: `train_suite14_authority_safe_collaborative_moe.py`
- Modify: `run_suite14.sh`
- Modify: `README.md`

**Interfaces:**
- Score CSV columns include E0, full-authority candidate, calibrated candidate, and final Suite14 deployment.
- Diagnostics include selected authority per faculty, row-authority distribution, full-vs-deployed delta AP/F2, E0 retention, expert ablations, gate/attention, mechanism metrics, rescue/lost transitions, and fallback reason.

- [ ] Add evaluator references to Suite13.
- [ ] Add authority diagnostics and comparison outputs.
- [ ] Update launcher paths and README.
- [ ] Run full tests, compilation, shell syntax, CLI help, synthetic end-to-end smoke test, and ZIP integrity.
