The organisation and workspace names can never be changed after setup #2077

Closed
opened 2026-11-20 08:59:18 +00:00 by sam · 2 comments
Owner

What is wrong

An organisation's name and a workspace's name are written once, when the first
owner account is created, and nothing can change either afterwards. No endpoint,
no dashboard control, no API method. If first-run setup stops asking for them
(which is the direction of the setup issue), the built-in names "System" and
"Default" become permanent for that instance.

Evidence

  • The only writer of an organisation's name is the bootstrap registration:
    setupAccountOrganisation in
    internal/infrastructure/postgres/accounts.go, and the equivalent upsert in
    modules/governance/internal/store/accounts.go.
  • The org routes have no update method. internal/webui/orgs.go registers list,
    create, get, workspace list, workspace create, members list, member add, member
    set, member remove, agents list and agent assign. Nothing renames an org or a
    workspace.
  • The dashboard client has no rename call either: ui/src/lib/api.ts exposes
    orgs, org, orgCreate, orgWorkspaces and createOrgWorkspace.
  • ui/src/org/OrgWorkspacesPage.vue renders workspaces read-only with a "New
    workspace" section, so a workspace name is fixed from the moment it is created.

Blocker

The org API is still served by the service being retired. internal/webui owns
/api/orgs; modules/governance serves accounts, authentication, tokens and
capabilities but no org routes, and modules/dashboard only serves the embedded
dashboard. A rename endpoint added to the module today would sit behind org pages
whose own list call has no handler on the single binary.

So the rename belongs with moving org administration into the module: list, get
and rename for the organisation, and list, create and rename for its workspaces,
with the owner check, audit entry and capability registration that the other
module registrations carry.

Wanted

An owner can correct the organisation's name and a workspace's name from the
dashboard, and the change is attributable.

Done when

  • An owner can rename the organisation from the dashboard, and the change appears
    in the audit trail.
  • An owner can rename a workspace, and the change appears in the audit trail.
  • The names defaulted during first-run setup are correctable through that control.

Context worth knowing before starting

  • The built-in organisation is org-sys, seeded with the name "System" by
    internal/infrastructure/postgres/migrations/0033_org_sys.sql. org-sys is
    the instance's own org, not a tenant someone created.
  • Every org is created with one workspace named "Default"
    (internal/infrastructure/postgres/orgs.go), and setup renames that row rather
    than inserting a new one.
  • Workspace identity is not the name: workspace.id is what policies and records
    are scoped to, and the name is a label, so a rename needs no data migration.
    The org's id is likewise independent of its name.
## What is wrong An organisation's name and a workspace's name are written once, when the first owner account is created, and nothing can change either afterwards. No endpoint, no dashboard control, no API method. If first-run setup stops asking for them (which is the direction of the setup issue), the built-in names "System" and "Default" become permanent for that instance. ## Evidence - The only writer of an organisation's name is the bootstrap registration: `setupAccountOrganisation` in `internal/infrastructure/postgres/accounts.go`, and the equivalent upsert in `modules/governance/internal/store/accounts.go`. - The org routes have no update method. `internal/webui/orgs.go` registers list, create, get, workspace list, workspace create, members list, member add, member set, member remove, agents list and agent assign. Nothing renames an org or a workspace. - The dashboard client has no rename call either: `ui/src/lib/api.ts` exposes `orgs`, `org`, `orgCreate`, `orgWorkspaces` and `createOrgWorkspace`. - `ui/src/org/OrgWorkspacesPage.vue` renders workspaces read-only with a "New workspace" section, so a workspace name is fixed from the moment it is created. ## Blocker The org API is still served by the service being retired. `internal/webui` owns `/api/orgs`; `modules/governance` serves accounts, authentication, tokens and capabilities but no org routes, and `modules/dashboard` only serves the embedded dashboard. A rename endpoint added to the module today would sit behind org pages whose own list call has no handler on the single binary. So the rename belongs with moving org administration into the module: list, get and rename for the organisation, and list, create and rename for its workspaces, with the owner check, audit entry and capability registration that the other module registrations carry. ## Wanted An owner can correct the organisation's name and a workspace's name from the dashboard, and the change is attributable. ## Done when - An owner can rename the organisation from the dashboard, and the change appears in the audit trail. - An owner can rename a workspace, and the change appears in the audit trail. - The names defaulted during first-run setup are correctable through that control. ## Context worth knowing before starting - The built-in organisation is `org-sys`, seeded with the name "System" by `internal/infrastructure/postgres/migrations/0033_org_sys.sql`. `org-sys` is the instance's own org, not a tenant someone created. - Every org is created with one workspace named "Default" (`internal/infrastructure/postgres/orgs.go`), and setup renames that row rather than inserting a new one. - Workspace identity is not the name: `workspace.id` is what policies and records are scoped to, and the name is a label, so a rename needs no data migration. The org's id is likewise independent of its name.
sam added the featurehigh labels 2026-11-20 08:59:18 +00:00
Author
Owner

This is the other half of #2076: once setup stops asking for the organisation and workspace names, they stay at their seeded values, so this control is what makes those defaults correctable.

This is the other half of #2076: once setup stops asking for the organisation and workspace names, they stay at their seeded values, so this control is what makes those defaults correctable.
Author
Owner

Implemented in 064eeab74 and b868d450b.

  • The single binary serves the organisation routes the Organisation area needs: list and get, workspace list and create, and owner-only renames of the organisation and each workspace. Creating a workspace needs owner or admin.
  • A rename changes only the display label and its revision. IDs, memberships, policies, records and workspace environments are untouched. The revision the caller read is required, so a stale save answers 409 instead of overwriting.
  • Each rename appends the actor, time, old name and new name to governance.org_events in the same transaction as the change. A save with the current name writes nothing.
  • Organisation → Name changes lists those events with the actor and time. The unified Audit page is still part of the audit-feed migration, so it stays hidden on this binary.
  • Fixed a dashboard deep-link race found while verifying this: a route could be replaced by the landing page while the router was still resolving it.

Verified with task check on the committed tree, an API smoke run against a disposable database (owner rename, workspace rename, stale 409, control and bidi characters 400, shared token 403, another org 404, names and history persisted across a restart), and browser checks of the rename dialogs, the topbar update, the conflict retry, and the history rows.

Implemented in 064eeab74 and b868d450b. - The single binary serves the organisation routes the Organisation area needs: list and get, workspace list and create, and owner-only renames of the organisation and each workspace. Creating a workspace needs owner or admin. - A rename changes only the display label and its revision. IDs, memberships, policies, records and workspace environments are untouched. The revision the caller read is required, so a stale save answers 409 instead of overwriting. - Each rename appends the actor, time, old name and new name to governance.org_events in the same transaction as the change. A save with the current name writes nothing. - Organisation → Name changes lists those events with the actor and time. The unified Audit page is still part of the audit-feed migration, so it stays hidden on this binary. - Fixed a dashboard deep-link race found while verifying this: a route could be replaced by the landing page while the router was still resolving it. Verified with task check on the committed tree, an API smoke run against a disposable database (owner rename, workspace rename, stale 409, control and bidi characters 400, shared token 403, another org 404, names and history persisted across a restart), and browser checks of the rename dialogs, the topbar update, the conflict retry, and the history rows.
sam closed this issue 2026-11-20 10:14:18 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#2077