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(lint): avoid recursion failures in valid Python expressions (#760)
Afloat6e85d9b9129e
diff --git a/CHANGELOG.md b/CHANGELOG.mdindex 8a84a692..3af085da 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -471,6 +471,10 @@ All notable changes to SkillEvaluator are documented in this file.### Fixed+- Script lint measures control-flow nesting without recursively walking expression+ nodes, so valid long operator or attribute chains no longer abort advisory+ checks for that script and subsequent files.+- 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 negativediff --git a/src/skillevaluator/validators/script_lint.py b/src/skillevaluator/validators/script_lint.pyindex 00e1ce68..3daa79cc 100644--- a/src/skillevaluator/validators/script_lint.py+++ b/src/skillevaluator/validators/script_lint.py@@ -47,16 +47,14 @@ _NESTING_NODES = (def _calculate_nesting_depth(tree: ast.AST) -> int:"""Calculate maximum nesting depth of control flow statements."""max_depth = 0-- def _walk(node: ast.AST, depth: int) -> None:- nonlocal max_depth+ pending = [(tree, 0)]+ while pending:+ node, depth = pending.pop()if isinstance(node, _NESTING_NODES):depth += 1max_depth = max(max_depth, depth)- for child in ast.iter_child_nodes(node):- _walk(child, depth)-- _walk(tree, 0)+ # Expression depth can exceed Python's call stack even when control flow is shallow.+ pending.extend((child, depth) for child in ast.iter_child_nodes(node))return max_depthdiff --git a/tests/validators/test_script_lint.py b/tests/validators/test_script_lint.pyindex 780c2b12..b4ca4c3d 100644--- a/tests/validators/test_script_lint.py+++ b/tests/validators/test_script_lint.py@@ -3,12 +3,13 @@"""Tests for ScriptLintValidator -- AST-based advisory lint checks."""+import astfrom pathlib import Pathimport pytestfrom skillevaluator.models.result import Severity, ValidationResult-from skillevaluator.validators.script_lint import ScriptLintValidator+from skillevaluator.validators.script_lint import ScriptLintValidator, _calculate_nesting_depth@pytest.fixture@@ -230,3 +231,54 @@ class TestScriptLintValidator:v = ScriptLintValidator()assert "Lint" in v.nameassert "Advisory" in v.name++[email protected]("directory", ["scripts", "tools"])+ "expression",+ [" + ".join(["value"] * 1500), "value" + ".next" * 1500],+ ids=["binary-expression", "attribute-chain"],+)+def test_deep_expression_does_not_abort_other_script_checks(tmp_path, directory, expression):+ (tmp_path / "SKILL.md").write_text("# Example\n", encoding="utf-8")+ scripts = tmp_path / directory+ scripts.mkdir()+ (scripts / "first.py").write_text(+ "#!/usr/bin/env python3\nimport argparse\ndef calculate(value):\n if value:\n return "+ + expression+ + "\n return 42\n",+ encoding="utf-8",+ )+ (scripts / "second.py").write_text("print('example')\n", encoding="utf-8")++ result = ScriptLintValidator().validate(tmp_path)++ findings = {(Path(f.file_path).name, f.check_name) for f in result.findings}+ assert ("first.py", "magic_numbers") in findings+ assert ("second.py", "flat_script") in findings+ assert ("second.py", "missing_shebang") in findings+ assert not any(f.check_name == "deep_nesting" for f in result.findings)+ assert result.passed+++def test_deep_expression_keeps_actual_control_flow_depth():+ source = "def calculate(value):\n"+ for depth in range(1, 8):+ source += " " * depth + "if value:\n"+ source += " " * 8 + "return " + " + ".join(["value"] * 1500) + "\n"++ assert _calculate_nesting_depth(ast.parse(source)) == 7+++ ("source", "expected"),+ [+ ("value = 42\n", 0),+ ("if first:\n if second:\n pass\nif third:\n pass\n", 2),+ ("try:\n with context():\n pass\nexcept Exception:\n while condition:\n pass\n", 2),+ ("async def work():\n async for item in items:\n async with item:\n pass\n", 2),+ ],+ ids=["flat", "siblings", "try-branches", "async"],+)+def test_control_flow_depth_keeps_existing_branch_semantics(source, expected):+ assert _calculate_nesting_depth(ast.parse(source)) == expected