Repository navigation
test(ci): a dist vitest project so built-artifact claims can be pinned - #7291
Conversation
The root `vitest.config.mts` aliases every workspace package to its `src`, which is right for the ~2000 tests that want fast source feedback and leaves "does the SHIPPED BUNDLE still do X" unanswerable. Such a test could not be committed: turbo's `test` task is `dependsOn: ["^build"]` — the DEPENDENCIES' builds, not the package's own — so a `dist`-importing test landed in CI with no `dist` to import. That is NOT MEASURED rather than a red pin, and the usual repair (delete it, or let it skip when `dist` is missing) leaves a green suite that measures nothing. Two lanes hit this wall in one morning and each threw a correct measurement away. Implements the PM ruling on objectui#7183 (option 1, 2026-09-02): - `vitest.config.mts` gains a fourth project, `dist`, collecting `packages/*/src/**/*.dist.spec.tsx`. The suffix keeps these files out of `unit`, `dom` and `dom-heavy` BY CONSTRUCTION — none of the three needed a character changed — and out of each package's `tsconfig.test.json`, which matters because turbo's `type-check` waits on `^build` and must never read the package's own `dist` (objectui#4801). - The project is OPT-IN behind `OBJECTUI_DIST_PINS=1`. CI's test job runs `pnpm test` with no build step, so an unconditional fourth project would be collected there with no `dist` on disk and would fail every PR. The one false-green this opens — `--project dist` without the env var collecting zero files and exiting green — is refused in the config with a message naming the right command. - `turbo.json` gains `test:dist`, `dependsOn: ["build"]` (self, not `^build`), `cache: false`: a lane whose subject is a build artifact turbo does not hash must not replay a verdict. That places it on the uncached side of the partition `scripts/__tests__/turbo-task-guard-coverage.test.ts` enforces, whose docstring is updated to match. - The light dom setup is deliberate, not a cost optimisation: `vitest.setup.dom.tsx` registers `page:header` from SOURCE, which would keep a pin green with the built bundle removed entirely. First resident: the objectui#6252 acceptance criterion PR objectui#7180 measured by hand and could not commit — an id-authored `page:header` resolves through the BUILT renderer and carries no `body.source` into the DOM or the authored node. Its live control is part of the pin: with the `dist` import removed the run fails `expected undefined to be truthy`. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
✅ 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
|
|
CI red on
Generated by Claude Code |
… still type-checks
The `dist` project entry added for objectui#7183 sits inside a conditional
spread, and inside that array literal `extends: true` widens to `boolean`.
`TestProjectConfiguration.extends` is `string | true | undefined`, so the widened
element matches no `defineConfig` overload and the whole `projects` array
degrades to `never[]`:
../../vitest.config.mts(311,7): error TS2769: No overload matches this call.
../../vitest.config.mts(325,7): error TS2769: No overload matches this call.
vitest.config.ts(11,15): error TS2345: Argument of type 'UserConfig & …'
is not assignable to parameter of type 'never'.
CI reported it on `@object-ui/console#type-check` rather than here, because
`apps/console/vitest.config.ts` merges this config and is the type program that
reads it — the root `.mts` is compiled by nobody on its own.
`as const` keeps the literal narrow. The three pre-existing projects are
unaffected: their `extends: true` sits in the plain array, where it never
widened. A comment records why the annotation is load-bearing, since it reads
like removable noise.
Measured red -> green on the reported program, deps built through turbo first
(the errors are unreachable behind 378 TS2882s on an unbuilt tree):
before exit 1, 3 errors
after exit 0, 0 errors
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b
✅ 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
|
…erdict (#3240) Direction A, ruled by the maintainer 2026-08-06 and reaffirmed by the delegated ruling of 2026-08-10: the root `vitest.config.mts` becomes the single entry, and a per-package run reaches it by path filter. What was there: 19 non-root vitest configs (the card's 17 under `packages/`, plus `apps/console` and `examples/schema-catalog`). Eleven of the seventeen were byte-identical standalone `defineConfig`s — `happy-dom` + `globals` + a one-line local setup and NO alias table, where the root config maps ~40 `@object-ui/*` specifiers at a sibling's `src/`. The other six re-exported or merged the root config, so they only ever restated it. What replaces them, per package: nothing. The root config already supplies every property they declared — `globals`, `happy-dom`, and jest-dom via `vitest.setup.dom-light.tsx` — plus the alias table they lacked. The one setup file that was not the shared one-liner, `plugin-map`'s, mocked `maplibre-gl`; `vitest.setup.base.ts` has mocked it globally all along, so that copy was a duplicate no canonical invocation ever loaded. Redefining the per-package run (the ruling's second clause): every `test` script is now `vitest run --root ../.. <pkgdir>/`, the shape PR #3869 landed for `packages/runner`. `pnpm --filter <pkg> test` and `turbo run test` were REFUSED by the invocation guard before this; they now run, against the same config CI uses, over exactly that package's files. Closing route 4 first, which the ruling did not anticipate: Vitest's config fallback does not stop at `vitest.config.*`. With none present it takes the directory's `vite.config.*`, and every `packages/*` has one — carrying a vestigial `test` block (`passWithNoTests: true`, a partial alias table, a setup the root config never loads). Deleting the 14 vitest configs whose packages also have a vite config would have moved them onto that route, widening the hole #5406 closed in the name of closing it. So each `packages/<pkg>/vite.config.ts` now calls the guard — gated on `process.env.VITEST`, which Vitest sets when it loads a config and `vite build` does not (measured both ways) — and the vestigial `test` blocks are deleted. turbo's `test` keeps `dependsOn: ["^build"]`, for a re-derived reason. The reason of record was resolution through `dist`, and that is now obsolete. But `^build` is the only edge putting a dependency's sources into a dependent's `test` cache key, and `helpers/vitest-config-program.ts` narrows its sweep by delegating to exactly that. Dropping it would replay stale greens; the note now says so. Evidence: `vitest list --filesOnly` from the repo root is byte-identical before and after — 2434 (project, file) pairs, empty diff. `vitest.config.mts` and all four root setup files are unchanged, so no file's project, environment or setup moved. #7291's `dist` project (`pnpm test:dist`: 1 file / 3 tests) and #7309's `isolate: false` invariant both still hold. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aCUUSwWefnbCJ4Xk1vqQW
…e configs (objectstack-ai#3240) (objectstack-ai#7523) * test(repo): delete the per-package vitest configs — one config, one verdict (objectstack-ai#3240) Direction A, ruled by the maintainer 2026-08-06 and reaffirmed by the delegated ruling of 2026-08-10: the root `vitest.config.mts` becomes the single entry, and a per-package run reaches it by path filter. What was there: 19 non-root vitest configs (the card's 17 under `packages/`, plus `apps/console` and `examples/schema-catalog`). Eleven of the seventeen were byte-identical standalone `defineConfig`s — `happy-dom` + `globals` + a one-line local setup and NO alias table, where the root config maps ~40 `@object-ui/*` specifiers at a sibling's `src/`. The other six re-exported or merged the root config, so they only ever restated it. What replaces them, per package: nothing. The root config already supplies every property they declared — `globals`, `happy-dom`, and jest-dom via `vitest.setup.dom-light.tsx` — plus the alias table they lacked. The one setup file that was not the shared one-liner, `plugin-map`'s, mocked `maplibre-gl`; `vitest.setup.base.ts` has mocked it globally all along, so that copy was a duplicate no canonical invocation ever loaded. Redefining the per-package run (the ruling's second clause): every `test` script is now `vitest run --root ../.. <pkgdir>/`, the shape PR objectstack-ai#3869 landed for `packages/runner`. `pnpm --filter <pkg> test` and `turbo run test` were REFUSED by the invocation guard before this; they now run, against the same config CI uses, over exactly that package's files. Closing route 4 first, which the ruling did not anticipate: Vitest's config fallback does not stop at `vitest.config.*`. With none present it takes the directory's `vite.config.*`, and every `packages/*` has one — carrying a vestigial `test` block (`passWithNoTests: true`, a partial alias table, a setup the root config never loads). Deleting the 14 vitest configs whose packages also have a vite config would have moved them onto that route, widening the hole objectstack-ai#5406 closed in the name of closing it. So each `packages/<pkg>/vite.config.ts` now calls the guard — gated on `process.env.VITEST`, which Vitest sets when it loads a config and `vite build` does not (measured both ways) — and the vestigial `test` blocks are deleted. turbo's `test` keeps `dependsOn: ["^build"]`, for a re-derived reason. The reason of record was resolution through `dist`, and that is now obsolete. But `^build` is the only edge putting a dependency's sources into a dependent's `test` cache key, and `helpers/vitest-config-program.ts` narrows its sweep by delegating to exactly that. Dropping it would replay stale greens; the note now says so. Evidence: `vitest list --filesOnly` from the repo root is byte-identical before and after — 2434 (project, file) pairs, empty diff. `vitest.config.mts` and all four root setup files are unchanged, so no file's project, environment or setup moved. objectstack-ai#7291's `dist` project (`pnpm test:dist`: 1 file / 3 tests) and objectstack-ai#7309's `isolate: false` invariant both still hold. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aCUUSwWefnbCJ4Xk1vqQW * chore(changeset): declare objectui#3240 as releasing nothing `check-changeset-presence` counts three files under a released package's `src/`: comments in `plugin-calendar`, `plugin-map` and `plugin-timeline` test files, each naming a config or setup file this change deletes. No runtime or type surface moves, so the empty frontmatter is the declared answer the gate asks for, not a workaround. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019aCUUSwWefnbCJ4Xk1vqQW --------- Co-authored-by: Claude <noreply@anthropic.com>
…stack-ai#8004) The repo-root `vitest.config.mts` had no runnable gate of its own (objectui#7328). A program did already contain it — `apps/console/tsconfig.node.json` has listed `../../vitest.config.mts` and `vitest.config.ts` since objectui#3476 — but the only invocation of that program was the console's own `type-check` script, reached through the task runner, whose `type-check` task waits on `^build`. So the cheapest compiler in the repo that reads the root Vitest config was reachable only behind a full workspace build, and no local gate union short of that could go red on it. PR objectstack-ai#7291 is the measured cost: a conditionally spread `dist` project whose literal `extends: true` widened to `boolean` degraded the whole `projects` array to `never[]`; `type-check:scripts`, `type-check:vitest-setup` and the vitest runs were all green, and CI answered with three errors, two of them reported at `../../vitest.config.mts`. Adding the file to an existing root program was measured and is not available: `tsconfig.scripts.json` includes only `scripts/**/*.ts` and `tsconfig.vitest-setup.json` only `./vitest.setup*.ts(x)`, neither glob admits `.mts`, and the setup program deliberately ships no `@types/node` while the root config imports `path` and `url`. A NEW root program was measured too: its resolved source set is the same nine files as `apps/console/tsconfig.node.json`'s, so it would only add a second option set over seven shared files — the "green in one project, red in the other" hazard `tsconfig.scripts.json`'s header documents. So the program keeps its single home and gains a second, cheap runner: `type-check:vitest-config` invokes it directly, in the cheap half of the `Type Check` job beside `pnpm type-check:scripts`. Nothing in its program imports an `@object-ui/*` package (the 40 `@object-ui/*` occurrences in `vite.config.ts` are alias-map strings), so it needs the install and nothing built: 2.0s on a worktree with no `dist/` anywhere. `scripts/__tests__/vitest-config-type-check.test.ts` pins the behaviour — that every root `vitest.config.*` is in the resolved program, that the merging consumer is too, that `allowJs` stays off so the root config's `@ts-expect-error` remains live, and that CI runs the script before the build. Claude-Session: https://claude.ai/code/session_01MM7kaS4dPpYHV5BsMyu4tQ Co-authored-by: Claude <noreply@anthropic.com>
…the carve-out it stopped covering `packages/types/tsconfig.test.json` closed with an invariant in the imperative: > Every test file in this package is compiled; keep it that way. It is false today, and it is false in the file that states it. ## ROTTED, not born false — the falsifier is one commit Orphans = files under `packages/types/src/__tests__/` matching neither `src/**/*.test.ts` nor `src/**/*.test.tsx`. Re-derived here per ref with `git ls-tree`, each zero carried by a lit control on the same instrument and the same corpus (the files that DO match): | ref | date | what it is | orphans | [LIT CTRL] in the program | |---|---|---|---|---| | `c35fed098` | 2026-08-07 | the sentence's write-time ref (PR #3574) | 0 | 28 | | `dd5b01b59` | 2026-09-02 | `DIST_PIN_GLOB` / the `dist` project lands (PR #7291) | 0 | 85 | | `8195905bf` | 2026-09-09 | the commit before the falsifier | 0 | 152 | | `1ccfc235e` | 2026-09-09 | the falsifier — PR #8646 adds the file | 1 | 153 | | `1cfdff814` | today | `origin/main` | 1 | 204 | The `include` line at the write-time ref is byte-for-byte the one in force today, so the sentence did not drift by its own config moving — the population moved under it. Independently of which commit wrote the sentence: tree-wide, zero `.dist.spec.tsx` files existed at `c35fed098` (lit control: 3716 tracked files), so the construction that falsifies it did not yet exist. TRUE when written, falsified on 2026-09-09. ⇒ kept and dated rather than overwritten (#9713). Overwriting it would erase that it was ever true. ## The exclusion is a construction, not a hole The `.dist.spec.tsx` suffix keeps the built-artifact pins out of this program deliberately: turbo's `type-check` waits on `^build` (the DEPENDENCIES' builds) and must never be handed a program that reads this package's own `dist` — #4801 removed a self-referencing `paths` entry for that reason. The pins are still RUN, by the opt-in `dist` vitest project (`DIST_PIN_GLOB`, #7183). A declared exclusion and a hole look identical in a directory listing, and the false sentence pointed at the wrong one, so the amended invariant now states the carve-out, its reason and its runner. No count is written into the prose (AGENTS.md #9): the comment points at `pnpm type-check:coverage`, which re-derives the claim and shares the same `*.test.ts(x)` definition. `vitest.config.mts` is cited by the `DIST_PIN_GLOB` symbol, never by line (AGENTS.md #11). ## Nothing a program reads changed — measured `tsc -p <cfg> --noEmit --listFiles` for all three of this package's `type-check` legs (`tsconfig.json`, `tsconfig.examples.json`, `tsconfig.test.json`) is byte-identical before and after; `diff` exits 0 on each. No `include`, no `exclude`, no compiler option, no test file moved. Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L
…the carve-out it stopped covering (objectstack-ai#9750) Fixes objectstack-ai#9737 Clause-②: no `packages/types/tsconfig.test.json` closed with an invariant in the imperative — *"Every test file in this package is compiled; keep it that way."* — which is false today, and false in the file that states it. This amends that one comment, and nothing else. ## The verdict was measured, not inherited — ROTTED, not born false Orphans = files under `packages/types/src/__tests__/` matching **neither** `src/**/*.test.ts` nor `src/**/*.test.tsx`. Re-derived per ref with `git ls-tree` in this branch's worktree, never from a working tree. Every zero carries a **lit control on the same instrument and the same corpus** — the files that DO match — so a zero is a reading, not a dead probe. | ref | date | what it is | orphans | **[LIT CTRL]** files in the program | |---|---|---|---|---| | `c35fed098` | 2026-08-07 | the sentence's write-time ref (PR objectstack-ai#3574) | **0** | 28 | | `dd5b01b59` | 2026-09-02 | `DIST_PIN_GLOB` / the `dist` project lands (PR objectstack-ai#7291) | **0** | 85 | | `8195905bf` | 2026-09-09 | the commit immediately before the falsifier | **0** | 152 | | `1ccfc235e` | 2026-09-09 | **the falsifier** — PR objectstack-ai#8646 adds the file | **1** | 153 | | `1cfdff814` | today | `origin/main` at branch point | **1** | 204 | The orphan is `packages/types/src/__tests__/zod-subpath-single-module-8598.dist.spec.tsx`. Two independent legs establish ROTTED rather than BORN FALSE: 1. The `include` line at the write-time ref is **byte-for-byte** the one in force today (`diff` of the two lines exits 0) ⇒ the sentence did not drift by its own config moving; the population moved under it. 2. Tree-wide at `c35fed098`, the count of `.dist.spec.tsx` files is **0** (lit control: 3716 tracked files at that ref) ⇒ the construction that falsifies the sentence **did not yet exist anywhere in the repo** when it was written. This leg holds whichever commit is taken to be the write-time ref, so the verdict does not rest on `git log -S` in a shallow checkout. `git log -S'Every test file in this package is compiled'` over that path returns `c35fed098` and nothing else in the fetched window. ⇒ TRUE when written, true for thirty-three days, falsified on 2026-09-09 by a single identified commit. So the sentence is **kept and dated**, not overwritten — overwriting it would erase that it was ever true (objectstack-ai#9713). ## What the repair says now The exclusion the sentence stopped covering is **a construction with a stated reason and a cited card**, not a hole — and a declared exclusion and a hole look identical in a directory listing. The amended invariant therefore states all three things a reader would otherwise have to re-derive: - **the carve-out** — the `.dist.spec.tsx` built-artifact pins are outside this program; - **its reason** — turbo's `type-check` waits on `^build` (the DEPENDENCIES' builds) and must never be handed a program that reads this package's own `dist`; objectstack-ai#4801 removed a self-referencing `paths` entry for exactly that reason; - **its runner** — the pins are still RUN, by the opt-in `dist` vitest project (`DIST_PIN_GLOB`, env-gated, reached through `pnpm test:dist`), built on purpose by objectstack-ai#7183. Two repo rules shaped the wording: - **AGENTS.md objectstack-ai#9** — no count is written into the prose. The comment points at `pnpm type-check:coverage` (`scripts/check-type-check-coverage.mjs`), which re-derives the claim and happens to share the same `*.test.ts(x)` definition, so the two agree by construction rather than by coincidence. - **AGENTS.md objectstack-ai#11** — `vitest.config.mts` is cited by the `DIST_PIN_GLOB` **symbol**, never by a cross-file line address. `pnpm check:new-line-citations` prints `0 new citation(s)` for this branch. ## ⛔ What did NOT change — measured, not asserted No `include`, no `exclude`, no compiler option, no test file moved. Proven at the level of program inputs rather than of the diff: `tsc -p CONFIG --noEmit --listFiles`, run for all three legs of this package's `type-check` script, **before and after** the edit: | program | exit | `--listFiles` diff, before vs after | |---|---|---| | `tsconfig.json` | 0 | `diff` exit **0** — byte-identical | | `tsconfig.examples.json` | 0 | `diff` exit **0** — byte-identical | | `tsconfig.test.json` | 0 | `diff` exit **0** — byte-identical | On that same `--listFiles` output for `tsconfig.test.json`: the orphan pin appears **0** times, and the lit control `src/__tests__/base-bind-declared.test.ts` appears **1** time — the carve-out read directly off the real program, not off the globs. ## Gates Exit codes captured to disk before any pipe. | gate | exit | verdict line | |---|---|---| | `pnpm --filter @object-ui/types type-check` (all three legs) | **0** | `tsc --noEmit && tsc -p tsconfig.examples.json && tsc -p tsconfig.test.json` | | `pnpm exec vitest run packages/types/` (repo root) | **0** | `Test Files 204 passed (204)` · `Tests 4771 passed (4771)` | | `pnpm type-check:coverage` | **0** | `test type-check coverage: 43/43 packages compile their tests, 0 declared debt` | | `node scripts/check-changeset-presence.mjs` | **0** | `No source or published contract of a released package changed in this range` | | `pnpm check:new-line-citations` | **0** | `0 new citation(s), enforcement report-only` | | `pnpm check:control-bytes` | **0** | `OK (scanned 7840 tracked text file(s))` | | `pnpm check:published-tsconfig-exclude` | **0** | | | `pnpm check:self-import` | **0** | | | `pnpm check:changeset-claims` | **0** | | | `pnpm check:pending-changeset-literals` | **0** | | | `pnpm check:comment-mask-corpus` | **0** | | | `pnpm census:tsconfig-test-parity` | **0** | | | `node scripts/check-governed-queue-guard.mjs --test` (both changed paths) | **0** | `NOT GOVERNED — 2 path(s) checked against 5 governed surface(s)`; **[LIT CTRL]** `AGENTS.md` ⇒ exit 3, `GOVERNED` | All figures above were taken at `837cea2f9`, this branch's final commit. **Repo-wide `pnpm lint` is CI's run; the local narrowing is declared and proven.** eslint's own flat config declares its universe as `**/*.{ts,tsx}` (plus `**/*.tsx`) and nothing else; run over the two changed paths with `--no-inline-config --format json` it reports **2** files, **0** errors, and for each one its own message *"File ignored because no matching configuration was supplied."* No `.ts`/`.tsx` file changed at all, and no tsconfig program input moved (table above), so no untouched file's verdict can move either. ## The changeset grade is MEASURED `packages/types`' `files[]` is `["dist", "README.md", "CHANGELOG.md", "LICENSE"]`, so anything reaching `dist` publishes. After `pnpm --filter @object-ui/types build`, scanning all **130** emitted `dist` files: | probe | hits | |---|---| | `DATED READING` (bytes this PR adds) | **0** | | `Every test file in this package is compiled` (bytes this PR keeps and quotes) | **0** | | `DIST_PIN_GLOB` (bytes this PR adds) | **0** | | **[LIT CTRL]** source-comment prose known to ship (`registry key`) | **5** — `field-types.d.ts`, `zod/node-derivation.d.ts`, … | | **[ABSENT CTRL]** a nonsense token | **0** | The lit control proves the instrument is connected on the same corpus, and the absent control proves it is not matching everything. ⇒ nothing published moved, and the changeset declares that with **empty frontmatter** — which is the claim, made explicitly rather than by analogy to a `base.ts` comment (whose prose *does* ship into `dist/base.d.ts`, and would have been graded `patch`). ## A count is invariant under quotation — probed separately, both reported The repair quotes the old sentence, so quoted position and assertion position were probed apart with a whitespace-tolerant whole-content scan (`git grep` is line-anchored and this is wrapped JSON-with-comments): | position | occurrences | |---|---| | total, any position | **1** (`packages/types/tsconfig.test.json`) | | quoted position (opens with a double quote) | **1** | | **assertion position** (total − quoted) | **0** | | **[LIT CTRL]** `DATED READING`, known present and unquoted | **1** | | **[ABSENT CTRL]** a nonsense token | **0** | The changeset body carries one further occurrence, also in quoted position. ⇒ no live, undated assertion of the sentence survives anywhere in the tree. ## Acceptance notes - **Measured in passing, and it dissolves rather than opens the second card.** The dispatch fenced out "every package with a `.dist.spec.tsx` pin and a `tsconfig.test.json` may carry the same sentence-vs-population question". Tree-wide there are exactly **2** `.dist.spec.tsx` files (lit control: 7925 tracked files), in `packages/types` and `packages/components`, and both packages do have a `tsconfig.test.json`. But the whole-content scan for the invariant sentence returns **1** hit, in `packages/types` only: `packages/components/tsconfig.test.json` states no such invariant. ⇒ there is no second site to repair. Noted, not filed; handed back to the dispatching seat. - The triage seat's optional escalation probe (has anyone already widened an `include` on the strength of this sentence ⇒ p1) reads **negative** in the fetched window: the only two commits touching `packages/types/tsconfig.test.json` are `c35fed098` and `4e96becf5`, and the latter moved `lib` only.⚠️ The checkout is shallow, so this is a NOT-FULLY-MEASURED negative rather than a proven absence. --- _Generated by [Claude Code](https://claude.ai/code/session_01UanLVj6xvbS6puBCewLr8L)_ Co-authored-by: Claude <noreply@anthropic.com>
Fixes #7183
Implements the PM ruling on this card (2026-09-02, option 1): a dedicated
distvitest project with its own turbo task that builds the package under test first.The gap
The root
vitest.config.mtsaliases every workspace package to itssrc. That is right for the ~2000 tests that want fast source feedback, and it makes "does the SHIPPED BUNDLE still do X" structurally unanswerable. Such a test could not be committed either: turbo'stesttask isdependsOn: ["^build"]— the DEPENDENCIES' builds, never the package's own — so adist-importing test landed in CI with nodistto import. That is NOT MEASURED rather than a red pin, and the usual repair (delete it, or let it skip whendistis missing) leaves a green suite that measures nothing. Two lanes hit this wall in one morning and each threw a correct measurement away.The five binding constraints, and where each is met
1. Only built-artifact pins; first resident re-derived from PR #7180; no source-resolved test moves in.
The project collects exactly one glob,
packages/*/src/**/*.dist.spec.tsx(spelled in the config, not here — a star-slash pair inside a block comment ends the comment, which this PR learned the hard way, see Corrections below). Its only resident ispackages/components/src/__tests__/page-header-action-ids.dist.spec.tsx: an id-authoredpage:headerresolves an action whose definition carries a script body, and the marker reaches neither the rendered DOM nor the authored node. Nothing was moved into the project; no existing test changed.2.
dependsOn: ["build"]for the package under test (self, not^build), and a loud precondition — not a skip — whendistis absent.turbo.jsongainstest:distwithdependsOn: ["build"]andcache: false. The precondition is an explicit assertion that reads the built entry from the package's ownpackage.jsonexports["."].importand names the absolute path when it is missing. It fails; it does not skip.3. The live control from PR #7180 is part of the delivery.
registers page:header from the BUILT bundleis a baretoBeTruthy()on purpose — a custom message would change the string the control is recorded by. See verdict (iii).4. Wired where the existing test job runs; no timeout raised, no heavy-test allowlist entry.
One step in the existing
testjob of.github/workflows/ci.yml,if: … && matrix.shard == 1.timeout-minutes: 20is untouched,heavyDomTestsis untouched, and the three existing projects (unit,dom,dom-heavy) are untouched.5. The step-2 tripwire. Not tripped, but it was close, and the near-miss is the design: see The opt-in below.
The opt-in — the half that keeps
pnpm testunchangedCI's
testjob runspnpm test(vitest run) with no build step anywhere in it. An unconditional fourth project is therefore collected by that run with nodiston disk, and its precondition would fail the whole suite on every PR — which would have forced a build into the path of all ~2000 tests, i.e. exactly the "change to how all tests build" constraint 5 says to stop at.So the project is declared only when
OBJECTUI_DIST_PINS=1. An env var rather than the--project distflag, because argv is meaningful only in the process that parsed the CLI while the env var is inherited by everything Vitest spawns.That opens exactly one false-green, and it is closed in the config rather than documented:
vitest run --project distwithout the env var would match no project, andpassWithNoTestsis true for a run that names no files — a green that measured nothing. Measured:The three verdicts
Each quotes the run's own output. Both mutating legs restore under a
trapwith absolute paths and prove the mutation landed on disk by marker count — never by an editor's exit code.(i)
distpresent, run the way CI runs it — GREEN.(ii)
distdeleted — a loud, named precondition FAILURE, not a skip and not MODULE_NOT_FOUND.Restore proven by state, not by an exit code:
sha256of the restoreddist/index.jsequals the recorded5365d829….(iii) the
distimport removed — the recorded control.expected undefined to be truthy— verbatim what PR #7180 recorded. The one case that still passes is the precondition, which is correct:distis on disk in this leg; only the import is gone. Restore proven by state: restored blob1f531adf…equals the HEAD blob, andgit diff HEADandgit status --shortare both empty.Cost — measured, because the ruling priced this at "one build in one job"
A bare
turbo run test:distdoes not cost one build. Turbo applies a task definition to every package in scope and resolvesdependsOn: ["build"]for each, so it schedules a build of the entire monorepo —siteandconsoleincluded:The root script therefore carries
--filter=@object-ui/components, and the 9 tasks are the package plus the dependency closure its.d.tsemit genuinely needs. Cold-cache wall time, which is what CI pays:~72 s added to shard 1 of a job whose ceiling is
timeout-minutes: 20, unchanged. (Shared-box seconds: four sibling agents build in this container, so this is an upper-ish bound, not an idle-box figure.)If a second package ever gains a pin without being added to the filter, the failure is the loud precondition naming its missing built entry — not a silent skip.
Collected by exactly one project
vitest list --filesOnlyis the instrument, and it has a positive control:The suffix does this by construction —
unitcollects*.test.ts,domcollects*.test.tsx,dom-heavyis an explicit file list — so none of the three needed a character changed.The same property keeps the file out of
packages/components/tsconfig.test.json, and that is deliberate rather than incidental: turbo'stype-checkwaits on^build, so a type program that read this package's owndistwould demand an artifacttype-checkis not allowed to wait for — the coupling #4801 removed. Measured with the package's own type program, with a control:Gates — union re-run at commit
7a6eef7b9vitest run scripts/Test Files 94 passed (94)/Tests 2645 passed (2645)pnpm --filter @object-ui/components run type-checkpnpm check:control-bytespnpm type-check:scriptspnpm check:doc-fencespnpm check:doc-typespnpm docs:check-linkscheck-changeset-presencecheck-changeset-overwrite/-no-major/-fixedeslinton the changed filesEvery exit code was captured before any pipe. The lint run is narrowed and the narrowing is measured: the population is the diff, the count comes from
--format json(3 files), andeslint.config.jscontains 0projectService/parserOptions/project:occurrences against a live control of 10ruleshits in the same file — not type-aware, so no untouched file's verdict can move under this diff.Changeset: an empty frontmatter, which the presence gate names as a pass rather than a workaround. The one file it flags is under
packages/components/src/but ships nowhere — the package publishesfiles: ["dist", …]and its buildtsconfig.jsonexcludessrc/__tests__outright.Corrections and deviations, stated rather than buried
The first run of all three verdicts was invalid and was thrown away. The pin file's docstring contained a glob pairing a star with a slash, which ends a block comment early; the file failed to parse, so verdict (i) was red and (ii)/(iii) reported
Tests no tests— a transform error, not an assertion.vitest list --filesOnlyhad passed because it never transforms. Fixed, and all three verdicts above are from the re-run. This repo already records the same trap intsconfig.scripts.json's header and incheck-changeset-presence.mjs.Three files beyond the dispatch's declared surface, each forced by a gate or by turbo's shape:
packages/components/package.json— one script. Turbo tasks are per-package, sodependsOn: ["build"]for the package under test cannot be expressed without a script in that package. It carries--root ../..because the invocation guard refuses any run whose Vitest root is not the repo root, and--config vitest.config.mtsbecause Vite resolvesconfigFilerelative toroot, not cwd (measured:../../vitest.config.mtsresolved to/home/vitest.config.mts).content/docs/guide/ci-cd-pipeline.md— one cell.scripts/__tests__/ci-cd-pipeline-doc.test.tsfails when the workflow runs a first-party command the job table does not name. It also fails if the cell names a command the job does not run, which is why the turbo invocation is described in prose there rather than as a code span.scripts/__tests__/turbo-task-guard-coverage.test.ts— one docstring line. That test enforces the partition "cacheable ⇒ has a derived inputs guard; otherwisecache: false", and its docstring enumerates the partition.test:distiscache: false— a lane whose subject is a build artifact turbo does not hash must never replay a verdict — so it belongs on the uncached side, and the enumeration now says so.⛔ No change to the root alias map. ⛔ No timeout raised. ⛔ No heavy-test allowlist entry. ⛔ No
skip-changesetlabel — in this repo that label is inert and the empty-frontmatter changeset is the declaration that counts.Not in this PR
Nothing migrates into the new lane. Its scarcity is the guard against it becoming a second default test surface, and the ruling asks for exactly one resident.
Fix round —
Type Checkwas red on the first pushWhat was red.
@object-ui/console#type-check, run 33588494358 / job 100117481182. Three errors, all one cause:Cause, one line. Inside the conditional spread that declares the
distproject, the literalextends: truewidens toboolean, whileTestProjectConfiguration.extendsisstring | true | undefined— so the element matched nodefineConfigoverload and the wholeprojectsarray degraded tonever[], which then took down the console entry on line 325 too.Fix.
extends: true as const, plus a comment recording why the annotation is load-bearing (it reads like removable noise). Nothing else changed; the three pre-existing projects never widened, because theirextends: truesits in the plain array rather than in a conditional one.Why CI saw it and this PR's own gates did not. The root
vitest.config.mtsis compiled by no type program of its own —apps/console/vitest.config.tsmerges it, so the console'stsc --noEmitis the program that reads it. That job was outside the gate set run before the first push. It is in the set now.Reproduced before fixing, not after. On an unbuilt worktree the real errors are unreachable behind 378
TS2882s, so the dependency closure was built through turbo first (turbo run type-check --filter=@object-ui/console), which is the path CI takes:error TSlinesRe-run at the fix commit
857c8afc5(exit codes captured by redirect-then-$?):pnpm --filter @object-ui/console run type-checkerror TSlines (was exit 1 / 3)pnpm --filter @object-ui/components run type-checkpnpm type-check:scriptspnpm type-check:vitest-setuppnpm type-check(turbo, every package)Tasks: 81 successful, 81 totalpnpm test:distTest Files 1 passed (1),Tasks: 9 successful, 9 totalvitest list --filesOnly --project distunit/dom/dom-heavystill 0 (files 810 / 1429 / 34)vitest run --project distwithout the env varNo rebase and no force-push: the fix is a commit on top of the branch.
🤖 Generated with Claude Code
https://claude.ai/code/session_01BGMDbrVa8JjZcCQ7DWYH1b