Dominant secondary-glazing split resolves deterministically to SECONDARY 🟥

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
Jun-te Kim 2026-07-02 11:09:47 +00:00
parent f873d5cad3
commit 787f0066c8

View file

@ -63,10 +63,31 @@ def test_dominant_era_stated_double_or_triple_resolves_deterministically(
assert result is expected
@pytest.mark.parametrize(
"description",
[
"95% secondary glazing (sap 9.94), 5% single glazing",
"90% secondary glazing, 10% double glazing 2002 or later",
],
)
def test_dominant_secondary_glazing_resolves_to_secondary(description: str) -> None:
# Secondary glazing is era-free like single (SAP10 code 5, U = 2.9 regardless
# of install year), so a dominant-secondary split is fully determined — the
# guard must claim it rather than let the LLM flatten it onto the minority
# type (Model#1416).
# Act
result = glazing_mix_guard(description)
# Assert
assert result is GlazingType.SECONDARY
@pytest.mark.parametrize(
"description",
[
"100% double glazing 2002 or later", # uniform — one type
"100% secondary glazing (sap 9.94)", # uniform — one type
"90% double glazing unknown age, 10% single glazing", # dominant but era unstated
"80% double glazing 2002 or later, 20% double glazing pre-2002", # same base type
"some double glazing and a bit of single", # unparseable — no percentages