Repository navigation
docs(adr): ADR-0139 / ADR-0055 record the view-all unrestricted-reader chain drop (#33696 ruling) - #33992
Conversation
…r chain drop Ruling record 6893666857 (the maintainer's re-ruling, replacing record 6893097935) lifts ADR-0139 D6's no-interim-removal prohibition for one reader class and nothing else: a reader who holds view-all on the detail AND whose every master hop answers unrestricted (the engine's per-hop scope), with a required master FK. Every other reader keeps the chain. - ADR-0139: a dated status-line entry, and a dated D6 paragraph carrying the ruling's binding bullets verbatim. D6's other prohibition (an interim with two spellings of one scope) stands. - ADR-0055: a status entry, a note under the 2026-10-22 entry, and in-place notes at section 2 and under "The rules the read keeps" of the 2026-11-06 amendment, so the rows-with-no-master rule reads as one statement. Append-only: insertions only, no existing line changed. Declares only; the code change is a separate card and by the ruling lands after this one. Claude-Session: https://claude.ai/code/session_01ADHkmPhSc3AHNRvPRkKRq8 Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv Contract reviewServed-tier: Read for this record: card #33820 (body, triage 6895962425, claim 6896544053, os-dev report 6896944503); ruling record 6893666857 on #33696 and the record it replaces, 6893097935, both read from the issue; PR #33992 body, file list and net diff against Check-runs on this head (46): none failed. Completed green: Check Documentation Links, Governed Surface Queue Guard, PR-body guards, Check Changeset, Check PR Size, Lint · PM dispatch-gates, the three ① Derived judgmentsEach rule statement the amendment makes, against the verbatim text of 6893666857:
② Semver levelNone. Docs only under ③ Boundary flags
④ Design judgmentdocs/adr/0139-… True to the ruling, readable alone, and no contradiction is left standing in D6 or the status paragraph. The class, the lifted item, the untouched item and the landing order are each stated once in the status entry and once, with the verbatim bullets, in D6. docs/adr/0055-… True to the ruling. The fullest statement is the note under "The rules the read keeps", which also dates the two older "unchanged" claims for a required master. The status entry reaches it by pointer. Security judgment: the amendment states the ruling's reader class exactly and neither widens nor narrows it. No security item is raised on the code read for this review.
No must-fix. One should-fix (S1), three nits. Implemented-by: VERDICT: PASS |
Two of the lines this branch added to ADR-0055 are reworded; no base line changes and ADR-0139 is untouched. - The 2026-11-15 note in section 2 now names the whole reader class: the per-hop qualifier after "every master hop answers unrestricted", and "inside its own tenant wall" for the rows that reader sees. - The mark under the 2026-10-22 status entry states the rule (the parent chain is dropped for one reader class) and no longer describes the shape of a read. Claude-Session: https://claude.ai/code/session_01ADHkmPhSc3AHNRvPRkKRq8 Co-authored-by: Claude <noreply@anthropic.com>
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv Contract reviewServed-tier: Delta record. It follows record 6896995006 (PASS on head Read for this record: the commit's diff and the net diff against Check-runs on this head (45): none failed and none cancelled. Completed green: Lint · docs & code guards, Lint · repo & tooling gates, Lint · ESLint, Lint · PM dispatch-gates, the three ① Derived judgmentsBoth changed lines, against the verbatim text of 6893666857:
② Semver levelUnchanged from 6896995006: none. Docs only, no changeset, ③ Boundary flags
④ Design judgmentdocs/adr/0055-… The §2 note is now a complete statement on its own, and it agrees word for word in substance with the status entry and the note under "The rules the read keeps". No contradiction inside the file. docs/adr/0139-… Unchanged; the judgment in 6896995006 stands. Security judgment: the amendment states the ruling's reader class exactly in every place that states it, and neither widens nor narrows it.
No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv 维护者速读
席位核对Verdict: ACCEPT, held for the maintainer · head
|
…MasterRead reviews (objectstack-ai#34075) <!-- claude-projects-attribution: {"github_login":"os-steve"} --> _Requested by **Steve** · [project thread](https://claude.ai/code/project/chan_01FdL1XeUyvVNxLreh3F4Qi9?thread=cmsg_01FdL1XeUyvVNxLreh3F4Qi9B6XCSGFtBWMTfzkHVAwJSu)_ Fixes objectstack-ai#33432 Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:ADR-0055 补 5 处措辞(7 Sep 链式写入条与 7 Nov 状态行加⚠️ 指向 11-14 修订、"every refusal" 收窄为 "every master-gate refusal"、裁决原文补上末句「HotCRM 的设计授权全部兑现。」、补一句"读不到主记录的人按条件批量写入时什么都不写");data 技能 relationships.md 两处措辞、对应 eval 加 3 条 must_not_contain。 - 为什么改:两次契约复审留下的措辞尾巴。旧措辞会让读者以为开了 writeRequiresMasterRead 后设置主记录仍要编辑权,从而给主记录多授编辑权。 - 风险与回滚:纯文字,无代码、无契约改动;技能文件 token 数不变(4232/4232),棘轮行未动。回滚即 revert 本 PR。 - 先看:docs/adr/0055-master-detail-controlled-by-parent.md(第 10、141、273、286、298 行),skills/objectstack-data/rules/relationships.md(第 85–91、110–111 行)。 - 两分钟验证:`node scripts/check-skills-token-ratchet.mjs && pnpm check:adr-symbol-anchors && pnpm check:adr-index`,预期全部 exit 0,relationships.md 显示 4232 / 4232。 - 需要你做的:批准本 PR(受管面 Tier H,docs/adr/** 与 skills/**)。 ## What changes **`docs/adr/0055-master-detail-controlled-by-parent.md`** (review 6883816828, nits 1 to 5; every nit re-read on main `e71ecc1b`, none already settled, so none dropped). The 2026-11-15 notes from PR objectstack-ai#33992 (objectstack-ai#33696) are untouched. 1. The 2026-09-07 amendment's **Write** bullet ("running the same three master-edit legs … on every hop") keeps its sentence and gains an in-place `⚠️ Amended 2026-11-14 (objectstack-ai#33250 / PR objectstack-ai#33369)` note: a hop that declares `writeRequiresMasterRead` asks read and ends the walk (`security-plugin-cbp-write-gate.ts#assertControlledByParentChainEditable`), pointing to the 2026-11-14 amendment. 2. The 2026-11-07 status line ("setting a master asks edit on it, emptying one asks edit on the stored master") gains a⚠️ note in the form the 2026-10-26 line already carries: on an opted-in detail the new and the stored master are each asked read; the null-master owner rule is unchanged. `scripts/adr-index.mjs --json` output is byte-identical before and after (`cmp` exit 0): its status reader reads only the `**Status**:` line. 3. "### The invariant": "every refusal still says 'requires edit access'" → "every master-gate refusal …" (the 2026-11-07 null-master owner refusal never said that; the code agrees: `masterGateRefusalUserCopyOf` answers `undefined` for it). 4. The ruling quote is called verbatim and now is: the record 6880588685's last sentence 「HotCRM 的设计授权全部兑现。」 is added, byte-identical to the record's option text (141 bytes each), and the English gloss covers it. 5. "What a refusal answers" gains the predicate case: a predicate (`multi: true`) update or delete by a caller who cannot read the master selects none of that master's rows, judges no master for them and writes none of them, with no refusal, as on a detail that does not opt in. Verified by reading main: `security-plugin-addressed-writes.ts#readableRowsScopeForPredicateWrite` narrows the matched set to readable rows, and `security-plugin-cbp-write-gate.ts#controlledByParentPredicateWriteMasters` judges the masters of those rows only; the opt-in never touches the read side (zero `writeRequiresMasterRead` hits in the read filter, addressed-writes and authz middleware). Worded per master, because one predicate can also select rows under masters the caller does read. **`skills/objectstack-data/rules/relationships.md`** (review 6883930925): - N1: "(even under `ownerMayEdit`; read under `writeRequiresMasterRead`)" → "(both even under `ownerMayEdit`; read for both under `writeRequiresMasterRead`)": setting and emptying a master both ask read under the key. - N2: the ownership floor now binds on-behalf-of updates and deletes "for both users" (ADR-0055 2026-11-14: a delegated by-id write keeps both principals' floors, ADR-0090 D10). - Paid by one cut in the same section (standing ruling 「A:先削重复,余额按实测提高」): the `ownerMayEdit` bullet's list "insert, delete, predicate (`multi: true`) updates and on-behalf-of writes still need master edit" → "every other write, on-behalf-of included, still needs master edit". Surviving homes: the section's own default two lines above ("by default, every write needs edit on the master") with the bullet's "only"; the `multi: true` gloss lives in `references/data-hooks.md` and `rules/security.md`. No re-wrap pays for anything. **`skills/objectstack-data/evals/objects-fields-relationships.json`**: the `writeRequiresMasterRead` case (found by content, `id: 17`) gains three `must_not_contain` strings: both orders of `ownerMayEdit: true` beside the key, and the key on the `master_detail` field (`required: true, writeRequiresMasterRead`). None occurs in the case's own `expected_output`; all four `must_contain` strings do. No other case changes (JSON compare against the base). **`.changeset/33432-cbp-write-opt-in-wording.md`**: `@objectstack/skills` patch, carrying both declaration lines. ### Token readings (`ceil(utf8 bytes / 4)`, `node scripts/check-skills-token-ratchet.mjs`) | Reading | Before | After | |---|---|---| | `rules/relationships.md` (ceiling 4232) | 4232 (16925 bytes) | 4232 (16925 bytes), headroom 0, row unchanged | | `evals/objects-fields-relationships.json` (not ratcheted) | 5466 | 5511 | | Whole `skills/objectstack-data` package | 52950 | 52995 | | Sum of all `SKILL.md` | 59218 | 59218 | | Bundle total (whole shipped tree) | 246388 | 246433 | The +45 is the eval file alone. ## Why Authors and agents read ADR-0055 and the data skill to decide which grant a detail write asks. A stale bullet or an open-scoped parenthetical tells some readers that setting a master still asks edit under the opt-in, and they over-grant edit on the master to get a write through. ## Acceptance notes - **Authoring tier (deviation, declared).** `dispatch-gates --tier` makes the contract-review tier MANDATORY for `docs/adr/**` and `skills/**`; the card thread is served below it, so the text was authored and committed by an isolated os-dev subagent pinned to that tier on this branch. The thread merged main, ran the gates, opened this PR and wrote the report. - Observation, nothing filed: the 2026-11-07 "Chains" bullet ("a chain hop with no master of its own ends the chain under the same rule") carries no 2026-11-14 note; the 2026-11-14 Gate bullet covers it in general terms. Not one of the five nits. - Carrier objectstack-ai#33696: once its code lands, one reader class reads a required master's empty or dangling rows; the 404 sentence and the new predicate sentence both rest on "a detail row's read derives from its master (§2)" and will need that card's note. - Eval limits: the three strings catch single-line spellings only. The case's `expected_output` still says the floor "binds predicate and on-behalf-of updates and deletes" (true, not refined to "both users"); left, since only `must_not_contain` was in scope. - Forced test edits: none. ## Verification Head `e84ff32f` (base `fb79d47c` + merge of main `e71ecc1b`). `node scripts/pm/dispatch-gates.mjs --commands` derived 51 commands; each run with its exit captured before any pipe, then reconciled with `--ran`. <details><summary>Gate readings</summary> Run on head `e84ff32f`, 51/51 exit 0. `check:dual-build-cjs-loads` first answered exit 3 (PREREQUISITE NOT MET: needs every package dist); after `turbo run build --filter='./packages/**'` under `os-verify-lock` (VERDICT command-exit 0, 5m47s) it answered exit 0. `--ran` reconciliation: "51 derived famil(ies) accounted for — 51 run, 0 NOT-MEASURED (a DERIVED zero)". Also exit 0 on the authored head `c5cc5319`: `pnpm check:skill-eval-tokens` (ui), `pnpm --filter @objectstack/spec check:skill-docs`, `check:skill-refs`, `check:skill-examples`, `node scripts/adr-index.mjs --check`, `check-skills-token-ratchet.mjs --self-test` (104 cases). ```text node scripts/check-adr-0087-registration.mjs --base origin/main :: exit 0 node scripts/check-adr-0087-registration.mjs --self-test :: exit 0 node scripts/check-adr-links.mjs :: exit 0 node scripts/check-adr-links.mjs --self-test :: exit 0 node scripts/check-changeset-no-major.mjs --base origin/main :: exit 0 node scripts/check-closing-keyword-parity.mjs :: exit 0 node scripts/check-closing-keyword-parity.mjs --self-test :: exit 0 node scripts/check-comment-mask-corpus.mjs :: exit 0 node scripts/check-doc-route-spelling.mjs --advisory :: exit 0 node scripts/check-doc-route-spelling.mjs --self-test :: exit 0 node scripts/check-dts-emitted.mjs --self-test :: exit 0 node scripts/check-empty-changeset.mjs --base origin/main :: exit 0 node scripts/check-empty-changeset.mjs --self-test :: exit 0 node scripts/check-skills-token-ratchet.mjs :: exit 0 node scripts/check-skills-token-ratchet.mjs --self-test :: exit 0 node scripts/ci/assert-turbo-remote-cache.mjs --self-test :: exit 0 node scripts/ci/plan-test-core-shards.mjs --self-test :: exit 0 node scripts/ci/prune-turbo-cache.mjs --self-test :: exit 0 node scripts/ci/snapshot-next.mjs --self-test :: exit 0 node scripts/pm/check-governed-queue-guard.mjs --self-test :: exit 0 node scripts/pm/release-rehearsal-clone.mjs --self-test :: exit 0 node scripts/release-pending-publish.mjs --self-test :: exit 0 pnpm --filter @objectstack/lint run check:doc-formula-expressions :: exit 0 pnpm check:adr-anchors :: exit 0 pnpm check:adr-index :: exit 0 pnpm check:adr-symbol-anchors :: exit 0 pnpm check:agent-test-spelling :: exit 0 pnpm check:changeset-gate-self-tests :: exit 0 pnpm check:ci-filter-parity :: exit 0 pnpm check:closed-ceremony-text :: exit 0 pnpm check:corpus-claim-drift :: exit 0 pnpm check:cross-package-test-inputs :: exit 0 pnpm check:doc-authoring :: exit 0 pnpm check:driver-memory-census :: exit 0 pnpm check:dts-closure :: exit 0 pnpm check:dual-build-cjs-loads :: exit 0 pnpm check:gitlink-declared :: exit 0 pnpm check:lean-entry-closure :: exit 0 pnpm check:nul-bytes :: exit 0 pnpm check:pm-governed-merges :: exit 0 pnpm check:pm-prior-rulings :: exit 0 pnpm check:pm-skill-id-lint :: exit 0 pnpm check:published-files :: exit 0 pnpm check:refd-timer-probe :: exit 0 pnpm check:role-word :: exit 0 pnpm check:skill-compatibility :: exit 0 pnpm check:skill-frame-sync :: exit 0 pnpm check:skill-identifier-liveness :: exit 0 pnpm check:skill-links :: exit 0 pnpm check:sourcemap-no-sources-content :: exit 0 pnpm check:watch-hint-literal :: exit 0 ``` </details> ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not 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 code changed; `pnpm lint` was not run locally, CI runs it) - [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. - [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. - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01ADHkmSuNnnr3JQjtkn1a28)_ Co-authored-by: Claude <noreply@anthropic.com>
Requested by Steve · project thread
Fixes #33820
Clause-②: no
Metadata-protocol: none
Ruling-ref: 6893666857
Records the maintainer's re-ruling on #33696, option 「只对管理员去掉」 (record 6893666857, 2026-11-15T11:31Z, replacing 6893097935), in ADR-0139 and ADR-0055. This is the governed precondition the ruling names: #33696's code (draft PR #33897) must not land before this PR merges.
维护者速读
git diff --numstat origin/main...HEAD,预期只有两行6 0 docs/adr/0055-…与37 0 docs/adr/0139-…,删除数都是 0。What changes
docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md(+37 / −0), two insertions:**Amended** (2026-11-15)entry at the end of the Status paragraph. D6's ⛔ on "interim removal of the predicate for an unrestricted master scope" (plugin-security: a controlled_by_parent child's read loads every readable master id with no limit (twice per request), so its CPU grows with the master table and the read answers 500 "too many SQL variables" past ~32.8k masters #24932 ruling B item 4) is lifted for one reader class and nothing else: a reader who holds view-all on the detail AND whose every master hop answers unrestricted (the engine's per-hop scope, nothasSuperuserReadBypass), with a required master FK. D6's other ⛔ item (an interim with two spellings of one scope) stands.docs/adr/0055-master-detail-controlled-by-parent.md(+6 / −0), four insertions:· **Amended** (2026-11-15, #33696, ruling 「只对管理员去掉」 6893666857)status entry.⚠️ **Amended 2026-11-15 …**mark directly under the 2026-10-22 status entry (the "10-22 note in step").⚠️note in §2, under the 2026-11-06 (controlled_by_parent admits an optional master (1/3): spec, lint and the read owner branch: a null-master detail row is readable by its owner only #30905 ruling A) note.⚠️note under "The rules the read keeps" in the 2026-11-06 amendment, so the rows-with-no-master rule reads as one statement: optional master, the owner and View All on the detail (unchanged); required master, only View All on the detail with every master hop unrestricted; members keep the chain.Why
Prime Directive 13: reversing a recorded decision needs an amended status line on the ADR that records it. The ruling lifts ADR-0139 D6's ⛔ for one reader class and orders this amendment to merge before #33696's code.
Acceptance notes
**Amended … verbatim:**D6 paragraph with a blockquote). ADR-0055 follows its 2026-10-22 amendment, the one the ruling names (status entry plus in-place⚠️ **Amended …**notes, no end-of-file section); the mark under a status entry follows the 2026-10-26 and 2026-11-06 entries' trailing marks.git diff --numstatreads37 0and6 0; no existing line changed or re-wrapped. So the ADR-0139 entry sits at the end of the Status paragraph, and the ADR-0055 mark for the 2026-10-22 entry is its own line directly under it (renders as that entry's continuation).Dheadings 6 → 6, bold leads 0 → 0, table rows 0 → 0; ADR-0055 0/0/0 → 0/0/0. No newpath#Symbolanchor;docs/adr/README.mdunchanged (check:adr-indexcurrent).hasSuperuserReadBypass)" and "inside its own tenant wall". N2 taken: the mark under the 2026-10-22 status entry now says the parent chain over a required master "is dropped for one reader class" instead of describing the unlanded code's query shape. N1 and N3 unchanged. The three open questions are answered A in that record (the §3 clause stays; no view-all bit definition; no further marks). One new commit, 0e1c1bc, touching only the two ADR-0055 lines this PR added; numstat is still37 0and6 0.docs/adr/**). The card thread runs a lower tier, so the ADR text was authored by an isolatedos-devsubagent pinned to model aliasfablein the card worktree on this branch (effort xhigh); round 2 went through the same route. The thread reviewed round 1 and changed one wording (which D6 item is lifted: "the second of the two things above that the ruling ⛔ does not take", since D6 carries one ⛔ over two items).Verification
Head
0e1c1bca(round 2; round 1 atdca1f17eread the same 21/21),node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderived 21 commands for the two paths; all 21 run locally after the last commit, eachexit 0:21 derived gates, exit codes, and the --ran reconciliation
The lint/formula closure for
check:doc-formula-expressionswas built first underos-verify-lock(VERDICT command-exit 0, 93 s). No code, no test, no changeset (skip-changeset:docs/adr/**publishes nothing). Tier H: this PR stays draft for a GOVERNED_APPROVERS approval.Human Minimum
packages/specholds no runtime logic. (n/a, docs only)pnpm lintpasses. (no lintable file touched; CI runs it)main, one pull request.skip-changeset)packages/spectouched: its generated artifacts are regenerated and committed. (not touched)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.🤖 Generated with Claude Code
https://claude.ai/code/session_01ADHkmPhSc3AHNRvPRkKRq8