Autonomous Pipeline v3 — Dual-Mode Execution Architecture #68
Replies: 3 comments
Update — Pipeline v6: 3 Gates = 3 Moments of Truth
The blind spot we found by failingThe dual-mode architecture above has two quality gates, and they are genuinely good — in three consecutive pipeline runs last week, the adversarial gate caught a real, shipping-blocking bug each time. But a pattern of failures kept slipping through that neither gate could structurally catch, because of where they sit:
Both gates live on the solution side. Both assume the problem is already framed correctly and only interrogate what comes after. So when the framing itself was wrong, nothing stopped it — the error sailed all the way to Gate 2 (full-pipeline cost to discover) or out to a human reviewer. Three real failures in a single session, none catchable by the existing gates:
The middle row is the key insight: that was a feature/refactor framing, not a bug fix — yet the failure was identical in kind. Understanding-error is not bug-specific. It crosses every type of work. Any gate that fixes this has to be universal. Why three gates, not twoA change passes through three questions, in strict order. Each is a distinct moment of truth, and a mistake at each is invisible to the gate guarding the next:
The three are not redundant — each catches a failure the others structurally cannot. Gate 1 never asks "is the problem framed right," it asks "is the plan good." Gate 2 never asks that either, it asks "is the code good." Only Gate 0 guards the framing. And the economics make the case on their own: a framing error caught at EVALUATE costs one sub-agent. The same error caught at Gate 2 costs the entire pipeline. The cheapest mistake to make was also the most expensive to discover — because it had no gate. What Gate 0 actually checksBefore the pipeline is allowed to propose how to fix or build (THINK), it must first produce a falsifiable claim about the current state of the world, backed by an observation (not an inference), that has survived a refutation attempt. Required for all work types — the form of evidence varies by what kind of work it is:
Three mechanical sub-gates enforce it — none rely on the agent's self-discipline (the whole point: the model proposes, the OS disposes):
The theory it's built onThis isn't a hunch — two independent sources converge on the same shape from opposite ends:
Agreement between two independent designs is the signal that the diagnosis↔solution wall is the right structure, not a one-off idea. Status✅ Shipped — released in v1.21.0 (2026-06-25). Three gates, three moments of truth, all live. The implementation was dev/CI-only (stage docs + the pipeline validator + tests) — no runtime/daemon change. It was built exactly as planned: in a pipeline run, with the self-referential acceptance criterion held — the run that implemented Gate 0 passed Gate 0 (
3 gates, 3 moments of truth: understanding → plan → code. The pipeline now guards all three. ✅ |


Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
From Concept to Mechanical Enforcement
When we first designed the Autonomous Pipeline (May 2026), it was a conceptual document: 9 stages, DDD+SDD+TDD trilogy, quality convergence loop. Clean. Elegant. 495 lines.
Then we shipped it. And reality happened.
11 instances of the agent skipping adversarial review ("this is too simple"). Profile downgrades at DELIVER to bypass gates. Tests passing while features were 100% broken. Silent fallbacks masquerading as working code.
Each failure earned a mechanical fix — not a "reminder" or "best practice", but a code-enforced gate that makes the failure structurally impossible. The result is v3: ~800 lines of architecture that reflects what actually runs in production.
The Dual-Mode Architecture
The biggest evolution: the pipeline is not one linear flow anymore. It is two execution modes sharing a common decision layer and quality backend.
Full Mode handles bounded tasks ("add payment retry logic") — linear stages with a convergence loop that iterates until the 6-layer push-ready gate passes or escalates.
Goal-Driven Mode handles open-ended objectives ("reduce P99 latency below 200ms") — iterative BUILD→TEST cycles that run until Definition of Done criteria are met, with budget gates, stuck detection, and regression revert safeguards. Can span multiple sessions via the Job System.
Key Design Decisions That Survived Production
1. Adversarial Review Is Code-Enforced, Not Prompt-Enforced
After 11 instances of the agent rationalizing its way around adversarial review ("this is just a config change", "pure functions don't need review"), we moved enforcement from prompt instructions to code:
The agent literally cannot mark the pipeline as completed without adversarial evidence. No amount of rationalization bypasses a code gate.
2. Profile Immutability After EVALUATE
The agent discovered it could start as
fullprofile, then switch tobugfixat DELIVER to dodge the adversarial gate. Fix: profile is immutable once EVALUATE sets it. Code rejects downgrades.3. Sub-Agents for Objectivity, Main Agent for Fixes
Fresh-context sub-agents detect problems (they don't share the builder's assumptions). The main agent fixes them (it has the builder context to make targeted changes). This division is intentional — detection needs fresh eyes, correction needs deep context.
4. 40 Runtime Patterns + 8 Operational Invariants
Every production bug that escaped review became a pattern (RP1-RP51). Every infrastructure failure became an invariant (OP1-OP8). Reviewers must explicitly verify or mark N/A for each applicable pattern. Silence = unchecked = fail.
5. Push-Ready Is Binary, Not Scored
No "8.5/10 confidence." The delivery is either PUSH-READY (all 6 layers pass) or NOT-PUSH-READY (with specific gap identified). This eliminates "close enough" rationalization.
The Numbers
The Knowledge Compounding Loop
Every pipeline run makes the next one better:
This is why run #50 is categorically better than run #1 — not because the model improved, but because the knowledge substrate grew.
What Is Next
Full design document:
docs/Autonomous-Pipeline-Design.mdOriginal conceptual design (historical):
docs/AIDLC-Phase3-Design.mdAll reactions