fix: bug: dev-poll stale detection ignores label scope — relabels in-progress bug-reports as blocked (#608)
All checks were successful
ci/woodpecker/push/ci Pipeline was successful
ci/woodpecker/pr/ci Pipeline was successful

Add issue_is_dev_claimable() helper to lib/issue-lifecycle.sh that checks
whether an issue's labels are compatible with dev-agent ownership. Labels
like bug-report, vision, in-triage, prediction/*, action, and formula
indicate another agent owns the issue.

In dev-poll.sh, replace the vision-only skip with the new helper so that
ALL non-dev labels are excluded from stale detection. This prevents
dev-poll from relabeling bug-reports (or other agent-owned issues) as
blocked while they are being triaged.

Also removes the now-redundant formula/prediction guard block in the
orphan section, since issue_is_dev_claimable covers those labels.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Claude 2026-04-10 18:10:58 +00:00
parent 17ad07f436
commit a0da97113b
2 changed files with 27 additions and 18 deletions

View file

@ -79,6 +79,27 @@ _ilc_backlog_id() { _ilc_ensure_label_id "backlog" "#0075ca"; }
_ilc_in_progress_id() { _ilc_ensure_label_id "in-progress" "#1d76db"; }
_ilc_blocked_id() { _ilc_ensure_label_id "blocked" "#e11d48"; }
# ---------------------------------------------------------------------------
# Labels that indicate an issue belongs to a non-dev agent workflow.
# Any issue carrying one of these should NOT be touched by dev-poll's
# stale-detection or orphan-recovery logic. See issue #608.
# ---------------------------------------------------------------------------
_ILC_NON_DEV_LABELS="bug-report vision in-triage prediction/unreviewed prediction/dismissed action formula"
# issue_is_dev_claimable COMMA_SEPARATED_LABELS
# Returns 0 if the issue's labels are compatible with dev-agent ownership,
# 1 if any non-dev label is present (meaning another agent owns this issue).
issue_is_dev_claimable() {
local labels="$1"
local lbl
for lbl in $_ILC_NON_DEV_LABELS; do
if echo ",$labels," | grep -qF ",$lbl,"; then
return 1
fi
done
return 0
}
# ---------------------------------------------------------------------------
# issue_claim — assign issue to bot, add "in-progress" label, remove "backlog".
# Args: issue_number