Skip to main content
← Back to list
01Issue
FeatureTriagedSwamp CLI
Assigneesstack72

Add swamp data delete command to remove a data artifact by model and name

Opened by 4chems · 4/28/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
  • --all flag to remove all versions (equivalent to full purge)
  • Requires confirmation prompt (or --confirm flag) since this is destructive and not covered by GC policies

Alternatives Considered

  • swamp data gc exists but operates on lifecycle/retention policies, not on-demand deletion.
  • Model methods could expose a reset or clear-state method individually, but that pushes the burden onto every extension author and doesn't solve the general case.
02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNEDCLASSIFICATION

Triaged

4/28/2026, 12:22:17 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack724/28/2026, 12:20:52 PM

Sign in to post a ripple.