Repository navigation
Recover retained source for exact grep results - #1210
Merged
Merged
Conversation
Class summaries omit physical line mappings even when complete raw chunks are retained. Verify those chunks under the same scope before lowering grep coverage, and share the recovery with rendered-message scans and symbol mentions. Signed-off-by: Lareb Zafar <[email protected]>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
5 tasks done
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.
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):
Exact grep and symbol mentions recover retained source behind class summaries before reporting missing source-line coverage.
Why
A class summary elides method bodies, so it cannot establish physical line numbers. The same index can hold complete raw chunks for that class. Grep discarded the summary and reported incomplete coverage without reading those chunks, prompting clients to retrieve source they already had or could read through Loom.
Recover source under the same tenant, namespace, embedding label and path. Replace a summary only when raw chunks cover its span without gaps or disagreements, including disagreement with source read earlier in the request.
Scope and risk
The shared recovery path serves literal and regex grep, rendered-message scans and symbol mentions. It groups summary fragments by class and uses bounded point reads. Source validation runs off the event loop. Recovery shares the existing scan character bound and any caller-supplied deadline. Missing, conflicting, failed or capped recovery preserves the existing coverage warning.
The risk is incorrect coordinates or extra read work during recovery. Recorded public-source replay against an isolated, migrated datastore retains previous hits and checks every returned line against the source revision. No extractor or stored source is changed.
Compatibility, rollout and rollback
Tests
make format lint typecheck: pass.python -m tests.analyzer.corpus --write: regenerated the SQL shape manifest, including the source-recovery read..venv/bin/python -m pytest tests/unit/test_code_grep_container_source.py tests/unit/test_code_grep.py tests/unit/test_code_symbol_uses.py tests/unit/test_code_search_cursor.pyand the SQL analyzer checks.AI assistance in the code (leave one; writing this description with AI is fine):
AI-generated: Codex wrote the change and checked source recovery, typed SQL, exact source coordinates and static checks.
I can explain every line of this diff and how it interacts with the rest of Loom.
Checklist