The file as it comes out of the camera, so-called raw, is a family of formats. Usually such files are kept untouched and any edits are saved in a lightweight settings file (in the format of your editing app) alongside the original.
I'm not even really a hobbyist photographer anymore, but when I was, the full lossless edit was a .psd and that was generally exported to (high quality) jpg for distribution. I have folders full of carefully curated raws. For the relatively few that were ever edited they have an accompanying psd. The jpgs are ephemeral and don't get saved long term.
No photog nerd wants EVEN MORE POSTPROCESSING.