Eski hakem-ornegi sozlesmesini M0-5'e gore guncelle
Browse files at this commit6463c8f66464db59a05bbd40bee32b63ee5e34baParent: 3df3aa6- test
- eski hakem-ornegi sozlesmesini M0-5'e gore guncelle
1 changed file +30 -2
tests/unit/test_eval_runner.pymodified+30 -2
| @@ -23,6 +23,18 @@ def _item(id, beh="cevapla", critical=False, unite=None, | |||
| 23 | 23 | ||
| 24 | 24 | ||
| 25 | class SelectJudgeIdsTests(unittest.TestCase): | 25 | class SelectJudgeIdsTests(unittest.TestCase): |
| 26 | + """M0-5 (#37) ile sözleşme DEĞİŞTİ. | ||
| 27 | + | ||
| 28 | + Bu testin eski hâli `assertNotIn("b", ids)` diyordu — yani "ünitesi zaten | ||
| 29 | + temsil edilen, critical olmayan item hakemsiz kalır". Ölçüldüğünde (EXP-010/ | ||
| 30 | + EVAL-04) bunun sonucu şuydu: bio v1.1'de `kolay` (46) ve `orta` (53) | ||
| 31 | + item'ların TAMAMI hakemsiz kaldı, kimya/fizik'te judge n=0 oldu. Yani o | ||
| 32 | + assertion bir DAVRANIŞ GARANTİSİ değil, YETERSİZ ÖRNEKLEMENİN kaydıydı. | ||
| 33 | + | ||
| 34 | + Yeni sözleşme: critical'lar zorunlu + her tabaka/ünite en az 1 + kalan kota | ||
| 35 | + `JUDGE_SAMPLE_N`e kadar orantılı doldurulur. Küçük havuzda bu, havuzun | ||
| 36 | + tamamının seçilmesi demektir (istenen davranış).""" | ||
| 37 | + | ||
| 26 | def test_critical_and_unite_backfill(self): | 38 | def test_critical_and_unite_backfill(self): |
| 27 | items = [ | 39 | items = [ |
| 28 | {"id": "a", "beklenen_davranis": "cevapla", "critical": True, "unite": "U1"}, | 40 | {"id": "a", "beklenen_davranis": "cevapla", "critical": True, "unite": "U1"}, |
| @@ -33,8 +45,24 @@ class SelectJudgeIdsTests(unittest.TestCase): | |||
| 33 | ids = R._select_judge_ids(items) | 45 | ids = R._select_judge_ids(items) |
| 34 | self.assertIn("a", ids) # critical cevapla | 46 | self.assertIn("a", ids) # critical cevapla |
| 35 | self.assertIn("c", ids) # U2 temsil edilmemişti → backfill | 47 | self.assertIn("c", ids) # U2 temsil edilmemişti → backfill |
| 36 | - self.assertNotIn("b", ids) # U1 zaten 'a' ile temsil | 48 | + self.assertNotIn("d", ids) # red → hakem yok (DEĞİŞMEDİ) |
| 37 | - self.assertNotIn("d", ids) # red → hakem yok | 49 | + # kota (40) havuzdan (3) büyük olduğu için "b" de girer — istenen davranış |
| 50 | + self.assertIn("b", ids) | ||
| 51 | + | ||
| 52 | + def test_small_quota_still_prioritises_critical_and_coverage(self): | ||
| 53 | + """Kota kısıtlıyken önce critical + tabaka/ünite kapsaması gelir.""" | ||
| 54 | + items = [ | ||
| 55 | + {"id": "a", "beklenen_davranis": "cevapla", "critical": True, | ||
| 56 | + "unite": "U1", "kategori": "zor"}, | ||
| 57 | + {"id": "b", "beklenen_davranis": "cevapla", "critical": False, | ||
| 58 | + "unite": "U1", "kategori": "zor"}, | ||
| 59 | + {"id": "c", "beklenen_davranis": "cevapla", "critical": False, | ||
| 60 | + "unite": "U2", "kategori": "kolay"}, | ||
| 61 | + ] | ||
| 62 | + ids = R._select_judge_ids(items, sample_n=2) | ||
| 63 | + self.assertIn("a", ids) # critical | ||
| 64 | + self.assertIn("c", ids) # yeni tabaka (kolay) + yeni ünite (U2) | ||
| 65 | + self.assertNotIn("b", ids) # aynı tabaka+ünite, kota yok | ||
| 38 | 66 | ||
| 39 | def test_missing_unite_no_crash(self): | 67 | def test_missing_unite_no_crash(self): |
| 40 | items = [{"id": "x", "beklenen_davranis": "cevapla", "critical": True}] # unite yok | 68 | items = [{"id": "x", "beklenen_davranis": "cevapla", "critical": True}] # unite yok |