Expand module contracts for references and normalizer LLM access
This commit is contained in:
@@ -87,7 +87,7 @@ func validateModuleSpec(kind string, expectedStage ModuleStage, spec ModuleSpec)
|
||||
if spec.Stage != expectedStage {
|
||||
return fmt.Errorf("%s %q must use %q stage, got %q", kind, spec.Key, expectedStage, spec.Stage)
|
||||
}
|
||||
if spec.Stage != StageExtract && len(spec.ReferenceSlots) > 0 {
|
||||
if !referenceSlotStage(spec.Stage) && len(spec.ReferenceSlots) > 0 {
|
||||
return fmt.Errorf("%s %q must not declare reference slots", kind, spec.Key)
|
||||
}
|
||||
if err := validateReferenceSlots(spec.ReferenceSlots); err != nil {
|
||||
@@ -96,6 +96,10 @@ func validateModuleSpec(kind string, expectedStage ModuleStage, spec ModuleSpec)
|
||||
return nil
|
||||
}
|
||||
|
||||
func referenceSlotStage(stage ModuleStage) bool {
|
||||
return stage == StageChunk || stage == StageExtract || stage == StageNormalize
|
||||
}
|
||||
|
||||
func sortedRegistryKeys[C any](constructors map[string]C) []string {
|
||||
if len(constructors) == 0 {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user