Repository navigation
fix(comps): skip tombstone Comps records with object_id=0xFFFFFFFF - #50
Merged
Merged
Conversation
Co-Authored-By: Claude Sonnet 4.6 <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.
Legacy Comps records can be tombstoned with
object_id = 0xFFFFFFFFSymptom
CompsRecord.parseraisesValueError: Invalid legacy Comps record lengthon some real project files, aborting the entire export, even though the
project is otherwise healthy.
Root cause
In the "legacy" comps layout (the branch that reads
object_id/parent_idout of what's normally a reserved field, used when that field is nonzero),
some records have
object_id == 0xFFFFFFFF— the sentinel Rockwell usesfor "no object". These appear to be deleted/replaced records left behind in
Comps.Dat(a tombstone), and their payload's length fields don't describeanything real:
payload_endcomputed from the record comes out smallerthan
payload_start, which the existing code correctly detects... and thenraises on, treating it as corruption rather than "there's nothing here."
Fix
Check for
object_id == 0xFFFFFFFFimmediately after it's read, before anyof the payload-length validation, and return
None(the same "nothing torecord" signal
CompsRecord.parsealready uses for other identifiers itdoesn't handle) instead of validating a payload that was never meant to be
read.
CompsRecord.__post_init__already handles aNonereturn correctly(it just returns without inserting anything), so no caller changes are
needed.
Suggested validation
A record search for
object_id == 0xFFFFFFFF and identifier in (64250, 65021)inComps.Datacross a corpus of real project files should turn uptombstones like this on any project with enough edit history; the fix
should make every one of them a silent skip instead of an aborted export.
🤖 Generated with Claude Code