gargamelle/diagnostics
Presentation of structural and semantic contract failures. Summaries are bounded; JSON output retains the complete error tree. Neither operation validates data, runs callbacks, or changes acceptance.
Values
pub fn summary(
error: gargamelle.ContractError,
max_details: Int,
) -> String
Render at most max_details detail lines, clamped to 0..100, followed by a
truncation marker when information is omitted. Branch expansion stops at depth
eight. Each line is limited to 160 graphemes; quoted paths/messages escape line
breaks and control characters. The full input error remains unchanged.
These limits bound presentation, not validation or the size of its error tree.
Categories and wording may evolve before 1.0; match structured categories
rather than parsing summary text. Application-authored messages are not redacted.
pub fn to_json(
error: gargamelle.ContractError,
) -> Result(gargamelle.Json, gargamelle.AdmissionError)
Serialize the complete diagnostic tree as admitted JSON. Branch and requirement indices are zero-based. No submitted JSON values are included. Application requirement descriptions and violation messages are included verbatim; those strings may themselves contain sensitive information supplied by the application. Non-scalar diagnostic strings return an admission error.