Skip to content

Close quality-gate coverage gaps: typecheck cli/tui, format+lint core/, coverage core/json+core/client #1689

Description

@cliffhall

Summary

Audit of the repo's quality gates (surfaced while reviewing the SDK v2 migration, #1688) shows the gates are not fully active for all code. Three pre-existing gaps: cli/tui src is never typechecked, core/ has no format or lint gate, and core/json/core/client aren't in the coverage include.

What's gated today, by surface

surface typecheck format:check eslint unit integration/e2e coverage ≥90
web src
launcher src ✅ (tsc build)
cli src
tui src (smoke) ✅ (non-React only, #1501)
core/ (mcp, react, auth, storage, logging, node) ✅ (via web tsc -b)
core/json, core/client partial ❌ (not in coverage include)

The three gaps

1. cli & tui src is never typechecked

Their build is tsup (esbuild — strips types, no check) and test is vitest (esbuild too); neither has a tsc --noEmit, and there is no typecheck script. Confirmed empirically: an injected const x: number = "str" in clients/cli/src passes npm run validate (eslint is not type-aware — no projectService/project). The standalone clients/cli/tsconfig.json / clients/tui/tsconfig.json are stale/unused — running them today throws 6 (cli) / 126 (tui) errors, mostly TS6059 rootDir noise from mis-including core/, but some real (e.g. clients/cli/src/cli.ts Property 'destroy' does not exist on type 'never'). Enabling a typecheck gate requires fixing those tsconfigs + the real errors first.

(core/ itself typechecks cleanly through web's tsc -bclients/web/tsconfig.app.json includes ../../core/**/*.ts.)

2. core/ has no format or lint gate

Every client's prettier --check and eslint . is scoped to its own dir, so nothing reaches core/ (this is why unformatted core files slipped past CI on #1688). Closing it means prettier --write core/ (surfaces ~50 pre-existing unformatted files) + an eslint pass over core/ (may surface latent lint issues) + wiring both into a gate (e.g. a root format:check/lint script or folding core/ into a client's scope).

3. core/json and core/client aren't in web's coverage include

clients/web/vite.config.ts coverage include lists core/mcp|react|auth|storage|logging|node only. core/json and core/client are typechecked but not ≥90-gated. Extend the include and add tests for any newly-surfaced uncovered lines.

Proposed scope

  • Add cli/tui typecheck scripts (tsc --noEmit), fix their tsconfigs + latent type errors, and fold into validate.
  • Add a core/ format + lint gate (root-level format:check/lint, or extend a client's scope) and reformat/clean core/.
  • Extend web coverage include to core/json + core/client; add tests for uncovered lines.

Note: none of this belonged in the behavior-neutral migration (#1688) — it would reformat untouched files and pull in the tui typecheck-fix project. Tracking here as the dedicated follow-up.

Metadata

Metadata

Assignees

Labels

v2Issues and PRs for v2

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions