Repository navigation
fix(plugin-security)!: an elevation's write is judged as it will be stored, and its option bag never widens it past its caller's organization wall - #38268
Conversation
…rganization to the caller's wall Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…ts option bag never widens it past the caller's wall Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…n-bag halves of the elevation's organization wall Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…y its declared keys Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
📓 Docs Drift CheckThis PR changes 2 package(s): 22 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 7 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 32 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): Which tree this was computed onThis run read A worktree cut from an older # while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 4e26bca7a7a37b3bfe005b7b3ccb8574f60ffad5 && git checkout 4e26bca7a7a37b3bfe005b7b3ccb8574f60ffad5
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 7e1b2229635ea2a2719d9cecafb2427d0b30edd6 a1e5b48cc688e4d15aaea7d9e68bc6f20f7dda2d && git checkout -B drift-repro 7e1b2229635ea2a2719d9cecafb2427d0b30edd6 && git merge --no-ff a1e5b48cc688e4d15aaea7d9e68bc6f20f7dda2d
node scripts/docs-audit/affected-docs.mjs --json 7e1b2229635ea2a2719d9cecafb2427d0b30edd6
|
|
security#2 · sunhaolin · session_017xRBcSSsTBYe1u4FyH5PGf {
"issue": null,
"status": "done",
"branch": "claude/sec2-wf9p-f12",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38268",
"session": "session_017xRBcSSsTBYe1u4FyH5PGf",
"premise_still_valid": true,
"summary": "An app-authored elevation is now held to its caller's organization wall on the row as it will be stored (a judging-only post-hook image seam, chained onto any seam already installed) and on the tenant scope its option bag asks for: a write whose bag names an organization outside the wall or clears tenantId is refused 403, a read's bag is bounded by the wall composed onto its predicate, and a tenant key a before-hook sets on the bag is held as it is set. One module changed (app-automation-organization-wall.ts) plus its module pins, 14 real-stack pins in the organizations writes harness, register row 1c and a patch changeset with the BREAKING banner. No first-party body or hook needs the old behaviour (platform stamps write only the caller's own organization), so no fork.",
"tests": "Real-stack (organizations, elevated-organization-wall.writes.wall.test.ts): base e42520c6 with the first 12 probes = 'Tests 9 failed | 14 passed (23)' (every rule case red, every control green); head = 'Tests 25 passed (25)'. Module pins (plugin-security app-automation-organization-wall.test.ts): 'Tests 59 passed (59)'. Full suites: plugin-security 'Test Files 290 passed (290) · Tests 7342 passed | 45 skipped'; organizations 'Test Files 23 passed (23) · Tests 329 passed (329)', re-run on merged head dbfa1eda, same. Typecheck plugin-security and organizations exit 0 (the organizations pin file is covered by check:test-typecheck, not by plain tsc). Ablation via ablation-replace + ablation-dist-preflight (marker proven in dist each leg): stored-image guard -> 3 red; door bag guard -> 3 red (two reads, delete); hook-set bag hold -> 2 red; stored-image + door bag together -> 9 red; door bag + hook-set together -> 5 red; restore leg: blob == HEAD, tree clean, all three markers absent from dist, back to 25/25.",
"gates": "Local: node scripts/pm/dispatch-gates.mjs --commands on dbfa1eda = 98 families; --ran with exit codes: 98 accounted, 94 exit 0, 4 exit 3 at first pass. Re-measured: pnpm check:type-check-debt exit 0 (it first starved on the verify lock my dogfood run held), pnpm --filter @objectstack/spec run check:skill-examples exit 0 after building client-react. NOT MEASURED (exit 3, prerequisite): node scripts/check-plugin-teardown-shape.mjs --self-test (shallow clone cannot reach its pinned fixture commit), pnpm check:dual-build-cjs-loads (studio/client-react/scenarios dist absent); CI carries both. PR check-runs at dbfa1eda: Lint & Repo Gates success, TypeScript Type Check success, Test Core success (10/10 shards success), Build Core success, Governed Surface Queue Guard success, Test UI success, Live E2E UI success, Dogfood Regression Gate success, Check Changeset success, Lint UI / Type Check UI / Build & E2E UI skipped (path filter).",
"dogfood_battery": "dbfa1eda · os-verify-lock VERDICT batch-last-exit 0 (parts: closure build 'Tasks 76 successful, 76 total', organizations suite ORG_EXIT=0, then pnpm --filter @objectstack/dogfood test) · Test Files 491 passed | 3 skipped (494) · Tests 4148 passed | 68 skipped (4216) · no failures",
"mcp_calls": "1 — mcp__github__pull_request_read (get_check_runs); no GitHub MCP write tool",
"api_writes": "2 — relay pr_create (POST pulls, draft forced, #38268, body read back byte-identical); this report comment via post-stamped.mjs. Plus 1 relay read stroke pair (advisory_read, two pages), not a write.",
"deviations": "The relay's revealed advisory read was printed to stdout as ordered, but its 37.7KB size made the harness persist the tool output to its own tool-results file; I read it from there once and deleted the file at once. The changeset is named for the designated branch slug as the order asks.",
"open_questions": [
{ "question": "Where no verdict is worked out for an operation, a tenant key a before-hook sets on the bag is judged against the caller's active organization alone, narrower than a group member's union. Keep, or work the verdict out eagerly for every elevated bag verb?", "options": ["A keep narrower (no added cost for the common elevated read)", "B compute the caller's verdict for every elevated find/update/delete so the hold uses the full union"], "recommendation": "A, because it is never wider than the plain door and the reach is an app hook deliberately writing a tenant key" },
{ "question": "Skills-docs follow-up: one sentence beside skills/objectstack-query/SKILL.md's pass-through paragraph saying an elevated body's tenantId/tenantIds is bounded by its caller's wall.", "options": ["A seat files the follow-up card", "B fold into the next domain:skills PR"], "recommendation": "A" }
],
"security_findings": "withheld",
"out_of_scope_findings": [],
"owed": "Contract-tier L2 of PR #38268 by the security seat (not knocked by me)."
} |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract-review-claim: session_017xRBcW9L8Noz9BxEwjwiov · head dbfa1ed · 2026-11-28T12:58Z The full round at |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier:
M1 (must-fix) — one write verb is not yet under the option-bag rule. The direction is on the private record. VERDICT: FAIL |
…n bag on an elevated insert, read and write to the caller's wall Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…acement only Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…judged where the engine builds it, after every before-hook Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…d hook-left halves of the option-bag rule Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
|
security#2 · sunhaolin · session_017xRBcSSsTBYe1u4FyH5PGf {
"issue": null,
"status": "done",
"round": "rework after the L2 FAIL at dbfa1eda (M1, M2, S1, S2)",
"branch": "claude/sec2-wf9p-f12",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38268",
"head": "34dacefd",
"session": "session_017xRBcSSsTBYe1u4FyH5PGf",
"premise_still_valid": true,
"summary": "The option bag's tenant keys are now judged where the engine builds the driver's options, after every before-hook. OperationContext gains driverTenantScopeCheck, and buildDriverOptions applies it at every driver bag an operation builds: find, findOne, the by-id prior-row read, update, the delete pre-image and write reads, and the insert landing. The security plugin installs it for an app-authored elevation with a caller on find/findOne/insert/update/delete/purge. A write's bag past the caller's wall is refused 403. A read's is narrowed to the wall. A denied caller's delete keeps the read rule. This closes M1 (an insert landing from a hook-left bag) and M2 (a read bag a hook replaced). The property hold is removed, so S1 has nothing left to redefine. S2: the module docblock, register row 1c and the changeset now state the insert and hook-left halves, plus the narrower reading the seat ruled on question A. The PR-body delta is below for the seat to apply.",
"tests": "Real-stack writes harness: 4 new cases, plus 1 control. At 32a45920+ (fix not yet in) 'Tests 3 failed | 26 passed (29)', every new rule case red: an insert landing from a sandboxed hook-returned bag and from an in-process replaced bag, a read from a replaced bag, a write with a redefined tenant key. At head 'Tests 29 passed (29)'. Engine pin (objectql engine-driver-options.test.ts): a bag replaced by every before-hook reaches the driver as the check answers, on find, findOne, insert, update, updateMany and deleteMany; control: with no check, the replaced key arrives. 'Tests 10 passed (10)'. Module pins (plugin-security): 'Tests 62 passed (62)'. Full suites at head: plugin-security 'Test Files 290 passed (290) · Tests 7345 passed | 45 skipped'; organizations 'Test Files 23 passed (23) · Tests 333 passed (333)'; objectql 'Test Files 642 passed (642) · Tests 14537 passed (14537)'. Typecheck exit 0 for objectql, plugin-security and organizations. Ablation, marker proven in dist each leg: the wall's installation of the check removed -> 5 red; the engine's application of it removed -> 5 red. Each time the red cases are the three new rule cases plus the two hook-set cases from round 1. Restore leg: blob == HEAD, tree clean, markers absent from dist (objectql 14 files, plugin-security 6).",
"gates": "dispatch-gates --commands on 34dacefd: 109 families. --ran with exit codes: 108 exit 0, 1 NOT MEASURED (exit 3: check-plugin-teardown-shape --self-test; the shallow clone cannot reach its pinned fixture). PR check-runs at 34dacefd: Lint & Repo Gates, TypeScript Type Check, Test Core (12/12 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate and Check Changeset all succeeded. Lint UI, Type Check UI and Build & E2E UI were skipped by the path filter.",
"dogfood_battery": "34dacefd · os-verify-lock VERDICT command-exit 0 (closure build 'Tasks 79 successful, 79 total' && pnpm --filter @objectstack/dogfood test) · Test Files 493 passed | 3 skipped (496) · Tests 4174 passed | 68 skipped (4242) · no failures",
"pr_body_delta_for_the_seat": [
"What changes, bullet 2, becomes: A write (`insert`, `update`, `delete`, `purge`) whose option bag names an organization outside the caller's wall, or clears `tenantId`, is refused `403 PERMISSION_DENIED`.",
"What changes, bullet 4, becomes: The option bag a before-hook leaves (a key it sets, a bag it replaces or hands back) is judged by the same rule where the engine builds the driver's options (`OperationContext.driverTenantScopeCheck`): a write's is refused `403`, a read's is narrowed to the organizations the wall admits. Where no verdict is worked out for the operation, that bag is judged against the caller's active organization alone, which is narrower than a `group` member's union and never wider.",
"Files: add `packages/objectql/src/engine-top-level.ts`, `engine-driver-options.ts`, `engine.ts`, `engine-find.ts`, `engine-insert.ts`, `engine-update.ts`, `engine-delete-and-aggregate.ts` and the objectql pin `engine-driver-options.test.ts`. The changeset now also bumps `@objectstack/objectql` (patch).",
"Tests/ablation: replace the hook-set hold reading with: the wall's installation of the dispatch check, ablated -> 5 red; the engine's application of it, ablated -> 5 red. Real-stack file 29 passed (29)."
],
"mcp_calls": "2 total this session, both mcp__github__pull_request_read (get_check_runs). No GitHub MCP write tool.",
"api_writes": "3 total this session: pr_create, the round-1 report comment, and this report comment. Plus 2 advisory_read strokes, which are reads.",
"deviations": "The second advisory read was piped through a filter that printed only the notes after the merge note, to stdout. Nothing was saved to a file.",
"open_questions": [],
"security_findings": "withheld",
"out_of_scope_findings": [],
"owed": "A fresh contract-tier L2 by the security seat on head 34dacefd. The seat applies the PR-body delta."
} |
… an elevated read, update and delete to the caller's wall Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…d update or delete never reaches another organization's rows Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…ated predicate delete to the caller's wall Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
|
security#2 · sunhaolin · session_017xRBcSSsTBYe1u4FyH5PGf {
"issue": null,
"status": "done",
"round": "rework after the L2 FAIL at dbfa1eda (M1, M2, S1, S2), completed against the seat's fix order",
"branch": "claude/sec2-wf9p-f12",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38268",
"head": "054893b0",
"session": "session_017xRBcSSsTBYe1u4FyH5PGf",
"premise_still_valid": true,
"summary": "Supersedes the report at 34dacefd; the code is unchanged since then. The option bag's tenant keys are judged where the engine builds the driver's options, after every before-hook. OperationContext.driverTenantScopeCheck is installed by the security plugin for an app-authored elevation that has a caller (find, findOne, insert, update, delete, purge). buildDriverOptions applies it at every driver bag the operation builds. A write's bag that reaches past the caller's wall is refused 403, a read's is narrowed to the wall, and a denied caller's delete keeps the read rule. The property hold is gone, so S1 has nothing left to redefine. Added since 34dacefd, as the order asks: real-stack pins driven through a sandboxed app hook's returned options for a read, a predicate update and a predicate delete, and the define-style channel on a predicate delete.",
"tests": "Real-stack writes harness, 33 cases. On dbfa1eda sources (plugin-security and objectql src restored from dbfa1eda, rebuilt, then restored to HEAD): 'Tests 6 failed | 27 passed (33)'. Red: an insert from a sandboxed hook-returned bag and from an in-process replaced bag; a read from an in-process replaced bag; a read from a sandboxed hook-returned bag; a write with a redefined key; and the sandboxed predicate update and delete, under their first 403 wording. On base the sandboxed update and delete touched only the caller's own row, so those two are now outcome pins: the other organization's row is never reached, and a 403 asserts PERMISSION_DENIED. At head: 'Tests 33 passed (33)'. objectql pin engine-driver-options.test.ts: 'Tests 10 passed (10)'. plugin-security module pins: 'Tests 62 passed (62)'. Suites: organizations at 054893b0 'Test Files 23 passed (23) · Tests 337 passed (337)'. objectql 'Test Files 642 passed (642) · Tests 14537 passed (14537)' and plugin-security 'Test Files 290 passed (290) · Tests 7345 passed | 45 skipped' are from 34dacefd; their sources are unchanged since. Typecheck exit 0 for objectql, plugin-security and organizations. Ablation on 054893b0, marker proven in dist each leg: removing the wall's installation of the check gives 6 red, and removing the engine's application of it gives 6 red. The 6 are the two round-1 hook-set cases, the hook-bag insert, the replaced read, the sandboxed read and the redefined write. Restore leg: blob == HEAD, tree clean, markers absent from dist (objectql 14 files, plugin-security 6).",
"gates": "dispatch-gates --commands on 054893b0 derived 109 families. --ran with exit codes: 108 exit 0, 1 NOT MEASURED (exit 3: check-plugin-teardown-shape --self-test, because the shallow clone cannot reach its pinned fixture). check:type-check-debt first starved on the lock my own dogfood run held; re-run, exit 0. PR check-runs at 054893b0: Lint & Repo Gates, TypeScript Type Check, Test Core (12/12 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate and Check Changeset all succeeded. Lint UI, Type Check UI and Build & E2E UI were skipped by the path filter. Intermediate heads e59ce7e0 and 99c2476a showed red CI and are superseded; 34dacefd and 054893b0 are green.",
"dogfood_battery": "054893b0 · os-verify-lock VERDICT command-exit 0 (closure build 'Tasks 79 successful, 79 total' && pnpm --filter @objectstack/dogfood test) · Test Files 493 passed | 3 skipped (496) · Tests 4174 passed | 68 skipped (4242) · no failures. A worker restart killed the first attempt; this is the rerun.",
"pr_body_delta_for_the_seat": "As in the 34dacefd report (comment 7241326186), plus one Tests line: 33 real-stack cases, sandboxed read, update and delete channels included.",
"mcp_calls": "4 total this session, all mcp__github__pull_request_read (get_check_runs x3, get_status x1). No GitHub MCP write tool.",
"api_writes": "4 total this session: pr_create and three os-dev-report comments, each read back identical. Plus 2 advisory_read strokes, which are reads.",
"open_questions": [],
"security_findings": "withheld",
"out_of_scope_findings": [],
"owed": "A fresh contract-tier L2 by the security seat on head 054893b0. The seat applies the PR-body delta."
} |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract-review-claim: session_017xRBcW9L8Noz9BxEwjwiov · head 054893b · 2026-11-28T20:11Z A fresh full round at |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier:
The open findings of 7239990075 are closed:
New findings at this head:
VERDICT: FAIL |
…hat the bag asks beyond the engine's own projection Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
… the plain-door equivalence; the base-green sandboxed write pins read as controls Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…on bag as such Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
|
security#2 · sunhaolin · session_017xRBcSSsTBYe1u4FyH5PGf {
"issue": null,
"status": "done",
"round": "fix round after the CONTRACT_REVIEW_TIER FAIL at 054893b0 (M3, S2, S3, nits)",
"branch": "claude/sec2-wf9p-f12",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38268",
"head": "b87b3cdd",
"session": "session_017xRBcSSsTBYe1u4FyH5PGf",
"premise_still_valid": true,
"summary": "M3: the driver tenant-scope check now judges only what an option bag asks beyond the scope the engine itself projects for that call. Keys inside the engine's own projection (what mergeDriverOptionsIntoHookView fills into the hooks' view, read back by the in-transaction delete rebuilds) are not judged. A key outside it, or a cleared key, still is. S3: the changeset drops the plain-door equivalence, and its 'Not moved' sentence now states the group reach: an operation naming no tenant key keeps the union, and a bag a hook leaves is narrower for a group member. Nits: the new interface no longer orphans the image-check docblock, and the two base-green sandboxed write pins are labelled as controls. S2 (PR-body counts) is the seat's; the numbers are below.",
"tests": "objectql unit pin (engine-driver-options.test.ts) under group, with a check that refuses everything: a bag-less by-id delete and predicate delete reach the driver and the check is never asked. Ablating the projection skip turns it red ('1 failed | 11 passed (12)'); restored it is green ('12 passed (12)'). A control shows a bag naming an organization beyond the projection is still judged. Real-stack group pins (postures harness), for a member of A and B with A active: by-id delete and by-id purge of an A row and of a B row, and a predicate delete on a cascade-referenced parent with its child, all 200; a C row answers 404 RECORD_NOT_FOUND. They pass on 054893b0 too, because in this harness's boot the engine merged no tenant keys on these deletes (instrumented: the check was installed and never asked), so they are reach controls; the unit pin carries the red. Real-stack files at head: postures + writes 'Tests 47 passed (47)'. Suites at head: organizations 'Test Files 23 passed (23) · Tests 341 passed (341)'; objectql 'Test Files 642 passed (642) · Tests 14539 passed (14539)'. Typecheck exit 0 for objectql and organizations; plugin-security source is unchanged since 054893b0.",
"s2_counts_for_the_pr_body": "Base (dbfa1eda sources) writes file: 'Tests 6 failed | 27 passed (33)' on the order's pin set; the reviewer's own count on its tree was 4 | 29. Head writes file: 33 cases; postures + writes 47. Module pins (plugin-security): 62. objectql engine pin: 12. objectql suite at head: 642 files / 14539 tests. organizations: 341. plugin-security: 290 files / 7345 tests (sources unchanged since 34dacefd).",
"gates": "dispatch-gates --commands on 7ee86034 derived 109 families, all exit 0 by --ran reconciliation ('109 run, 0 NOT-MEASURED'). check:query-options-erasure first exited 1 (one new test-surface site, a cast in my objectql control). Fixed on b87b3cdd with the sanctioned off-type spelling; the gate holds, test surface 236 at the ceiling. PR check-runs at b87b3cdd: Lint & Repo Gates, TypeScript Type Check, Test Core (12/12 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate, Check Changeset and Lint · scoped · query-options erasure all succeeded. Lint UI, Type Check UI and Build & E2E UI were skipped by the path filter.",
"dogfood_battery": "b87b3cdd · os-verify-lock VERDICT command-exit 0 (closure build 'Tasks 79 successful, 79 total' && pnpm --filter @objectstack/dogfood test) · Test Files 493 passed | 3 skipped (496) · Tests 4174 passed | 68 skipped (4242) · no failures",
"mcp_calls": "5 total this session, all mcp__github__pull_request_read. No GitHub MCP write tool.",
"api_writes": "5 total this session: pr_create and four os-dev-report comments, each read back identical. Plus 3 advisory_read strokes, which are reads.",
"open_questions": [],
"security_findings": "withheld",
"out_of_scope_findings": [],
"owed": "A fresh contract-tier L2 by the security seat on head b87b3cdd. The seat applies the PR-body counts."
} |
…driver tenant-scope check unasked Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
|
security#2 · sunhaolin · session_017xRBcSSsTBYe1u4FyH5PGf {
"issue": null,
"status": "done",
"round": "second rework order after the CONTRACT_REVIEW_TIER FAIL at 054893b0 (M3, S2, S3, nits), completed",
"branch": "claude/sec2-wf9p-f12",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38268",
"head": "122619b9",
"session": "session_017xRBcSSsTBYe1u4FyH5PGf",
"premise_still_valid": true,
"summary": "Supersedes the b87b3cdd report. M3: buildDriverOptions judges an option bag's tenant keys only where they ask beyond the scope the engine itself projects for that call (asksBeyondProjectedScope). The engine-filled hooks' view that the in-transaction delete rebuilds read back is therefore not judged. A key outside the projection, or a cleared key, still is. S3: the changeset drops the plain-door equivalence, and its 'Not moved' sentence states the group reach. Nits: DriverTenantScopeCheck sits above the image-check docblock; the two base-green sandboxed write pins are labelled controls; the module docblock says the common write pays no verdict (not 'nothing'). Measured: every verb under group with no tenant key.",
"group_every_verb_measurement": "objectql unit, group posture, member of A and B with A active, a recording check, no tenant key named. At head no verb asks the check (find, findOne, insert, count, by-id and predicate update, by-id and predicate delete): '{}'. With the projection skip ablated only delete asks, once; that is the by-id delete's rebuild from the engine-filled hooks' view. The every-verb pin (a check that refuses everything) is green at head and red with the skip ablated.",
"s2_counts_for_the_pr_body_at_122619b9": "Real-stack writes file on dbfa1eda sources: 'Tests 4 failed | 29 passed (33)'. Postures on base: 'Tests 14 passed (14)'. Head: writes 33/33, postures 14/14 (47 together). Module pins (plugin-security app-automation-organization-wall.test.ts): 62. objectql engine-driver-options pin: 13. Suites at 122619b9: objectql 'Test Files 642 passed (642) · Tests 14540 passed (14540)'; plugin-security 'Test Files 290 passed (290) · Tests 7345 passed | 45 skipped (7390)'; organizations 'Test Files 23 passed (23) · Tests 341 passed (341)'. The reviewer's 643 / 14542 for objectql was on its own tree. Two-minute check: the writes file reads 33 passed (33).",
"tests": "M3 red-then-green is carried by the objectql unit pins: a bag-less delete under group with a refusing check, and every verb under group with no tenant key. Both go red with the projection skip ablated ('2 failed | 11 passed (13)') and green restored ('13 passed (13)'); restore proven, blob == HEAD. The real-stack group pins (by-id delete and by-id purge of A and B rows, a predicate delete on a cascade-referenced parent with its child, all 200; a C row 404) are reach controls. In this harness the engine merged no tenant keys on those deletes, measured with instrumentation, so they pass on base too. Typecheck exit 0 for objectql and plugin-security. Module pins 62/62; real-stack 47/47.",
"gates": "dispatch-gates --commands on 122619b9 derived 109 families; --ran reconciliation: 109 run, 0 NOT MEASURED, all exit 0. check:type-check-debt first starved on my own verify-lock hold; re-run, exit 0. PR check-runs at 122619b9: Lint & Repo Gates, TypeScript Type Check, Test Core (12/12 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate, Check Changeset and the query-options erasure lint all succeeded. Lint UI, Type Check UI and Build & E2E UI were skipped by the path filter.",
"dogfood_battery": "122619b9 · os-verify-lock VERDICT command-exit 0 (organizations, plugin-security and objectql suites && closure build 'Tasks 79 successful, 79 total' && pnpm --filter @objectstack/dogfood test) · Test Files 493 passed | 3 skipped (496) · Tests 4174 passed | 68 skipped (4242) · no failures",
"pr_body": "Not patched by me. The seat applies the S2 counts above and the delta in comment 7241326186, with 'exactly as the caller's plain door is' dropped from the rule sentence.",
"mcp_calls": "8 total this session, all mcp__github__pull_request_read. No GitHub MCP write tool.",
"api_writes": "6 total this session: pr_create and five os-dev-report comments, each read back identical. Plus 3 advisory_read strokes, which are reads.",
"open_questions": [],
"security_findings": "withheld",
"out_of_scope_findings": [],
"owed": "A fresh contract-tier L2 by the security seat on head 122619b9. The seat applies the PR-body counts and delta."
} |
|
security#2 · sunhaolin · session_017xRBcW9L8Noz9BxEwjwiov Contract reviewServed-tier:
Prior findings:
Open: S2 (should-fix) — two earlier-round readings remain in the PR body's collapsed blocks. Correct them, and state that the VERDICT: FAIL |
…he engine's own projection passes; pin the in-union case Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
|
security#2 · sunhaolin · session_017xRBcSSsTBYe1u4FyH5PGf {
"issue": null,
"status": "done",
"round": "delta fix after the CONTRACT_REVIEW_TIER FAIL at 122619b9 (S4, S2)",
"branch": "claude/sec2-wf9p-f12",
"pr": "https://github.com/objectstack-ai/objectstack/pull/38268",
"head": "dab31e1d",
"session": "session_017xRBcSSsTBYe1u4FyH5PGf",
"premise_still_valid": true,
"summary": "S4: the changeset, register row 1c, the module docblock and the install comment now state the rule as built. A bag naming only organizations inside the scope the engine itself projects for the caller (its active organization, or under group its memberships) is not judged further. Where no verdict is worked out for the operation, a bag beyond that scope is judged against the caller's active organization. The in-union case is pinned at both layers. No code in plugin-security or objectql src changed this round (comment/docblock text and tests only).",
"tests": "In-union pins: objectql, a hook-left bag naming the caller's memberships (tenantId org_b, or tenantIds [A, B]) reaches the driver as left under group and the check is never asked. Real-stack postures: a member of A and B, active in A; a before-hook leaves tenantIds [B] on the read and it reads exactly ['B1']; the control with [C] reads no C1. With the projection skip ablated (marker proven in dist), the objectql file reads '3 failed | 11 passed (14)' and the real-stack postures file '8 failed | 7 passed (15)'. Red: the group by-id delete and purge pins for A and B, the cascade predicate delete, the in-union read, and the four union-counting flow pins. Restored: blob == HEAD, tree clean, marker absent from dist. Correction to my earlier reports: the real-stack group pins DO go red without the skip; my 054893b0 instrumented reading that they never reached the check was wrong. At head: module pins 62/62; real-stack postures + writes 48/48; objectql engine pin 14/14. Suites at dab31e1d: organizations 'Test Files 23 passed (23) · Tests 342 passed (342)'; plugin-security 'Test Files 290 passed (290) · Tests 7345 passed | 45 skipped (7390)'; objectql 'Test Files 642 passed (642) · Tests 14541 passed (14541)'. Typecheck exit 0 for objectql, plugin-security and organizations.",
"s2_counts_for_the_pr_body_at_dab31e1d": "Real-stack on dbfa1eda sources: writes 'Tests 4 failed | 29 passed (33)', postures 14/14. The group pins are red on the prior sources (the projection skip ablated: postures '8 failed | 7 passed (15)', objectql '3 failed | 11 passed (14)'). Head: writes 33/33, postures 15/15 (48 together). Module pins 62. objectql engine pin 14. Suites as in 'tests'. Replace the two earlier-round readings in the collapsed blocks: 'Head: 25 passed (25)' becomes 33/33 writes + 15/15 postures; 'Module pins 59' becomes 62.",
"gates": "dispatch-gates --commands on dab31e1d derived 109 families; --ran reconciliation: 109 run, 0 NOT MEASURED, all exit 0. check:type-check-debt first starved on my own verify-lock hold; re-run, exit 0. PR check-runs at dab31e1d: Lint & Repo Gates, TypeScript Type Check, Test Core (12/12 shards), Build Core, Governed Surface Queue Guard, Test UI, Live E2E UI, Dogfood Regression Gate, Check Changeset and the query-options erasure lint all succeeded. Lint UI, Type Check UI and Build & E2E UI were skipped by the path filter.",
"dogfood_battery": "dab31e1d · os-verify-lock VERDICT command-exit 0 (organizations, plugin-security and objectql suites && closure build 'Tasks 79 successful, 79 total' && pnpm --filter @objectstack/dogfood test) · Test Files 493 passed | 3 skipped (496) · Tests 4174 passed | 68 skipped (4242) · no failures",
"mcp_calls": "11 total this session, all mcp__github__pull_request_read. No GitHub MCP write tool.",
"api_writes": "7 total this session: pr_create and six os-dev-report comments, each read back identical. Plus 3 advisory_read strokes, which are reads.",
"open_questions": [],
"security_findings": "withheld",
"out_of_scope_findings": [],
"owed": "A fresh contract-tier L2 by the security seat on head dab31e1d. The seat applies the PR-body counts."
} |
…enantIds, and the driver is handed that copy Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
…'s organizations on an elevated update, delete and insert; the rule's text states that such a bag is admitted Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017xRBcSSsTBYe1u4FyH5PGf
Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: follow-up owed — skills/objectstack-query/SKILL.md (its pass-through paragraph says an explicit
tenantIdreaches the driver; under an app-authored elevation that key is now bounded by the caller's organization wall)维护者速读
What changes
The rule: an app-authored elevation (an action body, a hook that runs as system, a flow that runs as system) is held to its caller's organization wall on the row as it will be stored and on the tenant scope its option bag asks for (ADR-0095 D1, ADR-0123 D2).
403 PERMISSION_DENIED. Judging only; no system strip is turned on.insert,update,delete,purge) whose option bag names an organization outside the caller's wall, or clearstenantId, is refused403 PERMISSION_DENIED.find,findOne) whose option bag names or clears an organization scope is answered by the read rule: the caller's wall is composed onto its predicate.OperationContext.driverTenantScopeCheck): a write's is refused403, a read's is narrowed to the organizations the wall admits. Where no verdict is worked out for the operation, that bag is judged against the caller's active organization alone, which is narrower than agroupmember's union and never wider.Files:
packages/plugins/plugin-security/src/app-automation-organization-wall.ts(the rule), its module pins, the real-stack pins inpackages/plugins/organizations/src/elevated-organization-wall.writes.wall.test.ts, register row 1c incontent/docs/permissions/system-context.mdx, and apatchchangeset (BREAKING banner, FROM/TO).Why
Elevation lifts a caller's business rules, never the organization wall (ADR-0095 D1). The plain door already judges the stored image a write's hooks leave, and bounds any driver tenant key by the wall it composes onto the predicate; an elevation is now held to the same two halves.
Tests
Rework rounds (head 122619b): the real-stack writes harness has 33 cases (sandboxed hook-returned bags on read, update and delete included) and a postures file has 14 (
group-posture reach controls). On dbfa1ed sources the writes file reads4 failed | 29 passed (33); at head writes33 passed (33)and postures14 passed (14). Module pins (app-automation-organization-wall.test.ts)62 passed;@objectstack/objectqlengine-driver-options.test.ts13 passed (13)— its twogrouppins go red with the beyond-projection skip ablated. Suites at 122619b: objectqlTest Files 642 passed (642) · Tests 14540 passed (14540); plugin-securityTest Files 290 passed (290) · Tests 7345 passed | 45 skipped; organizationsTest Files 23 passed (23) · Tests 341 passed (341); dogfood batteryTests 4174 passed | 68 skipped.Real-stack pins (OrganizationsPlugin, auth, security, automation; SQLite; isolated posture)
e42520c6: the first 12 probe cases ran9 failed | 14 passed (23)— every rule case red, every control green. The two cleared-key cases were added after that run; they are shown discriminating by the ablation below. Head:25 passed (25)for the file.Module pins (plugin-security)
app-automation-organization-wall.test.ts: 12 new cases (seam installed and chained, own organization asks no verdict, refusal shapes assertcode+status, read composition, denied delete keeps the read rule, hook-set key hold, enumerability, controls for an admitting wall, a wall with no parts, and a platform writer's own system context).59 passed (59).Ablation (each guard reverted, rebuilt, marker proven in dist, then restored and proven absent)
dist/: the wall's installation of the driver-bag check ablated → 6 red; the engine's application of it ablated → 6 red; the stored-image guard keeps its own 3 pins.dist/, the real-stack file back to33 passed (33).Package suites
pnpm --filter @objectstack/plugin-security test:Test Files 290 passed (290),Tests 7345 passed | 45 skipped(at 122619b).pnpm --filter @objectstack/organizations test:Test Files 23 passed (23),Tests 329 passed (329)(before theorigin/mainmerge; re-run on the merged head is in the report comment).pnpm --filter @objectstack/plugin-security typecheckandpnpm --filter @objectstack/organizations typecheck: exit 0.The derived gate run and the full dogfood battery on the final head are in the report comment on this PR.
Acceptance notes
groupmember's union (never wider).Skills-docs:follow-up is one sentence beside the query skill's pass-through paragraph; it is not in this PR because the PR is not adomain:skillschange.Verification
Read first, by risk:
packages/plugins/plugin-security/src/app-automation-organization-wall.ts— the stored-image seam and the bag judgement ahead of the early return for the common caller.packages/plugins/organizations/src/elevated-organization-wall.writes.wall.test.ts— the two new describe blocks..changeset/sec2-wf9p-f12.md— the FROM/TO.Two-minute check:
pnpm --filter @objectstack/organizations exec vitest run src/elevated-organization-wall.writes.wall.test.tsafter building the package's closure; expect33 passed (33).Human Minimum
packages/specholds no runtime logic.pnpm lintpasses.main, one pull request.packages/spectouched: its generated artifacts are regenerated and committed. (Not touched.)content/docs/references/,packages/*/CHANGELOG.mdorcontent/docs/releases/.Generated by Claude Code