Skip to content

The review brief's history remap passes the scan for unnoted exception branches - #2380

Merged
zlareb1 merged 1 commit into
mainfrom
fix/history-section-gather-note
Dec 6, 2026
Merged

zlareb1 merged 1 commit into
mainfrom
fix/history-section-gather-note

Conversation

@zlareb1

@zlareb1 zlareb1 commented Dec 6, 2026 •

Copy link
Copy Markdown
Member

Closes: #1909
Related: #2359

Changelog category (leave one):

  • CI Fix or Improvement (changelog entry is not required)

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_unnoted has failed on every main push since #2359 (runs 47629450470, 47629597947, 47631411873, 47631518020; a different pytest unit part N each time, by shard). It reports review_brief_build.py::_history_section::gather::1.

_history_section gathers code.symbol_history with return_exceptions=True, then remaps a record whose symbol.path is another file to {"verdict": "unknown"}. That remap was written as r 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 calls degradations.partial for 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::1 and notes.

Scope and risk

One expression in _history_section. CallOp returns a dict, so every non-exception result goes down the same path as before, and exceptions pass through unchanged.

Compatibility, rollout and rollback

  • Wire: none.
  • Operator steps: none.
  • Rollback: nothing left behind.

Tests

pytest tests/unit/test_degraded_unnoted.py tests/unit/test_*review_brief*.py: 218 passed (the first failed on main before the change). ruff format --check and ruff check clean.

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

  • Local format, lint, type checks and focused tests pass. The full make test-unit and applicable integration results are reported by CI; a full local run is not required before pushing.
  • Repository text has no dates, people, host names, internal namespaces, ticket or decision numbers; the history goes in this description (tests/unit/test_public_copy.py).
  • Commits are signed off (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_unnoted check on _history_section after parallel code.symbol_history gathers complete.

The post-gather remap that turns a dict whose symbol.path is not the requested file into {"verdict": "unknown"} used a ternary starting with isinstance(r, BaseException). The degradation scan treated that as an unnoted exception branch (the pass-through r path notes nothing), even though exceptions are handled in the loop below via degradations.partial.

The logic is rewritten to remap only when r is a dict with a mismatched symbol path, and otherwise leave r unchanged—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.

…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>
@vercel

vercel Bot commented Dec 6, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
loom-docs Ready Ready Preview Dec 6, 2026 10:12am UTC
loom-telemetry Ready Ready Preview Dec 6, 2026 10:12am UTC

Request Review

@zlareb1
zlareb1 merged commit f2eeb8a into main Dec 6, 2026
78 of 80 checks passed
@zlareb1
zlareb1 deleted the fix/history-section-gather-note branch December 6, 2026 10:31
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.

[tooling-ci:python-unit] Python unit checks failed on main

1 participant