For a few decades around the turn of the third century, the Way of the Celestial Masters governed the Hanzhong valley outright under Zhang Lu, grandson of Zhang Daoling: parishes, libationers, free lodging houses on the roads, and penalties administered through confession and public works.
It submitted to Cao Cao in 215 CE, and the movement scattered across China — which is how a regional religious polity became the institutional spine of Chinese Taoism.