Implementation Spec · Forge FSM · PLAN Review

The Validation-Tier Gate

A plane's validation status — not just its enable flag — decides whether it may enter the live recall SELECT. Flag-alone must never admit an unvalidated plane. One small, mechanical, fail-closed gate on enabledPlanes.

sprint FORGE_PLANE_VALIDATION_TIER_GATE_v1 type security_hardening 35 LOC base 21a9e3bf SEED 3/3 converged signature stable

Owner coord-build-recall-b (MAIN RULING 2) · 2nd-verify wick-capture · consumer claude-revive (composition-wire A2) · lands standalone before any completion-plane enable.

01The Problem

Before · flag is the gate
export function enabledPlanes(env){
  return REGISTRY.filter(
    p => p.enabled(env));  // flag only
}
  1. completion-rs-lagrange is tagged open-store-fill-gated — real-data leg still OPEN.
  2. Operator sets FORGE_WICK_PLANE_COMPLETION=1.
  3. It enters the live content-router SELECT on the flag alone. The validation tag is never checked.
  4. Unvalidated plane serving real queries — violates the real-data-only P0.

the code comment even admits it: "the tag is honest metadata, the flag is the gate."

After · validation-tier is the gate
export function enabledPlanes(env){
  return REGISTRY.filter(
    p => p.enabled(env)
      && planeValidated(p, env));
}
  1. Flag ON is necessary but no longer sufficient for a non-proven plane.
  2. open-store-fill-gated also needs a separate declared _VALIDATED signal.
  3. proven-synthetic is excluded unconditionally — no env clears it.
  4. Only real-data-validated planes serve. Byte-identical when all flags off.

signature unchanged → claude-revive's A2 wire composes by construction.

02The Decision — planeValidated(p, env)

An exhaustive per-tier switch. The earlier draft's generic "non-proven ⇒ needs a validatedFlag" was the loophole all three SEED panelists caught: it would have let a synthetic plane serve via an env override. Fixed by making each tier explicit.

proven-real
enable flag suffices (banked real-data) → return true
open-store-fill‑gated
requires a declared validatedFlag AND env?.[validatedFlag]==="1" (plus the enable flag) → true only when both present, else false
proven-synthetic
never serves — no env clears it; must be re-tagged proven-real via code + real-data re-validation → return false
default
any unknown / future tier → return false (fail-closed)
function planeValidated(p, env){
  switch (p.validation){
    case "proven-real":            return true;                            // flag suffices
    case "open-store-fill-gated":  return p.validatedFlag != null              // declared +
                                     && env?.[p.validatedFlag] === "1";   //   signal set
    case "proven-synthetic":       return false;                           // NEVER serves
    default:                       return false;                           // fail-closed
  }
}

03State — the plane registry it gates

Registration is a wiring act with no behavioral claim. Eligibility (this gate) is separate from registration.

PlaneEnable flagValidation tierPost-gate: what admits it
intuition-pprFORGE_WICK_PLANE_PPRproven-realenable flag
completion-rs-lagrange ⚠️FORGE_WICK_PLANE_COMPLETIONopen-store-fill-gatedenable flag + …_COMPLETION_VALIDATED=1
l1-hierarchyFORGE_L1_HIERARCHY_RECALLproven-realenable flag
l2-grassmannFORGE_GRASSMANN_RECALLproven-realenable flag
l3-fisherFORGE_PLANE_L3proven-realenable flag

⚠️ completion-rs-lagrange is the one at-risk plane today — the only non-proven-real entry in the registry, and the concrete vector the gate closes.

04Modified functions & new state

infrastructure/packages/memory-router/src/recall/recall-pipeline.ts
// NEW additive optional field
interface RecallPlane {
  // …existing…
  readonly validatedFlag?: string;
}

Explicitly declared — never auto-derived. Set only on open-store-fill-gated planes eligible for real-data validation. proven-real/proven-synthetic carry none.

makeFlagPlane(…) — one added arg
makeFlagPlane(
  "completion-rs-lagrange",
  "FORGE_WICK_PLANE_COMPLETION",
  "open-store-fill-gated",
  "FORGE_WICK_PLANE_COMPLETION_VALIDATED")

The validated env is a distinct name from the enable flag → two independent operator signals, one labelled _VALIDATED.

05Kill-test battery (L0–L4)

#ScenarioEnvExpected
US-1open-store-fill-gated plane, flag onlyCOMPLETION=1EXCLUDED — the fix
US-2same, flag + validated (escape valve)COMPLETION=1 + …_VALIDATED=1INCLUDED
US-3proven-real plane, flag on (no regression)PPR=1INCLUDED
US-4validated signal WITHOUT enable flag…_VALIDATED=1 onlyEXCLUDED — both required
US-5all flags offempty ⇒ byte-identical legacy path
US-6signature stabilityfunctions unchanged; additive optional field
US-7proven-synthetic, flag + any validatedSYN=1 + anythingEXCLUDED — unconditional
US-8new/unknown non-proven tier, no declared flaganyEXCLUDED — fail-closed default

06Implementation notes

Backward compatibility — signature stable enabledPlanes(env)→RecallPlane[] and registeredPlanes() signatures are unchanged; the only shape change is an additive optional validatedFlag?. claude-revive's A2 composition-wire consumes RecallPlane[] reading only id/enabled/rank/validation → composes by construction. pipelineActive derives from enabledPlanes().length and inherits the gate for free.
Security — the loophole this closes The gate is not "block one plane." It enforces that no non-proven-real plane reaches the live SELECT on a flag alone, and that a proven-synthetic plane can never serve. The _VALIDATED env asserts a real-data validation was done; F1 is the mechanical gate, not the evidence-verifier (that's the separate real-data NC that justifies flipping it).
Sequencing Lands STANDALONE off origin/main, before any completion-plane enable (MAIN order). Rebases cleanly to current main (enabledPlanes unchanged there). claude-revive's composition-wire consumes the landed gate whenever it wires; correct in either land order. Out of scope: the ContentRouterSelect impl, the completion plane's real-data validation itself, and any rank impl.
F1 · PLAN-phase visual review · SEED converged 3/3 (Grok + Codex + Gemini, R1 synthetic-loophole caught → R2 approve) · design locked · next: PLAN panel → attest → DESIGN → BUILD → VALIDATE (wick-capture 2nd-verify) → land.