ReviewOS

home-lang/home

fix(ts): prevent CLI option crashes for skipLibCheck and ignoreConfig

#645
Closed chris opened this 8 days ago ·
8 days ago

Summary

home-tsc exits with signal-derived status 139 and no diagnostic when either supported TypeScript CLI option --skipLibCheck or --ignoreConfig is passed. A no-option control over the same valid file exits 0 in 0.03 seconds.

Found while refreshing the pinned TypeScript oracle for #639. This is separate from, but related to, #486: that issue tracks the missing TS5112 decision when positional files coexist with a config; this issue tracks the crash when the documented escape hatch is used.

Minimal reproduction

// /tmp/home-cli-option-repro.ts
const value: number = 1;
void value;

From the repository root:

./zig-out/bin/home-tsc --noEmit --strict /tmp/home-cli-option-repro.ts
# exit 0 in 0.03 s

./zig-out/bin/home-tsc --noEmit --strict --skipLibCheck /tmp/home-cli-option-repro.ts
# exit 139 after about 30 s; stdout/stderr empty

./zig-out/bin/home-tsc --noEmit --strict --ignoreConfig /tmp/home-cli-option-repro.ts
# exit 139 after about 30 s; stdout/stderr empty

The flags fail independently. The same behavior occurs with the exact post-#634 parent binary and the #639 candidate, so it is not caused by the recursive-default change.

Provenance

  • post-#634 parent commit: 773af2405
  • parent ReleaseFast SHA-256: 0ae28e7b700ac0effb7e6ec6ee7012ee23bc9387077a61d123bdc3260d4de163
  • #639 candidate commit: a8b99ecfa
  • candidate ReleaseFast SHA-256: a201e6d7c5c20f046a9b591ef43d8c47f9679653981d61027d6340fd5ebaab80
  • host: macOS arm64

Acceptance criteria

  • --skipLibCheck completes normally and applies the option.
  • --ignoreConfig completes normally and performs explicit-file checking without loading the nearby config.
  • CLI tests cover each flag independently, their combination, and the no-option control.
  • #486's TS5112 behavior remains independently testable.
8 days ago

Landed directly on main in two small, authored conventional commits (no coauthors):

  • d318b0c28 — fix(ts): honor explicit-file CLI booleans (#645)
  • 5cbf35e3b — docs(ts): record explicit-file CLI audit (#645)

Root cause: the unknown-option arity heuristic consumed the following positional source for both boolean flags. With no files left, Home discovered the repository config and eventually exited 139 while checking the wrong graph.

The fix gives ignoreConfig and skipLibCheck typed boolean parsing, including separate true/false values. Other following arguments remain positional. ignoreConfig suppresses discovery only beside explicit files; no-file invocations still load the project. skipLibCheck overrides config values in either direction and now suppresses declaration-file checker diagnostics at the diagnostic boundary while still completing checked metadata capture; lexer/parser diagnostics remain visible.

Fresh pinned TS 6.0.3 / native TS 7.0.2 / Home controls cover:

  • --ignoreConfig entry.ts: TS2304, not a crash
  • --ignoreConfig --skipLibCheck entry.ts: pass
  • explicit true for both: pass
  • explicit skipLibCheck false: TS2304
  • --ignoreConfig with no files: nearby config TS2322
  • malformed declaration under skipLibCheck: syntax error retained

The absent-flag TS5112 decision remains correctly scoped to #486. A cross-file declared-global negative control exposed the independent #480 gap (TS6/TS7 TS2322 vs Home TS2304); the exact reduction is posted there rather than being accepted or hidden in this issue.

Same-parent Zod 4.5.2 gate after the final rebase:

  • exact parent df4dff88f: 600 normalized diagnostics
  • candidate: 600 normalized diagnostics
  • added/removed identities: 0 / 0
  • both identity SHA-256: f093515438ca8b68df2a1fea133f3e247d21574900579902513adac4636ecfe2
  • parent/candidate ReleaseFast SHA-256: 1acadca6b41f3f9a17dbd3b3d883a55810bf806a9db2699e7997a7c42a136390 / 26ce61627370b68e8a5ef27d88f425c24efa2f24ad2df25fad15377c852b29dd
  • one-run walls: 27.49 s / 25.83 s, transparency only; no speed claim

The complete CLI, driver, and Program suites pass in Debug, ReleaseSafe, and ReleaseFast. zig fmt, git diff --check, and scoped documentation pickier pass. The required repository-wide bunx --bun pickier . remains red on the existing 20,869 diagnostics across 12,036 filtered files; the changed Markdown passes cleanly.

The README contains the brief linked audit table, and TS_PERFORMANCE.md contains the full oracle, methodology, hashes, commands, and matrix times.

Sign in to comment on this issue.