/.../ (And such an API should be that the doc extractor can ask the loader for the source when needed, not the other way around.)
can you elaborate on that please?
The API would allow custom class loaders to hook in callbacks that the doc extractor can call when it needs to get the source for a program or function. The doc extractor would first try Program.defined/ Function.defined, then see if the master can find the location, and then go through all the registered callbacks.
That way it's possible for a custom class loader to hook itself in and provide the sources for its programs on behalf of the doc extractor.