When a coding agent marks a subtask as "stuck", QA validation would never
start because is_build_complete() requires ALL subtasks to have status
"completed". This creates a deadlock: coder exits (no more subtasks to
work on), but QA never triggers.
Changes:
- Add is_build_ready_for_qa() that considers builds ready when all
subtasks reach a terminal state (completed, failed, or stuck)
- Update mark_subtask_stuck() to also set status="failed" in
implementation_plan.json, keeping plan file in sync with reality
- Reorder QA loop to check human feedback before build completeness,
so QA_FIX_REQUEST.md bypasses the build gate as intended
- Replace is_build_complete() with is_build_ready_for_qa() in
should_run_qa() and CLI qa commands
- Add 20 new tests covering is_build_ready_for_qa() edge cases and
mark_subtask_stuck() plan update behavior
Co-Authored-By: Claude Opus 4.6 <[email protected]>