Skip to content

Approver membership-tier select hardcodes three tiers — delegated_admin is not offered and a stored value renders "(invalid)" #5309

Description

@os-elon

Found while implementing objectstack-ai/objectstack#9806 (framework ruling: ORG_MEMBERSHIP_LEVELS is now derived from BUILTIN_MEMBERSHIP_ROLES, so the org_membership_level approver vocabulary is the whole four-value sys_member.role set — owner / admin / delegated_admin / member). Out of that card's scope (objectui is a separate repo); filed unassigned. Source read only at 7260a1ed4439 — nothing measured in a running Studio.

The stale copies

packages/app-shell/src/views/metadata-admin/inspectors/FlowReferenceField.tsx:169 hand-spells the tier options:

  • ORG_MEMBERSHIP_LEVEL_OPTIONS = Owner / Admin / Member (three values), with a doc comment attributing the set to better-auth ("only ever accepts these three"). delegated_admin is ObjectStack's own ADR-0105 D8 addition, enforced on sys_member.role since it landed.
  • The strict select for kind === 'org-membership-level' (same file, ~line 646) renders only this hardcoded list — the server-published enum source (source: { source: 'enum', values } from APPROVER_VALUE_SOURCES, the framework#3508 follow-up annotation this same file already carries for record lookups) is not consulted on the enum path.

Consequences once the four-value vocabulary is live server-side:

  1. delegated_admin cannot be picked — the picker offers a quarter less than the column stores and the framework schema publishes.
  2. A stored { type: 'org_membership_level', value: 'delegated_admin' } row renders as delegated_admin (invalid) — actively mislabeling a spec-valid, runtime-resolvable approver.

Secondary echoes of the three-value list, same repo:

  • inspectors/flow-node-config.ts:634 — picker label 'Organization membership (owner/admin/member)'.
  • inspectors/flow-node-config.ts:59 — comment "enum (owner/admin/member) rendered as a STRICT select".

Suggested direction (not prescriptive)

Prefer the schema's own published enum (resolveRefKind's source.values) when present — the precedence rule the file already states for record lookups — and keep the hardcoded list only as the fallback for a server predating the annotation; update the fallback and the labels to the four-value set either way. Test fixtures that pin values: ['owner', 'admin', 'member'] (FlowReferenceField.sources.test.tsx:83-96) are fixture inputs, not refusal pins, but any new preference logic should pin that a server-published four-value enum wins over the fallback.

Framework-side derivation and pins: objectstack-ai/objectstack#9806 (spec ORG_MEMBERSHIP_LEVELS = BUILTIN_MEMBERSHIP_ROLES, wire projection APPROVER_VALUE_SOURCES.org_membership_level.values now four values).


Generated by Claude Code

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions