Documentation
¶
Overview ¶
Package tasks implements a file-authoritative task ledger for TinyMem.
The task system follows these principles: 1. tinyTasks.md is the sole source of truth for task state 2. TinyMem never infers task completion 3. Memory entries are fully rebuildable from the file 4. If file and memory disagree, file wins 5. Memory never stores subtask text or implementation detail
The system supports: - Top-level checkbox tasks with nested subtasks - Stable task identification based on section and position - One-way sync from file to memory - Drift detection and recovery
Index ¶
- func GetTaskFileHash(dirPath string) (string, error)
- func HasTaskFile(dirPath string) (bool, error)
- type ByteReader
- type Service
- func (s *Service) CreateOrUpdateTask(task *Task) error
- func (s *Service) DeleteTask(key string) error
- func (s *Service) DetectAndRecoverDrift(filePath string) error
- func (s *Service) GetAllTasks() ([]*memory.Memory, error)
- func (s *Service) GetTaskByKey(key string) (*memory.Memory, error)
- func (s *Service) GetTaskStatus(projectPath string) (map[string]interface{}, error)
- func (s *Service) SyncTasks(projectPath string) error
- func (s *Service) SyncTasksFromFile(filePath string) error
- type Task
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetTaskFileHash ¶
GetTaskFileHash returns the hash of the tinyTasks.md file
func HasTaskFile ¶
HasTaskFile checks if tinyTasks.md exists in the given directory
Types ¶
type ByteReader ¶
ByteReader is a simple wrapper to implement io.Reader interface
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service handles task operations
func NewService ¶
NewService creates a new task service
func (*Service) CreateOrUpdateTask ¶
CreateOrUpdateTask creates or updates a task in memory
func (*Service) DeleteTask ¶
DeleteTask removes a task from memory
func (*Service) DetectAndRecoverDrift ¶
DetectAndRecoverDrift checks for differences between file and memory and recovers if needed
func (*Service) GetAllTasks ¶
GetAllTasks retrieves all task memories for the project
func (*Service) GetTaskByKey ¶
GetTaskByKey retrieves a task by its key
func (*Service) GetTaskStatus ¶
GetTaskStatus returns a summary of task status
func (*Service) SyncTasksFromFile ¶
SyncTasksFromFile synchronizes tasks from the tinyTasks.md file to memory
type Task ¶
type Task struct {
ID string `json:"id"`
Title string `json:"title"`
Section string `json:"section"`
Index int `json:"index"`
StepsTotal int `json:"steps_total"`
StepsDone int `json:"steps_done"`
Completed bool `json:"completed"`
LastSeenHash string `json:"last_seen_hash"`
FilePath string `json:"file_path"`
LastUpdated string `json:"last_updated"`
ExtraFields map[string]string `json:"extra_fields,omitempty"` // For future extensibility
}
Task represents a parsed task from tinyTasks.md