refactor(auth): derive the org-role vocabulary from @objectstack/spec instead of mirroring it - #3038
Merged
Merged
Conversation
… instead of mirroring it The four ORG_ROLE_* constants become re-exports of the spec's MEMBERSHIP_ROLE_* literals, OrgRole becomes BuiltinMembershipRole, and ORG_ROLES becomes [...BUILTIN_MEMBERSHIP_ROLES] — the same constant the enforced sys_member.role select is built from, so the console's list can no longer drift from what the server accepts. Unblocked by @objectstack/spec@17.0.0-rc.0 (first release carrying framework ADR-0108's closed vocabulary) and the workspace's move to ^17.0.0-rc.0. ORG_ROLE_LABELS and the grade ladder stay console-owned per ADR-0108 D4; the #2907 drift guard is dropped — a derived list cannot drift. Closes #2908 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
|
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #2908 — the follow-up #2907 recorded as blocked. All three unblock conditions now hold:
sys_member.rolevocabulary (ADR-0108, #3723) objectstack#3802).@object-ui/authnow depends on@objectstack/spec(this PR,^17.0.0-rc.0like every other package).@objectstack/spec@17.0.0-rc.0on npm shipsBUILTIN_MEMBERSHIP_ROLES/MEMBERSHIP_ROLE_*, verified against the installed dist. The^16 → ^17sequencing wrinkle the issue flagged resolved itself when the workspace moved to^17.0.0-rc.0.What changed
ORG_ROLE_*consts are now rename-re-exports of the spec'sMEMBERSHIP_ROLE_*literals;OrgRole=BuiltinMembershipRole;ORG_ROLES=[...BUILTIN_MEMBERSHIP_ROLES](the spec array is already in the display order the screens use — verified identical values and order at runtime).ORG_ROLE_LABELSand the grade ladder (orgRoleGrade,invitableOrgRoles,assignableOrgRoles) — console concerns (i18n keys, screen-narrowing), per ADR-0108 D4.is EXACTLY the framework four) — a derived list cannot drift. The feat(console): makedelegated_adminreachable and narrow both role pickers (framework#3697) #2891toContain(delegated_admin)test stays, reframed: it pins a console decision (ORG_ROLESis the spec list unfiltered), which types don't enforce.@object-ui/authis unchanged (same names, same literal types);app-shellconsumers type-check untouched.Verification
vitest run packages/auth— 8 files, 106 tests pass@object-ui/auth+@object-ui/app-shelltype-check pass; lint 0 errors (no new warnings)zod@3peer-variant fork (grep -c "zod@3.25.76))" pnpm-lock.yaml→ 0)BUILTIN_MEMBERSHIP_ROLES=["owner","admin","delegated_admin","member"]from the installed package🤖 Generated with Claude Code