Skip to content

repo-fleet-hygiene:audit PR-list batch window caps merged-PR evidence at 200/repo and never discloses the truncation #1795

Closed

Description

@kyle-sexton

Severity: CRITICAL (assigned by an audit agent; uncalibrated — not re-graded by a human).

Summary

repo-fleet-hygiene:audit gathers merged-PR evidence with a batched gh pr list call capped at
200 PRs per repository. On a fleet where any repository has more than 200 PRs, branches outside
that window get no merged-PR evidence. The --head fallback that would recover them is unreachable
because the privacy gate skips it, and — the part that makes this critical rather than merely
limiting — the truncation is never disclosed in the report. Only gate-skips are named.

A consumer therefore reads "no merged finding" for a branch that is demonstrably merged, with nothing
in the output indicating the evidence window ran out.

Evidence

  • skills/audit/scripts/audit-fleet.sh:973 — the batched call site.
  • :1019-1055 — the --head fallback path, reachable only when the privacy gate does not skip.
  • :1108-1110 — reporting of gate-skips; no corresponding disclosure of window truncation.
  • :971 — the limit constant.
  • gh_probe_allowed:159 and :165 — the 200 and 100 limits, hardcoded a second time in the
    probe allowlist.

The exact query is gh pr list --state merged --limit 200, so the population that matters is
merged PRs per repository. Measured on a real 11-repository fleet:

Repository Merged PRs Outside the 200 window
claude-code-plugins 851 651 (76.5%)
medley 726 526 (72.5%)
dotfiles 302 102 (33.8%)
standards 234 34 (14.5%)
ci-workflows 202 2 (1.0%)

5 of 11 repositories exceed the window, and the worst loses roughly 77% of its merged history.
That worst repository is also the one carrying 291 of the 300 branches the audit reported as
privacy-gated, so the two defects compound on exactly the repository where evidence matters most.

Independent cross-check from the same session: replacing the gated per-branch approach with one bulk
call per repository at a higher limit reproduced every HIGH finding the audit made and found 92
additional
branches whose merged PR headRefOid equalled the local tip (195 vs the audit's 103).

Second defect in the same mechanism

The 200/100 limits are hardcoded in two places — the call sites (:973, :1033) and the probe
allowlist (gh_probe_allowed:159, :165, with :214 gating). Raising one without the other causes
the probe to reject the call at runtime, and that rejection surfaces to the user as an UNKNOWN
finding rather than as a configuration error. A maintainer fixing the window is likely to hit exactly
this.

Why it matters

The skill's contract is confidence-tiered evidence. A silently truncated evidence window does not
lower a finding's tier — it removes the finding entirely, which reads identically to "clean". The
skill's own rule against turning "no verified finding" into "fleet is clean" applies to the tool's own
output here.

Suggested fix

Cheapest first:

  1. Disclose the window from data already in hand, no new API call. When the returned row count
    equals the limit, emit an UNKNOWN finding naming the repository and the cap. This alone converts
    a silent wrong answer into a stated evidence gap.
  2. Raise or paginate the limit, at both hardcoded sites, and add a check that keeps them in step.
  3. Widen the --head fallback safely by establishing proof-of-prior-push, so gated branches can still
    be resolved individually.
  4. Re-run the plugin's security review after touching the probe allowlist.

Related

Adjacent to #1770 (the remote-tracking gate), but distinct: #1770 is about which branches are
queried; this is about the query itself silently running out of window. Both must be fixed for the
merged-branch evidence to be trustworthy.

Environment

  • repo-fleet-hygiene 0.7.0, marketplace install melodic-software
  • Git 2.54.0.windows.1, gh authenticated, Claude Code on Windows 11 Pro 10.0.26200
  • 11 canonical checkouts, 506 local branches
  • Observed 2026-07-29/30

Activity

  1. added
    needs-triage
    on Jul 30, 2026
  2. self-assigned this
    on Jul 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

needs-triage

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions