Repository navigation
fix: start a prefixed relative glob's walk at its literal directory - #1236
Merged
Merged
Conversation
thekevinbot
force-pushed
the
claude/1199-glob-prefix
branch
from
October 2, 2026 18:27
46f730c to
f1f0669
Compare
A './' path-table now resolves like an absolute one: the literal directory chain ahead of the first wildcard becomes the scan root and the rest the glob, with paths reported under that chain. The walker no longer needs an ignore base, so that machinery goes.
The scan root of a prefixed relative table now sits below the index root,
so the parsed module takes the index root as its own argument and runs the
parser there, with {root} naming it, as the on-file hook documents. An
absolute table's parser ran in the scan root before; it runs in the index
root too now.
thekevinbot
force-pushed
the
claude/1199-glob-prefix
branch
from
October 2, 2026 21:06
b30d7bc to
41ac40a
Compare
This was referenced Oct 3, 2026
This was referenced Oct 5, 2026
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.
Fixes #1199
Approach
path_table::resolvenow treats a./table the way it already treated an absolute one: the literal directory chain ahead of the first glob component becomesPathTable::root(andpath_prefix), and the glob is the remainder.'./small/*.md'is therefore root<index>/small, glob*.md, and the walk never lists the index root.pathis reported exactly as before.With the walk starting at the named directory, the scanner no longer needs to know which part of a glob was literal, so
scan_globdrops itsignore_baseargument andpath_table::ignore_baseis removed (the ignore-walker machinery for "the base is itself under an ignored directory" went with it; naming a skipped directory outright still scans it, now by construction).Because the scan root can sit below the index root, the
dirsql_parsedmodule takes the index root as a sixth fixed argument and spawns the parser there, with{root}naming it. Rebased ontomainafter #1219: the parser is still spawned once per table throughon_file::runwith the absolute paths as trailing arguments; only its working directory and{root}change. That is whatdocs/reference/hooks.mddocuments for{root}; absolute path-tables previously got it wrong (the parser ran in the scan root), which this fixes as well.Skip rules and
.gitignoreare judged from the directory the scan starts in. A.gitignoreat or below that directory still applies beneath it (a_scoped_glob_still_honors_gitignore_rules_beneath_its_base). One above it inside the index root does not -- which is also whatmaindoes today: a root*.logrule never applied to'./docs/*'before this change either (verified by probe against themainbinary). That behavior is pinned bya_gitignore_above_the_named_base_does_not_reach_beneath_itrather than changed; the task brief assumed the opposite, so flagging it here.Before / after
Best of 5 back-to-back runs, release build, warm cache.
deep=big/with 500,000 files in 500 subdirectories besidesmall/with 10 files;wide= 200,000 top-level files besidesmall/with 10 files.dirsql "SELECT count(*) FROM './small/*.md'"dirsql "SELECT count(*) FROM './small/'"find ./small -name '*.md'find . -type fdirsql "SELECT count(*) FROM './small/*.md'"dirsql "SELECT count(*) FROM './small/'"find ./small -name '*.md'find . -type fBehavior changes
'./.dirsql'scans the reserved directory (naming it outright, as every other skipped directory already behaves);'./x/.dirsql/**'is pruned.{a,b}now counts as a glob metacharacter when splitting (it always was one to the matcher).--on-fileover an absolute path-table runs the parser in the index root with{root}= the index root.Public Rust API:
scanner::scan_glob(root, glob, ignore, gitignore);path_table::ignore_baseremoved;dirsql_parsed(root, glob, parser, gitignore, cache, index root, ignores...). No SDK-facing change, soPARITY.mdis untouched.Manual run
Built the release CLI and ran it by hand:
SELECT path FROM './docs/*.md'with the index root made unlistable returnsdocs/a.md,docs/b.md;--on-file './parse.sh {root}'over'./docs/*.md'and over the absolute form both runparse.shfrom the index root and substitute it for{root}(themainbinary fails to spawn the parser for the absolute form). The issue'sdeep/widetrees produced the table above.E2E Verification
cargo test --workspace --features cli)packages/python/e2e-attestations/claude-1199-glob-prefix.jsonreceipt written (just e2e-attest-python)packages/ts/e2e-attestations/claude-1199-glob-prefix.jsonreceipt written (just e2e-attest-ts)cargo fmt --all,cargo clippy --workspace --features cli --all-targets -- -D warnings,cargo test --workspace --features cli,cargo bench -p dirsql,uv run maturin develop --release,pnpm build,just e2e-attest-python,just e2e-attest-ts,just preflightcargo benchran clean (there is noscan_globbench);just preflight0 failing pairs.Changelog / Migrations
packages/rust/changelog.d/2026-10-02-glob-prefix-walk.mdpackages/rust/migrations.d/2026-10-02-glob-prefix-walk.md