Skip to content
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,10 @@ All notable changes to SkillEvaluator are documented in this file.

- Malformed optional trajectory `final_metrics` leave condition usage unavailable
and no longer abort fresh or reused Tier 3 result collection.
- Baseline task identities include authored `repo-context.json` files outside
the generated metadata location, so changed task inputs invalidate reuse.
Native Harbor tasks reject authored `environment/repo-context.json` because
that exact path is reserved for generated repository-context metadata.
- 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
Expand Down
4 changes: 2 additions & 2 deletions src/skillevaluator/tier3/baseline_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,9 @@ def baseline_task_tree_digest(task_dirs_by_agent: dict[str, Sequence[Path]]) ->
digest.update(len(header).to_bytes(8, "big"))
digest.update(header)
for path in sorted(task_dir.rglob("*")):
if path.name == "repo-context.json":
continue
relative = path.relative_to(task_dir).as_posix()
if relative == "environment/repo-context.json":
Comment thread
Afloat16 marked this conversation as resolved.
Resolved
continue
if path.is_symlink():
content = b"symlink\0" + path.readlink().as_posix().encode("utf-8")
elif path.is_file():
Expand Down
9 changes: 9 additions & 0 deletions src/skillevaluator/tier3/harbor/adapter.py
Original file line number Diff line number Diff line change
Expand Up @@ -4597,6 +4597,15 @@ def _prepare_native_environment(
"""Stage SkillEvaluator runtime additions into a copied native Harbor task."""
env_dir = task_dir / "environment"
env_dir.mkdir(parents=True, exist_ok=True)
try:
(env_dir / "repo-context.json").lstat()
except FileNotFoundError:
pass
else:
raise ValueError(
"native Harbor task environment must not contain repo-context.json; "
"that path is reserved for generated repository-context metadata"
)
if not has_skill and not baseline_aliases_prevalidated:
_check_baseline_skill_candidates_do_not_alias_target(
skill_path,
Expand Down
33 changes: 33 additions & 0 deletions tests/test_harbor_adapter_safety.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,39 @@ def _write_native_skill(tmp_path: Path) -> Path:
return skill


@pytest.mark.parametrize("with_skill", (False, True))
@pytest.mark.parametrize("relative", ("repo-context.json", "fixtures/repo-context.json"))
def test_native_tasks_reserve_only_the_generated_context_metadata_path(
tmp_path: Path, with_skill: bool, relative: str
) -> None:
skill = _write_native_skill(tmp_path)
subprocess.run(["git", "init", "-q", str(skill)], check=True)
native_task = skill / "evals" / "harbor" / "case-001"
environment = native_task / "environment"
authored = environment / relative
authored.parent.mkdir(parents=True)
authored.write_text('{"authored": "task input"}', encoding="utf-8")
(environment / "Dockerfile").write_text(
f"FROM python:3.12-slim\nCOPY {relative} /opt/fixture.json\n", encoding="utf-8"
)
tests_dir = native_task / "tests"
tests_dir.mkdir()
(tests_dir / "test.sh").write_text("#!/bin/sh\nexit 0\n", encoding="utf-8")
output_dir = tmp_path / "tasks"

if relative == "repo-context.json":
with pytest.raises(ValueError, match="reserved for generated repository-context metadata"):
stage_native_harbor_tasks(skill, output_dir, with_skill=with_skill, grading_mode="custom_only")
assert not (output_dir / "case-001").exists()
else:
staged = stage_native_harbor_tasks(skill, output_dir, with_skill=with_skill, grading_mode="custom_only")
assert len(staged) == 1
assert (staged[0] / "environment" / relative).read_text(encoding="utf-8") == authored.read_text(
encoding="utf-8"
)
assert authored.read_text(encoding="utf-8") == '{"authored": "task input"}'


def _write_repo_context_fixture(repo: Path) -> Path:
skill = repo / "skill"
skill.mkdir(parents=True)
Expand Down
38 changes: 38 additions & 0 deletions tests/tier3/test_baseline_context_digest.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0

"""Only the generated repository-context metadata is excluded from task identity."""

from pathlib import Path

import pytest

from skillevaluator.tier3.baseline_store import baseline_task_tree_digest


@pytest.mark.parametrize(
"relative",
["repo-context.json", "repo/repo-context.json", "environment/files/repo-context.json", "tests/repo-context.json"],
)
def test_authored_context_filename_changes_baseline_task_identity(tmp_path: Path, relative: str) -> None:
task = tmp_path / "case-001"
fixture = task / relative
fixture.parent.mkdir(parents=True)
fixture.write_text('{"expected": "first"}', encoding="utf-8")
original = baseline_task_tree_digest({"codex": [task]})

fixture.write_text('{"expected": "second"}', encoding="utf-8")

assert baseline_task_tree_digest({"codex": [task]}) != original


def test_generated_context_metadata_remains_outside_baseline_task_identity(tmp_path: Path) -> None:
task = tmp_path / "case-001"
metadata = task / "environment" / "repo-context.json"
metadata.parent.mkdir(parents=True)
metadata.write_text('{"staged_path": "first-run"}', encoding="utf-8")
original = baseline_task_tree_digest({"codex": [task]})

metadata.write_text('{"staged_path": "second-run"}', encoding="utf-8")

assert baseline_task_tree_digest({"codex": [task]}) == original
Loading