Skip to content

Sweep the 3.2 cycle's prose inside the code - #1533

Merged
derek73 merged 5 commits into
masterfrom
docs/prose-sweep-code
Nov 22, 2026
Merged

derek73 merged 5 commits into
masterfrom
docs/prose-sweep-code

Conversation

@derek73

@derek73 derek73 commented Nov 22, 2026 •

Copy link
Copy Markdown
Owner

Part B of the 3.2 release prose sweep (root AGENTS.md's release checklist step 0): the prose inside the code changed since v3.1.0. It covers comments, docstrings, message text and tests/v2/cases.py notes, plus two tests that run the code a message offers. It touches no docs/, no docs/design and no AGENTS.md; what belongs there is listed at the end.

What changed

API docstrings (autodoc renders them):

User-facing messages:

  • A SettingEvidence row's refused vote offered code that does not run there. It offered a mapping ({Signal.FIRST_SURNAME: True}, NameEvidence's shape) where a row takes a triple. Each refusal now offers its owner's shape, (Signal.FIRST_SURNAME, True, 2) for a row, and the patronymic vote the same.
    • A row that is no triple, and a by_signal that is no iterable, were always offered a name_order row, which the two_family_names and patronymic_rules settings refuse. Each is now offered a row whose signal votes on the evidence's own setting, and a setting no signal votes on (initials_as_family, capitals_as_family) is offered by_signal=().
    • Tests evaluate every offered spelling and construct with it, over every signal and setting _SETTING_OF names. The helpers run only inside the raise, so no hot path gains a frame.
  • Lexicon.add's empty pair-list refusal (completes=[]) offered completes=None without saying that clears to the widest reading. It now says what None does for each property. The bare-string refusal's completes=['ذو'] / completed_by=['الله'] and the completed_by=None clearing were unpinned; two new tests run them.
  • One helper writes the article for every a {kind} message: "an alias_marker", "an honorific". A test covers each vowel kind.
  • No warning text changed this cycle. Every other new or changed raise was triggered and reads as the taxonomy asks.

Stage headers: every Reads: line was checked against tools/stage_reads.py for all stages and against a grep of each module. All already match, including #1531's move of bound_long_names_only to post_rules.

Citation comments, brought to quote, clause and pointer:

  • _assign's H6/H10 block, _lexicon's T1 note, _post_rules' O6 block, and _group's N4 pointer. Their examples and history already live in rules/H6, H10, decisions/H9, T1, O6 and N4.
  • Three comments hold measurements no decisions file holds yet: _group's M1 bisect, _extract._overlaps and _vocab's script-sweep note. They are left as they stand on master. Part C moves the figures (below), after which the comments can drop them.

tools/:

  • suggest_measure.py's docstring now lists the thresholds, populations, tables and --base report it has, and the four-flag harness proof. The two-flag form it gave still decides initials_as_family and two_family_names.
  • order_names.py's generated blocks are plural. Its "both tables" error text stays, since a test pins it.
  • The README's CLDR pack list gains nl, ms and my, and its suggester --base sentence is updated.
  • cldr_agreement.py's two pt_PT comments now agree.
  • Also corrected:
    • local_agreement.py's source list (patentsview);
    • local_ctgov.py's "either" of three;
    • build.py's three modules;
    • familiar_wikidata.py's output folder;
    • pt_given_names.py's empty REMOVED.
  • pt_given_names.py --help and es_given_names.py --help printed their first line cut mid-sentence and now print the paragraph.

tests/v2/cases.py notes:

  • 613 notes on the 712 rows that moved this cycle were checked against the 1.4.0, 2.x, 3.0.x and 3.1.0 wheels. The version claims hold.
  • Fixed:
  • parity_check.py: 0 of 811 parity rows read otherwise under 1.4.0, so nothing was relabelled.

Proof

  • Snapshot: tools/differential/snapshot.jsonl is byte-identical to master.
  • Suite: 58,061 passed on 3.11 and 58,061 on 3.15 at 093a07e5 (its own environment); since then, docstrings and new tests only, the 3.11 suite re-run at the head. No test expectation edited.
  • Serial benchmarks: uv run pytest -n0 -m serial passes 41 of 41, so the band holds.
  • Lint and types: mypy and ruff are clean.
  • Doc builds: sphinx-build -b doctest docs has 0 failures, sphinx-build -W -b html docs is clean, and README's doctest passes. test_doc_citations.py passes in the suite.

For part C (docs/, docs/design, AGENTS.md), not changed here

rules/C6's quote in _comma.py (around line 894): the comment holds the quote only, with no clause line. The code under it already reads the widened reach: it asks caps_shape_candidate(..., mixed_case=True), mixed-case credentials included since #1517. The rule line and the quote can move together, and a clause line could join them.

decisions/parse-cost: three measurements still in code comments, held by no entry. Move each into a dated bullet; the comment can then point there instead.

  1. The M1 bisect in _group.py:
    • "(a) " * 3200 (4x the base) measured a 14.1x cost against a 4.1x control under a policy with no maiden_delimiters.
    • Re-measured 2026-08-03 at 11.2x against 4.2x, which is 3.2x against 2.1x per doubling.
    • The lesson: the control says which unit a ratio is in (~4 for 4x the input, ~2 per doubling), possibly for mechanisms.md's Verification shapes.
    • The guard is test_benchmark.py's maiden_pairs shape.
  2. _extract._overlaps: 400 pairs spent 5.4ms against 2.5ms before the closer sweep existed (commit 4e02fa4, 2026-07-19, no recipe). The guards are the delimiter_pairs and unmatched_closes rows.
  3. _vocab's script sweeps: single_script's compiled regex beat per-character range tests by 3-9x at token scale and about 70x on long tokens (a102c86, 2026-07-28, no recipe). Tokenize's separator scan followed in Parse cost could fall by about 18% with no reading moved #1436, whose 2026-11-18 entry could take this as a sentence.

docs/locales.rst, the sentence after the "What each pack carries" table: it says vi is the one pack whose fragment takes readings out, but cs does too (Ing's given-name reading). Suggested: "vi and cs are the packs whose own fragments take readings out rather than adding them."

Labels for the maintainer to weigh (cases.py classifications, not notes; left unchanged):

Smaller, optional:

Reviews

  • Five read-only sweeps (autodoc docstrings, messages, stage headers and citations, case notes, tools docstrings and READMEs), applied above.
  • PR review toolkit, first round (comment-analyzer, code-reviewer, pr-test-analyzer on 624e80b8):
    • Three trimmed pointers sent the reader to a decisions file that does not hold the measurements; those comments are back as on master.
    • The row message offered a name_order row for every setting.
    • The article rule read "a honorific", and two more a {kind} messages had been missed.
    • The completed_by=None clause overclaimed.
    • The completed_by test was vacuous on a dropped reading, and the bare-string test was brittle.
    • The surname1, nickname, ReadingSource.SHAPE and Parser.suggest wording was wider than the behavior.
    • All fixed in 02071bca.
  • Fix commit 02071bca (code-reviewer):
    • The row fallback still offered a name_order row to settings no signal votes on.
    • Two a {kind} messages were left unguarded.
    • The by_signal iterable message was untested, and so were two article sites.
    • All fixed in 093a07e5, with vi.py from part C's report. Its tests fail against the old fallback (4 of 5 settings).
  • Fix commit 093a07e5 (code-reviewer): no code defect; the two newly guarded article sites lacked a test. Tests added in 7414f466.
  • Commit 7414f466 (comment-analyzer, the suggester docstrings from part A):
    • every figure matches docs/suggest.rst and decisions/group-suggestion;
    • FIRST_SURNAME was wider than the code, which reads only the researchers' surname table;
    • NameEvidence promised a first-surname vote where the switch is not weighed.
    • Both fixed in 2ba0c673, comments only, checked against the reviewer's examples.

🤖 Generated with Claude Code

Release checklist step 0, part B, over what changed since v3.1.0. No
reading moves: comments, docstrings, message text and case-row notes,
plus two tests that run the code two messages offer.

- API docstrings: ParsedName.nickname and Role.NICKNAME name the alias
  marker (#1164); surname1 names the family-comma division and W5's Han
  pair; ReadingSource.SHAPE names the mixed-case credential (#1517),
  and capitalized() its force exception; LexiconReading.category lists
  `familiar` and `spelling`; Policy.two_family_names and Parser.suggest
  name the suggester's two-family vote (#1452).
- Messages: a SettingEvidence row's refused vote offered a mapping, the
  NameEvidence shape, where a row takes a triple; each now offers its
  owner's shape, and a test evaluates both. The empty pair-list refusal
  says what `None` clears to; "a alias_marker" reads "an".
- Citation comments trimmed to quote, clause and pointer in _assign,
  _group, _extract, _vocab, _lexicon and _post_rules; the measurements
  they held are listed in the PR body for decisions/parse-cost.
- tools: suggest_measure's docstring lists the thresholds, populations
  and harness proof it has now; order_names' blocks are plural; the
  CLDR pack list, local_agreement's sources, build.py's three modules
  and two builders' cut --help line.
- tests/v2/cases.py notes: release ranges for notes naming a commit or
  "master", a stale fixture quote, abdul's long_names_only reason.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73 derek73 added this to the 3.2 milestone Nov 22, 2026
@derek73 derek73 added docs Documentation fixes and updates internals Refactors and parse cost with no behavior change labels Nov 22, 2026
@derek73 derek73 self-assigned this Nov 22, 2026
derek73 and others added 4 commits November 22, 2026 11:58
- The three measurements no decisions entry holds yet (group's M1
  bisect, _extract._overlaps, _vocab's script sweeps) stay in their
  comments until part C moves them; the pointers had read as though
  decisions/parse-cost held them.
- A SettingEvidence row that is no triple, and a by_signal that is no
  iterable, are offered a row whose signal votes on the evidence's own
  setting (`_ROW_EXAMPLE`), not always a name_order row, which the
  two_family_names and patronymic_rules settings refuse.
- One article helper (`_lexicon._a`) for every "a {kind}" message, with
  honorific's silent h; the completed_by=None clause says it leaves no
  listed word completing the word, which completes_any can still join.
- Docstrings: surname1's family-comma example is under two_family_names;
  the nickname's alias marker is a listed one, @ and urf by default;
  ReadingSource.SHAPE's mixed-case word stands in a mixed-case name;
  Parser.suggest's two-family vote points at where it is weighed;
  suggest_measure's opening names every switch it suggests.
- Tests: the vote test runs over every signal not voting on the order,
  a new test runs every setting's offered row, the article is checked
  per kind, the completed_by clearing is read in a parse with its
  shipped list asserted first, and the bare-string test round-trips.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- A setting no signal votes on (initials_as_family, capitals_as_family,
  any other Policy field) was still offered a name_order row by the
  fallback, which it refuses: it is now told no signal votes on it and
  offered `by_signal=()`, and its by_signal iterable `()`.
- The two remaining "a {kind}" messages (attached on a reading, a phrase
  matching as a kind) take `_a`.
- locales.VI's docstring: CS's fragment removes a reading too (#970).
- Tests: the offered-row test runs both messages over the five settings
  suggest emits, the article test over every kind, the completed_by
  clause's text is pinned, and both signal helpers assert they yield
  rows.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
From part A's report (#1534):
- Parser.suggest's docstring gives the rounded figures docs/suggest.rst
  shows, with no dates; the dated tables stay in
  decisions/group-suggestion, which it names.
- Signal's members say what each signal is and what it votes on, in a
  reader's words, without issue numbers or private table names.
- NameEvidence's docstring says what a vote holds: the order voted for,
  the PatronymicRule, or True or False, as docs/suggest.rst does.

And from the review of 093a07e: the two newly guarded article sites
(attached on a reading, a phrase matching as a kind) each get a test
over every kind that reaches them.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- Signal.FIRST_SURNAME votes True on a surname researchers rarely write
  as a given name, the second of SURNAME's two tables, not on a
  romanized Chinese, Korean or Vietnamese one (`John Wang Smith` casts
  none).
- NameEvidence: a first-surname vote is cast only where
  two_family_names is weighed, not where the base has it on or an East
  Slavic rule is decided.
- Parser.suggest links its figures to the guide's limits section.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@derek73
derek73 merged commit 3f9702b into master Nov 22, 2026
14 checks passed
@derek73
derek73 deleted the docs/prose-sweep-code branch November 22, 2026 20:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

docs Documentation fixes and updates internals Refactors and parse cost with no behavior change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant