search: scaffolding for combinatorial query generator
Created by: rvantonder
Hokay started hacking on this because I'm trying to rush to the end MVP state.
This adds a generator that only takes a flat set of individual rules and tries combinations of n choose k
on the rule set, for decreasing values of k
. See the test and docstring for how this works.
This is unused, but it will replace the current Generator
code which only tries to apply the list of rules, not combinations of individual ones. When the code uses the new generator, it should turn out that we can just add individual rules and leave the iteration to try combinations that apply on the query. This'll make it much easier for me to add rules that, e.g., interpret https://github.com/repo/repo
as a repo filter without having to meddle with composition of rules. This isn't the only strategy we have to use, it's just one that will work well for me right now.
This still needs some other tweaking to incorporate the unordered patterns rule. More on that to come later.
Test plan
Unused, adds test.