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

@ -1,6 +1,6 @@
"""Load-bearing gate for order 20260908T141941Z (P3): the excerpt's new fields reach the prompt.
P2 (`docs/2026-09-08-n-bundlene-hypoteseform.md` SS 4) measured that llm-ingestion-okf's producer
P2 (its ledger row is in `docs/invarianter.md`) measured that llm-ingestion-okf's producer
now emits ``title``, ``req_number``, ``sources`` and per-excerpt ``source_*`` locators on every
excerpt (14 members, was 9) -- and that ``po`` drops all five TWICE: ``PrepassExcerpt`` is
``extra="ignore"`` so parsing throws them away, and ``_data_blocks`` renders only ``concept_id``,
@ -8,11 +8,11 @@ excerpt (14 members, was 9) -- and that ``po`` drops all five TWICE: ``PrepassEx
DATA block. (b') -- "did the model name the concept" -- was therefore a ``po`` verdict, never a
model verdict: no implementation of the model could have passed it while the field never arrived.
**Field-form decision, measured, not guessed.** The producer's OWN message (cited in P2 SS 4,
"differansen er at K2 baerer fem source_*-lokatorer der N-bundlene baerer to -- prefiks-regelen,
ikke en allowlist") states that ``source_*`` is an open-ended FAMILY, not a fixed two-member
allowlist. Two forms were compared against "does a future producer's new ``source_foo`` key reach
the prompt without a code change here":
**Field-form decision, measured, not guessed.** The producer's OWN message (cited in P2: K2
carries five ``source_*`` locators where the requirement bundles carry two, and the rule is a
prefix rule, not an allowlist) states that ``source_*`` is an open-ended FAMILY, not a fixed
two-member allowlist. Two forms were compared against "does a future producer's new ``source_foo``
key reach the prompt without a code change here":
- **Named fields** (``source_element_id: str | None``, ``source_sha256: str | None``, ...): a
producer adding a THIRD ``source_*`` member requires a new field declared on ``PrepassExcerpt``
@ -53,7 +53,7 @@ def _raw_with_new_fields() -> dict[str, Any]:
excerpt["title"] = "Kontorbygg Nord (BYGG-KONTOR-NORD)"
excerpt["req_number"] = "Krav 3.3.1–13"
excerpt["sources"] = [
{"resource": "https://viewers.vegnorm.vegvesen.no/api/nisosts/859984", "title": "N100:2023"}
{"resource": "https://example.invalid/driftskrav/859984", "title": "D100:2027"}
]
excerpt["source_element_id"] = "id-4b61eee9-a149-42b3-863d-293b8320c15a"
excerpt["source_sha256"] = "c58e8bbc5fa9a5400c111e51b04c05f2cfd9edabd884ef5352a486fdab2cb5ab"
@ -69,7 +69,7 @@ def test_the_excerpt_carries_title_req_number_and_sources() -> None:
assert excerpt.title == "Kontorbygg Nord (BYGG-KONTOR-NORD)"
assert excerpt.req_number == "Krav 3.3.1–13"
assert excerpt.sources is not None
assert excerpt.sources[0].resource == "https://viewers.vegnorm.vegvesen.no/api/nisosts/859984"
assert excerpt.sources[0].resource == "https://example.invalid/driftskrav/859984"
def test_a_future_source_star_key_survives_without_a_code_change() -> None:
@ -120,7 +120,7 @@ def test_the_data_block_renders_req_number_title_and_the_address() -> None:
header = _header_for(prepass.render_context(payload), "bygg-kontor-nord")
assert "Krav 3.3.1–13" in header
assert "Kontorbygg Nord (BYGG-KONTOR-NORD)" in header
assert "https://viewers.vegnorm.vegvesen.no/api/nisosts/859984" in header
assert "https://example.invalid/driftskrav/859984" in header
assert "id-4b61eee9-a149-42b3-863d-293b8320c15a" in header