Repository navigation
Commit 505d6de
Check rule citations in every shape, ledgers included; fix the stale ones (#632)
* Check ledger rule citations as verbatim excerpts, fix the stale ones
test_citations_are_verbatim_excerpts swept only *.py, so the
`# rules.md#X: "..."` comments in tools/differential/expected_since_*.toml
-- which AGENTS.md puts under the same excerpt discipline -- were
checked by nothing; #631's review found five stale by hand. The sweep
now reads the ledgers too. They are not "citing modules":
test_implemented_matches_citing_modules still counts .py files only.
Two scanner corrections the ledgers were the first input to reach:
- a decisions.md#X citation was looked up in rules.md's statements
(the regex accepted the doc name and dropped it), so a decisions.md#P6
quote was checked against rules.md#P6. It now must name a real
decisions entry, and a quote OPENING it must be verbatim in that
entry; a paraphrase pointer stays legal, the entry being a record
rather than a statement.
- an excerpt may elide with "[...]"; each fragment must be verbatim
and in order.
The fifteen failures (five citations, copied across ledgers):
- H5 and S2 (1.4.0) quoted Accepted clauses; now quote statements that
carry the same claim.
- C1's "The part is read as its words stand" is now a longer sentence.
- 2.2.0/2.3.0 S2 paraphrased with no quote; now quotes the sentence.
- T3 paraphrased a mechanism that is not there: '王·Smith' is one word
(the dot has a Latin neighbour) and '王Smith' reads the same; it now
cites T3 and W4 for why no script order applies.
Adds a reach assertion so a glob matching nothing cannot pass the
excerpt test vacuously, and an elision-order test.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Read every citation shape the tree writes; fix what that exposes
The first commit checked only the colon form's first quote, and the
review of #632 found the rest of the class: `rules.md#X -- "..."`,
`rules.md#X's Accepted clause ("...")`, `rules.md#S2 consumes "..."`
and a second quote chained by "and" all passed unread, 23 of them
stale. The scanner now:
- reads a quote after the ID in any of those shapes (_LEAD_RE), and
every quote chained to it; a reference with no quote must still
name a real rule, section, mechanism or decisions entry
- quotes against a rule's statement AND its Accepted: clauses (example
and pointer lines excluded), a section letter's Background
(`rules.md#H Background`), a decisions entry's text
- matches lowercase decisions keys, merges the `### differential-
ledger, ...` arc headings onto their one key, rejects empty "[...]"
fragments, reads `--` as the em dash and a nested ' as ", follows
`#:` comment continuations and IDs wrapped at a hyphen
- skips this module's own illustrative comments
- records the retired excerpts as a negative control, and asserts the
sweep reaches each shape (non-colon, chained, decisions, elided)
The colon form alone still defines a citing module for implemented:.
Fixed: P5 (the reserve's numeral clause and the join-after-the-run
wording, #614), P2 (S2's once-read run), M2 (#601 replaced the walk
with the clause-free trailing run; the 'Jane Doe Jr. nee Smith Ma'
paragraph gains a dated note that #601 moved it to fix(#601/#602)), S2
("OPENS THE STRING"), A1's segmenter clause, a decisions.md#S2 citation
of rules.md#S2's Accepted clause, and four ledgers crediting AGENTS.md's
"a reader would hesitate too" to rules.md#A1. Four ledgers' paraphrase
of decisions.md#S2 now quotes its headline and names #544's second
exception. With Accepted text quotable, the first commit's H5 and S2
rewrites go back to the original, more exact Accepted-clause quotes.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Fix #632's second-round review: reach, controls, stale prose
Scanner (tests/v2/test_doc_citations.py):
- a section's Background is read whole, not its first line; a wrapped
no-boundary: marker's continuation lines are no longer quotable
- each citation records its lead, and the reach test asserts every
lead shape is live ('s, parenthesis, dash, bare words) rather than
any one of them; a new test pins what is quotable (an Accepted
clause, a Background's wrapped line) and what is not (an example
line, a no-boundary: continuation)
- the docstring states the limits: case folds, and a quote more than
four words from its ID and chained to nothing is not checked -- the
measured alternative, every quote in the paragraph, flags 139, nearly
all names written in double quotes
- _RETIRED_EXCERPTS drops its P6 row (no version ever routed a
decisions quote to a rule) and says which direction it guards
Ledgers: fourteen stale quotes the check does not reach, found by the
review -- C1's paired-initials sentences in all five (#563 made the
speaking word an UNAMBIGUOUS suffix), N3 in three, P2 in one. Dated
landing paragraphs for P2 (#424) and P5 (#425) now say they describe
the rule as it then stood instead of quoting today's text as their
reason; the M2 rule's opener names all four names #601 moved, not one.
AGENTS.md: the count is measured, not summed from commit messages --
27 stale quotes and 5 quoteless colon citations, the current check
over e4b653a -- and the sentence states the four-word reach.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
* Name the count's comparator by its master commit
e4b653a lived on #631's branch, which the squash merge leaves to be
deleted; 8e6e524, master after #631, has the identical tree.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>1 parent 6185e6f commit 505d6de
9 files changed
Lines changed: 623 additions & 349 deletions
File tree
- nameparser/_pipeline
- tests/v2
- pipeline
- tools/differential
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
715 | 715 | | |
716 | 716 | | |
717 | 717 | | |
718 | | - | |
719 | | - | |
720 | | - | |
| 718 | + | |
| 719 | + | |
| 720 | + | |
721 | 721 | | |
722 | 722 | | |
723 | 723 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
426 | 426 | | |
427 | 427 | | |
428 | 428 | | |
429 | | - | |
| 429 | + | |
430 | 430 | | |
431 | 431 | | |
432 | 432 | | |
| |||
0 commit comments