feat(spec): ADR-0087 台账登记 ctx.user.roles 的立即退役 (#6011) - #6138
Merged
Conversation
Part of #6011 —— 运行时半边已随 PR #6048 落地,本条补上 ADR-0087 语义迁移台账里缺失的 ctx.user 面,与 session 侧三条同族条目对称。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wbxm29qPKnLf44AbSxizqW
spec-changes.json / docs/protocol-upgrade-guide.md 由 check:generated --fix 整体重生 (仅重生被判过期的 2 个),未手改。 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Wbxm29qPKnLf44AbSxizqW
|
The latest updates on your projects. Learn more about Vercel for GitHub. 1 Skipped Deployment
|
Contributor
📓 Docs Drift CheckThis PR changes 1 package(s): 112 hand-written doc(s) reference the affected code and may need an implementation-accuracy re-verification:
|
qq9340100
marked this pull request as ready for review
August 7, 2026 03:33
This was referenced Aug 7, 2026
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.
Part of #6011
#6011 的台账半边(运行时半边已随 PR #6048 合并落地;该 issue 已关闭,本 PR 不重开它)。按 issue 上分诊座位 15:10Z 评论的**走法 1「不拆,registry 条目按跨域例外路径处理」**执行,认领已在 02:55Z 评论申报。RELEASE-BLOCKING for v17.0.0-rc.4。
为什么要有这一条
PR #6048 删掉了
ActorUser上的roles别名(action body 的ctx.user/ AI 路由的req.user),positions成为唯一拼法。但 ADR-0087 语义迁移台账里这一面没有任何条目 —— 而同一次 ADR-0090 改名的另外三张面全都在册:data.hookContext.session.roleshook-context-session-roles-retiredui.actionSession.rolesaction-session-roles-to-positionsCEL/formula: current_user.rolescel-current-user-roles-to-positionsctx.user.roles/req.user.roles这种不对称正是 #6011 立单的原因:退役已经发生,但对
objectstack migrate meta/spec-changes.json/ 升级指南的读者不可见。本 PR 只登记既成事实(FROM→TO 已由 #6048 固定),不重判退役范围、不复核消费方。条目
actor-user-roles-to-positions,置于packages/spec/src/migrations/registry.ts的 step17semantic列表中、紧邻其同族兄弟action-session-roles-to-positions。action body / AI route: ctx.user.roles (req.user.roles)ctx.user.positions(AI 路由读req.user.positions)—— 同一个数组,值逐字不变ctx.user面至今没有 spec schema,只有packages/runtime里的 TS interface —— 所以 surface 刻意不带data./ui.这类 spec 域前缀,否则会谎称存在一个 spec 声明。写法照抄台账里已有的非 schema 面先例CEL/formula: current_user.roles的「渠道: 标识符」形状。处置口径则沿用
data-driver-find-stream-retired(#4484)/storage-service-list-retired(#5540)那一族:TS 契约面,无存量源可改写,刻意不设 tombstone(从没有任何ActorUser走过.parse(),写在那里的处方无人可达),强制渠道是 tsc,报在读取点。条目正文如实标注本面比那两条还外一层 —— 它们至少声明在packages/spec/src/contracts,本面只在packages/runtime;因此对未加类型的 / 沙箱 body 而言根本没有强制渠道,这正是本台账条目必须存在的理由。ctx.session的边界(条目里双处写明)同一个
ctx上两张面、两套时间表,条目开头即警告不要互读:ctx.user.roles在 17 里已经不存在(无窗口、无双发);ctx.session.roles保留 #5613 的一个弃用窗口,期间照常双发。生成物
按 os-regen 纪律整体重生,零手改:
pnpm --filter @objectstack/spec build后check:generated判定恰好 2 个过期,--fix只重生这 2 个。新条目已出现在重生后的升级指南(
docs/protocol-upgrade-guide.md:347,Protocol 16 → 17 的 Semantic 段):spec-changes.json里出现两处(单 major 清单 + 跨 major 合成视图),是同一数据的两个投影。测试证据
反向验证(方向事前判定为「红」,结果一致)
把 registry 条目撤掉、生成物保持重生后的样子:
恢复条目后两条立刻回绿。
但要如实说明这道门禁到底钉住了什么:它钉的是台账 ↔ 生成物同步,不是「已发生的退役必须有台账条目」。本 PR 之前的
origin/main上,registry 与生成物是互相一致的(都没有这一条),所有门禁全绿 —— 这正是为什么这条缺失只能靠人工/分诊立单发现,而 CI 抓不到。仓库里不存在「退役 ↔ 台账」完备性门禁,本 PR 也不新造一个(那是另一个设计决定,不在本单范围)。⛔ 范围外(已刻意不动)
packages/runtime零字节 —— 已随 PR feat(runtime)!: 退役 ctx.user 的 roles 别名,positions 成为唯一拼法 (#6011) #6048 落地。content/docs/releases/未触碰;台账锚点文件authorable-surface.base.json未手改。rationale有专门的钉子测试(protocol-17 的 migration rationale 仍写着「the server does not walkareas」,并投影进生成的升级指南 #5337),且最近的同族兄弟action-session-roles-to-positions也是只加 semantic 条目、不动 rationale,本 PR 照此惯例。🤖 Generated with Claude Code
https://claude.ai/code/session_01Wbxm29qPKnLf44AbSxizqW
Generated by Claude Code