For the sauce: Heat a pot over medium heat. Throw in the bacon and fry until crispy. Take the bacon out of the pot and set aside. Fry the garlic in the bacon fat until golden, about 1 minute. Add the carrots, celery and onions, and saute until the onions are translucent, about 8 minutes.
Pour in the chicken stock and tomatoes and bring to a simmer. Puree half the beans using a food processor, or mash with a fork, and add to the broth. Add the oregano, rosemary, brown sugar and season with pepper. Let simmer for 30 minutes.
Add the rest of the beans and the basil, and heat through for 5 minutes. For the pasta: In a pot, bring salted water to a boil. Throw in the pasta and cook until al dente. Drain. Place the pasta into a big bowl, ladle on the sauce, sprinkle with the bacon and parsley. Top with Pecorino Pepato cheese.