Skip to content

feat(task): verify remote cache artifacts - #11627

Merged
jdx merged 2 commits into
agent/task-cache-remote-resiliencefrom
agent/task-cache-remote-integrity
Aug 3, 2026
Merged

jdx merged 2 commits into
agent/task-cache-remote-resiliencefrom
agent/task-cache-remote-integrity

Conversation

@jdx

@jdx jdx commented Aug 2, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • validate remote manifest keys, formats, output roots, and mandatory artifact checksums before local promotion
  • reject corrupt downloaded artifacts as cache misses without poisoning the local cache
  • require HTTPS for remote services while retaining loopback HTTP for local development
  • document the transport and integrity requirements in protocol version 1

Tests

  • cargo test task_cache_store::tests
  • cargo test remote_entries_require_artifact_checksums
  • cargo clippy --workspace --all-features --all-targets -- -D warnings
  • mise run lint-fix

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


Note

Medium Risk
Changes affect remote cache restore and URL validation on a security-sensitive path; corrupt data should miss rather than poison local cache, but misconfiguration or stricter HTTPS rules could break existing setups.

Overview
Remote task cache reads now treat transport and content integrity as part of the contract, so bad or tampered CAS payloads fail verification instead of being trusted.

HTTP blob downloads (in-memory and streamed-to-file) are checked against the declared blake3/sha256 digest and size; mismatches surface as errors (covered by a new mock test for substituted blob bodies). Remote action-result assembly still computes the manifest artifact checksum after materializing the output tree, then returns a serialized manifest entry. Remote URL validation now explicitly rejects non-HTTP(S) schemes such as ftp:// in tests, alongside the existing HTTPS / loopback-HTTP rules.

The parity tracker marks “Verify remote artifact integrity and authenticity” as complete.

Reviewed by Cursor Bugbot for commit c4e8828. 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: 026659ec-d18f-4b19-8fbf-46c434175045

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.

@greptile-apps

greptile-apps Bot commented Aug 2, 2026 •

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR adds focused tests for CAS blob digest rejection and URL-scheme validation, marks remote artifact integrity and authenticity complete in the parity tracker, and makes a behavior-preserving manifest serialization refactor.

  • Tests corrupted blob responses against their requested BLAKE3 digest.
  • Tests rejection of loopback FTP URLs.
  • Marks the remote integrity/authenticity parity item complete.

Confidence Score: 4/5

The PR does not appear safe to merge until remote artifacts are checked against an independently trusted expected checksum before local promotion.

The current remote read path still computes the manifest checksum from the artifact it just downloaded, so a substituted output tree can satisfy the later checksum comparison and be promoted into the local cache; the new test only proves that an individual CAS response is rejected when it differs from its caller-provided digest.

Files Needing Attention: src/task/task_cache_store.rs

Important Files Changed

Filename Overview
src/task/task_cache_store.rs Adds lower-level CAS corruption and URL validation tests plus a manifest serialization refactor; the previously reported higher-level artifact verification issue remains.
TASK_CACHE_PARITY.md Marks remote artifact integrity and authenticity verification complete.

Reviews (12): Last reviewed commit: "fix(task): accept reordered remote cache..." | Re-trigger Greptile

@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch from bd24d25 to ccdd3bb Compare August 2, 2026 13:09
Comment thread src/task/task_cache.rs Resolved
@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,197,305 +0.15% 17.64 → 18.63ms +5.62%
hook-env ▅▅▁▃▂▂▃▃▄█ 82,190,914 → 82,335,121 +0.18% 18.34 → 18.03ms -1.68%
ls ▄▃▁▁▁▅▅▅▅█ 73,127,800 → 73,236,949 +0.15% 15.71 → 15.87ms +1.01%
registry ▁▁▂▂▃▆▆█▂▇ 49,102,713 → 49,169,314 +0.14% 11.64 → 11.79ms +1.26%
startup ▃▃▁▂▂▁▁▂▂█ 15,784,751 → 15,846,569 +0.39% 9.04 → 8.85ms -2.12%

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.

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

@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch from ccdd3bb to 954d751 Compare August 2, 2026 15:18

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

Comment thread src/task/task_cache.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch 2 times, most recently from 516e7ad to dbbbe9a Compare August 2, 2026 15:27
@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch 2 times, most recently from 5e361f1 to c247d7a Compare August 2, 2026 18:18
@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch from c247d7a to cf2d87c Compare August 2, 2026 18:58
@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch from cf2d87c to 3d2f6e3 Compare August 2, 2026 19:10
@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch from 3d2f6e3 to 1a5ff33 Compare August 2, 2026 21:25
Comment thread src/task/task_cache_store.rs Resolved
@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch from 1a5ff33 to bacb2a8 Compare August 3, 2026 00:38
@jdx
jdx force-pushed the agent/task-cache-remote-integrity branch from bacb2a8 to c4e8828 Compare August 3, 2026 00:46
@jdx
jdx merged commit 13b0355 into main Aug 3, 2026
37 of 45 checks passed
@jdx
jdx deleted the agent/task-cache-remote-integrity branch August 3, 2026 03:04
donbeave pushed a commit to donbeave/mise that referenced this pull request Aug 3, 2026
## Summary
- validate remote manifest keys, formats, output roots, and mandatory
artifact checksums before local promotion
- reject corrupt downloaded artifacts as cache misses without poisoning
the local cache
- require HTTPS for remote services while retaining loopback HTTP for
local development
- document the transport and integrity requirements in protocol version
1

## Tests
- `cargo test task_cache_store::tests`
- `cargo test remote_entries_require_artifact_checksums`
- `cargo clippy --workspace --all-features --all-targets -- -D warnings`
- `mise run lint-fix`

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

<!-- CURSOR_SUMMARY -->
---

> [!NOTE]
> **Medium Risk**
> Changes affect remote cache restore and URL validation on a
security-sensitive path; corrupt data should miss rather than poison
local cache, but misconfiguration or stricter HTTPS rules could break
existing setups.
> 
> **Overview**
> **Remote task cache reads now treat transport and content integrity as
part of the contract**, so bad or tampered CAS payloads fail
verification instead of being trusted.
> 
> HTTP blob downloads (in-memory and streamed-to-file) are checked
against the declared **blake3/sha256** digest and size; mismatches
surface as errors (covered by a new mock test for substituted blob
bodies). Remote **action-result** assembly still computes the manifest
**artifact checksum** after materializing the output tree, then returns
a serialized manifest entry. **Remote URL** validation now explicitly
rejects non-HTTP(S) schemes such as `ftp://` in tests, alongside the
existing HTTPS / loopback-HTTP rules.
> 
> The parity tracker marks **“Verify remote artifact integrity and
authenticity”** as complete.
> 
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
c4e8828. 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