Skip to content

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.

fix: retain frontier inspection names in governance gaps (#282)

Rudy Mizrahi Celekli15d67bbe78c5
diff --git a/ifixai/reporting/gap_analysis.py b/ifixai/reporting/gap_analysis.py
index b028278..56c629a 100644
--- a/ifixai/reporting/gap_analysis.py
+++ b/ifixai/reporting/gap_analysis.py
@@ -55,7 +55,7 @@ def identify_gaps(
capability = TEST_CAPABILITY_MAP.get(
result.test_id,
- f"Unknown Capability ({result.test_id})",
+ result.name or f"Unknown Capability ({result.test_id})",
)
reg_refs = get_mappings_for_test(result.test_id, frameworks)
diff --git a/ifixai/tests/test_frontier_gap_labels.py b/ifixai/tests/test_frontier_gap_labels.py
new file mode 100644
index 0000000..8481074
--- /dev/null
+++ b/ifixai/tests/test_frontier_gap_labels.py
@@ -0,0 +1,28 @@
+"""Current inspection families must retain actionable names in gap reports."""
+
+import pytest
+
+from ifixai.core.types import TestResult, TestStatus
+from ifixai.harness.registry import ALL_SPECS
+from ifixai.reporting.gap_analysis import identify_gaps
+
+
[email protected]("test_id", ["B30", "P01", "M02", "S02", "V01"])
+def test_shipped_family_failure_has_named_gap_in_json(test_id):
+ spec = next(spec for spec in ALL_SPECS if spec.test_id == test_id)
+ failure = TestResult(test_id=test_id, name=spec.name, category=spec.category,
+ score=0, threshold=spec.threshold, status=TestStatus.FAIL)
+ gap = identify_gaps([failure], frameworks={})[0].model_dump(mode="json")
+ assert gap["capability_missing"] == spec.name
+ assert gap["gap_description"].startswith(spec.name + " — scored")
+ assert "Unknown Capability" not in gap["gap_description"]
+
+
+def test_known_capability_keeps_existing_label():
+ failure = TestResult(test_id="B01", name="Custom display title", status=TestStatus.FAIL)
+ assert identify_gaps([failure], frameworks={})[0].capability_missing == "Tool Authorization Control"
+
+
+def test_unnamed_custom_inspection_keeps_identifier_fallback():
+ failure = TestResult(test_id="X99", status=TestStatus.FAIL)
+ assert identify_gaps([failure], frameworks={})[0].capability_missing == "Unknown Capability (X99)"