Parent: #1936
Problem
The largest remaining avoidable GitHub cost is repeated status/check/branch-protection style reads. Caching and backpressure help, but beta-stable should reduce the number of calls created in the first place.
Requirements
- Replace high-volume repeated REST reads with fewer equivalent reads where safe.
- Prefer GraphQL for aggregate PR/check/status snapshots when it can collapse many REST calls into one bounded query.
- Keep REST for writes, webhook-specific actions, and endpoints where GraphQL would add semantic risk.
- Preserve correctness for required checks, branch protection, mergeability, skipped checks, and gate decisions.
Deliverables
- Identify the top GitHub endpoints by live metrics/logs.
- Build a targeted GraphQL/status-rollup path for PR status/check summary reads.
- Cache repo/base-branch policy snapshots for a bounded TTL where correctness allows.
- Add regression tests proving gate decisions match the REST path for pending, success, failure, skipped, missing, and required-check cases.
Acceptance criteria
- The hot status/check path performs materially fewer GitHub requests per PR pass.
- GraphQL failures fail closed or fall back safely without creating request storms.
- Review/gate behavior remains semantically equivalent.
- Metrics show REST pressure decreases after deployment.
Expected outcome
The system stops burning GitHub budget on repeated status reads and uses GitHub APIs in a way that scales better for active repos.
Parent: #1936
Problem
The largest remaining avoidable GitHub cost is repeated status/check/branch-protection style reads. Caching and backpressure help, but beta-stable should reduce the number of calls created in the first place.
Requirements
Deliverables
Acceptance criteria
Expected outcome
The system stops burning GitHub budget on repeated status reads and uses GitHub APIs in a way that scales better for active repos.