fix(comment-hygiene): exclude '.' from the owner/repo#N leading boundary - #47
Merged
Conversation
The repo-issue rule's leading boundary `[^[:alnum:]_/]` let a dotted URL host satisfy it, so an ordinary comment linking a URL with a numeric fragment (e.g. `https://example.com/page#2`) matched as `tracker-ref:repo-issue` and failed the hygiene gate. Add `.` to the negated class so a dotted host is no longer misread as an owner/repo segment; genuine `owner/repo#N` references (no dot before the owner) still match. Adds a regression fixture asserting a dotted URL host with a numeric fragment stays clean. Empirically reproduced and verified against the live policy library. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPusuNL65RexZQQQ4SqL7t
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: c1e7477718
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
kyle-sexton
added a commit
to melodic-software/claude-code-plugins
that referenced
this pull request
Jun 27, 2026
Propagates the canonical fix (melodic-software/standards#47) to this repo's vendored copy of the comment-hygiene policy so all copies stay byte-identical. The repo-issue rule's leading boundary `[^[:alnum:]_/]` let a dotted URL host satisfy it, so a comment linking a URL with a numeric fragment (e.g. `https://example.com/page#2`) was flagged `tracker-ref:repo-issue`. Adding `.` to the negated class stops a dotted host being misread as an owner/repo segment; genuine `owner/repo#N` references still match. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01KPusuNL65RexZQQQ4SqL7t
Addresses Codex review: excluding only '.' from the leading boundary still let a hyphenated URL host match — `foo-example.com/page#2` matched `example.com/page#2` because the '-' before the host was a valid boundary char. Exclude '-' as well so dotted and hyphenated hosts are both ignored; owners that contain '-' still match (the '-' is excluded only at the boundary, not inside the owner class). Extends the test with a hyphenated-host case and a hyphenated owner/repo#N that must still be flagged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HjNG9583Dpkx77atd1k6t5
kyle-sexton
added a commit
to melodic-software/ci-workflows
that referenced
this pull request
Jun 27, 2026
Mirrors the standards SSOT fix (melodic-software/standards#47): excluding only '.' from the leading boundary still let a hyphenated URL host match (`foo-example.com/page#2` matched `example.com/page#2`, since '-' was a valid boundary char). Exclude '-' too; owners that contain '-' still match because '-' is excluded only at the boundary, not inside the owner class. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HjNG9583Dpkx77atd1k6t5
kyle-sexton
added a commit
to melodic-software/ci-workflows
that referenced
this pull request
Jun 27, 2026
…ary (#46) ## What Propagates the canonical comment-hygiene fix — **melodic-software/standards#47** — to this repo's vendored copy of `comment-hygiene-patterns.sh`, keeping all copies byte-identical. ## Why The repo-issue (`owner/repo#N`) rule's leading boundary `[^[:alnum:]_/]` allowed a dotted URL host to satisfy it, so an ordinary comment linking a URL with a numeric fragment was wrongly flagged: ```sh // see https://example.com/page#2 for details # was: tracker-ref:repo-issue ``` ## Fix Add `.` to the negated boundary class (`[^[:alnum:]_/]` → `[^[:alnum:]_/.]`). A dotted host is no longer misread as an owner segment; genuine `owner/repo#N` references still match. See standards#47 for the full rationale, regression test, and validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KPusuNL65RexZQQQ4SqL7t --------- Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
kyle-sexton
added a commit
to melodic-software/claude-code-plugins
that referenced
this pull request
Jun 27, 2026
…ary (#12) ## What Propagates the canonical comment-hygiene fix — **melodic-software/standards#47** — to this repo's vendored copy of `comment-hygiene-patterns.sh`, keeping all copies byte-identical. ## Why The repo-issue (`owner/repo#N`) rule's leading boundary `[^[:alnum:]_/]` allowed a dotted URL host to satisfy it, so an ordinary comment linking a URL with a numeric fragment was wrongly flagged: ```sh // see https://example.com/page#2 for details # was: tracker-ref:repo-issue ``` ## Fix Add `.` to the negated boundary class (`[^[:alnum:]_/]` → `[^[:alnum:]_/.]`). A dotted host is no longer misread as an owner segment; genuine `owner/repo#N` references still match. See standards#47 for the full rationale, regression test, and validation. 🤖 Generated with [Claude Code](https://claude.com/claude-code) https://claude.ai/code/session_01KPusuNL65RexZQQQ4SqL7t Co-authored-by: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Fixes a false positive in the comment-hygiene
owner/repo#N(repo-issue) rule.The rule's leading boundary
[^[:alnum:]_/]allowed a dotted URL host to satisfy it, so an ordinary comment linking a URL with a numeric fragment was wrongly flagged and would fail the hygiene gate:The
.inexample.comsatisfied the boundary, matchingcom/page#2as an owner/repo segment.Fix
Add
.to the negated boundary class ([^[:alnum:]_/]→[^[:alnum:]_/.]) so a dotted host is no longer misread as an owner segment. Genuineowner/repo#Nreferences — where the owner is not preceded by a dot (GitHub owners cannot contain dots) — still match.A regression fixture is added asserting a dotted URL host with a
#fragmentstays clean; the existing assertion that genuineowner/repo#Nis still flagged is unchanged.Validation
comment-hygiene.test.sh: 11/11 — new[11]URL guard passes and[7] flags owner/repo#Nstill passes.superset-test.sh).Scope
This is the canonical source. The identical one-line fix is being propagated to the vendored copies in
ci-workflows,github-iac, andclaude-code-plugins(separate PRs).medley's copy already uses a literal internal-repo matcher and is unaffected.🤖 Generated with Claude Code
https://claude.ai/code/session_01KPusuNL65RexZQQQ4SqL7t