Repository navigation
fix(sharing)!: delete on an owned public_read_write object follows the record's owner - #39216
objectstack-fleet[bot] wants to merge 13 commits into
Conversation
… record's owner (WIP) Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
…e owner authority (WIP) Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
… owner rule (WIP) Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
…elete on an owned public_read_write object (WIP) Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
…owned public_read_write object follows the owner Comment and JSDoc text only, no type or .describe change: the places that said the creator floor decides delete on a public_read_write object, or that checkDelete abstains exactly where checkEdit does, now name the ruling of record 7288570890. Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
… the owner, two narrowings named Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
… its contract type Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
…gin-sharing is installed Without the sharing service no door answers delete on an owned public_read_write object by its owner, so the owd_baseline layer keeps the declared open baseline there; with it, the layer reads owner-scoped for delete whether or not a record id is asked about. Four explain parity controls that boot without plugin-sharing stay green. Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 3 package(s): 22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 186 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 1f61acc0a645b81d449f787a69eb0f80eb865ff1 && git checkout 1f61acc0a645b81d449f787a69eb0f80eb865ff1
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 5a0bb8dd65283cbb34151e6569334b3c135b9473 9d7a867b8a40133c2c9d5f62e1f87ec4e0ee629f && git checkout -B drift-repro 5a0bb8dd65283cbb34151e6569334b3c135b9473 && git merge --no-ff 9d7a867b8a40133c2c9d5f62e1f87ec4e0ee629f
node scripts/docs-audit/affected-docs.mjs --json 5a0bb8dd65283cbb34151e6569334b3c135b9473
|
…s the record's owner Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
…e say delete on an owned public_read_write object follows the owner Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
…s on private once delete follows the owner Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr Contract reviewServed-tier: PR #39216, card #38517. Narrowing face: the PR body and the changeset both carry Check-runs on this head: 0 failed. Test Core 12/12, Test UI 16/16, Dogfood Regression Gate, the three dogfood battery shards, Check Changeset, Spec property liveness, Governed Surface Queue Guard, Type Check and every Lint family conclude ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentRead against ruling 7288570890 and the two later rulings, and the code paths the change relies on. The mechanism holds. By id: plugin-sharing's own middleware refuses when S1 (should-fix) — S2 (should-fix) — N1 (nit) — two reworded comments over-generalise: N2 (nit) — the population of ruling 7363759845 (a principal outside N3 (nit) — Open on this head: S1, S2. No must-fix. Implemented-by: VERDICT: PASS |
…keeps today's delete; pins for the ruled populations The ownership hand-off for delete now requires an owner column the platform provisioned or the author mapped, so a federated object whose owner_id is only the injected anchor keeps the floor, in the sharing service and in explain. New pins: custom-role members and the no-bypass org admin follow the owner (rulings of record 7363759845, 7364954150), the external owner of a row outside its grant's predicate is refused, a cascade into an owned public_read_write child and the recycle bin's permanent delete follow the owner. Comment and doc text follows: canDelete's two-state projection, the floor comments, the org admin sentence. The changeset names the third narrowed population. Claude-Session: https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr Contract reviewServed-tier: Delta review of PR #39216 (card #38517) after record 7364877498 on Check-runs on this head: 0 failed. Test Core 12/12, Test UI, Dogfood Regression Gate, the three dogfood battery shards, Spec property liveness, Governed Surface Queue Guard, Type Check and the Lint families conclude ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgmentS1: closed. The exclusion is in both predicates. S2: closed. Nits of the earlier record: N1 fixed (both comments now name the platform table with no declared model and the on-behalf-of write). N2 fixed (custom-role member pinned at the door on both models, with a control on the object with no owner column). N3 fixed. New pins in N4 (nit) — N5 (nit) — the new No must-fix, no should-fix. Implemented-by: VERDICT: PASS |
|
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr 维护者速读
席位核对ACCEPT — head
|
|
repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr 维护者速读
席位意见:ACCEPT。四类收紧都有裁决依据,并且都写进了变更说明。剩下的一个测试缺口和三处措辞由 #39243 跟进,技能文案由 #39217 跟进。 |
Requested by Bill · project thread
repo:objectstack@os-bill · os-bill · session_01Utp6Cb2WxATpgLNvmWnnUq
Fixes #38517
Ruling-ref: 7288570890
Clause-②: yes (narrowing)
Metadata-protocol: semantic
Skills-docs: follow-up #39217
维护者速读
Maintainer answers, all as built: ruling record 7363759845 (principals the creator floor never bound, a membership role outside the built-in roles or a session with no organization, follow the owner for delete too), ruling record 7363783625 (an external user whose permission grant speaks for the object follows the members' owner rule for delete) and ruling record 7364954150 (organization owners and admins who hold the no-bypass admin set follow the owner, as on a private object, with no carve-out). No code change followed any of them; all three narrowed populations are named in the changeset.
What changes
On an object that declares
sharingModel: 'public_read_write'and has an owner field (owner_id), delete is now answered by the same ownership authority that answers it on a private object, instead of by the platform's creator floor (owner_only_deletes,created_by == current_user.id):plugin-sharingSharingService: a newownershipDecidesDeleteOnOpenWrites(schema)predicate, andwriteOwdForVerb(...), which reads the write OWD asread(owner-scoped) for thedeleteverb on such an object.writeVerdicts(by-id:checkDelete/checkDeleteMany) therefore answersallow/denyinstead ofabstain, andbuildWriteFilter('delete')returns the owner / depth predicate instead ofnullfor predicate deletes. Modify All and the role-hierarchy depth (writeScope) are the existing private-object paths, unchanged.security-plugin-authz-middlewarestep 2.7) already lets a sharingallowreplace the floor and refuses adeny, so no gate code moves. The rls-filter placement of the floor (Apublic_read_writeobject is only writable by the row's creator —showcase_contributorgets 403 editing ashowcase_projectit can read, where the access matrix declaresedit:true#8023) is untouched, so the row gate never compiles to nothing.plugin-securityexplain-engine: theowd_baselinelayer fordeleteon such an object reportspublic_read_write (delete follows the record owner)with effectread, sosecurity/explainagrees with the door;updatestill reports the open baseline. It reads that only where plugin-sharing is installed (a newsharingServiceWiredexplain dependency, set bysecurity-plugin-explain-access): without it no door answers that delete by owner, so explain keeps the declared baseline, which keeps four explain parity suites that boot without plugin-sharing green.public_read_writeobject or thatcheckDeleteabstains exactly wherecheckEditdoes:packages/spec/src/contracts/sharing-service.ts(ISharingService.checkDelete),packages/spec/src/security/permission.zod.ts(Modify All; the.describestring is unchanged, so no generated artifact moves), and fourplugin-securityfiles (security-plugin-rls-filter.ts,platform-ownership-policies.ts,objects/default-permission-sets.ts, the step 2.7 abstain prose insecurity-plugin-authz-middleware.ts).content/docs/permissions/sharing-rules.mdx: the paragraph that said the sharing service abstains on apublic_read_writedelete (so the creator floor stays) now says the delete follows the owner;content/docs/permissions/permissions-matrix.mdx(the same floor paragraph) andcontent/docs/kernel/runtime-services/sharing-service.mdx(the doc copy of thecheckDeleteabstain sentence) likewise. Found by reading the docs-drift check's list; added to the claim by the zone.Unchanged: edit on the same object (everyone with edit edits every row); objects that declare
public_read_writewithout an owner field, a federated object whoseowner_idis only the platform's injected anchor (no column, nocolumnMapentry:hasPhantomOwnerAnchor, excluded inownershipDecidesDeleteOnOpenWritesand in explain'sdescribeOwdFor) among them; platform objects with no declared sharing model;controlled_by_parentdetails; externals whose grant does not speak for the object (already floored to owner-only); recycle-binrestore/purge(entryId)/empty(no record id or AST; stilldeleted_by+manageRecycleBin).Three narrowed populations, each named in the changeset and each ruled: (1) a member who created a row someone else now owns loses delete (7288570890); (2) principals the creator floor never bound (custom membership role strings keep their string as position, so the
org_memberfloor never applied; org-less sessions) lose the delete on rows they do not own (7363759845); (3) organization owners and admins holdingorganization_admin_no_bypass(a wall-less posture, or a walled one withsuppressUnbounded) delete only rows they own or manage, as onprivate(7364954150);admin_full_accessand Modify All are unaffected. Externals follow the members' rule (7363783625).Tests
packages/plugins/plugin-security/src/public-read-write-owner-delete.test.ts: realObjectKernel+ObjectQLPlugin+ better-sqlite3SqlDriver+SecurityPlugin(withmember_defaultfloor) +SharingServicePlugin, 33 cases. Owner deletes; manager above the owner (own_and_reports) deletes; Modify All deletes; creator-not-owner, stranger and a manager above someone else are refused; an ownerless row is deleted only by Modify All; edit unchanged for all;security/explainagrees per verb and per caller; an object with no owner column keeps the creator floor; predicate delete removes only the caller's owned rows (Modify All removes all); externals with and without a speaking grant. Added in review round 2: a custom-role member (owner deletes, refused another user's row, explain agrees, private parity); the no-bypass org admin (own row deletes, colleague's row refused, explain agrees, private parity); an external owner of a row outside its grant's predicate (refused, explain agrees); a cascade from an ownedprivateparent into an ownedpublic_read_writechild (refused whole when the child is another user's even though the caller created it; control removes both); the recycle bin's permanent by-id delete (permanent: true, withmanageRecycleBin: the owner purges, the creator who no longer owns it is refused).plugin-sharingfederated-phantom-owner-scoping.test.ts: the grandfathered showcase shape (public_read_writeover a phantom owner anchor) keepscheckDelete/checkDeleteManyabstain,canDeletetrue and a null delete write filter; anti-vacuity control: the same model over a real owner column denies a non-owner and returns an owner filter, with edit still abstaining.plugin-sharingsharing-service.test.ts(the public-object delete cells of the canDelete table, the abstain case split into a newdenycase,checkDeleteManyon the open object),operator-id-write-gate-33928.test.tsandplugin-securitycascade-delete-security-parity.test.ts(theirpublic_read_writeparent rows are now owned by the caller; the invariants they pin are unchanged).sharing-service.tsrestored toorigin/main(plugin-sharing dist rebuilt, grep 0) 8 of 23 ruled cells red; restored, green. Without the explain change, its cell is red. Round 2: withsharing-service.tsrestored toorigin/main(dist grep 0) 13 of 33 cells red, every new discriminating pin among them; with only the phantom-anchor exclusion removed, its pin is red (1 of 59).packages/qa/dogfood/test/owd-public-read-write-write-floor.dogfood.test.tsis not edited.predicate-write-unreadable-not-matched.dogfood.test.ts: the DELETE leg of its by-id control re-pinned (see Acceptance notes), 16/16 locally.Acceptance notes
skills/objectstack-data/rules/security.mdstill describes delete onpublic_read_writeby creator).public_read_writeobject now gets, on delete, the answers aprivateobject already gives: its own row meets the read door's refusal, another user's row and an id naming none get the same record-level refusal.packages/qa/dogfood/test/predicate-write-unreadable-not-matched.dogfood.test.ts's by-id control re-pins only its DELETE leg to that (claim amended by the zone); its PATCH leg is unchanged.purge(entryId),emptyandrestore(entryId)carry no record id or AST and are untouched.Verification
pnpm --filter @objectstack/plugin-security test: 292 files, 7406 passed / 52 skipped / 0 failed;pnpm --filter @objectstack/plugin-sharing test: 80 files, 1778 passed / 11 skipped / 0 failed.tsc --noEmiton plugin-sharing and plugin-security on head 9d7a867: exit 0.node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstackon head 9d7a867: 123 derived families, every one run with its exit code recorded, all 123 exit 0;--ranreconciliation: 123 run, 0 NOT-MEASURED, 0 UNRUN. An earlier pass on the pre-merge head found one real finding (check:slot-lookup: the new pin looked the security service up asany), fixed in this branch.origin/mainonce (main at f1df7a8, no conflict, no file overlap) before opening.🤖 Generated with Claude Code
https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq