Skip to content

The test gate touches only the edited definitions and labels every test with its evidence - #1707

Merged
zlareb1 merged 9 commits into
mainfrom
fix/test-links-gate-evidence-links
Nov 28, 2026
Merged

zlareb1 merged 9 commits into
mainfrom
fix/test-links-gate-evidence-links

Conversation

@zlareb1

@zlareb1 zlareb1 commented Nov 28, 2026 •

Copy link
Copy Markdown
Member

Related: #1696
Related: #1709

Changelog category (leave one):

  • Backward Incompatible Change

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.test_gate touches only the functions and classes a diff's changed lines sit in, labels every test with its kind of evidence in why (changed_test, coverage, static_call, stem_partner, test_map, file_neighbor; graph_hop is now static_call), and splits the touched definitions into untested (a verified coverage run measured them unexecuted) and the new unlinked (the index links no test to them, which is not proof that none runs them). The Claude Code and Codex plugins word the two differently and ask for a test only for untested; the new lists need the next server release.

Why

The gate's two lists did not say what they claimed. Measured against two kinds of ground truth, for Python repositories at the revision the index holds:

  • Gold patches with their failing tests. For 59 changes with a known fix and the tests that fix makes pass, the gate ran on the fix's diff. It listed 75% of the edited functions as untested on the development repositories, and for 39% of those the same answer's tests named the file of a test that exercises them. It touched 208 definitions the patch does not edit against 61 it does, because a hunk header naming as_sql selected every as_sql in the file and context lines leaked into neighbours. Class-body edits touched nothing: an edit to an attribute of two classes answered obligations: false, epistemic: "exact".
  • Per-test coverage. For three repositories whose own suite ran with per-test coverage, untested held 66% of the definitions a test executes and 83% of the ones no test executes on the development pair: the list did not separate them.

The cause is in how seeds are picked and in what a missing edge is taken to mean:

  • Seeds. The index holds the revision a diff starts from, so the old side of the diff is what matches it. The gate matched new-side hunk spans, which include context lines and shift after a file's first hunk, and put the hunk-header name first.
  • Classes and constructors. The gate read no classes, and a Python class call ends at the class symbol, so no test ever reached an __init__.
  • Absence. For half of the definitions a test executes, no static candidate links a covering test: tests reach code through fixtures, string dispatch and public entry points. A call graph cannot show that no test runs a definition.

What the gate does now:

  • Touched definitions. The innermost function or class holding a changed old-side line. An insertion sits between two old lines and touches the definition that holds both. Two more cases need the diff's lines, which the hooks do not send: added lines that are all decorators touch the definition below them, and in Python a run indented as deep as the old line above it touches the definition that line ends. Text added directly above a definition is otherwise a new definition the index does not hold, so it touches nothing. A hunk sent without its lines changes what its header's old range says. A changed line in no definition touches nothing and adds the cause unmapped_changes; so does a changed source file that touches no definition. Rows that share a qualified name in one file and sit apart are different definitions (a property's getter and setter, the arms of a conditional definition), and a changed line touches the one it sits in: the store folds the two tiers' rows of one definition where their spans coincide, and the gate folds nothing by name. code.impact's diff shape uses the same rule and still seeds functions only.
  • Links through another definition. A class's callers credit its __init__ and __new__ (via: constructor), and a function's callers credit the functions nested in it (via: enclosing).
  • File neighbours. One grouped read returns the test files that call other definitions of the edited files, most callees first, a definition both tiers hold counted once. They say nothing about a touched definition, so the server lists them only while the other kinds leave fewer than four rows, and never more than fill the list to four.
  • Order. changed_test, coverage, static_call, stem_partner, test_map, file_neighbor. Within a kind a file a call chain names a test in is first, the nearest hop before the others, then the file linked to more touched definitions, then the one with more tests doing so, then the more specific coverage row. A coverage row carries the specificity of its test-map row as confidence, and when a call chain links the file too it keeps the chain's test name, hop, callers and via. A test file is listed once, under its first kind.
  • Two lists. untested needs a coverage run at a commit the index verified, read against the definition's body: the lines after the first of every extent a tier holds of it at the run's commit. The first line is the declaration, which runs when the module is imported, under whichever test imports it first. A definition with no extent wider than one line is not measured. unlinked is everything else with no call chain to a test, and no file-level row clears it. obligations is true for tests or untested only.
  • epistemic. measured needs a verified run for every touched definition, every changed line in a definition and every changed source file touching one. causes keeps the call graph's causes under either value, because they limit tests; truncated is also set when the read of the coverage rows was cut. A change of test files only touches no source definition and is lower_bound with no cause.

Decisions taken on the development repositories, by rules stated before the held-out run:

  • Header fallback. A hunk whose lines sit in no definition used its header name in 3 development hunks and was wrong in all 3 (module-level code after a function). The name is now used only for a definition the index holds no body extent for.
  • Order within static_call. Ordering by links and linking tests moved the first test file that the fix makes pass to rank one for 40 of 79 definitions against 27 by path, and was worse for no instance.
  • Nested functions. The first run lost 9 links to closures that the old over-touch had credited through their enclosing function; crediting the enclosing function's callers restored them.
  • Order of kinds. By the share of a kind's rows that sit in a covering test's file, on the development index with an imported coverage run: 97% for coverage, 91% for static_call, 53% for stem_partner, 31% for test_map. With the map ahead of the call-chain rows, as before this change, a test file a call chain links was listed as a map row and lost the test's name and links_to: static_call rows fell from 181 to 19.
  • Order within coverage. Three orders were compared on the same development answers, by how often the first row is the file holding the most tests that execute the definition: a chain-linked file first and then the more specific row, 136 of 200 (181 within three); a chain-linked file first and then by path, 128 (170); the more specific row first and then the chain, 134 (177). The first is used. Ordered by path alone, as at the previous commit of this branch, it was 106 (169).
  • File neighbours fill to four. On development the answer then holds a test file the fix makes pass for 27 of 40 changes with 7.2 files per answer. Every neighbour, up to 200 rows, holds one for 37 of 40 with 41 files. 47% of neighbour rows sit in a covering test's file, between stem_partner and test_map; they stay last because they are a fill and take no row's place.
  • No confidence on static_call rows. The share of named tests that execute the linked definition was 92 of 102, 48 of 61 and 38 of 61 at one, two and three hops on two repositories. A number that is a function of the hop alone, ignores the edge's own tier and has no held-out figure per hop is not served.

Scope and risk

  • Touches code.test_gate, the diff shape of code.impact, and the plugins' wording.
  • Leaves alone what the index stores, code.callers, code.edit_context, code.coverage_claim and the test map. No migration, no setting, no re-index.
  • Index behind the diff's base. The changed lines are matched against the indexed revision. When a file changed on the indexed branch after the diff's base, a line can land in a neighbouring definition; the header name no longer corrects that. The old rule matched new-side lines, which were off after a file's first hunk even without drift.
  • Text added above a definition. The hooks send hunk headers only, so a decorator added above a function reads as a change in no definition: the gate answers unmapped_changes and the file's neighbours. One of 41 development changes is of this kind (decorators added to six classes). A caller that sends the diff with its lines gets the classes.
  • A mined test map. The only map measured is the one a coverage import writes. A map mined from history or naming keeps its two kinds and sorts after call-chain rows, where main sorts it before them; that order is measured on coverage rows only.
  • Same name and signature. A symbol's id is its qualified name and signature, so two definitions that share both in one file (the two arms of a conditional definition with one signature) are one row in the index. An edit in the arm the index does not hold lands in the enclosing definition or adds unmapped_changes.
  • Other languages. Every measured repository is Python. The constructor credit and the indentation rule are Python's; the line rule and the neighbour read are language-neutral and unmeasured elsewhere.
  • Hooks. A held stop and the edit-time line name 7.2 test files per change on development (3.9 before) and 3.1 held-out (1.2), and show at most four commands as before. A change whose only finding is unlinked no longer holds a stop. The edit-time line names the changed definitions from unlinked.
  • Cost. The touched rule merges a file's removed ranges before one walk, so a headers-only diff of 10,000 hunks that each claim a 100,000-line file costs one pass over the file's definitions.

Compatibility, rollout and rollback

  • Wire, code.test_gate output. tests[].why values are changed_test, coverage, static_call, stem_partner, test_map, file_neighbor: graph_hop is renamed static_call, coverage and file_neighbor are new, and stem_partner and test_map rows now follow the call-chain rows. coverage rows carry links_to and confidence, and the hop, callers and via of a call chain that links the file too, whose test evidence then names after the measurement. static_call rows gain callers, links_to and via; file_neighbor rows carry callees. New unlinked, unlinked_total, unlinked_capped. untested rows gain commit and the list is empty without a verified coverage run. obligations no longer counts unlinked definitions. epistemic is measured or lower_bound, never exact; causes gains unmapped_changes and no_coverage, is no longer emptied, and holds truncated also when the read of the coverage rows was cut. touched_symbols can hold classes.
  • Wire, code.impact. Diff-shaped touched_symbols holds the functions the changed lines sit in; via: header appears only for a definition without a body extent.
  • Plugins. Version 1.2.77 for both. Against a server of the previous release the hooks name tests as before and name no unlinked or unexecuted definition, because that server's untested rows carry no commit and it serves no unlinked. A plugin of the previous release against this server names the tests of tests, which hold at most four rows when only neighbours are found, and names no function, because untested is empty without a coverage run.
  • Operator steps. None.
  • Rollback. Reverting restores the old answer; nothing is stored.

Tests

The measurement asks a server started from this branch the same questions as one started from main, on the same read-only indexes, and scores the answers offline. Repositories were split into development and held-out before any answer was scored. Every column of this branch is read at commit a6c2c82, after the fixes of two reviews. Each round fixed its rule on the development repositories first and then read the held-out columns once at the frozen commit; the first two tables came out the same as at the previous round's commit, row for row. The main column of the third table is the baseline commit on the same coverage index. One pass of the third table's development sample lost six calls to the evaluation database's memory limit while three servers shared it and was asked again alone; no call failed in the runs reported.

Gold patches, gate at depth 2 (a test file is right when it holds a test the fix makes pass):

Measure Development before after Held-out before after
Changes / edited definitions 40 / 79 19 / 31
Labelled definitions in touched_symbols 61 77 27 30
Touched definitions the labels do not hold 208 0 39 0
Names no test 37% 3% 39% 0%
Right test file first 19% 51% 48% 68%
Within three 44% 73% 55% 77%
At any rank 53% 73% 55% 77%
Listed untested 46 of 61 0 of 77 18 of 27 0 of 30
Listed unlinked 46 of 77 16 of 30
unlinked with the right file in the same answer 31 of 46 12 of 16
The answer holds the right file (changes) 13 of 40 27 of 40 10 of 19 14 of 19
Test files per answer 3.9 7.2 1.2 3.1

The two rows about the touched set measure agreement with the labelling rule, not independent truth: the labels are the innermost definition of each old-side line, the rule the gate now uses. The labels also count text added just above a top-level definition as that definition, which the gate does not: that is the one held-out label it no longer touches, and the two development labels it never touched (a method added at the end of the class above).

Per-test coverage, gate at depth 2, index without a coverage import (one-line diffs inside sampled definitions; a test is right when coverage shows it executes the definition):

Measure Development before after Held-out before after
Sampled definitions a test executes / none executes 200 / 24 100 / 20
Executed definition: names no test 59% 1% 86% 5%
A covering test's file first 38% 85% 14% 81%
Within three 40% 92% 14% 88%
At any rank 40% 92% 14% 88%
A covering test function within three 33% 36% 14% 25%
Named test functions that execute the definition 89% (126/142) 89% (140/157) 100% (21/21) 96% (70/73)
Named test files that hold a covering test 91% (147/162) 59% (406/692) 100% (22/22) 58% (202/346)
static_call rows in a covering test's file 91% (164/181) 93% (92/99)
file_neighbor rows in a covering test's file 47% (242/511) 45% (110/247)
Executed definition listed untested 66% 0% 86% 0%
Unexecuted definition listed untested 83% 0% 53% 0%
Executed definition listed unlinked 56% 74%
Unexecuted definition listed unlinked 83% 53%
Unexecuted definition: a test is named 17% 75% 35% 100%

Without a coverage run untested is empty, and unlinked separates executed from unexecuted code no better than the old list did, which is why it is worded as the index's view and asks for nothing.

The same sample on an index with the coverage run imported. The three repositories were indexed into a new database (2 minutes 20 seconds), and each suite's per-test coverage was loaded through the coverage importer from a source in the importer's table layout, at the indexed commit. main has no untested from a coverage run, no coverage kind and no measured answer, so its column holds the order rows only:

Measure Development main this branch Held-out main this branch
Touched definitions a test executes / none executes 198 / 23 100 / 15
Executed definition listed untested 0 of 198 0 of 100
Unexecuted definition listed untested 18 of 23 15 of 15
Unexecuted definition not measured (the run holds no line of its file) 4 0
Unexecuted definition read as executed 1 0
Answers with epistemic: measured 219 of 224 119 of 120
A covering test's file first 80% (161/200) 99% (198/200) 91% 100%
Within three 89% (178/200) 100% (199/200) 97% 100%
The file with the most covering tests first 44% (87/200) 68% (136/200) 65% 70%
Within three 66% (131/200) 90% (181/200) 72% 86%
A covering test function within three 0% 36% (72/200) 0% 25%
coverage rows in a covering test's file 99% (649/655) 100% (289/289)
static_call rows in a covering test's file 77% (56/73) 86% (42/49)
stem_partner rows in a covering test's file 50% (14/28) 36% (5/14)
test_map rows in a covering test's file 29% (565/1936) 10% (98/956)

The order of kinds chosen on development holds on held-out. The one unexecuted definition read as executed is a function whose own body ran only at import while a test ran the function nested in it; the gate reads a definition's extent with the definitions nested in it.

What the second review's fixes changed in this table, against the previous commit of this branch on the same answers:

  • Order within coverage. At that commit the covering files of one definition tied and were listed by path. The file with the most covering tests was first for 53% of development definitions and 55% of held-out ones, which on held-out was below main's 65%; it is now 68% and 70%. A covering test function was within three for 9% and 2%, and is now 36% and 25%, the same as on the index without a coverage run.
  • The declaration line. In the three suites the declaration line of 97 of 1,094 definitions ran under a test, and in none was it the only line of the definition a test ran, so no untested answer changed. Eleven development coverage rows were of a test that ran the declaration line and no line of the body (a nested function's def runs with the function around it); they are gone, and the kind's share of rows in a covering test's file went from 97% to 99%.
  • Same-named definitions. No sampled or gold definition shares its name with another in its file: the first two tables are unchanged, and the rule is covered by a unit test of a getter and setter with a run that executed one.

What got worse:

  • File-level rows for code no test runs. Without a coverage run a test is named for 75% of the sampled definitions no test executes (17% before) and for all 20 on held-out (35%). Most are file_neighbor rows, which is why the kind is labelled, capped and never clears unlinked. On held-out, four are @overload stubs the index holds no symbol for: their line is now the class body's, so the class is touched and its tests are named. Over all rows, 59% of the named files hold a covering test against 91% before.
  • Map rows of a coverage import. The import writes file-level map rows, and the gate lists about ten per answer after the rows about the definition; 29% of them hold a covering test on development and 10% on held-out.
  • Named test functions on held-out gold patches. 15 of the named functions are tests of the fix against 17 before, among 69 named against 32, and the static_call rows alone hold the right file within three for 48% against 55% for every row before; the file neighbours bring it to 77%.
  • Decorators through the hooks. See Scope and risk.

Cost, from system.query_log on indexes of up to 56,000 symbols, under a loaded host: the neighbour read took 43 ms at the median and 253 ms at most, read at most 97,280 rows and 7 MiB, and used at most 8 MiB. With a coverage run the measured path adds a keyed read of the coverage files (15 ms at the median, at most 34 rows) and of the test map (13 ms, at most 440 rows). Nothing is indexed or stored.

Also checked:

  • A diff whose hunk carries fewer lines than its header counts no longer hides the file after it.
  • The headers-only zero-context diff the hooks send touches the same definitions and names the same tests as the full patch for 40 of 41 development changes; the other is the decorator change above. code.impact's diff shape answers all 41.
  • ruff format --check, ruff check, the mypy gate, the function-length gate, every generator's --check, the analyzer corpus (one changed shape; the second review's fixes change no statement), the Codex copies' --check, and node --test on the plugin's gate tests.

Not verified here:

  • A one-line compiler row on a real index. The measured indexes are parser-tier only, so a definition the compiler tier holds as its declaration line, and one whose tiers were parsed at different commits, are covered by a unit test over rows folded as the store folds them and not by the measurement.
  • Coverage from another tool or language. The coverage here is line coverage of Python suites with one context per test, where a declaration is reported on its first line and the parser's extent starts there. A declaration reported on a later line (a tool that reports each line of a signature, an extent that starts at an annotation) run by an importing test would still read a function executed whose body did not run. The statements of a class body run at import too: a class reads executed when a test is the first to import its module.
  • The Python unit suite. Left to CI; the changed and new test functions were called directly, outside the suite, and pass, and the ones added for the second review fail at the commit before it. The analyzer corpus differs from its builders in one statement shape of memory.for_file on main too; this change leaves it.
  • The whole plugin test suite on a loaded host. Locally only the gate's test file ran; CI runs the suite on every platform.
  • claude plugin eval. It needs model calls.

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. Checked by measurement on ground truth as described above, by reading the diff, and by the gates listed.

  • 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.
  • Generated files are regenerated in this PR, not by hand: the SDK op tables, docs/reference/configuration.md and the docs/reference/ tables (python scripts/codegen/docs_reference.py), the reach manifest, schemas/schema.sql (make schema-dump) and the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py).
  • A new migration is additive and numbered after the latest on main; no merged migration is edited.
  • A behaviour change to any file a plugin ships (hooks/, lib/, bin/, skills/, .mcp.json, the Codex plugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.
  • The frontend builds (npm --prefix frontend run build) and its tests pass, if frontend/ changed.
  • Docs under docs/ describe the system as it now is, and this description names any operator steps and wire changes.
  • 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.
  • I signed the Contributor License Agreement (CLA) if CLA assistant requested a signature.

🤖 Generated with Claude Code


Note

High Risk
Backward-incompatible code.test_gate and diff-shaped code.impact semantics affect pre-PR and plugin stop hooks; accuracy now depends on coverage imports and diff shape (headers-only vs full lines).

Overview
code.test_gate is reworked so a diff seeds only the innermost definitions whose old-side changed lines sit inside them (classes included), with finer placement rules for insertions, decorators, and Python indentation; unmapped lines add unmapped_changes. Test recommendations are evidence-typed (coverage, static_call replacing graph_hop, file_neighbor, etc.) via a new link path instead of crediting tests only through a reverse call walk.

Touched code splits into untested (verified coverage measured the body unexecuted, with commit) and unlinked (no coverage and no static chain—informational, does not drive obligations). epistemic is now measured or lower_bound (not exact); obligations ignores unlinked alone.

The same diff parsing applies to code.impact touched_symbols. Claude Code / Codex plugins (v1.2.77) mirror the wording: stop hooks prompt on unexecuted coverage only; edit-time lines surface unlinked separately. Docs, SDK types, and measured_definitions in coverage support the new contract.

Reviewed by Cursor Bugbot for commit 79b960e. Bugbot is set up for automated code reviews on this repo. Configure here.

@vercel

vercel Bot commented Nov 28, 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 Nov 28, 2026 5:46pm UTC
loom-telemetry Ready Ready Preview Nov 28, 2026 5:46pm UTC

Request Review

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/symbol/diff.py Resolved
Comment thread server/code/app/symbol/diff.py Resolved
zlareb1 and others added 2 commits November 28, 2026 19:40
…st with its evidence

code.test_gate picked its seeds from hunk-header names and new-side hunk spans,
read no classes, and listed a touched definition as `untested` whenever the
static graph held no test edge to it. Against SWE-bench Verified gold patches
and per-test coverage that list flagged tested and untested code alike.

- The touched definitions are the innermost function or class holding a
  changed old-side line (the revision the index holds). A hunk sent without
  its lines changes what its header's old range says, so the hooks' zero-context
  headers read the same. A header name is used only for a definition the index
  holds no body extent for. code.impact's diff shape shares the rule.
- A class's callers credit its `__init__` and `__new__`, and the callers of a
  function credit the functions nested in it.
- Each test row says its kind of evidence in `why`: `changed_test`, `coverage`,
  `static_call`, `file_neighbor` (new: the test files calling other definitions
  of the edited files, one grouped read), `test_map`. `graph_hop` and
  `stem_partner` are gone.
- `untested` holds only definitions a verified coverage run measured
  unexecuted. `unlinked` holds the ones no run measured and no call chain links
  a test to; a file-level row never clears it, and it is no obligation.
- `epistemic` is `measured` or `lower_bound`, never `exact`.
- The plugins say "the index links no test to" for `unlinked`, "measured
  unexecuted at <commit>" for `untested`, ask for a test only for the latter,
  and ask for file neighbours only up to four tests in all.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
A diff whose hunk carries fewer lines than its counts, followed by another
file's `---`/`+++` header, read that header as a removed and an added line and
lost the file. The header is now recognised when a hunk header follows it, or
when the hunk has no line yet.

The operations guide lists the evidence kinds instead of adding a table, so
the cell positions of the page's other tables stay where its translations
expect them.

Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>

@cursor cursor Bot left a comment •

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Stale Bugbot comment from a previous run.

Comment thread server/code/app/symbol/test_links.py Resolved
zlareb1 and others added 4 commits November 28, 2026 20:28
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…ad against a definition's body

The gate listed up to `limit` file neighbours ahead of the test map, so thirty
neighbour files pushed every map row off a default page, and a plugin of the
previous release took each of them for a test to run. Neighbours say nothing
about a touched definition: the server lists them only while the other kinds
leave fewer than four rows. `stem_partner` is a kind again, and a test file a
call chain links keeps that row ahead of a file-level map row, because a test
file is listed once and the call-chain row names the test and the definition.
On an index with an imported coverage run, rows in a covering test's file are
97% for `coverage`, 91% for `static_call`, 53% for `stem_partner` and 31% for
`test_map`.

A coverage run is read against every tier row's extent of a definition that is
wider than one line. A compiler row may be the declaration line only; testing
that line marked a function whose body ran as unexecuted under
`epistemic: measured`. A definition with no wider extent is not measured.

Text added directly above a definition touches it only when the added lines
are all decorators, which needs the diff's lines; a new function added there
is a change no definition answers for. In Python, lines appended as deep as
the line above continue the definition that line ends.

A file's removed ranges are merged before one walk, so the cost of a
headers-only diff follows the file's extent and not what its hunk headers
claim.

`measured` also needs every changed source file to touch a definition, and
`causes` keeps the call graph's causes under either answer.

The hop-only `confidence` of a `static_call` row is gone: it came from two
repositories and ignored the edge's own tier. A neighbour's `callees` counts a
definition both tiers hold once.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
… by bisection

The fallback for a hunk whose lines sit in no definition walked every row of
the file for each hunk. Rows are grouped by bare name in line order, so a
headers-only diff of thousands of hunks costs a bisection each.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.

There are 2 total unresolved issues (including 1 from previous review).

Fix All in Cursor

❌ 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 b518d58. Configure here.

Comment thread server/code/app/symbol/diff.py Resolved
zlareb1 and others added 3 commits November 28, 2026 22:28
… keeps same-named definitions apart and orders coverage rows by call chain and specificity

- A coverage run is read against the lines after the first of every extent a
  tier holds of a definition at the run's commit. The first line is the
  declaration, which runs when the module is imported, under whichever test
  imports it first. The extents are matched by id in the read that carries
  their parsing commit, so tiers parsed at different commits are measured on
  the extent the run's commit holds.
- Touched rows are no longer folded by qualified name. The store already
  folds the two tiers' rows of one definition where their spans coincide; rows
  that share a name and sit apart (a property's getter and setter) are
  different definitions, touched and measured apart.
- A `coverage` row carries the specificity of its test-map row as
  `confidence`, and the test name, `hop`, `callers` and `via` of a call chain
  that links the file too. Within a kind a chain-linked file is first, then
  the more specific row.
- `truncated` is also a cause when the read of the coverage rows was cut.
- The wire comment, the feature page and the skill reference say that a
  `static_call` test is linked by a call chain and usually, not always, runs
  the definition, and that a change of test files only is `lower_bound` with
  no cause.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
…is documented as not placed

The index holds no column for a definition. Where a class and its last method
end on one line, text added below that line and indented less than it may be
the method's (a statement after its last nested block) or the class's (a new
method), and the two indents the diff shows cannot tell which. The run touches
neither and counts in unmapped_changes, so the answer is lower_bound. The
operations page and the docstring say so, and a test holds the three cases.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
@zlareb1
zlareb1 merged commit 0d2ce06 into main Nov 28, 2026
84 of 89 checks passed
@zlareb1
zlareb1 deleted the fix/test-links-gate-evidence-links branch November 28, 2026 17:49
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