From e885ed54126b60eda07688018ee29174f069da51 Mon Sep 17 00:00:00 2001 From: MechaCat02 Date: Tue, 30 Jun 2026 20:04:09 +0200 Subject: [PATCH] =?UTF-8?q?test(modules):=20pin=20orphan-sweep=20coverage?= =?UTF-8?q?=20of=20group-shared=20blobs=20(=C2=A711.6=20files=20review)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The §11.6 files slice relies on the orphan sweeper covering the new `files/groups//...` subtree "for free" via its recursive walk of `/files/`, with no sweeper code change. Lock that guarantee with an explicit test so a future sweeper refactor can't silently drop group-shared tmp files. Co-Authored-By: Claude Opus 4.8 (1M context) --- crates/manager-core/src/files_sweep.rs | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) 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();