Make the pineapple jam: If you’re using a fresh pineapple, remove and discard the skin, eyes, and core, then chop the fruit into medium chunks. Weigh 1 pound 2 ounces of the fruit, reserving any extra for another use. Transfer the pineapple to the bowl of a food processor or blender, and process on low speed to create a coarse, slushy purée (Do not liquify; some small chunks may remain).
To a medium pot, add the pineapple, sugar, brown sugar, salt, vanilla extract, cinnamon, star anise, and cloves. Turn the heat to medium and simmer, stirring frequently and scraping the bottom of the pot, until the jam is reduced in volume by half, turns amber in color, holds its shape rigidly when stirred, and no liquid remains, about 45 minutes. (Take care not to scorch the bottom of the pot, especially as the jam thickens towards the end of cooking.) Turn off the heat, remove and discard the whole spices, then set the jam aside to cool to room temperature. (You should have approximately one cup of jam.)
Using a teaspoon-sized measuring spoon, scoop the cooled jam into 28 equal, approximately 8-gram portions. Roll each portion gently in the palms of your hands to form ¾-inch balls. (For the given amount of dough, you will need 25–30 balls; reserve any leftovers for another use.) Arrange the balls in a single layer on a large baking sheet, then, then cover tightly with plastic wrap. Refrigerate for at least 2 hours or up to 1 week.
Meanwhile, make the dough: To the bowl of a stand mixer fitted with the paddle attachment, add the butter, sugar, and salt. Turn the mixer to high speed and mix until pale and fluffy, about 2 minutes. Add two of the egg yolks, 1½ tablespoons cold water, water, and the vanilla and continue mixing to incorporate. Turn the speed to low, then add the flour and cornstarch and mix until no streaks of flour remain, 15–20 seconds. (If the dough looks and feels crumbly at this point, add a bit more water, one teaspoon at a time, just until the dough comes together.) Gather the dough into a ball, wrap tightly in plastic wrap, and refrigerate for at least 2 hours and up to 24 hours. (Alternatively, this dough may be stored in the freezer for up to 2 weeks; defrost overnight in the fridge.)
When you are ready to bake your tarts, preheat the oven to 350°F. Line a large rimmed baking sheet with parchment paper. Remove the dough from the fridge and set on the counter to soften slightly, about 10 minutes. Remove the jam balls from the fridge, unwrap, and set aside. Once the dough is malleable, fold it a few times to soften, then portion it into twenty-eight 2½-teaspoon balls (about 16 grams each). Using your hands, roll one piece of dough into a smooth ball , then flatten it between your palms to form a 3½-inch disk. (If the dough is very sticky, lightly flour your hands.) Place a ball of pineapple jam in the center of the disk and gently fold up the sides of the dough to seal the filling within. Gently roll the filled tart between the palms of your hands to create a smooth ball, then place it on the prepared baking sheet. Repeat with the remaining dough and filling, taking care to arrange the tarts at least 1 inch apart.
Beat the remaining egg yolks with 1 teaspoon of cold water, then use a pastry brush to brush a thin layer of the yolk mixture evenly over each tart. Transfer to the oven and bake, rotating the pan halfway through cooking, until golden, 16–20 minutes. Remove from the oven and set aside to cool completely on the baking sheet minutes before serving or transferring to an airtight container. Store at room temperature for up to 1 week.