in the particular example you pasted here, context...
# development
b
in the particular example you pasted here, context.scan() is a tricky case. https://github.com/pantsbuild/pants/blob/master/src/python/pants/goal/context.py#L341-L356, we can see that scan() directly creates a MutableBuildGraph which is from v1 era. If build_graph is LBG, then inject_address_closure() will not make a call to specs_to_addresses, and we will not see the error.