reviewfix

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Mar 23, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package reviewfix spawns a Smith worker to address PR review comments.

When Bellows detects "changes requested" on a PR, reviewfix fetches the review comments via the VCS provider, constructs a targeted fix prompt, and spawns Smith to address them. It then pushes the fixes to the PR branch.

Index

Constants

This section is empty.

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
	// Comments is the list of review comments to address.
	Comments []vcs.ReviewComment
	// VCS is the VCS provider for thread resolution.
	VCS vcs.Provider
}

BatchFixParams holds the inputs for a batched review 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 is 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
	// MaxAttempts is the maximum fix attempts for review comments.
	MaxAttempts int
	// ExtraFlags for Claude CLI.
	ExtraFlags []string
	// 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 repository operations. When set,
	// it is used for GetRepoOwnerAndName instead of creating a throwaway instance.
	VCS vcs.Provider
}

FixParams holds the inputs for a review fix attempt.

type FixResult

type FixResult struct {
	// Addressed is true if Smith successfully pushed review fixes.
	Addressed bool
	// Attempts is how many fix cycles were tried.
	Attempts int
	// CommentsFound is how many review comments were fetched.
	CommentsFound int
	// Duration is the total time spent.
	Duration time.Duration
	// Error if the fix process itself failed.
	Error error
}

FixResult captures the outcome of addressing review comments.

func BatchFix added in v0.9.0

func BatchFix(ctx context.Context, p BatchFixParams) *FixResult

BatchFix combines multiple review comments into one Smith prompt. Use this when copilot_batch_review_fixes is enabled and the provider is Copilot.

func Fix

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

Fix fetches review comments and spawns Smith to address them.

Jump to

Keyboard shortcuts

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