fix: post-write hook debounce break outside loop#35
Conversation
The project.py debounce path (line 53) used `break` to skip re-running when the walnut was projected within the last 5 minutes. `break` is only valid inside for/while/until loops — inside a `case` statement it causes bash to emit "break: only meaningful in a … loop" to stderr and exit non-zero, which can surface as a hook failure in Claude Code. Changed to `exit 0`, matching the identical debounce guard for generate-index.py on line 80. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
|
Merge safety review (advisory) — Patrick Brosnan, non-collaborator on Verdict: GREEN — merge as-is, merge first of the batch. Headline: The bug on main is real and user-visible. The debounce on main is therefore doubly broken:
The Recommendation: Merge as-is. Merge this first of the batch. No rebase needed, no author response needed, no dependencies. Inter-PR compatibility: Zero file overlap with any other open PR (#28, #29, #31, #32, #33, #34). No semantic or behavioural interactions with #29's architectural refactor or #33's Hermes subsystem. Smallest, safest, most isolated PR in the queue. Merging first also removes any chance that Ben's rebase of #29 accidentally reintroduces the broken Full cross-PR synthesis (conflict matrix, recommended merge order for all 7 open PRs, per-PR verdicts, blocker list): see the cover comment on #29 — #29 (comment) Generated via flow-next epic |
Summary
alive-post-write.sh(line 53) usedbreakto early-exit when the walnut was already projected within the last 5 minutesbreakis only valid insidefor/while/untilloops — inside acasestatement, bash emits"break: only meaningful in a for, while, or until loop"to stderr and returns non-zero, which can surface as a hook failure in Claude Codeexit 0, matching the identical debounce pattern forgenerate-index.pyon line 80Test plan
log.mdwrite twice within 5 minutes for the same walnut — second invocation should exit cleanly with no stderrproject.pystill runs on the first write (marker file created)🤖 Generated with Claude Code