Skip to content

Migrate the P rules to the skeleton format (#761, part 4) - #777

Merged
derek73 merged 12 commits into
masterfrom
docs/761-skeleton-p-rules
Oct 20, 2026
Merged

derek73 merged 12 commits into
masterfrom
docs/761-skeleton-p-rules

Conversation

@derek73

@derek73 derek73 commented Oct 20, 2026 •

Copy link
Copy Markdown
Owner

Part of #761.

Migrates P2–P9 in docs/design/rules/ from the block format to the skeleton format (When / Then / Because, then Except / Precedence / Accepted bullets, --- footer), one commit per rule. No rule changes meaning.

  • Examples: every example line is kept verbatim; the per-rule multisets of example lines match master exactly (P2 24, P3 16, P4 6, P5 41, P6 39, P7 6, P8 12, P9 6). P3's two NFD-typed lines (John й Smith, É. y É. Smith) are copied byte for byte. corpus_rules.jsonl and the snapshot do not move.

  • Code quotes: every code-comment quote of P2–P9 still matches (the phrases code quotes were kept verbatim), so no code comment needed retargeting.

  • Size budget: tests/v2/rules_budget.json is re-recorded, one rule's line per commit, each line moving from the block row to the skeleton row.

  • Decisions: one dated bullet appended to decisions/P6 (2026-10-20). P6's block text carried three passages of argument or history. The 52 / 366 draft measurements and the deleted Nguyen Thi Van FAMILY_FIRST line are already in decisions/P6's 2026-08-30 Ménil Christophe de under FAMILY_FIRST drops the tussenvoegsel, and de Mesnil Juan reads Juan as part of the surname #467 entry, so the rule now points there. The test_order_correspondence.py note moves into the new bullet.

  • docs/design/AGENTS.md: axis 13 (the migration check) gains one sentence. A block rule scopes sentences by the paragraph they stand in, while a skeleton field reads rule-wide, so a moved sentence's site has to be written into its lead. This is the trap the third review round found in P6.

Small wording changes (no change of meaning)

  • P3 — (#395, landed) → (#395).
  • P5 — Then names the reserve and its two lifts in a clause ("where the name has a name word to spare or a family comma or a given-name title has lifted that need (below)"). The reserve sentence itself is kept verbatim in the first Then bullet.
  • P6 — Then carries the old rationale's "where something has already named the family and left the particle in a position that means nothing — after a family comma, or in the middle of a FAMILY_FIRST reading", so Because is shorter. "attaches as it did before" → "attaches" (history). The one-case Portuguese clause moves from the statement to an Accepted bullet with its example (SMITH, JOHN DO). The do / vd / mc report split and the several-word run's report move into the Then "What reports" bullet, and the mc-inherits cost stays Accepted. The old "every other spelling of such a word attaches" sentence, which followed all three stand-downs, is now the first sentence of that bullet and names its word (do) and the two stand-downs that can reach it (S6, S7). When says "trailing words that hold no name behind it aside", matching the run bullet. Two · boundary inputs where no particle ends the name (Maria Luisa y de la Cruz, de Anke van y) are in the main fence.
  • P8 — "HumanName.initials() re-derives the conjunction decision instead of honoring the parse's tags: john e smith gives j. s. from the facade and j. e. s. from parse() #528 closed the split and decisions/P8 records it" → "(decisions/P8, HumanName.initials() re-derives the conjunction decision instead of honoring the parse's tags: john e smith gives j. s. from the facade and j. e. s. from parse() #528)". The Cyrillic example moves from the end of the Accepted clause to the bullet about Cyrillic capitals.

Old interacts: IDs

Rule Named in the rule now Dropped, and why
P2 P1, P4, M2, S2, S4, S6, S10 H5: H5's own Accepted clause states that a particle chain stops in front of the trailing title run; P2's old text never named it. C2: no chain in a tail part is C2's own bullet ("no particle chain (P2) is made in it"). P9: P9 cites P2's join itself; P2's text says nothing of P9.
P3 H1, P1, M2, C3, C10, S10, T4, P8 (+ N1, M1 from the text) R1, C7: each names P3 in its own text (R1's render, C7's title-word join); P3's old text named neither. C4, C6, S6: the shared case span is P8's to state ("the suffix slot (S6) and the post-comma slot (C4, C6)"), and P8 still does.
P4 P1, H2, H3 (+ O4 from the text) P5: P5 states its own precedence over P4 ("the join outranks the leading-position reading (P4)").
P5 C2, S2, M2, H1, H5, P2, P4, P6 (+ H3, S10 from the text) none
P6 S2, S4, S6, S7, P5, P9 (+ R2 from the text) P1, C7, C11, H5: each names P6 in its own text; P6's old text named none of them. A1, C1, M2: noise. Nothing in P6 reads them beyond "a family comma", which is C1's structure, and A1's general report contract.
P7 P1, P2, P6, T5 (named in the every-position bullet) P3: one-letter connectives are P8's subject, not P7's. R3, R4: an initial's render follows from its role; R3 and R4 state it.
P8 P3, T4, M2, R3, R4, S10, S6, C4, C6 M4: noise. The marker's effect on the case span is M2's, and M4's lone-word family reading never meets the letter.
P9 P6, S4, H5, T4 P2: a deliberate drop. P9's before-the-comma clause came from P2 in the 2026-10-19 split, and P9 states it without leaning on P2's join (the code comment's "as P2's join does" is the code's analogy). S2, S6, S7: the old text names none of them. "whatever case" is the rule's own point, and S7's company is P6's stand-down, named in P6's Precedence.

Rules that look wrong

None was changed. One observation for Derek, not fixed here because the old text never covered it:

  • Under FAMILY_FIRST, the no-comma site gives do two reports. Doe John Do (family-first) reads family 'Do Doe' and reports both suffix-or-name ("read as a family name rather than a post-nominal") and particle-or-given. Doe, John Do reports only particle-or-given. Old P6 stated the single particle fork for the comma site only, so the rule is silent on the family-first case, and the migration now scopes that sentence to the comma site. Whether one token should carry both reports there is open; it looks like A1's one-report-per-decision territory.

Verification

  • uv run pytest (full), uv run mypy and uv run ruff check pass.
  • The docs-review agent ran twice. Round 1 found five things, all fixed in the first fix commit: P6's "every other spelling attaches" sentence placed where the S7 bullet contradicted it; P6's When excluding post-nominal shapes; a comma-only lead on the post-nominal bullet; P4's "this is why" pointing at the wrong cause; two out-of-When boundaries in a Then fence. Round 2, on that fix commit, found three more in P6, all fixed in the second: the moved sentence had lost its subject and claimed every ambiguous credential attaches (Doe, John Ma does not); it listed P9, which never reaches do; When still left out trailing titles (Beethoven, Ludwig van Prof.).
  • A third round (/pr-review-toolkit:review-pr: code-reviewer plus a prose-vs-parser accuracy pass) found that four P6 clauses master had scoped to the comma site by their paragraph read as rule-wide in their skeleton fields, and the family-first site falsifies each: the S2 precedence (Berg Jan vd under family-first keeps suffix 'vd'), the do / vd / mc report sentences, and the only-given-word guard. Conversely, R2's base guard, master's family-first clause, read as covering the comma site (van, Jan de attaches). Each lead now names its site. Also fixed: the post-nominal bullet now carries the Berg Jan de Jr. lines that show a post-nominal; P5's abdul V Smith (where the join fires) moved out of an Except fence; and P5's vd/mc Except now states its scope in the lead.
  • Kept by choice (round 1, finding 6): P3's two single-letter carve-outs stay inside Then's sentence rather than becoming Except bullets, because code quotes that whole sentence verbatim (_group.py, _pieces.py). Its boundary Juan y Garcia stands under the carve-out's Then bullet.

🤖 Generated with Claude Code

derek73 and others added 10 commits October 20, 2026 00:42
Then states the join and its four ends; the chain's start, where a
trailing suffix begins (S2's read, S10, S6), the Title-case acronym
joining (S4) and P1's fold become Then bullets, each carrying the
examples it explains. The three Accepted clauses become Accepted
bullets. Every example line is kept verbatim; every code quote of P2
still matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Then states the join with its two single-letter carve-outs, verbatim.
The one-name-word count (with H1 and P1 as its witnesses), the
three-word carve-out's letter count and NFD clause, the connective
count, the generational-connective condition, the declared separator
(C10) and the own-words span become Then bullets, each carrying the
examples it explains. The two NFD example lines are copied byte for
byte. Every code quote of P3 still matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Then states that a leading particle chains nothing, verbatim. The
title and the unlisted abbreviation before it become Then bullets;
the title-particle that moves the leading position onto itself (#624)
becomes the Except bullet, with its two Freiherr St examples. Every
example line is kept verbatim; both code quotes of P4 still match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Then states the join under its reserve. The reserve with its two
lifts (family comma, given-name title, with H1's title-run clause),
the words to spare (S2/H5 read once, S10, the ambiguous acronym, the
unmoved suffix reading), the marker's words, the comma's no-peel
reserve and the title or particle joining as a name word become Then
bullets. What the join never absorbs and the vd/mc decline become
Except bullets. The P4, suffix-vocabulary and P6 orderings the old
text stated become Precedence bullets; the three Accepted clauses stay
Accepted. Every example line is kept verbatim; every code quote of P5
still matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Then states the attachment where a family comma or a FAMILY_FIRST
reading has named the family, keeping the quoted 'attaches to that
family name and is written before it'. The comma site's run, the
elided and hyphenated particles, the no-comma family-first site, the
word-blindness, the nothing-named reading and the report kinds become
Then bullets. The only-given-word guard and R2's base become Except
bullets; the S2 precedence and the three stand-downs (S6, S7, P9)
become Precedence bullets. The Accepted clauses stay Accepted, the
one-case Portuguese reading joining them. The order-correspondence
note moves to a dated decisions/P6 bullet; the 52/366 draft and the
deleted FAMILY_FIRST line were already its 2026-08-30 entry. Every
example line is kept verbatim; every code quote of P6 still matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Then states the period's reading, verbatim. Every-position becomes a
Then bullet naming the three rules it stops (P1, P2, P6); the bare
accented initial stays the Accepted bullet. Every example line is kept
verbatim; both code quotes of P7 still match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Then states when the letter reads as an initial, verbatim. Never
joining (P3), what reports, the shared case span (S6, C4, C6), the
letter count with the caseless and Cyrillic letters, the marked set
by tradition and the derived views (R3, R4, the facade) become Then
bullets; the Cyrillic example moves under its bullet. The parity
breaks and the declined-marker clause stay Accepted. Every example
line is kept verbatim; both code quotes of P8 still match.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Then states that the neighbors, not the case, decide, on both sides of
the family comma. The before-the-comma heading, the lone letter behind
it (T4) and the post-nominal run after the comma (H5, S4) become Then
bullets; the suffix reading before the comma and P6's attachment after
it become Except bullets, each with its boundary. Every example line
is kept verbatim; the code quote of P9 still matches.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
P6: the 'every other spelling attaches' sentence moves from the S6
Precedence bullet, where the S7 bullet after it contradicted it, into
the What-reports bullet, naming all three stand-downs. When no longer
says 'nothing after it', which put the post-nominal shapes outside the
rule, and the post-nominal bullet's lead drops 'After a family comma',
since the family-first site looks past one too (Berg Jan de Jr.). The
two boundary inputs where no particle ends the name move to the main
fence. P4: the title-transparency bullet says again that chaining
nothing is the cause of both facts, as the old 'This is why' did.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
P6's What-reports sentence names the word it is about again (a
particle that is also of the ambiguous credential class, do), since
without it the sentence claimed every ambiguous credential attaches
(Doe, John Ma does not), and lists only S6 and S7, P9 never reaching
do. When looks past every trailing word that holds no name, titles
included (Beethoven, Ludwig van Prof.), as the bullet it points to.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added docs Documentation fixes and updates design labels Oct 20, 2026
@derek73 derek73 self-assigned this Oct 20, 2026
@codecov

codecov Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 99.05%. Comparing base (a0edfed) to head (a64a0a5).

Additional details and impacted files
@@           Coverage Diff           @@
##           master     #777   +/-   ##
=======================================
  Coverage   99.05%   99.05%           
=======================================
  Files          47       47           
  Lines        4642     4642           
=======================================
  Hits         4598     4598           
  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 and others added 2 commits October 20, 2026 01:05
P6: four clauses master scoped to the comma site by their paragraph
read as rule-wide in their skeleton fields, and the family-first site
falsifies each: the S2 precedence (Berg Jan vd, family-first, keeps
suffix vd), the do / vd / mc report sentences (Doe John Do,
family-first, reports suffix-or-name too), and the only-given-word
guard; and R2's base guard, the family-first paragraph's, read as
covering the comma site (van, Jan de attaches). Each lead now names
its site. The post-nominal bullet carries the Berg Jan de Jr. lines
that show a post-nominal; the general comma examples move to the main
fence. P5: abdul V Smith, where the join fires, leaves the Except
fence for the main one, and the vd/mc Except names its scope in the
lead.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Axis 13 now says a block rule scopes sentences by their paragraph and
a skeleton field reads rule-wide, naming #777's five P6 clauses and
the two inputs that falsified them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit fb0b5a2 into master Oct 20, 2026
12 checks passed
@derek73
derek73 deleted the docs/761-skeleton-p-rules branch October 20, 2026 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

design docs Documentation fixes and updates

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant