Repository navigation
Conversation
reindexCollection (store.ts, used by `qmd update`) and indexFiles (cli/qmd.ts, used by `qmd index`) both glob with fast-glob's `dot: false` and then apply a second filter that drops any path containing a segment starting with ".". This is correct for `.git`/`.venv`/`.cache`-style directories, which can be huge and should never be walked, but it also silently drops directories like `.claude/` that hold real, intentionally committed project documentation (e.g. CLAUDE.md) meant to be searchable. Rather than a compiled-in allow-list, this follows the same architecture already used for `update` and `includeByDefault`: a per-collection YAML field (`~/.config/qmd/index.yml`), settable via a `qmd collection` subcommand backed by `updateCollectionSettings()`, read back at index time via `getCollectionFromYaml(...)` and threaded through the same options bag `ignorePatterns` already uses. qmd collection include-dot-dirs <name> [dir ...] # e.g. `claude` qmd collection include-dot-dirs <name> # clear it New `Collection.includeDotDirs?: string[]` field (collections.ts). Defaults to unset/empty for every collection — hidden directories stay excluded exactly as before unless a collection explicitly opts in. `qmd collection show`/`list` now display it next to `Ignore`. `globCollectionFiles()` (store.ts, shared by both `reindexCollection` and `indexFiles`) takes `includeDotDirs` as a parameter instead of reading a hardcoded module constant. The main crawl (`dot: false`) is unchanged — `.git`/`.venv`/`.cache` exclusion and crawl performance are unaffected. For each name in `includeDotDirs` it runs one additional narrowly-scoped glob using an explicit `.<name>` path segment — explicit dot segments in a glob pattern always match regardless of the `dot` option, so this doesn't touch the main crawl's traversal behavior at all. The post-filter still drops any other hidden path, so only the collection's own configured names are ever included. Regression tests in test/store.test.ts cover both sides of the config: a collection with `includeDotDirs: ["claude"]` set (via the same YAML path `qmd update` reads) indexes `.claude/` at the root and nested, while `.venv/`/`.git/` stay excluded; a collection with no `includeDotDirs` configured — the default for every existing collection — still excludes `.claude/` entirely.
Preserve original masks, validate literal directory names, and retain per-collection opt-in through SDK updates and SQLite reopen. Document opt-in for CLI and MCP clients. Detected-By: V3b
Keep addCollection limited to its supported fields when a JavaScript caller passes a wider object. Detected-By: V3b
Author
|
note(non-blocking): Copilot recommends approval of the final revision. Copilot reviewed Upstream CI and Nix require maintainer workflow approval. Local Bun retains two SQLite heap-budget failures reproduced on unmodified upstream. |
lanej
marked this pull request as ready for review
October 29, 2026 20:14
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.
Allow each collection to opt into hidden instruction directories such as
.claude/and.agents/, so their documents become searchable while other hidden directories remain excluded. Configure names throughqmd collection include-dot-dirsor the SDK'sincludeDotDirs; the setting persists in SQLite for SDK updates and DB-only reopen.Run
qmd updateafter enabling or clearing the setting. Collection-relative masks, ignore patterns, built-in exclusions, and hidden-file exclusion continue to apply.Verification gap: Local Bun runs retain pre-existing SQLite heap-budget failures reproduced on unmodified upstream.