Skip to content
Merged
Show file tree
Hide file tree
Changes from 3 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
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -268,6 +268,11 @@ All notable changes to SkillEvaluator are documented in this file.

### Changed

- Root help shows the SkillEvaluator wordmark in more terminals: the
Comment thread
chrisknvidia marked this conversation as resolved.
Resolved
one-line wordmark still needs 115 columns, 76-114 columns now get the same
letters stacked (SKILL over EVALUATOR), and 60-75 columns get a two-row
wordmark. Narrower terminals keep the plain title.

- Upgrade the Tier 3 backend to Harbor 0.25.0. Align supported sandbox
constructor options with the release while reserving automatic mounts and
host Compose environment forwarding for evaluator policy. Preserve local
Expand Down
28 changes: 24 additions & 4 deletions src/skillevaluator/cli_help.py
Original file line number Diff line number Diff line change
Expand Up @@ -49,14 +49,25 @@
_INDENT = (0, 0, 0, 2)

# ANSI Shadow lettering, stored as text so no font dependency is needed at runtime.
# Keep the full letter shapes; smaller terminals get a plain title, not squeezed art.
# Narrower terminals get the same letters stacked, then a two-row wordmark, then a plain title.
_WORDMARK = """███████╗██╗ ██╗██╗██╗ ██╗ ███████╗██╗ ██╗ █████╗ ██╗ ██╗ ██╗ █████╗ ████████╗ ██████╗ ██████╗
██╔════╝██║ ██╔╝██║██║ ██║ ██╔════╝██║ ██║██╔══██╗██║ ██║ ██║██╔══██╗╚══██╔══╝██╔═══██╗██╔══██╗
███████╗█████╔╝ ██║██║ ██║ █████╗ ██║ ██║███████║██║ ██║ ██║███████║ ██║ ██║ ██║██████╔╝
╚════██║██╔═██╗ ██║██║ ██║ ██╔══╝ ╚██╗ ██╔╝██╔══██║██║ ██║ ██║██╔══██║ ██║ ██║ ██║██╔══██╗
███████║██║ ██╗██║███████╗███████╗ ███████╗ ╚████╔╝ ██║ ██║███████╗╚██████╔╝██║ ██║ ██║ ╚██████╔╝██║ ██║
╚══════╝╚═╝ ╚═╝╚═╝╚══════╝╚══════╝ ╚══════╝ ╚═══╝ ╚═╝ ╚═╝╚══════╝ ╚═════╝ ╚═╝ ╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝"""

_WORDMARK_STACKED = "\n".join(
[line[:35].rstrip() for line in _WORDMARK.splitlines()] + [line[39:].rstrip() for line in _WORDMARK.splitlines()]
)

_WORDMARK_SMALL = """█▀ █▄▀ █ █ █ █▀▀ █ █ ▄▀█ █ █ █ ▄▀█ ▀█▀ █▀█ █▀█
▄█ █ █ █ █▄▄ █▄▄ ██▄ ▀▄▀ █▀█ █▄▄ █▄█ █▀█ █ █▄█ █▀▄"""

# Narrowest terminal that gets any wordmark. The version line can be as wide as the small
# one, so fitting alone would show it at 58-59 columns, where the plain title is intended.
_WORDMARK_MIN_WIDTH = 60


def _welcome_banner(command: click.Command, ctx: click.Context, *, width: int) -> RenderableType | None:
"""Brand interactive root help without adding output to command execution."""
Expand All @@ -75,10 +86,19 @@ def _welcome_banner(command: click.Command, ctx: click.Context, *, width: int) -
except UnicodeEncodeError:
supports_blocks = False
tagline = "Static checks · Deduplication · Live evaluation"
if supports_blocks and width >= max(map(len, _WORDMARK.splitlines())):
heading = Text(_WORDMARK, style="bold #76b900")
subtitle = f"v{__version__} · {tagline}"
wordmark = next(
(
art
for art in (_WORDMARK, _WORDMARK_STACKED, _WORDMARK_SMALL)
if supports_blocks and width >= max(_WORDMARK_MIN_WIDTH, len(subtitle), *map(len, art.splitlines()))
),
None,
)
if wordmark is not None:
heading = Text(wordmark, style="bold #76b900")
heading.highlight_regex(r"[╔╗╚╝═║]+", style="dim #76b900")
lines = [Text(""), heading, Text(""), Text(f"v{__version__} · {tagline}", style="dim")]
lines = [Text(""), heading, Text(""), Text(subtitle, style="dim")]
else:
lines = [Text(f"SKILLEVALUATOR v{__version__}", style="bold #76b900"), Text(tagline, style="dim")]
return Group(*lines)
Expand Down
24 changes: 23 additions & 1 deletion tests/test_cli_banner.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 @@ -47,7 +47,29 @@ def test_interactive_root_help_has_wordmark_and_installed_version(terminal, monk
assert all(len(line) <= 80 for line in help_text.splitlines())


@pytest.mark.parametrize("formatter_width,terminal_width", [(78, 40), (78, 80), (78, 114)])
@pytest.mark.parametrize("terminal_width", [76, 114])
def test_medium_help_stacks_the_full_wordmark(terminal, monkeypatch, terminal_width):
monkeypatch.setattr(shutil, "get_terminal_size", lambda: os.terminal_size((terminal_width, 40)))
banner = root_help(78).split("Usage:", 1)[0]

assert len([line for line in banner.splitlines() if "█" in line]) == 10
assert "╚══════╝" in banner
assert f"v{__version__}" in banner
assert all(len(line) <= terminal_width for line in banner.splitlines())


@pytest.mark.parametrize("terminal_width", [60, 75])
def test_small_help_uses_two_row_wordmark(terminal, monkeypatch, terminal_width):
monkeypatch.setattr(shutil, "get_terminal_size", lambda: os.terminal_size((terminal_width, 40)))
banner = root_help(78).split("Usage:", 1)[0]

assert len([line for line in banner.splitlines() if "█" in line]) == 2
assert "╚══════╝" not in banner
assert f"v{__version__}" in banner
assert all(len(line) <= terminal_width for line in banner.splitlines())


@pytest.mark.parametrize("formatter_width,terminal_width", [(78, 40), (78, 57), (78, 58), (78, 59)])
def test_narrow_help_uses_compact_banner(terminal, monkeypatch, formatter_width, terminal_width):
monkeypatch.setattr(shutil, "get_terminal_size", lambda: os.terminal_size((terminal_width, 40)))
banner = root_help(formatter_width).split("Usage:", 1)[0]
Expand Down
Loading