Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CatchupDelta ¶
type CatchupDelta struct {
Since time.Time
Sessions []SearchResult
ClosedIssues []types.Issue
StateChanges []types.BranchState
}
func GetCatchupDelta ¶
type CooccurrenceNode ¶
func GetRelatedEntitiesByCooccurrence ¶
func GetRelatedEntitiesByCooccurrence(ctx context.Context, db *sql.DB, entityID string, limit int) ([]CooccurrenceNode, error)
GetRelatedEntitiesByCooccurrence finds entities that frequently appear in the same sessions
type EntityGraph ¶
type EntityGraph struct {
Nodes []EntityNode
}
type EntityNode ¶
type ProximityWarning ¶
type ResolvedEntity ¶
func ResolveEntities ¶
func ResolveEntities(ctx context.Context, db *sql.DB, term string, limit int) ([]ResolvedEntity, error)
ResolveEntities finds entities matching the term using Hybrid FTS + LIKE logic. This ensures consistent behavior between "Search" and "Graph/Impact" commands.
type SearchOptions ¶
type SearchOptions struct {
Query string
Author string
CurrentBranch string
Limit int
Strict bool // If true, only BM25 on sessions, no expansion
TextOnly bool // If true, only BM25, no entity lookup
Preview bool // If true, show first 3 lines instead of snippet
Explain bool // If true, show score breakdown
}
type SearchResponse ¶
type SearchResponse struct {
Results []SearchResult
RelatedEntities []string
Strategy string // e.g. "exact", "hybrid", "fallback"
}
func HybridSearch ¶
func HybridSearch(ctx context.Context, db *sql.DB, opts SearchOptions) (SearchResponse, error)
type SearchResult ¶
type SearchResult struct {
ID string `json:"id"`
Title string `json:"title"`
Date string `json:"date"`
Narrative string `json:"narrative"` // Snippet or Preview
Score float64 `json:"score"`
Reason string `json:"reason"` // e.g. "text match", "entity:Modal"
// Explanation fields (for --explain)
BM25 float64 `json:"bm25"`
PhraseBonus float64 `json:"phrase_bonus"`
NearBonus float64 `json:"near_bonus"`
EntityBonus float64 `json:"entity_bonus"`
RecencyBonus float64 `json:"recency_bonus"`
IsLowConfidence bool `json:"is_low_confidence"`
// Lifecycle fields
LifecycleStatus types.LifecycleState `json:"lifecycle_status"`
StatusReason string `json:"status_reason"`
IsValidated bool `json:"is_validated"`
Branch string `json:"branch"`
}
type Suggestion ¶
type Suggestion struct {
Name string
Distance int // -1 if not applicable
Type string // "exact", "typo", "fuzzy"
}
func SuggestEntities ¶
SuggestEntities finds potential entity matches for a term that yielded no results. It uses fuzzy matching and Levenshtein distance for typo correction.
Click to show internal directories.
Click to hide internal directories.