Skip to content

feat(fs): support live embedded pack install/update lifecycle#353

Merged
wolfy-j merged 5 commits into
mainfrom
feat/fs-embed-live-install
Jun 16, 2026
Merged

feat(fs): support live embedded pack install/update lifecycle#353
wolfy-j merged 5 commits into
mainfrom
feat/fs-embed-live-install

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Jun 16, 2026

Copy link
Copy Markdown
Contributor

Why

Live hub installs could add fs.embed entries before the corresponding .wapp reader was registered in the embedded filesystem registry. Updates also need deterministic version-aware resolution while old and new packs are both staged.

What

  • Track embedded packs per pack path with module/version ownership.
  • Add entry-aware fs.embed resolution so Manager.Update selects the pack matching the entry metadata.
  • Register new module packs in dependency expansion Prepare, unregister obsolete packs on Commit, and roll staged packs back on failure.
  • Skip restaging unchanged module packs so live filesystems are not disturbed during unrelated dependency operations.
  • Register lock-file .wapp loads with module/version metadata.

Verification

  • go test -race -short -tags "fts5 sqlite_vec treesitter" ./api/service/fs/embed ./boot/deps/hub ./cmd/internal/entries ./service/fs/embed

@wolfy-j wolfy-j requested a review from skhaz June 16, 2026 21:09
wolfy-j added 5 commits June 16, 2026 17:58
Refactor the embed registry from a flat reader map to per-pack handles keyed
by pack path and indexed by owning module/version. Add RegisterPack,
UnregisterPack, and UnregisterModule so a specific (module, version) pack can
be staged, replaced, or torn down independently — the basis for live module
install/update/uninstall.

Add EntryResolver (GetFSForEntry) so the manager resolves an fs.embed entry
through the pack matching the entry's module/version metadata, falling back to
ID-based lookup for legacy packs. This keeps resolution deterministic while two
versions of a module are registered side by side during an update.
Tie embedded .wapp pack lifecycle to module dependency expansion. The hub
dependency handler now returns registry Effects from Expand: Prepare stages the
resolved modules' packs into the embed registry (keeping file handles open) so
fs.embed entries created in the same changeset resolve during apply; Commit
drops packs made obsolete by the operation (removed modules, prior versions);
Rollback unregisters the staged packs on apply failure.

Boot registration now uses RegisterPack with module/version from lock load
paths, so boot and live governance installs share one pack-registration API.

Fixes live hub-install/update/uninstall of modules that ship an embedded
filesystem, which previously failed with 'filesystem not found' because the
pack reader was never registered outside the boot path.
@wolfy-j wolfy-j force-pushed the feat/fs-embed-live-install branch from 2d510e4 to ab51a34 Compare June 16, 2026 22:10
@wolfy-j wolfy-j merged commit 17b48a9 into main Jun 16, 2026
4 checks passed
@wolfy-j wolfy-j deleted the feat/fs-embed-live-install branch June 16, 2026 22:20
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