feat(adr-0006): Phase 2 — generic resolveKernel seam on HttpDispatcher#1718
Merged
Conversation
ADR-0006 Phase 2 (引入通用接缝). Adds an optional, host-injected `KernelResolver` to the framework dispatcher so per-request kernel selection can move out of the framework and into the cloud distribution (Phase 5). Additive + behavior-equivalent: - `HttpDispatcherOptions.kernelResolver?: KernelResolver` (also picked up from the `kernel-resolver` service, mirroring `kernel-manager`). - In `dispatch()` it TAKES PRECEDENCE over `kernelManager` for primary routing, but the two COEXIST — `kernelManager` still serves the action-route service path until Phase 5 retires in-dispatcher resolution. - Returning `undefined` routes to the single `defaultKernel` (single-environment / control-plane / unscoped requests). - `KernelResolver` exported as a RETAINED generic contract (ADR D3) — the framework ships no multi-tenant implementation. Back-compat both ways: a host that injects neither is unchanged; a host on an older framework that registers a `kernel-resolver` service is ignored. New focused test (http-dispatcher.kernel-resolver.test.ts): precedence over kernelManager, undefined→defaultKernel fallback, legacy back-compat. Runtime build (incl. DTS) + tests 384 (was 381) green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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.
ADR-0006 Phase 2 — 引入通用接缝 (additive, behavior-equivalent)
Adds an optional, host-injected
KernelResolverseam to the frameworkHttpDispatcherso per-request kernel selection can move out of the open-source framework into the cloud distribution (the eventual Phase 5). Pure addition — coexists with the existingkernelManagerpath.What changes
HttpDispatcherOptions.kernelResolver?: KernelResolver— also auto-picked from thekernel-resolverservice, mirroring howkernelManagerresolves fromkernel-manager.dispatch()the resolver takes precedence overkernelManagerfor primary routing; the two coexist —kernelManagerstill serves the action-route service-resolution path until Phase 5 retires the in-dispatcher resolution.undefinedroutes to the singledefaultKernel(single-environment / control-plane / unscoped requests).KernelResolveris exported as a retained generic contract (ADR D3) — the framework ships no multi-tenant implementation; all hostname→env strategy + the per-env kernel cache live in cloud@objectstack/objectos-runtime.Behavior-equivalence & back-compat (both directions)
kernelManager→ unchanged legacy path.kernelResolver(cloud) → delegates to the sameKernelManager, so routing is identical.kernel-resolverservice simply ignores it → the cloud Phase 2 PR is safe to merge in any order relative to this one.Tests
New focused
http-dispatcher.kernel-resolver.test.ts: resolver precedence overkernelManager,undefined→defaultKernelfallback, and legacy back-compat.pnpm --filter @objectstack/runtime build(incl. DTS) succeeds; runtime tests 384 passed (was 381).🤖 Generated with Claude Code