The four roles are declared in internal/domain/org/org.go and again in modules/governance/org.go, and the shipped policies (modules/governance/roles.go) spell the same four names inside Cedar source. Rows store role text, so the vocabulary reads as data while enforcement is code.
A fifth role means editing three files and re-seeding policies, and nothing catches the policy text drifting from the Go list.
Done when: the role names exist once, the shipped policies are built from that one list, and adding a role touches no policy text.
Whether an organisation can define its own roles is a product question, not part of this.
The four roles are declared in internal/domain/org/org.go and again in modules/governance/org.go, and the shipped policies (modules/governance/roles.go) spell the same four names inside Cedar source. Rows store `role text`, so the vocabulary reads as data while enforcement is code.
A fifth role means editing three files and re-seeding policies, and nothing catches the policy text drifting from the Go list.
Done when: the role names exist once, the shipped policies are built from that one list, and adding a role touches no policy text.
Whether an organisation can define its own roles is a product question, not part of this.
Verified against the tree; the filed premise was wrong, so closing.
The policy text is not a third copy: modules/governance/roles.go interpolates the Role constants (roleViewer = string(RoleViewer) and so on), so a renamed role changes the shipped policies with it. Nothing can drift there.
The real duplication is modules/governance's four names beside internal/domain/org's four. That package is imported by 28 packages across the old services, and moving it is the migration ledger's work (MIGRATION.md, #2024), not a bug.
Custom roles already work: governance.Role.Validate accepts any stable identifier and TestCustomRoleAndMemberStatePolicy pins that, so the four are starter names, not the whole vocabulary. The old dashboard still validates against the four, which dies with that service.
Reopen if the four starter names should become editable per organisation, which is a product question rather than duplication.
Verified against the tree; the filed premise was wrong, so closing.
The policy text is not a third copy: modules/governance/roles.go interpolates the Role constants (roleViewer = string(RoleViewer) and so on), so a renamed role changes the shipped policies with it. Nothing can drift there.
The real duplication is modules/governance's four names beside internal/domain/org's four. That package is imported by 28 packages across the old services, and moving it is the migration ledger's work (MIGRATION.md, #2024), not a bug.
Custom roles already work: governance.Role.Validate accepts any stable identifier and TestCustomRoleAndMemberStatePolicy pins that, so the four are starter names, not the whole vocabulary. The old dashboard still validates against the four, which dies with that service.
Reopen if the four starter names should become editable per organisation, which is a product question rather than duplication.
sam
removed the in-progress label 2026-11-20 16:42:34 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
The four roles are declared in internal/domain/org/org.go and again in modules/governance/org.go, and the shipped policies (modules/governance/roles.go) spell the same four names inside Cedar source. Rows store
role text, so the vocabulary reads as data while enforcement is code.A fifth role means editing three files and re-seeding policies, and nothing catches the policy text drifting from the Go list.
Done when: the role names exist once, the shipped policies are built from that one list, and adding a role touches no policy text.
Whether an organisation can define its own roles is a product question, not part of this.
Verified against the tree; the filed premise was wrong, so closing.
The policy text is not a third copy: modules/governance/roles.go interpolates the Role constants (roleViewer = string(RoleViewer) and so on), so a renamed role changes the shipped policies with it. Nothing can drift there.
The real duplication is modules/governance's four names beside internal/domain/org's four. That package is imported by 28 packages across the old services, and moving it is the migration ledger's work (MIGRATION.md, #2024), not a bug.
Custom roles already work: governance.Role.Validate accepts any stable identifier and TestCustomRoleAndMemberStatePolicy pins that, so the four are starter names, not the whole vocabulary. The old dashboard still validates against the four, which dies with that service.
Reopen if the four starter names should become editable per organisation, which is a product question rather than duplication.