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

@@ -9,7 +9,6 @@ import (
"go.maximumdirect.net/promptkit"
"gitea.maximumdirect.net/eric/notarius/internal/core/source"
nativecapture "gitea.maximumdirect.net/eric/notarius/internal/framework/capture"
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
@@ -107,7 +106,7 @@ func validateRequest(ctx context.Context, req contracts.TypedValidationRequest[d
if req.Chunk.SourceID != req.Source.ID {
return contracts.LLMInputMaterial{}, dnd.SceneDescription{}, validatorErrorf("current chunk source ID %q does not match source %q", req.Chunk.SourceID, req.Source.ID)
}
if err := source.NewDocumentIndex(req.Source).ValidateRef(req.Chunk.Ref); err != nil {
if err := shared.DocumentIndexForSource(req.Source, req.SourceIndex).ValidateRef(req.Chunk.Ref); err != nil {
return contracts.LLMInputMaterial{}, dnd.SceneDescription{}, validatorErrorf("validate current chunk source range: %w", err)
}
if err := sceneShapeError(req.Value); err != nil {