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 via the VCS provider, runs Temper to reproduce local failures, then spawns Smith with a targeted fix prompt. For CI 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 BatchFixParams ¶ added in v0.9.0
type BatchFixParams struct {
// WorktreePath is the git worktree for this PR's branch.
WorktreePath string
// BeadID for tracking.
BeadID string
// AnvilName for tracking.
AnvilName 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.
WorkerID string
// ExtraFlags for Claude CLI.
ExtraFlags []string
// Providers is the ordered list of AI providers to try.
Providers []provider.Provider
// FailingChecks is the list of CI checks that are failing.
FailingChecks []vcs.CICheck
// CILogs maps check name to its log output.
CILogs map[string]string
}
BatchFixParams holds the inputs for a batched CI fix attempt.
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
// VCS is the VCS provider for fetching CI check status and logs.
// Required — callers must set this before calling Fix.
VCS vcs.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.
Click to show internal directories.
Click to hide internal directories.