Documentation
¶
Overview ¶
Package workspace manages per-agent git worktrees and thread branches (RFC 6.4, D5). Merging is always a human action.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrDirty = errors.New("the main checkout has uncommitted changes; commit or stash them first")
ErrDirty is returned when apply finds uncommitted changes.
var ErrMerged = errors.New("the branch is already merged into the main checkout's current branch")
ErrMerged is returned when the branch is already in the current branch.
Functions ¶
func Apply ¶
Apply merges branch into the main checkout's current branch. It refuses on a dirty tree.
func BranchName ¶
BranchName is smif/<agent>/<thread-ulid-short>.
Types ¶
type Manager ¶
type Manager struct {
Root string
}
Manager owns worktrees under Root/<agent>.
func (*Manager) Finish ¶
Finish commits a dirty worktree ("smif: <summary> [run <id>]") and returns the head SHA and the branch diffstat against its base.
func (*Manager) GC ¶
GC deletes smif/<agent>/* branches whose last commit is older than retention, detaching the worktree first when needed. Returns how many.
func (*Manager) Prepare ¶
func (m *Manager) Prepare(a *config.Agent, scope, thread, existingBranch string) (*Workspace, error)
Prepare returns the workspace for a run.
none, direct: the main checkout. worktree: Root/<agent> on the thread branch, cleaned and verified.
existingBranch is the branch already recorded for this thread, if any.