Skip to content

fix(source-control): read incomplete run pages as unreadable in review-venue.sh - #11245

Merged
kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-9086-41045866928-1
Oct 30, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
work-resolve-issue/issue-9086-41045866928-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9086

Summary

Opened by the work-resolve-issue lane. The run's own summary:

review-venue.sh accepted any run-listing page that parsed. A page with no workflow_runs, or one shorter than its total_count, ended discovery early as absent, or gave stale on a lane's own listing, so verdicts for an unchanged repository flipped between runs. Both listings now go through read_runs. It takes a page only when workflow_runs is an array whose length equals what total_count leaves for that page (clamped to 0..100), and re-reads an incomplete page up to 3 times. If the page is still incomplete, each undecided lane prints <lane> local unreadable: <detail> and runs its review locally. A failed gh call, or an unparsable or null body, still exits 2.

Not verified

  • bash plugins/source-control/skills/pull-request/scripts/review-venue.test.sh was not run: this lane's Bash runs only the named wrappers. The tests were traced by hand (here and by the review subagent); the suite is left to the PR's CI.
  • shellcheck was not run on the two edited scripts for the same reason; left to the PR's CI.
  • tidy pass 4 used only the rubric read: the ai-slop detector script (detect.sh) cannot run in this lane.
  • The root cause in the field is unconfirmed. The fix targets the issue's candidate: pages that parse but are short or missing workflow_runs. It was not reproduced against the live API.
  • The --head tests check-runs listing still ends at the first page shorter than 100 with no total_count check; the issue's scope is the two review-lane listings.

Fix

  • plugins/source-control/skills/pull-request/scripts/review-venue.sh: new read_runs whole-page check with 3 reads (pausing 2 s, then 3 s); discovery and the per-lane runs read use it; new local unreadable line; header documents the reason
  • plugins/source-control/skills/pull-request/scripts/review-venue.test.sh: stand-in listings carry total_count (the event filter keeps it consistent); sleep stub; set_total helper; cases for a page with no workflow_runs, a short page, a page longer than total_count, a short page 2, a short lane listin
  • plugins/source-control/skills/pull-request/reference/review-venue.md: documents local unreadable and adds it to the local report line
  • plugins/source-control/reference/providers/github/pull-request/review-venue.md: new 'A whole page' section with the completeness rule, retries and doc pointer
  • .changes/source-control/fix-review-venue-unreadable-9086a3f1.md: patch changelog fragment for the fix

Verification

The runner ran each check from the base copy against b6fb166:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //docs.github.com/en/rest/actions/workflow-runs?apiVersion=2022-11-28: both run-listing endpoints return required total_count (integer) and required workflow_runs (array); filtered queries (event among them) return up to 1,000 results
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-changelog-fragments: all 11 fragments valid (run after the final edit)
  • /home/runner/work/claude-code-plugins/claude-code-plugins/.lane/checks/bin/check-affected: 12 passed, 6 skipped, no failure (run after the final edit)
  • fresh-context review subagent over the whole diff: no script bug; 4 findings (a page-2 offset test that passed even with the offset ignored, an empty or null body read as unreadable instead of exit 2, two weak assertions), all fixed
  • tidy-diff over the change's lines: no edits needed
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/41045866928

Left out: the items under Not verified.

Related

#9086

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

Copy link
Copy Markdown
Contributor

claude-security-review reviewed b6fb166d5bca00d32f8156db636e6e974ff02757: 0 finding(s), 0 as inline comments.

No security issues found in this change.

The change is confined to the review-venue.sh helper in the pull-request skill, its test, two reference docs and a changelog fragment. None of the five files is a trusted-path match, so nothing here changes a trusted-actor list, a token scope, the kill switch, a merge hold or a plugin manifest.

What I checked in read_runs and its two call sites:

  • Failure direction: the new local unreadable verdict sends the caller to run its review locally, which is the stricter outcome. It is not a path to skipping a review.
  • Exit 2 cases: a failed gh call, an unparsable body, a null body or an empty body still exits 2. The jq check ends in || return 2, and the [[ -n "$whole" ]] guard also returns 2.
  • Injection: $1 is the endpoint built from $REPO and an integer page number. $2 goes to jq through --argjson and is computed arithmetically. There is no new shell or jq interpolation of external data. The sleep argument is the loop counter.
  • Bounds: the loop makes at most 3 attempts and PAGES is 3. Retries and pauses are bounded, with no unbounded loop or API-use amplification.
  • Verdict forgery: a page that is not whole can no longer produce absent or stale, so partial API output cannot flip a verdict toward "CI covers this" or toward "no CI lane".
  • Cost: a retry spends only a few gh api calls and a few seconds of sleep. There is no billing impact.

manifest: no plugin manifest is touched.

critical-findings: 0

@github-actions

Copy link
Copy Markdown
Contributor

claude-review reviewed b6fb166d5bca00d32f8156db636e6e974ff02757: 0 finding(s), 0 as inline comments.

No findings. I read the full diff, the PR context and the surrounding review-venue.sh and review-venue.test.sh code. I did not run the script or its tests: this lane has no shell. The conclusions below come from reading the code.

What I checked

  • read_runs (review-venue.sh:96-111): the three outcomes are handled correctly.
    • A failed gh call, a body that is not a JSON object (including null) and an empty body all return 2.
    • A page that parses but is not whole is retried. It returns 1 after the third read.
    • The jq completeness test is guarded. and short-circuits, so a missing total_count does not error. The expected length is clamped to 0..100, so page 2 of a 100-run listing correctly expects 0 runs.
    • The script uses set -uo pipefail with no -e, so the runs=$(...) / case $? pattern works as written.
  • Discovery loop: on an incomplete page it breaks and keeps any lanes already found on earlier pages. Only lanes still undecided print local unreadable. The existing early break at :167 still fires only on a whole page.
  • Per-lane listing: reading page 1 with offset 0 and clamping to 100 is right. An incomplete read prints local unreadable and moves to the next lane, with no stale or absent.
  • Acceptance criteria of fix(source-control): review-venue.sh gives absent, stale and healthy for the same repository minutes apart #9086:
    • "An incomplete read reports a reason that says so, never absent": met, and tested for no workflow_runs, a short page, a long page, a short page 2 and a short lane listing.
    • "Repeated runs against an unchanged repository give the same verdict": the new "same whole listing twice" test asserts this for whole listings. The incomplete-page path is deterministic given the same responses.
  • Tests: run() truncates the calls log on each invocation, so the "requested once" and "no sleep" assertions measure only the last run. The sleep stub is on PATH and logs sleep 2. The gh stub's event filter now keeps total_count consistent with the filtered runs.
  • Docs and changelog: the local unreadable line is documented in both reference files. The fragment has bump: patch, which fits a bug fix.

Not independently verified

  • The root cause in the field is unconfirmed, as the PR says. If the live API ever returns fewer runs than total_count on every read, the strict-equality check would make lanes read local unreadable each time. That fails closed and costs 5 s of sleeps per listing. I could not check this against the live API.
  • The --head check-runs listing still has the old "first page shorter than 100" break. The PR says this is out of scope for the issue.
  • Spend: none beyond a few extra gh api reads and up to 5 s of sleeps on an incomplete page.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 30, 2026
Merged via the queue into main with commit a769da4 Oct 30, 2026
47 checks passed
@kyle-sexton
kyle-sexton deleted the work-resolve-issue/issue-9086-41045866928-1 branch October 30, 2026 12:48
@github-actions

Copy link
Copy Markdown
Contributor

Post-merge mutation testing

Killed 5, survived 2, timeout 0, no coverage 0, invalid 0, not run 0.
Covered-code score 71%; mutation score 71%.

File Killed Survived Timeout No coverage Invalid Not run
plugins/source-control/skills/pull-request/scripts/review-venue.sh 5 2 0 0 0 0

Surviving mutants

Location Operator Disposition Cause
plugins/source-control/skills/pull-request/scripts/review-venue.sh:113 SBR productive input-gap
plugins/source-control/skills/pull-request/scripts/review-venue.sh:149 SBR equivalent none

The run's summary has the full report.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

fix(source-control): review-venue.sh gives absent, stale and healthy for the same repository minutes apart

1 participant