From 8ec5c28623ead3cb3b6660157a4da2d3ec712b39 Mon Sep 17 00:00:00 2001 From: PeterChrz Date: Sun, 20 Sep 2026 23:32:43 -0400 Subject: [PATCH] Severity-ordered psychbench sections, streamlined run metadata card with server config YAML --- app/Models/BenchmarkRun.php | 17 +++++++++++++- resources/views/livewire/runs/show.blade.php | 24 ++++++++------------ 2 files changed, 26 insertions(+), 15 deletions(-) diff --git a/app/Models/BenchmarkRun.php b/app/Models/BenchmarkRun.php index 13a7dfb..5a5eb57 100644 --- a/app/Models/BenchmarkRun.php +++ b/app/Models/BenchmarkRun.php @@ -130,9 +130,24 @@ public function suiteResults(?string $level = null, ?string $sortBy = null, ?str $orderCol = $sortBy ?? $defaultOrder; $direction = $sortDir === 'asc' ? 'asc' : 'desc'; + // psychbench sections are severity labels (mild → severe). Sort them + // by clinical severity, not alphabetically, when sorting by section. + $severitySort = $this->suite === 'psychbench' && $orderCol === 'section'; + return $this->{$relation}() ->when($level !== null && $level !== '', fn ($q) => $q->where('level', $level)) - ->orderBy($orderCol, $direction) + ->when($severitySort, function ($q) use ($direction) { + $q->orderByRaw("CASE section + WHEN 'mild' THEN 1 + WHEN 'moderate' THEN 2 + WHEN 'difficult' THEN 3 + WHEN 'severe' THEN 4 + WHEN 'documentation' THEN 5 + ELSE 6 + END {$direction}"); + }, function ($q) use ($orderCol, $direction) { + $q->orderBy($orderCol, $direction); + }) ->orderBy('id') ->get(); } diff --git a/resources/views/livewire/runs/show.blade.php b/resources/views/livewire/runs/show.blade.php index 297a2de..4efc3a9 100644 --- a/resources/views/livewire/runs/show.blade.php +++ b/resources/views/livewire/runs/show.blade.php @@ -131,24 +131,20 @@ private function sortDir(): string - {{ __('Run metadata') }} -
-
{{ __('Engine build') }}
{{ $this->run->engine_build ?? '—' }}
-
{{ __('Context') }}
{{ number_format($this->run->n_ctx ?? 0) }}
-
{{ __('Slots') }}
{{ $this->run->slots ?? '—' }}
+
{{ __('GPU') }}
{{ ($this->run->gpu_count ? $this->run->gpu_count.'x ' : '').($this->run->gpu ?? 'unknown') }}
+
{{ __('Context') }}
{{ number_format($this->run->n_ctx ?? 0) }}
{{ __('Inference host') }}
{{ $this->run->engine ?? 'unknown' }}
-
{{ __('Image digest') }}
{{ $this->run->image_digest ?? '—' }}
- @if ($this->run->serverConfig) -
{{ __('Server config') }}
{{ $this->run->serverConfig->name }}
- @endif - @if ($this->run->suite_versions) -
{{ __('Suite versions') }}
{{ json_encode($this->run->suite_versions) }}
- @endif - @if ($this->run->validators) -
{{ __('Validators') }}
{{ json_encode($this->run->validators) }}
+ @if ($this->run->label) +
{{ __('Run name') }}
{{ $this->run->label }}
@endif
+ @if ($this->run->serverConfig) +
+ {{ __('Server config') }} — {{ $this->run->serverConfig->name }} +
{{ $this->run->serverConfig->config_yaml }}
+
+ @endif @if ($this->run->isOwnedBy(auth()->user()))