NSA violated phone rules, misinformed secret court, documents show