Versions in this module Expand all Collapse all v0 v0.18.0 Oct 19, 2026 v0.17.0 Oct 16, 2026 Changes in this version + const ChangeCreate + const ChangeDelete + const ChangeModify + const DefaultProposalDiffLines + const SchemaCheckpointCreated + const SchemaCheckpointRestored + const SchemaMergeProposed + const SchemaRunOutputSealed + const SchemaRunOutputSettled + const SchemaScopeDiscarded + const SchemaScopeForked + const SchemaScopeMerged + const SchemaSupervisorDecision + const SchemaSupervisorHalt + const SchemaSupervisorInject + const SchemaWorkspaceApplied + const SchemaWorkspaceCaptured + var ErrApplyConflict = errors.New("shepherd: apply conflict") + var ErrOutputConsumed = errors.New("shepherd: retained output already settled") + var ErrSettleEffectLanded = errors.New("shepherd: settle effect landed") + type Checkpoint struct + CreatedAt time.Time + ID string + ScopeID string + Seq uint64 + Snapshot []byte + State CheckpointState + Workspace trace.WorkspaceState + type CheckpointState string + const CheckpointInvalid + const CheckpointUsed + const CheckpointValid + type MergeProposal struct + BaselineDigest string + Changes []ProposedChange + ChildScopeID string + Diff string + type MergeReviewer func(proposal MergeProposal) error + func DestructivePathReviewer(patterns []string) MergeReviewer + func DraftsOnlyReviewer(prefix string) MergeReviewer + type OutputState string + const OutputApplied + const OutputDiscarded + const OutputInvalid + const OutputReleased + const OutputSelected + const OutputUnconsumed + type ProposedChange struct + Diff string + Kind string + Path string + type RecoverOptions struct + Resolver func(scopeID, backend, path string) (sandbox.Sandbox, error) + Stats *RecoveryStats + type RecoveryStats struct + CheckpointBlobs int + ForkRecords int + ScanDuration time.Duration + SealedOutputs int + TerminalRecords int + type RetainedOutput struct + func (o *RetainedOutput) Action() SettlementAction + func (o *RetainedOutput) Baseline() trace.WorkspaceState + func (o *RetainedOutput) Changes() []ProposedChange + func (o *RetainedOutput) Diff() string + func (o *RetainedOutput) ID() string + func (o *RetainedOutput) ScopeID() string + func (o *RetainedOutput) SealedAt() time.Time + func (o *RetainedOutput) Settle(ctx context.Context, action SettlementAction) error + func (o *RetainedOutput) SettledAt() time.Time + func (o *RetainedOutput) State() OutputState + func (o *RetainedOutput) Workspace() trace.WorkspaceState + type Scope struct + func NewScope(store *trace.SQLiteTraceStore, ownerID string) *Scope + func (s *Scope) AppendFact(ctx context.Context, schemaRef, kindLabel string, payload map[string]any) (trace.AppendReceipt, error) + func (s *Scope) ApplyWorkspace(ctx context.Context, ws trace.WorkspaceState) error + func (s *Scope) Baseline() (trace.WorkspaceState, bool) + func (s *Scope) CaptureWorkspace(ctx context.Context) (trace.WorkspaceState, error) + func (s *Scope) Children() []*Scope + func (s *Scope) CreateCheckpoint(ctx context.Context, snapshot []byte) (*Checkpoint, error) + func (s *Scope) DiffWorkspace(ctx context.Context, ws trace.WorkspaceState, maxLines int) (string, []string, error) + func (s *Scope) Discard(child *Scope) error + func (s *Scope) Fork(childOwnerID string, snapshot any) (*Scope, error) + func (s *Scope) ForkPoint() string + func (s *Scope) Halt() error + func (s *Scope) ID() string + func (s *Scope) Inject(guidance string) error + func (s *Scope) Merge(child *Scope) error + func (s *Scope) OwnerID() string + func (s *Scope) Parent() *Scope + func (s *Scope) RestoreCheckpoint(ctx context.Context, cp *Checkpoint) ([]byte, error) + func (s *Scope) Sandbox() sandbox.Sandbox + func (s *Scope) Seal(ctx context.Context) (*RetainedOutput, error) + func (s *Scope) Snapshot() any + func (s *Scope) State() ScopeState + func (s *Scope) WithSandbox(sb sandbox.Sandbox, owns bool) *Scope + type ScopeManager struct + func NewScopeManager(store *trace.SQLiteTraceStore) *ScopeManager + func RecoverScopes(store *trace.SQLiteTraceStore, opts RecoverOptions) (*ScopeManager, error) + func (m *ScopeManager) ActiveScopes() []*Scope + func (m *ScopeManager) AllScopes() []*Scope + func (m *ScopeManager) CommitMerge(ctx context.Context, childID string, review MergeReviewer) error + func (m *ScopeManager) Create(ownerID string, sb sandbox.Sandbox) (*Scope, error) + func (m *ScopeManager) CreateCheckpoint(ctx context.Context, scopeID string, snapshot []byte) (*Checkpoint, error) + func (m *ScopeManager) DestroyScopeSandbox(ctx context.Context, scopeID string) error + func (m *ScopeManager) Discard(childID string) error + func (m *ScopeManager) Fork(parentID, childOwnerID string, snapshot any) (*Scope, error) + func (m *ScopeManager) ForkIsolated(parentID, childOwnerID string, snapshot any, sb sandbox.Sandbox) (*Scope, error) + func (m *ScopeManager) Get(id string) (*Scope, bool) + func (m *ScopeManager) LatestCheckpoint(scopeID string) *Checkpoint + func (m *ScopeManager) Merge(childID string) error + func (m *ScopeManager) Output(id string) (*RetainedOutput, bool) + func (m *ScopeManager) OutputsForScope(scopeID string) []*RetainedOutput + func (m *ScopeManager) ProposeMerge(ctx context.Context, childID string, maxDiffLines int) (*MergeProposal, error) + func (m *ScopeManager) PruneCheckpoints(ctx context.Context, scopeID string) + func (m *ScopeManager) PruneTerminal() int + func (m *ScopeManager) RestoreCheckpoint(ctx context.Context, checkpointID string) ([]byte, error) + func (m *ScopeManager) Seal(ctx context.Context, scopeID string) (*RetainedOutput, error) + func (m *ScopeManager) Settle(ctx context.Context, outputID string, action SettlementAction) error + type ScopeState string + const ScopeActive + const ScopeDiscarded + const ScopeMerged + type SettlementAction string + const SettleApply + const SettleDiscard + const SettleRelease + const SettleSelect + type SupervisorDeniedError struct + Changes []ProposedChange + Reason string + func (e *SupervisorDeniedError) Error() string