Skip to content

[HIGH PRIORITY] fix(metadata-admin): RoleSchema → PositionSchema in clientValidation.ts (ADR-0090 D3) #2365

Description

@akarma-synetal

Problem

@object-ui/app-shell's tsc build fails when @objectstack/spec resolves to a version that includes ADR-0090 D3 (the RoleSchemaPositionSchema rename):

src/views/metadata-admin/clientValidation.ts:101:66 - error TS2339:
Property 'RoleSchema' does not exist on type
'typeof import("@objectstack/spec/identity")'.

The deployment on objectstack-ai/objectui currently passes because its dependency tree resolves an older @objectstack/spec that still exports RoleSchema. Projects that vendor framework HEAD (like proaero-erp) hit this at build time.

Root cause

ADR-0090 D3 renamed RoleSchema to PositionSchema in @objectstack/spec/identity. The word "role" is now reserved-forbidden across the platform — capability = permission_set, distribution = position, hierarchy = business_unit. clientValidation.ts line 101 still references the old name:

// current (broken)role: async()=>(awaitimport('@objectstack/spec/identity')).RoleSchemaasunknownasZodLikeSchema,

Fix

// fixedrole: async()=>(awaitimport('@objectstack/spec/identity')).PositionSchemaasunknownasZodLikeSchema,

Same pattern as #2098 which dropped the policy loader for the exact same reason in the same file. PositionSchema is a drop-in replacement — same shape, same validation role, just renamed.

Verification

  • PositionSchema confirmed present in @objectstack/spec/identity dist
  • RoleSchema confirmed absent from every subpath export
  • ✅ Built locally with framework HEAD vendored → tsc passes clean
  • ✅ No other consumer in the repo references RoleSchema from @objectstack/spec/identity

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions