Org contract and archie-ui API: orgs, workspaces, members, agent assignments #307
Notifications
Due Date
No due date set.
Blocks
Reference: sam/archie#307
Reference in new issue
Block a user
Goal
Expose orgs, workspaces, memberships and agent assignments over the State Store gRPC contract and archie-ui's HTTP API, read and write, so the dashboard can build org pages.
Context
internal/domain/org/store.go(Repository: CreateOrg, GetOrg, ListOrgs, CreateWorkspace, ListWorkspaces, EnsureMembership, AssignAgent, OrgForIdentity), Postgres implinternal/infrastructure/postgres/orgs.go, queriesqueries/orgs.sql.proto/state/v1/state.proto(ListPolicies/PutPolicy), serverinternal/infrastructure/staterpc/access.go, client methods ininternal/infrastructure/staterpc/client.go, HTTPinternal/webui/api_access_policies.go, routesinternal/webui/server.go, authorizationinternal/webui/authorize.go(accessRequestmaps a route to action/kind).org.OrgFromContext(ctx)(set by the authorize wrapper).Steps
queries/orgs.sql: ListMembers(org_id) joined with identities (id, display name, kind), RemoveMembership(identity_id, org_id, workspace_id), ListOrgAgents(org_id).task db:generate. Add matching Repository methods + Postgres impl.task proto:generate.server.go:Map them in
authorize.goto kindorgwith read/update. Roles must be one of owner, admin, developer, viewer (validate in the domain).api.orgs*methods toui/src/lib/api.ts(no UI pages; that is archie-core-kgxw.3).Out of scope
Any dashboard page. Instance admin / seeing other orgs. Workspace placement of records. OIDC subject binding.
Stop when
curl(shared token) can list your org, its workspaces and members, add a membership, change its role and remove it.task checkpasses.feat(org): org, workspace and membership API, close the bead. Stop.Rules for this ticket
bd create(one line of why) and carry on. Do not fix it.task checkonce at the end. If it fails twice on the same problem, stop and write what failed in a bead comment (bd comments add <id> "...") instead of looping.Close reason
Closed
Imported from beads
archie-core-kgxw.2· GitHub #1277 · type feature · priority P1 · created 2026-10-05 · closed 2026-10-05