Skip to content

fix: exclude datastore-bundles from DEFAULT_DATASTORE_SUBDIRS#1104

Merged
stack72 merged 1 commit intomainfrom
fix/1100-exclude-datastore-bundles-from-subdirs
Apr 4, 2026
Merged

fix: exclude datastore-bundles from DEFAULT_DATASTORE_SUBDIRS#1104
stack72 merged 1 commit intomainfrom
fix/1100-exclude-datastore-bundles-from-subdirs

Conversation

@stack72
Copy link
Copy Markdown
Contributor

@stack72 stack72 commented Apr 4, 2026

Summary

Root Cause

PR #1103 added datastore-bundles to DEFAULT_DATASTORE_SUBDIRS alongside driver-bundles and report-bundles. This caused the S3 datastore setup migration to:

  1. Copy .swamp/datastore-bundles/ (containing S3 extension bundles) to the S3 cache
  2. Delete .swamp/datastore-bundles/ from local on successful migration

On subsequent commands, the datastore loader (which runs during bootstrap before the DatastorePathResolver exists and therefore always reads from local .swamp/) could no longer find the S3 extension bundles. This broke all S3 datastore operations — the extension failed to load, resolveDatastoreConfig couldn't resolve the S3 config, and sync operations failed silently.

Why This Is Correct

The UserDatastoreLoader is explicitly excluded from resolver wiring due to bootstrap ordering — it loads datastore extensions that configure the resolver. So datastore-bundles must always remain in local .swamp/, never in the datastore tier. This mirrors the exclusion of UserDatastoreLoader from the resolver in #1103.

driver-bundles and report-bundles remain in the datastore tier because their loaders do receive the resolver and can find bundles in the cache path.

Test Plan

🤖 Generated with Claude Code

The datastore loader runs during bootstrap before the
DatastorePathResolver exists, so datastore extension bundles must
always remain in local .swamp/. Including datastore-bundles in the
datastore tier (added in the #1100 fix) caused the S3 datastore
setup migration to delete .swamp/datastore-bundles/ after copying
to cache, breaking subsequent S3 extension loading on all commands.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

No blocking issues found. This is a clean, well-scoped regression fix.

Highlights

  • Root cause is well-documented: The comment at datastore_config.ts:59-63 clearly explains the bootstrap ordering constraint — why datastore-bundles must stay local while driver-bundles and report-bundles can live in the datastore tier.
  • Tests updated correctly: Both the isDatastoreSubdir and resolvePath tests now verify that datastore-bundles resolves to the local .swamp/ path, not the S3 cache path.
  • Minimal blast radius: Only touches the config constant and its tests — no unrelated changes.
  • DDD: The domain configuration module correctly captures the invariant that datastore extension bundles have different lifecycle constraints than other bundle types due to bootstrap ordering.

LGTM — approve.

Copy link
Copy Markdown

@github-actions github-actions Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Adversarial Review

Critical / High

None.

Medium

None.

Low

  1. design/extension.md doesn't mention the bootstrap constraint — The design doc lists datastore-bundles alongside other bundle dirs without noting why it's excluded from the datastore tier. This is purely a docs concern and doesn't affect correctness, since the code comment in datastore_config.ts:59-63 is clear.

Verdict

PASS — Correct, minimal fix. The removal of "datastore-bundles" from DEFAULT_DATASTORE_SUBDIRS is well-motivated by the bootstrap ordering constraint (the datastore loader runs before the DatastorePathResolver exists, so its bundles must remain in local .swamp/). The change is consistent with the existing design doc, which already documents datastore-bundles/ as living in .swamp/datastore-bundles/. The inline comment is precise about why and what breaks without it. Tests are updated to verify both the isDatastoreSubdir return value and the path resolution behavior.

@stack72 stack72 merged commit 7873a8e into main Apr 4, 2026
10 checks passed
@stack72 stack72 deleted the fix/1100-exclude-datastore-bundles-from-subdirs branch April 4, 2026 21:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant