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. |
…hrow (objectstack-ai#37619) <!-- claude-projects-attribution: {"github_login":"os-sales"} --> _Requested by **Sales** · [project thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuPE7uyDAJyqjwwMzomWv5ff)_ Fixes objectstack-ai#37407 Clause-②: no (published prose only; teaches the list throw already on main) Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:AI 助手照技能文档写钩子或动作时,现在会写「一次拒绝、列出多条原因」的写法,每条原因按用户的语言显示一行,最后一行是总结句。以前文档只教一次一条原因,这个能力在 objectstack-ai#37395 已经上线,文档没跟上。 - 为什么做:objectstack-ai#36877 的裁决要求配套技能文档;5 号座位审核时还留了两条要写进来:一条原因怎么声明,以及总结句里有占位符时要传顶层参数,否则占位处是空的。 - 出错会怎样:只改技能文字,不动产品。两个文件原本都没有余量,为了不变长,同文件里压缩了一些说法,删了一个重复的条件示例和示例里的一个字段,没有删掉事实。写错的话撤回即可。 - 要你做什么:这是受管的技能文件,需要审批人批准后才能合并。 ## What changes `skills/objectstack-data/references/data-hooks.md` and `skills/objectstack-ui/rules/actions.md`, plus a `patch` changeset for `@objectstack/skills`. - **data-hooks.md, Declared refusals:** - The `reasons` bullet says how an entry declares them: a snake_case reason mapped to `{ message }` only, under the code's wire `code` and status; another status needs another code (zone o5-U note N1, comment 7181230894). - The `params` bullet says a reason's holes follow the same rule. - A new bullet teaches the list throw, `reasons: [{ reason, params? }, …]` instead of `reason`: one translated line each, filled from its own `params`; `userMessage` joins them by newlines and ends with the entry's `message`, filled from the throw's top-level `params`, else its holes are empty (note N3); the HTTP doors answer `details.refusals: [{ reason, message }]`, absent for a single `reason` (the MCP tool gives the lines as text beside its envelope, so the page does not say every door). - The last bullet adds that a listed reason is judged even under a code that declares no `reasons`, and that a `reasons` that is not a non-empty list of `{ reason, params? }`, or one beside `reason`, is a `500`. - **actions.md, Refusing by code:** one sentence with the shape: "For several reasons throw `reasons: [{ reason, params? }, …]`, not `reason`: `userMessage` is one line per reason, closed by the code's `message` (rules there)." The rules stay a pointer to the hook section. - **Paid in the same files.** Both sat at zero token headroom, so every added byte is paid for nearby; net −13 lines. Removed: the third ("Complex conditions") `condition` example, two comments that restated the condition below them, `annual_revenue` from the insert `input` sample, the "lifecycle events organized by operation type" lead-in. The rest is tightened wording (data-hooks: What Are Hooks, `defineHook`, `has()`, `filter:`, `findOne`, unpredicated `find`, capabilities lead-in, `ctx.log`, `HookContext` note, `ctx.input`; actions: shorter example strings and one `params` array on one line). No other file pins any shortened string. Checked against `packages/runtime/src/sandbox/hook-refusal-catalogue.ts`, `quickjs-runner.ts` and `packages/spec/src/data/declared-entry.zod.ts` on `main`: the join order and closing line, top-level `params` filling the closing `message`, `details.refusals` only on a list throw, a listed reason judged under every code, `{ message }` as the reason value. Small calls made here (no card): - The list form is shown inline in a bullet, not as a second throw in the example, to fit the byte budget. The assignment form (`e.reasons = [...]; throw e`) is not taught; the object-literal throw is the one the page already uses. - The three list faults are written as run-time `500`s: the source detects them in the runner, not at save. - actions.md describes `userMessage`, not how the console toast renders its newlines, which was not traced. The console's param-dialog listing of reasons (objectstack-ai#37538) is not taught here. ## Why PR objectstack-ai#37395 (objectstack-ai#36877) let one throw carry several declared reasons. Its `Skills-docs:` line points here: both pages taught the single `reason` form only, so an agent writing a hook or action that refuses a selection for several reasons had no pointer to the list. ## Verification Run at `19b5b425d` (contract-review fixes; `f0fd20d1e` before), each exit 0: - `node scripts/check-skills-token-ratchet.mjs`: both files within their ceilings (data-hooks.md 10122/10122, actions.md 3880/3880). - `node scripts/check-skill-links.mjs`, `node scripts/check-skill-identifier-liveness.mjs`, `node scripts/check-skill-top-level-keys.mjs`. - `pnpm --filter @objectstack/spec check:skill-refs`, `check:skill-docs`. - `pnpm --filter @objectstack/spec check:skill-examples` (after building spec, client and client-react): 352 prose examples type-check, the edited `os:check` blocks included. - `node scripts/pm/overlap-check.mjs`: clean. The edits were drafted by a contract-tier subagent, as `dispatch-gates --tier` requires for `skills/**`, and reviewed here (one claim narrowed). The contract-review fixes (S1, N1, N3 of 7197638051) were drafted the same way; the extra bytes in actions.md are paid by wording-only tightenings in the same file. Contract review (L2) is owed before landing: `skills/**` is a governed surface (Tier H). ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. - [x] 2. Every name I added uses the casing for its kind. - [x] 3. No formatter ran; `pnpm lint` passes. - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed (not touched). - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj --- _Generated by [Claude Code](https://claude.ai/code/session_01L6bhgUpnvPnJ1hR74pUrVj)_ <!-- signed: repo:objectstack#2 · os-sales · session_01L6bhgUpnvPnJ1hR74pUrVj --> --------- Co-authored-by: Claude <noreply@anthropic.com>
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