Documentation
¶
Overview ¶
Package review implements automated PR review polling and fix prompt generation.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func SanitizeReviewBody ¶ added in v0.107.4
SanitizeReviewBody strips XML/HTML-like tags from the review body to prevent prompt injection.
Types ¶
type FixPromptGenerator ¶
type FixPromptGenerator interface {
Generate(ctx context.Context, opts GenerateOpts) error
}
FixPromptGenerator generates a fix prompt file in the inbox directory when a PR receives a request-changes review.
func NewFixPromptGenerator ¶
func NewFixPromptGenerator() FixPromptGenerator
NewFixPromptGenerator creates a new FixPromptGenerator.
type GenerateOpts ¶
type GenerateOpts struct {
InboxDir string
OriginalPromptName string // filename without path, used to derive fix prompt name
Branch string
PRURL string
RetryCount int
ReviewBody string
}
GenerateOpts holds the options for generating a fix prompt.
type PromptManager ¶ added in v0.119.2
type PromptManager interface {
ReadFrontmatter(ctx context.Context, path string) (*prompt.Frontmatter, error)
Load(ctx context.Context, path string) (*prompt.PromptFile, error)
MoveToCompleted(ctx context.Context, path string) error
SetStatus(ctx context.Context, path string, status string) error
IncrementRetryCount(ctx context.Context, path string) error
}
PromptManager is the subset of prompt.Manager that the review package uses.
type ReviewPoller ¶ added in v0.17.37
ReviewPoller watches all in_review prompts, fetches GitHub review state, generates fix prompts on request-changes, and triggers merge on approval.
func NewReviewPoller ¶ added in v0.17.37
func NewReviewPoller( queueDir string, inboxDir string, collaboratorFetcher git.CollaboratorFetcher, maxRetries int, pollInterval time.Duration, fetcher git.ReviewFetcher, prMerger git.PRMerger, promptManager PromptManager, generator FixPromptGenerator, projectName string, n notifier.Notifier, ) ReviewPoller
NewReviewPoller creates a new ReviewPoller.