Conversation
|
Important
This repository does not receive automatic reviews because it has fewer than 10 stars. ⚙️ Run configurationConfiguration used: defaults Review profile: CHILL Plan: Advanced Run ID: 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 |
FeathBow
force-pushed
the
feat/interactive-cleanup
branch
from
September 16, 2026 21:30
48fd85a to
1525b75
Compare
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Closes #101.
degu already knows which caches are safe to delete and which it refuses to decide. What it had no place for was the decision itself. A judgement about one location — this model is coming back next week, that one is not — could only be recorded by transcribing paths out of a report that had already scrolled past, and the command that took them,
degu clean, frees no quota: it stages, and space comes back only from a purge that until now took everything or nothing.This adds the place to make those decisions, and the command-line selector the interface needs in order to wrap one.
degu tuiruns the same scan, shows its findings beside the current staging trash, and hands what the reader decided todegu trash purgeanddegu clean.degu trash purge --pathnarrows a purge to entries staged from at or under a path: a new selector overplan_expired_trash's existing predicate shape, matching the origin the operation log recorded, not a new way to destroy data.User-visible behavior.
degu tuiis a new subcommand takingscan's own arguments. Space puts the selected finding in the clean plan or takes it out; Ready to clean findings start in it and Needs review findings start out, so including one is still an explicit act for one location at a time.tshows the staging trash, where space chooses entries for permanent deletion and nothing is chosen by default. The masthead carries the current plan, and the staged screen counts what was chosen, what the seven-day expiry removes whether or not it was chosen, and what the trash holds once both have run.ppreviews the clean half throughclean --dry-run;cruns both halves, each printing its own plan and taking its own confirmation. The equivalent command line is printed before each — not to be typed, but so that the next time the decision is a rule rather than a judgement, the reader already knows how to say it.degu trash purgegains a repeatable--path; without it the plan is still every entry.Compatibility. No WAL, sidecar, oplog, or JSON schema changes, and no change to what any existing command does with the arguments it already accepted. The standalone
degu-tuicrate added in #99 is removed and its modules live undercrates/degu/src/tui/; it waspublish = falseand absent from the release archive and the installer, so nothing shipped depended on it. The workspace publishes four crates as before.degugainsratatui, which resolves against the workspace's existingcrossterm; everything else the interface needs it already had.tools/release-contract.shandtools/package-release.shgain the new subcommand's man page and completion position.Moving in deleted a parallel model rather than relocating it: a
Findingstruct deserialized from JSON, mirrors ofDispositionandRecovery, aCoverageenum, and string matching on"eligible"/"opt_in"all gave way to the real types the compiler checks. Reading a saved report from another machine is no longer possible and is not part of this PR; the interface now scans in process, because deciding requires being where the files are.Validation
Passed locally on this branch:
The workspace run reports 1565 passed, 0 failed. Nineteen of those are new unit tests over the two decision models, built against findings that pass through
finalize_findingsso the tier assertions are degu's real classification rather than a fixture's claim about it: what may be decided and what may not, that deciding twice returns to where it started, that the arguments name every chosen path and carry no flag the interface did not set, and on the trash side the two kinds of entry a path selector cannot name, the expiry split, and the cursor bounds. Four new integration tests drive the real binary against the purge selector, covering one origin among several, a parent path, a selector matching nothing, and that expired-claim housekeeping still runs.A/B. Behaviour was measured end to end by driving the real binary through a pty in an isolated
HOME. Fixture:ccacheandgo-buildalready staged,go-buildrecreated on disk at 6 MiB,Mozilla.sccacheleft on disk as an unchosen Needs review finding. Choosing the stagedccacheentry and pressingc:Afterwards the
ccacheentry is gone from the trash directory, so its 3 MiB is off the quota; the unchosengo-buildentry is still staged and still reachable bydegu undo;Mozilla.sccacheis untouched. The staged screen had predictedAfterwards it holds 2 locations · 8.00 MiB, anddegu trash listreports 8.0 MiB across 2 entries. Typing anything butpurgegiveserror: the clean was not run either: Purge cancelled; no trash entries were deleted., with the trash intact and the eligible cache still on disk.degu clean --include-review --path …trash purgetook everythingdegu trash purge --path <origin>A defect the A/B caught. The first version of the decision model marked Ready to clean findings as already in the plan and passed only the chosen review paths as
--path. The run showed such a finding marked included and then still sitting on disk afterwards, because--pathkeeps only findings at or under a path — a filter. Choosing one review finding silently emptied the default plan of everything else, and the printed plan said one location while the screen the reader had just left said two. There is no CLI spelling for "the default plan, plus these two judgements", which is the issue's own problem statement; so the mark column was narrowed to answer one question, is this row in the plan, and every row degu will act on became decidable in both directions. When nothing has been changed the arguments carry no--pathat all, so an unchanged plan stays the default plan rather than a filter that happens to match it today.Two smaller things the same runs exposed: the masthead still said
Read-only snapshotand sat beside asourcefield that had been dead since the browser stopped reading a saved JSON file, and both were replaced by the live plan; andpran a dry run and then asked a bareProceed? [y/N]directly under a plan, which reads as consent to run it, so the prompt now says what it is asking.Safety
crates/degu/src/tui/contains no filesystem write, no traversal, noDetectCtx, noLifecycle, and no lock; its only imports from the mutation side are the seven-day retention constant andTrashEntry, the read-only rowdegu trash listalready prints. What it produces is aCleanArgsand aTrashCommand::Purge, handed to the existing command implementations, so admission, sealing, the mutation lock, execution-time re-verification, and both confirmations stay exactly where they were and there is no second deletion path to grow.confirm_permanent_deleteruns unchanged, including typing the wordpurge, and refusing it cancels the clean with it rather than proceeding to stage more.--pathcould never name them; ambiguous entries stay selectable and carry the CLI's own warning, because the CLI warns about them rather than refusing them and the interface must refuse only where the CLI refuses.--path, soclean's existing rule applies: if one selected item fails sealed-staging preflight the whole batch is refused before any source, trash, or WAL mutation.