You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Give the differential harness a CJK corpus generated from the case table
The fix(#271/#272) rule in expected_changes.toml had never classified
a name in a real run: corpus.jsonl regenerates from v1's test banks
(no reason to test CJK) and build_issues_corpus.py requires an
internal space, which unspaced names -- the exact shape the rule
explains -- never have. The rule was verified once against a
throwaway synthetic corpus during #294 and was otherwise dead weight
the harness could not distinguish from coverage.
corpus_cjk.jsonl is the third corpus with the third provenance:
generated by build_cjk_corpus.py from every distinct case-table text
bearing a codepoint the script table classifies, through the same
_script_matcher the parser uses. Row context is deliberately ignored
-- the corpus carries name STRINGS and the harness parses them with
the default facade, so a zh-scoped row's text is simply one more CJK
name to diff. The selection self-extends: a case row added for future
CJK work enters the corpus at the next regeneration, and
test_regex_sync.py pins the checked-in file against the generator's
selection so a stale corpus fails the suite.
First real run: 685 names, 44 intentional diffs, 0 unexplained, with
the CJK rule claiming 23 names. It also immediately surfaced a shape
no rule covered -- a name where delimiter recognition (corner
brackets, the nakaguro nickname join) and the CJK family-first flip
change fields in the SAME diff, which neither single-change rule may
claim because each excludes the other's fields on purpose. The new
fix(cjk-delimited-nickname) rule takes exactly that union, scoped to
the CJK-typographic delimiters so it cannot absorb a Latin delimiter
diff; its issue slug avoids the literal #271/#272 substrings the
sync test uses to select the one canonical CJK rule.
Closes#295
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Copy file name to clipboardExpand all lines: tools/differential/README.md
+11-4Lines changed: 11 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -38,7 +38,7 @@ needs widening. The run must exit 0 before a 2.0 release; the classified
38
38
summary it prints is the source for the "Behavior Changes" section of
39
39
`docs/release_log.rst`.
40
40
41
-
## The two corpora
41
+
## The three corpora
42
42
43
43
`compare.py` reads **every**`corpus*.jsonl` beside it by default
44
44
(deduped), because a corpus you have to ask for by name is a corpus
@@ -48,11 +48,18 @@ that stops being run. Pass `--corpus PATH` (repeatable) to narrow it.
48
48
|---|---|---|
49
49
|`corpus.jsonl`| v1's own test suite at a pinned ref | anything 2.0 added — v1's authors had no reason to test a typographic nickname delimiter or a Cyrillic title |
50
50
|`corpus_issues.jsonl`| name-like strings harvested from the GitHub issue tracker | anything nobody ever reported |
51
+
|`corpus_cjk.jsonl`| the CJK-bearing rows of `tests/v2/cases.py`, via `build_cjk_corpus.py` (#295) | anything the case table itself missed — it re-witnesses reviewed expectations at the 1.4 boundary rather than discovering new shapes |
51
52
52
53
They are deliberately separate rather than merged: `corpus.jsonl` is
53
-
reproducible forever from an immutable git ref, while the issue
54
-
tracker is mutable, so regenerating the second one is an explicit,
55
-
reviewable act that can only add names.
54
+
reproducible forever from an immutable git ref, the issue tracker is
55
+
mutable, so regenerating `corpus_issues.jsonl` is an explicit,
56
+
reviewable act that can only add names — and the CJK corpus exists
57
+
because BOTH of those are structurally blind to unspaced CJK (v1's
58
+
banks never tested it; `build_issues_corpus.py` requires an internal
59
+
space, which unspaced names never have). It regenerates from the case
60
+
table, and `tests/v2/test_regex_sync.py` pins the checked-in file
61
+
against the generator's selection, so a CJK case row added without
62
+
regenerating fails the suite instead of silently narrowing this gate.
56
63
57
64
The issue corpus earned its place on the first run — 166 of its 198
58
65
names were not in `corpus.jsonl`, and it immediately surfaced five
0 commit comments