…t module scope (objectstack#25763)
In the merged tree (objectui under objectstack `ui/`) every `@objectstack/*`
import in a ui test resolves to a workspace package's `dist`, and a first load
paid inside a test body, a hook, a `vi.mock` factory or after
`vi.resetModules()` bills a cold transform of that graph to a clocked window.
objectstack's `check:test-source-alias` names these sites; each touched file
now also loads the same specifier with a module-scope side-effect import, so
the transform is paid during collection, which no test or hook timeout clocks.
The dynamic imports stay where they are.
Seven findings the gate also prints are left untouched: they are type-level
`import('x').T` (four spec-symbol tripwires, a type alias, an annotation) or
text inside a template-literal fixture, which never load at run time. The gate
side is objectstack#25766.
Part of objectstack#25763, part of objectstack#25677.
Co-Authored-By: Claude <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01N1dH2ywuFXe38A89awucwV
Requested by Tesla · project thread
Part of objectstack#25763 (cutover prep F of the objectui → objectstack
ui/merge). Part of objectstack#25677.Clause-②: no
Metadata-protocol: none
What changes
In the merged tree every
@objectstack/*import in a ui test resolves to a workspace package'sdist, so a first load paid inside a test body, avi.mockfactory or aftervi.resetModules()bills a cold transform to a clocked window (verify runs 8 and 11 reddened Test UI 3/16 on exactly this shape). objectstack'scheck:test-source-aliasnames these sites.Each of the 26 files below now also loads the same specifier with a module-scope side-effect import, so the transform is paid during collection, which vitest clocks against nothing. Every dynamic import stays where it was: this only decides where the first load is paid. No timeout is widened, nothing is skipped, and no production code changes. The changeset is empty-frontmatter (test-only, releases nothing).
The 30 findings fall in three shapes, each with its own one-line comment in the file:
@objectstack/spec,spec/ui,spec/data,spec/api,spec/kernel,spec/system,spec/security,spec/integration,@objectstack/formula,@object-ui/components;vi.mockfactory (10 files):@object-ui/i18n/locales,@object-ui/react,@object-ui/components;vi.resetModules()(3 files,@object-ui/core): the reset re-evaluates, but the transform is cached, so warming it once moves the compile out of every clocked re-import.DraftChangesPanel.securityProblems.test.tsxis 2c round 2 (a)'s (objectstack#25727) and is not touched; the gate does not list it on this tree either.Gate reading on the merged layout
Verify branch
claude/project-thread-dwhq6r-25697-verifyhead9e37acd126, this diff applied withgit apply --directory=ui(applies clean: all 33 named files are byte-identical between that tree'sui/and objectuimain0063f22ce).node scripts/check-test-source-alias.mjs:ui/Gate false positives, left untouched (see objectstack#25766)
These 7 never load anything at run time, so there is no cost to warm; adding a side-effect import would add a load these files do not pay today. The gate reads them because its type-query check knows only
typeof, and its import pattern runs over a projection that still holds string content.packages/plugin-calendar/src/__tests__/spec-symbol-4650.test.ts, type alias under a@ts-expect-errortripwirepackages/plugin-form/src/__tests__/spec-symbol-4650.test.ts, samepackages/plugin-grid/src/__tests__/spec-symbol-4650.test.ts, samepackages/plugin-kanban/src/__tests__/spec-symbol-4650.test.ts, same (the four headers explain why the inline type-level form is deliberate)packages/types/src/__tests__/dashboard-global-filters-spec-binding.test.ts, type aliaspackages/components/src/renderers/complex/__tests__/data-table.test.ts, type annotationscripts/__tests__/check-spec-range-floors.test.ts, text inside a template-literal fixtureTiming, before and after
The 26 touched files, run as one set (
vitest runon those paths, json reporter), once per cell on a 4-vCPU box under the shared verify lock. Merged layout = the tree above after the CI build of the seven@objectstackpackages, run fromui/with--root .; standalone = this branch afterpnpm run setup. Both before and after: 26 files, 342 tests, all passed.The cost moved from the clocked "tests" phase into the unclocked import phase, which is the point. Single runs on a shared box, so differences of a few hundred ms on one file are noise. The clear per-file moves are in the slowest-test column:
apps/console/src/__tests__/masterDetailFormTypeManifest.test.tspackages/app-shell/src/__tests__/spec-symbol-parity.test.tspackages/app-shell/src/console/__tests__/AppContent.deniedVsUnpublished.test.tsxpackages/app-shell/src/hooks/__tests__/useConsoleActionRuntime.flowRowGuard-13397.test.tsxpackages/app-shell/src/views/ObjectView.listLinksPlural-11733.test.tsxpackages/app-shell/src/views/RecordDetailView.paramRuntimeParity-6431.test.tsxpackages/app-shell/src/views/metadata-admin/MetadataTypeActions.paramDialogClose-6473.test.tsxpackages/app-shell/src/views/metadata-admin/ResourceEditPage.requiredInGatedSection-6900.test.tsxpackages/app-shell/src/views/metadata-admin/clientValidation.optOuts.test.tspackages/app-shell/src/views/metadata-admin/clientValidation.retiredFormulaKey.test.tspackages/app-shell/src/views/metadata-admin/inspectors/ViewVariantInspector.requiredInGatedSection-6900.test.tsxpackages/app-shell/src/views/studio-design/DataPillar.addFieldPopover-12516.test.tsxpackages/app-shell/src/views/studio-design/DataPillar.formToolbar-12451.test.tsxpackages/app-shell/src/views/studio-design/DataPillar.gridProjection.test.tsxpackages/app-shell/src/views/studio-design/DataPillar.picklistServedOptions-10202.test.tsxpackages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveInFlight-11204.test.tsxpackages/app-shell/src/views/studio-design/StudioDesignSurface.autosaveSwitch-11232.test.tsxpackages/app-shell/src/views/studio-design/StudioDesignSurface.draftVersionConflict-11773.test.tsxpackages/auth/src/__tests__/auth-spec-parity.test.tspackages/plugin-calendar/src/__tests__/ObjectCalendar.dataObjectArmRefused-8348.test.tsxpackages/plugin-dashboard/src/__tests__/ObjectMetricWidget.i18nLabel.test.tsxpackages/plugin-grid/src/__tests__/gridBareArrayDataRefused-8348.test.tsxpackages/react/src/__tests__/SchemaRenderer.concealmentGateFaultDiagnostic.test.tsxpackages/react/src/__tests__/SchemaRenderer.disabledGateFaultDiagnostic.test.tsxpackages/react/src/__tests__/SchemaRenderer.productionPredicateFaultWarning.test.tsxpackages/types/src/__tests__/registry-meta-carry-9102.test.tsclientValidation.retiredFormulaKeyon the merged layout shows the bill-24 shape at small scale. Its first test went from 903 to 41 ms, and itsexpression-draft test from 7161 to 1948 ms. The remaining 1.9 s is not a load the gate attributes to this file, so this card leaves it alone (not investigated further).Verification record (exit codes)
objectui standalone, this branch after
pnpm run setup:pnpm exec vitest runon the 26 touched files (342 tests)pnpm exec turbo run type-checkfor the 8 touched packages (app-shell, auth, console, plugin-calendar, plugin-dashboard, plugin-grid, react, types; 43 tasks incl. each package'stsconfig.test.jsonandtype-check:e2e)pnpm exec eslinton the changed filesnode scripts/check-changeset-presence.mjsnode scripts/check-changeset-overwrite.mjsnode scripts/check-changeset-no-major.mjspnpm check:changeset-claimspnpm check:new-line-citationspnpm check:control-bytespnpm check:test-path-rootsMerged layout (verify head
9e37acd126plus this diff):git apply --check --directory=uipnpm install --frozen-lockfile@objectstackpackages (36 tasks)vitest run --root .fromui/on the 26 touched files (342 tests)node scripts/check-test-source-alias.mjs🤖 Generated with Claude Code
Session:
https://claude.ai/code/session_01N1dH2ywuFXe38A89awucwV