<?xml version="1.0" encoding="UTF-8"?>
<spec xmlns="https://vibevm.org/spec/1">
  <title id="root">CARD: scaffold-e-fast-loop — Per-Cell Fast Verification Loop</title>
  <status stage="spec" state="done"/>
  <p p="1"><fact id="status-line" status="impl/done">**Discipline v0.2 · BETA**</fact></p>
  <section id="band-one-identity" title="Band 1 — Identity &amp; Recognition">
    <p p="2"><fact id="CLASSIFICATION" status="impl/done">Classification: layer=E (verification) + H (weak-reader); mechanism=scaffold E.</fact></p>
    <p p="3"><fact id="INTENT" status="impl/done">Intent: Guarantee every cell is independently compilable and testable in seconds, so an agent's edit→check→read-error→edit loop gets a first signal fast enough to steer — the substrate that makes every other scaffold's pass/fail usable.</fact></p>
    <p p="4"><fact id="ALSO-KNOWN-AS" status="spec/done">Also Known As: tight feedback loop; incremental check; per-package test; smoke loop; agent-computer interface.</fact></p>
    <p p="5"><fact id="APPLICABILITY-RECOGNITION" status="impl/done">Applicability / Recognition: Apply when — a cell cannot be checked without building the whole repo; the only verification is a multi-minute CI run; an agent must wait minutes for a signal. *Detector seed:* `cargo test -p &lt;cell&gt;` fails to run in isolation, OR cell has no fast local check → recognition fires (verification locality beats capability, R3-007).</fact></p>
  </section>
  <section id="band-two-justification" title="Band 2 — Justification &amp; Tradeoffs">
    <p p="6"><fact id="MOTIVATION" status="spec/done">Motivation: A weak agent in a bounded loop gets one signal per 30-min CI run — useless. With `rust-ai-native fast-loop --cell &lt;crate&gt;` + `cargo test -p &lt;cell&gt;` returning in seconds, the same agent iterates ten times in the budget that previously bought zero feedback. The interpreter-budget result confirms: more local runs help agents that can use feedback (Opus, Sonnet); the loop is the amplifier.</fact></p>
    <p p="7"><fact id="STRUCTURE-AND-PARTICIPANTS" status="impl/done">Structure &amp; Participants: *Cell isolation* (independently buildable package) · *Fast checker* (conform tiers + per-cell tests) · *Structured error* (Class F) · *Budget guard* (first signal &lt; ~60s).</fact></p>
    <p p="8"><fact id="COLLABORATIONS" status="impl/done">Collaborations: Runs Classes C/D/G checks; consumes Class B's compiler checks; emits Class F diagnostics. The raid executor runs this per batch.</fact></p>
    <p p="9"><fact id="GOALS-AND-NON-GOALS" status="impl/done">Goals / Non-Goals: *Goals:* sub-minute first signal per cell; make the loop the standard agent workflow. *Non-Goals:* NOT replacing full CI (still runs at merge); does NOT create capability — Haiku didn't improve with more runs (it amplifies, not creates).</fact></p>
    <p p="10"><fact id="CONSEQUENCES" status="spec/done">Consequences: (+) every other scaffold becomes loop-usable; (+) iteration count rises within budget. (−) requires cells to be genuinely isolable (drives §1 cell design); (−) fast checks may miss what full CI catches — gate-mode checks backstop.</fact></p>
    <p p="11"><fact id="ALTERNATIVES" status="spec/done">Alternatives: whole-repo CI only (too slow for an agent loop); manual testing (not mechanical). Neither is a substitute.</fact></p>
    <p p="12"><fact id="RISKS-AND-ASSUMPTIONS" status="spec/done">Risks &amp; Assumptions: assumes cells are isolable; god-files break this (anti-pattern). *Sunset:* none — the loop is foundational.</fact></p>
    <p p="13"><fact id="EVIDENCE-AND-TRANSFER-STRENGTH" status="spec/done">Evidence &amp; Transfer-strength: R3-007 (verification locality, theory), R2C interpreter-budget result (more runs amplify capable agents, benchmark), BLD-010 (30–60s practical threshold). Class: benchmark + theory. Tag: **[E-strong]**.</fact></p>
  </section>
  <section id="band-three-operation" title="Band 3 — Operation">
    <fence lang="card-ops" p="14">trigger: WHEN a cell lacks a sub-minute isolated check, OR verification requires a full-repo build THEN apply
mode: gate            # a structural precondition, verified at merge
routine:
  1. Make the cell an independently buildable unit (own package or test target).
  2. Provide `rust-ai-native conform check --scope &lt;crate&gt;` + `rust-ai-native fast-loop --cell &lt;crate&gt;` for it.
  3. Ensure `cargo test -p &lt;cell&gt;` runs in isolation, &lt; ~60s.
  4. Wire the cell's Class C/D/G checks into that command.
  5. Confirm first-signal latency is within budget; if not, reduce test case counts.
checker: harness assertion `cell-fast-loop-present` (cell builds+tests in isolation under budget)
raid_role: layer=infrastructure; order=after:cell-boundaries; batch=cell
budget: active_rules=1; first_signal=&lt;60s by definition</fence>
  </section>
</spec>
