Versions in this module Expand all Collapse all v0 v0.2.5 Aug 28, 2026 v0.2.4 Aug 28, 2026 v0.2.3 Aug 28, 2026 v0.2.2 Aug 28, 2026 v0.2.1 Aug 28, 2026 v0.2.0 Aug 28, 2026 Changes in this version + const DBDriver + const DBMigrationPath + const DBSourceName + const DBURLProtocol + const DefaultSearchLimit + const LatestVersion + const MigrateAll + var ErrDatabaseNotPopulated = errors.New("database not migrated") + func AutoMigrate(dbPath string) error + func DatabasePopulated(db *sqlx.DB, targetVersion int) (bool, error) + func InitDB(dbPath string) (*sqlx.DB, error) + func MigrateDB(dbPath string, steps string) error + func NeedsMigration(dbPath string) (bool, int, error) + func TeardownDB(dbPath string, steps string) error + type Checkpoint struct + BenchedCount int + CommitHash string + CreatedAt string + Description string + ID int + ImplCount int + Name string + SnapshotJSON string + StubCount int + TestedCount int + TotalTokens int + type ContextManager struct + func NewContextManager(manager *DatabaseManager) *ContextManager + func (cm *ContextManager) DetectProject() (*Project, error) + func (cm *ContextManager) GetCurrent() (*Project, error) + func (cm *ContextManager) SwitchTo(projectID string) error + type DB struct + func Open(dbPath string) (*DB, error) + func (db *DB) Close() error + func (db *DB) CreateCheckpoint(name, description, commitHash, snapshotJSON string) error + func (db *DB) GetAllTokens() ([]*Token, error) + func (db *DB) GetCheckpoints() ([]*Checkpoint, error) + func (db *DB) GetFilesByReqID(reqID string, excludeSpecs bool) (map[string][]*Token, error) + func (db *DB) GetRefsByReqID(reqID string) ([]*Ref, error) + func (db *DB) GetTokensByProject(projectID string) ([]*Token, error) + func (db *DB) GetTokensByReqID(reqID string) ([]*Token, error) + func (db *DB) GetTokensByReqIDAndProject(reqID, projectID string) ([]*Token, error) + func (db *DB) ListTokens(filters map[string]string, idPattern string, orderBy string, limit int) ([]*Token, error) + func (db *DB) ReplaceRefs(kind string, refs []Ref) error + func (db *DB) SearchTokens(keywords string, limit int) ([]*Token, error) + func (db *DB) UpdatePriority(reqID, feature string, priority int) error + func (db *DB) UpdateSpecStatus(reqID, specStatus string) error + func (db *DB) UpsertToken(token *Token) error + type DatabaseManager struct + func NewDatabaseManager() *DatabaseManager + func (dm *DatabaseManager) Close() error + func (dm *DatabaseManager) DB() *sql.DB + func (dm *DatabaseManager) Discover() error + func (dm *DatabaseManager) Initialize(mode DatabaseMode) error + func (dm *DatabaseManager) Location() string + func (dm *DatabaseManager) Mode() DatabaseMode + type DatabaseMode int + const GlobalMode + const LocalMode + func (dm DatabaseMode) String() string + type GapCategory struct + CreatedAt time.Time + Description string + ID int + Name string + type GapConfig struct + CreatedAt time.Time + ID int + MaxGapInjection int + MinHelpfulThreshold int + RankingStrategy string + UpdatedAt time.Time + type GapEntry struct + Aspect string + Category string + CorrectiveAction string + CreatedAt time.Time + CreatedBy string + Description string + Feature string + GapID string + HelpfulCount int + ID int + ReqID string + UnhelpfulCount int + type GapQueryFilter struct + Aspect string + Category string + Feature string + Limit int + ReqID string + type GapRepository struct + func NewGapRepository(db *DB) *GapRepository + func (r *GapRepository) CreateEntry(entry *GapEntry) error + func (r *GapRepository) GenerateGapReport(reqID string) (string, error) + func (r *GapRepository) GetCategories() ([]*GapCategory, error) + func (r *GapRepository) GetConfig() (*GapConfig, error) + func (r *GapRepository) GetEntriesByReqID(reqID string) ([]*GapEntry, error) + func (r *GapRepository) GetEntryByGapID(gapID string) (*GapEntry, error) + func (r *GapRepository) GetTopGaps(reqID string, config *GapConfig) ([]*GapEntry, error) + func (r *GapRepository) MarkHelpful(gapID string) error + func (r *GapRepository) MarkUnhelpful(gapID string) error + func (r *GapRepository) QueryEntries(filter GapQueryFilter) ([]*GapEntry, error) + func (r *GapRepository) UpdateConfig(config *GapConfig) error + type Project struct + Active bool + CreatedAt string + ID string + Metadata string + Name string + Path string + type ProjectRegistry struct + func NewProjectRegistry(manager *DatabaseManager) *ProjectRegistry + func (pr *ProjectRegistry) GetByID(id string) (*Project, error) + func (pr *ProjectRegistry) GetByPath(path string) (*Project, error) + func (pr *ProjectRegistry) List() ([]*Project, error) + func (pr *ProjectRegistry) Register(project *Project) error + func (pr *ProjectRegistry) Remove(id string) error + type Ref struct + Context string + FilePath string + Kind string + LineNumber int + ReqID string + type Token struct + Aspect string + Bench string + Blocks string + Branch string + CommitHash string + CompletedAt string + CreatedAt string + DependsOn string + DocCheckedAt string + DocHash string + DocPath string + DocStatus string + DocType string + Feature string + FilePath string + ID int + IndexedAt string + Keywords string + LineNumber int + Owner string + Phase string + Priority int + ProjectID string + RawToken string + RelatedTo string + ReqID string + SpecStatus string + StartedAt string + Status string + Test string + UpdatedAt string