Documentation
¶
Overview ¶
Package initrecord keeps init's record in .git/physa: the areas a repo was divided into, the one init proposal, the capabilities' recoveries and what each init phase spent. It sits beside the gather the store keeps, in the same database, and a new gather clears it. None of it reaches the map. The tables' schema is the store's: every migration lives in the store's one numbered order.
Index ¶
- type Areas
- type Place
- type Proposal
- type Recovered
- type Spent
- type Store
- func (s *Store) AddSpent(p Spent) error
- func (s *Store) Areas() (Areas, bool, error)
- func (s *Store) Place() (Place, bool, error)
- func (s *Store) Proposed() (Proposal, bool, error)
- func (s *Store) PutAreas(a Areas) error
- func (s *Store) PutPlace(p Place) error
- func (s *Store) PutProposal(p Proposal) error
- func (s *Store) PutRecoverSeed(seed uint64, at time.Time) error
- func (s *Store) PutRecovered(rs []Recovered) error
- func (s *Store) PutWalk(w Walk) error
- func (s *Store) RecoverSeed() (seed uint64, ok bool, err error)
- func (s *Store) Recovered() ([]Recovered, error)
- func (s *Store) Spending() ([]Spent, error)
- func (s *Store) Walk() (Walk, bool, error)
- type Walk
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Areas ¶
type Areas struct {
GatherAt, At time.Time
Model string
Input, CachedInput, Output int64
Body []byte
}
Areas is the one division of a repo into areas the store keeps, with the session that made it and what it used. GatherAt is the run time of the gather it belongs to. Body is the areas and the source split as JSON.
type Place ¶
Place is the one placement of the gathered PRs and changes the store keeps. WalkAt is the time of the walk it was placed from. Body is the placements as JSON: file paths stay here, in init's record.
type Proposal ¶
type Proposal struct {
GatherAt, At time.Time
SessionID string
Model string
Appetite int64
Input int64
CachedInput int64
Output int64
Body []byte
}
Proposal is the one init proposal the store keeps: the capabilities and promise proposed from one gather, with the session that made it and what it used. GatherAt is the run time of the gather it belongs to. Body is the proposal as JSON.
type Recovered ¶
type Recovered struct {
Capability string
ProposalAt time.Time
At time.Time
Status string
File string
Terms string
Details []byte
SessionID string
Model string
Attempts int
Appetite int64
Input int64
CachedInput int64
Output int64
// KeepEarlier, when true, keeps an earlier stored row of the capability
// that holds a recovered file (a non-empty File) and does not store this
// row: a re-run that ends not yet recovered or failed loses nothing.
KeepEarlier bool
}
Recovered is one capability's recovery the store keeps: the capability text and glossary terms its session wrote, how it ended (Status is stored as given), the session and what it used. ProposalAt is the time of the proposal or the walk it was recovered from. Details is JSON.
type Spent ¶
Spent is what one init phase spent, as the run's meter counted it: its raw tokens, and its weighted tokens with their cost estimate.
type Store ¶
Store is an open store that also keeps init's record. Everything the store keeps, such as the gather, is reached through it as well.
func (*Store) PutAreas ¶
PutAreas replaces the stored areas with a, and clears the walk and placement made from the old ones, in one transaction.
func (*Store) PutProposal ¶
PutProposal replaces the stored init proposal with p. It also deletes the stored recoveries and what proposing and recovering spent, which belong to one proposal.
func (*Store) PutRecoverSeed ¶
PutRecoverSeed stores the seed of recovery's order, chosen once for a gather, and the time it was chosen. Every uint64 round-trips: the seed is kept as its int64 bit pattern.
func (*Store) PutRecovered ¶
PutRecovered stores rs in one transaction: a capability already stored is replaced, every other stored capability is kept. A row with KeepEarlier leaves an earlier row that holds a file as it is.
func (*Store) PutWalk ¶
PutWalk replaces the stored walk with w, and clears the placement made from the old one, in one transaction.
func (*Store) RecoverSeed ¶
RecoverSeed returns the stored seed of recovery's order, false when none is stored for the current gather.
type Walk ¶
type Walk struct {
AreasAt, At time.Time
Model string
Input, CachedInput, Output int64
Body []byte
}
Walk is the one walk of the areas the store keeps, with the session totals that made it and what they used. AreasAt is the time of the areas it was walked from. Body is the footprints as JSON: file paths stay here, in init's record, and never reach the map.