Skip to main content
← Back to list
01Issue
BugShippedSwamp CLI
Assigneeskeeb

Relationships

#1091 data prune --json omits reclaimedModels[].modelName when a report entry is grouped first

Opened by keeb · 7/11/2026· Shipped 7/11/2026

Description

swamp data prune --json (and --dry-run) emits reclaimedModels entries without modelName, even though the orphaned model's resource/file data carries a modelName tag.

Root cause: DefaultDataLifecycleService.findOrphanedData (src/domain/data/data_lifecycle_service.ts) reads group.items[0]?.tags.modelName. Report data entries (report-swamp-method-summary, report-swamp-method-summary-json) are written without a modelName tag, so whenever a report entry happens to enumerate first in the group, modelName comes back undefined.

Steps to Reproduce

  1. swamp init
  2. Install a model definition (e.g. shell-echo, command/shell) and run swamp model method run shell-echo execute
  3. Delete the model definition YAML from models/command/shell/
  4. swamp data prune --force --json

Observed: reclaimedModels[0] has type, modelId, dataNames, versionCount, bytesReclaimed — no modelName. Expected: modelName: "shell-echo" (the tag is present on the result/log entries' metadata).

Impact

UAT tests/cli/data/prune_test.ts (swamp#1079 gap-fill) fails schema validation: DataPruneSchema requires reclaimedModels[].modelName.

Suggested Fix

In findOrphanedData, take modelName from the first grouped item that has the tag instead of blindly items[0]: [HOST-1]((d) => d.tags["modelName"]).find((n) => n) Verified locally: with this change the prune JSON includes modelName and all 35 data_lifecycle_service unit tests still pass.

Environment

swamp main (c3fd7b11), Linux x86_64

02Bog Flow
OPENTRIAGEDIN PROGRESSSHIPPED+ 1 MOREASSIGNED+ 2 MOREREVIEW+ 4 MOREPR_MERGED+ 1 MORENOTIFICATION_SKIPPED

Shipped

7/11/2026, 5:14:07 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
keeb assigned keeb7/11/2026, 4:39:27 PM

Sign in to post a ripple.