{"id":"development/typescript-command-contract","relativePath":"development/typescript-command-contract.md","title":"TypeScript Command Contract","markdown":"# TypeScript Command Contract\n\nMeta Museum's release TypeScript signal is the production Next.js build:\n\n```powershell\npnpm typecheck\n```\n\n`pnpm typecheck` intentionally delegates to `pnpm build`, the same command used\nby CI. Treat a passing `pnpm typecheck`, `pnpm build`, and CI run as the\nrelease decision for app TypeScript correctness.\n\nDo not use a bare `tsc --noEmit` result as the release signal. The release\nsignal stays `pnpm typecheck`/`pnpm build` because that is the CI-aligned\nproduction Next.js path. Direct `tsc --noEmit` is now expected to converge too,\nbut it remains a diagnostic parity check rather than the release decision.\n\nThe explicit diagnostic command is:\n\n```powershell\npnpm typecheck:diagnostic\n```\n\nThe diagnostic parity report is:\n\n```powershell\npnpm typecheck:diagnostic:report\n```\n\nIt writes:\n\n- `artifacts/typescript-diagnostic/typescript-diagnostic-debt-latest.json`\n- `artifacts/typescript-diagnostic/typescript-diagnostic-debt-latest.md`\n\nOn July 2, 2026, the report originally reproduced the suspected drift while\n`pnpm typecheck` passed: 93 test/script TypeScript errors across 8 classified\nbuckets and 0 unclassified errors. Those buckets were retired in the same\ncommand-contract cleanup. The current expected state is:\n\n- `pnpm typecheck` passes as the release signal.\n- `pnpm typecheck:diagnostic` passes as direct TypeScript parity.\n- `pnpm typecheck:diagnostic:report` reports `status: converged`, 0 errors,\n  0 buckets, and 0 unclassified diagnostics.\n\nThis means the original drift was a real test-type debt issue in the diagnostic\npath, not evidence that production app typechecking was bypassed.\n\nWhen changing production app code, run the focused tests for the touched area\nand at least one of:\n\n```powershell\npnpm typecheck\npnpm build\n```\n\nWhen future direct-`tsc` drift appears, use the report first, classify any new\nbucket, retire one bucket at a time, then run `pnpm typecheck:diagnostic`.\nRecord that work separately from production readiness or launch evidence. The\ndiagnostic path is healthy only when both commands pass:\n\n```powershell\npnpm typecheck\npnpm typecheck:diagnostic\n```\n","sections":[],"html":"<h1 id=\"typescript-command-contract\">TypeScript Command Contract</h1>\n<p>Meta Museum&#39;s release TypeScript signal is the production Next.js build:</p>\n<pre><code>\npnpm typecheck\n</code></pre>\n<p>`pnpm typecheck` intentionally delegates to `pnpm build`, the same command used</p>\n<p>by CI. Treat a passing `pnpm typecheck`, `pnpm build`, and CI run as the</p>\n<p>release decision for app TypeScript correctness.</p>\n<p>Do not use a bare `tsc --noEmit` result as the release signal. The release</p>\n<p>signal stays `pnpm typecheck`/`pnpm build` because that is the CI-aligned</p>\n<p>production Next.js path. Direct `tsc --noEmit` is now expected to converge too,</p>\n<p>but it remains a diagnostic parity check rather than the release decision.</p>\n<p>The explicit diagnostic command is:</p>\n<pre><code>\npnpm typecheck:diagnostic\n</code></pre>\n<p>The diagnostic parity report is:</p>\n<pre><code>\npnpm typecheck:diagnostic:report\n</code></pre>\n<p>It writes:</p>\n<ul><li>`artifacts/typescript-diagnostic/typescript-diagnostic-debt-latest.json`</li><li>`artifacts/typescript-diagnostic/typescript-diagnostic-debt-latest.md`</li></ul>\n<p>On July 2, 2026, the report originally reproduced the suspected drift while</p>\n<p>`pnpm typecheck` passed: 93 test/script TypeScript errors across 8 classified</p>\n<p>buckets and 0 unclassified errors. Those buckets were retired in the same</p>\n<p>command-contract cleanup. The current expected state is:</p>\n<p>  0 buckets, and 0 unclassified diagnostics.</p>\n<ul><li>`pnpm typecheck` passes as the release signal.</li><li>`pnpm typecheck:diagnostic` passes as direct TypeScript parity.</li><li>`pnpm typecheck:diagnostic:report` reports `status: converged`, 0 errors,</li></ul>\n<p>This means the original drift was a real test-type debt issue in the diagnostic</p>\n<p>path, not evidence that production app typechecking was bypassed.</p>\n<p>When changing production app code, run the focused tests for the touched area</p>\n<p>and at least one of:</p>\n<pre><code>\npnpm typecheck\npnpm build\n</code></pre>\n<p>When future direct-`tsc` drift appears, use the report first, classify any new</p>\n<p>bucket, retire one bucket at a time, then run `pnpm typecheck:diagnostic`.</p>\n<p>Record that work separately from production readiness or launch evidence. The</p>\n<p>diagnostic path is healthy only when both commands pass:</p>\n<pre><code>\npnpm typecheck\npnpm typecheck:diagnostic\n</code></pre>","updatedAt":"2018-10-20T01:46:40.000Z","checksum":"e2c0fe337ff62f310179b195a32aa331968c24a41da24612c27f860d41c3b0c9","checksumPrefix":"e2c0fe337ff6","anchorCount":0,"lineCount":65,"rawUrl":"/api/docs/content?path=development%2Ftypescript-command-contract.md","htmlUrl":"/docs?doc=development%2Ftypescript-command-contract.md","apiUrl":"/api/docs/content?path=development%2Ftypescript-command-contract.md"}