Stop hook content key and silent detection#53
Merged
Conversation
Two related stop-hook quality-feedback changes (bundling the in-flight submodule-filtering work that was already uncommitted on main): Commit-invariant cache key: the Stop hook now fires only when .py/.rs *content* changes — never on commits, branch switches, pulls, rebases, or doc/config churn. The firing key is a digest of working-tree source content (git ls-files --cached --others --exclude-standard -> git hash-object --no-filters, with an identical pure-Python git-blob fallback), dropping commit_sha from the firing decision (kept only as a cheap fast-path hint). New untracked source files now fire; submodule code never does. Principled silent-failure detection: a handler counts as a swallowed exception only if it does no processing of any kind (pass/continue/break/ellipsis/bare string). Fallback assignments (`torch = None`) and counter increments (`errors += 1`) are recognized as handling and no longer flagged. A dedicated `# slopometry: allow-silent` marker downgrades a genuinely-silent handler to the new acknowledged_silent_except smell, which blocks only when it INCREASES — the anti-reward-hack guard against mass-suppressing real swallows. Also: the QPE MI checkpoint guard now averages production files only (test fixtures legitimately score low MI and were dragging the whole-repo average); docs/stop-hook-cache-spec.md added. 837 passed, 7 skipped; ruff check + format and mypy clean. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
📊 Slopometry QPE ReportQPE Score: 0.2117
Code Smell Breakdown
|
📈 Slopometry Impact ReportImpact: NEUTRAL (score: -0.176)
Smell Advantage Breakdown
|
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.
See commit messages for details