Skip to content

cargo-cleanme v0.2.11

Choose a tag to compare

@github-actions github-actions released this 25 Oct 17:23
· 35 commits to main since this release
Immutable release. Only release title and notes can be modified.

0.2.11

An output root inside another package's directory could delete that package's checked-in files. This is the one to read first if you are upgrading from 0.2.10. A covering root nested inside a package directory was classified private and cleaned, and the tool reported the space it had reclaimed — so a package whose target/ sat inside another package's tree lost its checked-in files, not just its build output. A covering root nested inside a package directory is now never a cleanup target, and the cleanup engine re-proves that at the moment of the spawn rather than trusting the earlier classification. If a package directory under a cleaned root looks thinner than it should, restore it from version control; the changelog names the defect and its regression test.

The cleanup spellings moved to the root, and the old ones still work. cargo cleanme --full is now the canonical Full-cleanup spelling and cargo cleanme ~/projects is the canonical bounded-root spelling — the root is the single cleanup front door for all three scopes and both modes:

$ cargo cleanme --full            # the canonical Full cleanup
$ cargo cleanme ~/projects        # the canonical bounded-root cleanup
$ cargo cleanme                   # routine maintenance

Nothing published was removed: cargo cleanme clean --full and cargo cleanme clean ~/projects still parse, still mean exactly what they meant, and are now hidden from the help. The reason for the move is that the two-level spelling had become a trap — a flag written at the root and the same flag written on clean could disagree, and one of them silently won. They are now the same flag, and a flag given at both levels is a usage error rather than a silent preference. --known does not move to the root: cargo cleanme --known is a usage error (exit 2), because the root has no --known; cargo cleanme clean --known still resolves to the bare invocation. scan --full remains a hidden alias of scan --all.

cargo cleanme . is now a bounded cleanup of .. It was a usage error (exit 2), because . was indistinguishable from the hidden clean alias. It is now the bounded-root spelling for the current directory.

The Full cleanup no longer refuses everything because one walk was incomplete. Until now, a Full reconciliation whose platform-wide walk did not finish refused the whole cleanup: the run exited 2 and nothing was cleaned, because an incomplete walk was read as "every learned root is unproven". That inference is wrong — an incomplete walk is evidence that the walk did not finish, not that every root under it is unmeasured. The Full cleanup now re-walks each learned root as its own walk root and judges it on its own traversal: a root that proves is cleaned, a root that does not is reported as unproven with the reason code skipped_incomplete_coverage, and the run exits 1 because the cleanup was partial. Two things did not change: a reconciliation that produced no fresh generation at all still refuses outright with the same message, and a missing per-root coverage verdict still fails closed.

A direct cargo cleanme silently discarded the ROOT you typed. The Cargo-injected token was stripped by spelling, and since the ROOT positional moved to the root the two are spelled identically — cargo-cleanme cleanme lost its own root and became a machine-wide Routine cleanup, so the scope label changed from explicit to routine and your project trees joined the selected roots. The token is now identified by launch context: Cargo exports CARGO to the external subcommand it runs, and a direct invocation does not.

A command-line --exclude spelled through a symlink protected nothing. The configured patterns were canonicalised and the command line's were not, so the tree you asked to keep was deleted. One canonicaliser now serves both.

A directory named cleanup authorization root could change the run's exit code. The cleanup engine's authorization verdict was a prose substring match on a human-readable message. The verdict is a typed BlockReason now; the message renders the verdict rather than being it.

The interactive selection surface renders what it draws. The frame was written with a bare newline — a linefeed without a carriage return in raw mode — so every line started at the column the previous one ended in, the frame occupied twice the rows it claimed, and the rewind erased most of it. The terminal cursor was never restored, so a session that ended in NOR left your shell with no visible cursor. The frame's geometry was wrong too: its width was clamped up to forty cells, so in a narrower terminal every line wrapped, and its height was bounded in lines against the terminal's height even though the frame occupies one row more than its line count — which scrolled the title off the top. The frame now adopts the terminal's geometry exactly and degrades in the order that costs you least: the reclaimable-size column goes first, then the ownership column's wording, then the name keeps what is left. The interactive preconditions are now checked before the scope is resolved, so a refused -i no longer spawns cargo metadata across every resolved root.

Also fixed: a root --profile that silently discarded a clean --package and exited 0 after doing a different destructive action; before_bytes contradicting the row's own detail; a stale VISUAL hiding a usable $EDITOR; learned_root_retention_days truncated with as u16; the shared symlink predicate trimming a trailing backslash on Unix, where \ is an ordinary filename character; two human surfaces writing path text raw; and the --full alias no longer being advertised in scan --help or the shell completions.

The JSON envelope keeps its shape and its schema_version: 1; its before_bytes now publishes the size the decision used, and the log surface's diagnostics and unresolved fields now agree with the JSON's. Three exit codes moved: cargo cleanme . is no longer a usage error, the Full cleanup's incomplete-coverage case exits 1 instead of refusing with 2, and a selector given at both levels is a usage error instead of one of them silently winning.

Five prebuilt targets are attached — x86-64 and aarch64 for Linux, macOS, and Windows x64 — each with a SHA-256 sidecar, alongside the four installer scripts and a release manifest.

See CHANGELOG.md for the full record. Pre-1.0: read the changelog before upgrading.