{"modulePath":"github.com/authzed/openagentprimitives","version":"v0.0.0-20261127202550-7c75ef61613a","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package podspec\n\nPackage podspec builds a sandboxed corev1.Pod from a SpiceboxSession + resolved SpiceboxClass spec.\n\n## Constants\n\n```go\nconst (\n\t// ContainerName is the name of the sandbox container in every pod this\n\t// package builds. Exported because the pod sandbox kind binds its exec\n\t// transport to this container.\n\tContainerName = \"sandbox\"\n\n\t// SkillsMountPath is where staged skill bundles land in the sandbox: each\n\t// bundle unpacks to /skills/\u003cLocalName\u003e/ — the skill's own AgentSkill name,\n\t// which is what a disk-based consumer (Claude Code) looks for because it\n\t// must match the staged SKILL.md's frontmatter name (see\n\t// ResolvedSkillBundle.LocalName and BuildBundleSession in\n\t// pkg/controllers/agentsession/bundles.go). NOT \u003cMountName\u003e: that value is\n\t// only the Kubernetes-object-safe volume/ConfigMap name and is never the\n\t// sandbox-visible directory.\n\t//\n\t// Exported (rather than the package-private form the rest of this file's\n\t// constants use) so that internal/cmd/claudeshim/main.go — which needs the\n\t// same path to link staged skills into Claude Code's discovery path, and\n\t// today hand-duplicates the \"/skills\" literal under its own constant of\n\t// the same name — can import this one instead of re-typing the value.\n\t// Not wired up in this change: internal/cmd/claudeshim/ is out of scope\n\t// pending a separate architecture decision on the claudeshim/\n\t// toolchain-claude split.\n\tSkillsMountPath = \"/skills\"\n)\n```\n\n## Functions\n\n```go\nfunc Build(s *spiceboxv1alpha1.SpiceboxSession, class spiceboxv1alpha1.SpiceboxClassSpec) (*corev1.Pod, error)\n```\nBuild returns a Pod that implements the sandbox for the given Session. Returns an error if the class spec is missing fields the Pod requires.\n\n```go\nfunc BuildClassSpec(class spiceboxv1alpha1.SpiceboxClassSpec, toolchains []spiceboxv1alpha1.ToolchainMount) (corev1.PodSpec, error)\n```\nBuildClassSpec renders the class-derived PodSpec: everything that does not depend on a particular session. This is exactly the shape a pre-warmed sandbox has, and comparing a session's PodSpec against it is how the agent-sandbox backend decides whether that session may adopt one.\n\ntoolchains is the already-RESOLVED mount list (see pkg/tools/toolchain/resolve), not class.Toolchains itself. Resolution is a pure function of the class, so a pool builder and a session reach this function with the same mounts for the same class and get byte-identical output — that equality IS the adoption test. Pass nil only for a class with no toolchains: passing nil for a class whose Toolchains is non-empty renders a spec missing the overlay, which no session that resolved those toolchains can ever compare equal to, so that pool entry becomes unadoptable.\n\n```go\nfunc BuildSnapshotStorePVC(sess *spiceboxv1alpha1.AgentSession, storageClass, size string) *corev1.PersistentVolumeClaim\n```\nBuildSnapshotStorePVC constructs the PVC the cp-by-pod Snapshotter writes snapshot subdirectories into. Owner-ref'd to the AgentSession so K8s GC deletes it when the session is deleted (same lifecycle as the workspace PVC).\n\nReadWriteOnce, matching the workspace PVC: under the bundled nodePathMap provisioner each PV carries nodeAffinity, and the snapshot/restore copy jobs mount workspace + snapstore in one pod — the shared nodeAffinity co-locates that pod and both PVCs on one node, where RWO permits the concurrent mounts.\n\n```go\nfunc HardenedContainerSecurityContext() *corev1.SecurityContext\n```\nHardenedContainerSecurityContext returns the container-level security context applied to both the sandbox container and the runner container.\n\n```go\nfunc HardenedPodSecurityContext() *corev1.PodSecurityContext\n```\nHardenedPodSecurityContext returns the pod-level security context applied to both the sandbox pod (Build) and the runner pod (BuildRunnerPod). Callers that need the service-account token (e.g. the runner) must leave AutomountServiceAccountToken at its default (nil / true); the sandbox pod sets it to false separately.\n\n```go\nfunc PodNameFor(s *spiceboxv1alpha1.SpiceboxSession) string\n```\nPodNameFor returns the deterministic Pod name for a given SpiceboxSession.\n\n```go\nfunc SnapshotStoreClaimName(sess *spiceboxv1alpha1.AgentSession) string\n```\nSnapshotStoreClaimName is the deterministic name of the snapshot-store PVC paired with an AgentSession's workspace PVC. The snapshot store accumulates one subdirectory per JIT snapshot taken by the cp-by-pod Snapshotter.\n\n```go\nfunc WorkspaceClaimName(sess *spiceboxv1alpha1.AgentSession) string\n```\nWorkspaceClaimName is the deterministic name of the PVC backing an AgentSession's shared workspace (ReadWriteOnce; see BuildWorkspacePVC).\n\n","path":"github.com/authzed/openagentprimitives/pkg/platform/podspec","name":"podspec","synopsis":"Package podspec builds a sandboxed corev1.Pod from a SpiceboxSession + resolved SpiceboxClass spec.","isRedistributable":true}
