  Much of modern metrology and communication technology encodes information in
electromagnetic waves, typically as an amplitude or phase. While current
hardware can perform near-ideal measurements of photon number or field
amplitude, to date no device exists that can even in principle perform an ideal
phase measurement. In this work, we implement a single-shot canonical phase
measurement on a one-photon wave packet, which surpasses the current standard
of heterodyne detection and is optimal for single-shot phase estimation. By
applying quantum feedback to a Josephson parametric amplifier, our system
adaptively changes its measurement basis during photon arrival and allows us to
validate the detector's performance by tracking the quantum state of the photon
source. These results provide an important capability for optical quantum
computing, and demonstrate that quantum feedback can both enhance the precision
of a detector and enable it to measure new classes of physical observables.
