Solution (source code)

= Solution

Multiplication by each column of $B$ gives
$$
AB=B\operatorname{diag}(-1,2,1).
$$
Since $B$ is invertible, its columns are an <eigenbasis> and the <similarity transformation> gives
$$
\boxed{D=B^{-1}AB=\operatorname{diag}(-1,2,1),\qquad(d_1,d_2,d_3)=(-1,2,1).}
$$
There is an important source variant: the alternative scanned copy supplies an erroneous inverse with an extra factor $1/6$ and a different top-right entry. Calling that supplied matrix $C$, direct multiplication gives $(CB)_{22}=1/6$, so it cannot be $B^{-1}$. Inverting $B$ instead gives
$$
B^{-1}=\begin{pmatrix}-1&-2&2\\-2&2&2\\3&0&-3\end{pmatrix}.
$$
This is the inverse in the cleaner copy used here. Using the scanned erroneous matrix would make $CAB$ nondiagonal, so correcting the inverse is necessary before applying the stated diagonalization. The <inverse-matrix verification test> catches the error without assuming the claimed outcome.