Repository navigation
fix(consistency): a Stop hook that could not run is a failed step - #1405
Conversation
A Stop hook whose command does not start (a relative path such as `sh .claude/hooks/stop.sh` after the agent ran `cd` into a subdirectory) gives no feedback. Claude Code shows only a `stop-hook-error` notification and the stop passes. The reader counted that as a hook that passed. A stop-hook-error notification with no feedback in the same stop is now a failed `Hook:Stop-error` step (not a tool call). A notification right after a blocked stop's feedback is that block's own and adds nothing. The docstring and docs/run-consistency.md say what each step means and show the `$CLAUDE_PROJECT_DIR` form for hook commands. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
|
✅ OpenCodeReview: Review complete: 0 finding(s) across 4 selected item(s). CI at Review details
|
Mutation of changed lines46 mutants of the lines this PR changes, at 6b5043c: 33 killed, 13 survived, 0 waived, 0 inconclusive, 0 timed out, 0 errors, 0 not run. A survivor is a change to that line that the tests covering it do not notice: add an assertion that fails on it or, if the change cannot alter behaviour, put
Warn-only: a survivor does not fail the job yet. Updated on every push; the full report is in the ci run summary. |
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1405 +/- ##
==========================================
+ Coverage 96.25% 96.27% +0.01%
==========================================
Files 512 513 +1
Lines 68234 68486 +252
Branches 11844 11887 +43
==========================================
+ Hits 65680 65932 +252
- Misses 1568 1570 +2
+ Partials 986 984 -2
🚀 New features to boost your workflow:
|
…esults The degrade-task hook arm is now valid: hook 5/6 vs none 0/7 (p = 0.005), vs prose 3/6 (p = 0.55). Pooled over both real tasks, hook 10/18 vs none 0/19 (p < 0.001) and vs prose 5/18 (p = 0.18). The hook beats no guidance on both tasks; a hook vs prose skill difference is not shown. Replaces the untested-arm note with the detection point: dokimi reads stop-hook errors (intel#1405), and a relative hook path fails silently. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
…not block Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
Signed-off-by: Vladislav Perevezentsev <vladislav.perevezentsev@intel.com>
vlad-perevezentsev
left a comment
There was a problem hiding this comment.
🟢 LGTM · re-checked 6b5043c · nothing required from @napetrov
🔀 Merge: safe now · merges cleanly into current main, 8 commits behind, and its tests pass on the merge · after it, #1408 needs a rebase (context/consistency.py)
✅ make ci-local --offline: 0 failed, 27 passed (30,983 tests) · ✅ mutation: every mutant of the new reset line (155) is killed · ✅ the subagent repro gives one Hook:Stop
The earlier points are fixed; a Stop hook that failed without blocking is now a failed step.
Fixed in this branch, up to 6b5043c:
…1398) * docs: measured findings on invocation, verifiers and path stability Add what the skill-evaluation experiments measured to the two guides: - evaluating-treatments: report invocation and split done-right by invoked / not invoked; pointer placement (CLAUDE.md vs README); trigger-heavy descriptions; Stop-hook gates, and checking the hook fired before crediting it. - run-consistency: the harness result is not a verdict (use a verifier for --outcomes); path distances at n = 6 are noisy and the paraphrase effect did not replicate on real tasks. Numbers are haiku-4-5 on one toy task and two real tasks, directional. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> * docs: estimate path-distance contrasts directly Thread: PRRT_kwDOVBg7g869LCA1 Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> * docs: report the fixed degrade hook rerun and pooled real-task hook results The degrade-task hook arm is now valid: hook 5/6 vs none 0/7 (p = 0.005), vs prose 3/6 (p = 0.55). Pooled over both real tasks, hook 10/18 vs none 0/19 (p < 0.001) and vs prose 5/18 (p = 0.18). The hook beats no guidance on both tasks; a hook vs prose skill difference is not shown. Replaces the untested-arm note with the detection point: dokimi reads stop-hook errors (#1405), and a relative hook path fails silently. Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> * docs: clarify how to verify Stop-hook errors Thread: PRRT_kwDOVBg7g869Li0E Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> * Correct the rename comparison p-value Thread: PRRT_kwDOVBg7g86-G2OF Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> * Describe standalone Stop-hook errors Thread: PRRT_kwDOVBg7g86-G2Oe Thread: IC_kwDOVBg7g88AAAABs3UqIA Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> * Identify the fixed-path degrade rerun Thread: PRRT_kwDOVBg7g86-G2O1 Thread: PRR_kwDOVBg7g88AAAABbZXZrw Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> * Identify the agent as the source of the pass claim PRRT_kwDOVBg7g86-K44r Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com> --------- Signed-off-by: Nikolay Petrov <nikolay.a.petrov@intel.com>
Summary
A Stop hook that cannot start gives no feedback, so the reader saw a clean stop:
consistency.py: astop-hook-errornotification with no blocked-stop feedback in the same stop becomes a failedHook:Stop-errorstep. A notification right after a blocked stop's feedback stays part ofHook:Stop.parse_runsplit into_record,_result,_finishto stay under the complexity ratchet (cap 10).docs/run-consistency.md: hook commands should besh "$CLAUDE_PROJECT_DIR"/.claude/hooks/stop.sh; a relative path follows the agent'scd.Evidence
Red then green (
tests/test_context_consistency.py):test_growth_ratchetand the consistency tests: 160 passed.Full suite on
8a51d7dba: 31053 passed, 42 skipped, 0 failed.make ci-local(pre-push): 0 failed, 17 passed, 3 skipped.Real traces (the degrade Stop-hook arm, haiku-4-5, read with
read_run): the 5 runs whose procedure failed with no feedback now showHook:Stop-error(para_0 twice, para_2, repeat_0, repeat_1). Runs with a blocked stop (para_1, repeat_2) and all 12 rename runs still showHook:Stoponly.Merge Danger
Door: two-way. Reader output only; no persisted input format changes. A new step kind
Hook:Stop-errorcan appear in consistency results.Blast Radius: only runs whose Stop hook could not run. Their failed-step count goes up by one per such stop, which can move a pass rate. Other runs are unchanged (their traces have no
stop-hook-errornotification).🤖 Generated with Claude Code