Documentation
¶
Index ¶
- Constants
- func BuildRunPrompt(cfg *Config, task *Task) string
- func FormatCheckReport(report *CheckReport) string
- func FormatContextReport(report *ContextReport) string
- func FormatDoctorReport(report *DoctorReport) string
- func FormatGCReport(report *GCReport) string
- func FormatMonitorReport(report *MonitorReport) string
- func FormatOwnerInbox(inbox *OwnerInbox) string
- func FormatPromotionList(tasks []*Task) string
- func FormatQueueSummary(summary *RunQueueSummary) string
- func FormatReleasePlan(plan *ReleasePlan) string
- func FormatReleaseWavePlan(waves *ReleaseWavePlan) string
- func FormatReleaseWaveRollouts(rollouts []*ReleaseWavePlan) string
- func FormatReviewList(tasks []*Task) string
- func FormatRunSummary(summary *RunSummary) string
- func FormatTaskList(tasks []*Task) string
- func SaveConfig(path string, cfg *Config) error
- func SaveTask(project Project, task *Task) error
- func SplitCommaInput(raw string) []string
- type BinaryRunner
- type CheckConfig
- type CheckIssue
- type CheckOptions
- type CheckReport
- type CommandCheck
- type CommandResult
- type Config
- type ConfirmDirtyWorkspaceFunc
- type ContentRule
- type ContextConfig
- func AugmentRunContexts(contexts []ContextConfig, goal string) []ContextConfig
- func DetectContexts(root string) []ContextConfig
- func EnsureOperationalContexts(contexts []ContextConfig, goal string, extraElements []string, ...) []ContextConfig
- func NormalizeContexts(contexts []ContextConfig) []ContextConfig
- func ParseContextSpecs(raw string) []ContextConfig
- func ResolveContext(cfg *Config, raw string) (*ContextConfig, error)
- func ResolveTaskContext(cfg *Config, task *Task) *ContextConfig
- func SuggestContexts(ctx context.Context, prov provider.Provider, req ContextSuggestionRequest) ([]ContextConfig, error)
- type ContextReport
- type ContextSuggestionRequest
- type ContextSummary
- type DeliveryReport
- type DirtyWorkspaceCheckpoint
- type DoctorReport
- type ExecuteTaskOptions
- type GCConfig
- type GCReport
- type InitOptions
- type InitResult
- type MonitorEvent
- type MonitorOptions
- type MonitorReport
- type MonitorRolloutTotals
- type MonitorTask
- type MonitorTaskTotals
- type OwnerInbox
- type OwnerInboxEntry
- type Project
- type ProjectConfig
- type QueueOptions
- type QueueRunOptions
- type ReleasePlan
- type ReleasePlanOptions
- type ReleaseWavePlan
- func AbortReleaseWaveRollout(project Project, rolloutID, note string) (*ReleaseWavePlan, error)
- func AdvanceReleaseWaveRollout(project Project, rolloutID string) (*ReleaseWavePlan, error)
- func ApplyReleaseWavePlan(project Project, waves *ReleaseWavePlan, note, batchBase string) (*ReleaseWavePlan, error)
- func ApproveReleaseWaveGate(project Project, rolloutID string, waveOrder int, note string) (*ReleaseWavePlan, error)
- func BuildReleaseWavePlan(project Project, cfg *Config, opts ReleasePlanOptions, groupBy string) (*ReleaseWavePlan, error)
- func FilterReleaseWaveRolloutsByEnvironment(rollouts []*ReleaseWavePlan, environment string) []*ReleaseWavePlan
- func ListReleaseWaveRollouts(project Project) ([]*ReleaseWavePlan, error)
- func PauseReleaseWaveRollout(project Project, rolloutID, note string) (*ReleaseWavePlan, error)
- func RejectReleaseWaveGate(project Project, rolloutID string, waveOrder int, note string) (*ReleaseWavePlan, error)
- func ResumeReleaseWaveRollout(project Project, rolloutID, note string) (*ReleaseWavePlan, error)
- type RunConfig
- type RunQueueSummary
- type RunRequest
- type RunResult
- type RunSummary
- func ExecuteTask(ctx context.Context, project Project, cfg *Config, task *Task, runner Runner, ...) (*RunSummary, error)
- func RerunTask(ctx context.Context, project Project, cfg *Config, taskID string, ...) (*RunSummary, error)
- func RerunTaskWithOptions(ctx context.Context, project Project, cfg *Config, taskID string, ...) (*RunSummary, error)
- func RunTask(ctx context.Context, project Project, cfg *Config, goal string, runner Runner) (*RunSummary, error)
- func RunTaskWithOptions(ctx context.Context, project Project, cfg *Config, goal string, runner Runner, ...) (*RunSummary, error)
- type RunTaskOptions
- type Runner
- type Task
- func ApproveTaskReview(project Project, id, note string) (*Task, error)
- func EnqueueTask(project Project, goal, entryPoint string, opts ...QueueOptions) (*Task, error)
- func ListPromotableTasks(project Project) ([]*Task, error)
- func ListReviewableTasks(project Project) ([]*Task, error)
- func ListTasks(project Project) ([]*Task, error)
- func LoadTask(project Project, id string) (*Task, error)
- func NewTask(goal, entryPoint string) (*Task, error)
- func NextQueuedTask(project Project) (*Task, error)
- func NextRunnableTask(project Project, cfg *Config, opts QueueRunOptions) (*Task, error)
- func PromoteApprovedTasks(ctx context.Context, project Project, note string) ([]*Task, error)
- func PromoteApprovedTasksForOwner(ctx context.Context, project Project, cfg *Config, owner, note string) ([]*Task, error)
- func PromoteTask(ctx context.Context, project Project, id, note string) (*Task, error)
- func RejectTaskReview(project Project, id, note string) (*Task, error)
- type TaskStatus
- type Workspace
- type WorkspacePrepareOptions
Constants ¶
View Source
const ( ConfigRelPath = ".ggcode/harness.yaml" StateRelDir = ".ggcode/harness" )
View Source
const ( VerificationPassed = "passed" VerificationFailed = "failed" VerificationSkipped = "skipped" )
View Source
const ( ReleaseGroupByOwner = "owner" ReleaseGroupByContext = "context" ReleaseWavePlanned = "planned" ReleaseWaveActive = "active" ReleaseWavePaused = "paused" ReleaseWaveAborted = "aborted" ReleaseWaveCompleted = "completed" ReleaseGatePending = "pending" ReleaseGateApproved = "approved" ReleaseGateRejected = "rejected" )
View Source
const ( ReviewPending = "pending" ReviewApproved = "approved" ReviewRejected = "rejected" )
View Source
const PromotionApplied = "promoted"
Variables ¶
This section is empty.
Functions ¶
func BuildRunPrompt ¶
func FormatCheckReport ¶
func FormatCheckReport(report *CheckReport) string
func FormatContextReport ¶
func FormatContextReport(report *ContextReport) string
func FormatDoctorReport ¶
func FormatDoctorReport(report *DoctorReport) string
func FormatGCReport ¶
func FormatMonitorReport ¶
func FormatMonitorReport(report *MonitorReport) string
func FormatOwnerInbox ¶
func FormatOwnerInbox(inbox *OwnerInbox) string
func FormatPromotionList ¶
func FormatQueueSummary ¶
func FormatQueueSummary(summary *RunQueueSummary) string
func FormatReleasePlan ¶
func FormatReleasePlan(plan *ReleasePlan) string
func FormatReleaseWavePlan ¶
func FormatReleaseWavePlan(waves *ReleaseWavePlan) string
func FormatReleaseWaveRollouts ¶
func FormatReleaseWaveRollouts(rollouts []*ReleaseWavePlan) string
func FormatReviewList ¶
func FormatRunSummary ¶
func FormatRunSummary(summary *RunSummary) string
func FormatTaskList ¶
func SaveConfig ¶
func SplitCommaInput ¶ added in v1.1.6
SplitCommaInput trims and splits a comma-separated user input string.
Types ¶
type BinaryRunner ¶
type BinaryRunner struct {
Executable string
}
func (BinaryRunner) Run ¶
func (r BinaryRunner) Run(ctx context.Context, req RunRequest) (*RunResult, error)
type CheckConfig ¶
type CheckConfig struct {
RequiredFiles []string `yaml:"required_files,omitempty"`
RequiredDirs []string `yaml:"required_dirs,omitempty"`
ContentRules []ContentRule `yaml:"content_rules,omitempty"`
Commands []CommandCheck `yaml:"commands,omitempty"`
}
type CheckIssue ¶
type CheckOptions ¶
type CheckReport ¶
type CheckReport struct {
Passed bool
Issues []CheckIssue
Commands []CommandResult
}
func CheckProject ¶
func CheckProject(ctx context.Context, project Project, cfg *Config, opts CheckOptions) (*CheckReport, error)
type CommandCheck ¶
type CommandResult ¶
type Config ¶
type Config struct {
Version int `yaml:"version"`
Project ProjectConfig `yaml:"project"`
Checks CheckConfig `yaml:"checks"`
Run RunConfig `yaml:"run"`
GC GCConfig `yaml:"gc"`
Contexts []ContextConfig `yaml:"contexts,omitempty"`
}
func DefaultConfig ¶
func LoadConfig ¶
type ConfirmDirtyWorkspaceFunc ¶ added in v1.1.8
type ConfirmDirtyWorkspaceFunc func(DirtyWorkspaceCheckpoint) (bool, error)
type ContentRule ¶
type ContextConfig ¶
type ContextConfig struct {
Name string `yaml:"name"`
Path string `yaml:"path"`
Description string `yaml:"description,omitempty"`
Owner string `yaml:"owner,omitempty"`
RequireAgent bool `yaml:"require_agent,omitempty"`
Commands []CommandCheck `yaml:"commands,omitempty"`
}
func AugmentRunContexts ¶ added in v1.1.6
func AugmentRunContexts(contexts []ContextConfig, goal string) []ContextConfig
func DetectContexts ¶ added in v1.1.6
func DetectContexts(root string) []ContextConfig
DetectContexts returns heuristic context suggestions from the current repo tree.
func EnsureOperationalContexts ¶ added in v1.1.6
func EnsureOperationalContexts(contexts []ContextConfig, goal string, extraElements []string, hintContexts []string) []ContextConfig
func NormalizeContexts ¶ added in v1.1.6
func NormalizeContexts(contexts []ContextConfig) []ContextConfig
NormalizeContexts trims, deduplicates, and canonicalizes context definitions.
func ParseContextSpecs ¶ added in v1.1.6
func ParseContextSpecs(raw string) []ContextConfig
ParseContextSpecs parses user-entered contexts like "payments" or "checkout=apps/checkout".
func ResolveContext ¶
func ResolveContext(cfg *Config, raw string) (*ContextConfig, error)
func ResolveTaskContext ¶
func ResolveTaskContext(cfg *Config, task *Task) *ContextConfig
func SuggestContexts ¶ added in v1.1.6
func SuggestContexts(ctx context.Context, prov provider.Provider, req ContextSuggestionRequest) ([]ContextConfig, error)
SuggestContexts asks the configured model for bounded-context suggestions.
type ContextReport ¶
type ContextReport struct {
Summaries []ContextSummary
}
func BuildContextReport ¶
func BuildContextReport(project Project, cfg *Config) (*ContextReport, error)
type ContextSuggestionRequest ¶ added in v1.1.6
type ContextSummary ¶
type ContextSummary struct {
Name string
Path string
Description string
Owner string
CommandCount int
TaskCount int
QueuedTasks int
RunningTasks int
BlockedTasks int
FailedTasks int
VerificationFailed int
ReviewReady int
PromotionReady int
ReleaseReady int
ActiveRollouts int
PlannedRollouts int
PausedRollouts int
AbortedRollouts int
CompletedRollouts int
PendingGates int
ApprovedGates int
RejectedGates int
LatestTask *Task
Unscoped bool
}
type DeliveryReport ¶
type DeliveryReport struct {
TaskID string `json:"task_id"`
WorkingDir string `json:"working_dir"`
ChangedFiles []string `json:"changed_files,omitempty"`
DiffStat string `json:"diff_stat,omitempty"`
Check *CheckReport `json:"check,omitempty"`
}
type DirtyWorkspaceCheckpoint ¶ added in v1.1.8
type DoctorReport ¶
type DoctorReport struct {
Project Project
Config *Config
Structural *CheckReport
Contexts int
TotalTasks int
RunningTasks int
BlockedTasks int
FailedTasks int
Retryable int
WorkerTasks int
StaleBlocked int
OrphanedWorktrees int
WorkerDrift int
VerificationFailed int
ReviewReady int
PromotionReady int
ReleaseReady int
Rollouts int
ActiveRollouts int
PlannedRollouts int
PausedRollouts int
AbortedRollouts int
CompletedRollouts int
PendingGates int
ApprovedGates int
RejectedGates int
LastTask *Task
}
type ExecuteTaskOptions ¶ added in v1.1.8
type ExecuteTaskOptions struct {
ConfirmDirtyWorkspace ConfirmDirtyWorkspaceFunc
}
type InitOptions ¶
type InitOptions struct {
Goal string
Force bool
Contexts []ContextConfig
}
type InitResult ¶
type InitResult struct {
Project Project
CreatedPaths []string
Overwritten []string
Config *Config
GitInitialized bool
ScaffoldCommit string
}
func Init ¶
func Init(dir string, opts InitOptions) (*InitResult, error)
type MonitorEvent ¶
type MonitorOptions ¶
type MonitorReport ¶
type MonitorReport struct {
GeneratedAt time.Time
SnapshotPath string
EventLogPath string
TaskTotals MonitorTaskTotals
RolloutTotals MonitorRolloutTotals
FocusTasks []*MonitorTask
RecentEvents []*MonitorEvent
}
func BuildMonitorReport ¶
func BuildMonitorReport(project Project, opts MonitorOptions) (*MonitorReport, error)
type MonitorRolloutTotals ¶
type MonitorTask ¶
type MonitorTaskTotals ¶
type OwnerInbox ¶
type OwnerInbox struct {
Entries []OwnerInboxEntry
}
func BuildOwnerInbox ¶
func BuildOwnerInbox(project Project, cfg *Config) (*OwnerInbox, error)
type OwnerInboxEntry ¶
type Project ¶
type ProjectConfig ¶
type QueueOptions ¶
type QueueRunOptions ¶
type QueueRunOptions struct {
All bool
RetryFailed bool
ResumeInterrupted bool
Owner string
ConfirmDirtyWorkspace ConfirmDirtyWorkspaceFunc
}
type ReleasePlan ¶
type ReleasePlan struct {
BatchID string `json:"batch_id"`
Tasks []*Task `json:"tasks,omitempty"`
Owners map[string]int `json:"owners,omitempty"`
Contexts map[string]int `json:"contexts,omitempty"`
GeneratedAt time.Time `json:"generated_at"`
Environment string `json:"environment,omitempty"`
OwnerFilter string `json:"owner_filter,omitempty"`
ContextFilter string `json:"context_filter,omitempty"`
GroupBy string `json:"group_by,omitempty"`
GroupLabel string `json:"group_label,omitempty"`
RolloutID string `json:"rollout_id,omitempty"`
WaveOrder int `json:"wave_order,omitempty"`
WaveStatus string `json:"wave_status,omitempty"`
GateStatus string `json:"gate_status,omitempty"`
StatusNote string `json:"status_note,omitempty"`
GateNote string `json:"gate_note,omitempty"`
ActivatedAt *time.Time `json:"activated_at,omitempty"`
GateCheckedAt *time.Time `json:"gate_checked_at,omitempty"`
PausedAt *time.Time `json:"paused_at,omitempty"`
AbortedAt *time.Time `json:"aborted_at,omitempty"`
CompletedAt *time.Time `json:"completed_at,omitempty"`
ReportPath string `json:"report_path,omitempty"`
}
func ApplyReleasePlan ¶
func ApplyReleasePlan(project Project, plan *ReleasePlan, note string) (*ReleasePlan, error)
func BuildReleasePlan ¶
func BuildReleasePlan(project Project, cfg *Config) (*ReleasePlan, error)
func BuildReleasePlanWithOptions ¶
func BuildReleasePlanWithOptions(project Project, cfg *Config, opts ReleasePlanOptions) (*ReleasePlan, error)
type ReleasePlanOptions ¶
type ReleaseWavePlan ¶
type ReleaseWavePlan struct {
RolloutID string `json:"rollout_id,omitempty"`
GroupBy string `json:"group_by"`
Groups []*ReleasePlan `json:"groups,omitempty"`
TotalTasks int `json:"total_tasks"`
GeneratedAt time.Time `json:"generated_at"`
Environment string `json:"environment,omitempty"`
OwnerFilter string `json:"owner_filter,omitempty"`
ContextFilter string `json:"context_filter,omitempty"`
}
func AbortReleaseWaveRollout ¶
func AbortReleaseWaveRollout(project Project, rolloutID, note string) (*ReleaseWavePlan, error)
func AdvanceReleaseWaveRollout ¶
func AdvanceReleaseWaveRollout(project Project, rolloutID string) (*ReleaseWavePlan, error)
func ApplyReleaseWavePlan ¶
func ApplyReleaseWavePlan(project Project, waves *ReleaseWavePlan, note, batchBase string) (*ReleaseWavePlan, error)
func ApproveReleaseWaveGate ¶
func BuildReleaseWavePlan ¶
func BuildReleaseWavePlan(project Project, cfg *Config, opts ReleasePlanOptions, groupBy string) (*ReleaseWavePlan, error)
func FilterReleaseWaveRolloutsByEnvironment ¶
func FilterReleaseWaveRolloutsByEnvironment(rollouts []*ReleaseWavePlan, environment string) []*ReleaseWavePlan
func ListReleaseWaveRollouts ¶
func ListReleaseWaveRollouts(project Project) ([]*ReleaseWavePlan, error)
func PauseReleaseWaveRollout ¶
func PauseReleaseWaveRollout(project Project, rolloutID, note string) (*ReleaseWavePlan, error)
func RejectReleaseWaveGate ¶
func ResumeReleaseWaveRollout ¶
func ResumeReleaseWaveRollout(project Project, rolloutID, note string) (*ReleaseWavePlan, error)
type RunConfig ¶
type RunConfig struct {
Mode string `yaml:"mode"`
MaxIterations int `yaml:"max_iterations"`
MaxAttempts int `yaml:"max_attempts"`
ExecutionMode string `yaml:"execution_mode,omitempty"`
PromptPreamble string `yaml:"prompt_preamble,omitempty"`
WorktreeMode string `yaml:"worktree_mode,omitempty"`
WorktreeBaseBranch string `yaml:"worktree_base_branch,omitempty"`
}
type RunQueueSummary ¶
type RunQueueSummary struct {
Executed []*RunSummary
}
func RunQueuedTasks ¶
func RunQueuedTasks(ctx context.Context, project Project, cfg *Config, runner Runner, opts QueueRunOptions) (*RunQueueSummary, error)
type RunRequest ¶
type RunSummary ¶
func ExecuteTask ¶
func ExecuteTask(ctx context.Context, project Project, cfg *Config, task *Task, runner Runner, opts ...ExecuteTaskOptions) (*RunSummary, error)
func RerunTaskWithOptions ¶ added in v1.1.8
func RerunTaskWithOptions(ctx context.Context, project Project, cfg *Config, taskID string, runner Runner, opts RunTaskOptions) (*RunSummary, error)
func RunTaskWithOptions ¶
func RunTaskWithOptions(ctx context.Context, project Project, cfg *Config, goal string, runner Runner, opts RunTaskOptions) (*RunSummary, error)
type RunTaskOptions ¶
type RunTaskOptions struct {
ContextName string
ContextPath string
ConfirmDirtyWorkspace ConfirmDirtyWorkspaceFunc
}
type Task ¶
type Task struct {
ID string `json:"id"`
Goal string `json:"goal"`
Status TaskStatus `json:"status"`
DependsOn []string `json:"depends_on,omitempty"`
ContextName string `json:"context_name,omitempty"`
ContextPath string `json:"context_path,omitempty"`
EntryPoint string `json:"entry_point,omitempty"`
Attempt int `json:"attempt,omitempty"`
LogPath string `json:"log_path,omitempty"`
WorkspacePath string `json:"workspace_path,omitempty"`
WorkspaceMode string `json:"workspace_mode,omitempty"`
BranchName string `json:"branch_name,omitempty"`
WorkerID string `json:"worker_id,omitempty"`
WorkerStatus string `json:"worker_status,omitempty"`
WorkerPhase string `json:"worker_phase,omitempty"`
WorkerProgress string `json:"worker_progress,omitempty"`
ChangedFiles []string `json:"changed_files,omitempty"`
VerificationStatus string `json:"verification_status,omitempty"`
VerificationReportPath string `json:"verification_report_path,omitempty"`
ReviewStatus string `json:"review_status,omitempty"`
ReviewNotes string `json:"review_notes,omitempty"`
ReviewedAt *time.Time `json:"reviewed_at,omitempty"`
PromotionStatus string `json:"promotion_status,omitempty"`
PromotionNotes string `json:"promotion_notes,omitempty"`
PromotedAt *time.Time `json:"promoted_at,omitempty"`
ReleaseBatchID string `json:"release_batch_id,omitempty"`
ReleaseNotes string `json:"release_notes,omitempty"`
ReleasedAt *time.Time `json:"released_at,omitempty"`
ExitCode int `json:"exit_code,omitempty"`
Error string `json:"error,omitempty"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
StartedAt *time.Time `json:"started_at,omitempty"`
FinishedAt *time.Time `json:"finished_at,omitempty"`
}
func EnqueueTask ¶
func EnqueueTask(project Project, goal, entryPoint string, opts ...QueueOptions) (*Task, error)
func ListPromotableTasks ¶
func ListReviewableTasks ¶
func NextQueuedTask ¶
func NextRunnableTask ¶
func NextRunnableTask(project Project, cfg *Config, opts QueueRunOptions) (*Task, error)
func PromoteApprovedTasks ¶
func PromoteTask ¶
type TaskStatus ¶
type TaskStatus string
const ( TaskBlocked TaskStatus = "blocked" TaskQueued TaskStatus = "queued" TaskRunning TaskStatus = "running" TaskCompleted TaskStatus = "completed" TaskFailed TaskStatus = "failed" TaskAbandoned TaskStatus = "abandoned" )
type Workspace ¶
func PrepareWorkspace ¶
type WorkspacePrepareOptions ¶ added in v1.1.8
type WorkspacePrepareOptions struct {
ConfirmDirtyWorkspace ConfirmDirtyWorkspaceFunc
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.