Positive biomechanical outcomes have been reported with lower-limb exoskeletons in laboratory settings, but these devices have difficulty delivering appropriate assistance in synchrony with human gait as the task or rate of phase progression change in real-world environments. This paper presents a torque controller for an ankle exoskeleton that uses state estimation with a data-driven kinematic model to continuously estimate the phase, phase rate, stride length, and ramp parameters during locomotion. The controller applies torque assistance based on the estimated phase and adapts the torque profile based on the estimated task variables to match human torques observed in a multi-activity database of 10 able-bodied subjects. We demonstrate in silico that the controller yields phase estimates that are more accurate than state of the art, while also estimating task variables with comparable accuracy to recent machine learning approaches. The controller implemented in an ankle exoskeleton successfully adapts its assistance in response to changing phase and task variables, both during controlled treadmill trials (6 able-bodied subjects) and a real-world stress test with extremely uneven terrain.