application

package
v0.46.0 Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2026 License: AGPL-3.0 Imports: 12 Imported by: 0

Documentation

Overview

Package application owns effort lifecycle and managed-worktree use cases.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Checkout

type Checkout interface {
	worktree.Runner
	ValidateRefName(context.Context, string) (bool, error)
}

Checkout is the application boundary's Git contract. Worktree mechanics use its narrower Runner subset; effort creation additionally validates ref names.

type CreationError

type CreationError struct {
	Message         string
	Condition       string
	ChangedEffort   bool
	ChangedTopology bool
	Topology        worktree.TopologyEffects
	ManagedPath     string
	ManagedBranch   string
	Cause           error
	RollbackCause   error
	Steps           []string
}

CreationError describes a failed default managed-worktree creation and its identity-bound effort rollback outcome.

func (*CreationError) Error

func (e *CreationError) Error() string

func (*CreationError) Unwrap

func (e *CreationError) Unwrap() []error

type Dependencies

type Dependencies struct {
	ResolveRoots        func(context.Context, string) (awfgit.ControlRoots, error)
	OpenCheckout        func(string) (Checkout, error)
	OpenResident        func(string) (worktree.ResidentHandle, error)
	AcquireProjectLease func(context.Context, string, string) (Lease, error)
	Clock               func() time.Time
	UUID                func() (string, error)
	GateCommand         func(string) (string, error)
}

Dependencies are the production mechanisms selected at this application boundary. Tests compose the same boundary with controlled per-instance seams.

func ProductionDependencies

func ProductionDependencies() Dependencies

ProductionDependencies selects the repository's ordinary mechanisms.

type Kind

type Kind uint8

Kind identifies one parsed effort use case. Command grammar remains owned by the CLI adapter; this type carries only the selected application operation.

const (
	New Kind = iota + 1
	List
	Show
	Finish
	AddWorktree
	RemoveWorktree
	Integrate
)

type Lease

type Lease interface{ Release() error }

Lease is the lifetime capability returned by mutation serialization.

type Request

type Request struct {
	Kind  Kind
	Slug  string
	Title string
	Base  string
}

Request is the representation-neutral input to one effort use case.

type Result

type Result struct {
	Document presentation.Document
	Release  func() error
}

Result is a completely mapped application result. Release retains the mutation lease through the caller's final presentation write.

func Execute

func Execute(ctx context.Context, root string, request Request, expectedArchiveMarker func() ([]byte, error)) (Result, error)

Execute runs one request against production dependencies.

func ExecuteWith

func ExecuteWith(ctx context.Context, root string, request Request, expectedArchiveMarker func() ([]byte, error), deps Dependencies) (Result, error)

ExecuteWith runs one request against explicitly selected dependencies.

Jump to

Keyboard shortcuts

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