Skip to content

Add verified artifact acquisition - #1

Open
andrew wants to merge 1 commit into
mainfrom
issue-294-acquire
Open

Add verified artifact acquisition#1
andrew wants to merge 1 commit into
mainfrom
issue-294-acquire

Conversation

@andrew

@andrew andrew commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Adds an acquire package for fetching package artifacts into caller-provided storage. It supports exact artifact resolution, cache and offline reads, size limits, integrity verification, and staged writes.

This supplies the acquisition boundary needed by git-pkgs/git-pkgs#294.

Copilot AI 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.

Pull request overview

Adds a new acquire package that defines the acquisition boundary for resolving, fetching, verifying, and storing package artifacts, enabling verified/staged artifact ingestion into caller-managed storage.

Changes:

  • Introduces acquire.Service and related interfaces (Resolver, Fetcher, Store, Stage) to coordinate resolution, download, integrity verification, and staged commits.
  • Adds comprehensive unit tests covering cache hits/misses, offline mode, size limits, integrity mismatch handling, and failure cleanup behavior.
  • Adds the github.com/git-pkgs/integrity dependency for streaming digest computation and SRI verification.

Reviewed changes

Copilot reviewed 3 out of 4 changed files in this pull request and generated 1 comment.

File Description
go.mod Adds github.com/git-pkgs/integrity dependency used by acquisition verification.
go.sum Adds checksums for the new integrity dependency.
acquire/acquire.go Implements artifact acquisition flow (cache/open, resolve+fetch, size limit, verification, staged commit).
acquire/acquire_test.go Adds unit tests for acquisition behavior and error/cleanup paths.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread acquire/acquire.go
Comment on lines +411 to +418
func digestAlgorithms(expected integrity.SRI) []integrity.Algorithm {
algorithms := make([]integrity.Algorithm, 0, len(expected)+1)
algorithms = append(algorithms, integrity.SHA256)
for _, item := range expected {
algorithms = append(algorithms, item.Algorithm())
}
return algorithms
}
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