Skip to content

feat: improve task runner summary with compact one-liners#171

Merged
branchseer merged 12 commits intomainfrom
feat/improve-task-runner-summary
Feb 25, 2026
Merged

feat: improve task runner summary with compact one-liners#171
branchseer merged 12 commits intomainfrom
feat/improve-task-runner-summary

Conversation

@branchseer
Copy link
Copy Markdown
Member

@branchseer branchseer commented Feb 24, 2026

Summary

Replace the verbose full execution summary with compact one-liners for normal runs, with --verbose flag for full summary and --last-details to view the last run's saved summary from a JSON file.

Behavior

Command Behavior
vp run task Run task, compact summary
vp run -v task Run task, full summary
vp run --last-details Read saved JSON, display full summary

Compact summary rules

  • Single task + not cache hit → no summary at all
  • Single task + cache hit → [vp run] cache hit, {duration} saved.
  • Multi-task → [vp run] {hits}/{total} cache hit ({rate}%), {duration} saved. (Run 'vp run --verbose' for full details)

Key design decisions

  • Structured data, not formatted strings: all display formatting happens at render time from LastRunSummary
  • Enums for invalid states: --last-details is exclusive at the type level via Command::RunLastDetails variant
  • Single rendering path: always generate LastRunSummary, then render compact or full from it
  • Atomic writes: last-summary.json written to .tmp then fs::rename
  • Write callback: reporter decoupled from file paths via Box<dyn FnOnce(&LastRunSummary)>
  • Direct TaskSummary construction: leaf reporter builds TaskSummary in finish() instead of collecting intermediate ExecutionInfo

Snapshot proof

Includes a commit adding --verbose to all e2e tests followed by its revert, proving the full summary output is correct and unchanged. The e2e tests exercise the compact summary path by default.

Add --details flag for full summary and --last-details to view saved
summary from last run. Normal runs now show a compact one-liner instead
of the full summary table:

- Single task + no cache hit: no summary
- Single task + cache hit: '[vp run] cache hit, {duration} saved.'
- Multi-task: '[vp run] {hits}/{total} cache hit ({rate}%)'

Summary data is persisted as structured JSON (last-summary.json) in the
cache directory using atomic writes. Both live and --last-details
rendering share the same code path through LastRunSummary.

The TaskResult enum encodes cache status and execution outcome together,
making invalid states unrepresentable (e.g. CacheHit+exit_code,
InProcess+error).

Also fixes a pre-existing flaky test in e2e-lint-cache where oxlint
scanned node_modules, causing fspy to fingerprint the cache directory.
- Make --last-details exclusive at type level by splitting Command into
  ParsedCommand (clap) and Command (resolved with RunLastDetails variant)
- Use ? to propagate IO errors in show_last_run_details
- Replace summary_file_path with write_summary callback to decouple
  reporter from file paths
- Remove ExecutionInfo/ExecutionStats, build TaskSummary directly in
  leaf reporter's finish() instead of collecting intermediate state
- Add .gitignore to oxlint fixtures to prevent fspy from fingerprinting
  the cache directory, fixing flaky cache-miss snapshots
… is unchanged

Rename --details flag to -v/--verbose and add it to all vp run steps
in e2e snapshot tests. The .snap file diffs confirm that only the
flag name in command echo lines and the compact summary hint text
changed — the actual summary output is identical, proving the full
summary rendering path is correct.

This commit will be reverted so that e2e tests exercise the compact
summary path (the default without --verbose).
@branchseer branchseer changed the title feat: replace verbose execution summary with compact one-liners feat: improve task runner summary with compact one-liners Feb 24, 2026
Copy link
Copy Markdown
Member Author

branchseer commented Feb 24, 2026

This stack of pull requests is managed by Graphite. Learn more about stacking.

…y output is unchanged"

This reverts the test-only changes from commit 86019bc, removing
--verbose from e2e test commands so they exercise the compact summary
path. The --details to --verbose code rename is preserved.
@branchseer branchseer force-pushed the feat/improve-task-runner-summary branch from 96182ea to 5d10eb4 Compare February 24, 2026 10:12
branchseer added a commit to voidzero-dev/vite-plus that referenced this pull request Feb 24, 2026
Upgrade vite-task to voidzero-dev/vite-task#171 which replaces the
verbose full execution summary with compact one-liners. Single-task
runs with no cache hit show no summary. Single-task cache hits show
a brief 'cache hit' message. Multi-task runs show hit rate and time
saved, with a hint to use --verbose for full details.

Updates cli.rs to use ParsedCommand (now exposed by vite-task) with
.into_command() at dispatch points, and regenerates 25 snap tests.
branchseer and others added 6 commits February 24, 2026 21:33
…ache misses

Tools like oxlint traverse node_modules/ during execution, which causes fspy
to record reads of files in the cache directory (SQLite DB, last-summary.json).
When these cache files change between runs, fspy reports them as changed inputs,
causing spurious cache misses.

Thread cache_dir_relative through Session -> ExecutionContext -> spawn_with_tracking
to filter out cache directory accesses alongside the existing .git exclusion.

Also adds summary-output e2e test fixture with 10 test cases covering compact
summary, --verbose, and --last-details.
The cache directory should not be special-cased in fspy. Instead, tests that
run tools like oxlint should include a .gitignore with 'node_modules' to
prevent the tool from traversing the cache directory — matching the setup
of real projects.
On main, finish_graph_execution always wrote the full summary and flushed.
With the compact summary, single-task non-cache-hit produces no summary
output, so the flush was skipped. This caused child process output written
via Stdio::inherit() to not be committed to the output stream, making it
invisible to callers reading the same fd.
…ernal

- Rename `ParsedCommand` → `Command` and `ParsedRunCommand` → `RunCommand` as the public API types
- Rename old `Command` → `ResolvedCommand` and old `RunCommand` → `ResolvedRunCommand` as crate-internal types
- `Session::main` and `HandledCommand::ViteTaskCommand` now accept `Command` directly (no `.into_command()` needed)
- Fix summary message: `--verbose` → `--last-details`

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove verbose reason suffixes from "cache disabled" inline status
messages (": no cache config" and ": built-in command").

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@branchseer branchseer merged commit 261c567 into main Feb 25, 2026
7 checks passed
@branchseer branchseer deleted the feat/improve-task-runner-summary branch February 25, 2026 03:12
branchseer added a commit to voidzero-dev/vite-plus that referenced this pull request Feb 25, 2026
Upgrade vite-task to voidzero-dev/vite-task#171 which replaces the
verbose full execution summary with compact one-liners. Single-task
runs with no cache hit show no summary. Single-task cache hits show
a brief 'cache hit' message. Multi-task runs show hit rate and time
saved, with a hint to use --verbose for full details.

Updates cli.rs to use ParsedCommand (now exposed by vite-task) with
.into_command() at dispatch points, and regenerates 25 snap tests.
branchseer added a commit to voidzero-dev/vite-plus that referenced this pull request Feb 25, 2026
## Summary

- Upgrades vite-task dependency to
[voidzero-dev/vite-task#171](voidzero-dev/vite-task#171)
which implements compact task runner summaries (GitHub issue #591)
- Updates `cli.rs` to use `ParsedCommand` (now exposed by vite-task)
with `.into_command()` at dispatch points
- Regenerates 25 snap test outputs: full verbose execution summaries
(~800 lines) replaced by compact one-liners

### New behavior
| Scenario | Output |
|---|---|
| Single task, no cache hit | No summary |
| Single task, cache hit | `---` + `[vp run] cache hit, {duration}
saved.` |
| Multi-task | `---` + `[vp run] {hits}/{total} cache hit ({rate}%),
{duration} saved. (Run 'vp run --verbose' for full details)` |

### New CLI flags
- `-v` / `--verbose`: Show full execution summary (previous default
behavior)
- `--last-details`: Display saved summary from last run

Depends on: voidzero-dev/vite-task#171

---------

Co-authored-by: Claude Opus 4.6 <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.

2 participants