Skip to content

Commit b7fe94a

Browse files
docs(spec,objectql): SharedRecordIds and fixed-read leaf seam docblocks describe the share arm after the switch (#36723)
Fixes #36121 Clause-②: no Metadata-protocol: none ## 维护者速读 - 用户能看到什么变化:用户无感;只改了两处源码注释,让它们和第 6 步切换后的实际行为一致。 - 为什么做:属于「共享授权不再有 5000 条上限」那个系列的收尾,旧注释仍说名单最多 5000 条、仍说还没有生产者。 - 出错会怎样:只是注释,不改任何代码或行为;写错了也只是误导读注释的人,随时可撤回。 - 要你做的:无。 ## What changes Comment-only, in two files. Each sentence below was false on `origin/main` (3aa008d) after the ADR-0155 step-6 switch (plugin-sharing's `buildReadFilter` / `buildWriteFilter` now push `SharedRecordIds.read` / `.write` at `sharing-service.ts:828` and `:948`; `share-arm-boot.ts` holds the class-2 boot check; `shareGrantsInertReason` calls `driverEvaluatesFixedReadLeaf` at `sharing-service.ts:1763`). `packages/spec/src/data/shared-record-ids.ts` | line | before | after | |---|---|---| | 9 | It sits where today's list of granted ids sits | It sits where the share arm's list of granted ids sat before the producer's switch (ADR-0155 plan step 6) | | 21-23 | The list the share arm binds today holds at most 5,000 members of G; the leaf is G at every count. | The list the share arm bound before the switch is retired; the share arm now carries this leaf, which is G at every count. | | 72 | where today's `recipient_id` comes from | where the retired list's `recipient_id` came from | | 102-104 | No caller of the comparand-shape door admits it until the engine's card (ADR-0155 plan step 2), and nothing writes it until that producer's switch (plan step 6). | The engine's callers of the comparand-shape door admit it (ADR-0155 plan step 2), and that producer writes it from its switch on (plan step 6). | `packages/objectql/src/fixed-read-leaf-seam.ts` | line | before | after | |---|---|---| | 57-59 | the class-② boot check and R2's share-arm answer land with the producer (ADR-0155 plan step 6), and until then nothing on main writes the leaf. | the class-② boot check and R2's share-arm answer live with the producer, plugin-sharing (ADR-0155 plan step 6), which is the one writer of the leaf. | | 85-86 | the seam's consult now, and the producer's up-front answer (R2) when it lands (ADR-0155 plan step 6) | the seam's consult, and the producer's up-front answer (R2, ADR-0155 plan step 6) | | 121 | which today's read of the table runs and the subquery would read around | which the retired list's read of the table ran and the subquery would read around | Kept, because still true at main: seam line 5, "`SharedRecordIds` today, ADR-0147's leaf on the card that adds it" (`FIXED_READ_LEAF_NAMES` is still `['SharedRecordIds']`), and "with no cap and no ordering" (ADR-0155 ① ruled A, restated unchanged). The corrected prose describes the 5,000 cap only as retired, never as live. The card's `git grep -n "5,000\|5000" -- packages/spec/src/data packages/objectql/src` hits one grant-list line (shared-record-ids.ts:22, fixed here). The other hits are unrelated: autonumber seed page size (`engine-top-level.ts`, `engine-defaults-and-autonumbers.ts`), `MIN_MAX_EXCLUDED_ID_BUDGET`, timeouts and test fixtures. Left alone. Two patch changesets, one per touched published package (`@objectstack/spec`, `@objectstack/objectql`), because the docblocks ship in the published bytes. ## Tests No behaviour changes, so there is no new test and no ablation. ## Acceptance notes - `packages/plugins/plugin-sharing/src/share-arm-boot.ts:10` still says "today's grant read" about the retired list read. It is outside this card's file surface (not under the card's grep roots), so it is left for a later pass. ## Verification Two-minute check: `git diff origin/main -- packages/spec/src/data/shared-record-ids.ts packages/objectql/src/fixed-read-leaf-seam.ts` shows only lines inside block comments, and `grep -n "today\|until" packages/spec/src/data/shared-record-ids.ts` no longer finds the list or the producer described as live. Files to read first: `packages/spec/src/data/shared-record-ids.ts` (the 5,000 sentence, lines 21-23). <details><summary>Local gates at d42859d</summary> - Build: `pnpm --filter '@objectstack/objectql^...' --filter @objectstack/objectql build` under os-verify-lock: VERDICT command-exit 0. - `pnpm --filter @objectstack/spec typecheck` and `pnpm --filter @objectstack/objectql typecheck`: both passed (the lock command's later vitest leg named a wrong path; rerun below). - `vitest run src/data/shared-record-ids.test.ts` (spec): Test Files 1 passed, Tests 32 passed. `vitest run src/engine-fixed-read-leaf-seam.test.ts` (objectql): Test Files 1 passed, Tests 70 passed. - `dispatch-gates --commands`: 81 families derived; 79 exit 0, 2 exit 3 (NOT MEASURED): `check-plugin-teardown-shape.mjs --self-test` (shallow clone cannot reach its pinned control commit) and `check:dual-build-cjs-loads` (needs a full workspace build). Both run in CI. - `--ran` reconciliation: 81 derived, 79 run, 2 NOT-MEASURED, 0 UNRUN. - Spec dist gates rerun after the build: check:api-surface, check:exported-any, check:docs, check:authorable-surface all exit 0. `check-nul-bytes`: exit 0. - `test:repo` not run locally (no repo-project test touched); CI Test Core covers it. </details> --- _Generated by [Claude Code](https://claude.ai/code/session_011y7As6FyXmJyGyHNKXUkV7)_ Co-authored-by: Claude <noreply@anthropic.com>
1 parent fa23941 commit b7fe94a

4 files changed

Lines changed: 39 additions & 20 deletions

File tree

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/objectql': patch
3+
---
4+
5+
docs(objectql): the fixed-read leaf seam's docblocks name plugin-sharing as the leaf's producer, in the present tense (ADR-0155 step 6)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Comment-only. The seam's docblocks no longer say the producer, its boot check and its up-front answer (R2) are still to land, or that nothing writes the leaf: plugin-sharing writes it and reads `driverEvaluatesFixedReadLeaf` for R2. No export or runtime behaviour changes.
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
'@objectstack/spec': patch
3+
---
4+
5+
docs(spec): the `SharedRecordIds` docblock describes the share arm after the switch — the capped list of granted ids is retired and the share arm carries the leaf (ADR-0155 step 6)
6+
7+
Clause-②: no
8+
Metadata-protocol: none
9+
10+
Comment-only. The module docblock of `@objectstack/spec/data`'s `SharedRecordIds` no longer says the share arm binds a list of at most 5,000 granted ids today, nor that nothing writes the leaf yet: plugin-sharing's read and write scopes carry the leaf, which is the whole grant set at every count. No schema, export or runtime behaviour changes.

‎packages/objectql/src/fixed-read-leaf-seam.ts‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -55,9 +55,9 @@
5555
* a refusal at the door and one at the boundary log one line between them.
5656
*
5757
* ⛔ No boot refusal and no producer here: the class-② boot check and R2's
58-
* share-arm answer land with the producer (ADR-0155 plan step 6), and until
59-
* then nothing on main writes the leaf. `index.ts` re-exports two readers
60-
* from this module and nothing else (plan step 5): {@link fixedReadLeafClassOfEngine}
58+
* share-arm answer live with the producer, plugin-sharing (ADR-0155 plan
59+
* step 6), which is the one writer of the leaf. `index.ts` re-exports two
60+
* readers from this module and nothing else (plan step 5): {@link fixedReadLeafClassOfEngine}
6161
* and {@link driverEvaluatesFixedReadLeaf}.
6262
*/
6363

@@ -82,8 +82,8 @@ const FIND_HOOK_EVENTS = Object.freeze(['beforeFind', 'afterFind'] as const);
8282
/**
8383
* [ADR-0155 D4, ② as ruled] Does `driver` evaluate the fixed-read leaf
8484
* `name`? Its `DriverCapabilities.fixedReadLeaves` lists the name; absence is
85-
* none. The one reader of the declaration: the seam's consult now, and the
86-
* producer's up-front answer (R2) when it lands (ADR-0155 plan step 6), which
85+
* none. The one reader of the declaration: the seam's consult, and the
86+
* producer's up-front answer (R2, ADR-0155 plan step 6), which
8787
* reaches the driver through `IDataEngine.getDriverForObject`.
8888
*/
8989
export function driverEvaluatesFixedReadLeaf(driver: { readonly supports?: unknown } | undefined, name: FixedReadLeafName): boolean {
@@ -118,9 +118,9 @@ export type FixedReadLeafClass =
118118
* (`resolveDatasourceBinding`), so no driver evaluates the subquery.
119119
* 2. **A registration for the table BY NAME**: an object-scoped middleware
120120
* (`hasObjectMiddleware`) or a `beforeFind` / `afterFind` hook that names
121-
* it (`hookNamesObject`), which today's read of the table runs and the
122-
* subquery would read around. A registration that names no object, or
123-
* `'*'`, is outside the class (D4's boundary).
121+
* it (`hookNamesObject`), which the retired list's read of the table ran
122+
* and the subquery would read around. A registration that names no
123+
* object, or `'*'`, is outside the class (D4's boundary).
124124
*
125125
* At this step both answer with the refusal (R1). ⛔ The seam never reads
126126
* around either.

‎packages/spec/src/data/shared-record-ids.ts‎

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
* user `recipient`"*: at every access level (the read form), or at the levels
77
* it names (the write form, ADR-0155 ③ ruled A).
88
*
9-
* It sits where today's list of granted ids sits, as the comparand of `$in` on
10-
* the object's `id`:
9+
* It sits where the share arm's list of granted ids sat before the producer's
10+
* switch (ADR-0155 plan step 6), as the comparand of `$in` on the object's `id`:
1111
*
1212
* ```ts
1313
* { id: { $in: SharedRecordIds.read('account', 'u1') } }
@@ -19,9 +19,9 @@
1919
* that is neither NULL nor empty and, on the write form, an `access_level` in
2020
* the levels it carries. Read with system authority, with no organization
2121
* predicate (ADR-0155 ① ruled A), with no cap and no ordering. The list the
22-
* share arm binds today holds at most 5,000 members of G; the leaf is G at every
23-
* count. A SQL driver compiles it in the list's own position, as
24-
* {@link SharedRecordIds.innerRead} describes:
22+
* share arm bound before the switch is retired; the share arm now carries this
23+
* leaf, which is G at every count. A SQL driver compiles it in the list's own
24+
* position, as {@link SharedRecordIds.innerRead} describes:
2525
*
2626
* ```sql
2727
* id IN (SELECT record_id FROM sys_record_share
@@ -69,10 +69,10 @@
6969
* non-enumerable.
7070
*
7171
* **The recipient is the producer's.** It is captured from the context the
72-
* scope is built for, where today's `recipient_id` comes from. ⛔ No seam and no
73-
* driver re-derives it from the reading context: the engine's seam (ADR-0155
74-
* D4) compares it with the reading context's user and delegator and never
75-
* replaces it.
72+
* scope is built for, where the retired list's `recipient_id` came from. ⛔ No
73+
* seam and no driver re-derives it from the reading context: the engine's seam
74+
* (ADR-0155 D4) compares it with the reading context's user and delegator and
75+
* never replaces it.
7676
*
7777
* ## It arrives composed
7878
*
@@ -99,9 +99,8 @@
9999
* No operator joins `FieldOperatorsSchema` or `VALID_AST_OPERATORS`
100100
* (`./filter.zod.ts`), and there is no CEL function and no lint vocabulary. One
101101
* producer writes it: plugin-sharing's read-scope builder, and its write-scope
102-
* builder. No caller of the comparand-shape door admits it until the engine's
103-
* card (ADR-0155 plan step 2), and nothing writes it until that producer's
104-
* switch (plan step 6).
102+
* builder. The engine's callers of the comparand-shape door admit it (ADR-0155
103+
* plan step 2), and that producer writes it from its switch on (plan step 6).
105104
*
106105
* Like `./readable-ids.ts`, the module is tolerant of bare, un-parsed input:
107106
* {@link isSharedRecordIds} accepts `unknown` and answers `false` for every

0 commit comments

Comments
 (0)