fix(stage): approved verdict advances analysis->architecture instead of re-running gate #15

Merged
admin merged 1 commits from fix/approved-advances-stage into main 2026-06-03 23:31:46 +03:00
Owner

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).

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).
admin added 1 commit 2026-06-03 23:30:38 +03:00
admin merged commit b6aa107f93 into main 2026-06-03 23:31:46 +03:00
Sign in to join this conversation.
No Reviewers
No Label
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: admin/orchestrator#15