test: neutral names for the reference path and the office-IT baseline

Rename the reference-project helpers and test names (_reference_k,
test_reference_path_*) and the cost-baseline helper (_kontor_it_baseline,
which already returned KONTOR-IT-E1). Names only; no assertion changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Kjell Tore Guttormsen 2026-09-23 17:31:13 +02:00
commit 9cdbd57cf6
Signed by: ktg
SSH key fingerprint: SHA256:JakMjO6FTBBzN0Bhfj9saOoEjaFxlSdYuZQQpM/lF9Q
8 changed files with 25 additions and 22 deletions

View file

@ -137,7 +137,7 @@ async def test_provenance_records_an_anchored_bundle_run(fresh_store) -> None:
assert result.provenance.cost_baseline_anchored is True
async def test_road_path_is_anchored_by_construction(docs_dir, fresh_store) -> None:
async def test_reference_path_is_anchored_by_construction(docs_dir, fresh_store) -> None:
"""The reference path derives its baseline from the reference project's own ``cost_items``, so it is
ALWAYS anchored — the stamp says so rather than leaving the reader to know it."""
result = await run_project(

View file

@ -219,7 +219,7 @@ async def test_the_run_stamps_which_source_answered_and_completes(
)
async def test_the_road_path_stamps_no_bundle_identity_at_all(
async def test_the_reference_path_stamps_no_bundle_identity_at_all(
docs_dir: Any, fresh_store: Any
) -> None:
"""(e, control) A run with no knowledge base has no bundle identity, and says so by ABSENCE

View file

@ -75,7 +75,7 @@ def test_neither_flag_is_still_refused_by_name(capsys: pytest.CaptureFixture[str
assert "run refused" in err and "--docs-dir" in err and "--bundle-dir" in err
def test_the_road_path_still_requires_a_real_docs_dir(
def test_the_reference_path_still_requires_a_real_docs_dir(
tmp_path: Path, capsys: pytest.CaptureFixture[str]
) -> None:
"""(d) The anti-omvei arm. With no bundle, ``--docs-dir`` is still the only door AND it is

View file

@ -249,7 +249,7 @@ async def test_run_result_carries_the_trace(tmp_path, fresh_store) -> None:
assert [s.target for s in result.skipped_links] == [_DANGLING]
async def test_road_path_has_an_empty_trace(docs_dir, fresh_store) -> None:
async def test_reference_path_has_an_empty_trace(docs_dir, fresh_store) -> None:
"""The reference path navigates no bundle, so "nothing was skipped" is literally true there — which
is exactly why the empty tuple is an honest DEFAULT rather than a withheld fact."""
result = await run_project(

View file

@ -40,7 +40,7 @@ from test_portfolio import REPLIES
from test_portfolio_learning_loadbearing import (
_ALIGNED_REPLY,
_bundle_kplus1,
_road_k,
_reference_k,
)
from portfolio_optimiser import ledger as ledger_mod
@ -797,7 +797,7 @@ async def test_intra_wave_visibility_is_the_documented_semantic_difference(
# rebuilt fixture would present as "the sentinel stopped arriving", i.e. as the very semantic
# difference this test claims to measure. The ``failures`` assertions below exist so that
# confusion can never happen silently again.
pair = (_road_k(tmp_path, rationale=sentinel), _bundle_kplus1(tmp_path))
pair = (_reference_k(tmp_path, rationale=sentinel), _bundle_kplus1(tmp_path))
monkeypatch.setattr("portfolio_optimiser.run.load_reference_projects", lambda: pair)
# k=1 — two waves. The control: the cross-project fold fires and the sentinel arrives.

View file

@ -57,7 +57,7 @@ def _make_docs(tmp_path, name: str) -> str:
return str(d)
def _road_k(tmp_path, *, rationale: str) -> Project:
def _reference_k(tmp_path, *, rationale: str) -> Project:
return Project(
id="REF-K",
name="Reference k",
@ -92,7 +92,7 @@ async def test_verdict_on_k_reaches_kplus1_hypothesis_prompt(
*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 reference
path → the Step-1 fold is skipped → the sentinel never arrives → RED."""
k = _road_k(tmp_path, rationale=_SENTINEL)
k = _reference_k(tmp_path, rationale=_SENTINEL)
kplus1 = _bundle_kplus1(tmp_path)
monkeypatch.setattr("portfolio_optimiser.run.load_reference_projects", lambda: (k, kplus1))
factory, recorded = make_recording_client_factory(_ALIGNED_REPLY)
@ -120,7 +120,7 @@ async def test_kplus1_alone_against_fresh_store_carries_no_signal(
"""T-2.0b CAUSALITY CONTROL: running ONLY *k+1* against a fresh (empty) store carries the
sentinel into NO prompt — proving the signal in T-2.0a is caused by the threaded store, not
incidental to the fixture (makes the positive test genuinely load-bearing)."""
k = _road_k(tmp_path, rationale=_SENTINEL)
k = _reference_k(tmp_path, rationale=_SENTINEL)
kplus1 = _bundle_kplus1(tmp_path)
monkeypatch.setattr("portfolio_optimiser.run.load_reference_projects", lambda: (k, kplus1))
factory, recorded = make_recording_client_factory(_ALIGNED_REPLY)
@ -158,7 +158,7 @@ async def test_dropped_verdict_in_kplus1_inbox_reaches_store(
)
write_verdict(str(inbox), dropped)
k = _road_k(tmp_path, rationale=_SENTINEL)
k = _reference_k(tmp_path, rationale=_SENTINEL)
kplus1 = _bundle_kplus1(tmp_path, verdict_dir=str(inbox))
monkeypatch.setattr("portfolio_optimiser.run.load_reference_projects", lambda: (k, kplus1))
factory, _recorded = make_recording_client_factory(_ALIGNED_REPLY)

View file

@ -59,7 +59,7 @@ _FAKE_UNIT_COST = 10_000_000.0
_FAKE_CLAIM = 3_000_000.0
def _fv42_baseline() -> CostBaseline:
def _kontor_it_baseline() -> CostBaseline:
return baseline_from_project(
next(p for p in load_reference_projects() if p.id == "KONTOR-IT-E1")
)
@ -83,7 +83,7 @@ def test_fabricated_cost_code_is_rejected() -> None:
rejected, even though its own arithmetic clears the LP/P90/nominal stages. Detach the
reconciliation stage and the SAME proposal validates."""
result = validate_proposal(
_proposal(_FAKE_CODE, 1.0, _FAKE_UNIT_COST, _FAKE_CLAIM), baseline=_fv42_baseline()
_proposal(_FAKE_CODE, 1.0, _FAKE_UNIT_COST, _FAKE_CLAIM), baseline=_kontor_it_baseline()
)
assert isinstance(result, Rejection), "a hallucinated cost code must never reach validated"
assert "unknown cost code" in result.reason
@ -95,7 +95,8 @@ def test_real_baseline_line_still_validates() -> None:
rejection above is caused by the code being absent from the baseline, not by the new stage
rejecting everything."""
result = validate_proposal(
_proposal(_REAL_CODE, _REAL_QTY, _REAL_UNIT_COST, _REAL_CLAIM), baseline=_fv42_baseline()
_proposal(_REAL_CODE, _REAL_QTY, _REAL_UNIT_COST, _REAL_CLAIM),
baseline=_kontor_it_baseline(),
)
assert isinstance(result, ValidatedProposal)
@ -117,7 +118,7 @@ def test_inflated_unit_cost_on_a_real_code_is_rejected() -> None:
line then validates, because the code itself is genuine."""
inflated = _REAL_UNIT_COST * 1.20
result = validate_proposal(
_proposal(_REAL_CODE, _REAL_QTY, inflated, _REAL_CLAIM), baseline=_fv42_baseline()
_proposal(_REAL_CODE, _REAL_QTY, inflated, _REAL_CLAIM), baseline=_kontor_it_baseline()
)
assert isinstance(result, Rejection)
assert "unit_cost" in result.reason and _REAL_CODE in result.reason
@ -127,7 +128,7 @@ def test_inflated_quantity_on_a_real_code_is_rejected() -> None:
"""RED: the same for quantity — a real code at an invented quantity (+20%) is rejected."""
result = validate_proposal(
_proposal(_REAL_CODE, _REAL_QTY * 1.20, _REAL_UNIT_COST, _REAL_CLAIM),
baseline=_fv42_baseline(),
baseline=_kontor_it_baseline(),
)
assert isinstance(result, Rejection)
assert "quantity" in result.reason
@ -139,7 +140,7 @@ def test_within_tolerance_deviation_is_admitted() -> None:
at all."""
result = validate_proposal(
_proposal(_REAL_CODE, _REAL_QTY, _REAL_UNIT_COST * 1.02, _REAL_CLAIM),
baseline=_fv42_baseline(),
baseline=_kontor_it_baseline(),
)
assert isinstance(result, ValidatedProposal)
@ -149,7 +150,7 @@ def test_tolerance_is_configurable() -> None:
caller-supplied tolerance."""
result = validate_proposal(
_proposal(_REAL_CODE, _REAL_QTY, _REAL_UNIT_COST * 1.02, _REAL_CLAIM),
baseline=_fv42_baseline(),
baseline=_kontor_it_baseline(),
tolerance=0.001,
)
assert isinstance(result, Rejection)
@ -204,7 +205,9 @@ def _factory(reply: str):
return factory
async def test_road_path_anchors_the_gate_to_the_reference_baseline(docs_dir, fresh_store) -> None:
async def test_reference_path_anchors_the_gate_to_the_reference_baseline(
docs_dir, fresh_store
) -> None:
"""RED (reference wiring): a numerically-impeccable fabricated cost line is REJECTED end-to-end
through ``run_project``. Detach the reference-path baseline (stop passing it) and the same run
returns a ValidatedProposal."""
@ -220,7 +223,7 @@ async def test_road_path_anchors_the_gate_to_the_reference_baseline(docs_dir, fr
assert "unknown cost code" in result.outcome.reason
async def test_road_path_control_real_line_validates(docs_dir, fresh_store) -> None:
async def test_reference_path_control_real_line_validates(docs_dir, fresh_store) -> None:
"""Causality control for the reference wiring: the real 05.2 line validates through the same path."""
result = await run_project(
"KONTOR-IT-E1",

View file

@ -241,7 +241,7 @@ def _make_docs(tmp_path: Path, name: str) -> str:
return str(d)
def _road_k(tmp_path: Path, *, verdict_input: dict[str, str] | None) -> Project:
def _reference_k(tmp_path: Path, *, verdict_input: dict[str, str] | None) -> Project:
return Project(
id="REF-K",
name="Reference k",
@ -275,7 +275,7 @@ async def test_a_given_verdict_on_k_does_reach_kplus1(
"""T4 CONTROL (mirrors ``test_portfolio_learning_loadbearing``): when an expert DID review
project *k*, that verdict reaches *k+1*'s hypothesis prompt. This is the event T5 denies —
proving first that it can happen is what makes T5's negative assert mean anything."""
k = _road_k(tmp_path, verdict_input={"decision": "approved", "rationale": _SENTINEL})
k = _reference_k(tmp_path, verdict_input={"decision": "approved", "rationale": _SENTINEL})
kplus1 = _bundle_kplus1(tmp_path)
monkeypatch.setattr("portfolio_optimiser.run.load_reference_projects", lambda: (k, kplus1))
factory, recorded = make_recording_client_factory(_ALIGNED_REPLY)
@ -295,7 +295,7 @@ async def test_an_ungiven_verdict_on_k_never_reaches_kplus1(
prompt — no verdict is minted, none enters the shared store, and *k*'s candidate key never
shows up as a prior judgement. RED before the seam: *k* minted an ``approved`` verdict from a
``verdict_input`` no expert supplied, and the threaded store carried it forward."""
k = _road_k(tmp_path, verdict_input=None)
k = _reference_k(tmp_path, verdict_input=None)
kplus1 = _bundle_kplus1(tmp_path)
monkeypatch.setattr("portfolio_optimiser.run.load_reference_projects", lambda: (k, kplus1))
factory, recorded = make_recording_client_factory(_ALIGNED_REPLY)