Tighten endless-wait: a timeout inside a loop caps nothing, and cover each branch

This commit is contained in:
2026-11-18 19:33:09 +01:00
parent 1d411be20d
commit 281220a69b
3 changed files with 33 additions and 31 deletions
+1 -1
View File
@@ -43,7 +43,7 @@ RULES: dict[RuleName, Rule] = {
),
"endless-wait": Rule(
"a wait ends: a loop that sleeps has a time limit or a count cap, and a `pgrep -f` or `pkill -f` has a pattern its own command line doesn't match, since such a pattern finds the shell that runs the command and the wait never ends, and the session that waits on it hangs; wait with `~/.claude/bin/wait-for <file> [<pattern>] --timeout <seconds>`, or find a process by name with `pgrep -x`",
"a Bash or Monitor command with an `until`, `while` or `for ((;;))` loop that runs `sleep` and has no `timeout`, no `date` or $SECONDS comparison and no counter compared with -lt, -le, -gt or -ge, or a `pgrep -f` or `pkill -f` whose pattern, read as a regular expression, matches the command's text; the same inside the script of a `bash -c`, unless a `timeout` runs the shell. A loop over a list, such as `for i in $(seq 1 40)`, is a count and passes",
"a Bash or Monitor command with an `until`, `while` or `for ((;;))` loop that runs `sleep` and has no `date` or $SECONDS comparison and no counter compared with -lt, -le, -gt or -ge, or a `pgrep -f` or `pkill -f` whose pattern, read as a regular expression, matches the command's text; the same inside the script of a `bash -c`, unless a `timeout` runs the shell. A loop over a list, such as `for i in $(seq 1 40)`, is a count and passes",
),
# A marker would let the credentials into the transcript all the same, so no marker waives it.
"env-file-read": Rule(