← Documentation home

Canonical Markdown source · Oct 20, 2018

TypeScript Command Contract

development/typescript-command-contract.md · 65 lines · SHA-256 e2c0fe337ff6

Meta Museum's release TypeScript signal is the production Next.js build:


pnpm typecheck

`pnpm typecheck` intentionally delegates to `pnpm build`, the same command used

by CI. Treat a passing `pnpm typecheck`, `pnpm build`, and CI run as the

release decision for app TypeScript correctness.

Do not use a bare `tsc --noEmit` result as the release signal. The release

signal stays `pnpm typecheck`/`pnpm build` because that is the CI-aligned

production Next.js path. Direct `tsc --noEmit` is now expected to converge too,

but it remains a diagnostic parity check rather than the release decision.

The explicit diagnostic command is:


pnpm typecheck:diagnostic

The diagnostic parity report is:


pnpm typecheck:diagnostic:report

It writes:

  • `artifacts/typescript-diagnostic/typescript-diagnostic-debt-latest.json`
  • `artifacts/typescript-diagnostic/typescript-diagnostic-debt-latest.md`

On July 2, 2026, the report originally reproduced the suspected drift while

`pnpm typecheck` passed: 93 test/script TypeScript errors across 8 classified

buckets and 0 unclassified errors. Those buckets were retired in the same

command-contract cleanup. The current expected state is:

0 buckets, and 0 unclassified diagnostics.

  • `pnpm typecheck` passes as the release signal.
  • `pnpm typecheck:diagnostic` passes as direct TypeScript parity.
  • `pnpm typecheck:diagnostic:report` reports `status: converged`, 0 errors,

This means the original drift was a real test-type debt issue in the diagnostic

path, not evidence that production app typechecking was bypassed.

When changing production app code, run the focused tests for the touched area

and at least one of:


pnpm typecheck
pnpm build

When future direct-`tsc` drift appears, use the report first, classify any new

bucket, retire one bucket at a time, then run `pnpm typecheck:diagnostic`.

Record that work separately from production readiness or launch evidence. The

diagnostic path is healthy only when both commands pass:


pnpm typecheck
pnpm typecheck:diagnostic