Skip to content

fix(studio): a renamed validation rule keeps the server verdict's hold on its guard - #31549

Merged
objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-0oxzdk
Nov 8, 2026
Merged

objectstack-fleet[bot] merged 4 commits into
mainfrom
claude/project-thread-0oxzdk

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Requested by Steedos · project thread

Fixes #27482

Clause-②: no
Metadata-protocol: none

维护者速读

What changes

  • ObjectValidationsPanel.tsx: a rule's verdict follows its name. The panel keeps each rule's blocking CEL count by rule name (reportCel(sel.name!, count)) and prunes names no longer in the draft. A rule the panel minted takes its name from its message (patchMessage), and the name input renames too. The guard's ConditionBuilder reports only when its count changes, so a rename left the count under the old name, it was pruned, and the new name never got one: the served verdict stayed on screen while every later edit autosaved. Now:
    • patchRule calls renameCel(old, new) whenever a patch carries a name, which moves the kept count to the new name.
    • renameCel also records the rename in renamedTo, and reportCel resolves a name through it. A report still in flight under the old name (the editor's effect ran on the render before the rename) lands on the rule's current name instead of being stranded. Without this, the new test's minted-rule case was red in 3 of 4 runs.
    • placeNewRule drops a renamedTo entry for the name it places, so a new rule that reuses a name a rename left reports as itself.
  • perm.cel.saveBlocked copy (studio namespace, en.ts and zh.ts, the only two packs that carry it): "Fix the CEL syntax errors before saving." → "Fix the expression errors before saving."; zh 「请先修复 CEL 语法错误再保存。」 → 「请先修复表达式错误再保存。」. The line holds server refusals too (rls-predicate-unenforceable measured live), not only syntax errors. Read by the permission set editor's held line and Save title and by ObjectHooksPanel's held line. The two metadata-admin pins of the old sentence are updated.
  • No change to CelPredicateField, ConditionBuilder or draftVerdict.ts. No client copy of any publish rule (Studio: an expression field that says "Valid CEL" should read the draft's server verdict at its own path (RLS predicate, flow edge condition) #26858), no packages/lint, packages/spec or server change.

Acceptance reading (seat ruling on the step-1 report)

The server judges only a saved draft, and no metadata validate-only door exists, so the first save of a refused guard goes out: it is the save whose re-read brings the verdict. Once the verdict shows, the next save is held and the held line is drawn while the guard still shows the judged text, a rename of the rule included. An edit of the guard text itself goes out, to be judged again (#27612's design, serverHoldAt).

Tests

New top-level describe in the shared harness ui/packages/app-shell/src/views/studio-design/DataPillar.validationVerdictHold-27644.test.tsx (real DataPillar, a fake door whose draft read refuses record.amount > 100 at validations.N.condition):

Ablations (fix committed first, mutated through scripts/ablation-replace.mjs, restored blob == HEAD 00af991baf66, git diff HEAD empty):

  1. The rename carry removed (the renameCel call in patchRule deleted): (a) and (b) red, the control and the Studio: the Validations tab holds the autosave on a served CEL verdict at the rule's own path, as the RLS arm does (#27482 layer 2 of 2) #27644 cases green.
  2. The in-flight resolution removed (the renamedTo walk in reportCel made a no-op): (a) red in 1 of 2 runs, as expected for a timing race. Before that half was written, the same case was red in 3 of 4 runs.

Acceptance notes

  • Live, before and after (fresh showcase, Console Vite over it, Playwright, my own writable package; the probe and its readings are in the project files under issue-27482/live/). On main 58f66b93: a rule made through New → "Reject the save when…" saved on every edit under the red verdict (message, label and guard edits, 4 PUTs, no held line). The same guard on a rule with an authored name was held. RLS USING on a formula field was held after the first save, under "Fix the CEL syntax errors before saving.". After this change: the message edit that renames the rule and the label edit are held (1 PUT in all, held line names qty_too_big_now), the guard edit goes out, and the RLS held line reads "Fix the expression errors before saving.".
  • The 11-03 RLS reading "first PUT answers 200" is the expected first save above, not a defect: after it, an edit beside the USING was held live.

Verification

Tests at the final head c1768bd (main a3ac7fb merged, no overlap with the touched files)
Derived gate union (dispatch-gates --commands): 36 of 36 exit 0

36 of 36 exit 0 at c1768bdc; dispatch-gates --ran: 36 derived, 36 run, 0 NOT-MEASURED. node scripts/check-sdui-manifest.mjs exit 0. pnpm --dir ui exec vitest run scripts/: 170 files passed, 2 skipped. pnpm check:test-source-alias first asked for module-top preloads of the lazily loaded @objectstack/formula, @objectstack/lint and @objectstack/spec/identity in the three edited test files; they were added (d2fd8a4c) and it is green. CI families: read from this PR's check-runs by the seat.


Generated by Claude Code

A rule the panel minted renames itself as its message is edited; its
guard's kept count stayed under the old name and was pruned, so a guard
the server refuses kept autosaving. The count now moves with the name.
The held-line copy names expression errors rather than CEL syntax.

Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01QsR2jSGK8zPYdrSzXgFLDf
…ename

The guard editor's report can still be in flight under the old name when
the rename lands (its effect ran on the render before it); such a report
now resolves to the rule's current name instead of stranding the count.

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

Copy link
Copy Markdown
Contributor Author

domain:ui#3 · zhuangjianguo · session_01QsR2jVEjiYrK7onirxUGyo

席位核对 · ACCEPT · 2026-11-08T14:34Z · head c1768bdcec1d40ac3e2a2e1da33beb46e655d4b2

Seat domain:ui#3 reviewed the diff of its own dispatch: claim 6721388863 on #27482 with amendment 6721638750, card thread session_01QsR2jSGK8zPYdrSzXgFLDf, report 6722643607. Checked against GitHub, not against the report.

  1. Shape: 7 files, +120 / -5, draft on main.
  2. Premise / acceptance: the step-1 reading holds. The count was keyed by name and stranded by a rename. The PR body carries the acceptance reading as ruled: the first save goes out; once the verdict shows, the next save is held, a rename included; a guard edit goes out to be judged again.
  3. Gates / check-runs: 55 runs on this head: 44 success, 11 skipped, 0 red. That includes Type Check UI (the en-drift gate). mergeable_state clean.
  4. Accepted deviations:
    • About 25 source lines, not 8. The in-flight half was needed: the minted-rule case was red in 3 of 4 runs without it.
    • Module-top preloads in the 3 edited test files, required by check:test-source-alias.
    • The 4-run stability reading predates the main merge, and that merge touches none of these files.
  5. Out of scope / Skills-docs: Metadata-protocol: none; Skills-docs: not owed. The changeset sentences were read against the diff: each describes behaviour the diff ships.
  6. Landing: check-governed-merges --pr 31549: NOT governed, 125 changed lines, so no human approval owed. Clause-②: no (an existing key's value, no key added), so no declaration review is owed. Serial: Studio: the disabled Publish button ("No drafts pending publish") is unreachable by keyboard and shows no hover reason, unlike the read-only Publish state beside it #31495 (this seat, in build) edits studio-design/StudioDesignSurface.tsx, a different file. Landing on the maintainer's standing rule that fleet PRs are reviewed and landed by the pm-dispatch skill (2026-11-03T04:52Z), in this project. Relay pr_ready, then automerge_enable.

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 8, 2026 14:35
@objectstack-fleet
objectstack-fleet Bot enabled auto-merge November 8, 2026 14:35
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 8, 2026
Merged via the queue into main with commit ba875d2 Nov 8, 2026
56 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/project-thread-0oxzdk branch November 8, 2026 15:18
rajeev-kumar-se pushed a commit to rajeev-kumar-se/objectstack that referenced this pull request Nov 10, 2026
…ectstack-ai#27482's ruled acceptance (objectstack-ai#32125)

<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBSmteL5HNtgDd86za1A3WTA)_

Fixes objectstack-ai#32112

Clause-②: no
Metadata-protocol: none

## 维护者速读

- **改了什么**:平台测试清单里「Studio
表达式编辑器」这一项(`studio-authoring.expression-editors`)的验收条款 acceptance[4] 和反例
negative[1],改为按已裁决的口径判定权限集行级安全里「引用公式字段的条件」:第一次保存会发出去,服务器回读后给出拒绝判定,此后旁边的修改被拦住、改条件本身会再保存一次接受新判定,发布时一律被拒(422),永远进不了生效版本。已知缺口
knownGaps[3] 同步记下编辑器卡 objectstack-ai#27482 已关闭,拦截提示语现在是「请先修复表达式错误再保存」。
- **为什么改**:QA 运行 objectstack-ai#32102 按旧写法(「一次 PUT 都不许发」)把这两条判成失败,但产品行为正是 objectstack-ai#27482
的裁决(PR
objectstack-ai#31549):服务器只评判已保存的草稿,没有只校验不保存的入口,客户端也不许复制发布规则(objectstack-ai#26858)。这是条款过期,不是产品缺陷。
- **风险与回滚**:只改一个清单 JSON 文件(12 行增、4
行删),不动产品代码。解析错误和无法下推的条件仍要求在第一次保存前就拦住,没有放宽。回滚即 revert。
- **先看**:`docs/qa/platform-checklist/areas/studio-authoring.json` 里
`studio-authoring.expression-editors` 的 `acceptance[4].verify` 和
`negative[1]`。
- **两分钟验证**:`node scripts/check-platform-checklist.mjs`,预期输出
`check-platform-checklist: OK`、退出码 0。
- **需要你做的**:无,席位落地。

## What changes

One item, `studio-authoring.expression-editors` (revision 9 → 10), in
`docs/qa/platform-checklist/areas/studio-authoring.json`. The source for
the new reading is objectstack-ai#27482's ruled acceptance, PR objectstack-ai#31549, "Acceptance
reading (seat ruling on the step-1 report)": "The server judges only a
saved draft, and no metadata validate-only door exists, so the first
save of a refused guard goes out: it is the save whose re-read brings
the verdict. Once the verdict shows, the next save is held … An edit of
the guard text itself goes out, to be judged again".

- **acceptance[4].verify**
- Before: "a parse-faulted predicate and the formula-field predicate are
held the same way", where held means "the perm-autosave-held status with
no PUT issued".
- After: the non-pushdownable and parse-fault probes keep that reading
word for word. The verify now says why: the editor judges both in the
browser before the first save (`celAuthoring.ts` `lintCelPredicate`,
which runs the published RLS rule through `rlsPredicateVerdict` for a
using or check clause). The formula-field probe is split out. The editor
cannot judge it before the first save, because `rlsPredicateVerdict`
lints a one-clause stack that names no object, so the rule's
virtual-field branch cannot fire. Only the draft re-read's
`_diagnostics` refuses it (`CelPredicateField` `useServerHoldAt`,
`draftVerdict.ts` `serverHoldAt`). For that probe it passes when: the
first save goes out (one PUT 200) and its re-read shows the verdict; an
edit beside the guard is held under "Fix the expression errors before
saving." with no PUT; each new text of the guard PUTs once more; and
publish answers 422, so the predicate never reaches the live set. The
verify also says how the clause's "cannot be persisted", steps[4]'s
"issues no PUT" and the evidence's "no save PUT" read for this probe, so
those fields need no edit.
- **negative[1]**
- Before: "a parse-fault formula or RLS predicate that Saves anyway
(Save not gated on celErrorCount) is a FAIL — a malformed RLS predicate
silently mis-scopes rows and some evaluation paths FAIL OPEN, widening
access with no error".
- After: that sentence is kept. It adds that both editors (the formula
field's editor in `ObjectFieldInspector` and the RLS editor in
`PermissionAdvancedFacets`) judge a parse fault before the first save,
so one PUT is the FAIL there. For a refused formula-field RLS predicate,
the FAIL is an edit beside the judged guard that saves, or a publish
that does not answer 422.
- **fixtures.knownGaps[3]**
- Before: "THE FORMULA-FIELD PROBE FAILS TODAY … The editor half is
objectstack-ai#27482, which is open … That first PUT is the residual objectstack-ai#27482 carries.
Until objectstack-ai#27482 is ruled, acceptance[2] and acceptance[4] FAIL on this
probe as written".
- After: "THE FORMULA-FIELD PROBE IS HELD FROM THE SERVER VERDICT, NOT
BEFORE THE FIRST SAVE". objectstack-ai#27482 is closed (2026-11-08, by PR objectstack-ai#31549). The
first save is the ruled acceptance, not a residual. The held line reads
"Fix the expression errors before saving." (zh 「请先修复表达式错误再保存。」),
`perm.cel.saveBlocked` in `ui/packages/i18n/src/namespaces/studio/en.ts`
and `zh.ts`, worded by PR objectstack-ai#31549 from "Fix the CEL syntax errors before
saving.". It also records QA run objectstack-ai#32102's reading (R-2, at ff04ad8) and
that the run scored acceptance[2] pass.
- **source[]**: two entries are added, `draftVerdict.ts`
(`serverHoldAt`) and the studio i18n packs (`perm.cel.saveBlocked`).
- **revision** 10, and a **history** row citing objectstack-ai#32102, objectstack-ai#31549 and
objectstack-ai#32112.

Not edited: acceptance[2], steps[4], acceptance[4].clause and
acceptance[4].evidence. No product code changes, no client copy of the
publish rule (objectstack-ai#26858), and no validate-only door is assumed.

## Acceptance notes

- The code reading is at base `45f0f81f`. `git grep -n "Fix the
expression errors before saving"` hits
`ui/packages/i18n/src/namespaces/studio/en.ts` (the
`perm.cel.saveBlocked` row), two pins
(`PermissionMatrixEditor.fieldWhen-25866.test.tsx`,
`PermissionMatrixEditor.rlsAddPolicyHold-13113.test.tsx`) and the objectstack-ai#31549
changeset. The zh row is `ui/packages/i18n/src/namespaces/studio/zh.ts`.
- The editor that gates before the first save is the one doing the lint.
The RLS editor judges parse faults and non-pushdownable filters in the
browser. The formula field's editor judges parse faults and holds its
save on the error count (`ObjectFieldInspector` `blockingIssues`).
Neither editor judges a formula-field RLS predicate in the browser. The
item now says this per editor instead of generalising.
- No live run was owed. The evidence is the run record objectstack-ai#32102 (R-2,
reproduced on 2 loads) and the existing pin
`PermissionMatrixEditor.serverVerdictHold-27482.test.tsx`, case (b).

## Verification

<details><summary>Gates</summary>

At head `1060d299` (base `45f0f81f`). `dispatch-gates --commands`: 16
families; each was run and its exit code recorded before any pipe:

- `node scripts/check-adr-links.mjs`: exit 0
- `node scripts/check-adr-links.mjs --self-test`: exit 0
- `node scripts/check-closing-keyword-parity.mjs`: exit 0
- `node scripts/check-closing-keyword-parity.mjs --self-test`: exit 0
- `node scripts/check-comment-mask-corpus.mjs`: exit 0
- `node scripts/ci/plan-test-core-shards.mjs --self-test`: exit 0
- `pnpm --filter @objectstack/lint run check:doc-formula-expressions`:
exit 0
- `pnpm check:ci-filter-parity`: exit 0
- `pnpm check:cross-package-test-inputs`: exit 0
- `pnpm check:doc-authoring`: exit 0
- `pnpm check:driver-memory-census`: exit 0
- `pnpm check:gitlink-declared`: exit 0
- `pnpm check:nul-bytes`: exit 0
- `pnpm check:platform-checklist`: exit 0
- `pnpm check:refd-timer-probe`: exit 0
- `pnpm check:watch-hint-literal`: exit 0

`dispatch-gates --ran`: 16 derived, 16 run, 0 NOT-MEASURED, 0 UNRUN,
exit 0. `node scripts/check-platform-checklist.mjs`: exit 0
("check-platform-checklist: OK — 16 areas, 361 items").
`check:doc-formula-expressions` ran after `turbo run build
--filter=@objectstack/formula --filter=@objectstack/lint` under
`os-verify-lock.sh` (VERDICT command-exit 0). No changeset: the diff is
`docs/qa/**` only (`skip-changeset`). CI families: the seat reads them
from this PR's check-runs.

</details>

---
_Generated by [Claude
Code](https://claude.ai/code/session_01WGufziPhFzgoYFZnBkgnuc)_

Co-authored-by: Claude <noreply@anthropic.com>
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 tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

1 participant