Repository navigation
Conversation
A brief stored before payload version 2 records no cap or failed read, so brief_verdict answers it unsettled with brief:v1 on every read, and the point read served it as stored with no way to refresh it. A read now treats it as a miss: the brief is built again and stored when the caller's store flag allows. When that build cannot run, the stored brief is served as before. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
… in degraded Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
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.
Related: #2040
Related: #2046
Changelog category (leave one):
Changelog entry (one or two sentences a user of Loom can read without the diff; the release pull request collects these into the release notes):
code.review_briefbuilds a brief stored at an older payload version again on read, and stores the new one whenstoreallows, so a PR briefed before the verdict can settle; when that build fails or notes a fallback, the stored brief is served as before, anddegradednamescode.review_brief: stored_brief_served.Why
A brief stored before payload version 2 records no cap or failed read, so
brief_verdictanswers itunsettledwithbrief:v1on every read. The point read served a stored brief exactly as built: no field rebuilt it, andstore: falseor a measurement consumer still read the stored row. Every merged PR briefed before version 2 could therefore never settle, and a client that acts on the verdict had no way out.A stored brief of an older version is now treated as a miss: the read builds it through the same path as a PR that was never briefed, and the stored row is replaced (the point read takes the newest
built_at). The old payload is served instead when the rebuild returns nothing, raises, or notes any fallback in its own note scope (for example a diff it could not read on a replica without the mirror, which would otherwise replace a complete stored brief with a thinner unsettled one). Its notes are dropped, and the response namesstored_brief_servedinstead.Scope and risk
server/code/app/review_brief.pyonly.Compatibility, rollout and rollback
Tests
test_a_brief_stored_at_an_older_payload_version_is_rebuilt_on_read: a version-1 row is rebuilt, stored at the current version and settles like a fresh build; with the diff unreadable, with the build failing, and with a ledger read before it raising, the stored brief is served withstored_brief_servedand withoutbrief_missing.test_code_review_brief_sections.pynow carry the current version; the version-1 rationale cases force the build to fail so they still cover the fallback.🤖 Generated with Claude Code
Note
Medium Risk
Changes cached-brief serving for all PRs still on pre-v2 payloads (extra build on first read); fallback path must not surface rebuild failures as missing briefs.
Overview
Fixes merged PR review briefs that stayed
unsettledforever when cached at payloadv< 2 (brief:v<n>), because older stored rows never recorded caps or failed reads and were served unchanged.On read,
_payload_forinreview_brief.pynow treats an outdated stored brief like a miss: it calls a new_buildhelper to rebuild (and replace the row whenstoreallows). A successful clean rebuild returns the fresh brief; if rebuild fails or records degradations (unreadable diff, etc.), the old payload is still returned asprecomputed, withdegradednotingcode.review_brief: stored_brief_servedand rebuild-time notes suppressed viadegradations.scoped().Docs in
history-and-prs.mddescribe the new read path. Tests cover happy-path rebuild plus fallback when diff, build, or ledger reads fail.Reviewed by Cursor Bugbot for commit 2d525c7. Bugbot is set up for automated code reviews on this repo. Configure here.