Documentation
¶
Overview ¶
Package ticks wraps the tk CLI for interacting with the Ticks issue tracker. It provides operations for epics, tasks, and dependency graph queries.
Index ¶
- type Client
- func (c *Client) AddAgentNote(issueID, message string) error
- func (c *Client) AddHumanNote(issueID, message string) error
- func (c *Client) AddNote(issueID, message string, extraArgs ...string) error
- func (c *Client) Approve(taskID string) error
- func (c *Client) ClearAwaiting(taskID string) error
- func (c *Client) CloseEpic(epicID, reason string) error
- func (c *Client) CloseTask(taskID, reason string) error
- func (c *Client) CompleteTask(taskID string, summary string) error
- func (c *Client) GetAgentNotes(issueID string) ([]Note, error)
- func (c *Client) GetEpic(epicID string) (*Epic, error)
- func (c *Client) GetHumanNotes(issueID string) ([]Note, error)
- func (c *Client) GetNotes(issueID string) ([]string, error)
- func (c *Client) GetNotesByAuthor(issueID string, author string) ([]Note, error)
- func (c *Client) GetStructuredNotes(issueID string) ([]Note, error)
- func (c *Client) GetTask(taskID string) (*Task, error)
- func (c *Client) HasOpenTasks(epicID string) (bool, error)
- func (c *Client) ListAllTasks() ([]Task, error)
- func (c *Client) ListAwaitingTasks(epicID string, awaitingTypes ...string) ([]Task, error)
- func (c *Client) ListReadyEpics() ([]Epic, error)
- func (c *Client) ListTasks(epicID string) ([]Task, error)
- func (c *Client) ListTickTasks(epicID string) ([]*tick.Tick, error)
- func (c *Client) NextAwaitingTask(epicID string, awaitingTypes ...string) (*Task, error)
- func (c *Client) NextReadyEpic() (*Epic, error)
- func (c *Client) NextTask(epicID string) (*Task, error)
- func (c *Client) NextTaskWithOptions(opts ...NextTaskOption) (*Task, error)
- func (c *Client) ProcessVerdict(taskID string) (VerdictResult, error)
- func (c *Client) Reject(taskID string, feedback string) error
- func (c *Client) ReopenTask(taskID string) error
- func (c *Client) SetAwaiting(taskID string, awaiting string, note string) error
- func (c *Client) SetStatus(issueID, status string) error
- func (c *Client) SetVerdict(taskID string, verdict string, feedback string) error
- type Epic
- type NextTaskOption
- type NextTaskOptions
- type Note
- type Task
- type VerdictResult
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client provides direct access to the Ticks issue tracker via the tick.Store. This avoids the overhead of exec'ing the tk CLI for each operation.
func NewClient ¶
NewClient creates a new Client using the given tick directory. tickDir should be the .tick directory (e.g., "/path/to/project/.tick").
func (*Client) AddAgentNote ¶
AddAgentNote adds a note from the agent (default author). This is the standard way for agents to leave progress notes.
func (*Client) AddHumanNote ¶
AddHumanNote adds a note from a human. Use this for feedback, answers, and other human-provided content.
func (*Client) AddNote ¶
AddNote adds a note to an epic or task. extraArgs can include "--from", "human" to mark the note as from a human.
func (*Client) ClearAwaiting ¶
ClearAwaiting clears the awaiting field of a task.
func (*Client) CompleteTask ¶
CompleteTask handles task completion, respecting the requires field.
func (*Client) GetAgentNotes ¶
GetAgentNotes returns only notes from agents. Use this to read progress notes from previous agent iterations.
func (*Client) GetHumanNotes ¶
GetHumanNotes returns only notes from humans. Use this to read feedback and answers from human reviewers.
func (*Client) GetNotes ¶
GetNotes returns the notes for an epic or task as newline-separated strings.
func (*Client) GetNotesByAuthor ¶
GetNotesByAuthor returns notes filtered by author.
func (*Client) GetStructuredNotes ¶
GetStructuredNotes returns notes as structured Note objects with author metadata. Parses the legacy "notes" string format, detecting [human] prefix for human notes.
func (*Client) HasOpenTasks ¶
HasOpenTasks returns true if the epic has any non-closed tasks.
func (*Client) ListAllTasks ¶
ListAllTasks returns all tasks regardless of parent epic.
func (*Client) ListAwaitingTasks ¶
ListAwaitingTasks returns all tasks awaiting human attention under the given epic.
func (*Client) ListReadyEpics ¶
ListReadyEpics returns all open epics (for picker display).
func (*Client) ListTickTasks ¶ added in v0.12.0
ListTickTasks returns raw tick.Tick pointers for all tasks under the given epic. This is used by wave.Compute which needs the full tick.Tick struct for dependency analysis (BlockedBy, Status, Awaiting, Priority, etc).
func (*Client) NextAwaitingTask ¶
NextAwaitingTask returns the next task awaiting human attention.
func (*Client) NextReadyEpic ¶
NextReadyEpic returns the next ready (unblocked) epic.
func (*Client) NextTask ¶
NextTask returns the next open, unblocked task for the given epic that is ready for agent work. Returns nil if no tasks are available.
func (*Client) NextTaskWithOptions ¶
func (c *Client) NextTaskWithOptions(opts ...NextTaskOption) (*Task, error)
NextTaskWithOptions returns the next open, unblocked task ready for agent work. Uses functional options to configure behavior.
func (*Client) ProcessVerdict ¶
func (c *Client) ProcessVerdict(taskID string) (VerdictResult, error)
ProcessVerdict reads a task, processes its verdict, and saves the result.
func (*Client) ReopenTask ¶
ReopenTask reopens a closed task.
func (*Client) SetAwaiting ¶
SetAwaiting updates the awaiting field of a task.
type Epic ¶
type Epic struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Notes string `json:"notes,omitempty"`
Status string `json:"status"`
Priority int `json:"priority"`
Type string `json:"type"`
Owner string `json:"owner"`
Children []string `json:"children,omitempty"`
CreatedBy string `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt time.Time `json:"closed_at,omitempty"`
}
Epic represents an epic containing multiple tasks.
type NextTaskOption ¶
type NextTaskOption func(*NextTaskOptions)
NextTaskOption is a functional option for configuring NextTask.
func OrphanedOnly ¶
func OrphanedOnly() NextTaskOption
OrphanedOnly filters to tasks whose parent epic is closed.
func StandaloneOnly ¶
func StandaloneOnly() NextTaskOption
StandaloneOnly filters to tasks without a parent epic.
func WithEpic ¶
func WithEpic(epicID string) NextTaskOption
WithEpic sets the epic ID to search within.
type NextTaskOptions ¶
type NextTaskOptions struct {
// EpicID filters to tasks under a specific epic. Empty means search all tasks.
EpicID string
// StandaloneOnly when true, only returns tasks without a parent epic.
StandaloneOnly bool
// OrphanedOnly when true, only returns tasks whose parent epic is closed.
OrphanedOnly bool
}
NextTaskOptions configures the behavior of NextTask.
type Note ¶
type Note struct {
Content string `json:"content"`
Author string `json:"author,omitempty"` // "agent" (default/empty) or "human"
CreatedAt time.Time `json:"created_at,omitempty"`
}
Note represents a single note with author metadata. Notes can be from agents (default) or humans.
func (*Note) IsFromAgent ¶
IsFromAgent returns true if the note was created by an agent. Notes with empty author are considered agent notes (default).
func (*Note) IsFromHuman ¶
IsFromHuman returns true if the note was created by a human.
type Task ¶
type Task struct {
ID string `json:"id"`
Title string `json:"title"`
Description string `json:"description"`
Status string `json:"status"`
Priority int `json:"priority"`
Type string `json:"type"`
Owner string `json:"owner"`
BlockedBy []string `json:"blocked_by,omitempty"`
Parent string `json:"parent,omitempty"`
Manual bool `json:"manual,omitempty"`
// Requires declares a gate that must be passed before closing.
// Set at creation time, persists through the tick lifecycle.
// Valid values: approval, review, content
Requires *string `json:"requires,omitempty"`
// Awaiting indicates the tick is waiting for human action.
// null means agent's turn, any other value means human's turn.
// Valid values: work, approval, input, review, content, escalation, checkpoint
Awaiting *string `json:"awaiting,omitempty"`
// Verdict is the human's response to an awaiting state.
// Processed immediately when set, then cleared.
// Valid values: approved, rejected
Verdict *string `json:"verdict,omitempty"`
CreatedBy string `json:"created_by"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt time.Time `json:"closed_at,omitempty"`
}
Task represents a single task in the Ticks issue tracker.
func (*Task) ClearAwaiting ¶
func (t *Task) ClearAwaiting()
ClearAwaiting clears both Awaiting and Manual fields. Use this when the task is ready for agent work.
func (*Task) GetAwaitingType ¶
GetAwaitingType returns the type of human action the task is waiting for. Returns an empty string if the task is not awaiting human action. For backwards compatibility, returns "work" if Manual is true and Awaiting is not set.
func (*Task) IsAwaitingHuman ¶
IsAwaitingHuman returns true if the task is waiting for human action. A task is awaiting human action when the Awaiting field is non-nil, or when Manual is true (backwards compatibility - Manual is equivalent to awaiting=work).
func (*Task) ProcessVerdict ¶
func (t *Task) ProcessVerdict() VerdictResult
ProcessVerdict processes the verdict on a task according to the awaiting type. Returns a VerdictResult indicating what changes were made.
Verdict processing matrix:
- work, approval, review, content: approved=close, rejected=agent continues
- input, escalation: approved=agent continues, rejected=close
- checkpoint: never closes, always back to agent
After processing:
- Awaiting and Verdict are cleared (transient fields)
- Requires is NOT cleared (persists through cycles)
- Status is set to "closed" if ShouldClose is true
func (*Task) SetAwaiting ¶
SetAwaiting sets the Awaiting field and clears the Manual field. This ensures new ticks use only the Awaiting field for human action state. Pass an empty string to clear the awaiting state (agent's turn).
type VerdictResult ¶
type VerdictResult struct {
// ShouldClose indicates whether the task should be closed.
ShouldClose bool
// TransientCleared indicates whether transient fields were cleared.
TransientCleared bool
}
VerdictResult represents the outcome of processing a verdict.