Skip to content

feat(adr-0006): Phase 2 — generic resolveKernel seam on HttpDispatcher#1718

Merged
os-zhuang merged 1 commit into
mainfrom
adr-0006-phase2-resolvekernel-seam
Jun 11, 2026
Merged

feat(adr-0006): Phase 2 — generic resolveKernel seam on HttpDispatcher#1718
os-zhuang merged 1 commit into
mainfrom
adr-0006-phase2-resolvekernel-seam

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

ADR-0006 Phase 2 — 引入通用接缝 (additive, behavior-equivalent)

Adds an optional, host-injected KernelResolver seam to the framework HttpDispatcher so 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 existing kernelManager path.

What changes

  • HttpDispatcherOptions.kernelResolver?: KernelResolver — also auto-picked from the kernel-resolver service, mirroring how kernelManager resolves from kernel-manager.
  • In dispatch() the resolver takes precedence over kernelManager for primary routing; the two coexistkernelManager still serves the action-route service-resolution path until Phase 5 retires the in-dispatcher resolution.
  • Returning undefined routes to the single defaultKernel (single-environment / control-plane / unscoped requests).
  • KernelResolver is 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)

  • Host injects neither → unchanged (single-env / legacy).
  • Host injects only kernelManager → unchanged legacy path.
  • Host injects kernelResolver (cloud) → delegates to the same KernelManager, so routing is identical.
  • An older framework that receives a kernel-resolver service 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 over kernelManager, undefineddefaultKernel fallback, and legacy back-compat. pnpm --filter @objectstack/runtime build (incl. DTS) succeeds; runtime tests 384 passed (was 381).

Part of the ADR-0006 series: Phase 1 = #1717 (deprecate framework cloud dupes). The cloud-side adoption (register kernel-resolver) is a separate cloud-repo PR. Phase 3/4 (startup-path / CLI decouple) are gated on human sign-off.

🤖 Generated with Claude Code

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>
@vercel

vercel Bot commented Jun 11, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
spec Ready Ready Preview, Comment Jun 11, 2026 9:36am

Request Review

@os-zhuang
os-zhuang merged commit c029f0c into main Jun 11, 2026
12 checks passed
@os-zhuang
os-zhuang deleted the adr-0006-phase2-resolvekernel-seam branch June 11, 2026 09:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant