Skip to content

Consider consolidating sources into populated_from as a list #157

@amc-corey-cox

Description

@amc-corey-cox

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions