Five items from packages/docs/audits/typescript-audit-2026-04.md are still open. That document remains the correct specification for each; this issue exists to keep them visible.
Status since April
| Signal |
Apr 2026 |
Sep 2026 |
as any |
~144 |
109 |
as Record<string, unknown> |
115 |
96 |
as Error |
~100 |
101 |
satisfies |
4 |
8 |
Type tests (expectTypeOf) |
0 |
0 |
createServerFn |
0 |
19 files |
@ts-ignore / @ts-expect-error |
3 |
0 |
Landed: typed-RPC migration, @types/google.picker, auth Zod parsing, the first pass on hot endpoints, and the admin type derivation in PR #768.
Still open
April item 5 (G1) -- type tests. Zero expectTypeOf / assertType calls repo-wide. Vitest supports this natively. Highest leverage of the five: type tests are what stop the rest of this backlog from quietly regressing between audits. 1-2 hours.
April item 4 (H1/G4) -- checklist registry as a discriminated map plus satisfies. Still Record<string, ChecklistMetadata> in checklist-registry/index.ts, which widens the keys to string and loses the AMSTAR2 | ROB2 | ROBINS_I union. 2-3 hours.
April item 3 (C1) -- admin and billing endpoints. 96 as Record<string, unknown> casts remain across 31 files. PR #768 handled the admin pages via createServerFn; the older hand-rolled endpoints did not move. Half a day.
April item 7 (G5) -- verbatimModuleSyntax: true. Still false in packages/web/tsconfig.json:12. Mostly lint-autofixable. 1-2 hours.
April item 8 (H4) -- server.ts env typing. Six as never / env as SentryEnv / env as DOEnv casts remain in packages/web/src/server.ts. Casting to never signals the binding type is too narrow at the source. 1 day, lower priority -- not actively dangerous.
Reference implementation for the type tests
cf-sync-engine already does this, in a repo we own. Three files carry 23 expectTypeOf / assertType assertions:
packages/protocol/test/schema.test.ts
packages/protocol/test/inference.test.ts
packages/client/test/collection.test.ts
They mix runtime and type assertions in the same describe block (expect(() => defineSchema({...})).toThrow(...) alongside expectTypeOf), which is the pattern to copy -- no separate .test-d.ts harness needed, and no extra tooling beyond the Vitest already in use.
Part of #778 (TypeScript correctness target state and tracker).
Five items from
packages/docs/audits/typescript-audit-2026-04.mdare still open. That document remains the correct specification for each; this issue exists to keep them visible.Status since April
as anyas Record<string, unknown>as ErrorsatisfiesexpectTypeOf)createServerFn@ts-ignore/@ts-expect-errorLanded: typed-RPC migration,
@types/google.picker, auth Zod parsing, the first pass on hot endpoints, and the admin type derivation in PR #768.Still open
April item 5 (G1) -- type tests. Zero
expectTypeOf/assertTypecalls repo-wide. Vitest supports this natively. Highest leverage of the five: type tests are what stop the rest of this backlog from quietly regressing between audits. 1-2 hours.April item 4 (H1/G4) -- checklist registry as a discriminated map plus
satisfies. StillRecord<string, ChecklistMetadata>inchecklist-registry/index.ts, which widens the keys tostringand loses theAMSTAR2 | ROB2 | ROBINS_Iunion. 2-3 hours.April item 3 (C1) -- admin and billing endpoints. 96
as Record<string, unknown>casts remain across 31 files. PR #768 handled the admin pages viacreateServerFn; the older hand-rolled endpoints did not move. Half a day.April item 7 (G5) --
verbatimModuleSyntax: true. Stillfalseinpackages/web/tsconfig.json:12. Mostly lint-autofixable. 1-2 hours.April item 8 (H4) --
server.tsenv typing. Sixas never/env as SentryEnv/env as DOEnvcasts remain inpackages/web/src/server.ts. Casting toneversignals the binding type is too narrow at the source. 1 day, lower priority -- not actively dangerous.Reference implementation for the type tests
cf-sync-enginealready does this, in a repo we own. Three files carry 23expectTypeOf/assertTypeassertions:packages/protocol/test/schema.test.tspackages/protocol/test/inference.test.tspackages/client/test/collection.test.tsThey mix runtime and type assertions in the same
describeblock (expect(() => defineSchema({...})).toThrow(...)alongsideexpectTypeOf), which is the pattern to copy -- no separate.test-d.tsharness needed, and no extra tooling beyond the Vitest already in use.Part of #778 (TypeScript correctness target state and tracker).