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

Relationships

#4502 Rename a behavior type (e.g. move it to another namespace) without losing its data

Opened by liywjl · 11/7/2026

Problem

After my username rename (#4500), my repo's 12 local behaviors had to move from @williamjtlacroix/es-* to @liywjl/es-*. There's no command for that, and the type is part of where data lives:

  • data is stored under .swamp/data/<type>/<definitionId>/, outputs under .swamp/outputs/<type>/, and the data catalog keys every row by type;
  • swamp data rename renames a data item inside a behavior, and swamp repo upgrade doesn't touch types;
  • changing only the type string in the extension and definitions would leave about 400 MB of history under the old type's folders.

What I did by hand:

  1. Stopped serve, changed the type in the extensions and definition YAML.
  2. Moved the data, outputs and definitions-evaluated folders to the new type.
  3. Cleared the catalog's populated flag so it would backfill.

The backfill is upsert-only (by design, per bulkUpsert), so it kept 19,818 rows for the old type whose files no longer existed. data.query then returned every item twice until I deleted those rows from SQLite myself. It works now, and new versions carry on from the old history.

This will come up again: moving local extensions into a collective before publishing, or from a personal namespace to a team's.

Proposed

Smallest first:

  • A supported full reindex, e.g. swamp data reindex, that rebuilds the catalog from disk and drops rows with no file behind them. Hand moves then become safe.
  • swamp behavior type rename <old> <new>: moves the data and outputs folders and rewrites catalog rows while holding the repo's locks, refusing while serve or a run is active, and prints what changed.
  • A docs note on what a type rename involves until either exists.

Cost

  • A rename has to be resumable if interrupted halfway, and remote datastores (S3) can't just move a folder.
  • Workflow run records keep modelType per step. Rewriting them keeps history links working; leaving them makes history show the old name.

I'm happy to be credited as co-author if you take this on.

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

Open

11/7/2026, 7:48:46 PM

No activity in this phase yet.

03Sludge Pulse

Sign in to post a ripple.