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

@ -6,7 +6,7 @@ the ``bundle_dir``-gated Step-1 ExpeL fold never fired on the portfolio path and
verdict never reached the next hypothesis — an honesty breach, since ``run_portfolio``'s docstring
already claimed a "cross-project learning loop".
Topology (road-*k* + bundle-*(k+1)*, ONE bundle): project *k* is road-backed (``docs_dir``,
Topology (ref-*k* + bundle-*(k+1)*, ONE bundle): project *k* is reference-backed (``docs_dir``,
``bundle_dir=None``); project *k+1* is bundle-backed (``bundle_dir`` = the repo-local mini-bundle,
``id`` = its IR ``project_id``). *k*'s scripted proposal shares *k+1*'s candidate features (code
``ENERGI-TOTAL-EL``, magnitude ~18000), so *k*'s captured verdict is what *k+1*'s ExpeL query
@ -47,11 +47,11 @@ def _generation_prompts(sink: list[str]) -> list[str]:
def _make_docs(tmp_path, name: str) -> str:
"""A tmp docs folder with citable content, so the road path retrieval is non-empty."""
"""A tmp docs folder with citable content, so the reference path retrieval is non-empty."""
d = tmp_path / name
d.mkdir()
(d / "cost.txt").write_text(
"Asphalt Ab11 unit rate renegotiation reduced the paving cost on the school stretch.",
"Licence unit price renegotiation reduced the office-suite cost for the head office.",
encoding="utf-8",
)
return str(d)
@ -59,9 +59,9 @@ def _make_docs(tmp_path, name: str) -> str:
def _road_k(tmp_path, *, rationale: str) -> Project:
return Project(
id="ROAD-K",
name="Road k",
description="road-backed project k",
id="REF-K",
name="Reference k",
description="reference-backed project k",
currency="NOK",
cost_items=(),
docs_dir=_make_docs(tmp_path, "k-docs"),
@ -88,9 +88,9 @@ def _bundle_kplus1(tmp_path, *, verdict_dir: str | None = None) -> Project:
async def test_verdict_on_k_reaches_kplus1_hypothesis_prompt(
tmp_path, monkeypatch, make_recording_client_factory
) -> None:
"""T-2.0a LOAD-BEARING: a verdict captured on road-backed project *k* reaches bundle-backed
"""T-2.0a LOAD-BEARING: a verdict captured on reference-backed project *k* reaches bundle-backed
*k+1*'s hypothesis-generation prompt (both the sentinel rationale and *k*'s verdict id, via the
ExpeL few-shot). Detach ``bundle_dir=project.bundle_dir`` at run.py:496 → *k+1* runs the road
ExpeL few-shot). Detach ``bundle_dir=project.bundle_dir`` at run.py:496 → *k+1* runs the reference
path → the Step-1 fold is skipped → the sentinel never arrives → RED."""
k = _road_k(tmp_path, rationale=_SENTINEL)
kplus1 = _bundle_kplus1(tmp_path)