fix: preserve index entries when a parser fails instead of purging them#82
Merged
Merged
Conversation
A parser crash was previously swallowed to an empty symbol list, which the pipeline treated as "no indexable symbols" and used to delete existing index entries for the file. Since the file's blob SHA is unchanged, it was never retried, so the data loss was permanent. Parser failures now raise ParseError, which the pipeline catches to skip the file while leaving its existing entries intact. Fixes #68 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
registry.parse_filepreviously caught every parser exception and returned[], which the indexing pipeline treated as "file has no indexable symbols" and used as a signal to delete existing index entries for that file (pipeline.py).ParseErrorexception:registry.parse_filenow re-raises parser failures instead of swallowing them, andIndexPipeline.index_servicecatchesParseErrorto skip the file for this run while leaving its existing index entries untouched. Genuinely symbol-less files (parsed OK, zero symbols) still go through the existing delete-stale-entries path.Fixes #68
Test plan
uv run pytest tests/parser/test_registry.py— updatedtest_parse_file_swallows_parser_exceptions→test_parse_file_raises_parse_error_for_parser_exceptions, now assertsParseErroris raiseduv run pytest tests/test_pipeline.py— newtest_parser_failure_preserves_existing_index_entriesassertsdelete_by_file/upsert_chunksare not called when parsing raisesuv run pytest— full suite green (217 passed)uvx ruff format --checkon all changed files🤖 Generated with Claude Code