In a recent campeign game (set to crippling difficulty), I built one of my early scouts with a laser, based around the cargo hull, with extra engines and sensors.
This wasnt intended to be a fighting ship, but to cause problems to enemy scouts and colony ships.
Strangely, it didnt raise my military score above 0 from the point of view of the quarterly reports.
It was incredibly sucessfull, however, and killed multiple starbases, constructors and scouts. The drengin player kept making scouts to orbit its planets, and constructors to build undefended starbases.
After killing off dozens of his ships, I built a second one of these armed scouts; several turns later, there were defenders orbiting the drengin worlds. It is possible I had starbases with weapons by that stage, which might alternativly have given me a military rating; I dont remember checking for it.
It waqs somewhat worrying the amount of time that the drengin allowed my to blow up his ships, however - and he had had tech to build ships with weapons since the start of the game. It felt like a very un-realistic behaviour, as all he needed to do to stop me is build any sort of ship with a weapon, instead of making more and more ships for me to blow up.