Skip to content

Commit 8a60f50

Browse files
docs(adr-0066, permissions): Modify All's own-row field vote is kept until the field-axis split (#34483)
Fixes #33828 Clause-②: no Metadata-protocol: none This is the last item owed on the card after #34082 merged (`3e490335`). It is a docs-only follow-up with two files and nine changed lines. **Tier H**: the diff touches `docs/adr/**`, so it lands only by the maintainer's hand or an authorized approval. ## 维护者速读 - 改了什么:ADR-0066 D2 ⑧ 2026-11-15 注里关于"修改全部"(Modify All)的那句,从"保持不变,等待裁决"改为"按 #33828 上的裁决 A(「保持现状,只给警告」)保持不变,直到字段轴拆分(#34365)";`field-level-security.mdx` 的默认可见段落补上 #34082 推迟的那一行:权限集自己的 View All 不再解开自己的 `readable: false`,自己的 Modify All 仍然解开(lint 给警告),直到字段轴拆分。 - 为什么改:维护者 2026-11-16 在本卡对 Modify All 选了 A(评论 6909362597);#34365 的裁决(6912661484)要求这句写成"保留到字段轴拆分",不写成"设计如此"。#34082 合并后只剩这两处文字没跟上。 - 风险与回滚:只改文档,不改代码、spec 或 `skills/**`,运行时行为不变,不发版。回滚即 revert 本 PR。 - 先看:① `docs/adr/0066-unified-authorization-model.md` 第 144 行 2026-11-15 注中加粗的 Modify All 那句(受管文本,本 PR 唯一的风险点);② `content/docs/permissions/field-level-security.mdx` 第 199–208 行。 - 两分钟验证:`git grep -n "pending a ruling" origin/main -- docs/adr/0066-unified-authorization-model.md` 有 1 处命中,在本分支上同一命令无命中;再打开 mdx 第 203 行,预期看到 "until the field-axis split (#34365)"。 - 需要你做的:审阅 ADR-0066 这一句受管文本,同意后批准或亲自合并(Tier H)。 ## What changes **`docs/adr/0066-unified-authorization-model.md`**, the D2 ⑧ note of 2026-11-15, one sentence. Only its bold lead changes: - Before: `**Modify All is unchanged, pending a ruling:** a set that holds ...` - After: `**Modify All is unchanged, kept until the field-axis split (#34365), by the maintainer's ruling on the card of 2026-11-16 (6909362597, letter A), verbatim 「保持现状,只给警告」 (keep the current behaviour, warn only):** a set that holds ...` The rest of the sentence (the set still votes `readable: true` and `editable: true` on every field, its own rows included) and the rest of the note are unchanged. The wording follows cross-link 6912701885 and ruling 6912661484 on #34365: "kept until the field-axis split", not "kept by design". The ruling is quoted in the original Chinese. **`content/docs/permissions/field-level-security.mdx`**, the default-visible paragraph. This is the line #34082 deferred ("Its sentence that a mask holds unless another set unmasks it does not name the own-set Modify All case; that line belongs with the Modify All ruling"). The sentence's condition gains its own-set half: - Before: `... or Modify All (modifyAllRecords, reads and edits every field) on that object — so protect sensitive fields ...` - After: `... on that object, and the set that declares it does not itself hold Modify All on that object: the set's own View All leaves its readable: false binding, while its own Modify All still reads and edits every field of the object, its own rows included (security-superuser-field-mask-inert warns on such a row), until the field-axis split (#34365) — so protect sensitive fields ...` The paragraph is about the condition under which a mask holds, so it states both own-set cases. The View All clause is the rule #34082 landed. ## Why - The maintainer ruled A on the Modify All half of the card (6909362597): 「保持现状,只给警告」. Modify All keeps its behaviour, and the warning is the only change. - Ruling 6912661484 on #34365 sets the end state (record axis and field axis split, a read-only `viewAllFields`). Modify All keeps today's behaviour until that split, so the ADR says "kept until", not "kept by design". - Hand-off 6912083426 and delivery note 6930255285 name exactly these two items as what the card still owes. ## Verification Each sentence was checked against the code on `origin/main` (`3bf9c5c41`, which contains `3e490335`): - **Modify All votes on every field, its own rows included.** `superuserFieldVote` in `packages/core/src/security/effective-object-permissions.ts` returns `{ readable: true, editable: true }` for any set where `holdsSuperuserBypass(ps, objectName, 'modify')` holds, before the set's own row is read. The own-row check (`declaresOwnReadMask`) runs only on the View All path. - **The set's own View All leaves its `readable: false` binding.** The same function skips a View All set when `declaresOwnReadMask(ps, objectName, fieldName)` is true. That check reads the set's own `<object>.<field>` row for an explicit `readable === false`. - **Warn only, no save refused.** `security-superuser-field-mask-inert` in `packages/lint/src/validate-security-posture.ts` fires only when `holdsSuperuserBypass(ps, flsObject, 'modify')` holds, and pushes `severity: 'warning'`. The authoring gate refuses on `error` findings only (`authoring-rules.ts`, `errors: findings.filter((f) => f.severity === 'error')`). <details><summary>Gates</summary> On head `e025d4c6f`. The diff touches no package, so no closure build was owed. The gates that read built output had their closure built first under `scripts/pm/os-verify-lock.sh`: `@objectstack/lint...` (exit 0), then `@objectstack/client-react...` (exit 0). - `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` derived 50 commands for the two paths. The repo assertion holds. - One hold of the verify lock ran all 50 (`VERDICT command-exit 0`, held 523 s on a shared box). Results: 49 exited 0. `pnpm --filter @objectstack/spec run check:skill-examples` exited 3 (PREREQUISITE NOT MET, nothing measured) because client-react's `dist` was missing. After that build it exited 0 in its own hold (`VERDICT command-exit 0`): "347 prose examples type-check across 3 surface(s)". - `--ran` reconciliation: `✓ dispatch-gates --ran: 50 derived famil(ies) accounted for — 50 run, 0 NOT-MEASURED (a DERIVED zero — all 50 recorded an exit code and none of them is 3).` - `pnpm check:nul-bytes` (in the derived list) exited 0. A control-byte scan of both files found no hits. - Not run locally, and owned by CI: the repo-wide `pnpm lint`, `test:repo`, and the dogfood battery. The title carries no `!` and there is no `(narrowing)` arm, so the battery is not owed. </details> <details><summary>Overlap and changeset</summary> - `git merge-tree --write-tree origin/main HEAD` exited 0 against `origin/main` at `e8cba8fed`. Neither file changed on `main` since the base. Neither path goes through the regeneration merge driver (`.gitattributes` routes only `content/docs/references/**` and `content/docs/ui/components/**` under `content/docs`). - The file lists of all 48 open PRs were read. None touches either file. The 20 that list no files report `changed_files=0`; these are mailbox PRs, checked one by one. - No changeset. No published package's `files[]` ships `content/docs/` or `docs/adr/`, so this PR releases nothing. The PR declares `skip-changeset` at creation (route 2 of `Check Changeset`). It edits no existing `.changeset/*.md`. </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (No schema touched.) - [x] 2. Every name I added uses the casing for its kind. (No names added.) - [x] 3. No formatter ran; `pnpm lint` passes. (No formatter ran. The repo-wide lint is CI's run.) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (Publishes nothing; both lines are above.) - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (Not touched.) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (The maintainer quick-read section is in Chinese by the dispatch contract. The ruling is quoted in the original.) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01FEkQ5nNrLRm8ssuwWcBVcw <!-- signed: repo:objectstack#1 · os-project-manager · session_01FEkQ5nNrLRm8ssuwWcBVcw --> Co-authored-by: Claude <noreply@anthropic.com>
1 parent f7b2d02 commit 8a60f50

2 files changed

Lines changed: 7 additions & 2 deletions

File tree

‎content/docs/permissions/field-level-security.mdx‎

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,7 +200,12 @@ out-votes another set's `false`). Until a subtractive muting layer lands
200200
(ADR-0066 ⑧), a `{ readable: false }` rule masks the field only as long
201201
as **no other set the user holds** declares it `readable: true` or holds
202202
View All (`viewAllRecords`, reads every field of the object) or Modify All
203-
(`modifyAllRecords`, reads and edits every field) on that object — so
203+
(`modifyAllRecords`, reads and edits every field) on that object, and
204+
the set that declares it does not itself hold Modify All on that object:
205+
the set's own View All leaves its `readable: false` binding, while its
206+
own Modify All still reads and edits every field of the object, its own
207+
rows included (`security-superuser-field-mask-inert` warns on such a row),
208+
until the field-axis split (#34365) — so
204209
protect sensitive fields by granting them only in the sets that need
205210
them, and treat a sensitive field on a broadly-granted object as a
206211
review smell — see the

‎docs/adr/0066-unified-authorization-model.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ Captured for the record; **out of scope for Phases 1–4 above**. Each is anchor
141141

142142
> **Note (2026-11-02) — a super-user set votes on every field of its object (#29106, ruling of record 6573563853, letter A).** In the field-permission merge, a permission set that holds the super-user bypass on an object now votes on **every** field of that object: `viewAllRecords` votes `readable: true`, and `modifyAllRecords` votes `readable: true` and `editable: true`. View All never grants an edit. Who holds the bypass is the row-level answer: the set's own entry for the object if it has one, otherwise its `'*'` wildcard. One function answers it, `holdsSuperuserBypass` (`packages/core/src/security/effective-object-permissions.ts`). `PermissionEvaluator.superuserBypassSets` reads it directly, and both field merges, `getFieldPermissions` and the row-blind `/auth/me/permissions` merge (`buildEffectiveFieldPermissions`), read it through `superuserFieldVote`. So every reader of the merge answers the same: the list projection, record read, the sort and filter gate, the field-level write gate, `/auth/me/permissions` and `os explain`. Before this, a set that granted the object through its super-user bits but declared no field entry cast no vote, so an app set's `readable: false` hid the field from a platform admin who also held the app set. Union without deny is otherwise unchanged. A caller who holds no super-user set on the object is still narrowed by a declared mask, and a field's `requiredPermissions` capability gate still applies to everyone. One consequence: a set can no longer withhold a field from its own View All / Modify All holders. To withhold a field, grant the object without those bits. Taking a field away from a super-user remains the job of the muting/deny layer ⑦ still owes.
143143

144-
> **Note (2026-11-15) — a set's own `readable: false` row wins over that set's own View All vote (#33828, maintainer ruling on the card, letter A).** The ruling, as the card states it: "A, platform. An explicit `readable: false` field-permission row on a permission set must win over that same set's View All (`viewAllRecords`) field vote. This amends ADR-0066 D2 ⑧ as amended by ruling of record 6573563853." In the field-permission merge, a set that holds View All on an object (its own entry for the object if it has one, otherwise its `'*'` wildcard) and does not hold Modify All on it casts **no read vote on a field its own `fields` row declares `readable: false`**. That row is the set's whole say on the field, so a set can grant View All on an object and still hide a field of it from its holders. "Explicit" is literal: an omitted `readable` parses to `true` and is never a mask. The rest of the 2026-11-02 note stands. **Another** set's View All or Modify All on the object still makes the field readable (and, under Modify All, editable) for a caller who holds both sets, which is the platform-admin case ruling 6573563853 fixed. The same set's View All still votes on every field it does not mask itself. View All never granted an edit, so an edit lock beside it binds as before. **Modify All is unchanged, pending a ruling:** a set that holds `modifyAllRecords` on the object still votes `readable: true` and `editable: true` on every field of it, its own rows included, so its own `readable: false` or edit lock binds none of its holders. This note replaces, **for View All only**, the 2026-11-02 note's sentence "a set can no longer withhold a field from its own View All / Modify All holders"; for Modify All that sentence still holds, and a field is withheld from a Modify All set's holders by granting the object without that bit. One function answers the per-field vote, `superuserFieldVote` (`packages/core/src/security/effective-object-permissions.ts`), asked with the field's name by both field merges, `getFieldPermissions` and the row-blind `/auth/me/permissions` merge (`buildEffectiveFieldPermissions`), so every reader of the merge answers the same. The lint rule `security-superuser-field-mask-inert` reports only a row its own set's Modify All unbinds; a `readable: false` beside the set's own View All is no longer reported. Taking a field away from a caller whom another set serves it to remains the job of the muting/deny layer ⑦ still owes.
144+
> **Note (2026-11-15) — a set's own `readable: false` row wins over that set's own View All vote (#33828, maintainer ruling on the card, letter A).** The ruling, as the card states it: "A, platform. An explicit `readable: false` field-permission row on a permission set must win over that same set's View All (`viewAllRecords`) field vote. This amends ADR-0066 D2 ⑧ as amended by ruling of record 6573563853." In the field-permission merge, a set that holds View All on an object (its own entry for the object if it has one, otherwise its `'*'` wildcard) and does not hold Modify All on it casts **no read vote on a field its own `fields` row declares `readable: false`**. That row is the set's whole say on the field, so a set can grant View All on an object and still hide a field of it from its holders. "Explicit" is literal: an omitted `readable` parses to `true` and is never a mask. The rest of the 2026-11-02 note stands. **Another** set's View All or Modify All on the object still makes the field readable (and, under Modify All, editable) for a caller who holds both sets, which is the platform-admin case ruling 6573563853 fixed. The same set's View All still votes on every field it does not mask itself. View All never granted an edit, so an edit lock beside it binds as before. **Modify All is unchanged, kept until the field-axis split (#34365), by the maintainer's ruling on the card of 2026-11-16 (6909362597, letter A), verbatim 「保持现状,只给警告」 (keep the current behaviour, warn only):** a set that holds `modifyAllRecords` on the object still votes `readable: true` and `editable: true` on every field of it, its own rows included, so its own `readable: false` or edit lock binds none of its holders. This note replaces, **for View All only**, the 2026-11-02 note's sentence "a set can no longer withhold a field from its own View All / Modify All holders"; for Modify All that sentence still holds, and a field is withheld from a Modify All set's holders by granting the object without that bit. One function answers the per-field vote, `superuserFieldVote` (`packages/core/src/security/effective-object-permissions.ts`), asked with the field's name by both field merges, `getFieldPermissions` and the row-blind `/auth/me/permissions` merge (`buildEffectiveFieldPermissions`), so every reader of the merge answers the same. The lint rule `security-superuser-field-mask-inert` reports only a row its own set's Modify All unbinds; a `readable: false` beside the set's own View All is no longer reported. Taking a field away from a caller whom another set serves it to remains the job of the muting/deny layer ⑦ still owes.
145145
- **⑨ Authoring-time validation for capability references** *(recorded 2026-07 pre-launch architecture assessment)*. `systemPermissions` / `requiredPermissions` are free strings today; a typo (`mange_users`) fails closed at runtime — the safe direction — but is undiscoverable: nothing reports that the referenced capability exists nowhere. When D1 lands the `sys_permission` registry, add the authoring/publish-gate lint alongside it: referencing an unregistered capability warns at author time (consistent with ADR-0049 honesty and the contract-first Prime Directive — reject at the producer, don't tolerate at the consumer). **Landed (2026-07):** `validateCapabilityReferences` in `@objectstack/lint` warns (never errors — cross-package capabilities and the fail-closed runtime make a hard gate wrong) when a `requiredPermissions` reference resolves against neither the built-in set (`@objectstack/spec` `PLATFORM_CAPABILITY_NAMES`), nor a capability the stack grants via a permission set's `systemPermissions`, nor a `sys_capability` seed row. Wired into `os validate` and `os lint`. `systemPermissions` (the declaration side) is deliberately not flagged.
146146

147147
> **Note (2026-10-14) — ⑨'s seed-row source is gone.** With `sys_capability` retired by #15204

0 commit comments

Comments
 (0)