Implement validate_corpus thu app.py; add failing test