ReviewOS

home-lang/home

feat(runtime): `home run --check` refuses to run TypeScript with type errors (and skips checking otherwise)

#785
Open chris opened this 9 days ago ·
9 days ago

Problem

home-tool compiles each module through ts_driver.compileSource, which runs the full checker, then keeps only the .js and discards the diagnostics — paying for type checking with no benefit. The Bun-port runtime path skips types entirely. The engine should be able to guarantee it only executes well-typed code.

Evidence (origin/main @ d4b219507)

Scope

  • Add --check (and a bunfig/home config key) that type-checks the module graph before execution and exits non-zero on errors.
  • Without --check, pass no_check so the checker phase does not run at all.
  • In sound mode, --check also enforces the sound-mode rules.

Acceptance criteria

  • home run --check bad.ts exits 1 and prints TS diagnostics; nothing executes.
  • Without the flag, a profile shows no checker phase.
  • Checked results are cached per file hash so repeated runs are cheap.

Related: #784 Part of #814.

Sign in to comment on this issue.