Repository navigation
feat(spec): the Studio hook form offers texts, and HookContext declares ctx.text - #35510
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>
📓 Docs Drift CheckThis PR changes 2 package(s): 2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 1 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 b000eebd67297a2b303af041eff30ef210f8d62e && git checkout b000eebd67297a2b303af041eff30ef210f8d62e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7eaa3f5df3af199aa87f83d3d788915e17836611 88900c1b2c26312dba04a2b86d709e4204dbaf43 && git checkout -B drift-repro 7eaa3f5df3af199aa87f83d3d788915e17836611 && git merge --no-ff 88900c1b2c26312dba04a2b86d709e4204dbaf43
node scripts/docs-audit/affected-docs.mjs --json 7eaa3f5df3af199aa87f83d3d788915e17836611
|
…at minor Claude-Session: https://claude.ai/code/session_01L6bhgX6mQpVU8yUysiRAFC Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Final green head for review: Every check-run on this head is Patch round 1 (b702af9) changed the changeset only: 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: cards #34575 and #35197 with every comment, the PR body, the 24-file net diff against
② Semver levelMatches. The PR body and the changeset both carry
③ Boundary flags
④ Design judgment
No must-fix, no should-fix.
Read, not reviewed (the lane seat's ACCEPT). The eleven packs carry the same three keys and each says the organization's language, never the caller's. The 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 #35510 @
|
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob L2 adoption · 2026-11-19T17:16Z · The seat checked the card thread's isolated
Verdict: PASS, no must-fix and no should-fix. N1–N4 stay as accepted deviations on this head. As the reviewer advised, #35197's close-out names #35512: a hotcrm |
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Contract reviewServed-tier: DELTA review from ① Derived judgmentsRead for this round: the PR and both card threads again (nothing new on the cards; on the PR the seat's ACCEPT 7016103561, the earlier record, its brief 7016465136 and the adoption), the net diff against
② Semver levelUnchanged, and still matching. The changeset is the same blob ( ③ Boundary flags
④ Design judgment①–④ of record 7016449176 stand unchanged for the
The moved file is generated output outside the No must-fix, no should-fix. N1 to N4 of record 7016449176 stay as accepted nits, as the seat's adoption recorded them. The files they name ( Implemented-by: VERDICT: PASS Generated by Claude Code |
|
repo:objectstack#1 · os-sales · session_01L6bhgUkbQqRUUFSiu2HGob L2 adoption · 2026-11-19T17:35Z · The seat adopts the delta record 7016935457 for head
|
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Landing (2026-11-19T17:50Z) · head
Readying and arming auto-merge; the queue lands it. Generated by Claude Code |
⛔ merge queue 构建失败 — 先分诊,再决定要不要重排队列构建 44581618003 红了。队列跑的是全量套件(PR 侧 CI 只跑 affected 子集), 分类: 失败的 job(日志抽取,best effort):
跨 PR 相同签名(24h,按失败测试文件聚合):
历史信号:
分诊清单:
Generated by Claude Code · merge-queue-triage workflow (#4859) |
|
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC Queue eject triage (2026-11-19T18:22Z) · head Signature: Initial judgment: not this PR's. Three facts read:
So this re-arms once, on the same head. If the same signature ejects it again, this thread stops and hands the signature on; the flaky-test card is the seat's to file (a fixed 50 ms wait before reading a socket response). Generated by Claude Code |
Requested by Sales · project thread
Fixes #34575
Fixes #35197
Clause-②: yes (widening)
Metadata-protocol: added
Skills-docs: none — skills/objectstack-data/references/data-hooks.md already teaches ctx.text (ctx table row and the "Declared texts" section); this PR declares its type and adds the Studio row
维护者速读
What changes
Studio hook form (#34575).
hook.form.tsgains atextsrow in the Body section, besiderefusals:type: 'record',widget: 'key-only-record', with entry fieldsmessage(textarea, required) andparams(tags), the two keys of the served entry schema (declaredTextEntrySchema('hook'):{ message, params? }). The key-only face is generic (KEY_ONLY_RECORD_WIDGETinui/packages/app-shell/src/views/metadata-admin/SchemaForm.tsxkeys off the row'swidget, and reads the key rule from the servedpropertyNames.pattern), andrefusalsalready exercises the same two entry controls, so no renderer change is needed. Thehook/textsomit row is deleted frommetadata-form-zod-reconciliation.test.ts; theaction/refusalsandaction/textsrows stay (other cards). The elevenmetadata-formspacks carry the row's label and help text:enregenerated bynode scripts/check-i18n-bundles.mjs --write, the ten translated packs hand-written, following each pack's wording for therefusalsrow.HookContext.text(#35197).HookContextSchemadeclarestext, the way it declaresapiandnotice:z.unknown().optional()at parse (JSON Schema{}), cast to the named function typeHookTextReaderfor the type:(key: string, params?)resolving to a string,paramsa name-to-value record. The signature is the card's and matches what the runtime binds exactly (HookTextSurfaceinpackages/runtime/src/sandbox/hook-text.ts: same params type, same return type). The runtime binds it on both hook paths: the sandboxed body (buildSandboxContext) and the in-process handler proxy inbody-runner.ts.HookContextSchema.parsenow keeps a boundtextinstead of stripping it. The generatedapi-surface,export-origins,authorable-surfaceandreferences/data/hook.mdxrows move by one line each.Read first, by risk:
packages/spec/src/data/hook.zod.ts: thetextmember andHookTextReader(a published type, Clause-② widening).packages/spec/src/data/hook.form.ts: thetextsrow.packages/platform-objects/src/apps/translations/zh-CN.metadata-forms.generated.ts, the threetextsentries underhook.fields.Tests
packages/spec/src/data/hook-context-text.test.ts: the member's type equals the runtime surface in both directions and is optional; a typed handler calls it; three@ts-expect-errorreverse checks (number key, positional params, numeric result), live becausetsconfig.test.jsoncompiles this file (check:test-typecheckOK); and the parse keeps a boundtext.metadata-form-zod-reconciliation.test.tspasses with the omit row gone.packages/platform-objects/src/apps/translations/move with the new row: hook enumerated children 12 to 14 (two files), translated row labels 741 to 744.Readings (head 3d0f92b)
pnpm --filter @objectstack/spec test: Test Files 856 passed, 1 skipped (857); Tests 27389 passed.pnpm --filter @objectstack/platform-objects test: Test Files 123 passed (123); Tests 2050 passed (2050).pnpm --filter @objectstack/spec typecheck: exit 0 (check:test-typecheck: OK, 240 ledgered errors held, none in the new file).pnpm --filter @objectstack/platform-objects typecheck: exit 0.tscoverasync (ctx: HookContext) => { await ctx.text('follow_up_subject', { lead }) }answersTS2339: Property 'text' does not exist, strict and non-strict. After: non-strict exit 0; strict answersTS2722(see Acceptance notes);await ctx.text?.(...)compiles under strict, and a number key is a type error.text:member viascripts/ablation-replace.mjs(anchor 1 to 0, blob changed) redsthe parse keeps the bound function instead of stripping it(Tests 1 failed, 3 passed); restore proven (blob equals HEAD,git diff HEADempty).pnpm check:i18n: OK, all bundles in sync.pnpm check:i18n-coverage: OK, none new.node scripts/check-cli-command-ids.mjs: exit 0.pnpm --filter @objectstack/spec check:generated: all 14 artifacts up to date.node scripts/pm/dispatch-gates.mjs --commands: 116 families;--ran: 115 run with exit 0, 1 NOT MEASURED (check-plugin-teardown-shape.mjs --self-test, exit 3, its positive-control commit is outside this shallow clone).Acceptance notes
apiandnoticeare, because a context parsed without the runtime carries none. Understrict, the documentedawait ctx.text('k')therefore answersTS2722(possibly undefined) rather thanTS2339; a strict handler has to narrow first. The narrowing spellings an author reaches for,ctx.text?.('k')(and in TSctx.text!('k')), are not read by the save-time literal check, which matches onlyctx.text('k': measured on the built spec, a js bodyawait ctx.text?.('undeclared_key')parses, whileawait ctx.text('undeclared_key')is refused at save. The key is still refused when the hook runs. Raised to the seat as an open question; not changed here.@objectstack/platform-objectspublishes the packs asMetadataFormsTranslations: TranslationBundle(dist/metadata-translations/index.d.ts); no declaration names a pack key (the existingrefusals.paramskey, as control, is in no.d.tseither). The new keys are published runtime content, not a published type.Metadata-protocol: none; the authorable-surface ratchet recordsHookContextmembers (it gainsdata/HookContext:text), so the kind isadded, and@objectstack/spectakesminor(correction of the dispatch, measured by the Check Changeset gate). Nothing a stack writes changes:textswas already authorable. No ADR-0087 entry.Verification
Two minutes:
pnpm --filter @objectstack/spec exec vitest run src/data/hook-context-text.test.ts src/system/metadata-form-zod-reconciliation.test.ts. Expected: both files pass, andgit grep -n "key: 'texts'" packages/spec/src/system/metadata-form-zod-reconciliation.test.tslists only theactionrow.Generated by Claude Code