+ // Second pass: validate 'belongs-to' in submodules
+ for (var submodule : submodules) {
+ final var belongsTo = submodule.belongsTo();
+ if (!isKnown(resolved, belongsTo)) {
+ // belongs-to check failed, move the source back to pending
+ final var sourceId = submodule.sourceId();
+ LOG.debug("Source {} is missing belongs-to {}", sourceId, belongsTo);
+ pending.put(sourceId, submodule);
+ resolved.remove(sourceId);
+ }
+ }
+