orgs: design membership, access, and ownership of sources, bindings and workflows #1389

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

Archie has no org concept. docs/prds/event-automation.md needs an org to own workflows and their enabled state; the org model itself (membership, access, which org owns a source or binding) needs its own design doc before t2db.42.


Imported from beads archie-core-ixe5 · GitHub #1087 · type task · priority P2 · created 2026-09-23

Archie has no org concept. docs/prds/event-automation.md needs an org to own workflows and their enabled state; the org model itself (membership, access, which org owns a source or binding) needs its own design doc before t2db.42. --- _Imported from beads `archie-core-ixe5` · GitHub #1087 · type task · priority P2 · created 2026-09-23_
sam added the mediumtask labels 2026-10-27 13:40:12 +00:00
sam self-assigned this 2026-10-27 13:40:12 +00:00
Author
Owner

Triaged: no code change is needed for this. No code change. The issue is a design task — "design membership, access, and ownership of sources, bindings and workflows" as a doc "before t2db.42" — and that design is both approved and already implemented in this tree.

What I checked:

  1. Approved design exists. prompts/organisation-automation/00-start-here.md states "The maintainer approved the architecture below" and carries the ownership table: Organisation owns "Members, execution identities, external connections, model configuration, workflows, schedules, channels"; Workspace "groups organisation work and resources; initially inherits organisation permissions". prompts/organisation-automation/03-organisation-ownership.md scopes exactly the resources this issue names: "workflow definitions/enablement, schedules, channel settings, event sources/bindings". So the "which org owns a source or binding" question has a settled, approved answer, not an open one.

  2. Membership and access are implemented, not planned. internal/domain/org/org.go defines Org, Workspace, Membership (owner/admin/developer/viewer, workspace-scoped or org-scoped) and AgentAssignment; proto/state/v1/org.proto exposes org/workspace/member RPCs; proto/state/v1/access.proto plus internal/domain/access define a Cedar chain (instance → org → workspace → object) with object kinds including source, event_type, mapping, binding, workflow and capture. Migrations 0013/0016/0033/0042 create orgs, workspaces, memberships, org_agents and access policies, and backfill pre-org rows. Enforcement is documented with its regression tests in docs/security/authorization.md ("Org membership/workspaces/agent assignment", "Incoming webhooks ... derive source/org from stored source").

  3. Ownership of sources, bindings and workflows is implemented. Migration 0014_edastore_orgs.sql puts org_id and workspace_id on sources, event_types, mappings, bindings, captures and tool_calls; internal/domain/binding/binding.go records OrgID with the note that "the store sets it and a binding may target only a workflow that org has enabled"; internal/domain/workflow/task/enablement.go stores per-org disabled-workflow state; internal/daemon/workflow_org.go resolves a task's workflow definitions in its own org and parks on mismatch; WorkflowDefinitionsKind is not in instanceOnlyKinds (internal/infrastructure/controlplanestore/org_models.go), i.e. workflow definitions are org resources. Dashboard and e2e cover it (internal/webui/orgs.go, internal/webui/org_selection.go, ui/src/org/org.ts, e2e/checks/org-pages.cjs, org-selector.cjs).

Nothing is broken, so tdd does not apply, and nothing remains to build that this issue would authorise.

One real gap, but it is not this issue's work: docs/prds/orgs-and-access.md is cited as the authority by roughly ten proto and code comments (proto/state/v1/org.proto, access.proto, package.proto, alert.proto, types.proto, internal/domain/storecontract/resource.go, docs/prds/external-agent-harness.md) but is not in the tree — docs/prds holds only self-development-loop.md and external-agent-harness.md, while code cites ~12 PRD filenames. Either the PRDs live outside this checkout or the references are dangling; I could not tell which from read-only tools. That is a documentation-reference fix, not a design to reopen, and it should be filed separately if the maintainer wants it.

Triaged: no code change is needed for this. No code change. The issue is a design task — "design membership, access, and ownership of sources, bindings and workflows" as a doc "before t2db.42" — and that design is both approved and already implemented in this tree. What I checked: 1. Approved design exists. prompts/organisation-automation/00-start-here.md states "The maintainer approved the architecture below" and carries the ownership table: Organisation owns "Members, execution identities, external connections, model configuration, workflows, schedules, channels"; Workspace "groups organisation work and resources; initially inherits organisation permissions". prompts/organisation-automation/03-organisation-ownership.md scopes exactly the resources this issue names: "workflow definitions/enablement, schedules, channel settings, event sources/bindings". So the "which org owns a source or binding" question has a settled, approved answer, not an open one. 2. Membership and access are implemented, not planned. internal/domain/org/org.go defines Org, Workspace, Membership (owner/admin/developer/viewer, workspace-scoped or org-scoped) and AgentAssignment; proto/state/v1/org.proto exposes org/workspace/member RPCs; proto/state/v1/access.proto plus internal/domain/access define a Cedar chain (instance → org → workspace → object) with object kinds including source, event_type, mapping, binding, workflow and capture. Migrations 0013/0016/0033/0042 create orgs, workspaces, memberships, org_agents and access policies, and backfill pre-org rows. Enforcement is documented with its regression tests in docs/security/authorization.md ("Org membership/workspaces/agent assignment", "Incoming webhooks ... derive source/org from stored source"). 3. Ownership of sources, bindings and workflows is implemented. Migration 0014_edastore_orgs.sql puts org_id and workspace_id on sources, event_types, mappings, bindings, captures and tool_calls; internal/domain/binding/binding.go records OrgID with the note that "the store sets it and a binding may target only a workflow that org has enabled"; internal/domain/workflow/task/enablement.go stores per-org disabled-workflow state; internal/daemon/workflow_org.go resolves a task's workflow definitions in its own org and parks on mismatch; WorkflowDefinitionsKind is not in instanceOnlyKinds (internal/infrastructure/controlplanestore/org_models.go), i.e. workflow definitions are org resources. Dashboard and e2e cover it (internal/webui/orgs.go, internal/webui/org_selection.go, ui/src/org/org.ts, e2e/checks/org-pages.cjs, org-selector.cjs). Nothing is broken, so tdd does not apply, and nothing remains to build that this issue would authorise. One real gap, but it is not this issue's work: docs/prds/orgs-and-access.md is cited as the authority by roughly ten proto and code comments (proto/state/v1/org.proto, access.proto, package.proto, alert.proto, types.proto, internal/domain/storecontract/resource.go, docs/prds/external-agent-harness.md) but is not in the tree — docs/prds holds only self-development-loop.md and external-agent-harness.md, while code cites ~12 PRD filenames. Either the PRDs live outside this checkout or the references are dangling; I could not tell which from read-only tools. That is a documentation-reference fix, not a design to reopen, and it should be filed separately if the maintainer wants it.
sam closed this issue 2026-11-08 12:44:21 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sam/archie#1389