SKILL.mdfix(server): typecheck apps/server clean (design: typecheck-build-boundary phase 1)
Split tests out of the main project (tsconfig.test.json) so it contains exactly the
sources that ship — Phase 2 emits declarations from it — then drove the remainder to
zero: 539 -> 253 -> 0. Tests still typecheck, via `types:test`.
`types` gates src only, deliberately. The test project carries 239 pre-existing errors
of its own; folding them in would keep the gate red forever and block caching for
everyone. Named backlog, not a silent exclusion. With the gate green, turbo can finally
cache it: 6.19s cold -> 188ms FULL TURBO.
Most of these were stale contracts, not sloppy typing — a WorkflowHandle cast to an
invented shape, Cloudflare globals that no longer exist post-AWS-migration, drizzle
result shapes read as node-pg, tool args deleted from the callee but not the caller.
The types were hiding real bugs. `validFields` was read out of scope and threw a
ReferenceError on every stage-batch apply. `corpus.ts` declared occurredAt as string
while holding a Date, so any conversation with 2+ meetings threw in the sort and got
swallowed by a catch. A conversation update dropped its hydrated events relation. A
dedup script keyed on columns that never existed on the table.
CustomFieldDefinition also regained strength/completeness. 2df812b33 collapsed the CRM
plane onto one `signal` rubric, but the taxonomy registry added two weeks later needs
two independent axes and the runtime has always read both — the type was lying, not the
code. Added them to the zod schema too, which strips unknown keys and would otherwise
silently delete every hand-authored rubric the first time it validated a write.
vitest: 4479 pass, 5 pre-existing failures in modifyCalendarEventTool (zero files
changed under that directory). deps:check clean.
Co-Authored-By: Claude Opus 5 (1M context) <<email>>Aug 1, 2026, 8:36 PM