Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
2 changes: 2 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ All notable changes to SkillEvaluator are documented in this file.
- Tier 1 accepts a verified, non-executable PNG that SkillSpector excludes
from text-pattern coverage when the remaining coverage and the full YARA
and artifact-integrity counts agree.
- Native platform CI stays enabled for package-code changes, including catalog
I/O and rubric validators with macOS-specific filesystem behavior.
- `tier3 validate` now exits nonzero when `evals/` is missing, matching the
error it reports.
- Scanner install hints in `health-check` and `doctor` now match the host:
Expand Down
13 changes: 5 additions & 8 deletions scripts/classify_ci_changes.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,11 @@
DOC_FILES = frozenset({b"fern/docs.yml", b"CHANGELOG.md", b"README.md"})
KNOWN_STATUSES = frozenset(b"ACDMRTUXB")

# The Tier 3 platform jobs are the macOS sandbox tests and the native Windows
# local-mode check. They exist for operating-system behaviour, and that code
# lives under these source paths. The Linux jobs run the same test files, so a
# change anywhere else can only break those tests in a way Linux already shows.
# The native jobs import code across the package, including catalog I/O and
# rubric validation with real macOS filesystem behavior. Package paths alone
# cannot establish platform independence, so keep these changes in the lane.
SOURCE_ROOT = b"src/skillevaluator"
TESTS_ROOT = b"tests"
TIER3_PLATFORM_SOURCE = (b"src/skillevaluator/tier3", b"src/skillevaluator/utils")
# The test files the two jobs run. tests/test_ci_workflows.py checks this list
# against the jobs' commands in ci.yml.
TIER3_PLATFORM_TESTS = frozenset(
Expand Down Expand Up @@ -69,9 +67,8 @@ def _is_test_module(path: bytes) -> bool:
def _touches_tier3_platform(path: bytes) -> bool:
if _is_documentation(path):
return False
if path != SOURCE_ROOT and _is_under(path, SOURCE_ROOT):
# ``tier3`` also matches top-level modules such as ``tier3_environments.py``.
return any(path.startswith(prefix) for prefix in TIER3_PLATFORM_SOURCE)
if _is_under(path, SOURCE_ROOT):
return True
if path != TESTS_ROOT and _is_under(path, TESTS_ROOT):
if _is_under(path, TIER3_PLATFORM_TEST_SUPPORT):
return True
Expand Down
27 changes: 17 additions & 10 deletions tests/test_ci_change_classifier.py
Original file line number Diff line number Diff line change
Expand Up @@ -86,9 +86,20 @@ def test_is_docs_only(paths: list[bytes], expected: bool) -> None:
[b"src/skillevaluator/tier3_environments.py"],
[b"src/skillevaluator/tier3_new_module.py"],
[b"src/skillevaluator/utils/secure_fs.py"],
# These implementations serve native-only filesystem tests in the jobs.
[b"src/skillevaluator/embedding/registry.py"],
[b"src/skillevaluator/validators/rubric_eval.py"],
# Other imports/resources cannot be ruled out by their package path.
[b"src/skillevaluator/reporting/html.py"],
[b"src/skillevaluator/cli.py"],
[b"src/skillevaluator/validators/security.py"],
[b"src/skillevaluator/deduplication/utils/chunker.py"],
[b"src/skillevaluator/tier2/collector.py"],
[b"src/skillevaluator/reporting/templates/report.html"],
# A directory replaced by a file or a link shows up under its bare name.
[b"src/skillevaluator/tier3"],
[b"src/skillevaluator/utils"],
[b"src/skillevaluator/embedding"],
# What the two jobs run, and what those tests load.
[b"tests/test_harbor_local_mode.py"],
[b"tests/validators/test_rubric_eval.py"],
Expand All @@ -111,6 +122,7 @@ def test_is_docs_only(paths: list[bytes], expected: bool) -> None:
# One related path is enough.
[b"src/skillevaluator/reporting/html.py", b"src/skillevaluator/tier3/runner.py"],
[b"CHANGELOG.md", b"docs/index.mdx", b"uv.lock"],
[b"CHANGELOG.md", b"src/skillevaluator/reporting/html.py", b"tests/reporting/test_html.py"],
# Nothing to go on.
[],
],
Expand All @@ -122,24 +134,16 @@ def test_tier3_platform_jobs_run_for_related_and_unknown_paths(paths: list[bytes
@pytest.mark.parametrize(
"paths",
[
[b"src/skillevaluator/reporting/html.py"],
[b"src/skillevaluator/cli.py"],
[b"src/skillevaluator/validators/security.py"],
# ``utils`` further down the tree is not the shared utilities package.
[b"src/skillevaluator/deduplication/utils/chunker.py"],
[b"src/skillevaluator/tier2/collector.py"],
[b"src/skillevaluator/reporting/templates/report.html"],
# Tests the two jobs do not run, and their data.
[b"tests/test_cli.py"],
[b"tests/tier3/test_budget_reservation.py"],
[b"tests/golden/benchmark_tier1.md"],
# Documentation never counts.
[b"docs/index.mdx"],
[b"CHANGELOG.md", b"README.md", b"fern/docs.yml"],
[b"CHANGELOG.md", b"src/skillevaluator/reporting/html.py", b"tests/reporting/test_html.py"],
],
)
def test_tier3_platform_jobs_are_skipped_for_unrelated_source_and_tests(paths: list[bytes]) -> None:
def test_tier3_platform_jobs_are_skipped_for_unrelated_tests_and_docs(paths: list[bytes]) -> None:
assert is_tier3_platform_related(paths) is False


Expand Down Expand Up @@ -232,8 +236,11 @@ def test_main_classifies_a_real_mixed_diff_as_full_ci(
@pytest.mark.parametrize(
("changed", "expected"),
[
("src/skillevaluator/reporting/html.py", "docs_only=false\ntier3_platform=false\n"),
("src/skillevaluator/reporting/html.py", "docs_only=false\ntier3_platform=true\n"),
("src/skillevaluator/tier3/runner.py", "docs_only=false\ntier3_platform=true\n"),
("src/skillevaluator/embedding/registry.py", "docs_only=false\ntier3_platform=true\n"),
("src/skillevaluator/validators/rubric_eval.py", "docs_only=false\ntier3_platform=true\n"),
("tests/test_unrelated.py", "docs_only=false\ntier3_platform=false\n"),
],
)
def test_main_classifies_a_real_source_diff_for_the_tier3_platform_jobs(
Expand Down
Loading