Crash-safety hardening, new history commands, and code-health overhaul#2
Merged
Conversation
Bug 1 — TUI empty merge base (src/tui/views/fuse.rs) do_fuse now resolves both head indices via get_timeline_head, computes the real LCA with repo.merge_base, and loads that tree as the base (empty only for genuinely unrelated histories) — mirroring the CLI. No more spurious conflicts on unrelated changes. Bug 2A — union truly concatenates (src/fuse.rs, callers, docs/fuse.md) Added a shared concat_blobs primitive and a MergeDecision::Concat variant. The two genuine-conflict arms of merge_file_union now combine ours-then-theirs bytes instead of silently dropping a side; fuse() takes a &FsStore (infallible, falls back to theirs only on CAS error). All five callers (CLI, TUI, review, sync, tests) updated; docs corrected. Bug 2B — TUI resolver wired up (src/tui/resolver.rs, src/tui/views/fuse.rs) Slimmed resolver.rs to shared types and converted the resolver into a view-owned modal (matching the rest of the TUI) rather than a nested terminal sub-loop. On conflict, do_fuse opens the modal; apply_resolutions builds the final tree with Ours/Theirs/Both(→concat)/Skip semantics. Skip leaves the file unresolved and does not commit — no silent side-picking. Bug 3 — file-mode fidelity (src/fsmerkle.rs, src/git_remote.rs, src/git_export.rs, src/workspace.rs) Added MODE_EXEC/MODE_SYMLINK, relaxed validation, fixed git import/export to map 100644/100755/120000 faithfully (restoring byte-exact tree SHA-1), and made materialize create real symlinks + set the exec bit (#[cfg(unix)]). No tree-hash format change — the format already encoded entry.mode.
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.
This branch hardens ivaldi's core engine against crashes and concurrent use, adds the missing day-to-day history commands under ivaldi's own vocabulary, and clears the codebase's lint/CI debt. 83 files changed; 694 tests passing (up from 622), clippy -D warnings clean, CI added.
Crash safety & data integrity
A VCS must not lose data. This branch closes every known window where a crash or a second ivaldi process could corrupt repository state:
New commands (ivaldi vocabulary, not git's)
Config UX
Bug fixes
Code health
Docs
README, docs/cli.md, and docs/rosetta.md updated for all new commands; new module docs for atomic_io, luth_device; new user guide docs/undo.md; key reference in docs/config.md; dotfile/security-block behavior documented in docs/ignore.md.
Testing
694 unit tests (+72), including crash-recovery scenarios (interrupted-switch resume/rollback), scripted interactive patch sessions, lock contention, truncated-file tolerance, and config validation. Manually smoke-tested end-to-end: seal → reseal → undo → pluck → rewind → gather --patch → JSON output → concurrent-process locking.