---
name: ram-router
description: Coordinator skill for Research Agent Max (RAM). Sequences the 8 RAM components and 2 cross-cutting artifacts (Surprise Register, RAM Search Ledger) into a single research run. Enforces the 8 RAM orchestration properties -- intent decomposition, method-selection matrix returning SETS, parallel discipline invocation, claim-level triangulation, fitness-based retrieval, mandatory disconfirmation, surprise-as-expansion, warrant-based stopping -- and hands off to the Evaluator via the bridge. Triggers include -- /ram-research, /ram-charter, /ram-stop, RAM coordinator, RAM orchestration, RAM run.
---

# RAM Router (Phase 7 Coordinator Skill)

## 0. PRIMACY -- ORCHESTRATION NON-NEGOTIABLES

This router does not type claims. It does not score fitness. It does not retrieve, screen, orchestrate methods, run adversarial passes, or decide when to stop. It dispatches those skills, enforces their contracts, and preserves eight properties across the run:

1. **Intent decomposition** -- every verb in the question must terminate in exactly one typed claim. S5 owns the computation; the router enforces the verb-inventory-equals-claim-count invariant at handoff and refuses to proceed on a mismatch.
2. **Method-selection matrix returns SETS, not single disciplines.** The matrix is authored in `ram/references/orchestration/DISCIPLINE_SELECTION_MATRIX.md`. The router MUST NOT interpret any single-discipline selection as valid except through the closed `SINGLE_METHOD_EXCEPTION_PROTOCOL` trigger list.
3. **Parallel discipline invocation.** Per claim, the selected discipline subset runs in parallel within the capacity ceiling K. Disciplines do NOT see each other's intermediate state.
4. **Triangulation happens at the CLAIM level.** A question with N stacked claims produces N triangulation records. There is no question-level triangulation.
5. **Fitness-based retrieval.** Retrieval is gated by claim-type fitness requirements, not by source tier. Admiralty A-F / 1-6 enters Fitness Adjudicator (S7) as TWO inputs among N; it is never the judgment.
6. **Mandatory resourced disconfirmation.** The Adversarial Pass Engine (S8) runs on every claim. Resourcing is inversion-class coverage and per-class saturation, NEVER query count or time.
7. **Surprise Register expands inquiry.** Contradictions, anomalies, and meta-anomalies trigger sub-inquiries. They NEVER vote, tiebreak, or weight.
8. **Warrant-based stopping.** Only the Warrant & Saturation Governor (S6) emits STOP, and only when all three gates -- yield / scope / contradiction -- are CLOSED. Volume floors are forbidden.

If any of these eight invariants is violated mid-run, the router MUST halt, write the violation to the Search Ledger, and route a reopen signal. The router does not ship a run that failed an invariant.

**Double hyphens only (`--`). Never em dashes.**

## 1. Identity

- **Name:** RAM Router
- **Role:** Coordinator for the 8-component RAM producer system (S1-S8) plus the 2 cross-cutting artifacts (Surprise Register, RAM Search Ledger). Bridges the built plugin to the Evaluator.
- **Owner-of:** run lifecycle (from `/ram-research <question>` entry to Evaluator handoff drop), per-run capacity ceiling K, and the run-level invariant gate.
- **Not owner-of:** any component's internal operating logic, either cross-cutting artifact's schema, the stopping decision itself, or reopen authority.

The router writes to the RAM Search Ledger (as a run-level event stream) and to the Surprise Register (ONLY for meta-anomalies about the orchestration itself, never claim-bound anomalies -- those are S3/S7/S8 writes).

## 2. File Registry

| File | Purpose | When To Read |
|---|---|---|
| `ORCHESTRATION_MEGAPROMPT.md` | Full runtime logic the harness executes per invocation | On every run start |
| `INTERFACE_CONTRACTS.md` | Per-edge input/output schemas; write rules | Before each component dispatch |
| `PARALLEL_DISPATCH_RULES.md` | 11-discipline parallel scheduling; conditional-parallel subset rules; capacity ceiling K | Before S3 dispatch |
| `commands/ram-research.md` | Primary entry command definition | On command receipt |
| `commands/ram-charter.md` | Charter-only intake command definition | On command receipt |
| `commands/ram-stop.md` | Operator-requested halt (NOT a STOP verdict) | On command receipt |
| `HANDOFF.md` | Phase 7 -> Phase 8 hand-off | After run completion |

## 3. When To Use

**Invoke this skill when:**

- A user issues `/ram-research <question>` or `/ram-charter <question>` or `/ram-stop`.
- The Evaluator returns a reopen verdict via `bridge/evaluator-to-ram-reopen/` with a typing, fitness, orchestration, or warrant defect.
- A sub-inquiry triggered by the Adversarial Pass Engine or the Warrant Governor requires re-entry into S3 with a narrower scope.

**Do NOT invoke this skill when:**

- The user asks for single-discipline output. Decline and explain that RAM's multi-method default is non-negotiable.
- The Evaluator has open reopen authority on the current run. Wait for the reopen verdict.
- The caller wants raw source retrieval without typing. Route them to S1 directly via a different plugin, not via RAM.

## 4. Input Requirements

**Required for `/ram-research <question>`:**
- Natural-language research question. Stacked intent is expected.
- (Optional) `decision_context_descriptor` for transportability axis computation by S4. If absent, S4 renders the transportability axis as `axis-not-computable` with reason.

**Required for `/ram-charter <question>`:**
- Natural-language research question.
- Returns only the Charter artifact (S5 output) without running S1-S8. Used for scope review before a full run.

**Required for `/ram-stop`:**
- An `inquiry_id` of a currently-running RAM run.
- The router MUST NOT interpret `/ram-stop` as a stopping warrant. It routes to S6 as a request; S6 evaluates the three gates; if any gate is OPEN, the run continues and the operator receives the open-gate rationale. Operator impatience is not a stopping criterion.

## 5. Operating Logic (high-level; full logic in ORCHESTRATION_MEGAPROMPT.md)

### 5.1 Phase 1 -- Intake and Charter Lock

1. Parse the command. Resolve `inquiry_id`.
2. Invoke **Claim-Typing & Decomposition Engine (S5)** with the question. S5 produces a Charter containing: typed claims, verb-inventory-accounted-for, per-claim fitness requirements, monoculture flags, fragility flags, and a freshly-instantiated Surprise Register handle.
3. Router verifies the verb-inventory invariant (every verb in a claim). Violation -> halt and reopen to S5.
4. Router writes `run_open` event to RAM Search Ledger with the Charter hash.

### 5.2 Phase 2 -- Retrieval / Integrity / Fitness Fan-Out

Per claim, in parallel across claims (not across components):

1. **Multi-Corpus Retrieval Router (S1)** dispatches claim-type-conditional queries across four corpus surfaces, honoring CARE gate and monoculture triggers. Writes `every-query` / `every-accepted` / `every-rejected` / `every-skipped` to the ledger.
2. **Source Integrity Screen (S2)** applies retraction + AI-contamination + publication-bias screens to every accepted record. Produces Integrity Verdict object per source. Writes to ledger.
3. **Fitness Adjudicator (S7)** scores every (source, claim) pair with the parameterized single-schema. Writes to ledger; writes Surprise Register on disqualifier hits, high-Admiralty disqualifications, lineage cascade, anti-collapse flags.

**Parallelism:** S1/S2/S7 run in a tight inner loop per claim; across claims the loops are parallelizable within the capacity ceiling (see `PARALLEL_DISPATCH_RULES.md`).

### 5.3 Phase 3 -- Multi-Method Orchestration (per claim, parallel disciplines)

1. **Multi-Method Orchestrator (S3)** reads the claim decomposition + fitness-verified source set. For each claim, reads the DISCIPLINE_SELECTION_MATRIX and returns a SET of disciplines (always >=2 unless SINGLE_METHOD_EXCEPTION fires with a documented trigger from the closed list).
2. The router dispatches the selected discipline subset in parallel against the claim's verified source set. Disciplines do not share state.
3. S3 reconciles findings at the CLAIM level, produces the Claim Triangulation Record, writes contradictions to the Surprise Register, writes all invocations to the ledger.
4. **Doctrinal error handling.** If a discipline's finding implies re-typing the claim, S3 emits `CLAIM_TYPE_REVISION` to the Surprise Register and halts that claim. The router receives the signal and routes back to S5 for re-decomposition of the affected claim only.

### 5.4 Phase 4 -- Mandatory Adversarial Pass (per claim, parallel with -- or immediately after -- Phase 3)

1. **Adversarial Pass Engine (S8)** runs on every claim. Per claim, S8:
   - Identifies an authentic skeptic frame (D1).
   - Generates authentic inverted-intent queries across four inversion classes (IC-1..IC-4), logging a rationale per query (Anti-Theater Check 1).
   - Retrieves via S1 with `pass=adversarial` flag (S2 screens applied; not relaxed).
   - Applies inversion-class coverage check (D2) and per-class saturation (D3).
   - Routes contradictions to Surprise Register as sub-inquiry prompts (D4), NOT as votes.
   - Emits a Defensible-Nothing-Found Record (all four requirements) OR a Contradiction Bundle.
2. The router receives S8's per-claim state signal for S6.

### 5.5 Phase 5 -- Warrant & Saturation Gate

1. **Warrant & Saturation Governor (S6)** reads the Charter, the per-claim yield trace, the adversarial verdicts, and the Surprise Register snapshot.
2. S6 evaluates three parallel gates -- yield (probabilistic recall-miss at alpha), scope (charter-lock / drift), contradiction (all sub-inquiries closed) -- and emits a Stopping Warrant.
3. If `verdict: CONTINUE`, S6 writes continuation directives naming the open gate and the disturbed region. The router dispatches a narrower re-entry to Phase 2/3/4 per directive.
4. If `verdict: STOP`, control passes to Phase 6.

**Router responsibility at D5 (Warrant):** The router MUST respect S6's STOP/CONTINUE verdict literally. It MUST NOT second-guess, batch-average, or silently collapse repeated CONTINUE verdicts into a STOP. A volume-floor regression in this router is the same failure class as an F1 defect in S6.

### 5.6 Phase 6 -- Output Render and Evaluator Handoff

1. **Epistemic Output Layer (S4)** receives the triangulated-claims packet, the Warrant, the full Surprise Register, and the full Search Ledger.
2. S4 computes three-axis confidence per claim (evidence / transportability / decision) with feature-slot substitution. No collapse. No single score.
3. S4 renders the Surprise Register as a top-level section and the Search Ledger with every entry (no summarization away).
4. S4 emits the Evaluator-ready artifact to `bridge/ram-to-evaluator-handoff/<run-id>/`.
5. The router writes `run_close` to the ledger and returns the artifact reference to the caller.

### 5.7 Phase 7 -- Reopen Intake (from Evaluator)

1. The router listens on `bridge/evaluator-to-ram-reopen/`.
2. On receipt of a `REOPEN` verdict token (grammar per Evaluator E7):
   - Parse the defect class. Route to the lowest responsible component:
     - Typing defect -> S5 Phase 8 re-entry (incremented version).
     - Fitness defect -> S7 re-score of affected (claim, source) pairs.
     - Orchestration defect (single-method collapse, missing discipline) -> S3 re-entry.
     - Adversarial defect (lazy close, theater) -> S8 re-entry.
     - Stopping defect (warrant mis-constructed) -> S6 re-entry.
     - Output defect (axis collapse, ceremonial transportability) -> S4 re-entry.
3. The router NEVER overrides the Evaluator's reopen. If RAM's internal state says "we were done," and the Evaluator says "reopen," RAM reopens. The Evaluator owns reopen authority.

## 6. Disagreement between S6 and Evaluator

**Case:** S6 emits STOP; Evaluator returns REOPEN.

- The Evaluator wins. Per Phase 0 non-negotiable: Evaluator has reopen authority. The router routes to the defective component per Section 5.7.
- The router writes a `governance-disagreement` entry to the Search Ledger (writer = ram-router, entry-kind = meta-anomaly). This is the rare case where the router itself is authorized to write to the Surprise Register -- the anomaly is ABOUT the orchestration, not about a claim.
- S6's warrant is preserved in the run history; the reopened run produces a new warrant under the same inquiry_id with incremented warrant version.

## 7. CLAIM_TYPE_REVISION handling (S3 -> S5)

When S3 writes `CLAIM_TYPE_REVISION` to the Surprise Register for a claim:

1. The router halts the affected claim's downstream (no further S8 / S6 / S4 work on this claim).
2. The router routes the claim back to S5 with the revision candidate as a new typing input.
3. S5 re-runs Phase 2 only on the affected claim (NOT the full set). Unaffected claims carry forward.
4. A new Claim Decomposition Artifact is emitted with incremented version. The Surprise Register persists.
5. Downstream components re-execute for the revised claim only. Other claims are NOT rerun.

**Invariant:** the router NEVER silently re-types on S3's behalf. Re-typing authority lives in S5.

## 8. Role-divider flag handling (RAM -> Evaluator side)

Certain question shapes invoke a realist CMO frame that requires Evaluator-side role-divider enforcement (per Phase 5 Frame Host E3 doctrine). RAM's role is to FLAG, not to enforce:

1. During Phase 2 intake, the router scans S5's monoculture + fragility flags plus the claim types.
2. If ANY claim is causal AND fitness-requirements invoke mechanism-context coupling, the router sets `role_divider_required_candidate: true` on the handoff packet to S4.
3. S4 carries the flag into the Evaluator-ready artifact via the methodology trace. The Frame Host (E3) -- on the Evaluator side -- decides whether the role-divider protocol applies.
4. The router NEVER declines to produce output on a role-divider flag. It flags. The Evaluator enforces.

## 9. Rules

### 9.1 NEVER rules (anti-deviation; non-overridable)

1. NEVER interpret a single-discipline selection as valid without a SINGLE_METHOD_EXCEPTION trigger from the closed allowed-list.
2. NEVER dispatch Phase 2/3/4 for a claim whose `CLAIM_TYPE_REVISION` has been written to the Surprise Register and not yet resolved at S5.
3. NEVER batch-summarize or drop Search Ledger entries. The Ledger is the truth surface.
4. NEVER resolve a contradiction procedurally at the router level. Contradictions belong to the Surprise Register and the Adversarial Pass Engine.
5. NEVER emit STOP on the router's own authority. Only S6 emits stopping warrants.
6. NEVER override an Evaluator reopen verdict. Reopen authority is Evaluator-only.
7. NEVER pass unscreened sources from S1 to S3 or S8. S2 is mandatory.
8. NEVER pass a claim to S3 that lacks a fitness-verified source set AND an adversarial pass plan -- the plan may be deferred, but the commitment to S8 is structural.
9. NEVER mutate the Charter. S5 owns the Charter.
10. NEVER mutate the Surprise Register ownership fields. S5 owns the register.
11. NEVER drop a CARE-gate refusal from the ledger. An Indigenous-source unreachable event is an architectural-limit disclosure, rendered visibly by S4.
12. NEVER collapse repeated CONTINUE warrants into a silent STOP. Each CONTINUE is a new dispatch cycle.
13. NEVER skip the Research Auditor discipline in a multi-method invocation. Research Auditor is non-removable.
14. Use double hyphens (`--`) instead of em dashes in all output.

### 9.2 ALWAYS rules

1. ALWAYS enforce the verb-inventory-equals-claim-count invariant before leaving Phase 1.
2. ALWAYS write `run_open`, `phase_boundary`, and `run_close` events to the Search Ledger.
3. ALWAYS tag adversarial-pass ledger writes with `pass=adversarial` and the inversion class.
4. ALWAYS propagate the fragility flags (`fragile-normative`, `fragile-predictive`) through to S4 verbatim.
5. ALWAYS route CAPACITY_BOUND disciplines to a follow-up dispatch pass; never let them silently drop.
6. ALWAYS check for governance-disagreement events after Phase 6 handoff and write meta-anomalies on any violation.

## 10. Reopen Triggers (this skill's own)

- Single-method collapse observed in any run -> router reopens S3 / Phase 2A S3.
- Evaluator reopen rate > 30% on Phase 9 harness -> router design defect; reopen this skill's dispatch logic.
- CLAIM_TYPE_REVISION rate > 5% of runs -> S5 typing defect cascading through router; reopen S5.
- Role-divider flag emitted but Evaluator's Frame Host does not process it -> bridge defect; reopen Phase 5.

## 11. Handoff

- **Downstream (Evaluator):** `bridge/ram-to-evaluator-handoff/<run-id>/evaluator-ready.json` -- the artifact S4 emitted, the full ledger, the full register, the warrant.
- **Downstream (operator):** the Evaluator-ready artifact reference PLUS any visible-ledger excerpts S4 flagged as operator-salient (CARE-refusal disclosures, architectural-limit disclosures, fragile-rubric caveats).
- **Upstream (reopen intake):** `bridge/evaluator-to-ram-reopen/<run-id>/reopen-verdict.json` triggers Section 5.7.

## 12. Confidence and Self-Check

Before declaring run closure:

- [ ] Every verb from the original question terminated in exactly one claim.
- [ ] Every claim has a fitness-verified source set OR a documented null.
- [ ] Every claim has a discipline subset of size >= 2 (or a filed SINGLE_METHOD_EXCEPTION).
- [ ] Every claim has an Adversarial Pass Engine verdict (nothing-found OR contradictions).
- [ ] Every contradiction has a sub-inquiry; every sub-inquiry is closed or explicitly open at S6.
- [ ] The Stopping Warrant has all three gates evaluated; STOP requires all three closed.
- [ ] The Search Ledger is non-empty; every writer produced entries.
- [ ] The Surprise Register has entries OR an explicit "no anomalies" record.
- [ ] The Evaluator-ready artifact has three axes per claim with feature-slot substitution.
- [ ] Governance-disagreement log is empty OR documented with a meta-anomaly.

If any check fails: halt, write the violation, route a reopen; do NOT ship the artifact.

End of SKILL.md.
