Documentation
¶
Index ¶
- Constants
- func Exists(metadataDir string) (bool, error)
- func Invalidate(metadataDir string) error
- func SummarizeTurnEvents(events []eventlog.Event) map[uint64]TurnEventSummary
- func SummarizeTurnEventsByStream(events []eventlog.Event) map[StreamTurnKey]TurnEventSummary
- type BlameCacheEntry
- type BlameCacheOrigin
- type BlameCacheQuery
- type BlameCacheSnapshot
- type GraphQuery
- type GraphSession
- type GraphTurn
- type Paths
- type RebuildStats
- type SearchQuery
- type SearchResult
- type Store
- func (s *Store) Close() error
- func (s *Store) Healthy() (bool, error)
- func (s *Store) LoadBlameCache(query BlameCacheQuery) (BlameCacheSnapshot, bool, error)
- func (s *Store) LoadGraph(query GraphQuery) ([]GraphSession, error)
- func (s *Store) SaveBlameCache(snapshot BlameCacheSnapshot) error
- func (s *Store) Search(query SearchQuery) ([]SearchResult, error)
- func (s *Store) StructurallyHealthy() (bool, error)
- type StreamTurnKey
- type TurnEventSummary
Constants ¶
View Source
const ( SchemaVersion = 7 DBFileName = "index.sqlite" )
Variables ¶
This section is empty.
Functions ¶
func Invalidate ¶
Invalidate removes derived index state. It is safe because the index can be rebuilt entirely from durable event, checkpoint, and adapter records.
func SummarizeTurnEvents ¶
func SummarizeTurnEvents(events []eventlog.Event) map[uint64]TurnEventSummary
func SummarizeTurnEventsByStream ¶
func SummarizeTurnEventsByStream(events []eventlog.Event) map[StreamTurnKey]TurnEventSummary
Types ¶
type BlameCacheEntry ¶
type BlameCacheEntry struct {
Line int
Text string
Origin BlameCacheOrigin
}
type BlameCacheOrigin ¶
type BlameCacheOrigin struct {
Kind string
SessionID primitives.SessionID
TurnID primitives.TurnID
CheckpointRef primitives.CheckpointRef
Commit primitives.CommitSHA
Time time.Time
Adapter string
Prompt string
ToolNames []string
ActionTool string
ActionAgentID string
ActionAgentType string
Intent *provenance.Attribution
}
type BlameCacheQuery ¶
type BlameCacheQuery struct {
ScopeSession primitives.SessionID
Path primitives.RepoPath
HistoryKey string
LatestRef primitives.CheckpointRef
LatestCommit primitives.CommitSHA
CompleteTurns int
Line int
}
type BlameCacheSnapshot ¶
type BlameCacheSnapshot struct {
ScopeSession primitives.SessionID
Path primitives.RepoPath
HistoryKey string
LatestRef primitives.CheckpointRef
LatestCommit primitives.CommitSHA
LatestTime time.Time
CompleteTurns int
LineCount int
Entries []BlameCacheEntry
Warnings []string
}
type GraphQuery ¶
type GraphQuery struct {
Session primitives.SessionID
WorktreeID primitives.WorktreeID
Limit int
}
type GraphSession ¶
type GraphSession struct {
ID primitives.SessionID
Turns []GraphTurn
TotalTurns int
Warnings []string
}
type GraphTurn ¶
type GraphTurn struct {
WorktreeID primitives.WorktreeID
StreamID primitives.EventStreamID
TurnID primitives.TurnID
Pre *checkpoint.CheckpointRefInfo
Post *checkpoint.CheckpointRefInfo
Diff checkpoint.DiffSummary
DiffLoaded bool
Events TurnEventSummary
Warnings []string
}
type Paths ¶
func PathsForMetadata ¶
type RebuildStats ¶
type RebuildStats struct {
DBPath string
Sessions int
Turns int
Events int
Checkpoints int
FileTouches int
SearchDocuments int
SourceFingerprint string
}
func Rebuild ¶
func Rebuild(repo *checkpoint.Repo) (RebuildStats, error)
type SearchQuery ¶
type SearchQuery struct {
Query string
Session primitives.SessionID
WorktreeID primitives.WorktreeID
Limit int
}
type SearchResult ¶
type SearchResult struct {
SessionID primitives.SessionID `json:"session_id"`
WorktreeID primitives.WorktreeID `json:"worktree_id,omitempty"`
StreamID primitives.EventStreamID `json:"stream_id,omitempty"`
TurnID primitives.TurnID `json:"turn_id"`
First time.Time `json:"first,omitempty"`
Last time.Time `json:"last,omitempty"`
Adapter string `json:"adapter,omitempty"`
Model string `json:"model,omitempty"`
Prompt string `json:"prompt,omitempty"`
Assistant string `json:"assistant,omitempty"`
ToolNames []string `json:"tool_names,omitempty"`
Paths []string `json:"paths,omitempty"`
Snippet string `json:"snippet,omitempty"`
Rank float64 `json:"rank"`
}
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
func (*Store) LoadBlameCache ¶
func (s *Store) LoadBlameCache(query BlameCacheQuery) (BlameCacheSnapshot, bool, error)
func (*Store) LoadGraph ¶
func (s *Store) LoadGraph(query GraphQuery) ([]GraphSession, error)
func (*Store) SaveBlameCache ¶
func (s *Store) SaveBlameCache(snapshot BlameCacheSnapshot) error
func (*Store) Search ¶
func (s *Store) Search(query SearchQuery) ([]SearchResult, error)
func (*Store) StructurallyHealthy ¶
StructurallyHealthy reports whether the derived database is internally usable and schema-compatible. Freshness is deliberately separate: a new durable event makes an index stale, but does not indicate corruption.
type StreamTurnKey ¶
type StreamTurnKey struct {
StreamID primitives.EventStreamID
TurnID uint64
}
Click to show internal directories.
Click to hide internal directories.