Repository navigation
fix(app-shell): a validation rule guard the publish refuses holds the Studio autosave (#27644) - #28027
Merged
Conversation
…holds the Studio autosave Claude-Session: https://claude.ai/code/session_01Utp6CZjUkAAB57j1TQa8sE Co-authored-by: Claude <noreply@anthropic.com>
…ar and the row builder Claude-Session: https://claude.ai/code/session_01Utp6CZjUkAAB57j1TQa8sE Co-authored-by: Claude <noreply@anthropic.com>
Contributor
Author
|
domain:ui#4 · os-bill · session_01Utp6CbDAucNyQ4UtzCJKyh 席位核对ACCEPT · head
Generated by Claude Code |
This was referenced Nov 8, 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 Bill · project thread
Fixes #27644
Clause-②: no
Metadata-protocol: none
维护者速读
validations.N.condition),发布会拒收的条件就挡住自动保存。StudioDesignSurface.tsx的 DataPillar 加载和doSave两处、ConditionBuilder.tsx行模式的 hold 计数、ObjectValidationsPanel.tsx的ruleIndex。pnpm --dir ui exec vitest run packages/app-shell/src/views/studio-design/DataPillar.validationVerdictHold-27644.test.tsx,预期 6 个用例全绿。What changes
DataPillarkeeps the object draft read's served_diagnosticsand the body they judged (editedItemDiagnostics, the layered read's verdict and body without a pending draft), drops both on each object load, and re-reads the draft after each save, so the next verdict is the stored body's. A sequence counter keeps a stale re-read from landing over a later load. Both are provided to the Validations tab only, through the existingDraftVerdictContext/DraftVerdictBodyContext.ObjectValidationsPanelhands each rule's guard its verdict path:validations.N.GUARD, where N is the rule's index in the draft's rawvalidationslist (the index the lint locates by, since lint: a validation rule's expression finding carries the key pathvalidations.N.condition, not prose, so the draft read can address it (#27482 layer 1 of 2) #27643) and GUARD iscondition, orwhenon a conditional rule. A rule not yet in the draft gets none.ConditionBuildertakesverdictPath. In raw mode it forwards it toCelPredicateField, whose fix(app-shell): a server error at an RLS clause's path holds the permission-set autosave #27612useServerHoldAtalready reports the served error throughonLintChangewhile the text on screen is the judged text. In row mode no CEL editor is mounted, so the builder reads the sameuseServerHoldAtitself: it shows the served message under the rows and counts it inonBlockingIssuesChange. No second hold mechanism and no client copy of the rule: the server's errors are taken whole, at their exact path, through the fix(app-shell): a server error at an RLS clause's path holds the permission-set autosave #27612 helpers.The panel's verdict count already rides #27629's per-rule kept verdicts, so the hold also survives leaving the tab, and the held line names the rule.
Why
A guard the publish refuses (an ordering compare on a nullable field,
record.amount > 100) read clean in the Validations tab and autosaved until Publish refused it. Measured on this branch before the fix: the stored refused guard round-trips as a ROW, so the raw-editor half alone would not hold the card's own shape (ablation 2 below).Tests
DataPillar.validationVerdictHold-27644.test.tsx, pinned the wayPermissionMatrixEditor.serverVerdictHold-27482.test.tsxis: a fake door decides the refusal and serves it in the draft read's_diagnostics; the CEL engine is stubbed to pass every guard, so every hold is the served verdict's. (a) stored refused draft: another edit to the rule is held, no PUT, the message stays; (b) the card flow: the refused guard saves once, its re-read holds the next edit; (c) editing the guard away releases, the save goes out and its clean re-read clears the message; (d) typed back to the judged text before the autosave fires: held again; (e) leaving the tab keeps the hold; control: the rule beside it shows none of it.ConditionBuilder.serverHold-27644.test.tsx: the row builder shows and reports the served error, editing the row away reports 0, and withoutverdictPathnothing is read.Acceptance notes
serverHoldAtcompares the judged body's value at the path with the text on screen, and a guard stored as an expression envelope (dialect+source) reads as an object there, so it never matches. No producer of envelope-form validation guards was found (none inexamples/); the Studio writes a plain string unless the prior value was an envelope. Left as is, not filed.StudioDesignSurface.tsxhunks: the shared import block (one name added) andDataPillaronly; disjoint from feat(studio): the list-view panel switches between an object's list views, a drafted one included #27988'sInterfacesPillarhunks.Verification
All readings on this branch, against
objectstack-ai/objectstack. The final head is479a7575: this card's six files overorigin/main066ff51e, which already carries #27988.New tests and ablations
pnpm --dir ui exec vitest run packages/app-shell/src/views/metadata-admin/inspectors/ConditionBuilder.serverHold-27644.test.tsx packages/app-shell/src/views/studio-design/DataPillar.validationVerdictHold-27644.test.tsx: Test Files 2 passed, Tests 9 passed.DraftVerdictContext.Provider value={objVerdict}tovalue={undefined}, throughscripts/ablation-replace.mjs, anchor 1 to 0):DataPillar(a) to (e) fail, the control passes (5 failed, 1 passed). Restored: blob equals HEAD,git diff HEADempty.raw ? celErrors : held.lengthtoraw ? celErrors : 0): both row-builder cases fail, and so doDataPillar(a) and (e), the cases that open the stored refused guard (4 failed, 5 passed). This is the measurement that the stored guard opens as a row. Restored the same way.Package checks on the final head
pnpm --filter @object-ui/app-shell type-check(bothtscprojects;tsconfig.test.jsoncompiles the tests): exit 0.ObjectValidationsPanel*,DataPillar*,StudioDesignSurface*,ConditionBuilder*,CelPredicateField*, theserverVerdict*suites), including both new ones: Test Files 169 passed, Tests 1234 passed.eslinton the five changedui/files: 0 errors (the warnings are on lines this PR does not touch).pnpm check:new-line-citations: 0 new citations.packages/app-shell/suite (about 1950 files) was not completed locally; a run passed an hour on the shared box before the secondorigin/mainmerge, and was stopped.Test UIin CI runs it.Derived gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack: 34 commands, the same list at every head. At23227677all 34 exit 0, includingnode scripts/check-sdui-manifest.mjs. The re-run on the final head is reported in the os-dev report on the card.Generated by Claude Code