We added a [POC] marker to this post, because the code is not really ready for public consumption (it is rough around the edges and may not work in all circumstances). Our hope is to publicize the approach and perhaps motivate interested hackers to take the code and develop it further into a proper tool.
Very happy to see work like this, even if it’s in earlier stages!
Have hacked together a much more primitive solution to a similar problem with ast-grep by autogenerating rules from tree-sitter tree of OCaml snippets (tree-sitter query could be used for similar purposes), but it doesn’t allow as much flexibility as this would afford.
Very nice. I would love to integrate some of this in semgrep so that we can leverage the semantic information (e.g., good names, types) in cmt from semgrep rules.