Skip to content

feat(task): cache tasks without file outputs - #11351

Merged
jdx merged 1 commit into
mainfrom
agent/task-cache-no-outputs
Jul 27, 2026
Merged

jdx merged 1 commit into
mainfrom
agent/task-cache-no-outputs

Conversation

@jdx

@jdx jdx commented Jul 26, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • support outputs = [] as an explicit result-only task cache declaration
  • store successful results and replayable logs without creating an artifact archive
  • allow scoped cache defaults to apply to result-only tasks
  • document the behavior and mark the parity-tracker item complete

Why

Checks such as linting, testing, and type checking often produce no filesystem artifacts, but their successful result and logs are still useful to cache. This closes that local-cache parity gap while requiring users to explicitly assert that no filesystem side effects need restoration.

Stacking

This PR is stacked on #11347 and should be retargeted to main after that PR merges.

Validation

  • mise run lint-fix
  • cargo check --all-features
  • cargo test --all-features task_outputs --quiet
  • cargo test --all-features task_cache --quiet
  • mise run test:e2e tasks/test_task_artifact_cache_no_outputs tasks/test_task_artifact_cache tasks/test_task_artifact_cache_validation tasks/test_task_artifact_cache_output

The e2e coverage verifies current hits, manifest-only restoration, log replay, source invalidation, scoped defaults, cache clearing, and that result-only entries create no tar archive.


Note

Medium Risk
Changes experimental task cache store/restore and skip logic; incorrect outputs = [] could skip work if users misdeclare side effects, though behavior is opt-in and covered by new e2e tests.

Overview
Adds outputs = [] as an explicit “result-only” cache mode for tasks that produce no filesystem artifacts (lint, test, typecheck). Successful runs can be skipped or restored from cache with manifest + replayed stdout/stderr, without writing a .tar.zst archive.

TaskOutputs::NoFiles is parsed from an empty outputs array; cache validation and scoped task_config.cache defaults now treat outputs = [] like explicit output paths (still rejecting outputs = { auto = true }). Store/restore only unpacks archives when manifest roots are non-empty; result-only entries skip the output-directory lock and tolerate a missing archive when the JSON manifest is present.

The executor treats result-only tasks as cache-eligible on the “sources up-to-date” fast path without requiring output freshness, and reports “restored result” vs “restored outputs” on cache hits. Docs, parity tracker, validation messages, and e2e coverage for hits, manifest-only restore, log replay, invalidation, and scoped defaults are updated.

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

Summary by CodeRabbit

  • New Features

    • Tasks configured with outputs = [] can now use caching.
    • Cached result-only tasks replay successful results and logs without storing filesystem artifacts.
    • Cached results can be restored after local cache state is removed.
  • Bug Fixes

    • Improved cache validation and clearer errors for unsupported output configurations.
    • Cache reuse now correctly handles tasks without filesystem outputs.
  • Documentation

    • Expanded task-cache configuration guidance, eligibility rules, and examples.

@coderabbitai

coderabbitai Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Central YAML (base), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: e12658fa-d7b4-4868-ad3c-5159f58128c7

📥 Commits

Reviewing files that changed from the base of the PR and between 967eec4 and 97b47d1.

📒 Files selected for processing (8)
  • TASK_CACHE_PARITY.md
  • docs/tasks/task-configuration.md
  • e2e/tasks/test_task_artifact_cache_no_outputs
  • e2e/tasks/test_task_artifact_cache_validation
  • src/config/mod.rs
  • src/task/task_cache.rs
  • src/task/task_executor.rs
  • src/task/task_sources.rs

📝 Walkthrough

Walkthrough

Adds outputs = [] as a manifest-only task-cache mode. Task output parsing, cache storage and restoration, executor reuse logic, validation, documentation, and end-to-end tests now support cached results and logs without filesystem artifacts.

Changes

Result-only task cache

Layer / File(s) Summary
No-output task contract
src/task/task_sources.rs, src/task/task_cache.rs
Adds TaskOutputs::NoFiles, maps outputs = [] through serialization, and allows explicitly empty outputs during cache validation.
Manifest-only cache storage
src/task/task_cache.rs
Stores manifests without archives when no output roots exist and restores cached results without modifying the task directory.
Cache reuse and defaults
src/config/mod.rs, src/task/task_executor.rs
Updates cache eligibility, bypasses source freshness checks for no-file tasks, and reports restored results separately from restored outputs.
Documentation and validation
docs/tasks/task-configuration.md, e2e/tasks/*, TASK_CACHE_PARITY.md
Documents result-only caching and tests replay, invalidation, cache clearing, archive absence, and updated validation errors.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Sequence Diagram(s)

sequenceDiagram
  participant User
  participant TaskExecutor
  participant TaskArtifactCache
  participant LocalCache
  User->>TaskExecutor: run task with outputs = []
  TaskExecutor->>TaskArtifactCache: check cached result
  TaskArtifactCache->>LocalCache: read manifest and logs
  LocalCache-->>TaskArtifactCache: manifest-only cache entry
  TaskArtifactCache-->>TaskExecutor: restored result
  TaskExecutor-->>User: replay cached stdout and stderr
Loading

Possibly related PRs

  • jdx/mise#11254: Both modify freshness checks used for task-cache reuse.
  • jdx/mise#11328: Extends the related local artifact-cache implementation with outputs = [] support.
  • jdx/mise#11347: Both modify cached stdout/stderr replay in the artifact-cache pipeline.

Suggested reviewers: risu729, jambalaya56562

Poem

I’m a rabbit with a cache in my burrow so neat,
No files, just logs, and a result to repeat.
The manifest rests while archives stay light,
Fresh runs hop past with their output just right.
outputs = [] makes the cache leap! 🐇

🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 28.57% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly summarizes the main change: enabling cache support for tasks without file outputs.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit e5f0dc4. Configure here.

Comment thread src/task/task_cache.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-no-outputs branch from e5f0dc4 to 64ed924 Compare July 26, 2026 22:28
@greptile-apps

greptile-apps Bot commented Jul 26, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

This PR adds explicit result-only caching for tasks declaring outputs = [].

  • Introduces a distinct TaskOutputs::NoFiles representation and scoped cache-default support.
  • Stores and restores manifest/log-only cache entries without creating artifact archives.
  • Preserves validation for declared filesystem outputs that match no files.
  • Adds documentation and end-to-end coverage for result restoration, invalidation, log replay, and cache clearing.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported missing-output issue is resolved because cache storage still requires every declared filesystem output pattern to match, while only explicit result-only tasks can legitimately produce empty-root manifests; no blocking failure remains.

Important Files Changed

Filename Overview
src/task/task_cache.rs Adds manifest-only cache storage and restoration while retaining store-time rejection when declared filesystem output patterns match nothing.
src/task/task_executor.rs Replays current or restored result-only cache entries through the existing content-keyed cache flow.
src/task/task_sources.rs Distinguishes explicit empty outputs from omitted and automatic output configurations across parsing and serialization.
src/config/mod.rs Allows explicitly result-only tasks to inherit scoped cache defaults.
e2e/tasks/test_task_artifact_cache_no_outputs Covers result-only cache hits, manifest restoration, source invalidation, log replay, clearing, and absence of archives.

Reviews (3): Last reviewed commit: "feat(task): cache tasks without file out..." | Re-trigger Greptile

Comment thread src/task/task_cache.rs Resolved
Base automatically changed from agent/task-cache-logs to main July 26, 2026 22:51
@jdx
jdx force-pushed the agent/task-cache-no-outputs branch from 64ed924 to 97b47d1 Compare July 27, 2026 00:09
@github-actions

Copy link
Copy Markdown
Contributor

Hyperfine Performance

mise x -- echo

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 x -- echo 18.5 ± 1.1 16.4 24.2 1.00
mise x -- echo 20.5 ± 1.5 17.9 29.5 1.11 ± 0.10
⚠️ Inconclusive: x -- echo measured 11% slower, but the relative uncertainty overlaps the 10% threshold.

mise env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 env 18.0 ± 1.0 15.8 23.1 1.00
mise env 20.0 ± 1.2 16.9 24.5 1.11 ± 0.09
⚠️ Inconclusive: env measured 11% slower, but the relative uncertainty overlaps the 10% threshold.

mise hook-env

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 hook-env 19.4 ± 1.2 16.6 23.9 1.00
mise hook-env 21.3 ± 1.5 18.2 27.7 1.10 ± 0.10

mise ls

Command Mean [ms] Min [ms] Max [ms] Relative
mise-2026.7.14 ls 16.7 ± 1.1 14.2 21.7 1.00
mise ls 18.3 ± 1.2 16.0 24.6 1.09 ± 0.10

xtasks/test/perf

Command mise-2026.7.14 mise Variance
install (cached) 165ms 179ms -7%
ls (cached) 67ms 68ms -1%
bin-paths (cached) 67ms 72ms -6%
task-ls (cached) 97ms 97ms +0%

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