Skip to content

tenancy-service.tsdegraded 注释仍说「只有 isolated 会降级」—— 与同文件 120 行后的实现和 ADR-0105 D12 修正相反 #5360

Description

@os-zhuang

发现于 #5269content/docs/deployment/tenancy-modes.mdx 文档核证)过程中;纯注释问题,无运行时影响,故打 finding 不入队,按 PM 分诊处理。

事实

packages/plugins/plugin-auth/src/tenancy-service.ts:68-77TenancyService.degraded 的文档注释结尾:

Only reachable for isolatedgroup is enforced by the open engine, so it has no missing dependency to degrade against.

同一个文件 120 行之后的实现说的是相反的话:

  • tenancy-service.ts:196-207 isolationActive()if (requestedPosture === 'single') return false; 之后两种有墙 posture 一视同仁deps.probeIsolation(),注释里明写「BOTH walled postures probe」;
  • tenancy-service.ts:224-226 degraded = postureEnforcesWall(requestedPosture) && !isolationActive() —— group 请求 + 无 org-scopingdegraded === true

外部证据同向:

  • .changeset/adr-0105-group-posture-entitlement.md(ADR-0105 D12 修正):「tenancy-service: group probes org-scoping exactly like isolated. Without it the posture resolves to single and reports degraded.」
  • packages/cli/src/commands/serve.ts:1772-1774 的 D5 启动闸门按 tenancyPosture !== 'single' 判定,group 同样会走 FATAL / OS_ALLOW_DEGRADED_TENANCY 分支。

判断

这句注释是 D12 修正前那一版的残留(当时 group 确实自激活)。它没有改变任何行为,但它就长在读者判断「我这个 group 部署会不会降级」时最先看到的地方,且与本文件自己的实现矛盾——AGENTS.md Prime Directive #13 的那类「代码里找不到治理它的决定」的反面:这里找得到,但写反了。

修法

删掉那两句,或改写为:两种有墙 posture 都会在企业版 runtime 缺席时降级(ADR-0105 D12)。落点单文件 packages/plugins/plugin-auth/src/tenancy-service.ts

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions