Skip to content

fix(auth)!: a cloud-managed environment refuses remove-member and update-member-role - #34281

Merged
objectstack-fleet[bot] merged 20 commits into
mainfrom
claude/cloud-managed-membership-changes-refused
Nov 16, 2026
Merged

objectstack-fleet[bot] merged 20 commits into
mainfrom
claude/cloud-managed-membership-changes-refused

Conversation

@objectstack-fleet

@objectstack-fleet objectstack-fleet Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

Clause-②: no (narrowing)
Metadata-protocol: none
Skills-docs: none — no skill under skills/** teaches the organization membership doors or the cloud-managed mode; content/docs/permissions/authentication.mdx gains the rule in this change.

维护者速读

  • 改了什么:云托管环境(OS_CLOUD_MANAGED=1)上,成员资格与成员等级由托管该环境的组织管理:组织族中凡写入或删除成员行的六扇门一律答 409 RESOURCE_CONFLICT 且不写任何东西(与邀请成员同一信封):移除成员、修改成员等级(含「设为所有者」)、离开组织、接受邀请、创建组织(创建者成为所有者)、删除组织(结束其全部成员资格);对应的七个操作在云托管时隐藏。唯一例外:add-member 只接纳平台管理员、只做「添加一条成员资格」,用于恢复环境丢失的成员资格。
  • 为什么改:成员资格归托管组织所有,是已有邀请规则的同一条规则;组织族其余路由不写成员行(团队、邀请、当前组织、组织自身字段)或只读,照旧。自托管部署不受影响。
  • 风险与回滚:属破坏性变更(BREAKING),只影响云托管环境:在环境内移除成员、改等级、离开、接受邀请、创建或删除组织的人改到托管组织去做。回滚即还原本 PR。
  • 先看:① packages/plugins/plugin-auth/src/auth-manager-before-hook.ts(CLOUD_MANAGED_MEMBERSHIP_DOORS 六条与拒绝分支的位置:在 remove-member 权限分支、组织删除记录分支与改等级授权快照之前);② packages/plugins/plugin-auth/src/cloud-managed.ts(族普查与六句拒绝文案);③ packages/platform-objects/src/identity/(七个 visible)。
  • 两分钟验证:pnpm --filter @objectstack/plugin-auth exec vitest run src/cloud-managed.test.ts,预期全部通过:云托管下六扇门各答 409 且成员行不变,自托管下各照常 200 并改动成员行,非平台管理员调用 add-member 得 403。
  • 需要你做的:无,席位落地

What changes

The rule: on a cloud-managed environment, membership and membership tiers are managed by the organisation that hosts it. It extends the invite-member rule already in place. Every organization-family door that writes or deletes an organization membership row refuses; add-member alone stays open.

  • plugin-auth: six doors refused. On a cloud-managed environment, each door below refuses every request with the envelope invite-member already gives (409 RESOURCE_CONFLICT) and writes nothing. CLOUD_MANAGED_MEMBERSHIP_DOORS in auth-manager-before-hook.ts lists them, and the refusal comes ahead of the remove-member permission arm, the organization-delete records arm and the role-change grant read, so none of them runs on a refused request. Six sentences join CLOUD_MANAGED_REFUSAL_MESSAGES: removeMember, updateMemberRole, leaveOrganization, acceptInvitation, createOrganization, deleteOrganization. This hook is the only line of refusal: no in-process caller reaches these vendor operations. The hook comment says so, and says that a future in-process caller needs its own refusal.
  • platform-objects: seven actions hidden. features.cloudManaged != true now sits in visible on sys_member.update_member_role, remove_member and transfer_ownership; sys_organization.leave_organization, create_organization and delete_organization; and sys_invitation.accept_invitation. The invite actions are already hidden the same way.
  • spec. PUBLIC_AUTH_FEATURES.cloudManaged.gatedInputs books the seven paths. The registry note now names accept_invitation as the one gated input that has no second feature gate. This is a list entry, not a schema change, so Metadata-protocol: none.
  • The one exception. POST /organization/add-member admits exactly a platform administrator, adding a membership. On a managed environment it restores a membership the environment lost; any other caller is refused 403 PERMISSION_DENIED (pinned).
  • Self-hosted deployments never set the switch and answer exactly as before.
  • Docs. content/docs/permissions/authentication.mdx states the rule in its cloud-managed section: the six doors, the seven hidden actions, what add-member admits, and that the rest of the family is unchanged. The six routes sit in a marked wire fence.
  • A membership pin. membership-required-every-posture.dogfood.test.ts gains a leg under each tenancy posture. A person whose membership row was deleted under the system context (no door) signs in to no active organization, adopts no membership, and cannot read or write any of the organization's data, their own note included.

The organization family on a cloud-managed environment

Every family: 'organization' route in auth-route-ledger.ts (26 routes):

Route Disposition Reason
POST /organization/remove-member refused (409) deletes a membership row
POST /organization/update-member-role refused (409) re-tiers a membership row (Make Owner included)
POST /organization/leave refused (409) deletes the caller's membership row
POST /organization/accept-invitation refused (409) creates a membership row
POST /organization/create refused (409) creates the caller's owner membership row
POST /organization/delete refused (409) deletes every membership row of the organization
POST /organization/add-member the exception admits exactly a platform administrator, adding a membership
POST /organization/invite-member refused already (409) invitation rows; refused before this change
POST /organization/cancel-invitation unchanged invitation row only
POST /organization/reject-invitation unchanged invitation row only (pinned: answers 200 when managed)
POST /organization/add-team-member out of scope team rows only
POST /organization/remove-team-member out of scope team rows only
POST /organization/create-team out of scope team rows only
POST /organization/update-team out of scope team row only
POST /organization/remove-team out of scope team rows only
POST /organization/set-active unchanged the session's active organization, no membership row
POST /organization/update unchanged the organization's own fields
GET /organization/get-active-member unchanged read
GET /organization/get-full-organization unchanged read
GET /organization/list unchanged read
GET /organization/list-members unchanged read
GET /organization/list-invitations unchanged read
GET /organization/list-user-invitations unchanged read
GET /organization/list-teams unchanged read
GET /organization/list-team-members unchanged read
GET /organization/invitation-preview unchanged read

Tests

  • plugin-auth/src/cloud-managed.test.ts gains one top-level describe. It runs on the real AuthManager behind the real route mount; create and delete run on a walled posture, since single refuses a second organization.
    • On a managed environment, each of the six doors is refused with the envelope (code, status and the door's own sentence), and the membership rows are unchanged. For create, no organization is written either; for delete, the organization stays.
    • The arms behind the refusal never run (spied): the permission judge, the grant read and the delete records judge.
    • CONTROLS on self-hosted: each door answers 200 and changes the rows (the spied arms run there).
    • add-member still answers a platform administrator on a managed environment and restores the row; an ordinary member is refused 403 PERMISSION_DENIED there with nothing written.
    • invite-member keeps its own refusal, and reject-invitation answers 200 when managed.
  • platform-objects:
    • The feature-gate guard's forward rows now include the seven paths; the walker floor goes from 37 to 44.
    • The lowering matrix carries the new conjunct on the six action rows it already had, and adds an accept_invitation row.
    • identity/cloud-managed-visibility.test.ts evaluates the seven predicates through the canonical CEL engine. Each is hidden when managed, offered as before when not, and still hidden when its other gate is closed (organization or multiOrgEnabled; the pending row for accept). add-member stays offered when managed, and reject-invitation too.
    • The sparse-face sweep reads the new conjunct.

Acceptance notes

  • The docs page carried the managed refusals for create-user and import-users, not invite-member; the rule went into that same cloud-managed section.
  • No skill under skills/** teaches these doors, so no skill moves.

Verification

Readings at head 852c9a0e942bfc395181fa9739dd889144632c35, under the verify lock.

Rule suites, ablations, gates and the dogfood battery
  • pnpm --filter @objectstack/plugin-auth exec vitest run src/cloud-managed.test.ts: Tests 59 passed (59).
  • platform-objects pins (feature-gate-guard, identity/action-predicate-sparse-face, identity/cloud-managed-visibility, platform-objects): Test Files 4 passed (4), Tests 353 passed (353).
  • membership-required-every-posture.dogfood.test.ts: Tests 21 passed (21). org-change-slug-bound-action.dogfood.test.ts: Tests 5 passed (5).
  • Typecheck: @objectstack/plugin-auth, @objectstack/platform-objects and @objectstack/spec each exit 0.
  • Ablation of the refusal arm (scripts/ablation-replace.mjs, WRAP on the membership-door arm of the before-hook): src/cloud-managed.test.ts Tests 10 failed | 49 passed (59), the reds being the refusal pins of the six doors and the refuse-ahead-of-the-arms pins. Restored: blob equal to HEAD, git diff HEAD empty.
  • Ablation of the fixture correction (the old cross-check put back): org-change-slug-bound-action.dogfood.test.ts 1 failed | 4 passed. Restored the same way.
  • dispatch-gates --commands ∪ --ran: 116 derived, 116 run, 0 NOT-MEASURED, 0 UNRUN; the three prerequisite gates were run after building their prerequisites (check:skill-examples 347 examples, check:dual-build-cjs-loads 123 entry points across 72 packages, check:type-check-debt OK).
  • Dogfood battery (pnpm --filter @objectstack/dogfood test, no shard, no path): Test Files 473 passed | 3 skipped (476), Tests 4006 passed | 42 skipped (4048), no failures.
  • CI at this head: 59 success, 12 skipped, 0 failed.

Round 3 changes from dc93845f: the dogfood cross-check of the multi-org gate now compares against set_active_organization, the one sys_organization action whose only gate is multiOrgEnabled (leave_organization now also carries the cloud-managed hide); the docs say who names the tier of a membership added through add-member and that a caller with no session is answered as unauthenticated; origin/main merged without conflict.


Generated by Claude Code

…and update-member-role

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
… cloud-managed; docs and changeset

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…d the cloudManaged gate on the membership actions

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/m documentation Improvements or additions to documentation tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface labels Nov 16, 2026
@github-actions

github-actions Bot commented Nov 16, 2026 •

Copy link
Copy Markdown
Contributor

📓 Docs Drift Check

This PR changes 3 package(s): @objectstack/platform-objects, @objectstack/plugin-auth, @objectstack/spec, touching 19 documentable anchor(s).

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

  • content/docs/permissions/authentication.mdx (via /api/v1/auth/organization/remove-member (route, the route ledger binds it to client method organizations.removeMember), /api/v1/auth/organization/update-member-role (route, the route ledger binds it to client method organizations.updateMemberRole))
  • content/docs/protocol/objectui/actions.mdx (via cloudManaged (symbol, a field of const object PUBLIC_AUTH_FEATURES))

⛔ 1 release-owned page(s) also name something this change touched. These are read-only:

  • content/docs/releases/v18/18-4.mdx (via createOrganization (symbol, a field of const object CLOUD_MANAGED_REFUSAL_MESSAGES), createOrganization (literal, a string literal in CLOUD_MANAGED_MEMBERSHIP_DOORS; a string literal on a changed line))

content/docs/releases/ is RELEASE-OWNED (AGENTS.md "Documentation Guardrails"): release
notes are written centrally at release time, and a code PR that edits them is the exact PR
that guardrail exists to stop. They are still audited — read-only. If one of them is actually
wrong, file an issue or open a dedicated docs-only PR; do not edit it here.

What this run could not see
  • 1 name(s) were too generic to anchor anything (single lowercase words)
  • the SDK route bridge reached 65 of 247 client-bound route-ledger rows — the other 182 have no registrar path: tail to select them, so pages documenting THEIR client methods cannot appear above, on this or any run. Of those 182: 0 are remediable by widening that discovery convention (an in-repo file declares the path; the convention did not scan it); 59 are structural — on a ledger where NOT ONE row is declared in-repo, so no discovery change reaches them at any price; 123 are undecided (no in-repo declaration, on a ledger that has other in-repo registrars — absence and an unreadable spelling are not distinguishable here). The rows themselves: node scripts/docs-audit/affected-docs.mjs --bridge-coverage
  • a page that states a rule by its inputs shares no identifier with the emitter that implements the rule, so an emitter-only diff cannot list it — not on this run and not on any run. Measured on fix(driver-sql): emit varchar(maxLength) for a text field a declared index keys on #11430: content/docs/protocol/objectql/types.mdx documents the text-family column mapping by the ObjectQL type names it maps FROM (text / textarea / html) while the diff changed createColumn; it went unlisted, and it was the page that diff falsified, in four places. No shared token exists to detect this on, so a rule your change carries has to be re-read by hand in the pages that restate it.
  • a key NAME is not a key, so the hand re-read the line above prescribes can land on the wrong schema. The same spelling is authorable on one governed type and a [REMOVED] tombstone on another for each of active, aria, joins, objects, template, tools and version (censused on [finding] tools is a key on BOTH AgentSchema (tombstoned, dead) and SkillSchema (live, cloud-attested), so a name-based search attributes skill examples to the agent key — it produced a false stop-the-line alarm on PR #19059 #19093 over the liveness ledger's governed types, top-level keys); nothing in a search result distinguishes the two, so a grep hit on a LIVE example reads as evidence about the DEAD key. Measured on fix(spec): the agent.tools liveness row says dead — it claimed live on a key the schema tombstoned #19059: content/docs/ai/agents.mdx was reported as contradicting the agent.tools tombstone over its tools: example at :161, which is inside the defineSkill({ block opened at :155 — the page was already correct. Settle ownership by PARSING the value against both schemas, never by the name: that literal PASSES SkillSchema, and as an AgentSchema it FAILS at tools with the tombstone prescription. ⛔ These names are not the whole class — a key retired through a .strict() guidance map leaves no tombstone in the walked shape and none of them here (tool.category, live as AIToolDefinition.category).

Coarse fallback — 178 page(s) merely mention a changed package (the pre-#9192 predicate, kept for the deliberately-wide backstop): node scripts/docs-audit/affected-docs.mjs --json f59a4aa040910debf0f060a329b3a094c190c082 → packageMentionDocs.

Which tree this was computed on

This run read content/docs from 36a7f3b0efbf401a1fc54efd24b6d7e2c3175dc0 — the merge of head 852c9a0e942bfc395181fa9739dd889144632c35 into base f59a4aa040910debf0f060a329b3a094c190c082, which is what actions/checkout gives a pull_request run. Not the PR head.

A worktree cut from an older main holds a different content/docs, so re-deriving there can legitimately return a different list — that is a different tree, not a wrong row. To answer on the same tree:

# while this PR is open — GitHub drops the merge commit once it closes
git fetch origin 36a7f3b0efbf401a1fc54efd24b6d7e2c3175dc0 && git checkout 36a7f3b0efbf401a1fc54efd24b6d7e2c3175dc0
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin f59a4aa040910debf0f060a329b3a094c190c082 852c9a0e942bfc395181fa9739dd889144632c35 && git checkout -B drift-repro f59a4aa040910debf0f060a329b3a094c190c082 && git merge --no-ff 852c9a0e942bfc395181fa9739dd889144632c35

node scripts/docs-audit/affected-docs.mjs --json f59a4aa040910debf0f060a329b3a094c190c082

⚠️ That checkout carried uncommitted changes, so the commit above does not fully identify what was read.

Advisory only, and a precision-first one (#9192): a page is listed because it names a
symbol, wire route or SDK method this diff touched — not because it mentions a changed
package. Each row says which anchor put it there, so a wrong row is reportable rather than
merely annoying. To re-verify, run the docs-accuracy-audit workflow scoped to these files:
node scripts/docs-audit/affected-docs.mjs f59a4aa040910debf0f060a329b3a094c190c082 → pass the list as
args.docs, on the commit named under Which tree this was computed on.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

Contract-review-handoff: review#2 — CONTRACT_REVIEW_TIER unavailable (the maintainer routes contract-tier reviews to the review seat, 2026-11-16T03:43Z) · head def9a07

@objectstack-fleet objectstack-fleet Bot added the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head def9a07 · 2026-11-16T03:45Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: def9a07ea55e9e23340908f182d52d06c2ac07d8
Local-runs: none
Scope: packages/spec/src/kernel/public-auth-features.ts + packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/cloud-managed.ts, packages/plugins/plugin-auth/src/cloud-managed.test.ts, packages/platform-objects/src/identity/sys-member.object.ts, packages/platform-objects/src/identity/cloud-managed-visibility.test.ts, packages/platform-objects/src/identity/action-predicate-sparse-face.test.ts, packages/platform-objects/src/feature-gate-guard.test.ts, packages/platform-objects/src/platform-objects.test.ts, packages/qa/dogfood/test/membership-required-every-posture.dogfood.test.ts; read, not reviewed: packages/plugins/plugin-auth/src/auth-route-ledger.ts, organization-add-member.ts, auth-manager-organization-plugin.ts, auth-plugin.ts, packages/core/src/stack-auth.ts, packages/platform-objects/src/identity/sys-organization.object.ts and sys-invitation.object.ts

Read at 2026-11-16T03:48Z. First review of this head; claim: comment 6906689819; lane request 6906680880 on mailbox #33873. Independence: implemented in a project thread for security#1 (sunhaolin); reviewed by os-tesla, who neither dispatched nor implemented it.

① Derived judgments

  • The diff was judged against the merge base with main (12 files, +307/−11), not against the merge commits.
  • The two refused doors hold as claimed. The refusal keys on the endpoint's declared path alone, so it does not depend on the body; it sits ahead of the remove-member permission arm and ahead of the role-change grant read, and it throws before the vendor handler. No in-process caller of either vendor operation exists outside those two routes. The tests pin envelope, unchanged rows and both arms not called, each with a self-hosted control in which the arm does run.
  • One predicate: every reader goes through isCloudManaged() in @objectstack/core; this diff adds no second reading of the switch.
  • sys_member stays read-only through the data API (apiMethods get and list), unchanged here, so the object door is not a second route to the two refused writes.
  • visible is declared as a hide, not as enforcement: the changeset, the object comments and the registry comment each say the door refuses and the action is hidden. gatedInputs gains three paths; the guard's forward rows read them and the walker floor moves 37 to 40, the reverse direction is unchanged. The lowering matrix and the sparse-face sweep read the new conjunct.
  • Self-hosted is unchanged and pinned (three 200 controls that change the row).
  • The exception is, in code, exactly the platform-administrator gate on exactly add-member; this diff does not widen it.
  • The declaration's census is not closed. See M1.

② Semver level

patch on @objectstack/plugin-auth, @objectstack/platform-objects and @objectstack/spec is the level the repo rule gives a non-protocol breaking change; the BREAKING banner, the who-moves sentence and the ADR-0087 marker (not-required, no-migration-prescription) are present and the marker's reason is true: nothing stored is rewritten. Clause-②: no (narrowing) is well-formed and matches PR body and changeset. Metadata-protocol: none is true although a spec file changed: the hunk adds three entries to a feature-flag registry list, no authorable key, accepted value or metadata type moves, and the author reports the generated artifacts up to date. Skills-docs: none reason read and accepted.

CI at this head: 73 check-runs, 23 success, 16 skipped, 33 in progress (Test Core, Test UI, Build Core, Build Docs, type-check and lint lanes), 1 cancelled (Check Changeset). Nothing has failed yet; nothing is settled either. The cancelled changeset check needs a re-run on the next head.

③ Boundary flags

  • Security-touching (authentication, membership). Mechanisms and the per-door reading are kept out of this record and are with the seat.
  • BREAKING narrowing, hosted environments only.

④ Design judgment

M1 (must-fix) — the declared rule is wider than the doors the change closes, and the declaration says otherwise. The rule as written: on a cloud-managed environment the hosting organisation decides who is a member and at which tier. The change refuses two doors and states, in three places (cloud-managed.ts module comment, content/docs/permissions/authentication.mdx, the changeset), that these are the two doors that change an existing membership and that add-member is the one door left open. Read against the organization family in auth-route-ledger.ts, that census is incomplete: further ledgered routes write or delete a membership row and carry neither a cloud-managed disposition nor an out-of-scope sentence, and no pin holds them either way. Required: give every organization-family route that creates, ends or re-tiers a membership an explicit disposition on a managed environment (refused with the same envelope and a pin plus control, or open by rule with its reason written down), bring the row actions and gatedInputs into line for any door that becomes refused, and make the three sentences true to the result. Either direction closes this; an unstated remainder does not.

S1 (should-fix) — the exception is described by its purpose (restoring a membership the environment lost) while the page's lead sentence says the hosting organisation decides membership and tier. The open door is not bounded by that purpose in code. State on the docs page what the door admits on a managed environment, or bound it; and add to the new describe a pin that the door refuses a caller who is not a platform administrator on a managed environment, so "exactly the platform administrator" is held where the exception is claimed.

N1 (nit) — the invitation refusal has a second line behind the hook; the two new refusals have one. A sentence in the hook comment saying so, and why one suffices today, would keep the next in-process caller from walking past it.

Held against the published spec on main: the registry entries make the hide real in both guard directions and take no declared capability from a self-hosted consumer.

Implemented-by: claude/cloud-managed-membership-changes-refused
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: FAIL

…letes a membership row refuses on a cloud-managed environment, add-member excepted

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@github-actions github-actions Bot added size/l and removed size/m labels Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head 6ad5572 · 2026-11-16T04:00Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

Note for the delta on 6ad55722de (claimed): this is round 2 for your FAIL 6906747948. The seat ruled M1 closed in code: every organization-family route that writes or deletes a membership row is refused on a managed environment, except add-member, with a disposition table in the body. The implementer has not reported yet, and the body is not brought to this head; the seat posts it with readings when the report lands. The maintainer has now given the standing go-ahead for review notes, verbatim: 「长期允许」.

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 6ad55722de39601b0f39ab9234f487b645db9c96
Local-runs: none
Scope: packages/spec/src/kernel/public-auth-features.ts + packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/cloud-managed.ts, packages/plugins/plugin-auth/src/cloud-managed.test.ts, packages/platform-objects/src/identity/sys-member.object.ts, packages/platform-objects/src/identity/sys-organization.object.ts, packages/platform-objects/src/identity/sys-invitation.object.ts, packages/platform-objects/src/identity/cloud-managed-visibility.test.ts, packages/platform-objects/src/identity/action-predicate-sparse-face.test.ts, packages/platform-objects/src/feature-gate-guard.test.ts, packages/platform-objects/src/platform-objects.test.ts, packages/qa/dogfood/test/membership-required-every-posture.dogfood.test.ts; read, not reviewed: packages/plugins/plugin-auth/src/auth-route-ledger.ts, organization-add-member.ts, adopt-membership.ts, ensure-default-organization.ts, auth-manager.ts, auth-plugin.ts

Read at 2026-11-16T04:08Z. Delta review of this head against FAIL 6906747948 at def9a07; claim: comment 6906901776; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for security#1 (sunhaolin); reviewed by os-tesla, who neither dispatched nor implemented it.

① Derived judgments

  • Delta: one commit since def9a07e (6 files, +232/−28), no merge. The whole diff was re-read against the merge base; the findings below are about what that one commit left behind.
  • Prior M1, code side: closed. The refusal now covers six organization-family doors (remove-member, update-member-role with Make Owner, leave, accept-invitation, create, delete) through one arm that keys on the endpoint's declared path alone, answers the invite-member envelope, and sits ahead of every authorization arm and every write for those paths. Each of the four new doors has a pin (rows unchanged, nothing created, the invitation still pending) and a self-hosted control in which the door does write. The rest of the family is open by a written rule in the cloud-managed.ts header (it writes no membership row), with one control. No in-process caller of the six vendor operations exists; the object door stays read-only for memberships and invitations.
  • Prior M1, declaration side: not closed. Of the three sentences only the module header was corrected. See M1.
  • Row actions and gatedInputs: the four actions behind the new doors carry the conjunct and are booked, so the guard's forward direction resolves. Their pins did not move with them. See M2.
  • Prior S1: the pin is there (a caller without platform-administrator standing is refused at add-member on a managed environment, nothing written). The admission is now stated in the module header, not on the docs page. See S1.
  • Prior N1: closed. The hook comment says this is the only line, why one suffices today, and what a future in-process caller owes.
  • One predicate still: the delta adds no second reading of the switch.
  • No new door is opened. Self-hosted is unchanged and pinned (five further 200 controls). The platform administrator's add-member path is untouched.

② Semver level

patch on the three packages remains the level the repo rule gives a non-protocol breaking change, and Clause-②: no (narrowing) is well-formed. Metadata-protocol: none is still true after the second spec hunk: four more entries and a notes sentence in a feature-flag registry list; no authorable key, accepted value or metadata type moves. The ADR-0087 marker's conclusion still holds (nothing stored is rewritten), but its reason text and the rest of the declaration describe the previous head. See M1.

CI at this head: 65 check-runs, 28 success, 10 skipped, 27 in progress (Test Core 1 to 8, Test UI 1 to 16, Type Check workspace, Type Check UI, Build and E2E UI). Nothing has failed yet and nothing is settled. By reading, M2 predicts a red Test Core lane.

③ Boundary flags

  • Security-touching (authentication, membership). Mechanisms and the per-door reading are kept out of this record and are with the seat.
  • BREAKING narrowing, hosted environments only, now six doors and seven hidden actions rather than two and three.
  • For the maintainer's eye, not a finding: with create and accept-invitation refused, a person who holds no membership on a managed environment has no way in from inside it except the platform administrator's add-member or the hosting organisation. That follows from the rule as ruled; it is worth one sentence on the docs page so it reads as intended.

④ Design judgment

M1 (must-fix, continues prior M1) — the declaration no longer matches the change, now in the other direction. The code refuses six doors and hides seven actions; the changeset (title, the Clause-② narrowed list, the BREAKING paragraph, who-moves, the ADR-0087 marker's reason), the PR body and content/docs/permissions/authentication.mdx still name two doors, three actions, three registry paths and two refusal sentences. Four breaking refusals (leave, accept-invitation, create, delete) would ship with no release note and no who-moves line for the member who leaves, the invitee who accepts, or the owner who creates or deletes an organization. The docs page still says "the two doors that change an existing membership", which was the sentence prior M1 asked to be made true. Required: bring the changeset, the PR body and the docs paragraph to the six doors, the seven actions, the family rule for what stays open, and who moves for each.

M2 (must-fix, new) — the pins for the hide did not follow the four new gates. The lowering matrix in platform-objects.test.ts still pins the previous predicates for create_organization, delete_organization and leave_organization byte for byte, while this head authors a cloud-managed conjunct on each; read against the sibling rows, those three rows cannot hold at this head (not run locally; Test Core is still in progress). accept_invitation has no row there, and cloud-managed-visibility.test.ts still holds only the three sys_member actions: none of the four new hides is pinned as hidden when managed, offered as before when not, and still under its other gate. Required: correct the three rows, add the fourth, and extend the visibility describe to the four actions with their controls.

S1 (should-fix, continues prior S1) — the pin half is done. The docs page still describes the open door by its purpose alone; say there what it admits on a managed environment (who may call it and what it may add), as the module header now does, or bound it in code.

N1 (nit, new) — feature-gate-guard.test.ts still says 40 booked inputs and floors at 40; 44 are booked now.

Held against the published spec on main: the narrowing takes nothing from a self-hosted consumer and makes the registry's hide real for the four new actions at the door; what fails is that the release declaration and the predicate pins describe a smaller change than the one in the tree.

Implemented-by: claude/cloud-managed-membership-changes-refused
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: FAIL

…ent; docs and changeset state it

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…doors and seven actions

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…served predicate

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract-review-claim: session_01L9qibxTeW8xHnxoHxWNHWW · head dc93845 · 2026-11-16T05:02Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#2 · os-tesla · session_01L9qibxTeW8xHnxoHxWNHWW

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: dc93845fe941accac09bf93c3dcdad9438e9ceb5
Local-runs: none
Scope: packages/spec/src/kernel/public-auth-features.ts + packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/cloud-managed.ts, packages/plugins/plugin-auth/src/cloud-managed.test.ts, packages/platform-objects/src/identity/sys-member.object.ts, packages/platform-objects/src/identity/sys-organization.object.ts, packages/platform-objects/src/identity/sys-invitation.object.ts, packages/platform-objects/src/identity/cloud-managed-visibility.test.ts, packages/platform-objects/src/identity/action-predicate-sparse-face.test.ts, packages/platform-objects/src/feature-gate-guard.test.ts, packages/platform-objects/src/platform-objects.test.ts, packages/qa/dogfood/test/membership-required-every-posture.dogfood.test.ts; read, not reviewed: packages/plugins/plugin-auth/src/auth-route-ledger.ts, organization-add-member.ts

Read at 2026-11-16T05:08Z. Delta review of this head against FAIL 6907027054 at 6ad5572; claim: comment 6907809052; no lane request (owed per check-owed-reviews). Independence: implemented in a project thread for security#1 (sunhaolin); reviewed by os-tesla, who neither dispatched nor implemented it.

① Derived judgments

  • Delta: three commits since 6ad55722 (6 files, +109/−31), no merge: the changeset, the docs page and four test files. No shipped source moved, so the reading of the six doors, the one arm and the one predicate made at 6ad55722 stands as it was; the net diff against the merge base was re-read with it.
  • Prior M1 (declaration): closed. The changeset (title, the Clause-② narrowed list, the ADR-0087 reason, the BREAKING paragraph, who-moves, Unchanged), the docs paragraph and the PR body now name the six doors, the six refusal sentences, the seven hidden actions, the seven registry paths, the add-member exception with what it admits, and the family rule for what stays open. The docs wire fence lists the six routes. The PR body adds a disposition table for the organization family; its 26 rows match the 26 organization-family rows of the route ledger at this head. One section of the body is unfinished. See S1.
  • Prior M2 (pins): closed. The lowering matrix carries the cloud-managed conjunct on create_organization, delete_organization and leave_organization and gains an accept_invitation row; cloud-managed-visibility.test.ts holds the four actions hidden when managed, offered as before when not, and still hidden when their other gate is closed, with decline-invitation as the control that stays offered. Test Core is green at this head, so the rows hold by CI and not only by reading.
  • Prior S1 (the open door's admission): closed. The docs page now says who the door admits, what it does, and what any other caller is answered; the pin from the previous round is unchanged. One residual wording point. See N1.
  • Prior N1 (the guard's floor): closed. Comment and floor read 44.
  • New in the delta: the create and delete cases in cloud-managed.test.ts now stage a walled posture, because the single posture refuses a second organization on its own. The override is passed after the default and takes effect; refusal and control both run on the same posture.
  • Against main: 21 commits ahead of the merge base, one of which retired two booked inputs under another flag. A trial merge is clean, and the guard's floor still holds on the merged registry.

② Semver level

patch on the three packages is the level the repo rule gives a non-protocol breaking change. Clause-②: no (narrowing) is well-formed and now lists what is narrowed in full, in the changeset and the PR body alike. Metadata-protocol: none holds: the spec hunk is seven entries and a notes sentence in a feature-flag registry list; no authorable key, accepted value or metadata type moves. The ADR-0087 marker's reason now describes this head (seven paths, six doors, nothing stored to rewrite).

CI at this head: 72 check-runs, 60 success, 12 skipped, none failed, none in progress. The skipped set includes the Dogfood Regression Gate, which the merge queue runs.
CI completed before posting: 72 check-runs on this head, 60 success, 12 skipped, none failed.

③ Boundary flags

  • Security-touching (authentication, membership). Mechanisms and the per-door reading are kept out of this record and are with the seat.
  • BREAKING narrowing, hosted environments only: six doors refuse and seven actions hide. Self-hosted is unchanged and pinned by a control per door.
  • For the maintainer's eye, carried from the previous round and not a finding: on a managed environment a person who holds no membership has no way in from inside it except the platform administrator's add-member or the hosting organisation. The docs page now states the exception and the rule, so this reads as intended.

④ Design judgment

No must-fix.

S1 (should-fix, the remainder of prior M1) — the PR body's ## Verification section is the unfilled token ROUND2_VERIFICATION. The readings the previous body carried were removed and none for this head took their place, so the body states no measured result for the four doors added in round 2 beyond the green check-runs. Fill the section before landing; a body edit does not move the head, so this record stays on it.

N1 (nit, continues prior S1) — on the docs page, "anyone else is refused 403 PERMISSION_DENIED" holds for a signed-in caller; a caller with no session is answered as unauthenticated. And the paragraph opens with the hosting organisation deciding the membership tier, while the exception does not say who names the tier of a membership added through it. One clause each would settle both.

Held against the published spec on main: the narrowing takes nothing from a self-hosted consumer, the registry's hide is real at the door for all seven actions and pinned in both guard directions, and the release declaration now describes the change that is in the tree.

Implemented-by: claude/cloud-managed-membership-changes-refused
Reviewed-by: session_01L9qibxTeW8xHnxoHxWNHWW

VERDICT: PASS

… session answers 401

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…membership-changes-refused

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
…rganization, the action gated by multi-org alone

Claude-Session: https://claude.ai/code/session_017xRBcT1w3zpekijraHJE4f
Co-authored-by: Claude <noreply@anthropic.com>
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract-review-claim: session_01ASNY8Ywba8ySbMdWvra2vS · head 852c9a0 · 2026-11-16T09:25Z

@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

review#1 · os-mickey · session_01ASNY8Ywba8ySbMdWvra2vS

Contract review

Served-tier: CONTRACT_REVIEW_TIER
Head-sha: 852c9a0e942bfc395181fa9739dd889144632c35
Local-runs: none
Scope: packages/spec/src/kernel/public-auth-features.ts, packages/plugins/plugin-auth/src/auth-manager-before-hook.ts, packages/plugins/plugin-auth/src/cloud-managed.ts, packages/plugins/plugin-auth/src/cloud-managed.test.ts, packages/platform-objects/src/identity/sys-member.object.ts, packages/platform-objects/src/identity/sys-invitation.object.ts, packages/platform-objects/src/identity/sys-organization.object.ts, packages/platform-objects/src/identity/cloud-managed-visibility.test.ts, packages/platform-objects/src/identity/action-predicate-sparse-face.test.ts, packages/platform-objects/src/feature-gate-guard.test.ts, packages/platform-objects/src/platform-objects.test.ts, packages/qa/dogfood/test/membership-required-every-posture.dogfood.test.ts, packages/qa/dogfood/test/org-change-slug-bound-action.dogfood.test.ts + read, not reviewed: packages/plugins/plugin-auth/src/auth-route-ledger.ts, auth-manager-auth-instance.ts, organization-add-member.ts, auth-plugin.ts, admin-user-endpoints.ts, pending-sso-users.ts, service-account-doors.ts, service-account-lifecycle.ts, reconcile-membership.ts, membership-backfill-ledger.ts, adopt-membership.ts, audience-posture.ts, auth-manager.ts, packages/core/src/stack-auth.ts, ui/packages/app-shell/src/console/organizations/manage/MembersPage.tsx and SettingsPage.tsx
Security-touching: yes

Read at 2026-11-16T09:40Z. Full review of this head, not a delta; claim: comment 6912510522. Earlier records on other heads: FAIL 6906747948, FAIL 6907027054, PASS 6907898459. Judged from the net diff against the merge base with main (15 files, +608/−22), the rule text on main, and the cited code at this head. Findings stay at rule level; the per-door reading is with the seat.

① Derived judgments

  • What moves from accepted to refused: on a cloud-managed environment only, six organization-family doors that write or delete a membership row (remove a member, change a member's tier with Make Owner included, leave, accept an invitation, create an organization, delete an organization) answer the envelope the invitation door already gives and write nothing. Nothing else moves: the arm is conjoined with the one isCloudManaged() accessor, and each door has a self-hosted control that answers 200 and changes the row.
  • The refusal is one arm of the single before-hook of the auth instance. It keys on the endpoint's declared path alone, not on anything the request carries, and nothing ahead of it returns, so it runs for every request to those six doors, in-process calls included. It sits ahead of the permission arm, the delete records arm and the grant read; the tests pin that none of them runs on a refused request.
  • No in-process caller of the six vendor operations exists at this head. The object door stays read-only for memberships and invitations, and edits only the organization's own fields.
  • The exception is, in code, exactly the platform-administrator gate on add-member, and it only adds: an existing membership is not re-tiered through it. The tier is required in the request and the docs now say who names it.
  • Outside the organization family, membership rows are still written or ended on a managed environment by doors that admit by their own rules: the platform administrator's people doors, and the AI service account lifecycle, which touches non-person principals only. None of them lets a caller below platform administrator end or re-tier a person's membership. That is consistent with the rule; one comment states it more widely than the code does. See N2.
  • Automatic writers do not undo the rule: binding happens at user creation, the bulk backfill is one-time per deployment, self-registration is refused on a managed environment, and the new dogfood leg pins that a person whose row was removed adopts no membership on sign-in, under each tenancy posture.
  • Schema file against its consumers: gatedInputs gains seven paths; each resolves to an action whose visible carries the matching conjunct, the guard's floor reads 44, the lowering matrix and the CEL evaluation pin each predicate hidden when managed, offered as before when not, and still under its other gate. The served flag comes from the same accessor the doors ask.
  • Against main: six commits past the merge base, none touching a file of this diff.

② Semver level

patch on @objectstack/plugin-auth, @objectstack/platform-objects and @objectstack/spec is the level AGENTS.md gives a non-protocol breaking change. The title carries !. Clause-②: no (narrowing) is line-initial and well-formed in the PR body and the changeset, and names what is narrowed in full. Metadata-protocol: none holds: the spec hunk is seven entries and a notes sentence in a feature-flag registry list; no authorable key, accepted value or metadata type moves. The BREAKING banner, the who-moves sentence and one ADR-0087 marker (not-required, no-migration-prescription) are present, and the marker's reason is true of this head: nothing stored is rewritten.

CI at this head when read: 65 check-runs, 31 success, 10 skipped, 24 in progress (Test Core, Test UI, Type Check workspace and UI), none failed. Not settled; the skipped set includes the Dogfood Regression Gate, which the merge queue runs.

③ Boundary flags

  • Security-touching (authentication, membership). Mechanisms are kept out of this record.
  • BREAKING narrowing, hosted environments only: six doors refuse, seven actions hide. Self-hosted unchanged and pinned.
  • SQL push-down: the shipped hunks add no read, no id materialisation and no in-app join.
  • Dev flags and open questions: the body's two acceptance notes (where the docs rule went; no skill teaches these doors) are read and accepted. No open question is left unanswered.
  • For the maintainer's eye, carried and not a finding: on a managed environment a person with no membership has no way in from inside it except the platform administrator or the hosting organisation. The docs state the exception and the rule, so this reads as intended.

④ Design judgment

M1: closed.
M2: closed.
N1: closed.
S1: kept.

S1 (should-fix) — as graded in 6907898459: the PR body's ## Verification section is still the unfilled token ROUND2_VERIFICATION. The body states no measured result for this head. Fill it with rule and counts only; a body edit does not move the head.

N2 (nit) — the comment above the seven new entries in public-auth-features.ts says every door that writes or deletes a membership row refuses. The changeset, the docs and the cloud-managed.ts header all say every organization door, which is what the code does. Say "organization door" there too, and add one sentence to the family census naming that doors of other families answer by their own admission rules.

N3 (nit) — the file header of auth-manager-before-hook.ts still describes the refusal as covering the two doors that change a membership or its role; the arm below it covers six.

N4 (nit) — the hide is real for the seven booked row actions. The console's own organization pages under ui/, which are not metadata-driven, hide only the invite entry on a managed environment and still offer the other changes; the server refuses each with the sentence that says where to go instead, so nothing is written. Worth a follow-up on the ui/ lane so the shell matches the registry; not a change for this PR.

Held against the published spec on main: the narrowing takes nothing from a self-hosted consumer, makes the registry's hide real at the door for all seven actions, refuses fail-closed with the one envelope on every organization-family door that writes or deletes a membership row, and leaves open exactly the exception it declares. I tried the doors of other families, the object door, in-process callers and the automatic writers and found no way for a caller the rule excludes to change a person's membership or tier.

Implemented-by: claude/cloud-managed-membership-changes-refused
Reviewed-by: session_01ASNY8Ywba8ySbMdWvra2vS

VERDICT: PASS

@objectstack-fleet objectstack-fleet Bot removed the needs:contract-review Marker only — PR awaits its at-tier Contract review PASS; no check reads it, the record decides label Nov 16, 2026
@objectstack-fleet

Copy link
Copy Markdown
Contributor Author

security#1 · sunhaolin · session_017xRBcT1w3zpekijraHJE4f

席位核对

ACCEPT at Head-sha: 852c9a0e942bfc395181fa9739dd889144632c35 (2026-11-16T10:56Z).

  • Shape:
    • No-card order from the security#1 seat.
    • 15 paths (plugin-auth, platform-objects, one spec registry list, two dogfood tests, docs, changeset). Not governed.
    • Clause-②: no (narrowing), BREAKING on cloud-managed environments only, patch on @objectstack/plugin-auth, @objectstack/platform-objects and @objectstack/spec, ADR-0087 marker not-required (no-migration-prescription), Metadata-protocol: none.
  • Rule: on a cloud-managed environment, membership and membership tiers are managed by the hosting organisation: the six organization-family doors that write or delete a membership row refuse with the invite-member envelope and write nothing, their seven actions are hidden, and add-member stays open to exactly a platform administrator. Self-hosted is unchanged.
  • Gates:
    • CI on this head: 59 success, 12 skipped, 0 failed.
    • Locally on this head: the rule suite 59/59, the platform-objects pins 353/353, both dogfood files green, three typechecks exit 0; dispatch-gates 116 derived, 116 run, 0 NOT-MEASURED, 0 UNRUN.
    • Ablations of the refusal arm (10 red) and of the fixture correction (1 red), each restored.
    • Dogfood battery on this head: Tests 4006 passed | 42 skipped (4048), no failures. It found the stale cross-check at dc93845f that the PR's CI does not run, fixed in round 3.
  • Review: at CONTRACT_REVIEW_TIER:
    • review#2 FAIL 6906747948, FAIL 6907027054, PASS 6907898459 (dc93845f);
    • review#1 PASS 6912752888 on this head, with no must-fix. Its S1 (the unfilled ## Verification) is answered by the body edit of 2026-11-16T10:56Z, which does not move the head.
  • Accepted deviations: N2 and N3 (two code comments that still name the narrower census) and N4 (the console's own organization pages offer the hidden changes; the server refuses each) go to a follow-up, so the head does not move.
  • Landing: through the merge queue, by the seat.

Implemented-by: os-dev (security#1 order, session_017xRBcT1w3zpekijraHJE4f) · Reviewed-by: review#2 (session_01L9qibxTeW8xHnxoHxWNHWW), review#1 (session_01ASNY8Ywba8ySbMdWvra2vS).

@objectstack-fleet
objectstack-fleet Bot marked this pull request as ready for review November 16, 2026 10:58
@objectstack-fleet
objectstack-fleet Bot added this pull request to the merge queue Nov 16, 2026
Merged via the queue into main with commit e2a4c66 Nov 16, 2026
76 checks passed
@objectstack-fleet
objectstack-fleet Bot deleted the claude/cloud-managed-membership-changes-refused branch November 16, 2026 11:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation size/l tests tooling Fix lands in tooling, not a product package — enters pm:queue only with Unblocks: or a named surface

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants