Files
stack/docs/scratchpads/149-test-rejection-loop.md
Jason Woltje ac3f5c1af9 test(#149): Add comprehensive rejection loop integration tests
Add integration tests validating rejection loop behavior:
- Agent claims done with failing tests → rejection + forced continuation
- Agent claims done with linting errors → rejection + forced continuation
- Agent claims done with low coverage → rejection + forced continuation
- Agent claims done with build errors → rejection + forced continuation
- All gates passing → completion allowed
- Multiple simultaneous failures → comprehensive rejection
- Continuation prompts are non-negotiable and directive
- Agents cannot bypass quality gates
- Remediation steps included in prompts

All 9 tests pass.
Build gate: passes
Lint gate: passes
Test gate: passes (100% pass rate)
Coverage: quality_orchestrator.py at 85%, forced_continuation.py at 100%

Refs #149

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-01 20:11:15 -06:00

1.3 KiB

Issue #149: [COORD-009] Test rejection loop

Objective

Validate quality gates prevent premature completion through simulated rejection scenarios.

Approach

  1. Create comprehensive integration tests for rejection loop scenarios
  2. Test each gate failure type triggers proper rejection
  3. Verify forced continuation prompts are generated correctly
  4. Ensure agents cannot bypass gates
  5. Validate loop continues until all gates pass

Test Scenarios

  • Agent claims done with failing tests
  • Agent claims done with linting errors
  • Agent claims done with low coverage
  • Agent claims done with build errors
  • All gates passing allows completion
  • Multiple simultaneous gate failures handled correctly
  • Forced continuation prompts are non-negotiable and actionable

Progress

  • Read existing QualityOrchestrator and ForcedContinuationService code
  • Write comprehensive integration tests (TDD)
  • Run tests - all 9 tests pass
  • Fix linting issues
  • Run type checking - passes
  • All quality gates pass
  • Commit changes

Testing

Test file: apps/coordinator/tests/test_rejection_loop.py

Notes

The services already exist from Issue 148, so this is primarily testing the rejection loop behavior through integration tests that simulate agent completion scenarios.