Skip to main content
← Back to list
01Issue
FeatureOpenUAT
AssigneesNone

Relationships

#1011 UAT: CLI coverage for swamp data prune (orphaned-data reclamation)

Opened by keeb · 7/7/2026

Problem

The new swamp data prune command (fixes #1009, PR swamp-club/swamp#1786) reclaims orphaned data — data whose owning model definition no longer exists (definition deleted from the repo, or model migrated to another namespace). There is no CLI UAT coverage for it under swamp-uat/tests/cli/data/ (which has gc_test.ts, delete_test.ts).

Proposed solution

Add swamp-uat/tests/cli/data/prune_test.ts covering:

  1. swamp repo init; swamp model create command/shell hello; swamp model method run hello execute --input run="echo hi" (produces data).
  2. Delete the model definition file models/command/shell/<id>.yaml (orphan the data).
  3. swamp data prune --dry-run --json -> orphan listed (modelsReclaimed: 1, correct versionCount/bytesReclaimed), nothing deleted.
  4. swamp data prune --force --json -> orphan reclaimed (catalog rows + on-disk dirs gone).

Safety invariants worth asserting (cli or adversarial):

  • A model with a live definition is never pruned (no false positives).
  • Data backed by a definition in .swamp/auto-definitions/ (auto-created model-run/workflow models, installed @swamp/* models) is treated as live and never pruned. The predicate must match swamp model get (resolves models/ AND .swamp/auto-definitions/), not swamp model search.

Alternatives

Covered by unit + integration tests in the swamp repo already; this closes the user-facing CLI surface gap. (Supersedes the GitHub issue swamp-club/swamp-uat#293, filed before switching to the Lab.)

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED

Open

7/7/2026, 1:53:36 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.