Commit dda8af0
committed
fix(tenancy): eight sites read the demoted OS_MULTI_ORG_ENABLED as "is this multi-org?" (#5262)
ADR-0105 D1 made OS_TENANCY_POSTURE the authoritative knob and demoted
OS_MULTI_ORG_ENABLED to a back-compat *input* of resolveTenancyPosture().
A deployment configured the documented way — OS_TENANCY_POSTURE=isolated
(or group), legacy boolean unset — therefore reads false from
resolveMultiOrgEnabled() while running a fully mounted organization wall.
#5233 fixed two sites in plugin-auth; a census found eight more, all
written before that function's doc comment was corrected. Third recurrence
of the shape (cloud#1020, #5233).
Each site was judged separately for WHICH posture answers its question —
what the operator REQUESTED, or what the `tenancy` service reports is
actually IN FORCE — rather than converted mechanically:
REQUESTED posture (postureEnforcesWall(resolveTenancyPosture())):
- objectql SchemaRegistry — constructed below the kernel, no service
registry to ask. The organization_id column was always provisioned;
what diverged is its INDEX, so a posture-only deployment ran the
Layer 0 wall's hottest predicate unindexed while SecurityPlugin
compiled that same wall.
- plugin-dev — this branch is what MOUNTS the wall, so asking whether
the wall is up would be circular. Mirrors serve.ts. Its diagnostic
now names the requested posture instead of asserting
OS_MULTI_ORG_ENABLED=true at an operator who never set it.
- driver-sql isMultiTenantMode() — a driver has no kernel to ask, and a
suppressed warning is the costlier error for a diagnostic. Also drops
the _multiTenantMode memo, which froze a process-level fact into a
per-instance verdict on whichever write landed first; the read is now
live, affordable because auditMissingTenant consults it only after
the tenantId early-out.
- cli `os verify` — resolves a flag before any kernel exists. This site
produced a GREEN verification run over an unverified property.
EFFECTIVE posture (the `tenancy` service, falling back to requested):
- runtime AppPlugin, both seeder sites — they ask "will the per-org
replay run instead of me?", and on an ADR-0093 D5 degraded boot that
replay does not exist, so keying on the request would defer to a
replay that can never happen.
- cloud-connection marketplace local install, both sites — same
reasoning; the install path is a write path that landed sample rows
with no organization_id, outside the wall its own reads apply.
Single-org behaviour is unchanged at every site; only the knob each one
reads is corrected. resolveTenancyPosture()'s own fallback chain is
untouched — it remains the sole legitimate consumer of the legacy boolean,
and is now the only caller left in the repo.
Every new test was run against the unfixed source and confirmed red; the
runtime suite additionally pins that a REQUESTED-posture fix fails exactly
the three degraded assertions, which is what makes the per-site judgment
falsifiable rather than asserted.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_015W6nhsDrz6zWQc8je12a1t1 parent 88b9b2d commit dda8af0
14 files changed
Lines changed: 1395 additions & 33 deletions
File tree
- .changeset
- packages
- cli/src/commands
- cloud-connection/src
- objectql/src
- plugins
- driver-sql/src
- plugin-dev/src
- runtime/src
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
14 | 15 | | |
15 | 16 | | |
16 | 17 | | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
17 | 49 | | |
18 | 50 | | |
19 | 51 | | |
| |||
42 | 74 | | |
43 | 75 | | |
44 | 76 | | |
45 | | - | |
| 77 | + | |
46 | 78 | | |
47 | 79 | | |
48 | 80 | | |
| |||
53 | 85 | | |
54 | 86 | | |
55 | 87 | | |
56 | | - | |
| 88 | + | |
57 | 89 | | |
58 | 90 | | |
59 | 91 | | |
| |||
Lines changed: 41 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
46 | 47 | | |
47 | 48 | | |
48 | 49 | | |
| |||
57 | 58 | | |
58 | 59 | | |
59 | 60 | | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
60 | 92 | | |
61 | 93 | | |
62 | 94 | | |
| |||
233 | 265 | | |
234 | 266 | | |
235 | 267 | | |
236 | | - | |
237 | | - | |
| 268 | + | |
| 269 | + | |
238 | 270 | | |
239 | 271 | | |
240 | 272 | | |
| |||
981 | 1013 | | |
982 | 1014 | | |
983 | 1015 | | |
984 | | - | |
| 1016 | + | |
| 1017 | + | |
| 1018 | + | |
| 1019 | + | |
| 1020 | + | |
| 1021 | + | |
985 | 1022 | | |
986 | 1023 | | |
987 | 1024 | | |
| |||
0 commit comments