Versions in this module Expand all Collapse all v0 v0.10.0 Sep 11, 2026 v0.9.3 Sep 6, 2026 v0.9.2 Sep 5, 2026 v0.9.1 Sep 5, 2026 v0.9.0 Sep 5, 2026 v0.8.0 Sep 5, 2026 Changes in this version + type ActionsCache string + const ActionsCacheDisabled + const ActionsCacheOff + const ActionsCacheServed + const ActionsCacheSpliced + const ActionsCacheUnavailable + const ActionsCacheUnused + func (c ActionsCache) Valid() bool type Allocator + func (a *Allocator) HistoryPlacement(ctx context.Context, leaseID string) (JobPlacement, error) + func (a *Allocator) RecordCacheObservation(ctx context.Context, leaseID string, epoch int64, obs CacheObservation) error + type CacheObservation struct + ActionsCache ActionsCache + CacheGeneration string + ImageCache ImageCache + func (o CacheObservation) Validate() error + type ImageCache string + const ImageCacheCold + const ImageCacheUnavailable + const ImageCacheUnused + const ImageCacheWarm + func (c ImageCache) Valid() bool + type JobPlacement struct + ActionsCache ActionsCache + CacheGeneration string + ImageCache ImageCache + InstanceType string + Memory config.ByteSize + PriceUSDPerHour config.USDPerHour + Provider config.ProviderKind + Site string + VCPU int type Lease + ActionsCache ActionsCache + CacheGeneration string + ImageCache ImageCache + PriceUSDPerHour config.USDPerHour + Site string v0.7.0 Sep 5, 2026 v0.6.1 Sep 4, 2026 v0.6.0 Sep 4, 2026 Changes in this version type NodeWire + HighestRelease string v0.5.0 Sep 3, 2026 Changes in this version + const BarrierWireVersion + const CertEnrolled + const CertIssued + const CertRenewed + const DefaultLeaseTTL + const EnrollApproved + const EnrollDenied + const EnrollPending + const ForceReleasedReason + const HeldPastLimitReason + const LaunchFailedReason + const PoolRunnerBusy + const PoolRunnerIdle + const PoolRunnerRetired + const PoolRunnerRetiring + const RunnerRetiredReason + var ErrAdmissionSealed = errors.New("alloc: this deployment is not accepting new work") + var ErrBadJoinToken = errors.New("alloc: that join token is not usable") + var ErrBadTransition = errors.New("alloc: invalid phase transition") + var ErrConflict = errors.New("alloc: retry contradicts the recorded operation") + var ErrEnrollmentConflict = errors.New("alloc: another key has already requested this node name") + var ErrFenced = errors.New("alloc: lease was reclaimed by another holder") + var ErrFleetHeld = errors.New("alloc: that fleet's shared capacity is already claimed") + var ErrForceHeld = errors.New("alloc: a node has taken custody of this lease") + var ErrForceRelease = errors.New("alloc: operator requested forced release") + var ErrGuestOSNotAllowed = errors.New("alloc: node does not permit that guest OS") + var ErrLeaseNotFound = errors.New("alloc: lease not found") + var ErrNoCapacity = errors.New("alloc: no capacity available") + var ErrNotDecommissionable = errors.New("alloc: this host cannot be decommissioned yet") + var ErrNotPlaceable = errors.New("alloc: lease cannot be placed safely") + var ErrNotPlaced = errors.New("alloc: lease has no bound node") + var ErrParentRevoked = errors.New("alloc: the certificate being renewed has been revoked") + var ErrRemoteCostUnavailable = errors.New("remote compute cost report unavailable") + var ErrUnknownTier = errors.New("alloc: unknown tier") + var ErrWithdrawalStale = errors.New("alloc: that withdrawal names a registration this ledger does not hold") + var ErrWrongNode = errors.New("alloc: lease cannot be bound to that node") + var ErrWrongProvider = errors.New("alloc: node runs a different provider") + var ErrWrongSite = errors.New("alloc: node reports a different site") + type Allocator struct + func New(db *state.DB, limits Limits, tiers []config.Tier, opts ...Option) (*Allocator, error) + func (a *Allocator) AcknowledgePoolRunner(ctx context.Context, tier string, requestID int64) error + func (a *Allocator) ActiveRunnerLeases(ctx context.Context, tier string) (int, error) + func (a *Allocator) Admission(ctx context.Context) (state.Admission, error) + func (a *Allocator) AdmissionGeneration(ctx context.Context) (int64, bool, error) + func (a *Allocator) Advance(ctx context.Context, leaseID string, epoch int64, to Phase) error + func (a *Allocator) AgeQuarantineForTest(ctx context.Context, leaseID string) error + func (a *Allocator) Assign(ctx context.Context, leaseID string, epoch, runID, requestID int64) error + func (a *Allocator) AttributedFailures(ctx context.Context, since time.Time, limit int) ([]AttributedFailure, error) + func (a *Allocator) Bind(ctx context.Context, leaseID string, epoch int64, node string) error + func (a *Allocator) BumpDispatch(ctx context.Context, node string) (int64, error) + func (a *Allocator) CertRevoked(ctx context.Context, serial string) (bool, error) + func (a *Allocator) CertRevokedFor(ctx context.Context, node, serial string, issuedAt time.Time) (bool, error) + func (a *Allocator) CodeBuildRegistrationPaths(ctx context.Context) ([]RegistrationPath, error) + func (a *Allocator) ComputeBarrierInForce(ctx context.Context) (ComputeBarrier, bool, error) + func (a *Allocator) ComputeClear(ctx context.Context) (ComputeClearance, error) + func (a *Allocator) DecideEnrollment(ctx context.Context, name, fingerprint, decision, certPEM string) error + func (a *Allocator) Decommission(ctx context.Context, req DecommissionRequest) (bool, error) + func (a *Allocator) DirectJobIdentity(ctx context.Context, jobID string) (int64, bool, error) + func (a *Allocator) DropComputeBarrier(ctx context.Context, id string) error + func (a *Allocator) EndedLeaseNode(ctx context.Context, leaseID string) (string, error) + func (a *Allocator) Enrollments(ctx context.Context, want string) ([]Enrollment, error) + func (a *Allocator) Escrow(ctx context.Context, tier string, want int) ([]*Lease, error) + func (a *Allocator) ExpireForTest(ctx context.Context, leaseID string) error + func (a *Allocator) ForceDestroyCandidates(ctx context.Context, tier, node string) ([]ForceCandidate, error) + func (a *Allocator) ForceRelease(ctx context.Context, leaseID string) (ForceReleaseResult, error) + func (a *Allocator) ForceTargets(ctx context.Context, generation int64) ([]state.ForceTarget, error) + func (a *Allocator) ForceTerminate(ctx context.Context, leaseID string) error + func (a *Allocator) ForgetEveryNode(ctx context.Context) error + func (a *Allocator) ForgetPoolRunner(ctx context.Context, leaseID string) error + func (a *Allocator) Headroom(ctx context.Context, tier string) (int, error) + func (a *Allocator) Heartbeat(ctx context.Context, leaseID string, epoch int64) error + func (a *Allocator) Held(ctx context.Context) ([]HeldLease, error) + func (a *Allocator) HistoryFailureReason(ctx context.Context, leaseID string) (string, error) + func (a *Allocator) HistoryOutcome(ctx context.Context, leaseID string) (string, error) + func (a *Allocator) HistoryOutcomesForRequest(ctx context.Context, requestID int64) ([]string, error) + func (a *Allocator) IdentifyDirectJob(ctx context.Context, jobID string) (int64, error) + func (a *Allocator) IdentifyPoolSlot(ctx context.Context, leaseID string) (int64, error) + func (a *Allocator) IdlePoolRunners(ctx context.Context, tier string) ([]PoolRunner, error) + func (a *Allocator) InvalidateBarrierRun(ctx context.Context, node string) error + func (a *Allocator) InvalidateEveryBarrierRun(ctx context.Context) error + func (a *Allocator) JobForLease(ctx context.Context, leaseID string) (LeaseJob, error) + func (a *Allocator) JoinTokens(ctx context.Context) ([]JoinToken, error) + func (a *Allocator) LatestForceDestroy(ctx context.Context) (state.ForceDestroy, bool, error) + func (a *Allocator) LaunchedLeaseIDs(ctx context.Context, node string) (map[string]bool, error) + func (a *Allocator) Lease(ctx context.Context, leaseID string) (*Lease, error) + func (a *Allocator) LeaseClosure(ctx context.Context, leaseID string) (LeaseClosure, error) + func (a *Allocator) LeaseTTL() time.Duration + func (a *Allocator) LiveCertsFor(ctx context.Context, node string) ([]IssuedCert, error) + func (a *Allocator) LookupEnrollment(ctx context.Context, name string) (Enrollment, bool, error) + func (a *Allocator) MarkDeregistered(ctx context.Context, leaseID string) error + func (a *Allocator) MarkFailure(ctx context.Context, leaseID string, epoch int64, reason string) error + func (a *Allocator) NewJoinToken(ctx context.Context, ttl time.Duration, uses int, note string) (string, error) + func (a *Allocator) NodeFenceOf(ctx context.Context, node string) (NodeFence, bool, error) + func (a *Allocator) NodeGone(ctx context.Context, name string, epoch int64) error + func (a *Allocator) NodeInventories(ctx context.Context) ([]NodeInventory, error) + func (a *Allocator) NodeWireVersions(ctx context.Context) ([]NodeWire, error) + func (a *Allocator) NodeWithdrawn(ctx context.Context, name string, epoch int64, incarnation string) error + func (a *Allocator) OpenForceDestroy(ctx context.Context) (state.ForceDestroy, bool, error) + func (a *Allocator) PendingForceTargets(ctx context.Context, generation int64, tier string) ([]state.ForceTarget, error) + func (a *Allocator) PoolRunnerByLease(ctx context.Context, leaseID string) (PoolRunner, error) + func (a *Allocator) PoolRunnerByName(ctx context.Context, name string) (PoolRunner, error) + func (a *Allocator) PoolRunners(ctx context.Context, tier string) ([]PoolRunner, error) + func (a *Allocator) PreserveRecoveredBusyPoolRunner(ctx context.Context, runner PoolRunner) error + func (a *Allocator) Quarantined(ctx context.Context) ([]QuarantinedLease, error) + func (a *Allocator) QuarantinedLeaseIDs(ctx context.Context, node string) (map[string]bool, error) + func (a *Allocator) Quiescence(ctx context.Context) (Quiescence, error) + func (a *Allocator) Reap(ctx context.Context) (int, error) + func (a *Allocator) Reconcile(ctx context.Context, node string, running []string) (int, error) + func (a *Allocator) RecordBarrierObservation(ctx context.Context, obs BarrierObservation) error + func (a *Allocator) RecordIssued(ctx context.Context, name, fingerprint, certPEM string) (string, error) + func (a *Allocator) RecordIssuedCert(ctx context.Context, c IssuedCert) error + func (a *Allocator) RecordJobResult(ctx context.Context, leaseID, result string, runID int64) error + func (a *Allocator) RecordRenewedCert(ctx context.Context, cert IssuedCert, parent string, parentIssuedAt time.Time) error + func (a *Allocator) RecordedJobResult(ctx context.Context, leaseID string) (string, error) + func (a *Allocator) RegisterNode(ctx context.Context, reg NodeRegistration) (int64, error) + func (a *Allocator) RegisterPoolRunner(ctx context.Context, runner PoolRunner) error + func (a *Allocator) RegisteredNodes(ctx context.Context) ([]RegisteredNode, error) + func (a *Allocator) Release(ctx context.Context, leaseID string, epoch int64, outcome Phase) error + func (a *Allocator) ReleaseFailed(ctx context.Context, leaseID string, epoch int64, reason string) error + func (a *Allocator) RemoteCostNodes(ctx context.Context) ([]config.RemoteCostNode, error) + func (a *Allocator) RequestComputeBarrier(ctx context.Context, generation int64, actor string) (ComputeBarrier, error) + func (a *Allocator) RequestEnrollment(ctx context.Context, name, fingerprint, csrPEM string) (Enrollment, error) + func (a *Allocator) RequestEnrollmentWithToken(ctx context.Context, name, fingerprint, csrPEM, token string) (Enrollment, error) + func (a *Allocator) RequestForceDestroy(ctx context.Context, req state.ForceDestroyRequest) (state.ForceDestroy, error) + func (a *Allocator) Reserve(ctx context.Context, tier string) (*Lease, error) + func (a *Allocator) Resize(ctx context.Context, leaseID string, epoch int64, instanceType string, ...) error + func (a *Allocator) ResolveQuarantine(ctx context.Context, leaseID string, outcome Phase) error + func (a *Allocator) ResolveQuarantineFailed(ctx context.Context, leaseID, reason string) error + func (a *Allocator) ResolveQuarantineFor(ctx context.Context, node string, running []string, epoch int64) (int, error) + func (a *Allocator) RetirePoolRunner(ctx context.Context, leaseID string) error + func (a *Allocator) RetireRecoveredPoolRunner(ctx context.Context, runner PoolRunner) (PoolRunner, error) + func (a *Allocator) RevokeCert(ctx context.Context, serial, node, reason string) error + func (a *Allocator) RevokeNode(ctx context.Context, node, reason string) ([]IssuedCert, error) + func (a *Allocator) RevokedCerts(ctx context.Context) ([]RevokedCert, error) + func (a *Allocator) RunningWithReplacedHolder(ctx context.Context) ([]ReplacedHolderLease, error) + func (a *Allocator) ServiceableRunnerLeaseIDs(ctx context.Context, tier string) ([]string, error) + func (a *Allocator) SettleCompletionOnTerminalLease(ctx context.Context, leaseID string, leaseEpoch int64, outcome Phase) (bool, error) + func (a *Allocator) SettleForceTarget(ctx context.Context, generation int64, leaseID, disposition, detail string) error + func (a *Allocator) SettlePoolRunner(ctx context.Context, tier string, requestID int64) error + func (a *Allocator) SpendJoinToken(ctx context.Context, token string) error + func (a *Allocator) StartPoolRunner(ctx context.Context, leaseID, tier string, runnerID int64, runnerName string, ...) (PoolRunner, error) + func (a *Allocator) Stranded(ctx context.Context, ids []string) ([]string, error) + func (a *Allocator) Usage(ctx context.Context) (Usage, error) + type AttributedFailure struct + Detail string + DisruptedAt string + Disruption Disruption + LeaseID string + Node string + Result string + ResultAt string + RunID int64 + Tier string + type BarrierObservation struct + BarrierID string + Empty bool + Fence NodeFence + Node string + type ClearanceState int + const ClearanceBelowProtocol + const ClearanceProved + const ClearanceRunning + const ClearanceSettling + const ClearanceUnknown + const ClearanceUnreachable + const ClearanceWaiting + func (s ClearanceState) String() string + type ComputeBarrier struct + Generation int64 + ID string + RequestedAt string + RequestedBy string + type ComputeClearance struct + AdmissionGeneration int64 + AdmissionSealed bool + BarrierID string + Excluded []Exclusion + Generation int64 + Nodes []NodeClearance + Requested bool + func (c ComputeClearance) Blocking() []NodeClearance + func (c ComputeClearance) Clear() bool + func (c ComputeClearance) Stale() bool + func (c ComputeClearance) Unproven() []string + type DecommissionRequest struct + Actor string + Force bool + Node string + type Disruption string + const DisruptionGuestAbsent + const DisruptionHeldPastLimit + const DisruptionNodeForgotten + const DisruptionReclaimed + func (d Disruption) Valid() bool + type Enrollment struct + CSRPEM string + CertPEM string + DecidedAt string + Fingerprint string + Name string + RequestedAt string + Source string + State string + type Exclusion struct + Actor string + At string + Node string + Proven bool + type ForceCandidate struct + ID string + Node string + Phase Phase + RunID string + SchedulerRequest int64 + Since string + Tier string + type ForceReleaseResult struct + Node string + Pending bool + type HeldLease struct + ForceRequested bool + Holder Holder + ID string + Memory config.ByteSize + Node string + Since string + State Phase + Tier string + VCPU int + type Holder struct + Incarnation string + NodeIncarnation string + NodeKnown bool + NodeLive bool + NodeSeenAt string + func (h Holder) Replaced() bool + type InventoryReport struct + ReceivedAt string + ReportedRunning int + type IssuedCert struct + IssuedAt string + Node string + NotAfter string + Serial string + Source string + type JoinToken struct + CreatedAt string + ExpiresAt string + Note string + Uses int + type Lease struct + DisruptedAt string + Disruption Disruption + Epoch int64 + FailureReason string + ForceRelease bool + GuestOS config.GuestOS + HeldSince string + HolderIncarnation string + ID string + InstanceType string + MacOSSlot bool + Memory config.ByteSize + Node string + Phase Phase + PreferenceRank int + Provider config.ProviderKind + Providers []config.ProviderKind + RequestID int64 + RequestedMemory config.ByteSize + RequestedVCPU int + RunID int64 + TargetNode string + Tier string + VCPU int + type LeaseClosure struct + FinishedAt time.Time + Known bool + Terminal bool + type LeaseJob struct + RequestID int64 + RunID int64 + Tier string + type Limits struct + MaxMemory config.ByteSize + MaxVCPU int + Nodes map[string]config.NodePolicy + type NodeClearance struct + ClearAt string + EmptySince string + Node string + State ClearanceState + WireVersion int + type NodeFence struct + Dispatch int64 + Epoch int64 + Live bool + WireVersion int + type NodeInventory struct + Live bool + Node string + Report *InventoryReport + type NodeRegistration struct + CodeBuildFleet string + CodeBuildJITPath string + CodeBuildRegion string + Digest string + EC2Shapes []config.RemoteShape + Incarnation string + Memory config.ByteSize + Name string + Provider config.ProviderKind + Release string + Site string + VCPU int + WireMax int + WireMin int + WireVersion int + type NodeWire struct + Digest string + Epoch int64 + Live bool + Max int + Min int + Name string + Negotiated int + Release string + type Option func(*Allocator) + func WithClock(now func() time.Time) Option + func WithLeaseTTL(d time.Duration) Option + func WithPlacement(p config.PlacementPolicy) Option + type Outstanding struct + Deregistered bool + ID string + Node string + Phase Phase + RunID string + Since string + Tier string + type Phase string + const PhaseAssigned + const PhaseBusy + const PhaseCapacity + const PhaseCustody + const PhaseDone + const PhaseFailed + const PhaseLaunching + const PhaseOnline + const PhaseQuarantine + const PhaseTeardown + func (p Phase) Terminal() bool + type PoolRunner struct + ActualRequestID int64 + JobID string + LaunchRequestID int64 + LeaseID string + RunID int64 + RunnerID int64 + RunnerName string + SourceAcknowledged bool + Status string + Tier string + type QuarantinedLease struct + ID string + Memory config.ByteSize + Node string + Since string + Tier string + VCPU int + type Quiescence struct + Generation int64 + Outstanding []Outstanding + Sealed bool + func (q Quiescence) Escrowed() int + func (q Quiescence) Quiet() bool + func (q Quiescence) RegistrationUnconfirmed() int + type RegisteredNode struct + DecommissionProven bool + Decommissioned string + DecommissionedBy string + Live bool + Name string + Provider config.ProviderKind + Site string + type RegistrationPath struct + Decommissioned bool + Node string + Path string + Region string + type ReplacedHolderLease struct + Holder Holder + ID string + LastRenewed string + Memory config.ByteSize + Node string + State Phase + Tier string + VCPU int + type RevokedCert struct + Node string + Reason string + RevokedAt string + Serial string + type Usage struct + Leases int + Memory config.ByteSize + VCPU int