fix: BACKLOG_NUMS array in supervisor-poll.sh is never queried (#110)

The BACKLOG_NUMS associative array was built to track which issue numbers
are in the backlog, but the DFS cycle-detection code used NODE_COLOR as
a membership guard instead. This meant deps pointing to non-backlog issues
were only skipped by coincidence (they weren't in NODE_COLOR either).

Three changes:
- Remove SC2034 suppression since BACKLOG_NUMS is now actually queried
- Initialize NODE_COLOR from BACKLOG_NUMS keys (all backlog issues) instead
  of DEPS_OF keys (only issues with dependencies), so every backlog issue
  gets a proper DFS color
- Replace the NODE_COLOR membership check with BACKLOG_NUMS in the DFS, so
  the guard explicitly asks "is this dep a backlog issue?" rather than
  relying on NODE_COLOR initialization as a proxy

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
openhands 2026-03-23 08:16:13 +00:00
parent 6744429fe1
commit fbe645a305

View file

@ -467,12 +467,11 @@ check_project() {
BODY=$(echo "$BACKLOG_FOR_DEPS" | jq -r ".[$i].body // \"\"")
ISSUE_DEPS=$(echo "$BODY" | bash "$PARSE_DEPS" | grep -v "^${NUM}$" || true)
[ -n "$ISSUE_DEPS" ] && DEPS_OF[$NUM]="$ISSUE_DEPS"
# shellcheck disable=SC2034
BACKLOG_NUMS[$NUM]=1
done
declare -A NODE_COLOR
for node in "${!DEPS_OF[@]}"; do NODE_COLOR[$node]=0; done
for node in "${!BACKLOG_NUMS[@]}"; do NODE_COLOR[$node]=0; done
FOUND_CYCLES=""
declare -A SEEN_CYCLES
@ -481,7 +480,7 @@ check_project() {
local node="$1" path="$2"
NODE_COLOR[$node]=1
for dep in ${DEPS_OF[$node]:-}; do
[ -z "${NODE_COLOR[$dep]+x}" ] && continue
[ -z "${BACKLOG_NUMS[$dep]+x}" ] && continue
if [ "${NODE_COLOR[$dep]}" = "1" ]; then
local cycle_key
cycle_key=$(echo "$path $dep" | tr ' ' '\n' | sort -n | tr '\n' ' ')