recoverinput

package
v0.0.27 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: 21 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 Add added in v0.0.26

func Add(sum *adapter.Tokens, t adapter.Tokens)

Add adds t to sum.

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 Done added in v0.0.26

func Done(rows []initrecord.Recovered, at time.Time) map[string]bool

Done is the set of capabilities rows holds recovered from the source at at (the walk's time or the proposal's): a row of another time is of an earlier source, and one that failed or is not yet recovered is not done.

func Kept added in v0.0.26

func Kept(st interface {
	Recovered() ([]initrecord.Recovered, error)
}, only []string, at time.Time) (map[string]bool, error)

Kept is the set of capabilities init's record holds recovered from the source at at, for a run that names none with only; a named capability is always recovered again, so only non-empty gives nil.

func KeptLine added in v0.0.26

func KeptLine(kept, left int, what string) string

KeptLine says how many capabilities a continued run keeps from what, and how many it recovers.

func Plural added in v0.0.26

func Plural(n int, one, many string) string

Plural counts n things: "1 rule", "3 rules".

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 Resolver added in v0.0.26

func Resolver(g store.Gather, exists func(int) (bool, error)) func(int) (bool, error)

Resolver answers whether a PR exists: yes for every PR of g, without asking, and otherwise what exists says, each number asked once. It is safe for capabilities checked at the same time, and asks exists one call at a time. A nil exists gives nil: anchors are then checked for form only.

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.

func TooLong added in v0.0.26

func TooLong(err error, system, message string, read reading.Report) error

TooLong is err, a session refused as too long, with how big physa made its prompt, system and message, by its own estimate, and what read, its sources, counts. An agent's own account may count everything physa passes outside the message as its system prompt, which here holds only the skill and the docs every capability reads; the capability's own sources are in the message.

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