Skip to content

feat(history): append guarded non-destructive version restores - #712

Merged
JSv4 merged 1 commit into
mainfrom
feat/history-restore-reconstruction
Sep 6, 2026
Merged

feat(history): append guarded non-destructive version restores#712
JSv4 merged 1 commit into
mainfrom
feat/history-restore-reconstruction

Conversation

@JSv4

@JSv4 JSv4 commented Sep 6, 2026

Copy link
Copy Markdown
Owner

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.

@JSv4
JSv4 changed the base branch from feat/history-version-service to main September 6, 2026 03:48
@JSv4
JSv4 merged commit ecb9340 into main Sep 6, 2026
9 checks passed
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.
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