Pakistan already has a permanent solution.A very lucid explanation. Allow me to give my two cents.
Without travelling too far, Afghanistan's treaties with the British can be more appropriately compared to -Anglo-Nepalese Treaty of Sugauli 1816 and Anglo-Burmese Treaty of Yandabo -1826. Both ceded sizable territories previously held by them to the British.
After Hindu India's independence, both Nepal and Burma signed treaties of friendship with India in 1950 and 1951 respectively and recognized India's as a successor of the British Empire thus ratifying their previous treaties.
Question is why didn't Afghanistan do this with Pakistan? In fact, Afghanistan was conducting raids especially during the 50s at a time when India had mobilized its troops on Both East and West Pakistan.
A merger in the late 50s proposed by Pakistan was also rejected. Even though few sane Afghans fearing USSR did voice their support later, it was desultory.
The problem seems to be contempt for Pakistan and its people. This to my mind has no legal, political or economic solution. Hence, Afghan govts will continue to dispute the durand line in any way they seem fit be it ethnic, legal, historical or political.
Pakistan has to come up with a permanent solution realizing these ground realities.
It's called The Pakistan Army.