Tighten NPC interaction validation and consistency
This commit is contained in:
@@ -16,7 +16,8 @@ import (
|
||||
const (
|
||||
Key = "extract/dnd/npc-interactions/source_relatedness"
|
||||
WarningReasonCode = "npc_interaction_not_near_source"
|
||||
policy = "dnd.npc_interactions.validator.source_relatedness.v1"
|
||||
OmittedReasonCode = "npc_interaction_relatedness_warnings_omitted"
|
||||
policy = "dnd.npc_interactions.validator.source_relatedness.v2"
|
||||
)
|
||||
|
||||
type Options struct{}
|
||||
@@ -57,7 +58,10 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
|
||||
Message: fmt.Sprintf("NPC interaction name %s was not found in cited source text", diagnostics.Quote(interaction.Name)),
|
||||
})
|
||||
}
|
||||
return contracts.ValidationResult{Approved: true, Warnings: warnings}, nil
|
||||
return contracts.ValidationResult{
|
||||
Approved: true,
|
||||
Warnings: diagnostics.LimitWarnings(warnings, "npc_interactions", OmittedReasonCode),
|
||||
}, nil
|
||||
}
|
||||
|
||||
func Spec() pipeline.ValidatorSpec {
|
||||
|
||||
Reference in New Issue
Block a user