Documentation
¶
Index ¶
Constants ¶
const DefaultMaxTokens = 2048
DefaultMaxTokens is used when Input.MaxTokens is unset or zero. It leaves headroom for reasoning models that spend part of the budget on hidden reasoning tokens before emitting a visible completion; the previous default of 256 was too tight and produced empty completions against such models.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input struct {
RepoDir string // root of the git repository (working dir for git log)
RecordFiles []string // paths to draft blueprint records to enrich
APIKey string // LLM API key; falls back to OPENAI_API_KEY or ANTHROPIC_API_KEY env vars
Provider string // "openai" or "anthropic"; auto-detected from env vars if empty
Model string // optional model override; sensible defaults per provider
MaxTokens int // optional max_tokens override; unset/zero uses DefaultMaxTokens
LLMBaseURL string // optional base URL for local LLMs (e.g., http://localhost:1234); provider path appended automatically
Progress func(msg string) // optional; called at each stage per record for progress reporting
}
Input holds everything needed to run git history enrichment on a set of draft records.
type Result ¶
type Result struct {
RecordFilePath string
Intent string
Skipped bool // no commits found or no LLM configured
Err error // non-fatal; caller logs and continues
}
Result is the outcome of enriching one record.
func Enrich ¶
Enrich collects git commit history for each record's affected_scope files, synthesizes an intent summary via LLM, and updates each record's intent field in place. Per-record errors are captured in Result.Err rather than returned; the error return is reserved for structural failures that prevent any enrichment.