• I briefly worked in safety critical software, so adjacent to defence and aeronautical in the UK. I recall that when the UK was asking for the source code for windows running on the trident subs at the time (which is terrifying thought at the best of times. A whole new meaning to blue screen of death) that UK gov had asked to inspect the source code but was told to swivel. IIRC US and China were both allowed to look. That was all on the grapevine though, and I was still a kid so obv take with a pinch of salt, but I’m inclined to believe it.

    I had more direct experience in my role validating software to run on military aircraft. We were contracted in to “prove” that the software was up to do-178b security stand and bug free via line by line inspection and some other techniques (which was a joy as you can imagine). I never got the impression that the source would be shared with the government, only that it had to meet the standard.

    Interesting sidenote there, was that because it was for defence, being up to the standard was really marketing more than legal requirement. We’d find bugs that would trigger hard reboots of the hardware and the message was always “thanks for letting us know, but it’s too expensive to get the original contractors back to fix it so we’ll just ignore it”. I think they’d have been legally obliged to do something for civilian aircraft but military is a different game.

    (Again should emphasise these are vague memories from working a gap year before my masters, so take with pinch of salt.)