fix: bug: dev-poll stale detection ignores label scope — relabels in-progress bug-reports as blocked (#608)
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:
parent
17ad07f436
commit
a0da97113b
2 changed files with 27 additions and 18 deletions
|
|
@ -439,12 +439,14 @@ if [ "$ORPHAN_COUNT" -gt 0 ]; then
|
|||
OPEN_PR=true
|
||||
fi
|
||||
|
||||
# Skip vision-labeled issues — they are managed by architect agent, not dev-poll
|
||||
# Skip issues owned by non-dev agents (bug-report, vision, prediction, etc.)
|
||||
# See issue #608: dev-poll must only touch issues it could actually claim.
|
||||
issue_labels=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" \
|
||||
"${API}/issues/${ISSUE_NUM}" | jq -r '[.labels[].name] | join(",")')
|
||||
if echo "$issue_labels" | grep -q "vision"; then
|
||||
log "issue #${ISSUE_NUM} has 'vision' label — skipping stale detection (managed by architect)"
|
||||
BLOCKED_BY_INPROGRESS=true
|
||||
if ! issue_is_dev_claimable "$issue_labels"; then
|
||||
log "issue #${ISSUE_NUM} has non-dev label(s) [${issue_labels}] — skipping (owned by another agent)"
|
||||
BLOCKED_BY_INPROGRESS=false
|
||||
OTHER_AGENT_INPROGRESS=true
|
||||
fi
|
||||
|
||||
# Check if issue has an assignee — only block on issues assigned to this agent
|
||||
|
|
@ -505,20 +507,6 @@ if [ "$ORPHAN_COUNT" -gt 0 ]; then
|
|||
fi
|
||||
fi
|
||||
|
||||
# Formula guard: formula-labeled issues should not be worked on by dev-agent.
|
||||
# Remove in-progress label and skip to prevent infinite respawn cycle (#115).
|
||||
if [ "$BLOCKED_BY_INPROGRESS" = false ]; then
|
||||
ORPHAN_LABELS=$(echo "$ORPHANS_JSON" | jq -r '.[0].labels[].name' 2>/dev/null) || true
|
||||
SKIP_LABEL=$(echo "$ORPHAN_LABELS" | grep -oE '^(formula|prediction/dismissed|prediction/unreviewed)$' | head -1) || true
|
||||
if [ -n "$SKIP_LABEL" ]; then
|
||||
log "issue #${ISSUE_NUM} has '${SKIP_LABEL}' label — removing in-progress, skipping"
|
||||
IP_ID=$(_ilc_in_progress_id)
|
||||
curl -sf -X DELETE -H "Authorization: token ${FORGE_TOKEN}" \
|
||||
"${API}/issues/${ISSUE_NUM}/labels/${IP_ID}" >/dev/null 2>&1 || true
|
||||
BLOCKED_BY_INPROGRESS=true
|
||||
fi
|
||||
fi
|
||||
|
||||
# Check if there's already an open PR for this issue
|
||||
if [ "$BLOCKED_BY_INPROGRESS" = false ]; then
|
||||
HAS_PR=$(curl -sf -H "Authorization: token ${FORGE_TOKEN}" \
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue