Complete shared domain contract verification
This commit is contained in:
@@ -191,9 +191,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -157,9 +157,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -151,9 +151,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -106,9 +106,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -151,9 +151,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -106,9 +106,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -150,9 +150,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -116,9 +116,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -148,9 +148,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -166,9 +166,6 @@ 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)
|
||||
})
|
||||
}
|
||||
|
||||
@@ -88,7 +88,7 @@ func TestExtractReturnsCanonicalSpellListFromPrivateResponse(t *testing.T) {
|
||||
|
||||
func TestExtractPromptProjectsCanonicalNamesAndAliasesWithoutMetadata(t *testing.T) {
|
||||
client := &fakeSpellsLLMClient{response: extractionResponse{SpellCasts: []spellCastResponse{}}}
|
||||
extractor := newExtractor(t, client, overlaySpellCatalogReference())
|
||||
extractor := newExtractor(t, client, sharedGlossarySpellCatalogReference())
|
||||
if _, err := runExtraction(context.Background(), extractor, extractionRequest()); err != nil {
|
||||
t.Fatalf("Extract() error = %v, want nil", err)
|
||||
}
|
||||
@@ -127,7 +127,7 @@ func TestExtractUsesAliasRecognitionToRequestCanonicalSpellNames(t *testing.T) {
|
||||
request.Chunk.Content = []byte(`{"segments":[{"id":1,"text":"Aria invokes Emberfall Aegis."}]}`)
|
||||
request.SourceInput = spellChunkInput(request.Chunk)
|
||||
|
||||
result, err := runExtraction(context.Background(), newExtractor(t, client, overlaySpellCatalogReference()), request)
|
||||
result, err := runExtraction(context.Background(), newExtractor(t, client, sharedGlossarySpellCatalogReference()), request)
|
||||
if err != nil {
|
||||
t.Fatalf("Extract() error = %v, want nil", err)
|
||||
}
|
||||
@@ -162,7 +162,7 @@ func TestExtractAliasOnlyCatalogChangesPromptMaterial(t *testing.T) {
|
||||
|
||||
func TestNewRejectsMalformedCatalogBeforeLLMCall(t *testing.T) {
|
||||
client := &fakeSpellsLLMClient{}
|
||||
_, err := New(Options{}, spellCatalogReference(`{"schema_version":"notarius.dnd.spell-catalog-overlay.v2","catalogs":[]}`))
|
||||
_, err := New(Options{}, spellCatalogReference(`{"schema_version":"wrong","collections":{}}`))
|
||||
if err == nil || !strings.Contains(err.Error(), "resolve effective spell catalog") {
|
||||
t.Fatalf("New() error = %v, want effective catalog error", err)
|
||||
}
|
||||
|
||||
@@ -161,7 +161,7 @@ func spellCatalogReference(content string) contracts.ReferenceSet {
|
||||
}}
|
||||
}
|
||||
|
||||
func overlaySpellCatalogReference() contracts.ReferenceSet {
|
||||
func sharedGlossarySpellCatalogReference() contracts.ReferenceSet {
|
||||
return spellCatalogReference(`{"schema_version":"maximumdirect.glossary.v1","collections":{"spells":{"entries":[{"id":"aegis","name":"Aegis of Emberfall","category":"spell","aliases":["Emberfall Aegis"]}]}}}`)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user