classifier

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 26, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package classifier maps deterministic evidence packets to per-comment classifications via short-circuit rules and an LLM provider.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ApplyShortCircuit

func ApplyShortCircuit(e types.CommentEvidence) (string, *types.Classification)

ApplyShortCircuit is exposed for tests.

func ParseClassification

func ParseClassification(text string) (*parsedClassification, error)

ParseClassification is exposed for tests.

Types

type Diagnostics

type Diagnostics struct {
	Source     types.ClassificationSource
	RuleName   string
	RawText    string
	ParseError string
	Usage      llm.Usage
}

Diagnostics carries provenance metadata about a classification.

type Options

type Options struct {
	LLM       llm.Provider
	Model     string
	MaxTokens int
	// HistoryRewritten signals that the PR branch was force-pushed: commit
	// SHAs may be unreachable, so the prompt forbids referencing them in
	// draft replies and we strip evidence SHAs from the final classification.
	HistoryRewritten bool
}

Options configures a single classification call.

type Result

type Result struct {
	Classification types.Classification
	Diagnostics    Diagnostics
}

Result wraps a classification with its diagnostics.

func ClassifyComment

func ClassifyComment(ctx context.Context, e types.CommentEvidence, opts Options) (*Result, error)

ClassifyComment classifies a single inline comment evidence packet.

func ClassifyIssueLevel

func ClassifyIssueLevel(ctx context.Context, e types.IssueLevelEvidence, opts Options) (*Result, error)

ClassifyIssueLevel classifies a review summary or issue comment evidence packet.

Jump to

Keyboard shortcuts

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