recoverinput

package
v0.0.24 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: Apache-2.0 Imports: 19 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 recoverinput is what each capability's recovery reads and in what order: from the stored proposal and coverage as before, or from the walk's footprints and the placements, in a seeded order across areas. It reads the store's records and never writes them, and it cuts no source.

Index

Constants

View Source
const NoPromise = "Not yet stated."

NoPromise is the product's promise when no proposal is stored to give one: the stand-in the check also uses.

Variables

This section is empty.

Functions

func Choose

func Choose(names, only []string, missing string) ([]int, error)

Choose returns the indices in names of those only names, in its order and each once, or of all of them when only is empty. A name not in names is an error, missing formatted with the name and the names there are.

func Proposed

Proposed is the part of g linked to c, a capability proposed from the history, in g's order: the docs it reads, the PRs and changes that show it or suggested its questions, those pl places with it by their files, and the changes those revert or are reverted by.

func Seed

func Seed(g store.Gather) uint64

Seed is the seed of recovery's order chosen for the gather g: its time, so a gather always gives the same seed and a new gather a new one.

Types

type Source

type Source struct {
	// FromWalk is true when they are the walk's, false when they are the
	// proposal's.
	FromWalk bool
	// At is the walk's time when FromWalk; a stored recovery counts only when
	// its ProposalAt equals it. Zero for the proposal, which keeps every
	// stored row as it always has.
	At           time.Time
	Capabilities []mapping.Capability
}

Source is the capabilities of the source a stored recovery came from, in the order the map lists them.

func Listed

func Listed(st interface {
	Walk() (initrecord.Walk, bool, error)
	Place() (initrecord.Place, bool, error)
}, proposed mapping.Proposal, hasProposal bool) (src Source, ok bool, err error)

Listed is the source of the stored recovery: the walk's capabilities and promises in walk order when st holds both the walk and the placements, else the proposal's capabilities when proposed is true, else ok is false.

func (Source) Holds

func (s Source) Holds(proposalAt time.Time) bool

Holds reports whether a stored recovery made at proposalAt is of this source: always for the proposal, and for the walk only when the row was recovered from this walk, so a row from an earlier source stays stored but is not listed.

type Walked

type Walked struct {
	Name, Promise string
	Area, Parent  string
	Footprint     recovering.Footprint
	// Sources are the PRs and changes placed with the capability, and the
	// changes those revert or are reverted by, in the gather's order, whole
	// and with no docs: the session reads the footprint's docs itself.
	Sources store.Gather
}

Walked is a capability found in the code, with what its recovery reads: its area and, when that area is a part, the area it was split from, its footprint, and the PRs and changes placed with it.

func Chosen

func Chosen(st place.Loader, root string, w initrecord.Walk, g store.Gather, only []string, seed uint64) ([]Walked, error)

Chosen is the stored walk w's capabilities to recover, as Walk reads them against the placement st holds and the gather g: those only names, in its order and each once, or all of them in recovery's order for seed. A name the walk lacks is an error naming it and the names the walk found.

func Order

func Order(caps []Walked, seed uint64) []Walked

Order is caps in recovery's order for seed: one capability from each area in turn, round after round, until all are taken, the areas and each area's capabilities in a random order seed fixes. An area is its name together with the area it was split from. The order depends only on the set of capabilities and the seed, never on the order caps come in, so a run that stops early leaves a sample spread across the areas.

func Walk

func Walk(root string, w walk.Record, p place.Record, g store.Gather) []Walked

Walk is one Walked for each capability of the stored walk w, in walk order. Its source files carry their line counts as root holds them now, a file that cannot be read as text showing none (0), and its sources are what the stored placement p places with it in the gather g. A capability p places nothing with has empty sources and is still recovered.

Jump to

Keyboard shortcuts

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