Display validated sources
Source fields are optional and can vary by retrieval provider. Render defensively and keep citation warnings visible.
type Source = {
title?: string;
url?: string;
source?: string;
official?: boolean;
};
function sourceLabel(source: Source): string {
return source.title ?? source.source ?? source.url ?? "Source";
}
const sources: Source[] = response.sources ?? response.lessons_used ?? [];
const warnings: string[] = response.citation_warnings ?? [];
Do not infer that all sources are official because official_documentation_used is true. That field only indicates official documentation participated in the analysis. Avoid presenting legacy sources as trusted when the retrieved session includes a citation warning about unknown validation status.