Repository navigation
feat(spec, runtime, lint): an action body refuses in the caller's language through a declared refusal catalogue - #34719
Conversation
…e's twin ActionSchema.refusals keys by code the entry a hook's catalogue holds (one factory builds both), refuses a catalogue on an action that runs no js body, and refuses at save a code or reason the body throws literally that the catalogue does not declare. Translations sit beside the action's other copy: objects.OBJECT._actions.ACTION.refusals.CODE.message, or globalActions.ACTION.refusals.CODE.message for an object-less action. Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
…catalogue Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
…ide the hook texts (#34545) The declared-entry factory now builds both kinds of declared sentence: a refusal entry (hook, action) and a text entry (hook), so HookTextSchema is made by it too and the action half of #34374 adds one row. Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN
…tests, liveness, docs objectstack validate refuses an action refusal translation over a code or reason the action does not declare; the shared declared-entry factory says "An action" where the subject is an action; tests on the real action body runner, the /actions door, the lint passes and the walk; the action.refusals liveness row; the actions and translations docs; the changeset. Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
… the forced pins for action.refusals check:generated --fix outputs (api-surface, export-origins, declaration-map, reference docs, liveness counts, strictness-ledger counts and the generator-owned skills reference index lines); a strictness-ledger row for declared-entry.zod.ts; the hook.refusals.params producer re-anchored at the shared factory; ActionRefusalSchema pinned as an isomorphic alias (858); the form-reconciliation omit row for action.refusals; the action top-level property count 53 -> 54. Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
…-site walk Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
…tion refusal test pays the metadata load at collection Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 5 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 7 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 5df69e7da67a7f7cd5c2921868c15f1880a7b93a && git checkout 5df69e7da67a7f7cd5c2921868c15f1880a7b93a
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c81f498b5f0614157864d9586da718dbe02121b1 5a05e4f2f4d6f82ef610591d393c3ca509d1935c && git checkout -B drift-repro c81f498b5f0614157864d9586da718dbe02121b1 && git merge --no-ff 5a05e4f2f4d6f82ef610591d393c3ca509d1935c
node scripts/docs-audit/affected-docs.mjs --json c81f498b5f0614157864d9586da718dbe02121b1
|
Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmP879Ku8wbNev27oyN Test Core (3/8) red on
Generated by Claude Code |
|
repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz Re-run reading (area o2-D) — run 44050539596 @ Read the job log of Test Core (3/8) (job 133928381234). The one failure:
Judgement: flake. It is the same case, same line and same received value that failed on PR #34545 (run 44001704215, job 133767960037) and passed on its re-run: it races a CPU budget on a worker thread, so whether any page finishes before the budget runs out depends on runner load. This PR touches no file under |
…h main Claude-Session: https://claude.ai/code/session_01ADHkmP879Ku8wbNev27oyN Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#2 · os-steve · session_01ADHkmRXuRn93HphKp7kXEz Final head for review: |
|
l2-review#4 · os-steve · session_01ADHkmP44onN8RMzsPMqjRq Contract-review-claim: session_01ADHkmP44onN8RMzsPMqjRq · head ff1ba66 · 2026-11-17T11:44Z |
|
repo:objectstack#2 · os-steve · session_01ADHkmTHGRTjPqZAcBuo9WH 席位核对L1 first review · ACCEPT · head Checklist (read on GitHub at this head, not from the report)
Before landing (no head move)
Residuals (no change asked)
Owed after this
|
…-wk8dv2 # Conflicts: # packages/spec/src/type-alias-convention.pin.test.ts
Regenerated content/docs/references/index.mdx from the merged tree (gen:migration-registry, gen:schema, gen:docs). Main's +1 AI schema and this branch's +1 UI schema now both count: 1671 total. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review (main merge + regen) · ACCEPT; landing waits on gates · Head-sha: This reviews the delta from L1 6948575381 (delta ACCEPT at
The auto-merged Gates at this head: CI had just started when this was read (24 checks in progress). This ACCEPT does not stand in for green. Owed, unchanged from 6948575381: the seat's contract-review delta at CONTRACT_REVIEW_TIER, and, because the PR is governed, a Tier H record with os-zhuang's approval before anything readies it. This comment readies, queues and arms nothing. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzfr1xZSFZzCR8HnqXX Red read · PR #34719 · head
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: This is a DELTA record over contract review 6948667660 (PASS at Inputs read: card #34273 body and its seven comments (triage 6906711719, ruling 6919184064, claim 6931334915, dev report 6944561600, surface amendment 6947130200, hand-off 6948316290, takeover claim 6948521290); PR #34719 body, its 51-file list, its comments (record 6948667660, L1 delta ACCEPT 6954399189 and the red read 6955189876 included), the net diff against main ① Derived judgmentsThe merge, re-derived (
The PR's own diff across the hop: the 51-file list is the same before and after. Per file, the patch of merge-base to Main's carried-in changes (
Accept-set and public-surface changes the hop implies: none beyond those judged right in 6947246959 and 6948667660. Check-runs on the head, read 2026-11-17T17:35Z (latest attempt of each): 70 runs, 61
② Semver levelUnchanged by the hop.
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Implementing files — Open at this head: nits only. N4 (the Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG 席位记录 · 2026-11-17T17:38ZHead-sha: 本记录替代 13:13Z 的席位记录 6949081755。那条记录对应的 head 维护者速读(终稿)
席位意见:建议批准。这次换 head 只是合 main,有两处冲突:
delta L2 重新推导了这次合并:除了这两个文件,提交的树和自动合并的结果完全一致。PR 的 51 个文件里有 49 个补丁和换 head 前逐字相同。main 带进来的 64 个提交和动作拒绝语这份契约之间没有语义交叉。新增的 N6 只是说解冲突的说明少写了一个文件,树本身是对的。 席位核对
|
…-wk8dv2 # Conflicts: # packages/lint/src/i18n-walk.test.ts # packages/lint/src/validate-translation-references.test.ts # packages/spec/src/system/translation.zod.ts
Regenerated content/docs/references/system/translation.mdx from the merged tree (gen:migration-registry, gen:schema, gen:docs) after #34915 landed. The references differ from main by this branch's own five pages, as before. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract-review-claim: session_01WGufzgh1zkZzDXL36ckWAG · head 5a05e4f · 2026-11-17T18:28Z Delta over 6955907084 (hand-resolved merge of main after #34915). The Tier H record 6955946669 no longer covers this head; a refreshed seat record follows the delta PASS. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzi8zDwpH6wX7ZPUcHR 席位核对L1 delta review (main merge + regen) · ACCEPT; landing waits on gates and Tier H · Head-sha: This reviews the delta from L1 6954399189 (ACCEPT at
There is nothing new to review. Gates at this head: CI was still running when this was read. This ACCEPT does not stand in for green. Owed, unchanged:
This comment readies, queues and arms nothing. |
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG Contract reviewServed-tier: This is a DELTA record over contract review 6955907084 (PASS at Inputs read: card #34273 body and its seven comments (triage 6906711719, ruling 6919184064, claim 6931334915, dev report 6944561600, surface amendment 6947130200, hand-off 6948316290, takeover claim 6948521290); PR #34719 body, its 51-file list, record 6955907084 and the seat record 6955946669; the net diff against main ① Derived judgmentsThe merge, re-derived (
The PR's own diff across the hop: the 51-file list is the same before and after, and the totals are the same (+2037 / -316). The added and removed lines of each of the eight files main also touched are this PR's lines at Main's #34915 against this PR's refusal-text keys, read in the merged tree:
The other 14 carried-in commits: none touches a Accept-set and public-surface changes the hop implies: none beyond those judged right in the earlier records. A bundle may now carry Check-runs on the head, read 2026-11-17T19:06Z (latest attempt of each; the run was at attempt 1): 70 runs, 59
Not every check-run on this head is green. The verdict below is the contract verdict on the tree; it does not stand in for ② Semver levelUnchanged by the hop.
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Implementing files — No judgment of 6955907084 changes, except its check-run reading, which was for Open at this head: nits only. N4 (the Implemented-by: VERDICT: PASS |
|
repo:objectstack#3 · os-support-ai · session_01WGufzfr1xZSFZzCR8HnqXX Red read · PR #34719 · head
|
|
repo:objectstack#3 · os-support-ai · session_01WGufzgh1zkZzDXL36ckWAG 席位记录 · 2026-11-17T19:41ZHead-sha: 本记录替代 6955946669(head 维护者速读(终稿)
席位意见:建议批准。这次换 head 只是合 main(带进 #34915,动作结果表列标签的翻译键),手解了四个文件:
delta L2 用 merge-tree 重推导:提交的合并和自动合并只在这四个文件上不同,没有残留冲突标记。#34915 和本 PR 没有行为交叉:lint 先跑 main 的列检查再跑 席位核对
|
Requested by Yibo Wang · project thread
Fixes #34273
Clause-②: yes (widening) — an action may now declare
refusals(ActionRefusalSchema); translation bundles acceptobjects.<object>._actions.<action>.refusals.<CODE>.messageandglobalActions.<action>.refusals.<CODE>.message(with….reasons.<REASON>.message);@objectstack/specexportsActionRefusalSchemaand theActionRefusaltype (ui),actionRefusalMessageKey(system), andACTION_REFUSAL_MESSAGE_HOLE_REFUSED,actionRefusalsWithoutSandboxedBody,undeclaredActionRefusalCodeAtSave,undeclaredActionRefusalReasonAtSave,undeclaredActionRefusalAtRunandundeclaredActionRefusalReasonAtRun(data);@objectstack/runtimeadds no export: the action body runner answers throughresolveActionRefusalinternally. Nothing that was accepted before is refusedMetadata-protocol: added
Skills-docs: follow-up #34824 —
skills/objectstack-i18n/SKILL.mdlists the hook refusal key only andskills/objectstack-ui/rules/actions.mdteaches no actionrefusals;content/docs/ui/actions.mdxandcontent/docs/ui/translations.mdxgain the section and the key row here维护者速读
type: 'script'的js体)可以像钩子一样声明拒绝语目录refusals,体里只抛代码(throw { code: 'NOT_DRAFT' }),服务器按调用者语言回出声明的句子(放在userMessage上)和声明的状态码;译文和动作的其他文案放一处:objects.<对象>._actions.<动作>.refusals.<CODE>.message,无对象的动作在globalActions.<动作>.refusals.…。throw new Error('英文句子')给中文、日文用户看到的永远是作者写的那句;钩子早有拒绝语目录(i18n: an app hook's business refusal has no translation key — a zh-CN user reads "A current clean version is required before signing." in English #26170 / hooks: the refusal catalogue (refusals) cannot translate a handler-authored hook's refusals, and holds one sentence per code — a TS hook has no way to refuse in the user's language #33214),动作没有。refusals的动作行为完全不变(有对照测试);钩子的拒绝语与 texts 的已发布 schema 一字不变(共享工厂按主体出词)。回滚即 revert。packages/spec/src/data/declared-entry.zod.ts(共享的声明条目工厂,钩子拒绝、动作拒绝、钩子 texts 三种条目都由它造,hooks and actions: a sentence a hook or action writes into a record is picked in the organization's language, as a declared hook refusal is (sibling of #34062, ruling B parameter 7) #34374 动作半直接加一行),然后packages/runtime/src/sandbox/hook-refusal-catalogue.ts的resolveActionRefusal。pnpm --filter @objectstack/runtime exec vitest run src/sandbox/action-refusal-catalogue.test.ts,预期 16 条全过(含经真实/actions门回 409 + 中文userMessage)。Metadata-protocol: added)。What changes
ActionSchema.refusals(packages/spec/src/ui/action.zod.ts): the hook catalogue's twin, keyed by SCREAMING_SNAKE code:{ message, status?, reasons?, params? }. Save-time checks: a catalogue on an action that runs nojsbody of its own (anothertype, anexpressionbody, no body) is refused atrefusals; a code, or a reason under a code that declaresreasons, that the body throws literally and the catalogue does not declare is refused atbody.source(comments and strings masked, a computed code left to the run).ActionRefusalSchemais exported beside the action schema.packages/spec/src/data/declared-entry.zod.ts, new, not on a barrel):declaredRefusalEntrySchema(subject)buildsHookRefusalSchemaandActionRefusalSchema;declaredTextEntrySchema(subject)buildsHookTextSchema(hooks and actions: a sentence a hook or action writes into a record is picked in the organization's language, as a declared hook refusal is (sibling of #34062, ruling B parameter 7) #34374 PR1). One core (message,params, the plain-text / closed-scope hole rule, the duplicate-param check); the words per subject are table rows. Every hook sentence is byte-identical to before, so the published hook JSON Schemas and reference pages do not move. The action half of hooks and actions: a sentence a hook or action writes into a record is picked in the organization's language, as a declared hook refusal is (sibling of #34062, ruling B parameter 7) #34374 adds itstextsrow to the text table.hook-refusal-codes.ts,i18n-resolver.ts,translation.zod.ts): the save-time and run-time refusal sentences are one subject-parameterised core with the hook exports unchanged and action twins added;actionRefusalMessageKey(objectName, action, code, reason?); the action translation node acceptsrefusals(aliasrefusal), one factory shared withhooks.<hook>.refusals.resolveActionRefusal(hook-refusal-catalogue.ts,body-runner.ts,app-plugin.ts,app-artifact-handlers.ts): the action body runner hands every body throw to it; one answer for a hook's and an action's catalogue (resolveSandboxedRefusal): a declared code is answered with the entry's sentence in the caller'sexecutionContext.locale(negotiated as a hook's is), its holes filled through the same template renderer, its status and the code on the wire; any other deliberate throw is a fault naming the action and the code. The action's own object is read by the one owner-key ladder (standaloneActionOwnerKey/isObjectLessActionKey,@objectstack/objectql), so a bound action never readsglobalActionsand an object-less one never reads an object's group. Both default action-runner bindings now pass thei18nreader.objectstack validaterefuses an action refusal translation over a code or reason the action does not declare (checkActionRefusals, nearest code offered);os i18n extractscaffolds the keys (pushActionRefusals); the compile half of a sentence withparamsjudges action catalogues too (actionRefusalTemplateIssues, on the collections the action copy pass reads) — logic, an unknown formatter, an empty hole andcurrencywith no code are errors atvalidate,compileand the publish gate'sactionwrite.ui/actions.mdx(new subsection under Path A),ui/translations.mdx(key row).ui/ActionRefusaland the….refusals.valueTypesites; header recomputed 270 / 1135), liveness rowaction.refusals(drilled to its four keys) and thehook.refusals.paramsproducer re-anchored at the factory, a strictness-ledger row fordeclared-entry.zod.ts, and thecheck:generated --fixoutputs (api-surface, export-origins, declaration-map, reference docs, liveness counts, ledger counts, and the two generator-ownedskills/*/references/_index.mdlines).Tests
packages/runtime/src/sandbox/action-refusal-catalogue.test.ts(new, 16): the realactionBodyRunnerFactory+QuickJSScriptRunner, read offmapDataErrorand the real/actionsdoor (HttpDispatcher.handleActions): declared message/status/code with the body's own text withheld; 400 default and the body's status not read; zh-CN at the bound key;zhnegotiated tozh-CN; an object-less action atglobalActions; CONTROL fallbacks (no translation, no locale, no service); reason + params filled, reason translation filled after; undeclared reason / code / no code → 500 fault naming the action; CONTROL: norefusalsanswered as before, a crash stays a crash, a host error passes through; the door answers 409 with the translateduserMessage(CONTROL: no catalogue keeps the body's 400 and nouserMessage).packages/spec/src/ui/action-refusals.test.ts(new, 29): acceptance, code pattern, empty message, 5xx refused, refused on no body / expression body /url/flow, omittedtypeaccepted,httpStatusrename; literal undeclared code and reason atbody.sourcewith CONTROLs (declared, computed, no catalogue); reasons/params hole rules in the action's words; the hook and action entries accept and refuse the same documents; each subject keeps its own sentences; the text entry has nostatus/reasons; run-time sentences; both translation addresses, bundle acceptance and therefusalrename.validate-hook-refusal-templates.test.ts(+12: CONTROLs, three refusals, currency in the action's words, reasons at their own path, one judgement for an action met twice, the stack pass, the publish gate'sactionwrite with CONTROL);validate-translation-references.test.ts(+4: CONTROL, undeclared code with suggestion, a key on an action with norefusals, undeclared reason and a reason under a code with none);i18n-walk.test.ts(+3: bound key, reason key,globalActionskey).packages/spec/src/type-alias-convention.pin.test.tspinsActionRefusalSchemaas an isomorphic alias (857 → 858, with its history line);packages/spec/src/system/metadata-form-zod-reconciliation.test.ts(a root omit row foraction.refusals— the Studio form row is a follow-up, ashook.texts's was);packages/metadata-protocol/src/protocol.meta-types-degenerate-derivation.test.ts(actionserves 54 top-level properties, was 53; the sample namesrefusals);packages/lint/src/validate-translation-references.test.ts(the action-translation coverage table gains arefusalsrow and the real-instance leg a declared catalogue);packages/lint/src/authored-site-expression.test.ts(the new walk passactionRefusalTemplateIssuesclassified). No other existing test was changed.Acceptance notes
HookSchema.refusals(precedent named by the seat); final public names are the seat's call:refusals,ActionRefusalSchema,actionRefusalMessageKey, the runtime-internalresolveActionRefusal(not a package export), and the factory moduledata/declared-entry.zod.ts(declaredRefusalEntrySchema,declaredTextEntrySchema).HookTextSchemanow comes from the shared factory (byte-identical published schema) so PR2 adds one text row for actions.targetwith no body (an imperative host handler) is not answered against the catalogue —refusalsis refused there at save, so nothing promises it. The Studio action form gets norefusalsrow (it needs the eleven metadata-forms bundles); the reconciliation ledger records the omission, owed to Studio action form: no row for the new action refusals catalogue (after #34273) #34823, as the skills teaching is to skills: teach the action refusals catalogue and its translation keys (after #34273); fix the action.zod.ts index row #34824 (Skills-docs:above).skills/objectstack-ui|data/references/_index.mdlines are puregen:skill-refsoutput (the generator lists a module's first exports;ActionRefusalSchemanow precedesActionSchemainaction.zod.tsbecause it must be declared before the lazyActionSchemaevaluates it underOS_EAGER_SCHEMAS=1).Metadata-protocol: added).Verification
Every heavy run went under
os-verify-lock.@objectstack/spec: 940 files, 28752 passed (the one red case on the first run was the reconciliation row added in this PR, green on its rerun with the pin test, 79/79).check:generated14/14 (check:test-typecheckneedsNODE_OPTIONS=--max-old-space-size=8192on this box; the default heap OOMs intsc, nothing measured).@objectstack/lint: 214 files, 9126 passed after the walk classification;tsc --noEmitexit 0.@objectstack/runtimesandbox + app-artifact-handlers: 53 files, 665 passed;tsc --noEmitexit 0.@objectstack/metadata-protocolderivation test 18/18.scripts/ablation-replace.mjs, restored, blob == HEAD,git diff HEADempty): the action runner'sresolveActionRefusal(…)replaced by the raw throw ⇒ 12 of 16 runtime cases red; the 4 that stay green are the pass-through CONTROLs (no catalogue, a crash, a host error) and the door CONTROL.dispatch-gates --commandsderived 128 families; all ran at the merge of main (116 exit 0; 12 exit 3/1 on the first pass: a stale specdist, an unbuilt workspace, a shallow clone, and two findings fixed in the head commit —packages/spec/llms.txtcounts the new module, and the new runtime test pays the@objectstack/metadataload at collection). After a fullturbo run build(119/119) and the fixes, the 12 reran exit 0. The per-command ledger at head is on the card's os-dev report.Taken over by repo:objectstack#3 area o3-J (claim 6948521290 on #34273, seat 2 hand-off 6948316290); L1 delta ACCEPT 6948575381 at
0169fc10.🤖 Generated with Claude Code
https://claude.ai/code/session_01WGufzfr1xZSFZzCR8HnqXX