Skip to content

feat(refusals)!: one refusal names several declared reasons, each in the person's language - #37395

Merged
os-zhuang merged 7 commits into
mainfrom
claude/project-thread-t35ilq
Nov 26, 2026
Merged

os-zhuang merged 7 commits into
mainfrom
claude/project-thread-t35ilq

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Bill · project thread

Fixes #36877

Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up #37407

维护者速读

  • 用户能看到什么变化:批量操作(如 HotCRM 的「提交报销」)一次拒绝多条记录时,每条原因都按用户的语言逐行显示,最后一行是总结句。
  • 为什么做:拒绝语目录原来一次只能回一句,中文界面下只能给用户看英文清单;HotCRM 的报销提交卡在这里。
  • 出错会怎样:只影响声明了拒绝语目录、并且一次抛出多条原因的钩子和动作;写错的原因会在保存或运行时被明确拒绝,不会把未翻译的英文漏给用户。
  • 破坏性:这是一次收窄。旧版本里被忽略的 reasons 键现在会被读取,三种原来能保存、能运行的写法现在会被拒绝(见下方 Narrowing)。changeset 带 BREAKING 标注、迁移说明和 ADR-0087 登记。
  • 要你做什么:无(入队前的批准由席位安排)。

What changes

Ruling 7178348458 (option A, 「A 一次抛多条原因逐行翻译」), executed term by term:

  • (1) Throw shape. A hook or script action body may throw { code, reasons: [{ reason, params? }, …] } beside the existing single reason/params form. One reader, refusalAddressFrom (packages/runtime/src/sandbox/quickjs-runner.ts), reads the address for both run paths: the VM's __errorInfo channel now also carries reasons (JSON-cloned like params) and whether the key was present. A reason beside a reasons list, an empty list, or a list that is not { reason, params? } elements is a listProblem, which is the loud fault.
  • (2) Every listed reason checked. declaredAnswer (hook-refusal-catalogue.ts) checks each listed reason against the entry's reasons. One undeclared reason makes the whole throw the 500 fault naming the hook or action, the code and the reason (the existing undeclared…ReasonAtRun sentence). Under a code with no reasons, every listed reason is undeclared. At save, hookRefusalReasonsThrownIn already read reason: 'x' inside an inline list (the regex is unanchored within the throw statement); it now marks such pairs listed: true when the reasons: [ list is a direct member of the thrown object literal (the one key the run reads, so a params: { reasons: [ … ] } stays the body's own data), and also reads the assignment form e.reasons = [{ reason: 'x' }]; throw e. Both save checks (HookSchema, ActionSchema) judge a listed pair through one predicate, isUndeclaredThrownReason: a single reason is still read only under a code that declares reasons, as before; a listed one under every code.
  • (3) Rendering and wire. Each line is that reason's sentence, translated and filled from its own params through the existing ownerRefusalMessage. userMessage is the lines joined by \n, then the entry's own message as the last line (holes from the throw's top-level params). The rendered lines ride the SandboxError as refusals, and every door answers them as details.refusals: [{ reason, message }]: one shape reader, declaredRefusalLines (packages/types/src/thrown-http-error.ts, the candidates precedent), read by resolveThrownHttpError (the /actions door, MCP run_action, the dispatcher) and by mapDataError's userMessage rider (the /data door). The VM never sets refusals: only the catalogue does, so a body cannot hand the wire a list it did not render.
  • (4) Parity. The in-process hook handler reads its throw through the same refusalAddressFrom and builds the same error shape (code, status, userMessage, refusals), so the two paths answer byte-identically (pinned below).
  • (5) The catalogue entry schema and the translation keys are unchanged. The ruling's two declaration lines (yes / added) rested on "nothing accepted today is refused"; the diff falsifies that premise, so the PR declares the narrowing instead (contract review M1; zone order, on the seat's recommendation, with the fork on Bill's decision card). If Bill keeps term 5's lines, only the declaration lines, the BREAKING banner, the migration and the semantic entry come out.

Narrowing (declared)

Three sources that save and run on main are refused at this head:

  1. A literal throw { code: 'X', reasons: [{ reason: 'y' }] } where X declares no reasons: refused at save at body.source (main skips every reason under such a code). A literal y under a code that declares reasons without it was already refused.
  2. e.code = 'X'; e.reasons = [{ reason: 'y' }]; throw e with y undeclared: refused at save (main has no reader for the assignment form).
  3. A body that throws a declared code with a reasons property of its own (empty, not a list of { reason, params? }, beside a reason, or naming an undeclared reason): the run answers the loud 500 fault where main answered the declared sentence and status.

The changeset carries the BREAKING banner, the FROM → TO migration for each (declare the reason under the code's reasons, remove the key, or rename the body's own property) and the ADR-0087 disposition registered refusal-reasons-list-literal-judged, a new semantic entry (packages/spec/src/migrations/entries/semantic/18.refusal-reasons-list-literal-judged.ts, fence amendment 2, comment 7181270799). No mechanical rewrite: whether a reasons key was meant as the list or as the body's own data is the author's call.

The surface was widened by the zone before the edit (claim amendment 7179332961) to packages/types/src/thrown-http-error.ts and packages/types/src/data-error-classification.ts: each door builds details from a closed set of fields read there, so term (3) could not reach the wire from packages/runtime/src/sandbox/** alone.

Tests

  • packages/runtime/src/sandbox/hook-refusal-catalogue.test.ts: the body path (en and zh-CN lines, per-line params, closing line, details.refusals on /data and through thrownAnswerOf, the e.reasons = […] form); seven fault cases (undeclared listed reason, listed reason under a code with no reasons, both forms, empty, element without reason, non-list, list params), each a 500 with no userMessage and no details; the parity pin (body vs in-process handler, JSON.stringify equal on mapDataError and thrownAnswerOf, en and zh-CN) plus the same faults in-process; CONTROL: a single reason carries no details.refusals on either path.
  • packages/runtime/src/sandbox/action-refusal-catalogue.test.ts: through the real /actions door, translated lines plus error.details.refusals, and actionsDoorAnswerOf (the MCP reader) agrees; an undeclared listed reason is the fault naming the action.
  • packages/spec/src/data/hook-refusals.test.ts, packages/spec/src/ui/action-refusals.test.ts: the reader's listed pairs (inline and assignment), what it leaves to run time, the predicate, the save refusal for an undeclared listed reason and for one under a code with no reasons, CONTROL: a single reason under such a code still saves, CONTROL: a reasons list nested under params is not a thrown list (the reader reads it as an unlisted pair, and it saves under a code with no reasons on both the hook and the action check).
  • packages/types/src/thrown-http-error.test.ts: declaredRefusalLines shape reading (five no-list cases, copies only reason/message) and both door compositions.
Package suites and typecheck (local)
  • pnpm --filter @objectstack/types test: Test Files 41 passed, Tests 939 passed.
  • pnpm --filter @objectstack/runtime test: Test Files 649 passed, Tests 12051 passed, 25 skipped.
  • pnpm --filter @objectstack/spec test: Test Files 895 passed, Tests 28435 passed, 1 todo.
  • typecheck for @objectstack/types, @objectstack/runtime, @objectstack/spec: exit 0 (lock VERDICT command-exit 0).
  • Re-run after the last source commit (e8d60127): src/sandbox/ of runtime, 46 files / 529 passed, 2 skipped; runtime typecheck exit 0.
Ablation (one, on the behaviour this PR adds)

node scripts/ablation-replace.mjs on hook-refusal-catalogue.ts, the listed-reason check if (!reasons || !Object.prototype.hasOwnProperty.call(reasons, line.reason)) { replaced by if (/* ABLATED_36877 */ false) { (anchor 1 → 0, blob 5f2aba5d → ae48d69f): 3 failed / 50 passed, the three [#36877] undeclared-reason cases on both paths. Restored: blob equals HEAD (5f2aba5d), git diff HEAD empty. The runtime tests import the module from src/, so no rebuild was needed.

Ablation (rework: the direct-member bound)

On hook-refusal-codes.ts, if (!direct) continue; replaced by if (/* ABLATED */ false) continue; (anchor 1): 3 failed / 145 passed in hook-refusals.test.ts + action-refusals.test.ts, exactly the three nested-params controls. Restored from a byte copy; git diff HEAD empty.

Acceptance notes

Verification

Derived gate list (node scripts/pm/dispatch-gates.mjs --commands, 97 commands) run locally:

  • 94 exit 0.
  • pnpm check:dispatcher-error-vocabulary: red on the first run (a refusalError(code) helper read as an unresolved code stamp); fixed in e8d60127 by building the error inline at both sites as before; re-run exit 0.
  • NOT MEASURED, prerequisites of this checkout, not of the diff: node scripts/check-plugin-teardown-shape.mjs --self-test (exit 3, its pinned positive control needs an unshallowed clone; it grades the script, which this PR does not touch); pnpm check:dual-build-cjs-loads (exit 3, needs the whole workspace built; CI's Build Core runs it).
  • pnpm --filter @objectstack/spec check:generated: api-surface/ and export-origins/ were stale (new exports) and are regenerated in this PR; re-check green.

Rework (4031cd56): check-adr-0087-registration --base origin/main ✓ ([BREAKING+bang+clause-②-narrowing+metadata-protocol-narrowed] registered refusal-reasons-list-literal-judged (new here)); check-changeset-no-major, check-empty-changeset, check:changeset-gate-self-tests, check:commit-card-trailers, check:spec-changes, check:upgrade-guide exit 0; src/migrations 201 passed; the two spec refusal suites 148 passed. CI's check-runs are the authority for every family. The (narrowing) arm owes the full dogfood battery on the final head: on 4031cd56, pnpm --filter '@objectstack/dogfood^...' build then, under the lock, pnpm --filter @objectstack/dogfood test (no shard, no path): Test Files 487 passed, 3 skipped; Tests 4128 passed, 68 skipped; exit 0. CI on 4031cd56: 73 runs, success or skipped, none failed.

Two-minute check: pnpm --filter @objectstack/runtime exec vitest run --maxWorkers=2 src/sandbox/hook-refusal-catalogue.test.ts -t 36877 — expect every [#36877] case green, including the parity pin.

Read first: packages/runtime/src/sandbox/hook-refusal-catalogue.ts (declaredAnswer, the list branch), packages/runtime/src/sandbox/quickjs-runner.ts (refusalAddressFrom and the reject handler's new reasons clone), packages/types/src/thrown-http-error.ts (declaredRefusalLines).


Generated by Claude Code

… each translated

A throw may carry an ordered reasons list beside a declared code; each
listed reason renders in the caller's locale, the entry message closes
the answer, and the lines ride details.refusals on every door.

Claude-Session: https://claude.ai/code/session_01Utp6CXvMJTCqCs1b69pCH7
Co-authored-by: Claude <noreply@anthropic.com>
…every door; add its changeset

Claude-Session: https://claude.ai/code/session_01Utp6CXvMJTCqCs1b69pCH7
Co-authored-by: Claude <noreply@anthropic.com>
…he vocabulary scan reads them

Claude-Session: https://claude.ai/code/session_01Utp6CXvMJTCqCs1b69pCH7
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation protocol:data protocol:ui tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

37 anchor(s) derived from 3 changed package(s); no hand-written page names any of them. ⚠️ 2 changed file(s) yielded no anchor (packages/spec/api-surface/data.json, packages/spec/export-origins/data.json), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

What this run could not see
  • 2 changed file(s) yielded no anchor (packages/spec/api-surface/data.json, packages/spec/export-origins/data.json) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: snake_case (literal, 54 pages)
  • 8 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 69 of 252 client-bound route-ledger rows — the other 183 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 183: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 183 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json ecbe854bda8559069fb228eed1a1564000d2f259 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 06bfab95577408f393fd302c84088f2a15297368 — the merge of head 4031cd56165cdf19f5ea293bfd6038ee4b42ed09 into base ecbe854bda8559069fb228eed1a1564000d2f259, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 06bfab95577408f393fd302c84088f2a15297368 && git checkout 06bfab95577408f393fd302c84088f2a15297368
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin ecbe854bda8559069fb228eed1a1564000d2f259 4031cd56165cdf19f5ea293bfd6038ee4b42ed09 && git checkout -B drift-repro ecbe854bda8559069fb228eed1a1564000d2f259 && git merge --no-ff 4031cd56165cdf19f5ea293bfd6038ee4b42ed09

node scripts/docs-audit/affected-docs.mjs --json ecbe854bda8559069fb228eed1a1564000d2f259

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head a2558d1 · 2026-11-26T02:42Z

The seat runs the at-tier contract review of this head through an isolated sub-agent; L1 is the seat's own.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: a2558d1890ebe6f8769ae36a1645fb82b25319b1
Local-runs: none
Scope: packages/spec/src/data/hook-refusal-codes.ts, packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts + packages/runtime/src/sandbox/hook-refusal-catalogue.ts, packages/runtime/src/sandbox/quickjs-runner.ts, packages/types/src/thrown-http-error.ts, packages/types/src/data-error-classification.ts, packages/spec/api-surface/data.json, packages/spec/export-origins/data.json, .changeset/36877-refusal-reasons-list.md
Security-touching: yes
Rule-change-verified: none

PR #37395, card #36877, ruling 7178348458 (option A). Read: the card body and all seven comments, the PR body, the net diff against main (15 files, +847/−55), the check-runs on the head. Nothing was built or run; the save-reader findings below are read from the source of the diff and of main.

① Derived judgments

Ruling terms, one by one:

  • Term 1 (throw shape, both forms ⇒ fault): right. refusalAddressFrom reads reasons only when the key is present, and a reason beside it is listProblem: 'both', which declaredAnswer turns into the fault before anything renders.
  • Term 2 (every listed reason checked; undeclared literal refused at save; undeclared at run ⇒ the 500 fault naming it): right at run. At save it is met, and it is also where the accept set shrinks (M1) and where the reader over-reads (S2).
  • Term 3 (per-line render, userMessage joined by a line break with the entry's sentence last, details.refusals: [{ reason, message }]): right on both doors. One sentence of the changeset overstates it (S3).
  • Term 4 (one resolver, byte-identical on both run paths): right. Both paths go through refusalAddressFrom and declaredAnswer; the pin compares JSON.stringify of mapDataError and of thrownAnswerOf for the default locale and zh-CN.
  • Term 5 (catalogue schema and translation keys unchanged; Clause-②: yes, Metadata-protocol: added): the schema and keys are unchanged, right. The two declaration lines copy the ruling, and the diff does not bear them out (M1).
  • Term 6 (console): out of this PR, carried by 控制台:一次拒绝带多条原因时,提示框逐行列出全部原因(接 #36877) #37403.

Accept-set and public-surface changes the diff implies:

  • Widened, right: a body may throw { code, reasons: [{ reason, params? }] }; the wire gains details.refusals.
  • Public surface added, right: @objectstack/spec data exports isUndeclaredThrownReason, unreadableHookRefusalListAtRun, unreadableActionRefusalListAtRun, HookRefusalThrownReason, RefusalListProblem; the five rows in api-surface/data.json and export-origins/data.json match them. hookRefusalReasonsThrownIn now returns HookRefusalThrownReason[] (an optional listed added; compatible for a reader of code and reason). @objectstack/types adds declaredRefusalLines and DeclaredRefusalLine. @objectstack/runtime adds no package export; SandboxError gains an optional refusals.
  • Narrowed at save, declared wrong: HookSchema and ActionSchema now refuse sources that parse on main (M1).
  • Changed at run, declared wrong: under a declared code, a thrown reasons key that main ignores (the card's probe table: "ignored — the entry sentence, once") is now answered as a list, or is the 500 fault when it is empty, not a list, not { reason, params? } elements, or beside a reason (M1).

Gates the PR says were not measured locally, read off the head's check-runs:

  • check:dual-build-cjs-loads: Build Core success; its step "Every published require entry point actually loads" concluded success.
  • check-plugin-teardown-shape --self-test: Lint · CI, release & engine gates success; its step "Plugin teardown-shape gate" concluded success (the step is continue-on-error, so the step conclusion was read, not the job's alone).
  • All other runs on the head: success or skipped, none failed. Check Changeset, Auto Label, Check PR Size and PR-body guards each appear twice; the newer run of each governs and reads success, except Auto Label and Check PR Size, whose newer runs are skipped.

② Semver level

minor on @objectstack/spec, @objectstack/runtime and @objectstack/types is the right level for either kind (added or narrowed both take at least minor). The level stands. The declaration lines do not:

M1 (must-fix) — The diff narrows what an author can write, and neither the PR body nor the changeset declares it. By AGENTS.md Post-Task Checklist step 3, "a value refused or a requirement tightened is narrowed", and several kinds resolve "narrowed over semantic over added"; by scripts/pm/clause2-line.mjs, yes (narrowing) is "a diff that widens one surface and narrows another". Three inputs that parse on main are refused at this head:

  1. throw { code: 'X', reasons: [{ reason: 'y' }] } where X declares no reasons. On main the save check skips every reason under such a code (if (!reasons || …) continue). The PR's own tests pin the new refusal (action-refusals.test.ts, "refuses a listed reason under a code that declares no reasons").
  2. e.code = 'X'; e.reasons = [{ reason: 'y' }]; throw e with y undeclared. main has no reader for the assignment form.
  3. The over-read in S2.
    At run, a body that carries a reasons key beside a declared code for any purpose of its own gets a 500 where main answers the declared sentence with its declared status.
    The ruling's term 5 took its two lines from the analysis (7178064820, "Protocol"), which rests them on "nothing accepted today is refused". The diff makes that sentence false, and the PR body says so itself ("Nothing that saves today is refused unless …"). The ruling's premise clause sends a failed premise back as a fork; it does not let the seat or this review keep the line. That the refused shapes were never answered as written is an argument for the ADR-0087 disposition, not for leaving the arm off: the arm exists ([finding] An accept-set narrowing owes a **BREAKING** banner in core but not in platform-objects — and the ADR-0087 classifier reads the banner #16421) because an undeclared narrowing passes every gate.
    Two ways to clear it, both outside this review:
  • Declare it: Clause-②: yes (narrowing) and Metadata-protocol: narrowed at a line's lead in the PR body and the changeset. The arm then owes: a BREAKING banner in the changeset; exactly one ADR-0087 disposition marker there (on a declared narrowing the no-migration-prescription category is refused, check-adr-0087-registration: a changeset declaring Metadata-protocol: narrowed can still take not-required (no-migration-prescription), so a narrowing ships with no upgrade-guide entry (#32345 item 2) #32601); the migration note (FROM a literal reasons list naming a reason the code does not declare, TO declaring the reason under the code's reasons or removing the key; and for the run side, renaming a body's own reasons property); the full dogfood battery pinned to the head in the os-dev-report (it reads "n/a" today, and --land refuses the arm without it); and at the queue, an authorized approval plus a PASS record on this head.
  • Or the maintainer rules, on this question in words, that term 5's lines stand although the save and run sides refuse what main accepts.

③ Boundary flags

  • Open question in the os-dev-report (bare yes or yes (narrowing)): answered. It is a narrowing by the letter of step 3; the dev's option A is not open to the seat, because the ruling's line rests on a premise the diff falsifies. Escalate to the maintainer or declare (M1).
  • Metadata-protocol: added against narrowed: narrowed. The run-side change alone would be semantic; the save-side refusals make it narrowed, which outranks both.
  • Wire shape of details.refusals, security: no leak found. Each element is copied to exactly reason and message. reason is a key the catalogue declares (checked with hasOwnProperty, so no prototype name passes); message is a sentence already inside userMessage. The thrown error's own message stays off the wire (pinned: "internal detail" absent). The VM channel cannot set refusals; only declaredAnswer does. A faulted list answers 500 with no userMessage and no details (pinned, seven cases). Two things to know, neither a leak: declaredRefusalLines recognises by shape, so an in-process handler on a hook with no catalogue that throws userMessage plus a refusals list reaches the wire (host code, which can already set userMessage); and details.refusals has no bound on line count or length where /data bounds userMessage at 500 (that bound is documented as not a leak defence, rest-server 的 4xx 直通把 ≥500 字符的 message 整条换成 "Request failed" —— #5368 刚写好的过滤器拒收措辞,客户端一个字也收不到(实测) #5423).
  • en and zh-CN parity pin: adequate. Body path pinned in both locales with exact strings; the two-path pin is JSON-equal in the default locale and zh-CN on both door compositions; the /actions door is pinned in zh-CN with details.refusals, and the MCP reader agrees. The parity case asserts equality, not content, but the body-path cases beside it pin the content.
  • MCP rendering of details (analysis gap c): not measured, and the report names no carrier. N2.
  • SQL push-down: not applicable; the diff adds no query, id materialisation or in-app join.
  • The brief file handed to this review is the unfilled template (placeholders for the PR, the card and the head; tier TIER_DEFAULT). The head, card and tier were taken from the dispatch and the PR's committed tree, which touches published schema, so the served tier is the contract one.

④ Design judgment

packages/spec/src/data/hook-refusal-codes.ts

S2 (should-fix) — The save reader marks a reason listed wherever reasons: [ appears in the throw statement, at any depth (REASONS_LIST_PROPERTY has no depth check; listedSpans takes every match). throw { code: 'X', params: { reasons: [{ reason: 'late' }] } } under a code that declares no reasons is refused at save, yet at run it is not a list throw at all (the address reads the top-level key only) and is answered as on main. The save refuses what the run answers. Read the list only as a direct member of the thrown object literal, and pin the nested case as a control.

S1 (should-fix) — Two docblocks in the reviewed files now say the opposite of the code. hook-refusal-codes.ts, on HOOK_REFUSAL_REASON_PATTERN: "A reason never reaches the wire — the code does"; details.refusals[].reason now carries it. hook.zod.ts, the block above the refusals check: "under a code that declares none, a thrown reason is not read at all, as before"; a listed reason is now read under every code. The inline comment at the check was updated; the block was not.

Otherwise the file holds against the ruling: one predicate (isUndeclaredThrownReason) serves both save checks, a single reason keeps main's reading, and what cannot be read literally is left to the run.

packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts: the two checks are the same four lines through the one predicate; the refusal sentence lists none under a code with no reasons. Right, subject to M1 and S1.

Implementing files:

  • hook-refusal-catalogue.ts, quickjs-runner.ts: agree with terms 1 to 4. The list is all-or-nothing; no line renders before every reason is checked.
  • thrown-http-error.ts, data-error-classification.ts: one reader for both doors; details is merged, not replaced.

S3 (should-fix) — The changeset and the PR's acceptance note say details.refusals "keeps every sentence whole" and that a long list "loses nothing". The closing sentence (the entry's own message) is not in details.refusals; it lives only as the last line of userMessage, which /data cuts at 500 characters, so on a hook refusal with a long list the closing line is the first thing lost and is nowhere else on the wire. The shape is the ruling's and stays; correct the sentence, and tell #37403 that the console must take the lines from details.refusals and cannot rely on the closing line on /data.

N1 (nit) — declared-entry.zod.ts's reasons describe still teaches only { code, reason }. Term 5 keeps the schema file unchanged, so the list form is taught nowhere an author reads until #37407 lands.

N2 (nit) — Analysis gap (c), whether the MCP tool result renders details, has no carrier; file one or name it under #37403.

N3 (nit) — The closing line renders with empty holes when the throw gives no top-level params (pinned as Nothing was submitted ( selected).). It is today's behaviour for a single sentence; #37407 should teach it.

Implemented-by: claude/project-thread-t35ilq
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: FAIL

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

席位核对

Head-sha: a2558d1890
REWORK — L1, seat repo:objectstack#5. Contract record 7181155005 reads FAIL on one must-fix, the declaration lines. Its three should-fix findings are owed in this PR. The implementation meets ruling terms 1–4, and nothing leaks on the wire.

  1. Shape: open draft against main, 15 files (+847/−55), Fixes #36877. l1-face CLEAN.
  2. M1 goes to the maintainer as a fork, per the ruling's premise clause. Ruling term 5 (7178348458) fixes the declaration as Clause-②: yes and Metadata-protocol: added. Its premise was that nothing accepted today is refused, and the diff falsifies that:
    • (b) a literal list under a code that declares no reasons, and the e.reasons = [...] assignment form with an undeclared reason, both parse on main and are refused at save at this head;
    • (a) a reasons key beside a declared code now faults when malformed.
      Under AGENTS.md step 3 that is narrowed. The seat recommends declaring it: Clause-②: yes (narrowing) and Metadata-protocol: narrowed. The arm then owes:
    • a BREAKING banner;
    • exactly one ADR-0087 marker;
    • a FROM → TO note;
    • dogfood_battery on the final head;
    • the human hand-off at the queue.
      The seat has asked the maintainer. The area proceeds on the recommendation, and the work is undone if the maintainer instead keeps term 5's lines.
  3. Owed in this PR regardless of M1:
    • S1: two docblocks now contradict the code. hook-refusal-codes.ts says "A reason never reaches the wire", and hook.zod.ts says a reason under a code with no reasons "is not read at all, as before". Bring both up to date.
    • S2: the save reader takes reasons: [ at any depth of the throw as a list. throw { code, params: { reasons: [...] } } under a code with no reasons is refused at save, yet at run it is not a list throw. Bound the read to the throw object's top level, pinned by a test.
    • S3: the claim that "details.refusals keeps every sentence whole" is false on a long refusal. The closing sentence lives only in userMessage, which /data cuts at 500 characters. Correct the sentence in the changeset and the PR body, and tell 控制台:一次拒绝带多条原因时,提示框逐行列出全部原因(接 #36877) #37403.
      The same reviewer reads the delta.
  4. Accepted deviations: contract nits N1 (the reasons describe teaches only the single form until skills: data hooks and actions teach the multi-reason refusal throw (after #36877) #37407), N2 (MCP rendering of details has no carrier; the area files one) and N3 (empty holes with no top-level params; skills: data hooks and actions teach the multi-reason refusal throw (after #36877) #37407 teaches it).
  5. Out of scope and where it went: Skills-docs is skills: data hooks and actions teach the multi-reason refusal throw (after #36877) #37407. The console half is 控制台:一次拒绝带多条原因时,提示框逐行列出全部原因(接 #36877) #37403.
  6. Landing terms: a same-head at-tier PASS with M1 settled and S1–S3 closed is owed, then ACCEPT. If declared a narrowing, the PR goes to the human hand-off.

…declare the narrowing it brings

The save reader now takes a `reasons: [` list only when it is a direct
member of the thrown object literal, the one key the run reads; a list
nested under `params` is the body's own data, as before (control pins on
both save checks). Two docblocks now say what the code does: a reason
reaches the wire as the label of a rendered line, and a listed reason is
read under every code.

The changeset declares the narrowing (`Clause-②: yes (narrowing)`,
`Metadata-protocol: narrowed`) with its BREAKING banner, the FROM → TO
migration for the three sources now refused, and the ADR-0087 semantic
entry it registers. It no longer claims `details.refusals` keeps every
sentence: the closing line is only on `userMessage`, which `/data` bounds.

Claude-Session: https://claude.ai/code/session_01Utp6CXvMJTCqCs1b69pCH7
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/xl and removed size/l labels Nov 26, 2026
@objectstack-fleet objectstack-fleet Bot changed the title feat(refusals): one refusal names several declared reasons, each in the person's language feat(refusals)!: one refusal names several declared reasons, each in the person's language Nov 26, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 4031cd56165cdf19f5ea293bfd6038ee4b42ed09
Local-runs: none
Scope: packages/spec/src/data/hook-refusal-codes.ts, packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts, packages/spec/src/migrations/entries/semantic/18.refusal-reasons-list-literal-judged.ts + packages/runtime/src/sandbox/hook-refusal-catalogue.ts, packages/runtime/src/sandbox/quickjs-runner.ts, packages/types/src/thrown-http-error.ts, packages/types/src/data-error-classification.ts, packages/spec/api-surface/data.json, packages/spec/export-origins/data.json, .changeset/36877-refusal-reasons-list.md
Security-touching: yes
Rule-change-verified: none

Delta review of PR #37395 (card #36877), rework round 1. The earlier record read FAIL at a2558d18. Read this round: the delta between that head and this one (7 files, +133/−20), the PR body, the card comments since the first report (fence amendment 7181270799, report 7181853836), the note on #37403 (7181225232), card #37416, and the check-runs on this head. Nothing was built or run; the reader findings are read from the source.

① Derived judgments

② Semver level

The declaration is right. Clause-②: yes (narrowing) and Metadata-protocol: narrowed lead a line in both the PR body and the changeset; the PR title and the changeset title carry !; minor on the three packages is the level a narrowed kind takes.

What the arm owes, each checked:

  • BREAKING banner: present in the changeset, naming the widening and the narrowing apart.
  • ADR-0087 disposition: exactly one marker, registered refusal-reasons-list-literal-judged, backed by the new semantic entry. registered is a category a declared narrowing may hold (check-adr-0087-registration: a changeset declaring Metadata-protocol: narrowed can still take not-required (no-migration-prescription), so a narrowing ships with no upgrade-guide entry (#32345 item 2) #32601). The entry's surface, replacement, reason and acceptanceCriteria describe the three shapes as the code refuses them, and say there is no mechanical rewrite, which is true: the reader cannot tell a list from a body's own property. The file was fenced in before the edit (amendment 7181270799).
  • Migration note: a FROM → TO table of the three shapes with where each is refused, plus the one-line fix. Complete against the code: the two save refusals, and the run fault for an empty list, a non-list, a list beside a reason, or an undeclared listed reason.
  • Dogfood battery: report 7181853836 pins the full battery to this head (487 files passed, exit 0, no shard, no path).
  • Skills-docs: follow-up #37407: present.

③ Boundary flags

  • The maintainer has not answered the fork (declare the narrowing, or keep ruling term 5's yes / added). This record judges the declaration as written on this head, and it is the correct reading of the diff. It does not choose for him. If he keeps term 5 and the lines come out, that is a new head and this record does not cover it.
  • Tier: yes, this now lands like Tier H. Metadata-protocol: narrowed and the (narrowing) arm are each a declared narrowing to the queue guard's fifth leg (governance: the guard scripts join the governed register, .claude/** lands by declared rule-change, and a narrowed spec change lands only by the maintainer #35321), which refuses the PR until both halves are on record: an authorized APPROVED review (or the maintainer's own enqueue) and a PASS record on the current head. The approval is also where the maintainer answers the fork; whoever approves should know the declaration departs from term 5's literal lines.
  • Report open_questions: empty this round. The earlier one is answered by the declaration and escalated by the decision card.
  • Security: nothing new. The delta changes a save reader, docblocks, the changeset and a migration entry; the wire shape judged in the first record is untouched.
  • SQL push-down: not applicable; no query in the delta.

④ Design judgment

packages/spec/src/data/hook-refusal-codes.ts: the direct-member bound holds against the run-time address, which reads the top-level reasons key only. Right.

N4 (nit) — One level down the same class remains: a reason: 'x' literal anywhere inside a listed element counts as listed, so reasons: [{ reason: 'a', params: { reason: 'free_text' } }] judges free_text as a listed reason, while the run treats it as a param. It needs a param literally named reason holding a snake_case literal, and main already reads params: { reason: 'x' } the same way beside a single reason, so it is the reader's standing limit and not new ground. Worth one line in #37407.

packages/spec/src/data/hook.zod.ts, packages/spec/src/ui/action.zod.ts: unchanged in behaviour this round; the docblock now agrees with the check.

packages/spec/src/migrations/entries/semantic/18.refusal-reasons-list-literal-judged.ts: agrees with the code and with the changeset's table. The 18. prefix follows the entries beside it; the fence amendment already notes it must follow main if #37314 moves the protocol version first.

packages/types/src/data-error-classification.ts: docblock only; now accurate.

N5 (nit) — The note left on #37403 (7181225232) says details.refusals "carries every line whole" and "the entry's closing line still renders last". The closing line is not on details.refusals, so on a cut /data answer the console has nothing to render last. The PR body and changeset say this correctly; the note on #37403 should say it the same way.

Implemented-by: claude/project-thread-t35ilq
Reviewed-by: session_01Utp6CYtTDvfPQDzMbZnN5X

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

维护者速读

  • 改了什么:一条 hook/动作的拒绝(refusal)现在可以列出多个已声明的原因(reasons: [...]),每条按用户语言渲染成一行,放在 details.refusals 里。
  • 为什么:卡 refusals: one throw answers one declared sentence — an action that refuses a selection for several reasons at once cannot list them in the person's language (after #34273) #36877。以前一次拒绝只能报一个原因,多条件同时不满足时用户只看到第一条。
  • 风险:属于收窄。三种以前能保存的写法(空列表、非列表、列表与单个 reason 并存或列了未声明的原因)现在保存或运行时报错,已有 BREAKING 横幅、ADR-0087 标记和迁移表;dogfood 全量在现 head 通过(487 个文件)。注意:裁决第 5 条原文写的是 yes / added,本 PR 改为申报收窄,这个分叉你还没在决策卡上回答。
  • 要你做什么:若同意申报收窄,批准即同时回答了决策卡。若要保留第 5 条,告诉席位,专区只撤回申报行、横幅、迁移和条目文件,复核要在新 head 重做。契约复核 PASS 在评论 7181908508,Head-sha 4031cd56165cdf19f5ea293bfd6038ee4b42ed09。

席位意见:ACCEPT,建议申报收窄。代码确实拒收这三种写法,只写 added 会掩盖破坏性变更;收窄仪式齐全,复核找不到误拒。

席位核对

Head-sha: 4031cd56165cdf19f5ea293bfd6038ee4b42ed09
ACCEPT — L1, seat repo:objectstack#5

  1. Shape: open draft against main, 16 files (+965/−60), ! title, Clause-②: yes (narrowing), Metadata-protocol: narrowed. The rework since a2558d18 is 7 files (+133/−20). l1-face flags only dogfood, which is met: card comment 7181853836 records the full battery on this head (487 files passed, exit 0).
  2. Rework closed (delta contract record 7181908508): M1 (the narrowing is declared, with banner, one registered refusal-reasons-list-literal-judged marker backed by its semantic entry under fence amendment 7181270799, and a FROM → TO table of the three shapes), S1 (both docblocks match the code), S2 (reasons: [ is read only as a direct member of the thrown object; three nested-params controls, ablation-checked), S3 (closing-line sentence corrected; 控制台:一次拒绝带多条原因时,提示框逐行列出全部原因(接 #36877) #37403 told in 7181225232), N2 (carrier MCP:一次拒绝带多条原因时,把 details.refusals 逐条转给智能体(接 #36877) #37416).
  3. Gates: check-runs at 4031cd5616: 62 success, 15 expected skip, 0 failed. Dogfood Regression Gate and Governed Surface Queue Guard read success.
  4. Accepted deviations: contract nits N1, N3 and N4 (the reader's standing limit on a reason nested inside a listed element's params) all carried by skills: data hooks and actions teach the multi-reason refusal throw (after #36877) #37407. N5: the note on 控制台:一次拒绝带多条原因时,提示框逐行列出全部原因(接 #36877) #37403 still says the closing line renders on details.refusals; the area corrects that note to match the PR body (comment only, not a code change).
  5. Out of scope and where it went: skills docs to skills: data hooks and actions teach the multi-reason refusal throw (after #36877) #37407; the N2 item to MCP:一次拒绝带多条原因时,把 details.refusals 逐条转给智能体(接 #36877) #37416.
  6. Landing terms: Tier H by the declared-narrowing leg. L2 at CONTRACT_REVIEW_TIER: PASS, comment 7181908508, same head, no must-fix, no should-fix. Security-touching: yes. Waits for the approver, and the approval answers the open fork on ruling term 5 (decision card in the seat thread). If term 5 is kept, the reverted head needs a new record. After approval the seat lands it.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Approval requested (declared narrowing: Clause-②: yes (narrowing), Metadata-protocol: narrowed; this departs from ruling term 5's literal added, so the approval also answers that fork). Seat ACCEPT: comment 7181921852. Contract review PASS at CONTRACT_REVIEW_TIER: comment 7181908508, Head-sha 4031cd56165cdf19f5ea293bfd6038ee4b42ed09. dogfood_battery at this head: card comment 7181853836. After approval the seat lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 26, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 26, 2026 03:41
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 26, 2026
Merged via the queue into main with commit 51b67f1 Nov 26, 2026
87 of 88 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-t35ilq branch November 26, 2026 04:45
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X

Maintainer ruling recorded · 2026-11-26T05:26Z

The fork named in the seat ACCEPT (7181921852) and in the approval request (7181929093) is answered. Who: Bill (os-bill). Where: seat 5's thread, decision card. Words: 「改申报为收窄(narrowed)」, the answer to 「#36877 实现会拒收现有写法,按收窄申报还是维持裁决第5条的「added」?」. The declaration on head 4031cd56165cdf19f5ea293bfd6038ee4b42ed09 (Clause-②: yes (narrowing), Metadata-protocol: narrowed) stands, and nothing reverts. The contract review PASS (7181908508) and the ACCEPT stay current. The PR still waits for the approver's APPROVED review (Tier H, declared narrowing); after approval the seat lands it.

Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…dshake reads '^19' (objectstack-ai#37314)

repo:objectstack#4 · os-justin · session_01QSeKYpEsWWE9Y5YtSsDgqZ
Fixes objectstack-ai#37229
Clause-②: yes (narrowing)
Metadata-protocol: narrowed
Skills-docs: follow-up objectstack-ai#37298

## 维护者速读

- 协议版本从 18 升到 19:仓库里每个示例应用、连接器应用和文档示例都改为声明 19,新建项目模板在出预发布版时自动改成 19;只有装
19 预发布版的人会碰到。
- 属于「19.0.0 大版本」路线(你选的方案「A」第 2 项);它解开 19.0.0-next 的版本
PR:出版本的流水线不接受顺手改协议版本,所以由这一单先改好。
- 装了 19 预发布版、但应用仍声明 18 的人,启动时会被拒绝并提示改成
19(单一配置文件的应用有一条命令可自动改;多包组合的应用要逐个包手改);18.x 正式版用户不受影响;撤回即还原本单。
- 按你对冲突的裁决「A」,本单还改了一道检查:预发布模式下且 spec 已排定大版本时,下架提示写「19.0.0」不再被拦;五条下架提示因此写
19.0.0。
- 要你做的:「进入预发布模式」那一单已合并;本单是大版本变更,请你亲自把关合并。「Check
Changeset」是有意的红:本单改了别人已合并的两条变更说明(各改一处事实)。另一单 objectstack-ai#37298 改三个技能文件,在本单合入之后合并。

## What changes

On the shape of the v18 move (objectstack-ai#22215, commit `4e9fe9f`), minus
`skills/**`.

- **`packages/spec/src/kernel/protocol-version.ts`:** `PROTOCOL_VERSION
= '19.0.0'`. The docblock names protocol 19 as the pre-mode lockstep
exception (ruling records 6049734955 and 7153441862), and says the blank
template follows at the version pass and the published skills' examples
in a change of their own.
- **Handshakes:** 85 sites in 67 files move `engines.protocol` from
`'^18'` to `'^19'`. Each is a manifest that stands for "an app on the
current protocol", and none of them asserts on the range.

| Directory | Files | Sites |
|---|---|---|
| `examples/` (crm, showcase, todo, starter, multi-package ×2) | 6 | 6 |
| `packages/apps/connector-{docusign,github,stripe}` | 3 | 3 |
| `packages/cli` (tests) | 40 | 56 |
| `packages/qa` (7 dogfood tests, the sql-perf bench app, the scenarios
exporter test) | 9 | 9 |
| `packages/lint`, `packages/spec`, `packages/metadata` (tests) | 4 | 5
|
| `packages/mcp/README.md` | 1 | 2 |
| `content/docs` (cli, your-first-project, upgrading) | 3 | 3 |
| `docs/qa/scenarios/builds/travel_expense.json` | 1 | 1 |

`examples/app-starter` arrived from `main` (objectstack-ai#37399) declaring `'^18'`
and moves with the merge. Its boot test, which installs the starter
through `MarketplaceInstallLocalPlugin`, passes 5/5 at `'^19'`. At
`'^18'` it reads 3 failed | 2 passed, refused
`OS_PROTOCOL_INCOMPATIBLE`.

- **`docs/qa/platform-checklist/areas/cli.json`:** one prose fact, "the
stock showcase declares `'^18'`", now reads `'^19'`.
- **`docs/qa/scenarios/builds/travel_expense.provenance.json`:**
`sha256` is the build's hash as it now stands, and a second `amended`
entry names the one edit (`engines.protocol` `'^18'` → `'^19'`) and the
hash it replaced. `cardSha256` is unchanged.
- **The protocol 19 migration step (ADR-0087).**
`packages/spec/src/migrations/registry.ts.template` opens `step19`, with
no conversions yet. Its first semantic entry,
`entries/semantic/19.protocol-18-range-refused.ts`, is the refusal this
PR causes, with the prescription: `--write` rewrites the range of a root
`defineStack` manifest; for a manifest `composeStacks` composes, it
writes nothing and lists the range for a hand edit in each package
manifest. Its acceptance text claims only what the hop does: it edits or
refuses the range. A key retired in this release that the metadata still
carries is refused at parse by its own message, which names its own
remedy. The text no longer says that `validate` passes or that every
package installs. The upgrade guide now generates three hop sections
(17, 18, 19). See "Why a step-19 entry" below.
- **Removal prescriptions stamped after 18.6.0 name `@objectstack/spec
19.0.0`.** `retired-key-removal-version.pin.test.ts` derives the
removing release's major from `PROTOCOL_MAJOR`, so at 19 the retirements
not in the published 18.6.0 name 19.0.0, not 18.7.0, a release the v19
line never cuts: `object-grid` `singleClickEdit` (`component.zod.ts`),
the boolean `field.inlineEdit` (`field.zod.ts`), `listView.columnState`
and `view.columnState` (`view.zod.ts`), and `seed.mode` `'insert'` /
`'replace'` (`seed.zod.ts`). Their text pins, the regenerated
`content/docs/references/ui/{component,view}.mdx`,
`content/docs/data-modeling/seed-data.mdx` and the metadata-protocol
seed pin follow.
- **`scripts/check-future-spec-major.mjs` reads the pre-mode window
(ruling record 7176929521, option A).** On a stable `@objectstack/spec`
label, with `.changeset/pre.json` at `"mode": "pre"` and a pending
changeset declaring `"@objectstack/spec": major`, the next publish is
label + 1, so the gate judges citations against 19 here. That is why the
prescriptions above can name `@objectstack/spec 19.0.0`. The window is
read through `check-changeset-no-major.mjs`'s
`readProtocolLockstepInputs`, the reader the protocol lockstep already
uses; there is no second parser. That file's docblock now names its
three importers (`check-docs-image-tag.mjs`,
`check-future-spec-major.mjs`, `pm/l1-face.mjs`); the change is a
comment. Label + 2, pre mode without a pending spec major, a pending
spec major outside pre mode and a prerelease label each open nothing;
five new self-test rows pin those five cases (34 → 39 cases). An
unreadable `.changeset/` opens nothing either, by the code; no row pins
it. The stable-label condition is the same one `judgeProtocolLockstep`
applies: on a `19.0.0-next.N` label the label's own major is already the
carrier. Reverse verification: with the window condition ablated, the
gate reads 14 problems, the 14 sites.
- **Two fixtures pay a dynamic load at module top**
(`validate-flow-region-shape.test.ts`,
`plugin-artifact-packages-attribution.test.ts`).
`check:test-source-alias` judges every test file a diff edits, and both
edits here are the range literal. The gate prescribes exactly these
imports.
- **`.changeset/37229-protocol-19.md`:** `"@objectstack/spec": minor`
and `"@objectstack/mcp": patch` (its shipped `README.md` changes), the
two declaration lines, a BREAKING note with the FROM → TO and the
command, and `registered protocol-18-range-refused`.
- **DELIBERATE CORRECTION of two existing changesets.** `Check
Changeset` stays red on both by design: each note is on the merge base,
and each changes only the facts this PR makes false.
- `.changeset/37223-v19-line-opens.md` (carried N1 of objectstack-ai#37230's L1, and
N3 of this PR's L1), two sentences. "The first is `@object-ui/i18n`'s
retirement …" now reads "The first change graded `major` is
`@object-ui/i18n`'s retirement …", because this PR's protocol move is a
breaking change graded `minor`. "`PROTOCOL_VERSION` follows
`@objectstack/spec`'s major at version time." now reads
"`PROTOCOL_VERSION` moves to 19 ahead of the version pass, in its own
changeset."
- `.changeset/37042-skills-inline-edit-boolean.md`, one clause: "The
spec parse refuses `true` and `false` on a relationship field's
`inlineEdit` since 18.7.0" now reads "… since 19.0.0", the release the
retirement ships in.
- **Carried from objectstack-ai#37230's L1, N3 —
`ui/packages/i18n/scripts/released-keys-removed.mjs`** refuses an
argument it does not know (exit 2, naming it), and prints the tag's
commit: `^{commit}` peels the annotated tag. Measured: the tag
`@object-ui/i18n@18.6.0` is a tag object `0dbef86ce3`, and the script
now prints its commit `958ee03594`. The script is not in the package's
`files[]`, so it publishes nothing and needs no changeset.

## Judgments: every `'^18'` left in place, with its reason

| Site | Reason |
|---|---|
| `skills/**` (3 files) | Governed Tier H; the sibling PR objectstack-ai#37298. |
|
`packages/create-objectstack/src/templates/blank/objectstack.config.ts:38`
| The version pass stamps it with the template's `@objectstack/*`
versions, and `template-consistency.test.ts` holds it equal to the
scaffolder major (create-objectstack is 18.6.0). Measured: moved to
`'^19'` now, that test goes red; the version-pass rehearsal below stamps
it `'^19'`. Same judgment as objectstack-ai#22215. |
| `packages/cli/src/utils/protocol-version-gap.test.ts:82` | Paired with
an explicit installed `'17.2.0'`: "a newer major is silent". The subject
is the pairing, not the current protocol. |
| `packages/metadata-core/src/artifact-forward-conversion*.test.ts`,
`protocol-handshake.test.ts` | The subject is the artifact's floor
against an injected runtime label (the v18 prerelease major-step
window), or a range/major pair. No handshake against `PROTOCOL_VERSION`
runs. |
|
`packages/metadata/src/plugin-artifact-forward-conversion-{major-step,package-body}.test.ts`
| The same age subject at the metadata door, which runs no handshake. |
| `docs/qa/platform-checklist/areas/platform-core.json`, item
`platform-core.protocol-18-handshake-and-stored-replay` | Revised in
place to protocol 19 (revision 6, with its history entry). The id keeps
its protocol-18 slug because ids are immutable. Its `'^18'` now stands
for the refused case: `'^18'` → 422 `OS_PROTOCOL_INCOMPATIBLE` naming
`os migrate meta --from 18`, `'^19'` admitted, and the artifact step
edits the copy's range to `'>=18.0.0'`, as the option-B fixture does. |
| `content/docs/releases/**`, `docs/adr/**`, `**/CHANGELOG.md`,
`.github/workflows/release.yml` (comment), script comments |
Release-owned, governed or historical prose. |
| `ui/**` tests,
`packages/runtime/src/domains/packages-ensure-customization.test.ts`,
`scripts/docs-audit/affected-docs.mjs` | Not a protocol handshake
(`requiredRange` of a later refusal, a package-dependency range, a React
peer range). |

Moved to `'>=18.0.0'` (5 sites, commit `e05fdf6f`):
`packages/runtime/src/standalone-stack-option-b-forward-conversion.test.ts`.
It boots through the load seam, which refuses `'^18'` at protocol 19.
Measured: `ProtocolIncompatibleError: package 'com.test.ob.core' targets
protocol ^18 … Run: objectstack migrate meta --from 18`, 3 cases. Its
subject is the conversion window, which opens on the floor. `'>=18.0.0'`
keeps the floor (18.0.0, as `parseRangeFloor` reads `^18`) and admits
19. This is the same move as objectstack-ai#22215's two runtime fixtures (`>=17.1.0`).
The fixture's docblock now says why, so a later sweep to `'^19'` does
not close the window.

## Why a step-19 entry (the ADR-0087 disposition)

`Metadata-protocol:` is judged from content. A 19 runtime refuses an
authored value, `engines.protocol: '^18'`, that 18 admitted. That is
`narrowed`, and the `Clause-②` arm is `narrowing`, as in objectstack-ai#22215. On a
declared `narrowed`, `check:adr-0087-registration` refuses `not-required
(no-migration-prescription)` outright and asks for a registered entry.
Measured: "`not-required (no-migration-prescription)` is refused on a
changeset that declares `Metadata-protocol: narrowed` … fix: register an
entry under packages/spec/src/migrations/entries/semantic/". No entry at
the merge base covers the refusal, so this PR opens step 19 with one
entry, and the upgrade guide carries the prescription.

## Acceptance notes

- **Docs versus npm `latest`.** The three docs pages show `'^19'`, as in
objectstack-ai#22215. npm `latest` stays 18.6.0 until 19.0 GA, and an 18.x runtime
refuses `'^19'`. The changeset says to move the range together with the
`@objectstack/*` versions.
- **Size.** 92 files, +440 / −161 against `main` (GitHub at
`3811cd10f5a`), under the 3,000-line threshold.
- **Out of this PR, found by the version-pass rehearsal.** On the
post-version tree, `check:release-notes` is red: `@objectstack/spec`
ships 19.x and there is no curated `content/docs/releases/v19` page. It
is red on the control leg too (main + objectstack-ai#37230, without this PR), so
objectstack-ai#37230's `major` causes it, not this PR. Release pages are
release-owned, so this PR does not write one. Until one exists, the
version-PR lane still refuses the 19.0.0-next refresh, on that gate
alone.
- **objectstack-ai#37287 and step 19.** objectstack-ai#37287 registered its retirement,
`KnowledgeChunk.metadata`, under step 18; it reached this branch through
the merge of `main`, and its refusal says "removed in @objectstack/spec
18" (`packages/spec/src/ai/knowledge-document.zod.ts:61`). Once protocol
19 is on `main`, `os migrate meta --from 18` replays only step 19, so a
retirement that ships on the v19 line and is filed under step 18 is not
listed to an 18 → 19 upgrader. objectstack-ai#37287 is one member of the family
"step-18 entries registered on `main` after the 18.6.0 tag" (31 step-18
semantic entry files at this head that the 18.6.0 tag does not carry,
and 34 on `main` at `5d21d431ec`, after objectstack-ai#37382, objectstack-ai#37392 and objectstack-ai#37395). That
card is follow-up owed (seat).
- **The dev's open questions, as built (seat reading at L1):**
- The declaration is `yes (narrowing)` + `narrowed` with a step-19
entry, rather than `semantic`.
  - The blank template stays `'^18'`, and the version pass stamps it.
- The metadata and metadata-core floor-subject sites are kept. The
option-B runtime file moves to `'>=18.0.0'`.
- The gate conflict between `check-future-spec-major` and the
removal-version pin is resolved by ruling record 7176929521, option A
(above).

## Verification

Two-minute check: `node scripts/check-future-spec-major.mjs` prints `✓
check-future-spec-major: no @objectstack/spec citation names a major
above 19` and `pre-mode window: label major 18, pre mode next, pending
major for @objectstack/spec in .changeset/37223-v19-line-opens.md — the
next publish carries 19`, and exits 0. `node
scripts/check-changeset-no-major.mjs --base origin/main` prints `✓
Protocol lockstep: PROTOCOL_VERSION major 19, @objectstack/spec@18.6.0 —
the one exception, evidenced: pre mode (tag next) and a pending major
for @objectstack/spec (.changeset/37223-v19-line-opens.md).` and exits
0.

Read first:
1. `.changeset/37229-protocol-19.md` and
`packages/spec/src/migrations/entries/semantic/19.protocol-18-range-refused.ts`:
what an upgrading author is told.
2. `packages/spec/src/migrations/registry.ts.template`, the new
`step19`: the ledger's protocol 19 step opens here.
3. `scripts/check-future-spec-major.mjs`, `judgedMajor` and the five new
self-test rows: the one gate this PR changes.
4. The Judgments table: every `'^18'` left in place.

<details><summary>Readings at <code>3811cd10f5a</code> (the dev's,
through the verify lock, and the seat's L1)</summary>

- **CI at `3811cd10f5a`:** 70 check-runs, 60 success, 9 skipped, 1
failure. The failure is `Check Changeset`, by design: its two file
annotations name the two DELIBERATE CORRECTION notes, and its ADR-0087
and no-major steps are green. All eleven required contexts are success,
`Test Core` 10/10 included, and so is `Type Check · source gates`.
- **Tests:**
- dogfood full battery (os-dev-report 7183121949 on objectstack-ai#37229): Test Files
487 passed | 3 skipped (490), Tests 4129 passed | 68 skipped (4197),
VERDICT command-exit 0.
- whole spec suite: Test Files 896 passed (896), Tests 28442 passed | 1
todo (28443).
- `examples/app-starter` boot test: 5/5 (re-run by the seat). With the
range put back to `'^18'` through `ablation-replace`, it reads 3 failed
| 2 passed, refused `OS_PROTOCOL_INCOMPATIBLE`; the restore was proven
with `git diff HEAD` empty.
- `retired-key-removal-version.pin.test.ts` and
`protocol-version.test.ts`: 2 files, 68/68 (re-run by the seat).
- **Guards:**
- `check-future-spec-major` exits 0, and `--self-test` reads `39 cases
pass` (re-run by the seat). The gate file is byte-identical to
`9ed0f5e41f6`, where the seat ablated `stable`, the pending-major
condition, the pre-mode condition and `+ 1` in turn: one self-test row
went red each time, and with the window off the scan read the 14 sites.
Each ablation was restored with `git diff HEAD` empty.
  - `check-changeset-no-major --base origin/main` exits 0.
- `check:adr-0087-registration` exits 0 with `registered
protocol-18-range-refused`.
- `dispatch-gates --commands` derives 150 families on this diff. Two are
red: `check-empty-changeset` by design (the two DELIBERATE CORRECTION
notes), and `check:platform-checklist` on `areas/automation.json: ABSENT
SYMBOL … FlowItemMoreMenu.tsx#FlowItemMoreMenu`, which `main` itself
carries (reproduced on `origin/main` `ecbe854bda`; this diff touches
neither path). The other 148 exit 0.
- **Against current `main` (`5d21d431ec`, 9 commits past the merge
base):** `git merge-tree --write-tree` is clean, and the merged tree
carries the same `'^18'` lines as this head. `main` added no other
handshake at `'^18'`.

</details>

<details><summary>Earlier readings (the dev's, on 9da4c1d plus the
fixture fix, and at 8852bcb for the <code>--write</code>
reach)</summary>

Not re-run at `3811cd10f5a`. Of the code these read, this PR changed
only the step-19 entry's text and the `examples/app-starter` range after
them. The merges of `main` brought other changes in, and CI at the head
is green.

- **Handshake**, from the built `@objectstack/metadata-core` on protocol
19: `'^18'` → `incompatible OS_PROTOCOL_INCOMPATIBLE … Run: objectstack
migrate meta --from 18`; `'^19'` → `ok`.
- **Prescription**, with the built CLI. On a `'^18'` copy of
`examples/app-todo`, `os migrate meta --from 18` lists the step-19
entry, and `--write` rewrites `objectstack.config.ts:48` to `'^19'`. On
`examples/app-multi-package` with both package manifests at `'^18'`,
`--write` writes nothing and prints the range for a hand edit (`manifest
is composed by composeStacks(…)`).
- **Template control leg:** moving the blank template to `'^19'` now
turns `template-consistency.test.ts` red (`expected 19 to be 18`).
- **`release.yml` version-pass rehearsal.** The `version-pr` Render and
Validate blocks were extracted verbatim and run in a throwaway clone:
- Results: `PROTOCOL_VERSION already 19.0.0`; the template is stamped
`'^19'`; unvalidated surfaces 0; 14 of 15 content gates green;
`check:release-notes` red.
- Control (main + objectstack-ai#37230 without this PR): `protocol-version.ts` is
unvalidated, with the same release-notes red.
- **Tests:** cli 677 files, 8441 tests passed; runtime 647 files, 11978
passed | 25 skipped (the option-B file fails 3 cases at 9da4c1d and
passes 6/6 at e05fdf6); metadata, metadata-core, lint, mcp,
create-objectstack, scenarios and the example tests all green;
`validate` exits 0 for 4 examples and 3 connector apps.

</details>

## Provenance

Opened by seat repo:objectstack#4 on the maintainer's authorization in
the seat session (「objectstack-ai#37229 的两个 PR 开 PR 时被拦了:放行」). The dev session
(`session_01QSeKYnLptCbfzwtkTrDG3j`, zone a4-S) had three writes refused
by its permission check, and none was retried: its relay `pr_create`,
the hand-off of the payload to the seat, and the push of the runtime
fixture fix. The seat read the prepared body from that session's final
message. The fixture fix was then re-applied and pushed as `e05fdf6f`
(fast-forward, five sites in one test file) by a seat-dispatched dev, on
the maintainer's authorization 「objectstack-ai#37229 夹具修复推送放行」. Rework round 1 (seat
L1 7170046632) pushed `3fdf3490b9` to `43133e8ce5`. After ruling record
7176929521, `c871272e47` merged `origin/main` `db77cc493a`, `e5a7e35bff`
regenerated the two ui reference pages from the merged tree, and
`9ed0f5e41f` changed the gate. Rework round 2 (seat L1 7181615974, L2
7181629335): `d47c169db75` merged `origin/main` `da7c559990`, and
`3811cd10f5a` moved `examples/app-starter` to `'^19'`, narrowed the
step-19 entry's acceptance text, and corrected a comment in
`check-changeset-no-major.mjs`. Branch
`claude/issue-37229-protocol-version-19` @ `3811cd10f5a`.

---
🤖 Generated with [Claude Code](https://claude.com/claude-code)

https://claude.ai/code/session_01QSeKYpEsWWE9Y5YtSsDgqZ

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…n its alert box (objectstack-ai#37538)

Fixes objectstack-ai#37403

Clause-②: yes (widening)
Metadata-protocol: none

The widening: `@object-ui/types` adds the export `ActionRefusalLine` and
the optional member `ActionResult.refusals`, and `@object-ui/core` adds
the optional member `ActionResponseOutcome.refusals`. Nothing is
narrowed; every package ships `patch`.

## 维护者速读

-
用户能看到什么变化:在控制台的操作弹窗里,一次拒绝带多条原因时,红色提示框逐行列出每一条原因,最后一行是总结句;不再只显示第一句、其余藏在「更多」里。只有一句的拒绝照旧显示。
- 为什么做:接服务端「一次拒绝给出多条已翻译原因」那张卡(多原因拒绝),让批量提交被整体拒绝的用户一眼看到每一条为什么不行。
- 出错会怎样:只影响带多条原因的拒绝提示;最坏是提示框少显示总结句,原因本身仍全部列出;可直接撤回本改动,恢复成「首句 + 更多」。
- 要你做什么:无。

## What changes

Ruling on objectstack-ai#36877, term (6), verbatim: "Console: a ui follow-up card
under this one renders a multi-line `userMessage` as a list in the alert
box."

- **The carrier.** The `/actions` door answers a multi-reason refusal's
sentences on `error.details.refusals: [{ reason, message }]` (PR
objectstack-ai#37395), but the console dropped `details` before the refusal box:
`interpretActionResponse` read only `fields` and `userMessage`, and
`ActionResult` had no member for the list. Now `refusalLines`
(`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's
`userMessage` condition, because it reads only what the server answered.
`createServerActionHandler` relays it on the new `ActionResult.refusals`
(`ui/packages/types/src/ui-action.ts`, element type
`ActionRefusalLine`), next to `userMessage`.
- **The dialog.** `ActionParamDialog` keeps the refused run's `refusals`
with its text and passes them to `RefusalMessage` as `lines`.
- **The box.** With `lines`, `RefusalMessage` renders 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 from `details.refusals` and 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
`/data` door cuts `userMessage` at 500 characters), every reason is
still shown and the closing sentence is left out. Without `lines`, or
with an empty list, the component behaves as before.

Read first, by risk:
1. `ui/packages/app-shell/src/components/RefusalMessage.tsx`:
`refusalListItems`, which picks the closing sentence.
2. `ui/packages/core/src/actions/actionResponse.ts`: `refusalLines`, the
shape reader.
3. `ui/packages/app-shell/src/views/ActionParamDialog.tsx`: the
`refusalLines` state set next to `refusal`.

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."), no `refusal-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 with `refusals` lists them in the
`action-param-refusal` alert box.
- `ui/packages/core/src/actions/__tests__/actionResponse.test.ts`:
`details.refusals` carried in order and copied to `reason`/`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 relays `refusals` beside `error` and `userMessage`.
- The fixture sentences match the `/actions` door answer pinned on the
server side in `action-refusal-catalogue.test.ts` (the `[objectstack-ai#36877] an
action's reasons list` describe), in English.

<details><summary>Ablation (one, on the list branch)</summary>

`node scripts/ablation-replace.mjs` on `RefusalMessage.tsx`, anchor `if
(!lines || lines.length === 0) return null;` replaced by `if (/*
ABLATED_37403 */ true) return null;` (anchor 1 to 0, blob 10d8749 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 (10d8749), `git diff HEAD` empty. The tests
import the component from `src/`, so no rebuild was needed.

</details>

## Acceptance notes

- Reach: today the console renders `RefusalMessage` for an action
refusal only in the param dialog. An action without params reports its
refusal as a toast, which shows `userMessage` (the joined lines) and is
not part of this card. The `/data` door (record save) does not reach
`RefusalMessage`.
- A closing line that the 500-character cut lands inside, after all the
reasons, is shown as the cut text ends, with its ellipsis. The console
cannot tell a cut closing line from one that ends in an ellipsis without
knowing the server's bound. The `/actions` door, the only door that
reaches this box, does not cut.
- The card's pins live in the existing harness files as top-level
describes (AGENTS.md, ruling record 6583487846), not in a new file named
for the card as the claim's file surface said.

## Verification

Rework round 1 (head `e0d4fddd36`, changeset and jsdoc only): the
changeset declares `Clause-②: yes (widening)` and names
`ActionResponseOutcome.refusals` in its "New:" bullet. The
`refusalLines` jsdoc now says it applies the element rule of the
server's `declaredRefusalLines` and does not re-check that rule's
`userMessage` condition. 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-bytes` and
`check:closed-ceremony-text` all exit 0. `actionResponse.test.ts`: Test
Files 1 passed, Tests 12 passed. The readings below are from head
`7556f528a1`; that round's source is unchanged here.

Readings at head `7556f528a1` (after merging `origin/main`), under the
verify lock:

<details><summary>Type-check and tests (local)</summary>

- `pnpm --filter @object-ui/types --filter @object-ui/core build`: exit
0.
- `type-check` for `@object-ui/types`, `@object-ui/core` and
`@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.
- Declared narrowing: the whole `@object-ui/app-shell` suite 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's `Test UI` runs
the rest.

</details>

<details><summary>Derived gates (local)</summary>

`node scripts/pm/dispatch-gates.mjs --commands` derived 39 families. 38
ran locally, each exit 0 (`check:type-check-debt` re-run once it got the
lock: `0 raw tsc error(s) total`). `--ran` reconciliation: 39 derived,
38 run, 1 UNRUN. The UNRUN family is `pnpm --dir ui exec vitest run
scripts/`: it timed out locally behind a sibling's lock, and CI's `Test
UI` carries it. `node scripts/pm/overlap-check.mjs --branch=HEAD`:
clean, merges cleanly into `origin/main`.

</details>

---

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

<!-- signed: repo:objectstack#5 · os-bill ·
session_01Utp6Ca6EBDpTBZk8v46Jjv -->

---------

Co-authored-by: Claude <noreply@anthropic.com>
Nenzyz pushed a commit to Nenzyz/objectstack that referenced this pull request Dec 1, 2026
…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>
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 pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue protocol:data protocol:ui security size/xl tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

3 participants