Skip to content

feat(server): add shared organization accounts and scoped access - #2974

Draft
PsiACE wants to merge 3 commits into
masterfrom
codex/organization-server
Draft

PsiACE wants to merge 3 commits into
masterfrom
codex/organization-server

Conversation

@PsiACE

@PsiACE PsiACE commented Dec 2, 2026

Copy link
Copy Markdown
Member

Which issue or RFC does this PR close?

Implements the Server portion of RFC #2857.

Rationale for this change

Let Server replicas share organization accounts, membership, and Scope authorization.

What changes are included in this PR?

  • POST /v1/org-bootstrap issues the first code. POST /v1/org-registration redeems a code for an account and personal Scope.
  • GET /v1/my/org-session resolves the active membership. PUT /v1/my/account-token rotates the account credential.
  • /v1/orgs/{slug} manages members, invitations, teams, and projects. Existing Access routes grant and revoke project Scope roles.

Are there any user-facing changes?

Each logical database hosts one organization. Deployment credentials and account tokens have distinct permissions. Background processing uses its service grant, and portable restore requires matching Scope ownership.

How was this change tested?

108 local tests passed for Server flows, API contracts, and schema migrations. Before merge, sync and qualify the Desktop contract for the new OpenAPI digest (see #2101). Two Desktop digest checks currently fail.

AI usage statement

OpenAI Codex assisted with implementation, tests, and PR preparation.

@hidb4ai hidb4ai left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[P2] Synchronize and qualify the Desktop contract before merging. I reproduced the two acknowledged failures in tests/test_desktop_contract.py::test_desktop_contract_identity_matches_openapi: both desktop/ui/src/generated/operations.ts and desktop/src-tauri/src/transport/operations.json retain the old OpenAPI digest after the organization API additions. Generate the matching Desktop manifests and complete the compatibility qualification described in #2101; the current head does not pass this repository contract gate.

@hireview001 hireview001 added the module:core Core: PR changes under src/ label Dec 2, 2026
@hireview001

Copy link
Copy Markdown
Collaborator

The affected modules are Core. @hidb4ai, please coordinate follow-up. Core: @hidb4ai @frf12 @Fengzdadi @beatenevo. Please coordinate the review of the affected changes.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

module:core Core: PR changes under src/

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants