Tevul Yom, Chapter 3, Mishnah 4. This chapter turns on the question of chibur, connection: a tevul yom invalidates terumah that he touches, so everything depends on how much of a dish is considered joined to the exact point that he touched. Our mishnah continues with the same dish of vegetables baked under a layer of beaten egg, and asks about the egg that ran up and over the sides of the pan.
The mishnah states: "chut shel beitzah shekaram al dafnos shel ilpas" - a streak of egg that baked hard onto the walls of the stew pan. In the preparing of the dish a thread of egg would sometimes run up the inner wall, over the rim, and down the outside of the pan, and there it would set. "V'naga bo tevul yom" - a tevul yom touched that streak, which is itself connected to the vegetables sitting in the pan. The ruling depends entirely on where along the streak he touched.
First the mishnah divides the streak in two: "min hasafah v'lifnim, chibur". Whatever part of the egg lies on the inner surface, up to the lip, is treated as one with the food resting inside, so a tevul yom who touched there has disqualified the vegetables. "Min hasafah v'lachutz, eino chibur": once the streak has crossed the lip and continues down the exterior, that stretch of egg is no longer joined to what the vessel holds, and the vegetables remain fit.
Rabbi Yosi is more lenient still. He rules "chut v'chol sheniklaf imo": the streak, and whatever peels away together with it. That is the practical test. Where the streak is low enough that peeling it off would bring a piece of the vegetables along with it, that portion is joined to the food. But high up on the wall of the pan, where peeling away the streak of egg would lift nothing of the vegetables with it, there is no connection, and a tevul yom who touches the streak at that point has not invalidated the vegetables in the pan at all.
The mishnah then extends the ruling: "v'chein b'kitnios shekarmu al sefasah shel kedeirah" - and so too with legumes that crusted onto the edge of a pot. Whatever the Tannaim held above with regard to the streak of egg, they hold equally with regard to kitnios that have hardened onto the rim.