If you find small (but visible) pieces of dirt on your food or drink is it permissible to eat it? Are there sources that discuss this?
By dirt I mean "an unknown foreign object that makes the food look bad".
Based on the verse (Lev. 11:43), אל תשקצו את נפשותיכם - "do not make yourselves detestable," there is indeed a halachah that one may not eat things that are disgusting to the average person. Shulchan Aruch (Yoreh De'ah 116:6) puts it as follows:
The Gemara in Shabbas 113b brings down a discussion about eating dirt. Rebbe asks can one eat dirt on shabbas because of refuah?
Rabbi Yismael b' Rebbi Yossi says it is forbidden even during the week since it makes one sick.
Rav Ami: Eating dirt from Bavel is like eating ones ancestors. Some say it is like eating shrutzim and rumasim.
The Chachamim forbade it because of it being unhealthy and because of shratzim u'rumasim.
A person one time ate clean dirt and it sprouted inside of him and reached his heart and he died.