Commit e4d13a9
Sort differential rules most-specific-first, dropping the ordering rule
expected_changes.toml's rules were tried in file order, so a rule
narrowed by name_regex had to be written above every rule narrowed
only by fields -- an invariant the file could only defend in prose,
and one it had already lost once (the fix(#271) CJK rule was dead on
arrival at the end of the file, its diffs claimed and mislabelled by
fields-only fix(suffix-routing)).
compare.py now sorts the rules into two tiers before matching, stably,
so rules within a tier keep the order they were written in. That makes
the ordering rule structural, and the three places that documented it
by hand -- the toml header, the #271 rule's own "FIRST on purpose"
paragraph, and the README's ordering section -- collapse to one line
each.
No exit-code change: sorting cannot change WHICH rules match, only
which of several matching rules wins the label. The run is unchanged
against the current corpora (654 names, 18 intentional diffs, 0
unexplained, exit 0) -- with one fields-only rule in the file and the
one specific rule that competes with it already written above it, the
sort is a no-op today. Verified it is not a no-op in general: with the
#271 rule moved to the end of the file, '毛泽东' classifies as
suffix-routing unsorted and as fix(#271) sorted.
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>1 parent a102c86 commit e4d13a9
3 files changed
Lines changed: 11 additions & 20 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
116 | 116 | | |
117 | 117 | | |
118 | 118 | | |
119 | | - | |
120 | | - | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
125 | | - | |
126 | | - | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
127 | 123 | | |
128 | 124 | | |
129 | 125 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
62 | 62 | | |
63 | 63 | | |
64 | 64 | | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
65 | 70 | | |
66 | 71 | | |
67 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
6 | | - | |
7 | | - | |
8 | | - | |
9 | | - | |
| 6 | + | |
| 7 | + | |
10 | 8 | | |
11 | 9 | | |
12 | 10 | | |
| |||
23 | 21 | | |
24 | 22 | | |
25 | 23 | | |
26 | | - | |
27 | | - | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | 24 | | |
35 | 25 | | |
36 | 26 | | |
| |||
0 commit comments