Relationships
#901 doctor extensions --repair should remove stale bundle entries for deleted source files
Opened by dmc · 6/30/2026· Shipped 7/1/2026
Description
swamp doctor extensions --repair leaves stale bundle entries on disk when the source files they were built from no longer exist. Manual deletion of the bundle directory is required to clean up.
Steps to Reproduce
- Have a local extension loaded from
extensions/models/(e.g.proxmox_vm_extras.ts,proxmox_storage.ts) - Publish the extension to the registry and pull it via
swamp extension pull - Delete the local source files from
extensions/models/ - Run
swamp doctor extensions --repair
Observed Behavior
doctor extensions --repair reports all checks as passing but leaves the stale bundle directory (e.g. .swamp/bundles/e9c5c01e/) in place. The --repair output still lists the deleted source paths alongside the new pulled-extension paths:
"sourcePath": "/Users/dmc/projects/ai-infra/extensions/models/proxmox_storage.ts",
"bundlePath": "/Users/dmc/projects/ai-infra/.swamp/bundles/e9c5c01e/proxmox_storage.js",Even though extensions/models/proxmox_storage.ts no longer exists on disk.
Expected Behavior
swamp doctor extensions --repair should detect bundle entries whose source files no longer exist and remove them automatically — the same way it handles other inconsistent state. A user who deletes local extension source files and runs --repair should end up with a clean state without needing to manually rm -rf .swamp/bundles/<hash>/.
Shipped
Click a lifecycle step above to view its details.
dmc commented 6/30/2026, 11:22:02 PM
Follow-up: the stale entries persist because they're stored in .swamp/_extension_catalog.db (SQLite), not just on the filesystem. Deleting the bundle directory alone doesn't clear them — the catalog still holds the old source/bundle paths. The --repair command would need to check for catalog entries whose source files no longer exist and remove them from the DB, then also remove the associated bundle directories. Workaround until fixed: rm .swamp/_extension_catalog.db* forces a rebuild from the actual extension files.
Sign in to post a ripple.