Skip to content

Commit 0a6af56

Browse files
docs(skills): the data skill teaches that a predicate update or delete of a controlled_by_parent detail writes the rows its by-id writes do (#36389)
<!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9JpRoUZGqtwqMU5k7b4C58D)_ Fixes #36285 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用 AI 搭应用的人问到「看得到主记录的人按条件批量改、删明细」时,技能包不再教「只能动到本人录入的行」,改为教「批量与逐条改到的行一致,要么全部生效要么一行不动」。平台行为本身没有变。 - 为什么做:属于权限与共享这条线;你裁定的「批量与逐条一致」已经随上一个改动落地,对外发布的技能包还在教旧规则,这是它欠下的文档跟进。 - 出错会怎样:这次只改两处说明文字,不动运行代码;写错的后果是 AI 照着错误说法搭应用,合并后发现不对可以直接撤回。 - 要你做什么:技能包属于需你本人批准的内容,请审阅这两处文字后批准并合并。 ## What changes The rule taught is the maintainer's ruling 「A 批量与逐条一致」 as the runtime now implements it (the predicate-write change for `controlled_by_parent` details, already on `main`). - `skills/objectstack-data/rules/relationships.md`, the `writeRequiresMasterRead: true` bullet under "Writes under `controlled_by_parent`". Before: "The ownership floor (rows you created) still binds predicate and, for both users, on-behalf-of updates and deletes." After: "A predicate (`multi: true`) update or delete writes the rows a by-id write of each would, all matched rows or none. The ownership floor (rows you created) still binds, for both users, on-behalf-of updates and deletes." Only the predicate half moved; the on-behalf-of half is kept word for word (ADR-0090 D10). - `skills/objectstack-data/evals/objects-fields-relationships.json`, eval 17: the last sentence of `expected_output` states the same rule. Its `assertions` are unchanged: none of the four `must_contain` strings and none of the four `must_not_contain` strings involved the old wording. - `.changeset/36285-relationships-predicate-floor.md`: `@objectstack/skills` patch. Read first, by risk: 1. `skills/objectstack-data/rules/relationships.md`, the one hunk at lines 86 to 92: the sentence an agent will author from. 2. `skills/objectstack-data/evals/objects-fields-relationships.json`, eval 17. ### Skill size readings | What | Before | After | |:---|---:|---:| | `rules/relationships.md`, lines | 399 | 400 | | `rules/relationships.md`, tokens (ceiling 4203) | 4162 | 4188 | | `evals/objects-fields-relationships.json`, lines | 451 | 451 | | `evals/objects-fields-relationships.json`, tokens (not ratcheted) | 7488 | 7517 | | Bundle, every `SKILL.md` summed, lines | 4950 | 4950 | | Bundle, whole shipped tree, lines | 22900 | 22901 | | Bundle, ratcheted authored tokens (ceiling 202541) | 197497 | 197523 | | Bundle, whole shipped tree, tokens | 290191 | 290246 | No ceiling is raised. Before readings at `ed33f8aed`, after readings at `eb547b8f3`. ## Tests Head `eb547b8f3`. No runtime code moves, so no package test suite is owed and no ablation applies (documentation only). <details><summary>Eval 17 against its own assertions, and the shipped catalog</summary> - Eval 17 `expected_output` checked against its `assertions`: `must_contain` missing 0 of 4, `must_not_contain` present 0 of 4. The fixture parses as JSON, 25 evals. The repository has no runner that executes eval fixtures; this is the structural check available. - `pnpm --filter @objectstack/skills build`, exit 0: "sync-catalog self-test: 9 cases pass", "114 file(s) across 14 skill(s) copied from skills/** into dist/skills and read back byte-identical". In `packages/skills/dist/skills/objectstack-data/`, the new sentence is found once in each of the two files and the old wording "still binds predicate" zero times in `rules/relationships.md` (positive control: `writeRequiresMasterRead` is found there). </details> <details><summary>Derived gates, local subset</summary> `node scripts/pm/dispatch-gates.mjs --commands` derived 48 families from the 3 changed paths. All 48 were run at `eb547b8f3` with each exit code captured before any pipe; `--ran` answers "48 derived, 48 run, 0 UNRUN". - 43 exit 0, among them `check-skills-token-ratchet` ("60 authored bundle file(s) within their ceilings"; `relationships.md` 4188 tokens, ceiling 4203, headroom 15), `check:skill-served-sections`, `check:skill-links`, `check:skill-identifier-liveness`, `check:skill-compatibility`, `check:skill-frame-sync`, `check:doc-authoring`, `check:pm-skill-id-lint`, `check:nul-bytes`, `check:published-files`, `check-empty-changeset`, `check-changeset-no-major`, `check-adr-0087-registration`. - 5 exit 3, NOT MEASURED, reason: each needs a full workspace build this documentation diff does not owe locally, and each printed its own prerequisite refusal: `check:doc-formula-expressions` (the formula package is not built), `check:dts-closure`, `check:dual-build-cjs-loads`, `check:lean-entry-closure`, `check:sourcemap-no-sources-content`. They are left to CI. </details> ## Acceptance notes - Search for other sentences teaching the old rule, at `ed33f8aed`: `git grep -iE 'rows you created|ownership floor' -- skills/` answers the two sites corrected here and no other; `git grep -i predicate -- skills/objectstack-data/` has no other hit about a `controlled_by_parent` write. No generated mirror carries the sentence: `rules/relationships.md` is hand-authored, and `check:skill-served-sections` is green. - The predicate rule holds for every `controlled_by_parent` detail, not only one that declares `writeRequiresMasterRead`. The sentence stays in the bullet where the old one stood, as the card asks for a rewrite in place with no restructuring. - The region after line 406 of `relationships.md` (another open draft's) is not touched; the file is 400 lines on this branch. - `relationships.md` grows by 1 line and 26 tokens, inside its ceiling. Nothing was deleted to pay for it. - Governed surface (`skills/**`, Tier H): this pull stays draft and requests no reviewer. ## Verification Two-minute check: `git diff origin/main...HEAD -- skills/` shows exactly two hunks, one sentence each. Then `node scripts/check-skills-token-ratchet.mjs`; expect a last line starting "✓ check-skills-token-ratchet: 60 authored bundle file(s) within their ceilings". 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01ADHkmRY38EZf38Yy3zthbY <!-- signed: repo:objectstack#2 · os-steve · session_01ADHkmRY38EZf38Yy3zthbY --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent cedc094 commit 0a6af56

3 files changed

Lines changed: 16 additions & 5 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/skills': patch
3+
---
4+
5+
docs(skills): the data skill teaches that a predicate update or delete of a `controlled_by_parent` detail writes the rows its by-id writes do
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
objectstack-data's `rules/relationships.md`, the `writeRequiresMasterRead: true` bullet under "Writes under `controlled_by_parent`": it no longer says the ownership floor (rows you created) binds a predicate update or delete. It now says a predicate (`multi: true`) update or delete writes the rows a by-id write of each would, all matched rows or none, which is what the runtime does since the change noted as "a predicate update or delete of a `controlled_by_parent` detail now writes every row its caller may write by id". The on-behalf-of half is unchanged: the floor still binds an on-behalf-of update or delete, for both users. `evals/objects-fields-relationships.json`, eval 17: its `expected_output` states the same rule; its assertions are unchanged.

‎skills/objectstack-data/evals/objects-fields-relationships.json‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -293,7 +293,7 @@
293293
{
294294
"id": 17,
295295
"prompt": "Order lines belong to orders. Anyone who can see an order should be able to add, change or remove its lines, as far as the line object's own permissions allow; nobody needs edit rights on the order itself for that. How do I declare the line's sharing?",
296-
"expected_output": "`order_line` is `sharingModel: 'controlled_by_parent'` with a required `master_detail` field to `order`, plus `sharing: { controlledByParent: { writeRequiresMasterRead: true } }`: read access to the order becomes the master question for every write (insert, update, delete, re-point), and the line's own object permissions, RLS and FLS decide the rest. Without the key every line write needs edit on the order. Not `ownerMayEdit` (only the owner's by-id update, and refused beside the new key), not the key one level up (`sharing.writeRequiresMasterRead`, refused), and not on a non-`controlled_by_parent` object (refused). The platform ownership floor still binds predicate and on-behalf-of updates and deletes.",
296+
"expected_output": "`order_line` is `sharingModel: 'controlled_by_parent'` with a required `master_detail` field to `order`, plus `sharing: { controlledByParent: { writeRequiresMasterRead: true } }`: read access to the order becomes the master question for every write (insert, update, delete, re-point), and the line's own object permissions, RLS and FLS decide the rest. Without the key every line write needs edit on the order. Not `ownerMayEdit` (only the owner's by-id update, and refused beside the new key), not the key one level up (`sharing.writeRequiresMasterRead`, refused), and not on a non-`controlled_by_parent` object (refused). A predicate (`multi: true`) update or delete writes the rows a by-id write of each would, all matched rows or none. The platform ownership floor still binds on-behalf-of updates and deletes, for both users.",
297297
"files": [],
298298
"assertions": {
299299
"must_contain": [

‎skills/objectstack-data/rules/relationships.md‎

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,10 +85,11 @@ sharing: { controlledByParent: { writeRequiresMasterRead: true } }, // or owner
8585
other write, on-behalf-of included, still needs master edit.
8686
- `writeRequiresMasterRead: true`: whoever reads the master inserts, updates and
8787
deletes the detail under its own object permissions, RLS and FLS (re-points and
88-
each opted-in chain hop too; on-behalf-of, both users must read the master). The
89-
ownership floor (rows you created) still binds predicate and, for both users, on-behalf-of
90-
updates and deletes. Refused beside `ownerMayEdit: true`, which it covers. Lint
91-
`security-controlled-by-parent-owner-policy-without-opt-in` is silent here.
88+
each opted-in chain hop too; on-behalf-of, both users must read the master). A
89+
predicate (`multi: true`) update or delete writes the rows a by-id write of each would,
90+
all matched rows or none. The ownership floor (rows you created) still binds, for both
91+
users, on-behalf-of updates and deletes. Refused beside `ownerMayEdit: true`, which it
92+
covers. Lint `security-controlled-by-parent-owner-policy-without-opt-in` is silent here.
9293

9394
The detail's own row policies AND in under both. Each is refused at parse under any
9495
other `sharingModel` and one level up (`sharing.KEY`).

0 commit comments

Comments
 (0)