Skip to content

feat(adr-0006)!: Phase 5 — env resolution converges into the KernelResolver seam - #1724

Merged
os-zhuang merged 1 commit into
mainfrom
adr-0006-phase5-resolver-convergence
Jun 11, 2026
Merged

os-zhuang merged 1 commit into
mainfrom
adr-0006-phase5-resolver-convergence

Conversation

@os-zhuang

Copy link
Copy Markdown
Contributor

ADR-0006 Phase 5 — 解析策略全归 cloud (final phase; breaking)

The dispatcher's entire multi-tenant environment resolution (URL → hostname → x-environment-id → session activeEnv → org default-env → single-env default, all registry-driven) moves to the cloud distribution's resolver behind the KernelResolver seam from Phase 2 (#1718). The framework dispatcher keeps only its own URL-parsing conventions, contributed as hints (context.routePath, unvalidated context.urlEnvironmentId), and serves defaultKernel when no resolver is registered.

Removed (breaking)

  • HttpDispatcherOptions.kernelManager + the dispatcher's env-registry wiring (positional ctor param kept-but-ignored so 3-arg callers compile)
  • EnvironmentDriverRegistry / KernelManager type exports + runtime/src/cloud/environment-registry.ts → the cloud/ directory is gone from the framework runtime
  • createHonoApp envRegistry/kernelManager passthroughs (options deprecated-ignored)

Contract (documented on KernelResolver)

Resolver owns env resolution + kernel selection; SETS context.environmentId/dataDriver; downstream stages (membership enforcement, scope TTL touch, scoped services, the data-plane 428 guard) key off them unchanged. The 428 guard's multi-tenant signal is now "a kernel-resolver is registered" (was: env-registry service).

Tests moved with the behavior

The resolveEnvironmentContext suite is ported to cloud kernel-resolver.test.ts (URL-param precedence, /cloud skip, header fallthrough + new hostname/platform/default-project/unresolved cases).

Validation

Full-repo build sweep clean · runtime 368 + cli 240 + rest 100 + hono 67 green · cloud against this checkout: boot-smoke ALL GREEN, objectos-runtime 85, typecheck clean ×4, live file-mode HTTP identical (hostname→env now through the cloud resolver).

Pairs with the cloud PR (resolver impl + .framework-sha bump) — landing immediately after.

🤖 Generated with Claude Code

…solver seam

BREAKING CHANGE (ADR-0006 Phase 5, final phase): the framework dispatcher
no longer performs ANY multi-tenant environment resolution. The ~150-line
`resolveEnvironmentContext` (URL → hostname → x-environment-id → session
activeEnv → org default-env → single-env default, all via an environment
registry) moved to the cloud distribution's resolver
(@objectstack/objectos-runtime kernel-resolver.ts), behind the generic
`KernelResolver` seam introduced in Phase 2.

Dispatcher now:
- contributes parsing hints only: `context.routePath` + unvalidated
  `context.urlEnvironmentId` (URL conventions stay framework-owned);
- delegates env resolution + kernel selection to the host resolver, which
  SETS context.environmentId/dataDriver (membership enforcement, scope TTL
  touch and scoped service resolution key off them, unchanged);
- serves single-environment hosts from defaultKernel with no env context.

Removed from the public API:
- HttpDispatcherOptions.kernelManager (+ the 'kernel-manager' service
  pickup for routing; the SERVICE remains a cloud-side concern),
- the dispatcher's envRegistry constructor wiring (positional param kept,
  ignored, so 3-arg callers compile),
- `EnvironmentDriverRegistry` / `KernelManager` type exports +
  runtime/src/cloud/environment-registry.ts (the last file of the cloud/
  dir — directory gone; cloud owns its own copies),
- @objectstack/hono createHonoApp envRegistry/kernelManager passthroughs
  (options kept as deprecated-ignored for source compat).

handleData's 428 "environment not resolved" guard now keys off a
registered kernel-resolver (was: env-registry service) — same multi-tenant
signal, same behavior.

The dispatcher's resolution test suite moved with the behavior — ported to
cloud packages/objectos-runtime/src/kernel-resolver.test.ts (incl. the
URL-param precedence / /cloud-skip / header-fallthrough cases).

Validation: full-repo build sweep clean; runtime 368 + cli 240 + rest 100
+ hono 67 tests green; cloud repo against this checkout: boot-smoke ALL
GREEN, objectos-runtime 85 tests, typecheck clean (objectos / ee / cloud),
live file-mode HTTP behavior identical (data 401 via requireAuth after
hostname resolution through the cloud resolver).

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 11:28am

Request Review

@os-zhuang
os-zhuang merged commit 4f30988 into main Jun 11, 2026
1 of 2 checks passed
@os-zhuang
os-zhuang deleted the adr-0006-phase5-resolver-convergence branch June 11, 2026 11:26
@github-actions github-actions Bot added documentation Improvements or additions to documentation tests size/l labels Jun 11, 2026

This branch was successfully deployed

1 active deployment
Preview — 582db166 Deployed Jun 11, 2026 by vercel[bot]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant