Skip to content

fix(review): record on a contributor's fork PR from a maintainer's checkout - #784

Merged
kixelated merged 4 commits into
mainfrom
quest/m0/fork-review-record
Nov 19, 2026
Merged

kixelated merged 4 commits into
mainfrom
quest/m0/fork-review-record

Conversation

@kixelated

@kixelated kixelated commented Nov 19, 2026 •

Copy link
Copy Markdown
Collaborator

Finishes quest/m0/fork-review-record.md (deleted here).

quest review in a maintainer's checkout of a contributor's fork PR now finds that PR, reads its ## Models size, and rewrites its ## Review record, so nobody writes one by hand.

Changes

  • openPull (src/cli/review-record.ts) takes the open PRs from the reviewed branch into the base from any head repository. The push repository's PR wins, so contributors reviewing in their own fork's clone (and same-repo PRs) behave as before. Otherwise it uses another repository's PR only when the checkout's HEAD contains that PR's pushed head (git merge-base --is-ancestor; a head missing locally counts as no match), and only when exactly one such PR exists. A stranger's PR from a branch of the same name is skipped: record skipped: no open PR from <branch> into <base> from <owner> or with a head this checkout holds: <urls>. Several matching forks skip with record skipped: several open PRs from <branch> into <base> with heads this checkout holds, none from <owner>: <urls>.
  • OpenPull (src/core/forge.ts) gains an optional sha, the PR's head commit, which GitHub's open-PR listing fills in (src/github/claims.ts).
  • The "no PR" message drops the owner: record skipped: no open PR from <branch> into <base>.
  • quest review --help and the README describe the lookup.

Choices made without asking

  • Ambiguous match skips instead of picking the earliest PR (the one that holds a claim). I followed the Plan's recommendation. Picking the claim holder would also work, but a wrong pick rewrites someone else's body.
  • sha is optional on the wire rather than required, so a Kixel Quest server that doesn't send it yet still parses. Without it, another repository's PR never matches and the round skips the record, as before this PR.

Decisions

  • Pullfrog's stranger-PR finding: ✅ accept another repository's PR only when the checkout's HEAD contains its pushed head, missing locally counting as no match (rejected: trust any lone fork PR; skip every fork PR). Why: a real checkout of a contributor's PR always descends from its last pushed head, while a stranger's same-named branch does not, so the stranger can neither set the round's size nor receive the record. The coordinator recommended this; the user has not been asked.

Public API

  • CLI output: the record skipped: text changes as described above. No wire or flag changes.

Validation

  • New test a maintainer's checkout records on a contributor's fork PR and reads its size (test/review.test.ts): a stranger's lone fork PR whose head the checkout lacks is skipped, its Size: XS unread and its body untouched. Adding a contributor's PR whose head is HEAD~1 writes the record there and reviews at size S (the shadow runs at low effort). A second fork's PR with a head the checkout holds makes it skip and name both. The push repository's own PR then wins.
  • With the ancestry filter removed, the same test fails: the round reads the stranger's size XS.
  • Ran that test against the old openPull: it fails with size M default and no record, the same thing both iterates on moq-dev/quest#761 hit.
  • just check and just test pass (1566 tests) on 1d6962d, after merging main (feat(github)!: read on an installation token from Kixel Quest #777's installation-token reads; the one conflict in openPull kept this PR's fork-PR selection and took feat(github)!: read on an installation token from Kixel Quest #777's awaited hosting.live()). Review round 3 on that head: 10/10, no findings.
  • Not tested against real GitHub: moq-dev/quest has no open fork PR, and opening one just for this would be an outward action. This PR's own /quest-review exercises the same-repository path live.

Caused by

  • moq-dev/quest#508: looked up the PR as head=<push owner>:<branch>, which in a maintainer's checkout names the upstream, not the contributor's fork (found by person).

Follow-ups

None.

Models

  • Size: S
  • Implementer: Claude Code, claude-opus-5-5, medium effort (iterate, S, arm A)

Review

Rewritten by quest review after each round.

  • Head: 1d6962d

  • Base: origin/main at fd0a7fd

  • Risk: high, The change alters exported PR data and how review records and model sizes are associated with fork PRs, potentially causing maintainers and downstream tools to trust or overwrite the wrong PR’s record; reverting cannot undo records already written or agent actions taken from them.

  • Classified: high by Codex, gpt-6.1-sol, low effort, session 01a1f5aa-4958-7381-af48-7d8070e32fd6

  • Reviewer: Codex, gpt-6.1-sol, medium effort

  • Session: 01a1f2c6-8b72-7e13-9858-3903fbdf36ee, round 3

  • Score: 10/10, The incremental changes correctly await the updated live-forge API, with no new actionable defects found by inspection; builds and tests were not run as instructed.

  • Rounds: 3; first round 0; findings 0: fixed 0, refuted 0, open 0

  • Findings: none

  • Reviewer: Codex, gpt-6.1-sol, low effort, shadow

  • Session: 01a1f2c6-8b72-7511-8463-3f0264607c66

  • Rounds: 1; first round 0; findings 0: fixed 0, refuted 0, open 0

kixelated and others added 2 commits November 18, 2026 23:44
…eckout

quest review now takes the open PR from the reviewed branch into the base
from any head repository, preferring the push repository's, and skips
naming every candidate when several forks match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@kixelated kixelated changed the title quest review records on a contributor's fork PR fix(review): record on a contributor's fork PR from a maintainer's checkout Nov 19, 2026
@kixelated
kixelated marked this pull request as ready for review November 19, 2026 07:48
@coderabbitai

coderabbitai Bot commented Nov 19, 2026 •

Copy link
Copy Markdown

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 56 seconds.

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: CHILL
  • Plan: Advanced
  • Run ID: 8871d12e-e306-40da-8422-4d981b2e7dad
Commits

Reviewing files that changed from the base of the PR and between 9e072ef and 1d6962d.

Files selected for processing: 7

  • README.md
  • quest/m0/fork-review-record.md
  • src/cli/main.ts
  • src/cli/review-record.ts
  • src/core/forge.ts
  • src/github/claims.ts
  • test/review.test.ts
  • 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

@pullfrog pullfrog 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.

ℹ️ No critical issues — one trust edge in the fallback worth a look.

Approach: sound. It fixes the cause, the lookup filtering on the push repository's owner, in the one function (openPull) that both pullModels and recordRounds share. Size reading and record writing therefore stay consistent.

Reviewed changes: the whole PR.

  • openPull fallback: prefers the push repository's PR, else uses the only open PR from the branch into the base from any repository, else skips and lists the candidates.
  • Skip messages: no open PR from <branch> into <base> drops the owner, and a new several open PRs … message lists the competing URLs.
  • Docs: quest review --help and the README describe the new lookup.
  • Tests: a new stub-forge test covers three cases: a lone fork PR, ambiguous forks, and the push repository's own PR winning. FakePull gains an optional head.

Pullfrog  | Fix all ➔ | Fix 👍s ➔ | View workflow run | Using claude-opus-5-5 | 𝕏

Comment thread src/cli/review-record.ts Resolved
… head

A lone fork PR from a branch of the same name no longer sets the round's
size or receives its record unless the checkout holds that PR's pushed head.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
pullfrog[bot]
pullfrog Bot previously approved these changes Nov 19, 2026

@pullfrog pullfrog 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.

✅ No new issues found. The new commit resolves the earlier stranger-PR concern.

Reviewed changes: this review covers c4139dc, which narrows the fork-PR fallback.

  • Ancestry filter in openPull: another repository's PR is used only when the checkout's HEAD contains its pushed head (contains → git merge-base --is-ancestor). A head that is missing locally counts as no match. Exactly one such PR must exist. The push repository's own PR still wins.
  • Head SHA on OpenPull: OpenPull has an optional sha, which is validated with maybe(sha) and filled from head.sha in openPullRequests. If a server omits it, fork PRs are skipped as before.
  • Skip messages: a new no open PR … from <owner> or with a head this checkout holds message covers unheld candidates. The several open PRs message now lists only the held candidates.
  • Docs and test: the README and --help describe the held-head rule. The test now checks that a stranger's same-named PR is skipped, that its size is never read, and that its body stays untouched.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

…record

# Conflicts:
#	src/cli/review-record.ts

@pullfrog pullfrog 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.

✅ No new issues found. The new push only merges main, and the earlier stranger-PR concern stays fixed.

Reviewed changes: this review covers 1d6962d, which merges origin/main into the branch.

  • Conflict resolution in openPull: the candidate lookup now calls await (await hosting.live()).pulls(repository). This matches #777's async live(). The fork-PR selection and the ancestry filter are unchanged.

Pullfrog  | View workflow run | Using claude-opus-5-5 | 𝕏

@kixelated
kixelated added this pull request to the merge queue Nov 19, 2026
Merged via the queue into main with commit c1f1ace Nov 19, 2026
23 checks passed
@kixelated
kixelated deleted the quest/m0/fork-review-record branch November 19, 2026 21:25
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