SAN FRANCISCO — Having an affair with the boss is generally a bad idea.

And for Becky Christian, a key witness in the government’s computer hacking and trade secrets case against David Nosal, the price was particularly steep ­— FBI agents at her door, criminal charges and a plea deal that required her to cooperate against her former boss and lover.