Generated code can look plausible while missing requirements or failing on cases the prompt left unspecified. The Task/Verify gate replaces dump-and-review with verify-then-merge: an agent implements a small task against a contract, and the pipeline—not a human reading of the diff—decides whether it passes. section 1.3 section 1.4
Use the gate as part of an iterative workflow:
- Explore first, then turn what you learn into an executable specification and a reviewed plan. Break the plan into tasks small enough to verify individually. section 1.3
- Have the agent implement each task against the contract, tests first. Use the pipeline result to determine whether the task passed. section 1.3
- After verification, refactor the working solution into the team’s own terms. The goal is code the team can explain and maintain without relying on the generation transcript. section 1.3
Verify an ISBN validator
A prompt asks for a Python function that validates 13-digit ISBNs, with or without hyphens, and returns a boolean. Repeating the prompt can produce different implementations: one supplied retry rejects hyphenated input and refers to an undefined variable. Tests for valid inputs in both formats, an invalid checksum, invalid length, and nonnumeric characters make several expectations explicit before accepting the result. section 1.4
import pytest
# Assume is_valid_isbn13 is the function to be generated
def test_valid_isbn_with_hyphens():
assert is_valid_isbn13("978-0-306-40615-7") is True
def test_valid_isbn_without_hyphens():
assert is_valid_isbn13("9780306406157") is True
def test_invalid_checksum():
assert is_valid_isbn13("978-0-306-40615-0") is False
def test_invalid_length():
assert is_valid_isbn13("978-0-306-40615") is False
def test_contains_non_numeric_characters():
assert is_valid_isbn13("978-0-306-40615-X") is FalseThe pytest cases turn the ISBN requirements into checks for the verification gate. section 1.4
A passing gate checks the task against its stated contract; it does not replace the later work of understanding and owning the code. Keep prompts, outputs, and specifications as owned artifacts so the remaining trust debt stays visible. section 1.3 section 1.4
