Commit 89c4e22
fix(walker): catch Js.Exn in pattern position + exempt phase2c.res fixture
Two bugs blocked Phase 2c parity tests + governance:
1. `walker-phase2c-parity / untyped-exception on lines 19/22/28` failed
with missing=[22]. Tree-sitter labels `Js.Exn.Error(_)` in catch-arm
pattern position with a different node type than the typed branches
([member_expression]/[value_identifier_path]) the detector matches.
Add a leaf-only text fallback ( <=32 chars, no children) so any
small leaf carrying `Js.Exn` / `Promise.catch` flags too. Dedupe by
(kind, line) collapses same-line duplicates against the parent
try_expression hit, so no over-reporting.
2. `governance / Language / package anti-pattern policy` failed with
"❌ ReScript files detected" for the new phase2c.res fixture. The
walker exists precisely to detect anti-patterns in .res files, so
the fixture is intentional. Side-channel exemption in
`.hypatia-ignore` (same pattern as the existing `sample.res` line)
per `feedback_inline_pragma_vs_snapshot_test`.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>1 parent 5a26b51 commit 89c4e22
2 files changed
Lines changed: 17 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
| 26 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
421 | 421 | | |
422 | 422 | | |
423 | 423 | | |
424 | | - | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
| 434 | + | |
| 435 | + | |
| 436 | + | |
| 437 | + | |
| 438 | + | |
| 439 | + | |
425 | 440 | | |
426 | 441 | | |
427 | 442 | | |
| |||
0 commit comments