-
Notifications
You must be signed in to change notification settings - Fork 0
fix(indexer): harden OpenCode ingestion against corrupt rows and cursor drift (#21) #48
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
eebe8ff
fix(indexer): harden OpenCode ingestion against corrupt rows and curs…
senna-lang 828564c
fix(indexer): address PR #48 review — non-dict JSON + upgrade-path du…
senna-lang e0dc313
fix(indexer): replace position-based legacy fallback with content-bas…
senna-lang 62a87e3
fix(indexer): fix duplicate-content collisions and stale ply/session_…
senna-lang File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Priority-1: the new guard only catches JSON decode/conversion errors. A row whose
datais syntactically valid JSON but not an object (e.g.null,[],"text") is still accepted intoraw_entries.parse_opencode_exchangesthen calls.get()on that value while buildingmessage_role/boundaries, raising `AttributeError" and aborting the whole database's ingestion again — exactly the failure mode #21 asked to eliminate, just via a different input shape. Please also reject/skip non-dict JSON values here, not just JSON decode failures.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed in 828564c.
_parse_opencode_rownow checksisinstance(data, dict)afterjson.loadsand returnsNone(row skipped) for syntactically-valid-but-non-object JSON (null,[],"text"). Addedtest_non_dict_json_row_is_skipped_not_crashed, which inserts message rows with those three payload shapes plus one such part row; confirmed RED against the pre-fix guard (AttributeError: 'list' object has no attribute 'get') and GREEN after the fix.make checkrun directly: ruff 0 errors, pyright 0 errors, 667 tests pass.