Skip to content

Commit c34fb74

Browse files
authored
Merge pull request #480 from derek73/chore/open-the-2.3-cycle
Open the 2.3 cycle, and record the ledger roster AGENTS.md missed
2 parents e52aeaa + b3e1e77 commit c34fb74

6 files changed

Lines changed: 64 additions & 11 deletions

File tree

AGENTS.md

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -139,20 +139,34 @@ uv run sphinx-build -b html docs dist/docs
139139
# so a copy spelled some other way is not undeclared but unseen. What
140140
# covers those is _CORPUS_CLAIMS, which records what every rule claims
141141
# -- its regex's corpus reach, its roles, and which names -- and so
142-
# needs no notion of how a copy is spelled. Enrol the new ledger in
143-
# _CORPUS_CLAIMS always, and in the others where they apply:
142+
# needs no notion of how a copy is spelled.
143+
# THREE rosters are keyed by FILENAME and checked by EQUALITY, so a new
144+
# ledger must be enrolled in every one of them on the day it lands, even
145+
# empty -- each fails loudly and names itself, but that is three separate
146+
# red runs if you add them one at a time. Two more are keyed by rule
147+
# CONTENT and apply only where such a rule exists.
148+
# Required, by filename:
144149
# - _SPAN_BEARING_RULES: add the filename, mapped to the set of issue
145150
# tags whose rules carry a script-span class (empty set if none).
151+
# - _CORPUS_CLAIMS: a ledger with no entry hard-fails. Add the
152+
# filename mapped to {} while the ledger is empty, then one _Claim
153+
# per rule as rules land. The test prints the values to record. A
154+
# _Claim's digest moves whenever the corpus text does, so a pure
155+
# RENAME of a corpus name lands here as names-unchanged,
156+
# roles-unchanged, digest-moved; a count that GREW means the rule
157+
# absorbed something.
158+
# - _CROSS_RULE_WINNERS: add the filename mapped to {} while the
159+
# ledger has no contested name. Equality since #452, which found
160+
# that a ledger with no rows had been indistinguishable from one
161+
# needing none -- the two 2.x ledgers whose shapes #452 moved
162+
# between rules had no section at all.
163+
# Conditional, by rule content:
146164
# - _HONORIFIC_SOURCES: if the ledger has a CJK honorific rule, add a
147165
# substring of its issue (keyed that way, not by tag) mapped to the
148166
# constant it copies -- but only if no existing key already matches
149167
# that issue. A retroactive ledger can repeat an older one's rule
150168
# verbatim (fix(#271/#272/#298) is in both today), and every rule
151169
# must match exactly one key.
152-
# - _CORPUS_CLAIMS: REQUIRED, not conditional -- a ledger with no
153-
# entry hard-fails. Add the filename mapped to {} while the ledger
154-
# is empty, then one _Claim per rule as rules land. The test prints
155-
# the values to record.
156170
# - _LATIN_ALTERNATION_SOURCES: same, for a rule copying a Latin
157171
# vocabulary (maiden markers, ambiguous acronyms). An alternation
158172
# matching no key fails as undeclared -- add it, or record it in

docs/release_log.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
Release Log
22
===========
3+
* 2.3.0 - Unreleased
4+
35
* 2.2.0 - August 31, 2026
46

57
nameparser 2.2 is a rename plus about thirty parsing fixes.

nameparser/_version.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@
77
#: cannot carry the dev marker, so `VERSION >= (2, 2, 0)` is already
88
#: true here while 2.2.0 is unreleased. Compare `__version__` instead
99
#: where that distinction matters.
10-
VERSION = (2, 2, 0)
10+
VERSION = (2, 3, 0)
1111
#: PEP 440 pre-release/dev segment appended to the numeric version, or
1212
#: "" for a final release. Joined WITHOUT a dot ("2.0.0rc1", not
1313
#: "2.0.0.rc1"); setuptools reads __version__ as the package version.
1414
#:
1515
#: "dev" through the cycle, cleared at release. It normalizes to
16-
#: 2.2.0.dev0, which sorts above 2.1.0 and BELOW 2.2.0, so an install
16+
#: 2.3.0.dev0, which sorts above 2.2.0 and BELOW 2.3.0, so an install
1717
#: from master can never masquerade as the release it precedes.
18-
PRE_RELEASE = ""
18+
PRE_RELEASE = "dev"
1919
__version__ = ".".join(map(str, VERSION)) + PRE_RELEASE

tests/v2/test_ledger_guards.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -352,7 +352,8 @@ def test_script_ranges_membership_is_decided() -> None:
352352
"fix(#271/#272/#298)", # the canonical class
353353
"fix(#298)", # the 间隔号 lookahead
354354
}),
355-
"expected_since_2.1.0.toml": frozenset(), # open cycle, no rules yet
355+
"expected_since_2.1.0.toml": frozenset(), # 2.2 cycle: no span-bearing rule
356+
"expected_since_2.2.0.toml": frozenset(), # open cycle, no rules yet
356357
}
357358

358359
#: The leading `fix(...)`/`feat(...)` tag of a rule's `issue`, which is
@@ -1776,6 +1777,7 @@ def _claim(rule: dict) -> _Claim:
17761777
"fix(#371) a suffix never begins a name: the Ph./D. merge declines at the head":
17771778
_Claim(4, ('family', 'given', 'middle', 'suffix', 'title'), "1425d85a2d86"),
17781779
},
1780+
"expected_since_2.2.0.toml": {}, # open cycle, no rules yet
17791781
"expected_since_2.1.0.toml": {
17801782
"fix(#371) a suffix never begins a name: the Ph./D. merge declines at the head":
17811783
_Claim(4, ('family', 'given', 'middle', 'suffix', 'title'), "1425d85a2d86"),
@@ -1973,6 +1975,7 @@ def test_every_rule_claims_the_recorded_share_of_the_corpus() -> None:
19731975
#: Re-measure rather than adjust them if a parser change moves one:
19741976
#: a diff shape that shifted is a finding, not a number to update.
19751977
_CROSS_RULE_WINNERS: dict[str, dict[tuple[str, tuple[str, ...]], str]] = {
1978+
"expected_since_2.2.0.toml": {}, # open cycle, no rules and so no contest
19761979
"expected_since_1.4.0.toml": {
19771980
("Andrews, M.D.", ("given", "suffix")): "fix(comma-family)",
19781981
("田中, 太郎さん", ("given", "suffix")): "fix(cjk-comma-honorific-peel)",

tools/differential/compare.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525
FIELDS = ("title", "first", "middle", "last", "suffix", "nickname",
2626
"maiden")
2727

28-
DEFAULT_BASELINE = "2.1.0"
28+
DEFAULT_BASELINE = "2.2.0"
2929
REPO_ROOT = HERE.parents[1]
3030
#: The v2 API's names for the same seven roles FIELDS names in v1
3131
#: vocabulary. Both are compared from baseline 2.0 on.
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
# Ledger for baseline 2.2.0 -- what changes for a user upgrading from
2+
# the previous minor. Same rule grammar as the other ledgers: `issue`,
3+
# `name_regex` and `fields` are every one of them required. Neither
4+
# narrowing key may stand on its own -- #451 banned a rule with
5+
# `fields` and no regex, #456 banned the reverse -- so a rule here
6+
# narrows by name AND by role, never by just one.
7+
#
8+
# Opened empty the day 2.2.0 shipped (AGENTS.md release step 8), and it
9+
# is opened before it has anything to say because DEFAULT_BASELINE and
10+
# the ledger are coupled: _allowlist_for treats a missing file as a
11+
# hard error, on the reasoning that an absent ledger classifies nothing
12+
# and would make every diff report as unexplained. So the baseline
13+
# could not advance to 2.2.0 without this file.
14+
#
15+
# Do not copy rules across from expected_since_2.1.0.toml: that ledger
16+
# classifies what 2.2 changed on top of 2.1, and a rule copied without
17+
# checking either over-matches -- hiding a real 2.3 regression behind a
18+
# 2.2-era label -- or never fires at all. Where a 2.3 change is visible
19+
# from several baselines the rule may legitimately appear in more than
20+
# one file, but each copy is checked against its own run rather than
21+
# assumed.
22+
#
23+
# tests/v2/test_differential.py permits exactly one empty ledger, the
24+
# one DEFAULT_BASELINE names -- which is this file, for as long as the
25+
# 2.3 cycle moves no corpus name at the default order.
26+
#
27+
# tests/v2/test_ledger_guards.py records this file in
28+
# _SPAN_BEARING_RULES with an empty set and in _CORPUS_CLAIMS with an
29+
# empty mapping. The first rule that hand-copies _SCRIPT_RANGES has to
30+
# be recorded in the former or the sweep fails.
31+
#
32+
# There is deliberately no `change = []` line. TOML forbids appending a
33+
# [[change]] table to a statically defined array, so that line would
34+
# block the first entry.

0 commit comments

Comments
 (0)