(a) That's right. There is most probably a great risk in what A has done. If a party asserts a breach of contract (actual or anticipatory) and relies on it to put a stop to performance, they must be able to prove the breach relied on. Otherwise, stopping performance itself becomes an act of repudiation, leaving that party open to an action for breach of the contract.
The difficulty of establishing an anticipatory breach in the circumstances of the example is that B has not expressly repudiated the contract. Indeed, he says he is ready and able to perform. Whether or not A is correct to say that it is too late for proper performance is a question of fact, to be determined by evidence.
If B can satisfy the court that he would have been able to do the job in the time still available, then his conduct was not an anticipatory breach. A's decision to terminate performance would then not have been justified.