feat(history): append guarded non-destructive version restores - #712
Merged
Conversation
This was referenced Sep 6, 2026
JSv4
pushed a commit
that referenced
this pull request
Sep 6, 2026
…r focus fix (#705) Eight stacked PRs landed a new Docxodus/History subsystem overnight — package change sets and their codec, blob and head stores, exact DOCX snapshots, immutable version records, and guarded restores — plus #705 on the editor's find bar. Triaged as rebuild-yes, re-measure-no. Rebuild, because #705 changes npm/src/editor.ts and ribbon.ts, and those are bundled into the embed bundle this demo loads. Verified through the full pretest so the WASM engine is rebuilt with the History code compiled in. No re-measure, because nothing in the range changes behaviour on the diff, save or conversion paths the published figures describe. History is additive: every file under Docxodus/History is new and nothing existing calls into it yet. The one edit to a file this demo's finale does exercise — Verification/PackageManifestGenerator.cs — only widens two members from private to internal so the History code can reuse the entry-name canonicalisation. Same code, same results. CHANGELOG conflicted in the ordinary shape, main's "### Fixed" against this branch's "### Added" under [Unreleased]; both kept, main's first. The placement check confirms one copy of each with the demo entry still inside the section. Verified: 61 node checks, 3 pin checks, 14 browser assertions.
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.
Stack layer 8; depends on #711 → #710 → #709 → #708 → #707 → #706 → #704. Continues #671/#672.
Adds RestoreVersionAsync with an exact previewed-head precondition. It verifies the retained target snapshot, then appends a new version/reset commit and atomically publishes the new state. For V1→V2→V3, restoring V1 creates V4(parent=V3, restoredFrom=V1), reusing V1's exact snapshot bytes. Sequence and epoch advance even for an explicit same-content reset; earlier history is never rewritten.
Missing/corrupt/foreign targets, stale previews, and metadata/head-write failures do not publish a partial reset. Restore does not silently mutate an open DocxSession or replay/discard pending edits; the host/client epoch-reset lifecycle remains explicitly deferred.
Validation: 84 history tests pass. New coverage includes exact V1→V4 audit topology, filesystem reopen, all previous exact exports, post-restore imports, same-content resets, stale previews, each of three metadata-write failure points plus CAS failure, and missing/corrupt/foreign targets. git diff --check passes.
Self-review: GPT-5.6-sol reviewed the complete restore layer; no actionable findings remain.
Next: sequence reconstruction and replay validation, then remaining core/client milestones. Merge bottom-up; no merge wait.