Repository navigation
fix: rewrite glob expansion (component-split, char-walk matcher, backslash-tolerant) + v1.0.3 - #11
Merged
Merged
Conversation
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.
The bug
Glob input expansion in
src/cli.ts(expandInputs+simpleGlobMatch) failed silently — zero matches,No .jsonl files matched.— for several common invocations:'<dir>/**/*.jsonl': the root computation (base.slice(0, base.lastIndexOf("/") + 1)) swallows the**component, andjoin()normalizes away the prefix thatp.slice(root.length)expects to strip, so no file path ever matches the suffix.'*.jsonl'(prefix-less): root resolves to"."but the suffix/slice math still misaligns.<dir>\**\*.jsonl) on Windows:lastIndexOf("/")finds nothing, root degenerates.**on nested trees matched files exactly one level deep only:simpleGlobMatch's replace-chain turned**into a wildcard but left the literal/of**/required, so**/could never match zero directories.?was never escaped and acted as a bare regex quantifier.isAbsoluteappeared only in a no-op ternary (lastIndexOf(isAbsolute(input) ? "/" : "/")) — vestigial.Bug proven by curt-claudeai's Task 6 quality review (same code inherited there); this repo ships the same defect.
The fix
Mirrored exactly from curt-claudeai commit
de8f516("fix: rewrite glob expansion (component-split, backslash-tolerant) + JSONL hint, drop unused import"), which went through that repo's review cycles. Two adaptations only:.jsonl(curt-claudeai's parse-error JSONL hint block and its.json-oriented handling were NOT carried over — everything here is JSONL).isAbsoluteimport.--stdoutbehavior untouched. Version bump only, 1.0.2 → 1.0.3.Verification matrix (real files:
C:/tmp/globfix-scratch/parent.jsonl+C:/tmp/globfix-scratch/a/b/child.jsonl)Suite:
npx vitest run→ 30 passed (30), green.npm run buildclean.Merge-order note
PR #10 (docs: npm repo.url note) is still OPEN. This branch is cut from
mainat123129b(before #10). Both PRs add lines under the same## [Unreleased]CHANGELOG heading, so whichever merges second will need a trivial CHANGELOG conflict resolution (keep both lines). No other overlapping files.After merge
Publish after merge:
npm publish(Jordan OTP — 2FA required on npm).