Skip to content

feat(cache): add content-addressed disk store#11

Merged
jmgilman merged 1 commit intomasterfrom
session-004/cache-service
May 5, 2026
Merged

feat(cache): add content-addressed disk store#11
jmgilman merged 1 commit intomasterfrom
session-004/cache-service

Conversation

@jmgilman
Copy link
Copy Markdown
Contributor

@jmgilman jmgilman commented May 5, 2026

Summary

  • Add internal/cache with a provider-neutral Service interface and disk-backed DiskStore implementation.
  • Store verified blobs under blobs/sha256/<prefix>/<digest> with temp downloads under tmp/.
  • Harden cache correctness around read-only blobs, bounded downloads, corrupt entry replacement, size/digest conflicts, and unsafe cache paths.

Validation

  • go test -count=1 ./internal/cache
  • moon run root:check --summary minimal

Notes

Provider integration is intentionally deferred; IncusOS can wire into cache.Service.Fetch in a later slice.

Adds a provider-neutral cache service interface with an XDG-compatible disk-backed implementation for verified blob downloads.

Covers cache hits, unknown digests, corrupt entries, validation errors, cancellation, mismatch handling, read-only blobs, and unsafe cache paths.
@jmgilman jmgilman marked this pull request as ready for review May 5, 2026 02:58
@jmgilman jmgilman merged commit acc0de4 into master May 5, 2026
2 checks passed
@jmgilman jmgilman deleted the session-004/cache-service branch May 5, 2026 02:58
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