Skip to content

running-in-ci: cover PR/issue titles in bang-escape guidance - #319

Merged
max-sixty merged 1 commit into
mainfrom
fix/bang-escape-pr-title-24741474472
Apr 21, 2026
Merged

max-sixty merged 1 commit into
mainfrom
fix/bang-escape-pr-title-24741474472

Conversation

@tend-agent

Copy link
Copy Markdown
Collaborator

Summary

Extend the bang-escape workaround in running-in-ci to cover PR and issue
titles. PR #318 restored the warning for comment bodies (via --body-file);
titles are still uncovered because gh pr create has no --title-file flag,
so a conventional-commits breaking-change marker in a title like
feat(hooks) followed by !: gets preprocessor-rewritten and ships with
a literal backslash before the bang.

Evidence

First wild post-#318 occurrence: worktrunk-bot opened
max-sixty/worktrunk#2359
at 2026-04-21T18:40:19Z. Raw API confirms the title is stored with a
backslash before the bang:

$ gh api repos/max-sixty/worktrunk/pulls/2359 --jq '.title' | cat -A
feat(hooks)\!: rename pre-start/post-start to pre-create/post-create$

The corresponding commit message on the same branch is clean —
git commit uses -F/file internally, so the ! survives there.
Only gh pr create --title "feat(hooks)!: ..." hit the preprocessor.

Fix

Add one paragraph after the existing --body-file guidance documenting the
command-substitution workaround. $(cat /tmp/pr-title.txt) is evaluated by
bash after the preprocessor's string scan, so the bang in the file stays
literal. Same pattern covers gh pr edit --title, gh issue create --title,
and gh issue edit --title.

Gate assessment

  • Evidence level: Critical — public-facing PR title corruption, 1 occurrence (#2359).
  • Cumulative this month: prior occurrence was in a comment body
    (worktrunk#2309)
    which PR skills: restore bang-escape warning (bug still fires in CI harness) #318 fixed; this is a different shape not yet covered.
  • Structural vs. stochastic: structural. Any bot PR with ! in its title
    reproduces deterministically until the skill documents the workaround.
  • Change type: targeted fix (one paragraph, no structural changes).
  • Both gates pass: Critical + structural + proportionate fix.

Evidence gist:
review-reviewers evidence: max-sixty/worktrunk 2026-04.

Triggering run: https://github.com/max-sixty/tend/actions/runs/24741474472

PR #318 restored the bang-escape warning and documented --body-file for
comment bodies. Titles are still uncovered: gh has no --title-file flag,
so a conventional-commits breaking-change marker in a title like
"feat(hooks)\!: rename ..." gets rewritten and ships as "feat(hooks)\\!: ...".

First wild occurrence post-#318: worktrunk-bot opened PR max-sixty/worktrunk#2359
with a visibly corrupted title. The commit message itself was clean (git commit
uses -F file internally); only the title passed via gh pr create --title "..."
got hit.

Document the command-substitution workaround: $(cat ...) is evaluated by bash
after the preprocessor's string scan, so the file contents stay literal. The
pattern applies to gh pr create, gh pr edit, gh issue create, and gh issue edit.

Co-Authored-By: Claude Opus 4.7 <[email protected]>
@tend-agent tend-agent added the claude-behavior Behavioral issues found by review-reviewers label Apr 21, 2026
@tend-agent

Copy link
Copy Markdown
Collaborator Author

Second occurrence in the wild while this PR sits open — bumps the count from 1 to 2 and confirms the pattern is deterministic rather than a #2359 one-off.

worktrunk#2361 opened at 2026-04-21T20:04:35Z by worktrunk-bot with stored title (backslash before the bang, via cat -A):

fix(config)\!: reject post-create hook instead of silently migrating$

Same root cause as #2359: gh pr create --title "fix(config)!: ..." hit the Bash-tool ! → \! preprocessor. The corresponding commit message on the branch (hooks/post-create-fatal) is clean, confirming the corruption is still isolated to --title string arguments.

Evidence recorded in the monthly gist: https://gist.github.com/44ab1483b29406255dd36141650c894d

Both PRs covered conventional-commits breaking-change renames/removals (feat(hooks)!: → \! in #2359, fix(config)!: → \! in #2361), which is exactly the surface area this PR's $(cat /tmp/pr-title.txt) guidance targets.

@max-sixty

Copy link
Copy Markdown
Owner

Great, but open a new issue about the line wrapping in the original PR description here

@max-sixty
max-sixty merged commit edbacf5 into main Apr 21, 2026
3 checks passed
@max-sixty
max-sixty deleted the fix/bang-escape-pr-title-24741474472 branch April 21, 2026 20:53
@tend-agent

Copy link
Copy Markdown
Collaborator Author

Filed as #320.

max-sixty pushed a commit that referenced this pull request Apr 21, 2026
## Problem

The `running-in-ci` skill already says "write each paragraph as a single
long line and let the browser reflow," but PR #319 still shipped with a
body hard-wrapped at ~72 chars. GitHub renders each source newline as
`<br>`, so the description reads with mid-sentence breaks instead of
reflowing to the reader's window.

Filed as #320 per @max-sixty's request.

## Solution

Add an explicit do/don't `<example>` block to the existing line-wrapping
paragraph, using the observed failure case from #319 as the
anti-example. Also clarify two points the prior wording left implicit:

- The rule applies to every delivery path — heredoc, `--body "…"`, and
`--body-file` — because the source newlines pass through unchanged.
- The Write tool does not reflow paragraphs, so authoring the body to a
file is not a fix on its own.

Code blocks, lists, and tables are called out as still keeping their
newlines; only prose paragraphs need to be unwrapped.

## Alternatives considered

The issue suggested two other angles:

- **Lint the composed body before `gh pr create`** — more robust, but
significantly more machinery, and the false-positive shape (prose that
happens to line up near 80 chars) is awkward to spec.
- **Unify on Write tool + `--body-file` as the canonical path** —
doesn't actually solve it: the model can (and did) write a wrapped
paragraph to the file.

Strengthening the wording is the smallest change with direct
line-of-sight to the failure mode. If this recurs after merge, the lint
angle stays on the table.

## Testing

Skill text only — no automated test exists for skill compliance. The
change is visible in the diff and follows the existing `<example>` block
convention used elsewhere in the file.

---
Closes #320 — automated triage

Co-authored-by: tend-agent <[email protected]>
Co-authored-by: Claude <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

claude-behavior Behavioral issues found by review-reviewers

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants