Skip to content

feat(run): check every input with vp run -v - #963

Merged
wan9chi merged 1 commit into
claude/dry-run-03-every-key-changefrom
claude/dry-run-05-verbose-every-input
Nov 9, 2026
Merged

wan9chi merged 1 commit into
claude/dry-run-03-every-key-changefrom
claude/dry-run-05-verbose-every-input

Conversation

@wan9chi

@wan9chi wan9chi commented Nov 7, 2026 •

Copy link
Copy Markdown
Member

Motivation

The file check stops at the first changed file, so 'src/a.ts' modified doesn't say whether reverting that file is enough. The dry-run RFC has -v check every input. With it, the detailed summary lists every change: in dry runs, in real runs, and in --last-details afterwards.

Changes

Without -v, nothing changes. With -v:

$ vp run --dry-run -v read
…
  [1] app#read: $ vtt print-file a.txt b.txt c.txt
      → Cache miss: 'a.txt' modified
                    'b.txt' modified             ← new with -v
                    'c.txt' modified             ← new with -v
  • A FileCheck, first file or all, follows -v from the session to the cache lookup.
  • The cache.input comparison and the search of the files the task read collect every change instead of stopping. The search stays parallel and unordered. A miss sorts its changes, so the output is stable.
  • An input that can't be checked fails the lookup only when nothing else changed, the rule the tracked-env check already follows. Each change is its own result, so a folder entry whose name isn't a valid path doesn't hide the folder's other changes.
  • A listed folder reports every entry added or removed.
  • When the command, config or a cache.env var changed, only those changes are listed, as before: there's no cached run with the new ones to compare the files with. The RFC's -v section now says so, and drops its real-run example, which listed a file next to the env change.

Cost: with -v, a miss hashes every input instead of stopping at the first changed file.

🤖 Generated with Claude Code


Note

Medium Risk
Touches core cache validation and miss reporting on every lookup; behavior change is gated on -v but verbose runs do more filesystem work per miss.

Overview
vp run -v now drives a FileCheck mode through cache lookup: default runs still stop at the first changed input file; with -v, validation walks all explicit glob inputs and inferred/folder inputs and reports every file difference in stable path order.

Cache miss diagnostics use input_changes and multi-entry folder diff logic instead of first_input_change. Partial check failures (e.g. invalid folder entry names) no longer hide other listed changes when something already differs. CHANGELOG, the dry-run RFC, CLI help, and an e2e snapshot fixture document and lock in the new verbose behavior for real runs, --dry-run, and --last-details.

Reviewed by Cursor Bugbot for commit 02daff6. Bugbot is set up for automated code reviews on this repo. Configure here.

@github-actions

github-actions Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

fspy benchmark

linux

dynamic/launch             change  +0.66%  [ -6.16% ..  +9.26%]  overhead   +57.83%
dynamic/access             change  +1.58%  [ -5.15% ..  +8.04%]  overhead   +21.75%
dynamic/access-relative    change  +0.82%  [ -3.84% ..  +4.45%]  overhead   +72.65%
dynamic/access-contended   change  -0.34%  [-10.85% ..  +4.65%]  overhead   +39.50%
static/launch              change  -0.18%  [ -5.50% ..  +5.15%]  overhead  +195.35%
static/access              change  +0.65%  [-10.60% .. +11.49%]  overhead +1472.11%
static/access-relative     change  -1.69%  [-15.32% .. +10.10%]  overhead +1893.71%
static/access-contended    change  -4.29%  [-11.90% ..  +2.19%]  overhead +1622.39%

macos

dynamic/launch             change  -0.33%  [ -2.56% ..  +2.59%]  overhead  +225.61%
dynamic/access             change  +0.00%  [ -2.71% ..  +1.97%]  overhead    +3.07%
dynamic/access-relative    change  -0.72%  [ -3.12% ..  +2.08%]  overhead  +247.39%
dynamic/access-contended   change  +0.74%  [ -1.78% ..  +3.15%]  overhead    +3.67%

windows

dynamic/launch             change  +0.94%  [ -7.72% ..  +8.18%]  overhead   +25.64%
dynamic/access             change  +0.00%  [ -1.20% ..  +0.82%]  overhead    +1.84%
dynamic/access-relative    change  -0.18%  [ -6.20% ..  +1.68%]  overhead    +2.43%
dynamic/access-contended   change  -0.20%  [ -7.90% ..  +1.86%]  overhead    +1.97%

@wan9chi
wan9chi force-pushed the claude/dry-run-05-verbose-every-input branch from ef1446d to 4e3df9d Compare November 7, 2026 11:50
@wan9chi
wan9chi force-pushed the claude/dry-run-05-verbose-every-input branch from 4e3df9d to 8a5a090 Compare November 7, 2026 11:59
@wan9chi
wan9chi removed this pull request from stack #970 November 7, 2026 14:54
@wan9chi
wan9chi changed the base branch from claude/dry-run-04-fallback-baseline to claude/dry-run-03-every-key-change November 7, 2026 14:54
@wan9chi
wan9chi force-pushed the claude/dry-run-05-verbose-every-input branch from 8a5a090 to 96a9150 Compare November 7, 2026 14:54
@wan9chi
wan9chi added this pull request to stack #973 November 7, 2026 14:55
@wan9chi
wan9chi force-pushed the claude/dry-run-05-verbose-every-input branch from 96a9150 to 5a94ca9 Compare November 7, 2026 15:07
@wan9chi
wan9chi removed this pull request from stack #973 November 7, 2026 17:18
@wan9chi
wan9chi force-pushed the claude/dry-run-05-verbose-every-input branch from 5a94ca9 to 9df6ce3 Compare November 7, 2026 17:18
@wan9chi
wan9chi added this pull request to stack #975 November 7, 2026 17:19
@wan9chi
wan9chi force-pushed the claude/dry-run-05-verbose-every-input branch from 9df6ce3 to f38a1dc Compare November 7, 2026 18:38
The file check stops at the first changed file, so `'src/a.ts'
modified` doesn't say whether reverting it is enough. With `-v`, every
input of a miss is checked and the detailed summary lists every change,
in dry runs too, and `--last-details` shows them afterwards.

- A `FileCheck` (first file or all) follows `-v` from the session to
  the cache lookup.
- The `cache.input` comparison and the search of the files the task
  read collect every change instead of stopping. The search stays
  parallel and unordered; a miss sorts its changes, so the output is
  stable.
- An input that can't be checked fails the lookup only when nothing else
  changed, by the rule the tracked-env check already follows. Each change
  is its own result, so a folder entry whose name isn't a valid path
  doesn't hide the folder's other changes.
- A listed folder reports every entry added or removed.

With `-v`, a miss hashes every input instead of stopping at the first
changed file. Without it, nothing changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@wan9chi
wan9chi force-pushed the claude/dry-run-05-verbose-every-input branch from f38a1dc to 02daff6 Compare November 9, 2026 10:44
@wan9chi
wan9chi merged commit 200dedc into main Nov 9, 2026
23 checks passed
@wan9chi
wan9chi deleted the claude/dry-run-05-verbose-every-input branch November 9, 2026 11:29
wan9chi added a commit that referenced this pull request Nov 9, 2026
## Motivation

Before starting a long run, there's no way to see which tasks would come
from the cache and which would run, or why one would miss, without
running them (#791, voidzero-dev/vite-plus#2848). [The dry-run
RFC](https://github.com/voidzero-dev/vite-task/blob/main/docs/rfcs/dry-run.md)
specifies `vp run --dry-run` for this. This is the first PR of the stack
that implements it: the text output. The PRs above it add every change
of a miss (#961), `-v` (#963), `--json` (#966, #967), `unknown` (#968)
and `-vv` (#969).

This supersedes #792 by @lifeiscontent, whose write-free lookup and test
scenario it builds on, so it credits them as co-author.

Closes #791.

## Changes

`vp run --dry-run` plans the run and checks the cache as a real run
does, the remote cache included, then prints each command's line and the
summary. It runs nothing and records nothing. The cache is opened as in
a real run, but no entry is written, a hit's outputs aren't downloaded
or restored, and `last-summary.json` isn't written, so `--last-details`
still shows the last real run.

```
$ vp run --dry-run test
$ vtt print-file src/a.txt ◉ cache hit
$ vtt print tested

---
vp run: 1/2 cache hit (50%), nothing was run.
```

- A dry run goes through the real run's lookup and spawn path, which
skips each step that would write or run: recording a local hit,
downloading a remote hit, replaying a hit, and spawning the command.
- Each line is a real run's, without `, executing` or `, replaying`, and
with no blank line between commands. `--log` is ignored, since it only
shapes task output: `--dry-run` and `--log` move from `RunFlags`, which
selects tasks, to `RunCommand`, and resolve to a `RunMode` of `Real {
log }` or `Dry`, so a dry run can't carry a log mode.
- The summary follows a real run's rules, with "nothing was run" in
place of the successful count and the time saved, and without the
`--last-details` hint. The detailed summary (`-v`) has no ✓ or exit
codes.

  Real run, unchanged:

  ```
vp run: 1/2 cache hit (50%), 2/2 successful. (Run `vp run
--last-details` for full details)
          │ │            │     │ │
          │ │            │     │ └─ tasks
          │ │            │     └─ tasks that succeeded
          │ │            └─ cache hit rate
          │ └─ tasks
          └─ cache hits
  ```

  Dry run:

  ```
  vp run: 1/2 cache hit (50%), nothing was run.
          │ │            │
          │ │            └─ cache hit rate
          │ └─ tasks
          └─ cache hits
  ```

- A cache lookup error is printed under its command and stops the dry
run, as it stops a real run, and both exit 1. Real runs stopped but
exited 0 before, since the summary only counted tasks that started; a
task that fails before it starts now fails the run. Otherwise a dry run
exits 0 once planning succeeds.
- A nested `vp run --dry-run` isn't inlined. It's started as a process
that prints its own dry run, so an enclosing dry run doesn't start it.
- Without a task, `--dry-run` is an error, like `vp run -v`. After the
task name, it's passed to the task, like any other flag.
- RFC: the summary and cache-error rules are written down, and the
sentence about the first changed file being the first in path order is
removed. Without `-v`, the file check stops at whichever changed file it
finds first.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches cache lookup, remote fetch, spawn, and exit-code paths across
the runner; mistakes could skip real execution side effects or
mis-report failures, though behavior is gated on `RunKind::Dry`.
> 
> **Overview**
> Adds **`vp run --dry-run`**, which plans the task graph and performs
full cache lookups (including remote) but **does not** spawn processes,
replay outputs, download remote archives, write cache entries, or
persist `last-summary.json`.
> 
> The CLI introduces **`RunMode`/`RunKind`**: `--dry-run` and `--log`
move onto `RunCommand` (dry runs always use interleaved output).
Execution and cache layers thread `RunKind` through lookup, spawn, and
reporters so dry runs short-circuit after reporting cache status
(`WouldSpawn` / `DryRun` not-updated reasons).
> 
> **Output and summary** match a real run’s command lines and cache
indicators, but omit `, executing` / `, replaying`, skip extra blank
lines, use **“nothing was run”** instead of success/saved time, and omit
the `--last-details` hint. **`-v`** detailed summaries drop exit icons
and saved-time wording for hits.
> 
> **Bugfix:** runs now **exit 1** when a task’s cache cannot be checked
(e.g. DB unreadable), including failures before `start()`; nested `vp
run --dry-run` is not inlined. Changelog and dry-run RFC/e2e snapshots
document the behavior.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
3010605. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Aaron Reisman <aaron@lifeiscontent.net>
Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
wan9chi added a commit that referenced this pull request Nov 9, 2026
…961)

## Motivation

A cache miss reports one reason. When an env var a tool tracks and a
file changed together, the summary named only the file. When a task's
`input` and `output` settings changed together, it named only `input`.
To know whether reverting a change is enough for a hit, you need every
change. The dry-run RFC lists command, config and env changes in full,
and `--dry-run --json` (#966) will report them.

## Changes

A miss is now `CacheMiss::Changed(Comparison { changes })`. It lists
every change to:
- the command: program, args, cwd;
- the task's cache settings: `input`, `output`, `untrackedEnv`;
- its envs: `cache.env`, tracked envs and tracked queries.

Files still stop at the first change the check finds, until `-v` changes
that in #963. Changes are sorted by kind, then by name or path.
Duplicates, such as an env that two tracked queries match, are dropped.

- The inline reason is the first change. It changes only where the kind
order differs from the old priority, such as a program change alongside
an env change. Several env changes still read as `envs 'A', 'B'
changed`.
- The detailed summary prints one change per line, aligned under the
first, instead of joining spawn changes with `; `. An `output` change
now reads `output configuration changed` there, not `input configuration
changed`.

  Before:

  ```
    [1] app#test: $ vtt print-file test.txt ✓
        → Cache miss: input configuration changed
  ```

  After:

  ```
    [1] app#test: $ vtt print-file test.txt ✓
        → Cache miss: input configuration changed
                      output configuration changed
  ```

- The saved summary holds the list, so `vp run --last-details` gives a
`last-summary.json` from an earlier version the existing "different
version" message.
- Each tracked env and query is compared on its own. If one can't be
compared, such as a value that isn't UTF-8, another's change still makes
it a miss, as before, rather than a failed lookup.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches core cache validation and persisted summary format; behavior
is clearer but miss detection and reporting paths changed across local
and remote lookups.
> 
> **Overview**
> **Cache miss reporting** now collects every difference between the
current run and a stored entry, not only the first failure. Misses use
`CacheMiss::Changed` with a sorted, deduplicated `Vec<Change>` covering
command fields (`program`, `args`, `cwd`), cache settings (`input`,
`output`, `untrackedEnv`), fingerprinted and runner-tracked env changes,
and still at most one file change (first detected).
> 
> **User-facing output:** the inline line uses the first change in kind
order (multiple envs still collapse to `envs 'A', 'B' changed`). `vp run
--verbose` / `--last-details` print **each** change on its own indented
line instead of joining spawn deltas with `; `. `output` changes are
labeled separately from `input`.
> 
> **Implementation:** validation, remote cache resolution, and post-run
fingerprint checks were refactored to accumulate `Change` values;
persisted `last-summary.json` stores the full list (older summaries no
longer load cleanly). E2e fixtures cover combined input/output config
and multi-env misses.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
ba4db44. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->

Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant