feat: pre-PR local test runner gate (Closes #580) - #597
Merged
Conversation
Implement a targeted test shard runner that maps changed source files
to their most relevant test counterparts BEFORE gh pr create. This
shifts validation left — catches regressions locally instead of
waiting for CI minutes later.
Four-tier mapping heuristic:
1. Exact match: agent/foo.py → tests/agent/test_foo.py
2. Module match: built into the exact-match lookup by basename
3. Directory fallback: hermes_cli/config.py → tests/hermes_cli/
4. Last resort: pytest tests/ -x -q --timeout=120 -k 'not slow and not docker'
Files:
- scripts/evolution_pre_pr_test_runner.py — the gate script (541 lines)
- tests/scripts/test_evolution_pre_pr_test_runner.py — 30 pure tests
- skills/evolution/evolution-implementation/SKILL.md — integrated as
Step 1 in the 'Validate LOCALLY' section of the PR-creation flow
The script is standalone + import-safe: pure functions are injectable
for offline testing. Logs go to
~/.hermes/profiles/user1/evolution/pre-pr-test-results/{timestamp}.log.
Co-Authored-By: Hermes Evolution <evolution@hermes.ai>
3 tasks
…ecomposition_gate.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Automated evolution PR for issue #580. Adds evolution_pre_pr_test_runner.py — a targeted test shard gate that identifies and runs the most relevant tests before PR creation, shifting validation left and reducing CI failure rate.