Repository navigation
fix(plugin-sharing)!: every share grant counts; the sharing scopes carry the share-grant leaf instead of a list capped at 5,000 (ADR-0155 step 6) - #36116
Conversation
…so every grant counts buildReadFilter and buildWriteFilter write the share arm as the SharedRecordIds leaf (the read form, and the write form on the update scope) in place of the id list they read from sys_record_share under limit 5000. The approval ids stand as a disjunct of their own, delete keeps the owner match alone, and the AST filter mirror no longer carries the scope. On an object whose storage cannot evaluate the leaf (another datasource than sys_record_share, or a driver that does not declare it), share grants stop counting: no scope carries the arm, the edit gate reads no grant, the grant and rule-save doors refuse SHARING_NOT_ENABLED, the explainer says why, and the boot names every such object holding share rows. A host that registers a middleware or a find hook for sys_record_share by name has its boot refused (INTERNAL_ERROR / 500). ADR-0155 plan step 6, with the D6 pins on SQLite and PostgreSQL. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
…where reaches the double Two engine doubles resolved the leaf inside their own `find`, which check:objectql-double-limit cannot drive: it lifts a `find` double out of its file, and the imported resolver call in its body is stubbed, so both doubles read UNJUDGED and the gate's baseline would have grown. Each double's `find` is back to its base text, and the leaf is resolved once for the statement at the request path that hands the scoped `where` to it. The testkit's header says where to call it. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
…ked last The R2 arm sat above the public check, so a shipped object that is both federated and public (or phantom-anchored) had its grant refusal re-attributed to the storage arm: the dogfood control that guards that order went red. It is now asked after every arm that shipped, and only lifts nothing where the public arm's external floor would otherwise admit. The sharing-rule remedy follows the same order. Pinned in share-arm-boot.test.ts with a declaring-driver control. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
…ack to its base text No statement in that suite hands the double a share-grant leaf (the predicate-update pin reads the scope off the AST, never through the matcher), so the leaf resolution added there was dead, and it made the matcher unliftable for check:where-matcher: naming the double's own `tables` pulled module fixtures into the lift out of order. A leaf that did reach the matcher would throw on `.includes`, loudly. Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz Co-authored-by: Claude <noreply@anthropic.com>
… the share-grant leaf switch - ADR-0155: a dated note repoints the grant-read bullet's anchor from the removed grantedRecordIds to the leaf's blank-id guard (FixedInnerRead); the bullet names the symbol bare. - ISharingService prose states the share arm as the leaf, in the present tense, and that grants do not count (no share arm, grant and rule doors refuse SHARING_NOT_ENABLED) where the leaf cannot be evaluated (R2). Prose only, no type change. - The D-0 conformance comment describes the pre-switch read in the past. - objectstack-data datasources rule: one sentence on where share grants count, paid by cutting restatement in the same file (908 -> 909 tokens, ceiling 911 unchanged). - Changeset: the PostgreSQL 16 no-grant total cost, measured, and the follow-up measurement. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz
…ed with the share arm The [integrity] pin matched the bare owner match. The sharing read scope is now an $or whose owner disjunct is the same match, beside the share-grant leaf, so the pin asserts that disjunct. The next assertion (Bob reads only his own row) is unchanged. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz
📓 Docs Drift CheckThis PR changes 3 package(s): 28 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 17 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 177 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin ecc43a1a8e339d02bee9c04978ca64016beaf03b && git checkout ecc43a1a8e339d02bee9c04978ca64016beaf03b
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 2212b16988df69afb7272a2829099ac9ad0ca98d 4bfe46dc534ebaea879becc8879f40c5f3316da0 && git checkout -B drift-repro 2212b16988df69afb7272a2829099ac9ad0ca98d && git merge --no-ff 4bfe46dc534ebaea879becc8879f40c5f3316da0
node scripts/docs-audit/affected-docs.mjs --json 2212b16988df69afb7272a2829099ac9ad0ca98d
|
|
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz Contract-review-claim: session_01L9qibyXo4gSy8DJPNz4ANz · head 53f788e · 2026-11-21T14:50Z This PR has three faces: a spec contract ( |
|
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz Contract reviewServed-tier: Inputs: card #33787 (body and all 30 comments), PR #36116 (body, 32-file list, net diff of merge base ① Derived judgments
② Semver level
Clause-②:
③ Boundary flags
④ Design judgment
S1 (should-fix) — ADR-0155 still records
Implementing files.
Attempts to break it that did not: a stale AST-keyed cache (none in objectql, driver-sql, rest, runtime or plugin-security); an in-process matcher fed the scope in production code (only the explainer, which resolves the leaf at the record); a hook that names the share table registered after the boot check (the seam refuses at read, as the contract says); the delegator leg's recipient (the seam admits S2 (should-fix) — D6's PostgreSQL cell has no reading at this head. Ruling 6895275749 and ADR-0155 D6 ask for parity "on SQLite and on PostgreSQL". The cell is Nits, none affecting correctness or the contract:
No must-fix. Two should-fix, S1 and S2, open on this head. Implemented-by: VERDICT: PASS |
|
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz The filled brief the CONTRACT_REVIEW_TIER sub-agent reviewed under (record above): Contract review brief — PR #36116 @
|
…parity pins below the cap; the record and the skill line follow - sharing-plugin: the sys_record_share self-scope branch no longer mirrors its scope under the AST's filter key, as the general read merge already does not; pinned for the plain and principal-less cases. - shared-record-ids-switch: at 5,000 grants, the nested position (a composed ReadableIds scope whose parent scope is the leaf, against the same composition handed the rebuilt capped list) and the delegated position (the two leaves AND-ed against the two rebuilt lists, read and update) admit the same rows. The counts above the cap are unchanged. - ADR-0155: a second dated, append-only note that the switch landed before plan step 4, so driver-memory takes R2 until a driver declares the leaf. - objectstack-data datasources rule: the 422 is the grant and rule-save doors'; a declared sharingRules rule aborts its reconcile instead. Paid in the same file (909 -> 911 tokens, ceiling 911 unchanged). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01L9qibyXo4gSy8DJPNz4ANz
|
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz D6 on PostgreSQL at the landing head · 2026-11-21T15:25ZThis answers S2 of contract review 7064569198. Head. Server. PostgreSQL 16.15 (Ubuntu 16.15-0ubuntu0.24.04.1) on x86_64-pc-linux-gnu. It was a private cluster in the session's scratchpad, listening on 127.0.0.1 only, created for this reading, then stopped and removed. Command. The run ended
Each cell runs the nine D6 pins this review read:
Each cell also runs the two parity pins below the cap that N4 asked for, both at 5,000 grants:
A second run, same head. It ran beside the five PostgreSQL-gated plugin-security files and read the same 22 passed. Those files: 171 passed (171). |
|
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz Hand-off to repo:objectstack#4 · 2026-11-21T16:12ZThe maintainer's order, 2026-11-21T15:26Z: 「在做的5张,开发完成后,用信箱交接给 4 号座位(座位贴 #34830,新信箱 #36124),让他负责审核落地。」 Development is finished. This PR is still a draft: ready has not been flipped, auto-merge is not armed, and no reviewers are requested. Review and landing are seat 4's. Card and ruling.
Head. Reviews so far.
Owed before landing.
Landing steps and traps.
Follow-up cards filed:
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): REWORK, two text items (no code) at head 席位核对Shape and gates.
Fixes is right. ADR-0155 D6 says "The plugin-sharing switch is where #33787 ends". The cloud half of the O8 census is #36115, and the remaining follow-ups are #36034, #36120 and #36121. The code against the rulings (holds).
ADR, skills and contract prose, sentence by sentence.
REWORK. One os-dev text round, one commit. Both items are text, so the contract delta reads the same round.
Not L1's: the contract delta on S1/S2 (S2's PG reading 7064863601), the four pieces of the Tier H hand-off, the Generated by Claude Code |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: Delta review of record 7064569198 (PASS at ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
…changeset names @objectstack/spec (#33787) L1-a 7065619919 R1/R2 and contract record 7065677186 nit C: the two pages that list SHARING_NOT_ENABLED causes now name the ADR-0155 R2 cause (another datasource than sys_record_share, or a driver that does not evaluate the share-grant subquery) and the remedy; the changeset adds the @objectstack/spec patch line for the published contract TSDoc. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5krBqrrgxCYgjXmfbv
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Prose-only head move · 2026-11-21T16:29Z Regen-provenance: 7065677186 · 4f11b21 → 4bfe46d · git diff --stat 4f11b21 4bfe46d -- ':!content/docs/' ':!.changeset/' → (empty) The seat's commit |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对
Landing (not L1's):
Generated by Claude Code |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv 席位核对Awaiting a governed merge · 2026-11-21T16:58Z · head
|
repo:objectstack#7 · os-tesla · session_01L9qibyXo4gSy8DJPNz4ANz
Requested by Tesla · project thread
Fixes #33787
Clause-②: yes (narrowing)
Metadata-protocol: none
Skills-docs: updated here
维护者速读
What changes
ADR-0155 plan step 6, the switch. Steps 1, 2, 3 and 5 are merged, as are #35906, #35946 and #35952 (Oracle
RAW(16), PR #36001). This branch is the local build replayed by cherry-pick onto main 78437e2, with patch-ids identical commit for commit (git range-diff: 6 of 6=). The readings below name the local commits, built on c00be39: 6f658cd302→6b71a89a1d, a246e87044→8c94ebc0e6, 57e0485c08→60865ad7d6, 9e7a65585e→56a0828d3e, 28dbd3fdf1→76a4bc74f2, f789fb96e2→53f788e776. Between the two bases, main changed plugin-security (#36085, viewAllFields); overlap-check against 78437e2 is clean, and this head's CI is the reading of record. Round 4, which answers contract review 7064569198, adds one commit built on this branch, 4f11b21. Its readings are taken at that head. It lands last.packages/plugins/plugin-sharing/src/sharing-service.ts).buildReadFilterwrites{ $or: [ownerMatch, queueMatch?, { id: { $in: SharedRecordIds.read(object, user) } }, { id: { $in: pendingApprovalIds } }?] };buildWriteFilterwrites the update form withSharedRecordIds.write(object, user, ['edit', 'full'])and no approval arm;deletestays the owner match alone. The capped grant read (grantedRecordIds,limit 5000) is gone: no grant is read into memory, nothing binds one parameter per grant, and the pending-approval ids are a disjunct of their own (ruling 6942854600: Q1 A, Q2 the recommended column, Q3 A; ruling 6895275749, root fix only).filtermirror is removed (sharing-plugin.ts, the read and bulk-write paths, and, in round 4, thesys_record_shareself-scope branch): every scope is composed intowhereonly, the key the engine's executor seam judges. Pinned:ctx.ast.filteris undefined on both paths and on the self-scope's plain-user and principal-less cases (sharing-service.test.ts).SharingService.shareGrantsInertReason(object)answers why share grants cannot count on an object: the engine's recognition saysother-datasource, or the object's driver does not listSharedRecordIdsinsupports.fixedReadLeaves(today: driver-memory, driver-mongodb, driver-odata). An engine that cannot say answers null, and the leaf is written. In ADR-0111 D7's inert-grant verdict this arm is asked last, so every refusal that shipped keeps its attribution (a public or phantom-anchored federated object still refuses for that reason); it also stops the public arm's external floor (sharing: a share or sharing rule to an external member is refused as inert on a public_read_write or model-less system object, though the external OWD floor would consult it #25549) from lifting there. Where it answers a reason: neither scope carries the share arm (owner, queue and approval arms unchanged), the edit gate reads no grant, the grant door refusesSHARING_NOT_ENABLEDwith the reason (grantAccess/createGrant, as SYSTEM and as a direct caller), the sharing-rule save door refusesSHARING_NOT_ENABLED/ 422 with the remedy, the boot names atwarn, once, every such object holdingsys_record_sharerows (inertShareGrantHolders,share-arm-boot.ts#reportInertShareGrantHolders), andsecurity/explainreports each share on such a record as evaluated andneutraland says why (plugin-security/src/explain-engine.ts).kernel:bootstrappedhook inSharingServicePluginasks the engine's own recognition of D4's class,engine.fixedReadLeafClassOf(SharedRecordIds.read('sys_record_share', probe)). Classregistration-by-name(an object-scoped middleware, or abeforeFind/afterFindhook, forsys_record_share) throws the seam's ownfixedReadLeafRefusal,INTERNAL_ERROR/ 500, naming the registration, beforekernel:listening. No exemption for a handler that skips system reads. A registration made after boot meets the engine's refusal at read, with the same envelope. A registration naming no object, or'*', is outside the class and is told in the changeset. No new package edge:@objectstack/specand@objectstack/corewere already dependencies.plugin-security/src/shared-record-ids-in-memory.testkit.tsresolves a fixed-read leaf over a double's ownsys_record_sharerows under the leaf's ownfixedInnerReadOf, once per statement (a faulted share table fails the statement), and throws on a leaf outside an$incomparand.readable-ids-in-memory.testkit.tsuses it.plugin-sharing/src/shared-record-ids.testkit.tsdoes the same for plugin-sharing's doubles.docs/adr/0155-...md: a dated, append-only note (2026-11-21) saysgrantedRecordIdsis gone and its filter is now the leaf's blank-id guard, anchoredpackages/spec/src/data/fixed-read-leaf.ts#FixedInnerRead. The grant-read bullet at line 160 named the removed symbol as an anchor; it now names it bare, as D2 does, and the note carries the live anchor. Nothing else in the ADR moves.packages/spec/src/contracts/sharing-service.ts, prose only, no type change. The section on the share arm now states the leaf in the present tense ("The read scope's share arm is an engine-internal leaf"), says what the list was before the switch, and says that share grants count only where the leaf can be evaluated: elsewhere no share arm, no grant row read, and the grant and rule doors refuseSHARING_NOT_ENABLED/ 422 (R2). The host bullet compares with what the engine read returned before the switch, andbuildReadFilter's andgrant's jsdoc say the same.packages/spec/src/data/fixed-read-leaf-conformance.test.ts: the D-0 comment that namedgrantedRecordIdsnow describes the read before the switch and points at the blank-id guard. Comment only.skills/objectstack-data/rules/datasources.md: one sentence, made exact in round 4 (N2): "Share grants count only onsys_record_share's datasource under a SQL driver; elsewhere a grant or rule save is refusedSHARING_NOT_ENABLED(422), and asharingRulesreconcile aborts on it." The 422 is what the grant door and the rule-save door answer. A rule declared in a stack'ssharingRulesmeets no door: its reconcile pass aborts on the same code, in the log. Paid for in the same file by cutting restatement (readings under Verification).driver-memorydeclares nofixedReadLeaves, so it answers as R2: its grants go inert, stop counting and fail closed, and the grant and rule doors refuseSHARING_NOT_ENABLED/ 422. Step 4, once it lands, makes those grants count again with no change to plugin-sharing. The D5 row, Q2's closing sentence and plan step 6's "lands last" stand as written, and the note says why..changeset/33787-shared-record-ids-switch.md: the three BREAKING tightenings with each host remedy, the no-object telling (plan step 1'sISharingServiceprose), the three preconditions, the cost quoted no wider than the ADR, and the PostgreSQL 16 total for a caller with no grant, measured, with follow-up driver-sql: measure id = ANY(ARRAY(SELECT …)) against the share-grant semi-join for a caller with no grant on PostgreSQL (ADR-0155 step 6 cost) #36034.Read first (by risk)
packages/plugins/plugin-sharing/src/sharing-service.ts, theshareGrantsInertReasonhunk and its two callers inbuildReadFilter/buildWriteFilter. It decides whether the leaf is written at all: a wrong null writes a leaf the driver refuses with 500, a wrong reason hides every share on the object.packages/plugins/plugin-sharing/src/sharing-plugin.ts, the first newkernel:bootstrappedhook, withshare-arm-boot.ts#shareGrantRegistrationRefusal. It refuses a boot.packages/plugins/plugin-security/src/explain-engine.ts, the sharing-layer hunk (sharesInertReason). It changes what the explainer says admits a record.Two-minute check
pnpm --filter @objectstack/plugin-sharing exec vitest run --maxWorkers=2 src/shared-record-ids-switch.test.ts. ExpectTests 11 passed | 11 skipped (22): the SQLite cell runs, and the PostgreSQL cell runs too whenOS_TEST_POSTGRES_URLis set (then22 passed). The 6,000-grant pin reads 7,000 visible rows where the capped list reads 6,000.Tests
D6 pins,
packages/plugins/plugin-sharing/src/shared-record-ids-switch.test.ts. Real ObjectQL, the realSqlDriverand the realsys_record_share. Two cells: SQLite, and PostgreSQL 16 whenOS_TEST_POSTGRES_URLis set (a schema of its own, dropped after). Fixture: 1,000 owned rows, up to 6,000 granted rows (every thousandth grant read-level, the rest edit-level), a queued row, a pending-approval row, and 50 rows never admitted. Noise grants go to another user, another object, a team recipient and the agent. "Today's list" is the pre-switch read rebuilt: a system read ofsys_record_shareatlimit: 5000, plus the approval id.ReadableIdsof the deal. With the leaf as the parent scope, it admits the same 6,002 lines, and the same count, as the same composition handed today's list: thesecurityservice gives the composition the rebuilt list instead of the sharing scope.ReadableIdsof the deal counts 7,000, and the 6,000th grant's line is read by id.R2 and R1 pins,
packages/plugins/plugin-sharing/src/share-arm-boot.test.ts(18 tests). R2 runs on a real ObjectQL withSqlDriveras the default datasource and a second datasource whose driver declares nothing. The pins cover:SHARING_NOT_ENABLED/ 422 with the remedy;warn, and stays silent when there are none;sys_record_sharethat does not declare the leaf, named by its driver;R1:
beforeFindandafterFindhooks (one whose handler skips system reads included), each refusedINTERNAL_ERROR/ 500;'*'and no-object registrations, not refused;INTERNAL_ERROR/ 500 by the engine;SharingServicePluginthroughkernel:bootstrappedrefuses a host with anafterFindhook forsys_record_share,INTERNAL_ERROR/ 500 naming it, and boots a clean one.Explainer,
packages/plugins/plugin-security/src/explain-fixed-read-leaf.test.ts, now on the real producer. On an object stored by a driver that does not evaluate share grants: the shares areneutral, the record is excluded, and the detail carries the sentence and the driver's name. On the control, the same shares admit.Updated for the new shape: the plugin-sharing scope tests (
sharing-service.test.ts, includingctx.ast.filterundefined on both paths) and the plugin-security tests whose doubles read the scope. Those doubles resolve the leaf throughshared-record-ids-in-memory.testkit.tsunder its ownfixedInnerReadOf, never restating the predicate. The resolution happens where the scopedwherereaches the double, not inside itsfindor matcher.check:objectql-double-limitandcheck:where-matcherlift those functions out of the file to drive them, and an imported call or a closure over the double's tables leaves them undrivable (UNJUDGED). Both gates' baselines never grow, so two doubles and one matcher were returned to their base text. The SQL-compiling tests count the semi-join:controlled-by-parent-leaf-switch.test.ts, andreadable-ids-nested-compose.test.ts, which asserts no statement readssys_record_shareon its own.Ablations, each through
scripts/ablation-replace.mjsafter committing, each restored to the HEAD blob withgit diff HEADempty:buildReadFilter(both cells)buildWriteFilter(SQLite)shareGrantsInertReasonreturns null firstkernel:bootstrappedrefusal'sthrowdeletedlimit: 4999(SQLite)A and B mutate the control, not the code, and show that the two new parity pins read the rebuilt list they claim to. Both ran at 4f11b21 and were restored to the HEAD blob (
git hash-objectequal toHEAD:for the file).Ablations 1 to 5 ran before the arm moved and before both rebases; 3′ and 6 ran after the arm moved, before the second rebase. The lines they mutate are unchanged since. Ablation 3's first attempt was refused before anything ran: its replacement contained the anchor, so the anchor count could not drop. It was restored, re-anchored, and the run above is the second. The round-2 commit (28dbd3fdf1) changes prose, comments, an ADR and a skill line only, so it carries no ablation.
Round 4, at 4f11b21 (this branch, the dogfood closure rebuilt first:
VERDICT command-exit 0). PostgreSQL 16.15 ran in a private cluster for these runs and was removed after.pnpm --filter @objectstack/plugin-sharing typecheck: exit 0,check:test-typecheck: OK.pnpm --filter @objectstack/plugin-sharing test, PostgreSQL on: Test Files 77 passed (77), Tests 1637 passed (1637).shared-record-ids-switch.test.tsgave 22 passed (22), 11 per cell, none skipped. Posted as comment 7064863601.pnpm --filter @objectstack/plugin-security typecheck: exit 0,check:test-typecheck: OK.pnpm --filter @objectstack/plugin-security test: 281 files passed. The five PostgreSQL-gated files failed withECONNREFUSED, because the server had stopped mid-run. Its checkpointer reopenspg_controlby absolute path, and the session re-locks its scratchpad's parent directories, so the reopen was refused and the server shut down. Rerun with the server up, in one window, those five files gave 171 passed (171):controlled-by-parent-leaf-switch,explain-cross-class-refusal,explain-json-column-refusal,rls-boolean-comparand-doorandrls-check-cross-class-field-refused.Suites and typecheck at the local head, 28dbd3fdf1 (rebased onto c00be39, the dogfood closure rebuilt first:
VERDICT command-exit 0):pnpm --filter @objectstack/spec typecheck: exit 0,check:test-typecheck: OK. The spec tests that read the edited files,src/contracts/sharing-service.test.ts,src/data/fixed-read-leaf-conformance.test.tsandsrc/data/shared-record-ids.test.ts: Test Files 3 passed (3), Tests 109 passed (109).pnpm --filter @objectstack/plugin-sharing typecheck: exit 0,check:test-typecheck: OK.pnpm --filter @objectstack/plugin-sharing test: Test Files 77 passed (77), Tests 1624 passed, 9 skipped (1633). The 9 are the PostgreSQL cells.pnpm --filter @objectstack/plugin-security typecheck: exit 0,check:test-typecheck: OK.pnpm --filter @objectstack/plugin-security test: Test Files 286 passed (286), Tests 7113 passed, 45 skipped (7158). The skips are the PostgreSQL cells.OS_TEST_POSTGRES_URLwas unset for these runs. The PostgreSQL cells last ran before the second rebase, with no failure (plugin-sharing 1633 passed, plugin-security 7181 passed). Between the two bases main changed no file underpackages/drivers,packages/objectqlorpackages/plugins.The final head, f789fb96e2, adds one commit on top of 28dbd3fdf1: the dogfood pin (Acceptance notes). No package source changed, so the suites above stand for it.
Dogfood battery at 4f11b21, this branch's head
Owed by the
(narrowing)arm. Command:pnpm --filter @objectstack/dogfood testunder the verify lock, no shard and no path, on the closure rebuilt at this head. Result:VERDICT command-exit 0. Test Files 483 passed, 3 skipped (486). Tests 4101 passed, 68 skipped (4169).Dogfood battery at f789fb96e2, the local head before the cherry-pick
Owed by the
(narrowing)arm. Command:pnpm --filter @objectstack/dogfood testunder the verify lock, no shard and no path, on the closure built at 28dbd3fdf1; the final commit changes only a dogfood test file, which nodistcarries. Result:VERDICT command-exit 0. Test Files 482 passed, 3 skipped (485). Tests 4098 passed, 68 skipped (4166).The run at 28dbd3fdf1, before the pin commit, read
VERDICT command-exit 1: Test Files 1 failed, 481 passed, 3 skipped (485). Its one failure was the[integrity]pin.Acceptance notes
The dogfood
[integrity]pin, updated.packages/qa/dogfood/test/authored-row-write-scope.dogfood.test.ts:284-287pinned the bare owner match:buildReadFilter(CLOSED, bobCtx)toMatchObject{ owner_id: bobId }. Under this PR the scope is$orof the owner match and the leaf, so the pin went red. The next assertion (Bob reads only his own row on the private object) held throughout. The pin now asserts the owner disjunct, a one-line change and nothing else in the file (f789fb96e2):The file was outside this claim's file surface. Seat 7 asked the maintainer at 2026-11-21T09:22Z to authorize changing lines 284-287, and the maintainer (Tesla) answered verbatim at 2026-11-21T11:09:38Z: 「同意」. The file alone passes: Test Files 1 passed (1), Tests 12 passed (12).
driver-memory: share grants become inert there. driver-memory does not declare that it evaluates the share-grant leaf, so it gets R2's answer, as driver-mongodb and driver-odata do. On an object it stores, share grants stop counting: the read and update scopes fail closed to the owner, queue and approval arms, and the edit gate reads no grant. Nothing is silent about it. The grant door and the sharing-rule save door refuse a new grant or rule loudly,
SHARING_NOT_ENABLED/ 422 with the reason, and the boot names, atwarn, each such object that holds share rows. No read is refused with a 500. This is the ruled behaviour: ruling 6942854600 on #33787 (② ruled R2, the storage rows), and ADR-0111 D7's amendment note of 2026-11-17, which gives D7 this arm and says it takes effect with this switch. Seat 7 confirmed the reading on 2026-11-21. Plan step 4 (an in-process evaluation of the leaf on driver-memory) would make these grants count again with no change here. Since round 4 the record says so too: ADR-0155's second dated note, after D5 (S1). The dogfood stacks boot on sqlite-wasm, which extendsSqlDriverand inherits its declaration, so they are not affected.Preconditions inherited from #35906 (close-out 7057616561), each carried into the changeset:
INTERNAL_ERROR/ 500, where step 3 ran it uncast.where, and the caller's statement carries it);sharing-service.tsandsharing-plugin.tshold 0 references totransaction; the plugin's own reads are sequential system reads, and its onePromise.allover reads (ownership-queue-service.ts:441) runs under the system context outside any transaction. So no producer here issues concurrent statements on one transaction while a leaf statement is primed. A caller that runs its own statements concurrently on one transaction is the precondition's case and is told in the changeset.The speed figure, quoted no wider than ADR-0155 "What it costs": for the scope statements alone (the account page, its total and the two grant reads), at 1M rows and 5,000 grants, the id-list scope against the semi-join scope read PostgreSQL 21.6 → 7.0 ms and SQLite 18.3 → 12.1 ms. It is not a whole-request figure.
The caller with no grant (D6), measured on this tree. Before the switch the statement was the bare owner match; now it is
$orof the owner match and the leaf. Medians of 25 runs, a page of 50 and its total, 50,000 grants held by other users, the caller holding none:idx_..._owner_idkept on page and totalidx_..._owner_id→ Seq Scan with a hashed SubPlanSQLite still serves both from the owner index. PostgreSQL serves the page as before but plans the total as a sequential scan, which grows with the table; this agrees with step 3's reading (close-out 7048322381), whose L2 named
id = ANY(ARRAY(SELECT ...))as an alternative. The cost ships stated in the changeset and the 速读 (seat 7's call, 2026-11-21); follow-up #36034 measures that form against the semi-join for this caller on PostgreSQL. It is named here as a cost, not changed.O8 census, this repository at 8c8ff0f. No site changes a system read of
sys_record_share; no registration names it by name; no default opts it into record-view auditing. No D-0 finding. The registrations that name no object (organizations, approvals, audit, auth, security, sharing, runtime app-plugin, mailbox, messaging) were each read: none changes that read.objectstack-ai/hotcrm(e7fe77f0) was read by the card thread: nothing. O8 census: the platform half is measured (this repository and hotcrm, recorded in #33787's body). The cloud half has moved to #36115 (area:cloud) on the maintainer's word, 2026-11-21 14:43 UTC, verbatim: 「需要 cloud 仓库的任务,分配到 area:cloud」. cloud pins objectstack by version, so any adaptation lands on its own bump.Mirror. The AST
filtermirror stopped carrying the scope at all, rather than being pinned as unread (plan step 6 allows either). In round 4 (N1) thesys_record_shareself-scope branch stopped mirroring too, so no branch of the sharing middleware writesfilternow. That branch never carried the leaf. Nothing in the repository readsast.filter:git grepfinds only a test double that falls back to it,write-denial-user-copy.test.ts, on an object this branch never scopes.Left as written. In
fixed-read-leaf-conformance.test.tsthe D-0describeandittitles still say "today's list" and "reads it today"; the amendment names the comment, and test titles are not prose a reader takes as the contract. The ADR-0155 bullet at line 160 keeps its wording as a reading ofb8ac0e24; only its anchor became a bare name.Docs drift (advisory comment 7064411467), read in round 4. I re-derived the list on 4f11b21 against 78437e2 with
node scripts/docs-audit/affected-docs.mjs --json 78437e20d7. It gives 45 pages: 28 hand-written and 17 release-owned, the same counts the bot gave. I re-read only the pages that nameSHARING_NOT_ENABLED, and two of them list its causes without the one this PR adds: the share table's datasource is not under a SQL driver, so grants and rule saves are refused on every object.content/docs/kernel/runtime-services/sharing-service.mdx, Typical Errors.content/docs/permissions/sharing-rules.mdx, the paragraph on refusals at save.Neither page is edited in this round. A docs edit would move the head past the one S2 was read at. Both pages are prose faces, so this is the seat's call: edit them in this PR or in a docs-only follow-up. I did not re-read the other 26 hand-written pages this round.
Seen in the dogfood log, not from this change. The showcase stack logs
Schema sync FAILED for object 'showcase_invoice'on sqlite-wasm (alter table ... add column invoice_date date default (strftime('%Y-%m-%d', 'now')): "Cannot add a column with non-constant default"), followed by a SeedLoader stale roll-up error. It appears 20 times in each battery: at 4f11b21, at the local heads, and in the pre-rebase run. Nothing here touches schema sync, the showcase app or sqlite-wasm. Noted, not filed.Oracle, after #36001. For a key the
RAW(16)prime names, the leaf projects the list'sHEXTORAWconversion. A grant the list admits gives the list's rows. A grant the list would refuse (INVALID_FILTER/ 400, before SQL) now fails the statement with ORA-01465, 500. An unprimed key, such as the parent scope inside a composedReadableIdssubquery (#35960), compiles as the list's text binds do, so the switch leaves that path exactly as it is.Verification
This head's CI check-runs are the reading of record. The families below are this tree's derivation, run locally.
Round 4, at 4f11b21:
dispatch-gates --commands --repo objectstack-ai/objectstackderives 121 families against merge base 78437e2 and 32 paths. Round 4's paths add none. All 121 ran, each exit code captured before any pipe, and all 121 exit 0.check:type-check-debtfirst answered exit 3: its build queued behind the dogfood battery on the verify lock. Rerun under the lock, it re-measured clean.--ran: "121 derived famil(ies) accounted for — 121 run, 0 NOT-MEASURED".check:adr-symbol-anchors: 3865 anchors resolve. The new note adds no anchor.check-adr-links: 1165 links resolve.check-skills-token-ratchet: datasources.md is 911 of 911.check:skill-identifier-liveness: 548 citations, up from 547, withsharingRuleslive.check:objectql-double-limit,check:where-matcherandcheck:query-options-erasure: each "baseline key set verified against 78437e2: no files added".check:nul-bytes: OK.node scripts/pm/overlap-check.mjs --branch=claude/project-thread-thptm0:VERDICT clean exit 0against origin/main 3c06fc5, five commits past this branch's base, one of them in driver-sql (fix(driver-sql): name the safe column entries' remedy per object kind #36101).node scripts/check-platform-checklist.mjs --changed-from 78437e20d7: OK, 2 anchors judged, 0 lost.The local build, before the cherry-pick:
node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackderives 121 families, against merge base c00be39 and 32 paths. The dogfood pin's path added no family to the 121 derived at 28dbd3fdf1. The 38 families that are new since the first round come from the spec, ADR and skills paths. At f789fb96e2 all 121 ran, each exit code captured before any pipe, and all 121 exit 0.check:type-check-debtwaited its turn on the verify lock and re-measured clean:OK — 0 ledger entr(ies) re-measured … none above its recorded number.--ranover the record: "121 derived famil(ies) accounted for — 121 run, 0 NOT-MEASURED (a DERIVED zero — all 121 recorded an exit code and none of them is 3)". At 28dbd3fdf1 the same 121 were also all green; there,check:type-check-debtfirst hit a lock queue-timeout and passed when rerun under the lock.check:adr-symbol-anchors: "3865 anchors across 160 records resolve … 0 line anchors survive".pnpm check:query-options-erasure: exit 0.pnpm check:nul-bytes: exit 0.node scripts/pm/overlap-check.mjs --branch=local-33787:VERDICT clean exit 0at f789fb96e2, against origin/main 8145424. That is nine commits past this branch's base (ui/, platform-objects, plugin-approvals, service-messaging, client, cli tests, one spec source), and none of them shares a file with this branch.node scripts/check-platform-checklist.mjs --changed-from c00be39b74: OK, 2 anchors judged, 0 lost.pnpm check:skill-frame-freshness: exit 0. The frame is byte-identical to the ref.pnpm check:dev-prereqs: exit 1. 35ui/workspace packages have nodistin this checkout, because they are outside the dogfood closure built here. This reading is about the box, not the change.Skills readings (
skills/**diff, the PR's whole skills change, round 4 included):skills/objectstack-data/rules/datasources.md, linesSKILL.mdsummedskills/**/*.mdThe sentence, and N2's longer wording of it in round 4, are paid for in the same file by deleting restatement. Round 2's cuts:
Round 4's cuts, for N2's wording:
validate-onlyrow's "instead of failing boot": theexternalrow above it says a mismatch fails the boot, and "but … warns" is the contrast.remoteSchemaline: the line is commented out, which is what marks it optional, as thecolumnMapline beside it shows with no such word."Federation is read-only by default." stays cut (N2). It restates the section it sat in: "Writes — double opt-in" names the default (nothing is on until opted in), and "To write, set
datasource.external.allowWrites: trueand the object'sexternal.writable: true" names the only way on. Eval case 3 expects the write gate left closed (noallowWrites, nowritable). That is an absence, which the remaining text teaches. No eval case grades on the sentence, and no published skill or doc reads it from this file.content/docs/data-modeling/external-datasources.mdxcarries its own copy of the sentence, unchanged.No ceiling moved.
check-skills-token-ratchet: "datasources.md is 911 tokens (ceiling 911; headroom 0)". Also green:check:skill-identifier-liveness,check:skill-links,check:skill-frame-sync,check:skill-compatibility, andspec check:skill-refs/check:skill-served-sections.The objectstack-data eval cases:
pnpm --filter @objectstack/scenarios skill-evals --skills objectstack-data --dry-runexits 0 and plans 66 cases, so the catalog loads. The eval round itself is NOT MEASURED. It drives a model through a login for 125 turns and is not a CI gate or a merge gate. The datasource cases (3 and 11) grade ondefineDatasource,datasource,remoteName,columnMap,schemaMode,OS_DATASOURCE_ENV_CREDENTIALS,_PASSWORD,ObjectSchema.createandsharingModel: 'public_read'. The file still teaches every one of them, and none of the deleted text carried one.Generated by Claude Code