Uh oh!
There was an error while loading. Please reload this page.
chore(type-check): retire the narrow typetests projects in graduated packages (#4291) - #4345
Merged
Merged
Conversation
…packages (#4291) `tsconfig.typetests.json` is the objectui#3181 rescue hatch: a package whose test tree was still in `check-type-check-coverage.mjs`'s TEST_DEBT could compile the one file whose whole value is compile-time assertions, instead of waiting for its whole backlog. As #4040's tranches landed full `tsconfig.test.json` projects, the hatch went redundant wherever the package graduated — the full project already compiles the same file, so the repo carried two spellings of what gets compiled plus one extra tsc per run. Retired in auth, plugin-chatbot, plugin-detail, plugin-form, plugin-grid and plugin-list, each with its `type-check` chain entry. Per package, the full project's `--listFiles` was checked to contain the exact file the narrow project named, and a provably-false `Assert` appended to that file turned the FULL project red (TS2344, exit 2) — the coverage moved rather than vanished. app-shell, components, core and react are still in TEST_DEBT and keep theirs. The gate now makes this a ratchet rather than a one-time sweep: a narrow project on a package whose full test project already compiles everything is reported as redundant, so the seventh cannot reappear. Section 5½ had no test coverage at all — the gate keeping the rescue hatch honest was itself unchecked — so it gains a fixture suite plus a real-repository pin. Refs #4040, #3032, objectstack-ai/objectstack#4118 Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 11, 2026 19:12
Uh oh!
There was an error while loading. Please reload this page.
This was referenced Aug 11, 2026
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.
Closes#4291. Follow-up to #4040 tranche 1; refs #3032, objectstack-ai/objectstack#4118.
tsconfig.typetests.jsonis the #3181 rescue hatch: a package whose test tree was still inscripts/check-type-check-coverage.mjs'sTEST_DEBTcould compile the one file whose whole value is compile-time assertions — anAssert< Equal< Local, Spec > >is atscerror or it is nothing — instead of waiting for its whole backlog to compile. As #4040's tranches landed fulltsconfig.test.jsonprojects, that hatch went redundant wherever the package graduated: the full project already compiles the same file, so the repo carried two spellings of what gets compiled, plus one extratscpertype-checkrun.Six packages had graduated. All six are retired here, with the narrow project deleted and its
type-checkchain entry removed.Inventory
maincarried 10 narrow projects. Classification, fromTEST_DEBTat78fa331:tsconfig.test.jsonTEST_DEBTauthplugin-chatbotplugin-detailplugin-formplugin-gridplugin-listapp-shellcomponentscorereactThe fifth
TEST_DEBTentry,plugin-dashboard(6 errors), never had a narrow project. The four kept ones are untouched — no file, no script, no comment.Coverage proof, per retired package
For each,
tsc -p tsconfig.test.json --listFileswas written to a file and that file grepped for the absolute path of the file the narrow project named (never piped throughhead— SIGPIPE would truncate the compiler). All six: exactly one match.authsrc/__tests__/auth-spec-parity.test.tsplugin-chatbotsrc/__tests__/spec-symbol-batch6.test.tsplugin-detailsrc/__tests__/spec-symbol-batch7.test.tsplugin-formsrc/__tests__/spec-symbol-batch7.test.tsxplugin-gridsrc/__tests__/spec-symbol-batch7.test.tsplugin-listsrc/__tests__/spec-symbol-batch6.test.tsxBeing in the program is not the same as being enforced, so each was also discriminated: append a provably-false assertion in the file's own vocabulary (
type _Probe4291 = Assert< Equal< 1, 2 > >;), run the FULL project, revert. All six went red — coverage moved, it did not vanish.Type 'false' does not satisfy the constraint 'true'in every case. The probes were appended and reverted one package at a time;git statuswas empty afterwards.The environment the file is compiled in is equal or wider
Retiring a project is only sound if the surviving one does not check the file more weakly. Both projects
extendsthe same roottsconfig.json, and neither overrides any strictness flag, sostrictand friends are identical by construction. The only differing options arelib/types/jsx/paths, and in every case the full project is a superset or an exact match:auth,plugin-chatbot,plugin-detail: narrow pinnedlib: ["ES2020","DOM"]; the full project inherits the root's["ES2020","DOM","DOM.Iterable"].plugin-grid(["ES2022","DOM"]) andplugin-list(["ES2022","DOM","DOM.Iterable"]) sit one notch above the narrow project's ES2020.types: four full projects add@testing-library/jest-domon top of the narrow["node"];plugin-detailandplugin-listmatch it exactly.jsx:plugin-detail/plugin-listinherit the root'sreact-jsx, which is what the narrow project set explicitly.paths:{}on both sides everywhere exceptplugin-detail, whose full project adds one narrow@object-ui/fields/widgets/*alias (see@object-ui/fieldsdeep subpaths resolve only through the repo vitest alias — itsexportsmap publishes none of them #4325) — an addition the guard file does not use.A wider
libcannot make a spec-parity assertion pass that previously failed; it only adds globals the guard file never references.The ratchet — so the seventh cannot appear
The count in the gate's summary line is computed, not hardcoded, so it moved on its own from
10 with a narrow type-assertion projectto4. But nothing stopped a future graduating package from leaving its narrow project behind and re-creating this exact cleanup, so section 5½ gains the invariant its own header already stated in prose:A narrow project on a package where
testsCoveredis already true is now an error.testsCoveredis true only when every test file the build program skips is read by the chainedtsconfig.test.json— which necessarily includes whichever file the narrow project names, so the redundancy is proven rather than assumed. Declared is now enforced.Reverse verification of the new rule — auth's narrow project and chain entry restored on top of this branch:
Reverted; the gate is green on this branch.
Section 5½ had no tests at all
Grepping the gate's own suite for
typetestsreturned nothing: the section that keeps the rescue hatch honest was itself unchecked — the same shape as the defect it exists to report. It now has three fixture tests (redundant-once-graduated; still-allowed-while-in-debt; the pre-existing never-runs case, pinned for the first time) and a real-repository block that holds every surviving narrow project totestsCovered === falseand names the six retired here.Verification
node scripts/check-type-check-coverage.mjs— green, before and after. Test-coverage line unchanged at35/40 packages compile their tests, 5 declared debt (189 errors outstanding), narrow projects10to4.tsccommands, per retired package, after the retirement — 12 invocations, all exit 0:vitest runover the gate suite and all five touched guard files —Test Files 6 passed (6),Tests 70 passed (70).eslintover every changed file — 0 errors (67 pre-existing warnings, allno-unused-varson the compile-time pin aliases, which is what those aliases are).type-checkscripts, checking-only tsconfig projects, test-file comments and a CI gate change; nothing published moves.Note on comment edits inside five guard files
Five guard files carried a header naming the project this PR deletes (
Compiled by this package's tsconfig.typetests.json), and three of those also claimedthis package's test tree is still in TEST_DEBT— already false onmainsince #4040. Deleting the project without touching them would ship a comment pointing at a file that no longer exists, in the very PR that removes it. They are retargeted attsconfig.test.json; the changes are comment-only, no assertion or fixture touched.plugin-list's historical note about the&&short-circuit that hid #4163 is kept as history, with its tense corrected from present to past.Generated by Claude Code