A third party code escrow account with instructions on how to build the service and a contract that specifies conditions when a customer gets access to that escrow.
I've been on both the customer and service end of such agreements.
Is there a popular provider for doing this? It sounds like a lot of work to find a solution in which both parties trust (both technically versed and reliability wise). A common notary probably wouldn't cut it, right?
There's a bunch of companies doing it, some dedicated, some as part of larger related offerings. E.g. I know NCC Group (large IT security company) does offer it, TÜV (which does all kinds of certification and compliance work), ...
I've been on both the customer and service end of such agreements.