Skip to content

refactor(runtime): generic frame-context resolver registry#420

Merged
wolfy-j merged 5 commits into
mainfrom
feat/wasm-fs-prefix-option
Jul 4, 2026
Merged

refactor(runtime): generic frame-context resolver registry#420
wolfy-j merged 5 commits into
mainfrom
feat/wasm-fs-prefix-option

Conversation

@wolfy-j

@wolfy-j wolfy-j commented Jul 4, 2026

Copy link
Copy Markdown
Contributor

Moves frame-context option application behind a generic resolver registry applied at the two dispatch choke points: function executor and process Start. Network is migrated onto the registry, dispatchers no longer import api/net, missing selected resolvers fail closed, and ApplyOverlayPair remains as a deprecated compatibility wrapper. This replaces the earlier fs_prefix contents; fs_root should be layered on top of this resolver mechanism in a follow-up.

wolfy-j added 5 commits July 4, 2026 13:50
Frame-decorating options (the network overlay, and future ones like a
filesystem root) were hand-wired into every dispatcher: the process manager
and both the wasm and lua function lifecycles each called
netapi.ApplyOverlayPair, leaking api/net into generic machinery and forcing
every new option to touch every dispatcher.

Introduce ctxapi.FrameResolvers: an ordered registry of
(ctx, options) -> ([]Pair, error) resolvers, carried on the AppContext and
populated once at boot. The two real choke points — the function registry
executor (shared by lua and wasm) and the process manager Start — apply the
whole set generically. Reads are lock-free (atomic snapshot, copy-on-write on
register), mirroring the interceptor registry; the no-resolver path is ~1.4ns
with zero allocations.

Network migrates onto it: api/net.OverlayResolver replaces ApplyOverlayPair
and is registered by the network boot component. The dispatchers no longer
import api/net or api/fs; a new frame-context option is one resolver plus one
Register line, with no dispatcher edits.
- Keep api/net.ApplyOverlayPair as a deprecated thin wrapper over
  OverlayResolver so out-of-tree Go callers do not break (codex).
- Network boot component fails loud (ErrFrameResolversMissing) instead of
  silently skipping registration when the registry is absent, so a wiring
  bug cannot degrade the overlay to clearnet (fable #1).
- Remove the now-redundant SetMultiple(task.Context) from the wasm and lua
  Execute handlers: the function registry executor already applies task.Context
  to the same forked frame and is the sole caller (fable #3).
- Drop the speculative FrameResolverOrderFSRoot constant and fs-root comment
  references; this PR migrates only the network overlay (fable #4).
- Fix stale comments and the test section header (fable #5).
@wolfy-j wolfy-j force-pushed the feat/wasm-fs-prefix-option branch from 1ee38c5 to 780ebec Compare July 4, 2026 18:47
@wolfy-j wolfy-j changed the title feat(wasm): options.fs_prefix to root function mounts into a subtree refactor(runtime): generic frame-context resolver registry Jul 4, 2026
@wolfy-j wolfy-j merged commit 154b3be into main Jul 4, 2026
8 checks passed
@wolfy-j wolfy-j deleted the feat/wasm-fs-prefix-option branch July 4, 2026 19:14
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.

2 participants