Heat the oil in a frying pan, add the onion and fry gently for 10 minutes until softened. Add the garlic and sugar, increase the heat slightly and fry for 5 more minutes, stirring more frequently until a deep golden.
Add the apple to a food processor and finely chop. Add the pork, egg yolk, sage and plenty of salt and pepper and blitz. (Alternatively, finely chop the apple and sage, then mix with pork, egg yolk and seasoning.)
Roll out half the pastry between 2 sheets of clingfilm to a strip about 30 × 10 cm (12 × 4 inches). Remove the top clingfilm and spoon half the onion mix in a line down the centre, then spoon half the minced pork in a line on top. Brush the edges of the pastry with beaten egg.
Fold the pastry strip in half to enclose the filling and press the edges together with fingers dusted with rice flour to seal well. Trim the edges to neaten, then cut the strips into pieces about 7.5 cm (3 inches) thick. Arrange slightly spaced apart on an oiled baking sheet. Repeat with the remaining pastry, onion and pork mix.
Make 2–3 small slashes in the top of each sausage roll, brush with beaten egg to glaze, then bake in a preheated oven, 190°C (375°F), Gas Mark 5, for 20–25 minutes until the pastry is golden and the filling cooked through. Transfer to a wire rack and leave to cool.