Complete shared domain contract verification

This commit is contained in:
2026-11-29 18:28:59 +00:00
parent 9dc976afaf
commit 41a5c43561
33 changed files with 126 additions and 97 deletions

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
})
}

View File

@@ -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)
}

View File

@@ -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"]}]}}}`)
}