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:
2026-11-07 11:55:56 +01:00
parent 668e690cda
commit 91a15baebc
4 changed files with 179 additions and 2 deletions

View File

@ -121,6 +121,49 @@ fn batch_results(paths: State<'_, AppPaths>, batch_id: i64) -> Result<Vec<RunRec
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.
#[tauri::command]
fn batch_ranking(paths: State<'_, AppPaths>, batch_id: i64) -> Result<ranking::Ranking, String> {
@ -164,7 +207,9 @@ pub fn run() {
start_batch,
cancel_batch,
batch_results,
batch_ranking
batch_ranking,
run_steps,
runtime_status
])
.run(tauri::generate_context!())
.expect("error while running tauri application");