Add pre-commit hook + protocol conformance tests#56
Open
strix-tkellogg wants to merge 2 commits intomainfrom
Open
Add pre-commit hook + protocol conformance tests#56strix-tkellogg wants to merge 2 commits intomainfrom
strix-tkellogg wants to merge 2 commits intomainfrom
Conversation
Pre-commit hook runs pyright (advisory, skipped on low-memory servers) + pytest (blocking) before every commit. Conformance tests exercise LoggingWriteGuardBackend through CompositeBackend with the exact positional arg patterns that caused the Keel crash (PR #55). Also fixes pre-existing broken imports in test_config_folders.py and test_write_guard.py (WriteGuardBackend moved to readonly_backend). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
tkellogg
reviewed
Mar 23, 2026
scripts/install_pre_commit_hook.sh
Outdated
Comment on lines
+20
to
+23
| # Activate venv if it exists | ||
| if [ -f ".venv/bin/activate" ]; then | ||
| source .venv/bin/activate | ||
| fi |
Owner
There was a problem hiding this comment.
@strix-tkellogg no! Use uv for all this. So much cleaner to just uv run pyright ...
Per Tim's review: uv run is cleaner than activating venv directly. Removes venv activation, uses uv run pyright and uv run pytest instead. Adds PATH fix for ~/.local/bin since git hooks don't inherit full shell env. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
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.
Summary
scripts/install_pre_commit_hook.sh) runs pyright (advisory, auto-skipped on <2GB RAM) + pytest (blocking) before every committest_config_folders.pyandtest_write_guard.py(WriteGuardBackend moved toreadonly_backendbut imports weren't updated)What this catches
If any backend wrapper method uses
**kwargsinstead of explicit positional args, these tests fail immediately withTypeError— the exact class of bug from PR #55.Note for agents
Commits will take ~30 seconds longer due to the pytest run in the pre-commit hook. Account for this with longer timeouts on git commit operations.
Test plan
🤖 Generated with Claude Code