Repository navigation
feat(console): a refusal that names several reasons lists every one in its alert box - #37538
Conversation
…n its alert box The /actions door answers each reason's sentence on error.details.refusals. The core response reader and the server action handler carry the list on ActionResult.refusals, the param dialog hands it to RefusalMessage, and RefusalMessage lists every reason in order, then the closing sentence read from the text, with no More toggle. A refusal without a list renders as before. Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 7556f52 · 2026-11-26T11:55Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Inputs: card #37403 (body and all 7 comments, including claim 7188742050, os-dev-report 7191297031 and claim amendment 7191329678), PR #37538 body, the net diff ① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
…e.refusals The changeset now reads Clause-②: yes (widening): @object-ui/types gains ActionRefusalLine and ActionResult.refusals, and @object-ui/core gains ActionResponseOutcome.refusals. All three packages still ship patch. The refusalLines jsdoc now says it applies the element rule of the server's reader, and that it does not re-check the server's userMessage condition. Claude-Session: https://claude.ai/code/session_01Utp6Ca6EBDpTBZk8v46Jjv Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head e0d4fdd · 2026-11-26T12:51Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Delta round 1 against record 7191427569 (head
① Derived judgments
② Semver level
③ Boundary flags
Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X
Landing on seat ACCEPT 7192606088, which sits on the same-head delta PASS 7192595998. The maintainer named this PR on the seat thread's decision card: 「合并 #37538」 on 「合并已 ACCEPT 的非受管 PR #37538(操作被拒时逐条列出原因)吗?」, at 12:56Z. Action: ready + auto-merge. Closes #37403 on merge. |
Fixes #37403
Clause-②: yes (widening)
Metadata-protocol: none
The widening:
@object-ui/typesadds the exportActionRefusalLineand the optional memberActionResult.refusals, and@object-ui/coreadds the optional memberActionResponseOutcome.refusals. Nothing is narrowed; every package shipspatch.维护者速读
What changes
Ruling on #36877, term (6), verbatim: "Console: a ui follow-up card under this one renders a multi-line
userMessageas a list in the alert box."/actionsdoor answers a multi-reason refusal's sentences onerror.details.refusals: [{ reason, message }](PR feat(refusals)!: one refusal names several declared reasons, each in the person's language #37395), but the console droppeddetailsbefore the refusal box:interpretActionResponseread onlyfieldsanduserMessage, andActionResulthad no member for the list. NowrefusalLines(ui/packages/core/src/actions/actionResponse.ts) reads the list whole or not at all, by the element rule of the server's reader (declaredRefusalLines): a non-empty list, every element{ reason: string, message: string }. It does not re-check that reader'suserMessagecondition, because it reads only what the server answered.createServerActionHandlerrelays it on the newActionResult.refusals(ui/packages/types/src/ui-action.ts, element typeActionRefusalLine), next touserMessage.ActionParamDialogkeeps the refused run'srefusalswith its text and passes them toRefusalMessageaslines.lines,RefusalMessagerenders one list: every listed reason in order, then the refusal's closing sentence, and no "More" toggle. Following the zone note on the card (7181225232), the reasons come fromdetails.refusalsand are never split out of the text. The closing sentence is not on that list. The server sends it only as the last line of the text, after the reasons joined by line breaks, so it is read from there, and only when the text still starts with exactly those reasons. If the text was cut inside the reasons (the/datadoor cutsuserMessageat 500 characters), every reason is still shown and the closing sentence is left out. Withoutlines, or with an empty list, the component behaves as before.Read first, by risk:
ui/packages/app-shell/src/components/RefusalMessage.tsx:refusalListItems, which picks the closing sentence.ui/packages/core/src/actions/actionResponse.ts:refusalLines, the shape reader.ui/packages/app-shell/src/views/ActionParamDialog.tsx: therefusalLinesstate set next torefusal.Two-minute check:
pnpm --dir ui exec vitest run packages/app-shell/src/components/RefusalMessage.test.tsx. Expect the new(objectstack#37403)describe to pass: three list items in order (two reasons, then "Nothing was submitted."), norefusal-more.Tests
RefusalMessage.test.tsx: a new top-level describe. Multi-reason (every line in order, closing line last, one list, no More). Text cut inside the reasons (both reasons shown from the list, no closing line). CONTROL: a single-sentence refusal with no list renders as text alone. CONTROL: an empty list is no list.ActionParamDialog.refusalKeepsInput-13161.test.tsx: a new top-level describe. A refused run withrefusalslists them in theaction-param-refusalalert box.ui/packages/core/src/actions/__tests__/actionResponse.test.ts:details.refusalscarried in order and copied toreason/message. CONTROL: an absent list, an empty list, a malformed element or a non-list carries none.ui/packages/core/src/actions/__tests__/serverActionHandler.test.ts: the handler relaysrefusalsbesideerroranduserMessage./actionsdoor answer pinned on the server side inaction-refusal-catalogue.test.ts(the[#36877] an action's reasons listdescribe), in English.Ablation (one, on the list branch)
node scripts/ablation-replace.mjsonRefusalMessage.tsx, anchorif (!lines || lines.length === 0) return null;replaced byif (/* ABLATED_37403 */ true) return null;(anchor 1 to 0, blob 10d87495 to 81dba40e): 3 failed / 21 passed. The three failures are the multi-reason case, the cut-text case and the dialog case. The controls stay green. Restored: blob equals HEAD (10d87495),git diff HEADempty. The tests import the component fromsrc/, so no rebuild was needed.Acceptance notes
RefusalMessagefor an action refusal only in the param dialog. An action without params reports its refusal as a toast, which showsuserMessage(the joined lines) and is not part of this card. The/datadoor (record save) does not reachRefusalMessage./actionsdoor, the only door that reaches this box, does not cut.Verification
Rework round 1 (head
e0d4fddd36, changeset and jsdoc only): the changeset declaresClause-②: yes (widening)and namesActionResponseOutcome.refusalsin its "New:" bullet. TherefusalLinesjsdoc now says it applies the element rule of the server'sdeclaredRefusalLinesand does not re-check that rule'suserMessagecondition. Local:check-adr-0087-registration --base origin/main,check-changeset-no-major --base origin/main,check-empty-changeset --base origin/main,check:changeset-gate-self-tests,check:nul-bytesandcheck:closed-ceremony-textall exit 0.actionResponse.test.ts: Test Files 1 passed, Tests 12 passed. The readings below are from head7556f528a1; that round's source is unchanged here.Readings at head
7556f528a1(after mergingorigin/main), under the verify lock:Type-check and tests (local)
pnpm --filter @object-ui/types --filter @object-ui/core build: exit 0.type-checkfor@object-ui/types,@object-ui/coreand@object-ui/app-shell: each exit 0.pnpm --dir ui exec vitest run --maxWorkers=2 packages/types/ packages/core/ packages/app-shell/src/components/RefusalMessage packages/app-shell/src/views/ActionParamDialog packages/app-shell/src/hooks/__tests__/useConsoleActionRuntime: Test Files 687 passed (687), Tests 15780 passed, 27 skipped. Exit 0.@object-ui/app-shellsuite was started but stopped after about 30 minutes holding the shared lock, so only the app-shell files around the refusal box ran locally. CI'sTest UIruns the rest.Derived gates (local)
node scripts/pm/dispatch-gates.mjs --commandsderived 39 families. 38 ran locally, each exit 0 (check:type-check-debtre-run once it got the lock:0 raw tsc error(s) total).--ranreconciliation: 39 derived, 38 run, 1 UNRUN. The UNRUN family ispnpm --dir ui exec vitest run scripts/: it timed out locally behind a sibling's lock, and CI'sTest UIcarries it.node scripts/pm/overlap-check.mjs --branch=HEAD: clean, merges cleanly intoorigin/main.Generated by Claude Code