Fix overly permissive --pr regex pattern in compact command#14
Merged
khaliqgant merged 2 commits intomainfrom Feb 20, 2026
Merged
Fix overly permissive --pr regex pattern in compact command#14khaliqgant merged 2 commits intomainfrom
khaliqgant merged 2 commits intomainfrom
Conversation
The previous regex `PR.*${escaped}\b` was matching words containing "pr"
(e.g., "Improve", "Express") because the case-insensitive flag made "PR"
match any "pr" substring. Combined with `.*` allowing any characters,
this caused false-positive trajectory matching.
For example, `--pr 5` would match "Improve error handling for module 15"
because "Improve" contains "pr" and "15" contains "5".
Fix: Use `\bPR\s*#?\s*${escaped}\b` which requires "PR" at a word boundary
and properly handles variations like "PR #5", "PR#5", "PR 5".
Fixes Devin review comment on PR #13.
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Added husky for git hooks - Added lint-staged to run biome on staged files - Pre-commit hook runs biome check --write on staged .js/.ts/.json/.md files - Fixed existing lint issues (package.json files array formatting) Co-Authored-By: Claude Opus 4.5 <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.
Summary
--prflag of the compact commandChanges
1. PR Regex Fix
The previous regex
PR.*${escaped}\bmatched words containing "pr" (e.g., "Improve", "Express") due to case-insensitive matching.Before:
#${escaped}\b|PR.*${escaped}\bAfter:
#${escaped}\b|\bPR\s*#?\s*${escaped}\b2. Pre-commit Lint Fixing
biome check --writeon staged.js/.ts/.json/.mdfilesTest plan
--pr 5does NOT match trajectories titled "Improve error handling"--pr 5DOES match trajectories with "PR feat: add environment variable and CLI overrides for trajectory storage #5" or "feat: add environment variable and CLI overrides for trajectory storage #5" in title🤖 Generated with Claude Code