Uh oh!
There was an error while loading. Please reload this page.
test(types): pin the PartialSchema collapse, plus the #5155 sequencing note - #6433
Merged
Merged
Conversation
…g note `PartialSchema<T>` declares exactly ONE property for every instantiation and carries a live `[key: string]: any`, so it accepts anything. Measured through the checker against the emitted `index.d.ts`: PartialSchema<ObjectGridSchema> -> 1 declared property: type (source: 61) PartialSchema<ObjectFormSchema> -> 1 declared property: type (source: 67) PartialSchema<ObjectViewSchema> -> 1 declared property: type (source: 42) PartialSchema<ButtonSchema> -> 1 declared property: type (source: 27) `keyof T` on a type carrying a string index signature is `string | number`, so `Partial<Omit<T, 'type'>>` rebuilds the index signature and none of the named members. objectui#6151's collapse in a heritage clause and objectui#6269's in property position, here in a generic mapped-type alias. The declaration is deliberately unchanged: retiring a published export sits on the human floor, in-place repair is unavailable for a generic `T`, and objectui#5155 is expected to make the alias work as written with no edit. What this removes is the one impermissible state -- declared, published, collapsed, and unpinned. Part of #6397
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
|
os-support-ai
marked this pull request as ready for review
August 26, 2026 00:13
Uh oh!
There was an error while loading. Please reload this page.
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 freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
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#6397
Pins the
PartialSchema< T >collapse and records the objectui#5155 sequencing note.Nothing about the type changes. The declaration is byte-identical, no export is added,
removed, deprecated or narrowed, and the whole
src/index.tsdiff sits inside a JSDoc block(mechanically checked: every added/removed line in that file is inside a comment).
Scope — and what is deliberately NOT here
Triage's 2026-08-25 re-judgement (objectui#6397) withdrew the retirement default and narrowed
this card to the option-3 floor. So this PR does not retire, remove, deprecate or narrow
the alias, and adds no
@deprecatedtag. Removing a published export of@object-ui/typesisa breaking removal of published capability and sits on the human floor; and once objectui#5155
lands the alias works as written, which is why the removal question is being left alone rather
than escalated. What ships here is the retirement of the one impermissible state —
declared, published, collapsed, and unpinned.
Omit< T, K >) below, per the card's ownconvention — GitHub's body sanitizer eats a fragment that opens with an identifier in angle
brackets.
The two readings, quoted
What the alias promises — its own doc comment, "all properties optional except the type".
That is the reading you get when
keyof Tresolves to the literal member names. Measured on acontrol type that declares no index signature:
What it delivers — measured through the TypeScript checker against the emitted
index.d.ts, the same instrument that produced objectui#6269's 61 -> 0 reading:Omit< T, K >isPick< T, Exclude< keyof T, K > >, andkeyof Ton a type carrying a stringindex signature is
string | number— the literal member names are absorbed. EveryT extends BaseSchemainheritsBaseSchema's[key: string]: any(objectui#5155), soPartial< Omit< T, 'type' > >rebuilds a type holding the index signature and none of the namedmembers. The explicit
{ type: T['type'] }half is the only reason the count is 1 and not 0.Same mechanism as objectui#6151 (heritage clause) and objectui#6269 (property position); this
is its third position, a generic mapped-type alias, which is why neither of their guards sees
it — #6151's walks the
LayoutSchemaunion, #6269's readsObjectViewSchema's two slots.Census — zero in-repo instantiations, stated rather than passed over
Re-run on this branch across
packages/,apps/,examples/,content/,docs/andscripts/, excludingnode_modulesanddist: exactly one occurrence of the identifier,and it is the declaration itself (
packages/types/src/index.ts). There is no call site, nore-export under another name, no doc page and no test. (The card counted two because its grep
included the package's own emitted
dist/index.d.ts; a fresh worktree has nodist/.)So there is no real usage to pin against, and rather than let that pass unremarked: the four
types measured are chosen deliberately. They are the four the card itself measured, they are
real published schemas of this package spanning four families, and they are the population an
"editor partial schema" alias would actually be pointed at. The synthetic
IndexFreeSchemaappears only as the control, never as the subject.
The pin
packages/types/src/__tests__/partial-schema-collapse-pin.test.ts— 31 assertions in foursections. It emits declarations with the package's own tsconfig into a scratch dir and
measures those, for the reason recorded in
stack-schema-emitted-members.test.tsandobject-view-slot-key-lists.test.ts: the per-PRtestjob runs with no build ahead of it, soa guard reading
dist/would be absent-or-stale on a cold cache — vacuous exactly where it isneeded.
PartialSchemais generic, so the instantiations are made in a probe source filewritten next to the emitted
index.d.ts../indexto the freshlyemitted file (not
dist/, not anode_modulescopy), and the four source schemas stilldeclare 20+ members each.
T: 4 declaredmembers, no index signature, everything but
typeoptional.["type"], drops 20+ namedmembers the source declared, and carries a live string index signature.
BaseSchemastill declares[key: string]: any.The sequencing note lives in two places: the pin's header (with an explicit removal condition)
and the alias's own doc comment, which now ships in the published
.d.ts— confirmed on a realpnpm --filter @object-ui/types build, with the declaration itself emitted verbatim.⭐ This file is expected to go red when objectui#5155 lands. That is the point. The header
says so and says what to do: delete the file, do not relax the assertions.
Ghost-assertion guard — direction predicted before each run
A pin on a collapsed type is easy to write vacuously, so both legs were run against a
committed tree and restored by hash, never by exit code.
Ablation 1 — the objectui#5155 counterfactual. Removed
[key: string]: anyfromBaseSchema, which is what makeskeyof Tresolve the way the alias's author intended.Predicted: RED, with the four counts jumping from 1 to their source counts and every
stringIndexassertion flipping to false.Observed: RED, exactly that —17 failed | 14 passed:The 14 that stayed green are sections 0 and 1 — the instrument and the control never depended
on that index signature, which is the positive half of the guard: what failed was the collapse
reading and only the collapse reading.
Ablation 2 — retire the alias. Deleted the
PartialSchemadeclaration.Predicted: RED at section 0, the probe's import failing to resolve.Observed: RED, that
plus every downstream assertion. So the pin also notices a silent retirement, not only a
silent repair.
Where I was wrong: nowhere in direction — both legs landed where predicted. One correction
to the card's own numbers rather than to a prediction: it recorded
ObjectViewSchemaas"27+"; measured today it is 42, and 27 is
ButtonSchema's count.Each leg proved its mutation on disk before reading anything — grep counts of both the
removed and the injected text, plus a changed
git hash-object— and each restored under atrap … EXIT INT TERMwith absolute paths, verified afterwards bygit rev-parse HEAD:<path>matching
git hash-object <path>and an emptygit diff HEAD. Nodist/leg is involved:the pin emits from source at test time, so a mutation is picked up with nothing to rebuild.
The pin is inside the type-check program
Not assumed from a green gate — measured:
File surface
packages/types/src/index.ts, a new test file, and a changeset. It does not touchpackages/types/src/data-display.ts, so there is no overlap with objectui#6373 in this batch.Verification — union run at
2ec7800b0(the final commit)pnpm exec vitest run packages/types/Test Files 63 passed (63)/Tests 743 passed (743)pnpm --filter @object-ui/types run type-checktsc --noEmit && tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json)pnpm --filter @object-ui/types run lint✖ 244 problems (0 errors, 244 warnings), zero in the edited filesnode scripts/check-control-bytes.mjs✅ OK (scanned 5313 tracked text file(s))node scripts/check-changeset-presence.mjs✅ 2 source file(s) … declares 1 changeset(s)node scripts/check-changeset-fixed.mjs/check-changeset-no-major.mjsnode scripts/check-spec-symbol-derivation.mjsDeclared narrowing of the lint run. Repo-wide
pnpm lintisturbo run lint, i.e. eachpackage running its own
eslint .; my diff touches exactly one package, so its own lint run isthe complete lint for the changed surface. Three pieces of evidence, not two: (1) the population
comes from eslint's own config resolution, not my guess about which files count; (2)
eslint . --format jsoninsidepackages/typesreports 125 files linted, 0 errors, 244warnings, all pre-existing
no-explicit-anyinsrc/zod/**; (3)eslint.config.jsdeclaresno
projectService/parserOptions.project, so linting is not type-aware and a type-leveledit here cannot move any untouched file's verdict. The
.changeset/*.mdfile is outside everyeslint glob (no markdown processor is configured).
NOT MEASURED, with the reason:
pnpm check:readme-exportsexits 1 in a fresh worktree —all 378 findings are
its type entry ./dist/index.d.ts is not on disk -- run pnpm build first, naming 36 packages this PR never touches. That is a prerequisite failure, not a redgate; CI builds before it runs. Recorded rather than quietly counted as green.
Everything else in the gate farm is CI's run.
Not marked ready by design
Draft, no auto-merge, not self-merged — the PM lands this one.
Generated by Claude Code