Skip to main content

ralph_workflow/diagnostics/
mod.rs

1//! System and agent diagnostics.
2//!
3//! This module provides comprehensive diagnostic information for troubleshooting
4//! Ralph configuration and environment issues.
5
6mod agents;
7pub mod runtime;
8mod system;
9
10pub use agents::AgentDiagnostics;
11pub use system::SystemInfo;
12
13use crate::agents::AgentRegistry;
14
15/// Complete diagnostic report.
16#[derive(Debug)]
17pub struct DiagnosticReport {
18    pub system: SystemInfo,
19    pub agents: AgentDiagnostics,
20}
21
22/// Run all diagnostics and return the report.
23///
24/// This function gathers all diagnostic information without printing.
25/// The CLI handler is responsible for formatting and displaying the results.
26#[must_use]
27pub fn run_diagnostics(registry: &AgentRegistry) -> DiagnosticReport {
28    let system = SystemInfo::gather();
29    let agents = AgentDiagnostics::test(registry);
30
31    DiagnosticReport { system, agents }
32}