Repository navigation
feat(github): PR status and claims as a library - #705
Conversation
Quest-Claim: cc2a209e2c9e70ac
|
Warning Review limit reachedYou'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 45 minutes. View limit details
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. |
There was a problem hiding this comment.
ℹ️ No critical issues — one small latency suggestion inline.
Reviewed changes
Reviewed the full split of Quest's GitHub readers into src/github/ and the new quest/github export. Compared line by line against the old files, the moved code is verbatim. The only real logic changes are the extracted readSnapshot and the new library held/claimBranches. tsc -p src/github, root tsc, and the claims, status, start, github, and hold tests all pass locally.
- Client split: the request, GraphQL, paging, retry, and deadline code moves to
src/github/client.ts. The CLI keeps remotes, token resolution, and PR argument parsing. - PR status and holds:
pullRequestStatusmoves tosrc/github/status.ts. The read side of holds moves tosrc/github/hold.ts, andLabels.read()now delegates toreadSnapshot. Thequest landmarkers move tosrc/github/land.ts. - Claims library:
held(github, { upstream, fork? }, branches)reads tips throughgit/matching-refs/heads/quest/when a source passes none. The CLI'sheldwraps it and keeps the off-GitHub branch. Fork detection now uses the case-insensitivesame()instead of an exact compare, which is a small fix rather than a regression. - Export and type isolation:
./githubis inpackage.json, andsrc/github/tsconfig.jsonusestypes: []with theWebWorkerlib, so anode:import failsjust check. - Relocations:
src/github/models.tsmoves tosrc/cli/models-record.ts, andhosts/Hostare now exported from./core. The remaining CLI hunks only rewire imports.
claude-opus-5-5 | 𝕏
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the single commit since the prior pullfrog review.
- Parallelized
heldreads: the libraryheldinsrc/github/claims.tsnow reads the upstream and fork tips and lists their open PRs in onePromise.all. Result order is unchanged:allkeeps the[upstream, fork]order, sopushTostill picks the last source. This addresses the earlier latency suggestion.
claude-sonnet-5-5 | 𝕏
…d modules signals.ts and online-review.ts move to src/github, since pullRequestStatus now reads signals and both use only the client. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
There was a problem hiding this comment.
✅ No new issues found.
Reviewed changes
Reviewed the merge of main since the prior pullfrog review. It carries #652's signals into the moved modules. tsc -p src/github, the root tsc, and the signals, online-review, status, land, hold, and claims tests all pass locally.
- Moved signal readers:
src/cli/signals.tsandsrc/cli/online-review.tsnow live insrc/github/. The only change in each is the import path./github→./client, so neither pulls in Node APIs. - Carried
pullRequestStatussignals:Status.signalsand thereadSignalscall, including the head-changed guard, are insrc/github/status.ts.unanswered_signalis added toReasoninsrc/github/land.ts, and./githubexportstype Signal. - Rewired importers: the CLI modules (
hold,land,land-fixer,land-watch,land-watch-fix,usage) and the tests now import from../github/signalsand../github/online-review. No stalesrc/cli/copies remain.
claude-opus-5-5 | 𝕏
Follows #705's moves into src/github/ and keeps serve's deletions; adds a host-independent tests follow-up quest. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

Finishes
quest/m0/github-readers.md: a host with no checkout, git, or Node APIs, such as a Cloudflare Worker, can now read a PR's status and a quest's claims with Quest's own code, through a newquest/githubexport.Summary
src/cli/github.tstosrc/github/client.ts. The CLI keeps PR arguments, git remotes, and token resolution (GitHubInputError,pullRequest,readRemote,gitHubDependencies).repositoryPathmoves into the client too.pullRequestStatusand everything it calls (summary,classifyCheck, ejection reader, review record,enabledHead/headBefore,requiredOf/unreported) move tosrc/github/status.ts. The read side of holds (readSnapshot,readHoldStatus,starterHeld,ago) moves tosrc/github/hold.ts. Thequest landmarkers it reads (LAND_CHECK,pin/pinned,EJECTED,Reason) move tosrc/github/land.ts.src/cli/status.tskeeps onlystatusLines, andsrc/cli/hold.tskeeps taking, releasing, and landing.src/github/claims.tsholdsOpenPull,Claim,Holdings,openPullRequests,pullsFrom,mergedPull, and a newheld(github, { upstream, fork? }, branches). When a source passes notips, it reads them through GitHub's matching-refs API (claimBranches). It reads the sources' tips and their open PRs concurrently. The CLI'sheldnow delegates to it, passing tips it read withgit ls-remoteas before. Only finding the upstream through remotes, and the branches-only case off GitHub, stay in the CLI.src/github/signals.tsandsrc/github/online-review.ts(fromsrc/cli/):pullRequestStatusreads feat(merge): hold a head an unanswered finding or newer maintainer decision signals #652's signals, so they live in the library.package.jsonexports./github(src/github/index.ts), type-checked bytsc -p src/githubwithtypes: []and theWebWorkerlib, so a straynode:import orprocessfailsjust check.src/github/models.ts(the PR body's## Modelsparser) moves tosrc/cli/models-record.ts, since it imports the CLI's model routing.hosts(andtype Host) is now exported from./core.main.tsimports it from there.models.ts.quest status,quest wait,quest unblocked --unclaimed, andquest startall call the moved code, so the CLI and a hosted caller cannot disagree.Public API
quest/github:GitHub,GitHubDeadline,GitHubGraphQLError,GitHubDependencies,Repository,PullRequest,pullRequestStatuswithStatusand its parts,HoldFact/HoldReport, andheld,claimBranches,openPullRequestswithClaim,Holdings,OpenPull,Source,Sources.quest/coreaddshostsandHost.github:moq-dev/quest#<sha>).Choices made without asking
heldtakes repositories as{ owner, repo }rather thanowner/repostrings, as the rest of the client does.statusLinesstays in the CLI: a hosted caller has no consumer for the plain-line format yet.agolives insrc/github/hold.ts, its main consumer;quest start'sdescribeimports it from there.Validation
just checkandjust testpass (39 files, 1314 tests). A newtest/claims.test.tscovers the libraryheld: tips read through matching-refs for the upstream and the fork, the earliest open PR across both holding the claim, an upstream branch at a merged PR's head holding nothing, and no ref reads when tips are passed.quest statusfor #652, #698, #701, and #705, andquest unblocked --unclaimed --json(stdout and stderr), were byte-identical betweenorigin/mainand this branch.src/githubwithbun build --target=browser --conditions=workerd(nonode:imports in the bundle). It ran with onlyfetchand a token, and the result matched the CLI:pullRequestStatusfor feat(merge): hold a head an unanswered finding or newer maintainer decision signals #652, throughstatusLines, matchedquest statusexactly.heldon all 19 upstreamquest/*branches, reading tips through matching-refs, matched the CLI's git-basedheldexactly.workerd/workercondition) picksdecode-named-character-reference's DOM build through../core's Markdown parser and fails ondocument. Workers resolve theworkerdcondition to the non-DOM file, so a Worker is unaffected.Conflicts
Merged main after moq-dev/quest#652 landed, carrying its edits into the moved modules:
signalsonStatusandpullRequestStatusinsrc/github/status.ts, theunanswered_signalreason insrc/github/land.ts, and thesignalline instatusLines. SincepullRequestStatusnow reads signals,src/cli/signals.tsandsrc/cli/online-review.ts(which use only the client) move tosrc/github/, and./githubexportstype Signal.quest status 652printed the same output on main and on the merged branch.Follow-ups
None recommended.
Models
🤖 Generated with Claude Code
(Written by Claude Opus 5.5 with medium)
Review
Rewritten by
quest reviewafter each round.Head: 70f2c9d
Base: origin/main at e31952e
Reviewer: Codex, gpt-6.1-sol, high effort
Session:
01a1d6d5-2826-7382-bbe0-1ee3b62abec9, round 3Score: 10/10,
Code inspection found no actionable regressions in the incremental merge integration, which preserves main’s signal checks and the GitHub readers’ independence from Node; builds and tests were not run as instructed.Rounds: 3; findings 0: fixed 0, refuted 0, open 0
Findings: none
Reviewer: Codex, gpt-6.1-sol, medium effort, shadow
Session:
01a1d6d5-2826-7fb1-a482-222dac5f866fRounds: 1; findings 0: fixed 0, refuted 0, open 0