Skip to content

dl --purge deletes workspaces devlaunch never created #107

Description

@blooop

Question

dl --purge deletes workspaces devlaunch never created and knows nothing about.
What should "mine" mean, and what should it do with the rest?

Graduated from the e2e blast-radius build ticket,
which explicitly scoped itself to making the test suite safe and left this
open. Its metal evidence: run unscoped, --purge would have deleted
pythontemplate — a workspace on this host that devlaunch did not create, does
not track, and cannot recreate.

purge_all_data() iterates everything list_workspaces() returns
(devlaunch/dl.py:335-339), and list_workspaces() is a straight read of
devpod list. devpod's namespace is shared with every other way a person makes a
workspace — devpod up by hand, another tool, an older devlaunch. --purge
treats all of it as devlaunch's to destroy.

The ownership predicate already exists, unused. This is what makes the ticket
worth doing rather than merely worth noting: workspace ids derive from
(owner, repo, ref) through WorkspaceId (devlaunch/workspace_id.py:204,219),
and devlaunch already records the ones it created in metadata.json. "Mine" is
answerable from state devlaunch already keeps — no new concept, which is exactly
what principle 2 wants.

The open sub-question, and the real decision here: what should --purge do
about workspaces it finds but does not recognise?
Candidates, judge them:

  • Delete only recognised ones, silently ignore the rest. Safe, but a user who
    expected a clean slate is surprised by what survives.
  • Delete only recognised ones and report the others by name. Costs one line
    of output and removes the surprise.
  • Keep today's behaviour behind an explicit opt-in flag for people who really do
    want everything.

Principle 3 is live here: if "recognised" and "unrecognised" are two different
things --purge can do, that is a distinction the code should be able to state,
not something inferred from a lookup miss at the point of deletion.

This is a wayfinder:build ticket: go through /tdd.

Test-first, and mind the shape of the red test — the same trap
#103 hit. A test whose red state
deletes real workspaces is not acceptable. #103's merged seam (a per-run scoped
DEVPOD_HOME/DEVPOD_SSH_CONFIG) should make an honest end-to-end test of this
safe to write; prefer that over stubbing if it holds. The red test wants to be:
a scoped namespace containing one workspace devlaunch created and one it did not,
--purge, and the unrecognised one still standing.

Blocked on #103 — it supplies the safe harness this ticket's tests need.

Relation to the destination. This is not strictly about developing in a
devcontainer. It is in scope because the map's own work surfaced it, because a
nested daemon hides it (inside a container every workspace is devlaunch's, so
the bug becomes invisible exactly where developers will now be working), and
because leaving a known destructive defect behind while building the thing that
conceals it is the opposite of principle 1.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions