Skip to content

fix(comment-hygiene): preserve EMU underscore owners in vendored library - #66

Merged
kyle-sexton merged 1 commit into
mainfrom
fix/comment-hygiene-emu-underscore
Jul 8, 2026
Merged

kyle-sexton merged 1 commit into
mainfrom
fix/comment-hygiene-emu-underscore

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 8, 2026 •

Copy link
Copy Markdown
Member

Follow-up to #62, syncing the corrected library from melodic-software/standards#74.

#62 tightened the owner/repo#N owner class to [A-Za-z0-9-], which dropped _. GitHub Enterprise Managed Users have logins with an _SHORTCODE suffix (e.g. mona-cat_octo, fabrikam_admin), so // see mona-cat_octo/scratch#12 started scanning clean — the hygiene gate missed deferred-work refs in EMU repos. The corrected owner class [A-Za-z0-9_-] excludes only . (keeping the bare-domain fix) while preserving _.

Re-synced byte-identical to standards main. superset-test.sh passes; shellcheck clean.

🤖 Generated with Claude Code


Note

Low Risk
Single-regex tweak in a vendored detection policy; improves coverage for EMU refs without changing auth or runtime behavior.

Overview
Restores _ in the owner/repo#N regex owner class ([A-Za-z0-9_-]+ instead of [A-Za-z0-9-]+) so comment-hygiene flags cross-repo refs like mona-cat_octo/scratch#12 again after a prior tightening dropped underscores.

Comments now state that only . is excluded from owners (bare-domain false positives) and that GitHub EMU logins need _ in the owner segment. Repo-name matching and boundary rules are unchanged.

Reviewed by Cursor Bugbot for commit 218bef0. Bugbot is set up for automated code reviews on this repo. Configure here.

Follow-up sync. The prior sync (#62) tightened the owner/repo#N owner
class to [A-Za-z0-9-], which dropped '_' and made the gate miss
deferred-work refs for GitHub Enterprise Managed Users, whose logins
carry an '_SHORTCODE' suffix (e.g. mona-cat_octo/scratch#12). Re-sync the
vendored library to match standards, which corrected the class to
[A-Za-z0-9_-] — excluding only '.' (the bare-domain fix) while keeping
'_'. superset-test.sh still passes; the file shellchecks clean.

Co-Authored-By: Claude Opus 4.8 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01FSMCZgc6Dj6MaKLxDBSJFw
@claude

claude Bot commented Jul 8, 2026 •

Copy link
Copy Markdown

Claude finished @kyle-sexton's task in 1m 5s —— View job


PR Review

  • Gather context and read changed files
  • Review regex correctness and security
  • Verify comment accuracy and completeness
  • Final assessment

LGTM. This is a precise, well-reasoned fix. Here's my analysis:

Regex correctness

The owner character class changes from [A-Za-z0-9-] → [A-Za-z0-9_-]. One character added; everything else unchanged.

Does the bare-domain protection from #62 hold?

The leading boundary (^|[^[:alnum:]_/.-]) excludes . as a preceding character, so foo.com/bar#3 still can't match: the regex engine tries foo as the owner (matched by [A-Za-z0-9_-]+) but then hits . instead of /, and when it shifts to try com/bar#3 starting after the dot, the boundary rejects . as a valid start-of-token character (. is in the exclusion set [/.-]). No regression here. ✓

Does the EMU owner case now work?

For // see mona-cat_octo/scratch#12:

  • Boundary: space before mona → satisfies [^[:alnum:]_/.-] ✓
  • Owner: mona-cat_octo matches [A-Za-z0-9_-]+ ✓ (previously _ caused a miss)
  • Repo: scratch matches [A-Za-z0-9._-]+ ✓
  • Ref: #12 ✓

Previously this scanned clean; now it's correctly flagged. ✓

No false-positive risk introduced. Adding _ to the owner class makes the pattern more permissive, which increases true positives (real EMU refs caught). A pattern like my_var/something#5 in a comment is essentially never anything other than a tracker reference, so the practical false-positive risk is negligible.

Comment quality

The rewritten block comment is accurate and complete:

  • Correctly identifies . as the only excluded character (not _)
  • Explains the EMU _SHORTCODE rationale with a concrete example
  • Notes that the leading boundary still protects against mid-token host matches

No issues found. The change is minimal, correct, and well-documented.

@cursor cursor Bot 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.

Risk: low. Cursor Bugbot completed successfully with no findings requiring human review. Approved — narrow vendored regex fix restoring _ in EMU owner refs.

Open in Web View Automation 

Sent by Cursor Approval Agent: Pull Request Router and Approver

@kyle-sexton
kyle-sexton merged commit fc8c587 into main Jul 8, 2026
4 checks passed
@kyle-sexton
kyle-sexton deleted the fix/comment-hygiene-emu-underscore branch July 8, 2026 15:40
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