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:
@ -51,7 +51,7 @@ Zeichen: ✓ fertig · ◐ teilweise · ✗ offen · ? nicht geprüft.
|
|||||||
- [#1022] **Runner.** Umgesetzt in `src-tauri/src/runner.rs`, über `start_batch` und `cancel_batch` an die Oberfläche angebunden. Offen: Abbruch in der App real prüfen, Modelle mit eigenem Endpunkt in der Config (Phase 1 hat einen gemeinsamen `ollama_url`). Tests `batch2fortsetzen.1–.2`. → #1005
|
- [#1022] **Runner.** Umgesetzt in `src-tauri/src/runner.rs`, über `start_batch` und `cancel_batch` an die Oberfläche angebunden. Offen: Abbruch in der App real prüfen, Modelle mit eigenem Endpunkt in der Config (Phase 1 hat einen gemeinsamen `ollama_url`). Tests `batch2fortsetzen.1–.2`. → #1005
|
||||||
- [#1023] **SQLite-Speicher.** Umgesetzt in `src-tauri/src/store.rs`, Schema nach SPEC 8. Datei-Datenbank im Datenordner angebunden. Offen: Klicktest `lauf2ergebnis.2` mit Schritt-Ansicht (noch keine Oberfläche dafür). Tests `lauf2ergebnis.2`. → #1006
|
- [#1023] **SQLite-Speicher.** Umgesetzt in `src-tauri/src/store.rs`, Schema nach SPEC 8. Datei-Datenbank im Datenordner angebunden. Offen: Klicktest `lauf2ergebnis.2` mit Schritt-Ansicht (noch keine Oberfläche dafür). Tests `lauf2ergebnis.2`. → #1006
|
||||||
- [#1024] **Aufgaben a-01 bis a-03, b-04 bis b-06 schreiben.** Geschrieben unter `tasks/`. b-06 mit Mutationstest; ein Fehler im Check (veralteter Bytecode bei Mutanten) ist behoben. Ergebnis: mit `qwen3.8-flash-next-q2_0` über strata 6 von 6 bestanden. Bericht in `testberichte/`. Offen: Zeitlimit von b-04 bei langsamen Modellen prüfen. → #1007
|
- [#1024] **Aufgaben a-01 bis a-03, b-04 bis b-06 schreiben.** Geschrieben unter `tasks/`. b-06 mit Mutationstest; ein Fehler im Check (veralteter Bytecode bei Mutanten) ist behoben. Ergebnis: mit `qwen3.8-flash-next-q2_0` über strata 6 von 6 bestanden. Bericht in `testberichte/`. Offen: Zeitlimit von b-04 bei langsamen Modellen prüfen. → #1007
|
||||||
- [#1025] **GUI Setup und Batch.** Gebaut: Pfade, Aufgabenauswahl, Modelle, Wiederholungen, Start, Abbrechen, Live-Log, Ergebnistabelle. Offen: Podman-Status im Setup, Schritt-Log in der Oberfläche, Klicktest `batch2fortsetzen.1` manuell. → #1008
|
- [#1025] **GUI Setup und Batch.** Gebaut: Pfade, Container-Status (Podman-Version im Setup), Aufgabenauswahl, Modelle, Wiederholungen, Start, Abbrechen, Live-Log, Ergebnistabelle, Rangliste und Matrix, Schritt-Ansicht je Lauf. Offen: Klicktests `batch2fortsetzen.1` und `lauf2ergebnis.2` manuell, Oberfläche im Fenster ansehen. → #1008
|
||||||
- [#1026] **Rangliste und Matrix.** Gebaut: Gesamtscore (gewichtet nach `weight`), Median-Dauer als Tie-Breaker, Matrix Modell × Aufgabe mit Erfolgen und Farbe nach Score. Offen: Wilson-Intervall und „nicht unterscheidbar“ (F-12, Phase 2), Lauf-Detail mit Schrittliste, Klicktest `ergebnis2detail.1` manuell. Tests `ergebnis2detail.1`. → #1009
|
- [#1026] **Rangliste und Matrix.** Gebaut: Gesamtscore (gewichtet nach `weight`), Median-Dauer als Tie-Breaker, Matrix Modell × Aufgabe mit Erfolgen und Farbe nach Score. Offen: Wilson-Intervall und „nicht unterscheidbar“ (F-12, Phase 2), Lauf-Detail mit Schrittliste, Klicktest `ergebnis2detail.1` manuell. Tests `ergebnis2detail.1`. → #1009
|
||||||
|
|
||||||
**P2 – danach (Release 0.2.0, Referenz und Tiefe)**
|
**P2 – danach (Release 0.2.0, Referenz und Tiefe)**
|
||||||
|
|||||||
@ -121,6 +121,49 @@ fn batch_results(paths: State<'_, AppPaths>, batch_id: i64) -> Result<Vec<RunRec
|
|||||||
store.runs_for_batch(batch_id)
|
store.runs_for_batch(batch_id)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Schritte eines einzelnen Laufs für die Detailansicht.
|
||||||
|
#[tauri::command]
|
||||||
|
fn run_steps(
|
||||||
|
paths: State<'_, AppPaths>,
|
||||||
|
batch_id: i64,
|
||||||
|
model: String,
|
||||||
|
task_id: String,
|
||||||
|
repeat_idx: u32,
|
||||||
|
) -> Result<Vec<store::StepRow>, String> {
|
||||||
|
let store = Store::open(&paths.0.data_dir.join(DB_FILE))?;
|
||||||
|
store.steps_for_run(batch_id, &model, &task_id, repeat_idx)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Zustand der Container-Laufzeit (Podman) für das Setup.
|
||||||
|
#[derive(serde::Serialize)]
|
||||||
|
pub struct RuntimeStatus {
|
||||||
|
pub program: String,
|
||||||
|
pub available: bool,
|
||||||
|
pub detail: String,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tauri::command]
|
||||||
|
fn runtime_status(cfg: State<'_, Config>) -> RuntimeStatus {
|
||||||
|
let program = cfg.container_runtime.clone();
|
||||||
|
match std::process::Command::new(&program).args(["version", "--format", "{{.Client.Version}}"]).output() {
|
||||||
|
Ok(out) if out.status.success() => RuntimeStatus {
|
||||||
|
program,
|
||||||
|
available: true,
|
||||||
|
detail: format!("Version {}", String::from_utf8_lossy(&out.stdout).trim()),
|
||||||
|
},
|
||||||
|
Ok(out) => RuntimeStatus {
|
||||||
|
program,
|
||||||
|
available: false,
|
||||||
|
detail: String::from_utf8_lossy(&out.stderr).trim().to_string(),
|
||||||
|
},
|
||||||
|
Err(e) => RuntimeStatus {
|
||||||
|
program,
|
||||||
|
available: false,
|
||||||
|
detail: format!("nicht startbar: {e}"),
|
||||||
|
},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Rangliste und Matrix eines Batches. Gewichte kommen aus den Aufgaben.
|
/// Rangliste und Matrix eines Batches. Gewichte kommen aus den Aufgaben.
|
||||||
#[tauri::command]
|
#[tauri::command]
|
||||||
fn batch_ranking(paths: State<'_, AppPaths>, batch_id: i64) -> Result<ranking::Ranking, String> {
|
fn batch_ranking(paths: State<'_, AppPaths>, batch_id: i64) -> Result<ranking::Ranking, String> {
|
||||||
@ -164,7 +207,9 @@ pub fn run() {
|
|||||||
start_batch,
|
start_batch,
|
||||||
cancel_batch,
|
cancel_batch,
|
||||||
batch_results,
|
batch_results,
|
||||||
batch_ranking
|
batch_ranking,
|
||||||
|
run_steps,
|
||||||
|
runtime_status
|
||||||
])
|
])
|
||||||
.run(tauri::generate_context!())
|
.run(tauri::generate_context!())
|
||||||
.expect("error while running tauri application");
|
.expect("error while running tauri application");
|
||||||
|
|||||||
@ -50,6 +50,17 @@ CREATE TABLE IF NOT EXISTS step (
|
|||||||
";
|
";
|
||||||
|
|
||||||
/// Ein abgeschlossener Lauf, so wie er gespeichert wird.
|
/// Ein abgeschlossener Lauf, so wie er gespeichert wird.
|
||||||
|
/// Ein Schritt eines Laufs, für die Anzeige.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
pub struct StepRow {
|
||||||
|
pub idx: i64,
|
||||||
|
pub role: String,
|
||||||
|
pub content: String,
|
||||||
|
pub tool_name: Option<String>,
|
||||||
|
pub tool_args_json: Option<String>,
|
||||||
|
pub tool_result: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
pub struct RunRecord {
|
pub struct RunRecord {
|
||||||
pub batch_id: i64,
|
pub batch_id: i64,
|
||||||
@ -217,6 +228,38 @@ impl Store {
|
|||||||
rows.collect::<Result<Vec<_>, _>>().map_err(|e| e.to_string())
|
rows.collect::<Result<Vec<_>, _>>().map_err(|e| e.to_string())
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Schritte eines Laufs, identifiziert über Batch, Modell, Aufgabe und Wiederholung.
|
||||||
|
pub fn steps_for_run(
|
||||||
|
&self,
|
||||||
|
batch_id: i64,
|
||||||
|
model: &str,
|
||||||
|
task_id: &str,
|
||||||
|
repeat_idx: u32,
|
||||||
|
) -> Result<Vec<StepRow>, String> {
|
||||||
|
let mut stmt = self
|
||||||
|
.conn
|
||||||
|
.prepare(
|
||||||
|
"SELECT s.idx, s.role, s.content, s.tool_name, s.tool_args_json, s.tool_result
|
||||||
|
FROM step s JOIN run r ON s.run_id = r.id
|
||||||
|
WHERE r.batch_id = ?1 AND r.model = ?2 AND r.task_id = ?3 AND r.repeat_idx = ?4
|
||||||
|
ORDER BY s.idx",
|
||||||
|
)
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
let rows = stmt
|
||||||
|
.query_map(params![batch_id, model, task_id, repeat_idx], |r| {
|
||||||
|
Ok(StepRow {
|
||||||
|
idx: r.get(0)?,
|
||||||
|
role: r.get(1)?,
|
||||||
|
content: r.get(2)?,
|
||||||
|
tool_name: r.get(3)?,
|
||||||
|
tool_args_json: r.get(4)?,
|
||||||
|
tool_result: r.get(5)?,
|
||||||
|
})
|
||||||
|
})
|
||||||
|
.map_err(|e| e.to_string())?;
|
||||||
|
rows.collect::<Result<Vec<_>, _>>().map_err(|e| e.to_string())
|
||||||
|
}
|
||||||
|
|
||||||
pub fn run_count(&self, batch_id: i64) -> Result<i64, String> {
|
pub fn run_count(&self, batch_id: i64) -> Result<i64, String> {
|
||||||
self.conn
|
self.conn
|
||||||
.query_row("SELECT COUNT(*) FROM run WHERE batch_id = ?1", params![batch_id], |r| r.get(0))
|
.query_row("SELECT COUNT(*) FROM run WHERE batch_id = ?1", params![batch_id], |r| r.get(0))
|
||||||
@ -301,6 +344,19 @@ mod tests {
|
|||||||
assert!(s.runs_for_batch(99).unwrap().is_empty());
|
assert!(s.runs_for_batch(99).unwrap().is_empty());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn schritte_eines_laufs_werden_gefunden() {
|
||||||
|
let mut s = Store::open_in_memory().unwrap();
|
||||||
|
let b = s.create_batch("", 1, "{}").unwrap();
|
||||||
|
let transcript = vec![Message::new("user", "Aufgabe"), Message::new("assistant", "ok")];
|
||||||
|
s.insert_run(&rec(b, "m1", "a-01", 1), &transcript).unwrap();
|
||||||
|
let steps = s.steps_for_run(b, "m1", "a-01", 1).unwrap();
|
||||||
|
assert_eq!(steps.len(), 2);
|
||||||
|
assert_eq!(steps[0].role, "user");
|
||||||
|
assert_eq!(steps[1].content, "ok");
|
||||||
|
assert!(s.steps_for_run(b, "m1", "a-01", 2).unwrap().is_empty());
|
||||||
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
fn unbekannter_batch_existiert_nicht() {
|
fn unbekannter_batch_existiert_nicht() {
|
||||||
let s = Store::open_in_memory().unwrap();
|
let s = Store::open_in_memory().unwrap();
|
||||||
|
|||||||
@ -56,6 +56,17 @@
|
|||||||
type MatrixCell = { model: string; task_id: string; runs: number; successes: number; mean_score: number };
|
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[] };
|
type Ranking = { batch_id: number; models: ModelRank[]; cells: MatrixCell[]; tasks: string[] };
|
||||||
let ranking = $state<Ranking | null>(null);
|
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 batchError = $state("");
|
||||||
|
|
||||||
let unlisten: UnlistenFn | null = null;
|
let unlisten: UnlistenFn | null = null;
|
||||||
@ -66,6 +77,11 @@
|
|||||||
} catch (e) {
|
} catch (e) {
|
||||||
error = String(e);
|
error = String(e);
|
||||||
}
|
}
|
||||||
|
try {
|
||||||
|
runtime = await invoke<RuntimeStatus>("runtime_status");
|
||||||
|
} catch (e) {
|
||||||
|
runtime = { program: "?", available: false, detail: String(e) };
|
||||||
|
}
|
||||||
try {
|
try {
|
||||||
report = await invoke<LoadReport>("load_tasks");
|
report = await invoke<LoadReport>("load_tasks");
|
||||||
} catch (e) {
|
} 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() {
|
async function cancel() {
|
||||||
await invoke<boolean>("cancel_batch");
|
await invoke<boolean>("cancel_batch");
|
||||||
}
|
}
|
||||||
@ -153,6 +180,18 @@
|
|||||||
<dd><code>{paths.data_dir}</code></dd>
|
<dd><code>{paths.data_dir}</code></dd>
|
||||||
<dt>Aufgabenordner</dt>
|
<dt>Aufgabenordner</dt>
|
||||||
<dd><code>{paths.tasks_dir}</code></dd>
|
<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>
|
</dl>
|
||||||
{:else}
|
{:else}
|
||||||
<p>Lade Pfade …</p>
|
<p>Lade Pfade …</p>
|
||||||
@ -297,6 +336,7 @@
|
|||||||
<th>Score</th>
|
<th>Score</th>
|
||||||
<th>Schritte</th>
|
<th>Schritte</th>
|
||||||
<th>Dauer</th>
|
<th>Dauer</th>
|
||||||
|
<th></th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
<tbody>
|
<tbody>
|
||||||
@ -309,10 +349,31 @@
|
|||||||
<td>{r.score.toFixed(2)}</td>
|
<td>{r.score.toFixed(2)}</td>
|
||||||
<td>{r.steps}</td>
|
<td>{r.steps}</td>
|
||||||
<td>{(r.duration_ms / 1000).toFixed(1)} s</td>
|
<td>{(r.duration_ms / 1000).toFixed(1)} s</td>
|
||||||
|
<td><button onclick={() => showSteps(r)}>Schritte</button></td>
|
||||||
</tr>
|
</tr>
|
||||||
{/each}
|
{/each}
|
||||||
</tbody>
|
</tbody>
|
||||||
</table>
|
</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>
|
</section>
|
||||||
{/if}
|
{/if}
|
||||||
</main>
|
</main>
|
||||||
@ -400,6 +461,21 @@
|
|||||||
color: #c62828;
|
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 {
|
.matrix .zelle {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
font-variant-numeric: tabular-nums;
|
font-variant-numeric: tabular-nums;
|
||||||
|
|||||||
Reference in New Issue
Block a user