Repository navigation
Commit a0fac02
feat(platform-objects,spec): a single-organization deployment can rename its organization (#25661)
<!-- claude-projects-attribution: {"github_login":"os-sales"} -->
_Requested by **Sales** · [project
thread](https://claude.ai/code/project/chan_01D5bWFY3rFzgJcytD5gD4Uu?thread=cmsg_01D5bWFY3rFzgJcytD5gD4UuA2jsB5ocLSV8XnUmaYAnbA)_
Fixes #25347
Clause-②: yes
Metadata-protocol: none
Ruling-ref: 6384629949 (maintainer ruling A, 「25347 同意」). Claim of
record: `6384658457` on the card (card thread; the first PR #25464
landed the help and Branding half as `832a84eb`). Branch
`claude/project-thread-xvfy21` is the harness-pinned branch for this
session. It names no issue, so the Duplicate Fix Guard's branch-name
hint will not match, and the claim is the identity record.
## Why
Under the `single` posture the one organization could not be renamed
anywhere. `update_organization` and `rename_organization` were both
gated on `multiOrgEnabled`, and the generic edit form keeps `name`
readonly (ADR-0092 D4). So the record kept "Default Organization" for
good, which is the third name in the card's report. Renaming the one
organization changes nothing about tenancy, so it is not a
multi-organization action.
## What changes
- **`sys_organization.rename_organization`** (name and logo, never the
slug): `requiresFeature` moves from `multiOrgEnabled` to `organization`.
Its membership grades are unchanged: owner and admin, the same
`requiresMembershipReach: 'update_organization'`. better-auth's
`organization/update` still decides at the door.
- **Stays multi-organization only:** `update_organization` (it also
sends the slug), `create_organization`, `delete_organization`,
`set_active_organization` and `leave_organization`. Under `multi`
nothing changes.
- **`PUBLIC_AUTH_FEATURES`**: the
`'sys_organization.actions.rename_organization'` row moves from
`multiOrgEnabled.gatedInputs` to `organization.gatedInputs`.
`feature-gate-guard.test.ts` checks the registry against the
declarations in both directions, so the row and the gate land together,
as in #24216, #24317 and #25309.
- **`sys_organization.name`'s help** now names its door: "Change it with
Rename Organization at the top of this record." en was regenerated by
`check-i18n-bundles --write`. The zh-CN, ja-JP and es-ES leaves were
translated by hand, using each bundle's own label for the action.
## Outside the claim's file surface
This card is `domain:services`. One file belongs to the spec lane:
`packages/spec/src/kernel/public-auth-features.ts`. It changes by +5 /
−3: one row moved between two `gatedInputs` lists, with its comment.
Maintainer ruling `6384629949` on #25347 puts it in this PR, for this
card only; standing rule G is not decided. A cross-lane declaration is
posted on spec seat post #6017. The spec face owes a
`CONTRACT_REVIEW_TIER` contract review before the queue. The build is
`mode:cloud`, because the surface spans `packages/spec/src/**` and
another package.
## Pins
- `sys-organization-rename-action.test.ts`: the gate case now pins
`rename_organization` on `(reach) && features.organization != false`,
with `update_organization` on `multiOrgEnabled` as the control.
- `platform-objects.test.ts`:
- The gate-matrix row for `rename_organization` is now `${ADMINS} &&
${ORG}`.
- The multiOrg roster test ("the SysOrganization rows are every action
it gates on multiOrgEnabled") now counts only the rows whose expected
gate is `MULTI_ORG`.
- `sys-organization-name-timezone-help.test.ts`: a new case checks that
the name help names Rename Organization and that the action carries that
label.
- New
`packages/qa/dogfood/test/organization-rename-single.dogfood.test.ts`.
On a booted plain showcase (`single`), on the wire:
- The served flags are `organization: true`, `multiOrgEnabled: false`.
The seeded admin holds an owner or admin grade.
- The admin is offered Rename Organization, evaluated with the console's
`celEngine` against the served metadata and session `positions`. The
five multi-organization actions stay hidden.
- A plain member is not offered it. The door refuses the member with 403
`YOU_ARE_NOT_ALLOWED_TO_UPDATE_THIS_ORGANIZATION`, and the name is
unchanged.
- The admin's rename, built the way the console's api runner builds it,
returns 200. The name reads back changed and the slug is kept.
**Ablation:** `sys-organization.object.ts`, `public-auth-features.ts`
and the four bundles were restored from `origin/main` in the worktree
only, and spec and platform-objects rebuilt.
- In platform-objects, 4 tests failed and 156 passed: the gate case, the
matrix row, the roster test and the new help case.
- In the dogfood pin, 1 test failed and 3 passed: "the admin is offered
Rename Organization". The door itself admits the rename on both trees,
because the gate is a console affordance.
- After restoring HEAD and rebuilding, the dogfood pin passed 4 of 4.
## Tests and gates (head `d613a6d8`, base `49653f91`)
- `pnpm --filter @objectstack/spec test`: `Test Files 716 passed (716)`,
`Tests 21725 passed | 1 todo`.
- `pnpm --filter @objectstack/platform-objects test`: `Test Files 94
passed (94)`, `Tests 1344 passed (1344)`. This run includes
`feature-gate-guard.test.ts`.
- `organization-rename-single`, `organization-rename-door`,
`org-record-admin-reach` and `org-change-slug-bound-action` (dogfood):
`Test Files 4 passed (4)`, `Tests 18 passed (18)`.
- Typecheck for spec, platform-objects and dogfood: exit 0. eslint on
the changed files: clean.
- `dispatch-gates --commands`: 91 families. All 91 exited 0, and `--ran`
reports 91 run, 0 NOT-MEASURED.
- `check-i18n-bundles`, `check:i18n-stale-fill`, and
`check-adr-0087-registration --base origin/main` (no breaking changeset)
all passed. `git merge-tree` onto the latest `origin/main` is clean.
- Full dogfood battery: not owed. The title has no `!` and `Clause-②`
has no `(narrowing)` arm.
## Overlap
Two open PRs touch neighbouring lines, and neither asserts anything
about this action:
- #25626 adds `sys_user.actions.create_user.params.organizationId` near
the moved row in `multiOrgEnabled.gatedInputs`.
- #25637 rewrites `invite_user`'s `successMessage` in
`sys-organization.object.ts`.
Whichever lands second needs only a text merge.
## Acceptance notes
None new. The first PR's notes still stand: there are two built-in
product names (`OS_PRODUCT_NAME` and `OS_APP_NAME`), and
`sys_business_unit.timezone`'s help promises an inheritance that no code
implements.
Changesets: `.changeset/25347-rename-organization-single.md`
(`@objectstack/platform-objects` patch) and
`.changeset/25347-rename-organization-auth-feature.md`
(`@objectstack/spec` patch).
---
_Generated by [Claude
Code](https://claude.ai/code/session_01JJZRJcjTF4oBQK7333oAnR)_
🤖 Generated with [Claude Code](https://claude.com/claude-code)
https://claude.ai/code/session_01JJZRJcjTF4oBQK7333oAnR
Co-authored-by: Claude <noreply@anthropic.com>1 parent dc6c7ee commit a0fac02
12 files changed
Lines changed: 232 additions & 24 deletions
File tree
- .changeset
- packages
- platform-objects/src
- apps/translations
- identity
- qa/dogfood/test
- spec/src/kernel
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
| 531 | + | |
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
| 531 | + | |
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
| 531 | + | |
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
528 | 528 | | |
529 | 529 | | |
530 | 530 | | |
531 | | - | |
| 531 | + | |
532 | 532 | | |
533 | 533 | | |
534 | 534 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
10 | 12 | | |
11 | 13 | | |
12 | 14 | | |
| |||
24 | 26 | | |
25 | 27 | | |
26 | 28 | | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
27 | 35 | | |
28 | 36 | | |
29 | 37 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
18 | 19 | | |
19 | 20 | | |
20 | 21 | | |
| |||
102 | 103 | | |
103 | 104 | | |
104 | 105 | | |
105 | | - | |
106 | | - | |
107 | | - | |
108 | | - | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
109 | 111 | | |
110 | 112 | | |
111 | 113 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
245 | 245 | | |
246 | 246 | | |
247 | 247 | | |
248 | | - | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
249 | 255 | | |
250 | 256 | | |
251 | 257 | | |
| |||
299 | 305 | | |
300 | 306 | | |
301 | 307 | | |
302 | | - | |
303 | | - | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
304 | 311 | | |
305 | 312 | | |
306 | 313 | | |
307 | 314 | | |
308 | 315 | | |
309 | 316 | | |
310 | 317 | | |
311 | | - | |
| 318 | + | |
| 319 | + | |
312 | 320 | | |
313 | 321 | | |
314 | 322 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
699 | 699 | | |
700 | 700 | | |
701 | 701 | | |
702 | | - | |
| 702 | + | |
| 703 | + | |
| 704 | + | |
703 | 705 | | |
704 | 706 | | |
705 | 707 | | |
| |||
762 | 764 | | |
763 | 765 | | |
764 | 766 | | |
765 | | - | |
766 | | - | |
767 | | - | |
768 | | - | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
769 | 773 | | |
770 | 774 | | |
771 | 775 | | |
772 | 776 | | |
773 | | - | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
774 | 780 | | |
775 | 781 | | |
776 | 782 | | |
| |||
0 commit comments