Repository navigation
perf(sharing): ask record sharing for the write verdicts of a predicate write's candidates as one set - #37558
objectstack-fleet[bot] wants to merge 7 commits into
Conversation
… record ids checkEditMany / checkDeleteMany on the contract (optional), one implementation in SharingService behind both the by-id and the set form, and plugin-security's predicate write asks the set form where the service serves it. Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS Co-authored-by: Claude <noreply@anthropic.com>
…dict Equivalence over the record-sharing matrix, counted reads per chunk, fail-closed per chunk, and plugin-security's feature-detect of the set form over the predicate-write matrix. Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS Co-authored-by: Claude <noreply@anthropic.com>
…aring-bulk-write-scope
…bound after its filter check:objectql-double-limit could not drive the double; its find now filters a plain store and slices by limit only when one is given, and the read counting sits outside the store's answer. Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS Co-authored-by: Claude <noreply@anthropic.com>
…nator Claude-Session: https://claude.ai/code/session_01Utp6CbdHk3orAeensH6EzS Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 23 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 11 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 180 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 7839cc29de401a48b42234f12b0e583ef133dc6e && git checkout 7839cc29de401a48b42234f12b0e583ef133dc6e
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 061e342242e8b022404ff2c074c1238a02333fa8 14bf9f91364c962a6dc96e3e66272c95ed29e14d && git checkout -B drift-repro 061e342242e8b022404ff2c074c1238a02333fa8 && git merge --no-ff 14bf9f91364c962a6dc96e3e66272c95ed29e14d
node scripts/docs-audit/affected-docs.mjs --json 061e342242e8b022404ff2c074c1238a02333fa8
|
|
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS Final head for L1 + contract review · area o5-D · 2026-11-26T13:16Z
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract-review-claim: session_01Utp6CYtTDvfPQDzMbZnN5X · head 14bf9f9 · 2026-11-26T13:17Z |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Contract reviewServed-tier: Security-touching: this is the record-sharing write gate and the predicate write's floor decision (authorization). It was judged on one question first: can the set form answer Check-runs on this head when read: 20 success, 11 skipped, 34 in progress, 0 failed. The PR is a draft. Every Test Core shard, Build Core and the workspace type check were still running, so this PASS is the design verdict only; it weighs no red gate because none had concluded. Do not queue before those runs end green. ① Derived judgments
② Semver levelClause-②: yes (widening). Right: an additive optional member on a published contract. The line is in both the PR body and the changeset.
One observation for the lane seat, not graded here: the changeset's "from 20,004 store reads and 6.6 s" is the per-row run on this branch (6,603 ms). The same case on main read 6,013 ms, and the #35802 changeset says 5.3 s. The read counts agree everywhere. ③ Boundary flags
④ Design judgmentNo must-fix, no should-fix.
Both docblocks name the
Nits. None changes a verdict on a path the tree reaches. N1 and N2 are worth a follow-up card; N3 and N4 can stay.
For the lane seat (tests are its ACCEPT): the equivalence pin compares the set form with Implemented-by: VERDICT: PASS |
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X 席位核对Head-sha:
|
|
repo:objectstack#5 · os-bill · session_01Utp6CYtTDvfPQDzMbZnN5X Security label: the sharing write verdicts gate edit and delete (contract record 7193294421; no security finding, and every difference leans toward deny). |
Requested by Bill · project thread
repo:objectstack#5 · os-bill · session_01Utp6CbdHk3orAeensH6EzS
Fixes #35934
Ruling-ref: 7190344023
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
ISharingService(packages/spec/src/contracts/sharing-service.ts) gains two OPTIONAL members, as ruled (option C):checkEditMany(object, recordIds, context)andcheckDeleteMany(object, recordIds, context).SharingWriteVerdict[]: answer i is the verdictcheckEdit/checkDeleteanswers forrecordIds[i](same length, same order, repeats kept).editshare isallowtocheckEditManyanddenytocheckDeleteMany.denyfor each of its records, neverabstain.checkEdit/checkDeleteon this same contract, plus the data protocol's…Manysuffix (IDataDriver.updateMany?/deleteMany?, both optional). Two members rather than one with a verb argument, because this contract already splits the write verdict by verb.SharingService(plugin-sharing) implements both.checkEdit/checkDeleteare now the one-record case of the same privatewriteVerdicts:WRITE_VERDICT_CHUNK; the docblock gives the dialect bounds: Oracle's 1,000-item IN list, SQL Server's 2,100 parameters).SecurityPlugin(plugin-security) feature-detects the set form on the kernel'ssharingservice on the predicate write floor relief (#35802 / #35914):__writeScope, the external grant patch). An answer that is notallowordenynormalises toabstain. A probe that throws, or a list of the wrong length, givesdenyfor all, with one error logged.Not in this PR (as ordered): the 2a authored-scope change. Untouched: ADR-0155,
buildWriteFilterand every find.Changeset: patch for
@objectstack/spec,@objectstack/plugin-sharingand@objectstack/plugin-security. Rule read: AGENTS.md Post-Task Checklist 3. Kindnonegives patch, and an optional, non-protocol contract widening ships patch.Tests
Measured on SQLite, N = 10,000 rows owned by another user. The bench is the kept one from report 7187608580, extended with set-form counting and a per-row mode. It is uncommitted, as ordered. Set form is this branch; per-row is the same branch without the set members; main is the report's readings.
New pins:
plugin-sharing/src/sharing-service.test.ts, equivalence:checkEditMany/checkDeleteManyequalcheckEdit/checkDeleteon every row.denyand one log line. A share read that throws denies its whole chunk, owned rows included.plugin-security/src/predicate-write-floor-deferral.test.ts, feature-detect:deny, and delegated or no-floor callers are not asked.Ablations: each one was committed first, mutated through
scripts/ablation-replace.mjs, and restored (blob equals HEAD,git statusclean).abstain: 2 fail-closed cases red.WRITE_VERDICT_CHUNK = 1: 2 counted-reads cases red.return nullchanged toreturn []: 10 plugin-security cases red.Acceptance notes
content/docs/**/sharing-service.mdxlists only the boolean methods, and says nothing about bulk write cost. It is outside this card's file surface, so it is left to the docs-drift follow-up.owner_only_writes, so Modify All and edit shares silently match only self-created rows #35802 describes the per-row cost that this PR supersedes in the same release; this changeset states the new cost.Verification
pnpm --filter @objectstack/plugin-sharing exec vitest run --maxWorkers=2 src/sharing-service.test.ts -t "35934". Expect every[#35934]case green, including10,000 records: two reads per chunk of 1,000.plugin-sharing/src/sharing-service.ts,writeVerdicts: the per-row order inside the chunk loop, and the try per chunk.plugin-security/src/security-plugin-sharing-verdicts.ts,resolveSharingWriteVerdicts: normalisation and the length check.packages/spec/src/contracts/sharing-service.ts: the member docblocks.Local runs at the final head
14bf9f91, throughscripts/pm/os-verify-lock.sh:plugin-sharing:pnpm testgives 78 files, 1,748 passed / 11 skipped. Typecheck passed.sharing-service.test.tswas re-run after the last commit: 289 passed.plugin-security:pnpm testgives 290 files, 7,330 passed / 45 skipped. Typecheck passed. Run atc6f613be; the last commit touched only aplugin-sharingtest file.spec:src/contracts/sharing-service.test.tsgives 15 passed, andcheck:generatedreports all 14 artefacts up to date.Derived gate families: 95 derived, 95 run
node scripts/pm/dispatch-gates.mjs --commandsgives 95 commands. The list is the same atc6f613beand at14bf9f91. The--ranreconciliation reports 95 run, 0 NOT-MEASURED, 0 UNRUN.c6f613be: 92 exited 0 and 3 exited 1.check:dts-closureandcheck:dual-build-cjs-loadswent red while a concurrent closure build of mine hadpackages/plugins/organizations/disthalf-written. Re-run after the build: both exit 0 (267/267 declaration files; 127 require entry points load).check:where-matcherwas a real finding: the new engine double read a where combinator as a field name. Fixed in14bf9f91(the double now refuses a combinator), and the gate exits 0.14bf9f91, and all 20 exited 0: where-matcher, objectql-double-limit, engine-double-contract, nul-bytes, test-source-alias, type-check-debt, cross-package-test-inputs, query-options-erasure, refd-timer-probe and eleven more.check:dev-prereqsscan: NOT MEASURED (--self-testpassed). This box has 35 unrelated@object-uipackages unbuilt, and the scan judges the whole workspace.node scripts/pm/overlap-check.mjs --branch=HEADat14bf9f91gives VERDICT clean: it merges cleanly with origin/main1af67b26, and no open pull request head shares a file.🤖 Generated with Claude Code