Skip to content
This repository was archived by the owner on Nov 4, 2026. It is now read-only.

feat(cli): recognise ObjectUI schemas by validity, and report the broken ones - #6322

Merged
os-warren merged 2 commits into
mainfrom
claude/issue-6075-check-recogniser-recall
Aug 25, 2026
Merged

os-warren merged 2 commits into
mainfrom
claude/issue-6075-check-recogniser-recall

Conversation

@os-warren

@os-warren os-warren commented Aug 25, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #6075

objectui check judged a file's root type only 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.

⚠️ Editor's note: this body originally quoted the CLI's hint verbatim, with a validate argument written in angle brackets. GitHub's body sanitizer silently ate every angle-bracket fragment, including the ones inside code fences, so the argument is spelled FILE throughout instead. Mentioning it because the same erasure is invisible on the way in.

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, same jsonc-parser settings, same structural-key list.

before after
globbed 617 617
eligible (root type string) 475 475
judged 166 375 (166 structural + 209 validity)
reported as unvalidated candidates — 54
skipped 309 46

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.

⚠️ Every number here depends on whether the tree was built, and that is a defect I found on the way, not a property of this change: check's ignore list is ['node_modules/**','dist/**','.git/**'], and glob matches those relative to cwd, so only a top-level dist/ 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 check exists 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 variant is not in TextSchema'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 type names a component this build registers is listed as ObjectUI content that did not validate, pointing at objectui validate FILE for the reason. Everything else is counted as skipped, as before.

⚠️ 54 files carry a registered ObjectUI component type but did not validate as an ObjectUI schema:
   examples/schema-catalog/src/schemas/components-basic-text/small.json (type "text")
   … 53 more
   Run `objectui validate FILE` on any of them for the reason.
   Either the document is off-spec, or its component type is not modelled by @object-ui/types.
   These are NOT counted as skipped: a schema that fails validation is a broken schema, not a foreign file.
Skipped 46 files with a root "type" that no ObjectUI recogniser admitted.

Why isKnownSchemaType is the discriminator

It 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 type collides 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 is object — 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

errors still counts unreadable JSON only, so objectui check still 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 root type, 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 admitting package.json. Pinned as a test so the limit is visible rather than forgotten.

On the check ↔ validate coupling — yes, intended, and it is why the third bucket exists

objectui check and objectui validate now share one recogniser, so tightening a Zod schema moves files out of check'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 in packages/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 $schema arm, no minted URL, no marker stamped into any corpus file, and OBJECTUI_STRUCTURAL_KEYS is unchanged — the set still grows only when BaseSchema grows, and admitting BaseSchema-adjacent naming keys is what drives foreign retention from 0 files toward all 46. packages/types is untouched: safeValidateSchema was already exported and already consumed by validate.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 class check.ts promises 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 — the objectui check entry 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.ts moved, each for a different reason, and each re-pinned rather than renumbered:

  1. 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.
  2. says nothing about a JSON Schema document — the draft-07 object document moves into the candidate report. Re-pinned as the known false positive, with the load-bearing assertion (never judged) unchanged.
  3. 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 (a FormSchema needs 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 commit

Exit codes captured by redirect before any pipe; each verdict below is the gate's own printed line.

gate verdict
vitest run packages/cli/ Test Files 13 passed (13) · Tests 226 passed (226)
pnpm --filter @object-ui/cli run type-check echoed @object-ui/cli@17.6.0 type-check → tsc --noEmit, exit 0
pnpm lint (whole repo, not narrowed) Tasks: 47 successful, 47 total · 0 errors
check-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 errors
check-type-check-coverage.mjs ✅ test type-check coverage: 41/41 packages compile their tests
check-doc-snippet-types.mjs Semantic phase: 267 of 267 block(s) judged, 0 failed.
check-doc-links.mjs Links 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 all exit 0

--listFiles confirms both test files and check.ts are 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 (isUnvalidatedCandidate returns false), 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, and git hash-object moved 95832826 → 3929785e. Restore ran through a trap … EXIT INT TERM against an absolute path and was proved afterwards, not assumed: git diff HEAD empty, marker residue 0, hash back to 95832826.

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 no dist/ could go stale under it.

Findings filed, not fixed here


Generated by Claude Code

os-warren and others added 2 commits August 25, 2026 12:14
…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
@github-actions github-actions Bot added the tests label Aug 25, 2026
@github-actions

Copy link
Copy Markdown
Contributor

✅ Console Performance Budget

Metric Value Budget
Eager closure (gzip, 52 chunks) 3222.9 KB 3266.6 KB
Main entry chunk (gzip) 154.1 KB 350 KB
Entry file index-BHAA5kjr.js —
Status PASS —

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

Package Size Gzipped
app-shell (consoleActionDispatch.js) 0.20KB 0.19KB
app-shell (index.js) 10.96KB 4.16KB
app-shell (runtime-config.js) 18.10KB 6.51KB
app-shell (types.js) 0.01KB 0.04KB
app-shell (urlParams.js) 10.06KB 3.86KB
auth (ActiveOrganizationStorage.js) 25.05KB 9.16KB
auth (AuthContext.js) 0.31KB 0.24KB
auth (AuthGuard.js) 2.07KB 1.00KB
auth (AuthProvider.js) 40.18KB 10.59KB
auth (AuthShell.js) 3.49KB 1.40KB
auth (ForgotPasswordForm.js) 12.21KB 3.45KB
auth (LoginForm.js) 18.15KB 5.39KB
auth (PreviewBanner.js) 0.90KB 0.50KB
auth (RegisterForm.js) 6.65KB 2.22KB
auth (SocialSignInButtons.js) 9.61KB 3.89KB
auth (UserMenu.js) 3.41KB 1.23KB
auth (auth-gate-events.js) 1.29KB 0.66KB
auth (authStyles.js) 5.04KB 1.72KB
auth (createAuthClient.js) 40.21KB 10.80KB
auth (createAuthenticatedFetch.js) 8.46KB 3.43KB
auth (index.js) 3.19KB 1.44KB
auth (invitation-status.js) 1.22KB 0.70KB
auth (org-roles.js) 6.66KB 2.78KB
auth (phone-identifier.js) 1.11KB 0.66KB
auth (types.js) 0.59KB 0.35KB
auth (useAuth.js) 5.30KB 1.02KB
auth (useWorkspaceAdminStatus.js) 5.13KB 2.35KB
collaboration (CommentThread.js) 26.08KB 7.56KB
collaboration (LiveCursors.js) 3.17KB 1.27KB
collaboration (PresenceAvatars.js) 6.49KB 2.64KB
collaboration (PresenceProvider.js) 2.79KB 1.13KB
collaboration (index.js) 1.68KB 0.73KB
collaboration (useCollaborationTranslation.js) 6.05KB 2.52KB
collaboration (useCommentSearch.js) 1.98KB 0.88KB
collaboration (useConflictResolution.js) 7.75KB 1.86KB
collaboration (useMentionNotifications.js) 1.81KB 0.68KB
collaboration (usePresence.js) 6.33KB 1.84KB
collaboration (useRealtimeSubscription.js) 7.91KB 2.01KB
components (index.js) 505.63KB 114.68KB
core (index.js) 5.30KB 2.13KB
create-plugin (index.js) 10.08KB 3.26KB
data-objectstack (index.js) 171.74KB 47.48KB
fields (index.js) 238.40KB 59.89KB
i18n (LocalizationContext.js) 1.76KB 0.96KB
i18n (currency.js) 1.22KB 0.64KB
i18n (fallbackInterpolation.js) 6.25KB 2.77KB
i18n (i18n.js) 4.28KB 1.75KB
i18n (index.js) 3.44KB 1.39KB
i18n (pickLocalized.js) 7.62KB 3.26KB
i18n (provider.js) 26.89KB 9.04KB
i18n (useDisplayLocale.js) 2.85KB 1.45KB
i18n (useObjectLabel.js) 33.40KB 8.71KB
i18n (useSafeTranslation.js) 5.60KB 2.33KB
layout (index.js) 38.95KB 10.97KB
mobile (MobileProvider.js) 0.92KB 0.49KB
mobile (ResponsiveContainer.js) 0.94KB 0.38KB
mobile (breakpoints.js) 1.51KB 0.70KB
mobile (createOfflineDataSource.js) 5.61KB 1.75KB
mobile (index.js) 1.55KB 0.62KB
mobile (offlineQueue.js) 3.91KB 1.35KB
mobile (pwa.js) 0.97KB 0.49KB
mobile (serviceWorker.js) 1.48KB 0.62KB
mobile (serviceWorkerSource.js) 3.41KB 1.48KB
mobile (useBreakpoint.js) 1.54KB 0.65KB
mobile (useGesture.js) 6.96KB 1.98KB
mobile (useOfflineSync.js) 1.99KB 0.72KB
mobile (usePullToRefresh.js) 2.53KB 0.85KB
mobile (useResponsive.js) 0.72KB 0.42KB
mobile (useResponsiveConfig.js) 1.37KB 0.63KB
mobile (useSpecGesture.js) 4.32KB 1.64KB
mobile (useTouchTarget.js) 1.01KB 0.54KB
permissions (MePermissionsProvider.js) 9.53KB 3.38KB
permissions (PermissionContext.js) 0.31KB 0.25KB
permissions (PermissionGuard.js) 0.89KB 0.45KB
permissions (PermissionProvider.js) 4.64KB 1.50KB
permissions (evaluator.js) 5.12KB 1.74KB
permissions (index.js) 0.93KB 0.41KB
permissions (store.js) 0.91KB 0.42KB
permissions (useFieldPermissions.js) 1.28KB 0.53KB
permissions (usePermissions.js) 1.93KB 0.88KB
plugin-ai (index.js) 15.75KB 3.80KB
plugin-calendar (index.js) 46.62KB 12.83KB
plugin-charts (index.js) 64.66KB 18.32KB
plugin-chatbot (index.js) 188.21KB 44.67KB
plugin-dashboard (index.js) 133.35KB 34.45KB
plugin-designer (index.js) 212.33KB 42.81KB
plugin-detail (index.js) 245.10KB 62.31KB
plugin-editor (index.js) 2.46KB 1.10KB
plugin-form (index.js) 126.92KB 30.85KB
plugin-gantt (index.js) 164.17KB 39.89KB
plugin-grid (index.js) 201.14KB 54.40KB
plugin-kanban (index.js) 52.83KB 14.55KB
plugin-list (index.js) 111.94KB 27.24KB
plugin-map (index.js) 20.09KB 6.62KB
plugin-markdown (index.js) 13.72KB 4.69KB
plugin-report (index.js) 43.49KB 11.93KB
plugin-timeline (index.js) 26.49KB 7.59KB
plugin-tree (index.js) 9.26KB 3.13KB
plugin-view (index.js) 84.55KB 20.74KB
providers (DataSourceProvider.js) 0.75KB 0.39KB
providers (MetadataProvider.js) 1.37KB 0.59KB
providers (ThemeProvider.js) 1.90KB 0.85KB
providers (UploadProvider.js) 11.66KB 3.50KB
providers (index.js) 0.45KB 0.23KB
providers (types.js) 0.01KB 0.04KB
react-runtime (index.js) 5.62KB 2.34KB
react (LazyPluginLoader.js) 4.47KB 1.63KB
react (SchemaRenderer.js) 54.84KB 18.43KB
react (data-invalidation.js) 5.05KB 2.08KB
react (index.js) 1.35KB 0.70KB
react (schema-input.js) 2.32KB 1.24KB
react (spec-input.js) 0.20KB 0.18KB
sdui-parser (codegen.js) 5.41KB 2.34KB
sdui-parser (dashboard-widget-options.js) 3.08KB 1.30KB
sdui-parser (index.js) 4.93KB 2.24KB
sdui-parser (input-type.js) 2.84KB 1.40KB
sdui-parser (parse.js) 12.13KB 3.65KB
sdui-parser (provenance.js) 3.66KB 1.82KB
sdui-parser (types.js) 0.28KB 0.23KB
sdui-parser (validate.js) 7.54KB 2.63KB
types (ai.js) 0.20KB 0.17KB
types (api-types.js) 0.20KB 0.18KB
types (app.js) 2.87KB 0.99KB
types (base.js) 0.20KB 0.18KB
types (blocks.js) 0.20KB 0.18KB
types (complex.js) 2.74KB 1.41KB
types (crud.js) 0.20KB 0.18KB
types (dashboard-filter-alias.js) 6.23KB 2.74KB
types (data-display.js) 0.20KB 0.18KB
types (data-protocol.js) 0.20KB 0.19KB
types (data.js) 0.20KB 0.18KB
types (designer.js) 1.87KB 0.85KB
types (disclosure.js) 0.20KB 0.18KB
types (error-code.js) 1.54KB 0.88KB
types (feedback.js) 0.20KB 0.18KB
types (field-types.js) 0.20KB 0.18KB
types (form.js) 0.20KB 0.18KB
types (http-inflight.js) 8.87KB 3.73KB
types (http-retry.js) 4.32KB 2.02KB
types (icon-key-migration.js) 4.26KB 1.63KB
types (index.js) 4.49KB 2.14KB
types (layout.js) 0.20KB 0.18KB
types (managed-by.js) 0.19KB 0.18KB
types (mobile.js) 2.59KB 1.31KB
types (navigation.js) 0.20KB 0.18KB
types (objectql.js) 0.20KB 0.18KB
types (overlay.js) 0.20KB 0.18KB
types (permissions.js) 0.20KB 0.18KB
types (plugin-scope.js) 0.20KB 0.18KB
types (record-components.js) 0.20KB 0.19KB
types (record-semantics.js) 1.28KB 0.67KB
types (registry.js) 0.20KB 0.18KB
types (reports.js) 0.20KB 0.18KB
types (spec-report.js) 5.05KB 1.93KB
types (spec-ui-namespace.js) 0.20KB 0.19KB
types (system-fields.js) 3.33KB 1.54KB
types (theme.js) 6.28KB 2.87KB
types (ui-action.js) 3.40KB 1.71KB
types (views.js) 0.20KB 0.18KB
types (widget.js) 0.20KB 0.18KB

Size Limits

  • ✅ Core packages should be < 50KB gzipped
  • ✅ Component packages should be < 100KB gzipped
  • ⚠️ Plugin packages should be < 150KB gzipped

@os-warren
os-warren marked this pull request as ready for review August 25, 2026 12:58
@os-warren
os-warren added this pull request to the merge queue Aug 25, 2026
Merged via the queue into main with commit 7dc08a3 Aug 25, 2026
27 checks passed
@os-warren
os-warren deleted the claude/issue-6075-check-recogniser-recall branch August 25, 2026 13:10
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

objectui check skips 263 real corpus files it should judge — the recall debt #5329 could not repay

1 participant