Summary
SlotDerivation currently has two separate mechanisms for specifying where a value comes from:
populated_from: a single source slot name (string)
sources: a list of candidate source slot names (first available wins, error if multiple present)
These serve overlapping purposes. populated_from could accept either a string or a list, subsuming sources entirely:
# single source (current behavior, unchanged)
populated_from: height_cm
# multiple candidates (replaces sources)
populated_from:
- height_cm
- height_inches
- ht
Motivation
- Fewer concepts for spec authors to learn
- All existing
populated_from machinery (FK resolution, value mappings, offset) applies naturally to the resolved source
sources currently has zero test coverage and zero usage in example specs
Design considerations
- Backward compatible: single string works as today
- List means "first available" with error on ambiguous multiple matches (same as current
sources semantics)
- Schema change needed in
transformer_model.yaml to allow populated_from to be either string or list
- May need normalization step to resolve the list to a single value before the slot derivation loop
Related
Summary
SlotDerivationcurrently has two separate mechanisms for specifying where a value comes from:populated_from: a single source slot name (string)sources: a list of candidate source slot names (first available wins, error if multiple present)These serve overlapping purposes.
populated_fromcould accept either a string or a list, subsumingsourcesentirely:Motivation
populated_frommachinery (FK resolution, value mappings, offset) applies naturally to the resolved sourcesourcescurrently has zero test coverage and zero usage in example specsDesign considerations
sourcessemantics)transformer_model.yamlto allowpopulated_fromto be either string or listRelated
map_objectrefactor (issue Incremental refactoring of complex functions via extract-on-touch markers #104)sourcesimplementation inobject_transformer.py(_resolve_sources)