Repository navigation
fix(auth): label the external organization role objectstack#25515 added, so the console type-checks against objectstack main (objectui#13427) - #13429
Conversation
…ed, so the console type-checks against objectstack main (objectui#13427) objectstack#25515 (objectstack#25233 stage 1, ruling 6355206139 letter B) added `external` to @objectstack/spec's BUILTIN_MEMBERSHIP_ROLES. The exhaustive ORG_ROLE_LABELS table no longer type-checked there (TS2741 at packages/auth/src/org-roles.ts:67), which turned objectstack main's Console Pin Gate and Spec Shape Gate red. - @object-ui/auth exports ORG_ROLE_EXTERNAL and labels it (organization.roles.external, "External"); every locale pack carries the key (zh 外部成员, as the server's sys_member.role option reads). - An issuer below admin grade is offered the roles any issuer may confer, member and external, as the spec's invitation grant table reads (E3). - external grades as member on the ladder, as objectstack's cap does, so it never unlocks an administrative affordance. objectui's .objectstack-sha stays at 915e9404, before objectstack#25483, until objectstack#25251's spec PR lands. So the role is spelled locally and ORG_ROLE_LABELS is keyed by OrgRole | typeof ORG_ROLE_EXTERNAL, which compiles against both vocabularies; a tripwire test goes red on the pin move that brings #25515 and lists the swap to the spec constant. Claude-Session: https://claude.ai/code/session_01JtDJkBUiZnD9NWnDqYuhq7 Co-authored-by: Claude <noreply@anthropic.com>
|
changeset-claim-re-read
|
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
|
os-dev-report {
"issue": 13427,
"status": "done",
"branch": "claude/issue-13427-external-role-label",
"pr": "https://github.com/objectstack-ai/objectui/pull/13429",
"session": "session_01JtDJkBUiZnD9NWnDqYuhq7",
"premise_still_valid": true,
"summary": "objectstack#25515 added external to the spec membership vocabulary; ORG_ROLE_LABELS (exhaustive over OrgRole) no longer type-checked against objectstack main. @object-ui/auth now exports ORG_ROLE_EXTERNAL with a label row (organization.roles.external, External) and every locale pack carries the key (zh 外部成员, as the server's sys_member.role option). Choice 1, pickers: ORG_ROLES stays the spec list unfiltered; a below-admin issuer (delegated admin, unresolved caller) is offered the roles any issuer may confer, member and external, which is what the spec's INVITATION_ROLE_GRANTORS 'any' rows say (ruling 6355206139 E3); owner/admin may set external from the members page; E5/E6 refusals stay server-side. Choice 2, ladder: external grades as member, exactly as plugin-auth invitation-role-cap.ts grades it, so it never unlocks an administrative affordance. Per the coordinator (21:26Z), objectui's .objectstack-sha stays at 915e9404 because objectstack#25251's spec PR2 has not landed and any pin carrying #25515 also carries #25483; so the role is spelled as a local literal and ORG_ROLE_LABELS is keyed by OrgRole or typeof ORG_ROLE_EXTERNAL, which compiles against both vocabularies. A tripwire test goes red on the pin move that brings #25515 and names the swap.",
"tests": "At the pin 915e9404: vitest packages/auth/src/__tests__/, packages/app-shell/src/console/organizations/, packages/i18n/, apps/console/src/pages/system/ = 168 files, 2019 passed, 13 skipped, 0 failed. Against objectstack main 5ea211cc (pin built there, not committed): the role tests ran 159 passed, 6 failed, all expected (the tripwire plus five literal role lists that the pin move updates; their received values show owner offered 5 roles, delegate offered member and external, dropdowns ending 外部成员 / External). Ablation on the main build: restoring the old below-admin offer turns the grant-table test red.",
"gates": "Type check: turbo build auth+i18n then type-check console/auth/app-shell/i18n, exit 0, 39/39 tasks, both at the pin and against objectstack main 5ea211cc. eslint on changed files: 0 errors. Local repo checks exit 0: check:i18n-keys, i18n-drift, i18n-dead-keys, changeset-claims, pending-changeset-literals, spec-symbols, new-line-citations, control-bytes, installed-pin-claims, vi-mock-specifiers, vi-mock-inherit, vi-mock-override-shape, test-path-roots. check:readme-exports exit 1 = prerequisite (27 packages unbuilt, population below floors), not a verdict. CI on head 8a13d9bf: 33 success, 3 skipped, 0 failed; mergeable_state clean.",
"line_budget": "14 files, +177/-19 vs origin/main b317942; non-test source: org-roles.ts +65/-12, ten locale packs +1 each",
"files_changed": "packages/auth/src/org-roles.ts; packages/auth/src/__tests__/org-roles.test.ts; packages/app-shell/src/console/organizations/__tests__/org-i18n-holdouts-4474.test.tsx; packages/i18n/src/locales/{ar,de,en,es,fr,ja,ko,pt,ru,zh}.ts; .changeset/13427-external-org-role.md",
"deviations": "File surface is NARROWER than the claim: the claim listed a .objectstack-sha move (and .objectstack-pin manifests); the coordinator held the pin, so neither changed. InviteMemberDialog.roleCap.test.tsx, listed under the organizations tests, is unchanged. Changeset: @object-ui/auth minor (new export), @object-ui/i18n patch.",
"mcp_calls": "0 GitHub MCP writes (reads only: issue_read, pull_request_read; subscribe_pr_activity is a session subscription)",
"api_writes": "5, all through the fleet-write relay: labels+assignee on #13427 (label-write), claim comment 6374956587 (post-stamped), pr_create #13429 with assignee os-sales, pr_request_reviewers os-sales, and this report",
"open_questions": [],
"out_of_scope_findings": [
"class: c · reach: console profile page — apps/console ProfilePage's access word is two-way (admin or member from useWorkspaceAdminStatus), so an external user reads Member / 成员 there; showing External would need the hook to expose the external grade · dedupe words: profile access label external",
"class: c · reach: doc only — packages/app-shell/src/console/organizations/orgRoleLabel.ts docblock still says the four roles · dedupe words: orgRoleLabel four roles docblock",
"carrier: PR #13429 body · noted, not filed"
]
}Generated by Claude Code |
Contract reviewServed-tier: Face: the ① Derived judgmentsThe diff adds one public export and widens one public table. No existing member changes.
This is a label and an offer, not an access control: the server's cap and its exclusive-role and business-unit refusals (ruling E5, E6) still decide, and their refusals reach the screen through the existing error path. ② Semver levelThe changeset declares ③ Boundary flags
Implemented-by: VERDICT: PASS |
席位核对ACCEPT — objectui#13427 (p1,卡线程交付), head Seat: domain:ui#1 · Clause-②: yes
|
Requested by Sales · project thread
Closes #13427
Clause-②: yes (follows objectstack#25515's widening: a new
ORG_ROLE_EXTERNALexport andORG_ROLE_LABELSrow in@object-ui/auth, a neworganization.roles.externalkey in each shipped pack; no acceptance set of objectui's own widens)What changed
objectstack#25515 (objectstack#25233 stage 1, ruling of record 6355206139, letter B) added
externalto@objectstack/spec'sBUILTIN_MEMBERSHIP_ROLES.ORG_ROLE_LABELSis aRecordover that vocabulary, so the console stopped type-checking against objectstackmain(TS2741atpackages/auth/src/org-roles.ts:67), and objectstack's Console Pin Gate and Spec Shape Gate went red. This PR makes the console know the role:packages/auth/src/org-roles.ts: a newORG_ROLE_EXTERNALexport, its label row (organization.roles.external, "External"), and the any-issuer rule for invitations (below).packages/i18n/src/locales/carriesorganization.roles.external. zh is 外部成员, ja 外部メンバー and es Externo, the words objectstack's ownsys_member.roleoption uses; de, fr, ko, pt, ru and ar follow each pack's word formember.The two choices the card asked for
ORG_ROLESstays the spec list unfiltered, soexternalappears in the invite dialog and in the members page's role menu wherever the spec lists it. The invite offer for an issuer below admin grade (a delegated admin, or a caller whose membership has not loaded) becomesmemberandexternal. That mirrors the framework's invitation cap: in the spec's grant table (INVITATION_ROLE_GRANTORS) both rows read'any', becauseexternalconfers less than a member (ruling E3). An owner or admin may also set it from the members page, as better-auth'supdate-member-roleallows. Two server refusals are not pre-empted, because the screen cannot see what they read: a role list mixingexternalwith another role (E5; the menu sets one role) and re-roling a member who is placed in a business unit (E6).membergrade, as objectstack's own cap ladder (invitation-role-cap.ts) grades it. The console ladder answers only "is this an administrative grade", soexternalnever unlocks invite, remove, cancel or re-role. That it reaches less than a member is enforced server-side; a rung belowmemberhere would have no reader.Why the pin does not move, and the literal
Importing the spec's
MEMBERSHIP_ROLE_EXTERNALneeds objectui's own.objectstack-shapast objectstack#25515. Any such pin also carries objectstack#25483, PR1 of objectstack#25251, whose PR2 (spec lane) has not landed; this project keeps objectui's pin before #25483 until it does. So the pin stays at915e9404, and the console compiles against both vocabularies:ORG_ROLE_EXTERNAL = 'external'is spelled locally, with a docblock pointing at objectstack#25515.ORG_ROLE_LABELSis typedRecord<OrgRole | typeof ORG_ROLE_EXTERNAL, …>. Againstmainthe union isOrgRoleitself, so the table stays exhaustive there.spells external itself only while the pin predates objectstack#25515) goes red on the pin move that brings #25515. Its message lists the follow-up: import the constant, drop the union, addexternalto the role lists thatInviteMemberDialog.roleCap.test.tsxandorg-i18n-holdouts-4474.test.tsxexpect, and delete the tripwire.Tests
org-roles.test.ts: the external label row; external grades asmemberand below admin; an external actor may re-role nobody; an admin may re-role an existing external; and the invite offer equals what the spec's grant table admits, for owner, admin and every below-admin issuer. That last pin holds at either spec, and againstmainit asserts['member', 'external']for a delegate.org-i18n-holdouts-4474.test.tsx: every pack definesorganization.roles.external, and an external member's badge reads 外部成员 in zh and External in en.Verification
Measured in this container, in the worktree on this branch:
main5ea211cc(the pin built at that commit, nothing committed):turbo run build --filter=@object-ui/auth --filter=@object-ui/i18n, thenturbo run type-checkfor@object-ui/console,@object-ui/auth,@object-ui/app-shell,@object-ui/i18n: exit 0, 39/39 tasks (console runstsc --noEmitandtsc -b tsconfig.node.json, app-shell its test tsconfig too).vitest runonorg-roles.test.tsplusconsole/organizations/__tests__/: 159 passed, 6 failed, all six expected. The tripwire is one of them. The other five are the existing literal role lists, whose received values show the new behaviour: owner offered 5 roles, delegate and unloaded offered['member', 'external'], and the zh and en dropdowns ending in 外部成员 and External. Ablation on the same build: restoring the old below-admin offer ([ORG_ROLE_MEMBER]) turnsoffers exactly what the spec grant table admitsred.915e9404(afterpnpm run setup;objectstack-pin statusreads the cache at the pin): the same build and type-check, exit 0, 39/39 tasks;vitest run packages/auth/src/__tests__/ packages/app-shell/src/console/organizations/ packages/i18n/ apps/console/src/pages/system/: 168 files, 2019 passed, 13 skipped, 0 failed.eslinton the changed files: 0 errors (17 warnings, all pre-existinganylines in the holdouts test's mocks).check:i18n-keys,check:i18n-drift,check:i18n-dead-keys,check:changeset-claims,check:pending-changeset-literals,check:spec-symbols,check:new-line-citations,check:control-bytes,check:installed-pin-claims,check:vi-mock-specifiers,check:vi-mock-inherit,check:vi-mock-override-shape,check:test-path-roots.check:readme-exportsanswered exit 1 as a prerequisite, not a verdict: 27 packages were unbuilt, so its population collapsed below its floors. CI runs it after the build.Notes
Branch
claude/issue-13427-external-role-label, worktreeobjectui-issue-13427, claim 6374956587 (Seat:domain:ui#1).After this merges, chore(console): move the objectui pin past the
externalorg-role fix (objectui#13427), so Console Pin Gate and Spec Shape Gate go green again after #25515 — before the 18.1.0 merge objectstack#25537 moves objectstack's.objectui-shapast it, which greens Console Pin Gate and Spec Shape Gate.Not changed, outside the surface: the profile page's access word is two-way (admin or member, from
useWorkspaceAdminStatus), so an external user reads 成员 / Member there.orgRoleLabel.ts's docblock still says "the four" roles.Adds no product-specific widget, dialog, hook or string (see AGENTS.md › Product-neutral renderer)
Session:
https://claude.ai/code/session_01JtDJkBUiZnD9NWnDqYuhq7Generated by Claude Code
🤖 Generated with Claude Code
https://claude.ai/code/session_01JtDJkBUiZnD9NWnDqYuhq7