private ValidationEvent cycle(ResourceShape shape, Set<ShapeId> parents) {
        String chain = parents.stream().map(ShapeId::toString).collect(Collectors.joining(" -> "));
        return error(shape, String.format("Circular resource hierarchy found: %s -> %s", chain, shape.getId()));
    }
Validates that resource references do not introduce circular hierarchies.
smithy-model/src/main/java/software/amazon/smithy/model/validation/validators/ResourceCycleValidator.java