distribution: versions on the artifact seat answers the blob a reference names

The node-engine resolves a want's version to an archive's digest through
oci-artifact-registry's verb versions and fetches /blobs/<digest> by it.
The holder answered the tag's manifest digest, so shanks asked
claude-code/files' manifest as a blob and got 404 (claude-code 0.1.17).
On the artifact seat versions now answers the manifest's one blob, the
digest the reference and the event published carry; the image seat
keeps the manifest digest.

Builds: design 47 G A-430a (G-22-lead-answers-2), design 51 *One contract* (the seats' events carry the digest), the seat's contract Artifact and Listed.artifact
This commit is contained in:
2026-11-20 16:12:27 +01:00
parent a0e86fc696
commit 6f4e85c656
4 changed files with 53 additions and 2 deletions
@@ -40,11 +40,11 @@ func partAnswer(in reg.PublishPartInput, a holder.PublishAnswer) reg.PublishPart
return reg.PublishPartAnswer{Transfer: in.Transfer, Part: in.Part, Received: in.Sequence + 1, Complete: a.Ended}
}
// versionsAnswer is `versions`: each version with the digest the store holds under it.
// versionsAnswer is `versions`: each version with the digest its reference names (holder.Verbs.VersionDigest).
func versionsAnswer(v *holder.Verbs, kind string, a holder.VersionsAnswer) reg.VersionsAnswer {
out := reg.VersionsAnswer{Name: a.Name, Versions: []reg.Artifact{}}
for _, ver := range a.Versions {
d, _ := v.Catalog.Digest(a.Name, ver)
d, _ := v.VersionDigest(a.Seat, a.Name, ver)
out.Versions = append(out.Versions, reg.Artifact{Name: a.Name, Version: ver, Digest: d, Kind: kind})
}
return out