Why don’t modern dishwashers know whether the dishes inside are clean or dirty?
Why can’t a dishwasher indicate clean dish status on the front panel so that your spouse or room-mate doesn’t have to ask?
You could use a variety of methods to determine dish cleanliness.
The simplest, though most error prone, would be to detect whether the door has been opened at least once since the dishwasher was last run.
Of course, if someone goes in to just get out a clean mug, then you have a false negative, the dishwasher detects the door has been opened and so now indicates that the still clean dishes will need cleaning.
The other solution is the dishwasher knows the “dry weight” of being empty, or mostly empty.
The washer can detect how many dishes, by weight, have been removed, and when it detects that the weight has begun to increase, the machine could be reasonably assured you are now loading dirty dishes in to it.
Very few people I can think of would take out clean dishes and then load them back in again.
You might if a few did not get clean the first time through, but generally you would have unloaded the dishwasher first, realised some were dirty, perhaps hand rinsed off the dirt, and reloaded those specific items back in to the washer.