feat: add auto-resolution and name remapping for S3 datastore extension#910
Draft
feat: add auto-resolution and name remapping for S3 datastore extension#910
Conversation
Add infrastructure to automatically resolve the S3 datastore from the @swamp/s3-datastore extension package, replacing the built-in S3 code path over time. ## What changed ### Phase 1: Auto-resolution infrastructure - Added `resolveDatastoreType()` helper to `extension_auto_resolver.ts` (mirrors the existing `resolveVaultType()` pattern) - Added `hotLoadDatastores()` to `ExtensionInstallerPort` interface and the auto-resolver adapter, so newly installed datastore extensions are hot-loaded alongside models and vaults - Updated `installAndLoad()` to call `hotLoadDatastores()` after pulling an extension ### Phase 2: Name remapping with backward compatibility - Added `RENAMED_DATASTORE_TYPES` map: `"s3" → "@swamp/s3-datastore"` - Made `resolveDatastoreConfig` and `parseDatastoreEnvVar` async to support auto-resolution - When `type: s3` is encountered in `.swamp.yaml` or `SWAMP_DATASTORE` env var, the code remaps to `@swamp/s3-datastore`, attempts auto-resolution, and falls back to built-in S3 handling if the extension is unavailable - Users see a deprecation warning suggesting they update their config ## User impact - **No breaking changes** — existing `type: s3` configs continue to work via the built-in fallback - A deprecation warning is logged when the old `s3` type name is used - On first use, logged-in users will see the extension auto-install (~5s one-time cost); subsequent runs use the cached extension - The `@swamp/s3-datastore` extension must be published to the registry before this lands (it has been published as v2026.03.28.1) ## Testing performed - Compiled binary and tested against a real S3-backed repository - First run: extension auto-resolved from registry, downloaded, bundled, and cached successfully - Second run: extension loaded from cache with no registry call, command completed cleanly - All unit tests pass (38 tests across modified files) Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
type: s3in.swamp.yaml→@swamp/s3-datastoreextensionThis is the first step toward moving the S3 datastore to the
@swamp/s3-datastoreextension package (published as v2026.03.28.1 in the swamp-extensions repo). A follow-up PR will remove the built-in S3 code once this is validated.Phase 1: Auto-resolution infrastructure
resolveDatastoreType()helper inextension_auto_resolver.tshotLoadDatastores()inExtensionInstallerPortand auto-resolver adapterPhase 2: Name remapping
RENAMED_DATASTORE_TYPESmap:"s3" → "@swamp/s3-datastore"resolveDatastoreConfigandparseDatastoreEnvVarare now asynctype: s3configs auto-resolve the extension, with deprecation warningUser impact
type: s3configs work as befores3type name is used@swamp/s3-datastoreextension published to registry (done: v2026.03.28.1)Test plan
🤖 Generated with Claude Code