Skip to content

Commit 98f70f7

Browse files
committed
test(judge): pin global facet-size ceiling
1 parent d8d9fa1 commit 98f70f7

1 file changed

Lines changed: 16 additions & 1 deletion

File tree

tests/test_judge_construct_projection_identity.py

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,14 @@
1-
"""Regression tests for judge-construct item identity and column ordering."""
1+
"""Regression tests for judge-construct identity and policy boundaries."""
22

33
from __future__ import annotations
44

55
import numpy as np
66
import pytest
77

88
from fast_mlsirm.judge_construct import (
9+
JudgeConstructPolicy,
910
JudgeFormatError,
11+
MAX_JUDGE_CONSTRUCT_ITEMS,
1012
project_judge_results_to_matrix,
1113
validate_judge_construct,
1214
)
@@ -67,3 +69,16 @@ def test_projection_columns_follow_spec_criterion_order() -> None:
6769

6870
assert matrix.dtype == np.int64
6971
assert matrix.tolist() == [[3, 0, 2, 1, 1]]
72+
73+
74+
def test_custom_policy_cannot_raise_hard_facet_ceiling() -> None:
75+
"""Custom quality policy may tighten, but never exceed, the package cap."""
76+
with pytest.raises(
77+
ValueError,
78+
match=rf"max_items cannot exceed {MAX_JUDGE_CONSTRUCT_ITEMS}",
79+
):
80+
JudgeConstructPolicy(
81+
min_items=5,
82+
recommended_items=7,
83+
max_items=MAX_JUDGE_CONSTRUCT_ITEMS + 1,
84+
)

0 commit comments

Comments
 (0)