SERVER-139258Needs Scheduling
Infer prefix types according to dotted-path transformation semantics
Inclusion projections, exclusion projections and computed assignments have different effects on scalar, missing, object and array prefixes. Prefix type inference needs to distinguish these operations rather than retain only whether a prefix can be an array. The current expectations lose known scalar types, retain missing alternatives for fields that are guaranteed to exist, and retain array alternatives after a later match rules out prefix arrays. Inclusion [\{$set: {p: 1}}, \{$project: