buffalo_core.Diagnostic

class buffalo_core.Diagnostic(severity, code, message, location=None)[source]

Bases: object

Structured diagnostic suitable for programmatic reporting.

Raises:

ValueError – If code or message is an empty string.

Notes

The code field is intended to remain stable enough for programmatic filtering and test assertions. The message field is intended for direct human consumption.

Attributes

severity

Severity classification for the diagnostic.

code

Stable machine-readable diagnostic code.

message

Human-readable message describing the issue or informational result.

location

Optional location metadata that localizes where the diagnostic applies.

severity: DiagnosticSeverity

Severity classification for the diagnostic.

code: str

Stable machine-readable diagnostic code.

message: str

Human-readable message describing the issue or informational result.

location: DiagnosticLocation | None

Optional location metadata that localizes where the diagnostic applies.