refactor(examples): replace sector-specific example material with generic, fictitious examples

The context sets, the packaged knowledge bases and the example bundles are
replaced by one fictitious example set about IT operations in an invented
organisation: three context sets (serverrom-2027, driftsavtale-2027 and the
two-base drift-og-avtale-2027), two synthetic knowledge bases under
src/portfolio_optimiser/data/kunnskapsbaser and two example bundles under
src/portfolio_optimiser/data/bundles. Numbers, codes and structural values in
tests and fixtures are kept; names, ids and wording change. Dated measurement
documents that only recorded runs on the replaced material are deleted.

Gate figures measured on the new set are not comparable with earlier ones.
The exclusion gate from the previous commit is green: 0 tracked files hit
outside the shared/ subtree.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-23 15:04:21 +02:00
commit 37547fe292
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
1147 changed files with 24138 additions and 9503 deletions

View file

@ -209,7 +209,7 @@ def _dimension_bundle(tmp_path) -> str:
(tmp_path / "index.md").write_text(
"---\ntype: index\n---\n\n# Bundle\n\n"
"- [energi](energi-method.md)\n"
"- [asfalt](asfalt-method.md)\n"
"- [lisens](lisens-method.md)\n"
"- [shared](shared-note.md)\n"
"- [verdict](verdict-x.md)\n",
encoding="utf-8",
@ -217,8 +217,8 @@ def _dimension_bundle(tmp_path) -> str:
(tmp_path / "energi-method.md").write_text(
"---\ntype: methodology\ndimension: energi\n---\n\nENERGI-SENTINEL body\n", encoding="utf-8"
)
(tmp_path / "asfalt-method.md").write_text(
"---\ntype: methodology\ndimension: asfalt\n---\n\nASFALT-SENTINEL body\n", encoding="utf-8"
(tmp_path / "lisens-method.md").write_text(
"---\ntype: methodology\ndimension: lisens\n---\n\nLISENS-SENTINEL body\n", encoding="utf-8"
)
(tmp_path / "shared-note.md").write_text(
"---\ntype: reference\n---\n\nSHARED-SENTINEL body\n", encoding="utf-8"
@ -231,7 +231,7 @@ def _dimension_bundle(tmp_path) -> str:
def test_bundle_context_dimension_filter(tmp_path) -> None:
"""SC7 forutsetning: with ``dimension="energi"`` only energi-marked + unmarked concept files
render; an asfalt-marked file is omitted. ``dimension=None`` is byte-identical to the no-arg
render; a lisens-marked file is omitted. ``dimension=None`` is byte-identical to the no-arg
call (backward compat — protects the verdict-exclusion + step7/8 load-bearing tests).
``type: verdict`` stays excluded in every case."""
bundle = okf.navigate_bundle(_dimension_bundle(tmp_path))
@ -239,12 +239,12 @@ def test_bundle_context_dimension_filter(tmp_path) -> None:
scoped = okf.bundle_context(bundle, dimension="energi")
assert "ENERGI-SENTINEL" in scoped # energi-marked concept file rendered
assert "SHARED-SENTINEL" in scoped # unmarked knowledge is never dropped
assert "ASFALT-SENTINEL" not in scoped # other-dimension file filtered out
assert "LISENS-SENTINEL" not in scoped # other-dimension file filtered out
assert "VERDICT-SENTINEL" not in scoped # verdict layer still excluded
default = okf.bundle_context(bundle)
assert okf.bundle_context(bundle, dimension=None) == default # None == today, byte-identical
assert "ASFALT-SENTINEL" in default # no filter -> asfalt present
assert "LISENS-SENTINEL" in default # no filter -> lisens present
assert "VERDICT-SENTINEL" not in default # verdict still excluded
@ -317,13 +317,13 @@ def test_parse_frontmatter_reads_scalar_fields() -> None:
def test_parse_frontmatter_top_level_title_survives_nested_sources_title(tmp_path) -> None:
"""A concept's OWN ``title`` sits at top level; ``sources:`` is a block sequence whose nested
``title:`` names the SOURCE document, not the concept (measured on a real vegnormal-okf
concept, ``krav/N500/id-bfb0edb4-…``). Top-level keys carry no indentation and must win —
a nested line must never overwrite a top-level key of the same name, however late it appears
in the scan. Without this, ``directory_listing`` on ``krav/N500`` returns 269 documents that
all share the one nested title, ``N500:2024`` — rung 2/3 of the navigation ladder collapse to
an opaque UUID filename and a character count (P14 finding,
``docs/2026-09-12-p14-kontekstsett.md`` § 5).
``title:`` names the SOURCE document, not the concept (measured on a real concept of a
delivered requirements corpus). Top-level keys carry no indentation and must win — a nested
line must never overwrite a top-level key of the same name, however late it appears in the
scan. Without this, ``directory_listing`` on that corpus's level returned 269 documents that
all shared the one nested title, the source standard's own name — rung 2/3 of the navigation
ladder collapse to an opaque UUID filename and a character count (P14 finding; the ledger is
``docs/invarianter.md``).
Known-negatives that must stay green: ``type`` and ``req_number`` are untouched top-level
scalars either way, and the ``verified:`` block-form decoder (SPEC §5.2) reads
@ -331,18 +331,18 @@ def test_parse_frontmatter_top_level_title_survives_nested_sources_title(tmp_pat
text = (
"---\n"
"type: Krav\n"
"title: Krav 10.4.3—1 Mekanisk ventilasjon (impulsventilator)\n"
"title: Krav 10.4.3—1 Reservestrøm (nødstrømsaggregat)\n"
"req_number: Krav 10.4.3—1\n"
"sources:\n"
" - resource: https://example.invalid/859990\n"
" title: N500:2024\n"
" title: D500:2027\n"
"---\n\n"
"## Krav\nbody\n"
)
path = tmp_path / "concept.md"
path.write_text(text, encoding="utf-8")
fm = okf.parse_frontmatter(path)
assert fm["title"] == "Krav 10.4.3—1 Mekanisk ventilasjon (impulsventilator)"
assert fm["title"] == "Krav 10.4.3—1 Reservestrøm (nødstrømsaggregat)"
assert fm["type"] == "Krav"
assert fm["req_number"] == "Krav 10.4.3—1"