test(fixtures): the STS fixtures and fixture codes are fictitious
Three STS fixtures still carried the section titles and labels of one real reference document, and three identifiers were copies of its codes with a letter or a word swapped. They now describe an invented kitchen counter and cookbook series: the titles, labels and descriptions of sts-identity.xml, sts-inherit.xml and sts-empty-label.xml, the P350/P351 document codes, the 99-0001 delivery prefix and chapter 7 of the image and accounting corpora. Generated fixtures are regenerated and the witness inventory's per-document totals are identical before and after; only names and text move. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
parent
5359394a4f
commit
88cf67f12e
65 changed files with 396 additions and 390 deletions
|
|
@ -1,24 +1,24 @@
|
|||
"""A structure the publisher DECLARED takes the route declared structure takes.
|
||||
|
||||
MEASURED, AND THE MEASUREMENT IS THE WHOLE REASON THIS FILE EXISTS. Round 13
|
||||
gave `.xml` a reader that emits **2 761 of 2 761** ATX lines for a reference
|
||||
standard's titled `<sec>` elements, with the text preserved exactly. At SHIPPED DEFAULTS the
|
||||
build then delivered **23 concepts and 15 of 2 761 boundaries** -- everything
|
||||
gave `.xml` a reader that emits **N of N** ATX lines for a reference
|
||||
standard's N titled `<sec>` elements, with the text preserved exactly. At SHIPPED DEFAULTS the
|
||||
build then delivered **23 concepts and 15 of N boundaries** -- everything
|
||||
after the reader ate it. Two steps, each measured on that document and
|
||||
reproduced in miniature by `sts-container.xml`:
|
||||
|
||||
- the **orphan check** removes a heading with nothing under its own first line.
|
||||
It took **710 of 2 761**, and 710 of 710 removed headings are followed
|
||||
It took **710 of N**, and 710 of 710 removed headings are followed
|
||||
immediately by another heading while **0 of 2 051** delivered ones are: they
|
||||
are container sections, not false positives. The check asks whether a GUESS
|
||||
was a heading, which is the wrong question for a section a publisher named.
|
||||
- **Arm F** (`--unit-fold`, a build default) folds every level deeper than the
|
||||
shallowest repeated one into its parent. It took **2 066 more**, 2 089 -> 23,
|
||||
because a process code whose chapters are all `14.121 ...` reads as a unit
|
||||
because a reference standard whose chapters are all `14.121 ...` reads as a unit
|
||||
sheet.
|
||||
|
||||
`find_candidates` already skips both for `outline_marks`, the PDF bookmark arm
|
||||
-- which is why that arm reaches 2 762. This file pins the same route for the
|
||||
-- which is why that arm reaches N + 1. This file pins the same route for the
|
||||
one type whose reader KNOWS the structure because it wrote the heading itself,
|
||||
under its OWN rule name, so an artifact still says which of the two a boundary
|
||||
came from. Nothing else may move: the rule is reached only from the `.xml` row.
|
||||
|
|
@ -59,7 +59,7 @@ def test_the_reader_reports_the_line_every_declared_section_landed_on() -> None:
|
|||
"""No bridge, and that is the difference from the PDF arm.
|
||||
|
||||
The PDF arm has to map (page, `/XYZ` top) onto a line index and was wrong
|
||||
on 1 840 of 2 762 under the naive rule. Here the reader WROTE the line, so
|
||||
on 1 840 of N + 1 under the naive rule. Here the reader WROTE the line, so
|
||||
the index is the one it appended at -- asserted against the text itself
|
||||
rather than against a count, because a mark naming the right title at the
|
||||
wrong offset passes any count.
|
||||
|
|
@ -92,7 +92,7 @@ def test_a_declared_section_is_a_rule_of_its_own_and_not_the_bookmark_arms() ->
|
|||
|
||||
|
||||
def test_a_container_section_survives_where_the_orphan_check_deletes_it() -> None:
|
||||
"""710 of 2 761 on the reference standard; 1 of 9 here, and it is the chapter above the rest."""
|
||||
"""710 of N on the reference standard; 1 of 9 here, and it is the chapter above the rest."""
|
||||
text = extract.extract_text(CONTAINER.name, CONTAINER.read_bytes())
|
||||
marks = extract.xml_outline(CONTAINER.name, CONTAINER.read_bytes())
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue