shared between old transit.py and new _dilation/connector.py
(this compresses several months of false starts and rearchitecting)