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
|
|
@ -126,7 +126,7 @@ def test_save_is_byte_identical_regardless_of_order(tmp_path) -> None:
|
|||
|
||||
# --- Step 8: hard/soft goal-stop in run_portfolio on the accumulated ledger (SC6/SC8) ------------
|
||||
|
||||
_PORTFOLIO_IDS = ["FV42-GSV-E1", "RV13-RAS-TP", "BRU-LAKS-REHAB"]
|
||||
_PORTFOLIO_IDS = ["KONTOR-IT-E1", "NETT-SIKR-TP", "ARKIV-LAGR-MIGR"]
|
||||
|
||||
|
||||
def _prefilled(project_id: str, amount_ore: int) -> SavingsLedger:
|
||||
|
|
@ -147,7 +147,7 @@ def _prefilled(project_id: str, amount_ore: int) -> SavingsLedger:
|
|||
|
||||
|
||||
async def test_portfolio_hard_goal_stops_the_whole_pass(make_portfolio_client_factory) -> None:
|
||||
ledger = _prefilled("FV42-GSV-E1", 100) # portfolio_total == 100
|
||||
ledger = _prefilled("KONTOR-IT-E1", 100) # portfolio_total == 100
|
||||
goals = GoalConfig(portfolio=GoalContract(absolute_ore=100)) # met at 100 (>=)
|
||||
result = await run_portfolio(
|
||||
_PORTFOLIO_IDS,
|
||||
|
|
@ -167,7 +167,7 @@ async def test_portfolio_hard_goal_stops_the_whole_pass(make_portfolio_client_fa
|
|||
|
||||
async def test_boundary_exact_equal_stops(make_portfolio_client_factory) -> None:
|
||||
""">= boundary: accumulated EXACTLY equal to the goal stops (reached, not strictly exceeded)."""
|
||||
ledger = _prefilled("FV42-GSV-E1", 500)
|
||||
ledger = _prefilled("KONTOR-IT-E1", 500)
|
||||
goals = GoalConfig(portfolio=GoalContract(absolute_ore=500))
|
||||
result = await run_portfolio(
|
||||
_PORTFOLIO_IDS,
|
||||
|
|
@ -181,10 +181,10 @@ async def test_boundary_exact_equal_stops(make_portfolio_client_factory) -> None
|
|||
|
||||
|
||||
async def test_per_project_hard_goal_skips_only_that_pid(make_portfolio_client_factory) -> None:
|
||||
ledger = _prefilled("FV42-GSV-E1", 1000)
|
||||
goals = GoalConfig(per_project={"FV42-GSV-E1": GoalContract(absolute_ore=1000)})
|
||||
ledger = _prefilled("KONTOR-IT-E1", 1000)
|
||||
goals = GoalConfig(per_project={"KONTOR-IT-E1": GoalContract(absolute_ore=1000)})
|
||||
result = await run_portfolio(
|
||||
["FV42-GSV-E1", "RV13-RAS-TP"],
|
||||
["KONTOR-IT-E1", "NETT-SIKR-TP"],
|
||||
"local",
|
||||
ledger=ledger,
|
||||
goals=goals,
|
||||
|
|
@ -192,16 +192,16 @@ async def test_per_project_hard_goal_skips_only_that_pid(make_portfolio_client_f
|
|||
max_rounds=1,
|
||||
)
|
||||
ran = [r.outcome.proposal.project_id for r in result.runs]
|
||||
assert "FV42-GSV-E1" not in ran # its goal is reached -> skipped
|
||||
assert ran == ["RV13-RAS-TP"] # the rest of the pass proceeds
|
||||
assert "KONTOR-IT-E1" not in ran # its goal is reached -> skipped
|
||||
assert ran == ["NETT-SIKR-TP"] # the rest of the pass proceeds
|
||||
assert result.stopped_early is False # a per-project skip is NOT a pass-stop
|
||||
|
||||
|
||||
async def test_soft_goal_flags_but_continues(make_portfolio_client_factory) -> None:
|
||||
ledger = _prefilled("FV42-GSV-E1", 100)
|
||||
ledger = _prefilled("KONTOR-IT-E1", 100)
|
||||
goals = GoalConfig(portfolio=GoalContract(absolute_ore=100, mode="soft"))
|
||||
result = await run_portfolio(
|
||||
["FV42-GSV-E1", "RV13-RAS-TP"],
|
||||
["KONTOR-IT-E1", "NETT-SIKR-TP"],
|
||||
"local",
|
||||
ledger=ledger,
|
||||
goals=goals,
|
||||
|
|
@ -219,7 +219,7 @@ async def test_stop_decision_is_deterministic(make_portfolio_client_factory) ->
|
|||
r1 = await run_portfolio(
|
||||
_PORTFOLIO_IDS,
|
||||
"local",
|
||||
ledger=_prefilled("FV42-GSV-E1", 100),
|
||||
ledger=_prefilled("KONTOR-IT-E1", 100),
|
||||
goals=goals,
|
||||
client_factory=make_portfolio_client_factory({}),
|
||||
max_rounds=1,
|
||||
|
|
@ -227,7 +227,7 @@ async def test_stop_decision_is_deterministic(make_portfolio_client_factory) ->
|
|||
r2 = await run_portfolio(
|
||||
_PORTFOLIO_IDS,
|
||||
"local",
|
||||
ledger=_prefilled("FV42-GSV-E1", 100),
|
||||
ledger=_prefilled("KONTOR-IT-E1", 100),
|
||||
goals=goals,
|
||||
client_factory=make_portfolio_client_factory({}),
|
||||
max_rounds=1,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue