Repository navigation
fix(runtime): a declarative update action answers the validation warnings its write raised, and the console toast shows them - #38076
Conversation
…ite raised executeDeclarativeUpdateAction composed its answer from the written record and dropped the advisory validation-rule hits the data-plane update answered, so a button that performs the same write as a form save answered no warnings. Claude-Session: https://claude.ai/code/session_01L9qiby3dfNfCgpXwPkB2Hf Co-authored-by: Claude <noreply@anthropic.com>
…ts write raised The runner reads the declarative-update answer's warnings and raises the success toast on its warning variant with the rule's words as its description; both console toast handlers learn the warning variant. Claude-Session: https://claude.ai/code/session_01L9qiby3dfNfCgpXwPkB2Hf Co-authored-by: Claude <noreply@anthropic.com>
…d row and the record page; changeset Claude-Session: https://claude.ai/code/session_01L9qiby3dfNfCgpXwPkB2Hf Co-authored-by: Claude <noreply@anthropic.com>
…he ask_ai retirement's hunk Claude-Session: https://claude.ai/code/session_01L9qiby3dfNfCgpXwPkB2Hf Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift Check3 anchor(s) derived from 1 changed package(s); no hand-written page names any of them, so this run has nothing to list — not a clean bill of health. This check sees only pages that NAME a derived anchor: one that documents this change in prose, or enumerates it in an authoring dialect, names none and stays invisible to it on every run. What this run could not see
Coarse fallback — 30 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 95fe84f819d7f30defbf5a792561967b7589f50d && git checkout 95fe84f819d7f30defbf5a792561967b7589f50d
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 93fa9118a3dc61473890eafc6bb170a6fc1c3042 40c5c821495c1c02e2a7a4a96244fd1bc0ab1870 && git checkout -B drift-repro 93fa9118a3dc61473890eafc6bb170a6fc1c3042 && git merge --no-ff 40c5c821495c1c02e2a7a4a96244fd1bc0ab1870
node scripts/docs-audit/affected-docs.mjs --json 93fa9118a3dc61473890eafc6bb170a6fc1c3042 |
…in the declarative-update harness Claude-Session: https://claude.ai/code/session_01L9qiby3dfNfCgpXwPkB2Hf Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 Contract reviewServed-tier: ① Derived judgments
② Semver levelpatch for ③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-tesla · session_01L9qibwSEecrzDjKjbk24r1 L1-a: ACCEPT at
|
|
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU Landing · 2026-11-28T02:57Z · zone
|
Requested by Tesla · project thread
Fixes #37867
repo:objectstack#3 · os-tesla · session_01L9qibyUSf2nKJWW6qBemSU
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
packages/runtime/src/action-execution.ts:executeDeclarativeUpdateActioncopies thewarningsthe data-plane update answered (protocol.updateData, the data door's ownValidateDataIssueelements) onto its result.DeclarativeUpdateResultgains an optionalwarnings, present only when the write raised an advisory rule hit, so a write that trips nothing answers byte-for-byte as before. Both action doors (RESTPOST /api/v1/actions/...and MCPrun_action) go through this executor. The stale roll-up path (ERR_SUMMARY_RECOMPUTE) composes from the samewrittenanswer, so it carries them too.ui/packages/core/src/actions/ActionRunner.ts: for anoperation: 'update'action only, the runner reads the answer'swarnings(distinct messages, in answer order). When there are any, the success toast takes thewarningvariant, with the messages as itsdescriptionand the Undo affordance kept. This is one toast, the way a record save raises one (toastRecordSave). When the author turned the success toast off (toast.showOnSuccess: false, or a result dialog), the warning is still shown, in the rule's own words, so no new runner text is needed.ToastHandleroptions gain an optionaldescription.ui/packages/app-shell/src/hooks/useConsoleActionRuntime.tsx,ui/packages/app-shell/src/views/RecordDetailView.tsx: both console toast handlers used to send every non-error toast totoast.success. They now honourtype: 'warning'and calltoast.warning(message, { description, duration, action })with the same Undo action.@objectstack/runtime,@object-ui/core,@object-ui/app-shellpatch.Not changed:
packages/spec(the action answer has no zod declaration, it is the runtime's TS interface), locale packs (no new text), HotCRM (itsconfirm_sales_orderandframework_quota_exceededwork as authored).Tests
packages/runtime/src/action-declarative-update.test.ts, a new top-leveldescribein the shared harness. It puts aprotocolslot in front of the caller-honouring rig. REST: the 200 answer carries the write's warnings, element for element, beside the record and the undo anchor. MCPrun_action: the same write gives the same warnings. Control: a write that trips no rule has nowarningskey. The file gains a module-topimport '@objectstack/metadata'so the dispatcher's lazy load is paid at collection (check:test-source-alias).ui/packages/core/src/actions/__tests__/ActionRunner.updateOperation.test.ts, a newdescribethrough the realcreateServerActionHandler: one warning toast with the success message as title and the rule's words as description; repeated messages said once and distinct ones one per line; Undo kept on an undoable action; control with no warnings is a plain success toast with no description; success toast off still warns; reverse pin: a script action withoutoperationnever reads awarningskey.ui/packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.undoLookupId-11122.test.tsxandui/packages/app-shell/src/views/RecordDetailView.undoLookupId-11122.test.tsx, a newdescribein each, down tosonner. On a grid row and on the record page, the update's warnings raisetoast.warningonce with the description and the Undo action, no success toast, and Undo restores the stored value. Both harnesses' route stubs gained an optional answer body. These two test files are a surface amendment to the claim, reported to the seat.Acceptance notes
origin/main815e882bbefore any edit. Through the realHttpDispatcher.handleActions→executeDeclarativeUpdateAction→callData, the protocol'supdateDataanswered["object","id","record","warnings"]and the action's 200 body carriedwarnings0 times.notice(a hook's message for the person) anddroppedFields. Out of scope here; the seat files them.ToastHandlerand the action answer each gain one optional member. Nothing is refused or narrowed.Verification
pnpm --dir ui exec vitest run packages/core/src/actions/__tests__/ActionRunner.updateOperation.test.tsshows 19 passed, 6 of them the new block.executeDeclarativeUpdateAction's result block (action-execution.ts), then the success-toast arm ofhandlePostExecution(ActionRunner.ts).Local readings at 40c5c82
action-declarative-update.test.ts37 passed;ActionRunner.updateOperation.test.ts19 passed;useConsoleActionRuntime.undoLookupId-111226 passed;RecordDetailView.undoLookupId-111224 passed.pnpm --filter @objectstack/runtime testTest Files 655 passed, Tests 12316 passed, 25 skipped. ui vitestpackages/core/src/actions: 58 files, 810 passed. app-shelluseConsoleActionRuntime*+RecordDetailView*: 128 files, 1104 passed.@objectstack/runtime(test layer 27 files / 183 errors held in the ledger, unchanged),@object-ui/coretype-check,@object-ui/app-shelltype-check.scripts/ablation-replace.mjs, each restore blob == HEAD: runtimewarningsspread removed, 2 failed (REST, MCP); the runner's warnings read emptied, 6 failed (4 core, 2 hosts); each host's warning arm disabled, 1 failed each.dispatch-gates --ranwith recorded exit codes: 73 derived, 71 exit 0, 2 NOT MEASURED (exit 3:check-plugin-teardown-shape --self-test, fixture commit outside the shallow clone;check:dual-build-cjs-loads, needs a fullpnpm build), 0 unrun.check:test-source-aliasexit 0 at 40c5c82.overlap-check.mjsVERDICT clean exit 0 against main and feat(spec)!: action locations say what an action acts on #37929, feat(spec)!: retire the ask_ai action type (ADR-0160 D7) #37924, fix(runtime)!: an action not bound to an object accepts no record #37896.Generated by Claude Code