threadanalysis

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: 12 Imported by: 0

Documentation

Overview

Package threadanalysis turns normalized inline thread context into reusable lifecycle decisions through the durable LLM execution boundary.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ResponseAction

func ResponseAction(result Result) (review.ThreadResponseAction, bool)

ResponseAction converts one thread-analysis decision into a concrete response.

func ResponseActions

func ResponseActions(results []Result) []review.ThreadResponseAction

ResponseActions converts thread-analysis decisions into concrete thread responses that can be planned through reviewplan/ledger/outbox.

func ValidateCachedThread

func ValidateCachedThread(opts Options, thread threadcontext.Thread) error

ValidateCachedThread verifies that a cached analysis task still matches the current normalized thread input without invoking the provider.

Types

type Decision

type Decision string

Decision is the reusable lifecycle action selected for one thread.

const (
	DecisionSkip        Decision = "skip"
	DecisionReplyOnly   Decision = "reply_only"
	DecisionAcknowledge Decision = "acknowledge"
	DecisionClarify     Decision = "clarify"
	DecisionConcede     Decision = "concede"
	DecisionSummarize   Decision = "summarize"
)

Thread lifecycle decisions.

func (Decision) Valid

func (d Decision) Valid() bool

Valid reports whether d is a known thread analysis decision.

type Options

type Options struct {
	Store          llmlifecycle.Store
	RunID          string
	Adapter        llm.Adapter
	Model          string
	Effort         string
	LogPath        string
	LifecyclePaths llmlifecycle.Paths
	Progress       llmlifecycle.Progress
	Now            func() time.Time
	NewStepID      func() string
}

Options are explicit call-site supplied dependencies for one analysis run.

type Result

type Result struct {
	ThreadID  string   `json:"thread_id"`
	Decision  Decision `json:"decision"`
	ReplyBody string   `json:"reply_body,omitempty"`
	Summary   string   `json:"summary,omitempty"`
	Resolve   bool     `json:"resolve"`
	Rationale string   `json:"rationale,omitempty"`
}

Result is the domain result returned by thread analysis.

func AnalyzeThread

func AnalyzeThread(ctx context.Context, opts Options, thread threadcontext.Thread) (Result, error)

AnalyzeThread analyzes one normalized inline thread through the durable LLM lifecycle.

func AnalyzeThreads

func AnalyzeThreads(ctx context.Context, opts Options, threads []threadcontext.Thread, logPath func(threadcontext.Thread) (string, error)) ([]Result, error)

AnalyzeThreads analyzes normalized inline threads in order, using logPath to select each thread's provider log artifact.

Jump to

Keyboard shortcuts

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