Classify source relatedness as data-quality advisories
This commit is contained in:
@@ -14,10 +14,9 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
Key = "extract/dnd/enemy-events/source_relatedness"
|
||||
WarningReasonCode = "enemy_event_not_near_source"
|
||||
OmittedReasonCode = "enemy_event_relatedness_warnings_omitted"
|
||||
policy = "dnd.enemy_events.validator.source_relatedness.v1"
|
||||
Key = "extract/dnd/enemy-events/source_relatedness"
|
||||
ReasonCode = "enemy_event_not_near_source"
|
||||
policy = "dnd.enemy_events.validator.source_relatedness.v1"
|
||||
)
|
||||
|
||||
type Options struct{}
|
||||
@@ -51,13 +50,13 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
|
||||
}
|
||||
warnings = append(warnings, contracts.Warning{
|
||||
Scope: fmt.Sprintf("events[%d]", eventIndex),
|
||||
ReasonCode: WarningReasonCode,
|
||||
ReasonCode: ReasonCode,
|
||||
Message: diagnostics.Aggregate("enemy event subject not near source", []string{
|
||||
fmt.Sprintf("subject %s was not found in cited source text", diagnostics.Quote(event.Name)),
|
||||
}),
|
||||
})
|
||||
}
|
||||
return contracts.ValidationResult{Approved: true, Warnings: diagnostics.LimitWarnings(warnings, "enemy_events", OmittedReasonCode)}, nil
|
||||
return diagnostics.DataQualityResult(warnings)
|
||||
}
|
||||
|
||||
func Spec() pipeline.ValidatorSpec {
|
||||
|
||||
Reference in New Issue
Block a user