indexer: walker skip-list matches basename only, silently omitting legit source dirs (stale index) #13
Labels
No labels
code-review
correctness
dos
performance
security
severity/high
severity/low
severity/medium
tech-debt
Kind/Breaking
Kind/Bug
Kind/Documentation
Kind/Enhancement
Kind/Feature
Kind/Security
Kind/Testing
Priority
Critical
Priority
High
Priority
Low
Priority
Medium
Reviewed
Confirmed
Reviewed
Duplicate
Reviewed
Invalid
Reviewed
Won't Fix
Status
Abandoned
Status
Blocked
Status
Need More Info
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
h-dv/code-index#13
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Severity: High · Category: Correctness (missed change / stale index)
filter_entryincrates/indexer/src/walker.rs:101-106matches the skip-list against the entry basename (d.file_name()), not the project-relative path. So a directory legitimately namedbuild,dist,vendor,venv, etc. anywhere in the tree (e.g. a Rust modulesrc/build/mod.rs, or a JS libbuild/dir) is silently dropped — its files are never indexed and no error is logged.Notably the dispatch-time filter
is_in_skip_dir(crates/daemon/src/watcher.rs:929) already documents and implements the project-relative rule (only matching top-of-tree dirs viastrip_prefix(root)), so the walker is the inconsistent half. Thetarget/bin/objentries are marker-gated at the root, but the UNIVERSAL list (build,dist,vendor,venv, …) is not.Fix
root(or matches a path-scoped rule), mirroringis_in_skip_dir'sstrip_prefix(root)component reasoning — or restrict UNIVERSAL_SKIP matching to the project-relative first segment where that's the intent.Impact
Filed from a deep multi-agent code review of the workspace (v0.5.7). Severity/category per the review; file:line refs were accurate at review time — verify against current
master.Closing as not-a-bug after reassessing against current master (independently verified by reading both functions).
The literal observation is true —
walker.rsfilter_entrymatchesUNIVERSAL_SKIPagainst the entry basename (d.file_name()) at any depth. But the premise thatwatcher.rs::is_in_skip_diruses a different (top-of-tree-only) rule is false: it doesabs.strip_prefix(root)thenrel.components().any(|c| skip_dirs.contains(c))— i.e. it matches a skip name at any project-relative component, exactly like the walker. So forroot/src/build/mod.rsboth skip it; for anything inside the tree the two produce identical drop decisions. They can only differ for directories above the root, which the walker never visits.So there is no silent walker↔watcher inconsistency and no divergent stale-index behavior. The any-depth universal skip (
node_modules,dist,build,vendor,venv, …) is deliberate, gitignore-style, and consistent across both halves.(Separate, minor design consideration — not this bug: a project with a legitimate source dir literally named
build/dist/vendorcan't currently un-skip it via.code-index-ignore. If that ever matters, the enhancement would be root-anchoring the universal list or an allow-list override — happy to track that separately if wanted.)