reviews

package
v0.13.1 Latest Latest
Warning

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

Go to latest
Published: Oct 5, 2026 License: MIT Imports: 11 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 reviews reads the committed review folders under .abcd/work/reviews/ and says how stale each has become (itd-28, spc-2609211854150455).

Two kinds of folder live there. A dated review, `<YYYY-MM-DD>-<scope>/`, is a commissioned review whose `00-summary.md` names the commit it read in its frontmatter (`review_of_commit: <full sha>`); a review of a spec carries the spec's id in its scope, `<YYYY-MM-DD>-<spc-N>-<slug>/`. A semantic-gate receipt directory, `<40-hex>/<gate>.json`, is keyed by the commit it gates, so its name is its pin. The package reads both and counts, per pin, the commits the default branch has moved since; it writes nothing.

The pin's one reading is summaryPin. The reviews-charter gate (scripts/check-reviews.sh, RD004) refuses a dated folder whose pin summaryPin would not read, so the board and the gate agree about every folder.

Index

Constants

View Source
const (
	KindReview  = "review"
	KindReceipt = "receipt"
)

Kind names the two folder classes the tree holds.

View Source
const (
	// StatePinned: the pin names a commit this repository holds, and the
	// count is the commits the default branch has moved since.
	StatePinned = "pinned"
	// StateUnreachable: the pin names no commit this repository can count
	// from (a rewritten or squashed-away sha), so the age is unknown.
	StateUnreachable = "unreachable"
	// StateUnpinned: the folder names no commit at all — a review that
	// predates the pin rule.
	StateUnpinned = "unpinned"
)

State says whether a folder's staleness could be counted.

View Source
const Dir = ".abcd/work/reviews"

Dir is the committed reviews tree, repo-relative and slash-separated.

View Source
const StaleAfter = 20

StaleAfter is the threshold the board flags past: a review whose pin the default branch has moved more than this many commits beyond is marked for a re-run (itd-28 decision 2).

Variables

This section is empty.

Functions

This section is empty.

Types

type Board

type Board struct {
	Threshold int `json:"threshold"`
	// DefaultRef is the branch the counts are taken against, as a person
	// names it; HEAD when no default branch resolves.
	DefaultRef string `json:"default_ref"`
	Rows       []Row  `json:"rows"`
}

Board is the reviews block of the status board.

func Staleness

func Staleness(root string) (Board, error)

Staleness reads the tree and counts each pin's age against the default branch (gitutil.DefaultRef, or HEAD where none resolves), one `git rev-list --count <pin>..<ref>` per pinned folder. Rows come stalest first: counted rows by descending count, then the unreachable, then the unpinned, each run by folder name.

func (Board) StaleCount

func (b Board) StaleCount() int

StaleCount is the number of rows flagged for a re-run.

type Entry

type Entry struct {
	Folder string `json:"folder"`
	Kind   string `json:"kind"`
	// Scope is what the folder reviewed: the dated folder's name after its
	// date, or a receipt directory's gates, comma-separated.
	Scope string `json:"scope"`
	// Spec is the spec id the dated folder's name carries, if any.
	Spec string `json:"spec,omitempty"`
	// ReviewOfCommit is the pin: the summary's frontmatter key, or the
	// receipt directory's own name. Empty when the folder names none.
	ReviewOfCommit string `json:"review_of_commit,omitempty"`
}

Entry is one review folder as the tree holds it, before any git is asked.

type Row

type Row struct {
	Entry
	State string `json:"state"`
	// CommitsSince is the number of commits the default branch holds that
	// the pin does not; absent when the state is not pinned.
	CommitsSince *int `json:"commits_since"`
	// Stale is true when CommitsSince is past the threshold.
	Stale bool `json:"stale"`
}

Row is one folder on the board, with its age.

Jump to

Keyboard shortcuts

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