Fold gc --all into --cache all - #144
Merged
Merged
Conversation
`--all` named a scope but set a depth: it meant "empty whole rather than trim by age", and it reached caches only. Next to `--cache`, which does name a scope, the pair read as a contradiction. `--cache` now carries both, with `all` as the reserved name for every cache. Emptying whole is what `--cache` does, because that is what naming a cache asks for, and `--older-than <days>` still asks for trimming instead. `all` is matched before the substring search, so a directory carrying `install` cannot answer to it. A bare `gc --delete` still leaves every cache alone, which is the property that separates the safe tier from the destructive one. `gc --delete --cache all` empties every cache and inspects nothing else, so the reaping that `gc --delete --all` also performed stays with bare `gc --delete`. Each command now does one thing. Closes #143
The `cleanup` and `settings` guide topics and the website command reference still told the reader to run `gc --delete --all`, which now exits with `unknown option`. The website had never documented `--cache` at all. The guide contract test only asserted that advertised flags are present, so a flag a command no longer defines could stay in a topic. Assert the retired flag is absent from the command source and from every rendered topic. Normalize a blank cache name once in each entry point. A blank-but-present name selected every cache while marking them emptied, so the internal API could disagree with the flags even though the CLI rejects the value. `gc --delete --cache all` empties caches and inspects nothing else, so SKILL.md no longer describes it as also reaping.
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.
Closes #143.
Description
--allnamed a scope but set a depth. It meant "empty the cache whole rather than trim it by age", and it reached caches only, never devices or project entries. Beside--cache, which does name a scope, the two read as if they contradict each other:Solution
--cachecarries the scope, withallas the reserved name for every cache:Emptying whole is what
--cachedoes, since that is what naming a cache asks for, and--older-thanstill asks for trimming.allis matched before the substring search, so a declared cache directory carryinginstallcannot answer to--cache all.collectGcReportderives "empty whole" from the same rule the CLI uses, so the internal API cannot disagree with the flags.Behavior change
gc --delete --allemptied every cache and reaped devices, dead project entries and stale locks.gc --delete --cache allempties caches and inspects nothing else; the reaping stays with baregc --delete. Running both is two commands now, and each does one thing.This split is what keeps the compilation-cache remedy safe: a user recovering a broken build runs
gc --delete --cache "compilation cache", and that must not also delete their simulators.One flag combination also inverts.
gc --delete --all --older-than 30emptied, because the old--allbranch ran ahead of the trim branch.gc --delete --cache all --older-than 30trims, which is what asking for an age filter should mean.A bare
gc --deletestill leaves every cache alone, which is the property that separates the safe tier from the destructive one inskill/SKILL.mdanddocs/field-test-protocol.md.Risk
--allis removed rather than deprecated, so a script carrying it now fails withunknown option '--all'instead of doing something different quietly. The CLI is pre-1.0 and the flag is documented only in this repo.Test plan
gc --cache allreports every cache and states that devices and project entries were not inspectedgc --allexits withunknown option '--all'gcalone still reports without touching cachesselectCachescoversall, its case-insensitivity, and a/opt/install/cachedirectory that must not answer to itguide cleanupandguide settingsprint--cache all, and the guide contract test now fails if a retired flag reappears in any topic (verified by reintroducing the old text)