pub fn comprehension_from_subspaces(
subspaces: Vec<Vec<Clause>>,
) -> ComprehensionExpand description
Build a Comprehension from a list of pre-parsed
sub-spaces. Each subspaces[i] is one Cartesian clause
list (the output of parse_clause_list for one of the
YAML’s array-form entries, or one entry for the YAML’s
map / string forms).
Detection rule: if any variable name appears more than
once across the flat list of all sub-spaces’ clauses,
emit ComprehensionMode::Union (preserving sub-space
boundaries). Otherwise — every var name distinct — flatten
into a single ComprehensionMode::Cartesian list.
This collapses the YAML’s string form (which produces one sub-space per top-level clause) into the natural Cartesian shape when names are distinct, while still detecting repeats as a Union signal. Same rule the pre-refactor workload parser applied — see the host’s scenario-node parser.