Relationships
#181 Add swamp data delete command to remove a data artifact by model and name
Opened by 4chems · 4/28/2026· Shipped 5/4/2026
Problem
There is no way to delete a specific data artifact from swamp state. The swamp data subcommand offers get, list, search, query, versions, gc, and rename — but no delete.
This becomes a blocker when model methods guard against re-entry using stored state. For example, @4chems/node-provisioner's import method returns [NP-E028] if state already exists for a hostname, with the guidance "Deprovision or delete the existing entry first." Running deprovision is destructive (deletes the live server). Without data delete, the only options are manually editing the raw data file + checksum in .swamp/data/, or running a full deprovision when only a metadata refresh is needed.
Concrete case: A Hetzner server had its IP reassigned. Re-running import to pick up the new IPs was blocked by existing state. The workaround required hand-editing .swamp/data/.../raw and metadata.yaml checksum, and creating separate dns-record model instances to re-register DNS — all steps that should be unnecessary.
Proposed Solution
swamp data delete <model_name_or_id> <data_name>- Removes the latest version of the named data artifact for the given model
--version <n>flag to target a specific version--allflag to remove all versions (equivalent to full purge)- Requires confirmation prompt (or
--confirmflag) since this is destructive and not covered by GC policies
Alternatives Considered
swamp data gcexists but operates on lifecycle/retention policies, not on-demand deletion.- Model methods could expose a
resetorclear-statemethod individually, but that pushes the burden onto every extension author and doesn't solve the general case.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.