Happiness is based on the BGS political states - the exact details are uncertain, but Boom, Civil Liberty, Public Holiday (tricky, short-term), Investment and maybe Expansion seem to be the ones to go for.
It looks like it only counts the controlling faction of the system, and only counts whatever its state is on Thursday morning.
There may be more subtleties to it, it's hard to tell.