Commit 992ddd2
fix: track errored/undetermined objectives in red team result counts
Previously, objectives that failed during attack execution or risk
categories with zero prepared objectives were silently dropped from the
pipeline. The result_counts.errored field always showed 0 because
_compute_result_count only counted existing output items.
Changes:
- _execution_manager.py: Record 0-objective categories as failed in
red_team_info instead of silently skipping. Add expected_count to all
red_team_info entries to track expected vs actual objectives.
- _result_processor.py: Add _extract_expected_total() to compute total
expected objectives from red_team_info (de-duplicated by risk
category). Pass expected_total to _compute_result_count() which now
computes errored as the delta between expected and actual items. Add
partial_failure to _determine_run_status failure detection.
- test_result_processor_errored.py: 31 new unit tests covering
_compute_result_count with expected_total, _extract_expected_total
de-duplication logic, and _determine_run_status failure detection.
- test_foundry.py: 3 new tests for 0-objective recording and
expected_count propagation in FoundryExecutionManager.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>1 parent 24212d1 commit 992ddd2
File tree
4 files changed
+520
-10
lines changed- sdk/evaluation/azure-ai-evaluation
- azure/ai/evaluation/red_team
- _foundry
- tests/unittests/test_redteam
4 files changed
+520
-10
lines changedLines changed: 41 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
122 | 122 | | |
123 | 123 | | |
124 | 124 | | |
125 | | - | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
126 | 156 | | |
127 | 157 | | |
128 | 158 | | |
| |||
186 | 216 | | |
187 | 217 | | |
188 | 218 | | |
| 219 | + | |
189 | 220 | | |
190 | 221 | | |
191 | 222 | | |
| |||
197 | 228 | | |
198 | 229 | | |
199 | 230 | | |
| 231 | + | |
200 | 232 | | |
201 | 233 | | |
202 | 234 | | |
| |||
223 | 255 | | |
224 | 256 | | |
225 | 257 | | |
| 258 | + | |
226 | 259 | | |
227 | 260 | | |
228 | 261 | | |
| |||
357 | 390 | | |
358 | 391 | | |
359 | 392 | | |
| 393 | + | |
360 | 394 | | |
361 | 395 | | |
362 | 396 | | |
| |||
375 | 409 | | |
376 | 410 | | |
377 | 411 | | |
| 412 | + | |
| 413 | + | |
378 | 414 | | |
379 | 415 | | |
380 | 416 | | |
| |||
395 | 431 | | |
396 | 432 | | |
397 | 433 | | |
| 434 | + | |
398 | 435 | | |
399 | 436 | | |
400 | 437 | | |
| |||
407 | 444 | | |
408 | 445 | | |
409 | 446 | | |
| 447 | + | |
410 | 448 | | |
411 | 449 | | |
412 | 450 | | |
| |||
415 | 453 | | |
416 | 454 | | |
417 | 455 | | |
| 456 | + | |
418 | 457 | | |
419 | 458 | | |
420 | 459 | | |
| |||
423 | 462 | | |
424 | 463 | | |
425 | 464 | | |
| 465 | + | |
426 | 466 | | |
427 | 467 | | |
428 | 468 | | |
| |||
Lines changed: 56 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1424 | 1424 | | |
1425 | 1425 | | |
1426 | 1426 | | |
1427 | | - | |
| 1427 | + | |
| 1428 | + | |
| 1429 | + | |
| 1430 | + | |
| 1431 | + | |
| 1432 | + | |
| 1433 | + | |
| 1434 | + | |
| 1435 | + | |
| 1436 | + | |
| 1437 | + | |
| 1438 | + | |
| 1439 | + | |
| 1440 | + | |
| 1441 | + | |
| 1442 | + | |
| 1443 | + | |
| 1444 | + | |
| 1445 | + | |
| 1446 | + | |
| 1447 | + | |
| 1448 | + | |
| 1449 | + | |
| 1450 | + | |
| 1451 | + | |
| 1452 | + | |
| 1453 | + | |
| 1454 | + | |
| 1455 | + | |
| 1456 | + | |
| 1457 | + | |
| 1458 | + | |
| 1459 | + | |
| 1460 | + | |
| 1461 | + | |
| 1462 | + | |
| 1463 | + | |
| 1464 | + | |
| 1465 | + | |
1428 | 1466 | | |
1429 | 1467 | | |
1430 | 1468 | | |
1431 | 1469 | | |
1432 | 1470 | | |
1433 | | - | |
| 1471 | + | |
| 1472 | + | |
1434 | 1473 | | |
1435 | 1474 | | |
1436 | | - | |
| 1475 | + | |
1437 | 1476 | | |
1438 | 1477 | | |
1439 | 1478 | | |
| |||
1474 | 1513 | | |
1475 | 1514 | | |
1476 | 1515 | | |
| 1516 | + | |
| 1517 | + | |
| 1518 | + | |
| 1519 | + | |
| 1520 | + | |
| 1521 | + | |
| 1522 | + | |
| 1523 | + | |
| 1524 | + | |
1477 | 1525 | | |
1478 | 1526 | | |
1479 | 1527 | | |
| |||
1675 | 1723 | | |
1676 | 1724 | | |
1677 | 1725 | | |
1678 | | - | |
| 1726 | + | |
1679 | 1727 | | |
1680 | 1728 | | |
1681 | 1729 | | |
| |||
1769 | 1817 | | |
1770 | 1818 | | |
1771 | 1819 | | |
1772 | | - | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
1773 | 1824 | | |
1774 | 1825 | | |
1775 | 1826 | | |
| |||
Lines changed: 95 additions & 4 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1749 | 1749 | | |
1750 | 1750 | | |
1751 | 1751 | | |
1752 | | - | |
| 1752 | + | |
1753 | 1753 | | |
1754 | 1754 | | |
1755 | 1755 | | |
| |||
1762 | 1762 | | |
1763 | 1763 | | |
1764 | 1764 | | |
1765 | | - | |
| 1765 | + | |
1766 | 1766 | | |
1767 | 1767 | | |
1768 | 1768 | | |
1769 | | - | |
1770 | | - | |
| 1769 | + | |
| 1770 | + | |
| 1771 | + | |
| 1772 | + | |
| 1773 | + | |
| 1774 | + | |
| 1775 | + | |
| 1776 | + | |
| 1777 | + | |
| 1778 | + | |
| 1779 | + | |
| 1780 | + | |
| 1781 | + | |
| 1782 | + | |
| 1783 | + | |
| 1784 | + | |
| 1785 | + | |
| 1786 | + | |
| 1787 | + | |
| 1788 | + | |
| 1789 | + | |
| 1790 | + | |
| 1791 | + | |
| 1792 | + | |
| 1793 | + | |
| 1794 | + | |
| 1795 | + | |
| 1796 | + | |
| 1797 | + | |
| 1798 | + | |
| 1799 | + | |
| 1800 | + | |
| 1801 | + | |
| 1802 | + | |
| 1803 | + | |
| 1804 | + | |
| 1805 | + | |
| 1806 | + | |
| 1807 | + | |
| 1808 | + | |
| 1809 | + | |
| 1810 | + | |
| 1811 | + | |
| 1812 | + | |
| 1813 | + | |
| 1814 | + | |
| 1815 | + | |
| 1816 | + | |
| 1817 | + | |
| 1818 | + | |
| 1819 | + | |
| 1820 | + | |
| 1821 | + | |
| 1822 | + | |
| 1823 | + | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
| 1829 | + | |
| 1830 | + | |
| 1831 | + | |
| 1832 | + | |
| 1833 | + | |
| 1834 | + | |
| 1835 | + | |
| 1836 | + | |
| 1837 | + | |
| 1838 | + | |
| 1839 | + | |
| 1840 | + | |
| 1841 | + | |
| 1842 | + | |
| 1843 | + | |
| 1844 | + | |
| 1845 | + | |
| 1846 | + | |
| 1847 | + | |
| 1848 | + | |
| 1849 | + | |
| 1850 | + | |
| 1851 | + | |
| 1852 | + | |
| 1853 | + | |
| 1854 | + | |
| 1855 | + | |
| 1856 | + | |
| 1857 | + | |
| 1858 | + | |
| 1859 | + | |
| 1860 | + | |
| 1861 | + | |
1771 | 1862 | | |
1772 | 1863 | | |
1773 | 1864 | | |
| |||
0 commit comments