feat: Podman-Status im Setup und Schritt-Ansicht je Lauf
Setup zeigt, ob der Container-Befehl läuft (Version). Ergebnistabelle hat eine Schritte-Ansicht: Nachrichten, Tool-Aufrufe und Tool-Antworten eines Laufs aus der Datenbank. Store-Test grün, 53 Unit-Tests insgesamt. Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
@ -56,6 +56,17 @@
|
||||
type MatrixCell = { model: string; task_id: string; runs: number; successes: number; mean_score: number };
|
||||
type Ranking = { batch_id: number; models: ModelRank[]; cells: MatrixCell[]; tasks: string[] };
|
||||
let ranking = $state<Ranking | null>(null);
|
||||
type RuntimeStatus = { program: string; available: boolean; detail: string };
|
||||
type StepRow = {
|
||||
idx: number;
|
||||
role: string;
|
||||
content: string;
|
||||
tool_name: string | null;
|
||||
tool_args_json: string | null;
|
||||
tool_result: string | null;
|
||||
};
|
||||
let runtime = $state<RuntimeStatus | null>(null);
|
||||
let detail = $state<{ model: string; task_id: string; repeat_idx: number; steps: StepRow[] } | null>(null);
|
||||
let batchError = $state("");
|
||||
|
||||
let unlisten: UnlistenFn | null = null;
|
||||
@ -66,6 +77,11 @@
|
||||
} catch (e) {
|
||||
error = String(e);
|
||||
}
|
||||
try {
|
||||
runtime = await invoke<RuntimeStatus>("runtime_status");
|
||||
} catch (e) {
|
||||
runtime = { program: "?", available: false, detail: String(e) };
|
||||
}
|
||||
try {
|
||||
report = await invoke<LoadReport>("load_tasks");
|
||||
} catch (e) {
|
||||
@ -133,6 +149,17 @@
|
||||
}
|
||||
}
|
||||
|
||||
async function showSteps(r: RunRow) {
|
||||
if (batchId === null) return;
|
||||
const steps = await invoke<StepRow[]>("run_steps", {
|
||||
batchId,
|
||||
model: r.model,
|
||||
taskId: r.task_id,
|
||||
repeatIdx: r.repeat_idx,
|
||||
});
|
||||
detail = { model: r.model, task_id: r.task_id, repeat_idx: r.repeat_idx, steps };
|
||||
}
|
||||
|
||||
async function cancel() {
|
||||
await invoke<boolean>("cancel_batch");
|
||||
}
|
||||
@ -153,6 +180,18 @@
|
||||
<dd><code>{paths.data_dir}</code></dd>
|
||||
<dt>Aufgabenordner</dt>
|
||||
<dd><code>{paths.tasks_dir}</code></dd>
|
||||
<dt>Container</dt>
|
||||
<dd>
|
||||
{#if runtime}
|
||||
{#if runtime.available}
|
||||
<span class="ok">{runtime.program} verfügbar, {runtime.detail}</span>
|
||||
{:else}
|
||||
<span class="fehler">{runtime.program} nicht nutzbar: {runtime.detail}</span>
|
||||
{/if}
|
||||
{:else}
|
||||
Prüfe …
|
||||
{/if}
|
||||
</dd>
|
||||
</dl>
|
||||
{:else}
|
||||
<p>Lade Pfade …</p>
|
||||
@ -297,6 +336,7 @@
|
||||
<th>Score</th>
|
||||
<th>Schritte</th>
|
||||
<th>Dauer</th>
|
||||
<th></th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
@ -309,10 +349,31 @@
|
||||
<td>{r.score.toFixed(2)}</td>
|
||||
<td>{r.steps}</td>
|
||||
<td>{(r.duration_ms / 1000).toFixed(1)} s</td>
|
||||
<td><button onclick={() => showSteps(r)}>Schritte</button></td>
|
||||
</tr>
|
||||
{/each}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
{#if detail}
|
||||
<h3>Schritte: {detail.model} · {detail.task_id} · Wdh. {detail.repeat_idx}</h3>
|
||||
<ol class="schritte">
|
||||
{#each detail.steps as st (st.idx)}
|
||||
<li>
|
||||
<strong>{st.role}</strong>
|
||||
{#if st.tool_name}
|
||||
· Tool <code>{st.tool_name}</code> <code>{st.tool_args_json ?? ""}</code>
|
||||
{/if}
|
||||
{#if st.content}
|
||||
<pre>{st.content}</pre>
|
||||
{/if}
|
||||
{#if st.tool_result}
|
||||
<pre class="ergebnis">{st.tool_result}</pre>
|
||||
{/if}
|
||||
</li>
|
||||
{/each}
|
||||
</ol>
|
||||
{/if}
|
||||
</section>
|
||||
{/if}
|
||||
</main>
|
||||
@ -400,6 +461,21 @@
|
||||
color: #c62828;
|
||||
}
|
||||
|
||||
.ok {
|
||||
color: #2e7d32;
|
||||
}
|
||||
|
||||
.schritte pre {
|
||||
white-space: pre-wrap;
|
||||
overflow-wrap: anywhere;
|
||||
max-height: 12rem;
|
||||
overflow-y: auto;
|
||||
background: #8881;
|
||||
padding: 0.4rem;
|
||||
margin: 0.3rem 0;
|
||||
font-size: 0.85rem;
|
||||
}
|
||||
|
||||
.matrix .zelle {
|
||||
text-align: center;
|
||||
font-variant-numeric: tabular-nums;
|
||||
|
||||
Reference in New Issue
Block a user