Repository navigation
Code grep and symbol mentions retain source coordinates - #1107
Merged
Merged
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
zlareb1
force-pushed
the
fix/code-grep-source-spans
branch
2 times, most recently
from
November 21, 2026 09:30
83fe5a3 to
00b8d70
Compare
Use retained source lines for literal hits, message matches and symbol mentions so copied documentation and continuation headers cannot shift file locations. Disclose unmappable fragments through existing coverage fields. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Carry partial coverage across both message fallback legs and cached pages. Rerun cursor pools without the current line mapping so cached synthetic positions are not returned. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
Do not parse chunks beyond the existing line-scan bound when collecting coverage warnings. Keep that validation off the event loop for both literal and message reads. Signed-off-by: Lareb Zafar <lareb.zafar@clickhouse.com>
zlareb1
force-pushed
the
fix/code-grep-source-spans
branch
from
November 21, 2026 11:17
00b8d70 to
8a0dee0
Compare
8 of 9 tasks
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: #1080
Changelog category
Changelog entry
Code grep and symbol mentions report physical source line numbers when indexed chunks contain copied documentation or continuation headers. Results disclose partial coverage when compacted or incomplete chunks cannot establish exact coordinates.
Why
Chunk presentation text can prepend documentation that already appears inside a function. Counting every stored text line from the chunk's source start shifts literal hits and message matches, and can invent hits in synthetic text. Agents then read the wrong source location.
Use the retained-source mapping that definition bodies already use for literal grep, message matching and symbol mentions. This keeps their coordinates consistent and counts physical LF boundaries rather than Unicode separators inside source strings.
Scope and risk
The read paths share a source-line helper. Chunk queries carry
kindso compacted class skeletons are omitted rather than assigned guessed coordinates. Grep discloses partial coverage; symbol mentions disclose truncation. Coverage validation runs off the event loop and obeys the line-scan size bound, including large retained chunks. A negative result from an omitted fragment is not proof of absence.Existing unit fixtures with missing or inconsistent declared source spans are corrected to represent complete source rows. Their behavioral assertions remain, with scope boundaries corrected where the source spans were inconsistent. Regression tests cover copied documentation, continuation headers, Unicode separators, compacted classes and stored rows read through both SQL paths. Continuation pages and message fallbacks preserve warnings from every read leg. Unversioned cursor pools are rerun rather than replaying cached synthetic coordinates; callers are told to restart pagination for complete results. The analyzer statement corpus is regenerated.
Compatibility, rollout and rollback
Tests
make format,make lintandmake typecheck: passed.AI assistance in the code
AI-generated: Codex wrote the fix and regressions, checked the affected read paths and validated returned coordinates against source files. Human review is pending.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist