Documentation
¶
Overview ¶
Package harnessbuild makes the harness images that are built on this machine from a vendor artifact and never published. Claude Code's licence grants no redistribution, so each person's machine builds its own from Anthropic's npm packages, as `npm install -g` would lay them out, on agentry-dockerimages' Node base. Copilot CLI's allows redistribution only inside an application, so it is built the same way, from GitHub's release download, on agentry-dockerimages' Alpine base (copilot.go).
Every download is held to the hash this build carries before anything reaches the daemon: one whose bytes do not hash to it is refused and nothing is built. The image is labelled with the artifact it was built from, and an image of the tag without that label, or with another, is built again, so the receipt's pin is true of the image that ran.
Index ¶
Constants ¶
const ( CodexAPI = "https://api.github.com/repos/openai/codex" CodexReleases = "https://github.com/openai/codex/releases/download" CodexFiles = "https://raw.githubusercontent.com/openai/codex" )
Where Codex's releases are: GitHub's API for the newest release and the commit its tag names, the release downloads, and the files at a commit.
const ( CopilotBinary = "/usr/local/bin/copilot" CopilotPkgCache = "/opt/copilot/cache" CopilotHome = "/home/copilot" // LabelDownload is the checksum of the download the image holds. LabelDownload = "org.agentry.harness.download" )
The image's layout: the binary, the unpacked package it runs from, and the user it runs as.
const ( LabelArtifact = "org.agentry.harness.artifact" LabelNative = "org.agentry.harness.native" // LabelRecipe is the version of the Claude Code image's own recipe // (what this package adds around the vendor's packages): an image // built from the pinned artifact by an older recipe is built again. LabelRecipe = "org.agentry.harness.recipe" )
The labels a built image carries: the artifact its pin names, and the integrity of the native package it installed for the daemon's platform.
const ClaudeBase = "ghcr.io/blaktron/agentry-node-alpine:26-alpine@sha256:c6ad9e9c1d80f6eb607c26b4b0a132ff7a2344fad1c78ea3baa2a7d4c8de6d94"
ClaudeBase is the image Claude Code is installed on: agentry-dockerimages' mirror of node:24-alpine, pinned by digest. Alpine is musl, so the musl native packages are the ones installed; the base carries the libstdc++ and libgcc they link against, and the Node the wrapper's own install script runs on.
const ClaudeConfigDir = "/claude"
ClaudeConfigDir is where the image keeps Claude Code's config directory: made by the build and owned by the image's user, so a docker volume first mounted there is that user's too.
const ClaudeImageAdapter = "claude-image"
ClaudeImageAdapter is the adapter whose image this package builds (the adapter package, which imports this one, names it too; a test there holds the two to one name).
const ClaudeOpener = "/usr/local/bin/agentry-open"
ClaudeOpener is the Claude Code image's browser: the program its BROWSER names for a sign-in. Claude Code (2.1.296) hands its opener the sign-in address whose redirect is its own callback on the container's loopback; the opener writes it to the container's stderr as one line, "agentry-open <address>", for the agentry CLI, which opens it in the person's browser and relays the callback in. It opens nothing itself.
const ClaudeRecipe = "2"
ClaudeRecipe is the Claude Code image's recipe version: 2 adds the stand-in browser opener, ClaudeOpener.
const CodexBase = CopilotBase
CodexBase is the image the Codex binary is put on: the same Alpine mirror as the published agentry-codex image and the Copilot CLI image, pinned by digest. The binary is static (musl).
const CodexImageAdapter = "codex-image"
CodexImageAdapter is the adapter whose newest image codex.go builds (the adapter package names it too).
const CopilotBase = "ghcr.io/blaktron/agentry-alpine:3.24@sha256:be2656061b536c1883c4034790e21d0a09c5aaaf51968b89368a3c0371ea2c9a"
CopilotBase is the image Copilot CLI is installed on: agentry-dockerimages' mirror of alpine:3.22, the runner image's own runtime base, pinned by digest. The musl download needs nothing but musl's libc.
const CopilotImageAdapter = "copilot-image"
CopilotImageAdapter is the adapter whose image copilot.go builds (the adapter package names it too).
const CopilotPinNote = "pinned by checksum, not signed: GitHub publishes the download's SHA-256 and no signature"
CopilotPinNote is what the receipt says of the pin.
const CopilotReleases = "https://github.com/github/copilot-cli/releases/download"
CopilotReleases is where GitHub publishes Copilot CLI's release downloads, each under v<version>/.
Variables ¶
This section is empty.
Functions ¶
func NewestNote ¶ added in v0.7.4
func NewestNote(adapterName string, h policy.HarnessImage) string
NewestNote is what a receipt says of an image built from a vendor's newest release, "" for any other image.
func PinNote ¶
func PinNote(adapterName string, h policy.HarnessImage) string
PinNote is what an image this build makes for adapterName is pinned by and does not prove, for the receipt (spec.ImagePin.Note): "" when the pin says it all.
func TestedVersion ¶ added in v0.7.4
TestedVersion is the version of the release this build pins for adapterName and tested: "" for an adapter whose newest release is never tried.
Types ¶
type Builder ¶
type Builder struct {
Docker dockerx.Client
// HTTP fetches the packages; nil is a plain client, bounded by ctx.
HTTP *http.Client
// Registry is the npm registry; "" is policy.DefaultNPMRegistry.
Registry string
// Releases is where GitHub's release downloads are; ""
// is CopilotReleases.
Releases string
// Dir is where the build context is made and removed; "" is the
// system's temporary directory.
Dir string
// Log is told what is built from what.
Log io.Writer
// Building, when set, is told the vendor release's version as a build
// starts, before anything is downloaded: an image already here calls it
// not at all.
Building func(version string)
// Recorded is the record's entry for the adapter being made: a newest
// release built here before, which Ensure builds again from what it
// records when its image is gone. nil knows only the tested releases.
Recorded *policy.Newest
// CodexAPI, CodexReleases and CodexFiles are where Codex's newest
// release, its downloads and its licence files are; "" is OpenAI's.
CodexAPI, CodexReleases, CodexFiles string
// CacheDir caches Sigstore's trust root under sigstore/; "" is the
// user's cache directory.
CacheDir string
}
Builder makes the images this package builds.
func (Builder) AskNewest ¶ added in v0.7.4
AskNewest asks adapterName's vendor for its newest release, and returns it when it is newer than the tested one, ok false when it is not.
type ChecksumError ¶
type ChecksumError struct {
What, Want, Got string
}
ChecksumError is a download whose bytes are not the ones this build pins: the build is refused and nothing reaches the daemon.
func (*ChecksumError) Error ¶
func (e *ChecksumError) Error() string
type IntegrityError ¶
type IntegrityError struct {
Package, Want, Got string
}
IntegrityError is a package whose bytes are not the ones this build pins: the build is refused and nothing reaches the daemon.
func (*IntegrityError) Error ¶
func (e *IntegrityError) Error() string
type Newest ¶ added in v0.7.4
type Newest struct {
Adapter string
Version string
// Tested is the version this build pins and tested.
Tested string
// contains filtered or unexported fields
}
Newest is a vendor release newer than the one this build pins, as its vendor answers for it, ready to be built.