Skip to content

Decide How the Prose Gate's Heredoc Half of #1664 Proceeds #3666

Closed

Description

@ptr727

#1664 asks the prose gate to stop reporting a # line inside a workflow heredoc that a step writes as data, such as cat > f <<EOF. Today the gate reads every run: heredoc body as shell code, which #3411 chose so that the comments in inline scripts stay checked. Telling a data body from a body something runs takes a reading of shell. Pull request #3665 builds that reading by hand, and it has not converged.

What happened on #3665. Eight recorded local-strict-review passes each found new constructed shapes where the head reads a body as data that develop reads as code and bash actually runs. The direction of each one silently drops a real comment from comment-added, comment-wrap and comment-case.

  • Answered so far: quoted separators, |&, an expansion as the command, subcommand runners such as kubectl exec -- bash, process substitution, groups and loops piped onward, a construct left open on an earlier line, and a quoted paren.
  • Still open at head 5c2f809b:
    • A heredoc inside a substitution that is an argument to a data program, such as curl -d "$(python3 - <<'PY'.
    • Block keywords counted rather than parsed: a stray done argument, a case pattern's ), or f(){.
    • An apostrophe in an earlier comment pairing with a later quote.
    • exec > >(bash) earlier in the step.

The conservative checks also cost the fix much of its reach. After any if ... elif ... fi, every later data heredoc in that step stays code, as develop reads it.

What is already settled on #3665 and needs no decision: a line holding code after a block comment's closer is no longer a comment-added line. That half of #1664 is done and tested across seven block-comment languages.

The question: how should the heredoc half of #1664 proceed?

  1. Recommended: narrow Keep a Line Holding Code After a Block Comment's Closer Out of comment-added #3665 to the block-comment fix and leave run-block heredocs as develop reads them, as code. The reason is the direction of each error. Develop's reading errs only toward a visible false positive that the comments label clears, and the heuristic errs toward a silent false negative. The comment parser reads string and heredoc content as comments where a syntax carries no string state #1664's heredoc case stays a known false positive that the comments label clears. The issue already calls that exposure bounded. Keep a Line Holding Code After a Block Comment's Closer Out of comment-added #3665 would revert its heredoc commits and keep Line.trailed. Its body would close The comment parser reads string and heredoc content as comments where a syntax carries no string state #1664's block-comment shape and record the heredoc shape as accepted.
  2. Ship the heuristic, fixing the four open shapes above and accepting that adversarial review will keep finding more. This delivers The comment parser reads string and heredoc content as comments where a syntax carries no string state #1664's heredoc case for the common top-level shapes. Each later one would be a false negative, a real comment left unchecked, in a shape no current fleet file holds. A survey of this machine's local fleet checkouts shows exactly one data heredoc that the change reclassifies. Keep a Line Holding Code After a Block Comment's Closer Out of comment-added #3665 would keep driving.
  3. Redesign the reading on a real shell parser, such as tree-sitter-bash or a pure-Python bash parser added to the gate's inline dependencies. This closes the whole class rather than one shape at a time. That adds a dependency, which the gate's PEP 723 block and tests/requirements.txt would both carry. Keep a Line Holding Code After a Block Comment's Closer Out of comment-added #3665 would park until the design is chosen.

Handoff: #3663 (track auto-1664). Blocks pull request #3665.

Activity

  1. added
    decision
    on Oct 30, 2026
  2. ptr727 commented on Oct 30, 2026

    @ptr727
    OwnerAuthor

    Answered by the maintainer: option 1, narrow. #3665 reverts its heredoc commits and keeps Line.trailed with its tests and docs. Its body closes only #1664's block-comment shape and records the run-block heredoc shape as an accepted false positive that the comments label clears. The reason is the direction of each error: develop's reading errs toward a visible false positive, while the heuristic errs toward a silently dropped comment.

  3. removed
    decision
    on Oct 30, 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions