Repository navigation
The review brief's history remap passes the scan for unnoted exception branches - #2380
Merged
Merged
Conversation
…ion branch The remap that turns a record of another file's definition into unknown tested each gathered result for an exception and passed it through. The broad-handler scan reads that pass-through as a fallback that notes nothing, so test_degraded_unnoted failed on main. It now tests what it means, a record whose symbol path is another file; the loop below still notes each failed read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
Closes: #1909
Related: #2359
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):
...
Why
test_degraded_unnotedhas failed on everymainpush since #2359 (runs 47629450470, 47629597947, 47631411873, 47631518020; a differentpytest unit part Neach time, by shard). It reportsreview_brief_build.py::_history_section::gather::1._history_sectiongatherscode.symbol_historywithreturn_exceptions=True, then remaps a record whosesymbol.pathis another file to{"verdict": "unknown"}. That remap was written asr if isinstance(r, BaseException) or <same file> else unknown. The scan reads an exception test in a conditional as the exception's fallback branch, and this branch (r) calls nothing, so it counts as unnoted. The exception is in fact passed on to the loop below, which callsdegradations.partialfor it.The remap now tests what it means, a dict record whose symbol path is another file, so it holds no exception test. The loop's branch becomes
gather::1and notes.Scope and risk
One expression in
_history_section.CallOpreturns adict, so every non-exception result goes down the same path as before, and exceptions pass through unchanged.Compatibility, rollout and rollback
Tests
pytest tests/unit/test_degraded_unnoted.py tests/unit/test_*review_brief*.py: 218 passed (the first failed onmainbefore the change).ruff format --checkandruff checkclean.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated (an agent wrote most of the diff): Claude Code; I checked the scan's site ordering against the failing key and the remap's behaviour for dict and exception results.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist
make test-unitand applicable integration results are reported by CI; a full local run is not required before pushing.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code
Note
Low Risk
Single list-comprehension refactor in review brief history; no wire or storage changes, and semantics for dict and exception results are unchanged per the PR description.
Overview
Fixes a failing
test_degraded_unnotedcheck on_history_sectionafter parallelcode.symbol_historygathers complete.The post-gather remap that turns a dict whose
symbol.pathis not the requested file into{"verdict": "unknown"}used a ternary starting withisinstance(r, BaseException). The degradation scan treated that as an unnoted exception branch (the pass-throughrpath notes nothing), even though exceptions are handled in the loop below viadegradations.partial.The logic is rewritten to remap only when
ris a dict with a mismatched symbol path, and otherwise leaverunchanged—including exceptions—so behavior stays the same for successful op results and errors.Reviewed by Cursor Bugbot for commit 2a78c90. Bugbot is set up for automated code reviews on this repo. Configure here.