fix(store): no root keeps the \\?\ prefix; the Windows root test compares canonical homes (P11c)
check / check (push) Canceled after 0s
portable-macos / portable (macos-latest) (push) Canceled after 0s
portable-windows / portable (windows-latest) (push) Canceled after 0s
two-user / two-user (push) Canceled after 0s

main's canonical default made Root::setup take std::fs::canonicalize(home),
which on Windows is \\?\C:\...  with the long name. root.rs now uses
root::canonical (canonicalize, then the prefix off) at every site, so no
root, record or message keeps the prefix; Unix is unchanged (the identity),
and macOS still agrees on /tmp and /private/tmp. windows_root.rs compares
against default_root(canonical(home)), so TEMP's 8.3 short name is not in
the expectation, and asserts the root has no prefix.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HS8WZziDnyxunC23MUxrLp
This commit is contained in:
swaitsandClaude Fable 5.1 committed 2026-10-30 16:18:04 -06:00
1 parent 4a1bd05b7c
commit f2d1d4e892
2 files changed
+20 -10

No files matched your search

+5 -1
View File
@@ -35,7 +35,11 @@ fn the_default_root_sits_under_local_app_data() {
fn setup_makes_a_private_root_and_its_folders() {
let home = tmp("setup");
let (root, report) = Root::setup(home.path(), None, None).unwrap();
assert_eq!(root.path(), default_root(home.path()));
// The default root of the home as the system names it (its long name,
// no `\\?\` prefix; TEMP may hold an 8.3 short name).
let real_home = ledger_store::root::canonical(home.path()).unwrap();
assert_eq!(root.path(), default_root(&real_home));
assert!(!root.path().to_string_lossy().starts_with(r"\\?\"));
assert!(report.created && !report.tightened && !report.recorded);
assert!(winsec::is_private(root.path()).unwrap());
for sub in ["books", "run", "legacy"] {