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(calculator): accept signed values and reject trailing input in conversions (#737)
Dhananjay Aggarwal6b0a6476783a
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 23914101..8a84a692 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -473,6 +473,10 @@ All notable changes to SkillEvaluator are documented in this file.- GitLab JUnit collection includes nested skill folders in catalog reports.- API caller now percent-encodes scalar OpenAPI path values as individual segments and rejects `.` and `..` values with a JSON input error.+- The calculator reference skill converts negative values (`-40 celsius to fahrenheit`) and takes negative+ percentages, and no longer answers `10% of 50 + 5` with `Result: 5` by ignoring the rest of the input.+ Such input, and a malformed number like `1.2.3 km to miles`, now gets the usual `Error:` line instead+ of a wrong result or a traceback.- Direct Tier 1 validates the target, selected checks and LLM configuration beforepreparing scanners, so configuration errors do not trigger downloads or stdout noise.- Documentation-only CI follows imports through collected test modules anddiff --git a/src/skillevaluator/tier3/reference_skills/calculator/scripts/calc.py b/src/skillevaluator/tier3/reference_skills/calculator/scripts/calc.pyindex 321af0ae..f3e28e6c 100644--- a/src/skillevaluator/tier3/reference_skills/calculator/scripts/calc.py+++ b/src/skillevaluator/tier3/reference_skills/calculator/scripts/calc.py@@ -45,6 +45,9 @@ def safe_eval(expr: str) -> float:return _eval(tree)+# A signed decimal number: "-40", "+2", "3.5", ".5" or "5.".+NUMBER = r"[-+]?(?:\d+(?:\.\d*)?|\.\d+)"+CONVERSIONS = {("celsius", "fahrenheit"): lambda c: c * 9 / 5 + 32,("fahrenheit", "celsius"): lambda f: (f - 32) * 5 / 9,@@ -58,8 +61,8 @@ CONVERSIONS = {def try_conversion(expr: str) -> str | None:- m = re.match(- r"([\d.]+)\s+(\w+)\s+to\s+(\w+)",+ m = re.fullmatch(+ rf"({NUMBER})\s+(\w+)\s+to\s+(\w+)",expr.strip(),re.IGNORECASE,)@@ -76,7 +79,7 @@ def try_conversion(expr: str) -> str | None:def try_percentage(expr: str) -> str | None:- m = re.match(r"([\d.]+)%\s+of\s+([\d.]+)", expr.strip(), re.IGNORECASE)+ m = re.fullmatch(rf"({NUMBER})%\s+of\s+({NUMBER})", expr.strip(), re.IGNORECASE)if not m:return Nonepct = float(m.group(1))diff --git a/tests/test_reference_calculator.py b/tests/test_reference_calculator.pynew file mode 100644index 00000000..a1c72c74--- /dev/null+++ b/tests/test_reference_calculator.py@@ -0,0 +1,55 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++"""Behavior tests for the packaged calculator reference script."""++from __future__ import annotations++import subprocess+import sys+from pathlib import Path++import pytest++CALC = Path(__file__).resolve().parents[1] / "src/skillevaluator/tier3/reference_skills/calculator/scripts/calc.py"+++def _calc(expression: str) -> subprocess.CompletedProcess[str]:+ return subprocess.run(+ [sys.executable, str(CALC), expression],+ check=False,+ capture_output=True,+ text=True,+ )+++ ("expression", "expected"),+ [+ ("-40 celsius to fahrenheit", "-40 celsius = -40 fahrenheit"),+ ("-4 fahrenheit to celsius", "-4 fahrenheit = -20 celsius"),+ (".5 kg to lbs", "0.5 kg = 1.102 lbs"),+ ("-10% of 50", "Result: -5"),+ ("12.5% of -80", "Result: -10"),+ ("100 celsius to fahrenheit", "100 celsius = 212 fahrenheit"),+ ("15% of 200", "Result: 30"),+ ],+)+def test_conversions_and_percentages_accept_signed_numbers(expression: str, expected: str) -> None:+ result = _calc(expression)++ assert result.returncode == 0, result.stderr+ assert result.stdout.strip() == expected+++ "expression",+ ["10% of 50 + 5", "5 km to miles please", "1.2.3 km to miles"],+)+def test_input_beyond_a_conversion_or_percentage_is_rejected(expression: str) -> None:+ result = _calc(expression)++ assert result.returncode == 1+ assert result.stdout == ""+ assert result.stderr.startswith("Error: ")+ assert "Traceback" not in result.stderr