Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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 @@ -197,6 +197,8 @@ All notable changes to SkillEvaluator are documented in this file.
apply to intermediate values as well as the final result, so
`10**1000 - 10**1000`, which printed `Result: 0` before, now returns
`Error: result is too large` because each power has 1001 digits.
- Partial scanner results retain their actual diagnostics and recorded versions
Comment thread
rng1995 marked this conversation as resolved.
Resolved
instead of being described as missing installations.

## 1.0.1 - 2026-11-17

Expand Down
11 changes: 7 additions & 4 deletions src/skillevaluator/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -2046,8 +2046,11 @@ def _finish_pipeline_view(
if len(failed) == 1:
only = failed[0]
tier_no = (only.metadata.get("gating") or {}).get("tier")
ran = all(scan.removesuffix("-llm") in only.scanners for scan in only.incomplete_scans)
state = ("was incomplete" if ran else "didn't run") if only.is_incomplete else "failed"
from skillevaluator.reporting.console_ui import _scanner_setup_issue

state = "failed"
if context.result_statuses[id(only)] == "incomplete":
state = "didn't run" if _scanner_setup_issue(only) else "was incomplete"
Comment thread
rng1995 marked this conversation as resolved.
Resolved
headline = f"{only.validator_name or 'validation'} {state}" + (
f" in Tier {tier_no}" if tier_no is not None else ""
)
Expand All @@ -2057,10 +2060,10 @@ def _finish_pipeline_view(
by_tier.setdefault((result.metadata.get("gating") or {}).get("tier"), []).append(result)
parts = []
for tier_no, results in by_tier.items():
broken = sum(1 for r in results if not r.is_incomplete)
broken = sum(1 for r in results if context.result_statuses[id(r)] != "incomplete")
counts = [
f"{broken} failed" if broken else "",
f"{len(results) - broken} didn't run" if broken < len(results) else "",
f"{len(results) - broken} incomplete" if broken < len(results) else "",
]
parts.append((f"Tier {tier_no}: " if tier_no is not None else "") + ", ".join(c for c in counts if c))
headline = " · ".join(parts) or "validation failed"
Expand Down
87 changes: 71 additions & 16 deletions src/skillevaluator/reporting/console_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -917,26 +917,41 @@ def stage_hint_row(label: str, hint: str, *, lead: str = "") -> TierRow:


def _scanners_row(results: list[ValidationResult]) -> list[TierRow]:
"""The external scanners behind the Tier 1 checks, with their versions or why they did not run."""
states: dict[str, tuple[str, str]] = {}
"""Scanner versions and incomplete evidence, retaining every member's scan state."""
versions: dict[str, str] = {}
states: dict[str, set[str]] = {}
for r in results:
if _is_user_skipped(r):
if scanner := _CHECK_SCANNERS.get(r.validator_name):
states.setdefault(scanner, ("skipped", MUTED))
states.setdefault(scanner, set()).add("skipped")
continue
for scanner, version in r.scanners.items():
states[scanner] = (version, MUTED)
if scanner == "skillspector" and version == "unknown":
runtime_version = (r.metadata or {}).get("skillspector_version")
if isinstance(runtime_version, str) and runtime_version:
version = runtime_version
if versions.get(scanner, "unknown") == "unknown":
versions[scanner] = version
states.setdefault(scanner, set()).add("ran")
for scan in r.incomplete_scans:
if (scanner := scan.removesuffix("-llm")) in _SCANNER_NAMES:
version = r.scanners.get(scanner)
if not version:
state = "didn't run"
if scan != scanner and scanner in r.scanners:
state = "llm"
else:
state = f"{version}, LLM didn't run" if scan != scanner else f"{version}, scan incomplete"
states[scanner] = (state, f"bold {RED}")
state = "missing" if _scanner_setup_issue(r) else "incomplete"
states.setdefault(scanner, set()).add(state)
segments: list[tuple[str, str]] = []
for scanner in [name for name in _SCANNER_NAMES if name in states]:
state, style = states[scanner]
version, observed = versions.get(scanner), states[scanner]
style = f"bold {RED}"
if "incomplete" in observed or ("missing" in observed and version):
state = f"{version}, scan incomplete" if version else "incomplete"
elif "llm" in observed:
state = f"{version}, LLM didn't run" if version else "LLM incomplete"
elif "missing" in observed:
state = "didn't run"
else:
state, style = version or "skipped", MUTED
segments += [*([(" · ", FAINT)] if segments else []), (_SCANNER_NAMES[scanner], TEXT), (f" {state}", style)]
return [TierRow("scanners", segments)] if segments else []

Expand All @@ -948,8 +963,9 @@ def _is_user_skipped(result: ValidationResult) -> bool:

def _is_not_applicable(result: ValidationResult) -> bool:
"""True when a check was recorded as not applicable to the target instead of run."""
return (
_is_skipped(result) and not _is_user_skipped(result) and "not applicable" in get_skip_reason(result).casefold()
return not _is_user_skipped(result) and (
result_execution_status(result) == "not_applicable"
Comment thread
rng1995 marked this conversation as resolved.
Resolved
or (_is_skipped(result) and "not applicable" in get_skip_reason(result).casefold())
)


Expand Down Expand Up @@ -1212,7 +1228,7 @@ def summarize_tier1(
if count["fail"]:
checks_segments += [(" · ", FAINT), (f"{count['fail']} failed", f"bold {RED}")]
if count["incomplete"]:
checks_segments += [(" · ", FAINT), (f"{count['incomplete']} didn't run", f"bold {RED}")]
checks_segments += [(" · ", FAINT), (f"{count['incomplete']} incomplete", f"bold {RED}")]
if count["skipped"]:
checks_segments += [(" · ", FAINT), (f"{count['skipped']} skipped", MUTED)]
if warnings:
Expand All @@ -1227,7 +1243,12 @@ def summarize_tier1(
names = ", ".join(
dict.fromkeys(_check_key(r.validator_name) or _short_name(r.validator_name) for r in not_applicable)
)
reason = _bounded_console_line(get_skip_reason(not_applicable[0]))
first = not_applicable[0]
reason = _bounded_console_line(
first.success_details[0].message
if first.success_details and not _is_skipped(first)
else get_skip_reason(first)
)
rows += [TierRow("n/a", [(names, MUTED)]), TierRow("", [(reason, FAINT)], fit="wrap")]

if advisory:
Expand Down Expand Up @@ -1289,7 +1310,10 @@ def summarize_tier1(
items = [item for r in broken for item in _tier1_fixes(r)]
items += [item for r in failed for item in _unresolved_reference_fixes(r)]
items += [item for r in broken for item in _later_gate_fixes(r)]
if setup := [r for r in incomplete if not _only_llm_stages_missing(r) and not _unresolved_reference_fixes(r)]:
non_llm = [r for r in incomplete if not _only_llm_stages_missing(r) and not _unresolved_reference_fixes(r)]
if partial := [r for r in non_llm if not _scanner_setup_issue(r)]:
items.append(_incomplete_fix(partial))
if setup := [r for r in non_llm if _scanner_setup_issue(r)]:
Comment thread
rng1995 marked this conversation as resolved.
Resolved
items.append(_setup_fix(setup))
if llm := [r for r in incomplete if _only_llm_stages_missing(r)]:
items.append(_llm_fix(llm))
Expand Down Expand Up @@ -1358,6 +1382,37 @@ def _tier1_fix(result: ValidationResult, problem: str = "") -> FixItem:


_DOWNLOAD_FAILED = re.compile(r"couldn't (?:download|set up) .+? \((?:[^()]|\([^()]*\))*\)")
_MISSING_SCANNER = re.compile(r"\bnot installed\b|\bnot found in PATH\b", re.IGNORECASE)


def _scanner_setup_issue(result: ValidationResult) -> bool:
"""Only explicit installation diagnostics justify a scanner setup explanation."""
return any(
_DOWNLOAD_FAILED.search(text) or _INSTALL_HINT.search(text) or _MISSING_SCANNER.search(text)
for text in map(str, [*result.independent_warnings(), *result.independent_errors()])
)


def _incomplete_fix(results: list[ValidationResult]) -> FixItem:
"""Keep partial, malformed and failed analyses separate from installation failures."""
checks = ", ".join(dict.fromkeys(_short_name(r.validator_name) for r in results))
diagnostics = list(
dict.fromkeys(
str(message)
for result in results
for message in (
result.gate_failures
or result.independent_errors()
or result.independent_warnings()
or [f"{', '.join(result.incomplete_scans)} did not produce complete evidence"]
)
)
)
return FixItem(
"scan",
f"{checks} incomplete: {'; '.join(diagnostics)}",
Comment thread
rng1995 marked this conversation as resolved.
Resolved
["resolve the reported scanner or input issues, then rerun; see detailed reports for full diagnostics"],
)


def _setup_fix(results: list[ValidationResult]) -> FixItem:
Expand All @@ -1366,7 +1421,7 @@ def _setup_fix(results: list[ValidationResult]) -> FixItem:
hints: list[str] = []
failed_downloads: list[str] = []
for r in results:
for text in map(str, [*r.warnings, *r.errors]):
for text in map(str, [*r.independent_warnings(), *r.independent_errors()]):
if (download := _DOWNLOAD_FAILED.search(text)) and download.group(0) not in failed_downloads:
failed_downloads.append(download.group(0))
match = _INSTALL_HINT.search(text)
Expand Down
11 changes: 11 additions & 0 deletions src/skillevaluator/validators/harness.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,15 @@ def validate(self, skill_path: Path) -> ValidationResult:
)
)
result.metadata[HARNESS_METADATA_KEY] = block
harnesses = [row["harness"] for row in next(iter(block.values()), [])]
if harnesses:
evaluations = sum(len(rows) for rows in block.values())
result.add_success(
Comment thread
rng1995 marked this conversation as resolved.
Resolved
"harness_profile_evaluation",
f"Completed {evaluations} harness profile evaluation(s) across {len(block)} skill(s).",
harnesses=harnesses,
profiles_evaluated=len(harnesses),
skills_evaluated=len(block),
evaluations_performed=evaluations,
)
return result
135 changes: 135 additions & 0 deletions tests/harness/test_execution_evidence.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,135 @@
# SPDX-FileCopyrightText: Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
"""Completed harness evaluations must carry truthful execution evidence."""

from pathlib import Path

import pytest

from skillevaluator.models.result import ValidationResult
from skillevaluator.publication_evidence import tier1_required_checks
from skillevaluator.reporting.base import assess_publication, result_has_execution_evidence
from skillevaluator.tier1.commands import _as_result, run_validation
from skillevaluator.validators.harness import HarnessValidator


@pytest.fixture
def clean_profiles(tmp_path: Path) -> Path:
profiles = tmp_path / "clean-profiles"
profiles.mkdir()
(profiles / "clean-fixture.yaml").write_text(
"harness: clean-fixture\n"
"listing: {cut: 1024}\n"
"rules:\n"
" - id: FIXTURE-DESCRIPTION\n"
" when: description_missing\n"
" effect: not_loaded\n"
" message: A description is required.\n",
encoding="utf-8",
)
return profiles


def _skill(root: Path) -> Path:
skill = root / "demo"
skill.mkdir(parents=True)
(skill / "SKILL.md").write_text(
"---\nname: demo\ndescription: Use when reviewing a project.\nlicense: MIT\n"
"metadata:\n author: Demo Author\n---\n# Demo\n\n## Instructions\n\nRead the project.\n"
"\n## Examples\n\nExplain its workflow.\n",
encoding="utf-8",
)
return skill


def test_clean_harness_records_completed_profile_evaluations(tmp_path: Path, clean_profiles: Path) -> None:
skill = _skill(tmp_path)

result = HarnessValidator(profiles_dir=clean_profiles).validate(skill)

assert result.findings == []
assert result_has_execution_evidence(result)
detail = result.success_details[0]
assert detail.check_name == "harness_profile_evaluation"
assert detail.metadata == {
"harnesses": ["clean-fixture"],
"profiles_evaluated": 1,
"skills_evaluated": 1,
"evaluations_performed": 1,
}


def test_completed_harness_evidence_keeps_advisory_findings(tmp_path: Path) -> None:
skill = _skill(tmp_path / ".claude" / "skills")

result = HarnessValidator("claude-code,codex").validate(skill)

assert any(finding.check_name == "CX-ROOT" for finding in result.findings)
assert result.success_details[0].metadata["harnesses"] == ["claude-code", "codex"]
assert result.success_details[0].metadata["evaluations_performed"] == 2
assert {row["harness"]: row["status"] for row in result.metadata["harness_compatibility"][str(skill)]} == {
"claude-code": "loads",
"codex": "not_loaded",
}


@pytest.mark.parametrize("missing", [False, True], ids=["empty-directory", "missing-target"])
def test_no_skills_does_not_claim_completed_harness_evaluations(tmp_path: Path, missing: bool) -> None:
target = tmp_path / "missing" if missing else tmp_path

result = HarnessValidator().validate(target)

assert result.success_details == []
assert not result_has_execution_evidence(result)


def test_no_profiles_does_not_claim_completed_harness_evaluations(tmp_path: Path) -> None:
skill = _skill(tmp_path)
profiles = tmp_path / "profiles"
profiles.mkdir()

result = HarnessValidator(profiles_dir=profiles).validate(skill)

assert result.success_details == []
assert not result_has_execution_evidence(result)


@pytest.mark.parametrize("actual_harness", [True, False], ids=["completed-harness", "empty-harness"])
def test_harness_publication_requires_actual_execution_evidence(
tmp_path: Path, actual_harness: bool, clean_profiles: Path
) -> None:
skill = _skill(tmp_path)

def successful(_target: Path) -> ValidationResult:
result = ValidationResult()
result.add_success("completed", "Required check completed")
return result

required = [
_as_result(check, check, successful, skill, publication_check_id=check)
for check in sorted(tier1_required_checks(skill_like=True))
]
for result in required:
result.metadata["benchmark_policy"] = {"tier2_required": False, "tier3_required": False}
assert assess_publication(required, expected_skill_name="demo").status == "pass"

if actual_harness:
harness = run_validation(
skill, checks="harness", harness_profiles=clean_profiles, on_check=lambda _check: None
)[0]
assert harness.findings == []
assert harness.success_details[0].metadata["harnesses"] == ["clean-fixture"]
assert harness.success_details[0].metadata["evaluations_performed"] == 1
else:
harness = _as_result(
"Harness Compatibility",
"Harness",
lambda _target: ValidationResult(),
skill,
publication_check_id="harness",
)
harness.metadata["benchmark_policy"] = {"tier2_required": False, "tier3_required": False}
assessment = assess_publication([*required, harness], expected_skill_name="demo")

assert assessment.status == ("pass" if actual_harness else "incomplete")
assert assessment.reasons == (() if actual_harness else ("Tier 1 lacks trustworthy execution evidence.",))
Loading
Loading