Title: A theory of on-the-job learning