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) CanActOnTask(taskID string, query string) (bool, error)
- func (s *Service) CanCreateNewTask(query string) bool
- 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) HasExplicitTaskContinuationIntent(query string) bool
- func (s *Service) SyncTasks(projectPath string) error
- func (s *Service) SyncTasksFromFile(filePath string) error
- type Task
- type TaskMode
- type TaskSafetyEnforcer
- type TaskState
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) CanActOnTask ¶ added in v0.1.23
CanActOnTask checks if an action can be performed on a task based on safety rules
func (*Service) CanCreateNewTask ¶ added in v0.1.23
CanCreateNewTask checks if a new task can be created based on the query
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) HasExplicitTaskContinuationIntent ¶ added in v0.1.23
HasExplicitTaskContinuationIntent checks if the query explicitly requests task continuation
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"`
State TaskState `json:"state"`
Mode TaskMode `json:"mode"`
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
type TaskMode ¶ added in v0.1.23
type TaskMode string
TaskMode represents how the task should be treated
type TaskSafetyEnforcer ¶ added in v0.1.23
type TaskSafetyEnforcer struct {
// contains filtered or unexported fields
}
TaskSafetyEnforcer enforces the safety rules for task operations
func NewTaskSafetyEnforcer ¶ added in v0.1.23
func NewTaskSafetyEnforcer() *TaskSafetyEnforcer
NewTaskSafetyEnforcer creates a new safety enforcer
func (*TaskSafetyEnforcer) CanActOnTask ¶ added in v0.1.23
func (e *TaskSafetyEnforcer) CanActOnTask(task *Task, query string) bool
CanActOnTask determines if an action can be performed on a task
func (*TaskSafetyEnforcer) CanCreateNewTask ¶ added in v0.1.23
func (e *TaskSafetyEnforcer) CanCreateNewTask(query string) bool
CanCreateNewTask determines if a new task can be created without affecting existing tasks
func (*TaskSafetyEnforcer) HasExplicitTaskContinuationIntent ¶ added in v0.1.23
func (e *TaskSafetyEnforcer) HasExplicitTaskContinuationIntent(query string) bool
HasExplicitTaskContinuationIntent checks if the user explicitly requested to continue tasks