Repository navigation
Let ci-carry verify a rerun Actions attempt by reading its jobs in pages of 50 (GST-2215) - #4246
Merged
capy-ai[bot] merged 1 commit intoNov 9, 2026
Conversation
…ges of 50 (GST-2215) A rerun attempt's 100-job page took GitHub ~11 s for gbrain's 86-job Test runs, past the git proxy's ~10 s cutoff, so every rerun failed verification with api_error. Read 50 per page and, after a 5xx, reread the whole list once at 25. Any failed page still throws, so a partial job list never counts. Co-authored-by: capy-ai[bot] <230910855+capy-ai[bot]@users.noreply.github.com>
|
😎 This pull request was merged. |
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.
gstack can again reuse a GitHub Actions run as test evidence after that run has been rerun, so a green rerun of a known flaky test no longer forces /ship to run the whole test suite again on the agent's machine. This serves the project goal of CI being the one full test run.
What changed
The job list for one run attempt is now read 50 jobs per page instead of 100, and a server error (5xx) rereads the whole list once at 25 per page.
Before/after as text: ghRunDeps.jobs: one 100-job page per request (502 past the proxy's ~10 s cutoff on rerun attempts) becomes 50 per page, with one whole-list reread at 25 after a 5xx
Why
"
gstack-ci-carry findreturnedno_verified_run: test: run <id>: api_errorfor any run whose newest attempt is a rerun" (gbrain #8940). On a rerun attempt GitHub took about 11 seconds to answer a 100-job page for gbrain's 86-job Test workflow, and the proxy that Capy machines reach GitHub through cuts requests off at about 10 seconds with a 502. Smaller pages answer well inside that limit, so a rerun attempt verifies again and its green CI result carries instead of the suite running locally.Blast radius
Only the jobs read inside
ghRunDeps(lib/run-evidence.ts:335-339) changes; every caller ofghRunDeps(gstack-ci-carry,gstack-pregate --from-run,scripts/ci-tree-reuse.ts) gets the same complete job list it got before, now in more pages. It stays safe because a failed page still makesghexit non-zero, which throws, so a partial list never counts. The negative-control test walked that failure path, and a live read of gbrain run 42670157276 attempt 4 (the run that answered 502 before) returned all 86 jobs.Summary
A rerun Actions attempt could not be verified as test evidence. Reading its job list 100 at a time timed out behind the proxy, so every rerun came back
api_errorand /ship fell back to the full local suite even after a green rerun of a flaky test. The jobs read now asks for 50 per page (gh follows every page) and, on a 5xx, rereads the whole list once at 25. A non-5xx error (a 404, say) does not retry, and any failed page still leaves the run unverified.Test Coverage
All new code paths have test coverage. Three tests at the end of test/run-evidence.test.ts drive
ghRunDeps(...).jobsthrough a stubghon PATH that pages an attempt-2 list of 86 jobs and answers 502 past a page-size limit: 50 per page across every page, one 5xx retry at 25, and a negative control where page 2 fails (staysapi_errorafter exactly one retry) plus a 404 that does not retry. They were red on f75ce6f and are green at this head.Pre-Landing Review
No issues found by the core checklist or the batched specialist (testing, security, state machines, red team). The adversarial reader raised two notes below the blocking floor, listed under Review notes; the outside voice (openai/gpt-6.1-sol) returned CLEAN.
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Outside review: CLEAN (openai/gpt-6.1-sol, completed).
Review notes
Below the blocking floor (advisory, informational, test-gap or wording items); recorded here and not fixed in this PR.
lib/run-evidence.ts:338The 25-per-page retry fires only when gh's stderr carries 'HTTP 5xx'; with --jq, gh prints a JSON-parse error instead when a 5xx body is HTML, plain text or empty, so those 5xx answers skip the retry and stay api_error (fails closed, no regression)changelog.d/capy-ci-carry-reads-rerun-attempt-jobs-in-pages-gst-2215.md:4Changelog says any server error (5xx) triggers the 25-per-page reread; per finding 1 that holds only when the 5xx body is JSONExploratory QA
Functional smoke, CLI surface, read-only against GitHub through the live proxy (budget 300 s, 3 captures):
ghRunDeps('garrytan/gbrain').jobs('42670157276', 4), the rerun attempt that answered 502 at 100 per page before this change, returned 86 of 86 jobs in 18.9 s.garrytan/gstackrun 1) throwsgh: Not Found (HTTP 404)in 0.6 s instead of yielding an empty or partial list.Verdict: pass.
Design Review
No frontend files changed — design review skipped.
Eval Results
No prompt-related files changed — evals skipped.
Review bot comments
No review bot comments.
Scope Drift
Scope Check: CLEAN
Intent: let ci-carry verify a run whose newest attempt is a rerun (GST-2215).
Delivered: the jobs read pages at 50 with one 5xx retry at 25, three tests and a changelog fragment.
Plan Completion
Plan completion audit: not run (no plan is bound to this branch and no docs/designs/ file matches). Bug fix, exempt from the plan step.
Verification Results
No plan-specific verification items (bug fix, no plan). Automatic diff-scoped QA above: 2 PASS, 0 FAIL, 0 BLOCKED, 0 NOT RUN.
TODOS
No TODO items completed in this PR.
Documentation
Scope: the diff from f75ce6f to the branch head: lib/run-evidence.ts (the jobs reader for rerun attempts), test/run-evidence.test.ts, and the changelog.d fragment for GST-2215. The working tree had no staged, unstaged or new files. I also searched docs/ and the root Markdown files for mentions of api_error, per_page and job lists.
Result: current. The page size is an internal detail that no user-facing doc describes. docs/pregate.md and docs/troubleshooting.md describe
api_erroras gh failing to read the run, and that still holds, because a page that fails after the retry still leaves the run unverified. The changelog fragment covers the user-visible effect.Debt: none found.
Test plan
bun run test: carried from CI run 42696117285/1 at this exact tree (1655 test files, 0 failed).bun test test/run-evidence.test.ts test/ci-carry.test.ts test/spawnsync-timeout-tripwire.test.ts test/module-size-ratchet.test.ts test/changelog-fragments.test.ts,bun run typecheck,bun run typecheck:test: green before /ship on this tree.Tests ran: test 1655
Agent notes
Refs GST-2215 (from gbrain #8940, GBRA-405).
REVIEW_LOOP: passes=1 blocking_found=0 deferred=0 noted=0 fixed=0 scope=frozen ledgers_read=2 dispatches=1
Gate edits: none detected (2 listed, 1 read; patterns: RH-1,RH-3,RH-4,RH-12,RH-13,RH-14,RH-15,RH-16; unlisted idioms: none)
Retry stderr shape (Captain ruling): the 25-per-page retry fires only on
HTTP 5xxin gh's stderr. A 5xx with an HTML or empty body comes through--jqas a JSON-parse error, so it does not retry and fails closed toapi_error. The Captain ruled this correct; the retry will not be widened.Approvals
No approvals recorded for branch capy/ci-carry-reads-rerun-attempt-jobs-in-pages-gst-2215.
Plan: exempt: bug fix (R65)
Plan check: exempt bug fix