Finalize structured diagnostic aggregation

This commit is contained in:
2026-08-27 16:40:17 +00:00
parent 480680b257
commit 4dbbf68051
112 changed files with 656 additions and 893 deletions

View File

@@ -51,7 +51,7 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
if err != nil {
return contracts.ValidationResult{Approved: true}, nil
}
warnings := make([]contracts.Warning, 0)
warnings := make([]diagnostics.Finding, 0)
for index, scene := range req.Value.Scenes {
citedText, err := resolver.CitedText([]source.SourceRef{scene.SourceRef})
if err != nil {
@@ -98,8 +98,8 @@ func significant(token string) bool {
return !ignored
}
func warning(index int, field string) contracts.Warning {
return contracts.Warning{
func warning(index int, field string) diagnostics.Finding {
return diagnostics.Finding{
Scope: fmt.Sprintf("scenes[%d].%s", index, field),
ReasonCode: ReasonCode,
Message: "scene description " + field + " has no significant token in cited source text",