state

package
v0.7.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 9, 2026 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CopyDir

func CopyDir(src, dst string) error

func CopyDirFiltered added in v0.2.0

func CopyDirFiltered(src, dst string, skip func(relPath string) bool) error

CopyDirFiltered copies src into dst, skipping any relative path for which skip returns true (skip may be nil). It always skips the dst subtree itself, so it is safe when dst lives inside src (e.g. recording a workdir whose .agentprov data dir holds the snapshot store). Without that guard the walk would recurse into the snapshot it is writing and fail with "file name too long".

Types

type FileEntry

type FileEntry struct {
	Path      string
	Hash      string
	SizeBytes int64
	Mode      string
}

func BuildFileManifest

func BuildFileManifest(root string) ([]FileEntry, error)

type ForkResult

type ForkResult struct {
	AttemptID     string
	WorkspacePath string
	ForkMS        int64
	Plan          string
}

type IOProfile

type IOProfile struct {
	HotMetadataPaths    []string
	MetadataOpsEstimate int64
	CopyUpRisk          string
	UpperdirDevice      string
}

func AnalyzeIOProfile

func AnalyzeIOProfile(root string) (IOProfile, error)

type Manifest

type Manifest struct {
	Hash  string
	Files int64
	Bytes int64
}

func BuildManifest

func BuildManifest(root string) (Manifest, error)

type Service

type Service struct {
	DB    *sql.DB
	Paths store.Paths
}

func (Service) CreateDirectorySnapshot

func (s Service) CreateDirectorySnapshot(sessionID, workspacePath, name string) (string, Manifest, int64, error)

func (Service) CreateStack

func (s Service) CreateStack(taskPath string) (StackResult, error)

func (Service) CreateStackFromTemplate

func (s Service) CreateStackFromTemplate(templateNameOrID string) (StackResult, error)

func (Service) Fork

func (s Service) Fork(snapshotNameOrID string, count int) ([]ForkResult, error)

func (Service) InspectSnapshot

func (s Service) InspectSnapshot(snapshotNameOrID string) (SnapshotInfo, []SnapshotInfo, error)

func (Service) ListSnapshots

func (s Service) ListSnapshots() ([]SnapshotInfo, error)

func (Service) Plan

func (s Service) Plan(snapshotNameOrID string, rejectTainted bool) (SnapshotPlan, error)

func (Service) PlanWithPolicy

func (s Service) PlanWithPolicy(snapshotNameOrID, policy string, rejectTainted bool) (SnapshotPlan, error)

type SnapshotInfo

type SnapshotInfo struct {
	ID                  string
	Name                string
	SessionID           string
	ParentID            string
	Kind                string
	Source              string
	Path                string
	ManifestHash        string
	FileCount           int64
	Bytes               int64
	SnapshotCreateMS    int64
	Status              string
	SemanticType        string
	PhysicalType        string
	LogicalBytes        int64
	PhysicalBytes       int64
	DirtyBytesEstimate  int64
	InodeEstimate       int64
	StorageAmpRatio     float64
	HotMetadataPaths    string
	MetadataOpsEstimate int64
	CopyUpRisk          string
	UpperdirDevice      string
	CreatedAt           string
}

type SnapshotPlan

type SnapshotPlan struct {
	SnapshotID          string
	Plan                string
	Reason              string
	Score               float64
	SelectedPolicy      string
	CandidateCount      int
	SemanticType        string
	PhysicalType        string
	OverlaySkipReason   string
	DeltaFilesAdded     int64
	DeltaFilesModified  int64
	DeltaFilesDeleted   int64
	CopyUpRisk          string
	MetadataOpsEstimate int64
	SharedLowerFanout   int64
	IOFanoutBudget      int64
	UpperdirShard       string
	UpperdirDevice      string
	HotMetadataPaths    string
}

type StackResult

type StackResult struct {
	TemplateSnapshotID string
	ReadySnapshotID    string
	Attempt            ForkResult
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL