Diagnostics framework