The word translated as mindfulness is sati in Pali, and its root sense is memory or recollection rather than bare attention. That matters for understanding what the practice was originally taken to be.
The foundational discourse sets out four fields of observation. The body, including the breath, the postures, the parts of the body and its decomposition after death. Feelings, meaning only the pleasant, unpleasant or neutral tone of each experience and not emotion in the ordinary sense. States of mind. And mental phenomena, examined against explicit doctrinal categories: the hindrances, the aggregates, the factors of awakening, the four noble truths. That fourth field is where modern presentations diverge most sharply from the source, because it is unambiguously doctrinal. The practitioner is checking experience against a specific analysis of it, and is expected to arrive at that analysis.
The contemplation of a decomposing corpse through nine stages belongs to the same text and was practised in charnel grounds. It is neither an aberration nor a medieval addition. It is there to establish, below the level of argument, that this body will do that.
Sati also does not stand alone. It is one of eight factors of the path and one of five faculties, and the tradition insists that it operates alongside ethical conduct and right view rather than independently of them. Attention detached from those is not sati in the technical sense at all, a sniper is attentive, and the tradition would not call him mindful.