Extension auto-resolve reports "already_installed" for truncated pulled-extension trees
Opened by stack72 · 4/20/2026· Shipped 4/20/2026
Summary
When a pulled extension's directory exists on disk but its tree is incomplete (missing critical kind subdirectories such as datastores/ or models/, and/or missing manifest.yaml), the extension auto-resolve check short-circuits with reason: already_installed instead of repairing or reporting the truncation. The command then fails downstream with a misleading error like Unknown datastore type "@swamp/s3-datastore" or Unknown model type: @swamp/issue-lifecycle — even though the extension appears present.
Reproduction
Observed in a centralised repo used from multiple worktrees (SWAMP_REPO_DIR / --repo-dir pattern):
- Have an extension installed via
swamp extension pull @swamp/s3-datastore. - By some means the kind subdirectory for the extension's primary kind gets deleted from
.swamp/pulled-extensions/@swamp/<name>/(we reproduced hitting this state; root cause of the truncation itself is unknown — possibly a partial extract, a concurrent worktree operation, or interrupted install). - Run any command that needs the extension, e.g.
swamp data get issue-1 state-main --json.
Actual output:
{"event":"auto_resolve","status":"searching","type":"@swamp/s3-datastore"}
{"event":"auto_resolve","status":"failed","extension":"@swamp/s3-datastore","path":".../pulled-extensions/@swamp/s3-datastore","reason":"already_installed"}
{"error":"Unknown datastore type \"@swamp/s3-datastore\" in .swamp.yaml. Available types: filesystem"}Same symptom observed for @swamp/issue-lifecycle (missing models/ and manifest.yaml) — auto-resolve reports already_installed, then model create fails with Unknown model type.
Workaround: rm -rf .swamp/pulled-extensions/@swamp/<name> then re-run the command (auto-resolve re-fetches cleanly).
Expected
Auto-resolve should validate what already_installed actually means. A pulled-extension directory whose manifest is missing, or whose declared kind subdirectories are absent, is not installed — it is corrupted. The check should either:
- repair by re-fetching, or
- fail loudly with a clear error identifying the missing component (e.g.
pulled extension @swamp/s3-datastore is missing manifest.yaml / datastores/ — run 'swamp extension pull @swamp/s3-datastore' to repair).
Either is better than the current outcome, where the CLI reports the extension as resolved and then a downstream loader produces a confusing 'type not found' error.
Scope
The fix belongs in the extension auto-resolve logic (the code emitting the auto_resolve events — search for status: "already_installed" in the pulled-extension check). Validation should read the extension's manifest.yaml and confirm that the subdirectories it declares are actually present and non-empty before short-circuiting.
Environment
- swamp: 20260206.200442.0-sha (compiled from peppy-watching-russell worktree)
- Platform: macOS (darwin 25.3.0)
- Datastore:
@swamp/s3-datastorebacked by DigitalOcean Spaces
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.