query

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jan 16, 2026 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Apply

func Apply(ticks []tick.Tick, f Filter) []tick.Tick

Apply filters ticks according to Filter fields.

func Blocked

func Blocked(candidates []tick.Tick, allTicks ...[]tick.Tick) []tick.Tick

Blocked returns ticks that are open or in_progress with open blockers. Missing blockers are treated as closed (not blocked) - this handles orphaned references when blockers are deleted. If allTicks is provided, it is used to look up blocker status (for when candidates is a filtered subset and blockers may be outside that subset).

func LoadTicksParallel

func LoadTicksParallel(issuesDir string) ([]tick.Tick, error)

LoadTicksParallel loads all ticks from the issues directory with bounded concurrency.

func NeedsRebuild

func NeedsRebuild(indexPath, issuesDir string) (bool, error)

NeedsRebuild checks whether any issue file is newer than the index file.

func Ready

func Ready(candidates []tick.Tick, allTicks ...[]tick.Tick) []tick.Tick

Ready returns open ticks that are not blocked by open blockers. Missing blockers are treated as closed (ready) - this handles orphaned references when blockers are deleted. Tasks awaiting human action are excluded (use ReadyIncludeAwaiting to include them). If allTicks is provided, it is used to look up blocker status (for when candidates is a filtered subset and blockers may be outside that subset).

func ReadyIncludeAwaiting added in v0.1.18

func ReadyIncludeAwaiting(candidates []tick.Tick, allTicks ...[]tick.Tick) []tick.Tick

ReadyIncludeAwaiting is like Ready but includes tasks awaiting human action. Use this when displaying all ready tasks including those needing human review.

func SaveIndex

func SaveIndex(path string, ticks []tick.Tick) error

SaveIndex writes the index file.

func SortByPriorityCreatedAt

func SortByPriorityCreatedAt(ticks []tick.Tick)

SortByPriorityCreatedAt sorts ticks by status (in_progress first), priority, created_at, then id.

Types

type Filter

type Filter struct {
	Owner         string
	Status        string
	Priority      *int
	Type          string
	Label         string
	LabelAny      []string
	Parent        string
	TitleContains string
	DescContains  string
	NotesContains string
	// Awaiting filters by awaiting state. Use pointer to distinguish:
	// - nil: no filter (show all)
	// - pointer to empty string: show only ticks with awaiting=null (not awaiting human)
	// - pointer to value: show only ticks with that specific awaiting value
	Awaiting *string
	// AwaitingAny filters to ticks matching any of the listed awaiting values.
	// Treats Manual=true as awaiting="work" for backwards compatibility.
	AwaitingAny []string
}

Filter describes filtering criteria for ticks.

type Index

type Index struct {
	BuiltAt time.Time   `json:"built_at"`
	Ticks   []tick.Tick `json:"ticks"`
}

Index is a cached snapshot of ticks.

func LoadIndex

func LoadIndex(path string) (Index, error)

LoadIndex reads the index file.

Jump to

Keyboard shortcuts

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