Repository navigation
Description
Question
The fix for #1998, on branch feature/auto-1998 (handoff #2057, no pull request yet), has spent its two local-review edit rounds. Its third review still found one introduced finding: a command that develop denies as an unbounded wait loop, which the branch allows, and which bash really runs forever. How should the lane proceed?
Background
#1998 is a false deny, so the defect fails closed. The branch replaces the guard's quote-keeping lex, which reads no escapes, with _marked_lex, a lex that reads escapes as POSIX shlex does. That lets the quote mask survive an escape anywhere in the command, and the three commands in #1998 are now allowed.
The cost is that the mask now reaches commands where develop had no mask at all. On those, any place where shlex reads text differently from bash can mark a token as a literal operand when bash reads it as syntax. That fails open. Each review round found one more such shape:
- round 1: a
$(or backtick inside double quotes, and$'...' - round 2: a backtick glued to a quoted word, and a
#comment - round 3: a heredoc fed to a shell with an unquoted delimiter, whose body bash reads twice
For each shape, the branch falls back to develop's own mask (_quote_kept_mask), so that shape's verdict equals develop's by construction. After round 2, a 150k-case fuzz found no command where the branch's mask differs from develop's where develop's mask existed. The round-3 heredoc case is not covered yet. The reviewer also started probing a second double-read shape, an escaped backtick inside a bash -c "..." payload, but did not finish, so that case is unverified.
The shapes that develop itself allows are filed as #2058 and #2059 (pre-existing).
Counts per class across the three passes: introduced 5 (4 fixed, 1 open), pre-existing 2 (filed), style 0, plus 1 docstring finding (fixed).
Options
- Recommended: allow one more edit round. Fall back to develop's mask for any command holding a heredoc (
<<other than<<<) and for any loop read inside ash -c/bash -cpayload. Then run another local review, and drive the pull request to develop if that review finds nothing introduced.- Reason: the fallback pattern has held on every shape it covers. Both remaining shapes are the one class where bash reads text twice, and each fallback only restores develop's verdict.
- Effect on the parked work: the next worker adds the two fallbacks and self-test rows to
feature/auto-1998, then reviews again. It parks again if a fourth round finds another introduced flip.
- Close Wait-Loop Bound Check Drops Its Quote Mask on Any Escape in the Command #1998 as not planned and delete the branch.
- Reason: the defect fails closed, and each round has shown that widening the mask's reach exposes a new divergence that fails open, which is the worse direction for a safety guard.
- Effect on the parked work:
feature/auto-1998is deleted unmerged, Wait-Loop Bound Check Drops Its Quote Mask on Any Escape in the Command #1998 closes, and the lane closes out. The Wait-Loop Bound Check Counts a Comparison Bash Never Evaluates #2058 and A Heredoc Opener Holding (( Leaves Its Body in the Wait-Loop Check #2059 stay open.
- Merge the branch as it stands. The open heredoc flip would be tracked in The Wait-Loop Bound Check Counts a Comparison Bash Never Evaluates #2058.
- Reason: only if the three false denies in Wait-Loop Bound Check Drops Its Quote Mask on Any Escape in the Command #1998 matter more than a rare fail-open shape.
- Effect on the parked work: the next worker drives the pull request to develop unchanged, and The Wait-Loop Bound Check Counts a Comparison Bash Never Evaluates #2058 gains the heredoc-with-escape case.
Blocks
- Handoff Session Handoff [auto-1998]: Keep the Guard's Quote Mask When an Escape Sits Outside the Loop Condition (#1998) #2057 (track
auto-1998), branchfeature/auto-1998at50fc690e. No pull request is open.
Activity
ptr727 commentedon Sep 29, 2026
Answered by the maintainer on 2026-09-29: option 1, one more edit round. Fall back to develop's mask for any command holding a heredoc (
<<other than<<<) and for any loop read inside ash -c/bash -cpayload, review again, and drive to develop if nothing introduced remains; park again otherwise.Keep the Guard's Quote Mask When an Escape Sits Outside the Loop Cond…