Documentation
¶
Overview ¶
Package types defines core data structures for the arc issue tracker.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type BlockedIssue ¶
type BlockedIssue struct {
Issue
BlockedByCount int `json:"blocked_by_count"`
BlockedBy []string `json:"blocked_by"`
}
BlockedIssue extends Issue with blocking information.
type Comment ¶
type Comment struct {
ID int64 `json:"id"`
IssueID string `json:"issue_id"`
Author string `json:"author"`
Text string `json:"text"`
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at,omitempty"`
}
Comment represents a comment on an issue.
type Dependency ¶
type Dependency struct {
IssueID string `json:"issue_id"`
DependsOnID string `json:"depends_on_id"`
Type DependencyType `json:"type"`
CreatedAt time.Time `json:"created_at"`
CreatedBy string `json:"created_by,omitempty"`
}
Dependency represents a relationship between issues.
type DependencyType ¶
type DependencyType string
DependencyType categorizes the relationship.
const ( DepBlocks DependencyType = "blocks" DepParentChild DependencyType = "parent-child" DepRelated DependencyType = "related" DepDiscoveredFrom DependencyType = "discovered-from" )
func AllDependencyTypes ¶
func AllDependencyTypes() []DependencyType
AllDependencyTypes returns all valid dependency type values.
func (DependencyType) AffectsReadyWork ¶
func (d DependencyType) AffectsReadyWork() bool
AffectsReadyWork returns true if this dependency type blocks work.
func (DependencyType) IsValid ¶
func (d DependencyType) IsValid() bool
IsValid checks if the dependency type value is valid.
type Event ¶
type Event struct {
ID int64 `json:"id"`
IssueID string `json:"issue_id"`
EventType EventType `json:"event_type"`
Actor string `json:"actor"`
OldValue *string `json:"old_value,omitempty"`
NewValue *string `json:"new_value,omitempty"`
Comment *string `json:"comment,omitempty"`
CreatedAt time.Time `json:"created_at"`
}
Event represents an audit trail entry.
type EventType ¶
type EventType string
EventType categorizes audit trail events.
const ( EventCreated EventType = "created" EventUpdated EventType = "updated" EventStatusChanged EventType = "status_changed" EventCommented EventType = "commented" EventClosed EventType = "closed" EventReopened EventType = "reopened" EventDependencyAdded EventType = "dependency_added" EventDependencyRemoved EventType = "dependency_removed" EventLabelAdded EventType = "label_added" EventLabelRemoved EventType = "label_removed" )
type Issue ¶
type Issue struct {
// Core Identification
ID string `json:"id"`
WorkspaceID string `json:"workspace_id"`
ParentID string `json:"parent_id,omitempty"` // For hierarchical child IDs (e.g., parent-id.1)
// Issue Content
Title string `json:"title"`
Description string `json:"description,omitempty"`
// Status & Workflow
Status Status `json:"status"`
Priority int `json:"priority"` // 0 (critical) - 4 (backlog)
Rank int `json:"rank"` // 0 = unranked (sorts last), 1+ = lower rank = work on first
IssueType IssueType `json:"issue_type"`
// Assignment
Assignee string `json:"assignee,omitempty"`
// Timestamps
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
ClosedAt *time.Time `json:"closed_at,omitempty"`
CloseReason string `json:"close_reason,omitempty"`
// External Integration
ExternalRef string `json:"external_ref,omitempty"` // e.g., "gh-9", "jira-ABC"
// Relational Data (populated for detail views)
Labels []string `json:"labels,omitempty"`
Dependencies []*Dependency `json:"dependencies,omitempty"`
Comments []*Comment `json:"comments,omitempty"`
}
Issue represents a trackable work item.
func (*Issue) SetDefaults ¶
func (i *Issue) SetDefaults()
SetDefaults applies default values for missing fields.
type IssueDetails ¶
type IssueDetails struct {
Issue
Labels []string `json:"labels,omitempty"`
Dependencies []*Dependency `json:"dependencies,omitempty"`
Dependents []*Dependency `json:"dependents,omitempty"`
Comments []*Comment `json:"comments,omitempty"`
}
IssueDetails extends Issue with full relational data.
type IssueFilter ¶
type IssueFilter struct {
WorkspaceID string // Required: filter by workspace
Status *Status // Filter by status
Priority *int // Filter by priority
IssueType *IssueType // Filter by issue type
Assignee *string // Filter by assignee
Labels []string // AND semantics: issue must have ALL these labels
Query string // Full-text search in title/description
IDs []string // Filter by specific issue IDs
Limit int // Maximum results to return
Offset int // Pagination offset
}
IssueFilter is used to filter issue queries.
type IssueType ¶
type IssueType string
IssueType categorizes the kind of work.
func AllIssueTypes ¶
func AllIssueTypes() []IssueType
AllIssueTypes returns all valid issue type values.
type Label ¶
type Label struct {
WorkspaceID string `json:"workspace_id"`
Name string `json:"name"`
Color string `json:"color,omitempty"`
Description string `json:"description,omitempty"`
}
Label represents a tag that can be applied to issues.
type SortPolicy ¶
type SortPolicy string
SortPolicy defines how ready work should be sorted.
const ( // SortPolicyHybrid sorts recent issues (<48h) by priority/rank, older issues by age. // This prevents backlog starvation while keeping high-priority recent work visible. SortPolicyHybrid SortPolicy = "hybrid" // SortPolicyPriority always sorts by priority → rank → created_at. SortPolicyPriority SortPolicy = "priority" // SortPolicyOldest always sorts by created_at (oldest first) for backlog clearing. SortPolicyOldest SortPolicy = "oldest" )
func AllSortPolicies ¶
func AllSortPolicies() []SortPolicy
AllSortPolicies returns all valid sort policy values.
func (SortPolicy) IsValid ¶
func (s SortPolicy) IsValid() bool
IsValid checks if the sort policy is valid.
type Statistics ¶
type Statistics struct {
WorkspaceID string `json:"workspace_id"`
TotalIssues int `json:"total_issues"`
OpenIssues int `json:"open_issues"`
InProgressIssues int `json:"in_progress_issues"`
ClosedIssues int `json:"closed_issues"`
BlockedIssues int `json:"blocked_issues"`
DeferredIssues int `json:"deferred_issues"`
ReadyIssues int `json:"ready_issues"`
AvgLeadTimeHours float64 `json:"avg_lead_time_hours,omitempty"`
}
Statistics provides aggregate metrics for a workspace.
type WorkFilter ¶
type WorkFilter struct {
WorkspaceID string // Required: filter by workspace
Status *Status // Filter by status
IssueType *IssueType // Filter by issue type
Priority *int // Filter by priority
Assignee *string // Filter by assignee
Unassigned bool // Filter for unassigned issues
Labels []string // AND semantics
SortPolicy SortPolicy // Sort policy: hybrid (default), priority, oldest
Limit int // Maximum results
}
WorkFilter is used to filter ready work queries.
type Workspace ¶
type Workspace struct {
ID string `json:"id"` // Short hash ID (e.g., "ws-a1b2")
Name string `json:"name"` // Display name
Path string `json:"path,omitempty"` // Optional: associated directory path
Description string `json:"description,omitempty"`
Prefix string `json:"prefix"` // Issue ID prefix (e.g., "bd")
CreatedAt time.Time `json:"created_at"`
UpdatedAt time.Time `json:"updated_at"`
}
Workspace represents a project or workspace that contains issues. Replaces the per-repo concept from beads with explicit workspace management.