Skip to content

feat(global-settings): block hand-rolled waiting, 2.5.0 - #763

Merged
rubenvdlinde merged 1 commit into
mainfrom
feat/block-polling-hook
Sep 12, 2026
Merged

rubenvdlinde merged 1 commit into
mainfrom
feat/block-polling-hook

Conversation

@rubenvdlinde

Copy link
Copy Markdown
Contributor

Why

Item 5 of the 2026-09-12 velocity diagnosis (https://claude.ai/code/artifact/25ce5f91-817d-43f6-85a5-508304aa5131). In twelve days of sessions the transcripts held 2,043 idle heartbeats, 929 bare true calls, 395 streaks of five or more consecutive CI polls and 35.7 hours of sleep loops. A session that waits by hand burns turns and context; a session that pushes and moves on does not, and 96 percent of CI wall-clock is queueing anyway.

What changes

  • global-settings/block-polling.sh: a PreToolUse guard on Bash that denies gh run watch, gh pr checks --watch, while or until loops around sleep, a sleep of 60 seconds or more, the echo idle and echo waiting heartbeats, and tail -f on /dev/null. It allows short sleeps, a one-shot gh pr checks or gh run view, pushes, and any grep that merely mentions the words. The denial message says what to do instead.
  • Registered in settings.json right after block-write-commands.sh; README table row and install line; VERSION 2.4.6 to 2.5.0 (a new hook is a minor bump).
  • tests/test-block-polling.sh: 14 deny and 15 allow cases, with a positive control so a hook that denies nothing cannot read as green. Wired into hook-tests.yml.

Verified locally

  • bash global-settings/tests/test-block-polling.sh: 29 passed, 0 failed, exit 0.
  • Mutation check: HOOK=/bin/true makes the harness exit 1.
  • shellcheck -S warning on the hook: exit 0. bash -n: exit 0. settings.json and hook-tests.yml parse.
  • The hook has been live on one machine since this morning and has blocked one real command (a memory note that quoted the banned shapes inside a heredoc), which is the known limit: it matches text in a command, including heredoc bodies.

@rubenvdlinde
rubenvdlinde merged commit 8d0e780 into main Sep 12, 2026
32 of 35 checks passed
@rubenvdlinde
rubenvdlinde deleted the feat/block-polling-hook branch September 12, 2026 12:19
WilcoLouwerse added a commit that referenced this pull request Sep 15, 2026
…ective

ShellCheck failed the branch on test-block-polling.sh:76:

    expect allow 'until_date=2026-09-12; echo $until_date'
    SC2016: Expressions don't expand in single quotes, use double quotes

The single quotes are the point. This harness feeds literal command strings
to the hook as DATA, so an expanded $until_date would test something the
hook never sees. Its two sibling harnesses — test-block-write-commands.sh
and test-block-config-tool-writes.sh — already carry the same directive on
line 2 with the same reason; the file added in #763 just missed it.

No VERSION bump: this is a lint annotation on a test, with no behaviour
change for anything consuming global-settings.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
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