fix(reconciler): skip escalated / Blocked / Needs-Input tasks in F-1 (ORCH-060) #60
Reference in New Issue
Block a user
Delete Branch "feature/ORCH-060-reconciler-escalated-max-retri"
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?
Summary
developer_retry_count(task_id) >= MAX_DEVELOPER_RETRIES. Promotesstage_engine._developer_retry_countto publicdeveloper_retry_count(single source of truth; private alias kept); limit read from the constant, never a literal3. Closes the ET-013 infinite-bounce loop (green CI + reviewer REQUEST_CHANGES at the cap re-unblocked every tick).plane_sync.fetch_issue_state+Reconciler._is_blocked_or_needs_input; issue in Plane Blocked / Needs Input -> skip. Any error / None / unresolved project -> conservative skip. New sub-flagORCH_RECONCILE_SKIP_BLOCKED_ENABLEDmutes only the networked Guard 2 (Guard 1 always active)._reconcile_gate_taskAFTER the existing analysis/no-gate/active-job/grace guards and BEFORE the gate pre-evaluation; silent skip (no advance, nounblocked_total, no notifications).{in_progress, approved, rejected}-> never replayed (regression test).STAGE_TRANSITIONS,QG_CHECKS, never-raise per unit of work,analysiscarve-out, kill-switches.docs/architecture/README.md,README.md+.env.example(new flag),CHANGELOG.md. ADR:docs/work-items/ORCH-060/06-adr/ADR-001-reconciler-skip-escalated.md.Test plan
pytest tests/test_reconciler.py -q- 27 passed (15 ORCH-053 regression + 12 new TC-01..TC-11)pytest tests/ -q- 644 passed, 0 regressionsGenerated with Claude Code
Reconciler F-1 could not tell "stuck by a lost webhook" from "escalated: max developer retries reached, waiting for a human". With CI green and a reviewer that kept sending REQUEST_CHANGES up to the cap, every tick re-unblocked development -> review -> rollback -> re-unblock (incident ET-013, infinite bounce: wasted agent runs, Telegram spam, parasitic load on the shared self-hosting instance). Add two pre-gate guards in Reconciler._reconcile_gate_task (after the existing analysis/no-gate/active-job/grace guards, before the gate pre-evaluation), each an early silent return (no advance, no unblocked_total increment, no notifications): - Guard 1 (escalated, deterministic, no network, checked first): developer_retry_count(task_id) >= MAX_DEVELOPER_RETRIES. Promote stage_engine._developer_retry_count to public developer_retry_count (single source of truth; private alias kept). Limit from the constant, not a literal 3. - Guard 2 (explicit human Plane gate, Variant A, no DB migration): new never-raise plane_sync.fetch_issue_state + Reconciler._is_blocked_or_needs_input; any error/None/unresolved project -> conservative skip. New sub-flag ORCH_RECONCILE_SKIP_BLOCKED_ENABLED mutes only the networked Guard 2. F-2 unchanged: Blocked/Needs Input are outside {in_progress, approved, rejected} so they are never replayed (regression test added). DB schema, STAGE_TRANSITIONS, QG_CHECKS, never-raise, analysis carve-out and kill-switches untouched. Refs: ORCH-060 Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>