findings

package
v0.58.0 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package findings reads a review's findings file in the shape steps/review.md fixes: a `key: value` header, a categories list, and a block per finding with the verdict and reason resolve appends.

Index

Constants

View Source
const LastRound = 2

LastRound is the highest round a task gets: round two exists so fixes get read, and a third reviewer would only repeat it.

Variables

View Source
var ErrNoHeader = errors.New("findings: no header")

ErrNoHeader is a file without the header's task and round.

Functions

func Latest added in v0.58.0

func Latest(dir string) string

Latest is the highest round's file in dir, or "".

func Reopens added in v0.40.0

func Reopens(status string) bool

Reopens reports whether a prior finding's status awaits a verdict.

func Series added in v0.58.0

func Series(dir string) []string

Series is the round files in dir, round one first. Parsing is left to the caller, because each treats a file that does not parse its own way.

Types

type Decline added in v0.49.0

type Decline string

Decline is why no next round is allowed.

const (
	// Unsettled is round one holding findings resolve has not answered: a
	// round two then could only say `still open`.
	Unsettled Decline = "unsettled"
	// Exhausted is the last round already written.
	Exhausted Decline = "exhausted"
	// Merged is a branch whose content main already holds.
	Merged Decline = "merged"
)

type File

type File struct {
	Task       string
	Round      string
	Reviewed   string // the sha, plus ` dirty` when the tree differed
	PR         int    // the PR reviewed, written #204 or !204; 0 for none or a file older than the line
	Reviewer   string // `local`, a remote identity, or both: `local, claude[bot]`
	Verdict    string // clean or findings
	Categories map[string]int
	Findings   []Finding
}

File is one findings file.

func Parse

func Parse(text string) (*File, error)

Parse reads a findings file's text.

func (*File) Halves added in v0.43.0

func (f *File) Halves() (bool, bool)

Halves is which reviewers the header names: `local`, a remote identity, or both, comma-separated.

func (*File) Remote added in v0.43.0

func (f *File) Remote(fd Finding) bool

Remote reports whether the remote half raised a finding: its own `source:` line, else the header, a file naming both halves reading an untagged block as local.

func (*File) Tally added in v0.58.0

func (f *File) Tally() Tally

Tally counts every block of the file.

func (*File) TallyHalf added in v0.58.0

func (f *File) TallyHalf(remote bool) Tally

TallyHalf counts the blocks the remote half raised, or the local half's.

type Finding

type Finding struct {
	ID       string
	Title    string
	Category string
	Prior    bool
	Status   string // prior round only: fixed, still open, ...
	Source   string // local or remote, in a file both halves wrote; empty: the header's reviewer
	Verdict  string // as written, attachments included: `skip +reply`
	Reason   string
}

Finding is one block. Prior-round blocks carry their round-one id and the status the second review gave them.

func (Finding) Counts added in v0.58.0

func (fd Finding) Counts() bool

Counts reports whether the block belongs to its round's tally: a prior block only when the round reopened it, since a settled one takes no verdict.

func (Finding) Word added in v0.58.0

func (fd Finding) Word() string

Word is the verdict's first word, lower-cased: `fix`, `skip`, `ask`, "" for none, or text outside that vocabulary, which counts as settled.

type Open added in v0.49.0

type Open struct {
	ID    string `json:"id"`
	Title string `json:"title"`
	Why   string `json:"why"`
}

Open is a finding a decline names, with why it is still open: `no verdict`, `ask`, or the prior status that reopened it.

type Status added in v0.49.0

type Status struct {
	Dir     string  `json:"dir"`
	Latest  string  `json:"latest,omitempty"` // the highest round's file; empty with none
	Round   int     `json:"round,omitempty"`  // the next round; 0 on a decline
	Path    string  `json:"path,omitempty"`   // the next round's file
	Decline Decline `json:"decline,omitempty"`
	Open    []Open  `json:"open,omitempty"` // the findings behind the decline
	// PR is the branch's open PR for the next round's `pr:` line, `none`
	// without one; empty when the branch is not checked out here.
	PR string `json:"pr,omitempty"`
	// Archived is where a finished series moved before this round.
	Archived string `json:"archived,omitempty"`
}

Status is a findings directory read for the next review: the latest round and the next one, or the decline that stops it.

func Rounds added in v0.49.0

func Rounds(dir string, paths []string) (Status, error)

Rounds reads the round files in paths, in round order (`<n>.md` sorted by n), all under dir. A file that does not parse is an error naming it.

type Tally added in v0.58.0

type Tally struct {
	Found   int // blocks the round counts: new ones, and prior ones it reopened
	Fixed   int
	Skipped int
	Open    int // waiting on someone: an `ask`, or no verdict yet
	Raised  int // new in this round, a reopened prior one not counted
}

Tally counts one findings file, or one half of it.

Jump to

Keyboard shortcuts

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