Preserve selected collections in materialized references
This commit is contained in:
@@ -248,6 +248,8 @@ from later wiring must be identified, not hidden with compatibility scaffolding.
|
||||
|
||||
## Stage 5 — Preserve Selections Through CLI And Materialization
|
||||
|
||||
**Status:** Complete.
|
||||
|
||||
**Goal:** Deliver selected input views consistently to consumers.
|
||||
|
||||
**Inspect:** `internal/cli/reference_selectors.go`, framework reference resolution
|
||||
|
||||
@@ -86,6 +86,51 @@ func TestReferenceSelectorSpecificityAndFinalOccurrenceChooseConcreteBindings(t
|
||||
}
|
||||
}
|
||||
|
||||
func TestCLIReferenceOverridesRetainEachTargetSelection(t *testing.T) {
|
||||
cfg := referenceContractConfig()
|
||||
profile := cfg.Pipelines["demo"]
|
||||
profile.References = map[string]pipeline.ReferenceSource{"shared": {Path: "base.yml", Collections: []string{"campaign"}}}
|
||||
alpha := profile.Artifacts["alpha"]
|
||||
alpha.Extract.References["shared"] = pipeline.ReferenceSource{Path: "local.yml", Collections: []string{}}
|
||||
profile.Artifacts["alpha"] = alpha
|
||||
cfg.Pipelines["demo"] = profile
|
||||
catalog := referenceContractCatalog(t, true, true)
|
||||
requests := []cliReferenceRequest{
|
||||
{Selector: mustParseReferenceSelector(t, "shared", "--reference"), Source: "broad.yml"},
|
||||
{Selector: mustParseReferenceSelector(t, "alpha.extract.shared", "--reference"), Source: "narrow.yml"},
|
||||
}
|
||||
overrides, unbinds, err := resolveCLIReferenceRequests(cfg, "demo", nil, catalog, requests, nil)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
effective, err := cfg.Resolve(config.ResolveInput{PipelineID: "demo", Catalog: catalog, ReferenceOverrides: overrides, ReferenceUnbinds: unbinds})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
count := 0
|
||||
for _, id := range []string{"alpha", "beta"} {
|
||||
lane := referenceContractLane(t, effective.ResolvedPipeline, id)
|
||||
for _, target := range []pipeline.ResolvedReferenceTarget{lane.ExtractReferences, lane.MergeReferences, lane.NormalizeReferences} {
|
||||
for _, binding := range target.Bindings {
|
||||
if binding.SlotName != "shared" {
|
||||
continue
|
||||
}
|
||||
count++
|
||||
if id == "alpha" && target.Stage == pipeline.StageExtract {
|
||||
if binding.Source != "narrow.yml" || binding.Collections == nil || len(binding.Collections) != 0 {
|
||||
t.Fatalf("narrow binding = %#v", binding)
|
||||
}
|
||||
} else if binding.Source != "broad.yml" || !slices.Equal(binding.Collections, []string{"campaign"}) {
|
||||
t.Fatalf("broad binding = %#v", binding)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if count != 6 {
|
||||
t.Fatalf("resolved %d shared bindings, want 6", count)
|
||||
}
|
||||
}
|
||||
|
||||
func TestRequiredReferencesCanBeSuppliedOnlyByCLI(t *testing.T) {
|
||||
cfg := referenceContractConfig()
|
||||
profile := cfg.Pipelines["demo"]
|
||||
|
||||
@@ -109,6 +109,7 @@ type ReferenceProducer struct {
|
||||
|
||||
type ReferenceItem struct {
|
||||
SlotName string `json:"slot_name"`
|
||||
Collections []string `json:"collections,omitempty"`
|
||||
MediaType string `json:"media_type,omitempty"`
|
||||
Content []byte `json:"-"`
|
||||
Digest string `json:"digest,omitempty"`
|
||||
@@ -122,6 +123,9 @@ type ReferenceItem struct {
|
||||
|
||||
func CloneReferenceItem(item ReferenceItem) ReferenceItem {
|
||||
item.Content = append([]byte(nil), item.Content...)
|
||||
if item.Collections != nil {
|
||||
item.Collections = append([]string{}, item.Collections...)
|
||||
}
|
||||
item.ArtifactSchema = CloneArtifactSchema(item.ArtifactSchema)
|
||||
return item
|
||||
}
|
||||
@@ -129,6 +133,7 @@ func CloneReferenceItem(item ReferenceItem) ReferenceItem {
|
||||
func (item ReferenceItem) MarshalJSON() ([]byte, error) {
|
||||
type referenceItemJSON struct {
|
||||
SlotName string `json:"slot_name"`
|
||||
Collections *[]string `json:"collections,omitempty"`
|
||||
MediaType string `json:"media_type,omitempty"`
|
||||
Digest string `json:"digest,omitempty"`
|
||||
Origin ReferenceOrigin `json:"origin"`
|
||||
@@ -147,6 +152,9 @@ func (item ReferenceItem) MarshalJSON() ([]byte, error) {
|
||||
BindingSource: item.BindingSource,
|
||||
ArtifactKind: item.ArtifactKind,
|
||||
}
|
||||
if item.Collections != nil {
|
||||
encoded.Collections = &item.Collections
|
||||
}
|
||||
if item.ArtifactSchema.ID != "" || item.ArtifactSchema.Name != "" || item.ArtifactSchema.Version != "" || len(item.ArtifactSchema.JSONSchema) > 0 {
|
||||
schema := CloneArtifactSchema(item.ArtifactSchema)
|
||||
encoded.ArtifactSchema = &schema
|
||||
|
||||
@@ -123,6 +123,34 @@ func TestReferenceItemJSONOmitsContent(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestReferenceItemCollectionSelectionCopyAndJSON(t *testing.T) {
|
||||
for _, selection := range [][]string{nil, {}, {"campaign"}} {
|
||||
item := ReferenceItem{SlotName: "glossary", Collections: selection}
|
||||
clone := CloneReferenceItem(item)
|
||||
if (clone.Collections == nil) != (selection == nil) || len(clone.Collections) != len(selection) {
|
||||
t.Fatalf("cloned selection = %#v, want %#v", clone.Collections, selection)
|
||||
}
|
||||
encoded, err := json.Marshal(item)
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
var fields map[string]any
|
||||
if err := json.Unmarshal(encoded, &fields); err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
_, present := fields["collections"]
|
||||
if present != (selection != nil) {
|
||||
t.Fatalf("encoded selection = %s", encoded)
|
||||
}
|
||||
if len(selection) > 0 {
|
||||
clone.Collections[0] = "changed"
|
||||
if selection[0] != "campaign" {
|
||||
t.Fatal("copy mutated original selection")
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestLLMInputMaterialCopiesContentAndOmitsContentFromJSON(t *testing.T) {
|
||||
content := []byte("raw source bytes")
|
||||
material := NewLLMInputMaterial("transcript", "application/json", content, "sha256:source", "file:///tmp/source.json")
|
||||
|
||||
@@ -152,7 +152,11 @@ func resolveReferenceTargetBindings(target referenceResolutionTarget) ([]Referen
|
||||
if strings.TrimSpace(source) == "" {
|
||||
source = contracts.ReferenceBindingSourceCLI
|
||||
}
|
||||
if err := addReferenceBinding(target, slotByName, bindings, override.SlotName, ExternalReference(override.Source), strings.TrimSpace(source)); err != nil {
|
||||
replacement := ExternalReference(override.Source)
|
||||
if previous, exists := bindings[strings.TrimSpace(override.SlotName)]; exists && previous.Artifact == nil && previous.Collections != nil {
|
||||
replacement.Collections = append([]string{}, previous.Collections...)
|
||||
}
|
||||
if err := addReferenceBinding(target, slotByName, bindings, override.SlotName, replacement, strings.TrimSpace(source)); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
}
|
||||
|
||||
@@ -85,6 +85,24 @@ func TestReferenceCollectionResolutionAndCopy(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestReferenceOverrideKeepsTargetCollectionSelection(t *testing.T) {
|
||||
for _, selection := range [][]string{nil, {}, {"campaign"}} {
|
||||
target := referenceResolutionTarget{
|
||||
PipelineID: "demo", LaneID: "lane", Stage: StageExtract, Module: "extractor",
|
||||
Slots: []contracts.ReferenceSlot{{Name: "glossary"}},
|
||||
LocalReferences: map[string]ReferenceSource{"glossary": {Path: "old.yml", Collections: selection}},
|
||||
Options: ResolveOptions{ReferenceOverrides: []ReferenceBinding{{Stage: StageExtract, LaneID: "lane", SlotName: "glossary", Source: "new.yml"}}},
|
||||
}
|
||||
bindings, err := resolveReferenceTargetBindings(target)
|
||||
if err != nil || len(bindings) != 1 || bindings[0].Source != "new.yml" || (bindings[0].Collections == nil) != (selection == nil) || len(bindings[0].Collections) != len(selection) {
|
||||
t.Fatalf("override with %#v = %#v, %v", selection, bindings, err)
|
||||
}
|
||||
if len(selection) > 0 && bindings[0].Collections[0] != selection[0] {
|
||||
t.Fatalf("selection changed: %#v", bindings)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestNormalizeTargetReferenceSourceOwnsAndValidatesSelector(t *testing.T) {
|
||||
target := referenceResolutionTarget{PipelineID: "demo", StepID: "consumer", LaneID: "lane", Stage: StageExtract, Module: "extractor"}
|
||||
input := ReferenceSource{Artifact: &ArtifactReference{Step: " producer ", Lane: " output "}}
|
||||
|
||||
@@ -170,6 +170,9 @@ func materializeReferenceTarget(
|
||||
SizeBytes: int64(len(content)),
|
||||
BindingSource: strings.TrimSpace(binding.BindingSource),
|
||||
}
|
||||
if binding.Collections != nil {
|
||||
item.Collections = append([]string{}, binding.Collections...)
|
||||
}
|
||||
set.Slots[slotName] = contracts.ResolvedReferenceSlot{
|
||||
Slot: cloneReferenceSlot(slot),
|
||||
Items: []contracts.ReferenceItem{item},
|
||||
@@ -369,6 +372,9 @@ func CloneReferenceTarget(in ResolvedReferenceTarget) ResolvedReferenceTarget {
|
||||
out.Bindings = make([]ReferenceBinding, len(in.Bindings))
|
||||
for i, binding := range in.Bindings {
|
||||
out.Bindings[i] = binding
|
||||
if binding.Collections != nil {
|
||||
out.Bindings[i].Collections = append([]string{}, binding.Collections...)
|
||||
}
|
||||
if binding.Artifact != nil {
|
||||
artifact := *binding.Artifact
|
||||
out.Bindings[i].Artifact = &artifact
|
||||
|
||||
@@ -344,6 +344,30 @@ func TestMaterializeReferencesAcceptsDeclaredJSONMediaType(t *testing.T) {
|
||||
}
|
||||
}
|
||||
|
||||
func TestMaterializeReferencesCarriesCollectionsWithoutChangingContent(t *testing.T) {
|
||||
dir := t.TempDir()
|
||||
content := []byte("collections: {campaign: {entries: []}}\n")
|
||||
writeReferenceFile(t, filepath.Join(dir, "terms.yml"), content)
|
||||
slot := contracts.ReferenceSlot{Name: "glossary", AcceptedMediaTypes: []string{"application/yaml"}}
|
||||
resolved := resolvedPipelineWithReference(t, "glossary", "terms.yml", contracts.ReferenceBindingSourceConfig, slot)
|
||||
resolved.Steps[0].ArtifactLanes[0].ExtractReferences.Bindings[0].Collections = []string{"campaign"}
|
||||
materialized, _, err := MaterializeReferences(resolved, referenceCatalog(t, []contracts.ReferenceSlot{slot}), ReferenceMaterializationOptions{ConfigPath: filepath.Join(dir, "config.yml")})
|
||||
if err != nil {
|
||||
t.Fatal(err)
|
||||
}
|
||||
target := materialized.Steps[0].ArtifactLanes[0].ExtractReferences
|
||||
item := target.ReferenceSet.Slots["glossary"].Items[0]
|
||||
if string(item.Content) != string(content) || item.Digest != referenceDigest(content) || len(item.Collections) != 1 || item.Collections[0] != "campaign" {
|
||||
t.Fatalf("materialized item = %#v", item)
|
||||
}
|
||||
clone := CloneReferenceTarget(target)
|
||||
clone.Bindings[0].Collections[0] = "changed"
|
||||
clone.ReferenceSet.Slots["glossary"].Items[0].Collections[0] = "changed"
|
||||
if target.Bindings[0].Collections[0] != "campaign" || item.Collections[0] != "campaign" {
|
||||
t.Fatal("cloned selections alias original")
|
||||
}
|
||||
}
|
||||
|
||||
func TestMaterializeReferencesAcceptsDeclaredYAMLMediaType(t *testing.T) {
|
||||
configDir := t.TempDir()
|
||||
path := filepath.Join(configDir, "roster.yaml")
|
||||
|
||||
@@ -118,6 +118,9 @@ func Register(registry *pipeline.ChunkerRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -186,6 +186,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -152,6 +152,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -146,6 +146,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -98,6 +98,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -146,6 +146,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -98,6 +98,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -145,6 +145,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -108,6 +108,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -140,6 +140,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -161,6 +161,9 @@ func Register(registry *pipeline.ExtractorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -298,6 +298,9 @@ func Register(registry *pipeline.NormalizerRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -262,6 +262,9 @@ func Register(registry *pipeline.NormalizerRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -269,6 +269,9 @@ func Register(registry *pipeline.NormalizerRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -320,6 +320,9 @@ func Register(registry *pipeline.NormalizerRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -239,6 +239,9 @@ func Register(registry *pipeline.NormalizerRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -256,6 +256,9 @@ func Register(registry *pipeline.NormalizerRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -1,6 +1,31 @@
|
||||
package shared
|
||||
|
||||
import "gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
import (
|
||||
"fmt"
|
||||
"sort"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
)
|
||||
|
||||
// ValidateReferenceSelections rejects collection metadata on non-glossary inputs.
|
||||
func ValidateReferenceSelections(references contracts.ReferenceSet) error {
|
||||
names := make([]string, 0, len(references.Slots))
|
||||
for name := range references.Slots {
|
||||
names = append(names, name)
|
||||
}
|
||||
sort.Strings(names)
|
||||
for _, name := range names {
|
||||
if name == "glossary" || name == "spell_catalog" {
|
||||
continue
|
||||
}
|
||||
for _, item := range references.Slots[name].Items {
|
||||
if item.Collections != nil {
|
||||
return fmt.Errorf("reference slot %q does not support collection selection", name)
|
||||
}
|
||||
}
|
||||
}
|
||||
return nil
|
||||
}
|
||||
|
||||
type ReferenceSlotDescriptions struct {
|
||||
Glossary string
|
||||
|
||||
@@ -2,11 +2,27 @@ package shared
|
||||
|
||||
import (
|
||||
"reflect"
|
||||
"strings"
|
||||
"testing"
|
||||
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
)
|
||||
|
||||
func TestValidateReferenceSelections(t *testing.T) {
|
||||
for _, slot := range []string{"party", "roster", "players", "npc_registry"} {
|
||||
references := contracts.ReferenceSet{Slots: map[string]contracts.ResolvedReferenceSlot{slot: {Items: []contracts.ReferenceItem{{Collections: []string{}}}}}}
|
||||
if err := ValidateReferenceSelections(references); err == nil || !strings.Contains(err.Error(), slot) {
|
||||
t.Fatalf("slot %s: error = %v", slot, err)
|
||||
}
|
||||
}
|
||||
for _, slot := range []string{"glossary", "spell_catalog"} {
|
||||
references := contracts.ReferenceSet{Slots: map[string]contracts.ResolvedReferenceSlot{slot: {Items: []contracts.ReferenceItem{{Collections: []string{"chosen"}}}}}}
|
||||
if err := ValidateReferenceSelections(references); err != nil {
|
||||
t.Fatalf("slot %s: %v", slot, err)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
func TestReferenceMediaTypesReturnsDefensiveCopy(t *testing.T) {
|
||||
want := []string{
|
||||
"application/json",
|
||||
|
||||
@@ -151,6 +151,9 @@ func Register(registry *pipeline.ValidatorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||
itemregistry "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/items/registry"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared/diagnostics"
|
||||
occurrenceshape "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/validate/itemoccurrences/shape"
|
||||
)
|
||||
@@ -92,6 +93,9 @@ func Register(registry *pipeline.ValidatorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||
locationregistry "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/locations/registry"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared/diagnostics"
|
||||
occurrenceshape "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/validate/locationoccurrences/shape"
|
||||
)
|
||||
@@ -93,6 +94,9 @@ func Register(registry *pipeline.ValidatorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -137,6 +137,9 @@ func Register(registry *pipeline.ValidatorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||
npcregistry "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/npcs/registry"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared/diagnostics"
|
||||
occurrenceshape "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/validate/npcoccurrences/shape"
|
||||
)
|
||||
@@ -102,6 +103,9 @@ func Register(registry *pipeline.ValidatorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -9,6 +9,7 @@ import (
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/contracts"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/framework/pipeline"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared"
|
||||
"gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/shared/diagnostics"
|
||||
spellcatalog "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/spells/catalog"
|
||||
spellshape "gitea.maximumdirect.net/eric/notarius/internal/modules/dnd/validate/spells/shape"
|
||||
@@ -105,6 +106,9 @@ func Register(registry *pipeline.ValidatorRegistry) error {
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
if err := shared.ValidateReferenceSelections(request.References); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
return New(options, request.References)
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user