Skip to content

The Guard's Wait-Loop Rule Closes a Loop at a Quoted Separator Before done #2207

Description

@ptr727

Problem

_loop_parts finds a loop's do and done by command position alone and never reads the quote mask. A quoted ";" before a done word therefore reads as a separator, and the loop is closed there, before its real done.

Reproduce (constructed)

Allowed on develop, and bash prints ; done, sleeps, and repeats forever:

while true; do echo ";" done; sleep 1; done

Done looks like

_loop_parts takes the quote mask where it is known and ignores a quoted separator when it looks for do and done. The command above is denied, and a self-test row pins it.

Found by the local strict review of the #2080 fix (handoff #2137). It predates that fix.

Activity

  1. added
    bugSomething isn't working
    agentsAgents instructions
    pre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings
    on Oct 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    agentsAgents instructionsbugSomething isn't workingpre-existingReview finding classed pre-existing per local-strict-review Disposing of Findings

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions