This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
feat(cli): recognise ObjectUI schemas by validity, and report the broken ones - #6322
Merged
Merged
Conversation
…ken ones `objectui check` judged a file only when its root carried an ObjectUI structural key, so leaf schemas — the majority shape of a real corpus — were never checked. Measured on this tree: 475 eligible, 166 judged, 309 skipped. Add the validity arm the 2026-08-25 ruling on objectui#5392 selected: the document parses as an ObjectUI component under `@object-ui/types`' Zod union. It admits 209 of the 309, runs only after the cheap structural arm, and still refuses every `package.json`. Validity alone conflates "not ObjectUI" with "ObjectUI and broken", and the second failure is invisible — the file just stops being mentioned. Measured, 54 real corpus files land there. So the refused set is split: a root `type` that names a registered component is reported by name as content that did not validate; everything else stays in the skip count. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CZgmFFzqA9cX8tBMhvpFe
…m real The docblock and changeset said 54 real corpus files. 54 files are reported; one of them is the draft-07 JSON Schema document whose root `type` is `object`, which the test suite already pins as the known false positive. Measured on a clean checkout, since the command's ignore list only excludes a top-level `dist/`. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012CZgmFFzqA9cX8tBMhvpFe
Contributor
✅ Console Performance Budget
The eager closure is every chunk the entry reaches through static imports — what the browser fetches and parses before the app renders. The entry chunk on its own is a small fraction of it. 📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #6075
objectui checkjudged a file's roottypeonly when the file carried an ObjectUI structural key (children,body,className, …). Leaf schemas carry only their own vocabulary, so nothing checked them. This adds the second recogniser arm the maintainer's 2026-08-25 ruling on #5392 selected — the document validates as an ObjectUI component under@object-ui/types' own Zod union — and splits the files the recogniser refuses into two reports instead of one count.Measured on my own base, not adopted from any card
origin/main@090927f4f, clean checkout (see the caveat below — this matters). Harness reproduces the command's own predicate: same glob, samejsonc-parsersettings, same structural-key list.typestring)The counts close:
375 + 54 + 46 = 475.The 46 that remain skipped are 45
package.json("type": "module") plus one file discussed under "the honest limit" below. So the precision the marker gate was built for is intact: the command still says nothing about the reader's package manifest.check's ignore list is['node_modules/**','dist/**','.git/**'], and glob matches those relative tocwd, so only a top-leveldist/is excluded. After a full build of this workspace the same command globs 1047 files and every count roughly doubles. Filed as #6320; deliberately not fixed here.The design decision this card owns
A validity-based recogniser answers one question with two meanings. "This document does not validate" is the same sentence for a foreign file and for an ObjectUI file that is broken — and the second is the more valuable finding, because it is the thing
checkexists to catch. Collapsing them files every broken schema as "not ObjectUI", and the symptom of that bug is an absence: the file stops being mentioned, no count moves in a direction anyone would question, and nothing prompts a re-read.Measured rather than assumed: the bucket is not empty. 100 eligible files fail the validity arm. 45 are
package.json. Of the rest, 53 are real ObjectUI content — schema-catalog leaves like{ "type": "text", "content": "Small text", "variant": "small" }whose
variantis not inTextSchema's enum. A two-bucket recogniser would have reported all 53 as foreign files.Decision: three buckets, and the third one is reported by name, not counted. A file the recogniser refuses whose root
typenames a component this build registers is listed as ObjectUI content that did not validate, pointing atobjectui validate FILEfor the reason. Everything else is counted as skipped, as before.Why
isKnownSchemaTypeis the discriminatorIt is the same derived universe the judgement arm already uses — read out of the repository's own registration calls — so the split needs no second hand-maintained list, which is the shape #5115 deleted and #5127 declined to re-create. And it is the one signal that separates a broken
"type": "text"node from"type": "module".Its cost, stated
A foreign document whose root
typecollides with a registered component key lands in the report. This repository contains exactly one:packages/vscode-extension/schemas/objectui-schema.json, a draft-07 JSON Schema document whose root type isobject— a real ObjectUI component key. So of the 54 reported files, 53 are genuine and 1 is a false positive. That cost is pinned as a test, not left to be rediscovered, so it stays a known one-line cost and cannot silently grow. The alternative — exempting files by name — is the filename skip list this gate was built to avoid, and it fails on the general case anyway.The opposite error is the one that cannot be seen. I took the visible cost.
Why the report does not fail the build
errorsstill counts unreadable JSON only, soobjectui checkstill exits non-zero on exactly what it did before. Escalating a validation finding to a failing exit would change the contract of a released command for every consumer's CI at once — a different decision from this one, and not this card's to make.The honest limit
One real corpus file stays in the skip count:
examples/schema-catalog/src/schemas/core-schema-renderer/unknown-component-type.json. An unregistered roottype, no structural key, and a document that does not validate is byte-for-byte the same evidence a foreign file offers — no available signal separates them. Admitting it would mean admittingpackage.json. Pinned as a test so the limit is visible rather than forgotten.On the
check↔validatecoupling — yes, intended, and it is why the third bucket existsobjectui checkandobjectui validatenow share one recogniser, so tightening a Zod schema moves files out ofcheck's recognition. That is real, and it is the reason this change is three buckets rather than two: a file that stops validating stops being judged, but it does not stop being mentioned. Without the third bucket the coupling would be a hazard — validation tightens somewhere inpackages/types, and files silently reclassify as foreign in a command nobody was looking at. With it, the same tightening produces a named list. The bucket is the shock absorber for the coupling, not an extra.Not done, per the rulings
No
$schemaarm, no minted URL, no marker stamped into any corpus file, andOBJECTUI_STRUCTURAL_KEYSis unchanged — the set still grows only whenBaseSchemagrows, and admittingBaseSchema-adjacent naming keys is what drives foreign retention from 0 files toward all 46.packages/typesis untouched:safeValidateSchemawas already exported and already consumed byvalidate.ts; no export was widened and no validation behaviour changed.What changed
packages/cli/src/commands/check.ts— the second recogniser arm, the third bucket, and the two docblocks that described the old predicate. The user-facing explanation under the skip count now names both arms; a sentence that no longer describes the predicate is the defect classcheck.tspromises that "the corpus migration repays" the 263-file recall debt — the mechanism was deleted before #5334 merged #6074 had just finished removing from this file.packages/cli/src/__tests__/check-validity-recogniser.test.ts— new. 10 tests, over half of them negative.packages/cli/src/__tests__/check-schema-marker.test.ts— fixture triage on the three cases this change moves (below).content/docs/utilities/cli.mdx— theobjectui checkentry said "Validate every schema file detected in the project", which described neither the old predicate nor the new one. It now describes what the command does..changeset/6075-check-validity-recogniser-recall.md—@object-ui/cli: minor.Fixture triage on the existing suite
Three tests in
check-schema-marker.test.tsmoved, each for a different reason, and each re-pinned rather than renumbered:reports how many eligible files went unjudged— its two leaves ({type: 'button', …},{type: 'badge', …}) now validate and are judged. That fixture was the recall debt; the assertion still counts what went unjudged, and what changed is which files are in it.says nothing about a JSON Schema document— the draft-07objectdocument moves into the candidate report. Re-pinned as the known false positive, with the load-bearing assertion (never judged) unchanged.does not judge a foreign file even when its type happens to name a real component—{name: 'x', type: 'form'}is still refused by both arms (aFormSchemaneeds more than a name), so it is still never judged; it now costs one advisory line. Re-pinned with the cost written down.Tests and gates — run at
1c2ade6a8, the final commitExit codes captured by redirect before any pipe; each verdict below is the gate's own printed line.
vitest run packages/cli/Test Files 13 passed (13)·Tests 226 passed (226)pnpm --filter @object-ui/cli run type-check@object-ui/cli@17.6.0 type-check→tsc --noEmit, exit 0pnpm lint(whole repo, not narrowed)Tasks: 47 successful, 47 total· 0 errorscheck-changeset-presence.mjs✅ 3 source file(s) of 1 released package(s) changed, and this change declares 1 changeset(s)check-control-bytes.mjs✅ check-control-bytes: OK (scanned 5197 tracked text file(s); skipped 85 binary)check-lint-coverage.mjs✅ lint coverage: 46/46 packages linted, 0 with outstanding errorscheck-type-check-coverage.mjs✅ test type-check coverage: 41/41 packages compile their testscheck-doc-snippet-types.mjsSemantic phase: 267 of 267 block(s) judged, 0 failed.check-doc-links.mjsLinks are valid across 17 scan roots.check-phantom-dependencies.mjs✅ Every in-scope import is declared by the package that publishes it.check-vi-mock-specifiers.mjs,check-doc-fence-languages.mjs,check-doc-component-types.mjs,check-package-self-import.mjs,check-published-dist-tooling.mjs,check-node-esm-load.mjs,check-changeset-no-major.mjs,check-changeset-fixed.mjs,check-shell-escape-residue.mjs,check-skills-paths.mjs,lint:root--listFilesconfirms both test files andcheck.tsare in the CLI's typecheck program, so "typecheck clean" is a statement about them and not about a set that excluded them.Reverse verification — the bucket tests are not decorative
Predicted direction: red. Ablation: collapse the third bucket back to two (
isUnvalidatedCandidatereturnsfalse), so every refused file becomes "skipped" — the exact failure mode this card names.Mutation confirmed on disk before the run, not inferred from an editor's exit code: injected marker
grep -c= 1, andgit hash-objectmoved95832826→3929785e. Restore ran through atrap … EXIT INT TERMagainst an absolute path and was proved afterwards, not assumed:git diff HEADempty, marker residue 0, hash back to95832826.Result: 8 tests failed, including every test in "a broken ObjectUI schema is never filed as a foreign file" and the absence-detector that asserts the file is mentioned at all. No rebuild is involved on either leg — the suite imports
../commands/check.js, a relative specifier vitest resolves to source, so nodist/could go stale under it.Findings filed, not fixed here
safeValidateSchema#6318 — the 53 real corpus files this report now names, split by cause: 49 violate a schema the union models, 4 carry a registered type (code-editor,bar-chart) that has no Zod schema at all. Also records the 36 already-judged files that fail validation too, and that Zod 4 collapses every failure toinvalid_unionat the root.objectui checkscans build output: itsdist/**ignore only excludes a top-leveldist/#6320 — thedist/**scan-scope hole above.Generated by Claude Code