The Zhenguan Era and the Tang Legal-Administrative System
Also called: Reign of Zhenguan, Zhenguan zhi zhi
Emperor Taizong of Tang set up the Three Departments and Six Ministries, the codes of law, statute, regulation and ordinance, and the equal-field, zu-yong-diao and militia systems, and governed with an open ear to remonstrance — a period of stability known as the Reign of Zhenguan.

Unknown author · Public domain · Source
Under Taizong’s reign title Zhenguan (627–649) the Tang system of government was completed. At the centre were the Three Departments — the Secretariat, which drafted imperial orders, the Chancellery, which reviewed them, and the Department of State Affairs, which carried them out — with the Six Ministries of Personnel, Revenue, Rites, War, Justice and Works under the last, plus a Censorate. The law consisted of lü (penal code), ling (administrative statutes), ge (amendments) and shi (regulations).
Under the equal-field system adult men received land and paid zu (grain), yong (labour or silk in lieu) and diao (local cloth), and under the fubing system farmers took turns at military service. Taizong heeded blunt advisers such as Wei Zheng, and his dialogues with his ministers, later compiled as the Essentials of Government of the Zhenguan Era, became a textbook of statecraft. After he destroyed the Eastern Turks in 630 the northern peoples hailed him as “Heavenly Khagan”, and conquered regions were ruled loosely through protectorates and their own chiefs (the jimi policy).
Silla, Goguryeo, Baekje, Gaochang and Tibet sent young men to study at the Directorate of Education. This codified system was adopted by Silla, Balhae and Japan and became the framework of the East Asian cultural sphere. Taizong’s own campaign against Goguryeo in 645, however, was halted at Ansi fortress.