The OP was a moral question. Judicial precedence has no relevance because no authority is reliable except reason.
it's that self-defense only implies the right to kill the person attacking you, not the right to attack anyone at all. So while there might be potential arguments to justify attacks killing noncombatants, I find it hard to buy that self-defense is one of them.
Collateral damage is not "anyone at all" it's people in the way or people who are part of production chain used by your enemies.
That implies there is a responsibility to not be a cog in the machine of an aggressive organization, and that seems to follow. If it's immoral to throw the first punch, it's also immoral to be part of a team that plans to throw the first punch.
Now it doesn't feel fair that babies in Nagasaki burned, obviously they are innocent; but that is choosing to look at it as punishment.
Suppose that knowing your enemy values the lives of babies, you take babies hostage and then demand something crazy such as half of your enemies committing suicide (morally the smallest demand is equivalent to the largest demand except in the calculation of proportionality of punishment).
1.) Your enemies refuse and you kill the babies, perhaps they're your own babies. Did the enemy kill the babies?
2.) Now suppose you put a baby in the back seat of every bomber, fighter, and warship? Who killed the babies in that case?
3.) Now you leave them at home, but that home is a base from which you are waging war, a base which must be occupied to end the threat. Who killed the babies in that case?
I assert that all three are the exact same moral situation. The aggressors not only take responsibility for their own potential deaths, but all those deaths of innocents which become necessary to stop them.
Those people in Gaza who are truly innocent, who would stop Hamas if they could, if they die by an Israeli bomb; that is not Israel's fault, its Hamas's fault for turning innocent people's neighborhood into a rocket artillery launching site.
Contrast to this:
Rarely is it applied to situations where people who don't pose a threat are harmed to protect oneself. For example, harvesting someone's kidneys without their consent to save yourself is not self-defense, presuming they have nothing to do with your own kidneys failing.
Presumably not only has the kidney owner not committed an act an aggression but nobody has committed an act of aggression that would predictably endanger the kidney owner.
That it is why it is not self-defense, and why it is not self-defense to steal to fund a just war, or to draft soldiers to fight a just war.
It is not "I have a right to take anything I need to win, or kill anyone if their death would help me win", it is "has the enemy chosen to attack in a way by which they would gain advantage if I could not cause collateral damage".
By definition when a government attacks, they have made everyone in their controlled territory targets and are thus responsible for their deaths.
Keep in mind when I say "attack" I mean the moral factor: initiation of aggressive force (or threat thereof, or breaking a promise). The moral high ground (if anyone has it) will stay with the same side regardless of collateral damage. The fault is the aggressors, not only for the deaths of their own soldiers and their own civilians, but also the deaths of the civilians of the other side who died as collateral.
For example if the French had decided to fight in Paris it could have been Stalingrad before Stalingrad. A million people would die, hundreds of thousands of them civilians, tens of thousands of them children.
but that would not be the fault of the French because they did not initiate the use of force. On the contrary when the nazis decided to fight bitterly in Berlin and from many other major cities, those deaths were their fault as were all the deaths in the whole war.