There’s no standard solution for merging errors automatically, you’ll need to do it manually in the way that works for you. For example, I have code like this in one place
rule(:some_collection).each do
case validate_element.(value) # some other contract injected above
in Success then nil
in Failure(errors)
errors.each do |path, messages|
key([:some_collection, *path]).failure(message)
end
end
end