Repository navigation
docs(skills): owner_id in the session-token filter example, bound user id in the hook find example - #34125
Conversation
…r id in the hook find example
The query skill's session-token example filtered on `owner`, a column the
platform does not provision; it now names `owner_id`. The hook reference's
`find` example compared `owner_id` to an unbound `uid`; it now reads
`ctx.session?.userId`. The filters.md addition is paid in the same file by
dropping a third restatement of `{30_days_ago}`.
Claude-Session: https://claude.ai/code/session_01ADHkmPNsfEF3TsQJfFdSGv
Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv Contract reviewServed-tier: Read-only shape held: the card #33730 and its three comments, the PR body, file list and net diff against main ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Findings:
One must-fix, no should-fix, two nits. Implemented-by: VERDICT: FAIL |
…ns early without one A security item is with the owner seat. Claude-Session: https://claude.ai/code/session_01ADHkmPNsfEF3TsQJfFdSGv Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv Contract reviewServed-tier: Delta record on round 1 (head ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgment
Findings:
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv 席位核对Verdict: ACCEPT — the seat lands · head
|
Requested by Steve · project thread
Fixes #33730
Clause-②: no
Metadata-protocol: none
维护者速读
owner改为平台的归属列owner_id;data-hooks.md 的find示例先从钩子上下文取ctx.session?.userId绑定到uid,取不到就提前返回,不再用未定义的变量。owner列平台并不提供,uid是个未定义变量。skills/objectstack-data/references/data-hooks.md第 298–300 行,skills/objectstack-query/rules/filters.md第 166 与 176 行。node scripts/check-skills-token-ratchet.mjs,预期两个文件都在上限内(filters.md 2469/2473,data-hooks.md 10003/10011)。What changes
skills/objectstack-query/rules/filters.md: the session-token example now filtersowner_id: '{current_user_id}'.owner_idis the platform's provisioned ownership column (packages/objectql/src/registry.ts:1643-1649, auto-added and stamped to the acting user on insert by SecurityPlugin; the doc block atregistry.ts:1334-1338names it the canonical reassignable owner). The tokens' own source uses the same example (packages/spec/src/data/context-tokens.zod.ts:27). The surrounding "Session tokens" paragraph still reads true and is unchanged.skills/objectstack-data/references/data-hooks.md: thefindexample's unbounduidis now bound from the hook context before the read:const uid = ctx.session?.userId;thenif (!uid) return;, and thefindline itself is unchanged. The hook context names the caller's idHookContext.session.userId(packages/spec/src/data/hook.zod.ts:1411-1412:session: z.object({ userId: z.string().optional(), …), and the retired-roles prescription athook.zod.ts:1617says "readctx.session.userId/ctx.session.isSystem". Optional chaining because the same file teaches thatctx.sessionis absent on system writes; the example returns early when there is no id..changeset/33730-skills-query-hook-examples.md:@objectstack/skillspatch.Tests
Docs-only diff; no test file is touched and no forced test edit exists. No eval prompt is added: both edits correct an existing example and add no new teaching.
Readings on origin/main
f81e4b6c(before) and this head (after):skills/objectstack-query/rules/filters.mdskills/objectstack-data/references/data-hooks.mdSKILL.mdNo ratchet row moved. filters.md sat at zero headroom, so the 3 bytes of the
owner_idrename are paid in place: the Parameterised-tokens bullet drops its third restatement of{30_days_ago}(the token keeps its homes at line 71 and in the code example at line 157 of the same file). Net, filters.md is 16 bytes smaller (9892 → 9876). data-hooks.md's two new lines fit its existing headroom; nothing was cut there.Acceptance notes
dispatch-gates --tiermandates forskills/**; the thread did the push, gates and relay. The seat agreed this route before the claim.Verification
All local readings are on head
2d1bc82e(the round-1 commit on top ofd057b5bc, which is author commit0c58bfe6merged with origin/main385ea1cc; origin/main has not moved since). Build closure underos-verify-lock:pnpm buildVERDICT command-exit 0 (13m14s), then the packages main moved and their consumers (...@objectstack/objectql,...@objectstack/metadata-protocol) rebuilt, VERDICT command-exit 0; the round-1 commit touches only a skills file.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives the same 46 families on this head; all 46 pluscheck:skill-docsandcheck:skill-examplesran, every one exit 0.--ranreconciles: "46 derived famil(ies) accounted for — 46 run, 0 NOT-MEASURED (a DERIVED zero)".Gate run on 2d1bc82 (48 commands, exit codes captured before any pipe)
CI families are not re-run locally; read the PR's check-runs.