[PR #5316] [MERGED] fix(ci): validate unindexed readiness heads with live PR metadata #6875

Closed
opened 2026-11-01 21:43:44 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/5316
Author: @gensokyo-dev
Created: 10/19/2026
Status: ✅ Merged
Merged: 10/19/2026
Merged by: @gensokyo-dev

Base: main ← Head: fix/ci-readiness-head-fallback


📝 Commits (1)

  • f69bec8 fix(ci): validate unindexed readiness heads with live PR metadata

📊 Changes

3 files changed (+231 additions, -10 deletions)

View changed files

📝 scripts/ci/pr-readiness.d.mts (+8 -0)
📝 scripts/ci/pr-readiness.mjs (+59 -9)
📝 tests/boundary/filesystem/prReadiness.test.ts (+164 -1)

📄 Description

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 #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.

🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/morluto/rea/pull/5316 **Author:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Created:** 10/19/2026 **Status:** ✅ Merged **Merged:** 10/19/2026 **Merged by:** [@gensokyo-dev](https://github.com/gensokyo-dev) **Base:** `main` ← **Head:** `fix/ci-readiness-head-fallback` --- ### 📝 Commits (1) - [`f69bec8`](https://github.com/morluto/rea/commit/f69bec888111b1f71847ba631f92062a93e425bf) fix(ci): validate unindexed readiness heads with live PR metadata ### 📊 Changes **3 files changed** (+231 additions, -10 deletions) <details> <summary>View changed files</summary> 📝 `scripts/ci/pr-readiness.d.mts` (+8 -0) 📝 `scripts/ci/pr-readiness.mjs` (+59 -9) 📝 `tests/boundary/filesystem/prReadiness.test.ts` (+164 -1) </details> ### 📄 Description ## 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 #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. - [x] 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. - [x] I checked the evidence above, confirmed it supports the current change, and recorded meaningful validation gaps. - [x] I declare this PR ready for initial maintainer review. --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
bsakaguchi 2026-11-01 21:43:44 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
morluto/rea#6875
No description provided.