The agentic SDLC, as seven gates that can fail

A gate is only worth having if it can say no. For each of the seven, here is what it checks, how it fails, and what it leaves on the record when it passes.

APP-42 · Retry failed supplier syncSimulated run
  1. Analyst agentgate failedWhat should happen when the supplier API fails halfway? Question sent to the task author, nothing gets built yet.
  2. Task authorpersonRetry twice, then alert on-call. Added to the acceptance criteria.
  3. Architect agentClear and buildable. Spec published and pinned to the starting commit.
  4. Test author agent9 acceptance tests written from the spec. All 9 fail on the starting commit, as they must.
  5. Developer agentImplemented. 9 of 9 pass and the full suite is green. Tests and CI files untouched.
  6. Tester agentgate failedRebuilt on a fresh merge with main: a migration landed upstream and 2 tests fail. Back to Green.
  7. Developer agentAdapted to the new migration. Full suite green again.
  8. Tester agentReplay passes and the CI pipeline is green. Merge request opened.
  9. Reviewer, other model familyAdvisory note: the retry delay is hard-coded. Not blocking.
  10. MaintainerpersonRead the diff and the note. Merged.
  11. Security and business checksBoth pass on the merge commit. Ready for a human decision.
  12. OwnerpersonRead the evidence. Done.

Roast

What it checks
An analyst agent and an architect agent read the task in parallel. The analyst asks whether it is clear and complete. The architect asks whether it can be built in this codebase and how much process it needs.
How it fails
Either one returns questions instead of a ready verdict. The questions go back to the person who wrote the task, and nothing gets built.
What it leaves
A spec, published only when both say ready, and pinned to a commit.

Red

What it checks
A test author writes acceptance tests from the spec before any implementation exists, then runs them against the pinned starting commit.
How it fails
A test that passes before the change exists proves nothing, so the gate requires every new test to fail. Tests that pass, or do not run, stop the task here.
What it leaves
An execution manifest that records the failing run and the spec it came from.

Green

What it checks
A developer agent implements the change inside the sandbox until the Red tests pass, first the targeted ones, then the full suite.
How it fails
The developer cannot change the tests, the test configuration or the CI files. An edit to any of them fails the gate, and so does added code that patches the test machinery. Any failing test keeps the gate shut.
What it leaves
A developer manifest, read back from the remote before the task may move on.

Replay

What it checks
A tester that shares nothing with the developer rebuilds the verdict from scratch on a synthetic merge with the current protected branch. It then opens one merge request, and the required CI pipeline must pass.
How it fails
A result that only held on the developer’s branch fails here. So does a red pipeline.
What it leaves
An evidence commit with the replay manifest, and the pipeline result.

Merge

What it checks
A reviewer from a different model family writes an advisory note on the merge request. A person reviews the change and merges it.
How it fails
The orchestrator has no approve or merge operation, so nothing merges without a person. The merge identity is read back and must differ from the automation.
What it leaves
A review note bound to the exact diff, and the recorded merge commit.

Attest

What it checks
Business validation and security checks run in clean worktrees against the exact merge commit.
How it fails
A failing verdict never relabels the old merge as passing. It starts a new Red to Green chain from the tracker.
What it leaves
A pass or fail attestation per check, bound to the merge commit.

Done

What it checks
A person reads the evidence and closes the task in the tracker.
How it fails
Automation can mark a task as ready for that decision. It cannot set Done, and two independent code paths reject an automated attempt.
What it leaves
A closed task with every gate’s evidence linked to it.

Spec-driven: the spec is pinned to a commit

An analyst agent and an architect agent check that the task is clear and buildable before anything is built. The approved spec is pinned to the starting commit, and its fingerprint is checked at every later gate. If the spec changes after approval, the chain breaks and the work stops.

Test-first for AI agents: red tests before any code

A test author writes acceptance tests from the spec and runs them on the starting commit. Every new test must fail. Only then does a developer agent write code, and it cannot edit the tests, the test configuration or the CI files. A passing suite then means the code met a target it could not move.

Under every gate

  • The approved spec’s digest is carried through every later manifest. A change in the spec after approval breaks the chain.
  • Each gate reads the previous gate’s evidence back from the remote before it trusts it.
  • Gates fail closed. A timeout, a tampered file or a drifted spec keeps the gate shut.
  • Agents run in a sandbox with no network and no credentials, and host files outside the worktree are out of reach. Only the orchestrator’s own deterministic code commits, pushes or updates the tracker.
  • The gates are tested against themselves. Deliberate defects are injected into the gate code, and the test suite has to catch every one.

A lighter lane for small changes

Every task goes through Roast, Red, Green, Replay and a human merge. For a small, local, low-risk change, the architect can choose a light lane. After the merge a deterministic check on the diff decides whether the business and security gates may be skipped. Migrations, dependency changes and anything touching access control always get the full gates. The lane is recorded with the spec, and the person who closes the task owns that trade.