2 angle braces on attic of a gable roof
It’s difficult to see, but I suspect your gable end wall is not ballooned framed, but rather has a double top plate. This creates a “hinge” in the wall.
The diagonal braces keep the end wall from bending like a hinge during a wind storm or seismic activity. (I know, you’re going to tell me the ceiling will keep everything square and plumb. However, ceilings can’t give you a load resistance value to maintain the wall.)