Skip to content

fix: acquire verified original PR heads for provenance - #77

Closed
coisa wants to merge 2 commits into
mainfrom
codex/acquire-verified-pr-head
Closed

coisa wants to merge 2 commits into
mainfrom
codex/acquire-verified-pr-head

Conversation

@coisa

@coisa coisa commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Version preparation can refuse a valid squash-merged contribution when its original PR head is absent from a full main-only checkout. After verifying repository, merged PR/head, ancestry and complete file/commit evidence, the resolver acquires only that exact SHA and rechecks local commit identity and repository/PR API authority before proving direct implementation provenance.

Acquisition uses authenticated HTTPS discovery and a minimal exact-head Git upload-pack request to github.com. The supplied token stays inside the HTTP adapter, including for private repositories; redirects are disabled. A complete response is bounded to 64 MiB and imported by local git index-pack --stdin --strict. Credentials never reach Git processes, argv, environment, config, helpers or persisted files. Native Git authentication would violate the existing HTTP-only credential boundary.

Refs, FETCH_HEAD, index and managed files remain unchanged during acquisition, including previews. Failed authentication, malformed packs or changed evidence refuse preparation. Existing local Enterprise heads remain supported; missing Enterprise heads fail closed because their Git transport host is not verified. Ownership, signatures and managed-PR validation remain unchanged.

Validation at 81e3a8f: full unit suite 2,849 tests / 17,991 assertions; 100% executable source coverage (6,253/6,253 lines, every class); two disposable private-transport integration cases / 135 assertions using real git upload-pack and index-pack for authenticated success and HTTP 401 refusal; PHP syntax, 587 PHPDoc contracts, 45 quality-helper fixtures, Rector, ECS and fragment validation passed. Composer plugins stayed disabled for quality execution.

Includes one patch fragment and documents authentication, the response limit and Enterprise boundary. No live consumer recovery, merge or publication is claimed.

@coderabbitai

coderabbitai Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 33 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: 8e5cf0bf-43a2-4dc9-b939-07aed5dc8a53
Commits

Reviewing files that changed from the base of the PR and between f142824 and 81e3a8f.

Files selected for processing: 11
  • .changelog/acquire-verified-squash-pr-head.md
  • docs/history.md
  • src/Git/GitCommitAcquirerInterface.php
  • src/Git/GitRepository.php
  • src/GitHub/GitHubClient.php
  • src/GitHub/GitHubPublicTransportInterface.php
  • src/Release/Reference/PullRequestReferenceResolver.php
  • tests/Git/GitRepositoryTest.php
  • tests/GitHub/GitHubClientTest.php
  • tests/Integration/GitFragmentOriginTest.php
  • tests/Release/Reference/PullRequestReferenceResolverTest.php
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Oct 29, 2026 •

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 ✅ Completed 2026-10-29T12:36:10.222718Z 81e3a8f New commits
🔒 Security Review ✅ Completed 2026-10-29T12:37:50.897585Z 81e3a8f New commits
ℹ️ 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.

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

Changelog

✅ Contribution check passed.

Head: 81e3a8f4fcd3c3306467c5432a1c4c9ab0789bf8

Base: f1428242cbcd69887d1ecb6782ac6f5e4c249811

Contribution: 1 new valid fragment(s). Policy: ordinary.

  • acquire-verified-squash-pr-head.md — fixed, patch

    Recovers missing original pull-request heads after squash merges by fetching only API-verified exact commits from the matching GitHub repository through authenticated HTTP, keeping credentials out of Git processes and persisted configuration, before rechecking implementation provenance. Failed acquisition or mismatched evidence still refuses version preparation without writing managed files.

@github-actions

Copy link
Copy Markdown
Contributor

Code Coverage Report: Only Changed Files listed

Package Base Coverage New Coverage Difference
Overall Coverage 🟢 100% 🟢 100% ⚪ 0%

Minimum allowed coverage is 100%, this run produced 100%

@coisa

coisa commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

@codex review

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: ac05e402a8

ℹ️ 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".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread src/Git/GitRepository.php Resolved
@chatgpt-codex-connector

Copy link
Copy Markdown

🛡️ Codex Security Review · Automatically triggered

Security review completed. No security issues were found in this pull request.

Reviewed commit: ac05e402a8

View security finding report

Only the user who started this review can view the report in Codex.

ℹ️ About Codex security reviews in GitHub

This is an experimental Codex feature. Security reviews are triggered when:

  • You comment "@codex security review"
  • A regular code review gets triggered (for example, "@codex review" or when a PR is opened), and you’re opted in so security review runs alongside code review

Once complete, Codex will leave suggestions, or a comment if no findings are found.

coisa commented Oct 29, 2026

Copy link
Copy Markdown
Contributor Author

Incorporated by #78, merged as ad36660a95affb7ee7444e9009f4b98f8bea21f3. Verified that this PR's final provenance recovery and authenticated private-repository acquisition changes are preserved in the combined runtime. Closing as superseded without another merge; branch and history are preserved.

@coisa coisa closed this Oct 29, 2026
@coisa
coisa deleted the codex/acquire-verified-pr-head branch October 30, 2026 14:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant