Secretary of State John Kerry said Wednesday he had nailed down terms governing the presence of US troops in Afghanistan beyond 2014, just hours before Afghan leaders debate the deal.