Repository navigation
skills(running-in-ci): cover issue and PR bodies in bang-escape guidance - #404
Merged
Merged
Conversation
The rule previously enumerated "comment body" but not issue/PR body, even though the same Bash-tool preprocessor rewrites exclamation marks to backslash-bang on every body-composition path. A nightly survey-issue body quoting Rust macros (`eprintln\!()`, `assert\!()`) and HTML comments (`<\!-- -->`) shipped visibly corrupted to GitHub. Extending the listed surfaces to issue body / PR body, and naming code references as a common trap, follows the shape of #319 (which extended the rule to titles).
max-sixty
pushed a commit
that referenced
this pull request
May 15, 2026
…rule (#495) ## Summary Extend the existing `<<'EOF' ... EOF` backtick-escape rule to cover nested fenced code blocks. The current rule warns about escaping *inline code spans* (`` \`foo\` ``); the same single-quoted-heredoc mechanic also corrupts *nested fences* when the model defensively escapes the inner three-backtick fence (`` \`\`\`bash ``) to keep it from closing the outer fence. The fix is the standard markdown idiom: use a longer outer fence (four or five backticks) so the inner three-backtick fence renders intact without escaping. ## Evidence [PRQL/prql#5900](PRQL/prql#5900) (`tend ci-fix: transient classifier ignores repeat occurrences`, opened by prql-bot 2026-05-15T08:56:34Z). The body wraps a proposed skill addition in a `` ```markdown `` outer fence and contains an inner `` ```bash `` fence plus several inline code spans. The model escaped the inner fence and all inline backticks inside the inner section, producing visibly corrupted markdown — the rendered body shows `` \`\`\`bash ``, `` \`rustup-init\` ``, `` \`composer connect timeout\` ``, `` \`docker pull rate limit\` ``, `` \`gh issue search\` ``, and trailing `` \`\`\` `` (six distinct corrupted spans). Direct API spot-check: ```` $ gh api repos/PRQL/prql/issues/5900 --jq '.body' | grep -c '\\`' 6 ```` This is the first such occurrence in the PRQL evidence gist's tracked corruption-scan history (prior ticks all reported `backslash-backtick: clean`); the [evidence log](https://gist.github.com/tend-agent/5686b1fca82c08d385d9031a79be4a3e) for May 2026 records the scans. ## Classification - **Failure class**: structural. The trigger is deterministic — a body composed in a single-quoted heredoc that contains a nested fenced block + the model's defensive instinct to escape the inner fence. Replayed, this produces the same corruption every time. The existing rule already classifies the inline-code-span variant as authored (not preprocessor-injected); the nested-fence variant is the same shape with a different originating model habit. - **Evidence level**: structural / 1 occurrence — sufficient under [`review-gates.md`](https://github.com/max-sixty/tend/blob/main/plugins/tend-ci-runner/skills/review-reviewers/review-gates.md): *"Structural: no decision point — the same conditions produce the same failure every time... One clear occurrence is sufficient evidence for a targeted fix."* - **Change magnitude**: targeted fix — one sentence appended to an existing paragraph. Within the Gate-2 magnitude budget for structural-fix scope. ## Change `plugins/tend-ci-runner/skills/running-in-ci/SKILL.md`: extend the existing backtick-escape paragraph (already covering inline spans like `` \`foo\` ``) with a second sentence covering nested fenced blocks. Recommend a longer outer fence (four or five backticks outside, three inside) as the standard remedy. Adds a parenthetical noting that `--body-file` via the Write tool helps with delivery but not authoring — the model still has to author with bare backticks, since Write preserves data verbatim. ## Notes - #5900 itself is left as-is for now; its body is readable and stands as the in-evidence example for this fix. A clean re-author can follow once this skill update lands. - This change does not touch the inline-code-span rule (#423) or the bang-escape rules (#404, #427, #381, #432) — same paragraph, different shape, same delivery channel. Co-authored-by: tend-agent <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The bang-escape rule in
running-in-cienumerates "comment body, jq script, markdown heredoc, anything" but does not name issue body or PR body as surfaces. The Bash-tool preprocessor rewrites every literal exclamation mark to backslash-bang before bash parses the command, so anygh issue create --body "$(cat <<EOF ... EOF)"whose body quotes code references with!ships visibly corrupted to GitHub. The "anything" catchall doesn't reliably trigger when "issue body" isn't on the listed surface set.Evidence
This morning's tend-nightly run on max-sixty/worktrunk opened issue #2663 ("Nightly drift cleanup") with five backslash-bang corruption sites in the body:
(That output is from
gh issue view 2663 --json body --jq .body— confirms the corruption is in GitHub's stored body, not local rendering.)The body was composed in the nightly survey path, which doesn't have its own body-composition guidance and inherits from
running-in-ci. The maintainer engaged with the issue and merged five of the resulting fix PRs (#2664–#2668) within ~30m, so the corruption did not block the workflow — but every code reference in the issue is visibly wrong.Fix
Extend the listed surfaces in the bang-escape rule from "comment body" alone to "issue body, PR body, comment body". Name the listed
ghsubcommands that need--body-file(gh issue create/gh issue edit/gh pr create/gh pr edit/gh issue comment/gh pr comment). Add a one-line trap example: code references likeeprintln!(...)/assert!(...)/<!-- ... -->/!=quoted in survey or triage bodies are the common shape.This follows #319 ("running-in-ci: cover PR/issue titles in bang-escape guidance") which extended the same rule to titles via the same incremental enumeration.
Cumulative evidence
The watch item "review-reviewers corruption-scan recipe doesn't cover PR/issue bodies" has carried in evidence gist for prior months awaiting concrete recurrence; this run's #2663 body provides it.
Gate assessment
--body-filepattern.This is a one-line documentation change with a clear precedent and concrete reproduction.