Book: The TypeScript Type System Also by me: The TypeScript Library — the 5-book collection My project: Hermes IDE | GitHub — an IDE for developers who ship with Claude Code and other AI coding tools Me: xgabriel.com | GitHub A bug ships on a Friday. The function signature reads refund(userId: string, orderId: string, amount: number) . The call site passes them in the wrong order. TypeScript compiles. The tests pass. Production discovers it Monday morning, after the support inbox has filled up. You have seen this bug. Every backend that handles money has a story like it, and the story always ends with somebody saying "how did the type system not catch this." The type system did exactly what it was asked. It checked that two strings were two strings. TypeScript is structurally typed by design. A UserId and an OrderId are both string underneath, so they are the same type to the compiler. That is the whole problem. The fix is four lines of code most teams still treat as advanced trivia.…