Skip to content

finding(types): BreadcrumbSchema and ObjectTreeSchema are declared node schemas that @object-ui/types/zod never exports, so 2 of 107 component types cannot be validated on their own #7917

Description

@claude

Filed unassigned by the os-dev seat while running the objectui#7581 measurement (session session_013uAaxiwgYDybsTNV9xwa1M, PR #7916). Grading and domain:* are the triage seat's. ⛔ Deliberately NOT repaired in #7581's PR — that card is a measurement and forbids repairs.

The defect

Measured on origin/main fa7d66c4505d0fcc866fbecec1901c4990a80c3a, by enumerating the arms of AnyComponentSchema and asking, for each, whether any export of packages/types/dist/zod/index.zod.js resolves to it:

  • 107 node component types are declared by the arms of AnyComponentSchema.
  • 105 of them have a named export (ButtonSchema, CardSchema, PageNodeSchema, …).
  • 2 do not: the arm declaring type: 'breadcrumb' and the arm declaring type: 'object-tree'.
node -e "import('./packages/types/dist/zod/index.zod.js').then(Z=>console.log(
  'BreadcrumbSchema', !!Z.BreadcrumbSchema, '| ObjectTreeSchema', !!Z.ObjectTreeSchema))"
BreadcrumbSchema false | ObjectTreeSchema false

Control, run in the same session so the negative reading is not a typo: the same probe answers true for TreeViewSchema and TreeNodeSchema, which ARE exported — the nearest names to ObjectTreeSchema, and the ones a reader would reach for by mistake.

Why it matters

Every sibling node type can be validated on its own — ButtonSchema.safeParse(node) — which is what a designer, a form builder or a targeted test needs. For breadcrumb and object-tree the only route is AnyComponentSchema.safeParse(...), a 107-arm union: it answers "is this SOME valid node", never "is this a valid breadcrumb", and its failure message is an invalid_union naming every arm that did not match. Declared-and-unreachable is the asymmetry: the schema exists, is maintained, and is applied by the union, but no consumer can name it.

This is the same class as objectui#7502 / objectui#7324 (ObjectSchemaLike is the parameter type of exported functions but is not itself exported) on a different surface — those two are about packages/fields / packages/plugin-form; this is the zod node face in packages/types. Deduped against the open backlog before filing; no card names either symbol.

Where

packages/types/src/zod/navigation.zod.ts (the breadcrumb arm, reached only through NavigationSchema) and packages/types/src/zod/objectql.zod.ts (the object-tree arm, reached only through ObjectQLComponentSchema). The repair is presumably a one-line export const plus the re-export in zod/index.zod.ts — but ⛔ it is a repair, and this card exists so it is triaged rather than smuggled into a measurement PR.

⚠️ One thing this does NOT claim: that every node schema must be individually exported. There may be a deliberate reason these two are internal. The finding is that the export surface is inconsistent across the 107, in a way nothing detects.


Generated by Claude Code

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    domain:specobjectui spec stream: fix lands on packages/types, schema corpus or spec pin coupling — spec laneenhancementNew feature or requestfindingpm:queuepriority:p3

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions