Goal
Catch AST divergence between `src/parser-ts/` (TS compiler API, node compiler) and `src/parser-native/` (tree-sitter, self-hosted). Standalone regression gate. Pre-req for eventually retiring parser-ts.
Scope (~300-400 LOC)
- `tests/parser-diff.test.ts` (~150) — iterate `tests/fixtures/**/*.ts`, parse with both, deep-equal normalized JSON
- `src/parser-diff/normalize.ts` (~100) — strip `loc`/`range`, canonicalize field order, drop parser-specific metadata
- `src/parser-diff/allowlist.ts` (~50) — known divergences w/ reason + linked issue
Behavior
- Fail on new divergence
- Allowlisted entries logged, not failed
- `npm run test:parser-diff` standalone target
Expected outcome
First run likely surfaces 5-20 real divergences. Each becomes either a parser-native fix or allowlist entry linking a new bug issue.
Non-goals
- Translation layer between parsers
- Rewriting either parser
- Codegen changes
Risk
Low — pure test infrastructure.
Related
Goal
Catch AST divergence between `src/parser-ts/` (TS compiler API, node compiler) and `src/parser-native/` (tree-sitter, self-hosted). Standalone regression gate. Pre-req for eventually retiring parser-ts.
Scope (~300-400 LOC)
Behavior
Expected outcome
First run likely surfaces 5-20 real divergences. Each becomes either a parser-native fix or allowlist entry linking a new bug issue.
Non-goals
Risk
Low — pure test infrastructure.
Related