One of the questions that is most often asked in keys to leaf miners is wether pupation os outside the mine or not. There are but a very few species that sometimes pupate within the mine, another time outside. To answer the question itmis advisalbe to collect ample material in the field. When, upon inspection, one or more pupae or puparia are found, the case obviously is closed. If there are mines wouthout larvae, one can be reasonly certain the pupation is outside. Finding clear exit slits gives additional support. Only when all you find are mines with dead, parasitised larvae you are in trouble.
In the higher Diptera (there are no miners among the primitive Diptera) the moult from the latest late larval stage to pupa takes place within the larval skin: this skin is not shed but dries and hardens. When the adult fly emerges it does so by shedding both the pupal and the latest larval skin. One can say that this larval skin has taken over the function of a cocoon. Because of the unique situation the pupa+larval skin of the higher Diptera has got its own name, puparium. The anterior and posterior spiracula of the larvae remain visible in the puparium.
The photo below shows a puparium where the bond between pupal and larval skin was so weak that the larval skin has come loose. The grey below therefore is a rare picture of a Diptera pupa!
Phytomyza agromyzina on Dogwood: pupa and fragments of the puparium
In some Agromyzidae colour and shape of the puparium may be diagnostic, while it concerns species that pupate outside the mine. Often it is possible then to obtain puparia by keeping a number of occupied mines in a cool place in a small, closed, plastic bag, in which desiccation is limited. The larvae develop quickly, and often one has puparia within a day or two. (Lepidoptera are much less easy!) The puparia below lied like pepper grains in the collecting bag after two days; they only need a day more to take on their black colour.
Phytomyza cf. spondylii on Hogweed: puparia
In many of the Agromyzidae species that pupate within the mine one of the pairs of spiracula penetrate the epidermis. Mostly this concerns the front sparacula and often, though not always, it suggests the presence of a Chromatomyia species.
Phytomyza ilicis on Holly: front spiracula
Phyllonorycter pupae have a sharp frontal ‘nose’, which the pupa uses to work itself half outside the mine, just before pupation is at hand. After ecdysis the exuviuym remains in place. This is handy, because the exvium can gently be pulled out of the mine, enabling the study of a cremaster, even though the pupa has gone.
Phyllonorycter geniculella on Sycamore: exuvium
Moth pupae often have on the last (10th) abdominal segment more or less hook-like structures. Often, especially in Phyllonorycter-species, they are very important for a definite identification.
Phyllonorycter acerifoliella on Field Maple: cremaster