Diagnostics Model
Buffalo Core provides structured diagnostics so Buffalo projects can report validation, workflow, and runtime issues in a consistent way. The design is intentionally small and machine-readable.
Components
DiagnosticSeverityclassifies one diagnostic aserror,warning, orinfo.DiagnosticLocationoptionally records where a diagnostic applies.Diagnosticstores the stable code, message, severity, and optional location.DiagnosticReportgroups ordered diagnostics from one workflow.OperationResult[T]pairs one primary return value with aDiagnosticReport.
Design Goals
Diagnostics should support both human-facing reporting and programmatic inspection. The model should work for configuration validation, geometry preparation, sampling workflows, export helpers, and future solver orchestration. Buffalo Core keeps this layer domain-light so that other Buffalo projects can build richer conventions on top of it without changing the shared types.
Usage Pattern
Use Diagnostic values when a workflow needs to communicate structured issues without immediately raising an exception.
Use DiagnosticReport to aggregate those issues for a single operation.
Use OperationResult[T] when a function should return both a value and the diagnostics emitted while producing it.