Repository navigation
code.symbol_history and the review brief name the PRs behind a regression record - #2359
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
force-pushed
the
feat/brief-regression-evidence
branch
from
December 6, 2026 06:31
4424c92 to
b46bc89
Compare
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit d33bef6. Configure here.
…sion record code.symbol_history returns regression_prs: up to three PRs behind its named_fix_prs, reverts and caused_issues counts, strongest first, each with its title, merge date, kinds, fix_by, the issues it caused, up to four test files it changed and a code.test_gate query for them. A code.review_brief history row that makes `regressions` carries them. The counts and verdicts are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
regression_prs reads code_test_gate_run_templates as code.test_gate does, so a repository whose runner only that setting knows lists its tests before their fixtures. The brief copies the op's list as served. Tests cover the four-file cap and an override recipe on a made-up layout. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
… counts A test file no run recipe knows (a gtest, a JUnit class) now sorts before fixtures that are tests only by their directory, so the four-file cap keeps it. summarize counts named fixes, reverts and caused issues through the same rule regression_prs names them by, and the brief copies whatever the op returned. Test files are picked only for the PRs named. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…ents A fix counted only for closing an issue now ranks after every revert and culprit PR, so the three-entry cap keeps the stronger evidence. Each entry's test files are now one `test_gate` object, the code.test_gate arguments (org, namespace, files) for the namespace the history was read from, in place of a file list and a query that repeated it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…heir entries Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
A stored brief is read by every viewer of the code namespace. When a history record's tracker namespace is restricted, or its classification cannot be read, the brief's copy of regression_prs drops the caused_issue kind and its issue numbers, and an entry with no kind left, as the brief's qa section leaves that tracker out. The field comment states the order as the code sorts it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
A fix entry can rest on the tracker alone (its diff match or a fixes link), so filtering kinds left tracker facts in a stored brief and broke the cap and order. When the records' tracker namespace is restricted or unclassified the brief keeps the counts and carries no regression_prs. The docs say a listed test path may since be gone. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
A record whose tracker side raised names no namespace, so the brief now reads the namespace bound to the code namespace, as its qa section does, and only when a record names a PR. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
The binding can move between the op's read and the brief's check, so the brief is closed when the bound tracker or any tracker a record says it read is restricted or unclassified. A handler test shows the deployment's run templates reach the ordering. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…template is no recipe A brief that leaves out regression_prs because the tracker's classification could not be read is served and not stored, so the next read builds it again; no verdict rests on it. run_command_for treats a template that does not format as no recipe, so it cannot fail code.symbol_history. 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>
zlareb1
force-pushed
the
feat/brief-regression-evidence
branch
from
December 6, 2026 07:37
78191bc to
8426c88
Compare
Four config files of one integration suite no longer push another suite the PR changed out of the four-file cap: within the order, one file of each run command comes before a second of it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
A record whose symbol resolved to another file is discarded before the tracker gate, so its tracker no longer keeps the brief unstored. The regression_prs field description is one sentence, and the suite-ordering test uses a made-up run template. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
This was referenced Dec 6, 2026
Merged
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
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.symbol_historyreturnsregression_prs, the PRs behind its fix, revert and caused-issue counts with their titles, merge dates, the test files they changed and acode.test_gatequery for those tests. Thehistoryrows ofcode.review_briefthat makesymbol_with_regressionscarry them.Why
The brief's
historysection kept only counts per touched definition (named_fix_prs,reverts,caused_issues). An analyst who seessymbol_with_regressionscould not tell which earlier PR it rests on, what it fixed or which test guards it, so the gap could not be replayed.code.symbol_historyalready builds the PR rows those counts come from. This change names them.Each entry has
pr_number,title(the one-line cause),merged_at(date) andkinds(fix,revert,caused_issue). Acaused_issueentry hascaused_issues. Afixentry hasfix_by:titlewhen the title says fix, crash, regression and the like, orlinked_issuewhen the PR counts as a fix only because it closes an issue. When the PR changed test files,test_gateholds thecode.test_gatearguments{org, namespace, files}, so the call can be replayed as-is in the namespace the history was read from.filesholds up to 4 of the PR ledger's test paths: runnable first, then test-named files, then fixtures. The list is read from the whole window.limitonly boundsprs, and the brief asks for 5. At most 3 entries, in this order: a PR behind more of the counts first, then any entry before alinked_issuefix, then fix, revert, caused_issue, then the newest.Measured on a large C++ repository (to re-run: for each history row that makes
regressionsin a stored brief, callcode.symbol_historyover HTTP withlimit: 120, rebuildPrRows from itsprswith thefilesof each PR fromloom.code_pr_history, and call this branch'sregression_prson them): the 40 newest stored briefs whose history saysregressionsnamed no PR. The fix computesregression_prswith this branch's code over livecode.symbol_historyrows and the ledger's file lists, for 14 of those briefs (one regression row each). That gave 22 entries. Checked by hand against the issue and PR titles:caused_issueandrevertentries: 15 of 16 are genuine culprits (the issue describes a bug the PR introduced; one is a feature request tied to a stress-test PR).fixentries withfix_by: title: 2 of 2 are real bug fixes of the function.fixentries withfix_by: linked_issue: 0 of 6 are bug fixes. They are performance or refactoring PRs that close an issue.The last result comes from
is_fix_title, which counts any PR that closes an issue as a fix. This change leaves the counts and the verdict alone. Instead,fix_bydiscloses the weak case, and such a fix ranks after every revert and culprit PR, so the cap of 3 keeps the stronger evidence.Assumptions about the repository
Every assumption, and why it holds for any repository Loom indexes:
is_test_pathaccepts: a test directory, or a test file name in the languages its pattern lists (Python, shell, SQL, Ruby, Go, Rust, C and C++, the JavaScript family, Java, Kotlin, C#, Swift, PHP). Anything else outside a test directory is not listed. A PR that changed none has notest_gate.code.test_gatehas a run recipe for (its built-in ones and the deployment'scode_test_gate_run_templates), then files whose own name marks them as tests (test_x.py,XTest.java,gtest_x.cpp), then fixtures that are tests only by their directory. So a gtest or JUnit layout with no recipe still keeps its test ahead of its fixtures. Within that order, one file of each run command (such as one integration suite's directory) comes before a second file of the same command, so one suite's files cannot crowd another out.fix_by: titlereuses the fix-word rule that already decidesis_fix. It is not a new list. A repository whose titles never use those words still gets every fix, markedlinked_issue.caused_issuecomes from the tracker'scaused_byedges. Without a bound tracker the kind does not occur, as today.code.test_gate's existing built-ins (pytest, Go, vitest, Rust, and a ClickHouse stateless-test recipe) plus the deployment's setting. A recipe only lifts the files it matches, so a repository it does not match keeps the test-named-then-fixture order.Unit tests use a made-up layout (
spec/tally.caseandspec/<suite>/with custom run templates,tests/test_items.py,tests/fixtures/*.json).Second repository: Loom's own Python code base. The scan covered the history rows of its 80 newest briefs (104 functions). Five functions have live named fixes. Each got one entry, all
fix_by: linked_issue, because its PR titles state the outcome rather than saying "fix". All 5 carry the PR's own tests intest_gate, for exampletests/unit/test_llm_anthropic.pyforAnthropicLLMClient.completeandtests/unit/test_gitrepo_ca_file.pyforgitrepo.auth_env. On that code base the fix-title rule never fires, whichfix_bymakes visible.Scope and risk
Read-only. The handler adds one field, built from rows it already computes. No new query: the ledger read already selected
files. The brief copies at most 3 entries per row, and only onto rows that makeregressions. That is at most 6 definitions × 3 entries, each with ≤4 paths and a 160-character title, with no list repeated. Section verdicts,decisionsandhistory_verdictare unchanged.summarizenow counts named fixes, reverts and caused issues through the same rule that names them, with the same conditions as before. Payload version is unchanged: the field is additive and records no cap or failed read. Tenant scope: the op's entries come from the same scoped ledger and tracker reads. A stored brief is read by every viewer of the code namespace, so the brief follows the restricted-tracker rule itsqasection uses. The brief carries noregression_prswhen a tracker namespace a record may rest on is restricted, or its classification cannot be read (fail closed; an unread classification also keeps the brief unstored, so the next read builds it again). That covers two namespaces: the one bound to the code namespace, read from the binding as theqasection reads it, and each one a record says it read, since the binding can move during a build. A fix entry can rest on the tracker alone (its diff match or afixeslink), so a partial filter would not be safe. The row's existing counts already crossed into stored briefs before this PR. Removing them would change what makesregressions, which stays as it is.test_gate.filesare the ledger's paths for the PR, so a path that PR deleted, or a later PR renamed, may be gone; the docs say so. The behaviour is language-neutral (PR ledger and existing test-path rules).Compatibility, rollout and rollback
code.symbol_historyoutput addsregression_prs.code.review_briefhistory rows addregression_prswhere they makeregressions. SDK tables regenerated.Tests
tests/unit/test_code_symbol_history.py: ranking, kinds,fix_by, test-file order (built-in and deployment recipes, test-named files before fixtures on a gtest and a Java layout with no recipe) and the four-file cap, the newest-first tie-break, and that a fix that touched only the file is neither counted nor named,test_gateonly with tests and carrying the read's org and namespace. Also, the handler serves the same evidence atlimit=1as atlimit=3.tests/unit/test_code_review_brief_sections.py: the row that makesregressionscarries the op's entries and a clean row does not.test_history_rows_name_no_pr_a_restricted_tracker_read(six cases): a restricted or unclassifiable tracker, bound or read by a record, leavesregression_prsout; an unread classification keeps the brief unstored with no cause; counts and verdict stand.test_a_template_that_does_not_format_counts_as_no_recipe: a deployment template with a stray brace, a missing attribute or a bad index does not fail the op.make format-check,make lint, mypy on the changed modules, the brief, symbol-history, docs-reference, public-copy, package-contract and SDK-generation unit tests.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. It also ran the measurement above and checked the sampled PRs and issues by hand.
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.docs/describe the system as it now is, and this description names any operator steps and wire changes.git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code
Note
Low Risk
Read-only, additive API field with access-control gating aligned to existing brief QA rules; no new persistence or auth paths.
Overview
Adds
regression_prstocode.symbol_history: up to three PRs that explain the summary’s named fixes, reverts, and caused-issue counts, ranked by strength, withkinds,fix_by(titlevslinked_issue), optionalcaused_issues, and a replayabletest_gatepayload when the PR changed test paths (ledgerfiles, ordered viacode.test_gaterecipes).summarizenow derives those counts with the same evidence rules asregression_prs.code.review_briefhistory rows that drivesymbol_with_regressionscopyregression_prswhen tracker namespaces are readable and not restricted (_tracker_gate); otherwise counts stay but PR names are omitted, and unread classification blocks storing the brief.test_gategainsis_test_namedand tolerates bad run templates without failing the op. SDKs, API models, and docs are updated; unit tests cover ranking, test-file caps, tracker gating, and brief propagation.Reviewed by Cursor Bugbot for commit f705d55. Bugbot is set up for automated code reviews on this repo. Configure here.