Repository navigation
Add human-owned acceptance tests - #24
Merged
Merged
Conversation
Generated tests come from the same model as the code, so passing them only shows the model agrees with itself. A spec can now list hand-written test files under `acceptance:`; they are the contract. - Agents see them in every prompt and can never write them (they sit outside output_dir or are untracked files, both already off limits). - They run after the generated tests as acceptance_command (default test_command) with their paths appended; a failure goes to repair with the instruction to fix the code. - Their contents are part of the node fingerprint, so editing one marks the spec stale. - build refuses when a listed file is missing; validate reports it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FAykpfqqWA2GFjcC1p6FRy
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The same model writes the code and the generated tests, so passing them only shows the model agrees with itself. The example audit (
docs/example-audit.md) found many failures came from details the spec left open. Acceptance tests let the spec's author pin those details down.output_dir(path-escape check) or are untracked existing files (ownership check). A test covers this.acceptance_command(new; defaults totest_command) with their paths appended. A failure goes to repair labelled "Hand-written acceptance tests failed (fix the code)". The repair and test skills explain how to treat them.status.buildrefuses when a listed file is missing or no test command is configured.validatereports missing files.Writing acceptance tests before building makes
specdiff buildtest-driven.Testing
pytest tests/: 206 passed. New tests cover the parser, fingerprinting, the runner (a real pytest run where a failing acceptance test drives repair until it passes, write protection, and missing-file refusal), andvalidate.ruff check/ruff format --check: cleanGenerated by Claude Code