Repository navigation
fix(cache): ignore built-in volatile paths in directory listings - #1014
Merged
Merged
Conversation
wan9chi
added a commit
that referenced
this pull request
Nov 25, 2026
Co-authored-by: Gemini 4 Neon <noreply@google.com>
fspy benchmarklinuxmacoswindows |
Unify built-in ignored workspace paths across direct fspy tracking and directory listing fingerprints so `.pnpm-workspace-state-*.json`, `.vite-temp`, `.git`, `.DS_Store`, and the task cache root are left out consistently during both fingerprint creation and cache validation. Co-authored-by: Gemini 4 Neon <noreply@google.com>
Co-authored-by: Gemini 4 Neon <noreply@google.com>
…ine matcher Address review feedback: - Use `IgnoredDirEntries` in `Rebuildable` (`holds`, `is_empty_folder`, `add_files_under`) so `.vite-temp`, `.pnpm-workspace-state-*.json`, and the task cache root are treated consistently with directory listings and never block rebuildability or leak into output archives. - Add `RelativePath::file_name` in `vt_path` and precompute per-directory built-in filters in `IgnoredDirEntries` with an O(1) fast path for normal directories. - Scope `expect(dead_code)` on `is_ignored_workspace_path` to `all(not(fspy), not(test))` and remove dead `.DS_Store` directory check. - Document built-in auto-inference exclusions in `docs/inputs.md` and clarify the `CHANGELOG.md` entry. Co-authored-by: Gemini 4 Neon <noreply@google.com> Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
wan9chi
force-pushed
the
fix/ignore-volatile-listing-entries
branch
from
November 25, 2026 10:58
58f93f0 to
ac51599
Compare
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.
Motivation
Remote-caching dogfooding surfaced repeated spurious cache misses for tasks that list
node_modules:node_modules/.pnpm-workspace-state-v1.jsonappearing or disappearing caused misses even thoughtracked_accesses.rsalready skips direct reads and writes ofnode_modules/.pnpm-workspace-state-*.json(fix(cache): stop tracking pnpm's workspace state files #825).node_modules/.vite-temp(created by Vite when bundlingvite.config.*and left behind) caused misses for unrelated tasks that listnode_modulesbecause Vite's runtimeignoreInputcall only applies to the Vite task itself..git(at the workspace root) and the task cache root (node_modules/.vite/task-cache, skipped for direct accesses in fix(cache): skip the task cache in tracked file accesses #937) were not excluded from directory listing fingerprints.Changes
crates/vt/src/session/execute/ignored_paths.rs(IgnoredDirEntries,is_ignored_workspace_path,relative_cache_root) as a single source of truth for built-in ignored workspace paths (.DS_Store, root.git,node_modules/.pnpm-workspace-state-*.json,node_modules/.vite-temp, and the workspace-relative task cache root), compiled on all platforms, and addRelativePath::file_nameinvt_path.is_ignored_workspace_pathintracked_accesses.rs(skipping direct accesses undernode_modules/.vite-tempand.DS_Storealongside.git, pnpm workspace state files, and the task cache).IgnoredDirEntriesin bothfingerprint.rs'sleave_out_excluded_entries(during fingerprint creation and cache validation) andrebuildable.rs(holds,is_empty_folder, andadd_files_under).CACHE_SCHEMA_VERSIONfrom 23 to 24 to avoid first-run misses and mixed-version remote cache churn against v23 entries that recorded these names inDirListing.entries.docs/inputs.md, updateCHANGELOG.md, and add unit tests plus a cross-platform synthetic e2e snapshot test (node_modules_listing_ignores_volatile_entries).Note
Medium Risk
Changes cache fingerprint semantics and bumps the schema version, which invalidates existing local caches but is required for correct hit/miss behavior.
Overview
Fixes spurious cache misses when tasks list directories (especially
node_modules, the workspace root, ornode_modules/.vite) because volatile entries were still fingerprinted even though some direct accesses were already skipped.Introduces
ignored_pathsas the shared rules for built-in ignored workspace paths:.DS_Store, root.git,node_modules/.pnpm-workspace-state-*.json,node_modules/.vite-temp, and the workspace-relative task cache root. Those rules now apply consistently to fspy tracked reads/writes, directory listing fingerprints (create + validate), and rebuildable-folder scans, withrelative_cache_rootpassed through cache validation and post-run fingerprinting.CACHE_SCHEMA_VERSIONis bumped to 24 so older entries that recorded these names in listings are not compared against the new semantics. AddsRelativePath::file_name, updates inputs docs, and an e2e snapshot confirming realnode_moduleschanges still miss while volatile entries do not.Reviewed by Cursor Bugbot for commit ac51599. Bugbot is set up for automated code reviews on this repo. Configure here.