Documentation
¶
Index ¶
- func AnalyzeDiff(oldContent, newContent string) ([]FieldChange, []SubtaskChange)
- func BuildGitLogArgs(tasksDir string, limit int, since, scope string) []string
- func BuildGitLogArgsForFile(limit int, since, taskFile string) []string
- func EnrichEntriesWithDiffAnalysis(entries []FeedEntry, gitShowFn GitShowFunc)
- func ExtractFrontmatterFields(content string) map[string]string
- func ExtractSubtasks(content string) map[string]bool
- func ExtractTaskIDFromPath(path string) string
- func NormalizeSince(s string) string
- func ParseSinceTime(since string) time.Time
- type FeedEntry
- type FieldChange
- type FileChange
- type GitLogFunc
- type GitShowFunc
- type Options
- type SubtaskChange
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func AnalyzeDiff ¶
func AnalyzeDiff(oldContent, newContent string) ([]FieldChange, []SubtaskChange)
AnalyzeDiff compares old and new task file content, returning detected frontmatter field changes and subtask checkbox toggles.
func BuildGitLogArgs ¶
BuildGitLogArgs constructs git log arguments for feed queries.
func BuildGitLogArgsForFile ¶
BuildGitLogArgsForFile constructs git log arguments scoped to a single task file. It uses --follow so the file's history is threaded across renames, and the initial "A" commit surfaces the task's creation event.
func EnrichEntriesWithDiffAnalysis ¶
func EnrichEntriesWithDiffAnalysis(entries []FeedEntry, gitShowFn GitShowFunc)
EnrichEntriesWithDiffAnalysis reads task files at each commit and its parent to detect field-level changes and subtask completions.
func ExtractFrontmatterFields ¶
ExtractFrontmatterFields parses YAML frontmatter (between --- delimiters) into a map of field name to value. Only handles simple key: value lines.
func ExtractSubtasks ¶
ExtractSubtasks finds all markdown checkbox lines (- [ ] or - [x]) in the body (after frontmatter) and returns a map of subtask text to checked state.
func ExtractTaskIDFromPath ¶
ExtractTaskIDFromPath extracts a task ID from a file path.
func NormalizeSince ¶
NormalizeSince converts shorthand durations like "2d" or "1w" into git-compatible relative date strings like "2.days.ago" or "1.weeks.ago".
func ParseSinceTime ¶
ParseSinceTime converts a since string into a time.Time cutoff.
Types ¶
type FeedEntry ¶
type FeedEntry struct {
Source string `json:"source"`
Hash string `json:"hash,omitempty"`
Author string `json:"author,omitempty"`
Timestamp time.Time `json:"timestamp"`
Message string `json:"message"`
TaskID string `json:"taskID,omitempty"`
Files []FileChange `json:"files,omitempty"`
}
FeedEntry represents a single event in the activity feed.
func MergeEntries ¶
MergeEntries merges two slices of FeedEntry sorted by timestamp descending.
func ParseGitLogOutput ¶
ParseGitLogOutput parses the output of a git log command into FeedEntry values.
func ScanWorklogEntries ¶
ScanWorklogEntries finds .worklogs/*.md files under tasksDir and converts their entries into FeedEntry values with Source "worklog".
type FieldChange ¶
type FieldChange struct {
Field string `json:"field"`
OldValue string `json:"oldValue"`
NewValue string `json:"newValue"`
}
FieldChange represents a frontmatter field that changed between two versions.
type FileChange ¶
type FileChange struct {
Path string `json:"path"`
Status string `json:"status"`
TaskID string `json:"taskID,omitempty"`
TaskStatus string `json:"taskStatus,omitempty"`
FieldChanges []FieldChange `json:"fieldChanges,omitempty"`
SubtaskChanges []SubtaskChange `json:"subtaskChanges,omitempty"`
}
FileChange represents a file changed in a commit.
type GitLogFunc ¶
GitLogFunc is a function that runs git log with the given args.
type GitShowFunc ¶
GitShowFunc is a function that retrieves file content at a given commit.
type Options ¶
type Options struct {
TasksDir string
Limit int
Since string
Scope string
Source string
// TaskFile, when set, scopes the query to a single task file (path
// relative to where git runs). Enables per-task history via --follow.
TaskFile string
Verbose bool
GitLogFn GitLogFunc
GitShowFn GitShowFunc
}
Options configures a feed query.
type SubtaskChange ¶
SubtaskChange represents a subtask checkbox that was toggled.