feat: Rangliste und Matrix für Batches

ranking.rs: Gesamtscore je Modell (gewichtet nach weight aus task.toml),
Median-Dauer und Completion-Tokens als Tie-Breaker, Matrix Modell × Aufgabe
mit Erfolgen und mittlerem Score. Befehl batch_ranking, Anzeige nach dem
Batch. 5 Unit-Tests grün, 47 insgesamt. Wilson-Intervalle folgen mit F-12.

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-07 11:54:28 +01:00
parent bf3d8d8459
commit 668e690cda
4 changed files with 321 additions and 3 deletions

View File

@ -1,5 +1,6 @@
mod agent;
mod config;
mod ranking;
mod runner;
mod sandbox;
mod store;
@ -120,6 +121,19 @@ fn batch_results(paths: State<'_, AppPaths>, batch_id: i64) -> Result<Vec<RunRec
store.runs_for_batch(batch_id)
}
/// 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> {
let store = Store::open(&paths.0.data_dir.join(DB_FILE))?;
let runs = store.runs_for_batch(batch_id)?;
let weights: std::collections::BTreeMap<String, f64> = tasks::load_all(&paths.0.tasks_dir)
.tasks
.into_iter()
.map(|t| (t.meta.id, t.meta.weight))
.collect();
Ok(ranking::compute(batch_id, &runs, &weights))
}
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
tauri::Builder::default()
@ -149,7 +163,8 @@ pub fn run() {
load_tasks,
start_batch,
cancel_batch,
batch_results
batch_results,
batch_ranking
])
.run(tauri::generate_context!())
.expect("error while running tauri application");