Repository navigation
feat: add getReviewSnapshot for one-read review status and gaps - #89
Open
mrpmohiburrahman wants to merge 2 commits into
Open
mrpmohiburrahman wants to merge 2 commits into
mrpmohiburrahman wants to merge 2 commits into
Conversation
mrpmohiburrahman
marked this pull request as ready for review
November 29, 2026 10:28
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
getReviewSnapshot(orgId, reviewId)gives a status page everything it needs in one call: what the review's result means, a link that opens it in the browser, and a list of checks that are missing or unresolved. Today a programmer assembles that by hand: fetch the review, interpret its assessments, work out which checks never resolved, and build the review URL. The only SDK call that does this interpretation,waitForReview, starts a polling loop that can run for 20 minutes. The snapshot returns the same answer from a single read.The existing fixture
check-gating-unresolvedshows why the interpretation matters: the server saysCOMPLETED, the SDK outcome saysINCOMPLETEwithCHECKS_UNRESOLVED. The snapshot surfaces that distinction in one GET.Changes
getReviewSnapshotinsrc/index.ts. It reusesvalidateReview,terminalandoutcome; no new transport behavior, no new options, no retries beyond the normal read path.SnapshotStatusandReviewSnapshottypes. An active review reportsPENDINGorRUNNING; a snapshot never returnsTIMED_OUT.settledReason, shared bywaitForReviewand the snapshot.waitForReviewbehavior is unchanged.Manual test
pnpm install --frozen-lockfile pnpm build node --test --test-name-pattern='a review snapshot' tests/http.test.mjsExpect one passing test that covers every fixture case, including
review-running(one GET,RUNNING) andcheck-gating-unresolved(one GET,INCOMPLETE,CHECKS_UNRESOLVED).Proofline review
I ran a real Proofline review on this change in my own GitHub organization, on a mirror of this branch: lab PR #2 (review walkthrough).
Run 1 reported two warnings. I accepted both:
59edaeb: an active snapshot now returns emptygapsand a nullreason, and keeps the raw review.reasonand skipped gaps for active reviews. Fixed in the same commit: the test now asserts the expected reason for every settled case, and empty gaps plus a null reason for the active cases.Run 2 on the fixed commit: no findings, published to the lab PR.
Scope and overlap