dnd 5e – Does the Divination wizard’s Portent feature replace only the d20 roll, or the final outcome?

Portent makes you replace only the d20 roll, not the final outcome.

The description of ability checks in the rules says (PHB, p. 174):

To make an ability check, roll a d20 and add the relevant ability

The descriptions of saving throws and attack rolls have the same phrasing.

The description of the Divination wizard’s Portent feature says that (PHB, p. 116; emphasis mine):

you can replace a roll in this way only once per turn

It does not say to replace the whole d20 + modifiers. Hence, the Portent feature allows the Divination wizard to replace just a roll of the d20, and not the final outcome, following the wording of the feature.

Replacing the final outcome (and not just the d20 roll) would allow the wizard to force the possible outcomes to lie in the interval ${1,2,dots,20}$ and not in the interval ${1+x,2+x,dots,20+x}$, where $x$ is the eventual modifier. In this way, a modifier would play no role in an attack roll, ability check or saving throw. Indeed, forcing the final outcome to lie in ${1,2,dots,20}$ is equivalent to having all the creatures with a 10 or 11 score in each ability (hence $+0$ modifier) and without any circumstantial bonus (e.g., proficiency bonus, a racial bonus, or some combat feat). For example, in this way a CON saving throw of Hobgoblins and Ancient Red Dragons would range between 1 and 20 for both creatures, while normally it would range in ${2,dots,21}$ and in ${17,dots,36}$, respectively.

This answer is supported by other ones related to Portent working with other game elements (such as Rubiksmoose’s answer to a question about its interaction with Bardic Inspiration, and my answer to a question about its interaction with advantage/disadvantage). Here I consider another aspect that supports my ruling: if Portent allowed to replace the final outcome, then it would mean that all the creatures have no differences at all, from the point of view both of abilities scores and other characteristics such CR, feats and similar.