Documentation
¶
Overview ¶
Package store persists percepts, decisions and memory in PostgreSQL.
Index ¶
- Variables
- type Backup
- type BackupTable
- type Counts
- type DayCost
- type Example
- type FactView
- type LogEntry
- type Store
- func (s *Store) Actions(ctx context.Context, statuses []string, limit int) ([]memory.Action, error)
- func (s *Store) ActionsSince(ctx context.Context, since time.Time) (int, error)
- func (s *Store) ActiveProjects(ctx context.Context, limit int) ([]memory.Project, error)
- func (s *Store) AddPersonIfNew(ctx context.Context, p memory.Person) (bool, error)
- func (s *Store) AddSkill(ctx context.Context, sk memory.Skill) error
- func (s *Store) AdvancePlan(ctx context.Context, plan ulid.ULID, at time.Time) error
- func (s *Store) AgentSkills(ctx context.Context) ([]memory.AgentSkill, error)
- func (s *Store) Agreement(ctx context.Context, n int) ([]memory.Agreement, error)
- func (s *Store) AgreementByStakes(ctx context.Context, n int) ([]memory.Agreement, error)
- func (s *Store) AllFacts(ctx context.Context, limit int) ([]FactView, error)
- func (s *Store) AllPeople(ctx context.Context, limit int) ([]memory.Person, error)
- func (s *Store) AllProjects(ctx context.Context, limit int) ([]memory.Project, error)
- func (s *Store) AnswerCall(ctx context.Context, c memory.Call, asCase bool) (bool, error)
- func (s *Store) Approval(ctx context.Context, id ulid.ULID) (memory.Approval, bool, error)
- func (s *Store) AskedForReview(ctx context.Context, since time.Time) (memory.Work, bool, error)
- func (s *Store) AutonomyRules(ctx context.Context) (map[string]string, error)
- func (s *Store) AwaitIntention(ctx context.Context, id ulid.ULID) error
- func (s *Store) AwaitWorkPublic(ctx context.Context, id ulid.ULID) error
- func (s *Store) Backup(ctx context.Context, w io.Writer, at time.Time) (Backup, error)
- func (s *Store) Call(ctx context.Context, id ulid.ULID) (memory.Call, bool, error)
- func (s *Store) CallsAskedSince(ctx context.Context, mode string, since time.Time) (int, error)
- func (s *Store) CallsToLookBack(ctx context.Context, types []string, from, to time.Time, limit int) ([]memory.Call, error)
- func (s *Store) Close()
- func (s *Store) Conversations(ctx context.Context) ([]memory.Conversation, error)
- func (s *Store) CostByDay(ctx context.Context, since time.Time, zone *time.Location) ([]DayCost, error)
- func (s *Store) CostSince(ctx context.Context, since time.Time, actions []string) (float64, error)
- func (s *Store) Counts(ctx context.Context) (Counts, error)
- func (s *Store) DecideApproval(ctx context.Context, id ulid.ULID, status string, at time.Time) (bool, error)
- func (s *Store) DecisionChain(ctx context.Context, id ulid.ULID) ([]LogEntry, error)
- func (s *Store) DecisionLog(ctx context.Context, after time.Time, limit int, newestFirst bool) ([]LogEntry, error)
- func (s *Store) DeleteFact(ctx context.Context, id ulid.ULID) (bool, error)
- func (s *Store) Dreams(ctx context.Context, activeOnly bool) ([]memory.Dream, error)
- func (s *Store) DueIntentions(ctx context.Context, now time.Time, limit int) ([]memory.Intention, error)
- func (s *Store) EndPlan(ctx context.Context, plan ulid.ULID, status string, at time.Time) error
- func (s *Store) ExpireCall(ctx context.Context, id ulid.ULID) (bool, error)
- func (s *Store) FinishIntention(ctx context.Context, id ulid.ULID, status, result string, at time.Time) error
- func (s *Store) FinishResource(ctx context.Context, id, work ulid.ULID, title string, at time.Time) error
- func (s *Store) Found(ctx context.Context, url string) (search.Result, bool, error)
- func (s *Store) GiveCallReason(ctx context.Context, id ulid.ULID, reason string, at time.Time) error
- func (s *Store) Goals(ctx context.Context, activeOnly bool) ([]memory.Goal, error)
- func (s *Store) Intention(ctx context.Context, id ulid.ULID) (memory.Intention, bool, error)
- func (s *Store) IntentionWork(ctx context.Context, intention ulid.ULID) (memory.Work, bool, error)
- func (s *Store) IntentionsDue(ctx context.Context, from, to time.Time) ([]memory.Intention, error)
- func (s *Store) JudgmentCases(ctx context.Context, status string, types []string) ([]memory.JudgmentCase, error)
- func (s *Store) KnownPeople(ctx context.Context, limit int) ([]memory.Person, error)
- func (s *Store) LabelledExamples(ctx context.Context, setID, question string, limit int) ([]Example, error)
- func (s *Store) Labels(ctx context.Context, decisions []ulid.ULID) ([]memory.Label, error)
- func (s *Store) LastFrom(ctx context.Context, source string) (string, bool, error)
- func (s *Store) LastRead(ctx context.Context, setID, source, thread string, before time.Time) (ulid.ULID, bool, error)
- func (s *Store) LastSpokeFirst(ctx context.Context, person, kind string) (time.Time, bool, error)
- func (s *Store) LatestWork(ctx context.Context, kind string) (memory.Work, bool, error)
- func (s *Store) Lessons(ctx context.Context, skill string, limit int) ([]memory.Lesson, error)
- func (s *Store) LogWeb(ctx context.Context, kind, what string, costUSD float64, at time.Time) error
- func (s *Store) MarkApprovalSent(ctx context.Context, id ulid.ULID, message []byte, at time.Time) error
- func (s *Store) MarkCallAsked(ctx context.Context, id ulid.ULID, where json.RawMessage, at time.Time) error
- func (s *Store) MarkFactsAsked(ctx context.Context, ids []ulid.ULID, at time.Time) error
- func (s *Store) MarkReviewAsked(ctx context.Context, work ulid.ULID, at time.Time) error
- func (s *Store) OpenIntentions(ctx context.Context, subject, kind string) ([]memory.Intention, error)
- func (s *Store) Person(ctx context.Context, key string) (memory.Person, bool, error)
- func (s *Store) Plans(ctx context.Context, activeOnly bool) ([]memory.LearningPlan, error)
- func (s *Store) PostponeIntention(ctx context.Context, id ulid.ULID, due time.Time) error
- func (s *Store) Principles(ctx context.Context, status string) ([]memory.Principle, error)
- func (s *Store) Profile(ctx context.Context) (page []byte, inputs string, at time.Time, ok bool, err error)
- func (s *Store) Project(ctx context.Context, id ulid.ULID) (memory.Project, bool, error)
- func (s *Store) ProjectWorks(ctx context.Context, project ulid.ULID, limit int) ([]memory.Work, error)
- func (s *Store) PublicFacts(ctx context.Context, limit int) ([]memory.Fact, error)
- func (s *Store) PublicWork(ctx context.Context, id ulid.ULID) (memory.Work, bool, error)
- func (s *Store) PublicWorks(ctx context.Context, limit int) ([]memory.Work, error)
- func (s *Store) RankPriority(ctx context.Context, id ulid.ULID, rank int, at time.Time) (bool, error)
- func (s *Store) ReadingProject(ctx context.Context, source ulid.ULID) (memory.Project, bool, error)
- func (s *Store) RecallCandidates(ctx context.Context, subjects, areas []string, limit int) ([]memory.Fact, error)
- func (s *Store) RecentActions(ctx context.Context, limit int) ([]memory.Action, error)
- func (s *Store) RecentApprovals(ctx context.Context, limit int) ([]memory.Approval, error)
- func (s *Store) RecentCalls(ctx context.Context, status string, limit int) ([]memory.Call, error)
- func (s *Store) RecentDecisions(ctx context.Context, n int) ([]decision.Decision, error)
- func (s *Store) RecentEvidence(ctx context.Context, skill string, limit int) ([]memory.Evidence, error)
- func (s *Store) RecentExchanges(ctx context.Context, source, thread string, since time.Time, exclude ulid.ULID, ...) ([]memory.Exchange, error)
- func (s *Store) RecentFacts(ctx context.Context, limit int) ([]memory.Fact, error)
- func (s *Store) RecentFound(ctx context.Context, limit int) ([]search.Result, error)
- func (s *Store) RecentWorks(ctx context.Context, limit int) ([]memory.Work, error)
- func (s *Store) RemoveAgentSkill(ctx context.Context, name string) (bool, error)
- func (s *Store) Resources(ctx context.Context, plan ulid.ULID) ([]memory.Resource, error)
- func (s *Store) ResumeIntention(ctx context.Context, id ulid.ULID, notBefore time.Time) error
- func (s *Store) RetireLesson(ctx context.Context, id ulid.ULID, at time.Time) error
- func (s *Store) RetireTaste(ctx context.Context, id ulid.ULID, at time.Time) (bool, error)
- func (s *Store) ReviewCase(ctx context.Context, id ulid.ULID, status, reason string, at time.Time) (bool, error)
- func (s *Store) ReviewPrinciple(ctx context.Context, id ulid.ULID, status, text string, at time.Time) (bool, error)
- func (s *Store) SaveAction(ctx context.Context, a memory.Action) error
- func (s *Store) SaveAgentSkill(ctx context.Context, sk memory.AgentSkill) error
- func (s *Store) SaveApproval(ctx context.Context, a memory.Approval) error
- func (s *Store) SaveAutonomyRule(ctx context.Context, class, verdict, by string, percept ulid.ULID, ...) error
- func (s *Store) SaveCall(ctx context.Context, c memory.Call) error
- func (s *Store) SaveCaseEmbedding(ctx context.Context, id ulid.ULID, v []float32, model string) error
- func (s *Store) SaveDecision(ctx context.Context, d decision.Decision) error
- func (s *Store) SaveDream(ctx context.Context, d memory.Dream) error
- func (s *Store) SaveEvidence(ctx context.Context, e memory.Evidence) error
- func (s *Store) SaveFact(ctx context.Context, f memory.Fact) error
- func (s *Store) SaveFound(ctx context.Context, query string, rs []search.Result, at time.Time) error
- func (s *Store) SaveGoal(ctx context.Context, g memory.Goal) error
- func (s *Store) SaveIntention(ctx context.Context, i memory.Intention) error
- func (s *Store) SaveLabel(ctx context.Context, l memory.Label) error
- func (s *Store) SaveLesson(ctx context.Context, l memory.Lesson) error
- func (s *Store) SavePercept(ctx context.Context, p perception.Percept) (bool, error)
- func (s *Store) SavePerson(ctx context.Context, p memory.Person) error
- func (s *Store) SavePlan(ctx context.Context, p memory.LearningPlan) error
- func (s *Store) SavePrinciple(ctx context.Context, p memory.Principle) error
- func (s *Store) SaveProfile(ctx context.Context, page []byte, inputs string, at time.Time) error
- func (s *Store) SaveProject(ctx context.Context, p memory.Project) error
- func (s *Store) SaveResource(ctx context.Context, r memory.Resource) error
- func (s *Store) SaveSelf(ctx context.Context, name string, vs ...memory.SelfVersion) error
- func (s *Store) SaveSource(ctx context.Context, src memory.Source) (ulid.ULID, error)
- func (s *Store) SaveTaste(ctx context.Context, t memory.Taste) error
- func (s *Store) SaveWork(ctx context.Context, w memory.Work) error
- func (s *Store) SaveWorkEmbedding(ctx context.Context, id ulid.ULID, v []float32, model string) error
- func (s *Store) Secrets(ctx context.Context) (map[string][]byte, error)
- func (s *Store) SeedJudgment(ctx context.Context, cases []memory.JudgmentCase, ...) (int, int, error)
- func (s *Store) SeenFrom(ctx context.Context, source string) (bool, error)
- func (s *Store) Self(ctx context.Context, section string) (memory.SelfVersion, bool, error)
- func (s *Store) SelfHistory(ctx context.Context, section string, limit int) ([]memory.SelfVersion, error)
- func (s *Store) SetAction(ctx context.Context, id ulid.ULID, from []string, status, result string, ...) (bool, error)
- func (s *Store) SetFactAreas(ctx context.Context, id ulid.ULID, areas []string) error
- func (s *Store) SetFactPublic(ctx context.Context, id ulid.ULID, public bool) error
- func (s *Store) SetOutcome(ctx context.Context, id ulid.ULID, outcome, verdict, note, by string, ...) (bool, error)
- func (s *Store) SetSecrets(ctx context.Context, sealed map[string][]byte, at time.Time) error
- func (s *Store) SetSkillLevel(ctx context.Context, name string, level float64, at time.Time) error
- func (s *Store) SetWorkData(ctx context.Context, id ulid.ULID, kind string, data json.RawMessage) error
- func (s *Store) SetWorkPublic(ctx context.Context, id ulid.ULID, public bool, by string) (bool, error)
- func (s *Store) Skills(ctx context.Context) ([]memory.Skill, error)
- func (s *Store) SourceText(ctx context.Context, id ulid.ULID) (string, error)
- func (s *Store) StaleApprovals(ctx context.Context, before time.Time, limit int) ([]memory.Approval, error)
- func (s *Store) StaleCalls(ctx context.Context, before time.Time, limit int) ([]memory.Call, error)
- func (s *Store) Start(ctx context.Context, name string, vs []memory.SelfVersion, ...) (bool, error)
- func (s *Store) Tastes(ctx context.Context, limit int) ([]memory.Taste, error)
- func (s *Store) UnaskedFacts(ctx context.Context, person string, since time.Time, limit int) ([]memory.Fact, error)
- func (s *Store) UndecidedPublicFacts(ctx context.Context, limit int) ([]memory.Fact, error)
- func (s *Store) UndecidedPublicWorks(ctx context.Context, limit int) ([]memory.Work, error)
- func (s *Store) UnlabelledFacts(ctx context.Context, limit int) ([]memory.Fact, error)
- func (s *Store) UnsentApprovals(ctx context.Context, limit int) ([]memory.Approval, error)
- func (s *Store) UnsetSecret(ctx context.Context, name string) (bool, error)
- func (s *Store) Vitals(ctx context.Context, since time.Time) (Vitals, error)
- func (s *Store) WaitForOwner(ctx context.Context, id ulid.ULID, waiting string, at time.Time) error
- func (s *Store) WaitingCall(ctx context.Context, since time.Time) (memory.Call, bool, error)
- func (s *Store) WebLog(ctx context.Context, kind string, limit int) ([]WebEntry, error)
- func (s *Store) WebSince(ctx context.Context, kind string, since time.Time) (int, error)
- func (s *Store) Whose(ctx context.Context) (string, bool, error)
- func (s *Store) Work(ctx context.Context, id ulid.ULID) (memory.Work, bool, error)
- func (s *Store) WorksBetween(ctx context.Context, from, to time.Time) ([]memory.Work, error)
- func (s *Store) WorksFor(ctx context.Context, person string, limit int) ([]memory.Work, error)
- func (s *Store) WorksMissingData(ctx context.Context, kinds []string, limit int) ([]memory.Work, error)
- type Vitals
- type WebEntry
Constants ¶
This section is empty.
Variables ¶
var ErrNotTheirs = errors.New("this database holds someone else's memory")
Functions ¶
This section is empty.
Types ¶
type Backup ¶
type Backup struct {
Format int `json:"format"`
Whose string `json:"whose"`
Version int64 `json:"version"` // the newest migration it was made at
At time.Time `json:"at"`
Tables []BackupTable `json:"tables"`
}
type BackupTable ¶
type Counts ¶
type Counts struct {
Facts, SelfFacts, People, Intentions, Projects, Works, Percepts, Decisions int
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) ActionsSince ¶
func (*Store) ActiveProjects ¶
ActiveProjects returns up to limit active projects, most recently worked on first.
func (*Store) AddPersonIfNew ¶
AddPersonIfNew is for what the agent was born knowing: memory, once formed, wins over the file it came from.
func (*Store) AdvancePlan ¶
AdvancePlan finishes a plan's current stage and moves to the next, or marks the plan done after its last.
func (*Store) AgentSkills ¶
AgentSkills are the skills it has, with their files, by name.
func (*Store) AgreementByStakes ¶
AgreementByStakes is by what the calls put at stake ("low", "medium", "high"; "low, can't undo", ...), over the latest n answered at each level.
func (*Store) AllProjects ¶
AllProjects returns up to limit projects, most recently worked on first.
func (*Store) AnswerCall ¶
AnswerCall records c's OwnerPick, OwnerChoice, OwnerReason, AnsweredBy, AnsweredAt and Waiting. With asCase, the answer is also kept as one of their decisions (approved: it's theirs). It returns false if already answered.
func (*Store) AskedForReview ¶
func (*Store) AutonomyRules ¶
AutonomyRules returns the owner's newest change per class.
func (*Store) AwaitIntention ¶
func (*Store) AwaitWorkPublic ¶
AwaitWorkPublic marks an undecided work as judged public but waiting for the owner's approval, so the daily check doesn't ask about it again.
func (*Store) Backup ¶
Backup writes everything as it is at one moment, so the agent can keep running while it's made.
func (*Store) CallsAskedSince ¶
func (*Store) CallsToLookBack ¶
func (s *Store) CallsToLookBack(ctx context.Context, types []string, from, to time.Time, limit int) ([]memory.Call, error)
CallsToLookBack returns calls not looked back on yet, oldest first: what its weekly review judges.
func (*Store) Conversations ¶
Conversations returns, for each person who has messaged the agent, the thread of their latest message and when anything was last said in it.
func (*Store) CostByDay ¶
func (s *Store) CostByDay(ctx context.Context, since time.Time, zone *time.Location) ([]DayCost, error)
CostByDay returns each day since the given time, in zone, oldest first.
func (*Store) DecideApproval ¶
func (s *Store) DecideApproval(ctx context.Context, id ulid.ULID, status string, at time.Time) (bool, error)
DecideApproval reports whether it was still pending: an approval is decided once.
func (*Store) DecisionChain ¶
DecisionChain returns the decision with id and every decision about the same percept (or, for one of the agent's own, its children), oldest first.
func (*Store) DecisionLog ¶
func (s *Store) DecisionLog(ctx context.Context, after time.Time, limit int, newestFirst bool) ([]LogEntry, error)
DecisionLog returns decisions after the given time: oldest first when following the log live, newest first for a page of history.
func (*Store) DeleteFact ¶
func (*Store) DueIntentions ¶
func (s *Store) DueIntentions(ctx context.Context, now time.Time, limit int) ([]memory.Intention, error)
DueIntentions returns pending intentions due by now, earliest first.
func (*Store) ExpireCall ¶
ExpireCall returns whether it was still asked.
func (*Store) FinishIntention ¶
func (*Store) FinishResource ¶
func (*Store) GiveCallReason ¶
func (s *Store) GiveCallReason(ctx context.Context, id ulid.ULID, reason string, at time.Time) error
GiveCallReason also sets the reason on the case the call became, and stops waiting for one.
func (*Store) IntentionWork ¶
func (*Store) IntentionsDue ¶
IntentionsDue returns those due in [from, to), whatever their status, earliest first.
func (*Store) JudgmentCases ¶
func (s *Store) JudgmentCases(ctx context.Context, status string, types []string) ([]memory.JudgmentCase, error)
JudgmentCases returns oldest first; status "" is all, and no types is all types.
func (*Store) KnownPeople ¶
KnownPeople returns everyone whose relation is known, oldest acquaintance first.
func (*Store) LabelledExamples ¶
func (s *Store) LabelledExamples(ctx context.Context, setID, question string, limit int) ([]Example, error)
LabelledExamples returns the newest decisions of setID (any version) with a label on question.
func (*Store) LastRead ¶
func (s *Store) LastRead(ctx context.Context, setID, source, thread string, before time.Time) (ulid.ULID, bool, error)
LastRead returns the newest decision of setID (any version) on a message in source's thread before before: the agent's read of the message before the one it is answering.
func (*Store) LastSpokeFirst ¶
LastSpokeFirst is when the agent last spoke first to person with a percept of kind (a reminder or a check-in), and whether it ever did.
func (*Store) LatestWork ¶
func (*Store) MarkApprovalSent ¶
func (*Store) MarkCallAsked ¶
func (*Store) MarkFactsAsked ¶
func (*Store) MarkReviewAsked ¶
func (*Store) OpenIntentions ¶
func (s *Store) OpenIntentions(ctx context.Context, subject, kind string) ([]memory.Intention, error)
OpenIntentions returns the pending ones, earliest due first.
func (*Store) PostponeIntention ¶
func (*Store) Principles ¶
Principles returns priorities by rank, then the rest oldest first, with the keys of the cases behind them; status "" is all.
func (*Store) Profile ¶
func (s *Store) Profile(ctx context.Context) (page []byte, inputs string, at time.Time, ok bool, err error)
Profile returns the page as JSON and a hash of what it was written from; ok is false if it never has been.
func (*Store) ProjectWorks ¶
func (s *Store) ProjectWorks(ctx context.Context, project ulid.ULID, limit int) ([]memory.Work, error)
ProjectWorks returns the newest works in a project, oldest first.
func (*Store) PublicFacts ¶
PublicFacts returns the newest public facts, oldest first. Facts about people are never among them.
func (*Store) PublicWork ¶
func (*Store) PublicWorks ¶
func (*Store) RankPriority ¶
func (s *Store) RankPriority(ctx context.Context, id ulid.ULID, rank int, at time.Time) (bool, error)
RankPriority shifts the others to make room, and returns whether there was such a priority. Rank 1 is first.
func (*Store) ReadingProject ¶
ReadingProject returns the active project that follows a source.
func (*Store) RecallCandidates ¶
func (s *Store) RecallCandidates(ctx context.Context, subjects, areas []string, limit int) ([]memory.Fact, error)
RecallCandidates returns facts sharing an area with areas first, then the rest, newest first within each group.
func (*Store) RecentActions ¶
func (*Store) RecentApprovals ¶
RecentApprovals returns the pending approvals, oldest first, then the newest decided ones.
func (*Store) RecentCalls ¶
RecentCalls returns its latest calls, newest first; status "" is all.
func (*Store) RecentDecisions ¶
func (*Store) RecentEvidence ¶
func (s *Store) RecentEvidence(ctx context.Context, skill string, limit int) ([]memory.Evidence, error)
RecentEvidence returns a skill's newest scores, newest first.
func (*Store) RecentExchanges ¶
func (s *Store) RecentExchanges(ctx context.Context, source, thread string, since time.Time, exclude ulid.ULID, limit int) ([]memory.Exchange, error)
RecentExchanges is oldest first, with what the agent said first (reminders, check-ins). The percept being handled is left out.
func (*Store) RecentFacts ¶
RecentFacts returns up to limit facts, newest first.
func (*Store) RecentFound ¶
RecentFound returns the newest pages its searches found, newest first.
func (*Store) RecentWorks ¶
RecentWorks returns up to limit works, newest first.
func (*Store) RemoveAgentSkill ¶
func (*Store) ResumeIntention ¶
ResumeIntention makes an intention that was waiting for approval pending again, due when it was or at notBefore, whichever is later.
func (*Store) RetireLesson ¶
func (*Store) RetireTaste ¶
func (*Store) ReviewCase ¶
func (s *Store) ReviewCase(ctx context.Context, id ulid.ULID, status, reason string, at time.Time) (bool, error)
ReviewCase keeps the reason when reason is empty. It returns whether there was such a case.
func (*Store) ReviewPrinciple ¶
func (s *Store) ReviewPrinciple(ctx context.Context, id ulid.ULID, status, text string, at time.Time) (bool, error)
ReviewPrinciple keeps the text when text is empty. It returns whether there was such a principle.
func (*Store) SaveAgentSkill ¶
SaveAgentSkill replaces any skill of the same name, files and all.
func (*Store) SaveApproval ¶
func (*Store) SaveAutonomyRule ¶
func (*Store) SaveCaseEmbedding ¶
func (*Store) SaveDecision ¶
func (*Store) SaveEvidence ¶
func (*Store) SaveIntention ¶
func (*Store) SavePercept ¶
SavePercept reports whether p was new: one already seen from the same source (same ExternalID) is not stored again.
func (*Store) SavePrinciple ¶
func (*Store) SaveProfile ¶
func (*Store) SaveProject ¶
func (*Store) SaveResource ¶
func (*Store) SaveSelf ¶
SaveSelf adds new versions. name is the person's name in a life among them ("" if none): whose memory this is follows it.
func (*Store) SaveSource ¶
SaveSource returns the ID already stored if the same URL was fetched before.
func (*Store) SaveWorkEmbedding ¶
func (*Store) SeedJudgment ¶
func (s *Store) SeedJudgment(ctx context.Context, cases []memory.JudgmentCase, principles []memory.Principle) (int, int, error)
SeedJudgment adds its owner's judgment file as proposed: each case not seen before (by key), and each principle not seeded before (by its seed text, so an edited or rejected one isn't seeded again). It returns how many of each it added.
func (*Store) SelfHistory ¶
func (s *Store) SelfHistory(ctx context.Context, section string, limit int) ([]memory.SelfVersion, error)
SelfHistory is section's versions, newest first.
func (*Store) SetAction ¶
func (s *Store) SetAction(ctx context.Context, id ulid.ULID, from []string, status, result string, at time.Time) (bool, error)
SetAction moves an action on: only from one of from, so a second tap or a late expiry can't move it again. It reports whether it moved.
func (*Store) SetFactAreas ¶
func (*Store) SetFactPublic ¶
func (*Store) SetOutcome ¶
func (s *Store) SetOutcome(ctx context.Context, id ulid.ULID, outcome, verdict, note, by string, at time.Time) (bool, error)
SetOutcome also records it on the owner's decision the call became. The owner's verdict stands: its review never overrides it. It returns whether it was recorded.
func (*Store) SetSecrets ¶
SetSecrets sets them all or none, each replacing what was there.
func (*Store) SetSkillLevel ¶
func (*Store) SetWorkData ¶
func (*Store) SetWorkPublic ¶
func (s *Store) SetWorkPublic(ctx context.Context, id ulid.ULID, public bool, by string) (bool, error)
SetWorkPublic reports whether the work was changed. The daily check (PublicBySystem1) never overrides its owner, and a work that may never be public can't be made public.
func (*Store) SourceText ¶
func (*Store) StaleApprovals ¶
func (s *Store) StaleApprovals(ctx context.Context, before time.Time, limit int) ([]memory.Approval, error)
StaleApprovals returns pending approvals asked before before, oldest first.
func (*Store) StaleCalls ¶
func (*Store) Start ¶
func (s *Store) Start(ctx context.Context, name string, vs []memory.SelfVersion, secrets map[string][]byte, skills []memory.AgentSkill, at time.Time) (bool, error)
Start makes the database someone's: their first versions, secrets and skills, all or nothing. It returns false, changing nothing, if a life is already here; ErrNotTheirs if the database was claimed by someone else.
func (*Store) UnaskedFacts ¶
func (s *Store) UnaskedFacts(ctx context.Context, person string, since time.Time, limit int) ([]memory.Fact, error)
UnaskedFacts returns facts the agent has not checked in about yet, newest first.
func (*Store) UndecidedPublicFacts ¶
UndecidedPublicFacts are about the agent itself, oldest first.
func (*Store) UndecidedPublicWorks ¶
UndecidedPublicWorks returns works that may be public but haven't been decided on yet, oldest first.
func (*Store) UnlabelledFacts ¶
UnlabelledFacts returns facts with no areas yet, oldest first.
func (*Store) UnsentApprovals ¶
UnsentApprovals returns pending approvals the owner hasn't been asked yet, oldest first.
func (*Store) UnsetSecret ¶
func (*Store) WaitForOwner ¶
func (*Store) WaitingCall ¶
func (*Store) WorksBetween ¶
WorksBetween returns what the agent made in [from, to), oldest first.