Skip to content

fix: exclude document history from split fragments - #496

Merged
entelecheia merged 4 commits into
mainfrom
fix/449-split-storages
Nov 10, 2026
Merged

entelecheia merged 4 commits into
mainfrom
fix/449-split-storages

Conversation

@entelecheia

Copy link
Copy Markdown
Member

Closes #449.

Section, saved-page and typed-range split outputs carried whole-source revision history. Remove hwp5_doc_history from each owned fragment clone before writing or range resource scanning, and return typed preservation evidence from SplitOutcome/RangeOutcome. The CLI merges it into the existing loss ledger before strict evaluation; MCP receives that same summary. Writers and source documents are unchanged.

Side-storage field Decision Basis and retained information
hwp5_doc_history Drop by default Whole-document revision history is outside the current fragment. Treat payloads as opaque, reporting one populated history storage plus its modeled streams per output, consistent with existing IR-level cross-format accounting.
hwp5_xml_template Keep unchanged Retain opaque native-form schema/binding data. Pruning it lacks a modeled dependency rule and could alter form compatibility; global information in that slot remains present.
hwpx_extra_entries Keep unchanged Retained opaque content can depend on master pages, scripts, extensions and original META-INF parts. Keep corresponding hwpx_opf_extra_items paired; range binary-reference scanning of these carried parts remains active.

The existing header/metadata and section/page-preview policies remain unchanged. Outputs continue to retain those global dependencies and information. This is a bounded history-exclusion policy.

History omissions use existing HwpContainerStorageRemoved/ContainerStorage and HwpContainerStreamRemoved/ContainerStream events with Removed disposition. Loss evidence is available through --loss-report, the unconditional stderr summary and MCP top-level preservation. --strict now refuses history-bearing splits before fragment publication, after saving the loss report. The frozen, binary/address-focused range-extraction-v1 JSON shape stays unchanged.

Test-only baseline 43340bc reproduced all four intended assertions: history remained in section/page/range containers and strict split incorrectly succeeded. Three compatibility controls passed. After the fix, all 7 CLI/container tests and 75 converter split/range unit tests passed, with hwp-cli/hwp-convert all-target clippy green.

Tests use owner-authored opaque sentinels, checking actual CFB storage and payload-byte absence, typed ledger counts, strict no-publication, retained schema bytes and paired HWPX parts/manifest entries. Ordinary convert/edit preserve history, and native no-op rewriting preserves the whole input byte-for-byte. Saved-page selection uses explicit fixture flags without host-font pagination assertions. These tests do not parse genuine revision-history records or establish a Hancom open/export result.

Full verification at 33114d1dead6f7c0de9b4b4ef9e3b669e74b6662: exact-head remote Linux/Rust 1.93.0, CARGO_BUILD_JOBS=2 RUST_TEST_THREADS=2 scripts/check.sh </dev/null, with verifier stdin also closed, exit 0. All 7 new CLI/container cases ran in this pass.

== check: OK (fmt/clippy/test/crate-edges/pdf-runner/structured-corpus/claims/doc-surface/release-block/readiness-selfcheck/skip-accounting/public-parity=skipped) skipped-for-missing-fixtures=49 (optional=4) ==

Missing-fixture skips are 49, including 4 optional cases; absent fixture paths remain unverified. Public PDF parity auto-skipped for the environment's Poppler version. Hosted three-OS/parity checks and native Hancom evidence remain separate.

Copilot AI balanced review requested due to automatic review settings November 10, 2026 15:19

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-10T15:22:44.269295Z 33114d1 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@entelecheia
entelecheia force-pushed the fix/449-split-storages branch from 33114d1 to d1c4783 Compare November 10, 2026 16:02
@entelecheia entelecheia reopened this Nov 10, 2026
@entelecheia
entelecheia merged commit 7719de2 into main Nov 10, 2026
9 of 14 checks passed
@entelecheia
entelecheia deleted the fix/449-split-storages branch November 10, 2026 16:38
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.

split: fragments carry the source's whole /DocHistory and other document-wide storages

2 participants