Skip to content

fix(ci): validate unindexed readiness heads with live PR metadata - #5316

Merged
gensokyo-dev merged 1 commit into
mainfrom
fix/ci-readiness-head-fallback
Oct 19, 2026
Merged

gensokyo-dev merged 1 commit into
mainfrom
fix/ci-readiness-head-fallback

Conversation

@gensokyo-dev

Copy link
Copy Markdown
Collaborator

Summary

Unblock PR readiness when GitHub's commit-to-PR association index omits a valid current head. This currently blocks #3807 despite its passing feature CI and filled initial declarations; no separate issue is needed for this directly observed CI defect.

The existing association lookup remains the fast path. When it cannot confirm the PR, check all live open PR heads using paginated GraphQL requesting only PR numbers, head OIDs and cursors. Require complete valid coverage, the current PR's matching head, and no other PR sharing that head. Retain the final PR freshness check. Missing, malformed, overlapping or non-progressing pages leave readiness pending.

Trusted default-branch checkout, workflow permissions, declaration requirements and duplicate-head rejection are unchanged. This changes CI metadata validation only; provider scope approval is not applicable. No CLI/MCP, Evidence, installation or generated metadata changes.

Validation performed

  • npm run test:focused -- tests/boundary/filesystem/prReadiness.test.ts — 43 tests passed, including paginated confirmation, later-page duplicate, stale head, unavailable/malformed metadata and incomplete coverage. The new positive regression fails against the old implementation (pending instead of success).
  • npm run check — passed (typecheck, lint and repository verification).
  • Read-only shadow runs against real feat(il2cpp): inventory Unity IL2CPP global-metadata images, types and methods #3807 metadata at 5f65d4adb5f5f64ec9af58febe68b0e582013346: old implementation remains pending with an empty association result; candidate succeeds twice after examining all 590 open heads across six pages. Commit-status writes were captured locally, not published.

Each fresh-process candidate shadow used 9 GitHub reads, 88,421 response bytes, 11.93–12.65 s elapsed, 1.79–1.81 s CPU and 91.4–91.5 MiB sampled process-family peak RSS. This includes local Node/gh transport; two status writes and actual Actions runner costs are excluded. Remote cache/host load were uncontrolled; there is no local live-state cache. The old 4.76 s run never completes readiness successfully, so this is not a speedup comparison. Agent token costs are not changed or measured. Ordinary indexed heads make no additional requests.

Author readiness

Human owner: @gensokyo-dev

The owner explicitly delegated these declarations and authorized opening ready, following CI/review and merging in this session. Codex reviewed the final diff and stated evidence; independent human review was not observed.

  • I reviewed the final diff and relevant existing code, understand the change and its edge cases, and take responsibility for the complete PR, including AI-assisted work.
  • I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps.
  • I declare this PR ready for initial maintainer review.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ⚠️ Failed 2026-10-19T23:04:58.430235Z f69bec8 PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex usage limits have been reached for code reviews. Please check with the admins of this repo to increase the limits by adding credits.
Repo admins can enable using credits for code reviews in their settings.

@greptile-apps

greptile-apps Bot commented Oct 19, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge; no actionable issues were found.

Summary

Adds a live, paginated lookup when GitHub’s commit association lookup cannot confirm the current PR.

  • Readiness checks can confirm a PR head when GitHub’s index misses it.

No actionable issues were found. Tests were not rerun. Supersession and existing PR discussions could not be checked because GitHub access was not authenticated.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
  A[Declarations pass] --> B[Read commit associations]
  B --> C{Current PR and head found?}
  C -->|No| D[Read every page of open PR heads]
  D --> E{Pages valid and complete?}
  E -->|No| F[Stop; readiness stays pending]
  E -->|Yes| G{Current PR has a unique matching head?}
  C -->|Yes| G
  G -->|Missing| H[Pending]
  G -->|Shared| I[Failure]
  G -->|Unique| J[Success candidate]
  H --> K[Recheck current PR freshness]
  I --> K
  J --> K
  K --> L[Publish result; use pending if changed]
Loading

Reviews (1) · Last reviewed commit: "fix(ci): validate unindexed readiness he..." · Reviewed by Greptile

@gensokyo-dev
gensokyo-dev merged commit 82c76e2 into main Oct 19, 2026
42 checks passed
@gensokyo-dev
gensokyo-dev deleted the fix/ci-readiness-head-fallback branch October 19, 2026 23:20
@github-actions github-actions Bot mentioned this pull request Oct 19, 2026
3 tasks done
@morluto morluto added area: build Build, CI, packaging, and publishing bug Something isn't working labels Nov 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: build Build, CI, packaging, and publishing bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants