Repository navigation
Duplicates: say why files were left; ask before deleting Recycle Bin refusals; count hard links once; drop ImageSharp - #2
Conversation
ImageSharp 3.1.12 carries five security advisories that are fixed only in 4.x, which refuses to build without a commercial license key. Its use here was small: decode an image to a 32x32 grey surface for the perceptual hash, read a PNG frame for the video hash, and read dimensions for the preview. - Images: a new IImageHashDecoder, implemented in Platform.Windows on the Windows Imaging Component (Windows.Graphics.Imaging). It applies EXIF orientation, scales to 32x32 with Fant resampling inside the decode, and reports the displayed dimensions. Decode failures name the HRESULT instead of surfacing as a blank error. - Video: FFmpeg now writes each sampled frame as 1024 raw grey bytes, so no image decoder is involved; a short frame is rejected. - Preview: dimensions come from the same decoder's header read. - The package reference is gone, and with it the NU1902/NU1903 warnings. Resampling differs slightly, so the image and video algorithm versions move to 3 and cached fingerprints are recomputed on the next analysis. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
A file with several hard links is one file on disk, but each name added its size to folder, category and session totals. Windows links most of WinSxS this way, so a system drive scanned noticeably fuller than it is. Both scanners now keep a HardLinkTracker (volume + file index, about 8 bytes per file). The first name a scan reaches carries the size; every further name is still listed with its real size, is marked IsAdditionalHardLink and adds nothing to folder, session or progress totals. Files without a stable identity are always counted, as before. Schema v16 persists that flag so the SQL category breakdown counts the shared data once too. Older rows default to 0 and read as they did. The managed-scanner test fixture gave every file the same identity, which now means "all hard links of one file"; it returns one identity per path. The v13 migration fixture gains the FileEntries table every real database has. Docs: schema v16 in README, ARCHITECTURE, CODEMAP and DOCUMENTATION; CODEMAP also drops ImageSharp from the package lists. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ecycle Bin refusals Duplicates page: DuplicateDeletionService now returns a reason for every selected file it left in place (changed since the analysis, could not be re-read, no longer matches the kept file, refused by Windows, Recycle Bin unavailable, no stable identity), and a group whose keeper cannot be verified lists its selected files as such. The page shows them in a warning banner with the reason under each path, in English, German and Spanish. Before, the status line only showed a lower count. Recycle Bin refusals: DeletionOutcome.RecycleBinRefused marks items Windows could only have deleted permanently. Duplicates, Cleanup, Smart Cleaner and the Results page follow such a refusal with a second confirmation, "Delete these N item(s) permanently?", that lists the items and defaults to No. A yes re-runs only those items as a permanent deletion through the normal checks (keeper re-verification, snapshots, cleanup policy); nothing else is selected. Scheduled cleanup keeps the refusal. The new dialog is in the capture catalogue, and the coverage test now also reads ConfirmItemsAsync. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
File systems that cannot give a file a unique 64-bit id report 0 or all ones instead: ReFS (Dev Drive) for files whose 128-bit id does not fit, and some network and user-mode file systems for every file. Unrelated files share those values, so the hard-link tracker folded them into one file and left all but the first out of the folder, category and session totals. Those ids are now always counted, like a missing identity. Also adds review tests: - v15 -> v16 migration of a real v15 database keeps every row and every category total, and reopening does not migrate twice. - damaged images (empty, header-only, truncated, not an image) never throw out of the image hash, and the decoder releases the file. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review: approve, with one fix pushed (74f16d1)I checked out the PR head in a separate worktree, read the full diff and the code around it, and ran every
CI is green on the fix commit. Fix: a placeholder file id was treated as a hard link (
|
Summary
Round 3 of the 2026-10-14 audit. It covers the StorageMaster items left open after #1:
dotnet buildnow reports 0 warnings).Changes
Why a duplicate was not deleted (
feat(delete))DuplicateDeletionService.DeleteSelectedWithResultAsyncreturnsSkipped: oneDuplicateDeletionSkipper selected file it left in place. The reasons are:Safety_Duplicates_NotDeleted_*strings in en-US, de-DE and es-ES follow the glossary ("beizubehaltende Datei", "archivo que se conserva", Papierkorb/Papelera de reciclaje). A test checks that every reason has a string in every language.Second confirmation for Recycle Bin refusals (
feat(delete))DeletionOutcome.RecycleBinRefusedis set whenFileDeleterrefuses an item that Windows could only delete permanently, for both single items and batches. A locked file is not a refusal.Safety_RecycleRefused_*("Delete these N item(s) permanently?"). The dialog lists the items and its default button is No, keep them:CleanupEngine.BuildPermanentRetryForRecycleBinRefusals). Suggestions the engine may not delete permanently (high risk, or no permanent support) contribute nothing. The next report shows that run.SmartCleanerService.NarrowToRecycleBinRefusals). Paths are revalidated against their analysis-time snapshots, and the summaries are reported separately. A cancelled run never asks.ScenarioCataloguefor the capture harness.SafetyDialogCoverageTestsnow also readsConfirmItemsAsynccall sites.PageViewModelThreadingGuardTests) pin two things:if (deletePermanently), after the listed question;Hard links count once (
fix(scan))HardLinkTrackerkeys files by volume + file index (about 8 bytes per file) and is thread-safe for the parallel managed scanner.SizeBytes, but is markedIsAdditionalHardLinkand adds nothing to folder, progress or session totals.FileEntries.IsAdditionalHardLink(default 0), so the SQL category breakdown counts shared data once. Older rows read exactly as before.FileEntriestable every real database has.ImageSharp replaced (
refactor(dedupe))IImageHashDecoderlives in Core;WicImageHashDecoder(Platform.Windows) implements it onWindows.Graphics.Imaging. The decoder:scale=32:32,format=gray -f rawvideo), so no image decoder is needed. A short frame is rejected.Verification
ci.ymlstep ran locally on the final tree:cargo fmt --check, clippy-D warnings,cargo testandcargo build --release(Rust is unchanged)dotnet format --verify-no-changesdotnet testwithSTORAGEMASTER_REQUIRE_TURBO_SCANNER=trueand the freshly built binary: 600 passed, 1 intentional skip (567 + 1 skip before)RecycleBinGuardTestsnow also assert the new flag. On this machine the\\localhost\C$cases run in full, not their early return.SixLaborsassembly.sm_dupdelete_*,sm_recycle_guard_*,sm_hardlink_*,sm_phash_*), or go through mocked deleters.InfoBar, and aContentDialogbuilt like the Cleanup report). The XAML compiles in the Release build. I did not run the capture harness.Left alone, and why
🤖 Generated with Claude Code