Heat the oven to 200°C / 400°F.
Toss eggplant cubes, ⅓ of the olive oil, a tablespoon of dried oregano, sea salt, and freshly ground pepper on a sheet pan. Roast until the eggplant is browned and creamy, 15 to 20 minutes, stirring halfway through. Add the cherry tomatoes and four or five garlic cloves with their papery skin to a baking pan. Toss with ⅓ of the olive oil, sea salt, half a teaspoon of sugar(optional), and freshly ground pepper.
Place in another rack in the oven and roast for 25 to 30 minutes, until tomatoes are softened and charred.
Meanwhile, cook pasta in well-salted boiling water until about 1 minute shy of al dente.
Remove eggplant cubes from the oven and set them aside. Remove the tomatoes from the oven. Lightly push the garlic to extract the roasted flesh from the skins. Discard the papers and mix the garlic with the tomatoes. Set aside.
Place a skillet on medium-high heat with olive oil.
Add diced onion and cook for one minute. Add the roasted tomatoes and garlic, stir, and sauté for two to three minutes on medium-low heat.
Add the eggplant cubes, spaghetti sauce, and 1/2 cup of pasta water and simmer for 3-4 minutes.
Reserve a cup of pasta water and drain the pasta in a colander.
Add the pasta to the eggplant sauce, stir, and cook for two to three minutes on medium-low heat. If needed, add more pasta water.
Once pasta is cooked and sauce has thickened, tear the mozzarella into smaller pieces and tuck them between the pasta and the vegetables.