Repository navigation
MCH 0.1.0: verified copy/move, real parallel workers, CLI fixes - #1
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 4eb5255d6e
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| for task in &plan.files { | ||
| if !targets.insert(task.destination.clone()) { |
There was a problem hiding this comment.
Reject case-folded duplicate destinations
On case-insensitive filesystems such as default macOS APFS, two sources whose basenames differ only by case (for example A and a) produce distinct PathBuf keys here but refer to the same destination file. With parallel workers, both pre-publish checks can observe the destination as absent, both renames can succeed by replacing the same file, and a --move run then deletes both originals while retaining only one payload. Destination collision detection must account for the target filesystem's path equivalence rather than only exact PathBuf equality.
Useful? React with 👍 / 👎.
| if let Err(error) = fs::rename(stage, destination) { | ||
| fs::rename(&backup.0, destination) | ||
| .context("restoring existing destination after rename failure")?; |
There was a problem hiding this comment.
Preserve the Windows backup when restoration fails
On Windows, if publishing the staged file fails after the existing destination was moved to backup, and restoring that backup also fails (for example because another process recreated the destination or the filesystem has a transient error), ? returns while backup is still a TempPath. Its Drop implementation then deletes the backup, destroying the user's original destination precisely when the replacement operation failed; the backup must be retained or otherwise disarmed when restoration cannot complete.
Useful? React with 👍 / 👎.
Summary
Local verification (Android Termux, Rust 1.99.1)
Scope and limitations
MCH is not an atomic multi-file transaction or filesystem snapshot. Metadata such as timestamps/ACLs/xattrs is not fully preserved. A per-file copy failure leaves all original sources, but completed destination files may remain. Windows and macOS CI must pass before merging. See docs/SPECIFICATION.md.