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): write generated test.sh and grader starters with LF endings (#266)
Narendran Raghavan33069377a365
diff --git a/.gitattributes b/.gitattributesnew file mode 100644index 00000000..835d69e0--- /dev/null+++ b/.gitattributes@@ -0,0 +1,3 @@+# Shell scripts run through their shebang inside Linux containers. Keep them+# LF so a Windows checkout cannot turn "#!/bin/bash" into "#!/bin/bash\r".+*.sh text eol=lfdiff --git a/CHANGELOG.md b/CHANGELOG.mdindex 159c60e0..da376c84 100644--- a/CHANGELOG.md+++ b/CHANGELOG.md@@ -326,6 +326,12 @@ All notable changes to SkillEvaluator are documented in this file.Harbor, so Docker Desktop finds its `compose` plugin, and passes`PYTHONUTF8` and `PYTHONIOENCODING` so Python UTF-8 mode reaches Harbor onnon-UTF-8 locales.+- On native Windows, generated Tier 3 `test.sh` files and the grader starters+ from `init-custom-grader` and `init-harbor-task` are now written with LF line+ endings. They were written with CRLF, which broke the `#!/bin/bash` shebang+ and `set -euo pipefail` in the Linux container, so the verifier failed+ before grading. The repository's `.gitattributes` also keeps `*.sh` files LF+ in Windows checkouts.- A `SKILL.md` `metadata` value that is not a mapping, such as `true`, `1.5`, adate, or a list or string containing `author` or `tags`, no longer crashesthe quality check with a `TypeError`, which aborted `validate`, `tier1`, anddiff --git a/docs/agents-and-sandboxes.mdx b/docs/agents-and-sandboxes.mdxindex ba59f2b8..fb99d1b5 100644--- a/docs/agents-and-sandboxes.mdx+++ b/docs/agents-and-sandboxes.mdx@@ -467,6 +467,12 @@ SkillEvaluator forwards both Python settings to Harbor when they are set;it does not enable them automatically. Native Windows local mode remainsunsupported; use Docker or run local mode inside WSL2.+Verifier scripts run inside the Linux container, so they need LF line+endings. SkillEvaluator writes generated `test.sh` files and the+`init-custom-grader` and `init-harbor-task` grader starters with LF on every+host. Keep LF when you edit them: a CRLF `grader.sh` or `test.sh` fails in the+container before grading starts.+### Resource tuningIf an agent's work is heavier than the defaults allow — large builds,diff --git a/src/skillevaluator/tier3/commands.py b/src/skillevaluator/tier3/commands.pyindex f0e9a9d0..f414ad5f 100644--- a/src/skillevaluator/tier3/commands.py+++ b/src/skillevaluator/tier3/commands.py@@ -307,10 +307,12 @@ printf "%s" "$score" > "$REWARD_TXT"def _write_grader_file(path: Path, *, language: str) -> None:+ # LF only: graders run inside a Linux container, and Windows' default CRLF+ # breaks the shebang and `set -euo pipefail`.if language == "shell":- path.write_text(_shell_grader_template(), encoding="utf-8")+ path.write_text(_shell_grader_template(), encoding="utf-8", newline="\n")else:- path.write_text(_python_grader_template(), encoding="utf-8")+ path.write_text(_python_grader_template(), encoding="utf-8", newline="\n")path.chmod(0o755)@@ -628,7 +630,7 @@ WORKDIR /workspacegrader_path = tests_dir / ("grader.sh" if language == "shell" else "grader.py")_write_grader_file(grader_path, language=language)test_sh = tests_dir / "test.sh"- test_sh.write_text(_native_test_sh(language), encoding="utf-8")+ test_sh.write_text(_native_test_sh(language), encoding="utf-8", newline="\n")test_sh.chmod(0o755)(private_harbor / "README.md").write_text("""# SkillEvaluator BYOT Harbor Tasksdiff --git a/src/skillevaluator/tier3/harbor/adapter.py b/src/skillevaluator/tier3/harbor/adapter.pyindex 8fda02f8..325429aa 100644--- a/src/skillevaluator/tier3/harbor/adapter.py+++ b/src/skillevaluator/tier3/harbor/adapter.py@@ -2339,7 +2339,9 @@ def _write_test_sh(task_dir: Path, *, grading_mode: str, custom_grader: bool) ->else:script = prefix + 'python3 -I "${evaluator_dir}/eval.py"\n'test_sh = tests_dir / "test.sh"- test_sh.write_text(script, encoding="utf-8")+ # LF only: the script runs inside a Linux container, and Windows' default+ # CRLF turns the shebang into "#!/bin/bash\r".+ test_sh.write_text(script, encoding="utf-8", newline="\n")test_sh.chmod(0o755)diff --git a/tests/tier3/test_generated_script_line_endings.py b/tests/tier3/test_generated_script_line_endings.pynew file mode 100644index 00000000..7d034797--- /dev/null+++ b/tests/tier3/test_generated_script_line_endings.py@@ -0,0 +1,118 @@+# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.+# SPDX-License-Identifier: Apache-2.0++"""Generated verifier scripts must keep LF line endings on every host.++``test.sh`` and the grader starters run inside a Linux container. On native+Windows, ``Path.write_text`` without ``newline=`` translates ``\\n`` to+``\\r\\n``, so ``#!/bin/bash`` becomes ``#!/bin/bash\\r`` and+``set -euo pipefail`` fails on ``pipefail\\r``. These tests emulate that+Windows default on any host so the regression is caught on POSIX CI too.+"""++from __future__ import annotations++from pathlib import Path++import pytest++from skillevaluator.tier3 import commands+from skillevaluator.tier3.harbor.adapter import _write_test_sh+++def windows_text_mode(monkeypatch: pytest.MonkeyPatch) -> None:+ """Make ``Path.write_text`` translate newlines like it does on Windows."""+ original = Path.write_text++ def write_text(+ self: Path,+ data: str,+ encoding: str | None = None,+ errors: str | None = None,+ newline: str | None = None,+ ) -> int:+ return original(self, data, encoding=encoding, errors=errors, newline="\r\n" if newline is None else newline)++ monkeypatch.setattr(Path, "write_text", write_text)+++def _assert_lf_script(path: Path, shebang: bytes) -> None:+ raw = path.read_bytes()+ assert b"\r" not in raw, f"{path.name} must not contain CR line endings"+ assert raw.startswith(shebang + b"\n")+++def _skill(tmp_path: Path) -> Path:+ skill = tmp_path / "sample-skill"+ skill.mkdir()+ (skill / "SKILL.md").write_bytes(b"---\nname: sample-skill\ndescription: Test fixture.\n---\n# Sample\n")+ return skill+++def test_windows_text_mode_emulation_translates_default_newlines(tmp_path: Path, windows_text_mode: None) -> None:+ probe = tmp_path / "probe.txt"+ probe.write_text("a\nb\n", encoding="utf-8")++ assert probe.read_bytes() == b"a\r\nb\r\n"+++ ("grading_mode", "custom_grader"),+ [("default", False), ("default_plus_custom", True), ("custom_only", True)],+)+def test_harbor_task_test_sh_is_lf_only(+ tmp_path: Path, windows_text_mode: None, grading_mode: str, custom_grader: bool+) -> None:+ _write_test_sh(tmp_path, grading_mode=grading_mode, custom_grader=custom_grader)++ _assert_lf_script(tmp_path / "tests" / "test.sh", b"#!/bin/bash")+++ ("language", "name", "shebang"),+ [("python", "grader.py", b"#!/usr/bin/env python3"), ("shell", "grader.sh", b"#!/usr/bin/env bash")],+)+def test_custom_grader_starter_is_lf_only(+ tmp_path: Path, windows_text_mode: None, language: str, name: str, shebang: bytes+) -> None:+ skill = _skill(tmp_path)++ assert (+ commands.init_custom_grader(+ skill,+ mode="default_plus_custom",+ language=language,+ force=False,+ no_config=True,+ )+ == 0+ )++ _assert_lf_script(skill / "evals" / name, shebang)+++ ("language", "name", "shebang"),+ [("python", "grader.py", b"#!/usr/bin/env python3"), ("shell", "grader.sh", b"#!/usr/bin/env bash")],+)+def test_harbor_task_scaffold_scripts_are_lf_only(+ tmp_path: Path, windows_text_mode: None, language: str, name: str, shebang: bytes+) -> None:+ skill = _skill(tmp_path)++ assert (+ commands.init_harbor_task(+ skill,+ force=False,+ case_id="case-001",+ mode="custom_only",+ language=language,+ with_config=False,+ )+ == 0+ )++ tests_dir = skill / "evals" / "harbor" / "case-001" / "tests"+ _assert_lf_script(tests_dir / "test.sh", b"#!/bin/bash")+ _assert_lf_script(tests_dir / name, shebang)