Share the source index with validators

This commit is contained in:
2026-11-26 05:12:19 +00:00
parent 60e732bbe8
commit d66cfe3986
43 changed files with 191 additions and 68 deletions

View File

@@ -54,7 +54,7 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
if enemyeventshape.Validate(req.Value) != nil {
return contracts.ValidationResult{Approved: true}, nil
}
index := source.NewDocumentIndex(req.Source)
index := shared.DocumentIndexForSource(req.Source, req.SourceIndex)
if !allSourceRefsValid(index, req.Value) {
return contracts.ValidationResult{Approved: true}, nil
}

View File

@@ -37,7 +37,7 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
if err := enemyeventshape.Validate(req.Value); err != nil {
return contracts.ValidationResult{Approved: true}, nil
}
index := source.NewDocumentIndex(req.Source)
index := shared.DocumentIndexForSource(req.Source, req.SourceIndex)
var coverage shared.ChunkCoverage
if req.Stage == string(pipeline.StageExtract) {
coverage = shared.NewChunkCoverage(req.Chunk)

View File

@@ -33,7 +33,7 @@ func (v *Validator) Validate(_ context.Context, req contracts.TypedValidationReq
if enemyeventshape.Validate(req.Value) != nil {
return contracts.ValidationResult{Approved: true}, nil
}
resolver, err := shared.NewCitationResolver(req.Source)
resolver, err := shared.NewCitationResolverForSource(req.Source, req.SourceIndex)
if err != nil {
return contracts.ValidationResult{Approved: true}, nil
}