Skip to content

fix(sharing)!: delete on an owned public_read_write object follows the record's owner - #39216

Queued
objectstack-fleet[bot] wants to merge 13 commits into
mainfrom
claude/project-thread-crdvow
Queued

objectstack-fleet[bot] wants to merge 13 commits into
mainfrom
claude/project-thread-crdvow

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

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-sharing SharingService: a new ownershipDecidesDeleteOnOpenWrites(schema) predicate, and writeOwdForVerb(...), which reads the write OWD as read (owner-scoped) for the delete verb on such an object. writeVerdicts (by-id: checkDelete / checkDeleteMany) therefore answers allow / deny instead of abstain, and buildWriteFilter('delete') returns the owner / depth predicate instead of null for predicate deletes. Modify All and the role-hierarchy depth (writeScope) are the existing private-object paths, unchanged.
  • The by-id gate (security-plugin-authz-middleware step 2.7) already lets a sharing allow replace the floor and refuses a deny, so no gate code moves. The rls-filter placement of the floor (A public_read_write object is only writable by the row's creator — showcase_contributor gets 403 editing a showcase_project it can read, where the access matrix declares edit:true #8023) is untouched, so the row gate never compiles to nothing.
  • plugin-security explain-engine: the owd_baseline layer for delete on such an object reports public_read_write (delete follows the record owner) with effect read, so security/explain agrees with the door; update still reports the open baseline. It reads that only where plugin-sharing is installed (a new sharingServiceWired explain dependency, set by security-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.
  • Comment and JSDoc text only, where it said the creator floor decides delete on a public_read_write object or that checkDelete abstains exactly where checkEdit does: packages/spec/src/contracts/sharing-service.ts (ISharingService.checkDelete), packages/spec/src/security/permission.zod.ts (Modify All; the .describe string is unchanged, so no generated artifact moves), and four plugin-security files (security-plugin-rls-filter.ts, platform-ownership-policies.ts, objects/default-permission-sets.ts, the step 2.7 abstain prose in security-plugin-authz-middleware.ts).
  • content/docs/permissions/sharing-rules.mdx: the paragraph that said the sharing service abstains on a public_read_write delete (so the creator floor stays) now says the delete follows the owner; content/docs/permissions/permissions-matrix.mdx (the same floor paragraph) and content/docs/kernel/runtime-services/sharing-service.mdx (the doc copy of the checkDelete abstain 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_write without an owner field, a federated object whose owner_id is only the platform's injected anchor (no column, no columnMap entry: hasPhantomOwnerAnchor, excluded in ownershipDecidesDeleteOnOpenWrites and in explain's describeOwdFor) among them; platform objects with no declared sharing model; controlled_by_parent details; externals whose grant does not speak for the object (already floored to owner-only); recycle-bin restore / purge(entryId) / empty (no record id or AST; still deleted_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_member floor never applied; org-less sessions) lose the delete on rows they do not own (7363759845); (3) organization owners and admins holding organization_admin_no_bypass (a wall-less posture, or a walled one with suppressUnbounded) delete only rows they own or manage, as on private (7364954150); admin_full_access and Modify All are unaffected. Externals follow the members' rule (7363783625).

Tests

  • New packages/plugins/plugin-security/src/public-read-write-owner-delete.test.ts: real ObjectKernel + ObjectQLPlugin + better-sqlite3 SqlDriver + SecurityPlugin (with member_default floor) + 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/explain agrees 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 owned private parent into an owned public_read_write child (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, with manageRecycleBin: the owner purges, the creator who no longer owns it is refused).
  • plugin-sharing federated-phantom-owner-scoping.test.ts: the grandfathered showcase shape (public_read_write over a phantom owner anchor) keeps checkDelete / checkDeleteMany abstain, canDelete true 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.
  • Rewritten to the ruled behaviour: plugin-sharing sharing-service.test.ts (the public-object delete cells of the canDelete table, the abstain case split into a new deny case, checkDeleteMany on the open object), operator-id-write-gate-33928.test.ts and plugin-security cascade-delete-security-parity.test.ts (their public_read_write parent rows are now owned by the caller; the invariants they pin are unchanged).
  • Red first, ablated once: with sharing-service.ts restored to origin/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: with sharing-service.ts restored to origin/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.ts is 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

Verification

  • On head 9d7a867: 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 --noEmit on plugin-sharing and plugin-security on head 9d7a867: exit 0.
  • node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack on head 9d7a867: 123 derived families, every one run with its exit code recorded, all 123 exit 0; --ran reconciliation: 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 as any), fixed in this branch.
  • CI on head 9d7a867: 66 success, 10 skipped, 0 failed.
  • Merged origin/main once (main at f1df7a8, no conflict, no file overlap) before opening.

🤖 Generated with Claude Code

https://claude.ai/code/session_01Utp6Cb2WxATpgLNvmWnnUq

… 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>
@github-actions github-actions Bot added size/l documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Dec 3, 2026
@github-actions

github-actions Bot commented Dec 3, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/plugin-security, @objectstack/plugin-sharing, @objectstack/spec, touching 16 documentable anchor(s). ⚠️ 1 changed file(s) yielded no anchor (packages/plugins/plugin-security/src/platform-ownership-policies.ts), so the pages documenting them are NOT COVERED by this run — this is not a clean bill of health for those files.

22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: node scripts/docs-audit/affected-docs.mjs --json 5a0bb8dd65283cbb34151e6569334b3c135b9473.

⛔ 10 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails.

What this run could not see
  • 1 changed file(s) yielded no anchor (packages/plugins/plugin-security/src/platform-ownership-policies.ts) — pages documenting those are invisible to this run
  • 1 anchor(s) matched too much of the corpus to be a work list: owner_id (literal, 46 pages)
  • the SDK route bridge reached 71 of 255 client-bound route-ledger rows — the other 184 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 184: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 60 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 124 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 186 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json 5a0bb8dd65283cbb34151e6569334b3c135b9473 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 1f61acc0a645b81d449f787a69eb0f80eb865ff1 — the merge of head 9d7a867b8a40133c2c9d5f62e1f87ec4e0ee629f into base 5a0bb8dd65283cbb34151e6569334b3c135b9473, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# 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

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs 5a0bb8dd65283cbb34151e6569334b3c135b9473 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

…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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 5ca1b86005cfedf5891b173ed697007b73bded77
Local-runs: none
Scope: packages/spec/src/contracts/sharing-service.ts, packages/spec/src/security/permission.zod.ts + packages/plugins/plugin-sharing/src/sharing-service.ts, packages/plugins/plugin-security/src/explain-engine.ts, packages/plugins/plugin-security/src/security-plugin-explain-access.ts, packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts, packages/plugins/plugin-security/src/security-plugin-rls-filter.ts, packages/plugins/plugin-security/src/platform-ownership-policies.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/plugins/plugin-security/src/public-read-write-owner-delete.test.ts, packages/plugins/plugin-security/src/cascade-delete-security-parity.test.ts, packages/plugins/plugin-sharing/src/sharing-service.test.ts, packages/plugins/plugin-sharing/src/operator-id-write-gate-33928.test.ts, packages/qa/dogfood/test/predicate-write-unreadable-not-matched.dogfood.test.ts
Security-touching: yes

PR #39216, card #38517. Narrowing face: the PR body and the changeset both carry Clause-②: yes (narrowing). Inputs read: the card body and all 17 comments (ruling 7288570890 letter C, rulings 7363759845 and 7363783625, the four claim amendments, analysis 7262681886, dev report 7363084540), the PR body, its 18 files, the net diff against main, and the check-runs on this head. Code outside the diff was read at this head through git objects (no checkout): sharing-plugin.ts, federated-phantom-anchors.ts, security-plugin-sharing-verdicts.ts, permission-evaluator.ts, packages/lint/src/validate-external-owner-sharing.ts.

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 success; the skipped runs are opt-in or schedule jobs.

① Derived judgments

  • Accept set (what a metadata author can write): unchanged. No key, value, type or .describe string moves; both spec hunks are JSDoc text. Right.
  • Runtime meaning of sharingModel: 'public_read_write' on an object with owner_id, for the delete verb: checkDelete / checkDeleteMany answer allow or deny where they answered abstain, and buildWriteFilter(.., 'delete') returns the owner predicate where it returned null. One seam (writeOwdForVerb), read by both the by-id verdict and the bulk filter, so the two cannot disagree. Right, and it is the ruled change (7288570890 point 1).
  • Widened: the owner who is not the creator, a caller above the owner by write depth, a Modify All holder (an ownerless row included). Each is the authority private already uses, reached through the same code path. Right.
  • Narrowed, ruled: a creator who no longer owns the row (7288570890 point 3); principals outside the org_member position (7363759845); an external creator who no longer owns the row, where a held grant speaks for the object (7363783625). Right. A fourth narrowed population is not ruled and not named: S1.
  • Unchanged, verified in code: update on the same object (checkEdit still reads owdForPrincipal directly); an object with no owner column; an undeclared model on a platform table and a controlled_by_parent detail (the predicate reads the declaration, not the effective bucket); an external with no speaking grant (owdForPrincipal already answers private, so the new branch is not reached). Right.
  • Public surface: ISharingService.checkDelete JSDoc now states the new abstain set. ISharingService.canDelete JSDoc in the same file still states the old one: S2.
  • security/explain: the owd_baseline layer reads the same two facts the service reads (declared model, owner_id in fields) and only where a sharing service is registered. Right.

② Semver level

Clause-②: yes (narrowing) and Metadata-protocol: semantic, in the PR body and in the changeset body. The diff both widens and narrows who may delete, so yes with the narrowing arm is the correct line. semantic is correct: no authorable key or value changes, the meaning of an existing declaration does. Level: @objectstack/plugin-sharing minor, @objectstack/plugin-security minor, @objectstack/spec patch (comment text only). The level rule asks for at least one moved package at minor; satisfied, and Check Changeset concludes success on this head. The changeset carries the BREAKING banner, the ! summary and an ADR-0087 not-required (no-migration-prescription) marker with its reason. Right, subject to S1 on the completeness of the BREAKING list.

③ Boundary flags

  • Dev open question 1 (principals the creator floor never bound): answered by ruling record 7363759845, built as ruled, named in the changeset as group 2.
  • Dev open question 2 (externals whose grant speaks): answered by ruling record 7363783625, built as ruled, named in the changeset.
  • Both ruling records were posted on the card by the dispatching seat's session, relaying taps on decision cards in the zone thread. The taps themselves are outside this review's inputs; the records are taken as written.
  • Dev deviations: security-plugin-explain-access.ts (inside the claimed surface); packages/spec/src/contracts/sharing-service.ts (claim amendment 7361274855); three docs pages (7363136771, 7363263451); the dogfood DELETE leg (7363898369). Each is covered by an amendment on the card.
  • The ruling's stop conditions: the row gate is not compiled to nothing (the rls-filter placement of the floor is untouched; only comment text moves there), and no fall-back to option B (no owner clause was added to the floor). Held.
  • packages/qa/dogfood/test/owd-public-read-write-write-floor.dogfood.test.ts is not in the file list; the dogfood battery is green. Held.
  • Dogfood DELETE leg re-pin: a caller who may write but not read now gets one answer deleting its own row (the read door's refusal) and another for someone else's row or a missing id (the record-level refusal, identical for the two). Nothing about another user's rows is told; the caller can tell its own existing rows apart from every other id. That is the answer private already gives, and one answer for every id across models is card Security plugin: a writer who cannot read an object gets permission_denied for its own row but record_access_denied for another's row or a missing id on by-id writes (private, and public_read_write after #38517) #39225. Accepted as private parity with the follow-up carried.
  • Skills follow-up Data skill: security.md still teaches the creator floor for public_read_write delete; rewrite to "delete follows the owner" once PR #39216 lands (ruling C on #38517) #39217 is named on the PR body's Skills-docs: line. Carried.
  • SQL push-down: no new id materialisation and no in-app join. The delete scope is a filter ANDed into the predicate, as on private.

④ Design judgment

Read 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 admitsByIdWrite answers false, so a deny refuses whatever the creator floor says; an allow replaces the floor in plugin-security's step 2.7. Predicate: the owner predicate is ANDed into the write, and a Modify All holder is not narrowed. Ownerless rows fail the owner match before the depth is read, so only the Modify All probe admits them. Shares and queue membership never reach delete. The new real-stack suite pins owner, manager, Modify All, creator-not-owner, stranger, a manager above someone else, ownerless rows, edit unchanged, explain parity, the no-owner-column control, predicate deletes and both external cells, each against a byte-identical private control. I looked for a caller who gains a delete the rulings refuse and found none.

S1 (should-fix) — ownershipDecidesDeleteOnOpenWrites reads hasOwnerField alone, so it is also true for a federated (ADR-0015) object whose owner_id is the platform's injected anchor with no storage and no columnMap entry (hasPhantomOwnerAnchor). On such an object declared public_read_write and writable, no row has a provable owner, so after this change every delete below Modify All is refused. Before it, the sharing service abstained and the creator floor decided, so a creator whose created_by the driver serves could delete. This population loses delete, is not covered by ruling 7288570890 (whose scope is objects that carry an owner column) or by 7363759845 / 7363783625, and is not in the changeset's BREAKING list. packages/lint/src/validate-external-owner-sharing.ts names public_read_write as a way out for exactly these objects. The same file already spells the exclusion elsewhere (isPublic && hasOwnerField(schema) && !hasPhantomOwnerAnchor(schema)). Closure is one of: exclude the phantom anchor in ownershipDecidesDeleteOnOpenWrites and in describeOwdFor so these objects keep today's answer, with a pin; or keep the behaviour, name the population in the changeset, and carry the maintainer's word for it, as the other two populations do. The refusal is fail-closed and matches private; no row is exposed.

S2 (should-fix) — packages/spec/src/contracts/sharing-service.ts, ISharingService.canDelete JSDoc: "Always true for system context, public objects, and objects with no owner field, matching canEdit." False at this head: on an owned public_read_write object canDelete is false for a non-owner while canEdit is true (pinned in sharing-service.test.ts). The PR corrected the checkDelete paragraph in the same file and left its two-state projection stating the opposite. The implementation's own canDelete docblock in packages/plugins/plugin-sharing/src/sharing-service.ts carries the same sentence. Ruling 7288570890 (Execution) puts docblocks that stop being true in this PR. Comment text only.

N1 (nit) — two reworded comments over-generalise: default-permission-sets.ts says the floors "decide alone only where no owner field exists", and platform-ownership-policies.ts says the floor decides delete "only on an object with no owner column". The floor also decides alone on a platform table with no declared model and stays in force for a write made on another user's behalf.

N2 (nit) — the population of ruling 7363759845 (a principal outside org_member) is pinned at the service (contexts with no positions in sharing-service.test.ts) and not at the door; the new real-stack suite gives every member org_member. A follow-up pin would hold the ruled narrowing where the refusal is raised.

N3 (nit) — content/docs/permissions/sharing-rules.mdx, the paragraph above the corrected one, still reads "under every other OWD both apply, and record sharing can replace them row by row", which now also holds for a public_read_write delete.

Open on this head: S1, S2. No must-fix.

Implemented-by: claude/project-thread-crdvow
Reviewed-by: session_01Utp6CYUove7YBXgHy4iEsr

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>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 9d7a867b8a40133c2c9d5f62e1f87ec4e0ee629f
Local-runs: none
Scope: packages/spec/src/contracts/sharing-service.ts, packages/spec/src/security/permission.zod.ts + packages/plugins/plugin-sharing/src/sharing-service.ts, packages/plugins/plugin-security/src/explain-engine.ts, packages/plugins/plugin-security/src/security-plugin-explain-access.ts, packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts, packages/plugins/plugin-security/src/security-plugin-rls-filter.ts, packages/plugins/plugin-security/src/platform-ownership-policies.ts, packages/plugins/plugin-security/src/objects/default-permission-sets.ts, packages/plugins/plugin-security/src/public-read-write-owner-delete.test.ts, packages/plugins/plugin-security/src/cascade-delete-security-parity.test.ts, packages/plugins/plugin-sharing/src/sharing-service.test.ts, packages/plugins/plugin-sharing/src/operator-id-write-gate-33928.test.ts, packages/plugins/plugin-sharing/src/federated-phantom-owner-scoping.test.ts, packages/qa/dogfood/test/predicate-write-unreadable-not-matched.dogfood.test.ts
Security-touching: yes

Delta review of PR #39216 (card #38517) after record 7364877498 on 5ca1b860, which left S1 and S2 open. The range 5ca1b860..9d7a867b is one commit with one parent: no merge of main. It touches 9 files, all inside the claimed surface; the only path new to the PR is packages/plugins/plugin-sharing/src/federated-phantom-owner-scoping.test.ts (a test under the claimed plugin-sharing/src/). packages/qa/dogfood/test/owd-public-read-write-write-floor.dogfood.test.ts is still not in the file list. Inputs added this round: the range diff, the PR body at this head, card comment 7364954150, and the check-runs on this head. The judgments of record 7364877498 that this range does not touch stand as written there.

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 success. Check Changeset concluded success once (started 02:08Z); a second run of it, started 02:45Z, was still in progress when this record was written.

① Derived judgments

  • Accept set: unchanged, as before. The spec hunk in this range is JSDoc text only.
  • ownershipDecidesDeleteOnOpenWrites now also requires !hasPhantomOwnerAnchor(schema). A federated object whose owner_id is the platform's injected anchor is back on the answer it had before the PR: checkDelete abstains, the delete write filter is null, the creator floor decides. Right; it removes the unruled narrowing.
  • describeOwdFor in explain-engine.ts adds !isOwnerAnchorUnprovable(schema), the function hasPhantomOwnerAnchor wraps. The report and the door read the same predicate. Right.
  • No other runtime line moves in this range. The org-admin population of ruling 7364954150 needs none: the service judges by owner, depth and Modify All and never reads positions.

② Semver level

Unchanged: Clause-②: yes (narrowing), Metadata-protocol: semantic, plugin-sharing and plugin-security minor, spec patch, BREAKING banner, ADR-0087 marker. The changeset now lists three BREAKING groups, names app-authored delete policies as wideners, replaces "an admin among them" and "or an admin" with the Modify All holder, names the federated anchor case among the unchanged objects, and its Skills-docs: line reads follow-up #39217. Right.

③ Boundary flags

  • Ruling record 7364954150 (org owners and admins holding the no-bypass admin set follow the owner; no carve-out; the first platform admin and the walled organization_admin are unaffected). Built as its text says:
    • no runtime change;
    • changeset group 3 names the population and the two ways out (Modify All on the object, or the full-access admin set);
    • sharing-rules.mdx carries the Org admins sentence;
    • a real-stack pin with a private control: the admin's own row lands, a colleague's row is refused, explain agrees.
  • The changeset's description of who holds that set ("a single organization, or walled with unbounded admin rights suppressed") matches orgAdminSetNameForPosture in auto-org-admin-grant.ts: organization_admin only where the posture enforces a wall and the suppression is off, and postureEnforcesWall is false for single alone.
  • As with the two earlier rulings, the record was posted by the dispatching seat's session relaying a tap; the tap is outside this review's inputs and the record is taken as written.
  • SQL push-down: nothing new in this range.

④ Design judgment

S1: closed. The exclusion is in both predicates. federated-phantom-owner-scoping.test.ts pins abstain on checkDelete and checkDeleteMany, true on canDelete and a null delete filter on the phantom-anchor shape, with a control on the same model over a real owner column that answers deny, a non-null filter, and abstain on edit. buildWriteFilter returns at the open-model line before it reaches its phantom-anchor deny-all, so the filter and the verdict agree.

S2: closed. ISharingService.canDelete in packages/spec/src/contracts/sharing-service.ts and the implementation's canDelete docblock both state the exception for an owned public_read_write object.

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 public-read-write-owner-delete.test.ts, read against the rulings: the custom-role member (7363759845); the no-bypass org admin (7364954150); an external owner of a row outside its grant's predicate is refused and explain agrees (7363783625, "still within the grant's predicate"); a cascade into an owned public_read_write child owned by someone else refuses the whole delete, with a landing control; the recycle bin's permanent delete refuses the creator and lands for the owner. Each holds against the code path it exercises, and I found no pin that asserts something the rulings do not say.

N4 (nit) — content/docs/permissions/sharing-rules.mdx, the new Org admins sentence, says organization_admin_no_bypass is "granted on a deployment with no wall between organizations". The set is also granted on a walled deployment that suppresses the unbounded grant, which the changeset states and the docs sentence omits.

N5 (nit) — the new canDelete contract sentence says "a non-owner below Modify All is refused"; a caller above the owner by write depth is admitted too, as the sentence before it says.

No must-fix, no should-fix.

Implemented-by: claude/project-thread-crdvow
Reviewed-by: session_01Utp6CYUove7YBXgHy4iEsr

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

维护者速读

  • 做了什么:公开读写、且有负责人字段的对象,「删除」改为跟着记录负责人走:负责人、负责人的上级、有「全部修改」权限的人能删,原创建人不再能删别人负责的记录;「编辑」仍然对所有人开放。权限解释(explain)与实际拦截在每一格都一致。
  • 收紧了谁(变更说明里逐条写明):① 原创建人;② 自定义角色成员、没有组织的会话(你 00:55 选 A);③ 外部用户只在作者给的授权条件内按负责人走(你 00:55 选 A);④ 单组织部署(或开了抑制开关的隔离部署)里没有「全部修改」的组织管理员(你 01:58 选 A)。首位平台管理员不受影响;没有负责人字段、或负责人字段是联邦对象占位的,行为不变。
  • 风险:属于收窄(Clause-②: yes (narrowing),Metadata-protocol: semantic),两个插件升 minor、spec 升 patch,带 BREAKING 说明。拒绝是失败即关闭,不会多放出删除权;dogfood 电池全绿。
  • 要你做什么:批准,并由授权账号入队(收窄按 11-19 裁定人工落地)。

席位核对

ACCEPT — head 9d7a867b8a40133c2c9d5f62e1f87ec4e0ee629f (#38517, zone data-p2).

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-bill · os-bill · session_01Utp6CYUove7YBXgHy4iEsr

维护者速读

  • 改了什么:公开读写、且有负责人字段的对象,删除改为跟着记录负责人走(负责人、其上级、有「全部修改」权限的人可删),原创建人不再能删别人负责的记录;编辑不变。explain 与实际拦截一致。
  • 为什么:Sharing: delete on an owned public_read_write object follows the record's owner (ruling C), not the creator floor #38517 裁决 C(7288570890),以及 Bill 之后的三次选择:自定义角色 / 无组织会话(7363759845)、外部用户(7363783625)、单组织部署里没有「全部修改」的组织管理员(7364954150),都跟着负责人走。
  • 风险:属于收窄(Clause-②: yes (narrowing),Metadata-protocol: semantic),plugin-sharing / plugin-security 升 minor,spec 升 patch,变更说明逐条写明被收紧的四类人和出路(授「全部修改」或 admin_full_access)。拒绝是失败即关闭。契约复核 PASS 后又做了 delta 复核,同样 PASS;dogfood 电池全绿。
  • 为什么交给你:声明了收窄的 PR,按 2026-11-19 在 governance: the guard scripts join the governed register, .claude/** lands by declared rule-change, and a narrowed spec change lands only by the maintainer #35321 上的裁定由人工落地;check-governed-merges 只看路径,所以判成了不受管。
  • 要你做什么:批准,并由授权账号入队。席位 ACCEPT 7365953588;契约复核 PASS 7364877498,delta PASS 7365883177(S1: closed,S2: closed);Head-sha 9d7a867b8a40133c2c9d5f62e1f87ec4e0ee629f。

席位意见:ACCEPT。四类收紧都有裁决依据,并且都写进了变更说明。剩下的一个测试缺口和三处措辞由 #39243 跟进,技能文案由 #39217 跟进。

@objectstack-fleet objectstack-fleet Bot added the pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue label Dec 3, 2026
@objectstack-fleet
objectstack-fleet Bot requested a review from os-zhuang December 3, 2026 02:53
@os-zhuang
os-zhuang marked this pull request as ready for review December 3, 2026 03:10
@os-zhuang
os-zhuang added this pull request to the merge queue Dec 3, 2026
Any commits made after this event will not be merged.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation needs:dogfood-battery pm:awaiting-merge PR only: landing waits on the maintainer's own review and merge (SKILL.md 复核 ②); never on an issue size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sharing: delete on an owned public_read_write object follows the record's owner (ruling C), not the creator floor

1 participant