Skip to content

Remove the empty head's own P6 site (#892) - #916

Merged
derek73 merged 2 commits into
masterfrom
refactor/issue-892-empty-head-code
Oct 27, 2026
Merged

derek73 merged 2 commits into
masterfrom
refactor/issue-892-empty-head-code

Conversation

@derek73

@derek73 derek73 commented Oct 27, 2026 •

Copy link
Copy Markdown
Owner

Closes #892 (point 4; points 1–3 landed in #914).

What goes

A search of the pipeline for code that reads an empty part before the comma found one site:

#890's floor for , Dr. fils is not empty-head code. It is rule C4's count of name words before the comma, and a one-word head meets it too (Sir Alexandre, fils).

What moves

Assign now attaches the trailing particle behind an empty head ahead of H1. H1 then finds a family and stands down. That moves the vd/mc tails behind a title that addresses by surname: 112 given parts per order on C15's invariant grid, and one snapshot name.

Name Before After
, Dr. Jones vd family 'Jones', suffix 'vd' given 'Jones', family 'vd', suffix-or-name
, Jones (MA) vd suffix 'MA' nickname 'MA' (its twin's reading; closes decisions/S13's "left as found")
, Dr. Jones vd, PhD (off the grid) family 'Jones', suffix 'vd, PhD' given 'Jones', family 'vd', suffix 'PhD', suffix-or-name
, de PhD vd (off the grid) given 'de', family 'vd', suffix 'PhD', suffix-or-name given 'de', suffix 'PhD vd' (the comma site's P1 guard, which the removed site lacked)

Each now reads as its twin Smith, … does, and as an ambiguous particle already read (, Dr. Jones van → family 'van'). None of the 10 real empty-head names in the local corpora holds a trailing particle.

Docs and tests

  • rules/C15: the vd knock-on leaves the H1 Except; the Precedence bullet says P6 also wins over H1.
  • rules/P6: gains a bullet for the empty head, and its Signal now reads "marked the family's place".
  • decisions/C15 and P6: new entries with SUPERSEDES: lines, and the reversed parts are marked on the old heads.
  • decisions/S13: an Elsewhere: line records the reading that moved.
  • Invariant test: the H1 arm is simplified, with a count of 2889 (was 3225). The negative control was re-taken: still 1,098 failures.
  • Field-sweep claim count: 1393 → 1396.
  • Notes: the case row is renamed and its expectation reversed, and three case notes plus the particle_tail docstring no longer describe the removed site.

Review round (/pr-review-toolkit:review-pr)

Code, comment and test reviewers ran. Fixed in 73da45a:

  • Two moved classes off the grid are now in the table above, in decisions/C15 and P6, and in case rows.
  • Absolute rows pin , Dr. Jones vd Jr. and , Jane van Jr. (FAMILY_FIRST). The twin invariant now compares two readings of one site, so a defect there would move both sides.
  • The H1 count is asserted per order (963 each).
  • Comments: the test_state.py ownership comment is fixed, the rules/P6 quote is now verbatim, _inside_a_credential_run states its precondition, and the guard row was renamed.
  • Lesson added to nameparser/_pipeline/AGENTS.md: when folding one site of a rule into another, compare the two sites' guards.

Not changed: the report detail "joins the family the comma named" still appears behind an empty head. That is wording only, and nameparser/AGENTS.md already records it.

Checks

The design-docs review ran on the change, and all six findings are fixed: stale mechanism notes, the decisions edit-kind format, and rules/P6's scope. The full suite, ruff and mypy pass. On the first run the serial benchmarks failed three wall-clock scaling ratios, the same flake seen on #914; all 43 passed on rerun.

🤖 Generated with Claude Code

rules/C15 reads a comma with nothing before it as a family comma naming
no surname, so P6's attachment behind it is assign's comma site, ahead
of H1. The second site #613 kept in post_rules for that head goes, with
assign's guard that kept the comma site off it and the empty-run guard
in _inside_a_credential_run that only that site could reach.

`, Dr. Jones vd` (and the other vd/mc tails behind a title addressing
by surname, 112 given parts per order on C15's grid) reads given
'Jones', family 'vd', as its twin `Smith, Dr. Jones vd` does, where it
read the comma-less name's family 'Jones', suffix 'vd'. H1's exception
rows fall 1,075 -> 963 per order; `, Jones (MA) vd` reads its twin's
nickname 'MA'. rules/P6 states the empty head; decisions/C15, P6 and
S13 record it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 2.7 milestone Oct 27, 2026
@derek73 derek73 self-assigned this Oct 27, 2026
- Record the two classes the removed site moved off C15's grid
  (`, Dr. Jones vd, PhD`; `, de PhD vd`, which now meets the comma
  site's P1 guard) in decisions/C15 and P6, with case rows.
- Pin `, Dr. Jones vd Jr.` and `, Jane van Jr.` under FAMILY_FIRST
  absolutely: the twin invariant now compares two readings of one site.
- Assert the H1 exception's 963 rows per order, not as a total.
- Rename the empty-run guard's old row; state `_inside_a_credential_run`'s
  non-empty precondition; quote rules/P6 verbatim at assign's site.
- Fix test_state.py's ownership comment and two docstring wraps.
- nameparser/_pipeline/AGENTS.md: compare guards when folding sites.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 119932f into master Oct 27, 2026
12 checks passed
@derek73
derek73 deleted the refactor/issue-892-empty-head-code branch October 27, 2026 19:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Should a comma with nothing before it read as a family comma with an empty family? (, John Smith → given John, middle Smith)

1 participant