What follows is implementation, not spec: tsc 6.0.3's checker.ts, whose design the Go port's relater.go keeps.
Relations. Each relation has its own result map. assignableRelation serves assignments and arguments. comparableRelation serves type assertions and ===/switch overlap checks, and is looser: roughly, either side may be assignable to the other. identityRelation serves redeclared vars, and subtype relations serve union reduction. isTypeRelatedTo tries cheap paths first: the same object, simple flag rules (anything to unknown), then the cache, keyed "sourceId,targetId". Only then does it compare members, signatures and index signatures structurally, storing Succeeded or Failed.
Recursion and generics. A pair being compared sits on a "maybe" stack; meeting it again returns Maybe, so recursive types terminate. Depth limits stop expanding types (TS2321, excessive stack depth). Two instantiations of one generic compare type arguments by its variance, measured once per type.
Interning. One literal type exists per value. Unions are deduplicated, sorted by type id and cached by member list; Array<string> comes from a per-generic instantiation map. Equal types are therefore often one object and hit the first fast path. Ids follow creation order, so 6.0 output can depend on checking order; 7.0, with parallel checkers, sorts by content.
Inference walks source and target together, collecting candidates per type parameter with priorities, and defers context-sensitive arguments (unannotated callbacks) to a second pass.
Editors. On 6.0, VS Code spawns tsserver: JSON requests on stdin (seq, type, command, arguments), Content-Length-framed responses and events such as semanticDiag, 1-based line/offset. TypeScript 7's server (tsc --lsp --stdio) speaks the Language Server Protocol instead: JSON-RPC, an initialize capability handshake, textDocument/hover, pulled diagnostics, 0-based positions, several threads.