Repository navigation
[Bug] Issue-quality media normalization accepts wrapped placeholders and can corrupt protected code #1196
Description
Client or integration
GitHub issue-quality automation and issue template validation
Area
CI and GitHub automation
Summary
The issue-quality normalizer has two related media-boundary defects:
- A placeholder wrapped in an HTML media element can be treated as substantive. For example,
clean("<video>No response</video>")retains the wrapper instead of classifying the section as an empty placeholder. - In a multiline media block, indented child tags such as
<source>or<img>can be protected as ordinary indented code before the media block is stripped, so a media-only section is not recognized consistently.
A direct combination of the obvious fixes is unsafe. The current indented-code protection restores sentinels by line position, while media stripping can collapse several lines to one. That can leak a NUL sentinel or drop an unrelated indented line before/after the media block.
Expected: placeholders wrapped only in media markup are rejected, real captions/fallback prose stay substantive, and fenced or indented code is preserved byte-for-byte.
Reproduction
Run the current issue-quality core against these cases:
clean("<video>No response</video>")
// currently remains substantive
isMediaOnly("<picture>\n <source src=\"x\">\n <img src=\"x\">\n</picture>")
// inconsistent because child lines are protected as indented codeA line-accounting regression appears when a stripped multiline media block is surrounded by protected lines:

<video>
<source src="x">
</video>
If multiline media is collapsed before positional restoration, the later sentinel can be restored to the wrong line or remain as a NUL byte.
Version
Current dev at 44dce33a; also reproducible from the current issue-quality core split
Operating system
All platforms
Provider and model
Not provider-specific
Logs or error output
direct media-wrapped placeholder: accepted as substantive
multiline media + neighboring indented code: positional sentinel restoration can lose a line or retain NUL
Screenshots and supporting files
No screenshot is needed; the string fixtures above reproduce the parser behavior.
Redacted configuration
{
"configuration_dependency": "none"
}Checks
- I searched existing issues and documentation.
- I removed secrets, tokens, account details, request credentials, and personal data.
Root cause and proposed boundary
protectIndentedCodeLines, HTML media stripping, and placeholder detection operate as separate text rewrites but assume line positions remain stable. Media removal violates that assumption.
A safe implementation should:
- identify fenced and indented code spans before inspecting media;
- strip or normalize media only outside protected code spans;
- preserve line count during intermediate masking, or restore protected spans from an ordered token queue rather than positional line indexes;
- inspect media fallback text for exact placeholder values without erasing real captions;
- preserve fenced HTML/media examples and ordinary indented Markdown exactly.
Required regressions include direct wrapped placeholders, single- and multiline captions, media-only nested source/img tags, fenced HTML/media, plain indented code, media surrounded by two protected lines with no NUL output, and the full issue-template validation result.
Activity
github-actions commentedon Aug 7, 2026
Automated translation bookkeeping — detected language: English.
Ingwannu commentedon Aug 8, 2026
Confirmed on current
dev: the three supplied boundaries still reproduce.<video>No response</video>remains substantive, indented child tags keep a multiline media block alive, and positional restoration is unsafe once media stripping changes line count.\n\nI am fixing this by protecting fenced/indented code before media normalization, restoring protected lines through ordered opaque tokens rather than line indexes, and treating only exact placeholder fallback text inside media as empty. Real captions/fallback prose remain substantive. The regression set covers direct wrapped placeholders, multiline media children, fenced examples, ordinary indented code, protected lines on both sides of a removed media block, and zero leaked NUL markers. I will link the draft PR and exact validation results here once pushed.Ingwannu commentedon Aug 8, 2026
Implemented and pushed as draft PR #1270: on exact head
03b05115:\n\n- issue-quality tests: 112/112 passed\n- related issue/PR-quality and target-enforcement tests: 211/211 passed\n- typecheck passed\n- privacy scan passed\n-git diff --checkpassed\n\nThe issue stays open until the CI-workflow change receives independent maintainer review, exact-head CI is green, and the PR merges intodev.Wibias commentedon Aug 9, 2026
Resolved on
dev.The fix originally developed in #1270 has been landed directly with a maintainer correction:
96141e8f—fix(ci): preserve code while normalizing issue mediad493c147—fix(ci): narrow media placeholder strippingThe landed implementation fixes the original three boundaries:
<video>No response</video>and equivalent GitHub-generatedNo responsewrappers are treated as empty.The maintainer follow-up also narrowed the placeholder rule so legitimate fallback/caption text such as
TBD,N/A,None, arbitrary text, filenames, URLs, emoji, and non-English content remains substantive.The final corrected implementation is present on current
dev, so the original corruption and wrapped-placeholder defects are resolved.Closing as completed.