threadrespond

package
v0.10.257 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2026 License: MIT Imports: 24 Imported by: 0

Documentation

Overview

Package threadrespond plans and posts responses to existing inline review threads through the shared LLM, reviewplan, ledger, and outbox boundaries.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AcquireFunc

type AcquireFunc func(string) (Lock, error)

AcquireFunc acquires one non-blocking live-run lock.

type Lock

type Lock interface {
	Release() error
}

Lock is a held live-run lock.

type Options

type Options struct {
	Store        Store
	Provider     outbox.LiveProvider
	Adapter      llm.Adapter
	Limiter      outbox.Limiter
	Layout       statepaths.Layout
	Acquire      AcquireFunc
	TaskProgress llmlifecycle.Progress
	Now          func() time.Time

	NewRunID       func() string
	NewActionID    func(reviewplan.ActionKind) (string, error)
	NewStepID      func() string
	ModelTier      config.ModelTier
	ModelOverride  string
	EffortOverride string
}

Options contains response-run dependencies.

type Request

type Request struct {
	PRRef            gitprovider.PRRef
	PRURL            string
	ProfileName      string
	Profile          config.Profile
	PostingIdentity  gitprovider.Identity
	DryRun           bool
	NoResolveThreads bool
	Rerun            bool
	RetryRunID       string
}

Request identifies one response run.

type Result

type Result struct {
	Run             ledger.Run
	PR              gitprovider.PR
	PRKey           string
	Artifacts       runartifact.Paths
	Threads         []threadcontext.Thread
	EligibleThreads []threadcontext.Thread
	Analyses        []threadanalysis.Result
	Responses       []review.ThreadResponseAction
	Plan            reviewplan.Plan
	PlannedActions  []ledger.PlannedAction
	Outbox          outbox.Result
	ExitCode        int
	Message         string
}

Result summarizes a response invocation.

func Run

func Run(ctx context.Context, opts Options, req Request) (Result, error)

Run executes a fresh response run or same-run retry.

type Store

type Store interface {
	llmlifecycle.Store
	GetRun(context.Context, string) (ledger.Run, error)
	ListRunsForHeadScope(context.Context, ledger.ListRunsForHeadScopeParams) ([]ledger.Run, error)
	AllocateRun(context.Context, ledger.AllocateRunParams) (ledger.Run, error)
	InsertPlannedAction(context.Context, ledger.PlannedAction) error
	InsertPlannedActions(context.Context, []ledger.PlannedAction) error
	ListPlannedActions(context.Context, string) ([]ledger.PlannedAction, error)
	UpdatePlannedAction(context.Context, ledger.PlannedAction) error
	CompleteRun(context.Context, string, ledger.Outcome, time.Time) error
}

Store is the durable state required by response planning and posting.

Jump to

Keyboard shortcuts

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