chore(ci): recursive typecheck across workspace packages#280
Merged
Conversation
Root `pnpm typecheck` was `tsc --noEmit` against the root tsconfig, which includes only `src/**/*.ts`. Packages and the app were silently skipped: - packages/agent — 1602 tests, complex SSE + signing surface; not typechecked in CI - packages/sdk — typechecked only via its own `typecheck` script, never invoked - app — Vite-built React UI; not typechecked in CI CI is the deploy.yml workflow at `.github/workflows/deploy.yml:36` which runs `pnpm typecheck` on every PR + push to main. The blind spot was real. Discovered during Spec 1 (PR #277) implementation when removing a switch case from agent-core silently passed root `pnpm typecheck` but failed `cd packages/agent && pnpm exec tsc --noEmit`. Fix: - Add `typecheck` script to packages/agent and app (sdk already had one) - Split root `typecheck` into: typecheck:root — original `tsc --noEmit` against root src typecheck — composite: typecheck:root + `pnpm -r --filter='!sipher' run typecheck` `--filter='!sipher'` excludes the root from the recursion (root is named `sipher` in pnpm-workspace.yaml entry `.`) so we don't infinite-loop into the new script's own definition. Verified: `Scope: 3 of 4 workspace projects` covers app + packages/sdk + packages/agent. Injected `const x: number = 'not a number'` into packages/agent/src/_temp_inject_typecheck_test.ts and confirmed root `pnpm typecheck` reports: packages/agent typecheck: src/_temp_inject_typecheck_test.ts(2,7): error TS2322: Type 'string' is not assignable to type 'number'. Then removed the injection and re-ran — clean. Out of scope: turbo.json migration (sipher uses pnpm workspaces without turborepo today; introducing turbo would be a larger architectural shift).
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
rz1989s
added a commit
that referenced
this pull request
May 17, 2026
PR #280's recursive typecheck (`pnpm -r --filter='!sipher' run typecheck`) exposed a build-order issue that the previous root-only typecheck masked. The agent package imports from @sipher/sdk (workspace dep) whose types live in `dist/index.d.ts` — without building the SDK first, tsc fails with 'Cannot find module @sipher/sdk' for every consumer. Local typecheck passes because dist/ exists from prior builds; CI does fresh install without building. This has been failing on main since PR #280 merged 2 days ago (last green: 7389a3e on PR #279 merge). Add a Build SDK step between Install and Typecheck. Fixes both the Typecheck and Test steps in one shot (tests also import the runtime @sipher/sdk via dist/index.js).
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.
Summary
Root
pnpm typecheckwastsc --noEmitagainst the root tsconfig (includes onlysrc/**/*.ts), silently skipping every workspace package:packages/agent— 1602 tests, complex SSE + signing surface; not typechecked in CIpackages/sdk— had its owntypecheckscript, never invoked by CIapp— Vite-built React UI; not typechecked in CICI is
.github/workflows/deploy.yml:36which runspnpm typecheckon every PR + push to main. The blind spot was real and silent.Discovered during PR #277 (Spec 1 assertNever). Removing a switch case from
agent-core.tssilently passed rootpnpm typecheckbut failedcd packages/agent && pnpm exec tsc --noEmit. The whole point of assertNever's compile-time guarantee was at risk of being defeated by a CI that wasn't actually running the check.Changes
"typecheck": "tsc --noEmit"topackages/agent/package.json"typecheck": "tsc --noEmit"toapp/package.jsontypecheck:root— originaltsc --noEmitagainst rootsrc/typecheck— composite:pnpm typecheck:root && pnpm -r --filter='!sipher' run typecheck--filter='!sipher'excludes the workspace root (sipheris the package name of the root entry.inpnpm-workspace.yaml) so the recursion doesn't infinite-loop into its own definition.Verification
Manual fault-injection test:
Output:
Removed the injection → clean run, all three packages report
Done.Out of scope
Test plan
pnpm typecheckruns against root + 3 packages, all cleanpackages/agentsurfaces via root commandRelated
This closes the followup tracked in the PR #277 / #278 / #279 chain —
Root pnpm typecheck misleadingly skips packages. With this PR merged, the assertNever guard pattern from Spec 1 is reliably enforced in CI.