Skip to main content
← Back to list
01Issue
BugOpenSwamp CLIPublic
AssigneesNone

Relationships

#4314 data prune through serve deletes data of an auto-definition whose declared type is invalid

Opened by zack · 11/2/2026

In swamp serve, data prune uses the injected definition repository with the definition id index attached. findById then finds auto-definitions through DefinitionIdIndex, which reads files with YamlDefinitionRepository.readDefinitionFile (readDefinitionEntry). That reader catches the ModelType.create failure for an invalid declared type and skips the file. So the index misses the auto-definition, isModelLive returns false, and the model's data is deleted as orphaned.

In the CLI, the same definition makes isModelLive throw on ModelType.create, which aborts the prune and deletes nothing. A definition in models/ also aborts in serve, because findAll(type) keeps it.

Expected: serve's prune fails the way the CLI does, or at least never treats a definition that declares the id as absent.

Found while triaging swamp-club#4300.

02Bog Flow
◉OPEN○TRIAGED○IN PROGRESS○SHIPPED

Open

11/2/2026, 7:29:11 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.