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

@ -55,7 +55,8 @@ _ATTEST_FILE = "attestering.txt"
#: carries. Everything this file asserts is counted from HERE, never from the builder's answer.
#:
#: The REJECTED row carries an amount ON PURPOSE, and no archived run does: measured 19.09 over
#: the four real outboxes (``tunnel-hauglia-2027-04/-06/-07/-08``), every ``rejected`` row has
#: the four real outboxes of one archived context set (run ids ``…-04/-06/-07/-08``), every
#: ``rejected`` row has
#: ``saving_nok = None``. The guard that only a ``validated`` row's figure may become
#: ``validated_nok`` is therefore aimed at a coverage writer that does not exist yet — and a
#: fixture that cannot produce the number cannot witness the guard at all, which is exactly why
@ -66,40 +67,40 @@ _ATTEST_FILE = "attestering.txt"
#: 137000001. One øre is the whole distance between the rule and its most plausible violation.
_SPEC: tuple[tuple[str, str, str, float | None, float, str], ...] = (
(
"a1-kortere-rekkverk",
"Kortere rekkverk langs fv. 12",
"a1-faerre-rackskap",
"Færre rackskap i rad 12",
"validated",
1_250_000.0,
1_250_000.0,
"",
),
(
"a2-faerre-kummer",
"Færre kummer i kryssene",
"a2-faerre-svitsjer",
"Færre svitsjer i etasjene",
"rejected",
900_000.0,
900_000.0,
"claimed saving 900000 exceeds P90 feasible 410000",
),
(
"a3-tynnere-dekke",
"Tynnere dekke på gang- og sykkelvegen",
"a3-mindre-testlagring",
"Mindre lagring i testmiljøet",
"validated",
60_000.005,
60_000.005,
"",
),
(
"a4-smalere-skulder",
"Smalere skulder på strekningen",
"a4-kortere-reservetid",
"Kortere reservetid på strømforsyningen",
"unsupported",
None,
400_000.0,
UNSUPPORTED_REASON,
),
(
"a5-enklere-rekkverksender",
"Enklere rekkverksender",
"a5-enklere-kabelgater",
"Enklere kabelgater",
"validated",
60_000.005,
60_000.005,
@ -107,7 +108,7 @@ _SPEC: tuple[tuple[str, str, str, float | None, float, str], ...] = (
),
(
"a6-enklere-belysning",
"Enklere belysning i krysset",
"Enklere belysning i serverrommet",
"not_evaluated",
None,
0.0,
@ -147,7 +148,7 @@ _STATUS_WORDS: dict[str, str] = {
#:
#: Measured 19.09: swapping the sentences for ``stage4-p90`` and ``stage0b-grounding`` in
#: ``round_builder.STAGE_PROSE`` passed all 43 arms of this file. The report then told the expert
#: that «Færre kummer i kryssene» fell on the GROUNDING when it fell on the uncertainty
#: that «Færre svitsjer i etasjene» fell on the GROUNDING when it fell on the uncertainty
#: calculation — the one thing that section exists to say, said wrong, with nothing to catch it.
#:
#: Both halves are independent for a reason. The opening clause is what the expert reads as the
@ -168,8 +169,8 @@ _STAGE_SENTENCES: dict[str, tuple[str, str]] = {
#: Every artefact type OF THE RUNS MEASURED — the denominator, counted here rather than
#: remembered, and deliberately not called «every type a real run leaves». METHOD: each file
#: ``<run_id>-<rest>.json`` is typed as ``proposal``/``outcome`` when ``<rest>`` ends there and
#: as ``<rest>`` itself otherwise. Counted 19.09 over the four archived runs
#: (``scratchpad/p19..p22-stress/tunnel-hauglia-2027/``, run ids ``…-04/-06/-07/-08``): ``-06``,
#: as ``<rest>`` itself otherwise. Counted 19.09 over the four archived runs of one context set
#: (``scratchpad/p19..p22-stress/<set>/``, run ids ``…-04/-06/-07/-08``): ``-06``,
#: ``-07`` and ``-08`` hold all SEVEN (15 files each); ``-04`` holds six (12 files, no
#: ``parse-failures`` — that file is written only when something failed to parse, so its ABSENCE
#: is the signal). Counted again over EVERY outbox in this repo holding exactly one coverage
@ -226,7 +227,7 @@ _SHARED_CITED = 9
def _snippet(aid: str, k: int) -> str:
return f"Kravteksten bak {aid}, sted {k}: restriktiv bruk av kryss anbefales."
return f"Kravteksten bak {aid}, sted {k}: restriktiv bruk av reservekapasitet anbefales."
def _stamp(decision: str, aid: str, *, shared: bool = False) -> ProvenanceStamp:
@ -241,7 +242,7 @@ def _stamp(decision: str, aid: str, *, shared: bool = False) -> ProvenanceStamp:
return ProvenanceStamp(
citations=[
Citation(
file=f"krav/N100/id-{'hele-kjoringen' if shared else aid}-{k}.md",
file=f"krav/D100/id-{'hele-kjoringen' if shared else aid}-{k}.md",
locator=TextSpan(start_index=0, end_index=48),
snippet=_snippet("hele-kjoringen" if shared else aid, k),
)
@ -319,7 +320,7 @@ def _outbox(
str(outbox),
run_id,
tool_calls=[{"tool": "read_dir", "argument": "krav/", "round": 1}],
requirements=[{"id": "N100-1", "title": "Kryss"}],
requirements=[{"id": "D100-1", "title": "Klient"}],
)
write_parse_failures(
str(outbox),
@ -483,7 +484,7 @@ def test_a_refused_rows_amount_never_becomes_a_validated_saving(tmp_path: Path)
refused_with_amount = {
aid for aid, _l, status, nok, *_rest in _SPEC if status != "validated" and nok is not None
}
assert refused_with_amount == {"a2-faerre-kummer"}, "the table lost the row this arm needs"
assert refused_with_amount == {"a2-faerre-svitsjer"}, "the table lost the row this arm needs"
rows = {
row["id"]: row
for row in json.loads((built.round_dir / "outcome.json").read_text(encoding="utf-8"))[
@ -524,7 +525,7 @@ def test_only_a_validated_row_counts_even_when_a_refused_one_carries_a_figure()
for row in leaky["approaches"]
if not row["validated"] and row["validated_nok"] is not None
]
assert leaked_rows == ["a2-faerre-kummer"], "the table lost the row this arm needs"
assert leaked_rows == ["a2-faerre-svitsjer"], "the table lost the row this arm needs"
assert rb.validated_ore(leaky) == _VALIDATED_ORE == 137_000_002
@ -962,7 +963,7 @@ def test_the_report_shows_each_proposals_source_and_how_many_places_it_cited(
for aid in _EVALUATED:
assert f"Kilde (1 av {_CITED[aid]} siterte steder)" in text, aid
assert _snippet(aid, 0) in text, aid
assert f"krav/N100/id-{aid}-0.md" in text, aid
assert f"krav/D100/id-{aid}-0.md" in text, aid
assert text.count("Kilde (1 av ") == len(_EVALUATED)
assert "Felles kilde" not in text
@ -1320,7 +1321,7 @@ def test_the_ledgers_claim_about_the_five_other_types_is_what_the_repo_measures(
times, and the third writing was still untrue: «``exploration``, ``prepass``, ``multibase``,
``plan-review`` og ``proposal-reviews`` … ingen av dem ligger i dag i en utboks som også har
coverage». Measured 19.09 in this working tree: ``multibase`` lies in FOUR outboxes that also
hold coverage (``scratchpad/{p17b-multibase,p20-stress,p21-stress,p22-stress}/lindaas``), and
hold coverage (the multi-base set's outbox under ``scratchpad/`` in four stress rounds), and
each of those outboxes holds TWO coverage files — which is why they fall outside the «exactly
one coverage» rule the union of seven is counted over, and at the same time why seven is a
FLOOR and not a ceiling.