archive

package
v0.67.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2026 License: MIT Imports: 18 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 archive keeps what a finished task leaves behind: archived plans and findings, the review and verdict series, and the handoff file.

Index

Constants

View Source
const ExcludeLine = storage.DirName + "/"

ExcludeLine is spelled as a repo that did it by hand would, so an existing entry is found.

Variables

This section is empty.

Functions

func ArchivePlan

func ArchivePlan(root storage.Root, id string) (string, string, error)

ArchivePlan moves the plan into the shared archive. A missing plan is a note, since a task shipped without one still needs cleaning up; one that cannot move is an error, since removing the worktree would delete it.

func ArchiveReviews

func ArchiveReviews(dir string, end SeriesEnd) (string, error)

ArchiveReviews moves a findings directory to reviews/archive/<id>.<N>/, so the task's next PR starts its own series of rounds. N always counts from 1, since a bare <id>/ under archive would read as a live directory.

func BranchTip

func BranchTip(ctx context.Context, main, branch string, p forge.PR) func() string

BranchTip is the local branch's commit, which the handoff step records as head; without the branch, the PR's head.

func ChangeOf

func ChangeOf(dir string) string

ChangeOf is the lore change of the task's open series: the task id for its first PR, <id>.<n> for its n-th, counted from the PRs archived.

func ClosedPRs

func ClosedPRs(dir string) []string

ClosedPRs is the archived series that each ended a PR, oldest first: a restart is left out.

func ExcludeF10

func ExcludeF10(ctx context.Context, root string) (string, error)

ExcludeF10 appends the entry to info/exclude rather than .gitignore, so the ignore itself is never committed.

func FreeArchiveName

func FreeArchiveName(dir, id string) string

FreeArchiveName numbers `<id>.<N>.md` the way steps/plan.md does.

func HandoffLines

func HandoffLines(path, id string, tip func() string) []string

HandoffLines is what finish prints under its report. It prints after the merge, when the branch is gone, so a stale or missing handoff names what to check rather than a command to rerun. tip runs only when the file exists, so a finish without one runs no extra git.

func HandoffTarget

func HandoffTarget(root storage.Root, id string) (string, string)

HandoffTarget names where the handoff will be archived, "" with none. Finish names it for its report and moves the file only after printing it, so a failure before the report leaves the file for the rerun to print.

func LoreSeries

func LoreSeries(changes []string, id string) []string

LoreSeries is the changes a show of id reads: every <id>.<n> newest first, then id itself; a change named with its number, or a task with one PR, is that change alone.

func ModTime

func ModTime(path string) time.Time

func MoveHandoff

func MoveHandoff(src, target string) error

func NewestArchived added in v0.60.0

func NewestArchived(dir, id string) string

NewestArchived is the most recently written of `<id>.md` and `<id>.<N>.md` in an archive dir, "" for none. FreeArchiveName takes the lowest free name, so the number does not order them and the file's time does.

func NextSeries

func NextSeries(archived, id string) string

func SeriesChange

func SeriesChange(id string, n int) string

func SeriesEndAt added in v0.60.0

func SeriesEndAt(dir string) time.Time

SeriesEndAt is when an archived series closed: its closed file's time, else the directory's, for a series archived before the file recorded one.

func SeriesNumbers

func SeriesNumbers(archived, id string) []int

SeriesNumbers is the archived series of id, ascending.

func SeriesStart

func SeriesStart(dir string) time.Time

SeriesStart is when the task's open series began, the newest archived PR's end; zero for a first series.

func TaskHandoff

func TaskHandoff(root storage.Root, id string) string

TaskHandoff is the task's handoff file.

func WriteHandoff

func WriteHandoff(w io.Writer, lines []string) error

WriteHandoff prints the lines apart from the notes, so the body's headings read as their own block.

Types

type JudgeOutcome

type JudgeOutcome struct {
	Verdict  string `json:"verdict"`
	Reason   string `json:"reason,omitempty"`
	Decision string `json:"decision,omitempty"`
	Changes  int    `json:"changes,omitempty"`
}

JudgeOutcome is a verdict and, from its file, what the ship run did with it: the decision line and how many changes it listed.

func (*JudgeOutcome) Done

func (j *JudgeOutcome) Done() string

Done is what the ship run did with the verdict, from the decision line; continue and a file with no line say nothing, and a new word shows as is.

type SeriesEnd

type SeriesEnd struct {
	PR      int // 0 for none
	Head    string
	At      time.Time
	Restart bool
}

A SeriesEnd is what an archived series records in its closed file: the PR (#204, or none), the commit it ended at, and when. A restart is rounds ended by a rebase before any PR existed: still the same PR, so it counts for no lore change.

func ReadSeriesEnd

func ReadSeriesEnd(dir string) SeriesEnd

ReadSeriesEnd is zero for a series archived before the file existed.

func (SeriesEnd) Same

func (e SeriesEnd) Same(o SeriesEnd) bool

Same compares by PR number, else by head.

func (SeriesEnd) Write

func (e SeriesEnd) Write(dir string) error

type VerdictFile

type VerdictFile struct {
	Outcome JudgeOutcome
	Judged  string // task or plan when its subject is one, else change
	At      time.Time
	Path    string
}

VerdictFile is one verdict file that judges the task, not an idea.

func JudgeFiles

func JudgeFiles(storageRoot, task string) []VerdictFile

JudgeFiles is the task's verdict files that parse, oldest first.

Jump to

Keyboard shortcuts

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