Repository navigation
Progressive sessions honour damaged_input (Salvage/Resync), reported as HeaderDamaged - #316
Conversation
…st damaged RAR headers, reported as HeaderDamaged
ProgressiveOptions::extract.damaged_input now reads past damaged RAR 4.x / 5.0 headers in ProgressiveSession::new and
from_sealed_memory as the whole-archive runners do (same members, bytes and HeaderDamage records), and reports each
as the new ProgressiveEvent::HeaderDamaged { volume, damage }. Refuse (the default) is unchanged.
Only delivered bytes are judged: a header still to come (NotYet) is waited for, one inside a Hole answer is
HeaderHole as before (repair may fill it), and a resync never searches across a hole. Under salvage the parser takes
the volume's known length so a cut header or data is UnexpectedEnd. Resync runs as an incremental phase over the
source with #310's candidate filter and a per-volume linear work bound; its window is charged to MetadataBytes.
Bytes passed over break the solid history. Persistent-partial sessions keep refusing (follow-up: the journal binds
members to header bytes).
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2cefaa677
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…, no salvage before a signature or with encrypted headers - A resync charges its work allowance for bytes a read delivered, not for the buffer it asked for: a source delivering a few bytes a call (or waiting) no longer runs the allowance out while crossing a long stretch. - A source that ends before a RAR signature is refused as before instead of reading as a damaged empty archive. - An encrypted-header archive cut at a header boundary is a truncation, not damage: the parser salvages nothing once headers are encrypted, at the end of a volume too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
|
Codex Review: Didn't find any major issues. 🚀 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Breezy! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Nice work! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
|
Codex Review: Didn't find any major issues. Delightful! Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b7681c4882
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
… main header reads on with an empty one As Volume::initialize_held does: a main header whose type byte was hit reads as a block of an unknown type, and the session now takes the main header as present (defaults) instead of failing with 'block before main'. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 9c628f5cd1
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…read is delivered; replacement replay reads salvaged headers - A HeaderDamaged queued by the read that also ends the session or uses up the poll's work is delivered before the end (poll_event drains the queue before its Done fast path and before yielding). - Strict replacement verification replays the header witnesses under the damaged-input choice they were read with: a damaged header is read as it stands (its bytes still compared with the witness) and the replay resumes where a resync did, so a member read past damage can still reach Strict. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 187c0c1c1b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
…racting, whatever its last event A HeaderDamaged delivered as the session reaches Done (a damaged end header) left extraction_active set, so poll_verify and publish_recovered refused the artifacts it had handed out. Done now always clears it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
|
@codex review |
|
Codex Review: Didn't find any major issues. 👍 Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
Local CI ( |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj
…kb and 7z x -so hand over of a failing member (#317) * Opt-in unverified output: UnverifiedOutput::Emit writes, prints and streams what UnRAR and 7-Zip hand over of a failing member - Options::unverified_output (whole-archive RAR runners, RarSession extraction with keep_broken): a RAR member cut off by a missing volume keeps every byte UnRAR 7.30 `x -kb` keeps (RAR 3.x/4.x: LZ tokens starting in the last 30 bytes left out; RAR 5.0: the partial block decoded, symbols in the last 128 bits left out, a block with under 1024 bytes skipped; observed on 50 cut points). - RarPrintOptions::unverified_output (`unrar p`): a member failing on its own data prints what was decoded of it; RarEntryOutcome::unverified_bytes says how many bytes went out. - sevenzip::print_selected_with_options + SevenZipPrintOptions (`7z x -so`): a failing 7z member streams what 7-Zip 26.06 streams (CRC failure: all; data error / cut folder: the bytes before it); Summary::unverified. - SelectOptions::unverified_output (SelectedEntry): 7z as above; RAR 3.x/4.x unsupported VM filters streamed unfiltered; read fails with UnverifiedWritten { bytes, cause }. - LZMA readers hand out the bytes decoded before a data error, then the error. Defaults unchanged. tests/unverified_output.rs checks each route against the reference tools' output. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj * Codex on #317: 7z unverified members keep archive order, output errors propagate, LZMA errors at the last byte stay - A member failing behind ones held for the folder's CRC is queued behind them (printed in archive order). - wrong_password() returns a result: an output error replaying held members ends the run. - The LZMA readers put a data error off only when the caller asked for more than was made; one asking for exactly the bytes left never reads again, so the error is returned then (default outcomes unchanged). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj * Merge origin/main; unverified_output in the new rar5_link_password literal Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj * Codex on #317: cut-member output faults end the run, printing hands over buffered bytes, unfiltered prerequisites don't stop a selected read - Run::emit_unverified returns a fault writing the flushed bytes as the run's terminal error. - RarSession decoding under UnverifiedOutput::Emit flushes what a failing decoder still buffers before the failure (printing and keep_broken extraction get every byte decoded). - SelectedEntry (Emit) goes on past a solid prerequisite written unfiltered; only the selected member's own unfiltered write fails the read. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj * Codex on #317: a split part failing its own checksum hands over what was decoded under Emit Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj * unverified_output in the Options literal #313 added Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj * unverified_output in the Options literals #316 added Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj --------- Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Extends #310's damaged-RAR salvage (
extract::Options::damaged_input) to progressive sessions, which RustyGet's live extraction uses.API
ProgressiveOptions::extract.damaged_inputis now honoured byProgressiveSession::newandfrom_sealed_memory.Refuse(the default) behaves exactly as before.ProgressiveEvent::HeaderDamaged { volume: u32, damage: extract::HeaderDamage }, one per damaged header. It arrives before anything read from that header, so a member whose header failed its checksum gets it just before itsMemberStarted. It uses the same records asSummary::damaged_headers(offset, kind, name, resumed_at).damage.volumeis the volume name the session asked for.new_partial) still refuse, whatever the option says. Their journal binds each member to the header bytes it was read from, and a header repaired later would no longer match. This is a follow-up, documented in docs/persistent-partials.md and covered by a test.Behaviour with holes (docs/compat-options.md, "Damaged headers in a progressive session")
Only bytes the source has delivered are judged:
NotYet, volume not there yet) is waited for. It is never reported as damage, and it is read normally once it arrives.Holeanswer is not damage either. The session stops withHeaderHole, as underRefuse, because repair may still fill it.Hole; it stops withHeaderHoleinstead. On an open-ended source (GrowingFileVolumes), a search that hasn't found a header yet waits for more bytes.SourceInfo::lengthunlessAdvertised(u64::MAX)). The result matches the whole-archive runners: same members, same bytes, same damage list.Implementation
HeaderParser::advance_salvagingsorts header failures the wayVolumedoes: Unreadable / UnexpectedEnd vs. a real error. Under salvage it also takes the volume's known length (set_complete_len), and after a resync it continues withresume_at.Phase::Resyncdoes the search incrementally across polls. It uses RAR damaged-input salvage: Options::damaged_input (Salvage as UnRAR 7.30, Resync) and a headers-damaged signal #310'sresync_shape/resync_checks. Work is bounded per volume at 16 × the furthest offset read plus 1 MiB. Its window (at most one chunk plus one candidate header) is charged toMetadataBytes, and cancellation and the per-poll work budget are respected.SolidHistoryUnavailable.Routes covered (tests/progressive_salvage.rs)
refuse_fails_at_the_damage_as_before: every damaged case, sealed and piecewise. Refuse fails with no events.salvage_and_resync_extract_what_the_whole_archive_runner_does: all of RAR damaged-input salvage: Options::damaged_input (Salvage as UnRAR 7.30, Resync) and a headers-damaged signal #310's cases and fixtures (RAR5/RAR4 header CRC, main CRC, garbage, zeroed header, cut header, damaged name/type, no end header, the 6 fixtures, two-volume sets including a damaged second main header). For each, Salvage and Resync over sealed memory and over a source delivering 13 bytes at a time give the same files, bytes, folders and damage list asextract::run.a_header_still_to_come_is_waited_for_and_one_in_a_hole_is_not_damagea_resync_never_searches_across_a_holesolid_history_after_a_skipped_header_fails_the_next_solid_member: header lost four ways (hole, service, main, folder).corrupting_every_37th_offset_never_panicsresync_crosses_random_data_and_false_headers_in_bounded_work: 4 MiB of noise, and 20 000 false headers.a_persistent_session_still_refuses_damaged_headers(withpersistent-partials)Revert check: with salvage disabled in the session (parsers kept at Refuse), the Salvage/Resync tests fail. On old main the test file doesn't compile, because
HeaderDamageddoesn't exist there.Clean-room: the behaviour matches observed UnRAR 7.30 / 7-Zip 26.06, as #310 recorded it. No third-party source was read.
🤖 Generated with Claude Code
https://claude.ai/code/session_01LG44gZ63jJDJGeNcamsGrj