Repository navigation
docs(skills): objectstack-data says which hook doors provide ctx.title (#24289) - #24504
Merged
Merged
Conversation
The sandbox ctx table listed ctx.title with no qualifier, which read as a member of every hook context. State it per door: a body has it; a deprecated handler gets it at runtime but HookContext does not declare it; ql.registerHook and a bare ObjectQL bindHooks do not provide it. Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz Co-authored-by: Claude <noreply@anthropic.com>
The skills token ratchet caps data-hooks.md; the door note is paid for by deleting the row's duplicate of the capability table (the no-argument form needs no capability) and its wordier phrasing. Claude-Session: https://claude.ai/code/session_01D6F9axfoPzR7t8G1J7Ytzz Co-authored-by: Claude <noreply@anthropic.com>
…ok-ctx-title-docs
Contributor
Author
Seat check: PASS · PR #24504 @
|
os-zhuang
approved these changes
Oct 19, 2026
os-zhuang
marked this pull request as ready for review
October 19, 2026 10:54
os-zhuang
enabled auto-merge
October 19, 2026 10:54
This was referenced Oct 19, 2026
This was referenced Oct 19, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #24289
Clause-②: no
Tier H — the maintainer merges this PR. The diff touches
skills/**, a governed surface (AGENTS.md Prime Directive #14). No AI seat readies, queues, arms auto-merge on, or approves it.What this does
This carries out ruling letter E on #24289 (comment 6261581954), item 2: the hook context type stays as it is, and the docs say which hook doors provide
ctx.title.skills/objectstack-data/references/data-hooks.mdlistedctx.title(field?)in the sandboxctxtable with no qualifier, so it read as a member of every hook context. One row changes, thectx.titlerow. It keeps what it taught (the no-argument form, a formulanameField, the lookup form underapi.read,nulland never the id) and adds a per-door note:body: has it (the recommended form).handler: gets it at runtime, butHookContextdoes not declare it, so an annotated handler fails with TS2339. Usebody.ql.registerHookand a bareObjectQLbindHooks: do not provide it.Under ruling item 1 nothing else changes:
HookContextSchemagets notitle, there is no new context type, and there is no engine work.Each door, checked against
main(ce2e08ee3, and again after merging959ee317b)body(sandbox)buildSandboxContext(..., buildTitleSurface(engineCtx, opts.ql, ...))installs the accessor on every hook bodypackages/runtime/src/sandbox/body-runner.ts(boundBodyHandler)handler, inline or named, when the runtime binds the stack's hooksbindAppArtifactHandlerspasseswrapHandler: (handler, hook) => withInProcessHookTitle(handler, ql, ...)toql.bindHooks. The binder applies it after a stringhandlerresolves, so inline and named handlers take the same wrap (PRs #24356 and #24423)packages/runtime/src/app-artifact-handlers.ts;packages/objectql/src/hook-binder.ts(wrapHandler)HookContexttypeHookContextSchemadeclares notitle(zero hits fortitlein the file)packages/spec/src/data/hook.zod.tsql.registerHooktitleto a hook context. The only producers of the accessor arebuildTitleSurfaceandwithInProcessHookTitleinpackages/runtime, andregisterHookgoes through neitherpackages/objectql/src/engine.tsObjectQL.bindHookswrapHandler,resolveHandlerreturns the resolved handler as it is (if (!fn || typeof opts.wrapHandler !== 'function') return fn;), so nothing installstitlepackages/objectql/src/hook-binder.tsThis is a code reading. No new runtime probe was run. The PR #24423 dev measured the last two doors with a bare-
ObjectQLprobe (registerHook,bindInlineandbindNamedeach readtypeof ctx.title === 'undefined'). That reading is in the card's report comment 6257914461.Token and line budget (
skills/**)skills/objectstack-data/references/data-hooks.md: 998 → 998 lines. Tokens (check-skills-token-ratchet.mjspricedTokens) 10059 → 10064, ceiling 10066 (headroom 2). The ceiling is unchanged.skills/**/SKILL.md: 4394 → 4394 lines. NoSKILL.mdis touched.api.readrow in "Capabilities — the complete list" already says so), and wordier phrasing ("including when it is", "evaluated server-side", "onefindOne", twoawaits, "it never falls back to").Changeset
.changeset/24289-hook-ctx-title-doors.md:'@objectstack/skills': patch. That package publishesskills/**as itsdist/skills(packages/skills/scripts/sync-catalog.mjs), so a text change here ships. The earlier skills docs PRs #24174 and #24262 shipped the same patch. Noskip-changeset.Gates
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack(no paths) derived 42 commands at953159abe, and the same 42 after the merge. I also rannode scripts/check-changeset-fixed.mjs, a roster family whose roster sits under.changeset.--ran: 42 derived, 42 run, 0 NOT-MEASURED, 0 UNRUN. Every exit code was recorded before any pipe.dcd4a8368/eee9ae8de:check-skills-token-ratchetexited 1 (data-hooks.md10127 / 10066, over by 61). The row was trimmed in953159abe. Five gates exited 3 on prerequisites (nodist). After a fullturbo run build --filter='!@objectstack/docs', all 43 exited 0.260ca2ea6, the merge oforigin/main959ee317b, I rebuilt (turbo run build --filter='!@objectstack/docs', exit 0) and re-ran all 43: each exited 0, and--rangave 42 / 42 / 0 / 0.check-skills-token-ratchetreaddata-hooks.mdat 10064 / 10066.pnpm lint,test:repoand CI's type-check lanes. CI owns those.Acceptance notes
handleris "available at runtime since PRs fix(runtime): an in-process hook handler is handed the same ctx.title a hook body gets #24356 and fix(objectql,runtime): a hook whose handler names a function gets ctx.title in-process #24423". The skill text says "gets it at runtime" and does not cite the PRs. Published skill text is customer-facing and carries no tracker numbers (AGENTS.md: the lesson goes into the text). The PRs are cited here instead.interface HookContextstill calls abody'sctxa "capability-gated subset" of the in-process context.ctx.titleis one member abodyhas thatHookContextdoes not declare. This PR leaves that blockquote alone, because ruling E scopes the edit to the context table row.维护者速读(草稿)
改了什么: 只改技能文档
data-hooks.md里ctx.title那一行,写明各个入口能不能用它:body能用(推荐写法);已弃用的handler运行时能用,但HookContext类型里没有声明,写了类型注解会编译报错,建议改用body;ql.registerHook和不经 runtime 直接用ObjectQL绑定的钩子拿不到它。另加一个@objectstack/skills的 patch changeset。为什么改: 按裁决 E(#24289 评论 6261581954)执行。原文没有任何限定,读起来像每个钩子上下文都有
ctx.title,实际并非如此。现在文档写的就是运行时真实提供的。风险与代价(含回滚): 纯文档,不改类型、不改引擎,运行时行为不变。这一行的 token 由删掉同一行里的重复内容来抵,文件 token 仍在上限内(10064 / 10066),行数不变。回滚就是 revert 这个 PR。
席位意见:
你要做的: 审阅这一行的措辞,同意就合并(Tier H,只能由你合并)。
Generated by Claude Code