wip: Report harmony execution outcome

This commit is contained in:
2025-09-09 17:59:14 -04:00
parent 11481b16cd
commit ceafabf430
16 changed files with 217 additions and 190 deletions

View File

@@ -0,0 +1,32 @@
use std::sync::Mutex;
use harmony::instrumentation::{self, HarmonyEvent};
use log::info;
pub fn init() {
let details: Mutex<Vec<String>> = Mutex::new(vec![]);
instrumentation::subscribe("Harmony CLI Reporter", {
move |event| {
let mut details = details.lock().unwrap();
if let HarmonyEvent::InterpretExecutionFinished {
execution_id: _,
topology: _,
interpret: _,
score: _,
outcome: Ok(outcome),
} = event
{
if outcome.status == harmony::interpret::InterpretStatus::SUCCESS {
details.extend(outcome.details.clone());
}
} else if let HarmonyEvent::HarmonyFinished = event {
info!("Here's a summary of what happened:");
for detail in details.iter() {
println!("{detail}");
}
}
}
});
}