You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Stacked on #493 / issue #456. Review the semantic-diff commits in this PR; once #493 lands, this branch can be retargeted to main without changing the #457 patch.
Summary
adds a stable, versioned docxodus.semantic-changes v1 schema with deterministic ordering and canonical JSON
SemanticDiff crashes with ArgumentOutOfRangeException on any DOCX containing OOXML integer attributes (image wp:extent/@cx,@cy; w:gridCol/@w; page/margin twips; etc.) whose values fit in long but exceed SemanticValue.MaxSafeInteger (2^53−1). A single crafted <wp:extent cx="9007199254740992" cy="1"/> turns the public verification surface into an uncaught crash across every transport (WASM/npm, Python, MCP docxodus_get_content format:"semantic_changes"). Fix in one place — clamp to bounds, return Absent, or add a lossless integer-string kind — at SemanticValue.Integer or the call sites in SemanticDiff.cs (image dims at 1598-1599, gridCol widths at 1834, and the twips projections at 1695-1786).
New file Docxodus.Tests/Verification/SemanticChangeSetContractTests.cs is missing the #nullable enable directive at the top, unlike all six sibling new files added in this PR. CLAUDE.md's Coding Standards explicitly require "New files: add #nullable enable at the top." — insert the directive after the license header for consistency.
TableGridValue/ElementValue/AttributeValue in SemanticDiff.cs use unbounded Descendants()/DescendantsAndSelf() sweeps rooted at the outer w:tbl/w:tc, so nested-table w:gridCol, w:tblStyle, w:tblW, and w:tcW leak into the outer container's emitted before/after values. When the outer table has a legitimate TblGridDigest/TblPrDigest/ShellDigest change, the v1 audit schema records anchor-accurate values that are in fact composed from nested tables, undermining the schema's stated contract. Fix by scoping to direct children — e.g. element.Element(W + "tblPr")?.Element(W + "tblStyle"), .Element(W + "tblPr")?.Element(W + "tblW"), .Element(W + "tcPr")?.Element(W + "tcW"), and table.Source.Element?.Element(W + "tblGrid")?.Elements(W + "gridCol") — mirroring IrReader's own tblGrid scoping.
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
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.
Closes #457
Stacked on #493 / issue #456. Review the semantic-diff commits in this PR; once #493 lands, this branch can be retargeted to
mainwithout changing the #457 patch.Summary
docxodus.semantic-changesv1 schema with deterministic ordering and canonical JSONArchitecture and safety
Verification
SemanticDiffTests: 30 passedPackageManifestTests: 30 passedMcpServerDispatcherTests: 85 passedgit diff --check: passedMeasured guards: