approvaloverride

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

Documentation

Overview

Package approvaloverride classifies explicit author override requests.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildPrompt

func BuildPrompt(req Request) string

BuildPrompt returns the deterministic prompt for one override classification.

Types

type Candidate

type Candidate struct {
	ID          string
	Source      string
	Author      gitprovider.Identity
	Body        string
	URL         string
	CreatedAt   time.Time
	UpdatedAt   time.Time
	EffectiveAt time.Time
}

Candidate is one PR-author-authored comment eligible for override classification.

type Classifier

type Classifier interface {
	ClassifyApprovalOverride(context.Context, Request) (Result, error)
}

Classifier decides whether filtered comments request approval override.

type LLMClassifier

type LLMClassifier struct {
	// contains filtered or unexported fields
}

LLMClassifier implements Classifier with structured output.

func NewLLMClassifier

func NewLLMClassifier(adapter llm.Adapter, model, effort string) *LLMClassifier

NewLLMClassifier builds an LLM-backed approval override classifier.

func (*LLMClassifier) ClassifyApprovalOverride

func (c *LLMClassifier) ClassifyApprovalOverride(ctx context.Context, req Request) (Result, error)

ClassifyApprovalOverride classifies explicit approval override requests.

type Request

type Request struct {
	PR              gitprovider.PR
	PostingIdentity gitprovider.Identity
	LatestMarkerAt  time.Time
	Candidates      []Candidate
	LogPath         string
	LLMTasksDir     string
	Now             func() time.Time
	NewSessionRowID func() string
}

Request is the full classifier input after deterministic Go filtering.

type Response

type Response struct {
	SchemaVersion             int  `json:"schema_version"`
	ApprovalOverrideRequested bool `json:"approval_override_requested"`
}

Response is the strict classifier schema.

func DecodeResponse

func DecodeResponse(data []byte) (Response, error)

DecodeResponse validates a classifier structured-output payload.

type Result

type Result struct {
	Approve bool
}

Result is the classifier's decision.

Jump to

Keyboard shortcuts

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