workflow validate can silently overwrite local edits to pulled extensions via force-pull in auto-resolver
Opened by stack72 Β· 4/16/2026Β· Shipped 4/17/2026
Problem
Running swamp workflow validate can silently re-pull an extension from swamp.club and overwrite a user's local edits to the pulled extension directory, with no warning and no conflict prompt.
This happens because the auto-resolver's installer adapter hardcodes force: true when installing an extension it needs to resolve. If the local copy of an extension ends up not registered in the in-memory registry β for example because a manifest edit made it fail to index via registerLazyFromCatalog, or because a referenced type isn't present in the locally-indexed version β the resolver path is taken and the installer overwrites the pulled directory without asking.
A command the user reasonably expects to be read-only (validate) can therefore destroy local work.
Steps to reproduce
- Pull an extension from swamp.club (e.g.
@some/ext). - Edit a file inside the pulled extension directory (e.g. introduce a manifest issue, or modify a method).
- Write or edit a workflow that references a model type from
@some/ext. - Run
swamp workflow validate. - If the local edits prevent the type from being registered as a lazy entry, the auto-resolver falls through to
installExtensionwithforce: trueand overwrites the pulled directory. Local edits are gone. No prompt, no warning.
Scope of affected code
src/cli/auto_resolver_adapters.tsβ installer adapter hardcodesforce: truewith no distinction between "first-time install" and "extension already exists on disk."src/domain/extensions/extension_auto_resolver.tsβresolveModelType/installAndLoadcalls the installer without checking whether the extension already exists locally, regardless of whether the user has modified it.src/domain/models/user_model_loader.tsβregisterLazyFromCatalogflow determines whether a local extension is visible to the registry; silent skip paths here are what cause the fall-through.src/libswamp/extensions/pull.tsβ respectsforcewithout considering whether the target directory has local modifications.
Suggested fix direction
- The auto-resolver should not invoke the installer with
force: trueunconditionally. At minimum, it should check whether the extension is already present on disk and refuse to overwrite without explicit user opt-in. - Consider a "local modification" marker: if the pulled extension directory has been modified since install (e.g. checksum mismatch against the lockfile),
workflow validateshould surface a clear error rather than silently clobbering. - Validation (and other read-intent commands) should probably not be allowed to pass
force: trueinto the installer at all. A separate "auto-install missing dependencies on validate" behavior could stay, but overwriting existing extensions should requireextension pull --forcerun deliberately. - Related adjacent concern:
hotLoadModelsin the installer adapter only reloads from the pulled models dir and not from.swamp-sources.yamlsource dirs, so after an auto-pull a local source override can end up shadowed at runtime. Worth addressing in the same pass.
Impact
Silent data loss of local WIP when developing or debugging extensions. Particularly painful because the triggering command (workflow validate) reads as a safe, side-effect-free operation.
Shipped
Click a lifecycle step above to view its details.
Sign in to post a ripple.