docs(plugins): packages.mdx 的 multi-org 开关改为 OS_TENANCY_POSTURE,legacy 布尔降为兼容 input (#5887) - #5974
Merged
Merged
Conversation
…_ENABLED (#5887) The `@objectstack/organizations` bullet was the last place in content/docs teaching the legacy boolean as the enable switch. Under `resolveTenancyPosture()` it is only a fallback INPUT, read when `OS_TENANCY_POSTURE` is unset, and it can only derive `isolated` — the `group` posture (`organization_id IN accessible_org_ids`, ADR-0105 D2) is unreachable from any spelling of it, so a reader following this page could reach only one of the two walled postures. packages/types/src/env.ts:89-122 additionally calls gating application code on that boolean a bug (cloud#1020, #5233). Switch the bullet to `OS_TENANCY_POSTURE=group|isolated`, keep the accurate `OS_ALLOW_DEGRADED_TENANCY=1` escape hatch, mention the legacy boolean only as a compat input, and link the authoritative page rather than repeat its resolution table. The Features bullet's "rows never leak across organizations" was isolated-only wording; restated in terms of the caller's organization scope so it holds under `group` too. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BDmDsu2575gDxeMCxXhDE3
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
hotlong
marked this pull request as ready for review
August 6, 2026 13:48
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.
Fixes #5887
content/docs/plugins/packages.mdx:335(@objectstack/organizations (enterprise)小节)是全仓content/docs里最后一处把 legacyOS_MULTI_ORG_ENABLED=true当作启用 multi-org 的开关教给读者的地方。文件面只有这一页(docs-only,不产出 changeset,PR 带skip-changeset)。前提复核(
origin/main@628b028,改动前)git show origin/main:content/docs/plugins/packages.mdx→ 335 行逐字为「Enable by settingOS_MULTI_ORG_ENABLED=trueand installing@objectstack/organizations」content/docs内仅此一处当启用开关git grep -c OS_MULTI_ORG_ENABLED origin/main -- content/docs= 15 行(drivers 1 / environment-variables 3 / tenancy-modes 10 / packages 1);除本行外的 14 行全部写作「superseded」「back-compat input」「不要 gate」packages/types/src/env.ts:89-122逐字标注 DEMOTED(ADR-0105 D1),并点名 cloud#1020(EE licence gate)与 #5233(organization/create在纯 posture 部署上 403)两个已发生缺陷groupposture 够不到resolveTenancyPosture():posture 未设置时该布尔只派生isolated;三值枚举在packages/spec/src/security/tenancy-posture.ts:40,group没有任何布尔拼法可达前提全部成立,按 issue 正文的改法实施。
改法(一页之内,2 行)
When to use(第 335 行):开关换成OS_TENANCY_POSTURE,两个 walled posture 各带一句极短的谓词说明(group= 跨调用者所属组织的 union 读;isolated= 每组织硬墙),legacy 布尔降为一句「仅在 posture 未设置时作为回落 input 读取、且只能选中isolated」并附上「never gate application code on it(ADR-0105 D1)」,末尾链到/docs/deployment/tenancy-modes。⛔ 不在本页重复 posture 解析表——解析规则、成员策略、degraded 引导都在那一页,本页只留一个入口链接(与 #5746 的落地样例 PR #5884 同处理)。
OS_ALLOW_DEGRADED_TENANCY=1那半句按 issue 说明保留,仅把触发条件由「flag 被设置」改写为「请求了 walled posture」,以覆盖group。Features(第 334 行,同小节相邻行,说明如下):原句「every query is AND-composed against the tenant wall so rows never leak across organizations」是isolated专属措辞——group的墙是organization_id IN accessible_org_ids,跨组织读是它的设计语义。上一行刚把group引入本页,这一行若不动就会在同一小节内自相矛盾,故一并改成「no row outside the caller's organization scope is ever returned」——对两个 walled posture 都成立。这是本次改动的直接后果,不是顺带扩面;文件面仍只有这一页。自验
docs-only 改动,未触碰任何 package 源码,故无「受影响包」的
pnpm test/typecheck可跑(如实报告,不凑证据)。实际跑的是覆盖本文件的门禁:四项全绿(退出码均 0,均先跑各自
--self-test)。check:role-word值得单独一提:本页在scripts/role-word-baseline.json里的基线是 1(第 326 行 plugin-security 的 "Role-based"),改动未增减该计数。另外:
check-nul-bytes扫描面):grep -naP '[\x00-\x08\x0b\x0c\x0e-\x1f\x7f]' content/docs/plugins/packages.mdx无命中。{/},也没有「小于号紧跟字母」的写法,不会被当成 JSX;链接写法[Tenancy Postures & Membership](/docs/deployment/tenancy-modes)与content/docs/protocol/objectql/schema.mdx:758已在main上的写法逐字一致(含文本里的裸&),路径与content/docs/deployment/tenancy-modes.mdx对应。build-docsjob 覆盖:.github/workflows/ci.yml的docs路径过滤器含content/**,本 PR 命中,会真正跑pnpm --filter @objectstack/docs build。(本地未跑:该 job 需要整仓pnpm install+ Next 构建,对一处两行的文案改动不成比例;容器为并行 agent 共用。)范围外发现
无。本次只读了
content/docs的租户相关页与packages/types/src/env.ts、packages/spec/src/security/tenancy-posture.ts,未发现新的不一致——drivers.mdx:315、environment-variables.mdx:87-88、tenancy-modes.mdx三处对 legacy 布尔的描述逐条核对后均与代码相符,无需登记。Generated by Claude Code