Repository navigation
Description
Goal
Comments, SubIssues, listIssues and every other first-page read in internal/tracker page through the whole listing, so a milestone issue past a hundred comments keeps its newest QA verdicts and milestone close cannot report VERDICT_MISSING for a verdict on page two; each paginated reader is tested against a synthetic listing longer than one page. Adopts #264.
Requirements
M15-R3
Adopts
- Backlog capture: first-page reads drop the newest comments, verdicts and sub-issues past 100 #264 — Backlog capture: first-page reads drop the newest comments, verdicts and sub-issues past 100
Plan
The change. internal/tracker/github.go — the four unpaginated listing reads get gh api --paginate, which merges a REST array endpoint's pages into one JSON array (checked against this repo's own labels and pulls endpoints on gh 2.100), so gh.JSON unmarshals the whole listing exactly as it already does for Labels:
Comments— GitHub's oldest-first order is preserved across pages, somilestone closeandstatussee the newest verdicts and latest-wins is computed over the whole issue;SubIssues— a milestone past a hundred tasks lists all of them;listIssues— behindMilestoneIssues/listMilestones; it grows a paginate flag becauseRecentIssuesshares it;OpenPRsForBranch— the stale sweep's keep-a-branch-under-an-open-PR check.
Two deliberate exceptions, each stated in a code comment and in the PR. RecentIssues reads the newest page by design (the floor fallback, #195) — walking a repo's whole history to build a floor buys nothing. TaskBranches reports hasNextPage and its callers already say "swept in part" (SPEC §6); #310 builds on that flag this milestone.
Out of scope, recorded as a Decision. The GraphQL first: N connections (ClosingPRs, LinkedBranches, Task's assignees/labels/closing refs) are per-issue relations bounded far under their limits, not listings.
Tests. A gh fake that pages the way the real one does — the whole listing only when the call carried --paginate, the first hundred otherwise — so a reader that drops the flag fails rather than passing on a short fixture. A 101-comment fixture for Comments asserting every comment arrives, in order, with the newest present and last; two-page fixtures for SubIssues, listIssues (through MilestoneIssues) and OpenPRsForBranch; and RecentIssues asserted to stay unpaginated.
SPEC. No change: git grep -n "hundred\|per_page\|first page\|one page" finds no sentence implying a hundred-comment ceiling, and the only partial-listing language in §6 is TaskBranches's "swept in part", which stays true. Pagination is an implementation correction, not a protocol change.
Requirements covered. M15-R3 (adopts #264).
Ask-the-human points
None. Which mechanism each reader uses — --paginate or a GraphQL cursor — is an ordinary engineering call and is recorded as a Decision.
Activity
radiusred-cody commentedon Sep 6, 2026
Started by @radiusred-cody[bot].
radiusred-cody commentedon Sep 7, 2026
Decision: all four readers page with
gh api --paginaterather than a GraphQL cursor.Trade-off:
--paginatecosts one flag per call and no new code — gh follows theLinkheader and joins a REST array endpoint's pages into a single JSON array, in request order, sogh.JSONunmarshals the whole listing exactly as it already does forLabels, andCommentsstays oldest-first across the boundary. I checked the join against this repo's ownlabelsandpullsendpoints on gh 2.100 before relying on it, including the-X GET -f …formOpenPRsForBranchuses. The cost is that the call is unbounded: a pathological listing is now several requests instead of one truncated read, which is the correct trade for a gate that must not miss a verdict.Rejected: hand-rolled cursor loops in Go (a
page=walk, or moving these reads to GraphQLafter:). Each would add paging state and an end condition per reader, in a package whose founding decision is that gh owns the transport (docs/founding-decisions.md); the one listing already paginated in this file set the precedent, and matching it keeps four readers on one mechanism.radiusred-cody commentedon Sep 7, 2026
Decision: the GraphQL
first: Nconnections in the tracker are left as they are, and are not counted as first-page listing reads under M15-R3.Trade-off:
ClosingPRs(first: 20),LinkedBranches(first: 20) andTask's nestedassignees(first: 10)/labels(first: 20)/closedByPullRequestsReferences(first: 10)are per-issue relations, not repository listings: an issue with twenty-one closing PRs or eleven assignees is not a shape the protocol produces, and every one of them is read for a yes/no (is a PR open, which branch is linked) rather than for a set that must be complete. Paginating them would add cursor loops with no reachable failure to prevent. The listing reads that #264 actually observed truncating — comments, sub-issues, the issue listing, the pulls listing — all walk to the end now.Rejected: cursor-walking them anyway "for symmetry". If one of these ever needs it the change is local and testable; adding it now would be untested paging code on paths no fixture can drive honestly.
radiusred-cody commentedon Sep 7, 2026
Decision: the tracker's
ghfake grew a third stand-in,pagingGH, which models the real gh's paging rather than returning a fixed body.Why it was needed: neither existing seam could express pagination —
fakeGHre-enters the test binary with a hard-coded answer per endpoint, andrecordGHprints one fixed stdout whatever the arguments. A fixture of 101 comments served unconditionally would pass with or without--paginate, proving nothing.pagingGHserves the whole listing only when the call carried--paginateand truncates to the first hundred otherwise, exactly as GitHub's first page does — so each new test fails when the flag is dropped. I verified that: removing--paginatefrom all four readers fails all four tests with "returned 100 of …", and restoring it passes.Trade-off: a third fake in one test file. It is nine lines and it is the only one that asserts a call's paging behaviour rather than its shape; folding it into
recordGHwould have made that helper argument-sensitive for every existing caller.Deviation from nothing else:
fakeGH's/pullsmatcher now finds the path anywhere in the argument list instead of atargs[1], because--paginatenow sits ahead of it.fix: every listing read in the tracker walks the whole listing (#308)
docs: the changelog records the paginated listing reads (#308)
fix: every listing read in the tracker walks the whole listing (#308)
docs: the changelog records the paginated listing reads (#308)
fix: every listing read in the tracker walks the whole listing (#308)
docs: the changelog records the paginated listing reads (#308)