From 26941e9760e90ecaef94ca3266b5e610fce37cf0 Mon Sep 17 00:00:00 2001 From: Alain Schlesser Date: Tue, 17 Nov 2026 14:21:25 +0000 Subject: [PATCH] test(ui-server): emit the declaration graph without the body check (#4142) The optional-backend declaration guard builds one TypeScript program of 1,570 files from the build tsconfig and emits all 414 declarations. With the full semantic check that emit took 9.5 s unloaded, and 45.2 s on one contended CPU, past the unchanged 30 s deadline. It failed main run 44096292239 at 30.6 s (#4186). `noCheck` keeps the real declaration emit and skips only the body check that `bun run typecheck` owns: 2.0 s unloaded, 13.6 s under the same load, with the same files and the same import specifiers in each. Refs #4186 Co-Authored-By: Claude Opus 5.5 --- packages/ui-server/tests/declaration-surface.test.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/ui-server/tests/declaration-surface.test.ts b/packages/ui-server/tests/declaration-surface.test.ts index de61c49f0f..aa583923cd 100644 --- a/packages/ui-server/tests/declaration-surface.test.ts +++ b/packages/ui-server/tests/declaration-surface.test.ts @@ -32,9 +32,14 @@ const BACKEND_SPECIFIER = /@schlessera\/brain-backend-(claude|pi)/; function emitDeclarations(): Map { const configPath = join(PKG, "tsconfig.build.json"); + // `noCheck` keeps the real declaration emit and skips only the full + // semantic check of every function body, which `bun run typecheck` owns. + // Measured on 1,570 program files: emit 9.5 s with the check, 2.0 s without, + // with the same 414 files and the same import specifiers in each (#4142); + // with the check, a contended CI worker passed the 30 s deadline. const parsed = ts.getParsedCommandLineOfConfigFile( configPath, - { noEmit: false, declaration: true, emitDeclarationOnly: true }, + { noEmit: false, declaration: true, emitDeclarationOnly: true, noCheck: true }, { ...ts.sys, onUnRecoverableConfigFileDiagnostic: (diagnostic) => {