Skip to content
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
16 commits
Select commit Hold shift + click to select a range
31f8ad4
fix(reporting): give exact LLM setup fixes and count named Tier 1 checks
chrisknvidia Nov 6, 2026
801acea
fix(reporting): stop validate from repeating its header in short term…
chrisknvidia Nov 6, 2026
d24cc56
Merge branch 'main' into fix/christopherk/validate-fix-lines
rng1995 Nov 7, 2026
6a1f186
Merge branch 'main' into fix/christopherk/validate-fix-lines
rng1995 Nov 7, 2026
319647f
fix(reporting): route Tier 1 setup advice and counts by what actually…
chrisknvidia Nov 13, 2026
f55d4bc
Merge main into fix/christopherk/validate-fix-lines
chrisknvidia Nov 13, 2026
845d441
Merge fix/christopherk/validate-fix-lines into fix/christopherk/valid…
chrisknvidia Nov 13, 2026
048d548
test(reporting): draw the live-view tests on a colourless console
chrisknvidia Nov 13, 2026
10ee7f4
fix(reporting): count Tier 1 validators in the summary row, like the …
chrisknvidia Nov 13, 2026
0137bee
Merge fix/christopherk/validate-fix-lines into fix/christopherk/valid…
chrisknvidia Nov 13, 2026
5ee48f8
Merge main into fix/christopherk/validate-fix-lines
chrisknvidia Nov 13, 2026
74bec2b
Merge fix/christopherk/validate-fix-lines into fix/christopherk/valid…
chrisknvidia Nov 13, 2026
616af6a
Merge main into fix/christopherk/validate-fix-lines
chrisknvidia Nov 13, 2026
bff9795
Merge fix/christopherk/validate-fix-lines into fix/christopherk/valid…
chrisknvidia Nov 13, 2026
ae8ed2e
Merge main into fix/christopherk/validate-repeated-header
chrisknvidia Nov 13, 2026
846f198
Merge main into fix/christopherk/validate-repeated-header
chrisknvidia Nov 13, 2026
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,22 @@ 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

- `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`).

- `validate` no longer repeats its header box in short terminal windows or
when a log warning prints mid-run. Only the tier that is still running is
redrawn; the header and finished tiers print once, and log records print
through the live view's console. The progress line now prints once, above
the final verdict.

## 0.8.0 - 2026-11-05

### Added
Expand Down
19 changes: 19 additions & 0 deletions src/skillevaluator/logging_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,28 @@
_LOG_MARKUP = False


# While a live view owns the terminal, log records print through its console.
# Rich writes every other console past Live's stdout proxy, which leaves stale
# frame lines (a duplicated header) on screen.
_live_console: list[Console] = []


def route_logs_to(target: Console | None) -> None:
"""Print log records through *target* (a live view's console) until called with ``None``."""
_live_console[:] = [target] if target is not None else []


class _LiteralRichHandler(RichHandler):
"""Rich handler that also drops terminal escape sequences from log messages."""

def emit(self, record: logging.LogRecord) -> None:
own = self.console
self.console = _live_console[0] if _live_console else own
try:
super().emit(record)
finally:
self.console = own

def render_message(self, record: logging.LogRecord, message: str) -> ConsoleRenderable:
# Imported here: skillevaluator.utils imports this module.
from skillevaluator.utils.rich_markup import strip_terminal_controls
Expand Down
119 changes: 81 additions & 38 deletions src/skillevaluator/reporting/console_ui.py
Comment thread
devin-ai-integration[bot] marked this conversation as resolved.
Resolved
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@
from rich.text import Text

from skillevaluator.constants import CONTENT_DEDUP_LLM_REFUSED_CHECK
from skillevaluator.logging_config import route_logs_to
from skillevaluator.reporting.base import (
get_skip_reason,
source_validation_errors,
Expand Down Expand Up @@ -527,17 +528,14 @@ def __init__(
def start(self) -> None:
if not self.enabled:
return
self.console.print(self._header())
self.console.print()
if self.console.is_terminal:
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
self._live = Live(
self,
console=self.console,
refresh_per_second=8,
vertical_overflow="visible",
)
# Only unfinished tiers stay live; finished ones print once above. A live
# region taller than the window can't be erased, so each redraw would repeat it.
self._live = Live(get_renderable=self._live_region, console=self.console, refresh_per_second=8)
self._live.start()
else:
self.console.print(self._header())
self.console.print()
route_logs_to(self.console)

def tier_start(self, index: int) -> None:
if not self.enabled:
Expand All @@ -561,8 +559,8 @@ def tier_done(self, index: int, *, failed: bool = False, rows: list[TierRow] | N
block.status = FAIL if failed else PASS
block.duration = time.time() - block.started_at if block.started_at else None
block.rows = rows or []
self._refresh()
self._flush_static()
self._refresh()

def tier_skip(self, index: int, reason: str) -> None:
if not self.enabled:
Expand All @@ -572,30 +570,27 @@ def tier_skip(self, index: int, reason: str) -> None:
# Multi-line reasons (setup instructions) continue on unlabeled rows.
lines = reason.split("\n") or [""]
block.rows = [TierRow("skipped" if index == 0 else "", [(line, MUTED)]) for index, line in enumerate(lines)]
self._refresh()
self._flush_static()
self._refresh()

def finish(self, verdict: Verdict, links: list[tuple[str, str]]) -> None:
if not self.enabled:
return
self.verdict = verdict
self.links = links
if self._live is not None:
self._live.update(self)
self._live.stop()
self._live = None
else:
if len(self.blocks) >= 2:
self.console.print(self._gate())
self.console.print()
self.console.print(self._verdict_panel(verdict))
self.stop()
if len(self.blocks) >= 2:
self.console.print(self._gate())
self.console.print()
for line in self._footer_lines():
self.console.print(line)
self.console.print(self._verdict_panel(verdict))
self.console.print()
for line in self._footer_lines():
self.console.print(line)

def stop(self) -> None:
"""Tear down the live display (safe on errors / KeyboardInterrupt)."""
if self._live is not None:
route_logs_to(None)
self._live.stop()
self._live = None

Expand Down Expand Up @@ -753,17 +748,22 @@ def _footer_lines(self):

def _refresh(self) -> None:
if self._live is not None:
self._live.update(self)
self._live.refresh()

def _live_region(self) -> Group:
return Group(*(self._block_panel(b) for b in self.blocks[self._static_printed :] if b.status != PENDING))

def _flush_static(self) -> None:
"""Non-tty mode: print blocks once, as they complete."""
if self._live is not None or self.console.is_terminal:
return
"""Print blocks once, in order, as they complete."""
done = []
for block in self.blocks[self._static_printed :]:
if block.status in (PENDING, RUNNING):
break
done.append(block)
# Advance first so the live region drops these blocks as they print above it.
self._static_printed += len(done)
for block in done:
self.console.print(self._block_panel(block))
self._static_printed += 1


def check_ticker_row(lineup: list[str], done: list[str], current: str | None) -> TierRow:
Expand Down 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)]
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)


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()
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"
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"
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
Loading
Loading