What, if anything, do the texts say about habits versus mindulfness?
Some modern references:


Conscious, preconscious, unconscious, subconscious by Piya Tan
Viññāṇa (Consciousness) by Piya Tan
Unconscious Views by Piya Tan
The Unconscious by Piya Tan
Anusaya by Piya Tan


Suttas:


Cetanā Sutta 1-3


There many more Tipitaka references bibliography of the essays.