board

package
v0.55.9 Latest Latest
Warning

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

Go to latest
Published: Nov 30, 2026 License: Apache-2.0 Imports: 13 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package board holds aeman's pure board logic, ported from the web frontend: date helpers, the stage model, per-team sprint pointers, the board views (Team grid, Me, Backlog) and the status/progress transition rules. Every function works on an in-memory Board snapshot with no network access, so the HTTP API and the MCP server can later expose the same views and actions.

Index

Constants

View Source
const (
	EventCreated         = "created"
	EventStage           = "stage"
	EventProgress        = "progress"
	EventAssignee        = "assignee"
	EventTeam            = "team"
	EventZone            = "zone"
	EventSize            = "size"
	EventReviewSent      = "review-sent"
	EventReviewPassed    = "review-passed"
	EventReviewerRemoved = "reviewer-removed"
	EventDates           = "dates"
	EventSprint          = "sprint"
	EventBacklog         = "backlog"
	EventReviewRound     = "review-round"
	EventParent          = "parent"
	EventSubtask         = "subtask"
	EventRecurrence      = "recurrence"
	// EventOwner and EventCustomers record a planning card's owner and a
	// card's customers (docs/design/ownership.md).
	EventOwner     = "owner"
	EventCustomers = "customers"
	// EventDependsOn records a card's dependency list, comma-joined uids
	// (docs/design/dependencies.md).
	EventDependsOn = "depends-on"
)

Event kinds written by the board service.

View Source
const (
	TypeTask       = ""
	TypeEpic       = "epic"
	TypeInitiative = "initiative"
	TypeGoal       = "goal"
)

The card types. A task is the absence of one: the day boards' own kind, and the only kind the boards before this one ever drew.

View Source
const (
	HierarchyNoItems    = "no-items"
	HierarchyBacklog    = "backlog"
	HierarchyInProgress = "in-progress"
	HierarchyDone       = "done"
)

The derived status of a planning card (HierarchyStatus): never stored. Four words. A card with NOTHING under it is not waiting for work, it has none (no items); work under it in hand is in progress; open work under it all waiting in backlogs is BACKLOG; done when every task is.

View Source
const (
	RecurrenceSprint    = ""        // every sprint (default)
	RecurrenceWeek      = "week"    // reseed when the new sprint is ≥1 week past the card's sprint
	RecurrenceFortnight = "2weeks"  // ≥2 weeks past
	RecurrenceMonth     = "month"   // ≥1 calendar month past
	RecurrenceQuarter   = "quarter" // ≥3 calendar months past
)

Recurrence cycles: how often a finished recurrent card reseeds a fresh copy at carry-over. The empty default keeps the original behaviour — every sprint.

View Source
const (
	WorkStatusInProgress = "in-progress"
	WorkStatusBacklog    = "backlog"
	WorkStatusDone       = "done"
)

The work statuses the Strategy board's status filter reads (O14). Mirrored by workStatus in web/src/workstatus.ts; both read testdata/work_status.json.

View Source
const (
	StatusFilterLocked  = "locked"
	StatusFilterNoItems = HierarchyNoItems
)

The values the Strategy board's status filter takes beyond the work statuses (O14): a card a dependency holds (the derived lock, N3 — status.locked, never the manual stage) and a planning card with nothing under it (its roll-up is HierarchyNoItems). Mirrored by web/src/workstatus.ts.

View Source
const DefaultBarColor = "#3fb950"

DefaultBarColor is the progress-bar colour for a card with no stage, mirroring DEFAULT_BAR_COLOR.

View Source
const DefaultSize = SizeM

DefaultSize is what a card nobody has sized WEIGHS on a board: M.

Not zero. A board that weighs unsized work as nothing tells a person their week is empty while they are drowning in it, and the number goes up as the cards are sized — which reads as the sizing having caused the load. M is the middle of the board's own record: of 2194 sized cards on the production board 40% are S, 34% M, 23% L, 1% XL — the median card is M and the mean is 2.14 points — and assuming M costs less than any other guess (mean error 0.96 points against 1.14 for S and 1.97 for L). The cards most likely to be left unsized, the ones with no description at all, average 1.86 points, which is nearer M than S too.

View Source
const MaxRankLen = 32

MaxRankLen is the length past which a key asks for a rebalance.

View Source
const SprintStateTitle = "aeman:sprint-state"

SprintStateTitle marks the hidden per-team card that stores a team's sprint pointer (current/previous start dates). It mirrors SPRINT_STATE_TITLE in web/src/providers/github/githubProvider.ts; such cards never render on a board.

Variables

View Source
var ErrNoRoom = errors.New("rank: no room to place the card")

ErrNoRoom is a place with no key to give: the gap is exhausted and no window around it can be renumbered — the whole list, or as far as the cards the mover may not write let it reach.

View Source
var ErrRankOrder = errors.New("rank: neighbours are equal or inverted")

ErrRankOrder is returned when the neighbours handed in are not in order.

View Source
var SizeOrder = []SizeKey{SizeS, SizeM, SizeL, SizeXL}

SizeOrder is the four sizes smallest first — the order a picker shows them.

StageOrder is the canonical stage ordering, mirroring STAGE_ORDER.

View Source
var Stages = map[StageKey]StageDef{
	StageLocked: {Key: StageLocked, Label: "Locked", Color: "#cf222e"},
	StageReview: {Key: StageReview, Label: "Review", Color: "#d4a72c"},

	StageRecurrent: {Key: StageRecurrent, Label: "Recurrent", Color: "#58a6ff"},

	StageRefuse: {Key: StageRefuse, Label: "Refuse", Color: "#1f2328"},
	StageDone:   {Key: StageDone, Label: "Done", Color: "#1f883d"},
}

Stages maps each stage to its label and bar colour, mirroring STAGES.

StatusFilters are the status filter's values in the order a toolbar offers them. Every one but done is what "Hide done" asks for.

Functions

func ActiveOnDay

func ActiveOnDay(start, finish, day string) bool

ActiveOnDay reports whether `day` falls within a card's [start, finish] range. A missing bound collapses to the other date, so a card with a single date is active only on that day and a card with neither date is never on the day board. It mirrors activeOnDay in web/src/date.ts (from = start||finish, to = finish||start, from <= day <= to).

func ActiveSprint

func ActiveSprint(b Board, team, day string) string

ActiveSprint returns which sprint was current for a team on a given day: the team's current sprint when day is on or after it, else the previous sprint when day is on or after that, else "" (only the last two sprints are tracked). It mirrors activeSprint in web/src/sprint.ts. team = "" is the no-team group.

func ActorFrom

func ActorFrom(ctx context.Context) string

ActorFrom returns the acting user's login stamped by WithActor ("" when none).

func AddDays

func AddDays(iso string, delta int) string

AddDays shifts a yyyy-mm-dd date by delta days, returning yyyy-mm-dd, or `iso` unchanged when it is not a parseable date. It mirrors addDays in web/src/date.ts.

func BestGap added in v0.52.0

func BestGap(q []Card, e string, order EpicOrder, epicOf func(Card) string) int

BestGap is where an epic's block — or the first task of an empty epic — goes in a queue q (Appendix A of ordering.md): the gap that contradicts the epic order least. Gap g costs the tasks before it whose epic comes AFTER e plus the tasks from it on whose epic comes BEFORE e; neutral tasks and e's own count nothing. Adjacent equal-cost gaps are a run; the earliest minimal run wins, and within it the first gap when the run starts right after a task of an earlier epic, else its last — with nothing counted at all, the end of the queue.

func CapacityOfPerson added in v0.37.0

func CapacityOfPerson(b Board, login string) int

CapacityOfPerson is how many points a week a person gets through: the roster's number, and only that. 0 means nobody has set one, which a client draws as the load alone rather than as a limit of none.

The board deliberately does NOT derive a number from its own record. It can be derived — the median of the points closed in each of the last four complete weeks the person closed anything in — and that arithmetic is written down in the derive-capacity skill, for a lead to run and write the answer back like any other judgement. It is not run here because a number the board prints beside a name reads as a fact, and this one would not be one: doneAt is only written from the day a board starts keeping it, so the four-week window is mostly empty of RECORDS while being full of WORK, and the median of the little that is there lands far under the truth — and lands quietly, since nothing on screen says the window was half empty. One number somebody stands behind beats four weeks of arithmetic over a record that does not go back four weeks.

func CarryingNow added in v0.32.0

func CarryingNow(b Board, today string) map[string]int

CarryingNow is how much work a person is holding at this moment, counted across EVERY team.

A board is nearly always read through a filter — one team's columns, one backlog — and a person is not. Somebody with four cards in the team on screen may have eleven altogether, and handing them a fifth is a decision made in the dark unless the whole number is in front of the reader. So this one ignores the filter on purpose.

What counts is work that is theirs, open, and not parked in a backlog: a parked card is on no day board and is not what they are carrying today. A subtask rides its parent and is not a card of its own; a state card is the board's own bookkeeping.

func ClampProgress

func ClampProgress(stage StageKey, value int) int

ClampProgress clamps a raw progress value for a card in the given stage. A card that is review, locked or REFUSED is held within the 10–90% band (never 0% or 100%); any other stage, including StageNone, keeps the value unchanged. It mirrors the slider clamp shared by handleProgress and the Card component.

All three are work that is neither untouched nor finished: it is parked on somebody else's answer, and a bar at either end would read as one of those two.

func Complete

func Complete(stage StageKey, progress int) bool

func CurrentSprint

func CurrentSprint(b Board, team string) string

CurrentSprint returns a team's current sprint start from its sprint-state card, or "" when the team has no sprint yet. team = "" is the no-team group. It mirrors currentSprint in web/src/sprint.ts.

func DateRange

func DateRange(start, end string) string

DateRange renders a start..end pair for a dates event value ("" parts kept readable: "..2026-07-04", "2026-07-01..", "" when both empty).

func DaysBetween added in v0.32.0

func DaysBetween(from, to string) int

DaysBetween is the signed number of days from one ISO day to another — negative when `to` is the earlier one. Mirrors daysBetween in web/src/date.ts.

func DaysSince

func DaysSince(iso, asOf string) int

DaysSince returns the whole days between an ISO timestamp's local date and the `asOf` day (a yyyy-mm-dd string; "" means today). It never goes negative. It mirrors daysSince in web/src/date.ts.

func DerivedProgress

func DerivedProgress(children []Card) int

DerivedProgress computes a parent's progress from its subtasks: the mean of each child's effective progress (a complete child counts as 100), scaled into the 0..90 band — the final done/100% is always a human's call.

func DomainFrom added in v0.26.0

func DomainFrom(ctx context.Context) string

DomainFrom is the caller's choice of domain, or "" for the default.

func DomainOf added in v0.26.0

func DomainOf(c Card, r DomainResolver) string

DomainOf applies the rule, in order:

  1. a review card lives where the card it reviews lives — the team rule alone would leak a review of a closed card into the shared repository;
  2. a subtask — a task whose parent is a TASK — lives where its parent lives;
  3. any other card lives where its team lives.

A hierarchy link does not place the child (H6): a task under an epic lives where its own team lives, and the resolver's PlanningResolver half is what tells the two parents apart. A resolver without it reads every parent as a task — which every parent was before the field existed.

An unknown reference falls through to the next rule; nothing deciding means the primary domain, "".

func EndOfDay added in v0.30.0

func EndOfDay(day string) (time.Time, error)

EndOfDay is a board day's last moment in the BOARD's own time zone — the instant a record of that day reflects. The day belongs to everyone on the board, so it is measured where the board lives, not where the reader does.

func FileDomain added in v0.29.0

func FileDomain(b Board, c Card) string

FileDomain is the repository whose files hold this card, read in the board's ONE namespace: the stamp the store put on it — gitstore stamps every card with its domain's name, the primary's included — with an unstamped card read as the primary.

It answers where the card IS, which is the question a rule about the references written IN its file has to ask. HomeDomain answers where a card WOULD live by the placement rule, which is what a CHANGE is judged against.

func FormatEventBody

func FormatEventBody(e Event) string

FormatEventBody renders an event as the body of a log line (the part after the "- [timestamp] " header): ":: kind | actor | from | to". Pipes inside values are replaced — they are the field separators.

func GapCost added in v0.52.0

func GapCost(q []Card, g int, e string, order EpicOrder, epicOf func(Card) string) int

GapCost is the cost BestGap gives gap g — what ValidReturn compares a returning task's gap against.

func HasPlanningAncestor added in v0.42.0

func HasPlanningAncestor(b Board, c Card) bool

HasPlanningAncestor reports a card with a goal, an initiative or an epic somewhere above it — which is what puts a task or a subtask on the Strategy.

func HasRecords added in v0.30.0

func HasRecords(view string) bool

HasRecords reports that a view can be shown AS IT STOOD on a day: only the day boards can, because only they place a card by the day being looked at. The Backlog and the Strategy board are not placed by a day — a record of one would be a claim about nothing. Mirrored by snapshotDay in web/src/viewquery.ts.

func HierarchyStatus added in v0.42.0

func HierarchyStatus(b Board, c Card) (status string, done, total int)

HierarchyStatus is a planning card's standing, derived from its leaf tasks and never stored (H5): NO ITEMS when nothing is under it; DONE when every leaf task is complete; IN PROGRESS when any open one is in work (a date or a sprint, not parked); BACKLOG when there are open ones and none is in work (amended with K16: progress, a person or a stage alone do not count). The counts are what the Strategy board shows beside the word. A task answers "" — it has a stage and a progress of its own.

func HomeDomain added in v0.29.0

func HomeDomain(b Board, c Card) string

HomeDomain is the repository that HOLDS a card, in the same namespace: the placement rule's answer (linked cards first, G14), with "nothing places this card" read as the primary — which is where such a card's file goes.

func InBacklog added in v0.34.0

func InBacklog(c Card) bool

InBacklog reports whether the card is parked in its team's backlog. A parked card that also carries dates (a direct writer can write one) reads as parked: the day boards leave it out, so it is drawn once, where it can be dealt with.

func InWork added in v0.43.0

func InWork(c Card) bool

InWork reports whether a card has a date or a sprint — what puts a task on the day boards (K1).

func InheritedEpic added in v0.52.0

func InheritedEpic(above, below string, hasAbove, hasBelow bool) string

InheritedEpic is the epic a task made in a gap of a list inherits (Q10): the epic of the card above it — the same as below's when the two agree, the card above's at a boundary — or, at the top of the list, the card below's; nothing in an empty list. The epics are the neighbours' EpicOf, reviews already skipped by the caller.

func IsDayIso added in v0.26.6

func IsDayIso(s string) bool

IsDayIso reports whether s is a board day: yyyy-mm-dd, and a real date.

func IsInProgress

func IsInProgress(c Card) bool

IsInProgress reports the implicit "In Progress" status: a card with no stored stage whose progress sits in [10, 90] inclusive. It mirrors isInProgress in web/src/stages.ts and is deliberately not a StageKey (there is no stored option for it).

func IsLegacyID added in v0.26.0

func IsLegacyID(id string) bool

IsLegacyID reports whether id is a Projects v2 item id — the form cards had before the move to git. A migrated card keeps its old id as GitHubID, and the service resolves such an id to the card for one major version.

func IsPlanning added in v0.42.0

func IsPlanning(c Card) bool

IsPlanning reports a goal, an initiative or an epic — a card the Strategy board draws and no day board does (H3).

func IsRecord added in v0.30.0

func IsRecord(b Board, c Card, past map[string]bool) bool

IsRecord reports that the day is over for this card: the sprint of the team it stands under (PlacedTeam, O13) has moved past it, so what the card shows is a record and cannot be changed. Every door asks THIS — the merge that builds the day, and the guard that refuses a write made from it — or the two answer differently and a card is live on screen and refused by the server.

func IsStateTitle added in v0.26.0

func IsStateTitle(title string) bool

IsStateTitle reports whether a title marks a roster stub — the hidden cards NewBoard splits out of the card rows.

func IsSubtask added in v0.42.0

func IsSubtask(b Board, c Card) bool

IsSubtask reports a task whose parent is a task (or is not here): the one kind of card that rides another — hidden from the boards, drawn under its parent, inheriting its team, person and sprint.

func IsSubtaskIn added in v0.42.0

func IsSubtaskIn(c Card, planning map[string]bool) bool

IsSubtaskIn answers IsSubtask against a set PlanningIDs built: a card with a parent that is NOT a planning card. A read board holds no DANGLING parent — the reading drops one (dropDanglingParents) — so an unknown parent is met only on a board nobody read: a cache between a delete and its reload, a hand-built board. There it reads as a subtask, which is what it always read as.

func IsUnattributed added in v0.11.2

func IsUnattributed(ctx context.Context) bool

IsUnattributed reports whether ctx was marked by Unattributed.

func KnownView added in v0.39.0

func KnownView(name string) bool

KnownView reports whether a name is one of them. The empty string is NOT: a door that defaults an unspecified view does so itself, deliberately, and a view that arrived empty because something forgot to send it must not quietly become "everything".

func Level added in v0.42.0

func Level(typ string) int

Level orders the types: a parent is always of a HIGHER level than its child, which is what makes the link point up and a cycle impossible to write. An unknown type is read as a task — the lowest level — so a value a direct writer invented can be a parent of nothing but a subtask.

func LoadNow added in v0.37.0

func LoadNow(b Board, today string) map[string]int

LoadNow is CarryingNow in points: the same cards a person is carrying today — theirs, open, not put off to a week ahead, subtasks riding their parent — weighed with PointsOf instead of counted. Like CarryingNow it ignores the filter on purpose: a person is not read through one, and the number beside their name has to be the whole of it. Unsized cards weigh the default, so the number is honest on a board nobody has sized yet.

func LocalDateIso

func LocalDateIso(iso string) string

LocalDateIso returns the local yyyy-mm-dd date for an ISO timestamp, or "" when the timestamp cannot be parsed. It mirrors localDateIso in web/src/date.ts.

func Location added in v0.26.6

func Location() *time.Location

Location is the board's time zone — what a board day's first moment is measured in (the day feed's history boundary, for one).

func LocationName

func LocationName() string

LocationName reports the installed board time zone (IANA name or "Local").

func MondayOf

func MondayOf(iso string) string

MondayOf returns the yyyy-mm-dd Monday of the week containing `iso`, or `iso` unchanged when it is not a parseable date. It mirrors mondayOf in web/src/date.ts.

func NeedsReviewer added in v0.43.0

func NeedsReviewer(c Card) bool

NeedsReviewer reports a REVIEW NOBODY HAS TAKEN (K10): an open review card with no assignee. Putting a task on review without naming a reviewer makes one, parked in the task's team's backlog — the "needs a reviewer" item the backlog pins above its ranked tasks — and naming a reviewer takes it into work like a task. A review card with a reviewer follows the card it reviews, as ever.

func NextAfter added in v0.18.0

func NextAfter(cycle, anchor, from string) string

NextAfter is the first date strictly after `from` at which a cycle anchored on `anchor` comes due — the calendar arithmetic behind process tasks. The cycle is counted on the calendar from the anchor, never from when the last iteration happened to close, so a late March does not shift April. The per-sprint default has no calendar meaning and yields "".

func OnBacklog added in v0.43.0

func OnBacklog(c Card, isSubtask func(Card) bool) bool

OnBacklog reports whether a card is listed in its team's backlog (K2): a parked task that answers for its own place, and is not finished — the backlog never shows work that is over. isSubtask is handed in so an Index can answer it for a whole listing without a walk of the board per card.

func OpenChildren

func OpenChildren(b Board, itemID string) bool

OpenChildren reports whether any of a task's subtasks is still unfinished.

func PartitionEvents

func PartitionEvents(notes []Note) ([]Note, []Event)

PartitionEvents splits a parsed log into plain work notes and events: any note whose body is an event line becomes an Event carrying the note's id and timestamp. The relative order inside each slice is preserved.

func PlacedTeam added in v0.46.0

func PlacedTeam(b Board, c Card) string

PlacedTeam is one card's placed team on a board.

func PlacedTeamAs added in v0.46.0

func PlacedTeamAs(b Board, c Card, team string) string

PlacedTeamAs is the team a card would stand under with `team` as its own: that team when it names one, else what it inherits.

func PlacedTeams added in v0.46.0

func PlacedTeams(b Board) map[string]string

PlacedTeams is every card's placed team, by id: one index for a reading that places many cards.

func PlanStatuses added in v0.50.1

func PlanStatuses(rollUp string, locked bool) []string

PlanStatuses are the status filter values a planning card answers BY ITSELF, from its roll-up (Index.HierarchyStatus) and its lock: no-items when nothing is under it, locked while a dependency holds it and its roll-up is not done. The other values it answers by a task under it.

func PlanningIDs added in v0.42.0

func PlanningIDs(b Board) map[string]bool

PlanningIDs is the set of planning cards, for the loops that ask of every card whether it is a subtask: one pass to build, and the question costs nothing after it. Planning cards are few — dozens on a board of thousands — so the set stays small.

func PlansWork added in v0.52.1

func PlansWork(v View) bool

PlansWork reports the boards a plan is MADE on: the lead's grid, the backlogs and the hierarchy. A person's own seat — the Me board — is not one, and ViewAll is no board at all. A rule that guards somebody else's plan from the person carrying it (the × on work typed for them) is a rule of the seats that do not plan: on a planning board the person pressing it is planning, their own column included.

func Points added in v0.37.0

func Points(s SizeKey) int

Points is the weight of a size on the scale: 1, 2, 4, 8, and 0 for the empty size. It is the SCALE, not what a card weighs — an unsized card weighs DefaultSize (PointsOf).

func PointsAWeekOf added in v0.37.0

func PointsAWeekOf(b Board, team string) int

PointsAWeekOf is a team's weekly capacity in POINTS: the number somebody set for it, and only that. 0 means nobody has said, which a client draws as the week's points alone rather than as a week with no room at all.

It was arithmetic once: the capacities of the PEOPLE in the team, added up, with anyone who works across teams split between them in proportion to what they had closed in each over four weeks — and the total then cut by the share history said arrives unplanned. Three derivations stacked on one record, and on a real board that record is eleven days old, because doneAt is only written from the day a board starts keeping it. One busy week could hand a person's whole number to a team they had barely touched, and nothing on screen said the split rested on four closed cards.

So the board stores what somebody decided and does no arithmetic. Working the number OUT is the derive-capacity skill's job, where the record's own thinness can be read out beside the answer — which a board printing a number beside a name could never do.

func PointsOf added in v0.37.0

func PointsOf(b Board, c Card) int

PointsOf is what a card WEIGHS on a board: its own size, or — when it has subtasks somebody has sized — the sum of theirs. This is the umbrella rule, and it is dynamic on purpose: umbrellas are not born as umbrellas (on the production history forty percent get their first child three days or more after creation, and nothing in a card's text predicts which will), so the parent's own estimate stands until the children exist and is replaced by their sum once they do — the way a parent's progress already derives from its subtasks. The total never counts twice, and a card split a minute ago into unsized pieces still weighs what its author said.

func PreviousSprint

func PreviousSprint(b Board, team string) string

PreviousSprint returns a team's previous sprint start from its sprint-state card, or "" when the team has no prior sprint. team = "" is the no-team group. It mirrors previousSprint in web/src/sprint.ts.

func PrimaryDomain added in v0.42.0

func PrimaryDomain(b Board) string

PrimaryDomain is the primary repository's name in the board's ONE namespace — what an unstamped entry resolves to. It is the repository every reader of the board can read (a board is 403 without it), which is why a planning card lives there and a hierarchy link may point up to it from any repository (H6).

func RankBetween added in v0.26.0

func RankBetween(prev, next string) (string, error)

RankBetween returns a key strictly between prev and next. An empty prev means "before everything", an empty next "after everything"; both empty gives the first key of a list. It never fails on ordered input: when the two are adjacent at their length, the key grows by a character.

func RankRebalance added in v0.26.0

func RankRebalance(lo, hi string, n int) ([]string, error)

RankRebalance returns n keys, evenly spaced, strictly between lo and hi (either may be empty for an open end) and none longer than MaxRankLen. The caller assigns them to the run's members in their current order.

The arithmetic is on arbitrary-precision integers: a key of 13 base-36 digits already overflows 64 bits, and boards grow keys far longer than that at the end of a list ("zzzzzzzzzzzzzv"). 64-bit arithmetic wrapped around there and handed back keys that sorted to the FRONT of the board.

func RankTooLong added in v0.26.0

func RankTooLong(key string) bool

RankTooLong reports whether a key has outgrown the cap and its run should be rebalanced.

func Reachable added in v0.31.0

func Reachable(b Board, today string) map[string]bool

Reachable is every card some board still shows: the day boards for the days a person opens (today, and each team's current and previous sprint day), the Strategy and every team's backlog, plus the cards that ride one of those — a subtask under its parent, a review card beside its original.

What it does NOT name is a card on no board at all: open, not parked, and standing on none of those days — an UNPLACED task (K1) among them, the shape the Triage strip used to draw and schema 3 parks (K8). The × used to make them by the dozen — it demoted a worked card into the previous sprint, out of today's way and into a sprint the day grid does not draw, the Me board's sprint gate hides and no carry-over ever picks up (a carry-over moves the CLOSING sprint's own cards) — and the production board held a hundred and thirty-two when the rule was found. The × deletes now (G60); this is what names the ones already made, for the migration's report and its cleanup.

func RecurrenceDue added in v0.9.0

func RecurrenceDue(c Card, day string) bool

RecurrenceDue reports whether a recurrent card's next iteration is due on day (the sprint being started): always for the per-sprint default, and once the interval has elapsed since the sprint the card is bound to otherwise. A cycle card without a sprint anchor is never due — there is nothing to count the interval from.

func RenderNoteBody

func RenderNoteBody(author, text string) string

RenderNoteBody prepends the author attribution to a note body for storage in the draft log ("@login: text"); an empty author stores the bare text.

func Schema4Orders added in v0.52.0

func Schema4Orders(ix *Index, old []Card) [][]string

Schema4Orders is every order the migration keeps, as chains of ids over a board in its old order: the backlog (every backlog card, the old backlog order), each parent's children, each level's roots, and the flat epic order (the old tree walk). The tests read them back after the migration.

func Schema4Plan added in v0.52.0

func Schema4Plan(b Board) ([]RankChange, []CellChange, error)

Schema4Plan is the migration's plan over a board: the rank changes, and the Team cells whose in-work order they change. It is a pure function of the board, so a resumed run computes the same plan.

func ScopedByTeam added in v0.39.0

func ScopedByTeam(v View) bool

ScopedByTeam reports the boards whose LISTING is narrowed by a team: the lead's grid and the backlog both ask for one (a comma-separated set of them). The Me board and the Strategy board list every team, and "" is the answer they give.

It is a fact about a BOARD, which is why it lives here rather than in either door: a gesture is judged against the listing its board answered, and a gate that pinned a team the listing never asked for would refuse work the board is drawing (a subtask of another team rides into the Me view on its parent). The two doors asked it separately once, held together by a comment.

func SetLocation

func SetLocation(name string) error

SetLocation installs the board time zone (name per IANA, e.g. "Europe/Berlin"). An unknown name is reported and leaves the zone as-is.

func SortCards added in v0.52.0

func SortCards(cards []Card)

SortCards puts cards in board order: by key, ties by id; a card with no valid key after every card that has one (normalisation gives it a place), the teams' state cards where they stand relative to each other.

func SortRanked added in v0.52.0

func SortRanked(list []Ranked)

SortRanked puts a list in board order: by key, ties by id.

func SplitNoteAuthor

func SplitNoteAuthor(body string) (author, text string)

SplitNoteAuthor extracts the "@login: " attribution from a stored note body, returning the author ("" for legacy unattributed notes) and the bare text.

func StripEventLines

func StripEventLines(text string) string

StripEventLines drops machine event-log lines from a description text. Descriptions occasionally get them baked in - an agent copying a card's visible text back, a description synced from a card whose body was damaged by an old log migration - and they are never legitimate prose, so every description write runs through this.

func TaskStatuses added in v0.50.1

func TaskStatuses(c Card, locked bool) []string

TaskStatuses are the status filter values a task answers (O14): its work status, and locked while a dependency holds it (locked — Index.Locked, own or inherited) and it is not done. Done wins: a finished task that still waits is done, so "Hide done" — every value but done — hides exactly the finished work.

func TeamDomain added in v0.26.9

func TeamDomain(b Board, team string) string

TeamDomain is the repository a team was declared in, read in the board's ONE namespace (inPrimary): an unstamped entry answers with the PRIMARY's name, which is "" only on a board that does not name its own. A team the roster does not declare answers "" and decides nothing.

func TeamsPast added in v0.30.0

func TeamsPast(live Board, day string) map[string]bool

TeamsPast names the teams for which a day is OVER: their sprint has moved on past it, so what they showed that day is a record and can be read from the history. A team still inside that sprint is not among them — the sprint lays itself out on its own day and the team works it from there, so the day is theirs to change. A team with no sprint at all answers for nothing.

func TodayIso

func TodayIso() string

func Unattributed added in v0.11.2

func Unattributed(ctx context.Context) context.Context

Unattributed marks ctx as carrying server-side work with no originating client, so watch frames reach everyone instead of being echo-suppressed against whoever happened to trigger it.

func Unplaced added in v0.43.0

func Unplaced(c Card, subtask bool) bool

Unplaced reports an OPEN task in neither place: no date, no sprint, not parked — the shape the Triage strip used to hold. A review nobody has taken (NeedsReviewer) is asked the same: its place is its team's backlog. No door leaves a task like this any more (K3); schema 3 parks the ones an older server left (K8). Finished work is not asked to be placed: it is over.

func ValidRank added in v0.52.0

func ValidRank(k string) bool

ValidRank reports whether a key is one this server could have minted: a non-empty run of the alphabet, not ending in the floor digit, within the cap. An invalid key is no key (docs/design/ordering.md, normalisation).

func ValidRecurrence added in v0.9.0

func ValidRecurrence(cycle string) bool

ValidRecurrence reports whether cycle is a storable recurrence value.

func ValidStatusFilter added in v0.50.1

func ValidStatusFilter(s string) bool

ValidStatusFilter reports whether a name is one of the status filter's values: a work status, locked or no-items.

func ValidType added in v0.42.0

func ValidType(typ string) bool

ValidType reports a type a card may be created with: a task, or one of the three planning levels.

func ValidWorkStatus added in v0.49.0

func ValidWorkStatus(s string) bool

ValidWorkStatus reports whether a name is one of the work statuses.

func WithActor

func WithActor(ctx context.Context, login string) context.Context

WithActor returns a context carrying the acting user's GitHub login.

func WithDomain added in v0.26.0

func WithDomain(ctx context.Context, domain string) context.Context

WithDomain carries the caller's choice of domain for a team being declared — asked only when more than one is writable. Cards never take one; a backend ignores the choice for them.

func WorkStatus added in v0.49.0

func WorkStatus(c Card) string

WorkStatus is a task's work status, and it follows PLACEMENT: done when complete (Complete — so locked or on review at 100 is not, and recurrent at 100 is); else backlog when parked, whatever its dates or its stage say; else in progress when in work — a date (an end date alone counts) or a sprint, whatever its stage (review, locked and refused are in somebody's hands). A task nobody has placed yet is waiting like the backlog and reads as backlog, on review or not. A card's stage badge may still show its stage; the filter reads where the task stands.

func Workable

func Workable(c Card) bool

Complete reports whether a card counts as finished — an explicit done stage, or 100% readiness with no stage (done is derived) or on the recurrent stage (a finished recurrent card stays behind; Carry Over reseeds a fresh copy). A 100% card that is on review or locked is still unfinished, so it is NOT complete. Carry Over uses this so finished cards are not dragged forward. Workable reports whether a card can be picked up and worked on right now: it is neither finished nor parked awaiting someone else. It excludes done (complete) cards, cards on review (waiting on a reviewer), locked (blocked) ones and REFUSE ones (waiting on the lead's answer), keeping in-progress, not-yet-started and recurrent ones.

Types

type Blocker added in v0.50.0

type Blocker struct {
	Target Card
	Via    Card
}

Blocker is one unsatisfied dependency of a card: the card it waits for, and the card whose dependsOn names it — the card itself, or an ancestor whose wait it inherits.

type Board

type Board struct {
	// Pinned are cards an ordering plan must not re-key: the ones the
	// visitor it is planned for may not write. A rebalance window stops at
	// them and an epic's gather leaves them where they stand
	// (docs/design/ordering.md). Never serialised.
	Pinned map[string]bool `json:"-"`
	// Board names the board this snapshot came from — the name of its primary
	// repository — so a backend can apply mutations against it. Empty on
	// hand-built snapshots that never get persisted.
	Board string `json:"board,omitempty"`
	// Title/URL identify the board for display, mirroring the frontend Board.
	Title string `json:"title,omitempty"`
	URL   string `json:"url,omitempty"`
	Cards []Card `json:"cards"`
	// SprintStates maps each team key ("" = the no-team group) to its pointer.
	SprintStates map[string]SprintState `json:"sprintStates"`
	// People is what the roster says about each login — the primary
	// repository's users/<login>.yaml: a capacity a lead set, when one is.
	// A login absent here is a person the board only knows from cards.
	People map[string]Person `json:"people,omitempty"`
	// TeamOrder lists the SprintStates keys in board order — the position of
	// each team's hidden sprint-state card on the project. That position IS
	// the team order every client shares (reordering teams moves the card).
	TeamOrder []string `json:"teamOrder,omitempty"`
	// Primary names the repository a board's own entries belong to — the
	// first of its domains. The store STAMPS every roster entry with its
	// domain's name, the primary included, while a card that nothing
	// places resolves to "" ("no repository decides this"); the two are
	// different namespaces, and comparing them directly answered "another
	// repository" for every card of the primary that nothing placed.
	// Boards built by hand (fixtures, older callers) leave it empty, which
	// is the same thing said the other way.
	Primary string `json:"primary,omitempty"`
	// Domains maps a roster entry's id — a team's sprint-state card — to the domain
	// (repository) it was declared in; cards carry their own Domain. Nil on
	// a single-domain board, where nothing records one.
	Domains map[string]string `json:"domains,omitempty"`
	// Customers is the board's customer roster in board order (O5): cards
	// name a customer by its id, so a rename reaches every card at once.
	Customers []Customer `json:"customers,omitempty"`
	// DroppedParents names the parents the reading dropped, by the card
	// that named them: a parent the board does not hold is read as no
	// parent (NewBoardIn), and a tool that must REPORT such links — the
	// importer's dangling references, M4 — reads them here.
	DroppedParents map[string]string `json:"-"`
	// BlockerTotals is how many blockers each card has on the WHOLE board,
	// recorded by Visible when the projection hides something: the
	// visitor's resource counts the ones it cannot name (N4). Nil when
	// nothing was hidden.
	BlockerTotals map[string]int `json:"-"`
	// UndoneTargets are the cards something waits for that are NOT done on
	// the WHOLE board, recorded by Visible beside BlockerTotals: a plan item
	// is done by its whole roll-up, not by the part of it the visitor's board
	// holds, so the visitor's listing judges a blocker the way a watch frame
	// does (N4). Nil when nothing was hidden.
	UndoneTargets map[string]bool `json:"-"`
	// JudgedWhole says Visible hid something on a board where something
	// waits: the visitor's dependencies are judged on the WHOLE board
	// (BlockerTotals, UndoneTargets), even when those maps are empty —
	// an empty map is "nothing undone on the whole board", not "judge on the
	// part you can see" (N4).
	JudgedWhole bool `json:"-"`
}

Board is an in-memory snapshot of a project board: its fields, the visible cards (sprint-state cards excluded) and the per-team sprint pointers. It mirrors the Board interface in web/src/providers/types.ts.

func ApplyRankChanges added in v0.52.0

func ApplyRankChanges(b Board, changes []RankChange) Board

ApplyRankChanges is applyChanges for the callers that keep a board of their own in step with a plan (the server's cache, a test's fake).

func MergeAsOf added in v0.30.0

func MergeAsOf(live, then Board, past map[string]bool) (Board, map[string]bool)

MergeAsOf is one day on one screen with two moments in it: the teams the day is over for (past) contribute what they held THEN, everyone else what they hold NOW. It returns the merged board and the ids of the cards that came from the past — a record, which a client must not offer to change.

A card is judged by the copy that is CURRENT, whatever team the evening's copy names: a card moved between teams since, and a team renamed since, both name two different teams across the two boards, and asking each copy about its own team dropped the card from both halves — it stood on the board that evening and vanished from the record of it.

func NewBoard

func NewBoard(cards []Card) Board

NewBoard builds a Board snapshot from the full card list, splitting the hidden sprint-state cards out of Cards into SprintStates (keyed by team, "" = the no-team group). A sprint-state card's Team is its key, its SprintStart is the team's current sprint and its StartDate (the "Start" field) is the previous sprint.

func NewBoardIn added in v0.29.0

func NewBoardIn(primary string, cards []Card) Board

NewBoardIn is NewBoard for a board whose entries are STAMPED with their domain's name — which is every board the store hands over, the primary included. The rules that read the board (TeamDomain, HomeDomain) ask "the same repository?" in that one namespace, so the primary's name arrives with the cards rather than being set on the result afterwards.

func Visible added in v0.26.0

func Visible(b Board, primary string, readable func(domain string) bool) Board

Visible is the board as a visitor who can read only some domains sees it. Cards and teams of an unreadable domain are absent. A card whose team is unreadable stays, under its team name — the team's order slot and sprint pointer do not. An entry with no recorded domain belongs to the primary. The input is not modified.

func (Board) CustomerName added in v0.44.0

func (b Board) CustomerName(id string) string

CustomerName is the roster name of a customer id, or "" for one the roster does not hold.

type Capacity added in v0.32.0

type Capacity struct {
	Points int `json:"points,omitempty"`
}

Capacity is a team's throughput: the POINTS a week it gets through, which is what a week of its plan is weighed against. Never derived — 0 means nobody has said (PointsAWeekOf).

It carried three more numbers once: a limit in CARDS a week, derived from what the team had been finishing, and the shares of it that client and internal work might take. Nothing ever wrote them — not one team file on the production board had the block — and no client read them back: the bar they were drawn for is long gone from the boards. A derived number nobody looks at is a rule that can only rot.

type Card

type Card struct {
	ItemID string `json:"itemId"`
	Title  string `json:"title"`
	// Type says what the card is: "" is a TASK, the day boards' own kind;
	// "goal", "initiative" and "epic" are the PLANNING cards above it, drawn
	// on the Strategy board and on no day board (docs/design/hierarchy.md). Fixed
	// at create; a card never changes level.
	Type string `json:"type,omitempty"`
	// Assignees are logins; Author is the login that created the card.
	Assignees []string `json:"assignees"`
	Author    string   `json:"author,omitempty"`
	// Team is the card's team label ("" = the no-team group). On a planning
	// card it is the team that carries the plan item out (O1): it places
	// nothing — the card lives in the primary (H3) — and the cards below
	// inherit it as their effective team when they have none (O3).
	Team string `json:"team,omitempty"`
	// Owner is the one person who answers for a PLANNING card — breaks it
	// down, keeps its status honest (O1). Never inherited, and it puts
	// nothing on any day board (O2); "" on every other card.
	Owner string `json:"owner,omitempty"`
	// Customers are the ids of the board's customers (Board.Customers) the
	// card is for. Any card may name several; the cards
	// below add to them (O4).
	Customers []string `json:"customers,omitempty"`
	// DependsOn are the uids of the cards this one waits for
	// (docs/design/dependencies.md): it is LOCKED while one of them, or one
	// an ancestor waits for, is not done — derived, never written — and the
	// targets are for this card's customers too (N1–N6).
	DependsOn []string `json:"dependsOn,omitempty"`
	Zone      ZoneKey  `json:"zone,omitempty"`
	// Size is what somebody said the card weighs — S, M, L or XL — set on a
	// daily sync or by a sizing tool; "" is unsized. The points a board sums
	// are derived from it (Points, PointsOf), never stored.
	Size SizeKey `json:"size,omitempty"`
	// Progress is the readiness percentage (0..100); 0 also stands for unset,
	// matching the frontend's `progress ?? 0`.
	Progress int      `json:"progress"`
	Stage    StageKey `json:"stage,omitempty"`
	// Day is the ISO date (yyyy-mm-dd) the card is planned to finish/be due on.
	Day string `json:"day,omitempty"`
	// StartDate is the day the card starts on; SprintStart is the start day of the
	// sprint it belongs to (what the day boards orient by).
	StartDate   string `json:"startDate,omitempty"`
	SprintStart string `json:"sprintStart,omitempty"`
	// Parked says the task is in its team's BACKLOG rather than in work. A
	// task is in work (a date or a sprint) or parked, never both and never
	// neither (K1). Read it through board.InBacklog.
	Parked bool `json:"parked,omitempty"`
	// ReviewOf, on a review card, is the itemId of the original card it reviews.
	ReviewOf string `json:"reviewOf,omitempty"`
	// Parent is the ONE link of the hierarchy: the itemId of the card this
	// one sits under ("" = a root). The parent's TYPE says what the link
	// means — read off the parent card, never off this field (H1): under a
	// task it makes this card a SUBTASK, one level deep (a parent cannot
	// itself be a subtask, and a card with subtasks cannot become one);
	// under an epic, an initiative or a goal it files the card in the
	// hierarchy and changes nothing else about it. A parent is always of a
	// higher level than its child (H2).
	Parent string `json:"parent,omitempty"`
	// Recurrence is a recurrent card's reseed cycle: "" = every sprint (the
	// default), "week" / "month" = only once that interval has elapsed since
	// the sprint the card is bound to (see RecurrenceDue).
	Recurrence string `json:"recurrence,omitempty"`
	// ReviewRound counts a review card's review rounds. A card sent back for
	// another review after already passing starts round 2, 3, … The first
	// review is implicit and left at 0 (round 1 is not shown).
	ReviewRound int    `json:"reviewRound,omitempty"`
	CreatedAt   string `json:"createdAt,omitempty"`
	// Rank is the card's ordering key within its list (see RankBetween): a
	// plain string compared bytewise, so a reorder rewrites this card alone.
	Rank string `json:"rank,omitempty"`
	// DoneFrom is the progress the card had when a write took it to 100; a
	// reopen restores it. Stored, not derived from history, because an
	// action must never depend on a log that may be cut at a horizon.
	DoneFrom int `json:"doneFrom,omitempty"`
	// DoneAt is the board day (yyyy-mm-dd) a write took the card to 100,
	// cleared when it drops below again — what lets a board show a card the
	// day it was done and drop it the next without reading history.
	DoneAt string `json:"doneAt,omitempty"`
	// LeftAt is the board day (yyyy-mm-dd) the older × took the card off:
	// it demoted into the previous sprint, dates and all, and this recorded
	// the day that happened. The × deletes now and nothing writes the field;
	// the cards that carry it are still read. Nothing live reads it: today's
	// board drops the card, which is what the × was for. It is what a RECORD
	// of that day gives back (G60) — the card was worked and finished on it —
	// and a fact about a day gone by is not undone by re-dating the card, so
	// it stands.
	LeftAt string `json:"leftAt,omitempty"`
	// Link is a URL the card points at — the only trace an issue-backed
	// card keeps of its issue. Nothing is fetched through it.
	Link string `json:"link,omitempty"`
	// GitHubID is the Projects v2 item id a migrated card came from, kept so
	// the id can still be resolved for a while; empty on cards born later.
	GitHubID string `json:"githubId,omitempty"`
	// Domain names the repository the card lives in ("" = the primary or a
	// single-domain board). MovedFrom/MovedAt record a cross-domain move,
	// so a torn move resolves from the tree alone.
	Domain    string `json:"domain,omitempty"`
	MovedFrom string `json:"movedFrom,omitempty"`
	MovedAt   string `json:"movedAt,omitempty"`
	// Description is the card's free-form details (a draft body minus its appended
	// action log, or an issue/PR body). Notes are the card's dated work notes.
	Description string `json:"description,omitempty"`
	Notes       []Note `json:"notes,omitempty"`
}

Card is a single board item with the well-known field values the boards orient by. It mirrors the Card interface in web/src/providers/types.ts.

func BacklogOrder added in v0.34.0

func BacklogOrder(ix *Index, cards []Card) []Card

BacklogOrder sorts a backlog's cards the way it is read (Q2, docs/design/ordering.md): in the BOARD's order (rank, then id), every card by its own key. A review nobody has taken (K10) is made at the top of the board's order, so it stands first until somebody drags it lower; it is no longer held there. A task's rank IS its place in its team's queue: nothing is inherited down the tree, so moving a goal or an initiative reorders no backlog, and a task may stand between any two others. A mix of teams is the same order over their cards.

func Children

func Children(b Board, itemID string) []Card

Children returns the subtasks of a task, in board order: the cards whose parent it is. A planning card has none — what sits under it is the hierarchy's (ChildrenOf), and never its subtasks.

func ChildrenOf added in v0.42.0

func ChildrenOf(b Board, id string) []Card

ChildrenOf is every card whose parent is the given one, planning cards and tasks alike, in board order. (Children, in subtasks.go, is the narrower question: the SUBTASKS of a task.)

func Find added in v0.42.0

func Find(b Board, id string) (Card, bool)

Find is a card by id. Linear: the board is a slice, and a lookup that happens once per request is not the place for an index (PlanningIDs is what a loop over the board uses).

func Followers added in v0.29.0

func Followers(b Board, itemID string) []Card

Followers lists the cards whose FILE moves with this one: its subtasks and its review card, and THEIRS — the store's cascade recurses, so a walk that stopped at the first ring went blind exactly where a child hides its own review card. What follows a card cannot be left behind by a move: neither its file nor the rules that read it.

A hierarchy link is not one of them: a task under an epic lives where its own team lives (H6), so nothing follows a planning card.

Cost: one pass over the board's cards per ring of the walk, and the rings are shallow (a card, its subtasks and its review card). A caller that asks it for many cards pays that per card; at board scale it is nothing, and a card index would be the answer if a board ever made it one.

func LeafTasks added in v0.42.0

func LeafTasks(b Board, id string) []Card

LeafTasks is every task under a planning card, through every level: a task whose parent is a planning card in the subtree. A subtask is NOT one of them — its parent task answers for it through its own derived progress — and neither is anything under a task, nor a review card (a copy of the card it reviews, made for the asking; the original answers for the work). A task has no leaf tasks: the question is a planning card's. The list is in BOARD order, whatever level a task hangs off.

func Lineage added in v0.42.0

func Lineage(b Board, c Card) []Card

Lineage is every ancestor of a card, ROOT FIRST — the breadcrumb a detail pane draws above it, a task parent included. The walk is bounded: it stops at a parent that is not here, on a repeat (a cycle written straight into the repository must not hang a reader), and after more hops than the levels allow.

The one-card form of Index.Lineage: it reads the board once for the answer. A loop over a board asking it of every card builds an Index first.

func MeView

func MeView(b Board, user, day string) []Card

MeView returns the cards on a person's own day board on a given day: the Team board's rule (inHandOn) asked of the person's cards, each by the team it stands under — the Me board is the Team board for one person, whatever their team (D6). user = "" means everyone. A parent whose subtask is the person's stands here too: the subtask rides it. It mirrors onMyDay in web/src/meview.ts.

It used to be a rule of its own — a card on the days of the sprints it spanned, across its date range, and on today if open — and the two boards drifted: a card closed on a day of a later sprint stood on the Team board that day and on no day of its owner's board, and an open card a carry-over left behind was debt on the Team board's past days and nowhere on the Me board's.

func MeViewIn added in v0.46.0

func MeViewIn(b Board, ix *Index, user, day string) []Card

MeViewIn is MeView over an index built once for a listing.

func ParentOf added in v0.42.0

func ParentOf(b Board, c Card) (Card, bool)

ParentOf is the card a card's `parent` names, if it is on the board.

func Schema3BacklogOrder added in v0.52.0

func Schema3BacklogOrder(ix *Index, cards []Card) []Card

Schema3BacklogOrder sorts a backlog's cards the way it is read: the reviews nobody has taken (K10) first, in their tasks' Strategy order, then the tasks in the STRATEGY BOARD's order across the whole hierarchy (K14), the tasks with no plan item above them after — see Schema3BacklogKey.

One order, decided by the tree: dragging a task in the backlog moves it among its siblings under the same parent, which moves it on the Strategy board too, and a task's place is never something the backlog keeps apart from the Strategy board's. The board's order (rank, then id) is where the siblings' order comes from, as on every board.

func SettleCard added in v0.42.0

func SettleCard(c Card) Card

SettleCard applies the reading rules that hold for one card on its own, whatever the file says — the same on a full read of the board and on the reload of a single card, or the two would disagree about one file.

A planning card has no band, no size and no sprint (H3): the Strategy board draws levels and bars, and a weight belongs to work somebody carries. A file that still says otherwise — a repository migrated before the rule, a direct writer — is read without them, and the card's next rewrite drops the keys; nothing is rewritten for the reading alone. A planning card is nobody's work besides: the people are on the tasks under it, and its owner and team (O1) answer for the plan item without putting it on any day board. Only a planning card has an owner.

func TeamGrid

func TeamGrid(b Board, team, day string) []Card

TeamGrid returns the cards on the Team board for one team on a given day: what the people are WORKING ON then, and nothing else. It mirrors inHandOn in web/src/teamgrid.ts.

A card is in hand on a day when it is this team's, is not a subtask (those ride with their parent), is not parked in the team's backlog, is IN WORK — it has a date or a sprint (K1; a task with neither is in its backlog), has not been deferred past that day, and is either open or was finished on that very day — a card finished yesterday belongs to yesterday, and a board that keeps it is a board nobody can read. A task has no week (K7).

One day answers differently, and deliberately: the day a SPRINT BEGAN is the whole sprint. A lead opens it every few mornings and goes through it with the team, so it holds the work the sprint opened with, the work typed into it since, and the work already closed — not only what is still in hand. What still leaves that day is what was taken OUT of the sprint: work deferred past today.

That is the whole rule. It used to be seven, layered: the week's own work, the sprint's start day, the card's own scheduled day, the range between its dates, the days of sprints it had passed through, and two special cases for deferral. Every one of them was a different reason for a card to be drawn, and between them they managed both halves of being wrong — work nobody was doing appeared on the day, while a card scheduled for last Tuesday and never finished fell off the board entirely, since no rule reached it any more. A day board answers one question, so it asks one.

Looking BACK is not this function's job: a day already past is answered from the board's history, as it was (the snapshot path). Looking forward works here, because every gate it applies is relative to the day asked about — a card deferred to Thursday is in hand on Thursday.

func TeamGridIn added in v0.46.0

func TeamGridIn(b Board, ix *Index, team, day string) []Card

TeamGridIn is TeamGrid over an index built once for a listing.

func Unreachable added in v0.31.0

func Unreachable(b Board, today string) []Card

Unreachable is Reachable's complement over the board's own cards, in board order: the cards no view shows.

type CellChange added in v0.52.0

type CellChange struct {
	Team, Person, Zone string
	Before, After      []string
}

CellChange is a Team cell — a team, a person, a zone — whose tasks in work read in a different order after the migration.

type CreateInput

type CreateInput struct {
	// ItemID, when set, is the id the card is created WITH — a backend that
	// mints its own ids (the git store) honours it, so the cache can hand out
	// the final id before the write lands; a backend that cannot ignores it.
	ItemID string `json:"itemId,omitempty"`
	// Domain, on a roster stub (a team's state card), is
	// the repository to declare it in; "" is the primary. Cards never carry
	// one — their domain is inherited (see DomainOf).
	Domain string `json:"domain,omitempty"`
	Title  string `json:"title"`
	// Type is the card's level: "" (a task), "goal", "initiative" or "epic".
	Type        string  `json:"type,omitempty"`
	Zone        ZoneKey `json:"zone,omitempty"`
	Size        SizeKey `json:"size,omitempty"`
	Day         string  `json:"day,omitempty"`
	Start       string  `json:"start,omitempty"`
	SprintStart string  `json:"sprintStart,omitempty"`
	Assignee    string  `json:"assignee,omitempty"`
	Team        string  `json:"team,omitempty"`
	ReviewOf    string  `json:"reviewOf,omitempty"`
	Parent      string  `json:"parent,omitempty"`
	// Parked puts the card straight on its team's SHELF: born there rather
	// than born somewhere else and moved, which is one commit instead of two
	// and spares every reader the instant in between.
	Parked     bool   `json:"parked,omitempty"`
	Recurrence string `json:"recurrence,omitempty"`
	// Body is the draft's description, written with the create rather than
	// after it: a card that appears without its text, then fills in a second
	// later, reads as a card the board got wrong.
	Body string `json:"body,omitempty"`
}

CreateInput is the payload for creating a card on a board: the fields a create can set. It mirrors NewCardInput in web/src/providers/types.ts. It lives in the board package (not boardservice) so a backend can implement the create method without importing boardservice. An empty field is left unset.

type Customer added in v0.44.0

type Customer struct {
	ID   string `json:"id"`
	Name string `json:"name"`
	Rank string `json:"rank,omitempty"`
}

Customer is one entry of the board's customer roster: who the work is for.

type DependencyProblem added in v0.50.0

type DependencyProblem int

DependencyProblem is why a dependency list cannot be written.

const (
	DependencyFine DependencyProblem = iota
	// DependencyBadTarget is a target N1 refuses.
	DependencyBadTarget
	// DependencyClosesCycle is a target that would close a cycle (N2).
	DependencyClosesCycle
)

The answers CheckDependsOn gives.

func CheckDependsOn added in v0.50.0

func CheckDependsOn(b Board, itemID string, ids []string) (DependencyProblem, string)

CheckDependsOn judges writing ids as the list of the card with id itemID on b: each id the card's list on b does not hold yet must be a lawful target (N1) and close no cycle (N2), judged on the board as the write would leave it, so two new ids that close a cycle only together are found. It answers the first problem and the id it is about. The board must be the WHOLE board: a visitor's breaks a lineage at a card they cannot read and ends a cycle's walk there.

type DependentCustomer added in v0.50.0

type DependentCustomer struct {
	Customer string
	From     Card
}

DependentCustomer is a customer a card is for only because work that waits for it is (N5), with the nearest such card.

type DomainResolver added in v0.26.0

type DomainResolver interface {
	// CardDomain is the domain of another card by id.
	CardDomain(id string) (string, bool)
	// TeamDomain is the domain a team was declared in.
	TeamDomain(name string) (string, bool)
}

DomainResolver answers where the things a card refers to live. A false ok means the reference is unknown and does not decide.

func Resolver added in v0.26.0

func Resolver(b Board, primary string) DomainResolver

Resolver is a DomainResolver over a board snapshot, for deciding where a card WOULD live after a change — the write check of a move needs the destination before anything is written.

type EpicOrder added in v0.52.0

type EpicOrder map[string]int

EpicOrder is the epic order one team reads: each epic's place, by id. Every algorithm takes it as a parameter. Today it is the SAME global order for every team (the epics in board order); a per-team exception would be an `epicRanks` key in the team's file read here — the documented extension point, not built (ordering.md).

type Event

type Event struct {
	// ID anchors the event like a note id (itemID:line or comment-derived).
	ID string `json:"id"`
	// Kind is one of the Event* constants below.
	Kind string `json:"kind"`
	// Actor is the GitHub login that made the change ("" when unknown).
	Actor string `json:"actor,omitempty"`
	// From and To carry the change's old and new value, kind-specific.
	From string `json:"from,omitempty"`
	To   string `json:"to,omitempty"`
	// At is the RFC3339 timestamp the change was recorded.
	At string `json:"at"`
}

Event is one recorded action on a card: who changed what, when. Events live in the card itself — a draft card keeps them as machine lines in its body log next to the work notes, an issue/PR card in a dedicated log comment — so the history is stored with the card and dies with it. Writes that bypass aeman (edits in the GitHub Projects UI) leave no events: Projects v2 exposes no field history, so aeman records changes at its own write path.

func ParseEventBody

func ParseEventBody(body string) (Event, bool)

ParseEventBody parses a log-line body produced by FormatEventBody. ok is false when the body is a plain work note, not an event line.

type Index added in v0.42.0

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

Index is a board's cards by id and by parent, built ONCE for a reading that asks the hierarchy's questions of every card — a listing, a watch projection — so each answer costs a lookup and not a walk over the board. The free functions (Find, Lineage, LeafTasks, OnBacklog, …) give the same answers for one card at a time; a loop over a board of three thousand cards asking them of each card was three thousand walks of the board per question, and the listing paid it for every watcher. The index is a snapshot: a card added to the board after it was built is not in it.

func NewIndex added in v0.42.0

func NewIndex(b Board) *Index

NewIndex reads the board once.

func (*Index) Blockers added in v0.50.0

func (ix *Index) Blockers(c Card) []Blocker

Blockers are a card's unsatisfied dependencies: its own first, then each ancestor's, nearest first. A target the board does not hold is dangling and blocks nothing (N6).

func (*Index) BlockersAs added in v0.50.0

func (ix *Index) BlockersAs(c Card, can func(Card) bool) (shown []Blocker, hidden int)

BlockersAs splits a card's blockers by what a reader may read: shown are the ones whose target, and every card from this one up to the card that names it, the reader can read; hidden counts the rest (N4).

func (*Index) Blocks added in v0.50.0

func (ix *Index) Blocks(c Card) []Card

Blocks are the cards whose own dependsOn names this one, board order.

func (*Index) ChildrenOf added in v0.42.0

func (ix *Index) ChildrenOf(id string) []Card

ChildrenOf is board.ChildrenOf: every card under the given one, planning cards and tasks alike, in board order.

func (*Index) DependencyTargetOK added in v0.50.0

func (ix *Index) DependencyTargetOK(c Card, target string) bool

DependencyTargetOK reports whether card c may wait for the card with id target (N1): it must be on the board, not c, neither a review card, and neither an ancestor nor a descendant of the other.

func (*Index) DependentCustomers added in v0.50.0

func (ix *Index) DependentCustomers(c Card) []DependentCustomer

DependentCustomers are the customers a card is for only through the work that waits for it (N5), each with the nearest waiting card.

func (*Index) Done added in v0.50.0

func (ix *Index) Done(c Card) bool

Done reports a dependency target as satisfied: a task complete, a plan item whose roll-up is done. A plan item with no tasks is not done.

func (*Index) EffectiveCustomers added in v0.44.0

func (ix *Index) EffectiveCustomers(c Card) []string

EffectiveCustomers is the customers a card is for (O4): every ancestor's and its own, the ancestors' first, each once — a lower card adds to them and never overwrites them. A review card is for its task's (O6). An id the board's roster does not hold is left out: it names nobody (O5). Then the customers of the work that waits for it or for an ancestor, transitively (N5).

func (*Index) EffectiveCustomersAs added in v0.50.0

func (ix *Index) EffectiveCustomersAs(c Card, can func(Card) bool) ([]string, []DependentCustomer)

EffectiveCustomersAs is EffectiveCustomers and DependentCustomers as a reader who can read only some cards works them out on their visible board (N5): a watch frame counted again for its subscriber.

func (*Index) EffectiveTeam added in v0.44.0

func (ix *Index) EffectiveTeam(c Card) string

EffectiveTeam is the team a card counts under (O3): its own, else the nearest ancestor's that has one. A task's own team always wins over an inherited one; nothing is written down the tree. A review card with no team of its own counts under its task's (O13).

func (*Index) EpicOf added in v0.52.0

func (ix *Index) EpicOf(c Card) string

EpicOf is a card's EPIC: its nearest epic ancestor, or "" — a NEUTRAL task.

func (*Index) EpicOrderFor added in v0.52.0

func (ix *Index) EpicOrderFor(_ string) EpicOrder

EpicOrderFor is the epic order team T reads.

func (*Index) Find added in v0.42.0

func (ix *Index) Find(id string) (Card, bool)

Find is a card by id.

func (*Index) HasDependencies added in v0.50.0

func (ix *Index) HasDependencies() bool

HasDependencies reports a board on which some card waits for another.

func (*Index) HasPlanningAncestor added in v0.42.0

func (ix *Index) HasPlanningAncestor(c Card) bool

HasPlanningAncestor is board.HasPlanningAncestor.

func (*Index) HierarchyStatus added in v0.42.0

func (ix *Index) HierarchyStatus(c Card) (status string, done, total int)

HierarchyStatus is board.HierarchyStatus.

func (*Index) HierarchyStatusAs added in v0.48.1

func (ix *Index) HierarchyStatusAs(c Card, can func(Card) bool) (status string, done, total int)

HierarchyStatusAs is HierarchyStatus as a visitor who reads only some cards would compute it on their visible board (Visible): the walk goes down through the planning cards they can read, and counts the tasks they can read. A watch frame built over the whole board answers with it, so a stream tells a visitor no more than their listing does.

func (*Index) InQueue added in v0.52.0

func (ix *Index) InQueue(c Card) bool

InQueue reports whether a card stands in a team queue: a backlog card (OnBacklog) that is not a review nobody has taken — those keep their own pinned group at the top of the backlog (K10).

func (*Index) IsSubtask added in v0.42.0

func (ix *Index) IsSubtask(c Card) bool

IsSubtask is board.IsSubtask: a task whose parent is a task, or is not here at all (which a read board never holds: the reading drops it).

func (*Index) LeafTasks added in v0.42.0

func (ix *Index) LeafTasks(id string) []Card

LeafTasks is board.LeafTasks: the tasks under a planning card through every level, a subtask and a review card not among them, in board order.

func (*Index) Lineage added in v0.42.0

func (ix *Index) Lineage(c Card) []Card

Lineage is board.Lineage: every ancestor, root first, bounded.

func (*Index) Locked added in v0.50.0

func (ix *Index) Locked(c Card) bool

Locked reports a card with at least one blocker (N3). Independent of the manual `stage: locked`.

func (*Index) OnBacklog added in v0.43.0

func (ix *Index) OnBacklog(c Card) bool

OnBacklog is board.OnBacklog with the subtask question answered by the index.

func (*Index) OnRoster added in v0.44.0

func (ix *Index) OnRoster(ids []string) []string

OnRoster is the ids of the given ones the board's customer roster holds, in order: what a card's own customers read as (O5).

func (*Index) ParentOf added in v0.42.0

func (ix *Index) ParentOf(c Card) (Card, bool)

ParentOf is the card a card's `parent` names, if it is on the board.

func (*Index) PlaceSpot added in v0.52.0

func (ix *Index) PlaceSpot(c Card, team string) Spot

PlaceSpot is THE default position of a task c in team T's queue (Q3) — create, a team handover, a drop into another epic, a return whose old key is no longer valid, normalisation. c is the card as it will be (its new parent, its new team); the queue is read without it.

epic E has parked tasks in Q(T)          → right after the LAST of them
epic E with none in Q(T)                 → BestGap(Q(T), E)
neutral, plan parent P has tasks in Q(T) → right after the last of them
otherwise                                → right after the last task of Q(T);
                                           an empty queue → the end of the board

An explicit place always wins over it; the callers apply that.

func (*Index) PlacedTeam added in v0.46.0

func (ix *Index) PlacedTeam(c Card) string

PlacedTeam is the team a card stands under (O13).

func (*Index) PlanParentOf added in v0.52.0

func (ix *Index) PlanParentOf(c Card) string

PlanParentOf is a card's nearest PLANNING ancestor — its epic when it has one, else the initiative or goal it hangs under — or "".

func (*Index) Queue added in v0.52.0

func (ix *Index) Queue(team string) []Card

Queue is Q(T): the queue of one team ("" is the no-team group), in board order.

func (*Index) ReviewedBy added in v0.42.0

func (ix *Index) ReviewedBy(c Card) string

ReviewedBy is the person on the card's open review card, or "" — what `status.reviewedBy` carries.

func (*Index) Schema3BacklogKey added in v0.52.0

func (ix *Index) Schema3BacklogKey(c Card) Schema3BacklogKey

Schema3BacklogKey is the card's place in its backlog (Schema3BacklogKey).

func (*Index) Split added in v0.52.0

func (ix *Index) Split(epic, team string) bool

Split reports an epic whose parked tasks in team T's queue do not stand together: another task stands inside its area.

func (*Index) UnassignTargets added in v0.48.0

func (ix *Index) UnassignTargets(c Card) []Card

UnassignTargets is what the Strategy board's UNASSIGNED means on a card (K16): on a task, the task itself when it is open work in hand; on a plan item, every such task under it at any depth, in board order. Work in hand is a task with a date or a sprint that is not parked; finished work, a review card (it follows the card it reviews) and a subtask (it rides its parent) are never among them.

func (*Index) ValidReturn added in v0.52.0

func (ix *Index) ValidReturn(c Card, team string) bool

ValidReturn reports whether a task coming back to its team's queue — the ×, unassign, park — may keep its old key (Q8): only while the key is still inside its epic's AREA in Q(T) (strictly after the task before the epic's first task and strictly before the task after its last); with no other task of the epic there, while the gap it falls in costs no more than the best one; a neutral task by its plan parent's area. No plan item above it at all, or a key no server mints, is never kept.

func (*Index) WouldCycle added in v0.50.0

func (ix *Index) WouldCycle(c Card, target string) bool

WouldCycle reports whether c waiting for target closes a cycle (N2): c — or any card under c, which inherits c's wait — is reachable from target through dependsOn, the waits a card inherits from its ancestors, and a plan item's cards under it (its roll-up).

type Link struct {
	URL string `json:"url"`
	// Kind is "issue", "pull" or "link".
	Kind   string `json:"kind"`
	Owner  string `json:"owner,omitempty"`
	Repo   string `json:"repo,omitempty"`
	Number int    `json:"number,omitempty"`
	// Title is the issue/PR title, when resolved.
	Title string `json:"title,omitempty"`
	// State is the issue/PR state (open/closed/merged), when resolved.
	State string `json:"state,omitempty"`
}

Link is one URL found in a card's description. GitHub issue and pull-request links are recognised and addressable (Owner/Repo/Number); everything else is a plain link. Title and State are filled by a LinkResolver, not here.

func ExtractLinks(description string) []Link

ExtractLinks finds every link in a free-form description — full URLs and GitHub owner/repo#number shorthands — classifies GitHub issue/PR references, dedupes (a shorthand and a full URL of the same item are one link), and orders the result the way the UI lists it: GitHub references first (in order of appearance), plain links after.

func ParseGitHubRef

func ParseGitHubRef(raw string) (link Link, ok bool)

ParseGitHubRef parses a GitHub issue/PR reference — a full URL or the owner/repo#number shorthand. ok is false for anything else.

func (Link) FallbackTitle

func (l Link) FallbackTitle() string

FallbackTitle is a readable card title for a GitHub ref whose real title could not be fetched (e.g. a token without access to a private repo): "Issue: owner/repo#123" or "Pull: owner/repo#123".

func (Link) IsGitHubRef

func (l Link) IsGitHubRef() bool

IsGitHubRef reports whether the link addresses a GitHub issue or PR.

type Note

type Note struct {
	ID        string `json:"id"`
	Body      string `json:"body"`
	CreatedAt string `json:"createdAt"`
	Author    string `json:"author,omitempty"`
	// Source is "comment" or "draft".
	Source string `json:"source"`
}

Note is a dated work note attached to a card: an issue/PR comment, or a line stored in a draft issue's body when the card has no comment thread. It mirrors the Note interface in web/src/providers/types.ts.

type Person added in v0.37.0

type Person struct {
	// Capacity is the roster's number — points a week — or 0 for "nobody
	// has said" (see CapacityOfPerson).
	Capacity int `json:"capacity,omitempty"`
}

Person is what the roster says about one login: for now, the points a week they get through, when a lead has set it (0 = nobody has said). It is the primary repository's users/<login>.yaml.

type Planner added in v0.52.0

type Planner func(b Board) ([]RankChange, error)

Planner computes an ordering action's keys over a board: the board is the MERGED board as it stands at the moment of the write, its cards in board order. A backend runs it and writes what it returns — the plan is decided in one place, over the state it applies to (ordering.md).

func Fixed added in v0.52.0

func Fixed(changes []RankChange) Planner

Fixed is a planner that returns changes already decided — the write of a plan computed elsewhere (the server's cache plans; its queued write applies the same keys).

type PlanningResolver added in v0.42.0

type PlanningResolver interface {
	CardIsPlanning(id string) bool
}

PlanningResolver is the optional half of a DomainResolver: whether a card is a planning card. The domain rule needs it — a subtask lives where its parent lives, a task under an epic where its own team does — and a resolver that cannot answer is read as "every parent is a task", which is what every parent was before this field existed.

type RankChange added in v0.52.0

type RankChange struct {
	ID     string `json:"uid"`
	Before string `json:"before,omitempty"`
	After  string `json:"after"`
}

RankChange is one key an ordering action rewrites: the card, the key it had and the key it gets. An action's changes are its whole plan (docs/design/ordering.md).

func GatherPlan added in v0.52.0

func GatherPlan(b Board, epic string) ([]RankChange, error)

GatherPlan gathers an epic's parked tasks into one block per team at the best gap of the queue without them — MoveEpicPlan's second half, on a board whose epic order is already the new one.

func MoveEpicPlan added in v0.52.0

func MoveEpicPlan(b Board, epic, after string) ([]RankChange, error)

MoveEpicPlan is the epic move (Q5), the same operation from the Strategy board and the Backlog: the epic takes a key right after `after` ("" = the top of the board) — its new place in the epic order — and then, in EVERY team holding its parked tasks, those tasks are gathered into one block, their order kept, at the BestGap of the queue without them under the new epic order. A block already standing there writes nothing; tasks in work and other epics' tasks never move.

func Normalize added in v0.52.0

func Normalize(b Board) ([]RankChange, error)

Normalize gives every open task in a queue that has NO valid key — a direct writer's file without a `rank`, or with one no server mints — its default place (Q11): Place, task by task in (created, id) order, each on the board the previous ones left. Deterministic over a board, so two replicas write the same keys. A valid key a writer chose is kept.

func Place added in v0.52.0

func Place(b Board, c Card, team string) ([]RankChange, error)

Place is PlaceSpot as keys: where c goes in team T's queue by default.

func PlaceAfter added in v0.52.0

func PlaceAfter(list []Ranked, id, afterID string) ([]RankChange, error)

PlaceAfter is the keys that put id right after afterID in list ("" = the top; an anchor the list does not hold = the end). With room between the two neighbours it is ONE key, the mover's (G12). When the gap is exhausted — the key would outgrow MaxRankLen — or the neighbours are tied or inverted (two writers picked one key), a WINDOW of neighbours around the place is renumbered with evenly spaced keys between the nearest entries outside it, grown until the keys fit: a bounded run, never the whole list unless the list is the window. Only keys that change are returned. list is in board order and may hold id.

func PlaceAt added in v0.52.0

func PlaceAt(rest []Ranked, mover Ranked, at int) ([]RankChange, error)

PlaceAt is PlaceAfter by position: the mover lands at index at of rest (the list without it).

func PlaceInOrder added in v0.52.0

func PlaceInOrder(b Board, ids []string) ([]RankChange, error)

PlaceInOrder places the given open parked tasks one by one, in the order given, by Place on the board the previous ones left — the cards of a repository that joins a board already at schema 4 (their keys meant the old tree order). Cards in no queue are left alone.

func PlaceRunAt added in v0.52.0

func PlaceRunAt(rest []Ranked, movers []Ranked, at int) ([]RankChange, error)

PlaceRunAt puts a RUN of movers, in the order given, at index at of rest (the list without them): evenly spaced keys between the two neighbours when they fit, else a bounded window renumbered around the place, as PlaceAfter does for one. A run already in place writes nothing.

func ReorderInEpicPlan added in v0.52.0

func ReorderInEpicPlan(b Board, task, after, before string) ([]RankChange, error)

ReorderInEpicPlan is a task moved WITHIN its epic on the Strategy board (Q6): a slot permutation. The epic's parked tasks of the task's team keep the keys they hold between them — the slots of the queue they stand in — and the keys are handed out in the new order, the task put right after `after` (or right before `before`) among the epic's children as drawn. Other epics' tasks never move. A task in work or done is no slot: it takes an ordinary key between its drawn neighbours.

func ReturnChanges added in v0.52.0

func ReturnChanges(b Board, c Card, team string) ([]RankChange, error)

ReturnChanges is the keys a task coming back to team T's queue gets: none when its old key is still valid (ValidReturn), else Place.

func SpotChanges added in v0.52.0

func SpotChanges(b Board, id string, s Spot) ([]RankChange, error)

SpotChanges is the keys that put card id at a spot in the board's order. The board's cards are its order (rank, then id).

type Ranked added in v0.52.0

type Ranked struct {
	ID   string
	Rank string
	// Fixed is an entry a rebalance window must not re-key (Board.Pinned):
	// the window stops at it, and it bounds the run instead.
	Fixed bool
}

Ranked is one entry of an ordered list: an id and its key.

func RankedOf added in v0.52.0

func RankedOf(cards []Card) []Ranked

RankedOf is a board's cards as a ranked list, in the board's order, the teams' state cards left out (they order the roster, not the board).

func RankedOfBoard added in v0.52.0

func RankedOfBoard(b Board) []Ranked

RankedOfBoard is RankedOf with the board's pinned cards marked Fixed.

type Schema3BacklogKey added in v0.52.0

type Schema3BacklogKey struct {
	Review bool
	Loose  bool
	Path   []int
}

Schema3BacklogKey is a backlog card's place in the list as schema 3 read it (K14, retired by docs/design/ordering.md): kept for the schema-4 migration, which preserves exactly this order, and for nothing else.

  • Review: a review nobody has taken (K10) stands first, before every task, in its own group.
  • Loose: the card has no plan item above it; the loose cards come after every planned one.
  • Path: the places in the board's order from the root of the card's tree down to the card itself (K14) — the Strategy board's draw order, which lists a parent's children in board order. The first step is the root's level ahead of its place, as the Strategy board draws its roots level by level (goals, then initiatives with no goal, then epics with no initiative). A loose card's path is its own place alone; a review's is the reviewed task's, so the reviews read in their tasks' Strategy order.

func (Schema3BacklogKey) Less added in v0.52.0

Less reports whether k stands before o.

type SizeKey added in v0.37.0

type SizeKey string

SizeKey is what somebody said a card weighs: S, M, L or XL. It mirrors the SizeKey union in web/src/providers/types.ts; SizeNone ("") is unsized.

The LETTER is what is stored and what a person picks on a daily sync; the points are derived (Points), never written, so the scale can be retuned without touching a card. The scale doubles at each step so a week of S-work and a week of L-work can be compared at all: S is up to a couple of hours, M half a day to a day, L two to five days, XL a week or more.

const (
	SizeNone SizeKey = ""
	SizeS    SizeKey = "S"
	SizeM    SizeKey = "M"
	SizeL    SizeKey = "L"
	SizeXL   SizeKey = "XL"
)

The four sizes, mirroring web/src/size.ts.

func ParseSize added in v0.37.0

func ParseSize(raw string) (SizeKey, bool)

ParseSize reads a size as people and tools type it — any case, stray spaces — and refuses anything that is not one of the four: a size nothing knows would weigh nothing and read as unsized, silently. The empty string is SizeNone and is accepted: it is how a size is cleared.

type Spot added in v0.52.0

type Spot struct {
	After  string
	Before string
}

Spot is a place in the board's order named by a neighbour: right after After, or — with After empty — right before Before; both empty is the end of the board.

type SprintState

type SprintState struct {
	Current  string `json:"current"`
	Previous string `json:"previous"`
	ItemID   string `json:"itemId"`
	// Capacity is the team's, from its roster file; zero when nothing is set.
	Capacity Capacity `json:"capacity,omitempty"`
}

SprintState is a team's explicit sprint pointer, read from its hidden sprint-state card: the current and previous sprint start dates (and the card's item id). It mirrors the SprintState interface in web/src/providers/types.ts; "" means the team has no such sprint yet.

type StageDef

type StageDef struct {
	Key   StageKey `json:"key"`
	Label string   `json:"label"`
	Color string   `json:"color"`
}

StageDef describes a stage's label and progress-bar colour, mirroring StageDef.

type StageKey

type StageKey string

StageKey is an explicit per-card status that recolours the progress bar. It mirrors the StageKey union in web/src/providers/types.ts and the stage model in web/src/stages.ts. StageNone ("") means the card carries no stored stage.

const (
	StageNone      StageKey = ""
	StageLocked    StageKey = "locked"
	StageReview    StageKey = "review"
	StageRecurrent StageKey = "recurrent"
	StageRefuse    StageKey = "refuse"
	StageDone      StageKey = "done"
)

The explicit stages a card can carry, mirroring web/src/stages.ts. StageNone ("") is the absence of a stage (the implicit In Progress / not-started state).

func ApplyInProgress

func ApplyInProgress(stage StageKey, progress int) (StageKey, int)

ApplyInProgress computes the (stage, progress) for moving a card to the implicit In Progress status: the stage is cleared and progress is nudged into the [10, 90] band only at its edges — under 10 becomes 10, a done or full (>=100) card drops to 90, otherwise the value is kept as-is (so a 91–99 value is left untouched, matching the frontend). It mirrors handleInProgress.

func ApplyProgress

func ApplyProgress(stage StageKey, raw int) (StageKey, int)

ApplyProgress computes the (stage, progress) resulting from setting a card's progress to raw. The value is first clamped for the current stage. Done is derived (no stage + 100%, see Complete), never stored: reaching 100% with no stage simply stays stage-less, and a legacy stored done clears itself when progress drops below full. review/locked stages are left as-is. It mirrors handleProgress.

func ApplyStage

func ApplyStage(stage StageKey, currentProgress int) (StageKey, int)

ApplyStage computes the (stage, progress) resulting from moving a card to the given stage. Done is derived, never stored: choosing it clears the stage and fills progress to 100% (Complete then reports the card finished). Choosing review or locked knocks a full (100%) card down to 90%, since those stages can never sit at full. Clearing the stage (StageNone) or any other case keeps progress. It mirrors handleStage.

func StageFromName

func StageFromName(name string) StageKey

StageFromName maps a Stage single-select option name onto a StageKey, mirroring stageFromName. An unknown (or empty) name yields StageNone.

type View added in v0.39.0

type View string

A VIEW is a board somebody opens. The domain names them because the name is an address: the API scopes a listing, a create and a board gesture by it (docs/design/view-scoped-api.md), so "me" and "backlog" are values that travel, not strings a client makes up.

A view is not a place a card LIVES — the same card is drawn on its owner's Me board, on the team's grid and on the Strategy board under its epic, all at once. It says where the CALLER is standing, which is what makes a gesture mean something ("remove it from here") and a create mean something ("a card of this board").

const (
	// ViewMe is the Me day board: one person's own cards on a day.
	ViewMe View = "me"
	// ViewTeam is the lead's day grid: a team's cards on a day, everyone's.
	ViewTeam View = "team"
	// ViewBacklog is the teams' backlogs: each team's parked tasks, ranked by
	// hand, top is next (docs/design/backlog.md). It replaced the Triage
	// board, whose drawer it used to be (K9).
	ViewBacklog View = "backlog"
	// ViewStrategy is the hierarchy: every goal, initiative and epic, and
	// every card with one of those above it (docs/design/hierarchy.md). A
	// task with no parent is not on it — it is on the day boards. Renamed
	// from `strategy` on 2026-11-08; the old name is no board any more.
	ViewStrategy View = "strategy"
	// ViewAll is no board at all: everything the caller may read. It is the
	// escape hatch for a tool that has no board to stand on — a migration, a
	// sweep, an embedder — and it is never a default, because a caller acting
	// board-wide should have said so.
	ViewAll View = "all"
)

func Views added in v0.39.0

func Views() []View

Views lists them in the order the SPA's own tabs run, the escape hatch last.

type ZoneKey

type ZoneKey string

ZoneKey is the colour zone a card belongs to, in the Ford sense. It mirrors the ZoneKey union in web/src/providers/types.ts ("" means no zone).

const (
	ZoneNone   ZoneKey = ""
	ZoneGray   ZoneKey = "gray"
	ZoneGreen  ZoneKey = "green"
	ZoneYellow ZoneKey = "yellow"
	ZoneRed    ZoneKey = "red"
)

The four Ford zones, mirroring web/src/zones.ts. ZoneNone ("") is no zone.

func ZoneOf added in v0.36.0

func ZoneOf(c Card) ZoneKey

ZoneOf is the band a card is drawn in — its own zone, or PLANNED when it is in the working area and nobody said.

The working area is drawn as four bands and nothing else, so a card standing on a day has to be in one of them. Every client already decides that the same way (`card.zone ?? "gray"` in MeBoard and TeamBoard), which means the answer existed but only inside the clients: the API said nothing, and each reader — a script, an agent, a second client — had to reinvent the fallback or read the card as zone-less work in the middle of somebody's day.

Outside the working area the empty zone is kept, because there it is DRAWN: the backlog gives a zone-less card a neutral line. A card parked in a backlog genuinely has no zone yet — the zones are statements about a DAY (critical means today, unplanned means it turned up today, "if time left" is a day's spare capacity), and a card on no day has not been the subject of one.

Jump to

Keyboard shortcuts

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