Add tdd-gate context, *-code-tdd-repo composites, and TDD task templates

Adds the tdd-gate harness context (TEST_PASS_REQUIRED=true + CLAUDE.md
methodology) and five provider-specific TDD composites that layer
tdd-protect + tdd-gate + python-dev + tdd-file-lock on top of the
existing code-* layer stacks. Matching task templates for sonnet, opus,
haiku, minimax, and airouter. allowed_failing_tests support noted in
warnings pending M19 pre-test hook implementation.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Paul O'Reilly
2026-04-28 13:48:35 +12:00
parent 2b3e4a3e80
commit f392f72ca2
12 changed files with 232 additions and 0 deletions

View File

@@ -0,0 +1,15 @@
kind: composite
name: code-airouter-tdd-repo
version: 1
description: "Airouter Qwen3.6 code agent with TDD enforcement — tests locked read-only, must pass before finish"
layers:
- context: qwen-code-methodology/v1
- context: best-practices/v1
- context: airouter/v1
- context: gitea-ssh/v1
- context: agent-repo/v1
- context: tdd-protect/v1
- context: tdd-gate/v1
- capability: python-dev/v1
- capability: tdd-file-lock/v1

View File

@@ -0,0 +1,14 @@
kind: composite
name: code-haiku-tdd-repo
version: 1
description: "Haiku code agent with TDD enforcement — tests locked read-only, must pass before finish"
layers:
- context: code-methodology/v1
- context: anthropic-cloud/v1
- context: gitea-ssh/v1
- context: agent-repo/v1
- context: tdd-protect/v1
- context: tdd-gate/v1
- capability: python-dev/v1
- capability: tdd-file-lock/v1

View File

@@ -0,0 +1,14 @@
kind: composite
name: code-minimax-tdd-repo
version: 1
description: "MiniMax code agent with TDD enforcement — tests locked read-only, must pass before finish"
layers:
- context: minimax-code-methodology/v1
- context: minimax/v1
- context: gitea-ssh/v1
- context: agent-repo/v1
- context: tdd-protect/v1
- context: tdd-gate/v1
- capability: python-dev/v1
- capability: tdd-file-lock/v1

View File

@@ -0,0 +1,14 @@
kind: composite
name: code-opus-tdd-repo
version: 1
description: "Opus code agent with TDD enforcement — tests locked read-only, must pass before finish"
layers:
- context: code-methodology/v1
- context: anthropic-cloud/v1
- context: gitea-ssh/v1
- context: agent-repo/v1
- context: tdd-protect/v1
- context: tdd-gate/v1
- capability: python-dev/v1
- capability: tdd-file-lock/v1

View File

@@ -0,0 +1,14 @@
kind: composite
name: code-sonnet-tdd-repo
version: 1
description: "Sonnet code agent with TDD enforcement — tests locked read-only, must pass before finish"
layers:
- context: code-methodology/v1
- context: anthropic-cloud/v1
- context: gitea-ssh/v1
- context: agent-repo/v1
- context: tdd-protect/v1
- context: tdd-gate/v1
- capability: python-dev/v1
- capability: tdd-file-lock/v1

View File

@@ -0,0 +1,34 @@
# TDD Gate — Tests Must Pass
You are operating in TDD mode. The test suite defines correctness. **You must not finish until all tests pass.**
## Rules
1. **Run the full test suite before committing.** Every change must be followed by a test run.
2. **A red test suite is not acceptable output.** If tests fail, keep working.
3. **Never skip, comment out, or delete tests.** Tests are read-only (OS-enforced). Any attempt to modify them will fail.
4. **Never use `pytest --ignore`, `-k "not ..."`, or `--deselect` to hide failures.** The passing criterion is `pytest` with no filters.
5. **Fix the implementation, not the tests.** If a test looks wrong, you are wrong.
6. **Commit only when green.** The finalize phase checks `TEST_PASS_REQUIRED=true` — a failing suite will fail the task.
## Workflow
```bash
# Run tests to see current state
python -m pytest tests/ -v --tb=short
# Implement until green
# ... edit source files ...
python -m pytest tests/ -v --tb=short
# Only when all green:
# finalize will commit and push via agent-repo
```
## If you are stuck
- Read the failing test to understand exactly what it expects
- Read the spec (if present at `/workspace/project/spec/`) for the subsystem under test
- Check the error message carefully — most failures have a clear root cause
- Do not attempt workarounds that hide failures; fix the underlying behaviour

View File

@@ -0,0 +1,13 @@
kind: context
name: tdd-gate
version: 1
description: "TDD enforcement: agent must get all tests passing before finishing. Compose on top of code-methodology."
requires: []
provides: [tdd-gate]
env:
TEST_PASS_REQUIRED: "true"
context_files:
- source: ./CLAUDE.md
target: /opt/harness/context/tdd-gate/CLAUDE.md