What is the complete, authoritative way in which Mac OSX 10.9 and later builds its PATH? I have read just about every article on this subject.  To wit, I know about:


launchctl setenv
/etc/launchd.conf
/etc/paths
/etc/paths.d/*
/etc/profile
/etc/bashrc
~/.profile
~/.bashrc
~/.MacOSX/environment.plist
~/Library/Preferences/.MacOSX/environment.plist


Let's start whittling all this craziness down:


From other reading, I know that on Mavericks anything that relies on an environment.plist is no longer supported or read.
I know that /etc/profile erases any PATH previously set by launchctl setenv or present in /etc/launchd.conf, and uses a default set of paths appended with anything found in /etc/paths.d/* and /etc/paths.
I also know that applications launched via Spotlight or the Dock obviously don't read your ~/.profile or ~/.bashrc.


That leaves launchctl setenv and /etc/launchd.conf (same thing, really).

At any rate, in my case I find that in a Terminal window—I should stress I have none of the following files: ~/.profile, ~/.bashrc, ./bash_profile—I find that the output of env | grep PATH has /opt/subversion/bin appended to the end of it.  This string does not show up in any of the sources listed above, so it must be coming from somewhere else.  I was not aware of there being anywhere else for it to come from.

So then: how does Mac OS X Mavericks build its PATH variable?
You're trying to understand the theory and that's great.  I'll just say that from practical experience, you can modify .bashrc, .profile and/or .bash_profile and the path setting will stick.  I prefer ~/.profile simply out of habit.  My teammates all use .bash_profile.  Either way it works as long as you pay attention to the order of processing precedence.

Here are a few other thoughts on the matter:


Homebrew wants me to amend my PATH (stackoverflow)
How to correctly add a path to PATH (stackexchange)


Hope that helps.