Skip to content

Stop hook content key and silent detection#53

Merged
TensorTemplar merged 1 commit into
mainfrom
stop-hook-content-key-and-silent-detection
Jun 11, 2026
Merged

Stop hook content key and silent detection#53
TensorTemplar merged 1 commit into
mainfrom
stop-hook-content-key-and-silent-detection

Conversation

@TensorTemplar

Copy link
Copy Markdown
Owner

See commit messages for details

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>
@TensorTemplar TensorTemplar merged commit 1cebbb1 into main Jun 11, 2026
1 of 2 checks passed
@TensorTemplar TensorTemplar deleted the stop-hook-content-key-and-silent-detection branch June 11, 2026 10:44
@github-actions

Copy link
Copy Markdown

📊 Slopometry QPE Report

QPE Score: 0.2117

Metric Value Description
MI (normalized) 0.249 Maintainability Index / 100
Smell Penalty 0.231 Weighted code smell deduction
Adjusted Quality 0.212 MI × (1 - smell_penalty) + bonuses
Code Smell Breakdown
Smell Count
orphan comment 243
inline import 219
dict get with default 73
swallowed exception 27
single method class 23
passthrough wrapper 15
hasattr getattr 14
untracked todo 8
test skip 5
type ignore 2

Higher QPE = better quality

@github-actions

Copy link
Copy Markdown

📈 Slopometry Impact Report

Impact: NEUTRAL (score: -0.176)

Metric Delta Description
QPE -0.0059 Quality-Per-Effort change
MI -95.973 Maintainability Index change
CC +192.000 Cyclomatic Complexity change
Effort +2592116.0 Halstead Effort change
Count
Changed files 14
Blind spots 0
Smell Advantage Breakdown
Smell Baseline Current Weighted Delta
single method class 26 23 -0.1500
orphan comment 239 243 +0.0400
untracked todo 7 8 +0.0200
inline import 220 219 -0.0100

Source: Previous commit (3735871 vs d37eef7)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant