fix(stage): approved verdict advances analysis->architecture instead of re-running gate #15
Reference in New Issue
Block a user
Delete Branch "fix/approved-advances-stage"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
BUG 4 (blocker): a manual Approved STATUS from analysis did not advance the pipeline to architecture (task stuck in analysis, architect never enqueued).
Root: advance_stage() always took an early return inside the check_analysis_approved branch via _handle_analysis_approved_flow, which on the webhook path (finished_agent=None) did nothing -> the Advance block was unreachable. Additionally check_analysis_approved looks for an :approved: COMMENT, so even falling through to _run_qg would block a status-only approval.
Fix: split the check_analysis_approved branch by agent. Launcher path (agent==analyst) keeps In Review + comment behavior. Webhook Approved-verdict path (agent is None) treats the Plane status flip as the approval, marks the gate passed WITHOUT re-running it, and falls through to the generic Advance block (update_task_stage->architecture + enqueue_job(architect via get_agent_for_stage(analysis))).
Tests: +2 (test_approved_verdict_advances_analysis_to_architecture, test_launcher_path_does_not_advance_and_calls_flow). Suite: 210 passed + 9 pre-existing test_webhooks HMAC/401 failures (unchanged baseline).