When we visit manor3.php in the Relay Browser, we call RequestEditorKit.addWineCellarSpoilers(), which calls RequestEditorKit.changeDustyBottleNames(), which looks at the page text to see if it has 3 GLYPH_PATTERN matches on it. That is the hover text you see when looking at the Wine Cellar Glyphs, where you can pour wines into the basin. If we find three glyphs, we set the selected adventure to "Haunted Wine Cellar (automatic)", add a goal for each glyph-wine that we do not have in inventory, and change the dusty bottle names in the dropdown to have the ordinal in which you have to pour them.
I suppose that is OK for your first visit, but pouring in a wine is also a "visit" to manor3.php - as are visiting the summoning chamber and summoning a demon. The first has "action=pourwine", the second has "place=chamber", and the third has "action=summon". "action=pourwine" probably shows you the glyphs again, and thus triggers re-setting the goals.
We should only do the aforementioned actions when we visit the glyphs, not when we pour a wine or do anything with the summoning chamber.
Note that we can visit the glyphs, pour one wine, go away and come back, and pour the 2nd and 3rd wines, and if we have none of the first wine left, we'll set it as a goal again. That's not great, but we don't track how many wines you have poured, and as far as I know, KoL gives you no indication about which glyphs are glowing. I.e., which ones you have successfully activated. Is there? If so, we could skip adding a goal for that glyph. We could track pouring wines within this session, at least, even if we can't detect you pouring wine from outside KoLmafia.
In any case, we can detect when we open the Summoning Chamber - "There is a grinding of gears from within the pedestal, and a section of the cellar's back wall slides aside to reveal a hidden passage. Eureka!" - and clear the goals at that time.