Repository navigation
fix(app-shell): the Studio RLS editor stops offering CHECK on a select or delete policy, and a refused save shows the server's explanation - #28884
Merged
Conversation
… pair by the spec's schema, and a refused save prints the server's issue messages A blank CHECK is not offered on an operation the spec admits none on; a written one keeps its editor with the spec's refusal under it. A policy with no predicate shows the spec's refusal under USING. While either remains the package door's autosave holds. A refusal now prints each issue's own message, a policy's on its row, instead of the door's path-only headline. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTuqPevUec8TiUH9Wd
…se verdict The server-verdict hold suite made its unrelated edit in CHECK on a select policy, which the editor no longer offers; its policy is now `all`. The field envelope suite's facet mock keeps the module's other exports. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01QsR2jTuqPevUec8TiUH9Wd
Contributor
Author
|
domain:ui#1 · zhuangjianguo · session_01QsR2jUJ19MstFvFhjgiYTu 席位核对 · ACCEPT · 2026-11-02T03:12ZHead-sha:
Generated by Claude Code |
This was referenced Nov 2, 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.
Requested by Steedos · project thread
Fixes #28664
Clause-②: no
Metadata-protocol: none
维护者速读
select/delete策略不再提供空白的 CHECK 输入框,改为一行说明;已经写了 CHECK 的保留输入框,并在下方显示 spec 自己的拒绝原文,不再显示「CEL 有效」。USING 和 CHECK 都为空的策略在 USING 下方显示 spec 的拒绝原文。存在这些问题时自动保存暂停,状态行说明原因。保存被拒时,横幅显示服务端每条issues[].message,策略相关的按行号显示,不再只显示路径和 zod 代码。checkon aselectordeleterow-level policy is accepted byRowLevelSecurityPolicySchemaand never evaluated — and it does not suppress theusingdefault either; no lint reports it #19965)已正确拒绝select/delete上的check和没有任何谓词的策略,但编辑器照样提供 CHECK、显示「CEL 有效」,自动保存随后 422,横幅只剩rowLevelSecurity.0.check [custom]。服务端的 422 消息按设计只给标题,原文在issues[]里,编辑器没读。RowLevelSecurityPolicySchema.safeParse,客户端不复述任何规则;编辑器不删除作者写过的内容。新增的保存暂停只在 spec 会拒绝的情况下出现。服务端和 spec 未改动。回滚即 revert 本 PR。metadata-admin/PermissionAdvancedFacets.tsx的rlsClauseFindings(探针只带operation/using/check)、metadata-admin/PermissionMatrixEditor.tsx的refusalText与rlsClauseRefusedCount、i18n/src/namespaces/studio/{en,zh}.ts的三条新文案。cd ui && pnpm exec vitest run packages/app-shell/src/views/metadata-admin/PermissionAdvancedFacets.rlsClauseFindings-28664.test.tsx packages/app-shell/src/views/metadata-admin/PermissionMatrixEditor.rlsAddPolicyHold-13113.test.tsx,预期 22 个用例全绿。What changes
specValidationFindingsin@objectstack/metadata-protocolreturns onlymetadataIssueHeadline(issues)("1 issue — PATH [code]") for the meta faces, and each issue's prose ridesissues[], whichMetadataClient'sparseErroralready reads. The Studio Access pillar's door isPermissionMatrixEditPage, whose save catch printederr.messageunless an issue named a policy name. So the fix is client-side; the server is right and unchanged.rlsClauseFindings(policy)inPermissionAdvancedFacets.tsxrunsRowLevelSecurityPolicySchema.safeParseon a probe that carries the row'soperation,usingandcheckbeside a placeholder name and object, so a name still being typed does not stop the cross-field rules from running. Issues atcheckshow under CHECK; issues atusingor at the policy itself show under USING. Whether an operation admits a CHECK at all is read by probing a non-blank one. No operation list or rule is restated in the client.select/delete. A blank CHECK is not offered: the CHECK label stays with the noteperm.rls.checkNotApplicable. A non-blank CHECK keeps its editor, shows the spec's message under it word for word, and withholds "Valid CEL" (throughCelPredicateField's existingscopeIssue). Nothing the author wrote is pruned.usingorcheck…" message under USING.rlsClauseFindingCount(draft.rowLevelSecurity)joinssaveHeldinPermissionMatrixEditPage, read from the draft so it does not wait for the RLS tab to mount. The status line saysperm.rls.clauseHeld. The CEL and unnamed-row lines keep their precedence.rlsNameRefusalbecomesrefusalText: arowLevelSecurity.N.nameissue keeps its wording; any otherrowLevelSecurity.N…issue reads "Not saved. Policy on row N + 1: MESSAGE" (perm.rls.policyRefused); an issue elsewhere follows the door's headline asPATH: MESSAGE. A refusal with no issues keeps the door's text. The banner span iswhitespace-pre-line, so each line shows on its own.perm.rls.policyRefused,perm.rls.checkNotApplicable,perm.rls.clauseHeld), en and zh. That table is typedRecord<string, string>outside the locale packs, soClause-②: noholds.@objectstack/spec/securityis already a static runtime import of app-shell (permission-slice.tsimportsobjectPermissionGrantsfrom it), so the schema adds no new entry to the bundle.Tests
PermissionAdvancedFacets.rlsClauseFindings-28664.test.tsx, 14 cases. Forselectanddelete, the CHECK finding's text equals the messageRowLevelSecurityPolicySchema.safeParseanswers and starts with the prefix the spec's own test pins ("checkis never evaluated on aselectpolicy:", and thedeleteone); a blank CHECK is not offered. Controls:all,insert,updateoffer CHECK with no finding. A policy with no predicate shows the spec's root message under USING onselect,deleteandall; controls for a non-blank USING and anupdatepolicy with only a CHECK.rlsClauseFindingCountcounts across rows and judges an unnamed row.PermissionMatrixEditor.rlsAddPolicyHold-13113.test.tsx. Case (d) now reads the headline followed by the issue's message. New (e): a refusal atrowLevelSecurity.0.checkreads "Not saved. Policy on row 1: MESSAGE" with no[custom]; its control, a refusal with no issues, keeps the door's text. New (f): a named row with no predicate is held with the status line and sends nothing; a USING lets it go.PermissionMatrixEditor.serverVerdictHold-27482.test.tsxmade its unrelated edit in CHECK on aselectpolicy, which the editor no longer offers; its policy is nowall(the verdict under test is about USING and does not read the operation).PermissionMatrixEditor.fieldEnvelope.test.tsx's facet mock now keeps the module's other exports.scripts/ablation-replace.mjs, anchor 1 → 0, restored to the HEAD blob withgit diff HEADempty:{ success: true }: 8 failed | 14 passed;checkAppliesforcedtrue: the two "blank CHECK is not offered" cases failed (2 failed | 12 passed);err.message: (c), (d), (e) failed (3 failed | 5 passed).Acceptance notes
Verification
Builds and type-check (at 1df41cf, base origin/main 67103cc)
turbo run build --concurrency=2 --filter='@object-ui/app-shell^...' --filter=@objectstack/formula --filter=@objectstack/sdui-parser --filter=@objectstack/lint --filter=@objectstack/client: 64/64 tasks, lock VERDICT command-exit 0.pnpm --filter @object-ui/app-shell --filter @object-ui/i18n run type-check: both Done, VERDICT command-exit 0.Tests
rlsAddPolicyHold-13113, 2 files, 22 tests passed;serverVerdictHold-27482andfieldEnvelope, 2 files, 9 tests passed.PermissionAdvancedFacets,PermissionMatrixEdit,rowLevelSecurityorperm.rls.(78 app-shell files, plusdata-objectstack,fields,plugin-designerandscripts/__tests__/spec-symbol-ledger-app-shell-7265.test.ts), 80 files in three locked batches: 277 + 158 + 281 tests. The middle batch had 6 failures in the two files repointed above (a facet mock missing the new export, and aselectfixture editing CHECK), both green after 1df41cf. CI's Test UI runs the rest of app-shell.pnpm exec vitest run packages/i18n/: 94 files, 1438 passed, 13 skipped.Derived gates (dispatch-gates --commands, at 1df41cf)
All 34 derived commands exit 0, reconciled with
dispatch-gates --ran(34 derived, 34 run, 0 NOT-MEASURED). Among them:node scripts/check-sdui-manifest.mjs(exit 0, no registry change),pnpm --dir ui exec vitest run scripts/(169 files, 4900 tests passed, after a spec rebuild),pnpm check:type-check-debt,pnpm check:nul-bytesandpnpm check:cross-package-test-inputs. The PR-body gates (check-adr-0087-registration --base origin/main,check-changeset-no-major --base origin/main,check-closing-keyword-parity) ran against this body throughGITHUB_EVENT_PATH.Human Minimum
packages/specholds no runtime logic. (No spec change.)pnpm lintpasses. (Left to CI's Lint UI.)main, one pull request.packages/spectouched: n/a.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code