Repository navigation
Description
coordinator#1 · os-project-manager · session_01FEkQ5p5uRcoqrJTKdjhTWj
Ruled: 7073030861 · letter A · 2026-11-22T02:39Z
Summary
On 18.6.0, a predicate (conditional, multi: true) update made by a business user matches only the rows that user created (created_by == current_user.id). This holds even when the same user can read and edit the other matching rows by id, and even when they hold modifyAllRecords. The update returns success with fewer rows changed. It does not refuse.
This looks like the #5492 problem surviving on the predicate write path. The deferral that fixed it is reached only when the write names a single id.
Where (current main)
In packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts, the floor decision that lets ISharingService's allow verdict replace the platform ownership floor (owner_only_writes / owner_only_deletes) sits inside:
const targetId = this.extractSingleId(opCtx);
if (targetId != null) {
// … resolvePreImageFloorDrop → dropPlatformOwnershipFloor …
}A predicate update carries no single id, so it never reaches the deferral, and the floor stays as an unconditional AND. The comment above the block describes exactly this outcome as the #5492 defect: "a manager holding Modify All Data and a share target holding access_level: 'edit' both got 403 on every row they did not personally create". On the predicate path the user gets 0 matches instead of a 403.
Repro (18.6.0, measured on a booted app)
- Take an object with
owner_idand record sharing, for example a child object whosesharingModeliscontrolled_by_parent, with the parent owned by user R. Create four rows under the same parent, covering every owner × creator combination: owner R or another user, created by R or another user. - As R,
findwith{ parent: X }returns 4 rows. R canPATCHeach of the 4 by id: 200. - As R, run a predicate update with the same filter (
update(..., { where: { parent: X }, multi: true })). Only 2 rows change, exactly the two withcreated_by = R. Ownership makes no difference. - Repeat as a manager holding
viewAllRecords+modifyAllRecordson the object. The predicate update again changes only the rows that manager created. - On an object such as a task object, with a Modify All manager, the result is the same.
The narrowing fails safe: it only refuses more, and a row the caller cannot read still matches nothing. But it is silent. Flows, scripts and server-side bulk updates change fewer rows than they target, with no error.
Expected
The predicate write path should compose the floor the same way as the by-id path: per matched row, the sharing service's tri-state write verdict (allow → the floor is replaced; abstain / deny → the floor stays). Alternatively, a user whose sharing verdict allows a row should not have that row dropped from the predicate's match set. At minimum, the response should report the rows dropped by the floor instead of returning a smaller success.
Related
- Row-level write gate consults neither
modifyAllRecordsnorsys_record_share.access_level— both declared write-widening mechanisms are inert #5492 and ISharingService 写判定补三态(放行/不表态/拒绝)—— #5492 裁决 B 案的 step1,二态 canEdit 已实测产出 fail-open #6428 (closed): the by-id fix this extends. modifyAllRecordsstill does not widen a by-id write on an object with NO owner field (sharing abstains, the platformcreated_byfloor holds) #6698 (closed): by-id, an object with no owner field.
Found while building approval-gated objects in an app on 18.6.0. The app does not work around it: its UI and REST bulk writes go by id. Only engine-level predicate updates are affected.
Activity
objectstack-fleet commentedon Nov 20, 2026
triage#1 · hotlong · session_01Q4EjjMnyLqJdzuktEmRPXH
Triage: lands in
domain:server(plugin-security authz middleware) ·pm:queue; rationale: area:data · Bug · Severe·data wrong (a predicatemulti: trueupdate by a business user changes only the rows that user created, even when they can edit the others by id or holdmodifyAllRecords, and still answers success; the #5492 floor deferral is reached only on single-id writes) · builders, often (flows, automations and bulk updates write by predicate) · reproduced on 18.6.0 by an outside builder → p1 · size M.objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
Claim: PM loop round 1
Session:
session_01L9qibvVRcFWKrfWeG5jzPbAccount:
os-teslaBranch:
claude/issue-35802-predicate-write-floor-deferralWorktree:
objectstack-issue-35802Domain:
domain:serverSeat:
repo:objectstack#7Area:
d7-CFile surface:
packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts,packages/plugins/plugin-security/src/security-plugin-addressed-writes.ts,packages/plugins/plugin-security/src/security-plugin-sharing-verdicts.ts,packages/plugins/plugin-security/src/security-plugin.ts, their tests underpackages/plugins/plugin-security/src/**orpackages/plugins/plugin-security/test/**, and one.changeset/35802-*.md. On a breach, stop and explain it in the report. If the fix needspackages/objectql/**orpackages/spec/**, stop and report before writing.Container & model:
M,mode:subagent,model: opus,effort: xhigh(an authz surface; seat order 17:40Z)Clause-②: yes (widening, expected; the dev confirms from the measured verdict and the claim is amended if it differs): a predicate write by a caller whose sharing verdict is
allownow matches rows the floor used to drop silently.Metadata-protocol: none
Responsibility:
plugin-security authz middleware in objectstack | the #5492 floor deferral (resolvePreImageFloorDrop → dropPlatformOwnershipFloor) is reached only under extractSingleId != null, so a predicate (multi:true) update/delete keeps owner_only_writes / owner_only_deletes as an unconditional AND | Modify All holders and edit-share targets running flows, scripts and server bulk updates; silent smaller success; reachable today on 18.6.0Thread-read: 7034749465
Premise: holds. At origin/main f44758b,
security-plugin-authz-middleware.ts:1402-1403 readsconst targetId = this.extractSingleId(opCtx); if (targetId != null) {, andresolvePreImageFloorDrop(:1414) is reached only inside that block.Serial constraints cleared: overlap-check probe over the four src files at origin/main f44758b: VERDICT clean, 0 open PR heads share them.
Pre-claim lane:
packages/plugins/**(domain:server). area:data p1. Seat 7 order 17:40Z; d7-A (plugin-security owner) is stopped. Tesla 17:07Z: only p1 cards dispatch.Pre-claim deps: no
Blocked-by:. #5492, #6428 and #6698 are closed (the by-id fix this extends).Prior rulings read: owner_only_writes,plugin-security,floor,deferral,covers,by-id,writes,predicate,multi,update,applies,modify (+6 more) → 233 hits; ADR-0055 Decision §3, ADR-0099 D2, ADR-0103 D2, ADR-0155 D1, ADR-0038 Decision §5, ADR-0054 Decision §3, ADR-0055 Decision §1; thread: none; repo: objectstack-ai/objectstack. These stand: the #5492 composition (
allowreplaces the platform floor;abstain/denykeep it; app-authored policies and Layer 0 untouched; ADR-0066 ① intact; ADR-0111 D3 verb boundary inherited), as stated in the comment block above :1402.Owed review: CONTRACT_REVIEW_TIER (Fable) because this changes what a predicate write can touch on an authz surface. L1 by L1-a. Run check-governed-merges before routing. If it is Tier H or a narrowing, hand off to the seat for the four pieces.
Pins owed: owner, non-creator owner, creator non-owner and Modify All manager, each × predicate update and predicate delete. Each must agree row for row with the by-id verdict. Ablate each.
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
os-dev-report
{ "issue": 35802, "status": "done", "branch": "claude/issue-35802-predicate-write-floor-deferral", "pr": "https://github.com/objectstack-ai/objectstack/pull/35914", "head": "99d771ef0b79e4f3239379f190e2ae09e5c47f1a", "session": "session_01L9qibvVRcFWKrfWeG5jzPb", "premise_still_valid": true, "summary": "Premise held on origin/main f44758b21e: the #5492 composition (sharing allow replaces owner_only_writes / owner_only_deletes, abstain and deny keep it) is reached only under extractSingleId != null (step 2.7), so a predicate write kept the floor as an unconditional Layer 1 term. Fix, plugin-security only (security-plugin-authz-middleware.ts, security-plugin-sharing-verdicts.ts): on an addressed predicate update/delete, after the existing readable-id question (10,000 cap, refusal above), a non-delegated caller for whom the floor is in play gets one id read of which matched rows the floored Layer 1 already admits, then the by-id gate's own resolvePreImageFloorDrop for every other matched id (predicateWriteFloorDropIds, batches of 25). Layer 1 becomes floored OR (id IN dropIds AND layer1-with-dropPlatformOwnershipFloor), with Layer 0 recomposed unchanged. Step 3.6 holds a floor-replaced row of a predicate update to the check computed with dropPlatformOwnershipFloor, and every other row keeps checkParts. Design: a union, never a narrowing. Every added row is one the by-id path admits for the same caller, and no row today's predicate path writes is removed. Exact per-row equality would narrow one measured corner (see out_of_scope_findings), which would be a BREAKING narrowing arm. Measured, predicate rows changed before -> after (by-id oracle in brackets), over r1 ALICE/ALICE, r2 ALICE/CAROL, r3 BOB/ALICE, r4 BOB/CAROL (owner/creator): ALICE update r1 -> r1 r2 [r1 r2], delete r1 -> r1 r2 [r1 r2]; BOB update and delete none -> r3 r4 [r3 r4]; CAROL update and delete none -> none [none]; Modify All manager update and delete none -> all 4 [all 4]; DAVE (edit shares on r2 r3) update none -> r2 r3 [r2 r3], delete none -> none [none, ADR-0111 D3]. Not fixed: the card's own repro object is a controlled_by_parent detail. Sharing abstains there, and the by-id write drops the floor through masterGateCoversThisWrite, which the RlsFilterOptions docblock says the bulk path must not set ('a separate decision'). Measured with the same rig: master owner, predicate r1 r3 vs by-id all 4; Modify All manager, predicate none vs by-id all 4. So the PR says Part of #35802 rather than the dispatch's Fixes (see deviations and open_questions).", "tests": "All at head 99d771ef0b (the last commit is changeset-only; the code tree is 00b233178a's). New src/predicate-write-floor-deferral.test.ts: a real SecurityPlugin + ObjectQL + SqlDriver(better-sqlite3) + SharingService and its middleware + shipped member_default. Each case runs the predicate write on one seeded copy and per-id writes on a second, asserts equal sets row for row (a by-id refusal must be 403/404), and names the expected set. 14 cases: ALICE, BOB, CAROL, the Modify All manager and DAVE, each x predicate update and delete; a Modify All holder under an authored update policy stage == 'open' (r1/r4 closed, so r2 r3 only); CONTROL, an owner-less object where sharing abstains: ALICE update r1 r3 and delete r1 r3 (floor kept); a row outside the predicate is never touched. Runs (os-verify-lock): pnpm --filter '@objectstack/plugin-security^...' build -> VERDICT command-exit 0; plugin-security pnpm typecheck && pnpm build -> VERDICT command-exit 0 (check:test-typecheck OK 0 errors; check-dts-emitted 2/2); full suite vitest run --maxWorkers=2 -> Test Files 285 passed (285), Tests 7082 passed | 45 skipped (7127), VERDICT command-exit 0; new file alone -> Tests 14 passed (14), VERDICT command-exit 0. Ablation, committed first, scripts/ablation-replace.mjs wrap mode, the test imports source (no dist hop). Leg 1: anchor 'if (rlsFilter && layered.layer1 && !delegatorSets) {' -> 'if (false && ...' landed (anchor 1 -> 0, blob 63529175fe16 -> 2619c7c8a874): Tests 8 failed | 6 passed, VERDICT command-exit 1. Red: ALICE x2, BOB x2, manager x2, DAVE update, never-touched. Green as designed: CAROL x2, DAVE delete, authored policy, control x2. Restored: blob == HEAD 63529175fe16, git diff HEAD empty. Leg 2: the per-row check relief anchor -> 'false && floorDropJudge !== undefined;' landed (blob -> 53367d4678d0): Tests 5 failed | 9 passed, VERDICT command-exit 1. Red: the four predicate updates and never-touched, each refused whole with record_change_not_allowed. Restored: blob == HEAD, git diff HEAD empty. Not run locally: test:repo (CI-owned, the diff touches none of its tests).", "gates": "Derived: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, tree objectstack-ai/objectstack at 99d771ef0b, --repo verified against origin, 4 paths, +671/-9. 71 families ran once each, with exit codes captured before any pipe. 69 exit 0. 2 exit 3 = NOT MEASURED, PREREQUISITE NOT MET (pnpm check:dual-build-cjs-loads reads every package's dist; pnpm check:i18n runs the built CLI; only the plugin-security closure is built here). CI owns both. Reconciliation: dispatch-gates --ran on the 'cmd :: exit N' record -> 'dispatch-gates --ran: 71 derived famil(ies) accounted for, 69 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)', exit 0. check-platform-checklist: not applicable (no exported symbol renamed or deleted; one function added). node scripts/pm/check-governed-merges.mjs --pr 35914 -> exit 0, 'NOT governed, ordinary queue landing applies', 0 of 4 paths hit the register, 680 changed lines (at most 3000). PR check-runs on 99d771ef0b, one read at report time: 23 total, 5 skipped (Borrowed queue verdict, Queue verdict, 18.x upgrade harness, Packed-tarball smoke, Schedule gate), 18 in_progress (Check PR Size, Check Changeset, Flag docs affected by code changes, filter, PR-body guards, Type Check source gates / debt ledger / workspace / consumer gates, Lint ESLint / docs & code guards / scoped tooling self-tests / query-options erasure / slot lookup & corpus / PM dispatch-gates / repo & tooling gates / CI release & engine gates, Governed Surface Queue Guard). in_progress is the honest value; not polled.", "dogfood_battery": "n/a: no ! in the PR title, and the Clause-② arm is (widening), not (narrowing)", "clause_2": "Clause-②: yes (widening), from measurement: rows the by-id path admits are now also written by a predicate write, and no row is removed. Metadata-protocol: none. The changeset is patch for @objectstack/plugin-security, and both lines are in the changeset and in the PR body.", "governed_verdict": "NOT governed (check-governed-merges --pr 35914, exit 0)", "mcp_calls": "0", "api_writes": "2 relay dispatches. (1) pr_create via scripts/pm/fleet-write/dispatch.mjs: POST /repos/objectstack-ai/objectstack/dispatches -> relay run 44795835114: POST pulls (draft #35914) + POST issues/35914/assignees (os-tesla); relay read-back 13047 bytes sent = stored. (2) this report, via scripts/pm/post-stamped.mjs --comment=35802 (relay). git push of the branch is not a REST write.", "deviations": [ "The dispatch asked for a PR body that closes the card. The PR opens with 'Part of' plus the card number instead (os-dev.md: use Part of when the merge should not close the card, and name the half left) because the card's literal repro, a controlled_by_parent detail, is not fixed by the sharing-allow composition (open_questions 1). Conflict reported, not chosen silently. If the seat rules the half out of scope, the first line is a one-line body edit.", "Two commit attempts were denied by the session's permission classifier: a combined commit + push with a long message, then a commit with -F file. The commit then went through as a plain git commit -m with the push as its own command. Nothing external was affected.", "The harness attribution reminder asks for a model-named Co-Authored-By trailer and an emoji PR footer. Not used: the dispatch requires model-free trailers, and os-dev.md / AGENTS.md set the PR footer form. Commits carry Claude-Session + 'Co-authored-by: Claude' only, and history was not rewritten.", "Gate runner and suite ran detached, with results read from their logs in the same turn. No process or monitor remains." ], "open_questions": [ { "question": "On a controlled_by_parent detail (the card's repro object), should an addressed predicate update/delete drop the platform floor the way the by-id write does through the master gate? Today the RlsFilterOptions docblock says the bulk path must not set masterGateCoversThisWrite ('a separate decision'), so the master's owner and a Modify All manager write only rows they created (measured: owner r1 r3 vs by-id all 4; manager none vs all 4).", "options": [ "A: set masterGateCoversThisWrite on the non-delegated addressed predicate path once assertControlledByParentWrite has passed every master the write reaches (it already refuses on the first master the caller may not edit). That equals the by-id decision row for row. No new reads (the master set is already computed). The 'must not' bullet becomes a ruling. Widening only. About half a day plus pins on the same rig.", "B: keep the floor on predicate writes to cbp details (status quo). The card's repro stays a silent under-write. Document it in the changeset and close the card as partial.", "C: keep the floor but refuse loudly when it would drop rows the by-id path admits. Needs the per-row comparison reads, and changes the answer existing callers get (a narrowing arm, BREAKING)." ], "recommendation": "A: the bulk master gate already judges every master the write reaches, so dropping the floor after it passes is exactly the by-id oracle the card asks for, at no extra read cost. B leaves the reported bug. C narrows." }, { "question": "Should PR 35914 close the card when it merges?", "options": [ "A: Part of (as opened). The card stays open for the cbp half and is closed by the follow-up PR under Q1.", "B: Fixes. Close the card here and file the cbp half as its own card linked back." ], "recommendation": "A, because the card's literal repro is the cbp object and it is not fixed by this PR." }, { "question": "Verdict cost on large predicate writes: each matched row the floor does not already admit costs one sharing verdict (checkEdit / checkDelete, a few store reads), batched 25 at a time and bounded by the existing 10,000 readable-row cap. A Modify All manager writing 10,000 rows asks 10,000 verdicts.", "options": [ "A: keep as is. The existing cap bounds it; a member over their own rows asks no verdict at all.", "B: add a bulk verdict to ISharingService (a spec interface change, so it needs its own decision).", "C: a lower cap for the verdict leg, with a refusal above it (never truncation)." ], "recommendation": "A for now. Measure under load before choosing B, and C narrows what callers can write today." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted in PR Acceptance notes, not filed. Candidate class a, but reach is not met: measured at the engine door only (ql.update by id under the caller's context), REST PATCH not measured. Evidence: an owner-creator holding an authored update widener (stage == 'open') is refused a by-id update of a CLOSED row they created and own (r1: 403 PERMISSION_DENIED), because the sharing allow drops the floor out of an OR of permissive policies and leaves the widener as the only Layer 1 term. The predicate path writes that row, before and after this PR. Same family as the #5492 by-id composition. Dedupe words: floor drop narrows, authored widener, owner_only_writes OR, by-id 403 own row, dropPlatformOwnershipFloor" ] }Generated by Claude Code
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
os-dev-report
{ "issue": 35802, "status": "done", "round": "2 (L1 7047985230 REWORK items 1-3; L2 7048114223 PASS: S1-S3, N1-N6; docs-drift 7047860335)", "branch": "claude/issue-35802-predicate-write-floor-deferral", "pr": "https://github.com/objectstack-ai/objectstack/pull/35914", "head": "267ccece2d1b8ea4eb78dd1f46ed44dbfe72ba69", "session": "session_01L9qibvVRcFWKrfWeG5jzPb", "premise_still_valid": true, "summary": "Round 2 on top of origin/main cd55df8f3c (merged in as 25c3807b54; none of its 4 commits touches plugin-security). (1) S2 implemented: predicateWriteFloorRelief now computes replaced first and answers null when it is non-null, so no probe read and no verdict run where an authored using policy remains. The relief's Layer 1 is now floored OR id IN dropIds. This changes no row's answer: policies OR-compose, so a row floored refuses fails every authored policy too. A7 shows the early return is load-bearing in the new shape. (2) N4: idsOfReadableScope (now exported) and predicateWriteFloorDropIds accept bigint ids. (3) Pins, the file is 14 -> 27 cases, and the rig now runs on the isolated tenancy posture so Layer 0 is composed: verdicts asked are recorded on the real sharing service (set-aside, verb, S2); five on-behalf-of cases equal to by-id (BOB for CAROL, a member with Modify All, both verbs, nothing written; ALICE for CAROL; ALICE for ERIN, an admin with Modify All, both verbs, r1 r3: her own floor holds back r2 r4); the authored-widener corner (predicate still writes the closed own row; by id refuses it); S1 pinned as the current answer; 60 candidates over three batches; Layer 0 in the composed predicate; a bigint unit pin; and three direct pins on predicateWriteFloorDropIds. (4) Changeset rewritten: S1 disclosure, the member verdict cost, N1 wording (creator-only floor, queue basis, 'unless an app-authored write policy admitted a row'), N2 bounds (5,000 edit shares, read share plus widener, cbp), and the delegated sentence, now pinned. (5) N3 and N6 not taken, with measured reasons (nits field). PR body: not PATCHed by me (os-dev.md: after pr_create the seat writes it). A full round-2 body is drafted for the seat at /tmp/claude-0/-home-user/cba0d951-fa67-548d-aa06-d20bae640045/scratchpad/issue-35802/pr-body-r2.md (15,269 bytes, linted: no angle-bracket fragments outside details/summary, no closing keyword near a card number, no control bytes).", "cost_measurements": { "rig": "zz-bench (scratch, never committed): the same real-engine rig, isolated posture, SQLite in memory, one run each on a shared box; checkEdit counted on the real SharingService, driver reads counted on SqlDriver find/findOne/count/aggregate/distinct; variants = the two source files at origin/main, at 99d771ef0b (round 1), at this head; every variant restored and checked blob == HEAD with git diff HEAD empty", "rows": [ "(i) member ALICE, predicate update over 1,000 readable rows owned by BOB (all-deny): main 44 ms, 0 verdicts, 3 driver reads, 0 written | round 1 1,081 ms, 1,000 checkEdit, 2,004 reads, 0 written | head 1,085 ms, 1,000 checkEdit, 2,004 reads, 0 written", "(ii) the same at 10,000: main 47 ms, 0, 3 reads, 0 written | round 1 5,419 ms, 10,000 checkEdit, 20,004 reads, 0 written | head 5,298 ms, 10,000 checkEdit, 20,004 reads, 0 written", "(iii) Modify All holder at 10,000 (rows owned by BOB, created by CAROL): main 47 ms, 0, 2 reads, 0 written | round 1 1,653 ms, 10,000 checkEdit, 10,003 reads, 10,000 written | head 1,796 ms, 10,000 checkEdit, 10,003 reads, 10,000 written", "(iv, S2) Modify All holder under an authored using policy (stage == 'open'), 10,000 closed rows: main 53 ms, 0, 2 reads, 0 written | round 1 1,629 ms, 10,000 checkEdit, 10,003 reads, 0 written | head 45 ms, 0 verdicts, 2 reads, 0 written", "(v, the L1's example) member ALICE over 3,000 readable rows, 20 owned by her (created by CAROL): main 18 ms, 0 written | head 1,446 ms, 3,000 checkEdit, 5,984 reads, 20 written" ], "per_verdict": "A member's deny costs 2 store reads (the row's owner and the share lookup), about 0.5 ms each here. A Modify All allow costs 1 read. The S2 pin keeps the verdict count at 0 under an authored using policy (the NARROW case and the widener case).", "material": "Yes, for the member all-deny path: about 50 ms becomes about 5.3 s and 20,004 store reads at the 10,000 cap, for no extra row. The changeset now names it. On a real network database each read is a round trip, so expect it to be larger.", "narrowing_proposals_not_implemented": [ "P1, a bulk verdict on ISharingService (for example writeVerdicts(object, ids, verb, ctx): one owner-scope read over id IN, one share read, one Modify All check per batch). Outside the surface: a packages/spec contract plus plugin-sharing, so it needs a decision. It changes no row's answer if each verdict equals checkEdit/checkDelete per row, pinned by equivalence. It cuts reads from 2 per row to about 3 per batch in every case, Modify All included.", "P2, push the sharing bulk write scope into the candidate read: AND buildWriteFilter(object, ctx, verb) into the read that picks candidates, so only rows the sharing middleware would let through are asked about. buildWriteFilter is not on ISharingService, so this is a spec change and outside the surface. It changes no row's answer: a row outside that scope is ANDed out by the sharing middleware anyway. It removes the member all-deny cost (i, ii, v) entirely. It does nothing for (iii): for Modify All the scope is org and the filter is null.", "P3, a Modify All short-cut inside the surface: when the caller's own sets grant modifyAllRecords on the object, ask one verdict and apply it to every candidate. Inside the surface. It changes no row's answer only while SharingService's verdict for a Modify All holder is constant per object (true today: every basis answers allow, and abstain is schema-level). That is an implementation property, not the ISharingService contract, so a replaced sharing service could differ. Not recommended without a contract statement.", "P4, the coordinator's example, 'skip the verdict leg when the caller holds no Modify All and no edit share on the object': inside the surface, but as stated it CHANGES answers. BOB (owner, not creator: the card's persona b) and queue members would lose their rows. It is only answer-neutral with an ownership pre-filter (owner_id in the caller's write-depth owner set), and that re-implements the sharing service's owner scope, depth resolution through the BU graph, and share and queue lookups inside plugin-security (contract-first, os-dev rule 5). Not recommended.", "P5, a lower cap for the verdict leg with a refusal above it: inside the surface, but it narrows (a write that succeeds today would be refused): a BREAKING arm." ], "recommendation": "Keep the leg as is in this PR: it is bounded by the existing 10,000 cap, and the changeset names the cost. File P1 plus P2 together as one follow-up for an ISharingService bulk write-scope and verdict contract (spec, needs a decision)." }, "s1_measurement": { "case": "ALICE holding a check-only update policy (region == 'emea', no using) on top of member_default; r1 owner ALICE, created by ALICE, EMEA; r2 owner ALICE, created by CAROL, APAC; predicate update where batch", "before_origin_main": "success; r1 written (r2 not matched: the floor)", "round_1_head_99d771ef": "refused whole: PERMISSION_DENIED 403 (record_change_not_allowed), nothing written", "this_head": "refused whole: PERMISSION_DENIED 403, nothing written; pinned as the current answer (code and status asserted, plus no row changed)", "by_id_oracle": "r1 written; r2 refused 403", "same_class_not_measured_here": "error-severity validation rule, a throwing before-hook and the readonlyWhen strip on a newly matched row (engine-update.ts, objectql), by L2's reading; NOT MEASURED in this round" }, "s1_options": [ "(a) Inside the surface (authz-middleware): before composing, read each candidate's full row, evaluate its pre-hook image ({...row, ...payload}) against the floor-dropped check, and leave failing rows out of dropIds. Covers the RLS check only. Validation rules, hooks and readonlyWhen run in objectql's engine-update (outside the surface) and stay all-or-nothing, and a hook that changes the image after the pre-check can still fail the write. Cost: one more full-row read of up to 10,000 rows. Against the oracle: the written set equals the by-id admitted set (r1), but r2's refusal becomes silent, which is the card's symptom class (a silent smaller success).", "(b) Keep all-or-nothing and declare it: Clause-② gains the (narrowing) arm, with its BREAKING banner and the full dogfood battery. The changeset sentence is already in. Inside the surface for text. The Clause-② lines are copied from the claim, so the seat amends the claim first. Against the oracle: r2 is refused loudly, as by id, but r1 is not written where by id writes it.", "(c) A per-row partial apply for predicate updates, reporting the refused rows: an engine (objectql) and response-shape change, outside the surface, a product decision." ], "s1_recommendation": "(b). A predicate update already refuses whole when a floor-admitted row fails its check today, and the newly matched rows follow the same rule. (a) cannot make the outcome a union inside the surface (validation, hooks and readonlyWhen stay all-or-nothing), and it brings back a silent skip. The seat or maintainer rules the arm; nothing that changes a row's answer was implemented.", "tests": "At head 267ccece2d. plugin-security pnpm typecheck && pnpm build -> lock VERDICT command-exit 0 (check:test-typecheck OK 0 errors; check-dts-emitted 2/2). Full suite vitest run --maxWorkers=2 -> Test Files 285 passed (285), Tests 7095 passed | 45 skipped (7140), VERDICT command-exit 0 (round 1: 7082 passed; +13 = this file's new cases). New file alone -> Tests 27 passed (27), VERDICT command-exit 0. Closure re-built after the merge: pnpm --workspace-concurrency=2 --filter '@objectstack/plugin-security^...' build -> VERDICT command-exit 0. test:repo not run locally (CI-owned; the diff touches none of its tests).", "ablations": [ "All ran through scripts/ablation-replace.mjs in wrap mode at 7b89b3ceb4, the same code as the head. Each anchor went 1 -> 0, and each restore was 'ok restored: blob == HEAD' with git diff HEAD empty.", "A1, L1 item 3 (verb: 'update' in place of rlsOperation in the relief), blob 869cbad82cdf -> 3f018c0744b9, run beside a scratch copy of the round-1 14-case file. The round-1 pins stayed GREEN 14/14, as the L2 predicted (buildWriteFilter delete is owner-only, so no row moves). The new pins went RED 2/27 (ALICE's and DAVE's predicate deletes asked edit:, not delete:). L1 expected 'DAVE's predicate delete writes r2 and r3'; that did not happen, and the rows stayed. The direct pin on predicateWriteFloorDropIds that L2 asked for is added (verb pass-through, delegation, batching). It cannot see this mutant, which sits in the caller; the verdict recorder does.", "A2, L1 item 3 second leg / S3 (!delegatorSets at the relief, :2852), blob -> 9eab6beaab22: RED 5/27. The delegated updates were refused whole (the 3.6 check kept the floor). The delegated deletes wrote extra rows: BOB for CAROL wrote [r4] where by id is []; ALICE for ERIN wrote [r1 r2 r3] where by id is [r1 r3].", "A3, S3 (!delegatorSets at the 3.6 judge, :2490), blob -> ad03a10d8fe7: GREEN 27/27. This is an EQUIVALENT mutant: on a delegated write the relief never runs, predicateFloorDropIds stays null, and the floor-dropped judge is built and never read (one wasted computeWriteCheckFilter). No pin can make it red without A2.", "A4, S3 (floor-admitted set-aside dropped), blob -> d7f80d96aaab: RED 2/27 (ALICE asked edit:r1..r4 instead of edit:r2 r4, and the same for delete). After S2 the set-aside is a cost leg. Its semantic role from round 1 (the widener corner) is now carried by the S2 early return.", "A5, S3 (batch loop runs once), sharing-verdicts blob 5569e873e4a4 -> 628fcd57a9e3: RED 2/27 (25 of 60 asked; the direct helper pin also failed). A5b (slice one short) -> 819033e6e42f: RED 2/27.", "A6, S3 (Layer 0 recompose dropped), blob -> 5d9ad8cb55d5: RED 1/27 (the composed predicate lost org_pwf). On round 1's single-posture rig Layer 0 was null and this leg could not go red, so the rig moved to the isolated posture.", "A7 (S2 early return removed), blob -> e54f5695cc91: RED 1/27 (NARROW's closed r1 r4 matched; the write was refused whole)." ], "delegated": "L1 item 2 is done with the pins. The changeset sentence stays. Measured: on-behalf-of predicate = by-id for all five cases, and no verdict is asked. ALICE for ERIN writes r1 r3, not r1 alone: ERIN's Modify All is the agent leg's depth under the ADR-0090 D10 ruling of 2026-09-08 (a ceiling declaring no depth leaves the delegator's standing), on both paths alike. That is the ruled behaviour, not this change's.", "nits": [ "N1 taken (changeset: creator-only floor, queue basis, the authored-widener exception).", "N2 taken (changeset: the 5,000 edit-share read, the read share plus widener, and cbp named as bounds that stay).", "N3 NOT taken: its premise is refuted by measurement. Step 3 does not read step 2.7's decision, so the guard is not answer-neutral. Compare-and-set shape, BOB updating where {id: r4, stage: 'open'}, multi: origin/main writes 0 rows (1 verdict); this head writes r4 (2 verdicts); this head plus the guard writes 0 (1 verdict). The guard would bring the reported under-write back on that shape; its saving is one verdict for one row.", "N4 taken (bigint ids, unit-pinned).", "N5 not actionable in-surface: noted (bind counts stay under the SQLite and Postgres limits; only better-sqlite3 is exercised; the bench needed 400-row seed chunks, not 1,000, for SQLite's compound-select limit, which is a seed artefact, not the write).", "N6 NOT taken: unreachable. resolveEngineUpdateDispatch routes a truthy payload id by id (or refuses it), never to the multi path, and a falsy one is excluded from dropIds by the !!id filter, so an image id can never name a different matched row." ], "docs_drift": [ "content/docs/permissions/permissions-matrix.mdx:53-56. Current: 'On an ordinary tenant business object, authored and baseline RLS still applies (e.g. member_default's owner-scoped write policies keep org_member holders owner-scoped on update/delete even when another set grants modifyAllRecords), and the Layer 0 tenant wall always ANDs on top.' False where record sharing enforces writes (an object with owner_id and a private or public_read OWD): a Modify All holder's sharing allow replaces the floor. By id this has been so since #5492; this PR makes it so by predicate too. Measured: the MANAGER cases on public_read. Also, the floor is creator-scoped (created_by), not owner-scoped. Proposed: 'On an ordinary tenant business object, authored RLS still applies, and so does member_default's creator-only write floor (created_by == current_user.id) for org_member holders, except where record sharing enforces writes (an object with an owner_id whose OWD is private or public_read): there the sharing service's allow for a row (ownership at the caller's write depth, Modify All, or, for an update, an edit share or the row's queue) replaces the floor for that row, on a by-id write and on a predicate write alike. The Layer 0 tenant wall always ANDs on top.'", "content/docs/permissions/sharing-rules.mdx:66-67 (the 'Baseline row-level security' bullet, 58-68). Current: 'On an ordinary tenant business object, modifyAllRecords does *not* lift those policies'. False for the same objects, for the same reason, by id since #5492 and by predicate with this PR. Lines 59-62 ('rank-and-file members stay owner-scoped on writes even under public_read_write') remain true: sharing abstains there, so the floor stays. Proposed replacement for 66-67: 'On an ordinary tenant business object, modifyAllRecords does *not* short-circuit those policies. Where record sharing enforces writes (an owner_id and a private or public_read OWD), the sharing service's allow for a row (ownership at the caller's write depth, Modify All, or, for an update, an edit share or the row's queue) replaces the floor for that row, by id and by predicate alike. Under public_read_write, or on an object with no owner_id, it abstains and the floor stays. An app-authored policy is never replaced.'", "content/docs/permissions/system-context.mdx: none falsified. Lines checked: 104 (owner_only_writes on an unstamped system insert), 135 (the readonly strip on the bulk/predicate path), 151 (member_default's '*' update floor on sys_personal_view / sys_user_preference: owner-less, so sharing abstains and the floor stays), 160 (the bulk data event organizationId), 171 (predicate-delete share revocation). Also still true: permissions-matrix.mdx:374 (the predicate-write performance callout: the readable bound, the 10,000 refusal, the sharing write bound, the read-share-plus-widener exception) and sharing-rules.mdx:31 ('public_read ... writes stay owner-scoped')." ], "gates": "Re-derived at 267ccece2d (node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack, --repo verified): the same 71 families as round 1, 4 paths, +955/-9. All 71 ran, with exit codes captured before any pipe: 69 exit 0, and 2 exit 3 = NOT MEASURED, PREREQUISITE NOT MET (pnpm check:dual-build-cjs-loads and pnpm check:i18n: the whole workspace's dist/ and the built CLI; CI runs both). --ran on the 'cmd :: exit N' record -> 'dispatch-gates --ran: 71 derived famil(ies) accounted for, 69 run, 2 NOT-MEASURED (2 DERIVED from a recorded exit 3)', exit 0. node scripts/pm/check-governed-merges.mjs --pr 35914 -> exit 0, NOT governed, 0 of 4 paths, 964 changed lines. PR check-runs on 267ccece2d, one read at report time: 53 total, 37 success, 16 skipped, 0 failed, 0 in progress. Not polled. The push hook check:commit-card-trailers passed ('2 commit message(s) ... carry no card relation and no model identifier').", "dogfood_battery": "n/a as declared (Clause-② yes (widening), no ! in the title). If the seat rules S1 option (b), the arm becomes (narrowing) and the full dogfood battery is owed at that head.", "clause_2": "Unchanged: Clause-②: yes (widening), Metadata-protocol: none, patch. S1 asks the seat whether a (narrowing) arm is owed (s1_options).", "governed_verdict": "NOT governed (check-governed-merges --pr 35914 at 267ccece2d, exit 0)", "mcp_calls": "0", "api_writes": "Round 2: 1 relay write, this report amendment via scripts/pm/post-stamped.mjs --comment=35802. git push x3 is not REST. Reads, not writes: gh api GET of comments 7047985230 and 7048114223, and check-runs. No PR body PATCH (the seat's).", "deviations": [ "PR body not edited: os-dev.md says a subagent writes it only at pr_create and the seat writes later versions. A complete round-2 body for the seat is at /tmp/claude-0/-home-user/cba0d951-fa67-548d-aa06-d20bae640045/scratchpad/issue-35802/pr-body-r2.md. The live body still reads '14 passed' and round 1's union wording.", "The rig moved from the default single tenancy posture to isolated (tenancy service in the test's service map), so Layer 0 is composed and the Layer 0 pin can go red. The 14 round-1 cases still pass unchanged on it. Share rows now carry organization_id (required under isolated).", "A1's on-disk marker grep had a quoting slip (it counted 'update,' and read 5). The landing proof is ablation-replace's own anchor count (1 -> 0) and blob move, which the tool asserts.", "The cost bench and the round-1 test copy were scratch files placed in the package's src for one run each and removed by trap. Nothing of them is committed, and git status was clean after every run.", "The L1's expected ablation result ('DAVE's predicate delete goes red, writing r2 and r3') did not occur, and the rows stayed. That is reported as observed (A1)." ], "open_questions": [ { "question": "S1: a newly matched row that fails a check-only policy (or, by reading, a validation rule, a hook or a readonlyWhen lock) now refuses or alters the whole predicate update, where it used to succeed on the creator's rows. Which outcome?", "options": [ "(a) leave failing rows out of dropIds after a pre-hook image check (RLS check only, inside the surface; silent skip)", "(b) keep all-or-nothing and declare the (narrowing) arm (the claim's Clause-② amended, BREAKING banner, dogfood battery)", "(c) per-row partial apply with a refused-rows report (objectql plus response shape, product decision)" ], "recommendation": "(b), see s1_recommendation." }, { "question": "Verdict-leg cost, restated with the member case: every matched readable row the floor does not admit costs one verdict, whether or not it can be written. A member matching 10,000 rows owned by others pays about 5.3 s and 20,004 store reads on SQLite for no extra row. A Modify All holder pays about 1.8 s and 10,003 reads to write 10,000 rows. A member over rows they created pays nothing. Under an authored using policy nothing is asked (S2).", "options": [ "A: keep it in this PR (bounded by the 10,000 cap, named in the changeset)", "B: P1 plus P2, an ISharingService bulk write-scope and verdict contract (spec), as a follow-up card", "C: P3, a Modify All short-cut inside the surface (couples to SharingService internals)", "D: P5, a lower cap with a refusal (narrowing)" ], "recommendation": "A now, plus B filed: answer-neutral and cuts every case; C and P4 couple to the implementation; D narrows." }, { "question": "Unchanged from round 1: on a controlled_by_parent detail, should the addressed predicate path set masterGateCoversThisWrite once assertControlledByParentWrite has passed every master?", "options": [ "A: yes (equals by id; reverses a recorded 'must not', so it needs a maintainer ruling)", "B: keep the floor", "C: refuse loudly" ], "recommendation": "A, as before; L2 reads it as coherent and the maintainer's word." } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: none · noted, not filed (unchanged; L2 says it should be filed, which is the seat's call). By-id authored-widener narrowing: an owner-creator under an authored update widener is refused 403 by id on a closed row she created and owns; the predicate path writes it. Now pinned on the predicate side ('the relief only ever adds rows'). Reach: engine door only, REST not measured. Dedupe words: floor drop narrows, authored widener, owner_only_writes OR, by-id 403 own row, dropPlatformOwnershipFloor", "carrier: none · noted. Docs drift on two pages (docs_drift); the by-id half predates this PR (#5492)." ] }Generated by Claude Code
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
Claim amendment 1 (claim 7046489990), per the seat's 19:58Z calls on PR #35914 round 2 (report 7049211796).
!title, and hand-off to the seat for the four pieces once L1 and the same-head L2 pass.content/docs/permissions/permissions-matrix.mdx(:53-56) andcontent/docs/permissions/sharing-rules.mdx(:66-67). Both say Modify All does not lift the owner-scoped write floor on an ordinary business object. That has been false by id since Row-level write gate consults neithermodifyAllRecordsnorsys_record_share.access_level— both declared write-widening mechanisms are inert #5492, and this PR makes it false by predicate too.controlled_by_parenthalf waits on the maintainer's card. The out-of-scope finding is 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.Clause-②: no (narrowing)
Metadata-protocol: none
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
os-dev-report
{ "issue": 35802, "status": "done", "round": "3 (seat ruling: S1 option (b), cost stays in this PR, docs fixed in this PR; claim amendment 7049287805)", "branch": "claude/issue-35802-predicate-write-floor-deferral", "pr": "https://github.com/objectstack-ai/objectstack/pull/35914", "head": "6ff08df403121d0fb9bdce9bc1422d9d3ebd836f", "title_text": "fix(plugin-security)!: a predicate write composes the platform ownership floor per row, as the by-id write does", "session": "session_01L9qibvVRcFWKrfWeG5jzPb", "premise_still_valid": true, "summary": "Round 3 on top of origin/main 138faaabac (merged in as 5bd87728b4; none of its 5 commits touches plugin-security). Plugin code is unchanged since round 2. (1) The narrowing is declared. The changeset now carries Clause-② no (narrowing) and Metadata-protocol none, a bang title line, and one ADR-0087 disposition: not-required, category no-migration-prescription; the gate accepts it as BREAKING+bang+clause-②-narrowing. It also has a BREAKING banner with the S1 FROM (success, r1 written) and TO (403 PERMISSION_DENIED, nothing written), and the fix for a caller: write those rows by id to get an outcome per row, or narrow the predicate to the rows that pass the check. The closing that began No action is needed is replaced. (2) The changeset names the measured cost: member all-deny at 1k (1,000 verdicts, 2,004 reads, about 1.1 s against 44 ms) and at 10k (20,004 reads, about 5.3 s against 47 ms); Modify All at 10k (10,003 reads, about 1.8 s, now writing the 10,000 rows); and 0 verdicts under an authored using policy. (3) permissions-matrix.mdx and sharing-rules.mdx now say: the floor is creator-only; the sharing allow replaces it per row, by id and by predicate alike, where sharing enforces writes; public_read_write and owner-less objects keep it; an authored policy is never replaced. (4) The dogfood battery is green at the new head. (5) Ablation A8 turns the S1 pin red. The S1 describe is renamed from pending the seat to the declared narrowing (a test name only).", "tests": "At 6ff08df403. plugin-security: pnpm typecheck && pnpm build under the lock, VERDICT command-exit 0 (check:test-typecheck OK 0 file(s) / 0 error(s); check-dts-emitted 2/2). Full suite: Test Files 285 passed (285), Tests 7095 passed | 45 skipped (7140), VERDICT command-exit 0. Ablation A8, via scripts/ablation-replace.mjs wrap mode: the step 3.6 line became floorReplaced ? true : satisfiesCheck(row). Anchor 1 -> 0, marker 1 on disk, blob 869cbad82cdf -> 2e088580e5c0. RED, 1 failed | 26 passed (27), the S1 pin alone: AssertionError: the predicate update is refused: expected null not to be null. Restore: blob after == HEAD 869cbad82cdf, and git diff HEAD is empty. Ran twice, at 8a25fbbbcd and at 6ff08df403, with the same result; the middleware blob is the same at both.", "gates": "Local, at 6ff08df403, every exit captured before any pipe. dispatch-gates --commands --repo objectstack-ai/objectstack derived 103 families: the round 2 set of 71 plus 32 docs families. First pass: 100 exit 0 and 3 exit 3. check:type-check-debt had queued behind the dogfood run on the lock; re-run whole under the lock, it exits 0 (0 ledger entries re-measured, 0 raw tsc errors). check:skill-examples lacked the client-react build; after the client-react closure build (VERDICT 0) it exits 0 (346 prose examples type-check across 3 surfaces). --ran reconciliation exits 0: 103 derived famil(ies) accounted for, 102 run, 1 NOT-MEASURED. NOT MEASURED: check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET, it needs the studio, embedder-openai and knowledge-memory dist, which this change does not touch; CI runs it. Declaration gates on the committed changeset: pnpm check:adr-0087-registration --base origin/main exits 0 (1 declared-breaking changeset(s), each carrying an ADR-0087 disposition, BREAKING+bang+clause-②-narrowing, not-required (no-migration-prescription)); node scripts/check-changeset-no-major.mjs exits 0 (no major bump). check-governed-merges --pr 35914: NOT governed, 0 of 6 paths, 998 changed lines. The first invocation used the wrong path, scripts/ instead of scripts/pm/; that was MODULE_NOT_FOUND, not a gate result, and it was re-run correctly. CI check-runs at 6ff08df403: 55, all completed, 40 success and 15 skipped, 0 failed. Successes include Test Core and shards 1-10/10, Lint & Repo Gates and its Lint jobs, Build Core, Build Docs, Check Documentation Links, Check Changeset, Dogfood Regression Gate, Spec property liveness, the Type Check jobs, PR-body guards and Live E2E UI. Check Changeset read the PR body as it now stands, which still declares the round 2 Clause-② line until r3 is applied, so it re-runs on the body edit.", "dogfood_battery": "6ff08df403 · os-verify-lock: VERDICT command-exit 0 (held 40m40s) · Test Files 482 passed | 3 skipped (485) · Tests 4098 passed | 68 skipped (4166) · no failures. Closure first built with pnpm --workspace-concurrency=2 --filter '@objectstack/dogfood^...' build, VERDICT command-exit 0. That was at merge head 5bd87728b4; the later commits touch only the changeset, docs and a test name, so no package code differs. Test command: pnpm --filter @objectstack/dogfood test, with no OS_TEST_SHARD and no path.", "changeset_text_note": "The exact text is in the final report. Here the ADR-0087 marker line is spelled out in square brackets, because the file carries it as an HTML comment and GitHub text carries none.", "changeset_text": "---\n'@objectstack/plugin-security': patch\n---\n\nfix(plugin-security)!: a predicate update or delete now writes the rows a Modify All holder, a non-creator owner or an edit-share target can write by id, instead of stopping at the platform's creator-only floor\n\nClause-②: no (narrowing)\nMetadata-protocol: none\n\n[ADR-0087 marker line: an HTML comment in the file, rendered as nothing in CHANGELOG, reading: adr-0087: not-required (no-migration-prescription) No key of any schema is added, removed, renamed or re-shaped, and no export changes shape. What moves is which rows one predicate update or delete by an organization member writes, and whether such an update is refused whole: no stored row, registry key or authored value changes, so there is nothing for a migration to rewrite and no tombstone.]\n\n**BREAKING** for a predicate update (`update(object, data, { where, multi: true })`) by an organization member, on an object where record sharing enforces writes, whose predicate matches a row the member did not create but may write by id (Modify All, ownership at the member's write depth, an `edit` share or the row's queue), when that row fails a row-level `check`, a validation rule or a hook. It ships `patch` because it is a non-protocol breaking change (AGENTS.md Post-Task Checklist step 3): no schema, key or stored value moves, so `Metadata-protocol` is `none`.\n\n- FROM: the update matched only the rows the member created. It answered success and wrote those, and the other row was never judged.\n- TO: that row is matched and judged too, and the update applies to all of its matched rows or to none. It is refused whole with `PERMISSION_DENIED` / 403 and writes nothing. A validation rule or hook that refuses that row refuses the whole update the same way, and a `readonlyWhen` lock on that row strips the field from the whole write. A write of that row by id is refused the same way, alone.\n\nThe fix for a caller: write those rows by id to get an outcome per row, or narrow the predicate to the rows that pass the check.\n\nA predicate write (`update(object, data, { where, multi: true })`, `delete(object, { where, multi: true })`) by an organization member held the platform's own ownership floor (`owner_only_writes` / `owner_only_deletes` in `member_default`, `created_by == current_user.id`) as an unconditional condition, where record sharing enforces writes. Unless an app-authored write policy admitted a row, the write matched only the rows that member had created, even when the same user could update or delete the other matching rows one at a time by id. This affected a manager holding `modifyAllRecords` on the object, a row's owner who did not create it, and, for an update, the target of an `edit`-level record share or a member of the queue a row sits in. The write answered success and changed fewer rows than its predicate matched. A write by id lets the record-sharing service's `allow` verdict replace the floor.\n\nThe predicate write now makes the by-id decision for each matched row the floor would refuse. Such a row is written when a write of that row by id would be, because the sharing service answers `allow` for it: ownership at the caller's write depth, Modify All, or, for an update only, an `edit` share or the row's queue. A row the service abstains on (an object with no `owner_id`, a public object) or denies keeps the floor. The row-level `check` on each updated row follows the same decision.\n\nThe by-id decision costs one sharing verdict, a few store reads, for each matched row the floor does not already admit. Measured on SQLite in memory:\n\n- A member's predicate update matching 1,000 readable rows owned by other people, every verdict `deny`: 1,000 verdicts and 2,004 store reads, about 1.1 s, against 44 ms and 3 reads before.\n- The same at 10,000 rows: 10,000 verdicts and 20,004 store reads, about 5.3 s, against 47 ms before.\n- A Modify All holder at 10,000 rows: 10,000 verdicts and 10,003 store reads, about 1.8 s, and it now writes the 10,000 rows. Before, it took 47 ms and wrote none of them.\n- Where an app-authored `using` policy for the write applies to the caller: 0 verdicts, because a row the floor refuses fails that policy too (10,000 matched rows the floor refuses, 45 ms).\n\nWhat does not change:\n\n- The rows a predicate write can reach are still only the rows its predicate matches that the caller can read. A predicate matching more than 10,000 of them is still refused before anything is written.\n- The sharing service's own bulk write scope still bounds a predicate write: the owner set at the caller's depth, plus the edit shares (at most 5,000 of them) and the queue on an update. A row that only a read share and an app `update` policy together make writable is still written by id alone.\n- An app-authored row-level policy still binds every row, and Modify All still does not bypass row-level security on an ordinary business object.\n- An `edit` share still widens update and never delete.\n- The tenant wall is unchanged.\n- A write made on another user's behalf keeps the floor for both principals, as its by-id write does.\n- A `controlled_by_parent` detail keeps the floor on a predicate write. Its by-id write is decided by the master gate instead, and that half is not changed here.\n\nA flow, script or server-side bulk update that relied on a predicate write skipping the rows its caller did not create now writes those rows too, when the caller may write them by id, and is refused whole when one of them fails a check. The fix is the one above.\n", "pr_body_draft": "/tmp/claude-0/-home-user/cba0d951-fa67-548d-aa06-d20bae640045/scratchpad/issue-35802/pr-body-r3.md (built from r2: the Clause-② line is now no (narrowing); the 速读 lines are updated, ending in one ask, the maintainer's arm on S1; What changes gains Docs and Changeset bullets; the S1, cost and verification readings are refreshed; not patched)", "mcp_calls": "0", "api_writes": "1 — POST /repos/objectstack-ai/objectstack/issues/35802/comments, this report via scripts/pm/post-stamped.mjs through the fleet-write relay. git push of 267ccece2d..6ff08df403 is not a REST write. Reads: GET pulls/35914, GET commits/6ff08df403/check-runs, GET pulls/35914/files (governed check).", "deviations": "(a) The ADR-0087 marker is an HTML comment, as the gate requires, and it lives only in the changeset file; GitHub text spells it out in words. (b) An extra test-only commit, 6ff08df403, renames the S1 describe so it no longer says the answer is pending. (c) The commit subject of 8a25fbbbcd carries a bang (docs(plugin-security)!:); both trailers are model-free. (d) The title and the PR body are not patched: the title text is above, and the body draft is at pr-body-r3.md.", "open_questions": [ { "question": "S1 arm: the maintainer confirms option (b), the update refused whole and declared as a narrowing, or switches to option (a), skip the failing row and write the rest. This is on the seat's decision card, and the PR stays a draft until it is answered.", "options": [ "(b) keep all-or-nothing, declared narrowing (this head)", "(a) skip the row that fails and write the rest (changes the engine's predicate update outcome; not implemented)" ], "recommendation": "(b), because it keeps a predicate write equal to its documented all-or-nothing contract and the by-id path stays the per-row tool" }, { "question": "The controlled_by_parent half of the card's repro (the predicate path does not set masterGateCoversThisWrite) still waits on the maintainer's card; hence Part of.", "options": [ "A: a separate card with the master gate's predicate decision", "B: extend this PR" ], "recommendation": "A, because RlsFilterOptions documents it as a separate decision" } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: #35917 (the by-id widener corner, filed by the seat in round 2) · noted, not refiled", "carrier: seat (the follow-up ISharingService bulk write scope and verdict contract card, per claim amendment 7049287805) · noted, not filed by dev" ] }Generated by Claude Code
objectstack-fleet commentedon Nov 20, 2026
repo:objectstack#7 · os-tesla · session_01L9qibvVRcFWKrfWeG5jzPb
os-dev-report
{ "issue": 35802, "status": "done", "round": "4 (prose only; L1 delta 7050824260 ACCEPT; L2 delta 7050850078 PASS with S4, S5, N7)", "branch": "claude/issue-35802-predicate-write-floor-deferral", "pr": "https://github.com/objectstack-ai/objectstack/pull/35914", "head": "35ef59a3ffc6334e0518078fb9b8c42da8c0c401", "session": "session_01L9qibvVRcFWKrfWeG5jzPb", "premise_still_valid": true, "summary": "No package source changed. Commits on 6ff08df403: a98bd1ee57 adds two pins, c5208e4597 is prose, 35ef59a3ff scopes the banner. S4: both docs pages, and the old sharing-rules sentence, now state the floor per OWD and verb, as read from the code. S5: the banner now covers a predicate delete, measured with two new pins: a beforeDelete hook refusing r2 refuses ALICE's and a Modify All holder's predicate delete whole (409, nothing deleted). By id, r1 is deleted and r2 refused 409. Ablation A9, with the relief off (origin/main's path), turns both pins red because the deletes answer success. N7: a validation or hook refusal now refuses the whole update too, with its own code. Folded in from the L2 notes: a predicate write keeps the floor beside an authored using policy; an on-behalf-of write keeps the floor; the queue basis answers allow under any OWD. That last one was measured with a scratch rig (not committed) on a controlled_by_parent detail. A queue row is written by a predicate update when the caller may edit the master, and the master gate still refuses a caller who may not, so the changeset's controlled_by_parent line now names that exception.", "code_reading_s4": "Under public_read_write, update: platformFloorYieldsToObjectWriteModel (security-plugin.ts:4522) returns true when owdOpensRowWrites and owdOpenWritesCoversOperation (platform-ownership-policies.ts:280-281, update only) both hold. computeLayeredRlsFilter then filters out the platform floor policy (security-plugin-rls-filter.ts:312), so there is no update floor. Under public_read_write, delete: owner_only_deletes stays, and SharingService.checkDelete abstains on the public model (plugin-sharing sharing-service.ts:1326), so the delete floor stays by id and by predicate. Owner-less object: checkEdit abstains when there is no owner field (:1244), checkDelete likewise (:1327), and there is no queue, because the queue column rides with owner_id (spec injected-system-columns.ts:246). So both floors stay. Queue basis: checkEdit asks sitsInCallersQueue before the public abstain (:1240-1243), so it answers allow under any OWD, a controlled_by_parent detail included. Measured on the detail: the queue row is written, and the master gate still runs on the predicate write.", "sentence_changes": [ { "file": ".changeset/35802-predicate-write-floor-deferral.md", "line": 10, "before": "[ADR-0087 marker reason, HTML comment in the file] No key of any schema is added, removed, renamed or re-shaped, and no export changes shape. What moves is which rows one predicate update or delete by an organization member writes, and whether such an update is refused whole: no stored row, registry key or authored value changes, so there is nothing for a migration to rewrite and no tombstone.", "after": "[ADR-0087 marker reason, HTML comment in the file] No key of any schema is added, removed, renamed or re-shaped, and no export changes shape. What moves is which rows one predicate update or delete by an organization member writes, and whether such a write is refused whole: no stored row, registry key or authored value changes, so there is nothing for a migration to rewrite and no tombstone." }, { "file": ".changeset/35802-predicate-write-floor-deferral.md", "line": 12, "before": "**BREAKING** for a predicate update (`update(object, data, { where, multi: true })`) by an organization member, on an object where record sharing enforces writes, whose predicate matches a row the member did not create but may write by id (Modify All, ownership at the member's write depth, an `edit` share or the row's queue), when that row fails a row-level `check`, a validation rule or a hook. It ships `patch` because it is a non-protocol breaking change (AGENTS.md Post-Task Checklist step 3): no schema, key or stored value moves, so `Metadata-protocol` is `none`.", "after": "**BREAKING** for a predicate update or delete (`update(object, data, { where, multi: true })`, `delete(object, { where, multi: true })`) by an organization member, whose predicate now matches a row the member did not create because the record-sharing service answers `allow` for a write of that row by id (ownership at the member's write depth or Modify All, and, for an update, an `edit` share or the row sitting in a queue the member belongs to), when that row is refused: on an update, by a row-level `check`, a validation rule or a hook; on a delete, by a `beforeDelete` hook or a `restrict` relation. It ships `patch` because it is a non-protocol breaking change (AGENTS.md Post-Task Checklist step 3): no schema, key or stored value moves, so `Metadata-protocol` is `none`." }, { "file": ".changeset/35802-predicate-write-floor-deferral.md", "line": 14, "before": "- FROM: the update matched only the rows the member created. It answered success and wrote those, and the other row was never judged.\n- TO: that row is matched and judged too, and the update applies to all of its matched rows or to none. It is refused whole with `PERMISSION_DENIED` / 403 and writes nothing. A validation rule or hook that refuses that row refuses the whole update the same way, and a `readonlyWhen` lock on that row strips the field from the whole write. A write of that row by id is refused the same way, alone.", "after": "- FROM: the write matched only the rows the member created. It answered success and changed those, and the other row was never judged.\n- TO: that row is matched and judged too, and the write applies to all of its matched rows or to none. An update whose new image of that row fails a row-level `check` is refused whole with `PERMISSION_DENIED` / 403 and writes nothing. A validation rule or hook that refuses that row refuses the whole update too, with its own code, and a `readonlyWhen` lock on that row strips the field from the whole write. A delete is refused whole, and deletes nothing, when a `beforeDelete` hook or a `restrict` relation refuses that row, with that hook's or relation's own refusal. A write of that row by id is refused too, alone." }, { "file": ".changeset/35802-predicate-write-floor-deferral.md", "line": 17, "before": "The fix for a caller: write those rows by id to get an outcome per row, or narrow the predicate to the rows that pass the check.", "after": "The fix for a caller: write those rows by id to get an outcome per row, or narrow the predicate to the rows that are not refused." }, { "file": ".changeset/35802-predicate-write-floor-deferral.md", "line": 21, "before": "The predicate write now makes the by-id decision for each matched row the floor would refuse. Such a row is written when a write of that row by id would be, because the sharing service answers `allow` for it: ownership at the caller's write depth, Modify All, or, for an update only, an `edit` share or the row's queue. A row the service abstains on (an object with no `owner_id`, a public object) or denies keeps the floor. The row-level `check` on each updated row follows the same decision.", "after": "The predicate write now makes the by-id decision for each matched row the floor would refuse. Such a row is written when a write of that row by id would be, because the sharing service answers `allow` for it: ownership at the caller's write depth, Modify All, or, for an update only, an `edit` share or the row's queue. A row the service abstains on keeps the floor: on an object with no `owner_id`, on a delete under `public_read_write` (an update there has no floor to keep, because that OWD opens row updates), and on a `controlled_by_parent` detail unless an update's row sits in a queue the caller belongs to. A row it denies keeps the floor too. The row-level `check` on each updated row follows the same decision." }, { "file": ".changeset/35802-predicate-write-floor-deferral.md", "line": 38, "before": "- A `controlled_by_parent` detail keeps the floor on a predicate write. Its by-id write is decided by the master gate instead, and that half is not changed here.", "after": "- A `controlled_by_parent` detail keeps the floor on a predicate write, except on an update of a row that sits in a queue the caller belongs to, which the sharing service answers `allow` for under any OWD. The master gate still judges the predicate write. Its by-id write is decided by the master gate instead of the floor, and that half is not changed here." }, { "file": ".changeset/35802-predicate-write-floor-deferral.md", "line": 40, "before": "A flow, script or server-side bulk update that relied on a predicate write skipping the rows its caller did not create now writes those rows too, when the caller may write them by id, and is refused whole when one of them fails a check. The fix is the one above.", "after": "A flow, script or server-side bulk update or delete that relied on a predicate write skipping the rows its caller did not create now changes those rows too, when the caller may write them by id, and is refused whole when one of them is refused. The fix is the one above." }, { "file": "content/docs/permissions/permissions-matrix.mdx", "line": "52-65", "before": "On an ordinary tenant business object, authored RLS still applies, and so does `member_default`'s creator-only write floor (`created_by == current_user.id`) for `org_member` holders, except where record sharing enforces writes (an object with an `owner_id` whose OWD is `private` or `public_read`): there the sharing service's `allow` for a row (ownership at the caller's write depth, `modifyAllRecords`, or, for an update, an `edit` share or the row's queue) replaces the floor for that row, on a by-id write and on a predicate write alike. Under `public_read_write`, or on an object with no `owner_id`, the floor stays, and an app-authored policy is never replaced. The Layer 0 tenant wall always ANDs on top.", "after": "On an ordinary tenant business object, authored RLS still applies, and so does `member_default`'s creator-only write floor (`created_by == current_user.id`) for `org_member` holders. Under `public_read_write` the update floor does not apply (that OWD opens row updates) and the delete floor does; on an object with no `owner_id` both apply. Where record sharing enforces writes (an object with an `owner_id` whose OWD is `private` or `public_read`), the sharing service's `allow` for a row replaces the floor for that row: ownership at the caller's write depth or `modifyAllRecords`, and, for an update, an `edit` share. On an update, a row sitting in a queue the caller belongs to gets the same `allow` under any OWD. A by-id write takes that replacement, and so does a predicate write unless an app-authored `using` policy for the write applies to the caller (then it keeps the floor beside that policy). A write made on another user's behalf keeps the floor. A `controlled_by_parent` detail's by-id write is judged by its master gate instead of the floor. An app-authored policy is never replaced. The Layer 0 tenant wall always ANDs on top." }, { "file": "content/docs/permissions/sharing-rules.mdx", "line": "59-65", "before": "The platform baseline `member_default` ships owner-scoped `update`/`delete` policies (`created_by == current_user.id`, applicability domain `org_member`), so rank-and-file members stay owner-scoped on writes even under `public_read_write`.", "after": "The platform baseline `member_default` ships creator-only `update`/`delete` policies (`created_by == current_user.id`, applicability domain `org_member`). Under `public_read_write` the update policy does not apply (that OWD opens row updates) and the delete policy does; under every other OWD both apply, and record sharing can replace them row by row, as below. A `controlled_by_parent` detail's by-id write is judged by its master gate instead." }, { "file": "content/docs/permissions/sharing-rules.mdx", "line": "72-82", "before": "Where record sharing enforces writes (an `owner_id` and a `private` or `public_read` OWD), the sharing service's `allow` for a row (ownership at the caller's write depth, `modifyAllRecords`, or, for an update, an `edit` share or the row's queue) replaces the baseline floor for that row, by id and by predicate alike. Under `public_read_write`, or on an object with no `owner_id`, the sharing service abstains and the floor stays. An app-authored policy is never replaced.", "after": "Where record sharing enforces writes (an `owner_id` and a `private` or `public_read` OWD), the sharing service's `allow` for a row replaces the baseline floor for that row: ownership at the caller's write depth or `modifyAllRecords`, and, for an update, an `edit` share. On an update, a row sitting in a queue the caller belongs to gets the same `allow` under any OWD. A by-id write takes that replacement, and so does a predicate write unless an app-authored `using` policy for the write applies to the caller (then it keeps the floor beside that policy). A write made on another user's behalf keeps the floor. Under `public_read_write` the sharing service abstains on a delete, so the delete floor stays; on an object with no `owner_id` it abstains on both, so both floors stay. An app-authored policy is never replaced." } ], "title_text": "fix(plugin-security)!: a predicate write composes the platform ownership floor per row, as the by-id write does (already applied by the seat; unchanged)", "tests": "plugin-security at c5208e4597, under the lock: pnpm typecheck, then the full suite, VERDICT command-exit 0. check:test-typecheck OK, 0 file(s) / 0 error(s). Test Files 285 passed (285), Tests 7097 passed | 45 skipped (7142); round 3 had 7095, and the difference is the two new pins. New file alone at a98bd1ee57: Tests 29 passed (29). Ablation A9, via scripts/ablation-replace.mjs wrap mode at a98bd1ee57, run with -t S5: the guard became if (rlsFilter && layered.layer1 && !delegatorSets && false). Anchor 1 -> 0, marker 1 on disk, blob 869cbad82cdf -> 7a00ce83b134. RED, 2 failed | 27 skipped: AssertionError: the predicate delete is refused: expected null not to be null, for both cases. Restore: blob == HEAD 869cbad82cdf, and git diff HEAD is empty. Scratch measurement (zz-scratch-cbp-queue-35802.test.ts, deleted, never committed), on a controlled_by_parent detail with a queue service stub. A caller without master edit: by id refused 403, and by predicate refused 403 (requires edit access to its master record). A caller who may edit the master: by id admitted; by predicate the q_ops row is written and the q_other row is not, with verdicts t2_q:allow and t2_o:abstain.", "gates": "Fresh worktree at c5208e4597. dispatch-gates --commands --repo objectstack-ai/objectstack derived 103 families, the same set as round 3. All ran, each exit captured before any pipe. First pass: 99 exit 0, 3 exit 3 and 1 exit 1. check:skill-examples (exit 3, no client-react dist) re-ran after the client-react closure build (VERDICT 0) and exits 0: 346 prose examples type-check. check:i18n (exit 3, CLI not built) re-ran after the cli closure build (VERDICT 0) and exits 0: check-i18n-bundles OK. check:query-options-erasure (exit 1) was ENOENT on packages/client-react/.examples-build/client-react__context__1.tsx, a temp file my concurrent skill-examples run wrote and removed while ESLint listed it; re-run alone it exits 0 (ratchet holds, none new). check:type-check-debt exits 0 (re-measure OK). --ran reconciliation exits 0: 103 accounted for, 102 run, 1 NOT-MEASURED. NOT MEASURED: check:dual-build-cjs-loads, reason: exit 3 PREREQUISITE NOT MET (the dist of untouched packages); CI runs it. At the final head 35ef59a3ff, a banner-only change, all 17 derived families that read a changeset re-ran and exit 0: check-adr-0087-registration --base origin/main (BREAKING+bang+clause-②-narrowing, not-required (no-migration-prescription)) and its self-test; check-changeset-no-major --base origin/main (no major bump); check-empty-changeset and its self-test; check-issue-citations; snapshot-next, governed-queue-guard, release-rehearsal-clone and release-pending-publish self-tests; check:changeset-gate-self-tests; check:closed-ceremony-text; check:driver-memory-census; check:issue-citations; check:keyed-text-bounds; check:nul-bytes; check:published-files. check-governed-merges --pr 35914: NOT governed, 1,081 changed lines. CI check-runs at c5208e4597: 55, all completed, 40 success and 15 skipped, 0 failed. CI at 35ef59a3ff was not read: it was in progress at report time.", "dogfood_battery": "Not re-run this round. The reading stands at 6ff08df403: VERDICT command-exit 0, Test Files 482 passed | 3 skipped (485), Tests 4098 passed | 68 skipped (4166). Since then no package source has changed (only a test file in plugin-security, the changeset and two docs pages), and origin/main was deliberately not merged, so the battery's code is the final head's code.", "pr_body_draft": "/tmp/claude-0/-home-user/cba0d951-fa67-548d-aa06-d20bae640045/scratchpad/issue-35802/pr-body-r4.md (not patched). Built from the live body, so the seat's Skills-docs line is kept verbatim. Changes: the 速读 lines 3 and 4 now name delete; the Docs and Changeset bullets; an S5 acceptance note; the controlled_by_parent queue measurement; 29 cases; and the round 4 suite, A9 and gate readings. The seat's trailing refresh note still says round 3, head 6ff08df4, for the seat to update.", "skills_docs_note": "The seat's Skills-docs line (verdict none) still holds with delete in scope. skills/objectstack-data/references/data-hooks.md:37 and :173 already teach that beforeDelete dispatches once per matched row on a multi:true delete, and no skill teaches the creator-only skip. Optionally, the seat could cite those two lines too.", "mcp_calls": "0", "api_writes": "1 — POST /repos/objectstack-ai/objectstack/issues/35802/comments, this report via scripts/pm/post-stamped.mjs through the fleet-write relay. Two git pushes, 6ff08df403..c5208e4597 and c5208e4597..35ef59a3ff, are not REST writes. Reads: GET issues/comments/7050850078, GET pulls/35914 (twice), GET check-runs at c5208e4597, GET pulls/35914/files (governed check).", "deviations": "(a) The coordinator said prose only. I added two test pins, which the coordinator's S5 item invited, and no source change. (b) origin/main, 4 commits ahead, was not merged, to keep the round 3 dogfood battery valid for the final head. (c) The controlled_by_parent queue reading came from a scratch rig that was deleted and never committed. (d) A third commit, 35ef59a3ff, narrows the banner's scope sentence. It was found while writing the report: the round 4 banner said 'on an object where record sharing enforces writes', which left out the queue basis on a controlled_by_parent detail. (e) The ADR-0087 marker change is spelled in words in GitHub text.", "open_questions": [ { "question": "S1/S5 arm: the maintainer confirms option (b), a predicate update or delete refused whole and declared as a narrowing, or switches to (a), skip the refused row. This is on the seat's decision card, and the PR stays a draft.", "options": [ "(b) all-or-nothing, declared (this head)", "(a) skip the refused row (engine outcome change; not implemented)" ], "recommendation": "(b), because the engine already runs a predicate update and a predicate delete as one unit, and the by-id path is the per-row tool" }, { "question": "The controlled_by_parent half of the card's repro still waits on the maintainer's card; hence Part of.", "options": [ "A: a separate card", "B: extend this PR" ], "recommendation": "A, because RlsFilterOptions documents it as a separate decision" } ], "security_findings": "none", "out_of_scope_findings": [ "carrier: #35917 (the by-id widener corner) · noted, not refiled", "carrier: seat (the follow-up ISharingService bulk write scope and verdict contract card) · noted, not filed by dev" ] }Generated by Claude Code
3 remaining items
objectstack-fleet commentedon Nov 22, 2026
coordinator#1 · os-project-manager · session_01FEkQ5p5uRcoqrJTKdjhTWj
Ruling: A · maintainer 「A 批量与逐条一致」 · 2026-11-22T02:38Z
维护者速读
Decision record
Maintainer Leehom answered the decision card by tap at 2026-11-22T02:37Z. The card's question, as he read it: 「裁定按条件批量改删主从明细时,是否与逐条修改一致」. The option he chose, label and consequence as shown: 「A 批量与逐条一致」 — 「有权编辑主记录的人批量改删明细时,改到逐条能改的全部行;其中一行被规则拦下就整次拒绝。升级后现有流程会多改到别人创建的行。一个PR。」
This rules the half of this card that PR #35914 left open (its body says Part of): the
controlled_by_parentdetail, which is the card's own repro object.What is ruled
controlled_by_parentdetail, an addressed predicate update or delete (multi: true) by a non-delegated caller no longer keeps the platform ownership floor (owner_only_writes/owner_only_deletes,created_by == current_user.id) once the master gate has passed every master the write reaches. The rows it writes are the rows a by-id write of each would write for the same caller.writeRequiresMasterRead); a null-master row is judged by the owner rule; an app-authored row-level policy binds every row; the 10,000 readable-row cap refuses above it.ownerMayEditis unchanged: its owner leg is a by-id update only (ruling 6398566164), so a predicate update still asks edit on the master.check, a validation rule, a hook or arestrictrelation refuses the whole write. The change is therefore declared on the narrowing arm, as fix(plugin-security)!: a predicate write composes the platform ownership floor per row, as the by-id write does #35914 was.This supersedes the "must not … a separate decision" bullet in the
RlsFilterOptions.masterGateCoversThisWritedocblock (packages/plugins/plugin-security/src/security-plugin.ts) and the sentence "A predicate update or delete keeps the floor, as before" in ADR-0055's 2026-11-14 amendment. It applies the earlier ruling's own condition ("the floor comes off only where the master gate demonstrably covers the same operation") to the predicate path, which the master gate has judged since #25012.Premises the ruling hangs on (the dev checks them before writing code; if one fails, report the fork here and stop)
controlled_by_parentdetail the master's owner predicate-updates 2 of 4 rows (the two they created) where by id all 4 are written; a Modify All manager, 0 against 4. The dev pins these onmainfirst.origin/main48c732c, not measured:masterGateCoversThisWriteis set at three places only (step 2.7 by id, the chain walk's master-edit leg,security/explain), never on the predicate path;assertControlledByParentWritejudges every master of the rows a predicate write selects and refuses on the first the caller may not write under, before the Layer 1 filter is composed.Not taken
Effort (from the analysis table): server lane · 1 PR · precedent PR #35914 (+1064/−17, 6 files, the same files); seat 7's estimate was about half a day plus pins; no new reads and no per-row verdict cost.
Governing text: the #8757 ruling quoted in
packages/plugins/plugin-security/src/platform-ownership-policies.ts(commit 6feac91); ADR-0055 §3 with its 2026-10-26, 2026-11-07 and 2026-11-14 amendments; the pin[#8757] §3 RESIDUALincontrolled-by-parent-detail-write-authority.test.ts, whose comment still says the master gate returns early on a bulk write. Protocol: no spec change, Metadata-protocol none expected.os-decision-facets: ① A removes the one case where the same caller and row get different answers by id and by predicate, and deletes a documented exception; B keeps it permanently; C adds a refusal shape on top of it · ② an outside builder hit it on 18.6.0 building approval-gated objects; flow bulk nodes and server scripts take this path · ③ today the write answers success with fewer rows changed; under A it writes them all or refuses whole and says why; C is loud but refuses a legitimate write · ④ A adds no key, switch or contract and reuses the master gate; B keeps exception text as a standing obligation; C adds a refusal contract
Prior rulings read:
masterGateCoversThisWrite|owner_only_writes|predicate.*floor|bulk writein docs/adr/0055 and packages/plugins/plugin-security/src → ADR-0055 §3 and amendments (rulings 6398566164, 6880588685), commit 6feac91, PR #35914; thread: 8 comments on this card, no maintainer ruling before this oneAfter the ruling (seat repo:objectstack#4 claims from the inbox with
Ruling-ref:this comment)main, then check P2 and P3.writeRequiresMasterRead; a detail declaringownerMayEdit(unchanged); null-master rows (owner rule); a delegated write (floors kept). Flip the§3 RESIDUALpin and correct its comment.RlsFilterOptionsdocblock;content/docs/permissions/permissions-matrix.mdxandsharing-rules.mdx; a changeset on the narrowing arm with a BREAKING banner that leads with "an existing flow now changes or deletes detail rows its caller did not create", the ADR-0087 disposition and the fix for a caller; the dogfood battery.Analysis:
/mnt/project-files/pm-orders/objectstack/seat4/35802-decision-analysis.md(project files).objectstack-fleet commentedon Nov 22, 2026
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D
Claim: PM loop round 1
Ruling-ref: 7073030861 (maintainer 「A 批量与逐条一致」, 2026-11-22T02:37Z)
Session:
session_01FEkQ5kt9AD1TPLy7Y9oa9DAccount:
os-project-managerBranch:
claude/issue-35802-predicate-write-floor-cbpWorktree:
objectstack-issue-35802Domain:
domain:serverSeat:
repo:objectstack#4Area: a4-E (second dev, released by the seat 2026-11-22T02:40Z)
File surface:
packages/plugins/plugin-security/src/{security-plugin-authz-middleware.ts, security-plugin.ts, security-plugin-sharing-verdicts.ts, security-plugin-cbp-write-gate.ts}and their tests (controlled-by-parent-detail-write-authority.test.ts,predicate-write-floor-deferral.test.ts),docs/adr/0055-master-detail-controlled-by-parent.md(one amendment),content/docs/permissions/{permissions-matrix,sharing-rules}.mdx, one new changeset (stop on breach; explain in the report)Container & model:
M,mode:subagent,model: fable — MANDATORY from dispatch-gates --tier: docs/adr/** carries no one-line exit (the ruling owes an ADR-0055 amendment in this PR),effort: highClause-②: no (narrowing) — the ruling's item 5: a predicate write applies to all of its matched rows or to none, as PR #35914 declared
Metadata-protocol: none
Responsibility: platform code (
@objectstack/plugin-security, this repo) applies the ownership floor on the predicate path | none: the by-id path already writes these rows, the predicate path silently does not | reached by flow bulk nodes and server scripts on anycontrolled_by_parentdetail (reported from an app on 18.6.0)Thread-read: 7073030861
Premise: holds as read in the ruling (P2, P3 read at 48c732c); P1 is pinned on main by the dev before any code, and a failed premise is reported as a fork on this card
Serial constraints cleared: PR #35914 (same files) merged 2026-11-21T03:34Z.
overlap-check.mjson a probe edit of the seven files above against origin/main 48c732c: VERDICT clean, no open PR shares themPre-claim lane: plugin-security is
domain:server;docs/adr/**is governed (Tier H) ⇒ the seat runs the contract review and the four pieces and the maintainer lands. Security-touching: no private detail is used or written.Pre-claim deps: no
Blocked-by:; the ruling is on the card.Prior rulings read: the ruling record's own list (ADR-0055 §3 and its 2026-10-26, 2026-11-07, 2026-11-14 amendments; rulings 6398566164, 6880588685; commit 6feac91; PR #35914) and the decision analysis in project files. No conflict.
objectstack-fleet commentedon Nov 22, 2026
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D
os-dev-report
{ "issue": 35802, "status": "done", "branch": "claude/issue-35802-predicate-write-floor-cbp", "pr": "https://github.com/objectstack-ai/objectstack/pull/36282", "head": "2ba103da71349d3ac7f3bac97a6ad6fec8687375", "session": "session_01FEkQ5kt9AD1TPLy7Y9oa9D", "premise_still_valid": true, "summary": "Ruling 7073030861 items 1-6 built in one draft PR (Fixes 35802). P1 pinned on origin/main a5a5312ff4 before any code (16 of the new cases red on the unchanged source): the master's owner predicate-wrote r1 r3 against all 4 by id; the Modify All manager and a member with an edit share on the master, none against all 4; a master reader on a writeRequiresMasterRead detail, 2 against 4; the owner of null-master rows, 1 against 2. P2 held as read. P3 did not hold as it stood (the gate's row read and the write's readable scope were two reads of one question) and is closed by the route the ruling itself names: one id list. Code: judgeControlledByParentWrite records, at the end of a predicate pass that refused nothing, the ids of the rows whose master reference it read (WeakMap keyed by the operation, security-plugin-cbp-write-gate.ts); the middleware takes that record straight after the caller's own pass at step 2.8 for a non-delegated addressed predicate write, composes step 3's Layer 1 and step 3.6's per-row check with masterGateCoversThisWrite, scopes the write to the gate's rows in place of the second read, and skips the sharing relief there. No gate verdict moves; delegated, nested and referential writes and shapes the gate does not judge keep the floor. Text: one ADR-0055 amendment dated 2026-11-22 (status line, a pointer under the superseded sentence, the section; older amendments not rewritten), the RlsFilterOptions docblock bullet, three permissions docs, one new changeset on the narrowing arm.", "tests": "Head 2ba103da71. plugin-security typecheck + build + full suite under the verify lock: Test Files 287 passed (287), Tests 7238 passed | 45 skipped (7283), VERDICT command-exit 0. predicate-write-floor-deferral.test.ts alone: Tests 75 passed (75), 24 new under a new top-level describe on the file's own real-engine rig (SecurityPlugin + ObjectQL + SqlDriver better-sqlite3 + SharingService): each of master owner, edit-share member who created no row, Modify All manager, a member who may not edit one master (refused whole 403 PERMISSION_DENIED, nothing written; by id the 3 rows under the editable master), a master reader (refused whole), writeRequiresMasterRead (reader writes all 4), ownerMayEdit (master owner all 4; row owner who only reads the master refused whole, by id 2 on update and 0 on delete), null-master rows (owner 2, manager 4), delegated (only the agent's own rows), x predicate update and delete, each compared row for row with by-id writes on a second copy; plus all-or-none (a beforeDelete hook refusing a newly matched row refuses the whole delete, 409) and a row inserted after the gate's read is not written. The [8757] section 3 RESIDUAL pin flipped and its comment corrected (no floor in the composed predicate where the gate admitted the write, refused whole across an uneditable master, floor kept on a write the gate does not judge). Two suites that pinned the superseded outcome for a member's selecting write updated (controlled-by-parent-every-master-edit, controlled-by-parent-write-shape-master-edit; delegated case kept on the floor). First full-suite run before that update: 4 failed, exactly those cases (expected value 2, received 3). Ablations, fix committed first, scripts/ablation-replace.mjs wrap mode (anchor 1 -> 0, blob changed, restore blob == HEAD 0f41242093e1 and git diff HEAD empty on every leg), tests import source (no dist hop), over the four files: (1) vouch set to null: 22 failed | 107 passed, VERDICT command-exit 1; (2) delegated exclusion removed: 2 failed | 127 passed (the delegated update and delete); (3) the gate's row list replaced by a second read: 1 failed | 128 passed (the late row was written); (4) per-row check left on the floor: 13 failed | 116 passed (predicate updates refused whole, deletes green as expected). Not run locally: test:repo (CI-owned, the diff touches none of its tests).", "gates": "Derived: node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 2ba103da71, 14 paths vs merge base a5a5312ff4, 107 families, each run once after the last commit, exit captured before any pipe. dispatch-gates --ran: '107 derived famil(ies) accounted for — 104 run, 3 NOT-MEASURED (3 DERIVED from a recorded exit 3)', exit 0. 104 exit 0; two of them on a second run (pnpm check:dts-closure first exit 1 naming packages not yet built in this worktree, pnpm check:i18n first exit 3; both exit 0 after the dogfood closure build). NOT MEASURED: check:skill-examples, reason: PREREQUISITE NOT MET, reads dist of client packages outside the closures built here. NOT MEASURED: check:dual-build-cjs-loads, reason: PREREQUISITE NOT MET, some package has no dist. NOT MEASURED: check:type-check-debt, reason: its closure build got queue-timeout (exit 99) on the shared verify lock twice. check-platform-checklist --changed-from origin/main: 'OK — 2 anchored file(s) in the change set, 6 anchor(s) judged, 0 lost', exit 0. check-nul-bytes exit 0. overlap-check at 2ba103da71: VERDICT clean exit 0, 0 PR heads share a file. check-governed-merges --pr 36282: GOVERNED, landing tier H (docs/adr/** x1); its exit was 3 only because the low-risk arm's catalog read needs a commit not in this checkout. PR check-runs on 2ba103da71, one read at report time, not polled: 25 total; 5 skipped (18.x upgrade harness, Borrowed queue verdict, Packed-tarball smoke, Queue verdict, Schedule gate); 20 in_progress (Check Changeset, Check Documentation Links, Check PR Size, Flag docs affected by code changes, Governed Surface Queue Guard, Lint CI release and engine gates, Lint ESLint, Lint PM dispatch-gates, Lint docs and code guards, Lint repo and tooling gates, Lint scoped query-options erasure, Lint scoped slot lookup and corpus, Lint scoped tooling self-tests, PR-body guards, Spec property liveness, Type Check consumer gates / debt ledger / source gates / workspace, filter).", "dogfood_battery": "2ba103da71 · os-verify-lock: VERDICT command-exit 0 (held the lock 2148s) · Test Files 484 passed | 3 skipped (487) · Tests 4107 passed | 68 skipped (4175) · no failure. Closure first: pnpm --filter '@objectstack/dogfood^...' build, VERDICT command-exit 0. No OS_TEST_SHARD, no path.", "line_budget": "+573 / -57 = 630 changed lines over 14 files (at most 3000). skills/** untouched, so no skill line ratchet applies.", "files_changed": [ ".changeset/35802-cbp-predicate-write-master-gate.md", "content/docs/permissions/permissions-matrix.mdx", "content/docs/permissions/rls.mdx", "content/docs/permissions/sharing-rules.mdx", "docs/adr/0055-master-detail-controlled-by-parent.md", "packages/plugins/plugin-security/src/controlled-by-parent-detail-write-authority.test.ts", "packages/plugins/plugin-security/src/controlled-by-parent-every-master-edit.test.ts", "packages/plugins/plugin-security/src/controlled-by-parent-write-shape-master-edit.test.ts", "packages/plugins/plugin-security/src/platform-ownership-policies.ts", "packages/plugins/plugin-security/src/predicate-write-floor-deferral.test.ts", "packages/plugins/plugin-security/src/security-plugin-authz-middleware.ts", "packages/plugins/plugin-security/src/security-plugin-cbp-write-gate.ts", "packages/plugins/plugin-security/src/security-plugin-rls-filter.ts", "packages/plugins/plugin-security/src/security-plugin.ts" ], "clause_2": "Clause-②: no (narrowing) and Metadata-protocol: none, both in the PR body and the new changeset (patch, @objectstack/plugin-security; BREAKING banner leading with the flow sentence; ADR-0087 marker not-required (no-migration-prescription)). The diff adds no key, accepted value, export or response member. Skills-docs: follow-up owed — skills/objectstack-data/rules/relationships.md.", "governed_verdict": "GOVERNED, Tier H (docs/adr/0055). Draft, no reviewers, no ready flip, no auto-merge. Assignee os-project-manager, carried by pr_create.", "mcp_calls": "0", "api_writes": "2 relay dispatches. (1) pr_create via scripts/pm/fleet-write/dispatch.mjs: POST /repos/objectstack-ai/objectstack/dispatches -> relay run 44985872461: POST pulls (draft 36282) + POST issues/36282/assignees (os-project-manager); read-back 12496 bytes sent = stored, body re-read to its last line. (2) this report via scripts/pm/post-stamped.mjs --comment=35802. git push is not a REST write. Reads were GETs through gh api (issue, comments, pull, check-runs).", "deviations": [ "File surface. The dispatch says to stop on anything outside the listed surface; os-dev.md says a published statement this change makes false is fixed in the same PR and allows a bounded in-place fix. Conflict reported, not chosen silently; os-dev.md was followed. Four files outside the claim's list, each named in the PR body: security-plugin-rls-filter.ts (one comment that said the bulk path does not and must not vouch; comment only), content/docs/permissions/rls.mdx (one sentence saying a predicate write on a detail keeps the floor), and two test files that pinned the superseded outcome (controlled-by-parent-every-master-edit.test.ts, controlled-by-parent-write-shape-master-edit.test.ts). overlap-check: no open PR shares any of the 14 files. platform-ownership-policies.ts (in surface, 'only if needed') carries one corrected docblock paragraph.", "P3 was closed in the PR instead of reported as a fork, because the ruling names the route taken (reuse one id list). The pin and ablation 3 show the row is written without it.", "The harness attribution reminder asks for a model-named Co-Authored-By trailer and a session URL after the PR footer. Not used: the dispatch requires the model-free trailer (Claude-Session + Co-Authored-By: Claude) and a body ending on the Generated-with line. The PR body's first line is the attribution comment the dispatch orders verbatim.", "origin/main moved during the run (ui/ and docs commits only, no file shared with this diff); not merged, base stays a5a5312ff4.", "The gate sweep, the final suite and the dogfood battery ran detached (nohup) and were read from their logs in the same turn; no process or monitor remains. One wait loop was stopped by the harness at its background limit; the run it watched completed and was read.", "Not pinned: the skip of the sharing relief on a vouched write (on these fixtures the relief answers nothing either way). Stated in the PR's acceptance notes." ], "open_questions": [], "security_findings": "none", "out_of_scope_findings": [ "class: b · reach: exception: release-text · skills/objectstack-data/rules/relationships.md line 89 says the ownership floor still binds a predicate update or delete on a writeRequiresMasterRead detail; false once this PR lands. Seam: spec:sharing.controlledByParent.writeRequiresMasterRead → runtime:security-plugin-authz-middleware.ts step 3. Carried by the PR's Skills-docs line (follow-up owed). Dedupe words: relationships.md ownership floor predicate, writeRequiresMasterRead skill text, rows you created still binds, controlled_by_parent skill predicate", "class: b · reach: exception: release-text · the unreleased changeset .changeset/35802-predicate-write-floor-deferral.md (the sharing half) says a controlled_by_parent detail keeps the floor on a predicate write; it ships in the same CHANGELOG as this PR's note, which names that bullet as no longer holding. Not edited here (editing an existing changeset is a DELIBERATE CORRECTION the dispatch did not order). Dedupe words: changeset 35802 deferral controlled_by_parent keeps the floor, changelog contradiction predicate write", "carrier: none · noted, not filed: on a vouched write with a select-derived Layer 1 the sharing relief would have asked verdicts for rows the floor no longer refuses; the new guard skips it, unpinned." ] }objectstack-fleet commentedon Nov 22, 2026
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D
os-dev-report
Rework round 1, answering REWORK 7074592987. New head
cdb290f78314feb5018be3cd1151a972bc3e93bb. The section below is for the PR body; the seat writes it there.DELIBERATE CORRECTION
One pending release note is corrected, release text only:
.changeset/35802-predicate-write-floor-deferral.md(the sharing half, unreleased). It ships in the same@objectstack/plugin-securityCHANGELOG entry as this PR's note and said the opposite of it in two sentences.check-empty-changesetis red on it, as it should be; noskip-changeset.owner_id, on a delete underpublic_read_write(an update there has no floor to keep, because that OWD opens row updates), and on acontrolled_by_parentdetail unless an update's row sits in a queue the caller belongs to. A row it denies keeps the floor too."owner_id, and on a delete underpublic_read_write(an update there has no floor to keep, because that OWD opens row updates). A row it denies keeps the floor too."controlled_by_parentdetail keeps the floor on a predicate write, except on an update of a row that sits in a queue the caller belongs to, which the sharing service answersallowfor under any OWD. The master gate still judges the predicate write. Its by-id write is decided by the master gate instead of the floor, and that half is not changed here."controlled_by_parentdetail is not decided by this composition. Its predicate write, like its by-id write, is decided by its master gate instead of the floor: see the note "a predicate update or delete of acontrolled_by_parentdetail now writes every row its caller may write by id"."This PR's own note (
.changeset/35802-cbp-predicate-write-master-gate.md) drops "whose bullet … no longer holds" for a plain cross-reference: "This is thecontrolled_by_parenthalf of the predicate-write change shipped beside it: see the note "a predicate update or delete now writes the rows a Modify All holder, a non-creator owner or an edit-share target can write by id" for every other object."{ "issue": 35802, "status": "done", "branch": "claude/issue-35802-predicate-write-floor-cbp", "pr": "https://github.com/objectstack-ai/objectstack/pull/36282", "head": "cdb290f78314feb5018be3cd1151a972bc3e93bb", "session": "session_01FEkQ5kt9AD1TPLy7Y9oa9D", "premise_still_valid": true, "summary": "Rework round 1 (L1-b REWORK 7074592987, release text only). One commit on top of 2ba103da71: the two sentences of .changeset/35802-predicate-write-floor-deferral.md that said a controlled_by_parent detail keeps the floor on a predicate write now point at this PR's note (paragraph 4 drops the controlled_by_parent arm; the last 'What does not change' bullet says the detail's predicate write is decided by its master gate and names the note), and this PR's own note carries a plain cross-reference in place of 'whose bullet … no longer holds'. Nothing else changed: 2 files, +3 / -3, no code, test, ADR or docs byte moved.", "tests": "No code or test byte changed since 2ba103da71, so the suite readings of that head stand (plugin-security 287 files / 7238 passed | 45 skipped; four ablations) and nothing was re-run.", "gates": "At cdb290f783, exit captured before any pipe. The derived families that read .changeset/** or scan changed text, run once each: check-adr-0087-registration --base origin/main exit 0 and --self-test exit 0; check-changeset-no-major --base origin/main exit 0; check-empty-changeset --self-test exit 0; check:changeset-gate-self-tests exit 0; check-issue-citations exit 0; check:issue-citations exit 0; check:doc-authoring exit 0; check:nul-bytes exit 0; check:org-identifier exit 0; check:role-word exit 0. check-empty-changeset --base origin/main: exit 1, EXPECTED and left red: '.changeset/35802-predicate-write-floor-deferral.md exists on the merge base and was not added by this PR' (the DELIBERATE CORRECTION class; no skip-changeset). Declared narrowing: the other derived families read code, tests, the ADR or docs, all byte-identical to 2ba103da71, and were not re-run; CI runs the farm. PR check-runs on cdb290f783, one read, not polled: in_progress (just pushed). PR head on GitHub = cdb290f783, draft.", "dogfood_battery": "Not re-run: no code change since 2ba103da71, whose reading stands (Test Files 484 passed | 3 skipped (487), Tests 4107 passed | 68 skipped (4175), VERDICT command-exit 0). The new head differs only in two .changeset files.", "line_budget": "This round +3 / -3 over 2 files; PR total about +574 / -58 over 15 files (at most 3000).", "files_changed": [ ".changeset/35802-cbp-predicate-write-master-gate.md", ".changeset/35802-predicate-write-floor-deferral.md" ], "mcp_calls": "0", "api_writes": "1 this round: the os-dev-report comment on the card via scripts/pm/post-stamped.mjs --comment=35802 (relay). git push is not a REST write. No PR body write, no label write.", "deviations": [ "The PR body's DELIBERATE CORRECTION section is NOT written by this run: os-dev.md says a subagent writes the PR body only at pr_create and never PATCHes it (the seat writes it), while the rework asks for the body to gain the section. Conflict reported, not chosen silently; os-dev.md was followed. The section is given whole, ready to paste, in deliberate_correction_section of this report and in the report comment on the card.", "main not merged: the PR reported no conflict.", "The worktree was recreated from the pushed branch for this round and removed again after the push." ], "open_questions": [], "security_findings": "none", "out_of_scope_findings": [] }objectstack-fleet commentedon Nov 22, 2026
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D
os-dev-report
Prose-only round answering the seat's contract review at
cdb290f(S1). New head4fe236dbd1652989eb591cd8ba2befce20e7261c. One file,.changeset/35802-cbp-predicate-write-master-gate.md, +3 / -2. No code, test, ADR or docs byte moved; the earlier corrected note and the PR body are untouched.Sentences changed:
updateordeletepolicy the app authored on the detail."updateordeletepolicy with ausingon acontrolled_by_parentdetail, a predicate write used to compose the platform floor beside that policy as one more OR term, so it also wrote the rows the caller created that the policy does not admit. The floor is no longer a term of that write, so the authored policy alone bounds it: those rows are left unwritten and the write answers success for the rows the policy admits. A by-id write of such a row was already refused, so the two now agree. A write made on another user's behalf keeps the floor and is not changed."{ "issue": 35802, "status": "done", "branch": "claude/issue-35802-predicate-write-floor-cbp", "pr": "https://github.com/objectstack-ai/objectstack/pull/36282", "head": "4fe236dbd1652989eb591cd8ba2befce20e7261c", "session": "session_01FEkQ5kt9AD1TPLy7Y9oa9D", "premise_still_valid": true, "tests": "Not re-run: no code or test byte changed since 2ba103da71.", "gates": "At 4fe236dbd1: check-adr-0087-registration --base origin/main 0 and --self-test 0; check-changeset-no-major 0; check-empty-changeset --self-test 0; check:changeset-gate-self-tests 0; check-issue-citations 0; check:issue-citations 0; check:doc-authoring 0; check:nul-bytes 0; check:org-identifier 0; check:role-word 0. check-empty-changeset --base origin/main exit 1, expected and left red (the DELIBERATE CORRECTION of round 1).", "dogfood_battery": "Not re-run: no code change since 2ba103da71, whose reading stands.", "pr_size": "15 files changed, 576 insertions(+), 59 deletions(-)", "security_findings": "none", "out_of_scope_findings": [] }objectstack-fleet commentedon Nov 22, 2026
repo:objectstack#4 · os-project-manager · session_01FEkQ5kt9AD1TPLy7Y9oa9D
Delivered: PR #36282 merged as
ed33f8aedc(Fixes #35802), building ruling 7073030861 「A 批量与逐条一致」.controlled_by_parentdetail, a non-delegated predicate update or delete now writes the rows a by-id write of each would, once the master gate has passed every master it reaches. A matched row that is refused refuses the whole write. Delegated writes keep both floors.pm:dispatchedremoved.fix(plugin-security): a sharing allow keeps the ownership floor besid…
fix(plugin-security)!: a predicate update or delete of a controlled_b…