Skip to content

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.

perf(results): reconcile independent diagnostics with local indexes (#761)

Afloata3bb7e91a325
diff --git a/CHANGELOG.md b/CHANGELOG.md
index bf760594..462663c2 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -28,6 +28,9 @@ All notable changes to SkillEvaluator are documented in this file.
release binary.
- Malformed optional trajectory `final_metrics` leave condition usage unavailable
and no longer abort fresh or reused Tier 3 result collection.
+- Rebuilding validation results after severity overrides or scanner finding
+ deduplication no longer repeatedly scans accumulated independent diagnostics;
+ diagnostic order, duplicate-warning options and summary counts are preserved.
- Allow GitHub all-tier CI to opt out of deployment records while retaining
environment secrets. Existing consumers keep deployment tracking by default.
- Point the PyPI Documentation link at the NVIDIA documentation instead of the GitHub
diff --git a/src/skillevaluator/models/result.py b/src/skillevaluator/models/result.py
index 06f0be39..3c98b8f3 100644
--- a/src/skillevaluator/models/result.py
+++ b/src/skillevaluator/models/result.py
@@ -346,8 +346,6 @@ class ValidationSummary:
}
-
-
def prefix_finding(finding: Finding, prefix: str, extra_metadata: dict | None = None) -> Finding:
"""Copy *finding* with *prefix* applied to every location it names.
@@ -388,6 +386,7 @@ def prefix_finding(finding: Finding, prefix: str, extra_metadata: dict | None =
metadata=metadata,
)
+
@dataclass
class ValidationResult:
"""Aggregates validation outcomes from a validator.
@@ -628,12 +627,20 @@ class ValidationResult:
"""
self.recalculate_from_findings()
if keep_all_errors or self.is_incomplete:
+ seen_errors = set(self.errors)
for error in errors:
- if error not in self.errors:
+ if error not in seen_errors:
self.add_error(error)
- for warning in warnings:
- if keep_repeated_warnings or warning not in self.warnings:
+ seen_errors.add(error)
+ if keep_repeated_warnings:
+ for warning in warnings:
self.add_warning(warning)
+ else:
+ seen_warnings = set(self.warnings)
+ for warning in warnings:
+ if warning not in seen_warnings:
+ self.add_warning(warning)
+ seen_warnings.add(warning)
def _finding_legacy_lines(self) -> set[str]:
"""Return the legacy error and warning lines that only repeat a structured finding."""
diff --git a/tests/models/test_independent_diagnostics.py b/tests/models/test_independent_diagnostics.py
new file mode 100644
index 00000000..e9f24b88
--- /dev/null
+++ b/tests/models/test_independent_diagnostics.py
@@ -0,0 +1,122 @@
+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
+# SPDX-License-Identifier: Apache-2.0
+
+"""Ordering, multiplicity and summary contracts for diagnostic reconciliation."""
+
+from copy import deepcopy
+
+import pytest
+
+from skillevaluator.models.result import Finding, Severity, ValidationResult
+from skillevaluator.validators.policy import ValidationPolicy, apply_policy
+from skillevaluator.validators.security import SecurityValidator
+
+
+def _finding(severity):
+ return Finding("SECURITY", severity, "example", "Check this source", file_path="SKILL.md")
+
+
+class _NoScanList(list):
+ """Reject membership scans while retaining the result's ordinary list operations."""
+
+ __slots__ = ()
+
+ def __contains__(self, _value):
+ raise AssertionError("diagnostic restoration must not scan the accumulated list")
+
+
+def test_reconciliation_does_not_scan_accumulated_diagnostics():
+ result = ValidationResult()
+ result.add_finding(_finding(Severity.HIGH))
+ errors = result.errors = _NoScanList(result.errors)
+ warnings = result.warnings = _NoScanList(result.warnings)
+
+ result.recalculate_keeping_independent(
+ ["error b", "error a", "error b"], ["warning b", "warning a", "warning b"], keep_all_errors=True
+ )
+
+ assert result.errors is errors
+ assert result.warnings is warnings
+ assert result.errors[1:] == ["error b", "error a"]
+ assert result.warnings == ["warning b", "warning a"]
+ assert (result.summary.errors, result.summary.warnings) == (3, 2)
+
+
[email protected]("incomplete", [False, True])
[email protected]("keep_errors", [False, True])
[email protected]("repeat_warnings", [False, True])
+def test_reconciliation_preserves_order_and_existing_multiplicity(incomplete, keep_errors, repeat_warnings):
+ result = ValidationResult()
+ high = _finding(Severity.HIGH)
+ medium = _finding(Severity.MEDIUM)
+ result.add_finding(high)
+ result.add_finding(medium)
+ result.add_finding(deepcopy(medium))
+ result.fail_gate("independent gate failure")
+ if incomplete:
+ result.mark_scan_incomplete("scanner")
+ errors = [high.to_legacy_string(), "independent gate failure", "error b", "error a", "error b"]
+ warnings = [medium.to_legacy_string(), "warning b", "warning a", "warning b", medium.to_legacy_string()]
+ original_errors, original_warnings = errors.copy(), warnings.copy()
+
+ result.recalculate_keeping_independent(
+ errors, warnings, keep_all_errors=keep_errors, keep_repeated_warnings=repeat_warnings
+ )
+
+ expected_errors = ["independent gate failure", high.to_legacy_string()]
+ if keep_errors or incomplete:
+ expected_errors += ["error b", "error a"]
+ expected_warnings = [medium.to_legacy_string()] * 2
+ expected_warnings += warnings if repeat_warnings else ["warning b", "warning a"]
+ assert result.errors == expected_errors
+ assert result.warnings == expected_warnings
+ assert result.summary.errors == len(expected_errors)
+ assert result.summary.warnings == len(expected_warnings)
+ assert (result.summary.high_count, result.summary.medium_count) == (1, 2)
+ assert not result.passed
+ assert errors == original_errors
+ assert warnings == original_warnings
+
+
+def test_skillspector_dedup_preserves_independent_diagnostic_order():
+ result = ValidationResult()
+ finding = _finding(Severity.HIGH)
+ result.add_finding(finding)
+ result.add_finding(deepcopy(finding))
+ result.fail_gate("scanner gate")
+ for message in ["error b", "error a", "error b"]:
+ result.add_error(message)
+ for message in ["warning b", "warning a", "warning b"]:
+ result.add_warning(message)
+
+ SecurityValidator._deduplicate_skillspector_findings(result)
+
+ assert result.findings == [finding]
+ assert result.errors == ["scanner gate", finding.to_legacy_string(), "error b", "error a"]
+ assert result.warnings == ["warning b", "warning a"]
+ assert result.summary.errors == 4
+ assert result.summary.warnings == 2
+ assert result.summary.high_count == 1
+
+
+def test_policy_override_keeps_repeated_warnings_and_incomplete_errors():
+ result = ValidationResult()
+ finding = _finding(Severity.HIGH)
+ result.add_finding(finding)
+ result.mark_scan_incomplete("scanner")
+ for message in ["error b", "error a", "error b"]:
+ result.add_error(message)
+ warnings = ["warning b", "warning a", "warning b"]
+ for message in warnings:
+ result.add_warning(message)
+
+ apply_policy([result], ValidationPolicy(severity_overrides={"SECURITY.example": Severity.INFO}))
+
+ assert result.findings[0].severity == Severity.INFO
+ assert result.errors == ["error b", "error a"]
+ assert result.warnings == [finding.to_legacy_string(), *warnings]
+ assert result.summary.errors == 2
+ assert result.summary.warnings == 4
+ assert result.summary.high_count == 0
+ assert result.is_incomplete
+ assert not result.passed