You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Land phase 0 of ADR-0002 (docs/ADR-0002-static-typing.md — incremental strict TypeScript, dev-time only): the compiler gate and the first typed contracts (the injected seam interfaces), without converting any existing module and without changing the build or the artifact.
Everything after phase 0 is monotonic per-file conversion (seams → state.js → core/ → net/ → editor/ → ui/), piggybacked on normal feature work — no separate issue needed until a slice proves non-mechanical.
Scope
tsconfig.json at the repo root: strict: true, allowJs: true, checkJs: false, noEmit: true, erasableSyntaxOnly: true, moduleResolution: "bundler". Unconverted .js stays unchecked; every .ts file is strict from day one.
typescript devDependency (deliberate lockfile change; runtime deps stay four — hard rule 4 untouched, esbuild strips TS natively).
tsc --noEmit joins the gate: wired into npm test exactly like check:schemas (a pretest/check:types script), and into CI.
Seam interface files (type-only .ts, no runtime code): EditorPort, the env.SpecEditor/env.CodeViewer factory shapes, the createApp(env) environment, and the app controller surface as consumed by render modules. These are declarations of what already exists — no behavior change.
Coverage config: widen vitest coverage include to src/**/*.{js,ts}; exclude the type-only interface files (they have no executable statements) alongside src/generated/.
Docs: CLAUDE.md rule 1 gains "and tsc --noEmit must pass"; ADR-0002 status updated on landing.
Acceptance
npm test fails on a deliberate type error in a .ts file and passes clean without it.
npm run build output is unchanged in kind: four bundled runtime deps, zero third-party requests; the type-only seam files contribute no bytes to dist/sql.html.
Full coverage gate still green (per-file thresholds unchanged).
Seam interfaces compile against real usage: at least one existing call site per interface is spot-checked via a scratch .ts import during review (the interfaces must describe reality, not aspiration).
CLAUDE.md rule 1 + ADR-0002 status updated in the same PR.
Non-goals (later phases / follow-ups)
Converting any existing .js module (phase 1+, leaf-up per ADR-0002 §4).
Schema-generated .d.ts for Library/saved-query/Spec shapes via compile-json-schemas.mjs (ADR-0002 §3 — its own follow-up once the gate exists).
A JSDoc sweep of unconverted files.
References
ADR-0002 (docs/ADR-0002-static-typing.md) — the decision this implements.
ADR-0001 — the slice-by-slice migration playbook this reuses; its 2026-07 addendum re-affirms no-framework and notes TS reduces the framework pull.
Goal
Land phase 0 of ADR-0002 (
docs/ADR-0002-static-typing.md— incremental strict TypeScript, dev-time only): the compiler gate and the first typed contracts (the injected seam interfaces), without converting any existing module and without changing the build or the artifact.Everything after phase 0 is monotonic per-file conversion (seams →
state.js→core/→net/→editor/→ui/), piggybacked on normal feature work — no separate issue needed until a slice proves non-mechanical.Scope
tsconfig.jsonat the repo root:strict: true,allowJs: true,checkJs: false,noEmit: true,erasableSyntaxOnly: true,moduleResolution: "bundler". Unconverted.jsstays unchecked; every.tsfile is strict from day one.typescriptdevDependency (deliberate lockfile change; runtime deps stay four — hard rule 4 untouched, esbuild strips TS natively).tsc --noEmitjoins the gate: wired intonpm testexactly likecheck:schemas(apretest/check:typesscript), and into CI..ts, no runtime code):EditorPort, theenv.SpecEditor/env.CodeViewerfactory shapes, thecreateApp(env)environment, and theappcontroller surface as consumed by render modules. These are declarations of what already exists — no behavior change.includetosrc/**/*.{js,ts}; exclude the type-only interface files (they have no executable statements) alongsidesrc/generated/.tsc --noEmitmust pass"; ADR-0002 status updated on landing.Acceptance
npm testfails on a deliberate type error in a.tsfile and passes clean without it.npm run buildoutput is unchanged in kind: four bundled runtime deps, zero third-party requests; the type-only seam files contribute no bytes todist/sql.html..tsimport during review (the interfaces must describe reality, not aspiration).Non-goals (later phases / follow-ups)
.jsmodule (phase 1+, leaf-up per ADR-0002 §4)..d.tsfor Library/saved-query/Spec shapes viacompile-json-schemas.mjs(ADR-0002 §3 — its own follow-up once the gate exists).References
docs/ADR-0002-static-typing.md) — the decision this implements.