Skip to content

fix(compare): fall back to a line diff when semantic rows fail to build - #61

Merged
seatedro merged 1 commit into
masterfrom
rohit/diff-core-compare-line-fallback
Nov 3, 2026
Merged

seatedro merged 1 commit into
masterfrom
rohit/diff-core-compare-line-fallback

Conversation

@seatedro

@seatedro seatedro commented Nov 3, 2026

Copy link
Copy Markdown
Owner

One file whose semantic rows failed to build made the whole compare request fail, and the Node binding rejected every file, because that error went up through diff_files instead of falling back. That file now gets a line diff with a logged warning and fallback semantic / invalid, a new reason value added to FORMAT.md and the TypeScript types without a format version bump (adding an enum value isn't listed as breaking).

When the semantic diff succeeded but its rows did not build a valid
document, diff_one returned Error::Build. diff_files collects every
file into one Result, so a single bad file failed the whole request,
and the Node binding rejected every file with it.

That file now gets a line diff like any other semantic failure, with a
warning logged and fallback kind semantic, reason invalid. The new
reason is added to FORMAT.md and the TypeScript types; adding an enum
value is not a breaking change under the format's versioning rules.
@seatedro seatedro closed this Nov 3, 2026
@seatedro seatedro reopened this Nov 3, 2026
@seatedro
seatedro enabled auto-merge November 3, 2026 12:49
@seatedro
seatedro merged commit 75ffa21 into master Nov 3, 2026
14 of 15 checks passed
@seatedro
seatedro deleted the rohit/diff-core-compare-line-fallback branch November 3, 2026 13:10
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