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:
parent
1e7345a401
commit
9d1f4b14ed
174 changed files with 1889 additions and 6512 deletions
|
|
@ -1,6 +1,6 @@
|
|||
"""Door C carries the sender's OWN metadata into the index — and nothing else.
|
||||
|
||||
The measured defect this closes, as data. vegnormal-okf ran a pre-registered
|
||||
The measured defect this closes, as data. A downstream consumer ran a pre-registered
|
||||
reasoning bake-off on 2026-08-27 over the same bundle through two index shapes:
|
||||
the arm reading DEFAULT's `index.md` scored 0 hits of 8, the arm reading a
|
||||
faceted index of the same frontmatter scored 25 of 29. The DEFAULT arm did not
|
||||
|
|
@ -82,15 +82,15 @@ def test_door_c_carries_the_senders_declared_facets_into_the_index(tmp_path: Pat
|
|||
# index the reasoning arm is handed now states them.
|
||||
place(
|
||||
tmp_path / "source",
|
||||
"krav/n500-3-1.md",
|
||||
"---\ntype: dataset\nnumber: N500\nstatus: gjeldende\ndate: 2024-06-01\n---\n\nBody.\n",
|
||||
"krav/q500-3-1.md",
|
||||
"---\ntype: dataset\nnumber: Q500\nstatus: gjeldende\ndate: 2024-06-01\n---\n\nBody.\n",
|
||||
)
|
||||
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
|
||||
assert index_of(bundle, STRUCTURED_V1) == (
|
||||
"- [krav/n500-3-1](import-krav-n500-3-1.md)"
|
||||
" — number: N500; status: gjeldende; date: 2024-06-01\n"
|
||||
"- [krav/q500-3-1](import-krav-q500-3-1.md)"
|
||||
" — number: Q500; status: gjeldende; date: 2024-06-01\n"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -101,13 +101,13 @@ def test_a_facet_key_the_policy_names_is_projected_whatever_it_means(tmp_path: P
|
|||
place(
|
||||
tmp_path / "source",
|
||||
"0f9a.md",
|
||||
"---\ntype: dataset\ntitle: Vegtunneler\nnumber: N500\n---\n\nBody.\n",
|
||||
"---\ntype: dataset\ntitle: Vinkjellere\nnumber: Q500\n---\n\nBody.\n",
|
||||
)
|
||||
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=TITLED)
|
||||
|
||||
assert index_of(bundle, TITLED) == (
|
||||
"- [0f9a](import-0f9a.md) — title: Vegtunneler; number: N500\n"
|
||||
"- [0f9a](import-0f9a.md) — title: Vinkjellere; number: Q500\n"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -122,14 +122,14 @@ def test_door_c_derives_nothing_the_sender_did_not_declare(tmp_path: Path) -> No
|
|||
place(
|
||||
tmp_path / "source",
|
||||
"b.md",
|
||||
"---\ntype: dataset\nstatus: gjeldende\n---\n\n# N500 Vegtunneler\n\nSe N100.\n",
|
||||
"---\ntype: dataset\nstatus: gjeldende\n---\n\n# Q500 Vinkjellere\n\nSe Q100.\n",
|
||||
)
|
||||
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
|
||||
index = index_of(bundle, STRUCTURED_V1)
|
||||
assert index == "- [b](import-b.md) — status: gjeldende\n"
|
||||
assert "N500" not in index
|
||||
assert "Q500" not in index
|
||||
assert "references" not in index
|
||||
|
||||
|
||||
|
|
@ -141,14 +141,14 @@ def test_the_senders_own_derived_list_travels_verbatim(tmp_path: Path) -> None:
|
|||
place(
|
||||
tmp_path / "source",
|
||||
"c.md",
|
||||
"---\ntype: dataset\nnumber: N130\nstatus: gjeldende\n"
|
||||
"---\ntype: dataset\nnumber: Q130\nstatus: gjeldende\n"
|
||||
"derived: [number, status]\n---\n\nBody.\n",
|
||||
)
|
||||
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
|
||||
assert index_of(bundle, STRUCTURED_V1) == (
|
||||
"- [c](import-c.md) — number: N130; status: gjeldende; derived: [number, status]\n"
|
||||
"- [c](import-c.md) — number: Q130; status: gjeldende; derived: [number, status]\n"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -158,7 +158,7 @@ def test_the_senders_own_derived_list_travels_verbatim(tmp_path: Path) -> None:
|
|||
def test_an_unnumbered_document_still_gets_the_facets_it_has(tmp_path: Path) -> None:
|
||||
# Operator directive 2026-08-27: everything built around OKF must work for
|
||||
# ALL content, so a design that only works for numbered norms is wrong even
|
||||
# when it scores well on N100/N200/N500. A meeting note has no number, no
|
||||
# when it scores well on Q100/Q200/Q500. A meeting note has no number, no
|
||||
# parent and no version — and must still reach the index carrying what it
|
||||
# does have, with no half-written separator for what it does not.
|
||||
place(
|
||||
|
|
@ -197,7 +197,7 @@ def test_the_default_profile_leaves_door_c_byte_identical(tmp_path: Path) -> Non
|
|||
place(
|
||||
tmp_path / "source",
|
||||
"e.md",
|
||||
"---\ntype: dataset\nnumber: N500\nstatus: gjeldende\n---\n\nBody.\n",
|
||||
"---\ntype: dataset\nnumber: Q500\nstatus: gjeldende\n---\n\nBody.\n",
|
||||
)
|
||||
|
||||
bundle = tmp_path / "bundle"
|
||||
|
|
@ -219,7 +219,7 @@ def test_the_concept_file_is_still_written_verbatim_under_a_faceted_profile(
|
|||
# The verbatim guarantee is what makes projection safe, so it is pinned on
|
||||
# the faceted path too: it is `index.md` that gains bytes, never the file
|
||||
# the sender wrote.
|
||||
text = "---\ntype: dataset\nnumber: N500\n---\n\nBody.\n"
|
||||
text = "---\ntype: dataset\nnumber: Q500\n---\n\nBody.\n"
|
||||
place(tmp_path / "source", "f.md", text)
|
||||
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
|
|
@ -236,14 +236,14 @@ def test_an_unrenderable_facet_value_drops_the_facet_not_the_concept(tmp_path: P
|
|||
place(
|
||||
tmp_path / "source",
|
||||
"g.md",
|
||||
"---\ntype: dataset\nnumber: N500\nstatus: utkast; til horing\n---\n\nBody.\n",
|
||||
"---\ntype: dataset\nnumber: Q500\nstatus: utkast; til horing\n---\n\nBody.\n",
|
||||
)
|
||||
|
||||
result, bundle = run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
|
||||
assert [entry.concept_path for entry in result.merged] == ["g.md"]
|
||||
assert (bundle / "import-g.md").is_file()
|
||||
assert index_of(bundle, STRUCTURED_V1) == "- [g](import-g.md) — number: N500\n"
|
||||
assert index_of(bundle, STRUCTURED_V1) == "- [g](import-g.md) — number: Q500\n"
|
||||
assert [(entry.concept_path, entry.key) for entry in result.unrendered_facets] == [
|
||||
("g.md", "status")
|
||||
]
|
||||
|
|
@ -266,19 +266,19 @@ def test_a_reimported_concept_updates_its_index_entry_rather_than_going_stale(
|
|||
# An index that contradicts the bundle it indexes is worse than one that
|
||||
# says nothing, because a reasoning arm reads the index and stops.
|
||||
source = tmp_path / "source"
|
||||
place(source, "a.md", "---\ntype: dataset\nnumber: N500\nstatus: utkast\n---\n\nBody.\n")
|
||||
place(source, "a.md", "---\ntype: dataset\nnumber: Q500\nstatus: utkast\n---\n\nBody.\n")
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
assert index_of(bundle, STRUCTURED_V1) == (
|
||||
"- [a](import-a.md) — number: N500; status: utkast\n"
|
||||
"- [a](import-a.md) — number: Q500; status: utkast\n"
|
||||
)
|
||||
|
||||
(bundle / "import-a.md").unlink()
|
||||
place(source, "a.md", "---\ntype: dataset\nnumber: N500\nstatus: gjeldende\n---\n\nBody.\n")
|
||||
place(source, "a.md", "---\ntype: dataset\nnumber: Q500\nstatus: gjeldende\n---\n\nBody.\n")
|
||||
run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
|
||||
assert "gjeldende" in (bundle / "import-a.md").read_text(encoding="utf-8")
|
||||
assert index_of(bundle, STRUCTURED_V1) == (
|
||||
"- [a](import-a.md) — number: N500; status: gjeldende\n"
|
||||
"- [a](import-a.md) — number: Q500; status: gjeldende\n"
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -335,13 +335,13 @@ def test_the_door_writes_into_the_profiles_namespace_not_defaults(tmp_path: Path
|
|||
STRUCTURED_V1,
|
||||
paths=replace(STRUCTURED_V1.paths, import_prefix="ekstern-"),
|
||||
)
|
||||
place(tmp_path / "source", "a.md", "---\ntype: dataset\nnumber: N500\n---\n\nBody.\n")
|
||||
place(tmp_path / "source", "a.md", "---\ntype: dataset\nnumber: Q500\n---\n\nBody.\n")
|
||||
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=profile)
|
||||
|
||||
assert (bundle / "ekstern-a.md").is_file()
|
||||
assert not (bundle / "import-a.md").exists()
|
||||
assert index_of(bundle, profile) == "- [a](ekstern-a.md) — number: N500\n"
|
||||
assert index_of(bundle, profile) == "- [a](ekstern-a.md) — number: Q500\n"
|
||||
|
||||
|
||||
def test_a_key_the_sender_declared_empty_produces_no_facet(tmp_path: Path) -> None:
|
||||
|
|
@ -351,9 +351,9 @@ def test_a_key_the_sender_declared_empty_produces_no_facet(tmp_path: Path) -> No
|
|||
place(
|
||||
tmp_path / "source",
|
||||
"a.md",
|
||||
"---\ntype: dataset\nnumber: N500\nstatus:\ndate:\n---\n\nBody.\n",
|
||||
"---\ntype: dataset\nnumber: Q500\nstatus:\ndate:\n---\n\nBody.\n",
|
||||
)
|
||||
|
||||
_, bundle = run_with(tmp_path, StubImportGate(), profile=STRUCTURED_V1)
|
||||
|
||||
assert index_of(bundle, STRUCTURED_V1) == "- [a](import-a.md) — number: N500\n"
|
||||
assert index_of(bundle, STRUCTURED_V1) == "- [a](import-a.md) — number: Q500\n"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue