Uh oh!
There was an error while loading. Please reload this page.
feat(studio): 包 Access 门改走草稿/发布(ADR-0086 P2 · D6/D7) - #2225
Merged
Conversation
…086 P2 · D6/D7)
The package Access pillar edited permission sets live (wrote the active record
directly), unlike Data/Interfaces which draft→publish with the package — a D6
violation. Now the package door writes drafts:
- PermissionMatrixEditPage.doSave (package scope) + AccessPillar's new-set
creator save with { mode:'draft', packageId }; the top-bar Publish promotes
them (framework materializes into sys_permission_set, ADR-0086 P2 块1). The
env-admin door (no packageId) stays live (config), per D7.
- Draft-aware reads: editor loads the pending draft over the published
baseline; the rail merges published ∪ draft sets so a draft-only/edited set
stays visible pre-publish. Save bumps the pending-changes counter; publish
reloads the published baseline (onDraftSaved / publishNonce threaded from the
surface into AccessPillar + the editor).
- Banner corrected: no longer claims "saved = live" — states edits save as
package drafts and go live on Publish.
Test: scope test now asserts the package-door save carries { mode:'draft',
packageId } and preserves other packages' slices.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014y5kiH3aPLWtRRRGcVrXcTThe latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
os-zhuang
marked this pull request as ready for review
July 4, 2026 13:33
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Jul 4, 2026
8 tasks
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 freeto 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.
概述
ADR-0086 P2「两道门分离」的 objectui 半边。框架半边(块1 发布物化 + 块2 数据层写门)在 framework#2573;本 PR 把 studio 包 Access 门从"实时写活动记录"改成"写草稿、随包发布"——与 Data/Interfaces 门一致(D6/D7)。
问题(D6 违背):包 Access 门(
/studio/:packageId/access)编辑权限集时直接client.save(...)写活动记录(live),banner 甚至明写"保存即生效 · 顶栏发布不涉及它"。而同一 studio 里 Data/Interfaces 门都是{mode:'draft'}草稿 + 顶栏 Publish 原子发布。两道门共用了同一条 live 写路径。变更
包门 → 写草稿:
PermissionMatrixEditPage.doSave(有packageId分支)+AccessPillar新建集 creator,改为client.save(..., { mode:'draft', packageId })。框架给草稿盖上包归属,顶栏 Publish 随整个包原子发布(框架侧物化进sys_permission_set)。packageId)保持 live(config),符合 D7——两道门各写各的。草稿感知读:
getDraft),草稿覆盖已发布基线显示——否则"存了没发布"的编辑重开会像丢了。listDrafts),所以草稿态/仅草稿的集在发布前也可见(与 Data/Interfaces 一致)。publishNonce触发重载,草稿收敛回已发布基线。(onDraftSaved/publishNonce从 surface 线到AccessPillar+ 编辑器。)banner 修正: 不再声称"保存即生效 / 发布不涉及"——改为"保存为软件包草稿,发布后随整个包生效"(EN + ZH 双语)。
验证
PermissionMatrixEditor.scope.test.tsx:新增断言——包门保存携带{ mode:'draft', packageId },且其他包切片仍逐字保留(ADR-0086 P0 切片合并不回退)。1 passed。端到端(配合 framework#2573)
包门编辑 → Save 写草稿 + pending 计数 +1 → 顶栏 Publish →
POST /packages/:id/publish-drafts→ 框架发布 permission 草稿 → 块1 物化进sys_permission_set(managed_by:'package') →publishNonce重载 → 草稿收敛。块2 写门确保 env-admin 不能绕过直接改包行。关联
🤖 Generated with Claude Code
https://claude.ai/code/session_014y5kiH3aPLWtRRRGcVrXcT
Generated by Claude Code