Repository navigation
fix(spec): the save door reads ctx.text?.( as a literal text-key ask - #35686
Conversation
The hook form gains a key-only record row for HookSchema.texts beside refusals, with message and params, and the reconciliation ledger drops its hook/texts omit row. Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
A typed hook handler can call ctx.text(key, params) against HookContext: the member is declared the way api and notice are (z.unknown at parse, a static cast for the type), with the signature the runtime binds, and the named HookTextReader type beside HookNoticeSetter. Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
…ms packs en regenerated from the form source; the ten translated packs carry hand-written translations following each pack's refusals wording. Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
… changeset Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
…ated children Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
…at minor Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
The action form gains a texts row beside the script body: a key-only record keyed by the snake_case key the body asks for with ctx.text, each entry editing message and params, gated like the body. The action/texts omit row is retired from the reconciliation ledger. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
… the eleven metadata-forms packs en regenerated from the form; the ten translated locales hand-written from each pack's hook texts wording. The action enumerated-children pin moves 7 to 9 and the translated row-label pin 744 to 747. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
The action form gains a refusals row between the script body and texts: the hook form's key-only record (message, status, reasons, params), the entry the one factory builds for both, gated like the body. The action/refusals omit row is retired from the reconciliation ledger. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
… in the eleven metadata-forms packs en regenerated from the form; the ten translated locales reuse each pack's hook refusals entries for the five entry fields (the en sources are identical) and hand-write the top row. The action enumerated-children pin moves 9 to 14 and the translated row-label pin 747 to 753. Adds the changeset for both rows. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
…s and refusals gates The two new action form rows are each gated on data.type == 'script', so the shipped-predicate pin moves 91 to 93 and the literal-comparison pin 65 to 67 (on main as of 5c5b54d, merged in the previous commit). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC
…-lryneu # Conflicts: # packages/platform-objects/src/apps/translations/object-lifecycle-panel-echo-decisions.test.ts
…t?.( and ctx.text!( Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 1 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 174 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 409d4682368db65d9a588cb894e719637b80e00b && git checkout 409d4682368db65d9a588cb894e719637b80e00b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin c03a8a342805186e04e05d9903f7f1913b43dabe 0acd17d22771e033de2fe8233b64433119c187ff && git checkout -B drift-repro c03a8a342805186e04e05d9903f7f1913b43dabe && git merge --no-ff 0acd17d22771e033de2fe8233b64433119c187ff
node scripts/docs-audit/affected-docs.mjs --json c03a8a342805186e04e05d9903f7f1913b43dabe
|
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Final green head for review: Every check-run on this head is Owed: L1 (thread L1-a) and L2 at Generated by Claude Code |
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 维护者速读
席位核对 — ACCEPT (L1-a) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Contract reviewServed-tier: ① Derived judgmentsRead for this record: card #35512 (body and all 5 comments), PR #35686 (body, its 2 comments, the 7 files, the net diff from merge base
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix. S1 (should-fix) — the
Each file, beyond S1:
Nits:
Implemented-by: VERDICT: PASS Generated by Claude Code |
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC The brief this card thread handed its isolated Contract review brief — PR #35686 @
|
…all; docs name ctx.text?.( Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgTcFanGhTvqS1V2Q4U 维护者速读
席位核对 — delta ACCEPT (L1-a) · repo:objectstack#1 · head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Contract reviewServed-tier: ① Derived judgmentsThis is a delta record (record 7025732554: PASS on
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. S1: closed. The dev took the second route the first record offered and dropped the
Each file on this head:
Nits:
Implemented-by: VERDICT: PASS Generated by Claude Code |
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Delta brief for PR #35686 at head Contract review brief — PR #35686 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Contract reviewServed-tier: ① Derived judgmentsThis is a delta record, drawn under brief 7027008067. It judges head Read for it: card #35512 (body and all 7 comments), PR #35686 (body, the 8 files, the net diff from merge base
② Semver level
③ Boundary flags
④ Design judgmentNo must-fix, no should-fix. S1: closed. The dev took the second route the first record offered and dropped the
Each file on this head:
Nits:
Implemented-by: VERDICT: PASS Generated by Claude Code |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob L2 adoption · 2026-11-20T01:10Z · The seat adopts the #35512 card thread's isolated delta record 7027208368 for head The verdict is PASS, with no must-fix and no should-fix items. S1 is closed. N2 rides #35698, and N4, N5 (PR-body prose only) and N6 stand as accepted deviations. On the reviewer's escalated item, the seat rules that no dogfood re-run is owed on this head, because its reader matches a strict subset of what the 269566b run covered. The L1-a delta ACCEPT on this head is 7026874816. |
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Landing (2026-11-20T01:46Z) · head
Readying and arming auto-merge; the queue lands it. Generated by Claude Code |
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC
Requested by Sales · project thread
Fixes #35512
Clause-②: no (narrowing)
Metadata-protocol: narrowed
Skills-docs: none — skills/objectstack-data/references/data-hooks.md and skills/objectstack-ui/rules/actions.md already teach "an undeclared key is refused at save when asked for literally, else at run" without naming a call shape; this diff makes that sentence hold for the optional-call shape, so nothing new is taught. The one hand-written page that names the call shape, content/docs/automation/hooks.mdx (~499), now names
ctx.text?.('key')besidectx.text('key')维护者速读
ctx.text?.(的写法去取一句没声明的文案时,保存时就被拒,以前要等运行时才报错。ctx.text?.(写法取了未声明文案的钩子或动作,保存会被拒;声明那句文案即可通过,本改动可直接撤回。What changes
TEXT_CALLinpackages/spec/src/data/hook-refusal-codes.ts, the one literal key reader behind both save doors (HookSchemaathook.zod.tsandActionSchemaataction.zod.ts, throughhookTextKeysAskedIn), now also readsctx.text?.('k'), awaited or not. So an undeclared key asked for in that shape is refused at save with the existingundeclaredHookTextKeyAtSave/undeclaredActionTextKeyAtSavesentence, atbody.source(orhandlerfor an in-process hook handler). The masking of comments and longer strings and the snake_case key group are unchanged.?.is read (ctx.text ?. ('k')), matching the reader's existing whitespace tolerance around the dot. The card's second shape, non-nullctx.text!('k'), is deliberately NOT read (patch round 1, L2 S1 on 7025732554): it is TypeScript with no JavaScript form. A handler's!is erased before the save readsFunction.prototype.toString(), somainalready reads it as the plain call; in ajsbody it is a syntax error (an action is refused asaction-body-does-not-compile, a hook body never runs). So the card's!(ask is moot, and a pin documents why.ctx?.text(andctx!.text(are left out:ctxis the bound parameter and is never optional in the type.(`ctx.text('k')`). It names the call, not the spelling the author used, and it reads correctly for both read shapes (the plain call and?.). Its bytes, which tests pin, are unchanged.?.(shape. That coversHookSchema.texts,HookContext.text,ActionSchema.texts, the two internal docblocks beside the doors, and the header comments aboveTEXT_CALL..describe()strings are unchanged.hook-action-text-key-optional-call-refused. Thenarrowedkind refusesno-migration-prescription, and there is no mechanical rewrite.@objectstack/specminor(the kind isnarrowed), with a BREAKING FROM/TO section and the fix.Tests
packages/spec/src/data/hook-texts.test.tsandpackages/spec/src/ui/action-texts.test.ts, one per shape (ctx.text?.(,await ctx.text?.() for each door. A lit pin checks that an undeclared key is refused atbody.sourcewith the exact sentence. A dark pin checks that a declared key, and a computed key in that shape, still pass save. The hook file also has a reader pin for whitespace and a line break around?., ahandler-path pin (an inline handler askingctx.text?.('undeclared')is refused athandler, the strict-TypeScript case; an action has no handler path), and a pin thatctx.text!('k')is not read, with the reason.text(?:\s*\?\.)?\s*\(with the oldtext\s*\((one occurrence) turned 8 of the 51 tests red. The restore was proved by an emptygit diff HEAD. (The earlier 12-red-first and 13-red readings were taken on 269566b, before patch round 1 removed the!(arm.)pnpm --filter @objectstack/spec test: 859 files / 27461 tests passed.pnpm --filter @objectstack/spec typecheck: exit 0.Acceptance notes
ctx?.text(andctx!.text(are still not read at save (see above). If one of them is used with an undeclared key, the runtime refuses it when the code runs.packages/spec/src/data/hook-context-text.test.ts:43(ctx.text?.('follow_up_subject', …)), and it stays green. The runtime's ownctx.text!(String(key), …)inpackages/runtime/src/sandbox/quickjs-runner.tsis host TypeScript, never a saved body. The break is the hook half only:ActionSchema.textsis unreleased (pending changeset), so the action half ships already narrowed (L2 N1).Verification
Two-minute check:
pnpm --filter @objectstack/spec exec vitest run --maxWorkers=2 src/data/hook-texts.test.ts src/ui/action-texts.test.ts, including the twoctx.text?.(shape rows per door and the handler pin.Read first, by risk:
packages/spec/src/data/hook-refusal-codes.ts: theTEXT_CALLregex hunk (the(?:\s*\?\.)?arm) and its header comment on why!is not read..changeset/35512-text-call-shapes.md: the declarations and the BREAKING section.packages/spec/src/migrations/entries/semantic/18.hook-action-text-key-optional-call-refused.ts.All the local readings below were taken at head
269566b8.Local gates (derived list, 96 commands)
pnpm --filter @objectstack/spec build: VERDICT command-exit 0.check:generated: all 14 artifacts are up to date (exit 0).node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 96 commands, and I ran all 96. On the first pass, 86 exited 0.check:api-surface,check:browser-reachable-entries,check:dual-source-exports,check:entry-nameability,check:exported-any(andcheck:docs/check:authorable-surfaceagain).migrate-meta-engine-guidancetest (3/3),check:doc-formula-expressions,check:lean-entry-closureandcheck:dual-build-cjs-loads.check-plugin-teardown-shape.mjs --self-test, because the shallow clone cannot reach its battery. CI runs it.check-adr-0087-registration(registeredhook-action-text-key-optional-call-refused),check-changeset-no-majorandcheck-empty-changeset.--ranreconciliation: 96 derived, 96 run, 0 UNRUN.overlap-check --branch=HEAD: VERDICT clean exit 0, against origin/main 03865ae.Dogfood battery (owed by the narrowing arm)
@objectstack/dogfood^...closure under the lock (exit 0), then ranpnpm --filter @objectstack/dogfood testat269566b8.Generated by Claude Code