A negative `input` pattern can't be narrowed, so keeping one folder under `node_modules` tracked takes a sibling-name glob
メンテナーはふだん 1 日以内に返信
まだ誰も着手していません。
評価
- 難易度
- 5/5
- 見積もり時間
- 1週間以上
- 初心者へのやさしさ
- 35/100
- issue の種類
- 機能追加
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- rust
- 領域
- build-system
調査の方向性
Start with crates/vt_glob/src/path.rs and the filtering call sites in crates/vt/src/session/execute/mod.rs and cache_update.rs; then trace explicit glob handling around crates/vt/src/session/execute/glob.rs. Check how exceptions interact with auto-tracked reads and explicit globs, including whether walking can prune exception subtrees. Done means negative patterns can leave matching exception paths eligible without adding files to the cache key by themselves.
索引モデルが issue の本文から書いたものです。
説明
Written by an AI agent (Claude) on behalf of @jasonkuhrt.
Summary
A negative input pattern removes every file it matches, including files the task declares as inputs. The docs say so ("Negative Patterns Apply to Both Modes"), so this is a feature request, not a bug: a way to write "exclude this tree, except this part of it".
The case
Most of our tasks exclude installed dependencies from their inputs, so a reinstall alone doesn't miss the cache. A few still need a file that lives under node_modules: a dependency fingerprint a task declares as its key, TypeScript declarations a test reads through a project reference, a progress file a test runner resumes from. The config that says what we mean drops that file:
cache: {
input: [
{ auto: true },
{ pattern: '!**/node_modules/**', base: 'workspace' },
// declared, and removed by the negative above
{ pattern: 'node_modules/.cache/tool-state/fingerprint/dependencies/hash', base: 'workspace' },
],
}
The declared file never enters the key: the explicit globs are walked with walk.not(negation) (crates/vt/src/session/execute/glob.rs:38-43 at cb0bddc5), and auto-tracked reads go through the same negatives (crates/vt/src/session/execute/cache_update.rs:236). A change to that file can never miss the cache, so the result is a silent false hit, not a wasted run.
What we write instead is a negative that excludes every name except the kept one, character by character. This is one package's copy, keeping node_modules/.vpp-progress visible:
const otherRootDirectories =
'{node_modules?*,[!n]*,n,n[!o]*,no,no[!d]*,nod,nod[!e]*,node,node[!_]*,node_,node_[!m]*,node_m,node_m[!o]*,node_mo,node_mo[!d]*,node_mod,node_mod[!u]*,node_modu,node_modu[!l]*,node_modul,node_modul[!e]*,node_module,node_module[!s]*}';
const otherInstalledTrees =
'{.vpp-progress?*,[!.]*,.[!v]*,.v,.v[!p]*,.vp,.vp[!p]*,.vpp,.vpp[!\\-]*,.vpp-,.vpp-[!p]*,.vpp-p,.vpp-p[!r]*,.vpp-pr,.vpp-pr[!o]*,.vpp-pro,.vpp-pro[!g]*,.vpp-prog,.vpp-prog[!r]*,.vpp-progr,.vpp-progr[!e]*,.vpp-progre,.vpp-progre[!s]*,.vpp-progres,.vpp-progres[!s]*}';
input: [
{ auto: true },
{ pattern: `!${otherRootDirectories}/**/node_modules/**`, base: 'workspace' },
{ pattern: `!${otherRootDirectories}/**/node_modules`, base: 'workspace' },
{ pattern: '!node_modules', base: 'workspace' },
{ pattern: `!node_modules/${otherInstalledTrees}`, base: 'workspace' },
{ pattern: `!node_modules/${otherInstalledTrees}/**`, base: 'workspace' },
]
Our shared config helper builds these from a trie of the kept paths (three trees today). Because the failure is silent, we also check at config load that no negative hides the one input file we generate (a test runner's progress file).
Proposal
Let a negative carry exceptions: paths it leaves alone.
input: [
{ auto: true },
{
pattern: '!**/node_modules/**',
base: 'workspace',
except: ['node_modules/.cache/tool-state/**'],
},
]
An exception only un-excludes. It adds nothing to the key by itself: a file under it counts when the task reads it (auto) or when another pattern declares it, as if the negative weren't there. That matters for us: the compiler tree holds every package's declarations, and a test should key on the ones it reads, not all of them.
It's opt-in, so no existing config changes meaning. The other shape we considered, ordered patterns where a later positive re-includes (as .gitignore's ! does), changes configs like ["!**/*.test.ts", "src/**"], and a positive also adds every file it matches to the key, so it can't express "track what's read under here".
Where it would go
- Auto-tracked reads:
PathGlobSetalready does last-match-wins when a pattern is negated (crates/vt_glob/src/path.rs:35-64). Built from each negative followed by its exceptions as!patterns, the filter atcrates/vt/src/session/execute/mod.rs:178/cache_update.rs:236would keep exception paths as is. - Explicit globs: a negative with exceptions can't go into
walk.not(negation)as is, or wax may prune the subtree an exception sits in. Filtering those files per path with the same set keeps the walk correct, at the cost of walking that subtree.
Related: #504 is the other direction, a negative that fails to exclude a directory listing's entries.
If the shape is agreed, we can send the PR.
- 主要言語
- Rust
- スター
- 480
- フォーク
- 50
- 平均マージ
- 1日 5時間
- マージ済み PR(30日)
- 63
環境構築
このプロジェクトの開発コンテナを、あなたの GitHub アカウントでブラウザ上に起動します。
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
voidzero-dev/vite-task のほかの issue
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
voidzero-dev/vite-task#910 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信
-
Automatic output tracking misses files a task renames into place, so a cache hit restores nothingオープン
難易度 4/5 3〜5日 初心者へのやさしさ 48/100
voidzero-dev/vite-task#908 ·
メンテナーはふだん 1 日以内に返信
-
Export OpenTelemetry client spans for the native remote cache対応中かも @jasonkuhrt が 1 日前に担当しました。 オープン
難易度 4/5 3〜5日 初心者へのやさしさ 25/100
voidzero-dev/vite-task#906 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 56/100
voidzero-dev/vite-task#905 ·
メンテナーはふだん 1 日以内に返信
-
難易度 4/5 3〜5日 初心者へのやさしさ 55/100
voidzero-dev/vite-task#904 ·
メンテナーはふだん 1 日以内に返信
voidzero-dev/vite-task の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
dekobon/big-code-analysis#1729 ·
メンテナーはふだん 1 日以内に返信
-
bug help wanted
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 3 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
akitaonrails/ai-memory#1888 ·
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
peteonrails/voxtype#941 ·
メンテナーはふだん 4 日以内に返信
-
bug priority:medium triage:maintainable
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
ccusage/ccusage#2000 · コメント 3 件 ·
メンテナーはふだん 1 日以内に返信