Multi-tier framework for evaluating AI agent skills and plugins with quality gates, security scanning, harness compatibility checks, semantic overlap detection, synthetic evaluation dataset generation, and live agent evaluation that measures how skills affect agent behavior. Ships reusable CI templates that bring every check to any repository.
Python agent-evaluationagent-pluginsagent-securityagent-skillsagentic-aibenchmarkci-templatesclaude-codecodexevaluateevaluationharnesspluginplugin-evaluationsecurity-scannerskill-evalskill-evaluationskill-evaluatorskill-gap-analysisskills
fix(tier3): include ATIF content parts in judge answer evidence (#203)
YMuskrat6b0d3498b6dd
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex e76c8c4d..5a3b8b73 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -85,6 +85,9 @@ All notable changes to SkillEvaluator are documented in this file.### Fixed+- Include schema-valid ATIF message content parts in final answers, conversation+ summaries, and judge evidence references in the host and Harbor verifier.+ Image and audio parts use markers without exposing their source paths.- Preserve scored Harbor trials when agent answers mention authentication errorsand per-step token usage is present but aggregate ATIF token metrics are absentor zero. Explicit runtime exceptions and error events still invalidate trials.diff --git a/src/skillevaluator/tier3/eval_core/atif_helpers.py b/src/skillevaluator/tier3/eval_core/atif_helpers.pyindex 6dbf126b..d6d0da1f 100644--- a/src/skillevaluator/tier3/eval_core/atif_helpers.py+++ b/src/skillevaluator/tier3/eval_core/atif_helpers.py@@ -17,7 +17,7 @@ import refrom typing import Anyfrom skillevaluator.evidence import evidence_ref_identity-from skillevaluator.tier3.eval_core.codex_tool_call_normalizer import atif_content_text+from skillevaluator.tier3.eval_core.codex_tool_call_normalizer import atif_content_has_text, atif_content_textfrom skillevaluator.tier3.eval_core.codex_tool_call_normalizer import (iter_normalized_tool_calls as iter_tool_calls,)@@ -98,19 +98,19 @@ def get_agent_text(traj: dict[str, Any]) -> str:parts: list[str] = []for step in traj.get("steps", []):if step.get("source") == "agent":- msg = step.get("message") or ""- if isinstance(msg, str) and msg.strip():+ msg = atif_content_text(step.get("message"))+ if msg.strip():parts.append(msg)return "\n".join(parts)def get_final_response(traj: dict[str, Any]) -> str:- """Get the last non-empty agent message from the trajectory."""+ """Get the last text-bearing agent message from the trajectory."""for step in reversed(traj.get("steps", [])):if step.get("source") == "agent":- msg = step.get("message") or ""- if isinstance(msg, str) and msg.strip():- return msg+ content = step.get("message")+ if atif_content_has_text(content):+ return atif_content_text(content)return ""@@ -153,8 +153,8 @@ def build_conversation_summary(traj: dict[str, Any], question: str) -> str:if content:parts.append(f"Tool returned: {content[:400]}")- msg = step.get("message") or ""- if msg and isinstance(msg, str) and msg.strip() and not step.get("tool_calls"):+ msg = atif_content_text(step.get("message"))+ if msg.strip() and not step.get("tool_calls"):parts.append(f"Agent: {msg[:1500]}")final = get_final_response(traj)@@ -502,8 +502,9 @@ def _final_response_ref(traj: dict[str, Any]) -> list[dict[str, Any]]:step = steps[step_idx]if step.get("source") != "agent":continue- msg = step.get("message") or ""- if isinstance(msg, str) and msg.strip():+ content = step.get("message")+ if atif_content_has_text(content):+ msg = atif_content_text(content)return [_evidence_ref(source="trajectory.json",diff --git a/src/skillevaluator/tier3/eval_core/codex_tool_call_normalizer.py b/src/skillevaluator/tier3/eval_core/codex_tool_call_normalizer.pyindex e5d751b4..9369bcc5 100644--- a/src/skillevaluator/tier3/eval_core/codex_tool_call_normalizer.py+++ b/src/skillevaluator/tier3/eval_core/codex_tool_call_normalizer.py@@ -46,6 +46,26 @@ def atif_content_text(content: object) -> str:return str(content)+def atif_content_has_text(content: object) -> bool:+ """Check for meaningful text rather than media-only placeholders.++ Keep atif_content_text unchanged: other evidence sections still need+ safe [image]/[audio] markers for non-text media.+ """+ if isinstance(content, list):+ return any(+ (isinstance(part, str) and bool(part.strip()))+ or (+ isinstance(part, dict)+ and part.get("type") == "text"+ and isinstance(part.get("text"), str)+ and bool(part["text"].strip())+ )+ for part in content+ )+ return bool(atif_content_text(content).strip())++def iter_normalized_tool_calls(traj: dict[str, Any]):"""Yield each trajectory tool call after safe native-Codex normalization."""for step in traj.get("steps", []):diff --git a/src/skillevaluator/tier3/harbor/templates/eval.py b/src/skillevaluator/tier3/harbor/templates/eval.pyindex 1f110ac2..0af5d3a1 100644--- a/src/skillevaluator/tier3/harbor/templates/eval.py+++ b/src/skillevaluator/tier3/harbor/templates/eval.py@@ -74,6 +74,7 @@ try:AMBIGUOUS_OUTER_EXEC_OBSERVATION,UNOBSERVED_INNER_CALL,UNSUPPORTED_NATIVE_CODEX_EXEC,+ atif_content_has_text,atif_content_text,iter_normalized_tool_calls,normalized_tool_call_observation,@@ -84,6 +85,7 @@ except ImportError: # pragma: no cover -- source-tree import onlyAMBIGUOUS_OUTER_EXEC_OBSERVATION,UNOBSERVED_INNER_CALL,UNSUPPORTED_NATIVE_CODEX_EXEC,+ atif_content_has_text,atif_content_text,iter_normalized_tool_calls,normalized_tool_call_observation,@@ -439,8 +441,8 @@ def get_agent_text(traj):parts = []for step in traj.get("steps", []):if step.get("source") == "agent":- msg = step.get("message") or ""- if isinstance(msg, str) and msg.strip():+ msg = atif_content_text(step.get("message"))+ if msg.strip():parts.append(msg)return "\n".join(parts)@@ -483,8 +485,8 @@ def build_conversation_summary(traj, question):content = atif_content_text(r.get("content"))if content:parts.append(f"Tool returned: {content[:400]}")- msg = step.get("message") or ""- if msg and isinstance(msg, str) and msg.strip() and not step.get("tool_calls"):+ msg = atif_content_text(step.get("message"))+ if msg.strip() and not step.get("tool_calls"):parts.append(f"Agent: {msg[:1500]}")return "\n".join(parts)@@ -545,9 +547,9 @@ _TOOL_NAME_SEPARATORS = (".", ":", "/", "__")def _get_final_response(traj):for step in reversed(traj.get("steps", [])):if step.get("source") == "agent":- msg = step.get("message") or ""- if isinstance(msg, str) and msg.strip():- return msg+ content = step.get("message")+ if atif_content_has_text(content):+ return atif_content_text(content)return ""@@ -808,8 +810,9 @@ def _final_response_ref(traj):step = steps[step_idx]if step.get("source") != "agent":continue- msg = step.get("message") or ""- if isinstance(msg, str) and msg.strip():+ content = step.get("message")+ if atif_content_has_text(content):+ msg = atif_content_text(content)return [_evidence_ref(source="trajectory.json",diff --git a/tests/tier3/test_atif_message_content.py b/tests/tier3/test_atif_message_content.pynew file mode 100644index 00000000..18c8f757--- /dev/null+++ b/tests/tier3/test_atif_message_content.py@@ -0,0 +1,135 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++"""Schema-valid ATIF message parts must reach judge evidence and references."""++from __future__ import annotations++import json+from types import ModuleType++import pytest++from skillevaluator.tier3.eval_core import atif_helpers+++def _trajectory(messages: list) -> dict:+ from harbor.models.trajectories.trajectory import Trajectory++ return Trajectory.model_validate(+ {+ "schema_version": "ATIF-v1.8",+ "agent": {"name": "test-agent", "version": "test"},+ "steps": [+ {"step_id": index, "source": "agent", "message": message}+ for index, message in enumerate(messages, start=1)+ ],+ }+ ).to_json_dict()+++ ("message", "expected"),+ [+ ("The answer is 4.", "The answer is 4."),+ ([{"type": "text", "text": "The answer is 4."}], "The answer is 4."),+ (+ [{"type": "text", "text": "First line."}, {"type": "text", "text": "Second line."}],+ "First line.\nSecond line.",+ ),+ ([], ""),+ ([{"type": "text", "text": " "}], ""),+ ],+)+def test_message_content_reaches_all_text_extractors(+ harbor_eval_template: ModuleType,+ message: str | list,+ expected: str,+) -> None:+ trajectory = _trajectory([message])++ assert atif_helpers.get_agent_text(trajectory) == expected+ assert atif_helpers.get_final_response(trajectory) == expected+ assert harbor_eval_template.get_agent_text(trajectory) == expected+ assert harbor_eval_template._get_final_response(trajectory) == expected+ assert atif_helpers.build_conversation_summary(trajectory, "question") == (+ harbor_eval_template.build_conversation_summary(trajectory, "question")+ )+++def test_last_nonempty_structured_answer_reaches_all_judges_and_refs(harbor_eval_template: ModuleType) -> None:+ trajectory = _trajectory(["Earlier answer.", [{"type": "text", "text": "The answer is 4."}], []])++ assert atif_helpers.get_final_response(trajectory) == "The answer is 4."+ assert harbor_eval_template._get_final_response(trajectory) == "The answer is 4."+ assert atif_helpers.get_agent_text(trajectory) == "Earlier answer.\nThe answer is 4."+ assert "Agent: The answer is 4." in atif_helpers.build_conversation_summary(trajectory, "What is 2+2?")+ shared = atif_helpers.build_metric_evidence_bundles(trajectory, "What is 2+2?", ground_truth="4")+ verifier = harbor_eval_template.build_metric_evidence_bundles(trajectory, "What is 2+2?", ground_truth="4")+ assert shared == verifier+ for bundle in shared.values():+ assert "The answer is 4." in bundle["prompt_evidence"]+ final_refs = [ref for ref in bundle["evidence_refs"] if ref["kind"] == "final_response"]+ assert len(final_refs) == 1+ assert final_refs[0]["json_pointer"] == "/steps/1"+ assert final_refs[0]["excerpt"] == "The answer is 4."++[email protected]("media_type", ("image", "audio"))+def test_media_only_followup_does_not_override_text_answer(+ harbor_eval_template: ModuleType, media_type: str+) -> None:+ trajectory = _trajectory(+ [+ "The answer is 4.",+ [{"type": media_type, "source": {+ "media_type": "image/png" if media_type == "image" else "audio/wav",+ "path": "/private/media",+ }}],+ ]+ )+ assert atif_helpers.get_final_response(trajectory) == "The answer is 4."+ assert harbor_eval_template._get_final_response(trajectory) == "The answer is 4."+ shared = atif_helpers.build_metric_evidence_bundles(trajectory, "What is 2+2?", ground_truth="4")+ verifier = harbor_eval_template.build_metric_evidence_bundles(trajectory, "What is 2+2?", ground_truth="4")+ assert shared == verifier+ for metric in ("accuracy", "goal_accuracy"):+ bundle = shared[metric]+ assert "FINAL RESPONSE\nThe answer is 4." in bundle["prompt_evidence"]+ refs = [ref for ref in bundle["evidence_refs"] if ref["kind"] == "final_response"]+ assert len(refs) == 1+ assert refs[0]["json_pointer"] == "/steps/0"+ assert refs[0]["excerpt"] == "The answer is 4."+ assert "/private/media" not in json.dumps(shared)+++def test_media_only_step_is_not_selected_as_final_text_response(harbor_eval_template: ModuleType) -> None:+ trajectory = _trajectory([[{+ "type": "audio", "source": {"media_type": "audio/wav", "path": "/private/media"}+ }]])+ assert atif_helpers.get_final_response(trajectory) == ""+ assert harbor_eval_template._get_final_response(trajectory) == ""+ assert atif_helpers._final_response_ref(trajectory) == []+ assert harbor_eval_template._final_response_ref(trajectory) == []+++def test_multimodal_answer_uses_markers_without_media_paths(harbor_eval_template: ModuleType) -> None:+ trajectory = _trajectory(+ [+ [+ {"type": "text", "text": "Result attached."},+ {"type": "image", "source": {"media_type": "image/png", "path": "/private/image-result.png"}},+ {"type": "audio", "source": {"media_type": "audio/wav", "path": "/private/audio-result.wav"}},+ ]+ ]+ )+ expected = "Result attached.\n[image]\n[audio]"++ assert atif_helpers.get_final_response(trajectory) == expected+ assert harbor_eval_template._get_final_response(trajectory) == expected+ shared = atif_helpers.build_metric_evidence_bundles(trajectory, "question")+ verifier = harbor_eval_template.build_metric_evidence_bundles(trajectory, "question")+ assert shared == verifier+ for bundle in shared.values():+ assert expected in bundle["prompt_evidence"]+ assert "/private/" not in json.dumps(bundle)