From 574409099fb54ff329e8f8e3b274e27230f2ea63 Mon Sep 17 00:00:00 2001 From: Claude Date: Sun, 15 Nov 2026 07:59:54 +0000 Subject: [PATCH] docs(skills): the data-hooks query example filters on owner_id, not a hand-named owner The ctx.api.object query-shape example in objectstack-data's data-hooks reference filtered task on { owner: uid }, a hand-named owner field beside the injected owner_id. It now filters on owner_id. The objectstack-data eval on a required user field with deleteBehavior restrict named that field owner (the agent holding the ticket); it now names a reviewer, a role apart from the record owner. Co-Authored-By: Claude Claude-Session: https://claude.ai/code/session_01FEkQ5nj2HhB4M8Anj58gqj --- .changeset/33722-skills-data-hooks-owner-id-filter.md | 10 ++++++++++ .../evals/objects-fields-relationships.json | 4 ++-- skills/objectstack-data/references/data-hooks.md | 2 +- 3 files changed, 13 insertions(+), 3 deletions(-) create mode 100644 .changeset/33722-skills-data-hooks-owner-id-filter.md diff --git a/.changeset/33722-skills-data-hooks-owner-id-filter.md b/.changeset/33722-skills-data-hooks-owner-id-filter.md new file mode 100644 index 00000000000..eb5e54da6f0 --- /dev/null +++ b/.changeset/33722-skills-data-hooks-owner-id-filter.md @@ -0,0 +1,10 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the data-hooks query example filters on the injected `owner_id`, not a hand-named `owner` + +Clause-②: no +Metadata-protocol: none + +The `ctx.api.object(name)` query-shape example in objectstack-data's `references/data-hooks.md` now filters `task` on `{ owner_id: uid }`. The old `{ owner: uid }` named a field the object does not have unless an author hand-adds a second owner beside the injected one; on an object without it the query is refused with `400 INVALID_FILTER`. The objectstack-data eval about a required `user` field with `deleteBehavior: 'restrict'` now names that field `reviewer`, a role apart from the record owner, instead of an `owner` field that holds the ticket. diff --git a/skills/objectstack-data/evals/objects-fields-relationships.json b/skills/objectstack-data/evals/objects-fields-relationships.json index 62e2bb09205..e4c4ba34ac9 100644 --- a/skills/objectstack-data/evals/objects-fields-relationships.json +++ b/skills/objectstack-data/evals/objects-fields-relationships.json @@ -100,8 +100,8 @@ }, { "id": 6, - "prompt": "On `ticket`, `owner` is the agent who holds it and must always be set; deleting that agent's user account must be blocked while they still hold tickets. `watchers` is several users, and a deleted user should just drop out of the list.", - "expected_output": "Both are `type: 'user'` fields, each with an authored `deleteBehavior` — a `user` field joins the referential delete walk only when it declares one. `owner`: `required: true` with `deleteBehavior: 'restrict'` (deleting a held user is refused with `409 DELETE_RESTRICTED`; `set_null` on a required field would refuse too). `watchers`: `multiple: true` with `deleteBehavior: 'set_null'` (only the deleted member is removed; an emptied set is `[]`). Neither is a `lookup` to a `user` object, which does not exist, and a `user` field with no `deleteBehavior` keeps the deleted user's id.", + "prompt": "On `ticket`, `reviewer` is the lead who signs it off and must always be set; deleting that lead's user account must be blocked while they still review tickets. `watchers` is several users, and a deleted user should just drop out of the list.", + "expected_output": "Both are `type: 'user'` fields, each with an authored `deleteBehavior` — a `user` field joins the referential delete walk only when it declares one. `reviewer`: `required: true` with `deleteBehavior: 'restrict'` (deleting a named reviewer is refused with `409 DELETE_RESTRICTED`; `set_null` on a required field would refuse too). `watchers`: `multiple: true` with `deleteBehavior: 'set_null'` (only the deleted member is removed; an emptied set is `[]`). Neither is a `lookup` to a `user` object, which does not exist, and a `user` field with no `deleteBehavior` keeps the deleted user's id.", "files": [], "assertions": { "must_contain": [ diff --git a/skills/objectstack-data/references/data-hooks.md b/skills/objectstack-data/references/data-hooks.md index 47e6608e0e2..94b74733bdf 100644 --- a/skills/objectstack-data/references/data-hooks.md +++ b/skills/objectstack-data/references/data-hooks.md @@ -301,7 +301,7 @@ same DSL as the [objectstack-query](../../objectstack-query/SKILL.md) skill: await ctx.api.object('candidate').findOne({ where: { id: ctx.result.id } }); await ctx.api.object('candidate').find({ where: { stage: 'hired' } }); await ctx.api.object('invoice').count({ where: { amount: { $gte: 1000 } } }); -await ctx.api.object('task').find({ where: { $and: [{ done: false }, { owner: uid }] } }); +await ctx.api.object('task').find({ where: { $and: [{ done: false }, { owner_id: uid }] } }); ``` > `filter:` is tolerated as an **object-valued** alias (normalised to `where`),