pub fn write_json(run: &AnalysisRun, output_path: &Path) -> Result<()>
Returns an error if serialization fails or the output file cannot be written.