Repository navigation
fix(plugin-security): a sharing allow keeps the ownership floor beside an authored write policy, so a creator writes their own row by id - #36117
Conversation
…n authored write policy On a by-id write, an `allow` from the declared write authority took the platform ownership floor out of Layer 1. Layer 1 is an OR of permissive policies, so beside an authored widener the widener was left alone, and a row the floor alone admitted (the caller's own closed row) was refused, while the predicate write over the same row wrote it. The floor is now dropped only where it is the OR's last term; beside an authored term it stays one term of the OR, in the pre-image Layer 1 and in the defaulted post-image check alike. checkAuthoredRowWrite takes the floor out of the sets by provenance instead of through the floor-drop knob, so the floor never answers there as an authored admission. Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
…authored write policy too Changeset for the by-id floor-term fix, and the sharing-rules page states the composition both write paths now share. Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
…d not create Under the ruled composition the ownership floor stays an OR term beside an authored write policy, so a held row the delegator created is admitted by the floor. The D10 and explain-parity fixtures that pinned the bound move their held rows (and the master and the store rows) onto rows someone else created, keeping every assertion, and add rows where the delegator created the held row and both the direct and the delegated write are admitted. The knob's jsdoc in security-plugin.ts says the floor is dropped only where it is the last term. Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
…re a creator cap goes The changeset names the ruling (comment 7063130499), the 22 refusals in the ADR-0090 D10 family that the ruling turns into admissions, and the removed capability. The sharing-rules page says where a limit on a creator's own rows goes now: a check for an update, a beforeDelete hook for a delete. Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
📓 Docs Drift CheckThis PR changes 1 package(s): 8 hand-written doc(s) NAME something this change touched and may need an implementation-accuracy re-verification:
⛔ 2 release-owned page(s) also name something this change touched. These are read-only:
What this run could not see
Coarse fallback — 18 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 ca186b3535e60ec83185de488c62a8748cbbe6a4 && git checkout ca186b3535e60ec83185de488c62a8748cbbe6a4
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 3543b51d37b41086275dacf91e7a29cb8c67da8b 1b90fa5f2abb38218c655a759b6b341d623c6414 && git checkout -B drift-repro 3543b51d37b41086275dacf91e7a29cb8c67da8b && git merge --no-ff 1b90fa5f2abb38218c655a759b6b341d623c6414
node scripts/docs-audit/affected-docs.mjs --json 3543b51d37b41086275dacf91e7a29cb8c67da8b
|
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Contract reviewServed-tier: Read: card #35917 (body; triage 7049054086; claim 7061803234; os-dev-reports 7062563042 and 7064413744; decision analysis 7062795693; maintainer ruling 7063130499); PR #36117 (body, the 9-file list, the net diff against merge-base Result: PASS. No must-fix: I found no row writable at this head that ruling A does not admit, and no row refused that main admits. Open on this head: S1 to S4 (should-fix), N1 to N5 (nits). S1 answers the question the dev left to the seat: the #24792 guard still decides one region, a ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentThe 22 rewritten tests. Every assertion is kept verbatim; the diff changes row tuples and comments and adds cells. Each test's stated invariant still holds. What each half can detect changed:
None was weakened to pass: the old rows pinned the outcome the ruling reversed, and moving them is the remedy the analysis prescribes. But no on-behalf-of half can now tell a tree with the #24792 guard from one without it, which is the dev's G1 to G3 reading (0 red at the head, against 4, 2 and 6 on the control leg). On an ordinary object no fixture could, by judgment 7. See S1. The new pins.
Ablations. A1 to A3 each name the anchor, the red counts match what the code predicts, and the restore is shown. Credible. G1 to G3 are the right instrument and were reported, not hidden. Not ablated, and no pin would go red: the Design. Keeping the collection whole is the smallest change that makes the by-id door the predicate door's composition, and asking "would an authored term remain" through the compile's own pass 1 keeps the two from disagreeing. Taking the floor out of the probe's sets, not through the knob, is what keeps the floor from answering as an authored admission. What gives way is listed below. S1 (should-fix) — the #24792 guard is still the only thing holding ADR-0090 D10 on a Where it narrows, by reading: only where the delegator's own composition carries the Scenario: a cbp detail, a delegator D holding an authored update policy on it (
Not a must-fix: the guard's code is untouched and no row is wrongly admitted at this head. It is owed here because this PR's rewrite is what removed its pins, and the file's header still says it pins "the one the delegator's OWN direct write sets". Fix: the D10 rig already has a cbp S2 (should-fix) — a second docs page still states the composition this PR replaces. It reads: "A by-id write takes that replacement, and so does a predicate write unless an app-authored S3 (should-fix) — four statements about what this PR admits and removes are wrong or incomplete.
S4 (should-fix) — the master-check widening the changeset claims has no pin. Every master the two rigs call N1 (nit) — N2 (nit) — N3 (nit) — N4 (nit) — N5 (nit) — one Test Core shard (3 of 10) was still running when this was written. The record covers the head's diff, not that shard's verdict; read it before landing. Implemented-by: VERDICT: PASS |
…nd the master check's admission Under ruling A the delegator's own composition narrows nothing on an ordinary object, so the rewritten D10 rows no longer told a tree with the #24792 bound from one without it. It still narrows on a controlled_by_parent object, where the delegator's direct write lets the floor yield to the master gate. The D10 rig gets an authored update policy on its detail and a grand detail under it, and three cells, one per gate: the by-id pre-image, the stored row, and the master gate on a middle master. It also pins the master check's widening: a held master the delegator created admits its details, for the delegator and on its behalf, with explain agreeing. The predicate matrix gets the edit-share target who created the shared row: update admitted, delete still refused. Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
…ap goes, on every page that states the floor The changeset and sharing-rules no longer say a non-owner creator is refused (write depth, Modify All, an edit share or a queue earn allow) or that by id and by predicate admit the same rows; they name the master check's widening and say a check bounds only the stored image, with a beforeUpdate hook reading ctx.previous as the place that sees the prior row. permissions-matrix and rls state the floor beside an authored policy. The checkAuthoredRowWrite and writeCheckPolicies docblocks describe the floor decision as it now is. Claude-Session: https://claude.ai/code/session_01L9qibvVRcFWKrfWeG5jzPb Co-authored-by: Claude <noreply@anthropic.com>
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb PR body corrections for the L2 fix round (S1 to S4, N1, N2, N4, the L1-a docblock)Head Replaces the first Acceptance-notes bullet (the #24792 guard):
Adds to Acceptance notes:
Replaces "The cbp master gate inherits the fix ... no dedicated #35917 pin":
Adds to Tests (N4):
Replaces the "Declared one-line breach" bullet:
Docs and changeset (S2, S3, N2):
Replaces Verification:
|
|
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb Hand-off to repo:objectstack#4Per the maintainer's word of 2026-11-21T15:26Z (seat 7 relayed it, the brief is /mnt/project-files/objectstack-seat7/handoff-to-seat4.md): development on this PR is finished, and seat 4 owns review and landing. This PR is still a draft; area d7-C has not marked it ready, armed it or requested reviewers.
|
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): REWORK, body only (one item, no code) at head 席位核对Shape and gates.
The code against ruling A (the reading holds).
The card's Done-when items, pinned (in
Changeset and the three docs pages, sentence by sentence.
REWORK item R1 (body only, the seat's stroke; no code, so the head and the same-head contract record stay valid).
Non-blocking note. Landing (not L1's): the same-head contract delta (the seat is running it now), Generated by Claude Code |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对
Landing (not L1's): the same-head contract delta PASS, then the two pending checks green, then the normal non-governed path. Generated by Claude Code |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: Delta review of record 7064678534 (PASS at ① Derived judgments
② Semver level
③ Boundary flags
④ Design judgmentNEW-1 (should-fix, docs) —
NEW-2 (nit) — changeset NEW-3 (nit) — PR body, not shipped. "Removed capability" keeps the pre-S3 remedy and omits the master-gate loss; "Why" says by id and by predicate give one answer, unscoped; the Tests table lists only "DAVE … closed rows: nothing" beside the N4 addition. NEW-4 (nit) — changeset N3 and N5 of 7064678534 left as directed. Implemented-by: VERDICT: PASS |
…nd the changeset's lifecycle verbs (#35917) Contract review 7065591342 NEW-1: name public_read_write update as the second case where an authored update policy is the whole scope, and scope the controlled_by_parent detail clause to by-id writes. NEW-2: restore addresses no single row id, so it does not meet the by-id gate. NEW-4: scope the still-refused creator to rows the authored policy does not admit. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01FEkQ5krBqrrgxCYgjXmfbv
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5nbzs5iP1HcMCFhZo5 L1 verdict (L1-a): ACCEPT at head 席位核对The delta, sentence by sentence.
Gates at 1b90fa5: not yet readable. When read: 13 success, 17 expected skip, 0 failed, 16 pending. Landing (not L1's): the same-head contract record on 1b90fa5, every check green, then the normal non-governed path. Generated by Claude Code |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv Contract reviewServed-tier: Delta read of record 7065591342 by the same isolated contract-tier reviewer. The head moves one commit, ① Derived judgments
② Semver levelUnchanged: ③ Boundary flags
④ Design judgment
Implemented-by: VERDICT: PASS |
|
repo:objectstack#4 · os-project-manager · session_01FEkQ5krBqrrgxCYgjXmfbv 席位核对Landing · 2026-11-21T16:56Z · head
Ready + auto-merge now. Held finding (a) is tracked on #35934 (7065565832). |
Fixes #35917
Clause-②: yes (widening)
Metadata-protocol: none
维护者速读
What changes
The maintainer ruled option A on #35917 (ruling comment 7063130499; the analysis is comment 7062795693): under a record sharing
allow, the platform ownership floor (created_by == current_user.id) stays an OR term beside an app-authored update or deleteusingpolicy. It is dropped only where it is the OR's last term.computeLayeredRlsFilter,security-plugin-rls-filter.ts). WithdropPlatformOwnershipFloor, the floor leaves Layer 1 only when the policies left after it carry nousingterm (asked through the same field-existence pass the compile uses). Beside an authoredusingit stays.computeWriteCheckFilter, same file). The defaulted check keeps the floor term on the same condition, so the stored row is judged by the same OR. Acheckan author wrote still refuses.checkAuthoredRowWrite,security-plugin-authored-row-write.ts). It now takes the floor out of the permission SETS by provenance instead of through the knob, so it still judges the authored policies alone and still answersabstainwhere no authored policy matches.dropPlatformOwnershipFloorgets the one meaning: the step 2.7 by-id gate, the predicate path's relief (predicateWriteFloorRelief, comments only: itsfloored OR id IN dropIdsnow agrees with the by-id answer), thecontrolled_by_parentmaster check, the delegator's own composition (delegatorOwnWriteFloorOptions) andsecurity/explain. The authored probe is the one caller that no longer uses the knob, for the reason above.security-plugin.ts, so these edits are no longer a breach:RlsFilterOptions.dropPlatformOwnershipFloorjsdoc line;checkAuthoredRowWritedocblock no longer says the probe is driven by the knob;writeCheckPoliciespoint 3 now says the floor stays in the check beside an authoredusingunder anallow, and names the pass-1 corner where the check keeps a floor the pre-image dropped.permissions-matrix.mdxnow agrees withsharing-rules.mdx: both paths keep the floor beside an authoredusing.rls.mdxsays a write policy is one more OR term that adds rows, names the cbp exception, and says where a cap goes.sharing-rules.mdxnow:editshare or a queue earnallow;checkbounds only the stored image, and name abeforeUpdatehook readingctx.previousfor the prior state,beforeDeletefor a delete, and a hook on the detail object for a master's details;transferwith update,purgewith delete;restoreaddresses no single row id and does not meet the gate) and the fail-closed outcome that moves.Removed capability. A
usingwrite policy no longer stops a row's own creator once record sharing saysallow, and the same holds for acontrolled_by_parentmaster's creator writing its details beside the master's authored update policy. Acheckbounds only the stored image of an update; a limit on the prior state goes in abeforeUpdatehook readingctx.previous, a delete's limit in abeforeDeletehook, and a limit on a master's details in a hook on the detail object.Fixture changes (the ruling turns 22 pinned refusals into admissions). The #24746 / ADR-0090 D10 fixtures pinned the old refusal on rows the delegator created. Each test keeps its invariant and every assertion exactly as written; only the rows moved:
delegated-write-never-exceeds-delegator.test.ts(12 tests: five held-row cells and the post-image store test, under both tenancy postures).held_1,held_del_direct,held_del_agent,store_direct,store_agentand the masterm_heldare now created by OTHER (owner still BOUNDED);held_2is owned and created by OTHER. New rowsheld_created,held_created_del_direct,held_created_del_agent(owned and created by BOUNDED) back two new cells, update and delete: a held row the delegator created is admitted for the delegator and on its behalf.explain-enforce-parity.test.ts(10 tests: five plugin-security: an on-behalf-of by-id write can admit a row the delegator's own by-id write refuses, where an app-authored row-level write policy narrows the delegator (ADR-0090 D10) #24746 rows under both postures).p_bounded_held,p_del_bounded_heldandm_bounded_heldare now created by D_OTHER. New rowp_bounded_held_createdbacks two new 'plugin-security: on a by-id write, a sharingallowdrops owner_only_writes out of the OR of permissive policies, so an owner-creator holding an authored widener is refused on their own row #35917' table rows, agent and direct update, both admitted, with explain equal to enforce.Why
On an object where an authored update or delete policy applied (for example "any open deal"), a sharing
allowdeleted the floor term from the OR, so the creator-owner's own closed row was refused by id with 403 while a predicate write over the same row wrote it. By id and by predicate now give one answer on the rows the floor admits (the open-row divergence on rows it does not admit is tracked on #35934).Tests
New describe in
predicate-write-floor-deferral.test.ts,[#35917] beside an authored widener ..., extending the #35914 matrix with the widener:CONTROLS: an authored EMEA
checkstill refuses ALICE's closed r1 moved out of EMEA (403 PERMISSION_DENIED); the tenant wall still refuses her own row in another organization; on an owner-less object (sharing abstains) the floor still applies (r1, r3 only).security/explainanswers the verdict the write gets.Also pinned (N4):
Ablations (each through
scripts/ablation-replace.mjson the committed fix, restore proven by an emptygit diff HEAD):held_createdcells and all four new parity rows).authored-row-write-verdict.test.ts1 failed (the abstain pin for a creator whose authored policy does not match).Full plugin-security suite and typecheck at the head: see Verification.
Acceptance notes
The fix(plugin-security): an on-behalf-of by-id write never admits a row its delegator's own by-id write refuses (ADR-0090 D10) #24792 delegator-own guard is pinned where it still narrows. On an ordinary object, ruling A makes the delegator's own composition a superset of the floor-kept delegator filter the delegated path already ANDs, so the guard narrows nothing there. It still narrows on a
controlled_by_parentobject. There the delegator's direct write carries the master-gate vouch, so the floor yields and the delegator's authored detail policy decides alone, while every floor-standing filter on the delegated path admits a row the delegator created. The body's earlier "an OWD that opens row writes" was wrong:platformFloorYieldsToObjectWriteModelanswers forpublic_read_writefrom the object alone, so both delegator filters drop the floor there and the guard narrows nothing. The D10 rig gets the authored update policynote != 'held'on its cbp DETAIL, a grand detail whose master is DETAIL (DETAIL becomes a middle master), and three pins, each under both postures:d_note_held(the step 2.7 site);d_store_*(the post-image check site);g_under_mid_heldunder the held middle master (the master-gate site).Each pin refuses both the delegator's own write and the write on its behalf, and explain agrees for the two cells. Ablation on the D10, parity and pin files (253 tests), each through
ablation-replace.mjs, restore proven bygit diff HEAD= 0 lines:delOwnWriteFilterremoved): 2 red, the step 2.7 cell under both postures;delOwnCheckFilterremoved): 2 red, the detail store test under both postures;delegatorOwnMasterWriteFilterremoved): 2 red, the middle-master cell under both postures.Open-row by-id vs predicate divergence (held finding, not fixed here). Under an authored write widener, an OPEN row the caller neither owns nor holds a share on is admitted by id (the authored probe lifts the sharing refusal) but left out of a predicate write (the sharing bulk scope stays owner and shares). The relief test in
predicate-write-floor-deferral.test.tsrecords it: by id r1, r2, r3, r4; by predicate r1, r2. Tracked on sharing: a predicate write asks one write verdict per candidate row, so a member bulk update over 10,000 rows owned by others costs ~5 s for no extra row; give ISharingService a bulk write-scope and verdict contract #35934 (comment 7065565832): it is that card's predicate bulk write scope, in the same files, so it was folded there rather than filed apart.Fixes #35917still holds: ruling A (7063130499) asks for one answer on the rows the platform floor admits, and this divergence is on rows the floor does not admit.The plugin-security: the #5492 floor deferral covers only by-id writes; a predicate (multi) update still applies
owner_only_writes, so Modify All and edit shares silently match only self-created rows #35802 relief test inpredicate-write-floor-deferral.test.tsnow pins the by-id answer r1, r2, r3, r4 against the predicate's r1, r2. That locks the held out-of-scope finding (a), the open-row by-id vs predicate divergence, in place until that finding is worked.sharing: a predicate write asks one write verdict per candidate row, so a member bulk update over 10,000 rows owned by others costs ~5 s for no extra row; give ISharingService a bulk write-scope and verdict contract #35934 proceeds on its own premise and is out of scope here.
The
controlled_by_parenthalf of plugin-security: the #5492 floor deferral covers only by-id writes; a predicate (multi) update still appliesowner_only_writes, so Modify All and edit shares silently match only self-created rows #35802 is out of scope here.S4, the master check's widening is pinned. The D10 rig gets the master
m_held_created: held, owned and created by the delegator. Under it are the detailsd_under_held_createdandd_under_held_created_del_direct/_agent. A detail update and a detail delete are both admitted for the delegator and on its behalf, with explain agreeing, under both postures. A1 turns all 4 red.Verification
a82a0b1be0for every run below. Head1b90fa5f2a(seat 4, contract record 7065591342 NEW-1/NEW-2/NEW-4) changes onlyrls.mdxprose and one changeset sentence.pnpm --filter @objectstack/plugin-security typecheck: VERDICT command-exit 0.a82a0b1be0derived 104 families: 101 exit 0.--ranreconciliation: 104 accounted, 101 run, 3 NOT MEASURED, 0 unrun.pnpm --filter @objectstack/spec run check:skill-examplespnpm check:dual-build-cjs-loadspnpm check:i18ncheck-governed-merges.mjs --pr 36117: NOT governed. 0 of 11 paths hit the register; 594 changed lines.Two-minute check:
pnpm --filter @objectstack/plugin-security exec vitest run --maxWorkers=2 src/predicate-write-floor-deferral.test.tsprints every test passed, including the[#35917] beside an authored widenerdescribe.Read first: (1)
security-plugin-rls-filter.ts, thewithoutFloorhunk incomputeLayeredRlsFilter, the decision itself; (2) thefloorReplacedhunk incomputeWriteCheckFilter, which must agree with (1); (3)security-plugin-authored-row-write.ts, the probe that must not start answeringadmit.Human Minimum
packages/specholds no runtime logic. (not touched)pnpm lintpasses. (CI runs the repo lint)main, one pull request.packages/spectouched: not touched.content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code