Forge Factory Gates

March 24, 2026 · Jason MacDonald
The two missing pieces that turn a capable factory into an autonomous one — and how they become platform features, not one-off fixes.

The Meta Frame: Steve's Lens

Steve Cunningham's workshops show what Level 2–3 business owners actually look like up close. They have documentation. They have SOPs. They have intention. What they don't have is a system that learns, adapts, and runs without them in the room.

Jason is building at Level 5–6 — a factory that runs while he sleeps. The gap between where most businesses are and where Forge operates is exactly the market. The factory IS the proof. Every session Forge runs autonomously overnight is the live demo for every JV conversation.

The aspiration isn't a timeline constraint — it's a forcing function. "Fully autonomous by mid-April" sets the direction of gravity. The two gates below are what closes the remaining gap between "capable" and "trustworthy enough to run unsupervised."

The Current Lifecycle

The build pipeline exists but has two holes. Every task that goes through the factory currently skips scope confirmation on the way in and skips quality validation on the way out.

/align
/discover
/design
/plan
⬡ Gate 1: pre-build interview
BUILD
⬡ Gate 2: QA pass
deploy

exists   not built — these are the two gates

Gate 1: Pre-Build Alignment Interview

Gate 1
Pre-Build Alignment Interview

Five questions, asked before the first line of code is written. This isn't a process tax — it's the difference between building the right thing and building a thing. The entire class of "spent 3 hours on the wrong interpretation" failures comes from skipping this gate.

Where It Lives in the Platform

Extend /align (recommended)

/align already fires on "starting a new project." Add a pre-build mode: when called with a task/code context (vs a project idea), run the 5-question interview instead of first-principles scoring. Same skill, two modes detected by context.

Gate in ralph.sh

Before ralph picks up any task tagged code or build, fire a lightweight pre-flight prompt that confirms the 5 questions are answerable from the task description. If not → task goes back to queue with a clarification request.

Built into /start ritual

Every /start asks: "What's the primary build for today?" and runs the 5 questions before anything else. Sets the frame for the whole session instead of discovering gaps mid-build.

Telegram pre-flight

When Ralph picks up a task, send a Telegram card with the 5 questions pre-filled from the task description. One-tap confirm or one-tap clarify. Keeps Jason in loop without requiring full session attention.

Gate 2: QA Pass

Gate 2
Post-Build Quality Gate

Automated pass before any deploy. This is the single biggest gap in the current system — every overnight build is unvalidated code going straight to production. The QA gate doesn't need to be perfect. It needs to catch the obvious failures: wrong function signature, missing env var, broken health check, test file that panics.

Three layers, in order of build priority:

  1. Smoke test — does it start? does /health return 200? Does the primary function run without throwing? (1 min)
  2. Spec check — does the implementation match what /plan said it would do? (Claude reads both, scores alignment)
  3. Regression scan — does anything that was working before still work? (run existing tests if any)

Where It Lives in the Platform

New /qa skill

Called by Ralph after build, before deploy. Reads the task spec + the code diff + the CLAUDE.md. Returns PASS / FAIL with specific reasons. PASS → deploy proceeds. FAIL → task flagged, Jason gets Telegram.

Wired into deploy.sh

deploy.sh already runs smoke tests. Extend it: after smoke test passes, run a lightweight spec-match check. Non-blocking warning now, blocking gate when confidence is higher.

Ralph post-task hook

ralph.sh has pre/post-task hooks (KFS wired). Add QA as a post-task hook for code tasks. QA result gets written to KFS brain event — the factory learns what kinds of tasks tend to fail QA.

CLAUDE.md as test spec

Every service already has a CLAUDE.md. The QA gate treats CLAUDE.md as the implicit spec — does the new code violate any of the service's stated contracts? Simple but powerful.

Second-Order Effects Tree

These two gates look like process overhead. They're not. They're the difference between a factory that produces volume and one that produces compounding value.

Gate 1 built → wrong-direction tasks never start → Ralph queue fills with high-confidence work only → overnight output quality improves 3–5x even with same task volume
Gate 2 built → unvalidated code stops reaching production → trust in overnight builds increases → Jason stops reviewing every Ralph commit → true hands-off autonomy becomes safe
Both gates active → Forge's build loop is trustworthy → this exact loop becomes the Athio OS deployment spec → every JV partner gets a factory with gates pre-installed → quality compounds across every business Forge deploys into
Gates as curriculum → Labs teaches the 5 pre-build questions and the smoke/spec/regression QA pattern → students build with gates from day one → their first deployment is already more disciplined than most professional teams
KFS learns from gate outcomes → every PASS/FAIL gets written to brain events → over time, Forge knows which task types, which agents, which times of day produce the most QA failures → the factory self-optimizes
Steve's L2→L3 business gets gates → when Labs teaches the gates, the "binder that doesn't walk out the door" now includes quality standards → the clone doesn't just remember the expert's content, it remembers the expert's standards

Build Sequence

Step What Effort Unlocks
1 Extend /align with pre-build mode (5 questions on code context) Small Gate 1 in every Claude Code session immediately
2 Add smoke test + spec-match to deploy.sh Small Gate 2 on every manual deploy immediately
3 Wire Gate 1 into ralph.sh (pre-flight before code task pickup) Medium Gate 1 for ALL Ralph overnight builds
4 New /qa skill — reads task spec + diff + CLAUDE.md → PASS/FAIL Medium Automated Gate 2 for Ralph, with Telegram notification on FAIL
5 Wire /qa as ralph.sh post-task hook + KFS brain event Medium Factory learns from gate outcomes — self-optimizing QA over time
Steps 1 and 2 are an afternoon build. They give you both gates on every session and deploy before Ralph even needs to be touched. Start there.

Related