Skip to content

fix(security): a Modify All holder deletes the records they own beside an authored delete policy - #39587

Merged
objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-39464-wip
Dec 4, 2026
Merged

objectstack-fleet[bot] merged 6 commits into
mainfrom
claude/issue-39464-wip

Conversation

@objectstack-fleet

Copy link
Copy Markdown
Contributor

Fixes #39464
Clause-②: no
Metadata-protocol: none

维护者速读

  • 用户能看到什么变化:应用给有负责人的对象另写一条删除规则后,持有"全部修改"权限的经理现在能删掉自己名下、但不是自己录入的记录,单条删除和批量删除结果一致;别人名下或没有负责人的记录仍然删不掉。
  • 为什么做:按您对"负责人一视同仁"的裁决,多给一项权限不应让人少做一件事;替持有全部修改权的经理解决删不掉自己名下记录的问题。
  • 出错会怎样:只有写了自定义删除规则的应用里持有全部修改权的人受影响,最坏是他们能多删自己名下的记录;改动可以整个撤回,撤回后回到删不掉的状态。
  • 要你做什么:无。

What changes

Ruling of record 7403225870 (route A) on #39464, as quoted: 「Route A: beside an authored delete policy, the owner term admits delete for every owner, Modify All holders included. The ADR-0066 ① bypass stays excluded.」

  • By id and security/explain (security-plugin-rls-filter.ts, new sibling modify-all-owner-delete-term.ts): beside an authored delete policy the declared write authority's allow cannot speak for ownership when the caller holds Modify All, because the write depth the bit manufactures is org and the bypass answers allow on every other row. Measured: the existing allow admits a row the holder neither owns nor created, so it is not reused. For that caller the composition keeps the floor and the authored terms as before and adds one OR term, owner_id == current_user.id. That is the owner read off the row, nothing the bit adds: a row of another owner and a row with no owner stay refused. No term is added where the owner column is not provable (isOwnerAnchorUnprovable) or the field set could not be read.
  • Predicate (bulk) delete (security-plugin-authz-middleware.ts, predicateWriteFloorRelief only, surface widened by the dispatching seat): before this, the relief answered null whenever the floor-replaced Layer 1 was non-null, so a predicate delete kept the floored Layer 1 and missed the owned row the by-id door now admits, which would break ruling of record 7063130499 (A: one answer by id and by predicate). Now, when the replaced Layer 1 differs from the floored one, the matched rows the floor refuses are first narrowed to the rows the replaced Layer 1 admits (one read under the caller's context; refused read keeps the floor), and only those are asked their by-id verdict. When the two are the same tree, which is every case except this one, it still answers null with no verdict asked.
  • Not carried, by design: someone above the owner by write depth, for a Modify All holder. A Modify All set cannot declare writeScope (the spec refuses it), so the holder's depth apart from the bit is own unless a second set declares one, and that depth's owner set needs the hierarchy resolution behind the sharing service.
  • Changesets: a new patch changeset, and a DELIBERATE CORRECTION of a pending one (below).

DELIBERATE CORRECTION

.changeset/39339-owner-beside-delete-policy.md (pending, from PR #39448) said a Modify All holder "deletes the records the policy admits and the ones they created, and no others". This PR makes that false. Corrected sentence: "so its holder deletes the records the policy admits, the ones they created and the ones they own, and no others." check-empty-changeset stays red on this file on purpose; the confirming record is the dispatching seat's.

Tests

  • owner-beside-authored-delete-policy.test.ts: Modify All owner deletes by id (DEAL public_read_write, SECRET private) and security/explain says so first; Modify All holder refused another owner's row and an ownerless row (bypass stays out); Modify All predicate delete removes the closed, created and owned rows and leaves another owner's and the ownerless row; no-owner-column object keeps the creator rule for a Modify All holder.
  • Each half ablated on the merged tree, both pin files (owner-beside-authored-delete-policy.test.ts + predicate-write-floor-deferral.test.ts):
tree result
middleware relief reverted 2 failed / 142 passed (both Modify All predicate cells)
composition term reverted 4 failed / 140 passed (Modify All owner by id x2, predicate x2)
full fix 144 passed

Acceptance notes

  • No delegated (on-behalf-of) pin: this harness resolves a delegator's sets from the store, so a Modify All delegator cannot be built here without new fixture work. The term rides only on the authority's allow, which the delegated agent leg never receives, and the delegator's floored leg is unchanged.
  • The unruled writeScope: 'org' asymmetry named in analysis 7398101528 is untouched.
  • Update is untouched (its own card).

Verification

Read first, by risk:

  1. packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts, predicateWriteFloorRelief steps 2 and 4: the narrowing read before verdicts are asked.
  2. packages/plugins/plugin-security/src/security-plugin-rls-filter.ts, the holdsModifyAllOnDelete / ownershipAllowAdmitsRow block.
  3. packages/plugins/plugin-security/src/modify-all-owner-delete-term.ts.

Two-minute check: pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/owner-beside-authored-delete-policy.test.ts should show 28 passed.

Local readings at head 6e344f2e (tree objectstack-ai/objectstack, merge base 0f5da90d):

Suite, typecheck, derived gates
  • pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2: Test Files 294 passed (294), Tests 7461 passed, 52 skipped; VERDICT command-exit 0.
  • pnpm --filter @objectstack/plugin-security typecheck: 0 TS errors, check:test-typecheck OK; VERDICT command-exit 0.
  • dispatch-gates --commands (73 families): 70 exit 0; check-empty-changeset exit 1 on the corrected pending changeset (deliberate, above); check:dual-build-cjs-loads and check:i18n exit 3 PREREQUISITE (no full build here): NOT MEASURED, CI owns them. --ran: 73 derived, 71 run, 2 NOT-MEASURED.
  • check-nul-bytes: OK.
  • Not run locally: test:repo (CI Test Core); no exported symbol renamed or removed, so the platform-checklist rename check does not apply.

Generated by Claude Code

@github-actions github-actions Bot added size/m 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 4, 2026
@github-actions

github-actions Bot commented Dec 4, 2026

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 1 package(s): @objectstack/plugin-security, touching 7 documentable anchor(s).

2 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:

  • content/docs/permissions/permissions-matrix.mdx (via computeLayeredRlsFilter (symbol, a top-level function))
  • content/docs/permissions/sharing-rules.mdx (via computeLayeredRlsFilter (symbol, a top-level function))
What this run could not see
  • 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 — 18 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 8b1560bcd814f5f4699fb273b930b1984436fb4c → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 5856abbaaa76af1a7d3db9ab76fff35d365e2c02 — the merge of head 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186 into base 8b1560bcd814f5f4699fb273b930b1984436fb4c, 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 5856abbaaa76af1a7d3db9ab76fff35d365e2c02 && git checkout 5856abbaaa76af1a7d3db9ab76fff35d365e2c02
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 8b1560bcd814f5f4699fb273b930b1984436fb4c 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186 && git checkout -B drift-repro 8b1560bcd814f5f4699fb273b930b1984436fb4c && git merge --no-ff 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186

node scripts/docs-audit/affected-docs.mjs --json 8b1560bcd814f5f4699fb273b930b1984436fb4c

⚠️ 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 8b1560bcd814f5f4699fb273b930b1984436fb4c → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cwiNRyb9B38wT2fjYj

Final green head: 2026-12-04T15:12Z · 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186 · check-runs 39 success, 18 skipped, 1 failed. The one red is Check Changeset, red by design: this PR deliberately corrects .changeset/39339-owner-beside-delete-policy.md, the pending note #39448 left. Per landing-operations, that DELIBERATE CORRECTION is confirmed by a same-head contract-review-tier L2 PASS. Fixes #39464 · Clause-②: no (runtime permission behaviour, claim amendment 7403630375; surface widened to predicateWriteFloorRelief after PR #39518 merged). os-dev report 7406862417. Owes an L1 and a same-head at-tier L2 at this head; landing then goes to the seat. Zone em-bill.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czzaKz49WLAvKtdyiY

席位核对

L1 verdict (L1-b): ACCEPT at head 6e344f2e9c (Fixes #39464, p2). Read at 2026-12-04T15:14Z.

Face: l1-face --pr 39587: 12 ok, 1 flag (all-checks). The flag is Check Changeset = failure, red by design. The PR rewrites a pending note of an earlier PR: .changeset/39339-owner-beside-delete-policy.md, from #39448. That is a DELIBERATE CORRECTION in a PR that also changes code, so under landing-operations.md it is confirmed only by a same-head L2 PASS at CONTRACT_REVIEW_TIER that judges the rewritten sentence. L1-b is running that L2 on this head now. Everything else: 39 success · 18 expected skip. Floor checks success.

Against the ruling (7403225870, option A: the owner term admits delete for every owner, Modify All holders included; the ADR-0066 ① bypass stays out; the allow can't be reused, so strict ownership is needed):

  • Owner term. modify-all-owner-delete-term.ts hands back owner_id == current_user.id and nothing else. It adds no depth, no share and no bypass. There is no term where the owner column is missing or not provable (isOwnerAnchorUnprovable). That is the strict ownership check the ruling's dev premise asks for.
  • Where it applies. It is added only for a Modify All holder's delete with dropPlatformOwnershipFloor. It sits in the OR beside the floor and the authored terms, so it can only add the caller's own rows. The term name is not a platform floor policy, so no floor replacement removes it. The non-Modify-All path (ownershipAllowAdmitsRow) is unchanged from fix(security): the owner deletes a record beside an authored delete policy #39448.
  • Bulk delete. In predicateWriteFloorRelief, step 2 now returns early only when replaced equals the floored tree, which is the unchanged-update case as before. The new step-4 bound reads only the rows replaced admits, under the caller's context, so the bulk path admits no row the by-id path would refuse. The equality is tested by JSON.stringify of two compiles of the same inputs. A spurious mismatch only costs one read and fails closed. Accepted.
  • Not ruled and not touched: someone above the owner by depth, for a Modify All holder. The module docblock says so, and that is consistent with the ruling leaving the writeScope: 'org' inversion unruled.

Pins: owner-beside-authored-delete-policy.test.ts (+80/−?) moves the Modify All cells: the holder now deletes an owned-not-created row, by id and by predicate, with security/explain agreeing. A row of another owner and an owner-less row stay refused.

Changesets: the new 39464-modify-all-owner-delete.md is a patch on @objectstack/plugin-security, and its bullets match the code. The one-sentence rewrite of the 39339 note ("…the records the policy admits, the ones they created and the ones they own, and no others") is now true of the code at this head; before the rewrite it stated the defect. The confirmation of record is the L2.

Landing: non-governed, under 3000 lines, Clause-②: no. It enters the queue red under SKILL.md's three conditions only after the same-head L2 PASS is on record. Per em-bill, it goes through the seat.


Generated by Claude Code

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4czzaKz49WLAvKtdyiY

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186
Local-runs: none
Scope: packages/plugins/plugin-security/src/modify-all-owner-delete-term.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/owner-beside-authored-delete-policy.test.ts + .changeset/39339-owner-beside-delete-policy.md, .changeset/39464-modify-all-owner-delete.md
Security-touching: yes
Rule-change-verified: none

PR #39587 for card #39464, judged against ruling of record 7403225870 (option A of analysis 7398101528). Read: the card body and all six comments, the PR body and its six-file list, the net diff against main (merge base 0f5da90d), and the check-runs on this head. Code outside the diff was read to judge the diff, not reviewed. No path under .claude/** is in the diff.

Check-runs on this head: 39 success, 18 skipped, 1 failure. The one failure is Check Changeset, which is red because the PR edits a pending note; that is judged in ② below. Test Core (12 shards), Type Check · workspace, Lint · PM dispatch-gates and Governed Surface Queue Guard are success.

① Derived judgments

  • Accept set and public surface: none changes. Right. No spec schema, no metadata key and no exported symbol moves. modify-all-owner-delete-term.ts is imported by security-plugin-rls-filter.ts alone and is not re-exported.
  • Runtime permission behaviour widens for one caller class. Right, and it is the ruled widening. A caller for whom hasSuperuserWriteBypass is true on the object (a Modify All holder), deleting beside an authored delete using policy while the platform delete floor is in play, gains exactly the rows matching owner_id == current_user.id. Nothing else is added to the OR.
  • Callers without Modify All: unchanged. Right. ownershipAllowAdmitsRow is rewritten as drop && delete && !holdsModifyAllOnDelete, which is the same truth table as the expression it replaces.
  • Update: unchanged. Right. holdsModifyAllOnDelete requires rlsOperation === 'delete'. The other floor-drop callers that reach this composition for update (the by-id gate, the master gate in security-plugin-cbp-write-gate.ts, computeWriteCheckFilter) pass update and never meet the new branch. In predicateWriteFloorRelief, an update whose replaced Layer 1 is non-null composes the same collection as the floored one, so the two trees compare equal and null is answered as before.
  • The lifecycle verb purge follows delete. Right. rlsOperationForVerb maps the permanent by-id delete onto delete, so the owner term applies there as it does for every other term of this composition. This is the existing mapping, not a new door.
  • Tenant isolation: untouched. Right. The term is one arm of Layer 1. Layer 0 is computed separately and AND-composed; the predicate relief recomposes it as it stood (andComposeLayers(layered.layer0, relief.layer1)), and both relief reads run through the read door under the caller's context.

② Semver level

  • New note .changeset/39464-modify-all-owner-delete.md: patch on @objectstack/plugin-security. Right: a behaviour fix in a released package with no protocol change.
  • Clause-②: no on the PR body and the changeset: right. The diff relaxes no published accept set and enlarges no public surface. The analysis proposed yes (widening); claim amendment 7403630375 kept no because a runtime permission change is not a Clause ② change, and the tree agrees.
  • Metadata-protocol: none: right. Nothing a metadata author can write is added, refused or given a new declared meaning; PR fix(security): the owner deletes a record beside an authored delete policy #39448 declared the same for the same hunk.

DELIBERATE CORRECTION of .changeset/39339-owner-beside-delete-policy.md (pending on main, from PR #39448): CONFIRMED. One sentence of the note changes, in the "Unchanged" bullet.

  • Before: "Modify All (modifyAllRecords) still does not lift an authored delete policy on a business object, so its holder deletes the records the policy admits and the ones they created, and no others."
  • After: "Modify All (modifyAllRecords) still does not lift an authored delete policy on a business object, so its holder deletes the records the policy admits, the ones they created and the ones they own, and no others."
  • Verdict: the new sentence is true of the code at this head, and the old one is false at this head. For a Modify All holder beside an authored delete policy the composed Layer 1 is the authored terms OR the floor (created_by == current_user.id) OR the new term (owner_id == current_user.id). "And no others" holds: the term reads the owner off the row, so a row of another owner and a row with no owner match none of the three. "Still does not lift" holds: the authority's allow is not used as an admission for this caller.

The rest of that note, read at this head sentence by sentence:

  • "Who sees it: an app that authors a row-level delete policy ... on private, public_read and public_read_write objects alike." True.
  • "Before, beside such a policy the platform's own row gate admitted only the person who created the record ..." True (history, unchanged by this PR).
  • "Now the owner, someone above the owner by write depth (writeScope), and a holder of write depth org delete it, as they do on an object with no authored delete policy." True for callers without Modify All. For a Modify All holder only the owner part holds; the corrected "Unchanged" sentence says so ("and no others"), so the note is consistent as a whole. See N1.
  • "A by-id delete and a predicate (bulk) delete reach the same records, and security/explain agrees." True, now for the Modify All holder as well.
  • "A creator who no longer owns a record is still refused unless the policy admits it. An object with no owner column keeps the creator rule. Edit (update) is not changed by this release." True; none of these is touched.

New note .changeset/39464-modify-all-owner-delete.md, sentence by sentence:

  • Title, "a Modify All holder deletes the records they own beside an app's own delete rule, as any owner does": true.
  • "Who sees it: an app that authors a row-level delete policy ... on an object with an owner column (owner_id), and a user who holds Modify All (modifyAllRecords) on that object, typically a manager.": true.
  • "Before, beside such a policy a Modify All holder was refused (403) a record assigned to them that someone else entered, while a plain owner in the same position deleted it.": true of main since PR fix(security): the owner deletes a record beside an authored delete policy #39448.
  • "Now the Modify All holder deletes the records they own as well, by id and by a predicate (bulk) delete alike, and security/explain agrees.": true (④).
  • "Modify All itself still does not lift an authored delete policy on a business object.": true.
  • "Its holder deletes the records the policy admits, the ones they created and the ones they own, and no others: a record of another owner, or one with no owner, stays refused.": true.
  • "An object with no owner column keeps the creator rule. Edit (update) is not changed by this release.": true.

③ Boundary flags

Dev report 7406862417 carries no open_questions. Its deviations, answered:

  • Main merged through refs/issue-39464/main: no effect on the tree; the merge base is 0f5da90d.
  • Derived-gate loop moved to the background: process only; the head's check-runs are the gate verdicts.
  • No delegated (on-behalf-of) pin: accepted on code reading. resolvePreImageFloorDrop answers false for a delegated write, and the predicate relief is skipped when delegatorSets is set, so neither principal's floored leg gains the term. One correction to the report's account: the delegator's own-composition leg (delegatorOwnWriteFloorOptions) does gain the term when the delegator holds Modify All. It is ANDed beside the delegator's floored filter, which is a subset of it, so the delegated outcome does not move. See N3.
  • Manager-above-owner not carried for a Modify All holder: within the ruling, which asks for a strict ownership-only check. See N1.
  • Commit trailers: process only.

Earlier report 7403602744, both questions closed by claim amendment 7403630375: the surface was widened to predicateWriteFloorRelief, and the middleware diff stays inside that function and its docblock; Clause-② stays no (② above).

Not ruled and not touched: the writeScope: 'org' inversion named in the analysis. The diff changes nothing for a caller without Modify All.

SQL push-down: predicateWriteFloorRelief gains one read, taken only when the replaced Layer 1 differs from the floored one. It is not a new unbounded id materialisation: the candidate list is the existing readable-id list, capped by PREDICATE_WRITE_READABLE_ID_CAP, and the replaced Layer 1 itself is evaluated in SQL. The ids come back because dropIds must be exactly the rows whose by-id write is admitted, and the per-row verdict is the sharing service's answer, which SQL cannot give. Reason given in the docblock (step 4). No finding.

④ Design judgment

No must-fix, no should-fix.

modify-all-owner-delete-term.ts — holds against the ruling.

  • Strict ownership only. The term is the literal predicate owner_id == current_user.id, compiled by the same compiler as every other policy. It takes no write depth, no share, no queue and nothing from the authority's allow.
  • No bypass leak through a missing identity. The by-id gate requires context.userId, and the compiler drops a policy whose current_user.* variable is unresolved, so the term can never compile to owner_id == null and match an ownerless row.
  • A row with no owner and a row of another owner match no arm. Both are pinned by id and by predicate, on public_read_write and private.
  • No term where the owner cannot be proved: no schema, no loaded field set, no owner_id column, or isOwnerAnchorUnprovable. Each of these falls back to the composition as it stood, which is the narrower answer.
  • The term is added after collection and is never returned by collectRLSPolicies, so the authored-row-write probes and the floor provenance test (isPlatformOwnershipFloorPolicy) never see it. It cannot pass as an authored admission, and no floor replacement can remove it.

security-plugin-rls-filter.ts — holds.

  • The term is added only inside the existing branch (floor present in the collection, floor drop requested, an authored term remains) and only for delete with hasSuperuserWriteBypass true. A Modify All holder's composition becomes authored OR floor OR owner; before it was authored OR floor.
  • The authority's allow is still not treated as ownership for this caller (ownershipAllowAdmitsRow is false), so the org depth the bit manufactures and the bypass both stay out, as ADR-0066 ① and the ruling require.
  • The by-id door asks for the floor drop only after the authority answered allow (resolvePreImageFloorDrop). For a Modify All holder that allow no longer decides the row; the row predicate does.
  • security/explain composes through the same resolvePreImageFloorDrop and the same computeLayeredRlsFilter options (recordWriteFloorOptions), so it cannot part from the door. The pins assert explain before each by-id delete, both directions.

security-plugin-authz-middleware.ts (predicateWriteFloorRelief) — holds; by id and by predicate agree.

  • For a Modify All holder beside an authored delete policy, the rows the relief can add are: admitted by the replaced Layer 1, not already admitted by the floored one, and answered allow by id. The replaced Layer 1 minus the floored one is exactly the owner term, so only rows the caller owns are added. That is the by-id answer row for row.
  • The tree comparison (JSON.stringify) is safe in both directions. A false "equal" returns null and keeps the floor (narrower). A false "different" costs one read, and each row it then adds is still one the replaced Layer 1 admits and the by-id verdict allowed, which is the by-id answer on update and on delete alike. So the removal of the early if (replaced) return null widens nothing.
  • A refused reach read keeps the floor. The delegated path and the master-gate path are excluded at the call site, as before.
  • Where no authored policy stands, the replaced Layer 1 is null and the function behaves exactly as on main.

owner-beside-authored-delete-policy.test.ts — holds against the scenario. Pinned: the Modify All owner deletes by id with explain agreeing first (two sharing models); refused another owner's row and an ownerless row, with explain agreeing; the creator term still works; the no-owner-column object keeps the creator rule; the predicate delete removes the closed, created and owned rows and leaves another owner's row and the ownerless row. Test Core is green on this head.

Nits (no effect on correctness or the contract; none is to be fixed on this head):

  • N1 (nit) — A Modify All holder who also holds a declared write depth through a second set does not get "someone above the owner" beside an authored delete policy, while the same person without the Modify All set does. This is the strict reading the ruling asks for and the module states it, but it is a remaining case where adding Modify All removes a delete. Follow-up card for the maintainer's inbox, together with the unruled writeScope: 'org' question; a pin for the current answer belongs with it.
  • N2 (nit) — content/docs/permissions/sharing-rules.mdx (the paragraph ending "the policy still bounds every other row") has not been true for delete since PR fix(security): the owner deletes a record beside an authored delete policy #39448, and this PR extends the gap to Modify All holders. The docs drift check on this PR names the page. Outside this diff; follow-up docs card.
  • N3 (nit) — No pin for a delegated delete whose delegator holds Modify All and owns the row. Unchanged by construction (③), but the analysis asked for the pin. Follow-up with the fixture work the dev names.
  • N4 (nit) — The module docblock says the term is "asked only where" the authority answered allow. predicateWriteFloorRelief also composes it once before any verdict, as a bound on which rows are asked. The outcome is the same; the sentence is slightly narrower than the code. Accepted deviation.
  • N5 (nit) — No pin for the isOwnerAnchorUnprovable branch (a federated object whose owner_id is only the injected anchor). The branch fails toward the earlier composition. Accepted deviation.

Implemented-by: claude/issue-39464-wip
Reviewed-by: session_016WV4czzaKz49WLAvKtdyiY

VERDICT: PASS

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

repo:objectstack@os-elon-musk · os-elon-musk · session_016WV4cxiJF5PkqquFk98Bh7

Landing · PR #39587 (Fixes #39464) · head 6e344f2e9cfa88981e6c7f934e2cd29c44f6d186

Probe Reading
Governed check-governed-merges --pr 39587: NOT governed, 250 lines, under 3000
Declaration Clause-②: no · Metadata-protocol: none
Records on this head final-green-head record 7415505617 · L1 ACCEPT 7415555791 · CONTRACT_REVIEW_TIER L2 PASS 7415678902
Red Check Changeset only: a DELIBERATE CORRECTION of .changeset/39339-owner-beside-delete-policy.md. Same-head L2 7415678902 confirms it sentence by sentence, so the queue takes it red and the gate is unchanged
Ruling #39464 A (7403225870)

Follow-ups owed from L2 7415678902, not filed now because the seat is standing by on the maintainer's word (2026-12-04T15:09Z): N1 (a decision card: Modify All plus a declared write depth loses "above the owner" for delete, paired with the unruled writeScope org question), N2 (docs: sharing-rules.mdx delete wording, stale since #39448), N3 (no pin for a delegated delete by a Modify All owner).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review December 4, 2026 15:20
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Dec 4, 2026
Merged via the queue into main with commit fb9b1a5 Dec 4, 2026
58 of 59 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/issue-39464-wip branch December 4, 2026 15:48
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 size/m 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.

Modify All holder who owns a row is refused delete that a plain owner gets

2 participants