Skip to content

Authorize a Third Round on the #1635 Token-Fallback Fix, or Drop It #1844

Closed

Description

@ptr727

The fix for #1635 on branch feature/auto-1635 (handoff #1835) used up its two-round local-review budget. An introduced finding is still open, so editing stopped, per local-strict-review "Disposing of Findings". No pull request exists yet. The branch is pushed.

Where it stands

  • _operator_tokens in host-setup/agent-safety/claude/gh-write-guard.py handles a line that fails to parse. It retries the line without the trailing comment bash sees, then falls back to plain splitting as the develop base does. _strip_trailing_comment finds that comment and tracks only plain ' and ".
  • It fixes An Apostrophe in a # Comment Defeats Requirement 7 Entirely #1635: while ! gh pr checks 5 --watch; do sleep 30; done # the PR's checks is now denied. The round-1 regressions are fixed too. A differential against the develop base shows no deny-to-allow change over the self-test corpus.
  • Still open (introduced): the comment scan runs one line at a time, and each line starts outside any quote. Bash can start a line inside a quote an earlier line opened. In that case a # inside the quote gets cut as a comment, and the command after the quote closes is dropped. Constructed reproductions that develop denies and the branch allows:
    • A three-line command. Line 1 opens a double quote (echo "start). Line 2 closes it after a # and then runs a cross-owner gh issue comment write. Line 3 ends in a comment with an apostrophe.
    • A four-line command, echo "a / <<EOF # " / while true; do sleep 5; done / EOF. No apostrophe is needed, because _heredoc_opener tokenizes one line at a time.

Options

  1. Recommended: authorize a third round with the root-cause fix. Carry the quote state across lines: strip comments over the whole command before the whole-command parse, not per line. Keep _heredoc_opener on base behaviour, with no comment stripping. Why: the defect is structural, the fix is narrow and known, and the reviewer found the single-line scan sound. What happens to the parked work: the branch continues, another review pass runs, and the pull request is driven to develop.
  2. Drop comment stripping and fall back to base. Why: it removes the regression with certainty. The cost is that An Apostrophe in a # Comment Defeats Requirement 7 Entirely #1635 is not fixed. What happens to the parked work: the branch is discarded, and An Apostrophe in a # Comment Defeats Requirement 7 Entirely #1635 goes back to the backlog for a redesign, for example a tokenizer that follows bash's quoting across lines.

Blocks: the feature/auto-1635 branch, which has no pull request yet. Handoff: #1835.

Activity

  1. added
    decisionA question waiting on the maintainer, alone or beside whatever else the issue carries
    on Sep 26, 2026
  2. ptr727 commented on Sep 26, 2026

    @ptr727
    OwnerAuthor

    Answered by the maintainer on 2026-09-26: authorize a third round (option 1). Strip comments over the whole command with the quote state carried across lines, before the whole-command parse, and keep _heredoc_opener on base behavior. Then run another local review pass and drive the feature/auto-1635 pull request to develop.

  3. removed
    decisionA question waiting on the maintainer, alone or beside whatever else the issue carries
    on Sep 26, 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

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions