Commit 582db16
feat(adr-0006)!: Phase 5 — env resolution converges into the KernelResolver 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>1 parent d4fdae3 commit 582db16
7 files changed
Lines changed: 144 additions & 382 deletions
File tree
- content/docs/references/ui
- packages
- adapters/hono/src
- runtime/src
- cloud
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
108 | 108 | | |
109 | 109 | | |
110 | 110 | | |
| 111 | + | |
111 | 112 | | |
112 | 113 | | |
113 | 114 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
64 | | - | |
65 | | - | |
66 | | - | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
67 | 66 | | |
68 | 67 | | |
69 | 68 | | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | | - | |
| 69 | + | |
| 70 | + | |
74 | 71 | | |
75 | 72 | | |
76 | 73 | | |
| |||
114 | 111 | | |
115 | 112 | | |
116 | 113 | | |
117 | | - | |
118 | | - | |
119 | | - | |
120 | | - | |
121 | | - | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
122 | 119 | | |
123 | 120 | | |
124 | 121 | | |
| |||
This file was deleted.
Lines changed: 44 additions & 31 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
10 | | - | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
11 | 13 | | |
12 | 14 | | |
13 | 15 | | |
14 | 16 | | |
15 | | - | |
| 17 | + | |
16 | 18 | | |
17 | 19 | | |
18 | 20 | | |
| |||
32 | 34 | | |
33 | 35 | | |
34 | 36 | | |
35 | | - | |
| 37 | + | |
36 | 38 | | |
37 | 39 | | |
38 | 40 | | |
39 | | - | |
40 | | - | |
41 | | - | |
42 | | - | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
43 | 46 | | |
44 | | - | |
45 | | - | |
| 47 | + | |
46 | 48 | | |
47 | 49 | | |
48 | 50 | | |
49 | | - | |
| 51 | + | |
| 52 | + | |
50 | 53 | | |
51 | | - | |
52 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
53 | 61 | | |
54 | | - | |
55 | | - | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
56 | 76 | | |
57 | 77 | | |
58 | 78 | | |
| |||
64 | 84 | | |
65 | 85 | | |
66 | 86 | | |
67 | | - | |
68 | 87 | | |
69 | 88 | | |
70 | 89 | | |
71 | 90 | | |
72 | 91 | | |
73 | | - | |
| 92 | + | |
74 | 93 | | |
75 | | - | |
76 | | - | |
77 | | - | |
78 | 94 | | |
79 | | - | |
80 | 95 | | |
81 | 96 | | |
82 | 97 | | |
83 | | - | |
84 | | - | |
85 | | - | |
86 | | - | |
87 | | - | |
88 | | - | |
89 | | - | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
90 | 103 | | |
91 | 104 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1651 | 1651 | | |
1652 | 1652 | | |
1653 | 1653 | | |
1654 | | - | |
1655 | | - | |
1656 | | - | |
1657 | | - | |
1658 | | - | |
1659 | | - | |
| 1654 | + | |
| 1655 | + | |
| 1656 | + | |
| 1657 | + | |
1660 | 1658 | | |
1661 | | - | |
1662 | | - | |
1663 | | - | |
1664 | | - | |
1665 | | - | |
1666 | | - | |
1667 | | - | |
1668 | | - | |
1669 | | - | |
1670 | | - | |
1671 | | - | |
1672 | | - | |
1673 | | - | |
1674 | | - | |
1675 | | - | |
1676 | | - | |
1677 | | - | |
1678 | | - | |
1679 | | - | |
1680 | | - | |
1681 | | - | |
1682 | | - | |
1683 | | - | |
1684 | | - | |
1685 | | - | |
1686 | | - | |
1687 | | - | |
1688 | | - | |
1689 | | - | |
1690 | | - | |
1691 | | - | |
1692 | | - | |
1693 | | - | |
1694 | | - | |
1695 | | - | |
1696 | | - | |
1697 | | - | |
1698 | | - | |
1699 | | - | |
1700 | | - | |
1701 | | - | |
1702 | | - | |
1703 | | - | |
1704 | | - | |
1705 | | - | |
1706 | | - | |
1707 | | - | |
1708 | | - | |
1709 | | - | |
1710 | | - | |
1711 | | - | |
1712 | | - | |
1713 | | - | |
1714 | | - | |
1715 | | - | |
1716 | | - | |
1717 | | - | |
1718 | | - | |
1719 | 1659 | | |
1720 | 1660 | | |
1721 | 1661 | | |
| |||
0 commit comments