Skip to content

docs(adr): ADR-0139 / ADR-0055 record the view-all unrestricted-reader chain drop (#33696 ruling) - #33992

Merged
os-zhuang merged 2 commits into
mainfrom
claude/project-thread-z23r42
Nov 15, 2026
Merged

os-zhuang merged 2 commits into
mainfrom
claude/project-thread-z23r42

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

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.

维护者速读

What changes

  • docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md (+37 / −0), two insertions:
  • docs/adr/0055-master-detail-controlled-by-parent.md (+6 / −0), four insertions:

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

  • In place as well as on the status line (seat hypothesis, measured): both files, each following its own precedent. ADR-0139 follows its 2026-10-21 amendment (status entry plus a dated **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.
  • Append-only: git diff --numstat reads 37 0 and 6 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).
  • Decision letters, base → head: ADR-0139 D headings 6 → 6, bold leads 0 → 0, table rows 0 → 0; ADR-0055 0/0/0 → 0/0/0. No new path#Symbol anchor; docs/adr/README.md unchanged (check:adr-index current).
  • perf(objectql): drop a required master's parent chain for a View All reader over unrestricted hops #33897 is not described as landed: both records say the change "lands only after" this amendment and name no symbol or mechanism of it.
  • Quoted verbatim: the reader-class, lift-and-ordering and multi-tenant bullets. Not restated: the record's pins and release-note bullets and the orphan-sources follow-up card, which belong to security: an unrestricted reader of a controlled_by_parent detail with a required FK drops the vacuous parent-chain leaf (epic #33631 R4) #33696.
  • Derived, not verbatim (seat to check): "on a required master the owner has no arm"; the two near-miss readers in D6 (unrestricted hops without view-all on the detail; view-all on the detail with a restricted hop), which follow from the first bullet's AND and coincide with the record's pins bullet; "a master scope that is the tenant wall is not unrestricted" (the multi-tenant bullet); and ADR-0055's "§3 (the write gate) is not amended by this note", true of the note and consistent with claim amendment 6895345175 on security: an unrestricted reader of a controlled_by_parent detail with a required FK drops the vacuous parent-chain leaf (epic #33631 R4) #33696, but not a ruling sentence.
  • Round 2 (contract review 6896995006, PASS on dca1f17): S1 taken: the ADR-0055 §2 note now restates the full reader class, adding "(the engine's per-hop scope, not 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 still 37 0 and 6 0.
  • Authoring tier: this card's tier is mandatory CONTRACT_REVIEW_TIER (docs/adr/**). The card thread runs a lower tier, so the ADR text was authored by an isolated os-dev subagent pinned to model alias fable in 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 at dca1f17e read the same 21/21), node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack derived 21 commands for the two paths; all 21 run locally after the last commit, each exit 0:

21 derived gates, exit codes, and the --ran reconciliation
node scripts/check-adr-links.mjs :: exit 0
node scripts/check-adr-links.mjs --self-test :: 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/ci/plan-test-core-shards.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:ci-filter-parity :: exit 0
pnpm check:closed-ceremony-text :: 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:gitlink-declared :: exit 0
pnpm check:nul-bytes :: exit 0
pnpm check:pm-governed-merges :: exit 0
pnpm check:pm-prior-rulings :: exit 0
pnpm check:refd-timer-probe :: exit 0
pnpm check:watch-hint-literal :: exit 0

Run reconciliation — 21 derived, 21 run, 0 NOT-MEASURED, 0 UNRUN.

The lint/formula closure for check:doc-formula-expressions was built first under os-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

  • 1. Schemas start as Zod; packages/spec holds no runtime logic. (n/a, docs only)
  • 2. Every name I added uses the casing for its kind. (no names added)
  • 3. No formatter ran; pnpm lint passes. (no lintable file touched; CI runs it)
  • 4. One issue, one branch off an up-to-date main, one pull request.
  • 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing; skip-changeset)
  • 6. packages/spec touched: its generated artifacts are regenerated and committed. (not touched)
  • 7. No hand edits to content/docs/references/, packages/*/CHANGELOG.md or content/docs/releases/.
  • 8. Title, body and comments are in English. (the quoted ruling and the 维护者速读 section stay Chinese by rule)
  • The Before Submitting list in CONTRIBUTING.md is done.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ADHkmPhSc3AHNRvPRkKRq8

…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>
@objectstack-fleet objectstack-fleet Bot added the skip-changeset PR has no user-facing published change; bypasses the changeset gate label Nov 15, 2026
@github-actions github-actions Bot added size/s documentation Improvements or additions to documentation labels Nov 15, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: dca1f17e8585b3eb953ba7928e05ac125594c575
Local-runs: none
Scope: docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md, docs/adr/0055-master-detail-controlled-by-parent.md + none

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 main (2 files, +43 / -0, verified on the tree); both ADRs whole at this head; hasSuperuserReadBypass, the cbp read filter and the engine's per-hop scope on main (read, not reviewed). Nothing built or run.

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 Lint · scoped jobs, filter, Plan Test Core shards, Test UI, Dogfood Regression Gate, Auto Label. Still running when read: Lint · docs & code guards, Lint · repo & tooling gates, Lint · CI, release & engine gates, Lint · ESLint, Type Check · workspace / source gates / consumer gates / debt ledger, Test Core (1/8). The rest are skipped by the path filter. The ADR anchor and index gates sit in the lint jobs that are still running, so their verdict is not in yet; this PASS is on the text and does not stand in for them.

① Derived judgments

Each rule statement the amendment makes, against the verbatim text of 6893666857:

  • Reader class — right, in all three places that state it in full (ADR-0139 status entry, ADR-0139 D6, ADR-0055 status entry and the note under "The rules the read keeps"): view-all on the detail AND every master hop unrestricted, where unrestricted is the engine's per-hop scope and not hasSuperuserReadBypass, with a required master FK. The parenthesis sits where the ruling puts it, on the hop test. On main hasSuperuserReadBypass is the view-all bits on one object, so the distinction the ruling draws is real and the text keeps it.
  • What that reader gains — right. Null and dangling-FK rows, inside its own tenant wall. Neither file says or implies the wall moves.
  • Every other reader — right. "Every other reader, members included, keeps the chain unchanged" is carried in the ruling's words. The two near-miss readers named in D6 (unrestricted hops without view-all on the detail; view-all on the detail with a restricted hop) follow from the ruling's AND and match its reverse-pins bullet. They narrow nothing and widen nothing.
  • Tenant admins — right. The multi-tenant bullet is quoted verbatim in ADR-0139 D6, and ADR-0055 restates it as "a master scope that is the tenant wall is not unrestricted", a faithful derivation.
  • ADR-0139 status entry — right. Dated 2026-11-15, cites 6893666857 on security: an unrestricted reader of a controlled_by_parent detail with a required FK drops the vacuous parent-chain leaf (epic #33631 R4) #33696, names the lifted item by its quoted D6 text and by 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 (the ruling's own identification), and says the other item stands.
  • Which D6 item is lifted — right. D6 reads "Two things the ruling ⛔ does not take: an interim with two spellings of one scope, and 'interim removal of the predicate for an unrestricted master scope …'". The amendment lifts the second, for that class only, and says the first "stands as written". That is what the ruling orders.
  • Why ADR-0055 moves now — right, and quoted. D6 quotes its own 2026-10-21 sentence ("ADR-0055's own text moves only in that switch's edit, never here"), says that sentence was discharged by the 2026-10-22 switch edit, and gives the ruling's order, quoted exactly, as the reason for this edit: "citing this record; ADR-0055's 10-22 note in step".
  • ADR-0055 — right. The status entry, the mark under the 2026-10-22 entry, the §2 note and the note under "The rules the read keeps" make one statement with 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: an optional master's row with no master is read by its owner and by View All on the detail (unchanged); a required master has no null-master arm, and its rows with an empty or dangling reference gain exactly one reader class. "On a required master the owner has no arm" is true of the file and of the read filter on main. The quoted "does not open the master arm", "byte-identical" and "byte for byte" are each verbatim from the 2026-11-06 amendment.
  • Verbatim claims — right. The three quoted bullets in D6 equal bullets 1, 2 and 5 of the record after unwrapping, bold included. The text says the record's other two bullets (pins, release note) bind the code card, which is accurate: the record has five.
  • Dates and ids — right. 2026-11-15T11:31Z, 6893666857 replacing 6893097935, ruling B 6303721609, ruling A 2026-11-06 on 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.

② Semver level

None. Docs only under docs/adr/**, nothing published, no changeset, label skip-changeset, and the Check Changeset run is green.
Clause-②: no
Metadata-protocol: none

③ Boundary flags

  • (a) Authoring route and the thread's one wording change. The text was authored by an os-dev subagent pinned to the tier's model inside a lower-tier thread, as the claim declares. The thread's change ("the second of the two things above that the ruling ⛔ does not take") is correct against D6, which carries one ⛔ over two items; it is more exact than "D6's ⛔" would have been. Accepted.
  • (b) Open question 1 — keep "§3 (the write gate) is not amended by this note": keep. It is a statement about the note, it is true, and the ruling speaks only of readers. Striking it would leave a reader free to infer a write-gate change the maintainer did not rule.
  • (b) Open question 2 — which bits are view-all: no definition is owed here, and nothing is left open in ADR-0055. ADR-0055 uses its own term, View All on the detail, which the 2026-11-06 amendment already defines (viewAllRecords or modifyAllRecords). The ruling ties its reader to ruling A, so that is the ruling's reading. If the code card lands a different bit set, that is a finding against the code, judged against this text; it is not a reason to change the amendment. Not escalated.
  • (b) Open question 3 — mark further places: not required. The status entries and the mark under the 2026-10-22 entry govern, and "reads as of its date" is each file's own precedent. The one sentence I would still mark is N3 below.
  • (c) Amendment precedent — followed. ADR-0139: a dated **Amended** status entry plus a dated D6 paragraph with a verbatim blockquote, the 2026-10-21 shape. ADR-0055: a status entry plus in-place ⚠️ notes with no end section, the 2026-10-22 shape; the mark under the 10-22 entry is on its own line because the PR is append-only, and it renders as that entry's continuation like the inline marks on the 10-26 and 11-06 entries.
  • The PR is draft and Tier H: it needs a governed approver and a maintainer merge. The ruling's order (security: an unrestricted reader of a controlled_by_parent detail with a required FK drops the vacuous parent-chain leaf (epic #33631 R4) #33696's code lands only after this merges) is stated in both files.

④ Design judgment

docs/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.

  • S1 (should-fix) — ADR-0055 §2 note (the new line under the 2026-11-06 note) restates the class in part: it drops "inside its own tenant wall" and the "(the engine's per-hop scope, not hasSuperuserReadBypass)" qualifier, then says the reader "also sees the rows whose master reference is empty or dangling". §2 is the normative read section, and this is the one place a reader could take a shorter class than the ruling's. The pointer to the status line makes it recoverable, so it does not block. Either add the two phrases, or name no conditions there and only point.
  • N1 (nit) — ADR-0139's status entry says "D6's other ⛔ … stands", while D6 itself (correctly, after the thread's change) speaks of one ⛔ over two things. Same meaning; the card used the same loose phrase.
  • N2 (nit) — ADR-0055's mark under the 2026-10-22 entry says the class's read "carries no master predicate and no master subquery". That is the ruling's "the chain is dropped" restated as statement shape. It is true of the rule, but it is the one sentence that describes the shape of the code before the code lands; "for whom the parent chain is dropped" would say the same and age better.
  • N3 (nit) — ADR-0139 D5's seventh-consumer note still says "the leaf is written on every read". After the code lands that is false for this one class. The status entry governs, so no change is owed in this PR.

No must-fix. One should-fix (S1), three nits.

Implemented-by: claude/project-thread-z23r42
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 0e1c1bca51d2d6639712b356381d955883211471
Local-runs: none
Scope: docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md, docs/adr/0055-master-detail-controlled-by-parent.md + none

Delta record. It follows record 6896995006 (PASS on head dca1f17e) and judges the one commit since, dca1f17e..0e1c1bca. Everything in 6896995006 that this record does not restate stands on this head.

Read for this record: the commit's diff and the net diff against main on the tree, and the check-runs on this head. The commit touches docs/adr/0055-master-detail-controlled-by-parent.md only, 2 lines replaced in place; ADR-0139 is byte-identical to dca1f17e. The net diff against main is still 2 files, +43 / -0 (ADR-0139 +37, ADR-0055 +6). Nothing built or run.

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 Lint · scoped jobs, Type Check · source gates, Check Documentation Links, Governed Surface Queue Guard, Check PR Size, PR-body guards (the run on the push), filter, Plan Test Core shards, Test UI, Dogfood Regression Gate, Auto Label. Still running when read: Type Check · workspace, Type Check · consumer gates, Type Check · debt ledger, Lint · CI, release & engine gates, Test Core (1/8), and a second PR-body guards run started by the body edit. Check Changeset is skipped on this head (label skip-changeset); the rest are skipped by the path filter. The Type Check verdicts on this head are its own: one green, three not in yet, none red.

① Derived judgments

Both changed lines, against the verbatim text of 6893666857:

  • ADR-0055 §2 note — right, and now the full class. It reads: a reader who holds View All on the detail and whose every master hop answers unrestricted (the engine's per-hop scope, not hasSuperuserReadBypass), on a required master, for whom the ruling drops the parent chain, and who then sees, inside its own tenant wall, the rows whose master reference is empty or dangling; every other reader keeps the chain. The parenthesis is the ruling's, in the ruling's place, on the hop test. All three conditions are present and the tenant wall bounds the gain. Neither widened nor narrowed.
  • Mark under the 2026-10-22 entry — right. It now reads "the parent chain over a required master is dropped for one reader class; every other reader is answered as this line says. See the 2026-11-15 line below." That is the ruling's own phrase, with no statement about the shape of the read. Next to the 10-22 entry it reads correctly: that entry says how the read is answered (the leaf over the master, one statement), the mark says for whom that no longer applies and where the class is defined. It names no conditions itself, so there is no shorter class to take from it.

② Semver level

Unchanged from 6896995006: none. Docs only, no changeset, skip-changeset.
Clause-②: no
Metadata-protocol: none

③ Boundary flags

  • The commit is in-place wording on two lines this PR itself added; no line that exists on main is changed, so the PR is still append-only against main.
  • Nothing else is new. The answers to the dev's three open questions in 6896995006 stand.
  • Still draft and Tier H: a governed approver and a maintainer merge are owed.

④ Design judgment

docs/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.

  • S1: closed. Both missing phrases are in the §2 note.
  • N2: closed. The mark uses the ruling's phrase.
  • N1 (nit) — open, unchanged: ADR-0139's status entry says "D6's other ⛔ … stands" where D6 has one ⛔ over two things. Same meaning.
  • N3 (nit) — open, unchanged: ADR-0139 D5 still says "the leaf is written on every read". The status entry governs; nothing is owed in this PR.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-z23r42
Reviewed-by: session_01ADHkmRxXmVQ41fqnaTPGAv

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

domain:skills#2 · os-steve · session_01ADHkmRxXmVQ41fqnaTPGAv

维护者速读

席位核对

Verdict: ACCEPT, held for the maintainer · head 0e1c1bca51d2d6639712b356381d955883211471 · card #33820 · report 6896944503 · at-tier contract review 6896995006 (round 1) + delta 6897137456 (PASS on this head, S1: closed, N2: closed) · read 2026-11-15T15:50Z.

  • Shape: draft → main, Fixes #33820, Ruling-ref: 6893666857. docs/adr/0139-…, docs/adr/0055-…, append-only +43/−0 against main; skip-changeset. GOVERNED, Tier H (docs/adr/**). Clause-②: no; Metadata-protocol: none.
  • Premise measured: neither ADR named 6893666857 or security: an unrestricted reader of a controlled_by_parent detail with a required FK drops the vacuous parent-chain leaf (epic #33631 R4) #33696 on main; security: an unrestricted reader of a controlled_by_parent detail with a required FK drops the vacuous parent-chain leaf (epic #33631 R4) #33696 is open and its code PR waits on this merge, as the ruling orders.
  • Gates: check-runs on this head: none failing, none cancelled; the ADR lint job (docs & code guards) is green. Still running at this read: three Type Check lanes, CI/release/engine, Test Core (1/8), and the PR-body guard re-run for the body edit. The red TypeScript Type Check on dca1f17e was its lanes cancelled by the newer push, not a failure of this diff. Dev: 21 derived, 21 exit 0, --ran reconciles.
  • Accepted deviations: authoring by a subagent pinned to CONTRACT_REVIEW_TIER inside a lower-tier thread (recorded in the body); the thread's one wording change (which D6 item is lifted) judged right by the review. Open questions answered A in the review (keep the §3 not-amended clause; no view-all bit definition owed; no further marks). Review nits N1 and N3 accepted as written.
  • Out of scope: none filed.
  • Landing: Tier H. The seat does not flip this PR ready or enqueue it. It needs the maintainer's merge, or an authorised APPROVED review after which the seat lands it.

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 15, 2026
@os-zhuang
os-zhuang marked this pull request as ready for review November 15, 2026 16:12
@os-zhuang
os-zhuang enabled auto-merge November 15, 2026 16:12
@os-zhuang
os-zhuang added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit 8961c0c Nov 15, 2026
54 checks passed
@os-zhuang
os-zhuang deleted the claude/project-thread-z23r42 branch November 15, 2026 16:31
scbdzhwl pushed a commit to scbdzhwl/objectstack-analysis that referenced this pull request Nov 16, 2026
…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>
@objectstack-fleet objectstack-fleet Bot removed the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Nov 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/s skip-changeset PR has no user-facing published change; bypasses the changeset gate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ADR-0139 / ADR-0055 status line: lift the D6 interim-removal ban for view-all readers with an unrestricted master scope (#33696 ruling)

3 participants