use Diagnostic;
/// Serialize a [`Diagnostic`] to a single-line JSON string. Tagged
/// discriminated union (`#[serde(tag = "type")]`) keeps the shape
/// stable across versions. Returns `None` only on JSON serialization
/// failure, which should never happen for the variants we own.