findings

package
v0.51.0 Latest Latest
Warning

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

Go to latest
Published: Oct 30, 2026 License: MIT Imports: 8 Imported by: 0

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 Reopens added in v0.40.0

func Reopens(status string) bool

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

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"
)

type File

type File struct {
	Task       string
	Round      string
	Reviewed   string // the sha, plus ` dirty` when the tree differed
	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.

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.

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
}

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.

Jump to

Keyboard shortcuts

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