If you know how to program it should not be hard to wite a script that uses the check book infrastructure to auto-fix correctable errors and run it via calibre-debug
Something as simple as
Code:
from calibre.ebooks.oeb.polish.check.main import run_checks, fix_errors
from calibre.ebooks.oeb.polish.container import get_container
import sys
filepath = sys.argv[-1]
container = get_container(filepath, tweak_mode=True)
errors = run_checks(container)
if errors:
print ('Found errors, trying to fix them')
if fix_errors(container, errors):
container.commit()