Repository navigation
Commit ec73246
docs(adr): ADR-0139 note, planReadScope is a second engine path that plans a ReadableIds leaf (#39124)
<!-- claude-projects-attribution: {"github_login":"os-support-ai"} -->
_Requested by **Yibo Wang** · [project
thread](https://claude.ai/code/project/chan_01BVUyyPie8gHwoPM18iABwB?thread=cmsg_01BVUyyPie8gHwoPM18iABwBKDusA48kJAMM6qbAVTGANT)_
Part of #39080
Clause-②: no
Metadata-protocol: none
## 维护者速读
- 用户看不到任何变化:这是一条架构记录(ADR-0139)的补记,只记事实,不改任何决定。
- 记的是:#39100 已落地的引擎方法 `planReadScope`,是第二条为调用方条件规划「可读 id
子查询」的引擎路径,后面列表页评论的读取口(#39084)会用它;请求能写的东西一点没变。
- 属于「列表页对象评论」专题的记账,按专题裁决第 6 条由落地席补记。
- 要你做一件事:`docs/adr/**` 只能你批,看过没问题就批准,席位来合并。
## What changes
One file,
`docs/adr/0139-engine-internal-semi-join-leaf-readable-parent-ids.md`: a
dated `Note (2026-12-02, #39080 — PR #39100)` added under D3, after the
ADR-0155 amendment note and before `### D4`. No other line of the ADR
moves: the Status header, D1 to D6 and the README index are untouched.
The note records:
- `ObjectQL#planReadScope(object, target, { where, context })` (#39100)
is a second engine path that plans a `ReadableIds` leaf for a `$in`
comparand. The first is the nested-relation lowering. It is that same
planned read, entered by the target's name, for a column that is not a
declared relation.
- Its outcomes, those of a nested-relation condition: the planned leaf
where the subquery is provably the caller-run id read; otherwise the id
list under `RELATION_FILTER_ID_CAP` (1,000), refused `INVALID_FILTER` /
400 past it; refused `INVALID_FILTER` / 400 before anything is read on a
driver without `DriverCapabilities.readableIdsLeaf`; `OBJECT_NOT_FOUND`
for an unregistered object.
- Nothing a request can write changes: D1's leaf under D1's brand, no
operator, no wire key; a JSON or spread copy is refused; a write verb
refuses the leaf in D3's envelope.
- D4's and D5's consumer count stands. For a planned leaf the executor
boundary asks the security service nothing; the scope is the planned
read's, so the caller places it under the context it was planned under.
- It was built for the comment read path (#39084, epic #39077), which
has not landed; on `main` at `1e87dc17e8` only tests call the method.
Claim amendment 7341556804 on #39080 names this PR's surface (this ADR
only) and its tier: Tier H (`docs/adr/**`), the maintainer approves and
the seat lands it. Epic ruling 7338398195 item 6 gives this bookkeeping
to the landing seat.
## Acceptance notes
- The note is not an "add-only note" for the governed-merge Tier S arm
(it sits under `## Decision`, and some lines carry anchors and lists),
so it goes to the maintainer as Tier H, as the amendment says.
- Not changed here, recorded for the weekly ADR-revisions card: D2's
"every leaf is composed from `canReadObject` and `getReadFilter`" does
not describe a planned leaf (true since the nested-relation semi-join,
before #39100); the 2026-11-17 Status entry's "the engine reads the bit
for author-written conditions only" now has two more readers
(`planReadScope`, `closed-state-lock.ts`). The code comment at the
`RELATION_SCOPE_PLAN` branch in `engine-find.ts` says only the lowering
sets that option; `planReadScope` sets it too.
## Verification
Read the note against the code:
`packages/objectql/src/engine-query-lowering.ts#planReadScope` and
`packages/objectql/src/relation-semi-join.ts`
(`planRelationSemiJoinLeaf`, `relationSemiJoinServes`,
`plannedRelationLeafVerdict`, `readScopeCapError`,
`readScopeDriverRefusal`). Every code anchor in the note resolves (`pnpm
check:adr-symbol-anchors`, nine anchors).
<details><summary>Local readings (head 2ee5c58, tree = main 1e87dc1 +
this note)</summary>
Derived gate set (`dispatch-gates.mjs --commands`, 21 commands), exit 0
each: `check-adr-links.mjs` (and `--self-test`),
`check-closing-keyword-parity.mjs` (and `--self-test`),
`plan-test-core-shards.mjs --self-test`, `check:adr-anchors`,
`check:adr-index`, `check:adr-symbol-anchors`, `check:ci-filter-parity`,
`check:closed-ceremony-text`, `check:cross-package-test-inputs`,
`check:doc-authoring`, `check:driver-memory-census`,
`check:gitlink-declared`, `check:nul-bytes`, `check:pm-governed-merges`,
`check:pm-prior-rulings`, `check:refd-timer-probe`,
`check:watch-hint-literal`, `check-comment-mask-corpus.mjs`. NOT
MEASURED: `@objectstack/lint check:doc-formula-expressions` (needs a
build; CI runs it).
</details>
---
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01WGufziSQiNb9xKWTy1uFgY
---------
Co-authored-by: Claude <noreply@anthropic.com>1 parent a533126 commit ec73246
1 file changed
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
248 | 248 | | |
249 | 249 | | |
250 | 250 | | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
251 | 287 | | |
252 | 288 | | |
253 | 289 | | |
| |||
0 commit comments