feat(governance): let owners rename the organisation and workspaces

Adds the organisation routes the single binary's dashboard needs (list, get, workspace list and create) plus owner-only renames of the organisation and its workspaces. A rename is guarded by the version the caller read, writes only the display label, and appends an actor-attributed event in governance.org_events in the same transaction. The Organisation page shows those name changes, and a deep link is no longer replaced by the landing page while the router is still resolving it.

Refs #2077
This commit is contained in:
sam committed 2026-11-20 21:10:34 +11:00
1 parent 904c510246
commit 064eeab748
20 files changed
+1408 -34

No files matched your search

+390 -1
View File
@@ -614,6 +614,22 @@ components:
required:
- name
type: object
CreateWorkspaceInputBody:
additionalProperties: false
properties:
environment:
description: Free-form attribute policies can test
type: string
id:
description: Workspace ID, permanent for the workspace's life
type: string
name:
description: Display name
type: string
required:
- id
- name
type: object
DeliveriesAttempt:
additionalProperties: false
properties:
@@ -1121,6 +1137,98 @@ components:
- model
- answer
type: object
GovernanceOrgBody:
additionalProperties: false
properties:
org:
$ref: "#/components/schemas/GovernanceOrgView"
required:
- org
type: object
GovernanceOrgEvent:
additionalProperties: false
properties:
actor_id:
type: string
actor_name:
type: string
at:
format: date-time
type: string
id:
format: int64
type: integer
kind:
type: string
new_name:
type: string
old_name:
type: string
workspace_id:
type: string
required:
- id
- kind
- actor_id
- actor_name
- old_name
- new_name
- at
type: object
GovernanceOrgEventsBody:
additionalProperties: false
properties:
events:
items:
$ref: "#/components/schemas/GovernanceOrgEvent"
type:
- array
- "null"
required:
- events
type: object
GovernanceOrgView:
additionalProperties: false
properties:
id:
type: string
name:
type: string
role:
type: string
version:
format: int64
type: integer
required:
- id
- name
- version
type: object
GovernanceOrgsBody:
additionalProperties: false
properties:
current:
type: string
instance_admin:
type: boolean
member_orgs:
items:
type: string
type:
- array
- "null"
orgs:
items:
$ref: "#/components/schemas/GovernanceOrgView"
type:
- array
- "null"
required:
- orgs
- current
- instance_admin
- member_orgs
type: object
GovernancePasskey:
additionalProperties: false
properties:
@@ -1329,6 +1437,46 @@ components:
required:
- user
type: object
GovernanceWorkspace:
additionalProperties: false
properties:
environment:
type: string
id:
type: string
name:
type: string
org_id:
type: string
version:
format: int64
type: integer
required:
- id
- org_id
- name
- version
type: object
GovernanceWorkspaceBody:
additionalProperties: false
properties:
workspace:
$ref: "#/components/schemas/GovernanceWorkspace"
required:
- workspace
type: object
GovernanceWorkspacesBody:
additionalProperties: false
properties:
workspaces:
items:
$ref: "#/components/schemas/GovernanceWorkspace"
type:
- array
- "null"
required:
- workspaces
type: object
JudgementAction:
additionalProperties: false
properties:
@@ -1886,6 +2034,20 @@ components:
- code
type: object
RenameInputBody:
additionalProperties: false
properties:
expected_version:
description: The version the caller read, so a stale edit is refused
format: int64
type: integer
name:
description: The new display name
type: string
required:
- name
- expected_version
type: object
RenameInputBody1:
additionalProperties: false
properties:
title:
@@ -1894,6 +2056,20 @@ components:
required:
- title
type: object
RenameWorkspaceInputBody:
additionalProperties: false
properties:
expected_version:
description: The version the caller read, so a stale edit is refused
format: int64
type: integer
name:
description: The new display name
type: string
required:
- name
- expected_version
type: object
RunsActionTrail:
additionalProperties: false
properties:
@@ -3073,7 +3249,7 @@ paths:
content:
application/json:
schema:
$ref: "#/components/schemas/RenameInputBody"
$ref: "#/components/schemas/RenameInputBody1"
required: true
responses:
"200":
@@ -3993,6 +4169,219 @@ paths:
summary: Accept an MCP server and the tools it may offer
tags:
- MCP servers
/api/orgs:
get:
operationId: list-orgs
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GovernanceOrgsBody"
description: OK
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: List the organisation the caller acts in
tags:
- Organisations
/api/orgs/{id}:
get:
operationId: get-org
parameters:
- description: Organisation ID
in: path
name: id
required: true
schema:
description: Organisation ID
type: string
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GovernanceOrgBody"
description: OK
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: Get an organisation
tags:
- Organisations
patch:
operationId: rename-org
parameters:
- description: Organisation ID
in: path
name: id
required: true
schema:
description: Organisation ID
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RenameInputBody"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GovernanceOrgBody"
description: OK
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: Rename an organisation
tags:
- Organisations
/api/orgs/{id}/history:
get:
operationId: list-org-events
parameters:
- description: Organisation ID
in: path
name: id
required: true
schema:
description: Organisation ID
type: string
- description: How many changes to return, at most 200
explode: false
in: query
name: limit
schema:
default: 50
description: How many changes to return, at most 200
format: int64
type: integer
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GovernanceOrgEventsBody"
description: OK
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: List the organisation's name changes
tags:
- Organisations
/api/orgs/{id}/workspaces:
get:
operationId: list-org-workspaces
parameters:
- description: Organisation ID
in: path
name: id
required: true
schema:
description: Organisation ID
type: string
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GovernanceWorkspacesBody"
description: OK
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: List an organisation's workspaces
tags:
- Organisations
post:
operationId: create-org-workspace
parameters:
- description: Organisation ID
in: path
name: id
required: true
schema:
description: Organisation ID
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/CreateWorkspaceInputBody"
required: true
responses:
"201":
content:
application/json:
schema:
$ref: "#/components/schemas/GovernanceWorkspaceBody"
description: Created
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: Create a workspace
tags:
- Organisations
/api/orgs/{id}/workspaces/{workspace}:
patch:
operationId: rename-org-workspace
parameters:
- description: Organisation ID
in: path
name: id
required: true
schema:
description: Organisation ID
type: string
- description: Workspace ID
in: path
name: workspace
required: true
schema:
description: Workspace ID
type: string
requestBody:
content:
application/json:
schema:
$ref: "#/components/schemas/RenameWorkspaceInputBody"
required: true
responses:
"200":
content:
application/json:
schema:
$ref: "#/components/schemas/GovernanceWorkspaceBody"
description: OK
default:
content:
application/problem+json:
schema:
$ref: "#/components/schemas/ErrorModel"
description: Error
summary: Rename a workspace
tags:
- Organisations
/api/people:
get:
operationId: list-people