Skip to main content
← Back to list
01Issue
BugClosedSwamp CLI
Assigneesstack72

#319 extension pull fails referencing removed source after extension source rm

Opened by bixu · 5/11/2026

Description

After removing a local extension source via swamp extension source rm <path>, subsequent swamp extension pull <ext> --force and swamp extension update <ext> invocations continue to fail with a rollback error that references the just-removed source path. swamp extension source list confirms zero sources are configured at the time of the failure. The pull eventually succeeds after several minutes / further commands, but the recovery path is unclear.

Steps to reproduce

Encountered while updating @hivemq/mudroom (registry 2026.05.11.522026.05.11.53) in a dedicated swamp repo at ~/.mudroom. The repo had previously had /Users/blake.irvin/hivemq/swamp-extensions/extensions/models/mudroom registered as a local extension source (added at some point by the mudroom bash wrapper as a fallback when the type wasn't found locally).

# Confirm source registered
SWAMP_REPO_DIR=~/.mudroom swamp extension source list
#  ✓ /Users/blake.irvin/hivemq/swamp-extensions/extensions/models/mudroom

# Remove the source
SWAMP_REPO_DIR=~/.mudroom swamp extension source rm /Users/blake.irvin/hivemq/swamp-extensions/extensions/models/mudroom
#  Removed extension source: ...
#  0 sources configured

# Confirm zero sources
SWAMP_REPO_DIR=~/.mudroom swamp extension source list
#  No extension sources configured.

# Pull still fails referencing the removed path
SWAMP_REPO_DIR=~/.mudroom swamp extension pull @hivemq/mudroom --force
#  FTL error Error: 'Type "@hivemq/mudroom" (kind=model) is already claimed by
#  @hivemq/[email protected] at ~/.mudroom/.swamp/pulled-extensions/@hivemq/mudroom/models/mudroom/mudroom.ts.
#  Cannot install @local/[email protected] at /Users/blake.irvin/hivemq/swamp-extensions/extensions/models/mudroom/mudroom.ts
#  — filesystem changes rolled back. Run `swamp extension rm @hivemq/mudroom` first if you intended to replace it.'

# swamp extension update produces the same error
SWAMP_REPO_DIR=~/.mudroom swamp extension update @hivemq/mudroom
#  WRN extension·update '@hivemq/mudroom: Update failed: ... same message ...'

The pull eventually succeeded after additional read-only commands (extension trust list, model type search, sqlite inspection of the catalog) and a retry. Whether the recovery was due to stale catalog state aging out, a lock timeout, or some other side effect is unclear.

Expected

After swamp extension source rm reports success and source list shows zero sources, swamp extension pull should not attempt to install from the removed path.

Observations

  • The rollback always wipes the freshly-pulled .53 files, leaving the repo with the prior .52 files (or, after enough rollback cycles, no files — see warning below).
  • After the rollback, every subsequent swamp command on this repo prints: WRN swamp·cli "2 pulled extension(s) have missing source files: @bixu/mudroom, @hivemq/mudroom. Run 'swamp extension install' to restore them."
  • The @local/[email protected] synthetic name (namespace = repo basename) suggests swamp is auto-discovering the dev path during install via something other than the source list.
  • Inspecting ~/.mudroom/.swamp/_extension_catalog.db after the source-rm shows no entries pointing at the removed path; bundle_meta source_dirs_fingerprint only references in-repo paths.

Environment

  • swamp: 20260509.235714.0-sha.7ace6b02
  • macOS: 26 (Tahoe), arm64
  • Affected repo: ~/.mudroom (dedicated mudroom repo created by the @hivemq/mudroom wrapper)
  • Cross-referenced extension: @hivemq/[email protected]
02Bog Flow
OPENTRIAGEDIN PROGRESSCLOSED+ 1 MOREASSIGNEDCLASSIFICATION

Closed

5/11/2026, 5:36:19 PM

No activity in this phase yet.

03Sludge Pulse
stack72 assigned stack725/11/2026, 5:26:41 PM
Editable. Press Enter to edit.

stack72 commented 5/11/2026, 5:36:08 PM

Thanks for the detailed report, @bixu — the steps to reproduce and observations were really helpful for tracing this.

This is the same root cause as swamp-club#310, which was fixed in PR #1356 (commit dc987cbf, merged May 10). Your build (20260509.235714.0-sha.7ace6b02) is from May 9 — two commits before that fix landed.

What was happening: Before the fix, swamp extension source rm removed the path from .swamp-sources.yaml but didn't purge the corresponding rows from _extension_catalog.db. Those stale rows were still materialized as @local/[email protected] during pull, colliding with the freshly-pulled @hivemq/[email protected] in the I-Repo-1 uniqueness check.

Why it eventually recovered: Some CLI commands (like model type search) trigger a reconcile on startup that re-scans disk against .swamp-sources.yaml. Since the source was already removed from the YAML, the reconcile cleaned up the orphaned rows — unblocking the retry.

Fix: source rm now purges catalog rows by source-path prefix immediately after removing the source from the config, so stale rows can't survive to conflict with a subsequent pull.

Running swamp update to pick up the latest build should resolve this. If you hit it again after updating, please reopen and we'll dig further.

bixu commented 5/12/2026, 11:07:07 AM

Nice, thanks!

Sign in to post a ripple.