from gal_fingerprint_i.corpus import build_realizations, read_primary_ids, registered_asset_report


def test_registered_assets_and_gate_c_counts():
    assert len(read_primary_ids()) == 121
    report = registered_asset_report()
    assert report["primary_count"] == 121
    assert report["missing_ladders"] == []
    assert report["ladder_file_hashes_matching_manifest"] == 121
    assert len(build_realizations("LEAVE_ONE_RADIUS_OUT")) == 782
    assert len(build_realizations("THINNING_N10_DETERMINISTIC")) == 121
    assert len(build_realizations("COVERAGE")) == 242
    assert len(build_realizations("ML_SENSITIVITY")) == 302


def test_random_thinning_is_separate_and_locked_count():
    deterministic = build_realizations("THINNING_N10_DETERMINISTIC")
    random = build_realizations("THINNING_N10_RANDOM")
    assert len(deterministic) == 121
    assert len(random) == 363
    assert all(row.realization_id == "T_DET10" for row in deterministic)
    assert all(row.realization_id.startswith("T_RAND10_S") for row in random)
    assert {row.generation_seed for row in random} == {91001, 91002, 91003}
