Skip to content

fix(gh-body-audit,gh-body-conventions): state where two math rules apply - #245

Merged
ultimatile merged 2 commits into
mainfrom
fix/242-math-rule-reach
Oct 3, 2026
Merged

ultimatile merged 2 commits into
mainfrom
fix/242-math-rule-reach

Conversation

@ultimatile

Copy link
Copy Markdown
Owner

Summary

gh-body-conventions § Math forbade raw Unicode math characters "in prose" and forbade \operatorname with no qualifier, so neither rule said whether it reached text inside a code span, a fenced code block, or math. gh-body-audit step 2 filled that gap with its own list of positions: it dismissed a math-scan hit inside a fenced code block, inside an inline code span, or in prose that only names the construct. Backtick-delimited inline math is written as a code span and a math fence is a fenced code block, so the list dismissed \operatorname in both, which is the text the rule is about. Each rule now names the text it reaches by how GitHub renders it, and step 2 points at the rules in place of the list.

Closes #242

Changes

  • § Math forbids raw Unicode math characters in text GitHub renders as neither code nor math.
  • § Math forbids \operatorname in text GitHub renders as math.
  • gh-body-audit step 2 flags a glyph or \operatorname hit that sits in the text its § Math rule prohibits it in, and marks any other such hit not applicable. It holds no list of positions.
  • The header comment and usage text of skills/gh-body-audit/body-math-scan.sh and the header comment of skills/gh-body-audit/test-body-math-scan.sh name the three scanned classes — Unicode math glyphs, \operatorname, and inline math wrapped in a longer code span — without calling every flagged construct forbidden, and the scan's header leaves the judgment of whether a hit sits in text its rule covers to skills/gh-body-audit/SKILL.md. The scan's regex and exit codes are as they were.
  • metadata.version in .claude-plugin/marketplace.json is 2026.10.3.

Impact

Four cases get a different outcome from the audit's math-scan step:

  • \operatorname in backtick-delimited inline math or in a math fence was dismissed and is flagged.
  • A glyph in dollar-delimited inline math was flagged and is not applicable. The position list had no entry for it, while "in prose" already left it outside the rule.
  • A glyph in text that is neither code nor math and that only names the glyph was dismissed and is flagged. A code span around the glyph clears it.
  • \operatorname in text that is neither code nor math and that does more than name the macro was flagged and is not applicable, since the math renderer never receives it.

file-issue and file-pullreq apply § Math by reference and take the reworded rules with no edit of their own.

Verification

  • gh api -X POST /markdown in gfm mode, given one body holding each form, returned a <math-renderer> element for backtick-delimited inline math, dollar-delimited inline math, and a math fence; a <code> or <pre> element for a code span, a tex fence, and backtick-delimited inline math wrapped in a longer code span; and neither for paragraph text and a table header cell. The three classes the rules name are the ones GitHub's renderer produces.
  • A fresh-context agent, given skills/gh-body-audit/SKILL.md and skills/gh-body-conventions/SKILL.md as this PR leaves them, ran step 2 on a body that places glyphs and \operatorname in a heading, paragraph text, code spans, a text fence, both inline-math forms, and a math fence, with one line also holding inline math wrapped in a longer code span. The scan printed 14 lines, which the agent split into 17 hits: it flagged the three glyphs in text that is neither code nor math and the three \operatorname in math, and marked the other 11 hits not applicable. That covers the four changed cases above.
  • bash skills/gh-body-audit/test-body-math-scan.sh printed All checks passed.
  • The pre-commit mdformat hook reported Passed on the edited files.

Notes

The raw-Unicode rule and the \operatorname rule each name the text they
reach by how GitHub renders it: the first binds text rendered as neither
code nor math, the second text rendered as math. The audit's math-scan
step and the scan's header comment point at those rules in place of a
list of positions a hit can sit in, which dismissed \operatorname inside
backtick-delimited inline math and inside a math fence.
The two math rules now bind only some of the text a hit can sit in, so
the audit step, the scan's header and usage text, and the test header no
longer call every flagged construct forbidden. The scan's header also
drops a sentence claiming it reports every occurrence, which a
line-oriented scan does not do.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot review overview

🟢 Approval recommended

The updated guidance consistently resolves the ambiguity from issue #242 without altering scanner behavior.

Review effort: Balanced
Findings: None

What changed in this PR

Clarifies where GitHub body math rules apply and aligns audit guidance with the conventions SSOT.

Changes:

  • Scopes Unicode glyph restrictions to non-code, non-math text.
  • Scopes \operatorname restrictions to rendered math.
  • Updates scanner documentation and bumps the plugin version.
File Description
.claude-plugin/​marketplace.json Bumps version to 2026.10.3.
skills/​gh-body-conventions/​SKILL.md Defines each math rule’s rendering scope.
skills/​gh-body-audit/​SKILL.md Delegates hit applicability to the corresponding convention.
skills/​gh-body-audit/​body-math-scan.sh Clarifies scanner scope without changing behavior.
skills/​gh-body-audit/​test-body-math-scan.sh Corrects the test harness contract description.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@ultimatile
ultimatile merged commit d6cc6ac into main Oct 3, 2026
1 check passed
@ultimatile
ultimatile deleted the fix/242-math-rule-reach branch October 3, 2026 11:28
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.

gh-body-conventions § Math leaves the reach of its rules unstated

2 participants