From 069276b8ee1624397987a3d3e813d13088e606db Mon Sep 17 00:00:00 2001 From: Amr Gharbeia Date: Tue, 5 May 2026 09:07:42 -0400 Subject: [PATCH] agents: require red-proof in TDD cycle --- AGENTS.md | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/AGENTS.md b/AGENTS.md index fd3b16e..0e8c3ad 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -8,9 +8,11 @@ It is read by agents working on the Memex / Passepartout project. All development MUST follow this cycle, beginning to end: 1. **Start in REPL** — Everything begins and ends in the Passepartout REPL (port 9105) -2. **TDD in REPL**: - 1. Write a test (use `passepartout: deftest` or equivalent) - 2. Run the test → it should FAIL +2. **TDD in REPL** — Red-Green-Refactor cycle: + 1. Write a FAILING test first (use `(passepartout:deftest name ...)` or `fiveam:test`) + 2. **Prove RED**: Run `(passepartout:run-test 'test-name)` — it MUST fail. + If it passes before code exists, the test is broken or testing nothing. + Record the failure output. 3. Develop code in REPL to make the test pass 4. Use lisp-structural-check to validate code while developing 5. Evaluate forms with `eval-defun` or equivalent @@ -140,6 +142,7 @@ The TUI process has its own REPL for live development: ## When Done Means +- Red proof recorded: Test was run and confirmed FAILING before implementation code existed - Tests pass: `(passepartout:run-tests)` returns success - Code validated: `lisp-structural-check` returns `(values t nil)` - Org reflected: Code exists in .org source file @@ -148,7 +151,7 @@ The TUI process has its own REPL for live development: ## Boundaries -- **Always do**: Use REPL first for all development, use TDD, validate with lisp-structural-check +- **Always do**: Use REPL first for all development, use TDD, prove tests fail FIRST before writing code, validate with lisp-structural-check - **Ask first**: Before editing .lisp directly (skip org), before deploying, before git commit - **Never do**: Edit .lisp files manually (they're autogenerated), skip validation before commit