Skip to content

fix(app-shell): permission matrix keeps a roll-up acknowledgement only while Read is on - #34954

Merged
objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34786-matrix-rollup-reason
Nov 17, 2026
Merged

objectstack-fleet[bot] merged 2 commits into
mainfrom
claude/issue-34786-matrix-rollup-reason

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Yibo Wang · project thread
Fixes #34786
Clause-②: no
Metadata-protocol: none

repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz

维护者速读

  • 改了什么:控制台权限矩阵里,字段行关掉 Read 时,同一次编辑会删掉 rollupSourceUnreadableReason;批量快捷键(只读全部/可写全部)改写字段行时保留这条说明。
  • 为什么改:spec 拒收 readable: false 旁边的说明,原来关 Read 会留下被拒的形状且无法清除;批量快捷键则会悄悄丢掉管理员写下的说明。
  • 风险与回滚:仅限私有包 @object-ui/app-shell 的两个函数,无 spec 或接口变化;回滚即 revert 本 PR。
  • 先看:permission-slice.ts(withFieldBits 的 readable && 条件)、PermissionMatrixEditor.tsx(updateFieldPerm 的 Read off 级联)、permission-slice.fieldRule-26597.test.ts。
  • 两分钟验证:cd ui && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/permission-slice.fieldRule-26597.test.ts,预期全绿,含 3 条 withFieldBits 新用例。
  • 需要你做的:无,席位落地。

What changes

  • FieldPerm (permission-slice.ts) declares the optional rollupSourceUnreadableReason key, documented against FieldPermissionSchema.
  • updateFieldPerm (PermissionMatrixEditor.tsx): Read off now deletes the reason beside when (the objectstack#25866 cascade), so the editor never authors the shape FIELD_PERMISSION_ROLLUP_REASON_ON_HIDDEN refuses.
  • withFieldBits keeps the reason while readable stays true and drops it only when readable goes false. Its one caller, applyFieldBulk, always passes readable: true, so the bulk shortcuts now keep the reason instead of dropping it silently.
  • Changeset: @object-ui/app-shell patch.

Tests

  • permission-slice.fieldRule-26597.test.ts: a new top-level describe for withFieldBits. It keeps the reason on a readable rewrite and drops it on readable: false, and applyFieldBulk Read-only all keeps it. Each resulting entry is parsed with the real FieldPermissionSchema from @objectstack/spec/security, and a control parse proves the refused shape really is refused (the issue path is rollupSourceUnreadableReason).
  • PermissionMatrixEditor.fieldWhen-25866.test.tsx: a new top-level describe in the existing field-cascade harness. Read off on a stored acknowledged entry saves { readable: false, editable: false }, Write all saves the entry with the reason kept, and both saved entries parse with FieldPermissionSchema.

Acceptance notes

  • withFieldBits(cur, false, …) still keeps when. The refused when beside readable: false shape is reachable only if a caller passes readable: false, and no caller does (applyFieldBulk passes true). I left it alone because it is outside this card.

Verification

Pinned tests, head 5d561af

os-verify-lock running vitest run --maxWorkers=2 on the two files: Test Files 2 passed (2), Tests 27 passed (27), VERDICT command-exit 0.

Ablations (scripts/ablation-replace.mjs, each restored to blob == HEAD)
  • A, delete delete next.rollupSourceUnreadableReason; in updateFieldPerm: Read off removes the reason, so the saved entry is one the spec accepts fails (1 failed). Restored to blob 27768b90fc7b, which equals HEAD.
  • B, readable && guard removed in withFieldBits: drops the reason when the entry goes readable:false fails (1 failed). Restored to blob 5206a2968c7c, which equals HEAD.
  • C, keep branch disabled in withFieldBits (the pre-fix behaviour): 3 failed, namely the slice keep case, bulk Read-only all, and editor Write all. Restored to blob 5206a2968c7c, which equals HEAD.
  • After the script: git diff HEAD empty.
Type check and gates
  • pnpm --filter @object-ui/app-shell run type-check (both tsc programs): VERDICT command-exit 0.
  • dispatch-gates --commands: 38 derived commands. 36 exited 0. Two were NOT MEASURED on the first pass: pnpm --dir ui exec vitest run scripts/ (the files failed with Cannot find package '@objectstack/spec/ui' because the run started before the spec dist existed, an environment fault) and pnpm check:type-check-debt (exit 3, its closure build never got a lock turn). The seat report records the re-run result. dispatch-gates --ran: 38 derived, 38 run.
  • overlap-check against origin/main c81f498 and open PR feat(studio): the permissions page speaks business wording; bulk buttons show on every row #34914: VERDICT clean exit 0.

Generated by Claude Code

…y while Read is on

Read off in updateFieldPerm now deletes rollupSourceUnreadableReason beside
when, so the editor never authors the shape the spec refuses beside
readable: false. withFieldBits keeps the reason while readable stays true
and drops it only when readable goes false, so the bulk shortcuts stop
dropping it silently. FieldPerm declares the optional key.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01WGufziunkXbDT7wUWqfmWz
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufzhshTXCAmv9KJXRZkB

L1 review · 2026-11-17T19:00Z

L1: ACCEPT
Head-sha: 5d561af

What I read at this head

Checklist

Shape. Draft, Fixes #34786. The body and the changeset both carry Clause-②: no and Metadata-protocol: none, matching the claim. FieldPerm is an app-shell-internal type, so declaring the optional key is no published widening.

Scope. Every path is inside the claimed surface:

  • PermissionMatrixEditor.tsx: updateFieldPerm only.
  • permission-slice.ts: FieldPerm and withFieldBits.
  • Their two tests.
  • A changeset.

Changeset. Patches @object-ui/app-shell, the one package whose src moved. Its text matches the diff.

Code. The fix follows the #25866 when cascade exactly:

  • Read off deletes rollupSourceUnreadableReason beside when. The spec refuses it beside readable: false (FIELD_PERMISSION_ROLLUP_REASON_ON_HIDDEN).
  • withFieldBits copies the reason only while readable is true.

I checked the other write paths:

  • fieldRuleSeed returns the entry itself, so a single-box click keeps every authored key.
  • updateFieldWhen spreads the seed and never sets readable: false.
  • applyFieldBulk is withFieldBits's one caller and always passes readable: true.

So no path now authors the refused shape, and no readable rewrite drops the reason.

Tests. The commands are real and exit codes are recorded. The new pins parse every resulting entry with the real FieldPermissionSchema from @objectstack/spec/security. The "drops" case first proves that the refused shape is refused, so the drop is load-bearing. Three ablations went red, each on its own case, and each was restored to blob == HEAD.

Docs. None made false. UI strings. None added. Unrelated files. None.

Must-fix

None.

Should-fix

None.

Notes

  • Deviation, judged acceptable: two gate families were NOT MEASURED locally.
    • ui vitest scripts/ failed because spec dist was absent (environmental). check:type-check-debt never got the lock.
    • The report declares both, and runs the one scripts/ gate that reads FieldPerm (check-designer-field-key-parity, OK).
    • CI is the reading for both. On this sha, Type Check · debt ledger, Lint · scoped · tooling self-tests and Lint · PM dispatch-gates are already green. The rest is covered by the CI-green landing condition below.
  • Dormant note. withFieldBits(cur, false, …) would still keep when beside readable: false. No caller passes false, as the Acceptance notes say. If a Hide-all shortcut is ever added, it must drop both keys. The reason already follows that rule.

CI at review time

There are 51 check-runs on this sha: 28 success, 13 skipped, 10 in progress, 0 failed.

  • Green: Lint UI, Type Check UI, Build & E2E UI, Live E2E UI and every core Lint/Type Check lane.
  • In progress: Test UI 1–10. Shards 11–16 had not registered yet.

Landing needs every run on the landing head green.

Routing

L1 ACCEPT. No L2 is owed (Clause-② no), and the PR is not governed. The area lands it once CI is fully green.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz

Landing · area o3-C · head f7de67d

Probe Reading
check-governed-merges.mjs --pr 34954 NOT governed; 106 changed lines (+103/−3) ≤ 3000 → Tier S
Review L1 ACCEPT 6958007304 at 5d561af; no contract review owed (Clause-②: no, FieldPerm is app-shell internal)
Open findings none (L1 notes only: two local gate families read by CI instead; dormant withFieldBits(cur, false, …) keeps when, no caller)
CI K was 15, so origin/main was merged in by relay pr_update_branch (clean merge commit, no PR change, ACCEPT kept); on f7de67d: 39 success, 13 skipped, 0 failed; mergeable clean

State: ready + auto-merge now; on MERGED, #34786 closes via Fixes and its pm:* state label comes off.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 17, 2026 19:25
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44160924991 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (10/16) — 失败步骤: Fetch this commit's history and the base branch(日志不可读,点进 job 看)

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️ 本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • 本 PR 过去 24h 无队列失败记录(首次)。
  • 过去 24h 队列共有 33 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-actions

Copy link
Copy Markdown
Contributor

⛔ merge queue 构建失败 — 先分诊,再决定要不要重排

队列构建 44170218125 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集),
所以失败的测试可能在本 PR 没碰过的包里 —— 那不是重排能修的。每次盲目重排都会让排在后面的所有 PR 重建一轮。

分类:failure —— 按下面的日志分诊。

失败的 job(日志抽取,best effort):

  • Test UI (3/16) — 失败步骤: Fetch this commit's history and the base branch(日志不可读,点进 job 看)

↳ 失败原因 是判读的关键:超时(Test timed out in … / Hook timed out in …)多半是负载/时序,不是本 PR 的回归;
断言(AssertionError: …)才指向真实的行为改变。两者的 FAIL 行长得一模一样,只有这一行能区分。

⚠️ 断言这一侧有一类例外,判据是断言在测什么,不是它是不是 AssertionError。 断言的对象是产品行为(一个值、一个形状、一次拒收)⇒ 照上面读:真实的行为改变,去查,⛔ 不要重排掉;
断言的对象是这次实验自身的有效性前提(跑完的耗时、负载下的先后、任何只在时间预算内才成立的条件)⇒ 它跟超时是同一类,同样对负载敏感,重排一次是合法的判别手段。
识别是机械的:断言的消息或它比较的值本身点名了一段时长、一个时间戳、一个耗时计数。实测过的一对 —— AssertionError: SecurityPlugin.init() ran: expected false to be true 测的是产品行为(真回归);
AssertionError: this run took over a second, so second-precision stamps could have differed too: expected 1006 to be less than 1000 测的是实验前提:它守护的那条不变式当时是绿的,同一个 head 原样重排一次即成功。
穿着 AssertionError 外衣的时间测量,仍然是时间测量。(⛔ 这只改「怎么读一次红」,不改「哪些测试可以重排」——后者由别处管。)

跨 PR 相同签名(24h,按失败测试文件聚合):

  • ⚠️ 本次没有可用的聚合签名(日志里没有能解析出测试文件名的 FAIL 行)—— 这不是「没有同签名的其他 PR」,是这一轮没测到。跨 PR 聚合本次不可用,请手工比对其他 PR 的同类评论。
  • ⚠️ 24h 评论账本没读完(超过 5 页仍未读到窗口尽头),所以上面的「不同 PR 数」是下界,不是全量。

历史信号:

  • ⚠️ 本 PR 过去 24h 已在队列失败 1 次(不含本次)。 内容未变而反复失败 ⇒ 高度怀疑 flaky 测试或与同组 PR 的语义冲突,重排不解决。
  • 过去 24h 队列共有 31 个失败构建(不含本次)。

分诊清单:

  1. 失败测试在本 PR 改动的包里 → 真回归,修 PR。
  2. 失败测试与本 PR 无关 → 看上面的「跨 PR 相同签名」;已有汇总 issue ⇒ flaky/环境问题实锤,去那张 issue 上谈,修好前重排只会再烧一轮全队列。
  3. 两者都不是 → 可能与同组 PR 语义冲突;等前面的 PR 落地或失败出队后再重排一次即可,不要连续重排。

Generated by Claude Code · merge-queue-triage workflow (#4859)

@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 17, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#3 · os-support-ai · session_01WGufziunkXbDT7wUWqfmWz

Re-queue · head f7de67d

The queue removed this PR at 20:50Z after two group builds failed, both on one Test UI shard at "Fetch this commit's history and the base branch" (timed out after 14 minutes, before any test ran): run 44160924991 on shard 10/16, run 44170218125 on shard 3/16. No test failed in either. That step is runner infra, not this diff (a 106-line app-shell change), and the same timeout removed #34914 earlier today before its re-queue merged. Head, review and PR-head CI are unchanged from landing comment 6958514847, so this is the one re-queue.

@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 17, 2026
Merged via the queue into main with commit 119d5db Nov 17, 2026
53 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-34786-matrix-rollup-reason branch November 17, 2026 21:45
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/m tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

console permission matrix: turning Read off leaves rollupSourceUnreadableReason behind (refused shape) and the bulk shortcut drops it silently

2 participants