This repository was archived by the owner on Nov 4, 2026. It is now read-only.
Repository navigation
Commit 18d7b48
feat(types): form fields declare
Part of #11070 (round 13)
Clause-②: yes — widens: the strict authoring face
(`StrictAnyComponentSchema`) now accepts `form` `fields[].scale` and
`fields[].currencyConfig`, which it refused with `unrecognized_keys`;
narrows: the tolerant face (`safeValidateSchema`), which stripped both
keys unjudged, now refuses a value the spec's `FieldSchema` refuses for
either key, and refuses `scale` on a `currency` entry (`custom` at
`scale`, the spec's own refusal) on both faces.
Round 13 of objectui#11070, claim `6060489789`, session
`https://claude.ai/code/session_01DBZ9bntPZ7VKyQNtJeNsgw`. This round
executes the seat's answers A, B and C (ACCEPT `6060086777`) for the
three class (ii) pairs round 12's M3 re-run left. **On this head, M3
class (ii) reads 0 corpus pairs, so the card's executable acceptance
holds.** The 32 pairs that remain are the class (i) pairs round 12
already listed, unchanged.
## M3 re-run: base `a835c314`, head `5f049697`
The instrument is round 12's, rebuilt as a scratch script and not
committed. It copies `scripts/measure-strict-authoring-face.mjs`
unchanged up to its first corpus run (`const catalog = loadCatalog();`),
except that `REPO_ROOT` comes from the environment. On top of that it
adds the JSON half of M2's population: every tracked `.json` outside the
three corpora, 195 files, holding 1 node document. The YAML half holds
none: 45 tracked YAML files, 0 with a root `type:`, against 41 with a
root `name:` as the lit control. Each node document is judged by
`StrictAnyComponentSchema` and `AnyComponentSchema` from the built
`packages/types/dist/zod`. Refused keys are read with PR
objectui#11069's own `findUndeclaredKeys`, copied from its head
`a11f73347d` with the types stripped. Each key is attributed to its
nearest node by the measure script's schema-guided walk, with node paths
kept. zod 4.6.5; `@object-ui/types` built at each end.
**The base reproduces round 12's head reading exactly**: 623 node
documents, 58 refused, 35 pairs, 54 occurrences, 40 strict-only.
| corpus | node documents | refused, base → head | strict-only, base →
head | red today, base → head | refused naming no key |
| --- | --: | --: | --: | --: | --: |
| catalog | 432 | 28 → 23 | 16 → 11 | 12 → 12 | 12 |
| docs | 184 | 27 → 26 | 13 → 13 | 14 → 13 | 8 |
| authored | 6 | 2 → 2 | 1 → 1 | 1 → 1 | 0 |
| M2 JSON (`examples/hello-world/schema.json`) | 1 | 1 → 1 | 1 → 1 | 0 →
0 | 0 |
| **total** | **623** | **58 → 52** | **31 → 26** | **27 → 26** | **20**
|
| class | pairs, base → head | occurrences | strict-only |
| --- | --: | --: | --: |
| (i) undeclared, no read site found | 32 → 32 | 48 → 48 | 35 → 35 |
| (ii) a renderer reads it, no schema declares it | **3 → 0** | 6 → 0 |
5 → 0 |
| (iii) the TS type names it, the zod mirror omits it | 0 → 0 | 0 | 0 |
- The three pairs that left are `form` · `fields[].scale` (3), `form` ·
`fields[].currency` (2) and `action:button` · `properties.endpoint` (1,
red on both faces).
- The six documents left the refused set: five catalog documents and the
guide's fence. The fence was red on both faces, which is why "red today"
drops by one.
- No pair appeared.
- The 32 remaining pairs are round 12's class (i) list, name for name:
`button` · `action` / `content` / `fullWidth`, `card` · five keys,
`form` · `submitButton` / `title` / four `fields[]` keys, and so on.
- Class (iii) stays 0. The `UnmirroredDeclared` ledger in
`zod-mirror-parity.test.ts` names none of the 32.
## A. `fields[].scale`, declared by reference, with the spec's one
cross-key rule
`FormField.scale` is `SpecField['scale']`, and `FormFieldSchema.scale`
is `stripImportedDefaults(SpecFieldSchema).shape.scale`. The readers are
the `number` widget (`numberField?.scale`), the `percent` widget
(through `resolveFieldScale`), and the `formula` and `summary` widgets
(through `formatNumberFieldValue`).
**H2, the cross-key rule, decided by measurement: the face carries it.**
- `@object-ui/types`' `@objectstack/spec` is 17.7.0. Its `FieldSchema`
refuses `scale` on `currency` (code `custom`, at `scale`), for `scale:
2` and `scale: 0` alike. It accepts `scale` on `number`, `percent` and
even `text`. `currency` is the one type it excludes.
- The `currency` widget does not read `scale`. Measured through the real
`SchemaRenderer` on a fixed-USD entry: with `scale` absent, `0` and `4`,
the read-only face draws `$1,234.50` and the edit face's step is `0.01`
each time. Lit control, a `number` entry with the same three: `1,234.5`
/ `1235` / `1,234.5000`, step `any` / `1` / `0.0001`.
- At base, the shipped strict face refused a currency entry carrying
`scale` (as an undeclared key). A bare `.shape.scale` declaration would
therefore have newly accepted exactly the document the spec refuses and
nothing reads.
- So the superRefine carries that one rule: `type === 'currency' &&
scale !== undefined` gives `custom` at `scale`. It is keyed as the spec
keys it, and its text is the spec's own
(`CURRENCY_FIELD_SCALE_REFUSAL`). The spec exports neither the rule nor
its text, so the pin asserts both: the spec still refuses that entry,
and objectui's message equals the spec's issue message. A spec release
that drops or rewords the rule reds the pin. ⛔ No new local rule:
nothing is refused that the spec admits.
- **Width, stated.** The spec's other cross-key rules on members this
face already takes by reference are not carried, as before. These are
`rows` (multiline types), `minLength` / `maxLength` (bounded string
types) and `multiple`. They key on the spec's field-type sets, and this
face's `type` is a widget id: the spec's `FieldSchema` refuses `type:
'input'` itself (`invalid_value` at `type`), while the built-in input
branch honours `minLength` on it. The spec's own inline form field (the
`object-form` row) also takes `rows`, `minLength` and `maxLength` off
`FieldSchema.shape` flat, without the rules. The currency rule keys on
`type` only, so an entry drawn as currency through `widget` alone is not
judged by it.
## B. `fields[].currency` is runtime-only; the two documents move to
`currencyConfig`
`fields-currency/euro-currency.json` and `usd-currency.json` now write
`currencyConfig: { currencyMode: 'fixed', defaultCurrency: 'EUR' | 'USD'
}` instead of `currency`. `currency` stays undeclared, and the strict
face still refuses it by name (pinned).
**One premise was falsified on the way, and the route was completed by
the round's own pattern.** The ACCEPT's B sends the documents to
`currencyConfig`, "which the spec declares". The spec declares it, but
**objectui's form-field face did not**. Base probe on the built dist:
the strict face refused `fields.0.currencyConfig` with
`unrecognized_keys`, and the tolerant face stripped it. Moving the
documents alone would have traded `form` · `fields[].currency` for
`form` · `fields[].currencyConfig`, which is still class (ii) because
`resolveFieldCurrency` reads it. So `currencyConfig` is declared on both
faces by reference too: `SpecField['currencyConfig']` and
`stripImportedDefaults(SpecFieldSchema).shape.currencyConfig`. That
needs no spec change. It also means B widens the strict face, which the
claim's last line did not expect ("B and C correct documents and widen
nothing"); the Clause-② line above states it. The imported-defaults
boundary keeps the spec config's defaults (`dynamic`, `CNY`) out of a
parsed document (pinned: `currencyConfig: {}` stays `{}`).
**H3 held**, through the real `SchemaRenderer`, form renderer and
`@object-ui/fields` registration:
| document | before (`currency`) | after (`currencyConfig`, fixed) |
markup |
| --- | --- | --- | --- |
| `euro-currency` | `€`, step `0.01` | `€`, step `0.01` | identical
apart from React `useId` values (1080 = 1080 bytes) |
| `usd-currency` | `$`, step `0.01` | `$`, step `0.01` | identical apart
from React `useId` values (1066 = 1066 bytes) |
| lit control: the same entry with neither key | — | no symbol, no
`pl-8` padding | differs |
The permanent pin
(`examples/schema-catalog/test/fields-scale-currency-config-11070.test.tsx`)
holds the after column. It has two controls: `dynamic` mode draws no
symbol, and `JPY` draws `¥` with step `1`. It does not pin the before
column, because limb 1's future is a separate question.
## C. The guide's `action:button` example names its endpoint `target`
In `content/docs/guide/schema-rendering.md`, the "Reference actions in
schemas" fence now writes `"target": "/api/action"` instead of
`endpoint`. The sentence below it now reads that an `api` action's
endpoint is its `target`, with the verb in `method`, and that the spec's
`action:button` row refuses `endpoint` and names `target` in its place.
Its half on `api` is unchanged and still true: no action renderer
forwards `api`. The core runner's `executeAPI` resolves `api || endpoint
|| target`, so `target` alone reaches it. The taught shape is pinned on
both faces, and `endpoint` in the bag stays refused on both.
## Hypotheses
- **H1 held.**
- `scale` sits in the three catalog documents.
- The fourth hit, `plugin-timeline/gantt-style-timeline.json`, is a
`timeline` node's own top-level `scale: "month"` (the Gantt axis bucket,
which the timeline schema declares). It is a different key in a
different block, and M3 refuses nothing there.
- `currency` sits in the two currency documents.
- The `endpoint` sits in the "Reference actions in schemas" fence and in
the sentence "the endpoint key is `endpoint`".
- **H2:** decided by measurement as above. The face carries the spec's
one currency rule with the spec's text, and the width is stated in the
changeset.
- **H3 held** as above. Its unstated half fell: that the objectui face
accepted `currencyConfig`.
## Tests, reverse verification, ablations
Heavy runs went through the verify lock with
`NODE_OPTIONS=--max-old-space-size=4096` and `--maxWorkers=2`. The
subjects resolve from source through the root vitest alias, so no leg
needs a `dist` rebuild. M3 reads the dist, which was built at each end.
- **Pins.** `strict-face-read-keys-11070.test.ts` gains the round-13
rows:
- `scale` and `currencyConfig` parse on the strict face, and a
misspelled sibling is refused by name;
- both keep their values on the tolerant face, with no default written
in;
- seven value rows are refused on both faces (a non-integer, negative,
over-100 or string `scale`; an unknown `currencyMode`; a 4-letter
`defaultCurrency`; the removed `currencyConfig.precision`);
- `scale` on a currency entry is refused at `scale` with the spec's
text, with two controls;
- `fields[].currency` stays refused by name;
- the guide's `action:button` shape parses, and `endpoint` stays
refused;
- type level: both members are the spec's exactly, and not `any`.
`form-field-zod-coverage.test.ts` adds the two keys to its declared set.
The new catalog test is described under B.
- **Predictions were written before any leg** (head `5f049697`). Every
leg ran on committed code. Each restore was proven by blob equal to HEAD
and an empty `git diff HEAD`.
- **R0**, `form.ts` and `form.zod.ts` at base under this head's pins.
Predicted 17 red (pin 11, coverage 1, catalog 5) and 3 `tsc` errors, all
in the pin. Observed `Tests 17 failed | 135 passed (152)` and 3 `error
TS2344`, all in the pin.
- **A1**, the zod `scale` member deleted through objectstack's
`scripts/ablation-replace.mjs` (anchor 1 → 0, blob `8056f03b` →
`c397dd27`). Predicted 11 red and at least 2 `tsc` errors. Observed
`Tests 11 failed | 141 passed (152)`. `type-check` stopped at its first
project with 1 error (`form.zod.ts`, `field.scale`). Its test project,
run alone under the same mutation, shows 2: that one, and
`zod-mirror-parity`'s ledger naming `form.zod.ts#FormFieldSchema`.
- **A2**, the zod `currencyConfig` member deleted (blob `8056f03b` →
`6febb5ab`). Predicted 9 red and at least 1 `tsc` error. Observed `Tests
9 failed | 143 passed (152)` and 1 (the parity ledger).
- **A3**, the currency rule disarmed (`if (false)`, blob `8056f03b` →
`f05fc4dd`). Predicted 1 red and 0 `tsc`. Observed `Tests 1 failed | 151
passed (152)` and 0.
- **A4**, the TS `scale` member deleted (blob `9c210d73` → `80d35122`).
Predicted 0 red and at least 3 `tsc` errors. Observed `Tests 152 passed
(152)` and 4: 2 in the pin, plus 2 in the parity ledgers (one naming
`form.zod.ts#FormFieldSchema`, one naming `scale`).
- **Union at the final head `5f049697`:** `pnpm exec vitest run
--maxWorkers=2 packages/types/ packages/fields/ examples/schema-catalog/
scripts/__tests__/` gave `Test Files 824 passed | 3 skipped (827)` and
`Tests 21333 passed | 9 skipped (21342)`.
- **Type-check:** `pnpm --filter @object-ui/types type-check` (script
line `@object-ui/types@17.7.0 type-check` echoed; its
`tsconfig.test.json` lists both edited pins) and `pnpm --filter
@object-ui/example-schema-catalog type-check` (echoed; its test project
lists the new test). Both exit 0, with 0 `error TS`.
## Gates at `5f049697`
objectui has no `dispatch-gates`, so this set is the brief's list plus
what the diff touches, derived by hand from the root `package.json`. All
exit 0:
- **The brief's list:**
- `check:skill-examples` and `check:doc-snippets` ("784 of 784 block(s)
judged, 0 failed"), after building the snippet gate's `--build-filter`
closure (turbo: "35 successful, 35 total");
- `check:doc-types`, `check:doc-examples` (122 blocks, 87 failing as
their ledger rows declare), `check:doc-fences` and
`check:doc-example-ids`;
- `check:spec-symbols`, and `check:component-surface-parity`
(report-only; no row names either new key);
- `check-changeset-presence` (4 published source files, 1 changeset),
`check:changeset-claims` and `check:pending-changeset-literals`;
- `check:new-line-citations` ("0 new citation(s)") and
`check:control-bytes`.
- **Derived from the diff:** `docs:check-links`,
`check:designer-field-key-parity`, `check:handler-key-reads`,
`check:test-path-roots`, `check:prompt-keys`,
`check:action-forward-parity`, `check:vi-mock-specifiers`,
`changeset:check`, and `check-governed-queue-guard --test` over the 9
paths (NOT GOVERNED).
- **Narrowed lint**, over the 5 changed `.ts`/`.tsx` files with the root
`eslint.config.js` and `--no-inline-config`:
1. The population is its `**/*.{ts,tsx}` blocks.
2. `--format json` lists 5 files, with 0 errors and 9 warnings. All 9
are `no-explicit-any` in `form.ts`, and the same 9 read at base through
`--stdin`. The other three existing files read 0/0 at base.
3. Invariance: no `parserOptions.project` or `projectService`, and no
`eslint-rules/` rule reads the filesystem, so the diff cannot move an
untouched file's verdict.
NOT MEASURED:
- `pnpm check` (the CLI self-check `lint.yml` runs). Reason: it needs
the built CLI. It exits non-zero only on unreadable JSON, and both
edited JSON documents parse.
- Repository-wide `pnpm lint` and `pnpm test`. Reason: CI-owned.
- CI on this PR. Reason: opened with this report; convergence is the
seat's.
## Acceptance notes
- **The card's executable acceptance holds on this head**: M3 class (ii)
reads 0 corpus pairs. The 32 class (i) pairs remain, a source-read
grade, carried by objectui#5250 slice B.
- **B widened the strict face by `currencyConfig`**, which the claim's
file surface allowed (`form.ts` / `form.zod.ts`) but its Clause-② note
did not expect. The reason is above: the moved documents need it to
parse.
- **The tolerant face narrows** on a malformed `scale` /
`currencyConfig` and on `scale` on a currency entry. The changeset
states this as BREAKING. No corpus document writes either malformed
shape: M3's red-today count moves only by the guide's fence.
- **Not this round's, read but not changed.** `CurrencyFieldMetadata`
(the field-metadata type) still declares `currency`.
`content/docs/fields/currency.mdx` teaches it in a `ts` fence, beside
the two catalog examples that now write `currencyConfig`. Both are limb
1 of `resolveFieldCurrency`, which the ACCEPT keeps as a separate
question. Noted, not filed.
- PR objectui#11069 (parked) edits a different section of the same guide
(the validation doors), so no textual overlap is expected.
- The M3 scratch instrument and the probes are not committed.
---
_Generated by [Claude
Code](https://claude.ai/code/session_01DBZ9bntPZ7VKyQNtJeNsgw)_
Co-authored-by: Claude <noreply@anthropic.com>scale and currencyConfig by spec reference; M3 class (ii) reads 0 (objectui#11070 round 13) (#11972)1 parent a920d8c commit 18d7b48
9 files changed
Lines changed: 322 additions & 7 deletions
File tree
- .changeset
- content/docs/guide
- examples/schema-catalog
- src/schemas/fields-currency
- test
- packages/types/src
- __tests__
- zod
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
320 | 320 | | |
321 | 321 | | |
322 | 322 | | |
323 | | - | |
| 323 | + | |
324 | 324 | | |
325 | 325 | | |
326 | 326 | | |
| |||
334 | 334 | | |
335 | 335 | | |
336 | 336 | | |
337 | | - | |
338 | | - | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
339 | 340 | | |
340 | 341 | | |
341 | 342 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
90 | 94 | | |
91 | 95 | | |
92 | 96 | | |
| |||
0 commit comments