Commit ea84651
committed
test(type-check): 12 packages type-check their tests, and the gap is now declared (objectstack#4118)
A package tsconfig excludes test files — correctly, it is the BUILD config and
they would emit into `dist`. The hole is that no other `tsc` invocation read them
either, so for most packages nothing compiled a test at all. objectui#3009 found
what that costs: `spec-derived-unions.test.ts` had built its whole contract on
`satisfies` checks that never ran, under a header calling them "the real
enforcement". Reverting a derived alias produced zero errors.
Tests are where agents encode their understanding of a contract. Unchecked, a
wrong understanding accumulates silently and then reads as evidence.
Wires up every package measured at zero code-tier errors — 12, not the 8 the
issue estimated. The extra four fell out of a better config template:
`plugin-calendar` and `plugin-kanban` needed only the jest-dom matcher types,
`providers` was already clean, and `sdui-parser`'s 50 TS2304s were env globals
exactly as the issue suspected, not real errors.
Wiring `sdui-parser` up surfaced a real bug: `render.test.tsx` imports
`@object-ui/core` and `@object-ui/react` with neither declared in its
package.json. Both were phantom — resolved only through the ROOT tsconfig's
`paths` alias and vitest, never as a dependency a consumer would get. Declared as
devDependencies, which is also what makes the `paths: {}` in the new config
meaningful: with the alias in place an undeclared workspace import still compiles.
Every `tsconfig.test.json` follows objectui#3009's template — `noEmit`,
`composite: false`, `paths: {}` to kill the TS6059 source-leak noise, and `lib` /
`types` only where the tests actually need them (`mobile` reads
`Array.prototype.at`, so ES2022; `plugin-report` pulls in a source file that
reads `process.env`, so `node`).
The guard grows a second half so this cannot silently regress. A package with
test files either compiles them or carries a TEST_DEBT entry with a MEASURED
count — re-measured against current main, not copied from the issue's table:
240 code-tier errors across 15 packages. It also fails on a `tsconfig.test.json`
that nothing runs, which is the objectui#3009 shape itself: a file that looks
like enforcement while no compiler reads it.
Discrimination proof — three ways it fails, run before landing:
1. unchaining plugin-tree's config: "has a tsconfig.test.json that its
type-check script never runs … the exact shape of objectui#3009"
2. deleting the `permissions` TEST_DEBT entry: "has 3 test files that no `tsc`
invocation reads"
3. a package listed in both DEBT and TEST_DEBT is rejected as one gap counted
twice (this is how `layout` was caught during the sweep)
Refs objectstack#4118, objectui#3009, objectstack#4074, #2911, #2901
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01Rvv6qysks2dRLaGfpTdgEy1 parent 0c2ec44 commit ea84651
26 files changed
Lines changed: 449 additions & 18 deletions
File tree
- packages
- mobile
- plugin-calendar
- plugin-designer
- plugin-kanban
- plugin-markdown
- plugin-report
- plugin-timeline
- plugin-tree
- providers
- react-runtime
- runner
- sdui-parser
- scripts
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
30 | 30 | | |
31 | 31 | | |
32 | 32 | | |
33 | | - | |
| 33 | + | |
34 | 34 | | |
35 | 35 | | |
36 | 36 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
24 | 24 | | |
25 | 25 | | |
26 | 26 | | |
27 | | - | |
| 27 | + | |
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| 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 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
| |||
| 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 | + | |
0 commit comments