Repository navigation
Replace the differential ledgers with a committed snapshot (#664) - #666
Merged
Merged
Conversation
tools/differential/snapshot.py records one line per (name, order) across every corpus*.jsonl: the seven role fields, ambiguity kinds and initials() on the 2.0 surface, plus the facade's fields where they differ. tests/v2/test_snapshot.py fails on drift and prints the moves grouped by which fields changed; --since REF compares against the snapshot at a git ref, --tree PATH reads with another checkout. Measured 2026-10-12: 3,422 readings, 495 KB, ~1.1s test. Run before and after #655, it reports five moved names where that PR spent 241 lines on ledger and guard edits. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-harness-review-138733
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Deletes the six expected_since_*.toml ledgers and tests/v2/test_ledger_guards.py. The snapshot (tools/differential/ snapshot.py and tests/v2/test_snapshot.py) is now how a change shows which corpus names it moved: the PR diff of snapshot.jsonl. compare.py keeps the released-wheel runner and its checks against a comparison of one tree with itself (version tell, path checks, stripped PYTHONPATH), and prints the moves grouped by changed fields through snapshot.py's row format and grouping. It classifies nothing and exits 0. Corpus-line validation moved into snapshot.py, so both tools read the corpora through one loader. With the contract/radar tiers gone, the CJK corpus is one file again (corpus_cjk_tolerated.jsonl folded into corpus_cjk.jsonl, same 153 names) and build_rules_corpus.py stops skipping tolerated rules' examples (8 W3 texts the CJK corpus already held); the snapshot is unchanged by both. The corpus-generation pins move to tests/v2/test_corpora.py, the phrase-entry storage test to test_lexicon.py; test_doc_citations.py stops sweeping ledger comments and tests the lead forms only the ledgers exemplified directly against the grammar. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
tools/differential/README.md keeps the invocation traps and corpus provenance and drops the ledger, tier and roster sections (995 -> ~400 lines). AGENTS.md's Release-log claims paragraph now draws claims from `snapshot.py --since <tag>` (or compare.py for a tag older than the snapshot), and release checklist steps 1 and 8 shrink to reading that report and moving DEFAULT_BASELINE. docs/design: a decisions.md entry records the retirement with its measurements and accepted costs; mechanisms.md keeps the headings decisions.md cites but marks LEDGER-RULE-SEPARATION, CROSS-RULE-OUTCOME-PINS and SENTINEL-SET-OVER-MATCH-CHECK retired, moves RECORDED-ROSTERS' exemplar to the snapshot, and drops the ledger-only field note; rules.md's tolerated-marker paragraph and two W3/S3 passages stop describing a radar tier. compare.py regains --corpus (now a path list through snapshot.py's loader), which docs/migrate.rst offers users for their own names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…on (#664) - snapshot.py checks that the tree side is a source package (check_source, shared with compare.py's _check_tree); --tree used the weaker under-the-root test, which an ancestor of the checkout passed while the import fell through to the checkout itself. - compare.py reports how many entries it compared and how many order-bearing ones it skipped below 2.0.0 (788 at 1.4.0). - The four build_issues_corpus.py harvester tests, deleted with the old test_differential.py, return in test_corpora.py. - --since on a ref with no snapshot says so instead of a traceback. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…iers (#664) - decisions.md: the share recipe names its head (04cc081) and its exact exclusions; 21% not 20%; #655's ledger and guard edits were 236 lines, not 241 (the other 5 were corpus data); the per-PR spread is stated as measured (0-82%, median 11%, above 30% on 11 of the 29 commits touching nameparser/) instead of "30-60%". - AGENTS.md and mechanisms.md named _EXCLUSION_EFFECT, deleted with the guards, as the recorded-negative-control exemplar; it is _UNGUARDED_EFFECT now. - rules.md S2, C1 and C2 argued against example lines from the cost of entering the enforced corpus; the reason now given is the promise an example would make. - Both tools print how many moved names only corpus_cldr.jsonl holds, which a release figure counts out. - Stale tier/roster mentions in _script_segment.py and cases.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…664) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
- only_in's test now holds a name CLDR shares with another corpus (マイケル), so the subtraction is exercised; without it, dropping '- others' passed every test. - compare.py's CLDR-only count is asserted, at 0 and at 1. - --since names both causes of a missing snapshot (unknown ref, or one from before the snapshot). - A stale 'the gate witnesses it' comment in test_group.py. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #666 +/- ##
=======================================
Coverage 99.02% 99.02%
=======================================
Files 46 46
Lines 4534 4534
=======================================
Hits 4490 4490
Misses 44 44 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #664.
The differential ledgers were built to show that 2.0 changed nothing against 1.4 except listed fixes. They did that job. As a standing check, every parser change had to be classified once per ledger, and the guards policing the ledgers grew longer than the ledgers. This PR replaces them with a committed snapshot of how the tree reads every corpus name.
What changes
The snapshot.
tools/differential/snapshot.pywritessnapshot.jsonl: one line per (name, order) across everycorpus*.jsonl. Each line holds the seven role fields, ambiguity kinds andinitials(), plus the facade's reading where it differs (3 names today).tests/v2/test_snapshot.pyfails on drift and prints the moved names grouped by changed field. A change that moves readings re-records the file, and its diff in the PR is the list of names it moved.--since <ref>compares against the snapshot at a tag, for release notes.--tree PATHreads with another checkout.compare.pystays, unclassified. It is down from 3,732 lines to about 400.PYTHONPATH).corpus_cldr.jsonlholds. It always exits 0, and--corpus PATHstill compares a file of your own names.Deleted:
expected_since_*.tomlledgerstests/v2/test_ledger_guards.pyWith the tiers gone, two simplifications followed. Neither changes the snapshot:
corpus_cjk_tolerated.jsonlfolds back intocorpus_cjk.jsonl(same 153 names).build_rules_corpus.pystops skipping tolerated rules' examples (8 W3 texts, which the CJK corpus already held).Kept, unchanged: the CLDR agreement ratchet.
Tests that guarded surviving code moved:
tests/v2/test_corpora.py.test_lexicon.py.Docs:
tools/differential/README.mddrops from 995 lines to about 400.snapshot.py --since(orcompare.pyfor a tag older than the snapshot).Measurements
These replace the figures in the issue description, which were partly wrong; the correction is posted on #664.
nameparser/, the share runs from 0% to 82%, median 11%, above 30% on 11.Accepted costs
compare.py --baseline 1.4.0, 808 of 2,635 compared entries move today), not a gate at every release.Review
snapshot.pydidn't check whichnameparserit imported, that--treeused a weak path check, thatcompare.pyskipped entries without saying how many, and that four harvester tests had been deleted. All fixed.Test plan
uv run pytestpasses: 16,624 passed, 110 skipped, 3 xfaileduv run ruff checkanduv run mypyare cleansphinx-build -b htmland-b doctestare cleancompare.pyruns against the real 1.4.0, 2.0.0 and 2.4.0 wheelssnapshot.py --treeagainst Keep a comma inside a delimited nickname or maiden clause (#653) #655's parent and Keep a comma inside a delimited nickname or maiden clause (#653) #655 reports the five moved namesFollow-up: cut 2.4.1 after this merges, so a release tag carries the first snapshot.
🤖 Generated with Claude Code