Repository navigation
Description
#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 askubectl 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
doneargument, a case pattern's), orf(){. - An apostrophe in an earlier comment pairing with a later quote.
exec > >(bash)earlier in the step.
- A heredoc inside a substitution that is an argument to a data program, such as
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?
- 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
commentslabel 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 thecommentslabel 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 keepLine.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. - 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.
- 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.txtwould 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
ptr727 commentedon Oct 30, 2026
Answered by the maintainer: option 1, narrow. #3665 reverts its heredoc commits and keeps
Line.trailedwith 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 thecommentslabel 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.Read Data Heredocs and Code After a Comment Closer as No Comment Lines (
Promote Develop: Table-Cell Prose Checks, Block-Comment Closers, and …