Boeing and its machinists union have reached a tentative agreement that could end a strike that has halted most production in the past month.