bugpriors

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: May 28, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package bugpriors mines recent fix-shaped commit messages from the repository's git log and renders them as a short prompt section.

The goal is to give the deep-review prompt a codebase-specific prior: instead of hunting for generic bug patterns, the reviewer learns the actual failure classes this repo has shipped. The output is plain text ready to splice into a prompt; Extract returns "" on any error (missing git, shallow clone, no commits) so a bug-priors miss never fails a review.

Index

Constants

View Source
const DefaultLookback = 30

DefaultLookback is the number of commits the extractor scans by default. Roughly two weeks of activity for a single-author codebase, long enough to surface recurring bug classes without burying the most-recent failures.

Variables

This section is empty.

Functions

func Extract

func Extract(repoRoot string, lookback int) (string, error)

Extract runs `git log -n <lookback> --pretty=%s` in repoRoot, filters to fix-shaped subjects, dedupes, caps, and returns a rendered prompt section. Returns "" on any failure or when no matches survive — callers should treat empty as "no priors available" and skip injection.

Calls never propagate git errors: missing git binary, shallow clone, no commits, non-zero exit — all return ("", nil).

func Hash

func Hash(s string) string

Hash returns a deterministic identifier for rendered priors, suitable for folding into cache keys. Empty input → empty string, which the cache helpers treat as "no priors" (legacy-equivalent).

Types

This section is empty.

Jump to

Keyboard shortcuts

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