-
Notifications
You must be signed in to change notification settings - Fork 0
security: fail cache-trash permanent deletion closed #263
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
seonghobae
wants to merge
170
commits into
fix/release-artifact-windows-namespace-v1
Choose a base branch
from
feat/physical-cache-reclaim-v1
base: fix/release-artifact-windows-namespace-v1
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from all commits
Commits
Show all changes
170 commits
Select commit
Hold shift + click to select a range
50a897e
feat: expose physical cache reclaim
seonghobae ad10a5b
docs: record physical reclaim loop evidence
seonghobae 080274f
fix: preserve cache purge results on journal errors
seonghobae baaa99f
docs: describe journal failure outcomes
seonghobae 3c65760
docs: bind gap baseline to purge fix
seonghobae 9a2a7fc
fix: bind cache purge to approved candidate set
seonghobae 1979cb8
docs: track cache purge approval gate
seonghobae 40588f4
test: cover pending cache journal failure
seonghobae 7108266
docs: record customer cache guidance
seonghobae 7624516
test: bind cache purge to reviewed snapshot
seonghobae 49443f0
test: expose cache purge audit failures
seonghobae 31b291a
fix: keep cache purge audit failures visible
seonghobae 9760a17
fix: surface cache purge audit gaps
seonghobae 4f6d7ef
fix: bind cache purge to reviewed snapshot
seonghobae 36b2335
fix: route cache purge through reviewed snapshot
seonghobae 3cd5d29
feat: make disk reclaim and customer copy actionable
seonghobae 28131ff
test: verify reviewed cache snapshot purge
seonghobae 967d040
fix: consume atomic cache trash review
seonghobae ed81ce3
fix: bind cache purge UI to one review snapshot
seonghobae 987613c
Merge remote cache audit fixes
seonghobae 96e6835
test: align cache UI contract with audit summary
seonghobae fefefb4
test: bind cache purge invocation to reviewed candidates
seonghobae 5ee20ab
test: bind cache trash approval to root identity
seonghobae e5493d3
fix: bind permanent cache purge to root identity
seonghobae 9ab1907
Merge reviewed cache snapshot implementation
seonghobae ae840d4
test: fail closed without object-bound cache purge
seonghobae d587976
fix: fail closed without final object-bound cache delete
seonghobae a235b82
test: preserve cache without object-bound permanent delete
seonghobae 0e49a05
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae 24e0785
test: disable cache purge affordance without object-bound delete
seonghobae 21c9a4f
test: hide unavailable permanent cache purge action
seonghobae b6aef3d
feat: project fail-closed cache purge availability
seonghobae 13f079f
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae d6c18c9
fix: suppress cache purge authority without object-bound delete
seonghobae 9daabeb
fix: hide unsafe cache purge affordance
seonghobae 8442df0
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae dffedc3
test: require fail-closed cache purge UI wiring
seonghobae a051d5f
docs: describe cache Trash purge fail-closed boundary
seonghobae 1cf2f4d
Keep unavailable cache purge guidance actionable
seonghobae 68c0859
docs: record fail-closed cache Trash review behavior
seonghobae 22b2f27
docs: record object-bound cache purge requirement
seonghobae 0102db7
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae d0ff1c0
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae d9cdf22
test: reject misleading cache-trash platform copy
seonghobae 1028fc9
fix: enforce actionable customer-facing copy
seonghobae fe11990
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae 7663bd7
test: reject misleading non-mac cache-trash support
seonghobae b8c3a26
fix: describe cache-trash support without overstating purge
seonghobae 927cee9
fix: clarify cache trash deletion boundary
seonghobae 9a22460
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae 702440f
fix: distinguish macOS cache review from purge support
seonghobae 8f0dc5f
test: bind cache-trash scope copy to availability contract
seonghobae 26d34b1
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae 9027c0f
fix: remove misleading cache-trash platform claim
seonghobae 9045627
test: keep cache copy contract synchronized
seonghobae f0c3be2
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae cc423cd
refactor: remove dead cache-trash support state
seonghobae 9dd965e
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae 60085ba
chore: format cache trash guard
seonghobae d36efa9
test: refuse unsafe cache-trash CLI permanent deletion
seonghobae 49ced5b
fix: fail closed on cache-trash CLI permanent delete
seonghobae bd54641
fix: keep cloud errors customer actionable
seonghobae 8f22826
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae a2c0f47
fix: remove pathname-recursive cache-trash purge authority
seonghobae 1e7b594
test: distinguish cache purge operation and audit failures
seonghobae c0a9cce
chore: format cache cleanup cli
seonghobae b2397f0
fix: distinguish cache purge operation and audit failures
seonghobae 2b2185c
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae a219d09
fix: distinguish cache purge and journal failures
seonghobae cbb6ded
test: enforce bounded cache purge feedback
seonghobae 4b90d3a
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae e5f2055
test: distinguish production date confidence labels
seonghobae 57f8bf2
fix: label production date confidence accurately
seonghobae 76a0005
test: gate platform-specific cache cleanup imports
seonghobae 2970222
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae c6ddd73
test: bind purge error copy to its helper
seonghobae 8189f17
fix: render production date confidence accurately
seonghobae a05a443
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae 5f7a7e1
docs: align cache reclaim baseline with fail-closed behavior
seonghobae 67786cb
fix: preserve cache cleanup CLI evidence shape
seonghobae 83d9022
test: create nested trash paths portably
seonghobae df2a743
test: fail closed when Organize markup markers are absent
seonghobae 674ac53
test: fail closed when Cleanup markup markers are absent
seonghobae 69e6f4e
test: require cache cleanup handlers in coverage builds
seonghobae 5c28b7c
test: validate customer markup boundaries safely
seonghobae 6a9eb21
fix: keep cache cleanup handlers in coverage builds
seonghobae 7d43bd0
Merge remote-tracking branch 'origin/feat/physical-cache-reclaim-v1' …
seonghobae 869f86c
docs: record current customer-copy and PR evidence
seonghobae b85a31a
fix: keep cache review actionable when purge is blocked
seonghobae c036d7c
docs: record follow-up customer-copy fixes
seonghobae 7cd2e62
docs: bind gap baseline to latest exact head
seonghobae 68d4a9f
docs: record current disk and worktree evidence
seonghobae a7a5241
fix: align cache trash CLI guidance
seonghobae c3abfe2
docs: record cache CLI guidance fix
seonghobae b4acaaf
fix: enforce actionable customer guidance
seonghobae d570d37
docs: record customer copy and cache boundary
seonghobae c360185
copy: guide empty reconciliation state
seonghobae 7787c06
fix: separate cache purge retry outcomes
seonghobae 6b2be59
docs: record cache purge outcome states
seonghobae 09e1fd7
test: remove unused customer-copy fixture read
seonghobae 92df2ed
fix(release): include artifact compatibility verifier
seonghobae dacedc0
copy: explain when Trash space is reclaimed
seonghobae 2f3d130
docs: record release verifier and Trash guidance
seonghobae 841b157
docs: keep physical reclaim out of canonical baseline owner
seonghobae e635aae
feat: suggest repository retention reference
seonghobae 38a7668
test: cover retention reference fallback
seonghobae e31243b
docs: record reclaim review boundaries
seonghobae 0d07044
merge main into physical reclaim lane
seonghobae 9d1b349
fix: align release artifact verifier with Windows runner
seonghobae 70623ca
test: require visible iCloud eviction approval value
seonghobae df5d6ab
fix: show iCloud eviction approval value
seonghobae 2133381
chore: keep release verifier repair in canonical owner
seonghobae 66fc7d0
security: converge cache-trash fail-closed repair on current main
seonghobae e0e75bc
refactor: remove unreachable cache-trash purge result
seonghobae ccdb035
Merge remote-tracking branch 'origin/fix/release-artifact-windows-nam…
seonghobae 87b4781
chore: keep cache-trash PR within owner boundary
seonghobae 6deb5ea
chore: restore release verifier ownership boundary
seonghobae 299c94f
fix: verify Windows release artifact namespace
seonghobae 6355c57
fix: bind release artifacts to platform directories
seonghobae 34f6e22
fix: verify tag artifacts before sbom
seonghobae d4e7f82
chore: restore cache-trash owner boundary
seonghobae f797100
chore: preserve release verifier ownership
seonghobae 766e45f
fix: keep cache journal helpers in coverage builds
seonghobae a4bdafa
fix: honor XDG trash location for current home
seonghobae 1716fed
test: bind Linux cache-trash evidence to XDG data home
seonghobae e850498
test: cover XDG trash routing
seonghobae 672bede
Revert "chore: preserve release verifier ownership"
seonghobae a40429e
Revert "chore: restore cache-trash owner boundary"
seonghobae e70f3d8
chore: keep release verifier owned by release PR
seonghobae ab648af
chore: remove release verifier mode drift
seonghobae 62f10ad
fix: match Windows release artifact runner
seonghobae fe4fa72
fix(ui): keep customer copy actionable
seonghobae 567a945
test(ui): guard customer copy markup bounds
seonghobae bf61404
fix(ui): remove duplicate cloud guidance
seonghobae 695f861
fix(ui): keep all customer guidance actionable
seonghobae 6ecfb5d
chore: restore cache-trash owner boundary
seonghobae c90ed5a
refactor: remove unreachable cache purge success payload
seonghobae 95df094
test: reject duplicate cache cleanup authority options
seonghobae b6aedc1
fix: reject duplicate cache cleanup authority options
seonghobae 3e8af4d
fix(ui): enforce actionable customer copy boundary
seonghobae 0603583
feat(cache): include Playwright browser cache
seonghobae 137680e
chore: reconverge cache-trash repair scope
seonghobae f156f04
Merge remote-tracking branch 'origin/main' into feat/physical-cache-r…
seonghobae 0476e43
fix(cache): bound invalid argument diagnostics
seonghobae adf22e9
fix: exclude provider-managed cache roots
seonghobae b96a9e8
test: hide managed provider cache candidates
seonghobae 93e5d56
fix: hide managed provider cache roots
seonghobae a27aefa
test: reject provider cache aliases
seonghobae 2ef4243
merge: converge release verifier into cache safety owner
seonghobae ef34a90
test: reject cache aliases into managed provider storage
seonghobae 74e2ff1
test: compile provider alias regression against production rules
seonghobae 03f9042
fix: bind cache roots to resolved provider boundary
seonghobae 56ede53
test: provide production-rules identity stub
seonghobae 2350e81
chore: converge cache-trash safety onto current main
seonghobae 5bdbadf
fix: restore release verifier ownership boundary
seonghobae d6be416
fix: preserve protected verifier file mode
seonghobae 78bae57
fix(stack): bind cache safety repair to release verifier owner
seonghobae 96b6eaf
fix(stack): preserve complete release verifier foundation
seonghobae abc7d85
test: lock fail-closed cache-trash operator guidance
seonghobae c860ab0
docs: make cache-trash operator guidance fail closed
seonghobae 80b5a5c
test: require superseding cache-trash safety ADR
seonghobae 2e02269
docs: supersede unsafe cache-trash deletion decision
seonghobae 1242d3c
docs: propose fail-closed cache-trash deletion ADR
seonghobae 3cd1988
docs: index proposed cache-trash safety decision
seonghobae 96c38af
merge(stack): inherit release binary isolation contracts
seonghobae c52c649
chore(stack): adopt current release foundation
seonghobae 0401a4f
chore(stack): adopt current release foundation
seonghobae b3b52fe
chore(stack): adopt exact release contract repair
seonghobae f25f51a
chore: restack cache-trash security on current release owner
seonghobae d9b7fcf
chore(stack): restack cache-trash security on current release owner
seonghobae File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
84 changes: 84 additions & 0 deletions
84
docs/architecture/adr/0012-cache-trash-permanent-delete-fails-closed.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,84 @@ | ||
| # ADR-0012: Cache Trash permanent deletion fails closed | ||
|
|
||
| **Status:** Proposed | ||
| **Date:** 2026-09-03 | ||
| **Supersedes:** ADR-0002 only for permanent deletion of cache entries already in OS Trash | ||
|
|
||
| ## Context | ||
|
|
||
| ADR-0002 allowed a separate `--execute --purge-proven-cache-trash` path to permanently remove | ||
| structurally recognized cache directories from operating-system Trash after pathname-based | ||
| revalidation. Subsequent implementation review showed that the final irreversible deletion syscall | ||
| was not bound to the exact reviewed filesystem object. A pathname can be replaced after review and | ||
| before recursive removal, so the earlier policy could not satisfy DiskSage's deletion-safety | ||
| boundary even when the candidate name, structure, size, and symlink checks were repeated. | ||
|
|
||
| DiskSage already has a reversible, identity-bound cleanup path that moves inactive regenerable cache | ||
| children into OS Trash. Permanent removal is different: once Trash is bypassed there is no product | ||
| undo boundary, so evidence that is sufficient for staging is not sufficient for irreversible | ||
| deletion. | ||
|
|
||
| ## Decision | ||
|
|
||
| DiskSage does not perform in-app permanent deletion of reviewed cache-Trash entries until the final | ||
| irreversible filesystem operation can be bound to the exact object that was reviewed and approved. | ||
|
|
||
| - `--purge-proven-cache-trash` remains a read-only evidence operation. | ||
| - `--execute --purge-proven-cache-trash` returns | ||
| `cache-trash-identity-bound-permanent-delete-unavailable` before journal or filesystem mutation. | ||
| - The library boundary also fails closed and does not call pathname-recursive permanent-deletion | ||
| primitives. | ||
| - Candidate names, signatures, byte counts, and approval phrases are review evidence only; they do | ||
| not create irreversible mutation authority. | ||
| - Operators who intend permanent reclaim must inspect the candidate evidence and empty the native | ||
| Trash manually through the operating system. DiskSage does not claim those bytes as physically | ||
| reclaimed until the operating system reports the resulting availability change. | ||
| - User files, cloud-provider placeholders, and arbitrary Trash entries remain outside this cache | ||
| evidence path. | ||
|
|
||
| This decision leaves ADR-0002's per-item active-use checks and reversible OS-Trash staging intact. | ||
| Only its separate permanent-delete authorization is superseded. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - The CLI and desktop remain conservative under disk pressure: they can identify regenerable cache | ||
| material but cannot silently turn that evidence into an irreversible delete. | ||
| - Automation receives a stable refusal code rather than a partial journal or ambiguous success | ||
| receipt. | ||
| - Physical space recovery may require an explicit operating-system Trash action after DiskSage has | ||
| completed its reversible cleanup. | ||
| - A future permanent-delete capability requires a new or superseding ADR, a real object-bound | ||
| deletion primitive for each supported platform, race/alias/mount/hardlink tests, recovery and | ||
| audit semantics, and current-head release evidence before it can become Accepted. | ||
|
|
||
| ## Alternatives rejected | ||
|
|
||
| - **Keep pathname revalidation plus recursive deletion.** Rejected because repeated pathname checks | ||
| do not bind the final syscall to the reviewed object and leave a check/use race at an irreversible | ||
| boundary. | ||
| - **Treat a candidate-set approval phrase as delete authority.** Rejected because a phrase proves | ||
| what the user reviewed, not that the pathname still names the same filesystem object at mutation | ||
| time. | ||
| - **Delete first and rely on the journal for recovery.** Rejected because a journal cannot restore an | ||
| object after a genuinely permanent delete and journal failure can itself occur after mutation. | ||
| - **Broaden automatic cleanup instead of using Trash.** Rejected because reversible OS-Trash staging | ||
| is the product's established safety and recovery boundary for regenerable cache content. | ||
|
|
||
| ## Evidence and acceptance | ||
|
|
||
| The production CLI regression creates a real cache-shaped directory under a temporary Trash, | ||
| invokes `--execute --purge-proven-cache-trash`, and requires the refusal code while proving both the | ||
| cache object and journal remain untouched. Documentation contract coverage requires the runbook and | ||
| ADR index to describe the same fail-closed behavior. | ||
|
|
||
| This ADR remains Proposed while the implementing PR is unmerged. Acceptance requires an unchanged | ||
| exact head with the repository's required tests, security gates, coverage, review, and release | ||
| verification all passing under live protection rules. | ||
|
|
||
| ## References | ||
|
|
||
| - [ADR-0002: Cache cleanup is per-item active-use evidence bound](0002-cache-cleanup-is-per-item-evidence-bound.md) | ||
| - `src-tauri/src/bin/disksage-cache-cleanup.rs` | ||
| - `src-tauri/src/cache_cleanup.rs` | ||
| - `src-tauri/tests/cache_cleanup_cli_purge_fail_closed.rs` | ||
| - [Cache cleanup operator runbook](../../development/cache-cleanup-operator-runbook.md) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.