Skip to content

Match the group marker only at the start of the body; cap each field - #2

Merged
Quantas merged 2 commits into
mainfrom
harden-marker-and-cap
Nov 13, 2026
Merged

Quantas merged 2 commits into
mainfrom
harden-marker-and-cap

Conversation

@Quantas

@Quantas Quantas commented Nov 13, 2026 •

Copy link
Copy Markdown
Contributor

Requested by Andrew · project thread

Two hardening fixes found in review before the first release:

  • Marker matching. An open issue was found by strings.Contains(body, marker). Alert text inside the fence could quote another group's marker and capture its updates and its closure. body() always writes the marker first, so the match now requires it at the start. TestQuotedMarkerDoesNotCaptureAnotherGroup fails with the old match.

  • Size cap. Header fields were not counted against the cap, so one huge annotation could push the body past GitHub's 65,536-character limit and the issue would never be created. Each fenced value is now capped at 8,000 characters (TestHugeHeaderStillUnderLimit).

  • Backtick flood. The fence was sized from untruncated content, so a field of 200,000 backticks made a 200,001-backtick fence. Content is now truncated first and runs over 10 backticks are shortened to 10 (TestBacktickFloodStaysBounded).

🤖 Generated with Claude Code

Quantas and others added 2 commits November 12, 2026 21:01
Alert text is written inside fences, but a fence does not stop a substring
match: an alert quoting another group's marker made that group's updates
and closure land on this issue. body() always writes the marker first, so
require it there.

Header fields (group labels, common annotations, the URL) were not counted
against the size cap, so one huge annotation could push the body past
GitHub's limit and the issue would never be created. Each fenced value is
now capped at 8000 characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The fence was sized from the untruncated content, so a field of 200,000
backticks produced a 200,001-backtick fence and a body far over GitHub's
limit. Truncate first, and shorten any run over 10 backticks to 10, so a
fence is at most 11 characters.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@Quantas
Quantas merged commit 86dc817 into main Nov 13, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant