feat(install): warn about hooks that won't run with the installed shims #2205
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 231 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.326
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #2205"
general
weight: 0.35
BitWeaverDev
This PR was written in part with the assistance of generative AI.
Closes #2056
What
prek installonly installs shims for the hook types you ask for —--hook-type, ordefault_install_hook_types, falling back topre-commit. If the config has hooks pinned to a different stage (the classic case being a slowerstages: [pre-push]hook), those hooks just silently never run after a plainprek install, and it's easy not to notice.This adds a warning at install time that names the hooks whose stages aren't covered and points at the fix:
Notes on the approach
stages→default_stages→ all), soinstallstays offline and fast. The trade-off is that a remote hook narrowed only by its manifest (not by the project config) won't be flagged — that's the conservative choice: no false positives, no new network I/O, and it covers the case from the issue.manualis skipped, since manual-only hooks have no Git shim and aren't meant to run automatically.Stages::resolvesoinstallandHookSpec::apply_project_defaultsshare one implementation instead of duplicating the fallback rules.Tests
Added integration coverage in
tests/install.rs: an unmatched hook warns (while an all-stages sibling does not), installing the matching--hook-typesilences it, manual-only never warns, anddefault_stagesinheritance is taken into account.