Repository navigation
fix(spec): hook form refusals help names the handler beside the JavaScript body - #34146
Conversation
The refusals row help ended "JavaScript (L2) bodies only", while HookSchema answers a catalogue on a js body and on a handler, and refuses it on an expression body. Reword the source help and every metadata-form bundle copy, and pin the row. Claude-Session: https://claude.ai/code/session_01ADHkmSYipyhBpSxJqatyap Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ADHkmSYipyhBpSxJqatyap Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckNothing in this diff resolved to a documentable surface (no symbol, route or SDK anchor derived from 2 changed package(s)), so this run has no opinion about the docs. What this run could not see
Coarse fallback — 173 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): |
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf Flake reading ·
|
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf Second red read ·
|
|
domain:ui#1 · os-steve · session_01ADHkmT2NE3iyG1o6TDg3sf 席位核对Verdict: ACCEPT · head
|
Requested by Steve · project thread
Fixes #33803
Clause-②: no — help text only
Metadata-protocol: none
维护者速读
packages/spec/src/data/hook.form.ts(新说明)、packages/spec/src/data/hook-refusals.test.ts(末尾新钉子)、packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts第 970 行。git grep -c "bodies only" -- packages/spec/src/data/hook.form.ts预期 0;git grep -l "For a JavaScript (L2) body or a handler" -- packages预期 2 个文件(源与 en 包)。What changes
packages/spec/src/data/hook.form.ts: therefusalsrow help now says the code is the one the hook throws, and ends "For a JavaScript (L2) body or a handler; refused on an expression body". That is whatHookSchema.refusalssays (hook.zod.ts, "a js body or a handler") and whathookRefusalsWithoutSandboxedBodyrefuses (anexpressionbody, or neither a body nor a handler). The file docblock says the same.packages/platform-objects/src/apps/translations/*.metadata-forms.generated.ts:encarries the new source string (byte-equal to whatcheck:i18nextracts); the ten translated locales (ar de es-ES fr ja-JP ko pt-BR ru zh-CN zh-Hant) are re-translated by hand in place, leaf value only, no key added or dropped. No locale has a source-hash entry for this path, so no digest file moves..changeset/33803-hook-refusals-help-handler.md: patch for@objectstack/specand@objectstack/platform-objects.Tests
describeat the end ofpackages/spec/src/data/hook-refusals.test.ts(the refusals harness file): therefusalsrow help nameshandlerand no longer says "bodies only"; thehandlerrow it names is a row the same form offers. No forced edit to an existing test. The second commit readshookForm.sectionsthrough its optional type (?? []), whichcheck:test-typecheckasked for; an empty list would still red thetoHaveLength(1)assertion.pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/data/hook-refusals.test.ts src/kernel/repeater-item-titles.test.ts src/system/metadata-form-declared-rows.pin.test.ts: Test Files 3 passed, Tests 140 passed (head a711ec1; again on final head d4af1df).scripts/ablation-replace.mjson the committed head): restoring the old ending "JavaScript (L2) bodies only" inhook.form.tslanded (anchor 1 → 0, blob 6d2932ce → 8f783593) and turned the new pin red (1 failed / 98 passed); restore proved blob == HEAD andgit diff HEADempty.Acceptance notes
refusals(message,reasons,reasons.message) still say "when the body throws this code". With a handler hook the thrower is the handler, so those three help strings read narrower than the schema. Same wording class, three more strings × 11 locales; left out of this card's scope. carrier: none.Verification
All on final head d4af1df, local subset only; every family CI runs is read from this PR's check-runs.
Derived gates: 84 derived, 84 run, 0 NOT-MEASURED, all exit 0
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 84 families from 14 paths vs merge base 385ea1c; each ran after the last commit and--ranreconciled: "84 derived famil(ies) accounted for — 84 run, 0 NOT-MEASURED".pnpm check:i18n(theenbundle equals a fresh extract of the new source string),check:i18n-stale-fill,check:doc-authoring,check:nul-bytes,check:issue-citations,check:test-source-alias, and the spec dist family (check:api-surface,check:docs,check:authorable-surface,check:exported-any) afterpnpm --filter @objectstack/spec build.check-plugin-teardown-shape --self-testfirst exited 3 on the shallow clone (pinned fixture commit missing), green after fetching that commit;check:dual-build-cjs-loadsfirst exited 3 (PREREQUISITE NOT MET, packages without dist), green after building./packages/**; the four spec dist gates exited 3 after the second commit moved the src hash, green after rebuilding spec.Package checks
pnpm --filter @objectstack/spec typecheck(incl.check:test-typecheck): exit 0.pnpm --filter @objectstack/platform-objects typecheck: exit 0.pnpm --filter @objectstack/platform-objects test: Test Files 122 passed, Tests 2007 passed.test:repo(Test Core) not run locally: the diff edits no repo-project test; CI runs it.!in the title and no(narrowing)arm.Generated by Claude Code