Tighten NPC interaction validation and consistency

This commit is contained in:
2026-07-23 14:25:32 +00:00
parent 36e0512454
commit bfe25609a7
14 changed files with 426 additions and 278 deletions

View File

@@ -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 {