test(fixtures): replace sector-specific example material with generic, fictitious examples — green

Every fixture, test document, tool example and document now uses an invented
kitchen-and-baking handbook series, written in this repository. The package's
behaviour is unchanged; src/ changes are comments and help text only.

- Generated fixtures are regenerated from their generators. Their structural
  counts are identical before and after: elements, images, rows, cells,
  headings, bookmarks and the witness inventory's per-document totals. The
  image-inbox and accounting documents are renamed kapittel-84-*.
- tools/okf_accounting_gate.py: the two options that named one real corpus
  each are replaced by a generic, repeatable --corpus PATH with no default.
  Row 5 compares the PDF pair alone. Gate verdict unchanged: RED rows 2, 3, 6.
- tools/okf_witness.py: the STS JSON reader for one publisher's delivery is
  removed, along with its three twins and five tests. The mutation harness
  loses W09.
- docs/: 13 dated reports that documented runs on a retired reference corpus
  are removed, and 40 are neutralized. Dead links are removed, and no new
  dangling path is introduced.
- The synthetic MCP-gate corpus and the residual probe words are neutral.

Valgt: keep the `okf quality --fasit` bar value (the measured fraction, one corpus) and
rewrite only its provenance, because the verdict stays unchanged and the
number names nothing.

Term check with the local list: 0 of 411 tracked files, 0 file names, 0 of
27 binary fixtures. Suite after git add: 2457 passed, 1 skipped. The base
tree had 2460 passed and 2 skipped; five tests went with the JSON reader and
four were added by the term check. ruff, ruff format and mypy --strict src/
are clean.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-23 13:54:57 +02:00
commit 9d1f4b14ed
174 changed files with 1889 additions and 6512 deletions

View file

@ -62,7 +62,7 @@ def drop(inbox: Path, name: str, text: str = DOCUMENT) -> Path:
return path
def _extracted_text_sha256(source_bytes: bytes, filename: str = "n500.md") -> str:
def _extracted_text_sha256(source_bytes: bytes, filename: str = "q500.md") -> str:
return hashlib.sha256(extract_text(filename, source_bytes).encode("utf-8")).hexdigest()
@ -153,11 +153,11 @@ ROUND_2 = (
def test_a_resplit_loses_no_concept_id_and_adds_at_least_two(tmp_path: Path) -> None:
source = drop(tmp_path / "one", "n500.md")
source = drop(tmp_path / "one", "q500.md")
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_1), round_name="one")
first = concept_ids(tmp_path / "bundle")
drop(tmp_path / "two", "n500.md")
drop(tmp_path / "two", "q500.md")
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_2), round_name="two")
second = concept_ids(tmp_path / "bundle")
@ -171,9 +171,9 @@ def test_a_resplit_loses_no_concept_id_and_adds_at_least_two(tmp_path: Path) ->
def test_the_parent_survives_the_resplit_and_its_children_point_at_it(
tmp_path: Path,
) -> None:
source = drop(tmp_path / "one", "n500.md")
source = drop(tmp_path / "one", "q500.md")
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_1), round_name="one")
drop(tmp_path / "two", "n500.md")
drop(tmp_path / "two", "q500.md")
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_2), round_name="two")
bundle = tmp_path / "bundle"
@ -184,11 +184,11 @@ def test_the_parent_survives_the_resplit_and_its_children_point_at_it(
def test_ids_are_stable_across_a_round_that_changes_nothing(tmp_path: Path) -> None:
source = drop(tmp_path / "one", "n500.md")
source = drop(tmp_path / "one", "q500.md")
plan = build_plan(source.read_bytes(), ROUND_2)
run(tmp_path, plan=plan, round_name="one")
first = concept_ids(tmp_path / "bundle")
drop(tmp_path / "two", "n500.md")
drop(tmp_path / "two", "q500.md")
run(tmp_path, plan=plan, round_name="two")
assert concept_ids(tmp_path / "bundle") == first
@ -199,11 +199,11 @@ def test_ids_are_stable_across_a_round_that_changes_nothing(tmp_path: Path) -> N
def test_a_round_naming_fewer_segments_removes_exactly_the_unnamed_ones(
tmp_path: Path,
) -> None:
source = drop(tmp_path / "one", "n500.md")
source = drop(tmp_path / "one", "q500.md")
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_2), round_name="one")
assert len(concept_ids(tmp_path / "bundle")) == 3
drop(tmp_path / "two", "n500.md")
drop(tmp_path / "two", "q500.md")
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_1), round_name="two")
# Exactly the un-named ones. An orphan surviving here is invisible to a
@ -213,18 +213,18 @@ def test_a_round_naming_fewer_segments_removes_exactly_the_unnamed_ones(
def test_retirement_leaves_every_other_documents_concepts_alone(tmp_path: Path) -> None:
source = drop(tmp_path / "one", "n500.md")
other = drop(tmp_path / "one", "v720.md", "Tunnelkrav.\n" * 20)
source = drop(tmp_path / "one", "q500.md")
other = drop(tmp_path / "one", "w720.md", "Kjellerkrav.\n" * 20)
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_2), round_name="one")
assert "inbox-v720" in concept_ids(tmp_path / "bundle")
assert "inbox-w720" in concept_ids(tmp_path / "bundle")
drop(tmp_path / "two", "n500.md")
drop(tmp_path / "two", "q500.md")
run(tmp_path, plan=build_plan(source.read_bytes(), ROUND_1), round_name="two")
# v720 was not in round 2's inbox at all. Ownership is per source_file, so
# nothing about n500's re-split may touch it.
assert (tmp_path / "bundle" / "inbox-v720.md").is_file()
assert other.name == "v720.md"
# w720 was not in round 2's inbox at all. Ownership is per source_file, so
# nothing about q500's re-split may touch it.
assert (tmp_path / "bundle" / "inbox-w720.md").is_file()
assert other.name == "w720.md"
# --- the four shipped profiles keep FLAT scans ----------------------------
@ -238,21 +238,21 @@ def test_default_ignores_a_nested_file_when_scanning_for_collisions(
# capability, and this plants a nested file to prove DEFAULT never looks.
bundle = tmp_path / "bundle"
(bundle / "krav").mkdir(parents=True)
(bundle / "krav" / "inbox-n500.md").write_text(
"---\ntype: note\ngenerated: true\nsource_file: n500.md\n---\n\nnested\n",
(bundle / "krav" / "inbox-q500.md").write_text(
"---\ntype: note\ngenerated: true\nsource_file: q500.md\n---\n\nnested\n",
encoding="utf-8",
)
drop(tmp_path / "round", "n500.md", "Flat.\n")
drop(tmp_path / "round", "q500.md", "Flat.\n")
result = run(tmp_path, profile=DEFAULT)
assert result.failed == ()
assert (bundle / "inbox-n500.md").is_file()
assert (bundle / "inbox-q500.md").is_file()
# Untouched: DEFAULT does not own it, does not see it, does not retire it.
assert (bundle / "krav" / "inbox-n500.md").read_text(encoding="utf-8").endswith("nested\n")
assert (bundle / "krav" / "inbox-q500.md").read_text(encoding="utf-8").endswith("nested\n")
def test_default_still_writes_one_flat_concept_per_file(tmp_path: Path) -> None:
drop(tmp_path / "round", "n500.md", "Flat.\n")
drop(tmp_path / "round", "v720.md", "Annet.\n")
drop(tmp_path / "round", "q500.md", "Flat.\n")
drop(tmp_path / "round", "w720.md", "Annet.\n")
run(tmp_path, profile=DEFAULT)
assert concept_ids(tmp_path / "bundle", DEFAULT) == ["inbox-n500", "inbox-v720"]
assert concept_ids(tmp_path / "bundle", DEFAULT) == ["inbox-q500", "inbox-w720"]