Documentation
¶
Overview ¶
Store of findings an agent records while it works, persisted as session records and exported as Markdown
Index ¶
- Constants
- Variables
- type Change
- type Evidence
- type Fact
- type Node
- type Query
- type Store
- func (s *Store) Add(f Fact) (Fact, error)
- func (s *Store) Attach(sess *session.Session)
- func (s *Store) ByKind() [][]Fact
- func (s *Store) Get(id string) (Fact, bool)
- func (s *Store) JSON() ([]byte, error)
- func (s *Store) Kinds() map[string]int
- func (s *Store) Len() int
- func (s *Store) List(q Query) []Fact
- func (s *Store) Markdown() string
- func (s *Store) OnChange(fn func(Change))
- func (s *Store) Remove(id string) bool
- func (s *Store) Restore(sess *session.Session) error
- func (s *Store) SetStatus(id, status string) (Fact, error)
- func (s *Store) Tags() map[string]int
- func (s *Store) Tree() []Node
- func (s *Store) Update(f Fact) (Fact, error)
- type Tool
Constants ¶
const ( StatusOpen = "open" StatusResolved = "resolved" StatusRetracted = "retracted" )
const ( OpAdd = "add" OpUpdate = "update" OpRemove = "remove" )
const RecordKind = "fact"
Kind of record a session keeps for every fact change
const ToolName = "Record"
Name the model calls to record a finding
Variables ¶
var DefaultKinds = []string{"finding", "risk", "decision", "question", "note"}
Kinds a fact may use when the caller does not restrict them
Functions ¶
This section is empty.
Types ¶
type Evidence ¶
type Evidence struct {
// What the reference names, such as file, url, command or tool
Kind string `json:"kind"`
Ref string `json:"ref"`
Line int `json:"line,omitempty"`
// Passage copied from the source
Quote string `json:"quote,omitempty"`
}
Where a fact was seen
type Fact ¶
type Fact struct {
ID string `json:"id"`
Time time.Time `json:"time"`
Agent string `json:"agent,omitempty"`
// Grouping such as finding, risk, decision, question or note
Kind string `json:"kind"`
Title string `json:"title"`
Body string `json:"body,omitempty"`
Tags []string `json:"tags,omitempty"`
// Belief from zero to one, one when the agent states it as verified
Confidence float64 `json:"confidence"`
Evidence []Evidence `json:"evidence,omitempty"`
// Open, resolved or retracted
Status string `json:"status"`
// Id of the fact this one refines
Parent string `json:"parent,omitempty"`
}
One recorded finding
type Query ¶
type Query struct {
Kind string
Tag string
Status string
Agent string
// Case insensitive match over title, body, tags and evidence references
Text string
// Smallest confidence included
MinConfidence float64
}
Filter over the store
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Facts keyed by id in insertion order with change listeners
func (*Store) Attach ¶
Writes every later change into the session log so the facts survive with the transcript
func (*Store) Markdown ¶
Renders every fact as Markdown grouped by kind with evidence as a list under each
func (*Store) Restore ¶
Rebuilds the store from the fact records of a session, replaying adds, updates and removes in order
type Tool ¶
Tool that lets an agent record, refine and resolve facts in the store of its run
func (Tool) Annotations ¶
func (Tool) Annotations() tool.Annotations