My wife cooks sometimes too, but usually it's fairly easy for me to observe what she made and have a good sense of what went into the meal.
>We do have a shared shopping list. If I remember I'll put things I use up on the list, but often I'm busy at the time I notice because the thing on the stove needs to be stirred constantly... Last night I used one can of beans leaving two more - I didn't put beans on the list, but maybe I should have. Overall this system is working, but it is annoying and sometimes not ideal.
Same for us. I wanted to make pinto bean tacos last night but forgot the pinto beans at the store last weekend, because I'd assumed we'd had some. We used it as an opportunity to pivot and have a random meal that involved using up extras in our pantry and freezer. Life will always have annoying moments that aren't always ideal, there's no amount of automation that will eliminate them. It's good for us to experience those moments and use them as growth opportunities (not saying you don't, I'm just speaking generally here).