VSDD fuses Spec-Driven, Test-Driven, and Verification-Driven Development into a single AI-orchestrated pipeline that produces provably correct software through adversarial refinement.
Verified Spec-Driven Development (VSDD) represents a fundamental shift in how software is engineered in the AI era. Rather than treating Spec-Driven Development (SDD), Test-Driven Development (TDD), and Verification-Driven Development (VDD) as competing methodologies, VSDD fuses them into a single, AI-orchestrated pipeline where each phase serves as a gate for the next.
The Three Pillars of VSDD
Spec Supremacy
In VSDD, specifications are the source of truth. Before any code is written, the human developer defines the contract—what the software must do, how it must behave, and what properties must be provable. This isn't just functional requirements; it's a complete behavioral contract including preconditions, postconditions, invariants, and non-functional requirements like performance bounds and security constraints.
Test-First Discipline
The TDD core of VSDD enforces that no implementation exists without a failing test demanding it. The Builder AI generates comprehensive test suites directly from the spec—unit tests for each behavioral contract item, edge case tests for boundary conditions, integration tests for system context, and property-based tests for invariants. Only then does implementation begin, with the minimum code necessary to make each test pass.
Adversarial Verification
VDD introduces the Adversary—a hyper-critical AI reviewer with zero patience. This isn't polite code review; it's adversarial refinement that continues until the reviewer is forced to hallucinate flaws. The Adversary examines specs for ambiguity, tests for tautologies, and implementation for hidden debt. This continues through formal verification, fuzz testing, and mutation testing until all four dimensions converge.
The VSDD Pipeline
Phase 1: Spec Crystallization
The human developer describes feature intent to the Builder AI, which produces a formal specification document. This phase does more than define what the software does—it defines what must be provable about it and structures the architecture accordingly.
Behavioral Specification establishes the functional contract: preconditions, postconditions, invariants, interface definitions, and edge case catalogs. Every boundary condition and failure mode is explicitly enumerated.
Verification Architecture is the critical design decision. The Builder produces a Verification Strategy answering: "What properties must be mathematically provable, and what architectural constraints does that impose?" This includes:
- Provable Properties Catalog: Which invariants, safety properties, and correctness guarantees require formal verification versus test coverage?
- Purity Boundary Map: Clear separation between deterministic, side-effect-free core and effectful shell (I/O, network, database). This boundary dictates module decomposition and dependency direction.
- Verification Tooling Selection: Based on language and properties, the Builder selects appropriate formal verification stack (Kani for Rust, CBMC for C/C++, Dafny, TLA+ for distributed systems).
Why Phase 1 Architecture Matters: If the system is designed with side effects woven through core logic, no amount of later heroics will make it verifiable. A function that reads from a database, performs a calculation, and writes to a log cannot be formally verified without mocking infrastructure the verifier may not support. But a pure function that takes data in and returns a result can be verified deterministically.
Spec Review Gate: The complete spec—behavioral contracts and verification architecture—is reviewed by both human and Adversary. Sarcasmotron (the Adversary) tears into the spec looking for ambiguous language, missing edge cases, implicit assumptions, contradictions, and verification tool mismatches. The spec iterates until the Adversary can't find legitimate holes.
Phase 2: Test-First Implementation
With an airtight spec, the Builder writes tests—and only tests. No implementation code yet.
Test Suite Generation translates the spec directly into executable tests. Every postcondition becomes an assertion. Every precondition violation becomes a test expecting a specific error. Property-based tests assert invariants across randomized inputs.
The Red Gate ensures all tests must fail before implementation begins. If a test passes without implementation, it's suspect—either testing the wrong thing or the spec was wrong.
Minimal Implementation follows classic TDD discipline: pick the next failing test, write the smallest implementation that makes it pass, run the full suite, repeat. After all tests are green, the Builder refactors for clarity, performance, and spec alignment.
Human Checkpoint: The developer reviews the test suite and implementation for alignment with the "spirit" of the spec. AI can nail the letter of the contract while missing intent.
Phase 3: Adversarial Refinement
The verified, test-passing codebase faces the Adversary. Sarcasmotron reviews:
- Spec Fidelity: Does implementation satisfy the spec, or did tests encode a misunderstanding?
- Test Quality: Are tests actually testing what they claim? Are there tautological tests or tests asserting implementation details rather than behavior?
- Code Quality: The classic VDD roast—placeholder comments, generic error handling, inefficient patterns, hidden coupling, missing resource cleanup, race conditions.
- Security Surface: Input validation gaps, injection vectors, authentication/authorization assumptions.
- Spec Gaps Revealed by Implementation: Sometimes writing code reveals incomplete specs. The Adversary looks for implemented behavior not covered by the spec.
Forced Negativity: Sarcasmotron is prompted for zero tolerance. Every piece of feedback is a concrete flaw with a specific location and proposed fix. Fresh context window on every adversarial pass prevents relationship drift.
Phase 4: Feedback Integration Loop
The Adversary's critique feeds back through the entire pipeline:
- Spec-level flaws → Return to Phase 1
- Test-level flaws → Return to Phase 2a
- Implementation-level flaws → Return to Phase 2c
- New edge cases → Add to spec's Edge Case Catalog
This loop continues until convergence.
Phase 5: Formal Hardening
The verification architecture from Phase 1b executes against the battle-tested implementation. Because the codebase was architected with pure core and clear purity boundaries, formal verification tools can operate without heroic refactoring.
Proof Execution: Property specifications (Kani harnesses, Dafny contracts, TLA+ invariants) run against implementation. Failures indicate bugs or spec properties needing refinement.
Fuzz Testing: Structured fuzzing (AFL++, libFuzzer, cargo-fuzz) layers on property-based tests to find unanticipated inputs. The deterministic core is an ideal fuzz target.
Security Hardening: Suites like Wycheproof (cryptographic edge cases) and Semgrep (static analysis) run as CI/CD gates.
Mutation Testing: Tools like mutmut or Stryker mutate code to verify the test suite catches real bugs.
Purity Boundary Audit: Final check that purity boundaries defined in Phase 1b have been respected throughout implementation.
All formal verification and fuzzing results feed back into Phase 4 if issues are found.
Phase 6: Convergence
VSDD inherits VDD's hallucination-based termination, extended across all three dimensions:
- Spec Convergence: Adversary's critiques are nitpicks about wording, not missing behavior or ambiguity
- Test Convergence: Adversary can't identify meaningful untested scenarios; mutation testing confirms high kill rate
- Implementation Convergence: Adversary forced to invent problems that don't exist in code
- Verification Convergence: All properties pass formal proof; fuzzers find nothing; purity boundaries intact
Maximum Viable Refinement is reached when all four dimensions have converged. Software is considered Zero-Slop—every line of code traces to a spec requirement, is covered by a test, has survived adversarial scrutiny, and the critical path is formally proven.
The VSDD Toolchain
Role Architecture
The Architect (Human Developer): Strategic vision, domain expertise, acceptance authority. Signs off on specs, arbitrates disputes between Builder and Adversary.
The Builder (Claude or similar): Spec authorship, test generation, code implementation, refactoring. Operates under strict TDD constraints.
The Tracker (Chainlink): Hierarchical issue decomposition—Epics → Issues → Sub-issues ("beads"). Every spec, test, and implementation maps to a bead.
The Adversary (Sarcasmotron/Gemini): Hyper-critical reviewer with zero patience. Reviews specs, tests, and implementation. Fresh context on every pass.
Full Traceability
One of VSDD's defining properties is full traceability. Every artifact links back:
Spec Requirement → Verification Property → Chainlink Bead → Test Case → Implementation → Adversarial Review → Formal Proof
At any point, you can ask "Why does this line of code exist?" and trace it all the way back to a specific spec requirement, through the verification property it satisfies, the test that demanded it, the adversarial review that hardened it, and the formal proof that guarantees it.
Core Principles
Spec Supremacy: The spec is the highest authority below the human developer. Tests serve the spec. Code serves the tests. Nothing exists without a reason traced to the spec.
Verification-First Architecture: The need for formal provability shapes the design, not the other way around. Pure core, effectful shell. If you can't verify it, you architected it wrong—and you find that out in Phase 1, not Phase 5.
Red Before Green: No implementation code is written until a failing test demands it. AI models are explicitly constrained to follow TDD discipline.
Anti-Slop Bias: The first "correct" version is assumed to contain hidden debt. Trust is earned through adversarial survival, not initial appearance.
Forced Negativity: Adversarial pressure bypasses the politeness filters of standard LLM interactions. The Adversary doesn't care about your feelings—it cares about your invariants.
Linear Accountability: Chainlink beads ensure every spec item, test, and line of code has a corresponding tracked unit of work. Nothing slips through the cracks.
Entropy Resistance: Context resets on every adversarial pass prevent the natural degradation of long-running AI conversations.
Four-Dimensional Convergence: The system isn't done until specs, tests, implementation, and formal proofs have all independently survived adversarial review.
AI Orchestration Notes
VSDD is explicitly designed for multi-model AI workflows:
- The Builder benefits from large context windows and strong code generation (Claude, GPT-4, etc.). It needs to hold the full spec, test suite, and implementation simultaneously.
- The Adversary benefits from a different model or configuration to avoid shared blind spots. Using a different model family (e.g., Gemini as Adversary when Claude is Builder) introduces genuine cognitive diversity.
- The Human is not a bottleneck—they're the strategic layer. They approve specs, resolve disputes, and make judgment calls that AI can't. The human's role is elevated, not diminished, by AI orchestration.
Prompt Engineering for TDD Discipline: The Builder must be explicitly instructed: "You are operating under strict TDD. Write tests FIRST. Do NOT write implementation code until I confirm all tests fail. When implementing, write the MINIMUM code to pass each test." Without this constraint, AI models will naturally try to write implementation and tests simultaneously.
When to Use VSDD
VSDD is high-ceremony by design. It's worth the overhead when:
- Correctness is non-negotiable (financial systems, medical software, infrastructure)
- The codebase will be maintained long-term and must resist entropy
- Multiple AI models are available and the team wants maximum quality extraction
- Security is a primary concern, not an afterthought
- The project complexity justifies formal spec work
For rapid prototyping or throwaway scripts, use the parts that make sense—TDD discipline and a quick adversarial pass can still catch a lot of slop even without the full ceremony.
"VSDD doesn't just generate code—it generates code that can prove why it exists, demonstrate that it works, and survive an adversary that wants it dead."

Comments
Please log in or register to join the discussion