Skip to content

type: 'crud' has four declaration faces and no renderer — api/schema-reference.md documents it as reference material, so a reader who copies it gets OBJUI-001 #5373

Description

@os-support-ai

Found while implementing #5342 (widening check-doc-component-types.mjs to .md). Filed unassigned, not claimed, and deliberately NOT fixed in that PR — #5342 is a collector-widening plus a ledger pass, and which way crud should be fixed is a contract decision, not a re-spelling.

Measured

content/docs/api/schema-reference.md:530 documents CRUDSchema with a copyable block:

{
"type": "crud",
"title": "Products",
"resource": "products",
"api": "/api/products",
...
}

Nothing registers crud. Derived from the actual register(...) calls (the universe check-doc-component-types.mjs builds — 659 keys on f2e11ae6f), crud is absent:

grep -rn "register('crud'" packages/*/src apps/*/src # zero hits

Every other declaration face is present:

facesite
TS interfacepackages/types/src/crud.ts:418type: 'crud';
zod mirrorpackages/types/src/zod/crud.zod.ts:158type: z.literal('crud')
validator branchpackages/core/src/validation/schema-validator.ts:135if (schema.type === 'crud')
builderpackages/core/src/builder/schema-builder.ts:170super('crud')

CRUDSchema is a member of CRUDComponentSchema (crud.ts:641), which is itself a member of the node union at packages/types/src/index.ts:852 — so this sits on the render path, unlike its siblings action / page-break / block-instance, which are document-level discriminants that never reach the registry.

Why this is not a duplicate of #5115

#5115 measured the same absent renderer, but it was scoped to the CLI's hand-written knownTypes copy, and PR #5128 closed it by deriving that list from the registry. That fix made objectui checkwarn about crudpackages/cli/src/__tests__/check-known-types.test.ts:63 pins the warning by name. It did not decide what crud itself should be. The published reference page still teaches it.

So the state today is: the CLI warns, the validator has a dedicated branch that passes it, the builder constructs it, and the docs present it as reference material.

What this card needs decided (it is a contract question, which is why it is filed rather than fixed)

#5115 already listed the three routes and declined to pre-decide, and nothing since has picked one:

  1. Register a crud renderer — the four declaration faces become true.
  2. Retire CRUDSchema under ADR-0049 enforce-or-remove — delete the interface, the zod mirror, the validator branch, the builder, and rewrite the reference page around the shapes that do render.
  3. Demote it to a document type that is not in the node union — keep the schema, take it off the render path, and say so on the page.

Each implies a different edit to content/docs/api/schema-reference.md, which is why #5342 ledgers the site instead of re-spelling it.

Current treatment, so this is not lost

#5342 adds a DOC_TYPE_EXEMPTIONS entry for content/docs/api/schema-reference.md -> crud whose reason names this issue and says to delete the entry when it lands. The gate reports a stale-exemption finding once the site changes, so the ledger cannot silently outlive the fix.

Reproduce

node scripts/check-doc-component-types.mjs # after #5342 lands
grep -n '"type": "crud"' content/docs/api/schema-reference.md
grep -rn "register('crud'" packages/*/src apps/*/src # zero hits

Related: #5115 / PR #5128 (the CLI half, closed), #4631 (three declared surfaces disagreeing — same family, different fact), #5342 (the gate widening that surfaced this site).

Generated by Claude Code

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationImprovements or additions to documentationdomain:uiobjectui ui stream: fix lands on the published library or apps — objectui execution seatpm:queue

    Type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions