Heat oil in a heavy-bottomed pot over medium heat. Add onions, carrots, and celery and cook until soft. Add garlic and stir until fragrant, about 30 seconds. Add peas and vegetable stock; simmer until peas are beginning to soften. Stir in greens, vinegar, red pepper flakes, and rosemary. Cook until greens are tender and peas are cooked through, about 20 to 25 minutes. Season with salt to taste.