Skip to content

fix(gh-body-audit): report the $$ delimiter in the math scan - #246

Merged
ultimatile merged 2 commits into
mainfrom
fix/243-scan-display-math
Oct 3, 2026
Merged

ultimatile merged 2 commits into
mainfrom
fix/243-scan-display-math

Conversation

@ultimatile

Copy link
Copy Markdown
Owner

Summary

gh-body-conventions § Math rules out display math written between $$ delimiters, but the math scan in gh-body-audit reported no $$, so a body that kept such a block passed the audit. The scan now reports every line holding $$, and step 2 of gh-body-audit says how to judge each one.

Closes #243

Changes

  • skills/gh-body-audit/body-math-scan.sh reports every line holding $$, as a fourth class beside Unicode math glyphs, \operatorname, and inline math neutralized by an enclosing code span. Its exit codes are unchanged: 0 clean, 1 hits, 2 usage or environment error.
  • Step 2 of skills/gh-body-audit/SKILL.md judges each $$ on a reported line: one that inspection shows GitHub does not render as a math delimiter is ⊘ N/A, and any other is ⚠. An unresolved ⚠ blocks the step that called the audit, so a $$ that cannot be classified blocks it.
  • Step 2 states that the $$ between two directly adjacent backtick-delimited inline-math spans is not a math delimiter: GitHub renders the two spans as inline math.
  • skills/gh-body-audit/test-body-math-scan.sh covers the new class with four hit cases, two clean cases, an assertion on the printed lines, and a differential showing that the scan regex without the $$ alternative reports a $$ block clean. The test keeps three frozen regexes, the scan regex cut off after its first, second, and third class; each is built from the previous one, and one helper runs any of them.
  • metadata.version in .claude-plugin/marketplace.json is 2026.10.4.

Impact

Step 2 of gh-body-audit is the scan's only caller. A body that mentions $$ in a code span now exits the scan with 1 and takes a ⊘ N/A line where it used to pass silently. A bare $$ in prose takes ⚠ unless inspection shows it renders as plain text; putting it in a code span clears the hit either way.

Verification

  • bash skills/gh-body-audit/test-body-math-scan.sh printed ok for all 27 checks.
  • skills/gh-body-audit/body-math-scan.sh on a body holding a $$ block exited 0 before the change and 1 after it.
  • gh api -X POST /markdown in gfm mode, run on seven one-construct bodies, returned:
Body Result
$$ on its own line above and below \{a\} one <math-renderer> block whose content is {a}, the backslashes gone
$$x+y$$ inside a sentence one <math-renderer>
echo $$ in a fenced sh block code
kill $$ in a code span code
two adjacent backtick-delimited inline-math spans two inline <math-renderer> elements
a sentence holding one bare $$ plain text
a sentence holding two bare $$, each followed by a space plain text

The scan reported no $$, so a body that kept a $$ display block passed
the audit although gh-body-conventions rules that form out.

The scan now reports every line holding $$. Step 2 judges each $$ on a
reported line: one shown not to be rendered by GitHub as a math
delimiter is N/A, and any other blocks. It also states that the $$
between two directly adjacent inline-math spans is not a delimiter.

The test's frozen-regex runners are folded into one helper that takes
the regex as an argument.
Each frozen regex is the previous one plus one alternative, so the
later two are built from the earlier ones instead of repeating them.
The comments describe what each regex is in place of when it was
introduced.

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 scanner, audit guidance, regression coverage, and version bump consistently implement issue #243.

Review effort: Balanced
Findings: None

What changed in this PR

Adds $$ detection to the GitHub body math audit, closing #243.

Changes:

  • Extends the scanner and audit guidance for $$.
  • Adds regression and output tests.
  • Bumps the plugin version to 2026.10.4.
File Description
.claude-plugin/​marketplace.json Bumps the CalVer patch version.
skills/​gh-body-audit/​SKILL.md Documents classification of $$ hits.
skills/​gh-body-audit/​body-math-scan.sh Adds the fourth scan class.
skills/​gh-body-audit/​test-body-math-scan.sh Tests detection, output, and regression behavior.

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

@ultimatile
ultimatile merged commit 0d461a1 into main Oct 3, 2026
1 check passed
@ultimatile
ultimatile deleted the fix/243-scan-display-math 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.

body-math-scan: report $$ display math

2 participants