ReviewOS

home-lang/home

feat(ts): emit Home-only `HMxxxx` diagnostics and accept Home options in tsconfig

#782
Closed chris opened this 9 days ago ·
9 days ago

Problem

Sound-mode TypeScript needs a channel for diagnostics beyond tsc's. The HMxxxx code table and the prefix plumbing through driver, CLI and conformance already exist, but no checker path ever sets the HM prefix. The tsconfig parser and CLI option table accept only tsc/tsgo options (the table is generated from tsgo), and the checker has no rule/lint registry.

Evidence (origin/main @ d4b219507)

Scope

  • Add a Home options namespace (e.g. "home": { ... } in tsconfig, mirrored as --home-* CLI flags) that tsc parity mode ignores.
  • Add a rule registry in the checker: each Home rule has a code, default severity and option gate.
  • Keep tsc parity untouched: with no Home options set, output is byte-identical to today.

Acceptance criteria

  • A test rule emits HM9xxx through home tsc, LSP diagnostics and the process exit code.
  • TS conformance numbers are unchanged with Home options off.

Part of #814.

9 days ago

Foundation pushed directly to main in 184b03d (feat(ts): add Home checker options (#782)).

This adds the root-level home namespace with inheritable sound / listUnmodeledAny controls, propagates them into driver compile options, and exposes explicit --home-* / --no-home-* CLI flags in expanded help only. Defaults remain unset so ordinary TypeScript behavior is unchanged.

Verified under the serialized 3,840 MB supervisor:

  • zig build test -Dfilter=tsconfig -j1
  • zig build test -Dfilter=ts_driver -j1
  • zig build test -Dfilter=ts_cli -j1

Next slice is the checker rule registry and an actual HM9xxx diagnostic through CLI/LSP/exit status; acceptance remains open.

9 days ago

Second direct-main slice pushed in f1392ab (feat(ts): add Home sound rule registry (#782)).

This adds a checker-local Home rule registry with a stable code, default severity, and option gate; wires effective Home options into the checker; and implements the first real HIR-based soundness rule: explicit any emits error HM9001 only when home.sound is enabled. Default parity mode emits no HM diagnostics. Diagnostic categories now preserve Home warnings without turning them into process errors.

Verified under the serialized 3,840 MB supervisor:

  • zig build test -Dfilter=ts_checker -j1 (peak 2,253 MB)
  • zig build test -Dfilter=ts_driver -j1 (re-run after rebasing on current main; peak 1,946 MB)
  • zig build test -Dfilter=ts_diagnostics -j1 (peak 97 MB)
  • zig build test -Dfilter=ts_cli -j1 (re-run after rebase; peak 1,848 MB)

Remaining acceptance work: preserve the HM identity in structured LSP diagnostics and prove the actual home tsc output/exit code plus unchanged default conformance numbers.

9 days ago

Pushed directly to main as d370270 (fix(ts): preserve Home codes in LSP diagnostics (#782)).

This three-file batch preserves the TS/HM diagnostic namespace through the language-service and all LSP serialization paths: TypeScript codes remain numeric, while Home codes are emitted as strings such as HM9001 with source home. It also includes project-level coverage for home.sound.

Guarded verification:

  • focused ts_lsp Home-code test: 1/1 passed, peak 1,883 MB
  • ts_lsp_server: 117/117 passed, peak 1,958 MB
  • tsc_main: 33/33 passed, peak 2,013 MB
  • formatting checks for the changed server/CLI files and git diff --check passed

I am leaving #782 open until the built home tsc binary behavior and unchanged default TypeScript conformance results are verified.

9 days ago

Binary-level acceptance update for the direct-main #782 slices:

  • Fresh guarded no-JSC home-debug build passed (peak 2,864 MB).
  • With { "home": { "sound": true } }, the real home tsc binary emitted error HM9001: Explicit any is not permitted in Home sound mode. and exited 1.
  • With the same source and no Home options, home tsc emitted no diagnostics and exited 0.
  • The default ts_conformance artifact passed 1,419/1,419 (peak 2,200 MB).

The full exact parity criterion cannot yet be marked complete honestly. After initializing the repository-pinned nested TypeScript corpus, official exact slice START=0 LIMIT=1000 produced 981 pass / 19 fail, while the harness still exited 0. I filed the actionable regression and gating work as #832. The monolithic exact run also reached the 3,840 MB guard, so the documented six slices are the safe validation shape.

Result: HM diagnostics now pass through CLI, LSP, and process exit status, but #782 remains open pending the unchanged exact-conformance proof tracked in #832.

9 days ago

TypeScript exact-conformance progress landed directly on main in fc43164c7 (fix(ts): box contextual Object returns (#832)).

The first-1,000 exact slice improved from 985/1,000 to 990/1,000. Five upstream fixtures now match: callSignatureAssignabilityInInheritance{2,5}, constructSignatureAssignabilityInInheritance{2,5}, and subtypingWithConstructSignatures5.

Full checker (4,417 tests), driver, and conformance package/category suites pass. The exact gate correctly remains red for the 10 residual mismatches.

9 days ago

Another exact TypeScript parity checkpoint landed directly on main in fd2c9b3b2 (fix(ts): select union signature diagnostics (#832)).

The first-1,000 exact slice improved from 990/1,000 to 992/1,000. unionTypeCallSignatures and unionTypeConstructSignatures now match upstream exactly. Full checker, driver, and conformance suites pass; eight exact mismatches remain.

9 days ago

TypeScript parity progress: 2e13465 is on main and fixes the mappedTypeProperties exact baseline. The first-1000 byte-for-byte conformance gate is now 993/1000 (up from 992/1000). Full checker 4419/4419, driver 197/197, conformance 1426/1426, baseline-aware 586/586, and a fresh no-JSC debug build all passed. Seven exact residuals remain.

9 days ago

Exact TypeScript conformance ratchet update: 080f26b raised the first-1,000 exact run from 993/1,000 to 996/1,000 by fixing the three generic indexed-write fixtures. Remaining exact failures in that slice are conditionalTypes2, conditionalTypes1, unionAndIntersectionInference1, and genericRestParameters1. Full checker remains 4,420/4,420 passing.

9 days ago

Exact-conformance acceptance checkpoint: b7f93ddea875716c51ff11778c2d35abd20562ec is on main and extends the current-tree revalidated byte-exact prefix from 2,200/2,200 to 2,800/2,800. The three new 200-case partitions pass exactly, while smoke/category/baseline-aware gates remain 16/16, 86/86, and 586/586.

The commit also adds scripts/ts-conformance-exact.sh, which runs exact ranges serially under the machine lock and explicit time/memory bounds. Detailed measurements are recorded in #832; no unverified full-corpus claim was added here.

9 days ago

Completed on main in df4cfa251b9181e524258858e7c3e8af519a738f (test(ts): prove Home diagnostic delivery (#782)).

Acceptance evidence:

  • The build-level test-tsc-streams gate invokes the real standalone home-tsc with --home-sound, requires exact stdout home_sound.ts(1,14): error HM9001: Explicit 'any' is not permitted in Home sound mode., requires empty stderr, and requires exit code 1.
  • The end-to-end home lsp --stdio fixture loads { "home": { "sound": true } } and requires both ordinary numeric TS2322 and string wire code HM9001 with source: "home" from the same document.
  • The real guarded home lsp --stdio process passed those assertions against the checked-in fixture.
  • Focused guarded suites pass: test-tsc-streams (321 MB final peak), ts_cli (1,917 MB), tsc_main (2,137 MB), and ts_lsp_server (2,120 MB).
  • Home options remain opt-in. No checker/compiler source changed in this acceptance commit, and the current-tree exact prefix remains 2,800/2,800; smoke/category/baseline-aware gates remain 16/16, 86/86, and 586/586.
  • Scoped Pickier and Zig format/diff checks pass. The parity plan still has only its three pre-existing historical reversed-link errors.

Verification boundary: the combined full-home zig build test-home-lsp link was safely stopped by the required 3,840 MB guard at 3,920 MB. This is not used as a pass claim; the actual already-built Home LSP process plus the freshly compiled tsc_main and ts_lsp_server suites provide the behavior/source evidence under the cap.

Exactly five files changed; author and committer are both glennmichael123 <gtorregosa@gmail.com> with no coauthors.

Sign in to comment on this issue.