From 095abd43e8fb56e7539b8180ce7f03e7ad40fef1 Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 06:57:38 +0000 Subject: [PATCH 1/2] docs(skills): View All and Modify All open no field in the ai and data skills The ai skill's pitfall 2, the data skill's roll-up and high-sensitivity sentences, and two eval expected outputs taught the meaning before 19. Claude-Session: https://claude.ai/code/session_01L9qibxzmGoTjk1cdRnQ5FX Co-authored-by: Claude --- ...74-skills-view-all-modify-all-open-no-field.md | 15 +++++++++++++++ skills/objectstack-ai/SKILL.md | 4 ++-- .../evals/hooks-security-seeds-datasources.json | 4 ++-- skills/objectstack-data/rules/relationships.md | 3 +-- skills/objectstack-data/rules/security.md | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) create mode 100644 .changeset/37374-skills-view-all-modify-all-open-no-field.md diff --git a/.changeset/37374-skills-view-all-modify-all-open-no-field.md b/.changeset/37374-skills-view-all-modify-all-open-no-field.md new file mode 100644 index 00000000000..306711de983 --- /dev/null +++ b/.changeset/37374-skills-view-all-modify-all-open-no-field.md @@ -0,0 +1,15 @@ +--- +'@objectstack/skills': patch +--- + +docs(skills): the ai and data skills stop teaching that View All or Modify All opens a field + +Clause-②: no +Metadata-protocol: none + +From 19, View All (`viewAllRecords`) and Modify All (`modifyAllRecords`) widen records only and cast no field vote; `viewAllFields` is the one "every field" bit. Four published texts still taught the meaning before 19 and now teach this one: + +- `skills/objectstack-ai/SKILL.md` (pitfall 2): a field permission without `editable` binds every caller none of whose sets grants the field with an `editable: true` row. It no longer says Modify All grants that edit. +- `skills/objectstack-data/rules/relationships.md` (roll-up visibility): masking a summary on a permission set no longer asks to remove the set's Modify All on the parent first. The mask binds beside it. +- `skills/objectstack-data/rules/security.md` (high-sensitivity fields): `requiredPermissions` is strictest-wins over every field row and `viewAllFields`. View All and Modify All leave the list, since they are no field vote. +- `skills/objectstack-data/evals/hooks-security-seeds-datasources.json`: the expected outputs of cases 20 and 37 match the three sentences above. diff --git a/skills/objectstack-ai/SKILL.md b/skills/objectstack-ai/SKILL.md index 7a89e6400d0..a8cb31762fc 100644 --- a/skills/objectstack-ai/SKILL.md +++ b/skills/objectstack-ai/SKILL.md @@ -393,8 +393,8 @@ top-level `temperature` / `maxTokens`** (`packages/spec/src/ai/agent.zod.ts:37-4 action, whose body writes elevated (`isSystem`), over a field a non-system write cannot set. `readonly: true` binds every non-system caller (the value is stripped, **objectstack-data** → `readonly`); a field permission without - `editable` (refused `403`) binds only a caller no held set grants it, and - Modify All grants it, so an admin's agent still writes the field. The body + `editable` (refused `403`) binds only a caller none of whose sets grants it + with an `editable: true` row; Modify All is no such grant. The body skips the caller's edit right: declare who may run the action in its `requiredPermissions` (ADR-0066). A declarative `operation: 'update'` action, and a `flow` action under `runAs: 'user'`, diff --git a/skills/objectstack-data/evals/hooks-security-seeds-datasources.json b/skills/objectstack-data/evals/hooks-security-seeds-datasources.json index 8bc351cfd91..1cd33b53153 100644 --- a/skills/objectstack-data/evals/hooks-security-seeds-datasources.json +++ b/skills/objectstack-data/evals/hooks-security-seeds-datasources.json @@ -254,7 +254,7 @@ { "id": 20, "prompt": "Each `project` shows a `task_count` — the number of its `task` records (each task has a `project` lookup). Add a `client_viewer` permission set: clients read projects, but must never be able to read tasks.", - "expected_output": "`task_count` is a `summary` on `project` (`summaryOperations: { object: 'task', function: 'count' }`). `client_viewer` grants `project: { allowRead: true }` and no `task` entry — and because a roll-up covers every child row and answers only to the parent field's own access, the set also masks the summary: `fields: { 'project.task_count': { readable: false } }`, with no Modify All on `project` (it overrides the mask). The build then finishes without `security-rollup-source-unreadable`; the warning is resolved, not left standing or explained away, and not silenced by granting the `task` read the request forbids.", + "expected_output": "`task_count` is a `summary` on `project` (`summaryOperations: { object: 'task', function: 'count' }`). `client_viewer` grants `project: { allowRead: true }` and no `task` entry — and because a roll-up covers every child row and answers only to the parent field's own access, the set also masks the summary: `fields: { 'project.task_count': { readable: false } }`. The build then finishes without `security-rollup-source-unreadable`; the warning is resolved, not left standing or explained away, and not silenced by granting the `task` read the request forbids.", "files": [], "assertions": { "must_contain": ["function: 'count'", "'project.task_count': { readable: false }"], @@ -370,7 +370,7 @@ { "id": 37, "prompt": "In our HR app, `employee.salary` and `employee.id_number` must stay closed to everyone except HR specialists. Department managers hold a set with Modify All on `employee`, and they must not see either field in full. Everyone who can read an employee should still see the ID number partially masked, to confirm identity.", - "expected_output": "The gate goes on the fields, not in a permission set: `salary: { type: 'currency', requiredPermissions: ['hr.view_compensation'] }` and `id_number: { type: 'text', requiredPermissions: ['hr.view_identity'], maskingRule: 'id_card' }` on `employee`, and the `hr_specialist` set grants both capabilities in `systemPermissions: ['hr.view_compensation', 'hr.view_identity']`. `requiredPermissions` is strictest-wins over every field row, `viewAllFields`, View All and Modify All, so the managers' Modify All does not re-open either field: a caller without the capability gets `salary` stripped on read and reads `id_number` as its partial value (the `maskingRule`), and a write to either is denied. A permission set's `readable: false` row on `employee.salary` would not do: field rows union across sets, and another set's vote on the field (a `readable: true` row, `viewAllFields`, View All or Modify All) re-opens it.", + "expected_output": "The gate goes on the fields, not in a permission set: `salary: { type: 'currency', requiredPermissions: ['hr.view_compensation'] }` and `id_number: { type: 'text', requiredPermissions: ['hr.view_identity'], maskingRule: 'id_card' }` on `employee`, and the `hr_specialist` set grants both capabilities in `systemPermissions: ['hr.view_compensation', 'hr.view_identity']`. `requiredPermissions` is strictest-wins over every field row and `viewAllFields`, and the managers' Modify All opens no field (from v19 it widens records only): a caller without the capability gets `salary` stripped on read and reads `id_number` as its partial value (the `maskingRule`), and a write to either is denied. A permission set's `readable: false` row on `employee.salary` would not do: field rows union across sets, and another set's vote on the field (a `readable: true` row or `viewAllFields`) re-opens it.", "files": [], "assertions": { "must_contain": ["requiredPermissions", "maskingRule", "systemPermissions"], diff --git a/skills/objectstack-data/rules/relationships.md b/skills/objectstack-data/rules/relationships.md index ec39a4d7587..96898667a03 100644 --- a/skills/objectstack-data/rules/relationships.md +++ b/skills/objectstack-data/rules/relationships.md @@ -233,8 +233,7 @@ child object, the aggregated field, or a field `filter` tests. Decide per set from the request: it sees the children → grant the read; the total but not the children → keep the column readable and add `rollupSourceUnreadableReason` to the set's entry for it (the warning becomes a note quoting the reason; refused -blank or beside `readable: false`); neither → mask the summary on that set, -after removing any Modify All it holds on the parent (it overrides the mask). +blank or beside `readable: false`); neither → mask the summary on that set. Never add the reason to silence a total the request withholds: mask it. A permission set (in TypeScript, the argument of `definePermissionSet(...)`) diff --git a/skills/objectstack-data/rules/security.md b/skills/objectstack-data/rules/security.md index a8ee8ac8640..191cd5c322f 100644 --- a/skills/objectstack-data/rules/security.md +++ b/skills/objectstack-data/rules/security.md @@ -268,7 +268,7 @@ filter: [{ field: 'api_key', operator: 'is_not_null' }] // list view **High-sensitivity fields — `requiredPermissions` (ADR-0066 D3).** The field is **stripped on read and denied on write** unless the caller holds ALL listed capabilities (a set's `systemPermissions`): strictest-wins over every field -row, `viewAllFields`, View All and Modify All. With `maskingRule`, a caller +row and `viewAllFields`. With `maskingRule`, a caller without them reads the partial value. ```typescript From a788fbfbf1176bc61f1b48f6e5969b2c3bb3956e Mon Sep 17 00:00:00 2001 From: Claude Date: Fri, 27 Nov 2026 07:07:53 +0000 Subject: [PATCH 2/2] chore(skills): lower three token-ratchet rows to the measured counts The ai skill, relationships.md and security.md shrank; each row follows its measurement down. Claude-Session: https://claude.ai/code/session_01L9qibxzmGoTjk1cdRnQ5FX Co-authored-by: Claude --- scripts/check-skills-token-ratchet.mjs | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/scripts/check-skills-token-ratchet.mjs b/scripts/check-skills-token-ratchet.mjs index 90f6d45fe5c..b63aaf09e74 100644 --- a/scripts/check-skills-token-ratchet.mjs +++ b/scripts/check-skills-token-ratchet.mjs @@ -439,7 +439,9 @@ export const CEILINGS = new Map([ // CEILING_BASIS.strippedInternalIds. `(was N)` is the ceiling this replaced. // Every SKILL.md row was later lowered by exactly 5 when its release-stamp // line left the count (A2′, see STAMP_LINE_REPIN) — its headroom did not move. - ['skills/objectstack-ai/SKILL.md', 6801], // -18 (was 6824), then -5 A2′ (was 6806) + // 6801 -> 6800: pitfall 2 no longer says Modify All grants a field edit (19: View All and + // Modify All cast no field vote). 27230 -> 27225 bytes; the row follows the measurement down. + ['skills/objectstack-ai/SKILL.md', 6800], // -18 (was 6824), then -5 A2′ (was 6806) // -12 (was 6331): the `http.server` decision-table row dropped a trailing // clause that taught `contributes.routes` as a key that "parses but serves // nothing". The key is retired — an authored entry is now REFUSED, carrying @@ -1266,7 +1268,10 @@ export const CEILINGS = new Map([ // the summary field and the permission set as JSON; the commented-out alternatives // became a sentence and a second field entry. 16884 -> 16811 bytes. // ceil($(wc -c < skills/objectstack-data/rules/relationships.md) / 4) == ceil(16811 / 4) - ['skills/objectstack-data/rules/relationships.md', 4201], // -2 to the measurement (was 4203) + // 4201 -> 4181: the roll-up visibility paragraph no longer asks to remove Modify All before + // masking a summary (19: it overrides no mask). 16801 -> 16723 bytes. + // ceil($(wc -c < skills/objectstack-data/rules/relationships.md) / 4) == ceil(16723 / 4) + ['skills/objectstack-data/rules/relationships.md', 4181], // -2 to the measurement (was 4203) // NEW FILE (#14296 item 1 = A, condition (b)): the entry's Security & Access // Control block moved here whole. Pinned at its landed count — no headroom, // because a split that arrives with budget is a raise wearing a new path. @@ -1411,7 +1416,10 @@ export const CEILINGS = new Map([ // The bullet adds 248 bytes, the cut removes 59: 17168 -> 17357 bytes -> 4340 tokens, // headroom 0 before, ceiling +48, the measured remainder only, pinned AT the measurement. // ceil($(wc -c < skills/objectstack-data/rules/security.md) / 4) == ceil(17357 / 4) - ['skills/objectstack-data/rules/security.md', 4340], + // 4340 -> 4334: the `requiredPermissions` sentence no longer lists View All and Modify All + // beside the field votes it beats (19: they cast none). 17357 -> 17335 bytes. + // ceil($(wc -c < skills/objectstack-data/rules/security.md) / 4) == ceil(17335 / 4) + ['skills/objectstack-data/rules/security.md', 4334], // 3024 -> 3109 (2026-08-31 app-repo-principles raise, see the block above). // Severity Levels listed the three values and left the CHOICE unstated: a // block rests on a judgement a person made, so a machine-inferred signal — a