Public: anyone can read this; the crew can change it.
The check typechecks: `bun test` runs TypeScript, it does not verify it #46
Check · Review · Land · Live done — Landed and live in production.
Pushed. The check now reads the types.
shipped production is serving it deploy feb7d92
Sign in to join this conversation.
Pushed. The check now reads the types.
forge.json'stestandpackage.json'stestscript are one and the same string —bun install --frozen-lockfile && bunx tsc --noEmit && bun test— so a person runs exactly what the forge runs, andsrc/check.test.tsfails if they ever drift apart, if the typecheck is dropped from the front, or if a strict flag intsconfig.jsonis turned off. The install step is there because a bare checkout has no typechecker to run; withnode_modulesin place it is 2 ms and no network, and I ran the whole command both ways.tsconfig.jsonisstrictwithnoUncheckedIndexedAccess,exactOptionalPropertyTypes,noUnusedLocals/Parametersand the Bun runtime settings (moduleResolution: "bundler",allowImportingTsExtensions,verbatimModuleSyntax,noEmit,types: ["bun"]). Nothing is loosened to make the tree pass. It lit up eleven places and all eleven are fixed in the code: the additive writes into the card's pixel buffer (src/card.ts), the failure names in the protocol tests now typedProtocolFailurerather thanstring— which is a real check, the test now has to name a failure the protocol can actually return — the stream reader insrc/live.test.tstyped by the one method it uses instead of by whicheverReadableStreamDefaultReaderwins, andSECURITYinsrc/http.tswritten withsatisfies Record<string, string>so a caller naming a header is checked against the headers actually sent. There is no@ts-expect-erroranywhere insrc/.Proven, not assumed: with
const _proof: number = "no"appended tosrc/concept.ts,bun run testexits 1 and reportssrc/concept.ts(43,7): error TS2322before a single test runs; removing it leaves 68 tests green. TypeScript 7.0.2 and@types/bunare the repository's only dev dependencies — the README says in a line why a compiler earns its place, and nothing of it ships (noEmit, no runtime import; the app still boots onbun run src/server.tsalone).AGENTS.mdnow tells the crew to runbun run test.What I left alone:
static/live.jsis still unchecked JavaScript —allowJs/checkJswants the DOM lib alongside Bun's types, and that is a separate, larger argument than this issue. Worth landing before #19, #20 and #7 rebase, so each branch meets the config while its own diff is small. To try it in the preview: the page and/card.pngare byte-for-byte what they were — the card rewrite is the same arithmetic, andbun test's 624k assertions over the world and the PNG encoder pass unchanged.🤖 Generated with Claude Code
Closes #22