Repository navigation
feat(types,fields)!: camelCase the grid widget's eight field-level keys; the snake_case spellings are refused by name (objectui#11610) - #11614
Conversation
…eld-level keys; the snake_case spellings are refused by name (objectui#11610) `GridFieldMetadata`, the form-field face and its zod mirror now declare `minRows`, `maxRows`, `allowAdd`, `allowDelete`, `allowReorder`, `totalField`, `addLabel` and `sortField`. The retired snake_case spellings stay declared only to refuse: `?: never` tombstones on both TS faces, an alias refusal naming the camelCase key on the zod mirror, and a named refusal the `grid` widget draws instead of the grid. One list, `GRID_FIELD_RETIRED_KEYS`, feeds the zod arms and the widget. Both plugin-form adapters, the console's dev harness, the catalog fixture, the grid doc page and the clipboard-paste RFC move to the new spellings; the adapters' grid objects are now checked against `GridFieldMetadata` instead of cast through `any`. Claude-Session: https://claude.ai/code/session_01CPvhwGcirXqBGEdPSb72TZ Co-authored-by: Claude <noreply@anthropic.com>
…aws its camelCase keys through the real form path; declare the rename (objectui#11610) Claude-Session: https://claude.ai/code/session_01CPvhwGcirXqBGEdPSb72TZ Co-authored-by: Claude <noreply@anthropic.com>
✅ 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
|
Contract reviewServed-tier: Reviewed from the card (#11610: body, triage grade ① Derived judgments1. The rename of the eight 2. The new 3. The retirement form on each face — right, and it is a refusal by name on all three, never a strip, never a conversion.
4. No dual read — right. Every 5. The stored fixture migration — right. 6. The
7. The premise (no stored producer outside objectui's fixtures) — holds, on what I re-measured. Gate verdicts (the check-runs on this head, read three times):
② Semver levelLevel — right for this repository. The changeset declares
The changeset names ③ Boundary flagsDev
Dev Flags from this review: Implemented-by: VERDICT: PASS Generated by Claude Code |
✅ 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
|
Contract reviewServed-tier: Second record on this PR, for the head that merged What moved. One commit, Byte-identity, per file. I normalised the hunk headers and the ① Derived judgments1. The rename, the by-reference members, the map export, the refusal on each face, the no-dual-read reading, the fixture migration, the 2. The
3. No test or fixture this branch adds authors a snake_case or undeclared key on a fresh literal whose type #11607 closed. Inventory of every fresh literal in the diff that carries a snake_case or undeclared key, with the type it is written against:
4. 5. No comment this branch wrote describes 6. The main-side hunks of the four shared files touch nothing this branch relies on.
7. The Gate verdicts (the check-runs on this head, every run naming
② Semver levelUnchanged and still right. The changeset
What the merge adds on this axis: ③ Boundary flagsDev
Dev The earlier record's escalations: Raised by the merge: Implemented-by: VERDICT: PASS Generated by Claude Code |
… a census pin keeps it gone (objectui#11608) (objectstack-ai#11616) Fixes objectstack-ai#11608 Clause-②: yes (narrowing) Retires the `PartialSchema` utility type (generic over a node type `T`) from `@object-ui/types`. It had no reader. The census ran at work time before any write; it found no reader in any repository it could read, so the seat's premised ruling (claim `5981086062`, executing triage `5979662969`) applies: retire, with no replacement alias. ## Census, run before the first edit Hits are listed by file, never as a count. "Lit" means the control query returned a non-empty result in the same checkout, so a zero beside it is a reading. | Repository | Read at | Searched | Hits | Control | |---|---|---|---|---| | objectui | `b403bb36`, the branch base (`origin/main`) | `git grep -n -w PartialSchema` over every tracked file | The declaration and docblock in `packages/types/src/index.ts`. The import, and the "`PartialSchema` works as written" section, of `base-schema-closed-face-8347.test.ts`. Listed apart: the pending `.changeset/8347-baseschema-closed-face.md`, where one bullet describes the type, and `packages/types/CHANGELOG.md` (history). A case-insensitive substring query outside CHANGELOGs found nothing more. | `git grep -l -w SchemaByType`: lit | | objectstack | `origin/main` `da40a5f6`, read through the owned ref `refs/os-dev/issue-11608/os-main` (no file edited) | `git grep -n -w PartialSchema`, then `git grep -n -i partialschema` | none | `git grep -l '@object-ui/types'`: lit | | hotcrm | `4054ec26`, an anonymous shallow clone of `objectstack-ai/hotcrm` | `git grep -n -i partialschema` | none | `git grep -l '@object-ui/'`: lit. There is no `@object-ui/types` import to use as the control: hotcrm's metadata-reference test says the repo declares no `@object-ui/*` dependency. | | cloud | n/a | **NOT MEASURED**: not reachable from this account | n/a | n/a | The objectui hits are the declaration, its own docblock, the objectstack-ai#8347 pin, and a pending note that describes the type. None of them reads it. With no reader anywhere the census reached, the ruling is retire. For any consumer the census could not see, cloud included, the changeset's migration is the answer. ## What this removes - **`packages/types/src/index.ts`:** the `PartialSchema` export and its whole docblock. ⛔ No replacement alias. The sibling `SchemaByType` and everything else stay byte-identical. - **`base-schema-closed-face-8347.test.ts`:** the `PartialSchema` rows. That is the import, section 4 ("`PartialSchema` works as written now"), and the two bindings that section fed into the vitest leg, whose length assertion moves with them. The `ButtonSchema` import goes too, because only section 4 read it. Sections 1 to 3 and the header are byte-identical, and the numbering stays coherent because section 4 was the last. - ⛔ `.changeset/8347-baseschema-closed-face.md` is not edited (see the note under review notes). ## The census pin `packages/types/src/__tests__/partial-schema-retired-11608.test.ts` reads the retirement through three instruments. Each one has a lit control. 1. **tsc** (`tsc -p tsconfig.test.json`, chained from the package's `type-check`) reads a `@ts-expect-error` row on the root barrel (`import('../index').PartialSchema`). Its control is the sibling `SchemaByType` through the same import form, with no directive. 2. **The `exports` map** (vitest) reads every entry's `types` target, maps it to the `src/` module that `tsc` emits it from, and asserts that each module exists and that none of them names `PartialSchema`. An entry added later is covered automatically. Control: the same read finds `export type SchemaByType` in the `.` entry's source. It reads `src/`, not `dist/`, because the per-PR `test` job builds nothing first. 3. **The tracked tree** (vitest) runs `git grep -nE` for the word over every tracked file except `*CHANGELOG.md`, `.changeset/` and the pin itself. A re-export chain is caught here: whatever module declares the alias names it, and that module is tracked. Control: the same probe finds `SchemaByType`. The pin also compiles the changeset's TO spelling for `ButtonSchema`. It checks that the spelling keeps the same key set, that `type` stays required (a `@ts-expect-error` row), and that a misspelled key is refused (a `@ts-expect-error` row). ### Ablation (one-off proof, nothing left in the tree) The fix was committed first (`de3dcf5b`). The mutation went through objectstack's `scripts/ablation-replace.mjs`, which puts `export type PartialSchema` back into `index.ts` right after `SchemaByType`. Its own on-disk evidence showed the anchor going from one hit to none, the replacement from none to one, and the blob changing. Both readings were taken on the mutated tree: - **vitest:** the run went red, and the two absence tests failed by name. "no entry source module names `PartialSchema`" listed `. -> packages/types/src/index.ts`. "the symbol `PartialSchema` appears nowhere: ..." listed the restored `index.ts` declaration. Both lit controls and the TO-spelling leg stayed green. - **tsc:** `TS2578: Unused '@ts-expect-error' directive`, on the `_RetiredFromTheRootBarrel` row. - **Restore:** `git checkout HEAD --` on the absolute path. The blob after the restore equals the HEAD blob (`333196a9`), and `git diff HEAD` is empty. After that, all of `packages/types` vitest and `type-check` went green at `de3dcf5b`. - The first attempt was a no-op. The tool refused it because the replacement contained the anchor, so the anchor count did not drop. Nothing ran, and the file was restored. It was re-anchored and run again, and only that second run's reading is reported above. ## Changeset `.changeset/11608-partialschema-retire.md`, `@object-ui/types: minor`. It carries a breaking banner, the line `**Clause-②: yes (narrowing)**`, and a FROM and TO pair: - **FROM:** the `PartialSchema` import and annotation. - **TO:** the node type's own declared members, or, for a partial value, `Partial` of `T` intersected with `{ type: T['type'] }`, written inline. The TO spelling was checked to compile (generic and concrete) in a scratch program, with a control that went red. It is also pinned in the census pin above. ## Gates (local, at `de3dcf5b`) - **`packages/types`:** `type-check` (all three `tsc` programs) green. vitest over `packages/types/` green. Both ran under `os-verify-lock`. - **`pnpm lint` on the touched files:** eslint over the three touched `.ts` files is clean in its JSON output. This is a declared narrowing. The population is eslint's own config, and the file set is the three paths the JSON names. The invariance: the config enables no type-aware linting (no `parserOptions.project` or `projectService`), so this diff cannot change the verdict on any untouched file. The full `pnpm lint` is CI's. - **The packages built for the dist-reading gates:** every package was built first (`pnpm --filter … run build`, no turbo cache touched). `dist/index.d.ts` names `SchemaByType` and not `PartialSchema`. - **Green, with the built tree in place:** `pnpm check:readme-exports` and `pnpm check:doc-snippets`. `pnpm check:doc-types` is green too, although no doc names the type. - **Also green:** `pnpm check:new-line-citations` (zero new citations) and `pnpm check:control-bytes`. - **The changeset checkers:** `changeset:check` (fixed and no-major), `check-changeset-presence`, `check-changeset-overwrite` (one added, nothing pre-existing modified), `check:changeset-claims` and `check:pending-changeset-literals`. All green, and none objects to the two pending notes describing the same type. - **Also run because the diff implicates them:** `type-check:coverage`, `check:test-path-roots`, `check:spec-symbols`, `check:unreferenced-sources`, `check:component-surface-parity` (report-only) and `check:published-dist`. All exited 0. - **The repo-wide `git grep -w PartialSchema` after the change**, outside CHANGELOGs, hits only the two pending changesets and the new pin. Its control, `SchemaByType`, is lit. ## Notes for review - **Two pending notes about one type.** `.changeset/8347-baseschema-closed-face.md` has a bullet saying the alias "works as written". This PR removes the alias. Per the dispatch, the objectstack-ai#8347 note is not edited here. This PR's changeset says that it supersedes that bullet. If both ship in the same release, the seat may want to drop or amend that bullet. No changeset checker objected. - **Serial:** `origin/main` had not moved past `b403bb36` when this was opened, so merging it was a no-op. objectstack-ai#11614 (which also touches `packages/types/src/index.ts`, in a disjoint region) was still open. - No labels written; the dispatch named none. --- _Generated by [Claude Code](https://claude.ai/code/session_01CPvhwGcirXqBGEdPSb72TZ)_ Co-authored-by: Claude <noreply@anthropic.com> Co-authored-by: Leehom <pm@objectstack.ai>
Fixes #11610
Clause-②: yes (narrowing)
The
gridwidget's eight field-level keys become camelCase in one move across the published type, its zod mirror, the form-field face and every reader. The snake_case spellings retire at once and are refused by name on all three faces, each refusal naming the camelCase key. Ground: objectstack-ai/objectstack#21704 fork 2, ruled B (record5978663135); claim5979906990(seat ruling: refuse by name, no load-time conversion, premised on no stored producer). Dispatch sessionsession_01CPvhwGcirXqBGEdPSb72TZ,mode:subagent.Premise (measured before any edit): no stored producer outside objectui's own fixtures
origin/main316be321(read throughgit grepon a private ref, nothing edited): the eight snake_case words occur only in comments, test strings and one changeset line.packages/speccomponent.zod.tsnames them in three comments (the line-items guidance block, thecustomFieldsfork note, the master-detailsortFieldretirement note); the retirement test fordetails.sortFieldcarries one as a must-not-match judge string;conversions/registry.ts,migrations/registry.tsand the retired-key entry fordetails.sortFieldcarry it in comments. No schema declares or emits any of the eight as a field's metadata, and the spec'sFieldTypeenum has nogridmember at all, so the spec cannot store agridfield. The seat's reading is confirmed.b508ac50(every tracked file,git grepon that commit), each hit classified:GridField.tsx(the eight reads).MasterDetailFormandLineItemsPanel(both hand the grid an object cast throughany), andapps/consoleDevLookup(a dev harness).GridFieldMetadata, the form-field face (FormField), its zod mirror (FormFieldSchema).examples/schema-catalogfields-grid/line-items-grid.json(the only stored document).content/docs/fields/grid.mdx; the clipboard-paste RFC (statesmax_rows/allow_addas GridFieldMetadata's API in its proposed wiring); ADR 0001 (reported below, not edited).GridFieldtest files inpackages/fields(the triage counted five), the master-detail members test and the line-items total test inpackages/plugin-form, threepackages/typestests (strict face, form-field coverage, mirror parity comment), the console registry pin's prose.## MAX_ROWS vs MIN_ROWSheading-anchor string inplugin-markdown's toc test; the en locale comment (a comment about the grid's label, updated); everyCHANGELOG.md(history, untouched). The master-detaildetails.sortFieldthe spec retired is a different key on a different object and stays untouched.customFieldsentries) and the triage's hotcrm / cloud reading (0 hits).Rename map
min_rowsminRowsmax_rowsmaxRowsallow_addallowAddallow_deleteallowDeleteallow_reorderallowReordertotal_fieldtotalFieldadd_labeladdLabelsort_fieldsortFieldOne list holds it:
GRID_FIELD_RETIRED_KEYS(new export of@object-ui/types, with its key typeGridFieldRetiredKey). The zod arms and the widget both read it; a type-level pin holds its keys equal to thenevertombstones and its values equal to the live camelCase members.The retirement form, per face (refused by name, never stripped)
GridFieldMetadataandFormFieldeach declare the eight snake_case keys asnevertombstones with a@deprecatednote naming the replacement.{ type: 'grid', name: 'lines', min_rows: 1 }typedGridFieldMetadatadoes not compile; on the docs face the gate's compile ofgrid.mdxreportsTS2322: Type 'number' is not assignable to type 'undefined'for the same key.@object-ui/types/zod).FormFieldSchemadeclares each snake_case key as analiasKeyRefusalarm. On the mirror, the tolerant face (safeValidateSchema, theobjectui validatedoor) and the strict authoring face,fields[0].min_rows: 1answers exactly one issue,invalid_typeatfields.0.min_rows, whose message leadsUnrecognized key(s) on this form field: `min_rows`. Did you mean `min_rows` → `minRows`?and goes on to say the value stays the same. Any value is refused (the refusal is by name). The camelCase key with the same value parses and is kept on all three doors.@object-ui/fields).GridFieldis now a thin gate over the grid body: a field whose metadata carries any snake_case key (with a defined value) is drawn asRetiredGridFieldKeysinstead of the grid, an inlinerole="alert"(data-testid="grid-field-retired-keys") reading for example[object-ui] Grid field `lines` carries retired snake_case key(s): `min_rows` → `minRows`. …, plus the same text onconsole.erroronce per message. This isRetiredFieldTombstone's settled shape in this package: nothing thrown, nothing silently substituted, rows untouched (onChangeis never called).Producers move with it: both plugin-form adapters write the camelCase keys, and their grid object is now
satisfiesPartial ofGridFieldMetadatainstead ofas any, so a snake_case key written there no longer compiles.Pins and guards, with ablation readings
All ablations ran through the anchored mutation tool (anchor must hit; blob change and restore proven on disk; restore leg
git checkout HEAD, blob after restore equal to the HEAD blob,git diff HEADempty), from committed state.GridFieldwith a lit control without the key (GridField.retiredSnakeKeys-11610.test.tsx):minRowsdisables every Remove at the minimum;maxRowsdisables Add and every Duplicate at the maximum;allowAdd: falseremoves Add and Duplicate;allowDelete: falseremoves Remove;allowReorder: falseremoves the drag handles;totalFielddraws the footer total (30);addLabellabels Add;sortFieldstamps the new indices after a drag. Through the real form path too:fields-grid-keys-camelcase-11610.test.tsxrenders the catalog fixture throughSchemaRendererand the form renderer (labelAdd line item, total109.97, two drag handles / Duplicate / Remove, all enabled), with the snake_case respelling as its control.console.erroris called once with the alert's text; edges pinned: several keys in one alert in map order, a snake key beside its camelCase twin is still refused, anundefinedvalue is not refused (as on the TS and zod faces), a nameless field reads "This grid field", a second mount logs nothing new.undefinedrow) green. Restored.grid-field-keys-camelcase-11610.test.ts, three doors × eight keys, plus lit controls and an any-value row).min_rowsarm): 8 tests red (themin_rowsrow and the any-value row on each of the three doors, and bothform-field-zod-coveragerows). Restored.tsc -p tsconfig.test.json): anEqualrow per member on both faces, akeyofmembership row onFormField, and the map-equals-tombstones rows.GridFieldMetadatatombstones): the eightEqualrows red,TS2339naming each key; the two map rows red; the strict-face lit-control row red; the map'ssatisfiesred (TS2561).@ts-expect-errorrows over freshGridFieldMetadataliterals stayed SILENT: with the member gone the key is still an excess property and the directive swallows it. That is the objectui#8347 lesson, reproduced; theEqualrows are what catch the deletion.total_fieldalone): exactly itsEqualrow (TS2339), the map row and thesatisfiesred.FormFieldtombstones): the eightEqualrows and thekeyofrow red, fourTS2578unused@ts-expect-error(the index signature now accepts the key), the strict-face by-reference rows red, and the mirror-parity ratchet red onFormFieldSchema.sort_fieldalone): itsEqualrow, thekeyofrow, itsTS2578, the strict-face rows and the parity ratchet red, namingsort_field.tsc -p tsconfig.test.jsonruns are in the gates below.grid.mdx's snippet snake_case turnspnpm check:doc-snippetsred at that line (TS2322), restored green.Repo-wide pin sweep: every assertion that read a grid key by its snake_case spelling now asserts the camelCase key's substance (the master-detail grid object's exact key set and values, the strict face's accept and wrong-type rows, the coverage key set, the widget draws). The rejection rows for genuinely wrong values (a string
minRows, a numericaddLabel, …) stay, respelled; the guarded surface grows by the eight refusals.Files and landing point
The claim's surface, plus two adjacent files the census named:
apps/consoleDevLookup.tsx(a producer) and its registry pin's prose;packages/i18nen locale (one comment namingadd_label); the RFC. The landing point is the claim's list; no producer was found in another package.ADR and RFC
docs/adr/0001-master-detail-subform.md(governed, ⛔ not edited) names the keys in three sentences: "Honorsmin_rows/max_rows/allow_add/allow_deletefrom the …", "Drag reorder of lines (allow_reorder), grouping/subtotal rows." and "… drag-to-reorder (asort_field…". Reported for whoever owns that record.content/docs/rfcs/0001-clipboard-paste.md(status Draft) statedmax_rows"from GridFieldMetadata" and wiredfield.allow_add/field.max_rowsas the current API, so it is edited to the camelCase keys.Serial and overlap
The claim's serial step is done. objectui#11605's PR #11612 (
fd060f07) and objectui#8347's PR #11607 (b403bb36) both landed.mainatb403bb36is merged into this branch by merge commit8b56ef26. Its combined diff is empty, so no hunk was hand-resolved.The four files this branch shares with them carry
main's hunks outside this branch's hunks:packages/i18n/src/locales/en.ts,packages/types/src/form.ts,packages/types/src/index.tsandzod-mirror-parity.test.ts. The contract review on the merged head (5981193754) reads every hunk of this branch as byte-identical to the reviewed head. The gate verdict on the merged head is its own check-runs.Gates (the dev's local readings, tree
82b400f9; the current head's verdict is its check-runs)@object-ui/types,@object-ui/fields,@object-ui/plugin-form,@object-ui/i18n,@object-ui/example-schema-catalog,@object-ui/console— all exit 0 (the console run after building@object-ui/plugin-tree, which its import graph needs). The fields and plugin-form test programs list the touched test files (--listFilesOnly).packages/types/353 files / 9482 tests passed;packages/fields/233 passed + 1 skipped / 3647 passed + 7 skipped;packages/plugin-form/163 / 1889 passed + 1 skipped;examples/schema-catalog/+ the console registry pin +packages/i18n/121 / 3807 passed + 13 skipped. Thetypes/fields/plugin-formruns measured a working tree byte-identical to82b400f9(its two later-committed files, the changeset and the catalog test, were already on disk); the rest ran at82b400f9.eslintwith the root config, as each package'slintruns it) over the 25 touched TS/TSX files, counted from--format json: 0 errors; the one finding on a touched line is the pre-existingas anywarning inGridField.test.tsx's fixture. Narrowing statement: the population is every file under the touched packages, read by the one rooteslint.config.js; it enables no type-aware linting and no custom rule reads the filesystem, so this diff cannot move a verdict on an untouched file.pnpm lintitself is CI's.check:doc-snippets(777 blocks judged, 0 failed),check:doc-examples,check:readme-exports,check:new-line-citations(0 new),check:control-bytes,check:spec-symbols,check:designer-field-key-parity,check:prompt-keys,check:handler-key-reads,check:unreferenced-sources,check:phantom-deps,check:self-import,check:test-path-roots,check:doc-types,check:doc-example-ids,check:doc-fences,check:doc-example-readers,check:i18n-drift,check:i18n-keys,check:esm-specifiers,check:side-effects-array: all exit 0..changeset/11610-grid-keys-camelcase.md:@object-ui/typesand@object-ui/fieldsminor, breaking banner, FROM → TO for all eight,Clause-②: yes (narrowing).node scripts/check-governed-queue-guard.mjs --testover the diff answers NOT GOVERNED.Acceptance notes
totalFieldnames the CHILD column summed (the value a specamountFieldcarries), while the spec's owntotalFieldon a master-detail subform orrecord:line_itemsnames the PARENT field the sum is saved to. The mechanical camelCase oftotal_fieldlands on that homonym. Every declaration, the doc page and the changeset say so; the open question in the report asks the seat whether the spec's runtime form field should carry it under this name.drillDown.report, object-formcustomFields, formsections, object-timelineitems,action:group/action:menumembers objectstack#21704), the three objectstack comments that still name the snake_case keys can move with it. Carrier: that stage.DevLookup.tsxkeeps itsas anyfield (a dev harness; only the key moved).The dispatching session is
https://claude.ai/code/session_01CPvhwGcirXqBGEdPSb72TZ.Generated by Claude Code