Repository navigation
Description
repo:hotcrm#2 · os-mickey · session_01ASNY8XiE8ZJYbrmzFDtS9g
Filing gate ①: a defect in a published contract, reproduced once with the public types.
Business reason. 18.6.0 (#34545, 11e04410) lets a hook declare texts and write them in the organization's language with await ctx.text(key, params). The runtime serves ctx.text on every hook path (packages/runtime/src/sandbox/hook-text.ts, buildHookTextSurface). But the type an app writes its handler against, HookContext (packages/spec/src/data/hook.zod.ts, z.input<typeof HookContextSchema>), has no text member. Every app that adopts the feature writes a local type to call it. hotcrm did: HookTextContext in src/sales/objects/_hook-api.ts, used by its four text-writing hooks (objectstack-ai/hotcrm#2494 / #2522 / #2535, PR objectstack-ai/hotcrm#2652). The HookSchema.texts docstring's own example (await ctx.text('follow_up_subject', { lead })) does not type-check against HookContext.
Reach (measured once). @objectstack/spec 18.6.0: tsc over async (ctx: HookContext) => { await ctx.text('k') } answers TS2339: Property 'text' does not exist on type 'HookContext'. On objectstack main ba6556c6, the top-level keys of HookContextSchema are id, object, event, input, result, previous, submitted, dispatch, session, provenance, referentialFieldClear, referentialCascadeDelete, transaction, ql, api, notice and user. There is no text.
Expected: HookContext declares text?: (key: string, params?: Record<string, unknown>) => Promise<string>, the way it declares api and notice, so the documented call type-checks.
Seam. spec:HookContext → runtime:buildHookTextSurface (injected as ctx.text).
Reader. objectstack triage grades it and routes it to the spec/runtime lane. Not a claim; awaits triage. When it ships, hotcrm drops HookTextContext; that will be its own hotcrm card at the pin bump.
Dedupe (search/issues, repo:objectstack-ai/objectstack is:issue, open and closed):
HookContext text: 59 hits, none on point. The nearest is Hook ctx.title is documented as part of every hook context, but @objectstack/verify bootStack runs app hooks without it: "ctx.title is not a function" under the test harness, while objectstack dev serves it #24289 (closed:ctx.titledocumented but absent in verify).ctx.text hook texts type: 1 hit, 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 (closed: the feature itself, not its type).HookContext missing text property: 15 hits, none on point.
Activity
objectstack-fleet commentedon Nov 18, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
First touch: p2 ·
domain:spec·pm:queue. Not a queue jump.HookContextlacks thetextmember that 18.6.0's hook texts serve at runtime, so a typed handler needs a local type. The runtime call works; the gap is only the published type.objectstack-fleet commentedon Nov 18, 2026
repo:objectstack#1 · os-warren · session_01JQwxbabAdcWyApSTGBYJNY
Ruling-ref: maintainer 14:43Z 「立一张专题卡,开始执行」 and 15:56Z 「domain 和优先级 不是已经定了吗?为什么现在不能改卡」 · regrade v3 under epic #35205
Grade: p3 (was p2) · area:build · Bug · impeded × rare · HookContext declares no text; a local type works around it
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC
Claim: PM loop round 1 (repo:objectstack#1 card thread for #34575, area lease b1-A; this card rides the same PR)
Session:
session_01L6bhgX6mQpVU8yUysiRAFCThread session:
session_01L6bhgX6mQpVU8yUysiRAFCAccount:
os-salesBranch:
claude/project-thread-lryneu(platform exception: this card thread can push only its assigned branch; shared with #34575, the chain head)Worktree:
objectstack-issue-34575Domain:
domain:specSeat:
repo:objectstack#1Area:
b1-AFile surface:
packages/spec/src/data/hook.zod.ts(HookContextSchemagains atextmember, declared the wayapiandnoticeare), a card-named test besidepackages/spec/src/data/hook.test.ts(a typed handler callingctx.textcompiles; a reverse check), the spec generated artifacts the change makes stale (check:generated --fix),.changeset/**; full surface of the shared PR is on the #34575 claimContainer & model:
M,mode:thread,model: default (dispatch-gates --tier: no path-derived mandate; floor sonnet · default opus · ceiling fable; L2 owed at CONTRACT_REVIEW_TIER, separate isolated reviewer),effort: highClause-②: yes
Metadata-protocol: none
Responsibility:
objectstack: HookContextSchema in packages/spec/src/data/hook.zod.ts declares no text member while runtime buildHookTextSurface (packages/runtime/src/sandbox/hook-text.ts) serves ctx.text on every hook path | none: each app writes a local type (hotcrm HookTextContext) | every app that writes a typed handler calling ctx.textThread-read: 6985066334
Premise: holds — on origin/main 6f36818 the
HookContextSchemaobject (hook.zod.ts:930) has notextkey;noticeis declared as a function member (precedent for the shape). The developer re-measures the TS2339 on a typed handler before writing code.Pre-claim lane:
packages/spec/src/data/**; the repo:objectstack seat covers every domain, card carriesarea:build(lease b1-A).Pre-claim deps: none named; #34374 (the feature) is closed and on main.
Prior rulings read: spec,hookcontext,declares,text,hook,typed,handler,call,local,type,ts2339 → 282 hits (broad terms; none rules against declaring the member); hook.zod.ts file-surface grep for ruling / maintainer / ⛔: 28 hits, governing ones #34374 6913660232 parameter 7 and the non-strict
HookContextSchemaheader (members are declared, never strict); thread: 6985066334 (regrade to p3, no ruling on the shape); repo: objectstack-ai/objectstack.Serial constraints cleared: covered by the #34575 claim's overlap-check (hook.zod.ts was in the probe): exit 0, 0 open PR heads share a file.
Generated by Claude Code
objectstack-fleet commentedon Nov 19, 2026
repo:objectstack#1 · os-sales · session_01L6bhgX6mQpVU8yUysiRAFC
Delivered (2026-11-19T18:58Z): PR #35510 merged as
b38e1330954f22e85e841aa9d31a975c72ca9ce1.HookContextdeclarestext?: HookTextReader((key: string, params?: Record<string, unknown>) => Promise<string>), the runtime'sHookTextSurfaceexactly;@objectstack/spectakes aminor(Metadata-protocol: added). Residue labelspm:dispatchedandlease:b1-Aremoved in this stroke.Partly reached for strict consumers, until #35512 lands: the member is optional, as this card asked and as
apiandnoticeare, so understricta typed handler narrows withctx.text?.(…)orctx.text!(…), and the save-time literal check reads neither spelling today (#35512). A strict app such as hotcrm can drop its local type now with a narrowing, and gets the save-time check on that spelling once #35512 merges.Generated by Claude Code