From 93500976b06a8da5ce681e64d6568a5daee652d5 Mon Sep 17 00:00:00 2001 From: Sam Catlow Date: Mon, 21 Sep 2026 11:30:48 +1000 Subject: [PATCH] docs: qualify the red step and require verifying handed-over input Red-green stays the default, but a test that cannot fail for an interesting reason is noise in the gate rather than evidence. Tests that restate an assignment or a constant were being written to satisfy the protocol literally. An empty handed-over export cost a whole autonomous run this session: the tree was reconstructed from instead, on a 131-file change with no context. An unreadable input is a blocking fact, not a gap to fill by inference. --- CLAUDE.md | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index bcd9b7291..389cf2554 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -50,6 +50,10 @@ domain migration. planning/refactor tracking issues. - **Solo Project Context:** Prefer the smallest workable change over extensive defensive scaffolding. +- **Verify handed-over input before acting on it.** An export, transcript, or + artifact that is empty, missing, or truncated is a blocking fact: report it + before starting work that assumes its contents. Never reconstruct the intent + from the working tree instead. - **PRD writing:** Read and follow `docs/prds/RULES.md` before creating or editing a PRD. @@ -258,9 +262,11 @@ structures found in legacy packages. ## Development Protocol -1. **Red (Failing Test):** Write failing test cases first using table-driven - tests against target behaviour. Verify the failure originates from test - assertions, not compilation errors. +1. **Red (Failing Test):** For behaviour with real logic, branching, or a + contract, write failing table-driven tests first against target behaviour. + Verify the failure originates from test assertions, not compilation errors. + Do not write tests that restate an assignment or a constant: a test that + cannot fail for an interesting reason is noise in the gate. 2. **Green (Implementation):** Implement minimal code to satisfy the failing tests. 3. **Quality Gate:** Run `task check`.