SERVER-125839Backlog
Implement remaining PipelineRewriteContext Transforms + methods
Currently, the extensions optimizations API only supports examining N stages ahead and erasing the Nth stage but there are other introspection methods/transforms that could be exposed to support a broader range of optimizations functionality. Determine what those should be, implement them, and add the appropriate unit and integration tests.