reviewfix

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2026 License: MIT Imports: 13 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 gh, 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 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
}

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 Fix

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

Fix fetches review comments and spawns Smith to address them.

type ReviewComment

type ReviewComment struct {
	Author   string `json:"author"`
	Body     string `json:"body"`
	Path     string `json:"path"`
	Line     int    `json:"line"`
	State    string `json:"state"`
	ThreadID string `json:"id"`
}

ReviewComment represents a PR review comment from GitHub.

Jump to

Keyboard shortcuts

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