feat(core): support list_with_glob via GlobLayer#7629
Open
chitralverma wants to merge 9 commits into
Open
Conversation
…ndalone GlobLayer
…ield Both java and python bindings constructed core ListOptions with full field literals, breaking when the new glob field was added. Use ..Default::default() spread to remain forward-compatible with future ListOptions additions.
chitralverma
commented
May 28, 2026
| recursive: convert::read_bool_field(env, options, "recursive").unwrap_or_default(), | ||
| versions: convert::read_bool_field(env, options, "versions").unwrap_or_default(), | ||
| deleted: convert::read_bool_field(env, options, "deleted").unwrap_or_default(), | ||
| ..Default::default() |
Contributor
Author
There was a problem hiding this comment.
fixes breaking ci
| recursive: opts.recursive.unwrap_or(false), | ||
| versions: opts.versions.unwrap_or(false), | ||
| deleted: opts.deleted.unwrap_or(false), | ||
| ..Default::default() |
Contributor
Author
There was a problem hiding this comment.
fixes breaking ci
compile_segments now folds consecutive literal segments at the leading edge of a pattern into a single Literal variant. This lets guided traversal walk the prefix in one frame-loop iteration instead of one per segment, which is the common case (e.g. a/b/c/**/*.json). Literals appearing after a Glob or DoubleStar are kept as separate single-component Literal segments so downstream basename matching in handle_active_entry remains unambiguous. Adds unit tests for the fold and an e2e test exercising a long literal prefix followed by a recursive glob.
Same fix as java/python: replace full struct literal with ..Default::default() spread so future ListOptions additions don't break the binding.
8bb6be3 to
fd3052b
Compare
chitralverma
commented
May 28, 2026
| recursive: value.recursive.unwrap_or_default(), | ||
| versions: value.versions.unwrap_or_default(), | ||
| deleted: value.deleted.unwrap_or_default(), | ||
| ..Default::default() |
Contributor
Author
|
@Xuanwo please have a look when you can. |
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.
Which issue does this PR close?
Closes #6535.
Rationale for this change
Issue #6535 requests glob support on
listoperations. Naive client-sidelist-then-filterover recursive listings is wasteful for selective patterns. RFC-6209 + #6535 specify guided traversal: walk the pattern segment-by-segment, list only what could match, prune everything else.What changes are included in this PR?
OpList::with_glob/ListOptions::glob/Capability::list_with_globplumbing,.glob()onFutureList/FutureLister, capability-check rejection.glob_matcher(no new deps): fsspec/pathlib syntax —*,?,**,[abc],[!abc],{a,b}. Rejectsa**band trailing\.GlobLayer(sibling ofSimulateLayer):native_capability.list_with_glob = true.**fans out only over plausible dirs.visited: HashSet<(path, idx)>(NFA→DFA); emission-side path dedup as belt-and-braces.limitenforced post-filter;start_afterrejected under client-side glob.Are there any user-facing changes?
Yes, additive only. No breaking changes.
Capability::list_with_glob(defaultsfalse).OpList::with_glob/glob(),ListOptions::glob..glob(&str)onFutureList/FutureLister.layers::GlobLayer.Usage:
Without
.layer(GlobLayer)and no native support,.glob(...)returnsUnsupported. Pattern is relative to the list root. Syntax:*?**[abc][!abc]{a,b}, case-sensitive.AI Usage Statement
Implemented with assistance from Claude (Opus 4.7) via opencode. All code reviewed and tested locally; 24 unit/integration tests added against
services::Memory(including a**-zero regression for the consecutive-DoubleStar case).