access: orgs, workspaces, people as identities, org_id/workspace_id on every record #1294

Closed
opened 2026-10-27 13:39:48 +00:00 by sam · 1 comment
Owner

Orgs and workspaces (with optional environment attribute); people as identities of kind user via the existing SubjectBinding; memberships and per-workspace roles referencing identity IDs; agent identities assigned to orgs; org_id and workspace_id on every owned record in the State Store and edastore; resumable default org/workspace upgrade after backup, State Store first then edastore, scoped calls refused until done; idempotency key org/identity/owner/repo/number produced in one place for poll, webhook and review envelopes, with task uniqueness to match. Design: docs/prds/orgs-and-access.md (Approved).

Notes

2026-09-24: storage decided as Postgres (epic archie-core-7r0x). Build orgs on Postgres: orgs, workspaces, memberships tables via goose/sqlc; org_id/workspace_id columns with row-level security keyed by a per-transaction setting derived from the caller's credential; instance service role bypasses RLS and is audited. Slugs are no longer needed for cross-store keys. The store-independent internal/domain/org package (types, validation, tests) is uncommitted in the working tree on eda/event-automation.

Close reason

done


Imported from beads archie-core-e5fn · GitHub #1028 · type task · priority P1 · created 2026-09-23 · closed 2026-09-28

Orgs and workspaces (with optional environment attribute); people as identities of kind user via the existing SubjectBinding; memberships and per-workspace roles referencing identity IDs; agent identities assigned to orgs; org_id and workspace_id on every owned record in the State Store and edastore; resumable default org/workspace upgrade after backup, State Store first then edastore, scoped calls refused until done; idempotency key org/identity/owner/repo/number produced in one place for poll, webhook and review envelopes, with task uniqueness to match. Design: docs/prds/orgs-and-access.md (Approved). ### Notes 2026-09-24: storage decided as Postgres (epic archie-core-7r0x). Build orgs on Postgres: orgs, workspaces, memberships tables via goose/sqlc; org_id/workspace_id columns with row-level security keyed by a per-transaction setting derived from the caller's credential; instance service role bypasses RLS and is audited. Slugs are no longer needed for cross-store keys. The store-independent internal/domain/org package (types, validation, tests) is uncommitted in the working tree on eda/event-automation. ### Close reason done --- _Imported from beads `archie-core-e5fn` · GitHub #1028 · type task · priority P1 · created 2026-09-23 · closed 2026-09-28_
sam added the hightask labels 2026-10-27 13:39:48 +00:00
sam self-assigned this 2026-10-27 13:39:48 +00:00
sam closed this issue 2026-10-27 13:39:48 +00:00
Author
Owner

sam wrote (originally 2026-09-26):

Step 1 delivered on crew/e5fn (5 commits, task check green, not merged to main): (1) internal/domain/org — orgs, workspaces, memberships with per-workspace roles, agent assignments, the store Repository + Upgrader contracts; (2) migrations 0012/0013 — orgs/workspaces/memberships/org_agents/org_upgrades tables, org_id+workspace_id on every state-store owned record (tasks, events, transitions, resources, resource_history) and every edastore owned record (bindings, mappings, captures, sources, event_types, tool_calls); task uniqueness moved to (org_id, identity, owner, repo, issue_number); (3) postgres Store implements org.Repository + the resumable default upgrade (state_store phase then edastore phase, ledger-recorded per transaction, run at State Store boot before serving, fail closed); (4) idempotency key org/identity/owner/repo/number produced in one place (workintake envelopes), task proto carries org. Remaining for later delivery steps: producer-side org resolution at publish time (needs an org RPC on the State Store client — lands with cp84's credentials), RLS keyed per transaction (no principal credentials exist yet), org-scoped TaskByIssue lookups (qc8p access chain).

_sam wrote (originally 2026-09-26):_ Step 1 delivered on crew/e5fn (5 commits, task check green, not merged to main): (1) internal/domain/org — orgs, workspaces, memberships with per-workspace roles, agent assignments, the store Repository + Upgrader contracts; (2) migrations 0012/0013 — orgs/workspaces/memberships/org_agents/org_upgrades tables, org_id+workspace_id on every state-store owned record (tasks, events, transitions, resources, resource_history) and every edastore owned record (bindings, mappings, captures, sources, event_types, tool_calls); task uniqueness moved to (org_id, identity, owner, repo, issue_number); (3) postgres Store implements org.Repository + the resumable default upgrade (state_store phase then edastore phase, ledger-recorded per transaction, run at State Store boot before serving, fail closed); (4) idempotency key org/identity/owner/repo/number produced in one place (workintake envelopes), task proto carries org. Remaining for later delivery steps: producer-side org resolution at publish time (needs an org RPC on the State Store client — lands with cp84's credentials), RLS keyed per transaction (no principal credentials exist yet), org-scoped TaskByIssue lookups (qc8p access chain).
sam added a new dependency 2026-10-27 13:42:05 +00:00
sam added a new dependency 2026-10-27 13:42:21 +00:00
sam added a new dependency 2026-10-27 13:42:22 +00:00
sam added a new dependency 2026-10-27 13:42:26 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Reference: sam/archie#1294