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): convert offset timestamps before labeling UTC (#175)
Rudy Mizrahi Celekli43a4491888c3
diff --git a/ifixai/reporting/artifact.py b/ifixai/reporting/artifact.pyindex 4728913..d18e980 100644--- a/ifixai/reporting/artifact.py+++ b/ifixai/reporting/artifact.py@@ -33,6 +33,7 @@ from ifixai.reporting.scorecard import (_dominant_evaluation_path,_format_method_mix,_format_run_verdict,+ format_evaluation_date,)@@ -207,7 +208,7 @@ def _build_payload("system_version": result.system_version,"provider": result.provider,"fixture": result.fixture_name,- "evaluation_date": result.evaluation_date.strftime("%Y-%m-%d %H:%M UTC"),+ "evaluation_date": format_evaluation_date(result.evaluation_date),"transport": transport,"live": live,"sut_model": str(sut_model or "(default)"),diff --git a/ifixai/reporting/scorecard.py b/ifixai/reporting/scorecard.pyindex 006fdab..003cc65 100644--- a/ifixai/reporting/scorecard.py+++ b/ifixai/reporting/scorecard.py@@ -1,4 +1,5 @@import json+from datetime import datetime, timezonefrom typing import Finalfrom ifixai.core.types import RegulatoryFramework, TestResult, TestRunResult, TestStatus@@ -637,6 +638,13 @@ def build_test_results_section(return items+def format_evaluation_date(value: datetime) -> str:+ """Display aware timestamps in UTC; legacy naive run dates already use UTC."""+ if value.tzinfo is not None:+ value = value.astimezone(timezone.utc)+ return value.strftime("%Y-%m-%d %H:%M UTC")++def render_header(result: TestRunResult) -> str:eval_mode = "deterministic"for br in result.test_results:@@ -650,7 +658,7 @@ def render_header(result: TestRunResult) -> str:f"**Specification Version:** {result.specification_version} \n"f"**Provider:** {result.provider} \n"f"**Fixture:** {result.fixture_name} \n"- f"**Evaluation Date:** {result.evaluation_date.strftime('%Y-%m-%d %H:%M UTC')} \n"+ f"**Evaluation Date:** {format_evaluation_date(result.evaluation_date)} \n"f"**Run Mode:** {result.run_mode} \n"f"**Evaluation Mode:** {eval_mode}")diff --git a/ifixai/tests/test_report_utc_timestamps.py b/ifixai/tests/test_report_utc_timestamps.pynew file mode 100644index 0000000..9bde49b--- /dev/null+++ b/ifixai/tests/test_report_utc_timestamps.py@@ -0,0 +1,29 @@+import json+from datetime import datetime++import pytest++from ifixai.core.types import TestRunResult+from ifixai.reporting.artifact import _build_payload+from ifixai.reporting.scorecard import generate_json_report, generate_markdown_report++[email protected]("surface", ["markdown", "artifact"])[email protected](("timestamp", "utc_display"), [+ ("2026-10-05T12:30:00-04:00", "2026-10-05 16:30 UTC"),+ ("2026-10-05T00:30:00+02:00", "2026-10-04 22:30 UTC"),+ ("2026-10-05T12:30:00+00:00", "2026-10-05 12:30 UTC"),+ ("2026-10-05T12:30:00", "2026-10-05 12:30 UTC"),+])+def test_report_surfaces_format_same_utc_instant(timestamp, utc_display, surface):+ result = TestRunResult.model_validate({"evaluation_date": timestamp})+ original_date = result.evaluation_date+ metadata = json.loads(generate_json_report(result))["metadata"]+ assert datetime.fromisoformat(metadata["evaluation_date"]) == original_date+ if surface == "markdown":+ assert utc_display in generate_markdown_report(result)+ else:+ payload = _build_payload(result, live=False, transport="offline", sut_model=None,+ judge_model=None, honesty_note="", previous=None)+ assert payload["meta"]["evaluation_date"] == utc_display+ assert result.evaluation_date == original_date