security: fail cache-trash permanent deletion closed - #263
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (16)
🚧 Files skipped from review as they are similar to previous changes (4)
Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review. 📝 WalkthroughWalkthroughmacOS Trash의 재생성 가능한 캐시만 검토 후보로 노출합니다. 검토 스냅샷을 파일시스템 객체 identity에 결합합니다. 객체 바인딩 영구 삭제 primitive가 없으면 purge를 fail closed하고 후보를 보존합니다. 관련 Tauri API, CLI, UI, 테스트 및 문서를 갱신합니다. Changes캐시 Trash 검토 및 reclaim
Estimated code review effort: 4 (Complex) | ~60 minutes Merge Risk: 🟠 High · up to The cleanup flow can permanently remove items from Trash, but the current implementation may classify an entire browser Default profile—including possible user data—as disposable cache. That creates a concrete risk of irreversible data loss and should be fixed or explicitly accepted before merge; the purge loop may also cause noticeable IPC delays. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 66.67% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 60 functions across 33 files. (8 skipped: 8 unsupported.)
✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
7bd7540 to
50a897e
Compare
Pull request was converted to draft
Pull request was converted to draft
Pull request was converted to draft
…espace-v1' into HEAD
Pull request was converted to draft
| } | ||
|
|
||
| /// Move only the reviewed cache children to the OS Trash, retaining the cache root itself. | ||
| #[cfg(not(coverage))] | ||
| #[tauri::command] | ||
| pub fn clean_cache_contents( | ||
| dir: String, |
There was a problem hiding this comment.
🔍 Cache handlers compiled but unregistered under coverage
list_cache_targets and clean_cache_contents lost their #[cfg(not(coverage))] guards, but the generate_handler! block that registers them (run) stays gated on #[cfg(not(coverage))]. Under a coverage build the two #[tauri::command] functions now compile without being registered. Confirm the macro-generated wrappers still compile cleanly in that configuration.
(Refers to this code)
Was this helpful? React with 👍 or 👎 to provide feedback.
Scope
This PR is the converged canonical repair for the cache-Trash permanent-delete defect tracked by #170.
Protected
mainat this verification point:79067c1160ddedf7fc962cbf8067ce7e83c4564a.Exact head:
6deb5ea0a207be9d44490c775104b228d84bd383.The branch is deliberately reduced to exactly four cache-safety files on current main:
src-tauri/src/bin/disksage-cache-cleanup.rssrc-tauri/src/cache_cleanup.rssrc-tauri/tests/cache_cleanup_cli_purge_fail_closed.rssrc-tauri/tests/cache_cleanup_coverage_runtime_contract.rsRelease-verifier files that had been concurrently reabsorbed into this branch were removed/restored to protected-main state; the release artifact verifier remains owned solely by #264.
Security behavior
--purge-proven-cache-trashremains available only as read-only review evidence.--execute --purge-proven-cache-trashfails closed withcache-trash-identity-bound-permanent-delete-unavailablebefore journal or filesystem mutation.remove_dir_all.list_cache_targetsandclean_cache_contentsremain present in instrumented builds instead of disappearing behindcfg(coverage).Ownership / stale convergence
The previous branch had accumulated unrelated cloud, Git-worktree, iCloud, duplicate-management, customer-copy, Podman, release-verifier, and canonical-documentation changes. Those deltas are not overlaid here because they are owned by their dedicated current branches or protected main.
The broader physical-reclaim UI remains deferred while irreversible deletion is unavailable. This PR preserves the highest-value safety invariant instead of exposing an affordance that cannot safely mutate.
Current verification state
The exact-head workflows regenerated after the ownership-boundary repair and are non-passing until terminal:
32956404087— queued;32956403743— queued;32956403711— queued;32956403704— pending.The PR therefore remains Draft. Predecessor checks/reviews do not transfer to this head.
Required before review/merge progression
Do not merge using predecessor, queued, pending, stale, synthetic, no-source, model-only, or status-only evidence.