Skip to content

fix: preserve PDF object precedence during recovery - #1156

Merged
andiwand merged 2 commits into
mainfrom
review/138-pdf-recovery-precedence
Oct 6, 2026
Merged

andiwand merged 2 commits into
mainfrom
review/138-pdf-recovery-precedence

Conversation

@andiwand

@andiwand andiwand commented Oct 5, 2026 •

Copy link
Copy Markdown
Member

🤖 Generated with Claude Code

PDF recovery kept older generations beside the last direct definition and indexed compressed copies in object-number order, allowing an older object stream to win. Recovery now replaces direct definitions by object ID, checks that same ID before adding compressed members, and scans candidate object streams from the latest file position first.

Direct definitions retain precedence over compressed copies; the module guide makes that recovery policy explicit.

Validation: three parent assertions fail across the extended recovery tests; 65 parser, cross-reference, writer and annotation tests pass, including the existing broken-file fixture. LLVM 22 clang-tidy passes for both implementation files.

@andiwand
andiwand force-pushed the review/137-corpus-checks branch from eec6133 to 1a56bc6 Compare October 6, 2026 18:09
Base automatically changed from review/137-corpus-checks to main October 6, 2026 18:14
andiwand and others added 2 commits October 6, 2026 20:14
The rewrite dropped the comments that say why the candidates are copied
before indexing, which definition of an id recovery keeps, and that a
direct definition beats a compressed copy. They stand again, adapted to
the new order: latest object stream first, and the last definition of
an id wins whatever its generation.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MxyTMutqSUJRGfxA8CyzMc
@andiwand
andiwand force-pushed the review/138-pdf-recovery-precedence branch from 2f50fb5 to 16e474c Compare October 6, 2026 18:19
@andiwand
andiwand merged commit 36f1814 into main Oct 6, 2026
21 of 23 checks passed
@andiwand
andiwand deleted the review/138-pdf-recovery-precedence branch October 6, 2026 18:20
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.

1 participant