Classify framework process diagnostics

This commit is contained in:
2026-08-27 15:33:13 +00:00
parent ba569594a1
commit 5175cb0722
10 changed files with 71 additions and 27 deletions

View File

@@ -88,6 +88,26 @@ func MaterializeReferences(resolved ResolvedPipeline, catalog ModuleCatalog, opt
return out, warnings, nil
}
// ReferenceDiagnostics converts framework-owned empty-reference findings into
// structured process diagnostics. Legacy callers may continue to use the
// materializer's warning return while the framework migration is in progress.
func ReferenceDiagnostics(warnings []contracts.Warning) []contracts.ProducerDiagnostic {
diagnostics := make([]contracts.ProducerDiagnostic, 0, len(warnings))
for _, warning := range warnings {
if warning.ReasonCode != "empty_reference" {
continue
}
diagnostics = append(diagnostics, contracts.ProducerDiagnostic{
Disposition: contracts.DiagnosticDispositionWarning,
Category: contracts.DiagnosticCategoryConfiguration,
ReasonCode: "empty_reference",
OccurrenceCount: 1,
Samples: []contracts.DiagnosticSample{{Scope: warning.Scope, Message: warning.Message}},
})
}
return contracts.CloneProducerDiagnostics(diagnostics)
}
func materializeReferenceTarget(
pipelineID string,
target ResolvedReferenceTarget,