As T2555 shows, we have a problem with "structural" nodes like protocols or service defined in files for specific components. Since every file needs all parent nodes starting from the root, there's no way we can avoid that issue altogether.
However, we can move "structural" nodes to separate definition files. Then the node.def generator can use a simple test: if a node dir/file already exists, then it should never be overwritten.