Repository navigation
feat(plugin-auth): multi-org Create User joins the administrator's current organization - #25626
Conversation
📓 Docs Drift CheckThis PR changes 2 package(s): 16 hand-written doc(s) name something this change touched — list omitted above 15 rows. Re-derive on the tree named below: ⛔ 11 release-owned page(s) also affected — read-only, see AGENTS.md Documentation Guardrails. What this run could not see
Coarse fallback — 149 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 415030e3de41c9989e21ff8c013113d7a0d04d09 && git checkout 415030e3de41c9989e21ff8c013113d7a0d04d09
# afterwards, rebuild it from the two parents, which stay fetchable
git fetch origin 6679644a1a56b552d6864b125900221823ec78b3 366391c7697a07047485df3dd009e907c6b26247 && git checkout -B drift-repro 6679644a1a56b552d6864b125900221823ec78b3 && git merge --no-ff 366391c7697a07047485df3dd009e907c6b26247
node scripts/docs-audit/affected-docs.mjs --json 6679644a1a56b552d6864b125900221823ec78b3
|
…odes The membership callout said Create User writes no membership under a walled posture; it now joins the chosen organization or the administrator's current one, so both pages say so and the create-user section documents organizationId and the join table. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEz8GXcBLFWiasohtBhYgR
…tract; reword a docs line The two new engine fakes in admin-user-endpoints.test.ts now open update() with assertEngineUpdateDispatch, as check:engine-double-contract requires, and its pinned ledger records the grown coverage. The authentication page no longer adds role-word occurrences (ADR-0090 D3). Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEz8GXcBLFWiasohtBhYgR
|
Heads-up from PR #25637 (#24814) is in the merge queue with auto-merge on. It edits the same Generated by Claude Code |
|
Maintainer instruction · 「25626 按当前组织」 · 2026-10-24T16:22:33Z · record on #25625 comment 6386597064 This PR is not approved in its current shape. Rework per the record: multi-org Create User joins the administrator's current organization as Maintainer's words: 「单库多组织的时候,浏览器可以切换组织啊,当前始终会属于一个组织啊,当前组织的管理员增加用户就应该加入这个组织啊,怎么会每次增加的时候要选择。你再想想主流系统是怎么做的」 Generated by Claude Code |
|
CI note: The same push registers Generated by Claude Code |
…e budget fix Test Core (8/8) failed twice on this PR in plugin-pinyin-search's boot-reconcile.integration.test.ts, as it does on other open PRs: the fixture seeds 2,500 rows one awaited create at a time and the suite overruns vitest's 5 s default under CI load. The same change as the open fix PR 25775 is ported here; it no-ops once main carries that PR. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VEz8GXcBLFWiasohtBhYgR
|
CI note: Generated by Claude Code |
…son-xvcx6q # Conflicts: # packages/spec/liveness/translation.json
The remaining 22 items of #25835 re-read on main and revised: automated.ref now names what each pin asserts and at which layer, the no-active-org producers follow #25626, and the share-link landing page drops the retired objectui pin. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GgKuGD9Ats95jBbJRZrf4a
…ss walled user, and record the ruled and environment-bound checklist rows (objectstack-ai#33467) <!-- claude-projects-attribution: {"github_login":"os-project-manager"} --> _Requested by **Leehom** · [project thread](https://claude.ai/code/project/chan_01TenzsRopZj4jMbvjX8uz1X?thread=cmsg_01TenzsRopZj4jMbvjX8uz1X5XzfhFryaGx3eajZAWLK24)_ domain:devx#4 · os-project-manager · session_01FEkQ5kWURVLmS49GR3jwxs Fixes objectstack-ai#33351 Round 2 of the card: the four rows the maintainer ruled on 2026-11-14 (「全按推荐 A·B·B·C」), the item text round 1 owed, row 208 and section B. With this PR every row on the card has a disposition; the per-row table is below. Clause-②: no Metadata-protocol: none ## 维护者速读 - 改了什么:showcase 任务甘特图(命名视图 `listViews.gantt`)加 `lockField: 'done'`;`qa-fixture.mjs walled-boot` 新增 `--member-less` 标志,造出一个不属于任何组织的用户;七个检查清单区域文件按裁决与实测改写测试项文字。 - 为什么改:落实四项裁决(92 A、135 B、90+153 B、263 C),补齐第一轮欠下的测试项文字(91、155、220、227),给 208 提供夹具,并把 B 段六行记为环境约束,下一轮扫描不再把它们算作失败。 - 风险与回滚:不改任何产品包代码;showcase 与检查清单都不发布(`skip-changeset`);回滚即 revert 本 PR。 - 先看:`examples/app-showcase/src/ui/views/task.view.ts` 的 `lockField`;`scripts/qa/qa-fixture.mjs` 的 `--member-less` 段。 - 两分钟验证:`node scripts/qa/qa-fixture.mjs walled-boot --posture group --member-less`,预期输出 `memberLess.activeOrganizationId: null`、`organizations: 0`(需先构建 showcase)。 - 需要你做的:无,席位落地。 ## What changes 1. **Row 263 · `lockField: 'done'` on the showcase task gantt** (`examples/app-showcase/src/ui/views/task.view.ts`). The task view declares a gantt config twice: on the default list's view-switcher binding and on the named view `listViews.gantt` ("Schedule (Gantt)"). The plugin reads the config of the view it renders (`getGanttConfig(schema)` in `ui/packages/plugin-gantt/src/ObjectGantt.tsx`, `locked = !!record[lockField]`), and `records-forms.gantt-interactions` drives the named view, so the key goes there only. The switcher binding stays unlocked, which keeps the default list's gantt mode unchanged. Two seeded tasks are done ("Audit current IA", "App wireframes"), so a locked bar sits beside draggable ones on every stock boot. The dogfood pin `packages/qa/dogfood/test/view-type-gallery-data-halves.dogfood.test.ts` reads that config with `toMatchObject`, so the added key does not move it. 2. **Row 208 · `walled-boot --member-less [EMAIL]`** (`scripts/qa/qa-fixture.mjs`). Create User always joins the operator's organization since objectstack-ai#25626, so the flag mints the persona there, removes the membership as the organization's owner (`POST /api/v1/auth/organization/remove-member`), clears the forced password change Create User stamps (otherwise every data read answers 403 `PASSWORD_RESET_REQUIRED`), and signs the persona in again. A removed member is never bound again by signing in (ADR-0093 D7, the same three calls as `membership-decided-at-creation.dogfood.test.ts`). The fixture then proves the state: `get-session` reads `activeOrganizationId` null and `organization/list` is empty, or it exits 1. 3. **Checklist item text** in seven area files, one revision and one history row per item; see the table. ## Per-row dispositions (every row on the card) | row | disposition | where | |---|---|---| | 79 | environment knownGap (per item) | `platform-core.metadata-registry-serving` knownGaps[0] (form screenshot), `platform-core.customization-pair-ensure-door` knownGaps[1] (live spec) | | 80 | already done on main (round 1) | — | | 89 | out of scope, product (seat ruling) | — | | 90 | ruled B: runner-built | `platform-core.activation-ledger-package-key-upgrade` knownGaps (ADR-0019; a permanent fixture extends `examples/app-multi-package`) | | 91 | item text, measured live | `identity-auth.self-signup-gate` variants[1]/[2], requires[3], knownGaps[0] | | 92 | ruled A: nothing to change | no item tells a runner to assign a task by user id (grep of every area file); the `<assigneeId>` in integration-system is a `sys_notification_preference.user_id`, which is right | | 135 | ruled B: by design | `approvals.quorum-m-of-n` knownGaps[1] | | 150 | environment knownGap (per item) | `cli.datasource-introspect-codegen` knownGaps[2]: blocked(environment) | | 151 | routed, product | carrier objectstack-ai#33352 | | 152 | environment-bound, already recorded (round 1) | `platform-core.keyboard-shortcut-surface` knownGaps[1] | | 153 | ruled B: runner-built | `search.command-palette-navigation` knownGap for negative[3] | | 154 | environment knownGap (per item) | `identity-auth.linked-accounts-social` knownGaps[1] | | 155 | already right | `studio-authoring.flow-edge-type-authoring` requires[1] names the cycle-closing edge (landed by batch B) | | 208 | fixture landed | `--member-less` above; `access-security.no-active-org-session-semantics` personas[0], requires[1], knownGaps[0] | | 209 | landed (round 1) | — | | 210 | already recorded | `platform-core.marketplace-install-local-lifecycle` knownGaps[0]/[1], `platform-core.marketplace-console-honesty` knownGaps[0] (blocked(environment), egress) | | 218 | routed, product | carrier objectstack-ai#33352 | | 220 | seed landed (round 1); item text here | `records-forms.multi-currency-invoice` requires[2] | | 227 | item text | `platform-core.stored-reference-package-backfill-upgrade` requires[0] (the app declares `connectors` and `assignmentRules`) | | 238 | environment knownGap (per item) | `identity-auth.scim-deactivation-revokes-api-keys` knownGaps[1] (SSO adoption needs a DNS-verified domain) | | 239 | already recorded | `identity-auth.auth-method-matrix` knownGaps[0] and variants (objectui#4179, not_planned) | | 263 | ruled C: landed | `lockField` above; `records-forms.gantt-interactions` locked half on the stock boot, dependency/auto-schedule half blocked(fixture) by design | Section B choice: every row went on the item it blocks. None of the six facts is general enough for RUNNER.md, so RUNNER.md is unchanged. ## Why The card listed checklist rows that could not score on stock fixtures. The maintainer's rulings settle 92, 135, 90+153 and 263; the rest are fixture or text work. A row recorded as environment-bound tells the next sweep to mark it blocked(environment) instead of counting a failure. ## Tests - **Row 208, real runs** on this head's build (`pnpm --filter '@objectstack/example-showcase...' build`): `walled-boot --posture isolated --member-less` and `--posture group --member-less` each exit 0 with `membershipPolicy: invite-only`, `activeOrganizationId: null`, `organizations: 0`, and the persona's first `GET /api/v1/data/showcase_task` answering 200 with zero rows. The first version of the flag skipped the password change, and that persona's data read answered 403 `PASSWORD_RESET_REQUIRED`, which is why the step is there. - **Row 208, ablation:** with the removal pointed at an address that is not a member, the fixture exits 1: "the persona is not member-less: activeOrganizationId reads ZSZM…, organization/list holds 1". Restored. - **Row 91, live:** a stock showcase boot per posture with `OS_AUTH_AUDIENCE_SELF_REGISTRATION_PERMISSION_SET=showcase_contributor`. `email_domain` with `OS_AUTH_AUDIENCE_ALLOWED_EMAIL_DOMAINS=allowed.test`: `alice@allowed.test` 200 (token null, verification forced), `bob@other.test` and `carol@sub.allowed.test` 403 `EMAIL_DOMAIN_NOT_ALLOWED`. `open`: all three 200. - `pnpm check:platform-checklist`: exit 0 (16 areas, 429 items). ## Acceptance notes - Row 263's locked half now runs on the stock boot with no overlay. Its dependency and auto-schedule half is blocked(fixture) by design, per the ruling. - Rows 90 and 153 stay runner-built (ADR-0019: an app package defines at most one app). ## Verification Local subset at head `358862cf0`, derived by `node scripts/pm/dispatch-gates.mjs --commands --repo objectstack-ai/objectstack` on this diff: - `dispatch-gates --ran`: 57 derived, 56 run with exit 0, 1 NOT MEASURED: `pnpm check:dual-build-cjs-loads` exit 3 PREREQUISITE NOT MET (it reads every package's dist; studio, client-react, scenarios and others are unbuilt here). The diff changes no package's build output. - `pnpm exec eslint` on `task.view.ts` and `scripts/qa/qa-fixture.mjs`: exit 0. - Changeset: none, `skip-changeset`: `examples/**`, `docs/qa/**` and `scripts/qa/**` ship in no package (`@objectstack/example-showcase` is private). - CI families are read off this PR's check runs by the seat. Full record: `/mnt/project-files/pm-orders/devx/33351-r2-gates-ran.txt`. ## Human Minimum - [x] 1. Schemas start as Zod; `packages/spec` holds no runtime logic. (not touched) - [x] 2. Every name I added uses the casing for its kind. (one CLI flag, `--member-less`, kebab-case like its siblings) - [x] 3. No formatter ran; `pnpm lint` passes. (eslint on `scripts/qa/qa-fixture.mjs` and `task.view.ts`: exit 0) - [x] 4. One issue, one branch off an up-to-date `main`, one pull request. - [x] 5. A change that publishes carries a changeset, and both declaration lines are filled in here and in the changeset. (publishes nothing: `examples/**`, `docs/qa/**` and `scripts/qa/**` ship in no package, `skip-changeset`) - [x] 6. `packages/spec` touched: its generated artifacts are regenerated and committed. (not touched) - [x] 7. No hand edits to `content/docs/references/`, `packages/*/CHANGELOG.md` or `content/docs/releases/`. - [x] 8. Title, body and comments are in English. (the 维护者速读 block is the seat's required Chinese summary) - [x] The *Before Submitting* list in CONTRIBUTING.md is done. --- _Generated by [Claude Code](https://claude.ai/code/session_01FEkQ5kWURVLmS49GR3jwxs)_ --------- Co-authored-by: Claude <noreply@anthropic.com>
Refs #25625 (close it by hand once this merges: the branch name is fixed by the session, so it cannot carry the
claude/issue-N-…claim the closing-target guard reads)What changes for the admin
In multi-org mode, Users → Create User adds the new user to the organization the administrator is working in, so the follow-up Add Member is no longer needed. Mainstream admin consoles behave the same way.
Reworked per the maintainer's ruling 「25626 按当前组织」 (#25625 comment 6386597064, confirmed by the maintainer in session): 「当前组织的管理员增加用户就应该加入这个组织」. The earlier Organization picker, the
organizationIdrequest parameter, itsmultiOrgEnabledgated-input row and the four translations are removed.@objectstack/specand@objectstack/platform-objectsare byte-identical tomain.How
tenancy.isolationActive, the predicate behindfeatures.multiOrgEnabled),POST /api/v1/auth/admin/create-userreads the caller'sactiveOrganizationIdfrom their session before any account exists:400 NO_ACTIVE_ORGANIZATION, nothing created.memberthrough better-auth's ownaddMember(the Add Member act), inside the account's transaction. A refused join returns the vendor's status and code, and no user is created. An existing membership is kept (membershipCreated: false).membershipPolicy: 'invite-only'still joins. Creating a user inside your organization is an explicit act (ADR-0093 D1).501before any account exists.authentication.mdx,tenancy-modes.mdx) are updated. The changeset is BREAKING (narrowing): FROM a member-less account TO400 NO_ACTIVE_ORGANIZATIONfor an administrator with no current organization. The fix is to switch to an organization first.Verification
Unit (
admin-user-endpoints.test.ts) covers:organizationIdchooses nothingThe plugin-auth and platform-objects suites pass.
Dogfood:
create-user-organization-join.dogfood.test.tsruns on a realisolatedstack:sys_userrow exists.The existing create-user, permission-set, reconciler, audit, self-registration and sign-up dogfoods pass (44 tests).
pnpm lint, typecheck,check:i18n,check:adr-0087-registration,check:engine-double-contract,check:role-word,check:doc-authoringandcheck:adr-anchorspass.Landing
This diff touches
docs/adr/**(Tier H). It lands only after an authorized approving review. No AI seat queues it before that.Clause-②: yes (narrowing)
Metadata-protocol: none
Generated by Claude Code