Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions .changeset/37374-skills-view-all-modify-all-open-no-field.md
Original file line number Diff line number Diff line change
@@ -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.
14 changes: 11 additions & 3 deletions scripts/check-skills-token-ratchet.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions skills/objectstack-ai/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -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'`,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 }"],
Expand Down Expand Up @@ -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"],
Expand Down
3 changes: 1 addition & 2 deletions skills/objectstack-data/rules/relationships.md
Original file line number Diff line number Diff line change
Expand Up @@ -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(...)`)
Expand Down
2 changes: 1 addition & 1 deletion skills/objectstack-data/rules/security.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading