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:
Kjell Tore Guttormsen 2026-09-23 14:50:44 +02:00
commit 88cf67f12e
65 changed files with 396 additions and 390 deletions

View file

@ -63,7 +63,7 @@ from pathlib import Path
fixtures = Path({fixtures!r})
w.witness_inbox(fixtures / "corpus")
w.witness_inbox(fixtures / "rejected")
w.pdf_poppler(fixtures / "corpus" / "kapittel-84-tabell.pdf")
w.pdf_poppler(fixtures / "corpus" / "kapittel-7-tabell.pdf")
print(sorted(m for m in sys.modules if m.split(".")[0] == "llm_ingestion_okf"))
"""
@ -126,7 +126,7 @@ HAND_COUNTS = {
},
"krav-rikt-tekstformat.rtf": {"cell": 56, "image": 0, "paragraph": 3, "table_row": 24},
"bilde.rtf": {"cell": 0, "image": 1, "paragraph": 2, "table_row": 0},
"kapittel-84-sts.xml": {
"kapittel-7-sts.xml": {
"cell": 0,
"citation": 0,
"figure": 0,
@ -191,8 +191,8 @@ HAND_COUNTS = {
"logg.txt": {"line": 4, "paragraph": 3},
"mengder.csv": {"cell": 6, "header_cell": 3, "row": 2},
"parametre.json": {"key": 6, "value": 6},
"kapittel-84-tabell.pdf": {"image": 2, "page": 1},
"kapittel-84-web.html": {
"kapittel-7-tabell.pdf": {"image": 2, "page": 1},
"kapittel-7-web.html": {
"cell": 0,
"heading": 1,
"image": 3,
@ -200,7 +200,7 @@ HAND_COUNTS = {
"paragraph": 3,
"table": 0,
},
"kapittel-84-notat.docx": {
"kapittel-7-notat.docx": {
"cell": 0,
"comment": 0,
"endnote": 0,
@ -212,7 +212,7 @@ HAND_COUNTS = {
"table": 0,
"text_box": 0,
},
"kapittel-84-presentasjon.pptx": {
"kapittel-7-presentasjon.pptx": {
"cell": 0,
"hidden_slide": 0,
"image": 1,
@ -292,8 +292,8 @@ def test_a_fenced_heading_is_not_a_heading_to_the_witness() -> None:
def test_the_sts_image_reference_resolves_through_the_graphics_directory() -> None:
inventory = witness.witness_file(gate.CORPUS, gate.STS_FIXTURE)
assert [ref.target for ref in inventory.images] == [
"graphics/tabell-84-2.png",
"graphics/figur-84-1.png",
"graphics/tabell-7-2.png",
"graphics/figur-7-1.png",
]
@ -559,9 +559,9 @@ def test_a_document_cannot_forge_a_conversion_claim(tmp_path: Path) -> None:
other = "0" * 64
arms = {
"plain body text": f"{pointer}\n\nKapittel 84. {clause}. Se figuren over.\n",
"a table cell": f"{pointer}\n\n| Krav | Kilde |\n| --- | --- |\n| 84-1 | {clause} |\n",
"a figure caption": f"{pointer}\n\nFigur 84-1 -- {clause}\n",
"plain body text": f"{pointer}\n\nKapittel 7. {clause}. Se figuren over.\n",
"a table cell": f"{pointer}\n\n| Krav | Kilde |\n| --- | --- |\n| 7-1 | {clause} |\n",
"a figure caption": f"{pointer}\n\nFigur 7-1 -- {clause}\n",
"a fenced code block": f"{pointer}\n\n```\n{clause}\n```\n",
"link text with a URL": f"{pointer}\n\n[{clause}](https://example.invalid/x)\n",
"the clause with non-breaking spaces": f"{pointer}\n\n{nbsp_clause}\n",
@ -652,12 +652,12 @@ def test_the_build_never_writes_a_claim_the_document_supplied(tmp_path: Path) ->
after = gate._sha256(real)
clause = f"converted from image/bmp sha256:{before} to image/png sha256:{after}"
(corpus / "kapittel.html").write_text(
"<!doctype html>\n<html><head><title>Kapittel 84</title></head>\n<body>\n"
"<h1>84 Brød og boller</h1>\n"
"<!doctype html>\n<html><head><title>Kapittel 7</title></head>\n<body>\n"
"<h1>7 Brød og boller</h1>\n"
"<p>Hevetidsklassene staar i figuren under.</p>\n"
f'<img src="graphics/ekte.png" alt="Figur 84-1 -- {clause}">\n'
f'<img src="graphics/ekte.png" alt="Figur 7-1 -- {clause}">\n'
"<p>Og den store figuren:</p>\n"
'<img src="graphics/figur.bmp" alt="Figur 84-2">\n'
'<img src="graphics/figur.bmp" alt="Figur 7-2">\n'
f"<p>{clause}</p>\n"
"</body></html>\n",
encoding="utf-8",
@ -707,8 +707,8 @@ def _forgery_corpus(root: Path, body: str, note: str | None = None) -> tuple[Pat
before = gate._sha256(never_carried)
after = gate._sha256(real)
(inbox / "kapittel.html").write_text(
"<!doctype html>\n<html><head><title>Kapittel 84</title></head>\n<body>\n"
"<h1>84 Brød og boller</h1>\n"
"<!doctype html>\n<html><head><title>Kapittel 7</title></head>\n<body>\n"
"<h1>7 Brød og boller</h1>\n"
'<img src="graphics/stor.bmp" alt="Stor">'
'<img src="graphics/ekte.png" alt="Ekte">'
'<img src="graphics/figur.bmp" alt="Figur">\n'
@ -1228,7 +1228,7 @@ def test_an_asset_under_a_reduced_name_still_proves_the_carry(tmp_path: Path) ->
corpus = _corpus(tmp_path)
source = corpus / "graphics" / "x.png"
digest = gate._sha256(source)
reduced = {f"{digest[:12]}-25-0143-tabeller-p761-p762.jpeg": digest}
reduced = {f"{digest[:12]}-99-0001-tabeller-p350-p351.jpeg": digest}
build = _build(accounting=_declared(fate="carried"), assets=reduced)
assert gate.account(_inventory(), build, corpus)[1].clean