[PR #3461] [CLOSED] fix(ci): look up PR readiness head association in the head repository #5753

Closed
opened 2026-10-31 01:09:10 +00:00 by bsakaguchi · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/morluto/rea/pull/3461
Author: @peter-research
Created: 10/14/2026
Status: ❌ Closed

Base: main ← Head: fix/pr-readiness-fork-head-lookup


📝 Commits (1)

  • dd0a81e fix(ci): look up PR readiness head association in the head repository

📊 Changes

3 files changed (+26 additions, -2 deletions)

View changed files

📝 scripts/ci/pr-readiness.d.mts (+7 -1)
📝 scripts/ci/pr-readiness.mjs (+7 -1)
📝 tests/boundary/filesystem/prReadiness.test.ts (+12 -0)

📄 Description

Summary

PR readiness could never reach success for PRs opened from forks.

Fixes #3432

Problem and expected behavior

runReadinessCheck confirmed the head association with listPullRequestsAssociatedWithCommit against context.repo, the base repository. A commit that exists only in a fork returns an empty list there, so every fork PR with a valid declaration stayed pending with the head-association message, and a rerun could not change the result.

Change and scope

The lookup now targets the head repository (pull.head.repo) when it is present and falls back to the base repository otherwise (for example when the fork was deleted). The distinct-head check keeps working on the same list, so it sees other open PRs from the same fork but not from a second fork, as noted in the issue. The ReadinessPullRequest declaration gains an optional head.repo.

Contribution scope: not applicable (ordinary fix within existing boundaries).

Contract and boundary impact

  • Semantic owner and earliest changed stage: CI workflow script scripts/ci/pr-readiness.mjs; association lookup
  • Contribution scope fit and linked maintainer decision: not applicable
  • CLI and MCP/tool-catalog contract: no schema or catalog change
  • Provider, bridge, target-format, or platform compatibility: unknown beyond the cases covered by the tests below
  • Evidence, artifact, provenance, or reconstruction contract: none
  • Generated metadata, package, or installation impact: none

Expected effects:

  • Read existing files or captured data.
  • Launch or attach to a process.
  • Inject instrumentation or run scripts/code.
  • Change process memory, registers, files, or configuration.
  • Contact network services.
  • Recover protected code or work around protections.
  • Documentation or usability only; no target interaction.
  • Not sure yet; investigation or maintainer guidance needed.

Evidence and regression coverage

Source-derived by the AI assistant from reading the code. The human owner reports reviewing the code and verifying the proof-of-concept reproductions, with no failures.

  • Tests added or updated: tests/boundary/filesystem/prReadiness.test.ts adds a fork case asserting the lookup is made for the fork owner and repository (owner reports no failures).
  • Base reproduction or other evidence: the reproduction in #3432 (not re-run for this PR)
  • User-visible CLI/MCP output (if applicable): not captured
  • Remaining proof gaps: Not exercised against real GitHub: the workflow runs from the default branch with pull_request_target, so a patched run is only possible after merge. Same-numbered PRs in the fork repository are not filtered out by base repository.

Validation performed

The human owner reports having reviewed the code and PRs and verified the proof-of-concept reproductions, with no failures. The exact commands and outputs were not recorded here.

Compatibility, safety, and release

  • Breaking changes or migration steps: none expected
  • Real Hopper/Ghidra, browser, or OS coverage: none
  • Package or release metadata impact: none
  • Security, privacy, process, or containment review: not applicable

Prepared with AI assistance (Claude). The author readiness declarations below were dictated by the human owner.

Author readiness

Human owner: @peter-research

  • 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/3461 **Author:** [@peter-research](https://github.com/peter-research) **Created:** 10/14/2026 **Status:** ❌ Closed **Base:** `main` ← **Head:** `fix/pr-readiness-fork-head-lookup` --- ### 📝 Commits (1) - [`dd0a81e`](https://github.com/morluto/rea/commit/dd0a81e9f8ffed68570f1e6c220e1bbd0f0f960c) fix(ci): look up PR readiness head association in the head repository ### 📊 Changes **3 files changed** (+26 additions, -2 deletions) <details> <summary>View changed files</summary> 📝 `scripts/ci/pr-readiness.d.mts` (+7 -1) 📝 `scripts/ci/pr-readiness.mjs` (+7 -1) 📝 `tests/boundary/filesystem/prReadiness.test.ts` (+12 -0) </details> ### 📄 Description ## Summary PR readiness could never reach `success` for PRs opened from forks. Fixes #3432 ## Problem and expected behavior `runReadinessCheck` confirmed the head association with `listPullRequestsAssociatedWithCommit` against `context.repo`, the base repository. A commit that exists only in a fork returns an empty list there, so every fork PR with a valid declaration stayed `pending` with the head-association message, and a rerun could not change the result. ## Change and scope The lookup now targets the head repository (`pull.head.repo`) when it is present and falls back to the base repository otherwise (for example when the fork was deleted). The distinct-head check keeps working on the same list, so it sees other open PRs from the same fork but not from a second fork, as noted in the issue. The `ReadinessPullRequest` declaration gains an optional `head.repo`. Contribution scope: not applicable (ordinary fix within existing boundaries). ## Contract and boundary impact - Semantic owner and earliest changed stage: CI workflow script `scripts/ci/pr-readiness.mjs`; association lookup - Contribution scope fit and linked maintainer decision: not applicable - CLI and MCP/tool-catalog contract: no schema or catalog change - Provider, bridge, target-format, or platform compatibility: unknown beyond the cases covered by the tests below - Evidence, artifact, provenance, or reconstruction contract: none - Generated metadata, package, or installation impact: none Expected effects: - [ ] Read existing files or captured data. - [ ] Launch or attach to a process. - [ ] Inject instrumentation or run scripts/code. - [ ] Change process memory, registers, files, or configuration. - [ ] Contact network services. - [ ] Recover protected code or work around protections. - [ ] Documentation or usability only; no target interaction. - [ ] Not sure yet; investigation or maintainer guidance needed. ## Evidence and regression coverage Source-derived by the AI assistant from reading the code. The human owner reports reviewing the code and verifying the proof-of-concept reproductions, with no failures. - Tests added or updated: `tests/boundary/filesystem/prReadiness.test.ts` adds a fork case asserting the lookup is made for the fork owner and repository (owner reports no failures). - Base reproduction or other evidence: the reproduction in #3432 (not re-run for this PR) - User-visible CLI/MCP output (if applicable): not captured - Remaining proof gaps: Not exercised against real GitHub: the workflow runs from the default branch with `pull_request_target`, so a patched run is only possible after merge. Same-numbered PRs in the fork repository are not filtered out by base repository. ## Validation performed The human owner reports having reviewed the code and PRs and verified the proof-of-concept reproductions, with no failures. The exact commands and outputs were not recorded here. ## Compatibility, safety, and release - Breaking changes or migration steps: none expected - Real Hopper/Ghidra, browser, or OS coverage: none - Package or release metadata impact: none - Security, privacy, process, or containment review: not applicable Prepared with AI assistance (Claude). The author readiness declarations below were dictated by the human owner. ## Author readiness Human owner: @peter-research - [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-10-31 01:09:10 +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#5753
No description provided.