Skip to content

Does --purge need an unsaved-work check #459

Description

@blooop

Question

--purge applies no unsaved-work check to devlaunch's own clones, while rm and --prune both do. Is that right?

Raised by #452 and promoted to its own ticket because it is a principle 1 question, and principle 1 outranks everything else on this map.

The asymmetry, stated plainly. dl <ws> rm refuses a clone that holds work existing nowhere else. --prune weighs the same question per clone and keeps what it cannot prove safe. --purge removes the whole cache after one confirmation, and the only thing standing between a user and work that exists nowhere else is that they typed y. So the contract table's "what proves removal safe" column reads, for that row, the confirmation, and nothing else.

Two readings, and this ticket picks one:

  1. It is correct as it stands. A purge is a stated intent to remove everything, the prompt names what goes, and a command whose whole purpose is "remove all devlaunch data" is entitled to take the user at their word. Adding a check makes the destructive-by-request command harder to complete than the routine one, and a purge that refuses is a purge that gets -y'd reflexively, which is worse.
  2. It is an inconsistency principle 1 does not permit. The other two paths encode "work that exists nowhere else is different from disk", and a purge that does not is a hole in exactly the property the rest of the map is being built around. A count in the prompt ("3 clones hold work that exists nowhere else") costs the user nothing and changes what they are agreeing to.

Note that these are not symmetric in cost. Reading 2's minimum version is a report, not a refusal: it does not make the purge harder, only better informed, and --prune already computes exactly this. Weigh whether the cheap version is so cheap that reading 1's objection does not apply to it.

Also weigh: --purge already names what it is leaving before it asks. A command that has room to list foreign workspaces it will not touch has room to say how many of its own clones hold unpushed work.

How the answer gets tested: whichever way it goes, a test pins the prompt's content for a cache containing one clone with unpushed work, so the answer is asserted rather than assumed. If the verdict is "correct as it stands", that test still documents it.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions