Skip to content

finding(types): StylePropsSchema and StyleProps share a name and zero keys — the naming asserts a mirror relationship that does not exist #5928

Description

@claude

Found by the domain:ui execution seat while landing objectui#5684's parity guard (session 01EuPCi56cnGyykygi3z9w4m). Dedupe search run over the repo-scoped open-issue listing: no duplicate.

What

@object-ui/types publishes two unrelated things under one name:

  • StylePropsSchema (packages/types/src/zod/base.zod.ts) — { className?: string, style?: Record<string, string | number> }, described as 'Style properties'.
  • StyleProps (packages/types/src/base.ts) — a Tailwind-scale vocabulary: padding, margin, gap, backgroundColor, textColor, borderWidth, …

They share zero keys. Neither is a mirror of the other, but the naming says they are: everywhere else in this package the …Schema const IS the runtime mirror of the like-named TS declaration (ListItemSchema / ListItem, AlertSchema / AlertSchema, and ~160 more).

Why it is worth a card

It is a live trap for exactly the mechanism #5684 exists to guard. Building that guard's registry by name pairing put these two together, and the pair reported five keys of phantom drift on a mirror that has no counterpart at all. A non-vacuity assertion (assertionEveryPairOverlaps) caught it because the overlap is empty — but only because it happens to be totally disjoint. A future name collision with partial overlap would report drift that is not drift, and there is no mechanical defence against that.

The same shape already cost a measurement once in this package: the const named FieldConstraintsSchema mirrors FieldValidationRules, not the like-named legacy FieldConstraints in field-types.ts (the flat dialect #5186 withdrew). Its own docstring is the only thing that says so.

Options

  1. Rename the zod const to say what it is (e.g. ClassNameStylePropsSchema) — cheap, but it is a published export, so a deprecation window applies.
  2. Rename the TS StyleProps — larger blast radius; it is referenced across component prop types.
  3. Leave the names and rely on the exclusion entry [finding] The anti-drift guard #5680 adds covers BaseSchema only — the ~17 sibling zod mirrors have nothing equivalent, and the class already has two confirmed instances #5684 added, which records the collision with its reason.

No recommendation attached — this is observation-class. Both names are published, so either rename is a contract change.

Recorded for now in packages/types/src/__tests__/zod-mirror-parity.test.ts's EXCLUSIONS, keyed base.zod.ts#StylePropsSchema, with the collision spelled out.

Related: #5684, #5186.


Generated by Claude Code


Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpackage: typespm:queue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions