perf: extract item selection into bin/pick-item#154
Merged
Conversation
gringolito
commented
Jun 16, 2026
Comment on lines
+250
to
+253
| winner_view=$(gh issue view "$winner_num" \ | ||
| --json number,title,body,labels,milestone,url 2>&1) || { | ||
| echo "Failed to fetch details for issue #${winner_num}: $winner_view" >&2; exit 1 | ||
| } |
Owner
Author
There was a problem hiding this comment.
Don't you have this information from the previous calls? I'm under the impression that we are doing unnecessary API calls
Owner
Author
There was a problem hiding this comment.
Correct — number, title, labels, milestone, and url are all already available from the project item-list data. Now saves the winning item in winner_item during the candidate walk, then fetches only body via gh issue view --json body. The gh issue view call is down from 6 JSON fields to 1.
| #!/usr/bin/env bats | ||
|
|
||
| setup() { | ||
| REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)" |
Owner
Author
There was a problem hiding this comment.
Suggested change
| REPO_ROOT="$(cd "$(dirname "$BATS_TEST_FILENAME")/.." && pwd)" | |
| REPO_ROOT="$(dirname "$(dirname "$BATS_TEST_FILENAME")")" |
gringolito
added a commit
that referenced
this pull request
Jun 16, 2026
- Move assignee:@me and -label:type:external-blocker filtering server-side; remove redundant jq post-filters - Drop gh api user fetch — no longer needed after server-side assignee filtering - Fetch only body from gh issue view; reuse project item-list data for number/title/labels/milestone/url (saves 5 redundant fields) - Save winner_item during candidate walk so section 7 can build candidate_out without re-fetching already-available fields - Fix step numbering in execute-item SKILL.md: 2.5→2, 2.6→3, 3→4 … 11→12; update all cross-references - Simplify REPO_ROOT to nested dirname calls (no subshell cd) - Update test mock to simulate server-side external-blocker filtering; simplify AC7b fixture to reflect assignee:@me scope Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Filipe Utzig <filipe@gringolito.com>
gringolito
commented
Jun 16, 2026
gringolito
added a commit
that referenced
this pull request
Jun 16, 2026
- Move assignee:@me and -label:type:external-blocker filtering server-side; remove redundant jq post-filters - Drop gh api user fetch — no longer needed after server-side assignee filtering - Fetch only body from gh issue view; reuse project item-list data for number/title/labels/milestone/url (saves 5 redundant fields) - Save winner_item during candidate walk so section 7 can build candidate_out without re-fetching already-available fields - Fix step numbering in execute-item SKILL.md: 2.5→2, 2.6→3, 3→4 … 11→12; update all cross-references - Simplify REPO_ROOT to nested dirname calls (no subshell cd) - Update test mock to simulate server-side external-blocker filtering; simplify AC7b fixture to reflect assignee:@me scope Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Filipe Utzig <filipe@gringolito.com>
32f333a to
a278696
Compare
Steps 1–2.6 of execute-item (milestone resolution, in-progress check, candidate selection, block-skipping, sub-issue check) are now deterministic bash rather than inline AI prose. execute-item delegates to bin/pick-item and consumes the JSON output; AI reasoning resumes at Step 3 (INVEST validation). Includes bats test suite (13 tests) covering all 9 acceptance criteria, wired into CI as a test stage that gates the validate-plugin job. Refs #141 Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Filipe Utzig <filipe@gringolito.com>
- Move assignee:@me and -label:type:external-blocker filtering server-side; remove redundant jq post-filters - Drop gh api user fetch — no longer needed after server-side assignee filtering - Fetch only body from gh issue view; reuse project item-list data for number/title/labels/milestone/url (saves 5 redundant fields) - Save winner_item during candidate walk so section 7 can build candidate_out without re-fetching already-available fields - Fix step numbering in execute-item SKILL.md: 2.5→2, 2.6→3, 3→4 … 11→12; update all cross-references - Simplify REPO_ROOT to nested dirname calls (no subshell cd) - Update test mock to simulate server-side external-blocker filtering; simplify AC7b fixture to reflect assignee:@me scope Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Filipe Utzig <filipe@gringolito.com>
a278696 to
cc65cd9
Compare
gh project item-list already returns .content.body — no need for a separate gh issue view call. Remove the fetch, use .content.body from winner_item directly, and add body to all test fixtures. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Filipe Utzig <filipe@gringolito.com>
The live GitHub Projects API returns labels, milestone, linked pull requests, and assignees at the item top level — not under .content. Also, labels are string arrays and linked PRs are URL strings. Fix field paths in in_progress and candidate_out construction, update all test fixtures to match, and fix the mock's label filter accordingly. Also remove select(.type == "ISSUE") — the live API returns type:null; the is:issue query filter already guarantees issue-only results. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Signed-off-by: Filipe Utzig <filipe@gringolito.com>
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.
Summary
execute-item(milestone resolution, in-progress resume check, candidate selection, block-skipping, sub-issue check) into a new deterministic bash scriptbin/pick-itemexecute-itemnow delegates tobin/pick-itemand consumes its JSON output; AI reasoning resumes at Step 3 (INVEST validation)tests/pick-item.bats, 13 tests) covering all 9 acceptance criteria, wired into CI as a paralleltestjobCloses #141
🤖 Generated with Claude Code