Skip to content

fix(comps): skip tombstone Comps records with object_id=0xFFFFFFFF - #50

Merged
hutcheb merged 1 commit into
hutcheb:mainfrom
colinlove:fix/legacy-tombstone-object-id
Nov 3, 2026
Merged

hutcheb merged 1 commit into
hutcheb:mainfrom
colinlove:fix/legacy-tombstone-object-id

Conversation

@colinlove

Copy link
Copy Markdown
Contributor

This fix is part of a series found with AI assistance (Claude Code) — see the first PR in this batch for the full disclosure.


Legacy Comps records can be tombstoned with object_id = 0xFFFFFFFF

Symptom

CompsRecord.parse raises ValueError: Invalid legacy Comps record length
on 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_id
out of what's normally a reserved field, used when that field is nonzero),
some records have object_id == 0xFFFFFFFF — the sentinel Rockwell uses
for "no object". These appear to be deleted/replaced records left behind in
Comps.Dat (a tombstone), and their payload's length fields don't describe
anything real: payload_end computed from the record comes out smaller
than payload_start, which the existing code correctly detects... and then
raises on, treating it as corruption rather than "there's nothing here."

Fix

Check for object_id == 0xFFFFFFFF immediately after it's read, before any
of the payload-length validation, and return None (the same "nothing to
record" signal CompsRecord.parse already uses for other identifiers it
doesn't handle) instead of validating a payload that was never meant to be
read. CompsRecord.__post_init__ already handles a None return 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) in Comps.Dat across a corpus of real project files should turn up
tombstones 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

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants