Documentation
¶
Index ¶
- type CommitInfo
- type Config
- type Extractor
- func (e *Extractor) CompactFileIntents(changes []FileChange) []FileIntent
- func (e *Extractor) FileHistory(ctx context.Context, filePaths map[string]bool) ([]FileChange, error)
- func (e *Extractor) RecentCommits(ctx context.Context, maxCount int) ([]CommitInfo, error)
- func (e *Extractor) RecentCommitsSummary(ctx context.Context, count int) (string, error)
- func (e *Extractor) Snapshot() (*RepoSnapshot, error)
- type FileChange
- type FileIntent
- type RepoSnapshot
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommitInfo ¶
type CommitInfo struct {
Hash string
AuthorName string
AuthorEmail string
AuthorTime time.Time
Subject string
Body string
TrailersJSON string // JSON-encoded trailers
IsMerge bool
FirstParent string
}
CommitInfo holds normalized commit metadata
type Extractor ¶
type Extractor struct {
// contains filtered or unexported fields
}
Extractor extracts Git metadata from a repository
func NewExtractor ¶
NewExtractor opens a git repository at the given path. Returns nil, nil if the path is not a git repository (graceful degradation). Returns an error if config values are invalid (HistoryDepth or MaxMessageBytes <= 0).
func (*Extractor) CompactFileIntents ¶
func (e *Extractor) CompactFileIntents(changes []FileChange) []FileIntent
CompactFileIntents generates compressed intent summaries per file from file changes. Groups changes by file, prioritizes recent and meaningful commits, and produces bounded text.
func (*Extractor) FileHistory ¶
func (e *Extractor) FileHistory(ctx context.Context, filePaths map[string]bool) ([]FileChange, error)
FileHistory returns commit associations for the given file paths. Walks up to config.HistoryDepth commits and maps file changes. If filePaths is nil, returns history for all files encountered.
func (*Extractor) RecentCommits ¶
RecentCommits returns the last N commits from HEAD (bounded by config.HistoryDepth). If maxCount <= 0, uses config.HistoryDepth.
func (*Extractor) RecentCommitsSummary ¶
RecentCommitsSummary returns a bounded human-readable summary of recent commits.
func (*Extractor) Snapshot ¶
func (e *Extractor) Snapshot() (*RepoSnapshot, error)
Snapshot captures the current repository state.
type FileChange ¶
type FileChange struct {
FilePath string
CommitHash string
ChangeType string // added, modified, deleted, renamed
CommitTime time.Time
Summary string // commit subject
}
FileChange represents a file's association with a commit
type FileIntent ¶
type FileIntent struct {
FilePath string
IntentText string
SourceHash string // hash of inputs used to generate this intent
CommitCount int
LastCommitHash string
LastUpdatedAt time.Time
}
FileIntent is a compacted, retrieval-ready intent summary per file
type RepoSnapshot ¶
type RepoSnapshot struct {
RepoRoot string
HeadRef string // branch name or "HEAD"
HeadCommit string // commit hash
IsDetached bool
IsDirty bool
AheadCount int // 0 for now (no remote comparison in v1)
BehindCount int // 0 for now
StagedFiles int
ModifiedFiles int
UntrackedFiles int
Summary string // human-readable summary
UpdatedAt time.Time
}
RepoSnapshot captures current repository state