fix(tracker): scan candidates independent of --limit; validate --status column (#66, #67) - #68
Merged
Merged
Conversation
…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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #66. Closes #67.
Two related bugs in
scripts/rig-tracker.shverb_select, both surfacing as a silent empty result that reads like "no work" when there is work / the config is wrong.#66 —
--limittruncated candidates before the intersectionverb_selectfetched both sources — the per-label issue queries and the board column — with the result--limit, then intersected. So--limitmeant "consider N candidates", not "return N results", andnext(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,nextreturned[]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>.#67 —
select --status <name>silently[]for a non-existent columnThe status was used only as a client-side
jqequality 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-statusalready validates option names;selectdidn't.Fix:
assert_valid_statuschecks the name against the field's real options (same sourceset-statususes) 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 mockghnow honors--limitand answersproject field-list, and the board returns a non-Todo item first so the truncation is observable. Added:nextfinds the dispatchable item even though it isn't first on the board.In Review) is a clean[]/ exit 0.Verified these 3 assertions fail on the pre-fix script and pass after (13/13 green with the fix).
🤖 Generated with Claude Code