Skip to main content
← Back to list
01Issue
BugShippedSwamp CLIPublic
Assigneesstack72

Relationships

#2475 swamp run gc deletes output YAML but orphans every run .log file

Opened by stack72 · 9/24/2026· Shipped 9/24/2026

swamp run gc removes expired model method output records but never removes their .log files, so run logs accumulate forever for every model.

Cause: YamlOutputRepository.deleteByMethodLifetime (src/infrastructure/persistence/yaml_output_repository.ts, around lines 395 and 430) derives the log path by replacing the .yaml suffix of the output record with .log. The two files are named from different timestamps: createRunLog (for example src/libswamp/worker/run_deps.ts) names the log from its own new Date() call, and the output record takes a later timestamp a few milliseconds after. The derived path never exists, the NotFound is swallowed, and the real log stays on disk. The output record already stores the real path in its logFile field, which is not used for deletion. The log removal also emits no dirty signal, so remote datastores would keep it even if the path matched.

Repro (swamp 20260923.231117.0-sha.ad0aa46d): in a fresh repo, run any model method a few times (I used swamp model method run @swamp/step-lease acquire and complete, 3 times each), then swamp run gc --older-than 1m --force. It reports 6 outputs deleted, but .swamp/outputs/swamp/step-lease/acquire and .../complete still hold all 6 .log files (for example acquire/-2026-09-24T11-34-17-475Z.log next to the deleted ...-11-34-17-478Z.yaml).

Expected: run gc deletes each output's log file (via its recorded logFile) together with the YAML, and marks it dirty for datastore sync.

Found while triaging swamp-club#2262.

02Bog Flow
✓OPEN✓TRIAGED✓IN PROGRESS✓SHIPPEDTRIAGE+ 5 MOREREVIEW+ 10 MOREPR_MERGED+ 2 MORESESSION_SUMMARIZED

Shipped

9/24/2026, 10:57:55 PM

Click a lifecycle step above to view its details.

03Sludge Pulse
stack72 assigned stack729/24/2026, 12:06:45 PM

Sign in to post a ripple.