Skip to content

fix(coord): make coord.sh's scope checks work on macOS and with glob scopes - #88

Merged
xcjs merged 3 commits into
mainfrom
fix/coord-claim-macos-grep
Oct 3, 2026
Merged

xcjs merged 3 commits into
mainfrom
fix/coord-claim-macos-grep

Conversation

@m-vawter

@m-vawter m-vawter commented Oct 3, 2026 •

Copy link
Copy Markdown
Collaborator

coord.sh claim failed on macOS, and on any platform claim and review misbehaved around ## Files scopes. This PR has three fixes in coord.sh. The first two bring it in line with coord.ps1:

  • claim, the macOS crash: the overlap check passed each Files entry to grep -x as a regex. The system grep (BSD grep 2.6.0-FreeBSD) rejects a glob like tests/** ("repetition-operator operand invalid"), and the claim aborted. Entries are now compared as exact strings (grep -qxF, like the PowerShell helper's -contains), and the lists are quoted so the shell never glob-expands an entry.
  • claim, a silent exit everywhere: the loop ended on grep … && echo, so a final non-match left the command substitution at status 1, and set -e quietly exited claim whenever another open issue declared Files. It now uses if … fi.
  • claim, body lines read as issues: the overlap loop read number<TAB>body line by line, so each line of a multi-line body was treated as an issue number ("invalid issue format" noise). A body line starting with digits would have been checked as that issue. It now emits just the number.
  • review: PR paths are checked against Files entries the way coord.ps1 does it: a wildcard match either way, or a prefix match on the entry with trailing * and / trimmed. That's a new in_scope helper. Before, a substring test reported every file under a glob scope (like tests/**) as undeclared.

Verification

🤖 Generated with Claude Code

…scopes

claim: compare Files entries as exact strings (grep -qxF, like coord.ps1's
-contains) and quote the lists so entries are never glob-expanded. macOS
BSD grep rejected a glob entry such as tests/** as a regex
('repetition-operator operand invalid'), which aborted the claim.

review: check PR paths against Files entries the way coord.ps1 does
(wildcard either way, or a prefix match with trailing '*' and '/' trimmed)
via a new in_scope helper. The old substring test reported every path
under a glob scope as undeclared.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
m-vawter and others added 2 commits October 2, 2026 20:53
The overlap loop ended on 'grep ... && echo', so a final non-match left the
command substitution with status 1, and set -e exited claim silently
whenever another open issue declared Files. Use if/fi so a miss is not an
error.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The loop emitted 'number<TAB>body' and read it line by line, so every
line of a multi-line body was treated as an issue number ('invalid issue
format' noise; a body line starting with digits would be checked as that
issue). Only the number is used, so emit only the number.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

@xcjs xcjs left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

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

Reviewed: in_scope() mirrors coord.ps1 wildcard semantics without regex/expansion (BSD+GNU safe), the claim clash loop no longer trips set -e on a non-match, and the review scope check uses in_scope. Fixes the exact macOS failures we saw with glob scope entries. Approving.

@xcjs
xcjs merged commit 4bc18c0 into main Oct 3, 2026
3 checks passed
@xcjs
xcjs deleted the fix/coord-claim-macos-grep branch October 3, 2026 01:31
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.

2 participants