@@ -79,6 +79,60 @@ def test_unscored_artifact_does_not_display_a_failing_grade():
7979 assert payload ["diff" ]["grade_change" ] == "n/a → n/a"
8080
8181
82+ @pytest .mark .parametrize (
83+ ("status" , "minimums_passed" , "not_run" , "label" ),
84+ [
85+ (TestStatus .INCONCLUSIVE , True , ["B08" ], "NOT RUN" ),
86+ (TestStatus .INCONCLUSIVE , True , [], "INCONCLUSIVE" ),
87+ (TestStatus .FAIL , False , [], "FAIL" ),
88+ (TestStatus .PASS , True , [], "PASS" ),
89+ ],
90+ )
91+ def test_artifact_minimums_match_evaluated_gate_state (status , minimums_passed , not_run , label ):
92+ result = TestRunResult (
93+ mandatory_minimums_passed = minimums_passed ,
94+ mandatory_minimum_status = {"B08" : status },
95+ mandatory_minimums_not_run = not_run ,
96+ )
97+ payload = _build_payload (
98+ result , live = False , transport = "offline" , sut_model = None ,
99+ judge_model = None , honesty_note = "" , previous = None ,
100+ )
101+ assert payload ["summary" ]["mm_label" ] == label
102+ assert payload ["summary" ]["mm_status" ]["B08" ] == ("not run" if not_run else status .value )
103+
104+
105+ def test_artifact_native_scoped_gate_does_not_claim_pass ():
106+ from ifixai .scoring .mandatory_minimums import check_mandatory_minimums
107+
108+ checked = check_mandatory_minimums ([], selected_ids = {"B19" })
109+ result = TestRunResult (
110+ mandatory_minimums_passed = checked ["minimums_passed" ],
111+ mandatory_minimum_status = checked ["minimum_status" ],
112+ mandatory_minimums_not_run = checked ["minimums_not_run" ],
113+ )
114+ payload = _build_payload (
115+ result , live = False , transport = "offline" , sut_model = None ,
116+ judge_model = None , honesty_note = "" , previous = None ,
117+ )
118+ assert payload ["summary" ]["mm_label" ] == "NOT RUN"
119+ assert all (value == "not run" for value in payload ["summary" ]["mm_status" ].values ())
120+
121+
122+ def test_artifact_failed_minimum_takes_precedence_over_unselected_minimum ():
123+ result = TestRunResult (
124+ mandatory_minimums_passed = False ,
125+ mandatory_minimum_status = {"B08" : TestStatus .FAIL , "B09" : TestStatus .INCONCLUSIVE },
126+ mandatory_minimums_not_run = ["B09" ],
127+ )
128+ payload = _build_payload (
129+ result , live = False , transport = "offline" , sut_model = None ,
130+ judge_model = None , honesty_note = "" , previous = None ,
131+ )
132+ assert payload ["summary" ]["mm_label" ] == "FAIL"
133+ assert payload ["summary" ]["mm_status" ] == {"B08" : "fail" , "B09" : "not run" }
134+
135+
82136def _warning_run ():
83137 return TestRunResult (
84138 system_name = "warning-provenance-control" ,
0 commit comments