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
@derek73 derek73 added this to the 2.7 milestone Oct 27, 2026
@derek73
derek73 deleted the claude/phase2f-numeral-predicate-4299e3 branch October 28, 2026 02:21
derek73 added a commit that referenced this pull request Nov 5, 2026
…s pool as built piecemeal

P9 gains its fenced example with a deviates marker (#886 moved the
reading in 2.7); O6's Open line carries the ñ question alone; the
vocabulary-model Standing line no longer reads phase 2's one pool as
pending. Also a test of a 2.x replace on an edited lexicon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
derek73 added a commit that referenced this pull request Nov 5, 2026
* Sweep migrate.rst and README for 3.0: the 1.4 readings 3.0 moved, 2.8.2's warnings

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Sweep the 3.0 docs, docstrings, stage headers, case notes and design docs for stale prose

User docs, autodoc docstrings and messages, the pipeline stages'
Consumes/Produces/Reads lines and ParseState's ownership map, the notes
in tests/v2/cases.py, docs/design/ and the AGENTS.md files and vocab
README, each read against the 3.0 tree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the design-docs review's findings on the sweep

H9's Precedence modifier clause in 3.0 terms (a caller's other title
reading), decisions/H9's pointers to the entries that hold its claims,
and vocabulary-model's phase 3 line in the shipped tense. H9's budget
record re-recorded, 778 -> 784 words: the clause reads no new signal.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Apply the decisions on #1079's open items

Translate a 2.x removal without rewriting another file's reading (ma's
Filipino same_as) and offer a bare Lexicon() call's fix on a lexicon it
names, each with a test that runs the offered code; retarget the .pyi
stub and the reserved vocabulary names to unbuilt, 3.x; give the API
reference's undocumented members docstrings and mark every 3.0 member
'Added in 3.0.'; state locales.rst's promise as the gate tests it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Track P9's deviation as #1080, O6's ñ question as #1081, and phase 2's pool as built piecemeal

P9 gains its fenced example with a deviates marker (#886 moved the
reading in 2.7); O6's Open line carries the ñ question alone; the
vocabulary-model Standing line no longer reads phase 2's one pool as
pending. Also a test of a 2.x replace on an edited lexicon.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Record the 3.x retargets as dated entries and fix the reviews' findings

Log entries for the .pyi stub (3-0-reevaluations) and the reserved
vocabulary names (vocabulary-model), with the Standing lines and the
RFC pointed at them; P9's one-case shape fenced under #1080 too; the
phase 2 pool line restated to match the entries that record it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Add P9's two new examples to the rules corpus and the snapshot

Two names new to the corpus, no reading moved.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Decline a per-region list or selection rule for Peru (decisions/O6)

A dated entry answers the question the #961 review and the #1061 entry
left Open above, on the figures those entries already record.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the review's findings on the Peru decline (decisions/O6)

Name the three passages that point at the Open line, say what cut it,
add the one per-region list figure on record, and scope the measure
bullet to the switches it measured.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Widen the 2026-11-05 decline to every Spanish-speaking country but Argentina (decisions/O6)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

* Fix the review's findings on the widened decline (decisions/O6)

The switch figure is the maximum over every Spanish group, Peru's; the
per-country-list finding is cited; the measured population is stated.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
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