Skip to content

feat: add getReviewSnapshot for one-read review status and gaps - #89

Open
mrpmohiburrahman wants to merge 2 commits into
prooflinedev:mainfrom
mrpmohiburrahman:feat/review-snapshot
Open

mrpmohiburrahman wants to merge 2 commits into
prooflinedev:mainfrom
mrpmohiburrahman:feat/review-snapshot

Conversation

@mrpmohiburrahman

@mrpmohiburrahman mrpmohiburrahman commented Nov 27, 2026 •

Copy link
Copy Markdown

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-unresolved shows why the interpretation matters: the server says COMPLETED, the SDK outcome says INCOMPLETE with CHECKS_UNRESOLVED. The snapshot surfaces that distinction in one GET.

Changes

  • getReviewSnapshot in src/index.ts. It reuses validateReview, terminal and outcome; no new transport behavior, no new options, no retries beyond the normal read path.
  • SnapshotStatus and ReviewSnapshot types. An active review reports PENDING or RUNNING; a snapshot never returns TIMED_OUT.
  • The incomplete-result reason text moves into settledReason, shared by waitForReview and the snapshot. waitForReview behavior is unchanged.
  • One test replays all 43 contract fixtures through the snapshot: settled cases match the wait outcome and gaps; the two active cases return after exactly one request.
  • A short README section with an example.

Manual test

pnpm install --frozen-lockfile
pnpm build
node --test --test-name-pattern='a review snapshot' tests/http.test.mjs

Expect one passing test that covers every fixture case, including review-running (one GET, RUNNING) and check-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:

  1. Active reviews reported unfinished assessments as gaps. A status page could show incomplete-result warnings for work still in progress. Fixed in 59edaeb: an active snapshot now returns empty gaps and a null reason, and keeps the raw review.
  2. The snapshot test never asserted reason and 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

@mrpmohiburrahman
mrpmohiburrahman marked this pull request as ready for review November 29, 2026 10:28

This branch has not been deployed

No deployments
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