Repository navigation
test(ui-server): emit the declaration graph without the body check (#4142) - #4187
Merged
Merged
Conversation
…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 <noreply@anthropic.com>
Owner
Author
Independent reviewReviewed head 26941e9 against base 146dfb4. Reviewer: agent. No findings. {
"version": 1,
"kind": "brain-review-receipt",
"pr": 4187,
"head": "26941e9760e90ecaef94ca3266b5e610fce37cf0",
"base": "146dfb4b398c5c8d313a48dbd9e745327ba5c51f",
"reviewer": "agent",
"outcome": "no-findings",
"findings": []
} |
schlessera
marked this pull request as ready for review
November 17, 2026 14:25
schlessera
marked this pull request as draft
November 17, 2026 14:31
schlessera
marked this pull request as ready for review
November 17, 2026 14:31
3 of 5 tasks
This was referenced Nov 17, 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 free
to 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 #4142. Refs #4186 (red-main incident; this is its declared fix).
What this does
packages/ui-server/tests/declaration-surface.test.tsproves that no emitted public.d.tsnames an optional backend package. It builds one TypeScript program frompackages/ui-server/tsconfig.build.json(1,570 source files: ui-server, plus ui-sdk and core source through thebuncondition) and emits all 414 declarations. With the full semantic check, that emit is the whole cost of the case. On a contended CI worker the case passed its 30 s deadline, most recently in main run 44096292239 at 30.6 s (#4186), and before that on #4102's candidate.The emit now passes
noCheck: true. That is still TypeScript's real declaration emit from the package's build config. It skips only the full semantic check of function bodies, whichbun run typecheckowns. The deadline, the scan of every emitted.d.ts, the non-empty-emit assertion, the separate source-AST case and the type-level descriptor assertions are unchanged.Measured boundary
Current main (146dfb4), Bun 1.4.4, TypeScript 6.0.3, this host (16 CPUs):
noCheck(after)declarationMap/sourceMapoff, full checkSame proof:
noCheck, the same 414 files are emitted, and every file's set offrom/import()specifiers (what this guard scans) is identical;Acceptance criteria
.d.tsscanned for both specifiers; the source-AST assertion keptnoCheckis the only option addedbun run testwrapper andscripts/host-admission.mjs. The weight inscripts/test-shard-costs.jsonis left for CI's measured refreshProof
node scripts/host-admission.mjs run -- taskset -c 0 bun scripts/test-determinism.ts packages/ui-server/tests/declaration-surface.test.ts --repetitions 2 --burners 1, one allowed CPU, one owned burner):no public .d.ts references an optional backend packageat 45,204 ms, "this test timed out after 30000ms". Exit 1.export type BackendLeak = typeof import("@schlessera/brain-backend-claude")appended tosrc/index.ts): the emit case fails with offenders["dist/index.d.ts"], and the source case independently withsrc/index.ts: @schlessera/brain-backend-claude..d.ts): fails onExpected: > 0, Received: 0.check:prpasses. No shipped package file changes, so no changeset.Collisions
bun scripts/collisions.ts --json --pr 4187at head 26941e9: closure reports only (shared test categories and workspaces) with #3059, #3069, #3581, #3622, #4002, #4151, #4168, #4173, #4175, #4177, #4179, #4181. No PR editsdeclaration-surface.test.ts.{"version":1,"kind":"brain-check-pr-receipt","head":"26941e9760e90ecaef94ca3266b5e610fce37cf0","base":"origin/main","mode":"focused","startedAt":"2026-11-17T14:21:41.882Z","finishedAt":"2026-11-17T14:22:12.941Z","checks":[{"name":"all lint and leakage gates","categories":["changeset"],"outcome":"passed","elapsedMs":16597.33756},{"name":"environment documentation","categories":["changeset"],"outcome":"passed","elapsedMs":171.5420479999957},{"name":"pending changeset package names","categories":["changeset"],"outcome":"passed","elapsedMs":127.23467600000004},{"name":"contribution changeset","categories":["changeset"],"outcome":"passed","elapsedMs":24.246853999997256},{"name":"affected fast invariants","categories":["verify","unit"],"outcome":"passed","elapsedMs":14119.675621000002}]}🤖 Generated with Claude Code