Skip to content

Derive the two name-clash markers from name readings (#752) - #883

Merged
derek73 merged 4 commits into
masterfrom
claude/phase2a-derived-markers-b6b331
Oct 25, 2026
Merged

derek73 merged 4 commits into
masterfrom
claude/phase2a-derived-markers-b6b331

Conversation

@derek73

@derek73 derek73 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Phase 2a of #752: the two vocabulary markers that record a clash with a name are now derived from name readings instead of written as flags. No compiled set moves: nameparser/config/_compiled.py rebuilds byte for byte.

What changes

  • The derivation (tools/vocab/build.py, new build check 11):
    • SUFFIX_ACRONYMS_AMBIGUOUS is now the words with an acronym suffix reading and a given or family reading.
    • The particles outside NON_GIVEN_NAME_PARTICLES are the words with a particle reading and a given reading.
    • Each holds wherever in the files the two readings sit.
  • The data. 44 words got 49 name readings, carrying out items 1 to 3 of decisions/vocabulary-model's 2026-10-23 Phase 2: derive ambiguity from clashing readings and extend the gate to every reading kind #752 entry (Record vocabulary phase 2's agreed design in the RFC and decisions (#752) #881), with counts from tools/name_usage.py taken 2026-10-25: the seven flagged credentials that lacked one (ba, do, ed, jd, lac, ma, meng) and the 38 flagged particles other than bon and dí (do is in both lists). The flags came off 97 readings.
  • A name reading may stand without a count, but it needs a note saying why. Eight particles have no count in any source (aen, bat, binte, freiherr, freiherrin, thoe, ua, vande).
  • ld stays unmarked. Its given count moved into its credential reading's note, so ld stays unmarked. Writing it as a given reading would mark ld: measured on this branch, that moves 3 ctgov and 5 FEC names (no PSC record writes it).
  • The old flags are refused. The build refuses may_be_name (either value) and may_be_given = true, and the message names the reading to write instead. A particle whose word has no given reading must still state may_be_given = false, and writing false beside a given reading is refused. Check 9 now asks for a given reading.
  • may_be_initial stays a property on the connective reading. It is not derived.

Neutrality, measured against 632685c

The branch is merged with master at b581482 (2.6.0 and #881). Master's code changes since 632685c are docstrings only, and _compiled.py still equals master's, so these hold on the merged tree; the suite and the committed snapshot were re-run on it.

  • build.py --check: current, and _compiled.py is unchanged in the diff.
  • snapshot.py: matches.
  • cldr_agreement.py: all seven records match (CLDR, GND, Wikidata, conventions, Wikidata native, both locale views).
  • snapshot.py --local, with the baselines recorded from a master checkout with --tree: ctgov-officials, fec-individuals and tse-donors all match.
  • local_agreement.py psc-individuals: matches the record.
  • Negative controls: the new mutation rows fail against master's build.py, and the rows the old check already refused still pass there.

Docs

  • nameparser/vocab/README.md: a Derived markers section, may_be_given as a "stated" property, count-less name readings, and the adding-a-word step.
  • decisions/vocabulary-model: a dated 2026-10-25 entry recording how 2a carried out the design entry, and its Standing lines. The Describe each word by its readings: per-word TOML vocabulary compiled to today's sets (phase 1) #737 and Classify the particles in und.toml by language and kind #749 entries are marked superseded in part.
  • Lines made stale by the change: decisions/ma-do and decisions/vocabulary-exclusions (Standing and reference lines), a correction in decisions/C8 (putting sa's credential back now marks it), and the RFC's do example, phase 1 flags line and phase table.
  • AGENTS.md's vocabulary lines.
  • The config-module comments.
  • No release-log bullet: nothing user-visible moves.

Checks

  • uv run pytest, -n0 -m serial, --python 3.15
  • mypy and ruff
  • sphinx-build -b doctest
  • A design-docs review (nine findings, fixed in the second commit), and a second review of that fix (four findings plus the C8 line, fixed in the third)

🤖 Generated with Claude Code

derek73 and others added 4 commits October 25, 2026 01:03
Phase 2a. SUFFIX_ACRONYMS_AMBIGUOUS is now the words with an acronym
suffix reading and a given or family reading, and the particles outside
NON_GIVEN_NAME_PARTICLES the words with a particle reading and a given
reading, wherever in the files the readings sit (build check 11).

The 44 flagged words that lacked one get a name reading, 49 in all,
with counts from tools/name_usage.py (2026-10-25); eight particles that
no source counts carry a required note instead. ld's given count moves
into its credential note, so it stays unmarked. The build refuses
may_be_name and may_be_given = true, naming the reading to write, and
still requires may_be_given = false on a particle whose word has no
given reading. may_be_initial stays a property.

No compiled set moves: _compiled.py rebuilds byte for byte, and the
snapshot, every agreement record, the ctgov, fec and tse local
snapshots and psc-individuals' agreement all match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…ved-markers-b6b331

# Conflicts:
#	docs/design/decisions/vocabulary-model.md
#	docs/design/vocabulary-model-rfc.md
@derek73 derek73 added tooling vocabulary Per-word vocabulary model and language packs labels Oct 25, 2026
@derek73 derek73 self-assigned this Oct 25, 2026
@codecov

codecov Bot commented Oct 25, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.07%. Comparing base (b581482) to head (87733ee).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #883   +/-   ##
=======================================
  Coverage   99.07%   99.07%           
=======================================
  Files          47       47           
  Lines        4781     4781           
=======================================
  Hits         4737     4737           
  Misses         44       44           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@derek73 derek73 added this to the 2.7 milestone Oct 25, 2026
@derek73
derek73 merged commit 2dd0414 into master Oct 25, 2026
12 checks passed
@derek73
derek73 deleted the claude/phase2a-derived-markers-b6b331 branch October 25, 2026 08:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

tooling vocabulary Per-word vocabulary model and language packs

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant