ReviewOS

also looking at this

home-lang/home

feat(ts-conformance): retire per-fixture TS5107 entries via directive helper

#65
Merged glennmichael123 wants to merge feat/retire-ts5107-shim-entries into main
1 file +197 -13
8 days ago

Summary

First slice of Chris's "AI to fix still" shim-retirement work (per the linked Slack message + docs/TS_PARITY_PLAN.md §6.A).

The first cluster in hasHarnessModeledExpectedError — comment block "These ES5 destructuring variants only carry the upstream TS5107 target-option deprecation diagnostic" — is exactly the pattern this PR makes generic:

  • Add directiveTargetDeprecated(source) (sibling to the existing directiveTargetEs2015OrLater) that returns true when the source's // @target: … directive lists es3 or es5.
  • Wire it into runOneEntry's coarse-mode had_errors expression, gated on entry.expects_error (same gate the shim already uses).
  • Now every @target: es3 / @target: es5 fixture whose only upstream error is the TS5107 deprecation satisfies its expects_error without needing a named shim entry.

Why the per-fixture entries stay (for now)

The 10 entries on lines 859-868 are kept with a NOTE: comment pointing at the new helper. They're no-ops for the coarse path now, but the use_exact_errors=true baseline-comparison path still relies on them — Home's ts_driver doesn't yet emit a real TS5107 diagnostic whose byte form matches the upstream .errors.txt. The note flags them for deletion once that downstream work lands (Chris's AI can prune them after a clean full-corpus run).

Test plan

  • zig build test -Dfilter=ts_conformance --summary all — 38/38 (was 36/36, +2 new)
  • zig build test -Dfilter=ts_checker --summary all — 689/689 unchanged
  • zig build test -Dfilter=ts_driver --summary all — 57/57 unchanged
  • Once Chris's AI finishes the 5700-5800 batch, re-run the bounded slices START=838 LIMIT=200 through START=5838 LIMIT=200 to confirm no regression from the new coarse-path helper.

Notes for review

This is intentionally small and additive — single function added, single OR clause in had_errors, no per-fixture entries removed yet. Designed to be the first of many small PRs that whittle the 373-entry shim down by replacing per-name matches with named source-level predicates.

🤖 Generated with Claude Code

1 changed file on the files tab, with 0 review threads.

Sign in to comment on this pull request.