Skip to content
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,16 @@ All notable changes to SkillEvaluator are documented in this file.
- When CI redaction masks a credential inside a reported PII value, remove the
finding's digest as well.

### Fixed
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved

- `validate` Tier 1 output: when only the `--llm` / `--llm-verify` stage
can't run, `what to fix` gives the exact `export` lines for the missing
provider or key instead of a scanner install or `--skip security`, and the
scanners row keeps the scanner version (`SkillSpector 2.12.0, LLM didn't
run`). The summary row now counts the named checks shown above it, plus
their sub-checks (`9/9 checks passed (24 sub-checks)`), instead of
validators (`11/11 passed`).

## 0.8.0 - 2026-11-05

### Added
Expand Down
65 changes: 54 additions & 11 deletions src/skillevaluator/reporting/console_ui.py
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,8 @@ def _scanners_row(results: list[ValidationResult]) -> list[TierRow]:
states[scanner] = (version, MUTED)
for scan in r.incomplete_scans:
if (scanner := scan.removesuffix("-llm")) in _SCANNER_NAMES:
states[scanner] = ("didn't run", f"bold {RED}")
version = r.scanners.get(scanner) if scan != scanner else None
states[scanner] = (f"{version}, LLM didn't run" if version else "didn't run", f"bold {RED}")
segments: list[tuple[str, str]] = []
for scanner in [name for name in _SCANNER_NAMES if name in states]:
state, style = states[scanner]
Expand Down Expand Up @@ -1037,7 +1038,6 @@ def summarize_tier1(results: list[ValidationResult], lineup: list[str] | None =
section with each check's final state (failed checks in red).
"""
user_skipped = [r for r in results if _is_user_skipped(r)]
total = len(results) - len(user_skipped)
failed = [r for r in results if not r.passed and not _is_skipped(r)]
incomplete = [r for r in failed if r.is_incomplete]
broken = [r for r in failed if not r.is_incomplete]
Expand All @@ -1054,13 +1054,26 @@ def summarize_tier1(results: list[ValidationResult], lineup: list[str] | None =
if lineup:
rows.append(final_check_ticker_row(lineup, results))
rows += scanners
checks_segments: list[tuple[str, str]] = [(f"{total - len(failed)}/{total} passed", TEXT)]
if broken:
checks_segments += [(" · ", FAINT), (f"{len(broken)} failed", f"bold {RED}")]
if incomplete:
checks_segments += [(" · ", FAINT), (f"{len(incomplete)} didn't run", f"bold {RED}")]
if user_skipped:
checks_segments += [(" · ", FAINT), (f"{len(user_skipped)} skipped", MUTED)]

# Count the named checks the lineup shows, not validators: code-integrity alone is three.
def check_of(r: ValidationResult) -> str:
return _check_key(r.validator_name) or _short_name(r.validator_name)

ran = [r for r in results if not _is_user_skipped(r)]
checks = set(map(check_of, ran))
broken_checks = set(map(check_of, broken))
incomplete_checks = set(map(check_of, incomplete)) - broken_checks
skipped_checks = set(map(check_of, user_skipped)) - checks
passed_checks = len(checks) - len(broken_checks) - len(incomplete_checks)
checks_segments: list[tuple[str, str]] = [(f"{passed_checks}/{len(checks)} checks passed", TEXT)]
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
if sub_checks := sum(r.summary.checks_performed for r in ran):
checks_segments.append((f" ({sub_checks} sub-checks)", MUTED))
if broken_checks:
checks_segments += [(" · ", FAINT), (f"{len(broken_checks)} failed", f"bold {RED}")]
if incomplete_checks:
checks_segments += [(" · ", FAINT), (f"{len(incomplete_checks)} didn't run", f"bold {RED}")]
if skipped_checks:
checks_segments += [(" · ", FAINT), (f"{len(skipped_checks)} skipped", MUTED)]
if warnings:
checks_segments += [(" · ", FAINT), (f"{warnings} warning{'s' if warnings != 1 else ''}", MUTED)]
rows.append(TierRow("summary" if lineup else "checks", checks_segments))
Expand Down Expand Up @@ -1095,8 +1108,10 @@ def summarize_tier1(results: list[ValidationResult], lineup: list[str] | None =
grade, score = quality
rows.append(TierRow("quality", [(grade, f"bold {GREEN}"), (f" {score:.1f} / 100", TEXT)]))
items = [_tier1_fix(r) for r in broken]
if incomplete:
items.append(_setup_fix(incomplete))
if setup := [r for r in incomplete if not _only_llm_stages_missing(r)]:
items.append(_setup_fix(setup))
if llm := [r for r in incomplete if _only_llm_stages_missing(r)]:
items.append(_llm_fix(llm))
return not failed, rows + fix_section_rows(items)


Expand Down Expand Up @@ -1141,6 +1156,34 @@ def _setup_fix(results: list[ValidationResult]) -> FixItem:
return FixItem("setup", problem, [*actions, f"or skip it: --skip {skip}"])


def _only_llm_stages_missing(result: ValidationResult) -> bool:
"""True when the check itself ran and only its ``--llm`` / ``--llm-verify`` stage did not."""
scans = result.incomplete_scans
return bool(scans) and all(s.endswith("-llm") or s.startswith("llm-") for s in scans)
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved


def _llm_fix(results: list[ValidationResult]) -> FixItem:
"""One item for checks whose LLM stage could not run: a missing key or a failed provider call."""
from skillevaluator.provider_config import resolve_llm_provider

checks = ", ".join(dict.fromkeys(_short_name(r.validator_name) for r in results))
scans = {s for r in results for s in r.incomplete_scans}
flags = " / ".join(
f for f, on in (("--llm", "skillspector-llm" in scans), ("--llm-verify", "llm-verification" in scans)) if on
)
try:
resolve_llm_provider()
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
except ValueError as exc:
reason, *setup = str(exc).splitlines() or [""]
exports = [line.strip().removeprefix("export ") for line in setup if line.strip().startswith("export ")]
problem = f"{checks} LLM review didn't run: {reason.rstrip('.')}"
action = f"export {' '.join(exports)}" if exports else "set up an LLM provider and key, then rerun"
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
else:
problem = f"{checks} LLM review didn't run: the LLM provider call failed"
action = "check the key and model with: skillevaluator doctor --tier 2 --verify-models"
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
return FixItem("setup", problem, [action, f"or rerun without {flags or '--llm'}"])


def _skip_name(validator_name: str) -> str:
"""The ``--skip`` value that leaves out the check producing *validator_name*."""
if validator_name == "Secrets Detection":
Expand Down
92 changes: 91 additions & 1 deletion tests/reporting/test_tier3_validate_cases.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from pathlib import Path
from types import SimpleNamespace

import pytest

from skillevaluator.reporting.console_ui import ViewProgressReporter, _fit_row, tier3_case_rows, tier3_fix_rows
from skillevaluator.tier3.case_summary import live_case_marks

Expand Down Expand Up @@ -107,7 +109,7 @@ def test_fix_section_for_tier1_and_tier2():
clean = ValidationResult(validator_name="Version Check", passed=True)
_ok, rows = summarize_tier1([schema, secrets, clean])
text = _text(rows)
assert "1/3 passed · 1 failed · 1 didn't run" in text
assert "1/3 checks passed · 1 failed · 1 didn't run" in text
assert "Author not specified in metadata\n" + " " * 12 + "→ Add 'metadata.author'" in text
assert "secrets didn't run: gitleaks not installed\n" + " " * 12 + "→ brew install gitleaks" in text
assert [r.label for r in rows if r.glyph in {"1", "2"}][1] == "setup"
Expand Down Expand Up @@ -212,3 +214,91 @@ def test_setup_fix_names_failed_skillspector_setup():
"or install it yourself: uv tool install skillspector.whl",
"or skip it: --skip security",
]


def _security_without_llm():
from skillevaluator.models.result import ValidationResult

security = ValidationResult(
validator_name="Security Scan",
passed=False,
metadata={"incomplete_scans": ["skillspector-llm", "llm-verification"], "scanners": {"skillspector": "2.13.3"}},
)
security.errors.append("skillspector-llm failed with unexpected exit code 2: scanner diagnostics were redacted")
return security


def test_llm_fix_asks_for_the_key_not_a_scanner_install(monkeypatch):
from skillevaluator import provider_config
from skillevaluator.reporting.console_ui import _llm_fix

def no_key():
raise provider_config.ProviderConfigurationError(
"SKILL_EVAL_LLM_API_KEY is required for the selected provider.\n\n"
"Set it in your shell:\n export SKILL_EVAL_LLM_API_KEY='your-api-key'\n"
)

monkeypatch.setattr(provider_config, "resolve_llm_provider", no_key)
item = _llm_fix([_security_without_llm()])
assert item.problem == (
"security LLM review didn't run: SKILL_EVAL_LLM_API_KEY is required for the selected provider"
)
assert item.actions == [
"export SKILL_EVAL_LLM_API_KEY='your-api-key'",
"or rerun without --llm / --llm-verify",
]


def test_llm_fix_without_a_provider_gives_every_export(monkeypatch):
from skillevaluator import provider_config
from skillevaluator.reporting.console_ui import _llm_fix

monkeypatch.delenv("SKILL_EVAL_LLM_PROVIDER", raising=False)
monkeypatch.delenv("SKILL_EVAL_LLM_API_KEY", raising=False)
for name in ("NVIDIA_API_KEY", "OPENAI_API_KEY", "ANTHROPIC_API_KEY"):
monkeypatch.delenv(name, raising=False)
with pytest.raises(provider_config.ProviderConfigurationError):
provider_config.resolve_llm_provider()
item = _llm_fix([_security_without_llm()])
assert item.problem == "security LLM review didn't run: No provider is configured"
assert item.actions[0] == "export SKILL_EVAL_LLM_PROVIDER=nv_build NVIDIA_API_KEY='your-api-key'"


def test_llm_fix_points_at_doctor_when_the_provider_call_fails(monkeypatch):
from skillevaluator import provider_config
from skillevaluator.reporting.console_ui import _llm_fix

monkeypatch.setattr(provider_config, "resolve_llm_provider", object)
security = _security_without_llm()
security.metadata["incomplete_scans"] = ["llm-verification"]
item = _llm_fix([security])
assert item.problem == "security LLM review didn't run: the LLM provider call failed"
assert item.actions == [
"check the key and model with: skillevaluator doctor --tier 2 --verify-models",
"or rerun without --llm-verify",
]


def test_scanners_row_keeps_the_version_when_only_the_llm_stage_failed():
from skillevaluator.reporting.console_ui import _only_llm_stages_missing, _scanners_row

security = _security_without_llm()
assert _only_llm_stages_missing(security)
assert "SkillSpector 2.13.3, LLM didn't run" in _text(_scanners_row([security]))
security.metadata["incomplete_scans"] = ["skillspector"]
assert not _only_llm_stages_missing(security)


def test_tier1_summary_counts_named_checks_and_their_sub_checks():
from skillevaluator.models.result import ValidationResult
from skillevaluator.reporting.console_ui import summarize_tier1

results = [ValidationResult(validator_name=name, passed=True) for name in ("Code Risk Analysis", "Schema")]
results.append(_security_without_llm())
for result, performed in zip(results, (2, 10, 1), strict=True):
result.summary.checks_performed = performed
secrets = ValidationResult(validator_name="Secrets Detection", passed=False)
secrets.errors.append("leaked token")
results.append(secrets)
_ok, rows = summarize_tier1(results, lineup=["code-integrity", "schema", "security"])
assert "1/3 checks passed (13 sub-checks) · 1 failed · 1 didn't run" in _text(rows)
3 changes: 2 additions & 1 deletion tests/test_skip_checks.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,8 @@ def test_skipped_check_is_visible_in_tier1_summary():
_ok, rows = summarize_tier1(results, lineup=["schema", "unicode"])
text = "\n".join("".join(seg for seg, _style in row.segments) for row in rows)
assert "\N{EN DASH} unicode" in text
assert "1/1 passed · 1 skipped" in text
assert "1/1 checks passed" in text
assert " · 1 skipped" in text
assert "unicode with --skip, not checked" in text


Expand Down
Loading