We should have a module that filters a set of segments with a given path policy. (dependency for #2818)