Documentation
¶
Index ¶
- Constants
- Variables
- func AccessMode(agent *agentcore.Agent) string
- func AccessModeFromConfig(config json.RawMessage) string
- func AcquireRunLock(ctx context.Context, appID, runID string, heartbeat func()) (func(), error)
- func CheckScratchSize(root string) error
- func CleanupScratch(appID, runID string) error
- func CleanupToolState(workspaceRoot string) error
- func ConfinementRoot(root string) string
- func NewScratch(appID, runID string) (*agentcore.WorkspaceLease, error)
- func NormalizeLease(lease *agentcore.WorkspaceLease)
- func NormalizeRepositorySpec(spec *RepositoryWorkspaceSpec)
- func RequiresHostPrepared(agent *agentcore.Agent) bool
- func ResetEphemeralRoot() error
- func ShouldCleanup(lease *agentcore.WorkspaceLease, terminal bool) bool
- func ToolStateRoot(workspaceRoot string) (path string, ephemeral bool, err error)
- func UpdateRepositoryLeaseBranch(lease *agentcore.WorkspaceLease, branch string) error
- func UpdateRepositoryLeaseDetachedHead(lease *agentcore.WorkspaceLease, commit string) error
- func WorkspaceMode(agent *agentcore.Agent) string
- func WorkspaceRoot() string
- type CleanupRequest
- type FinalizeRequest
- type FinalizeResult
- type GitIdentity
- type HTTPProvider
- func (p HTTPProvider) CleanupWorkspace(ctx context.Context, req CleanupRequest) error
- func (p HTTPProvider) FinalizeWorkspace(ctx context.Context, req FinalizeRequest) (*FinalizeResult, error)
- func (p HTTPProvider) PrepareWorkspace(ctx context.Context, req PrepareRequest) (*agentcore.WorkspaceLease, error)
- func (p HTTPProvider) ResolveRepositoryWorkspace(ctx context.Context, req PrepareRequest) (*RepositoryWorkspaceSpec, error)
- type LeaseValidator
- type PrepareRequest
- type Provider
- type Registry
- type RepositoryAuth
- type RepositoryProvider
- func (p RepositoryProvider) CleanupWorkspace(_ context.Context, req CleanupRequest) error
- func (p RepositoryProvider) FinalizeWorkspace(ctx context.Context, req FinalizeRequest) (*FinalizeResult, error)
- func (p RepositoryProvider) PrepareWorkspace(ctx context.Context, req PrepareRequest) (*agentcore.WorkspaceLease, error)
- func (p RepositoryProvider) PushWorkspace(ctx context.Context, req PrepareRequest, root, message string) (json.RawMessage, error)
- func (p RepositoryProvider) ValidateWorkspace(ctx context.Context, req PrepareRequest, lease agentcore.WorkspaceLease) (*agentcore.WorkspaceLease, bool, error)
- type RepositorySpecProvider
- type RepositoryWorkspaceSpec
Constants ¶
const ( ModeHostPrepared = sdk.WorkspaceModeHostPrepared ModeRepository = sdk.WorkspaceModeRepository AccessReadOnly = "read_only" AccessReadWrite = "read_write" CleanupAlways = sdk.CleanupAlways CleanupOnTerminal = sdk.CleanupOnTerminal CleanupManual = sdk.CleanupManual RepositoryFinalizeNone = sdk.RepositoryFinalizeNone RepositoryFinalizeLocalCommit = sdk.RepositoryFinalizeLocalCommit RepositoryFinalizePushBranch = sdk.RepositoryFinalizePushBranch RepositoryFinalizeOpenPR = sdk.RepositoryFinalizeOpenPR )
const EphemeralRootEnv = "AGENT_RUNTIME_EPHEMERAL_ROOT"
const ScratchLimitBytes int64 = 512 << 20
ScratchLimitBytes bounds retained analysis data and its private package cache.
Variables ¶
var ErrDirectPublicationUnsupported = errors.New("repository provider does not support direct publication")
ErrDirectPublicationUnsupported reports a workspace provider that cannot refresh credentials for a direct push. Callers fall back to publishing with the credentials already present in the prepared checkout.
Functions ¶
func AccessMode ¶
AccessMode returns the repository access policy from an agent's execution config. An empty value preserves the runtime's legacy read-write behavior.
func AccessModeFromConfig ¶
func AccessModeFromConfig(config json.RawMessage) string
AccessModeFromConfig returns workspace.access from a raw execution config.
func AcquireRunLock ¶ added in v0.11.2
AcquireRunLock takes an exclusive advisory lock fencing a run's workspace so that two execution workers never write the same checkout concurrently. The lock lives on the workspace volume, so on a cluster-wide filesystem it is cluster-wide as well. While another holder keeps the lock the call waits, invoking heartbeat on every retry, and gives up after ten minutes. The returned release drops the lock; the lock file itself is never removed.
func CheckScratchSize ¶ added in v0.11.2
CheckScratchSize never follows symlinks. This is a storage guard, not a sandbox.
func CleanupScratch ¶ added in v0.11.2
CleanupScratch removes only the deterministic scratch path for this app/run.
func CleanupToolState ¶ added in v0.11.2
CleanupToolState removes only the deterministic state directory for one run. Workspace-local state remains owned by the workspace provider.
func ConfinementRoot ¶ added in v0.11.2
ConfinementRoot widens a repository checkout to the run directory shared by all of that run's repositories. Other workspace layouts remain unchanged.
func NewScratch ¶ added in v0.11.2
func NewScratch(appID, runID string) (*agentcore.WorkspaceLease, error)
NewScratch prepares run-local storage on the execution worker's writable volume.
func NormalizeLease ¶
func NormalizeLease(lease *agentcore.WorkspaceLease)
func NormalizeRepositorySpec ¶
func NormalizeRepositorySpec(spec *RepositoryWorkspaceSpec)
func RequiresHostPrepared ¶
func ResetEphemeralRoot ¶ added in v0.11.2
func ResetEphemeralRoot() error
ResetEphemeralRoot removes stale run directories after an execution worker restarts. It deliberately leaves unrelated entries untouched so a bad operator path cannot turn startup into a broad recursive deletion.
func ShouldCleanup ¶
func ShouldCleanup(lease *agentcore.WorkspaceLease, terminal bool) bool
func ToolStateRoot ¶ added in v0.11.2
ToolStateRoot returns the run-local directory used for regenerable toolchain state. Without an operator-configured ephemeral root it preserves the legacy workspace-local layout.
func UpdateRepositoryLeaseBranch ¶ added in v0.11.2
func UpdateRepositoryLeaseBranch(lease *agentcore.WorkspaceLease, branch string) error
UpdateRepositoryLeaseBranch records a successful create_branch operation in every field used to validate the retained checkout on a later activity.
func UpdateRepositoryLeaseDetachedHead ¶ added in v0.11.2
func UpdateRepositoryLeaseDetachedHead(lease *agentcore.WorkspaceLease, commit string) error
UpdateRepositoryLeaseDetachedHead records an intentional detached checkout without moving HEAD or reconstructing the prior branch on the next activity.
func WorkspaceMode ¶
func WorkspaceRoot ¶ added in v0.11.2
func WorkspaceRoot() string
WorkspaceRoot returns the directory holding execution workspaces on this worker's writable volume.
Types ¶
type CleanupRequest ¶
type CleanupRequest = sdk.CleanupWorkspaceRequest
type FinalizeRequest ¶
type FinalizeRequest = sdk.FinalizeWorkspaceRequest
type FinalizeResult ¶
type FinalizeResult = sdk.FinalizeWorkspaceResult
type GitIdentity ¶
type GitIdentity = sdk.GitIdentity
type HTTPProvider ¶
func (HTTPProvider) CleanupWorkspace ¶
func (p HTTPProvider) CleanupWorkspace(ctx context.Context, req CleanupRequest) error
func (HTTPProvider) FinalizeWorkspace ¶
func (p HTTPProvider) FinalizeWorkspace(ctx context.Context, req FinalizeRequest) (*FinalizeResult, error)
func (HTTPProvider) PrepareWorkspace ¶
func (p HTTPProvider) PrepareWorkspace(ctx context.Context, req PrepareRequest) (*agentcore.WorkspaceLease, error)
func (HTTPProvider) ResolveRepositoryWorkspace ¶
func (p HTTPProvider) ResolveRepositoryWorkspace(ctx context.Context, req PrepareRequest) (*RepositoryWorkspaceSpec, error)
type LeaseValidator ¶
type LeaseValidator interface {
ValidateWorkspace(ctx context.Context, req PrepareRequest, lease agentcore.WorkspaceLease) (*agentcore.WorkspaceLease, bool, error)
}
type PrepareRequest ¶
type PrepareRequest = sdk.PrepareWorkspaceRequest
type Provider ¶
type Provider interface {
PrepareWorkspace(ctx context.Context, req PrepareRequest) (*agentcore.WorkspaceLease, error)
FinalizeWorkspace(ctx context.Context, req FinalizeRequest) (*FinalizeResult, error)
CleanupWorkspace(ctx context.Context, req CleanupRequest) error
}
type Registry ¶
type Registry struct {
// contains filtered or unexported fields
}
func NewRegistry ¶
func NewRegistry() *Registry
type RepositoryAuth ¶
type RepositoryAuth = sdk.RepositoryAuth
type RepositoryProvider ¶
type RepositoryProvider struct {
RootDir string
SpecProvider RepositorySpecProvider
}
func (RepositoryProvider) CleanupWorkspace ¶
func (p RepositoryProvider) CleanupWorkspace(_ context.Context, req CleanupRequest) error
func (RepositoryProvider) FinalizeWorkspace ¶
func (p RepositoryProvider) FinalizeWorkspace(ctx context.Context, req FinalizeRequest) (*FinalizeResult, error)
func (RepositoryProvider) PrepareWorkspace ¶
func (p RepositoryProvider) PrepareWorkspace(ctx context.Context, req PrepareRequest) (*agentcore.WorkspaceLease, error)
func (RepositoryProvider) PushWorkspace ¶ added in v0.11.2
func (p RepositoryProvider) PushWorkspace(ctx context.Context, req PrepareRequest, root, message string) (json.RawMessage, error)
PushWorkspace refreshes host-owned credentials for a directly authorized push.
func (RepositoryProvider) ValidateWorkspace ¶
func (p RepositoryProvider) ValidateWorkspace(ctx context.Context, req PrepareRequest, lease agentcore.WorkspaceLease) (*agentcore.WorkspaceLease, bool, error)
type RepositorySpecProvider ¶
type RepositorySpecProvider interface {
ResolveRepositoryWorkspace(ctx context.Context, req PrepareRequest) (*RepositoryWorkspaceSpec, error)
}
type RepositoryWorkspaceSpec ¶
type RepositoryWorkspaceSpec = sdk.RepositoryWorkspaceSpec
func RepositorySpecFromLease ¶
func RepositorySpecFromLease(lease agentcore.WorkspaceLease) *RepositoryWorkspaceSpec