source aren’t macros, they’re bulitin functions - there are both parse-time and runtime implementations. They’re not confidential or anything, dbt is open source! But I don’t think they’ll be useful for your needs unless you plan on forking dbt, you can’t really override them. They’re hooked pretty deeply into dbt internals.
Both parse and run-time implement instances of this base class - parser.ref, parser.source, runtime.ref, and runtime.source. They’re instantiated with information about the model for each node being parsed or run, and then their
__call__ is what does the work for that particular phase of dbt.