GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — vp run cache misses for vp check when a gitignored folder is added to the workspace root · Issue #3579 · voidzero-dev/vite-plus

vp run cache misses for vp check when a gitignored folder is added to the workspace root #3579

New issue
Copy link
New issue
Copy link
Todo
Feature
Todo
vp run cache misses for vp check when a gitignored folder is added to the workspace root#3579
Feature
Copy link
Assignees
wan9chi
Labels
- P2: has workaroundAffects specific usage and has a straightforward workaround (priority)enhancementNew feature or requesttriage: unable to fix

Description

@jaenyf
jaenyf
opened on Nov 25, 2026
Issue body actions

Describe the bug

A cached vp check task misses its cache when a new gitignored folder (here coverage/) appears in the workspace root, even though vp check never reads anything in it:

$ vp check ○ cache miss: 'coverage' added in workspace root, executing

vp check lists the workspace root, and automatic file tracking fingerprints that directory listing.
It does not take into account that fmt and lint ignore the entry by themselves because of the .gitignore file.

In a monorepo this happens in every package: each package's vp check lists the workspace root too, so vp test --coverage creating coverage/ at the root makes every package's check run again:

~/packages/core$ vp check ○ cache miss: 'coverage' added in workspace root, executing
~/packages/plugin-native$ vp check ○ cache miss: 'coverage' added in workspace root, executing
...

The only 2 ways around it today are :

  • prevent coverage folder deletion (just empty it) and a run.tasks check entry with { command: "vp check", cache: { input: [{ auto: true }, "!coverage/**"] }} in the root vite.config.ts,
  • or a run.tasks entry with cache.input: [{ auto: true }, { pattern: "!coverage/**", base: "workspace" }] in every package that has a check script, because cache.input can't be set on package.json scripts.

What I expect: a path that vp check ignores does not affect its cache. vp build and vp test already report paths to leave out through cooperative tracking, and vp check could do the same with its ignore patterns (or file tracking could skip gitignored names when fingerprinting a directory listing).

Reproduction

See steps to reproduce

Steps to reproduce

Complete reproduction steps:

vp create vite:monorepo --directory vp-check-cache-repro --no-interactive --package-manager bun
cd vp-check-cache-repro
echo coverage >> .gitignore
vp run ready            # first run
vp run ready            # vp check misses: 'dist' added in 'apps/website'
vp run ready            # 5/5 cache hit
mkdir coverage
vp run ready            # vp check misses: 'coverage' added in workspace root (4/5 hit)

Or, straight to the point:

vp run check            # cache miss (first run)
vp run check            # cache hit
mkdir coverage
vp run check            # cache miss: 'coverage' added in workspace root

System Info

`vp env current`:

Node.js:
  Version    26.13.1
  Source     .node-version
  Bin Path   /[...]/.vite-plus/js_runtime/node/26.13.1/bin/node
  Installed  true
  Mode       managed

Package Manager:
  Name       bun
  Version    1.4.4
  Source     packageManager
  Bin Paths  
    bun      /[...]/.vite-plus/package_manager/bun/1.4.4/bun/bin/bun
    bunx     /[...]/.vite-plus/package_manager/bun/1.4.4/bun/bin/bunx
  Installed  true
  Mode       managed


`vp --version`:

vp v1.8.0

Local vite-plus:
  vite-plus  v1.8.0

Tools:
  vite      v8.3.8
  rolldown  v1.2.19
  vitest    v5.1.1
  oxfmt     v0.79.0
  oxlint    v1.94.0
  tsrs      v7.1.0-beta.tsrs4
  tsdown    v0.23.4

Environment:
  Package manager  bun v1.4.4
  Node.js          v26.13.1 (.node-version)

Used Package Manager

bun

Logs

$ vp run check
$ vp check ○ cache miss: 'coverage' added in workspace root, executing

Validations

  • Read the Contributing Guidelines.
  • Check that there isn't already an issue for the same bug.
  • Confirm this is a Vite+ issue and not an upstream issue (Vite, Vitest, tsdown, Rolldown, or Oxc).
  • The provided reproduction is a minimal reproducible example.

Activity

  1. jaenyf
    added
    pending triage
    on Nov 25, 2026
  2. jaenyf
    added the
    Bug
    issue type on Nov 25, 2026
  3. voidzero-bot commented on Nov 25, 2026

    @voidzero-bot
    voidzero-botBot
    on Nov 25, 2026
    Contributor
    More actions
    • Reproduced: Yes — verbatim (○ cache miss: 'coverage' added in workspace root, executing) on current main in a fresh vp create vite:monorepo project.
    • Exploration: Yes
    • Unit Test: No — triage only reproduced, diagnosed, and verified intent; no code or test changes were made (the fingerprinting logic lives in the upstream vite-task crate, which is a git dependency here).
    • Priority: Priority P2: Has Workaround. This is a false cache miss (performance only — no incorrect cache replays; the strictness intentionally protects against stale hits), it hits a common workflow (cached vp check in any project that produces a gitignored coverage/), and there is a documented, straightforward workaround (cache.input with { auto: true } plus a !coverage/** negative glob), matching the "When To Add Manual Config" guidance in our docs.

    When vp run check caches the check script, the Vite Task runner's syscall-level tracking records the workspace-root directory listing that oxfmt/oxlint perform while scanning. That listing is fingerprinted verbatim (DirListing.entries in crates/vt/src/session/execute/fingerprint.rs in the upstream vite-task crate) with no .gitignore awareness — I confirmed the stored fingerprint in the reproduction's cache DB literally contains coverage as a tracked entry — so the folder's appearance is an input change. vp check never reports its ignored paths through cooperative tracking (ignoreInput); today only vp build and vp test do (e.g. the Vitest cache-path plugin in packages/cli/src/define-config.ts). Verification found this default is deliberate: upstream PR voidzero-dev/vite-task#919 removed blanket entry-skipping from listings because hidden entries can replay stale output, and maintainer-authored upstream issue voidzero-dev/vite-task#992 documents this exact gitignore behavior with an opt-in proposal outstanding.

    I wasn't able to find a fix, but I identified some areas that may be relevant. Two candidate directions, both aligned with the issue's own suggestions: (1) upstream, in vite-task's crates/vt/src/session/execute/fingerprint.rs (create/input_changes/DirListing) — the opt-in gitignore-aware listing mode drafted in vite-task#992; (2) in this repo, having vp check report ignored paths via the cooperative-tracking IPC (vt_client::Client::ignore_input, reachable from execute_check in packages/cli/binding/src/check/mod.rs), mirroring vitePlusVitestCachePathsPlugin — the docs already promise extending cooperative tracking "to more first-party tools in the future". Until then, the negative-glob workaround the reporter found remains the sanctioned path.

    Full Triage Report

    Triage Report — Issue #3579

    Issue summary

    • Title: vp run cache misses for vp check when a gitignored folder is added to the workspace root
    • Type: Bug
    • Reporter: @jaenyf, Vite+ v1.8.0, bun 1.4.4, Node 26.13.1
    • Expected: A path vp check ignores (gitignored, e.g. coverage/) must not affect its task cache; the second vp run check after mkdir coverage should stay a cache hit.
    • Actual: The automatic input tracking for the check script (vp check) fingerprints the workspace-root directory listing without honoring .gitignore, so a new gitignored folder causes ○ cache miss: 'coverage' added in workspace root, executing.

    Environment

    • Checkout: /home/runner/work/vite-plus/vite-plus (branch triagebot/fix-3579, current main)
    • vp v1.8.0 installed from this checkout, on PATH
    • Reproduction project used vite-plus 1.8.0 packed from the checkout via the local npm registry
    • Node.js v24.22.3, pnpm v12.11.2, Linux x86_64 (Ubuntu, kernel 7.0.0-1020-azure)

    Reproduction path

    /tmp/vite-plus-triage/gh-3579/repro/vp-check-cache-repro

    1. Scaffolded a monorepo through the local registry (matches the report, pnpm instead of bun — package manager is irrelevant to the cache-fingerprint bug):

      node "$VITE_PLUS_REPO/packages/tools/src/local-npm-registry.ts" --pack -- \
        vp create vite:monorepo --directory vp-check-cache-repro --no-interactive --package-manager pnpm
      

      (exit 0; scaffolded with apps/website and packages/utils, root script ready, package script check: vp check)

    2. git init, echo coverage >> .gitignore, commit (verified with git check-ignore coverage).

    3. Added a root "check": "vp check" script (the template's root has no check script; the report's project does) to mirror vp run check from the report.

    Commands and results

    Attempt 1 (abandoned): minimal hand-made project with pnpm link to the checkout

    vp check linted files reachable through the symlink into the checkout's node_modules (thousands of oxlint findings), exit 1 — noise caused by linking, not the reported bug. Switched to the local-registry scaffold above.

    Attempt 2 (successful): root check script — exact reported trigger

    $ vp run check        # first run — executes, populates cache
    $ vp run check        # "vp run: cache hit, 830ms saved."
    $ mkdir coverage      # 'coverage' is in .gitignore
    $ vp run check
    $ vp check ○ cache miss: 'coverage' added in workspace root, executing   <-- reported behavior
    

    Exit code 0 in all runs; the third run is a cache miss with the exact message from the issue log.

    Additional data points:

    • With a file inside the gitignored folder (touch coverage/lcov.info, i.e. what vp test --coverage produces): ○ cache miss: 'lcov.info' added in 'coverage', executing.
    • Removing a file from coverage/ also misses: ○ cache miss: 'foo.txt' removed from 'coverage', confirming file tracking reaches inside the gitignored directory.
    • Control: without touching coverage/, consecutive runs stay cache hits (vp run: cache hit, 856ms saved.), so the miss is caused solely by the gitignored directory appearing, not by flakiness.
    • Per-package script vp run utils#check (runs vp check in packages/utils) stayed a cache hit when coverage/ was created at the workspace root in this environment, unlike the report's monorepo claim that every package's check misses. The root-level vp check miss — the core of the report — reproduces verbatim.

    Result

    Reproduced on the current checkout (vp v1.8.0 from main): creating a gitignored folder in the workspace root invalidates the cached vp check run with ○ cache miss: 'coverage' added in workspace root, executing, exactly as reported.

    Observations for diagnosis (no fix proposed)

    • The cache miss comes from automatic input tracking of the check script: the fingerprint includes the workspace-root directory listing and even the contents of the gitignored coverage/ directory, although oxfmt/oxlint ignore it via .gitignore.
    • The miss message wording matches the report verbatim, including the 'coverage' added in workspace root phrasing for the empty-directory case and '<file>' added in 'coverage' for content changes.
    • The per-package vp check script did not miss in this environment; the difference vs. the report may depend on how each package's auto-tracking resolves its roots (the report says each package's check also lists the workspace root).
    • Direct vp check (built-in, not through vp run) shows no cache messages and always executes, so the bug is specific to vp run script caching/auto input tracking.

    Diagnosis

    Layer

    The cache-fingerprinting logic lives in Vite Task (vt), which is a git dependency of this repo (vt = { git = "https://github.com/voidzero-dev/vite-task.git", rev = "6a23096aa2f04eb59225c6467b15c2965ee6ae33" }, Cargo.toml:318); source inspected at ~/.cargo/git/checkouts/vite-task-b9d2f8c2bec84a8f/6a23096. The missing piece on the Vite+ side is in the vp check implementation, packages/cli/binding/src/check/mod.rs.

    Root cause chain

    1. Who reads the directory: vp run check caches the check script, which runs the built-in vp check — execute_check in packages/cli/binding/src/check/mod.rs:26 spawns the bundled oxfmt/oxlint (via resolve_and_capture_output, lines 110/211/298) to scan the project. Scanning the workspace root performs a directory listing (getdents), which fspy (syscall-level tracking attached to the task's process tree) records as a path read with read_dir_entries: true.

    2. Read filtering: observe_fspy (crates/vt/src/session/execute/cache_update.rs:225) filters recorded reads only by (a) user-configured input negative globs and (b) tool-reported ignoreInput paths (crates/vt/src/session/execute/cache_update.rs:87-93). vp check never reports ignoreInput — the only reporting site in this repo is the Vitest cache-path plugin (packages/cli/src/define-config.ts:828, vitePlusVitestCachePathsPlugin, used by vp test/vp build). So the workspace-root listing becomes an inferred input.

    3. Fingerprinting ignores .gitignore: PostRunFingerprint::create (crates/vt/src/session/execute/fingerprint.rs:149) fingerprints the listing via process_directory_unix (:631) / process_directory (:594), where should_ignore_entry (:535) skips only ., .., and .DS_Store. Inside create, listing entries are removed only for: rebuildable outputs (rebuildable.is_rebuildable_entry), tool-reported ignored inputs (ignored_input_names, :501), and input negative globs (leave_out_excluded_entries, :517). No vt crate consults .gitignore anywhere (verified by grep across the checkout). The gitignored coverage — like the also-gitignored node_modules — is therefore stored in DirListing.entries (fingerprint.rs:98).

      Verified directly: the reproduction's cache DB (node_modules/.vite/task-cache/v23/cache.db, table cache_entries) holds the root check task's fingerprint with a workspace-root DirListing whose entries are AGENTS.md, README.md, apps, coverage (Dir), node_modules, package.json, packages, ... — coverage stored as a plain tracked entry.

    4. Validation misses: on the next run, PostRunFingerprint::input_changes (fingerprint.rs:218) re-fingerprints the listing; determine_folder_change_kinds (:446) diffs the entry maps, finds coverage present but not stored → Change::File { Added, "coverage" } → CacheStatus::Miss(CacheMiss::Changed) → format_input_change_str in crates/vt/src/session/cache/display.rs:119 renders the exact observed message: ○ cache miss: 'coverage' added in workspace root, executing. Files inside the ignored dir show up the same way ('lcov.info' added in 'coverage'), because listing the folder and fingerprinting its contents are equally unfiltered.

    Why it happens: the auto-input-tracking design relies on cooperative reports (ignoreInput, vt_client::Client::ignore_input, exported as ignoreInput on @voidzero-dev/vite-task-client) or user negative globs to exclude irrelevant paths, rather than modeling each tool's semantics. oxfmt/oxlint silently skip gitignored entries, but vp check never tells the runner about them — precisely what the issue reports.

    Suggested fix approaches (both suggested by the issue; not applied)

    1. Vite+ repo: have vp check report the paths it ignores via cooperative tracking — e.g. in execute_check (or the fmt/lint spawn layer). When invoked from vp run, the binding is a nested process under the runner and can reach the IPC channel (vt_client::Client::from_envs + ignore_input; the binding already depends on vt crates, packages/cli/binding/Cargo.toml:35-43). Requires enumerating gitignore-respecting exclusions (gitignore semantics exist in-repo, e.g. vp_migration::is_directory_gitignored), or asking the tools to report ignores.
    2. Upstream vt repo: consult .gitignore when fingerprinting/validating a directory listing (in create and input_changes), moving ignored names out of DirListing.entries (a set like ignored_entries whose presence/absence doesn't matter). This is a change in the upstream vite-task repository (a git dependency here — no patch to a vendored clone).

    Edge cases for a fix

    • Negation patterns (!) and nested .gitignore files; non-git projects (no repo — must fall back to current behavior).
    • node_modules is also gitignored and also sits in the stored listing; excluding it from listings appears sound (actual file reads are tracked individually by fspy) but needs validation.
    • Tool-level ignorePatterns (oxlint config) beyond .gitignore are out of scope for the reporter's expectation.
    • Whether per-package vp check fingerprints the workspace root is project/tool dependent: in this repro utils#check did not record a root listing (no miss), while the reporter's packages did — execute_check passes -c <root config> to the tools when run from a package (packages/cli/binding/src/check/mod.rs:54-70), which can make them list the root.

    Regression evidence

    None found — this is not a regression but a gap in the cooperative-tracking rollout: the DirListing.ignored_entries machinery was built for tool-reported ignoreInput (used by the Vitest cache-path plugin for Vitest 5's on-disk caches, packages/cli/src/define-config.ts:795-855), and vp check simply never reports anything.

    Diagnosis confidence

    High — the failing logic is proven by code inspection and by direct inspection of the stored fingerprint in the reproduction's cache DB (workspace-root DirListing containing coverage), and matches the observed verbatim miss message.


    Verification

    Claim

    • Observed: a cached vp check script misses its cache when a gitignored folder (coverage/) appears in the workspace root: ○ cache miss: 'coverage' added in workspace root, executing (reproduced verbatim; see above).
    • Reporter expects: a path vp check ignores (via .gitignore) must not affect its cache.

    Research

    Vite+ docs (this repo)

    • docs/guide/automatic-data-tracking.md documents directory listings as tracked file-system inputs: "Vite Task records ... directories the command scanned. Subsequent runs re-run the task when one of those tracked inputs changes."
    • The Limitations section states file-system tracking "cannot always tell which tracked paths are stable inputs, generated outputs, or tool-managed cache paths that should not become inputs or outputs. Use Override Inputs And Outputs when file system tracking includes files that should not affect the cache" — and the When To Add Manual Config table prescribes exactly the reporter's workaround (input: [{ auto: true }, '!dist/**']).
    • The Cooperative Tracking section says support exists for vp build and vp test (e.g. the Vitest cache-path plugin, packages/cli/src/define-config.ts:828) and "It will extend this support to more first-party tools in the future." — i.e. vp check not reporting ignores is a documented, known gap, slated for extension, not an accidental behavior.

    Upstream Vite Task (the crate that owns the fingerprinting)

    • PR fix(cache): stop skipping dist in directory listings vite-task#919 (merged) — "fix(cache): stop skipping dist in directory listings" — removed a blanket skip of dist entries from listing fingerprints because hiding an entry can replay stale output ("a dist folder appearing in a folder the task listed goes unseen, and the next run replays stale output: oxlint, for example, passes from the cache after a dist folder with lint errors appears"). Since then listings deliberately skip only ., .., .DS_Store (fingerprint.rs:535 should_ignore_entry), with e2e snapshots asserting the miss wording (crates/vt_bin/tests/e2e_snapshots/fixtures/cache_miss_reasons/snapshots/inferred_input_changes.md:58) and asserting the sanctioned exclusion path (fixtures/negative_glob_hides_listing_entry/).
    • PR feat(cache): let input negatives keep entries out of directory listings vite-task#941 (merged) — "feat(cache): let input negatives keep entries out of directory listings" — established the intended exclusion mechanism: negative input globs (what the reporter uses as a workaround).
    • Issue Gitignored entries count in directory listings, so a used checkout misses the entries a fresh checkout recorded vite-task#992 (OPEN, filed 2026-11-12 on behalf of maintainer @jasonkuhrt) — "Gitignored entries count in directory listings, so a used checkout misses the entries a fresh checkout recorded" — documents this exact behavior and root cause (gitignored entries recorded in DirListing.entries; no gitignore awareness in vt). It proposes an opt-in per-task setting (listings: { gitIgnored: false }) where ignored entries leave listings, reads beneath them still invalidate, and the .gitignore files themselves become inputs — explicitly opt-in "because of Extension Pack for IntelliJ #919", since a tool that would read an ignored entry must not get a stale replay. So the maintainers treat the current default as deliberate, with a designed refinement outstanding.

    Prior Vite+ history

    • Issue Fresh vp create monorepo requires 2–3 vp run ready invocations before cache stabilizes #1638 (closed by PR ci: warm-up monorepo cache test under npm #1649) reported a near-identical false miss ('node_modules' added in 'packages/utils' invalidating a cached root vp check). It was triaged bug for the onboarding UX (fresh monorepo needing 2–3 vp run ready runs), but was fixed only by a CI warm-up; PR ci: warm-up monorepo cache test under npm #1649's description calls the proper fix (ignoring node_modules in directory fingerprints) a possible follow-up that has not landed. The strict listing semantics themselves were never changed.

    Verdict

    Intended-behavior (with a maintainer-acknowledged enhancement outstanding).

    The observed miss is the deliberate safe-by-construction default chosen in vite-task PR #919: every entry of a listed directory counts, because skipping entries that a tool might read can replay stale output. The sanctioned exclusion mechanism (negative input globs, PR #941) and cooperative ignoreInput reports exist and are documented in this repo; vp check simply does not report gitignored paths yet, which the docs describe as future work ("will extend this support to more first-party tools"). Upstream issue vite-task#992 — same root cause, maintainer-authored — frames the gitignore-aware variant as an opt-in proposal precisely because the strict default is intentional. Nothing in docs, tests, or commits says a gitignored entry must not invalidate the cache; the current behavior contradicts no documented intent.

    The reporter's underlying expectation is nonetheless endorsed upstream as the direction of travel: an opt-in gitignore-aware listing mode (vite-task#992) and/or extending cooperative tracking to vp check would remove these false misses without weakening the stale-replay guarantees. That is an enhancement to track against vite-task#992, not a defect in the current design.

    Verification confidence

    High — direct evidence: merged upstream PR #919 (rationale + e2e tests asserting misses on appearing entries), merged PR #941 (sanctioned exclusion mechanism), open maintainer-authored upstream issue #992 (same root cause, opt-in proposal), and Vite+ docs documenting the limitation and the workaround.

    This report was made by an LLM. The analysis may be wrong, and the potential fix might not work, but is intended as a starting point for exploring the issue.

  4. voidzero-bot
    added
    triage: unable to fix
    - P2: has workaroundAffects specific usage and has a straightforward workaround (priority)
    on Nov 25, 2026
  5. jong-kyung
    assigned
    jong-kyung
    and
    wan9chi
    and unassigned
    jong-kyung
    on Nov 25, 2026
  6. jong-kyung
    changed the issue type from
    Bug
    to
    Feature
    on Nov 25, 2026
  7. jong-kyung
    added
    enhancementNew feature or request
    and removed
    pending triage
    on Nov 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

  • @wan9chi
    wan9chi

Labels

- P2: has workaroundAffects specific usage and has a straightforward workaround (priority)enhancementNew feature or requesttriage: unable to fix

Type

Feature

Fields

Priority

None yet

Start date

None yet

Target date

None yet

Effort

None yet

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    You are visitor 01402775 — GeezerVison does not store the pages you look up.
    Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.