Added the Model Comparison assistant for blind comparisons of two models (#1009)

Co-authored-by: Thorsten Sommer <SommerEngineering@users.noreply.github.com>
This commit is contained in:
Dominic NeuburgandThorsten Sommer authored and GitHub committed 2026-11-14 14:11:34 +01:00
1 parent 12f26445ba
commit b7255694cd
221 files changed
+19989 -90

No files matched your search

+17 -1
View File
@@ -52,7 +52,7 @@ const SETTINGS_FILE_NAME: &str = "settings.json";
/// (`DataBackupContents`) includes. The runtime refuses a plan which names anything else, so that
/// whatever goes wrong in the app, a restore never replaces the logs, the downloaded tools, or the
/// data folder as a whole.
const REPLACEABLE_ELEMENTS: [(Location, &str); 11] = [
const REPLACEABLE_ELEMENTS: [(Location, &str); 12] = [
(Location::ConfigDirectory, SETTINGS_FILE_NAME),
(Location::DataDirectory, "workspaces/"),
(Location::DataDirectory, "tempChats/"),
@@ -61,6 +61,7 @@ const REPLACEABLE_ELEMENTS: [(Location, &str); 11] = [
(Location::DataDirectory, "tokenizers/"),
(Location::DataDirectory, "visualBriefings/"),
(Location::DataDirectory, "beyondFactsLab/"),
(Location::DataDirectory, "modelComparisons/"),
(Location::DataDirectory, "databases/sqlite/"),
(Location::DataDirectory, "databases/vector_database/stores/"),
(Location::DataDirectory, "mediaTranscripts/"),
@@ -827,6 +828,21 @@ mod tests {
assert!(!test.exists(Location::DataDirectory, "beyondFactsLab/current"));
}
#[test]
fn a_restore_replaces_the_files_of_the_model_comparison() {
let test = TestFolders::new();
test.write_current_data();
test.write(Location::DataDirectory, "modelComparisons/presets/current.json", "current preset");
test.prepare_restore(r#"{ "location": "DATA_DIRECTORY", "relative_path": "modelComparisons/", "keep": [] }"#);
test.write(Location::DataDirectory, ".restore-pending/modelComparisons/presets/restored.json", "restored preset");
let outcome = apply_pending_restore_in(&test.folders(), &[]);
assert_eq!(outcome, Some(RestoreOutcome::Applied));
assert_eq!(test.read(Location::DataDirectory, "modelComparisons/presets/restored.json").as_deref(), Some("restored preset"));
assert!(!test.exists(Location::DataDirectory, "modelComparisons/presets/current.json"));
}
#[test]
fn a_plan_which_names_another_element_is_refused() {
for relative_path in ["", "events.log", "databases/", "../data/", "pandoc/"] {