Skip to content

fix(path-detection): right boundary is the segment class, not a trailing separator - #254

Closed
kyle-sexton wants to merge 1 commit into
mainfrom
fix/path-detection-right-boundary
Closed

fix(path-detection): right boundary is the segment class, not a trailing separator#254
kyle-sexton wants to merge 1 commit into
mainfrom
fix/path-detection-right-boundary

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

Summary

The five HPP_* bodies required a separator AFTER the child segment, which inverted detection both ways in a live consumer incident (melodic-software/claude-code-plugins#1093):

  • A real bare path value at end of line (root = <drive>:/Dev/GitHub) has no trailing separator and was missed — a false negative on exactly the config-value shape the bodies exist to catch.
  • Prose satisfied the requirement anyway: the space-permitting segment class greedily consumed words until a later slash on the same line, flagging a comment as a "Windows repo path" while the actual violations passed clean.

Fix: the segment classes now exclude whitespace and the double quote, and the mandatory trailing separator is gone. Bare values at a natural boundary (EOL, whitespace, quote) are detected; prose spans cannot match (at least one non-space child character must follow the root); a root with NO child segment (C:\Users, a lone D:/repos/) still never matches.

Deliberately flipped pins

machine-path-patterns.test.sh pinned "bare roots stay clean" as a regression guard. Those pins are flipped, not worked around: that design's only stated rationale was prose safety, which the whitespace-excluding class now provides without the false-negative cost. New pins cover both directions of the old inversion (bare values must flag; prose spans must not — including a span-equality assertion that the prose line's match is the path token itself, never a greedy span). README updated to match (cross-doc reconciliation done in-PR; no other doc references the old boundary semantics).

Consumer impact (manifest targets)

Semantic widening reaches all three mapped targets on next sync — bare home/checkout values will start flagging:

  • claude-code-plugins (path-detection-guardrails): already carries the identical body file plus a bare-form update to its /Users/Shared exclusion stage — fix(guardrails): machine-path right boundary — segment class, not trailing separator claude-code-plugins#1095. Local and upstream copies are byte-identical.
  • medley (path-detection-tools): its hook-layer driver has the same /Users/Shared/ exclusion shape (tools/shared/path-detection/hardcoded-path-patterns.sh) and needs the same one-line bare-form follow-up when this syncs.
  • ci-workflows (path-detection-action): no affected exclusion stage found in check-machine-specific-paths.sh.

Verification

  • components/path-detection/machine-path-patterns.test.sh 34/0
  • shellcheck clean on both files (the escaped body's SC1003 disable became unnecessary — no trailing backslash remains)

🤖 Generated with Claude Code

Related

No linked issue — the driving incident is tracked downstream: melodic-software/claude-code-plugins#1093 (consumer bug report), fixed there by melodic-software/claude-code-plugins#1095 with this component change mirrored byte-identically. Prior art: #250 (checkout-root broadening from the same consumer chain).

…ing separator

The five HPP_* bodies required a separator AFTER the child segment,
which inverted detection both ways in a live consumer incident
(claude-code-plugins#1093): a real bare path value at end of line
("root = C:/Dev/GitHub") was missed, while the space-permitting segment
class let prose satisfy the requirement by greedily consuming words
until a later slash on the same line — a comment was flagged while the
actual violations passed clean.

The classes now exclude whitespace and the double quote and the
mandatory trailing separator is gone: bare values at a natural boundary
(EOL, whitespace, quote) are detected, prose spans cannot match, and a
root with no child segment still never matches. The old bare-root
non-match pins are deliberately flipped — that design's only rationale
was prose safety, which the whitespace-excluding class now provides
without the false-negative cost.

Consumer note: the guardrails driver in claude-code-plugins already
carries the identical body file (claude-code-plugins#1095) plus a
bare-form update to its /Users/Shared exclusion stage; medley's
hook-layer driver has the same Shared exclusion shape and needs the
same one-line follow-up when this syncs. ci-workflows' action driver
has no affected exclusion stage.

Suite 34/0; shellcheck clean.

Co-Authored-By: Claude Fable 5 (200k context) <noreply@anthropic.com>
@claude

claude Bot commented Jul 23, 2026

Copy link
Copy Markdown

Claude encountered an error after 0s —— View job


I'll analyze this and get back to you.

@github-actions

Copy link
Copy Markdown

Warning

Automated review did not complete — this is an infrastructure failure, not a review verdict.

Treat any Claude comment on this PR (including a placeholder like "I'll analyze this and get back to you") as incomplete, not "no findings."

Re-running the job, or pushing a new commit, will retry the review.

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 4105843e36

ℹ️ 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".

Comment thread components/path-detection/machine-path-patterns.sh
@kyle-sexton

Copy link
Copy Markdown
Contributor Author

🔒 babysit-prs lane claiming this PR for on-branch fix work this cycle (amendment-round: 16, safe tier). Will fix clear branch-owned findings and push; will not resolve threads or merge (safe tier).

@kyle-sexton

Copy link
Copy Markdown
Contributor Author

Closing in favor of #255 — same change as a signed commit (main requires commit signatures; this head was authored unsigned and force-push is not permitted from this environment). Review context: the Codex P1 thread here is answered and resolved; disposition carried onto #255.

@kyle-sexton
kyle-sexton deleted the fix/path-detection-right-boundary branch July 30, 2026 02:58
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