fix: resolve sources inside raw/sources dotfolders#547
Merged
nashsu merged 1 commit intoJul 15, 2026
Conversation
The resolver path index was built from a single full-project scan with `includeHidden` off, so dot-prefixed folders (`.claude`, `.codex`) under `raw/sources` never entered the index. Any `sources:` entry backed by a file in such a folder — e.g. `.claude/projects/.../MEMORY.md` — resolved to null and rendered as a "Source not found" card in the frontmatter panel, even though the file existed on disk. Rescan `raw/sources` with `includeHidden` (best-effort) and merge it into the index, mirroring the existing dotfolder handling in the Raw Sources tree and chat file tools. Guard the index builder against duplicate paths so the overlapping scans don't inflate the `filesByName` buckets.
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.
Problem
When opening a Knowledge-tab entity,
sources:entries that point at a file inside a dot-prefixed folder underraw/sources(e.g..claude,.codex) render as a dashed "Source not found" card in the frontmatter panel — even though the file exists on disk and its non-hidden siblings resolve fine.Concrete repro: an entity with
The⚠️ ; the sibling under a normal folder resolves.
.claude/...card showsRoot cause
The resolver path index (
projectPathIndex) is built inrefreshProjectFileTreefrom a single full-projectlistDirectory(projectRoot)scan, which defaults toincludeHidden: false.entry_is_visible(fs.rs) then drops every dot-prefixed entry at each level, soraw/sources/.claude/**never enters the index.resolveSourceNamelooks the path up in that index, misses, and theSourceCardrenders as unresolved.This is the same class of bug already fixed for the Raw Sources tree and chat file tools (
c70da6a,a126829), which scanraw/sourceswithincludeHidden: true. The resolver index was simply never given the same treatment.Fix
refreshProjectFileTree, additionally rescanraw/sourceswithincludeHidden: true(best-effort — a project without sources still gets a full index) and merge it into the tree passed to the resolver index. The full-project scan staysincludeHidden: false, so internal dotfolders (.git,.llm-wiki) are still kept out of the index.buildProjectPathIndexFromTreeagainst duplicate paths so the overlapping scans don't inflate thefilesByNamebuckets.related:references live underwiki/(never hidden) and are unaffected.Tests
project-file-tree-refresh.test.ts: new test asserting araw/sources/.claude/...file lands in the index; updated the existing call-signature expectations for the added hidden scan.wiki-page-resolver.test.ts: dedup test for merged overlapping trees, and a resolver test using the real.claude/projects/.../MEMORY.mdref shape.All existing tests pass;
tscclean.