This commit optimizes the repository validation script (`scripts/ci_validate_repo.py`) by consolidating file discovery and validation checks into a single pass.
Key improvements:
- Reduced filesystem traversals from 3 passes to 1.
- Consolidated per-file I/O operations (stat and read) into a single loop.
- Optimized validation sequence to perform cheap size checks before expensive content reads.
- Implemented 64KB chunked reading for NUL byte detection to allow early exit and minimize memory usage.
- Improved script robustness against large files by enforcing size limits before reading.
These changes make the CI validation process faster and more resource-efficient, especially as the repository grows.