from gal_fingerprint_i.evidence import gate_b_evidence_report, repeat_bundle
from gal_fingerprint_i.gate_c import load_reference


def test_gate_b_evidence_hashes_and_reference_loading():
    report = gate_b_evidence_report()
    assert report["gate_b_pass"] is True
    assert all(report["repeats"][r]["hash_match"] for r in ["R2", "R3", "R4", "R5"])
    assert repeat_bundle("R2").result_sha256 == "edf91d5e904502f44db5bd9209924b54302e51a11f66a0198634b9b0d588e7e4"
    ids, reference, sources = load_reference()
    assert len(ids) == 121
    assert reference["rho"].shape == (121, 40)
    assert reference["Ak"].shape == (121, 40)
    assert reference["nu_V"].shape == (121, 40)
    assert set(sources["source_sha256"]) == {"R1", "R2", "R3", "R4", "R5"}
