Skip to content

bug: newly-excluded files are never evicted from the graph — the walk skips them, reconcile only evicts deleted files; stale nodes persist until untrack+track #321

Description

@tiendungdev

Env: gortex daemon vv0.61.0+58dc39b, Windows 11 Pro (10.0.26200), one tracked repo (~2.6k files, 124,734 nodes), MCP facade v1.

Repro

  1. A directory of generated markdown (4 files) and a legacy TS helper tree (~250 files) are indexed.
  2. Add both to exclude: in the repo's .gortex.yaml; restart the daemon so the config is actually loaded (see the companion reload issue).
  3. Full workspace_admin {operation:"reindex"} → the walk honors the exclusion: file_count drops 2613 → 2305 (= exactly the newly-excluded files).
  4. But node_count/edge_count are unchanged, and search {operation:"files"} still returns the excluded files. A scoped reindex over just the excluded dirs doesn't evict them either.
  5. Full workspace_admin {operation:"index"} (cold path): same — nodes persist.

Analysis

Reindex "evicts nodes for deleted files". An excluded-but-still-present file is simply never visited by the walk, so it is neither re-parsed nor treated as deleted — its nodes and edges become permanent orphans. The only purge path today is untrack + track (full retrack), which is expensive and risks daemon-side session/notes state.

This is also a steady source of the "graph holds purgeable rows" problem reported in #311: every exclude-list refinement strands another batch of nodes.

Expected

After a config change, files that fall outside the admission set should be evicted on the next walk (present-but-excluded ⇒ same as deleted), or a prune/reindex --evict-excluded escape hatch should exist.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions