Independent Auditing of AI Agents. Run by human or the agent itself, to answer the most crucial question in the AI Agent Economy. Is the agent doing what is supposed to do? With iFixAi you can have this answer in less than 120 seconds.
Python agent-evaluationaiai-alignmentai-evaluationai-governanceai-safetyclidiagnostic-tooleu-ai-acthallucination-detectioniso-42001llm-evaluationllm-securitynist-ai-rmfowasp-llmprompt-injectionpythonresponsible-airisk-assessmentrisk-management
fix(reporting): label empty-reply inconclusive results consistently in Markdown (#332)
Rudy Mizrahi Celeklie40bd4d71f92
diff --git a/ifixai/reporting/scorecard.py b/ifixai/reporting/scorecard.pyindex 6fe9fdc..607e3fe 100644--- a/ifixai/reporting/scorecard.py+++ b/ifixai/reporting/scorecard.py@@ -951,7 +951,9 @@ _STATUS_LABELS: Final[dict[TestStatus, str]] = {def _format_test_status(br: TestResult) -> str:- if br.error:+ # An empty SUT reply is INCONCLUSIVE with ``error`` set (see BaseTest.run);+ # keep the label consistent with the JSON and HTML exports.+ if br.error and br.status != TestStatus.INCONCLUSIVE:return _STATUS_LABELS[TestStatus.ERROR]return _STATUS_LABELS.get(br.status, _STATUS_LABELS[TestStatus.FAIL])diff --git a/ifixai/tests/test_markdown_inconclusive_status.py b/ifixai/tests/test_markdown_inconclusive_status.pynew file mode 100644index 0000000..0827fad--- /dev/null+++ b/ifixai/tests/test_markdown_inconclusive_status.py@@ -0,0 +1,60 @@+import json++from ifixai.core.types import (+ InspectionCategory,+ TestGrade,+ TestResult,+ TestRunResult,+ TestStatus,+)+from ifixai.reporting.scorecard import generate_json_report, generate_markdown_report+++def _run(result: TestResult) -> TestRunResult:+ return TestRunResult(+ system_name="demo",+ provider="mock",+ fixture_name="default",+ overall_score=None,+ grade=TestGrade.F,+ strategic_score=0.0,+ test_results=[result],+ category_scores=[],+ )+++def _b01_row(run: TestRunResult) -> str:+ return next(+ line for line in generate_markdown_report(run).splitlines() if line.startswith("| B01 ")+ )+++def _result(status: TestStatus, **extra) -> TestResult:+ return TestResult(+ test_id="B01",+ name="Tool Invocation Governance",+ category=InspectionCategory.FABRICATION,+ score=0.0,+ threshold=1.0,+ passed=False,+ passing=False,+ status=status,+ evidence=[],+ error="provider returned empty content",+ error_message="provider returned empty content",+ **extra,+ )+++def test_empty_content_inconclusive_is_not_labelled_error():+ # Same shape BaseTest.run returns for ProviderEmptyContentError.+ run = _run(_result(TestStatus.INCONCLUSIVE, insufficient_evidence=True))+ row = _b01_row(run)+ assert row.endswith("| INCONCLUSIVE |")+ assert "ERROR" not in row+ assert json.loads(generate_json_report(run))["test_results"][0]["status"] == "inconclusive"+++def test_errored_inspection_is_still_labelled_error():+ assert _b01_row(_run(_result(TestStatus.FAIL))).endswith("| **ERROR** |")+ assert _b01_row(_run(_result(TestStatus.ERROR))).endswith("| **ERROR** |")