Skip to content

Commit 8044fe6

Browse files
test: migrate A11 override regression to typed evidence
1 parent e2e35ae commit 8044fe6

1 file changed

Lines changed: 27 additions & 9 deletions

File tree

‎tests/test_classification.py‎

Lines changed: 27 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88
from liouscope import (
99
A_CLASSES,
1010
DIAGNOSTIC_SCHEMA_VERSION,
11+
ENSEMBLE_MPEMBA_CONFIRMED,
1112
F_FAMILIES,
1213
TAXONOMY_VERSION,
14+
EnsembleEvidence,
1315
build_liouvillian,
1416
classify_mechanism,
1517
diagnose,
@@ -215,6 +217,24 @@ def _mpemba(**kw) -> MpembaResult:
215217
return MpembaResult(**base)
216218

217219

220+
def _passing_ensemble_evidence() -> EnsembleEvidence:
221+
return EnsembleEvidence(
222+
manifest_sha256="1" * 64,
223+
initial_state_family="thermal Gibbs family",
224+
ordering_parameter="inverse_temperature_beta",
225+
run_ids=("2" * 64, "3" * 64),
226+
input_hashes=("4" * 64, "5" * 64),
227+
relaxation_metric="trace_distance",
228+
comparison_test="family_ordered_crossing_test",
229+
uncertainty_method="BCa bootstrap 95% CI with multiplicity control",
230+
software_version="0.6.0.dev0",
231+
gate_status="PASS",
232+
reason_code=ENSEMBLE_MPEMBA_CONFIRMED,
233+
producer_attestation_sha256="6" * 64,
234+
reviewer_attestation_sha256="7" * 64,
235+
)
236+
237+
218238
def _classify(
219239
*,
220240
spectral=None,
@@ -224,7 +244,7 @@ def _classify(
224244
transient=None,
225245
lep=None,
226246
mpemba=None,
227-
ensemble_confirmation=False,
247+
ensemble_evidence=None,
228248
):
229249
return classify_mechanism(
230250
spectral=spectral or _spectral(),
@@ -234,7 +254,7 @@ def _classify(
234254
transient=transient or _transient(),
235255
lep=lep or _lep(),
236256
mpemba=mpemba,
237-
ensemble_confirmation=ensemble_confirmation,
257+
ensemble_evidence=ensemble_evidence,
238258
)
239259

240260

@@ -303,16 +323,14 @@ def test_a11_single_state_maximally_mixed_is_undetermined():
303323
assert cls.evidence["ensemble_confirmation"] == 0.0
304324

305325

306-
def test_a11_maximally_mixed_ensemble_override_suppresses_floor():
307-
# The exclusion is CONDITIONAL: a reference-ensemble Mpemba confirmation
308-
# (ensemble_confirmation=True) suppresses the downgrade, so the SAME
309-
# maximally-mixed A11 evidence is once again allowed to be a CANDIDATE. This
310-
# pins the ensemble-override hook/contract (a future thermal-family path plugs
311-
# in here without re-touching the floor logic).
326+
def test_a11_maximally_mixed_ensemble_evidence_suppresses_floor():
327+
# The exclusion is CONDITIONAL: validated reference-family evidence may
328+
# suppress the downgrade, so the same maximally-mixed A11 evidence is once
329+
# again allowed to be a CANDIDATE. A caller-controlled Boolean is not enough.
312330
cls = _classify(
313331
spectral=_maxmix_spectral(2),
314332
mpemba=_mpemba(overlap_c1=1.0e-6),
315-
ensemble_confirmation=True,
333+
ensemble_evidence=_passing_ensemble_evidence(),
316334
)
317335
assert (cls.a_class, cls.f_family) == ("A11", "F4")
318336
assert cls.verdict == VERDICT_CANDIDATE

0 commit comments

Comments
 (0)