Repository navigation
Conversation
…e function it declares A C++ member line of a class body (a member, a static constant, a method prototype) and a Python class attribute are placed on the class that holds them, and a C++ prototype also on the function it declares when the diff's files hold one definition of it. The placed definitions join code.impact's touched symbols and seed the radius, so the review brief claims their coverage instead of answering unsettled on unmapped_changes. Braces, class heads, access specifiers, using, friend, namespace and preprocessor lines, includes, file-scope constants and lines a macro continues stay unmapped. 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>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
A C++ member line now has to read as a declaration and hold no scope word, macro call, raw string or unclosed quote anywhere on it; a Python class-body line that opens a compound statement or an odd number of triple quotes stays a change. A file-scope line whose parentheses start with a literal is a constant, not a prototype. Prototypes are matched by the class's full qualified name through one index of the function names built per diff, never against a test file. A run whose two bounding lines sit in different rows is placed on the innermost row that holds both. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
| r"\b(?:using|friend|namespace|public|protected|private|class|struct|union|enum" | ||
| r"|template|typedef|return|throw|co_return|co_yield|co_await|if|else|for|while|do" | ||
| r"|switch|case|default|break|continue|goto|try|catch|operator)\b" | ||
| ) |
There was a problem hiding this comment.
Operator prototypes stay unmapped
Medium Severity
_CPP_SCOPE_WORDS treats operator as a scope or statement word, so member_line rejects method prototypes such as operator== and operator(). Those lines stay unmapped_changes and never touch the class, even though they are declarations. return already covers call expressions that use operator.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 2bf7011. Configure here.
…method are not placed A Python class-body line is placed only when it is an attribute or a docstring line below a line that leaves no bracket open, so a line inside a multi-line decorator stays the method's change. A file-scope prototype no longer matches a method of a class the diff's files hold. A C++ line holding virtual, override, final or a template head's words stays unmapped. The Python rule moves out of the C++ module. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…s own line A C++ member line must end with ';' and close every bracket it opens, so a parameter line of a multi-line (possibly virtual) prototype or a template head stays a change. A Python attribute line must leave no bracket open and sit below a line of code that leaves none open; below a blank or comment line it stays a change. code.test_gate's rows from code.impact are again exactly the gate's own: placed prototypes seed the walk and are claimed, and no longer reach impacted_tests. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
| if depth < 0: | ||
| return False | ||
| if depth: | ||
| return False |
There was a problem hiding this comment.
Angle brackets reject finished members
Medium Severity
member_line counts < and > as brackets that must balance, after stripping ->. A finished member or prototype that uses those characters as operators (int flags = 1 << 2;, bool ok = a > 0;, a default a < b) stays unmapped, so the brief keeps unmapped_changes. A template tail that does not end in ; is already dropped by the semicolon check.
Reviewed by Cursor Bugbot for commit 9cfdd9e. Configure here.
| depth += {"(": 1, "[": 1, "{": 1, ")": -1, "]": -1, "}": -1}.get(c, 0) | ||
| if depth < 0: | ||
| return False | ||
| return depth == 0 and not code.endswith(",") |
There was a problem hiding this comment.
Fields after closers stay unmapped
Medium Severity
_closed fails as soon as bracket depth goes negative, and _python_member_line places an attribute only when the previous line passes that check. A field under the closing ) or ] of a multi-line value stays unmapped. The scan also counts brackets inside strings, so a previous line such as note = ":)" blocks the next attribute too.
Reviewed by Cursor Bugbot for commit 9cfdd9e. Configure here.
… in its own directory A file-scope line, which a struct's body is too, goes through the same declaration check as a class-body line, so a virtual, override or friend prototype stays a change. A C++ member line below a line that does not end a declaration (a lone virtual or template head) stays a change. A same-stem match requires the same directory and skips anonymous-namespace functions. A Python string line is a docstring only right below the class head. Placed rows keep the touched-row order, and the symbols note counts touched definitions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…t's lines stay changes An in-class prototype whose function the diff's files do not define stays a change: its defaults and parameters reach the callers, which a claim on the class does not decide. So does one whose name a function in a scope nested in the class shares. code.impact reads the C++ struct rows of the diff's files for placement alone, and a line of a struct's body is placed on nothing. The pinned brief digest follows the symbols note's new label. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…on the wrong definition The prototype name read drops a trailing // comment, and a class-body line that names something before a ( but is not read as a prototype stays a change rather than landing on the class alone. A file-scope prototype no longer takes a struct's method, or a method of a scope nested in a class, as a free function. An open PR's added functions are what its new prototypes declare. code.impact reads the struct rows alongside the new side, in their own span. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
| return "" | ||
| if not in_class and (not words or rest.lstrip().startswith(_LITERAL_START)): | ||
| return "" | ||
| return name |
There was a problem hiding this comment.
Comment split ignores string literals
Medium Severity
declared_name and names_call split on the first // without removing string literals, unlike member_line. A // inside a string ends the text early, so a real prototype no longer looks terminated and is not bound. On a class-body line, names_call still sees the (, so the line stays unmapped instead of being placed on the class and the function.
Additional Locations (1)
Reviewed by Cursor Bugbot for commit 8ef5fd5. Configure here.
…ows to be one A function in a scope the diff's files show nothing about may be a method of a class declared elsewhere, so a file-scope prototype is placed only on a function at global scope or in a scope that holds a class or struct row and is none itself. The declaration pattern no longer backtracks on a long line that declares nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
A class or struct defined in a class body or a variable declaration, and a method under `#elif`, got no row, so a statement in a nested type's inline method read as a line of the outer class's body and was placed on it. They are rows now, so such a line is its method's and a nested struct's body stays a change. This changes C++ extraction: the symbol stage re-runs for C++ files in every indexed repository. The docs correct what the index's Python reads cover, and the placement loop names its entries. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…oc comment A struct or class defined in a typedef is a row like one defined in a member or a variable declaration, and its doc comment is the one above the declaration. A pure-virtual method returning an elaborated type keeps its row: only a type with a body is walked as a class. A member line of a nested class is placed on the nested class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
…limit A row the read cut off (a method, a struct) would leave its lines in the class around it, so with either read at its limit every line outside a function stays a change. The docs say why a class's static constant is placed on the class while a file-scope one is not, and that a docstring is read below any line ending with `:`. Two pattern alternatives no line could reach are gone, and `_place_member` reads one side's text as one tuple. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
| # row (a method, a struct) would leave its lines in the class around it | ||
| complete = len(definitions) < _ROWS_LIMIT and len(structs) < _ROWS_LIMIT | ||
| touched_rows, gate_touched, unmapped = touched_by_diff( | ||
| [*definitions, *structs], changes, new_side=new_side, added=added_rows, placing=complete |
There was a problem hiding this comment.
Placement skipped on complete reads
Medium Severity
placing is turned off whenever functions_for_paths returns at least _ROWS_LIMIT rows, but that read does not stop at limit. Each path batch is queried with max(limit, 300 * batch size), the batches are concatenated, and _prefer_scip collapses tiers. A diff whose files hold 2000 or more definitions or structs is therefore treated as truncated even when every row came back, so member lines and prototypes stay unmapped_changes.
Reviewed by Cursor Bugbot for commit 984a9aa. Configure here.
…w a class head A union nested in a class had no row, so a statement in its inline method read as the outer class's body line; it is a struct row now, as a Thrift union is. A Python string line is a docstring only right below the class's head, not below another line ending with `:` such as a dict key. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.
There are 7 total unresolved issues (including 6 from previous reviews).
❌ 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 4c95601. Configure here.
A changed file past the first 200 paths has no rows, so its class-body lines would read as file scope; placement is off then. A scope inside a known class is no namespace, so a function in it is no free function for a file-scope prototype. A header and its source at the repository root pair by stem, and a docstring below a generic class head is read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: zlareb1 <lareb.zafar@clickhouse.com>


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):
A changed declaration line of a C++ class body outside its methods (a member, a static constant, a method prototype) or a Python class attribute or docstring line is placed on the class, and a C++ prototype also on the function it declares, so
code.review_briefclaims their coverage and answerscovered_no_gapsorgapswhere it answeredunsettledonsymbols:unmapped_changes. Braces, class heads, access specifiers,using,#include, namespace lines and file-scope constants still keep a brief open.Why
unmapped_changesmarks a changed source line in no function, and it keeps a review briefunsettled. A member or a prototype in a class body, and a prototype at file scope, counted as such a line, though each belongs to a definition the index holds: the class, and the function the prototype declares. A PR that adds a member to a class and uses it in a method could never settle, whatever the tests of that class say.The change places such a line on that definition and makes it a subject of the brief (a class's data member or static constant is the class's like its other members: the brief claims the definition a change sits in, as for a function whose body changes, not the code that reads it; a file-scope constant sits in no definition, so it stays a change): it joins
code.impact'stouched_symbols, seeds the radius walk, and the tests section claims its coverage. So the brief settles only when that claim sayscovered_by, and an uncovered class or function answersgaps(uncovered_symbol). A settle on a change nothing covers is the outcome the rules are built against: a line is placed only on a definition whose claim decides it, as far as the index's rows are right. Where they are not, it is a known gap, named in the docs: a method whose head the parser cannot read (one spelled with a macro it does not expand) has no row, so a declaration in its body sits in the class body by the rows and is placed on the class alone, and so is one in an inline method of an unnamed struct. Placement reads the index's rows and the changed lines, not a parse of the indexed side, so it cannot tell such a body from the class's.Seeding decision. The class (or declared function) a line is placed on is a walk seed like a changed function. An alternative was to make it a claim subject only. Seeding keeps one rule (every touched symbol seeds the radius and is claimed) and reaches what the index links to the class (its derived classes, the callers of what points at it). A class that holds only lines that stay changes (an access specifier, a brace) stays code.test_gate's alone, as before, and is not seeded.
What stays unmapped, and why.
using,friend, namespace and preprocessor lines,#include: they shape a scope, so they can move unchanged code into another one or change which overload an unchanged call picks, which no claim about one definition shows.;, with every bracket it opens closed there): the lines of a prototype or template head spread over lines (the head may bevirtual), a macro call (FRIEND_TEST(...),check(x);), a statement (return x;), a base clause, a line holdingvirtual,overrideorfinal(they change which function a call through a base reaches, and the overrides are definitions no claim on the class covers), scope words after a member on one line (int x; private:),/*,*/, a raw string's opener or a quote no literal closes.def,classor compound statement head, a decorator, a line with an odd count of triple quotes, a multi-line decorator's argument (it belongs to the method below it), a string line anywhere but right below the class's head (a dict key's value, an argument), and a line below a blank or comment line, where the brackets open above are not known.\(a macro body) and a line starting a run the hunk shows no line above (a diff with no context).static const std::regex re("a+");, a constant).externdeclaration: the index links no C++ variable to its readers, and a Pythonreadsedge records an attribute read (config.LIMIT, a typed receiver's field) but not a bare name read in its module or afterfrom config import LIMIT. The readers the index holds are not all of them, so a claim on them would not decide the line.Registration. A registration statement inside a registration function (
REGISTER_FUNCTION(X) { ... },registerFoo(...)) is already that function's line; the index binds the registered class to it through its registration edges. In the measured set the only registration lines outside every function were registration functions' prototypes, declared in one file and defined in another: a prototype at file scope, once it passes the same whole-declaration check as a class-body line (so avirtual,overrideorfriendline of a struct body, which is file scope here, stays a change), is placed on the function of its name in the same file or one of the same stem in its directory (never a function the compiler tier names in an anonymous namespace; the parser givesnamespace {no scope, so without a compiler tier such a function reads as one of the namespace around it), or on a registration function by the index's own rule (registration.is_registration_caller), in each case only when the candidates in the diff's files outside tests share one qualified name and each is a free function: at global scope or in a scope the index shows to be a namespace (one that holds a class or struct row and neither is one nor sits in one; a class whose own row sits outside the diff's files, with a nested class's row in them, reads as one). A function in a scope nothing shows either way may be a method of a class whose row sits outside the diff, so a file-scope prototype is not placed on it; inside one.cppan out-of-line method and a free function look the same in the rows, so the same file gets no exception. In a class body a prototype is placed only together with the function whose qualified name is the class's and its own (or an open PR's added function of that name); a prototype whose function the diff's files do not define stays a change, since its defaults and parameters reach the function's callers, which a claim on the class does not decide.Parser change. The C++ parser gave no row to a class or struct defined in a class body or in a variable declaration (
struct Options { ... };inside a class,struct S { ... } s;), nor to a method under#elif: their lines read as lines of the class around them, so a statement in a nested type's inline method would have been placed on the outer class.parse_cppnow holds those rows (the nested type, its methods,#elifand#elifdefbranches), so such a statement is its method's line and a nested struct's body stays a change. This is an extraction change: the C++ symbol stage (and the stages that follow it) re-runs for C++ files in every indexed repository, hours of ingest on a large one. On every 20th C++ file under ClickHouse'ssrc/(519 files) it adds 4.2% symbol rows (5,896 to 6,143), 2.7% chunks (11,287 to 11,593) and 0.8% chunk text to embed: a nested class gets its own skeleton chunk, and the outer class's skeleton keeps the nested text as before. A struct or class defined in atypedefgets a row as well, a union (nested or not) is a struct row, as a Thrift union is, a nested type's doc comment is the one above its declaration, and a pure-virtual method returning an elaborated type (virtual struct Result * make() = 0;) keeps its row. The new rows also give out-of-line definitions of nested-type methods (Pool::Options::resetin a.cpp) the header row they lacked. An unnamed class, struct or union still has no row. Until a repository's re-extraction lands, its rows lack the nested types: a member line of a nested type is placed on the outer class there, as the previous head of this branch did, and an open PR's overlay, parsed by the new parser, reads every inline method of a nested type or under#elifin a changed file as a function the PR adds (classify_symbolsmarks a qualified name no index row holds as added), so that brief claims them and may answergapsfor functions the PR did not add. Both end with the re-extraction, which every extractor change that adds rows goes through.Assumptions about the repository, and why each is general.
;, a prototype istype name(...), a class body is between the class's lines in the index) and Python's class body as one indented scope: language rules, not conventions of one code base. Shell has no class or prototype, so nothing changes there; other languages keep their rule.widget.h,widget.cpp): a common C and C++ layout; where it does not hold, the prototype stays unmapped, as today.kind,qualified_name, extents): nothing is read from a path layout, a test harness or a name list.The new unit tests use a made-up repository (
ui::Widgetinsrc/ui/widget.handwidget.cpp, a PythonConfclass) with none of ClickHouse's conventions.Measurements
Replayed offline with the brief's own placement (
place_lineswith each side parsed as the ingest parses it), on the most recent first-parent merges of the ClickHouse repository that change C++ source, in both brief modes: merged (the reversed diff, index rows at the merge, new side at the parent, as #2315 measured) and open (index rows at the parent, new side at the merge, a name the parent lacks seeded on itself as the overlay seeds it). The second repository is Loom's own mirror (Python, the 100 most recent commits). Definitions keep the kinds the index stores; struct rows are passed for placement alone, ascode.impactpasses them, and in open mode the functions the head adds are passed as the overlay's added functions. Before ismain, after is this head. The script is a one-off and not in the repository.unmapped_changesbeforeNo brief gained a line. In Loom's commits every brief that keeps the cause also holds a module-scope line (an import, a constant), so placing class attributes shrinks those briefs without settling one. Of the 153 that keep the cause (200 merges, merged mode), 123 hold an
#include,using, brace, namespace, access or preprocessor line, 83 a file-scope constant, static orextern, 108 other file-scope code, 31 a line of a struct body, 59 a line of a function the new side pairs with no row; these are the cases above that stay unmapped by design. The ask's count (39 of 51 briefs withunmapped_changesas their only cause) is therefore cut by the member and prototype share only; the rest is code a claim about one definition cannot decide.New verdicts. For the 6 merged ClickHouse PRs of the 200 whose
unmapped_changesthis change removes, the brief the service holds now (built bymain) andcode.coverage_claimof each subject the change adds, read on the live index, give:gapsnow for another cause (a randomized setting, a regression record) and keep it.unmapped_changesin the stored brief (an older build, abrief:v1payload) and is unchanged.symbols:unmapped_changes, and the new subjects (StorageKeeperMap,StorageKeeperMap::getRootPathWithPrefix) arecovered_byon tests that name them (exact_scoped), as are its other claims.symbols:unmapped_changestotests:cooccurrence_only: their claims rest on a test that changed with the source, which the brief does not settle on.unsettled, now ontests:partly_covered: the classSSTFileReaderits member line touches has anunknownclaim. This is the case the design is for: the line no longer hides behindunmapped_changes, and the class decides it.Three PRs an earlier head of this branch cleared keep the cause, each by a rule that refuses a placement it cannot prove: #135441 changes a member of
Aggregator::Params, a struct nested in the class, which now has a row; #137526 changes a prototype inContext.h, a header the parser reads no rows of at that commit, so the line read as file scope and its candidateContext::mayUseTaskBasedParallelReplicasis a method; #137918 declaresstatic ... toDataLakeStorageType(...)above its free function in the same.cpp, whoseDBscope the file's rows do not show to be a namespace.Hand check. A sample of placed lines in both repositories, read against the source: C++ members (
mutable ASTPtr default_codec_description;onMergeTreeDataPartWriterOnDisk), a prototype on its class and the method it declares (HDFS::ClientPtr getClient() const;onHDFSObjectStorageandHDFSObjectStorage::getClient), a prototype spread over lines left a change, a file-scope prototype in a header on its function in the source of the same stem; Python model fields andmodel_configlines on their Pydantic classes and typed-dict fields on their class, where the line above is code; a field below a comment or a blank line stays a change. One limitation shows: in a template header whose method head is spelled with a macro the parser does not expand (static void NO_INLINE vectorVector(...)), the method's body lines sit in the class body by the index's rows, so a declaration in that body reads as a member line and lands on the class that holds the method. The docs say so.Scope and risk
server/code/app/symbol/diff.py:unmapped_linesbecomesplace_lines, which returnsPlacement(unmapped, rows): the lines left in no definition, as before, and the rows the other lines outside every function are placed on (_place_member). An added line no function of the new side holds sits where its run sits in the index (_FileSpans.around: the innermost definition that holds the old lines on both sides of the run, found by bisection once per file).touched_by_diffcombines_touched_rows_for_diffwith the placement and is whatcode.impactreads.server/code/app/symbol/cpp_members.py(new):member_lineanddeclared_name, the C++ text rules; the Python rule isdiff._python_member_line. Prototypes find their function through one index of the diff's function names per call (_Functions), so the cost stays linear in the lines. A run whose bounding lines sit in different rows is placed on the innermost row holding both, found through each row's parent.code.impactreads the struct rows of the diff's C++ files in one morefunctions_for_pathscall (in parallel with the new side, spanimpact.struct_rows), andplace_linesleaves every line of a struct's body a change. A file-scope prototype never takes a method of a class or struct the index holds as its free function.server/code/domain/extract/treesitter.py:parse_cppwalks a class or struct that is a declaration's type and the#elif/#elifdefbranches (the parser change above).overridereads as a member); a file-scope prototype's namespace is not read.server/code/app/symbol/impact.py: the diff shape's touched rows, seeds and causes come fromtouched_by_diff, which also gets the struct rows and the overlay's added functions; an added function a prototype is placed on is listed once. When the read of the diff's definitions or of its struct rows reaches its limit (2,000 rows), or the diff changes a file past the 200 paths whose rows are read, no line is placed (placing=False): a row the read cut off would leave its lines in the class around it, and a file with no rows read would put its class-body lines at file scope. The 2,000-row check is conservative: the read may return that many rows complete, and then the diff's lines stay changes.code.test_gateis unchanged: it already places a class-body line on the class and counts its own unplaced lines.code.impactpasses it the same rows as before, soimpacted_testsstill matches the gate; a function placed through a prototype seeds the walk and is claimed, but adds no gate row. Once a repository is re-extracted, a changed line of a nested class's body touches the nested class there (the innermost row), where it touched the outer class: a test that names only the outer class no longer links to that line._unmapped(files the call graph is not built for, deleted files of an open PR) is unchanged.test_code_review_brief_no_groups.pychanges with that label alone (checked by building the brief with the old label, which gives the old digest).Compatibility, rollout and rollback
code.impact'stouched_symbolsmay now hold a class (via: "hunk") or a function a prototype declares, andunmapped_changesis named for fewer diffs; the field comments oftouched_symbolsandcausessay so, and the operations reference is regenerated.symbolssection its build wrote until it is rebuilt.Tests
tests/unit/test_code_diff_sides.py(git diffs of a made-upui::Widgetrepository):test_a_member_line_or_a_prototype_is_placed_on_what_it_declares(a member, a changed default, a prototype of a defined function, with a trailing comment too, a file-scope prototype, on both sides of the diff);test_a_line_that_shapes_a_scope_or_names_no_definition_stays_unmapped(access,using,friend, a nested class head and braces,#if, a statement, a comment delimiter, a macro continuation, a file-scope constant, an include, a prototype nothing of its stem defines);test_a_file_scope_prototype_is_placed_only_on_one_definition(two qualified names of one name, a same-stem file in another directory, an anonymous-namespace function, a scope inside a known class, a header and source at the repository root, and a registration function's prototype);test_a_python_class_attribute_is_placed_on_the_class(an attribute, a docstring, adefhead, a module line);test_a_line_in_an_unpaired_function_stays_unmapped;test_a_class_seeds_the_walk_only_through_a_line_placed_on_it;test_a_prototype_is_placed_on_the_function_of_its_class_outside_tests(another class of the same name, a test file);test_a_file_scope_prototype_is_not_placed_on_a_method(a class's, a struct's, a nested struct's);test_a_line_inside_a_python_decorator_stays_unmapped(a string below a dict key's:in a decorator's arguments too);test_a_line_between_two_inline_methods_is_placed_on_their_class;test_placing_many_prototypes_costs_time_linear_in_them;test_a_prototype_an_open_pr_adds_is_placed_on_the_function_it_adds;test_a_line_of_a_struct_body_stays_unmapped(a struct at file scope, one nested in a class, and a statement in a nested class's inline method, which is that method's line);test_a_member_below_a_line_it_continues_stays_unmapped(a lonevirtual, a template head). The unmapped list also covers a prototype with no definition in the diff's files (with a trailing comment too), a braced default, a multi-line and avirtualmulti-line prototype, struct-bodyvirtual,overrideandfriendlines, scope text after a member, a base clause, macro calls,virtual, a template head, raw strings and a direct-initialized constant; the Python test covers compound heads and an odd triple quote.tests/unit/test_code_cpp_nested_types.py: the parser's rows for a nested struct and class, their methods, a struct defined in a variable declaration and one in atypedef, a pure-virtual method returning an elaborated type, a method under#elif, a nested type's doc comment, no row for a forward declaration, and a union as a struct row with its method.tests/unit/test_code_epistemic_envelope.py::test_no_line_is_placed_when_a_changed_file_is_past_the_rows_read(200 files place, 201 do not).tests/unit/test_code_diff_sides.py::test_no_line_is_placed_when_the_rows_were_not_all_read, and a static constant placed on its class in the placed list.tests/unit/test_code_diff_sides.py::test_a_member_of_a_nested_class_is_placed_on_the_nested_class: a member line of a nested class goes to it, one of the outer class to the outer class.tests/unit/test_code_review_brief_sections.py:test_a_member_line_of_a_class_body_is_claimed_on_the_class(merged and open: no cause, the class is claimed,covered_no_gapswhen covered andgapswhen the class is not); the cases that now place a member (the whole new file, the member belowk, the wiring fixture, an inserted method whose head the new side lacks) assert the class rows; the "is a change" list keeps its scope lines and moves its member cases to hunks with no context or below a macro line, which stay unmapped.touched_by_diff,place_lines,functions_for_pathsor the impact module, with the impact, test-gate and review-brief files (1579 passed), and on the parser push every unit file that imports the C++ parser, the ingest parse or the extractor stamp, and everytest_code_*file (7919 passed; one timing test,test_code_regex_cost.py::test_a_lane_walk_costs_linear_time[cpp-deep-includes], failed once on a loaded machine and passed rerun alone);make format-check;make lint; mypy on the changed modules (no error in them).test_doc_links.pyneedsmarkdown_it, which the local environment lacks; CI runs it.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 rules against the measured unmapped lines and their text, the placements against the source in both repositories, and each line kind left unmapped against what it can change in unchanged code.
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/reference/configuration.mdand thedocs/reference/tables (python scripts/codegen/docs_reference.py), the reach manifest,schemas/schema.sql(make schema-dump), the Codex plugin copies (python3 scripts/codegen/agent_plugin_sync.py) and the standalone skill bundles (python3 scripts/codegen/standalone_skills.py).main; no merged migration is edited.hooks/,lib/,bin/,skills/,.mcp.json, the Codexplugin-defaults.json) bumps both plugin manifests' version, and no other open PR uses that version.npm --prefix frontend run build) and its tests pass, iffrontend/changed.docs/describe the system as it now is, and this description names any operator steps and wire changes.tests/unit/test_public_copy.py).git commit -s), as CONTRIBUTING.md asks.🤖 Generated with Claude Code
Note
Medium Risk
Changes how diff lines seed impact and whether review briefs report
symbols:unmapped_changes, with new heuristics and a C++ parser change that triggers repository re-extraction.Overview
Diff-shaped impact and review briefs no longer treat every class-body or file-scope declaration line as
unmapped_changes.unmapped_linesis replaced byplace_lines, which attaches qualifying out-of-function edits to index definitions;touched_by_diffmerges that with existing hunk mapping and drivescode.impactseeds andtouched_symbols.Placed edits include C++ member lines and prototypes (class + declared function when uniquely resolvable in the diff’s files), Python class attributes and class-head docstrings, and prototypes on overlay-added functions. Scope-shaping lines, file-scope constants, struct bodies, ambiguous prototypes, and lines without full index context still stay unmapped.
C++ extraction now emits rows for nested types inside member/typedef declarations and methods under
#elif/#elifdef, so placement does not attribute those bodies to the outer class once re-ingested.Docs, API field comments, and the brief symbols note (“touched definitions”) describe the new rules; extensive unit tests cover placement edge cases.
Reviewed by Cursor Bugbot for commit 703c0bf. Bugbot is set up for automated code reviews on this repo. Configure here.