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:
parent
058dd25570
commit
37547fe292
1147 changed files with 24138 additions and 9503 deletions
|
|
@ -288,22 +288,23 @@ async def test_a_debate_that_opened_nothing_says_so(tmp_path) -> None:
|
|||
_ENERGY_DIM = Dimension(
|
||||
id="energi", label="Energi", allowed_measure_types=frozenset({"energy_efficiency"})
|
||||
)
|
||||
_ASFALT_SENTINEL = "ASFALT-LEAK-SENTINEL-x7y8z9"
|
||||
_ASFALT_FILE = "asfalt-dekke.md"
|
||||
_LISENS_SENTINEL = "LISENS-LEAK-SENTINEL-x7y8z9"
|
||||
_LISENS_FILE = "lisens-kontorpakke.md"
|
||||
|
||||
|
||||
def _bundle_with_a_foreign_dimension(tmp_path: Path) -> str:
|
||||
"""A copy of the fixture base plus ONE concept file marked ``dimension: asfalt``, linked from
|
||||
"""A copy of the fixture base plus ONE concept file marked ``dimension: lisens``, linked from
|
||||
the index so navigation reaches it."""
|
||||
copy = tmp_path / "bundle"
|
||||
shutil.copytree(BUNDLE_DIR, copy)
|
||||
(copy / _ASFALT_FILE).write_text(
|
||||
f"---\ntype: reference\ntitle: Asfaltdekke\ndimension: asfalt\n---\n\n{_ASFALT_SENTINEL}\n",
|
||||
(copy / _LISENS_FILE).write_text(
|
||||
f"---\ntype: reference\ntitle: Lisenser\ndimension: lisens\n---\n\n{_LISENS_SENTINEL}\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
index = copy / "index.md"
|
||||
index.write_text(
|
||||
index.read_text(encoding="utf-8") + f"\n- [Asfaltdekke]({_ASFALT_FILE})\n", encoding="utf-8"
|
||||
index.read_text(encoding="utf-8") + f"\n- [Lisenser]({_LISENS_FILE})\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
return str(copy)
|
||||
|
||||
|
|
@ -332,14 +333,14 @@ async def test_a_foreign_dimension_document_is_neither_listed_nor_readable(tmp_p
|
|||
tools = _tools(bundle_dir, "energi")
|
||||
|
||||
listing = await _invoke(tools["read_bundle"], bundle_id=bundle_id)
|
||||
assert _ASFALT_FILE not in listing, (
|
||||
assert _LISENS_FILE not in listing, (
|
||||
"a document from another dimension is still listed to the agents"
|
||||
)
|
||||
answer = await _invoke(tools["read_file"], bundle_id=bundle_id, path=_ASFALT_FILE)
|
||||
answer = await _invoke(tools["read_file"], bundle_id=bundle_id, path=_LISENS_FILE)
|
||||
assert answer.startswith(f"REFUSED ({DimensionScopeRefused.__name__})")
|
||||
# F99-D3 returns the refusal, so §4.1a's property is asserted on the value: the reason
|
||||
# travels, the out-of-scope document's bytes do not.
|
||||
assert _ASFALT_SENTINEL not in answer
|
||||
assert _LISENS_SENTINEL not in answer
|
||||
|
||||
|
||||
async def test_without_a_dimension_the_same_document_is_listed_and_readable(tmp_path) -> None:
|
||||
|
|
@ -350,9 +351,9 @@ async def test_without_a_dimension_the_same_document_is_listed_and_readable(tmp_
|
|||
tools = _tools(bundle_dir, None)
|
||||
|
||||
listing = await _invoke(tools["read_bundle"], bundle_id=bundle_id)
|
||||
assert _ASFALT_FILE in listing
|
||||
assert _ASFALT_SENTINEL in await _invoke(
|
||||
tools["read_file"], bundle_id=bundle_id, path=_ASFALT_FILE
|
||||
assert _LISENS_FILE in listing
|
||||
assert _LISENS_SENTINEL in await _invoke(
|
||||
tools["read_file"], bundle_id=bundle_id, path=_LISENS_FILE
|
||||
)
|
||||
|
||||
|
||||
|
|
@ -385,6 +386,6 @@ async def test_a_dimension_scoped_run_gives_the_debate_scoped_tools(tmp_path, mo
|
|||
)
|
||||
|
||||
read_file = next(t for t in captured[0] if getattr(t, "name", "") == "read_file")
|
||||
answer = await _invoke(read_file, bundle_id=bundle_id, path=_ASFALT_FILE)
|
||||
answer = await _invoke(read_file, bundle_id=bundle_id, path=_LISENS_FILE)
|
||||
assert answer.startswith(f"REFUSED ({DimensionScopeRefused.__name__})")
|
||||
assert _ASFALT_SENTINEL not in answer
|
||||
assert _LISENS_SENTINEL not in answer
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue