Jordach MakayaOperations leader · Backend & systems engineeringCasablanca · FR / EN
Journal
Journal · TutorialTypeScriptTDDAI coding agents

Provable TDD for AI Coding Agents: The RED Seal Execution Architecture

How I structure an agentic software delivery zone so that tests are written before implementation, role boundaries stay enforceable, and DONE is authorized by evidence rather than agent claims.

Author
Jordach Makaya
Reading
25 min
Structure
30 chapters
Audience
CTOs · Staff & Principal Engineers
01Task branchIsolated, bounded job
02Tests writtenTester dispatched first
03RED verifiedFailing for the right reason
04RED SealFailing state committed and sealed
05ImplementationCoder works toward GREEN
06Review + gatesIndependent, deterministic
07DONE authorizedDerived from evidence

Implementation code is not allowed to exist before a failing test state has been written, verified, and sealed.

claim → verification → evidence → DONE
Chronology of a sealed taskProvable TDD workflow

The core problem: speed destroys discipline

AI coding agents write code quickly. That is not the difficult part. The difficult part is preventing agents from modifying test assertions to make failing tests pass, or claiming a job is done when tests were never verified in an authentic failing state.

Strict separation of roles

An agent cannot act as both tester and coder on the same lot:

  • Orchestrator (Codex): Verifies RED, generates SHA-256 seals, reviews deliverable integrity.
  • Tester (Claude/Codex): Writes acceptance tests prior to production code.
  • Coder (AGY/Cline): Implements code toward GREEN without modifying sealed tests.

RED Seal cryptographic mechanics

Before the coder begins, the test file hashes and git commit are sealed in a cryptographic manifest. Any post-seal tampering of test files triggers an immediate review failure.

Proof in practice: caught mutation

Here is a real example where the coder mutated a sealed test to make it pass. The review gate detected the hash mismatch and blocked the handoff:

Independent review blocking a task after the coder modified a sealed test
Review verdict FAIL: Coder modified sealed test scripts/check-env-parity.test.ts

Automated gates and authorization of DONE

DONE is never authorized by an agent saying “I have completed the task”. DONE is authorized by deterministic checks: seal verification passes, tests run GREEN, coverage thresholds are met, and mutation testing verifies the oracle.