Repository navigation
Commit 802f0bc
fix(examples): repair the class (i) keys the strict authoring face refuses (objectui#5250 slice C) (#12128)
Part of #5250
Clause-②: no
Slice C of the objectui#5250 programme: the non-docs class (i)
documents. These are authored documents that the shipped strict
authoring face (`StrictAnyComponentSchema`, the face `objectui validate`
judges with) refuses only because they carry a key that no schema
declares. The slice table and its drop-list are in the park review
(comment 5887006513): no deletion without runtime proof, and no
declaration. Slice B is objectui#12127 (the JSON-fence gate plus the
docs repairs). This card stays open until both have merged.
## The set, re-derived on the dispatch base 5a65f7d
**Instrument:** a throwaway script. It reads every
`examples/schema-catalog/src/schemas/**/*.json`,
`examples/hello-world/schema.json`, and the exported nodes of
`packages/types/examples/*.ts`. It judges each node document whole with
the built `StrictAnyComponentSchema` and `AnyComponentSchema`, and names
keys with the CLI's own `findUndeclaredKeys`.
**Reading:** 435 node documents. 26 are refused, 13 of them strict-only.
14 documents carry an undeclared key, and they hold 12 (component, key)
pairs:
- 11 catalog fixtures;
- `examples/hello-world/schema.json`;
- `packages/types/examples/dashboard.ts`;
- `packages/types/examples/login-form.ts`.
The other 12 refusals (5 `carousel`, 6 `resizable`, 1 toaster `stack`)
name no undeclared key. Both faces refuse them for value or shape
reasons, so they are not class (i) and are not touched here.
The dispatch order's "25 files" is the whole class (i) set of the
measurement report, docs included. The non-docs half is these 14.
## Per-pair disposition and runtime proof
**Instrument:** a throwaway dom-project test, never committed. It
renders each node through the real `SchemaRenderer` and the real
registry (`packages/components/src/renderers` plus `@object-ui/fields`),
once with the key and once without it. It compares the normalised
`document.body` HTML. Combobox cases are compared with the popover OPEN,
where a search placeholder or an empty text would show.
**Controls:** every declared key a pair is renamed to changes the
output, so the instrument can see a read key: `items[].children`,
`className: "w-full"`, `submitLabel`, `colSpan`, `label`, `children`,
and the combobox `placeholder`.
| file | pair | runtime reading | disposition |
|:--|:--|:--|:--|
| `components-basic-navigation-menu/documentation-nav.json`,
`site-navigation.json` | navigation-menu `items[].items` | identical.
The renderer reads `item.children` (control: it draws a submenu trigger)
| renamed to `children` |
| `components-data-display-list/basic-list.json` | list `items[].type`
(x3) | identical. `ui:list` draws each item's `content` | removed |
| `components-form-button/full-width-button.json` | button `fullWidth` |
identical (control: `className: "w-full"` adds the class) | replaced by
`className: "w-full"`, the declared key the fixture's name asks for |
| `components-form-combobox/country-selector.json`,
`searchable-combobox.json` | combobox `searchPlaceholder`, `emptyText` |
identical with the popover open, both with options and with none. The
renderer passes only DOM keys on (`toFormControlDomProps`) | removed |
| `components-form-form/contact-form.json`, `login-form.json`,
`registration-form.json` | form `submitButton` | differs only by a stray
`submitbutton` DOM attribute on the `form` element (control:
`submitLabel` changes the button text) | renamed to `submitLabel` |
| `components-form-form/contact-form.json` | form field `columnSpan` |
differs only by a stray `columnspan` attribute on the textarea (control:
`colSpan` adds the `md:col-span-2` class) | renamed to `colSpan` |
| `components-form-label/required-label.json` | label `required` |
differs only by a `required` attribute on the `label` element, which
draws no indicator | removed |
| `fields-object/structured-configuration.json` | object field `schema`
| identical | removed |
| `examples/hello-world/schema.json` | button `content` | identical: the
button rendered blank (control: `label` draws it) | renamed to `label`
(the park review's rename) |
| `packages/types/examples/dashboard.ts` | card `content` | differs only
by a stray `content` DOM attribute. The data table never rendered
(control: `children` renders it) | renamed to `children` |
| `packages/types/examples/login-form.ts` | form field `defaultChecked`
| **READ**: with `true` the checkbox renders `checked`. `false` is
identical only because it is the default | **not touched**: a class (ii)
pair, reported, neither deleted nor declared |
**H6, checked:** only the `button` node's `content` is undeclared in
`hello-world`. Its two `text` nodes author `content`, which `text`
declares and reads, so they stay.
## After the change
The same instrument reads 435 documents, 0 strict-only refusals, and 14
refused:
- the 12 shape and value refusals above;
- `login-form.ts`: the class (ii) `defaultChecked`, plus the
host-supplied `onSubmit` function that both faces refuse by name as a
runtime slot;
- `dashboard.ts`, which is NEW to the refused list for a non-class-(i)
reason. With `children` in place, the data table is parsed (and
rendered) for the first time, and it carries host-supplied `onRowEdit` /
`onRowDelete` functions. That is the same runtime-slot refusal as
`login-form.ts`'s `onSubmit`. It was masked until now, because the
misplaced `content` key kept the table out of every parse and every
render.
**Reverse leg:** with the 13 repaired documents reverted to `5a65f7d5`,
the instrument reads 26 refused, 13 strict-only, and 14 carrying an
undeclared key, which is the base reading. Restored with `git checkout
HEAD -- FILES`; `git diff HEAD` is empty afterwards.
## Pins
- **H7 does not hold as written.**
`examples/schema-catalog/test/safe-validate-corpus-6318.test.ts` pins
seven named fixtures, none of them touched here, and by design it pins
no corpus count. It is unchanged and green.
- **The count that moved** is `NODE_CENSUS` in
`examples/schema-catalog/test/layout-dom-leak-5574.test.tsx`. Its
structural walk collected `basic-list`'s three `type: "text"` items as
bare text nodes, so `text` moves by exactly three: rendered 687 to 684,
no-element 140 to 137. It is re-pinned with a dated comment in the
file's own style.
## Gates (HEAD `54a95e75`)
| command | exit |
|:--|:--|
| locked `vitest run` over `examples/schema-catalog/` (including the
6318 pin and the census) and every test outside it that names
`schema-catalog` or `hello-world` (71 files, two runs) | 0, "Test Files
68 passed (68)" / "Tests 2988 passed (2988)", and "Test Files 45 passed
(45)" / "Tests 1274 passed, 16 skipped (1290)" |
| `pnpm --filter @object-ui/types type-check` (echoed `tsc --noEmit &&
tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json`) | 0 |
| `node scripts/check-changeset-presence.mjs` | 0, "no changeset is
owed", so none is added (`packages/types/examples/**` is outside
`@object-ui/types`' `files`, and the catalog and hello-world are private
examples) |
| `pnpm check:new-line-citations` | 0, "0 new citation(s)" |
| `pnpm check:control-bytes` | 0 |
| `pnpm docs:check-links` | 0 |
| `pnpm check:doc-types` | 0 |
| `node scripts/check-governed-queue-guard.mjs --test` over the 14 paths
| 0, NOT GOVERNED |
| `pnpm check` (the CLI self-check `lint.yml` runs) | NOT MEASURED: it
needs the CLI build. It exits non-zero only on unreadable JSON or an
expression refusal, and every edited JSON file parses. Declared to CI |
## Acceptance notes
- **Class (ii), not repaired here.** `login-form.ts`'s `defaultChecked`
is read through the checkbox field widget. Slice B measured the same
channel for a text field's `defaultValue`. The strict face refuses both,
so `objectui validate` tells an author to remove keys that work.
Reported on the card for the declaration side; nothing is declared here.
- **Docs interface blocks still advertise three of the removed keys:**
`content/docs/components/form/button.mdx` (`fullWidth`), `form.mdx`
(`submitButton`) and `label.mdx` (`required`, "Show required
indicator"). The probes above show nothing reads them. Those pages are
outside both slices' file surfaces, so this is reported on the card
rather than changed here.
The session that produced this change is
`https://claude.ai/code/session_01DwLS3LzXyNmyTunMGbpc8W`.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01DwLS3LzXyNmyTunMGbpc8W)_
Co-authored-by: Claude <noreply@anthropic.com>1 parent 69bca0a commit 802f0bc
14 files changed
Lines changed: 17 additions & 29 deletions
File tree
- examples
- hello-world
- schema-catalog
- src/schemas
- components-data-display-list
- components-form-button
- components-form-combobox
- components-form-form
- components-form-label
- fields-object
- test
- packages/types/examples
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
| 6 | + | |
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
7 | 7 | | |
8 | 8 | | |
9 | 9 | | |
10 | | - | |
| 10 | + | |
11 | 11 | | |
12 | 12 | | |
13 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
6 | 5 | | |
7 | 6 | | |
8 | 7 | | |
9 | | - | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
13 | | - | |
14 | 11 | | |
15 | 12 | | |
16 | 13 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
| 4 | + | |
5 | 5 | | |
6 | 6 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | 4 | | |
6 | 5 | | |
7 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
2 | 2 | | |
3 | 3 | | |
4 | | - | |
5 | | - | |
6 | 4 | | |
7 | 5 | | |
8 | 6 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | | - | |
| 34 | + | |
35 | 35 | | |
36 | 36 | | |
37 | | - | |
38 | | - | |
39 | | - | |
| 37 | + | |
40 | 38 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
22 | | - | |
23 | | - | |
| 21 | + | |
24 | 22 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
31 | | - | |
32 | | - | |
| 30 | + | |
33 | 31 | | |
0 commit comments