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
{{ message }}
Repository navigation
Undo through symbolic links: rm is undone as a regular file; a redirection through a dangling link is undone by deleting the link #234
Found on 2026-11-17 while fixing redo in #231. The Rust shell records the wrong undo data when a command acts through a symbolic link. Two defects remain, each confirmed with a probe test in a temporary sandbox root. A third (chmod/chown through a symlink recording the link's own mode and owner) was fixed in #231.
Defects
rm on a symlink is undone as a regular file.apply_rm in impl/rust-cli/src/commands.rs reads the content through the link and removes the link; undo writes a regular file.
A redirection through a dangling symlink is undone by deleting the link.ln -s target link; /bin/echo hi > link creates target and records CreateFile "link". In impl/rust-cli/src/redirection.rs, setup_output_redirect uses path.exists(), which is false for a dangling link. Undo removes link and leaves target.
What to do
Decide and document one rule: operate on the link itself, or resolve it and record the real path.
Apply it to rm and to redirections. chmod and chown already resolve the link.
Add regression tests. impl/rust-cli/tests/redo_roundtrip_tests.rs has a whole-sandbox snapshot harness (mod laws) and a proptest over random command sequences that leaves out symbolic links because of these defects (see the comment on command_line()). Add ln -s back once fixed.
Done means
The two reproductions restore the original state exactly.
The random-sequence test passes with symlinks included.
In impl/rust-cli: cargo fmt --check, cargo clippy --all-targets --all-features -- -D warnings and cargo test pass. Commits signed.
hyperpolymath/januskey's reversible-coreFileMetadata (is_symlink, symlink_target) is a useful reference for what to record. It must not be added as a dependency here (see .claude/CLAUDE.md).
Do not claim the shell is production-ready or formally verified end to end.
#232 - Runtime holes: 13 of 15 closed, by containment through a directory handle and a fixed session root [open] #231 - Fix redo: redone operations keep their undo data, and redo restores what the operation produced [open]
📝 Issue Planner
Check the box below or use the @coderabbitai plan command to generate an implementation plan and prompts that you can use with your favorite coding assistant.
Create Plan
🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your .coderabbit.yaml:
issue_enrichment:
auto_enrich:
enabled: false
💬 Have feedback or questions? Drop into our discord!
Activity
coderabbitai commentedon Nov 17, 2026
🔗 Related PRs
#232 - Runtime holes: 13 of 15 closed, by containment through a directory handle and a fixed session root [open]
#231 - Fix redo: redone operations keep their undo data, and redo restores what the operation produced [open]
📝 Issue Planner
Check the box below or use the
@coderabbitai plancommand to generate an implementation plan and prompts that you can use with your favorite coding assistant.🧪 Issue enrichment is currently in open beta.
You can configure auto-planning by selecting labels in the issue_enrichment configuration.
To disable automatic issue enrichment, add the following to your
.coderabbit.yaml:💬 Have feedback or questions? Drop into our discord!