displaying photos correctly in apps without color management

I’ve written software (Putting OOG back in the box, and other software not yet published) that happily accepts sRGB (or other) values outside the range 0 to 100%, and can manipulate it in various ways to push it back inside gamut.

But if values have already been crushed to 0 or clipped to 100%, recovering that lost data is more difficult: we need to guess what the OOG values were before we can push them inside gamut.