cifix

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Mar 12, 2026 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package cifix spawns a Smith worker to fix CI failures on a PR branch.

When Bellows detects CI failures, cifix checks out the existing PR branch, fetches failing check details from GitHub, runs Temper to reproduce local failures, then spawns Smith with a targeted fix prompt. For GitHub-only checks that Temper cannot reproduce (e.g. changelog-check), Smith receives the failing check names and CI logs directly.

Index

Constants

View Source
const MaxAttempts = 2

MaxAttempts is the maximum number of CI fix attempts per PR.

Variables

This section is empty.

Functions

This section is empty.

Types

type FixParams

type FixParams struct {
	// WorktreePath is the git worktree for this PR's branch.
	WorktreePath string
	// BeadID for tracking.
	BeadID string
	// AnvilName for tracking.
	AnvilName string
	// AnvilPath to the repo root.
	AnvilPath string
	// PRNumber being fixed.
	PRNumber int
	// Branch name for the PR.
	Branch string
	// DB for state tracking.
	DB *state.DB
	// WorkerID is the state DB worker ID, used to update the log path
	// so the Hearth TUI can display live activity.
	WorkerID string
	// ExtraFlags for Claude CLI.
	ExtraFlags []string
	// TemperConfig overrides auto-detection if set.
	TemperConfig *temper.Config
	// DetectOptions controls optional steps during Temper auto-detection.
	// When TemperConfig is nil, these options are forwarded to
	// temper.DefaultConfig so that per-anvil settings (e.g. DisableGolangciLint)
	// are respected by the cifix worker.
	DetectOptions *temper.DetectOptions
	// GoRaceDetection enables a separate 'go test -race' step in Temper.
	// Only used during auto-detection (when TemperConfig is nil).
	GoRaceDetection bool
	// Providers is the ordered list of AI providers to try.
	// If empty, provider.Defaults() is used (Claude → Gemini).
	Providers []provider.Provider
}

FixParams holds the inputs for a CI fix attempt.

type FixResult

type FixResult struct {
	// Fixed is true if the CI issues were resolved.
	Fixed bool
	// Attempts is how many fix cycles were tried.
	Attempts int
	// LastTemperResult is from the last verification.
	LastTemperResult *temper.Result
	// Duration is the total time spent.
	Duration time.Duration
	// Error if the fix process itself failed.
	Error error
}

FixResult captures the outcome of a CI fix attempt.

func Fix

func Fix(ctx context.Context, p FixParams) *FixResult

Fix attempts to resolve CI failures on a PR branch.

Jump to

Keyboard shortcuts

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