A possibly relevant answer is here. Basically, I suggested that if the damage is just to the paint or clear coat, treat it as something that adds character to the frame. If you see torn fibers, stop riding, but that should be obvious. Else, just use watchful waiting - keep riding, examine the suspected damaged area regularly, keep alert for changes in how the bike feels.
In your case, my understanding is that you packed your bike into a bag, and in transit, the fork rotated such that the brake impacted the frame. I would still say watchful waiting is entirely justified, but there is a potential issue when the frame gets struck by a small hard object like the corner of your brake. This can cause an internal fracture in the carbon (the term of art is delamination). I repeat, it is possible for impacts like this to cause a delamination, which will later propagate into a full fledged fracture. It is not guaranteed. We don’t know how hard the brake hit the tube. We only know that you took a small hit that scraped off the clear coat, the paint, and the primer. Those are not exactly the toughest layers in the structure, so there might not be any underlying damage. I can only recommend watching and waiting, and if the frame is damaged, know that carbon fiber is repairable, possibly even more so than metal - on a metal frame it would be a new head tube, on a carbon frame the repair can be localized.
If you’re interested, the answer should contain a link to Raoul Luescher’s YouTube channel. You could search for the recent video where he castigates Cannondale for poor engineering on one recent model. The issue is that on one of their bikes, there’s a metal plate inside the bike that limits how far the fork can travel; the intent is to stop the handlebar end from hitting the tube and causing a delamination. I base my cautious response above on his video. However, it did this by hitting the inside of the head tube, causing a delamination. When you watch it, do remember that people come to him because their bikes are broken or they suspect internal damage; I would assume he is entirely correct about the engineering principles behind the Cannondale frame he criticized, but remember that he does not see all the Cannondale of that model where the travel limiter didn’t cause a delamination.
If you are that worried, you could take your bike in to a carbon repair shop with ultrasound or other nondestructive testing equipment. A bike store is likely to do a tap test: tap around the suspect area and listen for changes in pitch. My answer discussed (pulling from Luescher) that this test isn’t likely to be informative on bikes; it works best on flat structures like wings.