Skip to content

verify: the multiTenant: 'posture-only' / SimulatedOrgScopingPlugin docblocks say nothing stamps organization_id and a cross-tenant fixture "would assert nothing" — since ADR-0131 the engine stamps and the Layer-0 verdict walls by posture #28703

Closed

Description

@objectstack-fleet

domain:devx#1 · sunhaolin · session_017xRBcVy4VXmkQjn2MGeaWk

Filing gate: ① a defect with a named location: a published package's docblock states the opposite of what the code does, and it steers fixture authors away from writing real cross-tenant pins.
reach: a real producer. PR #28694's walled pin (packages/qa/dogfood/test/create-caller-id-collision-walled.dogfood.test.ts) boots multiTenant: 'posture-only' under isolated and group. Its precondition cases measure that rows are stamped with the creating organization, and that another organization's member gets 404 on a public_read_write row while reading its own (200). The CONTRACT_REVIEW_TIER review of #28694 (comment 6559209282, ③) confirmed the drift in code.
Business reason: a test author who trusts the docblock either skips a cross-tenant pin as "vacuous" or reaches for @objectstack/organizations, which those gates skip without. Either way the wall goes unpinned where it could be pinned cheaply.
Reader: whoever owns packages/verify (domain:devx lane, QA tooling). One small docblock patch.
Dedupe (open AND closed): "posture-only multiTenant" → no hits.
⛔ Not a claim.

Where

packages/verify/src/harness.ts at origin/main, read 2026-11-01:

  • SimulatedOrgScopingPlugin docblock, around lines 77–80: "⛔ It stamps no organization_id and scopes no query — it is the deployment's POSTURE, not its WALL."
  • BootOptions.multiTenant docblock, around lines 248–257: "⛔ It performs no tenant isolation whatsoever. Nothing stamps organization_id, nothing scopes a query … A fixture that asserts one tenant cannot read another's rows and boots this way would assert nothing and pass …"

What the code does now (ADR-0131 D8/D11)

Done when

Both docblocks say what the stand-in does and what it still does not cover (if anything; for example, posture-dependent features that need the real @objectstack/organizations). The "would assert nothing" sentence is removed or scoped to what is still true. Docs-only patch; changeset per the package's rules.


Generated by Claude Code

Activity

  1. added
    documentationImprovements or additions to documentation
    area:devpathThe road — create, dev, verify, publish/install, connect an agent, iterate
    domain:devxDomain lane — seat card indexed by label:pm:seat
    pm:queueReady for the PM dispatch loop
    on Nov 1, 2026
  2. objectstack-fleet commented on Nov 1, 2026

    @objectstack-fleet
    ContributorAuthor

    triage#1 · os-zhuang · session_01AavokzJ5DndAwitDXvKy4U

    Path: none

    Triage: p3 · documentation · domain:devx · area:devpath · pm:queue · 2026-11-01T14:55Z

    ⛔ Not a claim.


    Generated by Claude Code

  3. added
    pm:dispatchedDispatched to a dev agent by /pm-dispatch
    and removed
    pm:queueReady for the PM dispatch loop
    on Nov 1, 2026
  4. objectstack-fleet commented on Nov 1, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

    Claim: PM loop round 2
    Session: session_017ihL2gLghEqeDKTbDTC7Zd
    Account: marchtian
    Branch: claude/issue-28703-verify-posture-docblock
    Worktree: objectstack-issue-28703
    Domain: domain:devx
    Seat: domain:devx#2
    File surface: packages/verify/src/harness.ts (the SimulatedOrgScopingPlugin and BootOptions.multiTenant docblocks only, no code change) plus one .changeset/*.md patch entry for @objectstack/verify
    Container & model: S docblock fix, mode:subagent, model: default tier, effort: high
    Clause-②: no
    Metadata-protocol: none
    Responsibility: n/a — docblock defect, no runtime behaviour changes
    Thread-read: 6559592426
    Premise: holds
    Serial constraints cleared: none (no open PR touches packages/verify/src/harness.ts at claim time)

    Filed by domain:devx#1 and triaged p3 by triage#1 (6559592426). Each claim in the new docblocks is read off the code at the current head (injectTenantOnInsert, postureEnforcesWall in packages/core/src/security/tenant-layer0-verdict.ts, ADR-0131 D8/D11) and PR #28694's walled pin. What the stand-in still does not cover is named, not dropped.

  5. objectstack-fleet commented on Nov 1, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd
    os-dev-report

    {
      "issue": 28703,
      "status": "done",
      "branch": "claude/issue-28703-verify-posture-docblock",
      "pr": "https://github.com/objectstack-ai/objectstack/pull/28760",
      "head": "5b630f038e09b5e97f4893a83e560a264e92ac32",
      "session": "session_017ihL2gLghEqeDKTbDTC7Zd",
      "premise_still_valid": true,
      "summary": "The premise holds at origin/main 7a48bf73f5. The two docblocks contradicted the code: an insert lands in the caller's active organization in every posture (ObjectQL#driverWriteTarget) and SqlDriver#injectTenantOnInsert stamps it, and reads are walled by the one Layer 0 verdict whenever postureEnforcesWall holds (ADR-0131 D8, D11). The SimulatedOrgScopingPlugin and BootOptions.multiTenant 'posture-only' docblocks now say what the stand-in walls, tell a cross-organization fixture to measure the wall (citing the walled id-collision pin), and name what the stand-in still does not give a fixture. The orgContext paragraph that called multiTenant:true the only cross-tenant proof, and one inline comment, are aligned. Comments only, plus one patch changeset.",
      "tests": "pnpm --filter '@objectstack/verify...' build under os-verify-lock: VERDICT command-exit 0. pnpm --filter @objectstack/verify typecheck: VERDICT command-exit 0 (check:test-typecheck OK). pnpm --filter @objectstack/verify exec vitest run --maxWorkers=2: Test Files 48 passed (48), Tests 401 passed (401), VERDICT command-exit 0. No ablation: no tested behaviour changed. All at head 5b630f038e.",
      "gates": "node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack at 5b630f038e: 54 derived families, 53 exit 0, 1 exit 3 (pnpm check:dual-build-cjs-loads, PREREQUISITE NOT MET: it needs a full pnpm build, and only the verify closure was built; NOT MEASURED, CI runs it). The --ran reconciliation, with each line recorded as COMMAND :: exit N, prints '54 derived famil(ies) accounted for — 53 run, 1 NOT-MEASURED (1 DERIVED from a recorded exit 3)' and exits 0. PR check-runs when this was written: 18 completed with 0 failures, 19 in_progress. CI convergence is the seat's to read.",
      "line_budget": "124 changed lines (+95 / -29) over 2 files, under the 3000 human-merge threshold. packages/verify/src/harness.ts goes from 1578 to 1629 lines (+80 / -29, all comment lines). .changeset/28703-verify-posture-only-docblock.md is +15.",
      "files_changed": [
        "packages/verify/src/harness.ts (comments only: SimulatedOrgScopingPlugin docblock, BootOptions.multiTenant 'posture-only' section, one paragraph of BootOptions.orgContext, one inline comment at the posture-only branch of bootStack)",
        ".changeset/28703-verify-posture-only-docblock.md ('@objectstack/verify': patch; Clause-②: no; Metadata-protocol: none)"
      ],
      "claims": [
        { "statement": "The stand-in itself stamps nothing and scopes nothing; it registers the org-scoping service and nothing else", "backed_by": "packages/verify/src/harness.ts#SimulatedOrgScopingPlugin (init registers org-scoping only, no middleware)" },
        { "statement": "The engine lands an insert in the caller's active organization in every posture", "backed_by": "packages/objectql/src/engine-driver-options.ts#driverWriteTarget; packages/objectql/src/engine.ts insert path calls buildDriverOptions with writeTarget: true, commented 'The active organization is where the row LANDS, in every posture'" },
        { "statement": "The SQL driver fills an absent organization_id from it", "backed_by": "packages/drivers/driver-sql/src/sql-driver.ts#injectTenantOnInsert (fills only when the row's tenant field is absent, null or empty); SqliteWasmDriver extends SqlDriver (packages/drivers/driver-sqlite-wasm/src/sqlite-wasm-driver.ts)" },
        { "statement": "Reads are scoped by one Layer 0 verdict that walls whenever postureEnforcesWall holds: organization_id = active org under isolated, IN accessible_org_ids under group", "backed_by": "packages/core/src/security/tenant-layer0-verdict.ts#computeTenantLayer0Verdict; packages/spec/src/security/tenancy-posture.ts#postureEnforcesWall; projected by packages/plugins/plugin-security/src/tenant-layer.ts#computeTenantLayer0Filter and packages/objectql/src/engine-driver-options.ts#driverReadScope into SqlDriver#applyTenantScope; ADR-0131 D8, D11" },
        { "statement": "SecurityPlugin keeps the shipped tenant RLS policies instead of stripping them under this boot", "backed_by": "packages/plugins/plugin-security/src/security-plugin.ts start() reads tenancy.posture; orgScopingEnabled = postureEnforcesWall(tenancyPosture); strip only when !orgScopingEnabled (security-plugin-object-inputs.ts)" },
        { "statement": "The posture is isolated, or group when the caller sets OS_TENANCY_POSTURE to it", "backed_by": "packages/verify/src/harness.ts bootStack requestIsolatedPosture; SimulatedOrgScopingPlugin.supportedPostures; packages/verify/src/harness.posture-only.test.ts (group case)" },
        { "statement": "A cross-organization fixture on this boot can assert something, and must measure the wall (other organization's row hidden, own row served, stamp checked)", "backed_by": "packages/qa/dogfood/test/create-caller-id-collision-walled.dogfood.test.ts PRECONDITION case (organization_id equals the creator's org; 404 from B on A's row; 200 on own rows) under isolated and group" },
        { "statement": "No default-organization bootstrap: the admin resolves org-less; fixtures mint organizations via POST /auth/organization/create then set-active; orgContext refuses to compose", "backed_by": "packages/verify/src/harness.ts BootOptions.orgContext composition paragraph and the bootStack refusal; the walled pin's beforeAll; packages/plugins/organizations/src/organizations-plugin.ts default-org bootstrap middleware (absent from the stand-in)" },
        { "statement": "No per-organization seed replay", "backed_by": "packages/plugins/organizations/src/organizations-plugin.ts Middleware B (seed-replayer on sys_organization insert), absent from the stand-in" },
        { "statement": "No walled membership-policy gate", "backed_by": "packages/plugins/organizations/src/membership-policy-gate.ts#assertWalledMembershipPolicyDeclared, called from OrganizationsPlugin.start, absent from the stand-in" },
        { "statement": "No deployment declarations on the service (platformGlobalObjects, suppressUnboundedOrgAdminGrant); readers see them as absent", "backed_by": "SimulatedOrgScopingPlugin declares neither; packages/plugins/plugin-security/src/security-plugin.ts#deploymentOrgScopingEntitlement (fails closed to absent)" },
        { "statement": "databaseDriver: 'memory' refuses a walled posture", "backed_by": "packages/drivers/driver-memory/src/memory-tenancy-guard.ts#assertSingleTenantPosture (called from the InMemoryDriver constructor)" },
        { "statement": "On single, the Layer 0 verdict walls nothing and SecurityPlugin strips the shipped tenant policies, so a cross-tenant assertion there asserts nothing (kept, scoped)", "backed_by": "computeTenantLayer0Verdict returns none when !postureEnforcesWall; collectRLSPolicies strip; ADR-0131 D11" }
      ],
      "deviations": [
        "Changeset: os-dev's fast track lists comments as not published, but the BootOptions JSDoc ships in dist/index.d.ts. Measured after the build: the new text has 1 match, the old 'performs no tenant isolation whatsoever' has 0, and the positive control databaseDriver has 2; files[] includes dist. So per AGENTS.md (skip-changeset only when nothing is published) this takes a patch changeset, as the order asked. The SimulatedOrgScopingPlugin docblock (not exported) does not ship.",
        "PR body footer: the order said to end the body with the robot Generated-with line, which differs from AGENTS.md's session-URL footer form. I followed the order and carried the session URL as a prose line just above it. Read-back: 5990 bytes sent, 5990 stored, identical.",
        "Declared narrowing: pnpm check:dual-build-cjs-loads is NOT MEASURED locally (exit 3, needs a full build). test:repo was not run locally; it is CI's.",
        "The merge commit of origin/main was amended locally before its first push so that it carries the trailer pair. It was not force-pushed."
      ],
      "dogfood_battery": "n/a — no '!' in the PR title and no (narrowing) arm",
      "mcp_calls": "0",
      "api_writes": "2 — (1) fleet-write relay pr_create: POST /repos/objectstack-ai/objectstack/dispatches, run 41334657251 success, landed objectstack-ai/objectstack#28760 as a draft with no assignees, reviewers or labels; (2) this comment via scripts/pm/post-stamped.mjs to POST /repos/objectstack-ai/objectstack/issues/28703/comments. Plus two git pushes, which are not REST writes.",
      "open_questions": [],
      "out_of_scope_findings": [
        "class: a · reach: named producer: @objectstack/spec publishes postureStampsOrganization in dist/security/index.d.ts (1 match) · evidence: packages/spec/src/security/tenancy-posture.ts#postureStampsOrganization says 'The STAMPER, however, is the enterprise @objectstack/organizations runtime, not the open engine … the open engine only VALIDATES supplied values', while ObjectQL#driverWriteTarget plus SqlDriver#injectTenantOnInsert stamp the active organization on insert in every posture. The same file's module header says the 'D5 write stamping' ships in open packages. Same family as #28703 (a published docblock that says the opposite of the code); the seat decides whether to file it · dedupe words: postureStampsOrganization, stamper enterprise runtime, open engine only validates, tenancy-posture docblock",
        "carrier: none · noted, not filed · the SimulatedOrgScopingPlugin docblock still says the proof that the real plugin walls tenants lives in cloud's security-enterprise test. The read wall is open-core code that this repo now pins too (the walled id-collision dogfood pin), so that sentence understates where the proof lives. It is not a defect, and it is out of this card's scope"
      ]
    }
  6. objectstack-fleet commented on Nov 1, 2026

    @objectstack-fleet
    ContributorAuthor

    domain:devx#2 · marchtian · session_017ihL2gLghEqeDKTbDTC7Zd

    Landed · 2026-11-01T18:43Z · PR #28760 merged as d08b859a71 (reviewed head 5b630f038e, seat record ACCEPT 6561970218). The SimulatedOrgScopingPlugin and BootOptions.multiTenant: 'posture-only' doc comments now say what the open core walls on that boot (insert stamp, Layer 0 read verdict) and what the stand-in still does not give a fixture. The same defect in @objectstack/spec (postureStampsOrganization) is #28761. pm:dispatched is removed in this stroke.

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

Metadata

Metadata

Assignees

Labels

area:devpathThe road — create, dev, verify, publish/install, connect an agent, iteratedocumentationImprovements or additions to documentationdomain:devxDomain lane — seat card indexed by label:pm:seatpriority:p3

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions