Skip to content

Scanner silently omits symlinked markdown files (and other unreadable entries) from the tree #21

Description

@anbturki

Summary

A symlinked .md file inside a workspace never appears in the tree: the scanner walks with follow_links(false) and then requires file_type().is_file(), which is false for symlinks, so the entry is dropped without any indication. The same silent-omission pattern applies to permission-denied subtrees and files over the 4 MiB cap.

Reproduction (release build of f485396, macOS)

  1. In a scanned workspace, run ln -s ~/outside-doc.md research/linked-from-outside.md and create research/visible-control.md in the same batch.
  2. Wait for the watcher rescan: the control appears, the symlink never does (screenshot from the same session as issue Docs under a phase folder named build, dist, target, or venv are permanently invisible in the GUI #20: "5 files", no linked-from-outside entry despite the symlink existing on disk).

Root cause

  • src-tauri/core/src/scan.rs:154: follow_links(false); scan.rs:184-186: non-regular files (including symlinks) skipped.
  • Same class of silent omissions, none of which set the truncated flag or surface anywhere:
    • walker.filter_map(|e| e.ok()) at scan.rs:168 drops permission-denied subtrees wholesale.
    • entry.metadata().ok()? / read_partial(...).ok()? at scan.rs:212, 220 drop unreadable files.
    • Files larger than 4 MiB are skipped (scan.rs:18, 193-197) without being counted or reported. MCP writes are capped at the same limit, so only files written by other tools hit this.

Proposed fix

Follow symlinks to regular files (with a cycle guard, or at minimum resolve and include link targets that are files), and count skipped/unreadable entries so the UI can say "N files skipped" instead of silently presenting a partial tree.

Screenshot

Symlink research/linked-from-outside.md exists on disk but is absent from the tree (control file from the same batch is present):

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions