feat(runtime): add resolver-bound interface facades - #12
Closed
Upd4ting wants to merge 9 commits into
Closed
Conversation
Member
Author
|
@greptile review |
Member
Author
|
@greptile review |
Co-authored-by: Upd4ting <upd4ting@gmail.com>
Co-authored-by: Upd4ting <upd4ting@gmail.com>
Route interface calls and registrations through resolver-selected providers without wrapping stored callbacks. Preserve provider ownership and invalidate only the destroyed module generation. Co-authored-by: Upd4ting <upd4ting@gmail.com>
Co-authored-by: Upd4ting <upd4ting@gmail.com>
Co-authored-by: Upd4ting <upd4ting@gmail.com>
Member
Author
|
Closed at Upd4ting's request: the Core 1.5 / multi-provider train is deferred and will be restarted manually later. This PR contains only work for that train; no independent fix is being retained. Do not merge or publish artifacts from this branch. Any future implementation should start from the then-current main branches and released package graph. |
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
InterfaceFunction, proxy, and nested namespace declarations to the provider selected for one consumer generationBuildInterfaceFacadefor the limited case where a derived helper or cold decorator closes over a declarationRunWithModuleContextprovider-selection API; provider selection now belongs exclusively to the resolver/facade pathApplication contract
Application imports and call syntax do not change. Core supplies the correct facade before evaluating each module, using that module's provider selection and
importOverrides.Direct
InterfaceFunctionexports need no interface-specific integration.BuildInterfaceFacadeis only needed for derived APIs such as Auth helpers or cold decorators such as API route registration. It is never a request wrapper.Runtime boundary
ModuleContextInvalidatedErrorBindToCurrentModuleContextand publicRunWithModuleContextare removedGetModuleContextremains an ownership diagnostic, not a provider selectorRunWithResponsibleModuleremains for its existing stack-attribution compatibility; Core does not install it around lifecycle, HTTP, or business callbacksCompatibility note
@antelopejs/interface-core0.0.11 already exportsRunWithModuleContextfrom/modules. Removing it is therefore a source-level breaking change for custom infrastructure that imports that function directly. Ordinary application modules, providers usingImplementInterface, and direct interface consumers do not use it and keep identical syntax. The release version/range strategy must be decided before publishing this PR.Causal validation
AmbiguousProviderErrorwith two providersPackage validation
pnpm lint/facadesexports and the absence of publicRunWithModuleContextgit diff --checkCross-repository validation
The candidate Core/API/Auth/Database/CMS/CMS-SaaS/Mongo stack completed two construct/start/stop/destroy cycles after the public API removal: 396 fresh routes per cycle, HTTP GET 200 and PUT 401, exact replay/unregister cleanup, zero reporter/unhandled errors, immediate SIGTERM, and exit 0.
Qualifying log SHA-256:
5c82c4cb34f57208b4e8eafa0a63c8e1b498687763a7aed31d7cc95f23b8666b.Performance
The rejected callback-wrapper design measured roughly 8% to 14% slower because it restored context in the request path.
The full-resolver A/B gate used Node 24.19.0, 1,000 routes, 100 connections, 5-second warmups, 30-second samples, and 10 alternating repetitions:
The paired median is noise, with no stable measurable regression. Result JSON SHA-256:
6fe775e130b2b4739d5e5f28527bb37e474874005d970eed8903158122b12dfd. The public export removal does not touchproxies.ts,facades.ts, Core resolution, or any request-path source, so this benchmark remains the relevant hot-path gate.Release ordering
This remains the first release gate, but do not publish it until the compatibility/version decision above is explicit. Downstream dependency ranges must target the chosen interface-core release before Core and composed interfaces are published.