Skip to content

Ask one predicate for every roman-numeral rule (#752, phase 2f) - #886

Merged
derek73 merged 4 commits into
masterfrom
claude/phase2f-numeral-predicate-4299e3
Oct 25, 2026
Merged

derek73 merged 4 commits into
masterfrom
claude/phase2f-numeral-predicate-4299e3

Conversation

@derek73

@derek73 derek73 commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Phase 2f of the vocabulary model (#752): every rule that weighs a roman numeral now asks one predicate, _vocab.reads_as_generation. That predicate reads the vocabulary's own numerals (ii to iv) itself, so no call site copies them. Closes #784, closes #774, closes #819.

What reads differently

Input Now 1.4.0 through 2.6.0
John Smith VI MD suffix 'VI MD' (reported) family 'VI', suffix 'MD'
John Smith VI Jones suffix 'VI Jones' (S8's run) family 'Jones'
Smith, John VI suffix 'VI' (reported) middle 'VI'
John Smith V, M.J., John Smith VI, M.J. suffix 'V' / 'VI' family 'John Smith V' / 'VI'
Georg VI. (GND regnal rows) suffix 'VI.' family 'VI.'
Smith, John PhD I, Jr. middle 'I' (1.4.0 to 2.3.0's reading) suffix 'PhD I, Jr.' in 2.4.0 to 2.6.0
Nguyen Van Vi family 'Van Vi' (Title case leans to the name, reported) suffix 'Vi' in 2.2.0 to 2.6.0

What stays the same: SMITH, JOHN X keeps middle 'X'. A one-letter numeral in the given part after a family comma is the generation only where the vocabulary lists it, which is FEC's constraint. Listed III, Ii and Iii are never weighed, so an initial in front or Title case does not move them.

The three readings Derek agreed (decisions/vocabulary-model, 2026-10-23, item 8)

  1. Should Smith, John PhD I, Jr. keep I as a middle initial, as Smith, John V, Jr. does? #819: a lone letter ending the given part ahead of a further comma is the middle initial. The credential run in front stops short of it. Accepted cost: Smith, John PSM I, Jr. splits a certification level from its credential (rules/C9).
  2. FEC's constraint: an unlisted one-letter numeral in the given part after a family comma stays the initial.
  3. Title case leans to the name: a Title-case numeral in a mixed-case name reads as a name, as a Title-case acronym does.

One reading kept rather than widened — please confirm

John Smith V PhD keeps family 'V'. This is decisions/S10's #721 reading. A one-letter numeral is still read only when it ends the walk; one of two or more letters is read anywhere in the trailing run.

I first read the one-letter numeral with the words-to-spare count in front of a credential too. That moved 6 tse-donors names, and every one was wrong: a lone V or I before JR or JUNIOR that abbreviates a surname (shape Aa A Aa de V JUNIOR gave family 'de', suffix 'V JUNIOR'). Item 8's wording can be read either way.

This leaves John Smith V Ph. D. (today suffix 'V Ph. D.') to the split-credential PR (2e), which has to keep that reading by its own rule.

Measured against master 2af8da8

Measure Result
Committed snapshot 6 existing names move, all intended: 3 GND regnal rows, Smith VI, AD, and #774's two rows. The other new snapshot names are rule examples.
cldr_agreement.py GND family 618 → 621 of 801, suffix 779 → 782. Every other record matches.
PSC, 1,039,171 records scored 3 fixed: Vietnamese names ending in the surname Vi, which the Title-case lean keeps a name. 1 broken: a Title-case Viii written as a generation (S10's Accepted bullet). 1 changed, in a title box the scorer sets aside.
ctgov-officials 1 move: a job title ending in a level before a comma, Aa Aa I, A → suffix 'I', reported.
fec-individuals 22 moves, each a numeral ending the given or the family part (A, A VI → suffix 'VI'). About 14 are generations and about 8 are a middle name or a fragment. All are reported.
tse-donors No moves.

Each local baseline was re-recorded from the master checkout immediately before its check. The cache's snapshot.jsonl is shared, and a sibling session's re-record had once shown its 1,334 joined-credential readings as this change's moves. AGENTS.md now says so.

Spellings swept: V, VI, III, XI, IX, VIII, v, vi, Vi, Ix, Ii, Iii, V., VI., I, X, iii.
Comma shapes: no comma, a full name before the comma, one word before it, nothing before it, and a nickname head.
Under all three orders, with: a title-particle head after a family comma, an initial in front, a maiden clause, trailing titles, and one-case spellings. Two code reviews and a design-docs review ran on top, and a second review of the fix commit.

Remaining split, recorded in decisions/C1: Vega y Lopez V, Mary keeps family 'Vega y Lopez V', where its comma-less twin reads suffix 'V'. The part before the comma joins the connective and the comma-less name does not. Counting a join's words fixed that row but broke Smith and Jones V, Mary, which both spellings join.

Docs

Checks

All pass: uv run pytest, -n0 -m serial, uv run --python 3.15 pytest, mypy, ruff, and the Sphinx doctest build. Frame counts are unchanged on the reference name and Smith, John.

🤖 Generated with Claude Code

derek73 and others added 3 commits October 25, 2026 03:33
Every rule that weighs a roman numeral now asks
_vocab.reads_as_generation, which reads the vocabulary's own numerals
inside it: the trailing peel (anywhere in the run for two or more
letters), S8's run start, C12's evidence, C1's listing form, the given
part's walk after a family comma, the maiden take and tail_reading.

- John Smith VI MD reads suffix 'VI MD' as III MD does (#784)
- John Smith V, M.J. and VI, M.J. keep the numeral as suffix (#774)
- Smith, John PhD I, Jr. reads middle 'I' again (#819)
- Georg VI. and the other GND regnal rows read the suffix
- a Title-case numeral in a mixed-case name leans to the name
- John Smith V PhD keeps family 'V' (#721), measured on tse-donors

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- a numeral declined for its Title case says so, and one a credential
  run in front takes reports as an absorbed name word
- the family part counts its words as C3 does, so 'Vega y Lopez V,
  Mary' keeps suffix 'V' as the comma-less name does
- S10 states that comma sites report only a generation read by shape;
  #819's clause is scoped to a letter written as an initial (T5)
- stale docstrings, Standing lines and the S8 Elsewhere pointer

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…#752)

The second review of the fix commit found that counting a connective
join's words, which fixed 'Vega y Lopez V, Mary', broke the joins both
spellings make ('Smith and Jones V, Mary'). The piece count stands, and
decisions/C1 records the remaining split with case rows for both.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added bug design vocabulary Per-word vocabulary model and language packs labels Oct 25, 2026
@derek73 derek73 self-assigned this Oct 25, 2026
Covers the branch where a credential run in front takes a numeral
the peel declined, which no test reached (Codecov's patch check).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 1f0b07c into master Oct 25, 2026
12 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug design vocabulary Per-word vocabulary model and language packs

Projects

None yet

1 participant