Documentation
¶
Overview ¶
Package models holds the board data model: a single task, its lifecycle state, and its workflow status.
North uses two orthogonal axes:
- State is the lifecycle location — the folder a task lives in (drafts/ tasks/ archive/). It is the source of truth for "where" a task is.
- Status is the workflow column (ready/in_progress/done/failed/blocked), stored only in frontmatter. It only changes while the task is active.
Both axes are freeform: any status can move to any other status, and any state to any other state, in a single step. The fixed status/state *lists* are hardcoded for the MVP (configurable statuses are deferred).
Index ¶
Constants ¶
const DefaultStatus = Ready
DefaultStatus is the status a new task carries.
Variables ¶
var StateDirs = map[TaskState]string{ StateDraft: "drafts", StateActive: "tasks", StateArchive: "archive", }
StateDirs maps each state to its on-disk folder name (in board order).
var StateOrder = []TaskState{StateDraft, StateActive, StateArchive}
StateOrder lists the states in board order (drafts → tasks → archive).
var Statuses = []TaskStatus{Ready, InProgress, Blocked, Done, Failed}
Statuses lists every workflow status in board order — a left→right flow: blocked sits beside in_progress (a parked task), terminal states last.
Functions ¶
func IsState ¶
IsState reports whether s is a known state. State moves are freeform: any known state is a legal target from any other.
func IsStatus ¶
func IsStatus(s TaskStatus) bool
IsStatus reports whether s is a known status. Status moves are freeform: any known status is a legal target from any other (active tasks only).
func StateIndex ¶
StateIndex returns the board-order position of a state (for stable sorting).
Types ¶
type Task ¶
type Task struct {
ID string
Title string
State TaskState
Status TaskStatus
Path string
Assignee string
Labels []string
DependsOn []string
CreatedAt *time.Time
UpdatedAt *time.Time
Body string
}
Task is one board task. Path is where the file currently lives on disk; State is derived from its folder, Status from its frontmatter.
type TaskState ¶
type TaskState string
TaskState is the lifecycle location of a task — the folder it lives in.
func StateForDir ¶
StateForDir returns the state whose folder is dir.
type TaskStatus ¶
type TaskStatus string
TaskStatus is the workflow column, stored in frontmatter.
const ( Ready TaskStatus = "ready" InProgress TaskStatus = "in_progress" Done TaskStatus = "done" Failed TaskStatus = "failed" Blocked TaskStatus = "blocked" )