Interesting, although the features might leak into other codebases and services too, at which point compiler directives won't be enough.
I believe this is a lot more tractable with Unision's[0] content addressable hashing. It's kinda made for that although more with an eye towards updates to distributed systems.