Fix: SDD TDD Agent — Assertion Quality Enforcement
The SDD apply agent was generating trivial tests that gave false confidence:
expect(true).toBe(true)— tautologies that prove nothing- Assertions over empty arrays (
queryAllByTestIdreturning[]) inside loops that never iterate - Stopping at GREEN without triangulating (incomplete TDD cycle)
Changes
sdd-apply/strict-tdd.md
- Added Assertion Quality Rules section with explicit banned patterns: tautologies, orphan empty checks, type-only assertions, ghost loops, incomplete TDD cycles
- Defined What Makes a REAL Assertion (3 criteria: calls production code, asserts specific value, breaks when logic changes)
- Empty Collection Rule:
toEqual([])only valid with precondition + companion non-empty test - Tightened triangulation: minimum 2 test cases per behavior, skip ONLY for purely structural tasks
- Trivial GREEN detection: warns about tests passing because setup doesn't exercise the code path
sdd-verify/strict-tdd-verify.md
- Added Step 5f: Assertion Quality Audit — scans test files for all banned patterns
- Ghost loops (assertions inside
forover emptyqueryAllresults) flagged as CRITICAL - Incomplete TDD cycles (component not rendered due to state) flagged as CRITICAL
- Checks triangulation variance — warns if all test cases assert the same trivial value
- New Assertion Quality Report Table in verification output
Evidence: prowler-cloud/prowler#10517