And all packages should be signed.
And if that is not feasible for whatever reason, there should at least be support for storing the checksum of each package inside the file where all dependencies are pinned to a particular version/commit.
e.g.
lib-a v1.23 4355a46b19d348dc2f57c046f8ef63d4538ebb936000f3c9ee954a27460dd865
lib-b v4.56 53c234e5e8472b6ac51c1ae1cab3fe06fad053beb8ebfd8977b010655bfdd3c3
...