The real important part of AMP that isn't open source is this, from the AMP HTML Specification[1]:
Required markup
AMP HTML documents MUST
...(some deleted)
- contain a <script async src="https://cdn.ampproject.org/v0.js"></script> tag inside their head tag.
That's the magic that allows google to inject the AMP header onto the top of your page, hijack the back button / left-right swipe on your page, etc, when someone visits your page from the carousel.
It's hard to call something open source when the spec says "You must include this javascript url (and therefore, code) that you don't control". And the validator does seem to make sure it's there.
[1] https://amp.dev/documentation/guides-and-tutorials/learn/spe...