tasks

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: May 9, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrLegacyTaskMetadata = errors.New("legacy XML task metadata detected")
	ErrV1TaskMetadata     = errors.New("v1 task front matter detected")
)
View Source
var BuiltinTypes = []string{
	"frontend",
	"backend",
	"docs",
	"test",
	"infra",
	"refactor",
	"chore",
	"bugfix",
}

Functions

func CompleteNonTerminalTasks added in v0.2.2

func CompleteNonTerminalTasks(tasksDir string) (int, error)

func ExtractLegacyTaskBody added in v0.1.10

func ExtractLegacyTaskBody(content string) (string, error)

func ExtractTaskBodyTitle added in v0.1.7

func ExtractTaskBodyTitle(body string) string

ExtractTaskBodyTitle returns the first H1 title from the body with any leading "Task N:" or "Task N -" prefix removed.

func ExtractTaskNumber added in v0.1.10

func ExtractTaskNumber(filename string) int

func FixPrompt added in v0.1.7

func FixPrompt(report Report, registry *TypeRegistry) string

FixPrompt renders a deterministic LLM-ready remediation prompt for a validation report.

func IsTaskCompleted added in v0.1.10

func IsTaskCompleted(task model.TaskEntry) bool

func LooksLikeLegacyTaskFile added in v0.1.10

func LooksLikeLegacyTaskFile(content string) bool

func MarkTaskCompleted added in v0.1.1

func MarkTaskCompleted(tasksDir, taskFileName string) error

func MetaPath

func MetaPath(tasksDir string) string

func ParseLegacyTaskFile added in v0.1.10

func ParseLegacyTaskFile(content string) (model.TaskEntry, error)

func ParseTaskFile added in v0.1.10

func ParseTaskFile(content string) (model.TaskEntry, error)

func ReadTaskEntries added in v0.1.10

func ReadTaskEntries(tasksDir string, includeCompleted bool) ([]model.IssueEntry, error)

func ReadTaskMeta

func ReadTaskMeta(tasksDir string) (model.TaskMeta, error)

func RefreshTaskMeta

func RefreshTaskMeta(tasksDir string) (model.TaskMeta, error)

func RemapLegacyTaskType added in v0.1.7

func RemapLegacyTaskType(raw string, registry *TypeRegistry) string

RemapLegacyTaskType canonicalizes a legacy v1 task type into an allowed v2 registry value when possible. It returns the empty string when the legacy type requires manual selection or has no known mapping.

func SnapshotTaskMeta added in v0.2.0

func SnapshotTaskMeta(tasksDir string) (model.TaskMeta, error)

func WrapParseError added in v0.1.10

func WrapParseError(path string, err error) error

func WriteTaskMeta

func WriteTaskMeta(tasksDir string, meta model.TaskMeta) error

Types

type ArtifactParseError added in v0.2.0

type ArtifactParseError struct {
	Path string
	Err  error
}

ArtifactParseError preserves the task artifact path and underlying parse failure so callers can classify invalid task content without losing context.

func (*ArtifactParseError) Error added in v0.2.0

func (e *ArtifactParseError) Error() string

func (*ArtifactParseError) Unwrap added in v0.2.0

func (e *ArtifactParseError) Unwrap() error

type Issue added in v0.1.7

type Issue struct {
	Path    string `json:"path"`
	Field   string `json:"field"`
	Message string `json:"message"`
}

Issue describes one validation problem found in a task file.

type Report added in v0.1.7

type Report struct {
	TasksDir string  `json:"tasks_dir"`
	Scanned  int     `json:"scanned"`
	Issues   []Issue `json:"issues"`
}

Report captures the outcome of validating a tasks directory.

func Validate added in v0.1.7

func Validate(ctx context.Context, tasksDir string, registry *TypeRegistry) (Report, error)

Validate scans task markdown files and reports schema violations without mutating the filesystem.

func (Report) OK added in v0.1.7

func (r Report) OK() bool

OK reports whether the validation pass found no issues.

type TypeRegistry added in v0.1.7

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

func NewRegistry added in v0.1.7

func NewRegistry(configured []string) (*TypeRegistry, error)

func (*TypeRegistry) IsAllowed added in v0.1.7

func (r *TypeRegistry) IsAllowed(slug string) bool

func (*TypeRegistry) Values added in v0.1.7

func (r *TypeRegistry) Values() []string

Jump to

Keyboard shortcuts

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