tasks

package
v0.1.12 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 29, 2026 License: MIT Imports: 9 Imported by: 0

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

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetTaskFileHash

func GetTaskFileHash(dirPath string) (string, error)

GetTaskFileHash returns the hash of the tinyTasks.md file

func HasTaskFile

func HasTaskFile(dirPath string) (bool, error)

HasTaskFile checks if tinyTasks.md exists in the given directory

Types

type ByteReader

type ByteReader struct {
	Data []byte
	Pos  int
}

ByteReader is a simple wrapper to implement io.Reader interface

func (*ByteReader) Read

func (br *ByteReader) Read(p []byte) (n int, err error)

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service handles task operations

func NewService

func NewService(db *storage.DB, memoryService *memory.Service, projectID string) *Service

NewService creates a new task service

func (*Service) CreateOrUpdateTask

func (s *Service) CreateOrUpdateTask(task *Task) error

CreateOrUpdateTask creates or updates a task in memory

func (*Service) DeleteTask

func (s *Service) DeleteTask(key string) error

DeleteTask removes a task from memory

func (*Service) DetectAndRecoverDrift

func (s *Service) DetectAndRecoverDrift(filePath string) error

DetectAndRecoverDrift checks for differences between file and memory and recovers if needed

func (*Service) GetAllTasks

func (s *Service) GetAllTasks() ([]*memory.Memory, error)

GetAllTasks retrieves all task memories for the project

func (*Service) GetTaskByKey

func (s *Service) GetTaskByKey(key string) (*memory.Memory, error)

GetTaskByKey retrieves a task by its key

func (*Service) GetTaskStatus

func (s *Service) GetTaskStatus(projectPath string) (map[string]interface{}, error)

GetTaskStatus returns a summary of task status

func (*Service) SyncTasks

func (s *Service) SyncTasks(projectPath string) error

SyncTasks performs synchronization of tasks from file to memory

func (*Service) SyncTasksFromFile

func (s *Service) SyncTasksFromFile(filePath string) error

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

func ParseTasks

func ParseTasks(r io.Reader) ([]*Task, error)

ParseTasks parses the tinyTasks.md file and returns a list of tasks

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL