Skip to content

refactor(task): extract versioned cache store - #11620

Merged
jdx merged 1 commit into
agent/task-cache-auditfrom
agent/task-cache-store
Aug 3, 2026
Merged

jdx merged 1 commit into
agent/task-cache-auditfrom
agent/task-cache-store

Conversation

@jdx

@jdx jdx commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • define a versioned TaskCacheStore contract independent of the artifact manifest format
  • move atomic filesystem lookup, staged publish, removal, and access-time updates into the local store implementation
  • keep artifacts file-backed so future stores can transfer large payloads without buffering them in memory
  • mark the cache-store interface item complete in the parity tracker

Validation

  • cargo test --all-features task_cache_store::tests -- --nocapture
  • task artifact cache E2E suite, including concurrency, corruption recovery, result-only entries, portability, limits, modes, and inspection
  • mise run lint-fix
  • cargo clippy --workspace --all-features --all-targets -- -D warnings

AI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.


Note

Medium Risk
Touches core cache read/write/restore paths; behavior should match the prior inline FS logic, but regressions in concurrency, corruption handling, or result-only entries would affect task execution correctness.

Overview
Introduces a versioned TaskCacheStore trait (get, staged begin_write/commit, remove, touch) separate from the artifact manifest format, with LocalTaskCacheStore as the filesystem implementation (partial writes, atomic renames, access-time updates).

TaskArtifactCache now holds Arc<dyn TaskCacheStore> and routes restore, store, hit checks, and corrupt-entry cleanup through the store instead of hard-coded {key}.tar.zst / {key}.json paths. Artifacts stay file-backed on disk for streaming-friendly future backends.

Checksum verification accepts an optional archive path; a unit test covers verifying when the manifest already embeds the expected checksum. TASK_CACHE_PARITY.md marks the cache-store interface item done.

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

@coderabbitai

coderabbitai Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

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

Review profile: CHILL

Plan: Pro Plus

Run ID: 6702e939-8175-4f5e-a153-b3101128abf8

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review

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.

Comment thread src/task/task_cache.rs Resolved
@greptile-apps

greptile-apps Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR extracts local task-cache persistence behind a versioned TaskCacheStore contract while preserving file-backed artifacts and existing manifest validation.

  • Moves lookup, staged writes, commits, removal, and access-time updates into LocalTaskCacheStore.
  • Routes cache restore, output inspection, and storage through the new trait.
  • Replaces the previously reported debug-only compatibility assertion with a release-build runtime check.
  • Marks the versioned cache-store interface parity item complete.

Confidence Score: 5/5

The PR appears safe to merge.

The previously reported release-build gap is fixed by an unconditional runtime version comparison in the sole TaskArtifactCache construction path, and no blocking failure remains.

Important Files Changed

Filename Overview
src/task/task_cache.rs Integrates the store abstraction throughout cache reads, restores, and writes, and now enforces the store version with a runtime error in all builds.
src/task/task_cache_store.rs Defines the versioned store contract and local filesystem implementation with staged cleanup and atomic publication behavior.
src/task/mod.rs Registers the new internal task-cache store module.
TASK_CACHE_PARITY.md Records completion of the versioned cache-store interface milestone.

Reviews (9): Last reviewed commit: "refactor(task): extract versioned cache ..." | Re-trigger Greptile

Comment thread src/task/task_cache.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-store branch from a59d790 to 15f114f Compare August 2, 2026 02:19
@jdx
jdx force-pushed the agent/task-cache-store branch from 15f114f to c58af1d Compare August 2, 2026 02:26

@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 c58af1d. Configure here.

Comment thread src/task/task_cache.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-store branch from c58af1d to 8dc4b26 Compare August 2, 2026 02:28
@github-actions

github-actions Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Instruction counts

benchmark trend instructions Δ wall (min) Δ
env ▃▅▂▁▁▂▅▄▄█ 80,074,952 → 80,143,125 +0.09% 17.64 → 18.93ms +7.28%
hook-env ▆▆▁▄▂▂▄▃▅█ 82,190,914 → 82,280,490 +0.11% 18.34 → 19.63ms +7.02%
ls ▅▃▁▁▁▆▆▆▅█ 73,127,800 → 73,207,598 +0.11% 15.71 → 17.15ms +9.15%
registry ▁▁▂▁▂▄▄▅▂█ 49,102,713 → 49,264,395 +0.33% 11.64 → 12.66ms +8.76%
startup ▃▃▁▃▂▁▂▂▃█ 15,784,751 → 15,827,625 +0.27% 9.04 → 9.22ms +2.05%

No instruction-count regression above 1%.

Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run.

Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.

c1f88830be91 vs e5230aa14775 · measured on the runner, not pushed to the history.

@jdx
jdx force-pushed the agent/task-cache-store branch from 8dc4b26 to 05988fc Compare August 2, 2026 02:36
@jdx
jdx force-pushed the agent/task-cache-store branch from 05988fc to 8dc4b26 Compare August 2, 2026 02:39
@jdx
jdx force-pushed the agent/task-cache-store branch from 8dc4b26 to f39fb79 Compare August 2, 2026 03:17
@jdx
jdx force-pushed the agent/task-cache-store branch from f39fb79 to 70e41fd Compare August 2, 2026 13:10
@jdx
jdx force-pushed the agent/task-cache-store branch from 70e41fd to c1f8883 Compare August 2, 2026 15:18
@jdx
jdx merged commit 90b17ad into main Aug 3, 2026
44 of 55 checks passed
@jdx
jdx deleted the agent/task-cache-store branch August 3, 2026 03:04
donbeave pushed a commit to donbeave/mise that referenced this pull request Aug 3, 2026
## Summary
- define a versioned `TaskCacheStore` contract independent of the
artifact manifest format
- move atomic filesystem lookup, staged publish, removal, and
access-time updates into the local store implementation
- keep artifacts file-backed so future stores can transfer large
payloads without buffering them in memory
- mark the cache-store interface item complete in the parity tracker

## Validation
- `cargo test --all-features task_cache_store::tests -- --nocapture`
- task artifact cache E2E suite, including concurrency, corruption
recovery, result-only entries, portability, limits, modes, and
inspection
- `mise run lint-fix`
- `cargo clippy --workspace --all-features --all-targets -- -D warnings`

*AI-assisted — Tool: Codex; model: unavailable/unavailable; version:
unavailable.*

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Touches core cache read/write/restore paths; behavior should match the
prior inline FS logic, but regressions in concurrency, corruption
handling, or result-only entries would affect task execution
correctness.
> 
> **Overview**
> Introduces a **versioned `TaskCacheStore` trait** (`get`, staged
`begin_write`/`commit`, `remove`, `touch`) separate from the artifact
manifest format, with **`LocalTaskCacheStore`** as the filesystem
implementation (partial writes, atomic renames, access-time updates).
> 
> **`TaskArtifactCache`** now holds `Arc<dyn TaskCacheStore>` and routes
restore, store, hit checks, and corrupt-entry cleanup through the store
instead of hard-coded `{key}.tar.zst` / `{key}.json` paths. Artifacts
stay **file-backed** on disk for streaming-friendly future backends.
> 
> Checksum verification accepts an optional archive path; a unit test
covers verifying when the manifest already embeds the expected checksum.
**`TASK_CACHE_PARITY.md`** marks the cache-store interface item done.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c1f8883. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
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