Typecheck scripts/** and test/isolation, fix the resulting errors - #438
Merged
TheGreatAxios merged 1 commit intoAug 29, 2026
Conversation
bun run typecheck only ran each workspace package's own typecheck script; the root tsconfig.json (scripts/**, eslint.config.ts) and test/isolation/tsconfig.json were never compiled. Compiling them surfaced 10 live errors, including a real bug: the browser walkthrough read seeded.workflows on the seeded-pending-agents branch of EnsureSeededResult, which has no workflows field, so it threw a TypeError instead of surfacing seeded.message. - typecheck now also runs tsc against tsconfig.json and test/isolation/tsconfig.json, after the per-package run, so CI's typecheck job is still the one that fails on either. - walkthrough.ts branches on seeded.kind and throws seeded.message for seeded-pending-agents instead of crashing. - browser-safe-subpaths.ts guards each regex capture group before use instead of asserting it's defined. - run-all.ts captures the CLI script-name argument in a separately declared const so its narrowed string type survives into the closures that use it. - harness.ts and hub.ts only include body in the fetch init when it's defined, per exactOptionalPropertyTypes. - smoke-library.test.ts and tool-registry-publish's putTarball copy bytes into a fresh Uint8Array so its buffer type matches BlobPart / BodyInit. Fixes CL-7121.
TheGreatAxios
force-pushed
the
cl-7121-root-tsconfig-scripts-is-never-typechecked-10-live-type
branch
from
August 29, 2026 04:46
44b9979 to
21c4a8a
Compare
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.
Fixes CL-7121 — https://linear.app/abklabs/issue/CL-7121
Problem
bun run typecheck(scripts/run-all.ts typecheck) only runs each workspace package's owntypecheckscript; the roottsconfig.json(scripts/**/*.ts,eslint.config.ts) andtest/isolation/tsconfig.jsonwere never compiled at all.bunx tsc -p tsconfig.json --noEmiton main reports 10 live errors, one a real runtime bug:scripts/e2e/browser/walkthrough.ts:602readsseeded.workflowsonEnsureSeededResult, but theseeded-pending-agentsbranch (packages/onboarding/src/complete-credential.ts:123) has noworkflowsfield — the walkthrough throws aTypeErrorinstead of surfacingseeded.message.Change
package.json:typechecknow chainsbunx tsc -p tsconfig.json --noEmitandbunx tsc -p test/isolation/tsconfig.json --noEmitafter the per-package run, sobun run typecheckcovers everything and CI's dedicatedtypecheckjob (.github/workflows/ci.yml) stays the one that fails — notcheck:structural, which is a separate job for unrelated heuristics.scripts/e2e/browser/walkthrough.ts: branches onseeded.kind, throwingseeded.messageforseeded-pending-agentsinstead of reading a field that doesn't exist there (this feeds the existing retry loop, same as any other transient failure). Also narrows thepageerrorhandler'serrorfromunknown.scripts/checks/browser-safe-subpaths.ts: guards each regex capture group (match[n]) before use instead of asserting it's astring, matchingnoUncheckedIndexedAccess.scripts/run-all.ts: captures the CLI script-name argument in a separately declaredconst script: string, since the!scriptearly-exit's narrowing doesn't survive into the later closures that read it.scripts/e2e/harness.ts/packages/hub-client/src/hub.ts: only spreadbodyinto the fetch init when it's defined, perexactOptionalPropertyTypes(the documented spread-literal exception).scripts/e2e/smoke-library.test.ts/packages/tool-registry-publish/src/publish.ts: copy bytes into a freshUint8Array(Uint8Array.from(...)) before handing them toFile/fetch, since theirArrayBufferLikebuffer type doesn't structurally matchBlobPart/BodyInit'sArrayBufferunder this tsconfig.Out of scope:
apps/web'stsc -b(CL-4613).Tests
bunx tsc -p tsconfig.json --noEmit— clean (was 7 errors across 5 scripts files)bunx tsc -p test/isolation/tsconfig.json --noEmit— cleanbunx tsc --noEmit -p packages/hub-clientand-p packages/tool-registry-publish— cleanbun test scripts/run-all.test.ts— 13 pass (orchestration logic itself is unchanged, only thetypecheckscript string gained two more chained commands, so no new test was needed — this is the stated red/green proof for that piece)bun test scripts/checks/test— 131 pass, includingbrowser-safe-subpaths.test.tsprettier --check/eslinton every changed file — cleanThe machine this ran on was saturated with several other concurrent build lanes, so a full local
bun run checkacross all 83 packages repeatedly got OOM-killed partway through; every package this PR actually touches (hub-client,tool-registry-publish) typechecks clean in isolation, and the orchestration script (run-all.ts) itself is untouched in behavior. CI'stypecheckjob is the real gate here.