Skip to content

fix(tracker): scan candidates independent of --limit; validate --status column (#66, #67) - #68

Merged
pgebheim merged 1 commit into
mainfrom
fix/66-67-rig-tracker-select
Aug 9, 2026
Merged

pgebheim merged 1 commit into
mainfrom
fix/66-67-rig-tracker-select

Conversation

@pgebheim

@pgebheim pgebheim commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

Closes #66. Closes #67.

Two related bugs in scripts/rig-tracker.sh verb_select, both surfacing as a silent empty result that reads like "no work" when there is work / the config is wrong.

#66--limit truncated candidates before the intersection

verb_select fetched both sources — the per-label issue queries and the board column — with the result --limit, then intersected. So --limit meant "consider N candidates", not "return N results", and next (hardcoded --limit 1) pulled one issue per shape label and one board item; their intersection is empty unless that single board item happens to be the dispatchable one. On a real board, next returned [] with dispatchable work sitting in Todo.

Fix: decouple scan depth from result count. Pull SCAN_DEPTH (default 500, RIG_TRACKER_SCAN-overridable) rows from each source, intersect, then return the first <limit>.

#67select --status <name> silently [] for a non-existent column

The status was used only as a client-side jq equality filter, so a column name not on the board (a typo, or drift after a Projects column rename) matched zero rows → [], exit 0 — indistinguishable from "no work in that column". set-status already validates option names; select didn't.

Fix: assert_valid_status checks the name against the field's real options (same source set-status uses) and dies otherwise. A valid-but-empty column still returns [] / exit 0 — the two cases are now distinguishable.

Tests

scripts/rig-tracker.test.ts: the mock gh now honors --limit and answers project field-list, and the board returns a non-Todo item first so the truncation is observable. Added:

Verified these 3 assertions fail on the pre-fix script and pass after (13/13 green with the fix).

🤖 Generated with Claude Code

…us column (#66, #67)

verb_select pulled both candidate sets — the label queries and the board
column — with the result --limit, then intersected. So --limit meant "consider
N candidates", not "return N results", and `next` (hardcoded --limit 1) fetched
one issue per shape label and one board item, whose intersection is empty
unless that single board item happens to be the dispatchable one. Real boards
returned [] with dispatchable work sitting in Todo. (#66)

Decouple the two: pull SCAN_DEPTH (default 500, RIG_TRACKER_SCAN-overridable)
rows from each source, intersect, THEN return the first <limit>. --limit is
now purely the result count.

Separately, `select --status <name>` used the status only as a client-side jq
equality filter, so a column name that isn't on the board (a typo, or drift
after someone renames a Projects column) returned [] with exit 0 —
indistinguishable from "no work in that column". Validate the name against the
field's real options first and die otherwise, the same resolution set-status
already uses for writes. A valid-but-empty column still returns [] / exit 0. (#67)

Tests: the mock gh now honors --limit and answers project field-list, and the
board returns a non-Todo item first so the truncation is observable. Added a
#66 regression (next finds the dispatchable item though it isn't first) and #67
cases (unknown column errors; valid-but-empty column is a clean []). Verified
these 3 assertions fail on the pre-fix script and pass after.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0157AoJ6PVpKyt5V8GCVrodf
@pgebheim
pgebheim merged commit 8e5bd7b into main Aug 9, 2026
2 checks passed
@pgebheim
pgebheim deleted the fix/66-67-rig-tracker-select branch August 9, 2026 06:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

1 participant