Automatically chosen published ports should be stable
Tor 0.2.2.x adds the ability to configure ports with "FooPort auto", and get Tor to choose a port on its own. However, these ports will almost certainly not be the same across invocations of Tor, which makes them unsuitable for ORPort and DirPort usage.
Tor should record the values chosen for published (that is, ORPort and DirPort) "auto" ports, and try to reuse them in later invocations. Of course, if those ports aren't available, it'll need to choose a new port anyway.