diff --git a/crates/manager-core/src/files_sweep.rs b/crates/manager-core/src/files_sweep.rs index 2ccb77e..dc28b86 100644 --- a/crates/manager-core/src/files_sweep.rs +++ b/crates/manager-core/src/files_sweep.rs @@ -165,6 +165,23 @@ mod tests { assert!(tmp.exists()); } + #[test] + fn sweeps_group_shared_tmp_files() { + // §11.6 group-shared files shard under `files/groups//...`, + // a disjoint subtree from the per-app `files//...`. The walk is + // recursive from `/files/`, so an orphan there is reaped without + // any group-specific sweeper change — this pins that "covered for free" + // guarantee against a future refactor. + let root = tmp_root(); + let group_shard = root.join("files/groups/6f693a33-9ae5-485b-804e-191e9fd33524/assets/ab"); + std::fs::create_dir_all(&group_shard).unwrap(); + let tmp = group_shard.join("uuid.tmp.123-0"); + touch(&tmp); + let stats = sweep_orphan_tmp_files(&root, Duration::ZERO); + assert_eq!(stats.files_deleted, 1, "group-shared orphan must be reaped"); + assert!(!tmp.exists()); + } + #[test] fn keeps_non_tmp_files() { let root = tmp_root();