sprint

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2026 License: MIT Imports: 47 Imported by: 0

Documentation

Overview

Package sprint implements the core coordination rules and data structures for nova-sprint (docs/SPEC-SPRINT.md).

Index

Constants

View Source
const (
	NAlarmReview  = "review above its alarm"
	NAlarmMerging = "merging above its alarm"
	NAlarmReady   = "nothing ready while cards wait"
	NAlarmFleet   = "the fleet works below its alarm"
	// NAlarmCleared is the happened note, to the coordinator, that an alarm's episode
	// ended: its what opens with the alarm's type and a colon.
	NAlarmCleared = "an alarm cleared"

	PropAlarmReview  = "alarm_review"  // a count: raised while review holds more
	PropAlarmMerging = "alarm_merging" // a count: raised while merging holds more
	PropAlarmFleet   = "alarm_fleet"   // a percent: raised while the up members work below it of their width
	PropAlarmReady   = "alarm_ready"   // on: raised while nothing is ready and a card waits
	// AlarmOff is the word that takes an alarm off.
	AlarmOff = "off"
)

The backlog alarms (docs/SPEC-SPRINT.md section 8, "Backlog alarms"): four conditions of the whole sprint the tick keeps, each off until the coordinator sets its threshold (`set --alarm-review`, `--alarm-merging`, `--alarm-fleet`, `--alarm-ready`, the work table's properties below). Each is one judgment while its condition stands, written once when it starts (notify: one per episode, so a push of new judgments pushes it once) and closed once when it ends, with one cleared note to the coordinator.

View Source
const (
	PropAttempts    = "attempts"
	FieldAttempts   = "attempts"
	AttemptsDefault = 4
	AttemptsMax     = 100
)

PropAttempts is the work table's property holding the sprint's attempt cap (set --attempts, init --attempts), FieldAttempts a stream's control card field holding the stream's (stream set --attempts), over the sprint's; AttemptsDefault is the cap when neither is set, and AttemptsMax the most a cap may be.

View Source
const (
	BriefDefectBase      = "the base lacks a PATHS file"
	BriefDefectDuplicate = "a duplicate of landed work"
	BriefDefectDecision  = "a decision delivered"
	BriefDefectPaths     = "PATHS do not hold what the brief names"
	BriefDefectOther     = "named by the worker"
)

The reasons a brief defect is recorded with (FieldBriefDefect), as BriefDefectOf reads them.

View Source
const (
	// TickTurnFloor is the least time the batches have the line between two ticks when
	// they wait for it: the run loop's TickFloor.
	TickTurnFloor = 100 * time.Millisecond
	// TickTurnCap is the most: with a tick and a batch each shorter, a tick of a loaded
	// server begins within 15 s (MachineSilence) of the tick before.
	TickTurnCap = 5 * time.Second
)
View Source
const (
	NFriendDeaf        = "a friend's session is deaf"
	NFriendIdle        = "a friend holds working cards and finishes none"
	NCoordinatorBehind = "judgments wait on the coordinator past their deadline"
	// NFriendEmpty is an up friend whose row has been empty for EmptyRowAfter while
	// cards she could do sit ready in the pool or unstarted on another friend's row.
	NFriendEmpty = "an up friend has an empty row while cards wait"
	// NPinIgnored is a named pin (WHO: friend <name>, not a hard pin) sitting ready
	// or working off that friend's row.
	NPinIgnored = "a pinned card was dealt away from its friend"
	// NFriendRowEmpty is the clock for NFriendEmpty: an acknowledgement, not a
	// judgment, written when an up friend's empty row and the cards she could do
	// first hold together, and closed when they do not. It is not one of PassTypes,
	// so a pass does not raise it and does not close it by the judgment rule.
	NFriendRowEmpty = "an up friend's empty row"
	// NRaisedAgain is the push of a pass judgment that still holds: a happened note to
	// the coordinator, once every PassEvery of running time.
	NRaisedAgain = "a judgment still holds: raised again"
)

The pass's judgment types and its push.

View Source
const (
	// PassEvery is the running time between two raises of one pass judgment.
	PassEvery = 10 * time.Minute
	// EmptyRowAfter is how long an up friend's row stays empty, while cards she
	// could do wait elsewhere, before the pass tells the coordinator once.
	EmptyRowAfter = 10 * time.Minute
	// FriendDeafAfter is how old a friend's last session pong may be before her
	// session is deaf: FriendProofLive, since her daemon asks her session eight minutes
	// after its last ask and waits up to five for the answer (nova-friend's ProveEvery and
	// SessionBound; docs/SPEC-FRIEND.md, The push proof), so a session that answers is
	// never proved longer ago than thirteen minutes. Shorter, and a friend whose session
	// answers slowly is judged deaf and cleared again every cycle.
	FriendDeafAfter = FriendProofLive
	// FriendFinishDefault is the friend-finish window when the coordinator set none.
	FriendFinishDefault = 30 * time.Minute
	// PropFriendFinish is the work table's property: the friend-finish window, a
	// duration (nova-sprint set --friend-finish).
	PropFriendFinish = "friend_finish"
)
View Source
const (
	// UsageSubscription is the usage word a subscription reader adds to its --usage.
	UsageSubscription = "billing=subscription"
	// WhySubscription is a subscription run's unpriced word: its tokens, no dollars.
	WhySubscription = "subscription"
	// CostTokens is the cost a COST line shows for a subscription run: its tokens.
	CostTokens = "tokens"
)

A read is priced as work is (the owner, 2026-10-05: "do we have the cost for readers properly calculated yet in nova sprint?"): by the route its ask drew, the read card's own route row, never by a route found again from the model its harness reported. A read card with a route is a routed read: its verdict (read --ok or --broken) carries the run's usage or is refused (ReadUsageMissing), so no routed reader can leave its read unpriced by saying nothing. A usage with no token count (a fleet harness that reported none) is permissive in what we read: the verdict is kept, its record says unpriced=no-tokens and the stream counts it (TierCosts.ReadsNoTokens). A subscription reader (a bud's claude -p on its own plan, which bills no dollar per token) says so in its usage, billing=subscription: its tokens are kept, with no dollar figure, and its cost is shown as tokens (CostTokens).

View Source
const (
	FieldCostRecord = "cost_record:" // + the consumer's key (Consumer.Key)
	FieldCostTotal  = "cost_total"   // cardcost.Total.String over every record
	FieldCostCut    = "cost_cut"     // how many records past MaxCostRecords were left out of the list
	// MaxCostRecords bounds the history on one card. A card's takes and reads are few;
	// past the bound a record is still added to the total, exactly, and counted in
	// FieldCostCut, and `card <id>` says the list was cut.
	MaxCostRecords = 64
)

The producer card carries what it cost, for the cost is tracked in the card: each consumer that ends appends one record to the primary, FieldCostRecord plus the consumer's key, in the same step that ends it, and the primary's running total (FieldCostTotal) is updated with it. Everything that shows or sums a card's cost reads the primary alone (CardCostOf), so no reader or member removed, no read card retired and no consumer record cleaned up can lose cost.

View Source
const (
	StageNeeds    = "needs"     // added to ready
	StageDeal     = "deal"      // ready to dealt (a card never reworked)
	StageTake     = "take"      // dealt to taken
	StageWork     = "work"      // taken to finished
	StageRework   = "rework"    // finished to dealt again, over every attempt (a reworked card)
	StageReadWait = "read_wait" // finished to read asked
	StageRead     = "read"      // read asked to read done
	StageAccept   = "accept"    // read done to accepted
	StageMerge    = "merge"     // merge queued to landed
)

Stage names, in the order wall time passes through them.

View Source
const (
	FieldReadyAt     = "ready_at"
	FieldDealtAt     = "dealt_at"
	FieldTakenAt     = "taken_at"
	FieldFinishedAt  = "finished_at"
	FieldReworkS     = "rework_s"
	FieldReadAskedAt = "read_asked_at"
	FieldReadDoneAt  = "read_done_at"
	FieldQueued      = "queued" // on the merge card
)

The stamps a card keeps on itself, beside admitted, accepted and landed.

View Source
const (
	// DeadlineK is the multiple of the member's median run wall a card's deadline is at
	// least.
	DeadlineK = 3
	// DeadlineSamples is how many of the member's latest ok attempts the median is over.
	DeadlineSamples = 50
	// FieldMemberDeadline is the member's control card field holding its pinned deadline
	// in seconds (fleet up --deadline), absent when none is pinned.
	FieldMemberDeadline = "deadline"
	// FieldOwnDeadline is the work card's own deadline in seconds, the route's or the
	// pin's, kept beside `deadline` (the member's) so a card dealt again to another
	// member (a member down, the level) gets that member's from the same start.
	FieldOwnDeadline = "deadline_own"
)
View Source
const (
	// FieldDecideAttemptNoResult and FieldDecideAttemptNothingToDo are a work card's attempt
	// bars, the sprint row's as the deal read them: a failed finish whose decision is that
	// class at or above its bar is routed by the class (finishKind).
	FieldDecideAttemptNoResult    = "decide_attempt_no_result"
	FieldDecideAttemptNothingToDo = "decide_attempt_nothing_to_do"
	// FieldDecided is a work card's attempt decision as its last finish carried it
	// (decide.Decided: `<class> p=<p> op=<op>`), and FieldDecidedUsed is "yes" when the
	// finish was routed by it.
	FieldDecided     = "decided"
	FieldDecidedUsed = "decided_used"
	// PrefixDecided keys a primary's record of each attempt decision of its takes:
	// `decided:<op>` = `<class> p=<p> used=<yes|no>`, set once (the op is per attempt and
	// state, so two takes that ended alike share it), read by DecideDue.
	PrefixDecided = "decided:"
	// FieldGrade is a primary's grade decision (decide.Decided: `<grade> p=<p> op=<op>`).
	FieldGrade = "grade"
)

The fields of layer 2.

View Source
const (
	NDriftAhead    = "the base is ahead of dev past its drift"
	NDriftCardBase = "an open card is cut on another base"
	NDriftServer   = "the live server runs off the base"
	NDriftBaseRed  = "the base is red at its tip"

	PropDriftCommits = "drift_commits" // a count: the base may be this many commits ahead of dev
	PropDriftHours   = "drift_hours"   // hours: the oldest commit of the base not on dev may be this old
)

The drift alarms (docs/SPEC-SPRINT.md section 8, "Drift alarms"). On 2026-10-04 and 2026-10-05 the branches drifted for hours before anyone looked: the live server on a side branch, cards on temporary and dead branches, and the base red three times through the lander's narrow gate, each blocking the promotion to dev. The owner, 2026-10-05: "How can we ensure that you ALWAYS do the merging properly from now on, vs. drifting and forgetting?" and "Prevention is better than cure". So every drift is a fact the machine raises: four judgments, each written once when its drift starts, raised again every PassEvery of running time while it holds (the judgment rewritten with the latest facts and its raises counted in Before, and a push NRaisedAgain to the coordinator, as the coordinator's pass does), never one a tick, and closed when it stops. The episode machine is the pass's, tla/CoordinatorPass.tla.

View Source
const (
	DriftCommitsDefault = PromoteCards
	DriftHoursDefault   = 2
)

The thresholds of the base ahead of dev when the coordinator set none: as many commits as PromoteCards, and two hours.

View Source
const (
	FieldFailure      = "failure"
	FieldFailureAt    = "failure_at"
	FieldFailureTier  = "failure_tier"
	FieldFailureBound = "failure_bound"
	FieldFailureBack  = "failure_back"
	FieldIdenticalAt  = "identical_at"
)

The primary's record of its failed work, written by the failed finish (Finish) and by the rework of an attempt at its redeal bound (Rework: its takes ended with no work to judge, BoundClass): the class of the last failed attempt, that attempt and the tier the card was on (CardTiers: a new tier counts its own failures), whether it ended at its bound, and the attempt whose failure was the same as the attempt before's (rule 2): the tick holds the bound's judgment on the primary while it stays in review at that attempt (AtIdenticalFailure). FieldFailureBack is the tiers on which the provider's return has lifted a held bound (providerBack), comma separated: once per tier per card, and nothing clears it.

View Source
const (
	FieldAdoptSince  = "adopt_since"
	FieldAdoptTo     = "adopt_to"
	FieldAdoptFailed = "adopt_failed"
)

The control card's fields of an adoption: the episode (when the member was held adopting, the key of its one adoption), the release it adopts, and the failure that keeps it held.

View Source
const (
	NMemberBack  = "fleet member back"
	NAdoptFailed = "a member's adoption failed"
)

NMemberBack is the happened note of a member back from down at the latest; NAdoptFailed the judgment of one whose adoption failed.

View Source
const (
	AdoptNone     = ""
	AdoptRunning  = "running"
	AdoptFinished = "done"
	AdoptFailed   = "failed"
)

The states of one machine's adoption.

View Source
const (
	NQuiet      = "a machine is quiet"
	NQuietEnded = "a machine's quiet ended"
)

The happened notes of a quiet: begun by the coordinator, and ended, at its time or early.

View Source
const (
	FieldHeldBy = "held_by"
	HeldBySync  = "sync"
)

FieldHeldBy is the control card's field naming who made the member's hold when it was not the coordinator; HeldBySync is the sync.

View Source
const (
	DriftAdd     = "add"     // the inventory names a member the table has no control card for
	DriftWidth   = "width"   // a member's width differs
	DriftHold    = "hold"    // the table has a member the inventory no longer names
	DriftRelease = "release" // a member the sync held is back in the inventory with room
	DriftRemove  = "remove"  // a member with no machine row on which no card stays
)

The kinds of drift between the fleet table and the inventory.

View Source
const (
	CheckAnswerWithin = 15 * time.Minute
	MaxAsked          = 8
)

CheckAnswerWithin is how long after the ask an answer to a check proves; MaxAsked is how many unanswered checks her beat record keeps, the oldest dropped first.

View Source
const (
	FriendTaskQueued  = "queued"
	FriendTaskWorking = "working"
	FriendTaskDone    = "done"
)

The states of a task in a friend's QUEUE.json.

View Source
const (
	ReconcileCollect = "collect" // her report is there: friend sync's finish
	ReconcileKeep    = "keep"    // she holds it: left working
	ReconcileReturn  = "return"  // she does not: FriendReturn
)

What reconcile does with one card working on a friend's row (FriendReconcileOf).

View Source
const (
	NFriendCollected = "a friend's card collected by reconcile"
	NFriendDisagrees = "a friend's row disagrees with her QUEUE.json"
	NFriendAgrees    = "a friend's row agrees with her QUEUE.json again"
	// NFriendDirStalled is the run loop's reconcile passing a friend over because a read
	// of her directory did not answer within its deadline (cmd/nova-sprint
	// friendreconcile_tick.go), once an episode
	NFriendDirStalled = "a friend's directory did not answer the reconcile"
)

The run loop's reconcile notes: happened, addressed to the coordinator (the tick end wakes them, and inbox --push carries them to the bus).

View Source
const (
	// NFriendSyncFailing is the judgment: friend sync has refused every pass past the bound.
	NFriendSyncFailing = "friend sync keeps refusing"
	// NFriendSyncRefusing and NFriendSyncRecovered are the log's happened notes of the
	// state's record and its clearing.
	NFriendSyncRefusing  = "friend sync refusing"
	NFriendSyncRecovered = "friend sync ok again"
	// PropFriendSync is the fleet table property holding the loop's standing failure
	// (FriendSyncState as JSON); absent or empty while the loop is ok.
	PropFriendSync = "friend_sync"
	// FriendSyncJudgeAfter is how long the loop fails before it records the state the
	// judgment is raised on: one minute, four passes of the 15 s loop.
	FriendSyncJudgeAfter = time.Minute
)

The friend sync loop's standing failure, told once (docs/FRIENDS.md, "The friend sync loop"). On 2026-10-08 the loop refused every pass from 01:05 to 08:51 ET ("schema config is at version 35 and this binary carries 36; run: nova-config migrate") and for 7h45m no friend card was delivered or collected and no width followed nova-config; nobody was told, because the loop wrote its one FAILING line to its own log and raised no judgment. Now a loop failing past FriendSyncJudgeAfter records its state on the fleet table (PropFriendSync, FriendSyncState), the tick's deal raises one judgment of type NFriendSyncFailing on it (friendSyncConds, one open at a time: notify), and the first ok pass clears the state, which closes the judgment. The loop keeps retrying as before; the judgment is the coordinator's to see, with the refusal and its remedy in it, and nothing to answer but ack or wait.

View Source
const (
	// FieldTakenBack is why a friend's work card was taken back, on the withdrawn card until
	// the deal places it again: "taken back by the coordinator: <reason>", or the hold's words.
	FieldTakenBack = "taken_back"
	// FieldTakenFrom is the friend's row the coordinator took the card back from (friend
	// take, not the hold): the deal that places it again never gives it back to her.
	FieldTakenFrom = "taken_from"
	// NTakenBack is the happened note of a friend's card taken back to ready.
	NTakenBack = "a friend's card taken back to ready"
	// FieldCarryHead is the head a started card had pushed when a hold took it back, and
	// FieldCarryGen the generation whose branch holds it (BranchOf at that generation): the
	// next generation starts from it. Both stay on the card through its next deal.
	FieldCarryHead = "carry_head"
	FieldCarryGen  = "carry_gen"
)
View Source
const (
	GCJobs    = "jobs"
	GCReads   = "reads"
	GCLanders = "landers"
	GCBench   = "bench"
	GCCache   = "cache"
)

The classes, in the order a pass says them.

View Source
const (
	GCLaneNone  = ""      // the log never names the job
	GCLaneLive  = "live"  // started, resumed or stopped at a limit (it runs again), not ended since
	GCLaneEnded = "ended" // its last event is an END
)

The states of a job's lane in its runner's log (GCLane).

View Source
const (
	HeldByActor    = "a"    // an outside actor, before its deadline
	HeldByTick     = "b"    // the next tick moves it or writes its judgment
	HeldByJudgment = "c"    // an open judgment names it
	HeldByWaiting  = "d"    // it waits on something held
	HeldByStopped  = "e"    // the machine is STOPPED; the next tick would move it
	HeldDone       = "done" // landed, or off the table: nothing is owed
)

The holders, as Holder names them.

View Source
const (
	WaitOnCards   = "card"
	WaitOnLine    = "line"
	WaitOnRelease = "release"
)

The one wait (docs/SPEC-ISA.md): a held card waits for release, a sentinel for its line, and the wave behind it for the release through its card operand.

View Source
const (
	HoldMember = "member"
	HoldReader = "reader"
	HoldFriend = "friend"
	HoldStream = "stream"
)

What a hold names.

View Source
const (
	FieldHeldReason = "held_reason"
	FieldHeldFinish = "held_finish"
)

FieldHeldReason is a held member's or stream's control card's reason for its hold, and FieldHeldFinish marks a member's hold that lets its working cards finish (hold with no --return): the rebalance's sweep leaves those cards where they are.

View Source
const (
	NIdle        = "the fleet is idle"
	NIdleCleared = "the fleet is working again"
)

The idle alarm's notes: happened, addressed to the coordinator (the tick end wakes them, and inbox --push carries them to the bus).

View Source
const (
	// IdleWindow is how long, in running time, the fleet works under half its width with
	// cards waiting before the alarm is pushed.
	IdleWindow = 5 * time.Minute
	// IdleRoots is how many roots the note names, the most cards behind first.
	IdleRoots = 8
	// PropIdleSince and PropIdleSaid are the fleet table's properties of an episode: when
	// it began and when its note was pushed ("" or absent: none).
	PropIdleSince = "idle_since"
	PropIdleSaid  = "idle_said"
	// PartIdle is the tick part's name.
	PartIdle = "idle"
)

The idle alarm's numbers and state.

View Source
const (
	// FieldRuleReread is the primary's attempt at which the read-late rule asked another
	// reader: once an attempt, the second late read of the attempt is a mind's.
	FieldRuleReread = "rule_reread"
	// FieldRuleNeed is the card a HOLD named that the hold-need rule waits for, with the
	// attempt that held: "<card>@<attempt>".
	FieldRuleNeed = "rule_need"
)

The fields these rules write.

View Source
const (
	PartRuleTake = "rule take"
	PartRuleAsk  = "rule ask"
	PartRuleNeed = "rule need"
)

The tick parts of these rules (TickRules).

View Source
const (
	// NStatus is the status transition's judgment type.
	NStatus = "status"
	// RuleStatus is the rule that answers a status judgment whose every step is done. It
	// is not in RuleNames (nova-config's answer_rules_off enum does not name it yet), so
	// only run --answer-rules=false turns it off.
	RuleStatus = "status"
	// TakeWithin is how recent a take of hers must be for a friend come up to be in the
	// sprint (the fourth step).
	TakeWithin = 10 * time.Minute
	// StatusDwell is how long a row must hold a status other than its recorded one, in running
	// time, before the change counts as a transition.
	StatusDwell = 2 * time.Minute
	// StatusFlapsRaise is how many flaps (a departure back inside the dwell) raise the row's
	// "flapping" judgment when none is open: once, until a transition counts.
	StatusFlapsRaise = 3
	// StatusFlapWindow is how long, in running time, the flaps that raise it may take: a count
	// short of StatusFlapsRaise that began longer ago starts again at the next flap.
	StatusFlapWindow = 10 * time.Minute
	// StatusRuleAfter is how long after a status judgment's last push the rule may answer it.
	StatusRuleAfter = 60 * time.Second
	// NStatusChanged is the push of a status judgment whose text a further transition
	// replaced: a happened note to the coordinator naming it.
	NStatusChanged = "a status judgment changed"
)
View Source
const (
	BuildSame      = "same"
	BuildDifferent = "different"
	BuildUnknown   = "unknown"
)

The answers of BuildMatch.

View Source
const (
	FieldBaseGatePassed     = "base_gate_passed"
	FieldBaseGatePassedStop = "base_gate_passed_stop"
)

FieldBaseGatePassed is the base commit the lander found green again, on the control card of a stream stopped on its base's red (cause base); the base-gate rule resumes the stream. FieldBaseGatePassedStop is the stop it was found for (the card's since): a mark left from an earlier stop (a hand resume does not clear it) is no mark (basePassed).

View Source
const (
	// LaneGo is the lane kind of a Go build or test run: one per machine unless the
	// sprint's setting says otherwise (PropGoLanes).
	LaneGo = "go"
	// LaneHoldFor is how long a holder keeps its lane without taking it again: past a
	// whole gate run of `go test -timeout 600s` with room for its build, so a worker
	// that exits without giving it back (killed, lost) frees it.
	LaneHoldFor = 20 * time.Minute
	// LaneWaitFor is how long a waiter keeps its place without asking again, and how
	// long a grant made while it was not asking waits for it to claim it.
	LaneWaitFor = time.Minute
	// LaneAskEvery is how often a waiting take asks again (lane take --wait): well
	// inside LaneWaitFor, so a waiter that is there never loses its place.
	LaneAskEvery = 5 * time.Second
	// LaneWidthDefault is a machine's lanes of a kind when the sprint sets none: the
	// one test stream per machine.
	LaneWidthDefault = 1
	// PropGoLanes is the work table's property: the Go lanes of every machine, a
	// whole number from 1 (`set --go-lanes`).
	PropGoLanes = "go_lanes"
)
View Source
const (
	FieldLaneCap     = "lane_cap"
	FieldLaneOverrun = "lane_overrun"
	FieldCapRedealt  = "cap_redealt"
)

The fields of a capped take: on the work card the cap and the overrun its finish named, and on the primary the re-deal the cap spent (`<from> -> <to>`), once per card.

View Source
const (
	Mechanical  = "mechanical"
	Coordinator = "coordinator"
)

The class of a move: mechanical moves need no decision; the coordinator's moves are made only by the coordinator's verbs.

View Source
const (
	PropMergeWindowUntil  = "merge_window_until"
	PropMergeWindowReason = "merge_window_reason"
)

The merge window's properties, the merge table's (merge-window open): its end, RFC 3339 in UTC, and its reason. A clear starts the next epoch with neither, as it starts every property.

View Source
const (
	NeedJudgment = "judgment" // an open judgment of the inbox
	NeedSentinel = "sentinel" // a sentinel reached, or held, that waits for its release
	NeedStream   = "stream"   // a stopped stream with no judgment open on it
	NeedHeld     = "held"     // a card admitted held (add --held) that waits for its release
)

The kinds of a Need.

View Source
const (
	Happened = "happened" // no decision
	Judgment = "judgment" // needs the coordinator
	Decided  = "decided"  // a judgment answered
	// Acknowledged is a judgment of the tick the coordinator acknowledged
	// while its condition held: kept on the condition's subjects, it is no
	// judgment and shows in no inbox; it stops the tick from writing the
	// judgment again until the condition has cleared (the tick then closes
	// it) and come back.
	Acknowledged = "acknowledged"
)

Notification kinds (docs/SPEC-SPRINT.md section 8).

View Source
const (
	NStartedMerging = "stream started merging"
	NBatchLanded    = "batch landed"
	NStreamLanded   = "stream landed"
	NWorkOK         = "work came back ok"
	NMemberUp       = "fleet member up"
	NMemberDown     = "fleet member down"
	NUnknownMachine = "an unknown machine is beating"
	NStagingRefused = "a member refused a card at staging"    // dealt to another member
	NRestWithdrawn  = "a card withdrawn from a resting route" // dealt again on one that serves
	NFriendReturned = "a friend's card returned to ready"     // by friend reconcile: no report, and her queue says done or does not hold it
	// The landing refused a card's head (it does not merge on the base's tip, or fails the tree
	// gate the base passes): the card was reworked at the tip and its stream landed on
	// (landRefused, redo.go). Addressed to the coordinator; nothing to answer.
	NLandRefused = "the landing refused a card's head: reworked at the tip"
	// The coordinator held a fleet member, a reader, a friend or a stream, or released
	// its hold (hold, unhold: hold.go), the reason in the note.
	NHeld   = "held by the coordinator"
	NUnheld = "released from a hold"

	// The tick's own failure, noted once for each distinct error text it
	// keeps failing with, and its recovery, noted once with the count of
	// failed ticks (docs/SPEC-SPRINT.md section 14): both are happened notes
	// addressed to the coordinator, so the tick end wakes it.
	NTickFailed    = "the tick failed"
	NTickRecovered = "the tick recovered"

	// Computed by inbox from the machine's record, as the stale line is: no
	// notification holds them.
	NMachineSilent  = "the machine is not ticking"
	NTickFailing    = "the tick keeps failing"
	NStoppedWithDue = "the machine is STOPPED and moves are due"
	NWithdrawn      = "cards returned to ready because no member is up"
	NCIGreen        = "ci green"
	NAbandoned      = "an operation was abandoned"
	NSentinelLanded = "sentinel landed" // released by the coordinator

	// The coordinator's seat moved (docs/SPEC-SPRINT.md, "Handing over the
	// seat"): given by its holder or the owner, or taken with the owner's name,
	// which is addressed to the holder it was taken from.
	NSeat           = "seat"
	NFriendNotWoken = "a friend was not told of her card" // friend sync delivered it, and the bus message to her failed
	NSeatTaken      = "seat TAKEN"

	NReadyToAccept   = "ready to accept"    // the readers it needs said ok at its head (ReadsNeeded)
	NReturned        = "returned to review" // sent back from merging: the coordinator decides again
	NWorkFailed      = "work came back failed"
	NBriefDefect     = "a brief defect" // a HOLD naming the brief: re-cut it (brief_defect.go)
	NReadBroken      = "a reader found it broken"
	NBriefWrong      = "a card has reached its bound: the brief is wrong, not the worker" // brief_bound.go
	NReadReturned    = "a reader returned a read"                                         // no verdict, not a read: asked again
	NConflict        = "stream stopped: conflict on a card"
	NRed             = "stream stopped: stream branch red"
	NCross           = "stream stopped: needs a card of another stream first"
	NRejected        = "stream stopped: the merge queue rejected"
	NBaseRed         = "stream stopped: the base fails its tree gate" // the base-gate rule's third failure (rules.go)
	NMissingBase     = "the base branch is gone"                      // a land whose base branch is missing (rebase.go)
	NBlocked         = "a primary is blocked on something dropped"
	NMissingNeed     = "a primary is blocked on something missing"
	NCIRed           = "ci red"
	NReadsExhausted  = "reads exhausted"
	NStranded        = "stranded in review" // failed work acknowledged, or never asked, and nothing open
	NRepairSkipped   = "repair skipped changes the store refused as recorded"
	NOpStuck         = "an operation was stuck"
	NOverdue         = "a judgment notification has waited past its deadline"
	NStreamStale     = "a stream has not changed state or count past its deadline"
	NSprintDone      = "the sprint is done"
	NSentinelReached = "sentinel reached" // a stop: the coordinator decides before going on
	NRepeatSuffix    = "; a second time for the same cause"
)

Notification types. A type is what happened; judgment types name the decisions open to the coordinator.

View Source
const (
	TimeoutStaging  = "stage-timeout"
	TimeoutDeadline = "deadline"
	TimeoutUsage    = "usage source"
)

The timeout kinds a member's finish reports (member.Judge): a launch refused at staging on the stage's own timeout, a child its deadline ended, and a child the budget rule ended because the usage source stopped answering within its bound.

View Source
const (
	FieldBriefOp     = "brief_op"
	FieldBriefRecord = "brief_record"
)

FieldBriefOp and FieldBriefRecord are the card's brief decision (internal/decide, docs/SPEC-NOVA-DECIDE.md section 14): the op id add asked it under and the record that holds it, written when add asked one, so land and drop attach the card's end to that decision by its exact id; both absent when none was asked.

View Source
const (
	FieldReadBranch     = "read_branch"
	FieldReadBranchHead = "read_branch_head"
)

FieldReadBranch and FieldReadBranchHead are a primary's record of the branch origin holds its attempt's head on, when a read named one origin does not hold (ReadReq.Missing): the server found the work's branch with that head, and every read of that head names it from then on.

View Source
const (
	PropTwinBriefs = "twin_briefs"
	EnvTwinBriefs  = "NOVA_SPRINT_JOBS"
)

PropTwinBriefs (the work table's property) and EnvTwinBriefs (the machine's environment) name the directory the paths rule writes a twin's brief under, one directory a card (its job directory); the property over the environment, and with neither <home>/nova-sprint/jobs.

View Source
const (
	ActTwin    = "replace by its widened twin" // no proposed file is shared
	ActTwinCmd = "left with its twin command"  // a proposed file is shared: a mind's, the command printed

)

The paths rule's acts.

View Source
const (
	// BeatDeadline is how long a beat is fresh, and so the length of one beat
	// window: a window with no beat after the last is one missed beat.
	BeatDeadline = 15 * time.Second
	// MissedBeatsDown is how many beat windows in a row a member misses before
	// it is down: one missed beat is a store round trip that timed out or a
	// slow machine, and marking a working member down on it withdrew its card
	// and lost the child's finish (the member's beat is one store call of
	// several seconds on a tailnet); three in a row is a member that is gone.
	// A beat between misses resets the count: it is derived from the last
	// beat, never stored.
	MissedBeatsDown = 3
	// LoadWindow is the span of beats whose highest load the load cell shows.
	LoadWindow = 10 * time.Second
	// FriendBeatEvery is how often a friend's daemon beats (friend beat). The
	// beat is recorded and shown (her report, her load, its age), and it never
	// makes her up: it proves a daemon, not a session (FriendStatus).
	FriendBeatEvery = time.Second
	// FriendProofLive is how old the session proof her beat carries may be while she is
	// up (docs/SPEC-FRIEND.md, The push proof): her daemon asks the session eight
	// minutes after its last ask and waits up to five for the answer (nova-friend's
	// ProveEvery and SessionBound), so a session that answers is never proved longer
	// ago than thirteen minutes, inside this window. The owner, 2026-10-05: "nova-bus is useless if the friend using it
	// is deaf and is not listening to messages sent back."
	FriendProofLive = 15 * time.Minute
	// FriendPongWindow is how long a wake ping her session answered keeps her
	// up, and FriendFinishWindow how long a card of hers finished (working to
	// done) does (docs/SPEC-FRIEND.md, "Presence is her session's evidence").
	// The owner, 2026-10-05 ~9:30 AM ET: "there is no value in things that are
	// answered just by the daemon"; a friend is up only when her session
	// answered a wake ping within ten minutes or she finished a card within
	// thirty. On 2026-10-04 friends read up for hours on beats sent for them
	// while their sessions took no turn.
	FriendPongWindow   = 10 * time.Minute
	FriendFinishWindow = 30 * time.Minute
)
View Source
const (
	PriorityBlocker  = "blocker"
	PriorityCritical = "critical"
	PriorityFix      = "fix"
	PriorityHigh     = "high"
	PriorityReader   = "reader"
	PriorityNormal   = "normal"
	PriorityLow      = "low"
)

The priority ladder, highest first.

View Source
const (
	PropPromotedAt  = "promoted_at"
	PropPromotedSha = "promoted_sha"
)

The work table's properties of the last promotion: when, and the merge sha.

View Source
const (
	// FieldLandProtected is a stream's control card's field: the repositories, comma
	// separated, whose protected branches the stream is marked to land on, or
	// LandProtectedAny for every repository; written by `stream set --land-protected`.
	FieldLandProtected = "land_protected"
	// LandProtectedAny marks a stream for the protected branches of every repository,
	// a card naming no repository among them.
	LandProtectedAny = "any"
)

The protected branches (docs/SPEC-SPRINT.md section 7): the lander never lands on a protected branch of a repository unless the card's stream is marked for that repository: a card cut on dev lands straight onto it and ejects the merge queue's promotion run, so a stream lands on its sprint branch and promotion is the marked stream.

View Source
const (
	NProviderFunds = "a provider is out of funds"
	NProviderLow   = "a provider is low on funds"
	NProviderKey   = "a provider refuses its key"
)

The provider's judgments, one per provider while its routes rest for the cause, subject ProviderSubject(provider).

View Source
const (
	PushProofEvery  = 10 * time.Minute
	PushAnswerBound = 5 * time.Minute
	PushProofLive   = PushProofEvery + PushAnswerBound
	PushRetry       = time.Minute // how soon a failed delivery is tried again
)

PushProofEvery is how often the push loop proves the seat again by the same round trip; PushAnswerBound is how long a check waits for its pong before the loop asks again; PushProofLive is how long a pong stands for the seat.

View Source
const (
	// RateWindow is the running time the rate is measured over: the last hour,
	// the window of the dashboard's throughput tile, so the two agree.
	RateWindow = time.Hour
	// RateFloor is the fewest landings in the window the rate is taken from;
	// with fewer, it is the whole sprint's average.
	RateFloor = 5
)

The landing rate the ETA is measured at (docs/SPEC-SPRINT.md section 1).

View Source
const (
	RetiredByLate     = "late"
	RetiredByPrimary  = "primary"
	RetiredByReturned = "returned"
	// RetiredByAway is a read card the machine took back off a reader down, away or held,
	// or off a resting route (RetiredByRest): it spends nothing of the reader's.
	RetiredByAway = "away"
	RetiredByRest = "rest"
	// RetiredByCards is a readers-table read asked and not begun, taken back when read cards
	// came on: dealt again as a read card.
	RetiredByCards = "read cards"
	// RetiredByUnstarted is a read card left in ready past the deal bound: the machine's
	// take-back, spending nothing.
	RetiredByUnstarted = "unstarted"
)

The retired_by of a read card the read-card ask takes back: past its deadline, or its primary no longer in review at the card's attempt (reworked, its brief replaced, dropped, accepted); RetiredByReturned is a read handed back with no verdict (read --return).

View Source
const (
	// ReaderUp, ReaderAway and ReaderDown are a reader's states.
	ReaderUp   = "up"
	ReaderAway = "away"
	ReaderDown = "down"
	// ReaderRetired is a reader the coordinator retired (reader retire): held
	// away for good, its beat writing none and its queue answering reader false,
	// its row and read cards kept, the history (the comfort list of 2026-10-03,
	// item 6); reader up brings it back.
	ReaderRetired = "retired"
	// ReaderHeld is a reader the coordinator holds (hold <reader>, hold.go): asked
	// nothing, its reads asked and not begun asked of another, its reads begun
	// finishing unless the hold took them back (--return).
	ReaderHeld = Held

	// ReaderBeatBound is how long a reader stays up after its last beat: the
	// fleet's bound (BeatDeadline), named once so a reader's can be told apart.
	ReaderBeatBound = BeatDeadline
)
View Source
const (
	// RetiredByRefused is the retired_by of a read its reader refused to launch.
	RetiredByRefused = "refused"
	// FieldRefused is why the reader refused it, as its return said.
	FieldRefused = "refused_why"
)

A read refused (docs/SPEC-SPRINT.md section 6, a read refused is not a read): a read its reader hands back because it could not launch it (cardhdr.EndLaunch: no route, a slot it cannot make) never ran, so it is no read, no re-ask and no mark against its reader. The return retires it off that reader (RetiredByRefused, the reason in FieldRefused) and the ask asks the read of another reader of its tier; the reader that refused may be asked it once more at the attempt (ReadCardForAsk's second identity), as a reader taken back away may. When no reader is left free at the attempt and one refused it for no route (refusedNoRoute), the tier's one judgment says so (NNoRoute, TickDeal) and the card stays in review: the readers stay up and are asked their next reads. On 2026-10-06 every fleet reader was asked heavy reads it had no route for, each return was counted toward the re-ask bound as a read, and the readers were spent at the attempt.

View Source
const (
	FieldReasked  = "reasked"
	MaxReadReasks = 2
)

FieldReasked is how many times a read card's reader returned it and it went back to asked on the reader's row, counted by Read itself at each return, so the bound holds whatever the tick does and however many readers are up (the ask need not run for the count to move); MaxReadReasks is the most: the return after them retires the card, counted as a read (tla/DirtyTick.tla, MaxReasks and ReasksBounded).

View Source
const (
	CoordinatorReaderPrefix = "coordinator:"
	HeavyKind               = "heavy"

	FieldHeavyReader    = "heavy_reader"
	FieldHeavyKind      = "heavy_kind"
	FieldHeavyVerdict   = "heavy_verdict"
	FieldHeavyEvidence  = "heavy_evidence"
	FieldHeavySHA       = "heavy_evidence_sha256"
	FieldHeavyReason    = "heavy_reason"
	FieldHeavyAttempt   = "heavy_attempt"
	FieldHeavyHead      = "heavy_head"
	FieldHeavyAt        = "heavy_at"
	FieldHeavyOverrules = "heavy_overrules"
)

The coordinator's heavy read (docs/SPEC-SPRINT.md section 6, accept-heavy-verdict-b.w1): accept --heavy records the coordinator's own read of the primary's attempt and head on the primary, under coordinator:<actor>, with the evidence file it read and that file's sha256, and it counts as one ok read toward the card's read rule (ReadsNeeded). It is never a reader's read: no read card is written for it, no reader row names it, and the readers field names the readers' oks alone. A reader's broken read at the same attempt stays as the reader left it, named on the primary as overruled.

View Source
const (
	ReaderSpendCol     = "spend"
	ReaderSpendHourCol = "spend_1h"
	ReaderPerReadCol   = "per_read"
	ReaderPricedCol    = "reads_priced"
)

The readers table's spend columns, as the where view is to show them: what its reads cost all time and in the last hour, dollars and cents rounded up ("-" when none of its reads was priced), what a priced read cost on average, and how many of its reads were priced.

View Source
const (
	BackupNone   = "none"
	BackupReads  = "reads"
	BackupMerges = "merges"
)

The backup states (Backup): reads when review exceeds working, merges when merging exceeds review and working together (it names the further bottleneck when both hold), none else.

View Source
const (
	MaxReadsWindowLines = 200
	ReadsWindowSpan     = 30 * time.Minute
	ReadsWindowMin      = 10
	ReaderWindowLen     = 20
	ReaderBreaksBar     = 0.8
	ReaderOtherBar      = 0.5
	ReaderOtherMin      = 5
	FindingClassLen     = 60
)

The bounds of the ledger and of the two notices.

View Source
const (
	NBrokenReadsOutrun = "broken reads outrun ok reads"
	NReaderBreaks      = "a reader breaks nearly everything"
)

The tick's two judgments.

View Source
const (
	FieldReturnedByDev     = "returned_by_dev"
	FieldReturnedByDevTier = "returned_by_dev_tier"
	FieldReturnedByDevSha  = "returned_by_dev_sha"
)

A landed primary's record of being returned by dev or an audit (Promoted, `promoted --returned <ids>`): when, the tier its reads ran on then, and the promotion's sha.

View Source
const (
	CheckCardsSettled     = "cards-settled"
	CheckBaseGateGreen    = "base-gate-green"
	CheckTwoOKReads       = "two-ok-reads"
	CheckProseTrue        = "prose-true"
	CheckLandingsPromoted = "landings-promoted"
	CheckNoOpenJudgment   = "no-open-judgment"
)

The six check names, in registry order.

View Source
const (
	RouteFile = "file"
	RouteBus  = "bus"
)

Route kinds.

View Source
const (
	// PropDealIndex is the fleet table's property: the deal's counter, a
	// decimal uint64 (round).
	PropDealIndex = "deal_index"
	// PropAskIndex is the readers table's property: the ask's counter round
	// the readers, a decimal uint64 (round).
	PropAskIndex = "ask_index"
	// PropStreamIndex is the work table's property of the deal: its counter
	// round the streams, moved past the stream of each primary dealt
	// (streamTurns). PropAskStreamIndex (the readers table's: the ask is the
	// readers' update) and
	// PropAcceptStreamIndex are the ask's and the accept's: each step that
	// takes cards across the streams keeps its own, so that one step's move
	// never resets another's rotation (a shared index moved by an ask of one
	// stream's card sends the next deal back to the stream after it, every
	// tick, and a third stream waits).
	PropStreamIndex       = "stream_index"
	PropAskStreamIndex    = "stream_index_ask"
	PropAcceptStreamIndex = "stream_index_accept"
)

The deal goes round the fleet and the ask goes round the readers: each keeps a rolling index into its names, in name order, modulo their number, that moves on with every card dealt (every read asked) past the name it went to. A deal scans the members from the index, wrapping, and takes the first that is up and has room for the card (a member down or full is skipped, and the index moves past the member dealt to, so a skipped member's turn is not given to its neighbour twice); an ask scans the readers from the index and takes the first that has no read card at the attempt and is not already chosen. So with every member idle consecutive deals go m1, m2, ..., mN, m1, ..., and over a run every member's done is within a few of the others; the shortest queue with its ties broken by name, which this replaces, gives every card of an idle fleet to the first members in name order and the tail of the fleet none.

Every placement of a card on a member goes through the deal's index and moves it, first attempts and redeals and levelling alike: the deal (R6, T3) and the withdrawn card dealt again, the rework of failed or broken work (R10, the coordinator's rework), the cards of a member that goes down (R2, fleet down and the tick's presence) and the levelling (R7, T4, fleet up and level). A rework skips the member of the attempt it sends back while another up member has room. The model is tla/SprintEvents.tla: RoundOne from dcur in PlanDeal, PlanDown, PlanRework and PlanLate, and dcur moved by each of their effects; the reference model's PlaceOn, ReworkChoice and levelRound.

The index is a property of the fleet table (the deal's, deal_index) and of the readers table (the ask's, ask_index), the owner's ruling ("a property of the reader table and the fleet table respectively; not a property of the work stream"): the index's counter (round), read with the table and written by the step that deals (asks) in the same atomic batch as its cards, guarded on the value the step read (Plan.Props; the table layer's properties). So it is atomic with the deal and survives a stop and a start of the machine and a new loop, and a clear starts the next epoch at counter 0, the first name. The model is tla/SprintEvents.tla: dcur and acur, moved by the deal's and the ask's effects, and PlanDeal's and PlanAsk's choice from them (RoundAssign, RoundTwo).

View Source
const (
	FieldRoute    = "route"
	FieldModel    = "model"
	FieldTokens   = "tokens"
	FieldUSD      = "usd"
	FieldHarness  = "harness"
	FieldDeadline = "deadline"
	FieldRoutes   = "routes"
	FieldUsage    = "usage"
	RoutePin      = "pin"
	// FieldTier is the primary's tier when the coordinator pinned it to one (rework
	// --tier): every later deal and read of the card draws from it, over its brief's
	// line 1, and the machine never escalates it (cardTier, NextTier); on a work or read
	// card, the tier its route was drawn from, which its packet hands the child or reader,
	// its JOB.md names and its cost record keeps.
	FieldTier = "tier"
	// FieldTierNow is the tier the primary is on, written by every deal on a route:
	// flash first on every card, then the tier the machine escalated it to (NextTier);
	// the tier its brief's line 1 names is its ceiling. Add writes pro on a card whose
	// gate's measured wall is over the flash bound (gate_wall.go).
	FieldTierNow = "tier_now"
)

The work card's route fields, written at each deal and redeal: the route taken (or RoutePin), the model id the member launches (provider/model), its budget and its deadline in seconds; the primary's FieldRoutes is every route taken for it, in order, the exclusion's history.

View Source
const (
	NRouteWoken               = "a route serves again: the coordinator woke it"
	NRouteRestedByCoordinator = "a route rested: the coordinator rested it"
)

NRouteWoken is the happened note of a rest the coordinator ended (routes wake), and NRouteRestedByCoordinator of one the coordinator began (routes rest).

View Source
const (
	RouteRestWindow = 10
	RouteRestAfter  = 3
	RouteRestFor    = 30 * time.Minute
)

A ROUTE RESTS ONLY ON A PROVIDER-TYPED FAILURE OR A COORDINATOR ACTION (the owner, 2026-10-10, through the seat: "this sounds like something the machine should not do. it should raise it to you as a thing to do, but not do it automatically."; tla/RouteRest.tla).

The tick counts the ended takes of each route over a sliding window, the last RouteRestWindow takes on it that ended after its last rest began, and when RouteRestAfter of them ended with a TRANSIENT provider failure (the provider's own line, class rate-limited, provider-5xx or timeout: a 429, a 5xx, the provider not answering) it rests the route for RouteRestFor (cause RestProvider): the rest is one line in the fleet table's property rule3_rest_<provider>, one property per provider however many of its routes rest, written in the deal's batch with a happened note to the coordinator naming the cards; the deal draws no work card (a first deal, a redeal or a rework's) on a resting route, and the rest ends by itself at its time. A take that ended with NO RESULT is the model's output on that card, never the provider's: it counts against the card's attempt and the route's ok%, and it never rests the route (rule 3 of 2026-10-02 rested on three of them; that rule is retired, and a rest it wrote holds no route: Retired). The rest is the sprint's, never config: nova-config's enabled stays the coordinator's.

View Source
const (
	NRouteRested    = "a route rested: its provider failed its takes"
	NProviderRested = "a provider rested: its funds or its key"
)

NRouteRested is the happened note of a rest the tick wrote, to the coordinator, and NProviderRested the note of a provider's (provider_funds.go).

View Source
const (
	RestProvider    = "provider"
	RestCredit      = "out-of-credit"
	RestAuth        = "auth"
	RestCoordinator = "coordinator"
	RestNoResult    = "no-result"
	RestBalance     = "balance"
)

The causes of a rest: a route's transient provider failures (RestProvider: rate limit, 5xx, timeout); a provider out of credit (a take it refused for want of credit); a take it refused for its key; and the coordinator's word (RestCoordinator, routes rest). Only out of credit counts toward stopping the sprint. RestNoResult (rule 3's, retired) and RestBalance (a balance poll's, retired: a low balance is a judgment, never a rest) are read only to say a rest written before is Retired.

View Source
const (
	RuleBaseGate    = "base-gate"    // the lander's base tree gate, retried before a stream stops, and its streams resumed when a land pass finds it green (landgo.go, land_base.go)
	RuleBound       = "bound"        // a card reached its bound: a new attempt a tier up, heavy to a friend
	RuleBriefDefect = "brief-defect" // the same finding twice: the card marked a brief defect, held
	RuleConflict    = "conflict"     // a head the lander refused (a file conflict, its PATHS, the tree gate): returned, redone on the tip at flash, resumed; the same refusal twice a brief defect
	RuleFailed      = "failed"       // work came back failed or with no result: redealt, then a tier up
	RuleFriendTake  = "friend-take"  // a friend's work card past its bound that she has not started: taken back, dealt again (judgment_rules.go)
	RuleHoldNeed    = "hold-need"    // failed work whose report HOLDs naming a card that has not landed: waits for it, reworked once it lands (judgment_rules.go)
	RuleLate        = "late"         // a work card past its deadline: a wait once with progress; returned and redealt only once its holder stamped and went silent
	RuleReadLate    = "read-late"    // a read past its deadline: taken back and asked of another reader, once an attempt (judgment_rules.go)
	// RulePaths: a failed attempt whose report proposes PATHS (PATHS-PROPOSED): its widened
	// twin, or one judgment with the twin's command when a proposed file is shared
	// (paths_proposed.go). Not in RuleNames: nova-config's answer_rules_off enum
	// (config.AnswerRules, held equal to RuleNames) does not name it yet, so only run
	// --answer-rules=false turns it off.
	RulePaths = "paths"
)

The rules, by name: the names nova-config's answer_rules_off takes (config.AnswerRules).

View Source
const (
	// FieldRuleAnswer is the last rule answer on a card: "<rule>: <what> at <time>".
	FieldRuleAnswer = "rule_answer"
	// FieldRuleTier and FieldRuleFails are the failed rule's count on the primary: the tier
	// it counts on and the attempts that came back failed there.
	FieldRuleTier  = "rule_tier"
	FieldRuleFails = "rule_fails"
	// FieldRuleRedo is the attempt the conflict rule returned to be redone on the tip.
	FieldRuleRedo = "rule_redo"
	// FieldRuleRefused and FieldRuleRefusal are the last refusal the conflict rule returned
	// the card on: its way (RefusalWay) and the lander's words. A second refusal of the same
	// way is a brief defect.
	FieldRuleRefused = "rule_refused"
	FieldRuleRefusal = "rule_refusal"
	// FieldRuleWaited is the work card's generation the late rule waited on, once.
	FieldRuleWaited = "rule_waited"
	// FieldBriefDefect is the stamp the brief-defect rule marked the primary with.
	FieldBriefDefect = "brief_defect"
	// FieldProgress is a work card's last progress: the server's time of its holder's last
	// `progress` verb (Progress), which the member and the friend daemon send every
	// ProgressEvery while the child or the turn prints. The late rule's sign that a late card
	// is moving; a stamp from before the card's take is another holder's and counts as none.
	FieldProgress = "progress"
	// FieldConflictKind and FieldConflictPaths are a conflict stop's facts on the stream's
	// control card, as the lander reported them (MergeReq).
	FieldConflictKind  = "conflict_kind"
	FieldConflictPaths = "conflict_paths"
)

The fields the rules write.

View Source
const (
	// RuleAttemptCap is the attempts a card's work may come back failed on one tier before
	// the failed rule raises it a tier: the first is redealt on the next route, the second
	// goes up (cost rule 2: escalate on the second failure, not the third).
	RuleAttemptCap = 2
	// RuleProgressWindow is how recent a late card's progress is to count.
	RuleProgressWindow = 10 * time.Minute
	// ProgressEvery is how often a holder whose child or turn prints stamps progress on its
	// card: inside RuleProgressWindow with room for a stamp that is late or lost.
	ProgressEvery = 3 * time.Minute
	// RuleLateWait is the late rule's one wait.
	RuleLateWait = 30 * time.Minute
	// RuleSameFailureCards is how many cards failing the same way (their failure's class)
	// make the failure the fleet's, not the card's: the failed and bound rules leave each to a
	// mind rather than climb the ladder with every card (sameFailure).
	RuleSameFailureCards = 3
)

The rules' numbers.

View Source
const (
	RefusedConflict = "conflict" // the head does not merge: a file no ledger owns conflicts
	RefusedPaths    = "paths"    // the lander's checks: it changes files outside its PATHS (E12)
	RefusedChecks   = "checks"   // the lander's other checks: a stranded fragment (E4)
	RefusedGate     = "gate"     // the merged tree fails the tree gate
)

The ways a head is refused at its landing, as the lander says them (cmd/nova-sprint, land.go and landgo.go: mergeHead, checkCard, gateCard): the conflict rule's "the same way" (RefusalWay).

View Source
const (
	ActRework = "rework"                    // the next attempt, on the next route of its tier
	ActUp     = "rework on a tier up"       // the next attempt, pinned a tier up
	ActFriend = "rework as a friend's card" // the next attempt, a friend's (above heavy)
	ActWait   = "wait 30m"                  // the late card made progress: held once
	ActHold   = "hold"                      // the late card's holder has not had its own deadline yet, or never stamped progress
	ActRedeal = "return and redeal"         // the late card withdrawn, dealt again
	ActReturn = "return"                    // the conflict card back to review
	ActResume = "resume"                    // the stream again, its conflict card out
	ActMark   = "mark brief defect"         // the card marked, the judgment kept
	ActTake   = "take back and deal again"  // the friend's card she has not started withdrawn from her row, dealt to another
	ActAsk    = "ask another reader"        // the late read taken back, asked of another reader
	ActNeed   = "wait for the card"         // the HOLD's card has not landed: the judgment waits on it
	ActLeft   = "left"                      // the judgment needs a mind
	ActOff    = "off"                       // its rule is turned off
)

The acts of a rule answer.

View Source
const (
	PartRulePaths  = "rule paths"
	PartRuleReturn = "rule return"
	PartRuleResume = "rule resume"
	PartRuleRework = "rule rework"
	PartRuleLate   = "rule late"
	PartRuleBrief  = "rule brief"
)

The tick's rule parts, in the order they run: the conflict's return, its resume, a twin (read-broken, rules_read.go), every rework (failed, bound, read-broken, hold-need, the conflict's redo), the late cards, the friends' cards taken back, a late read asked of another reader, the HOLDs waiting on a card, the brief defects (judgment_rules.go). Each is a step of its own on a fresh read, so the conflict's three moves can all be made in one tick. With TickReq.AnswerRules false each is empty.

View Source
const (
	Work    = "work"
	Readers = "readers"
	Merge   = "merge"
	Fleet   = "fleet"
)

The four tables, by their logical names. A deployment prefixes each (Names).

View Source
const (
	Asked   = "asked"
	Reading = "reading"
	OK      = "ok"
	Broken  = "broken"
)

Readers table columns.

View Source
const (
	Queued   = "queued"
	Merged   = "merged"
	Stuck    = "stuck"
	CI       = "ci"
	StateCol = "state"
	// Cost is the work table's last column: a stream's cell is the sum
	// of its landed cards' totals, kept on the stream's control card (FieldCost) and
	// mirrored as the row's text; the footer is the sum over the streams.
	Cost     = "cost"
	Since    = "since"
	Returned = "returned"
	Ctl      = "ctl"
)

Merge table columns. since (hidden) is when the stream's state last changed, for the machine. returned (hidden) holds a primary sent back from merging, so that accepting it again moves it rather than creating it: the table layer never places a removed member again. ctl (hidden) holds the stream's control card, whose fields are the stream's state.

View Source
const (
	Done       = "done"
	OkPct      = "okpct"
	DoneOK     = "ok"
	DoneFailed = "failed"
	// DoneDefect (hidden) holds a member's work cards that ended on a brief defect
	// (brief_defect.go): in neither done nor ok%, so a brief no worker could do is never
	// the worker's failure.
	DoneDefect = "defect"
	Status     = "status"
	Active     = "active" // friends.active: how long ago her session last wrote a file
	Tokens     = "tokens" // friends.tokens: her cards' usage summed, compact or in dollars
	Load       = "load"
	Withdrawn  = "withdrawn"
)

Fleet table columns (ready and working are named as in the work table). withdrawn (hidden) holds a work card withdrawn because no member was up, so that the tick deals the same card again rather than cutting another: the table layer never places a removed member again. ok and failed (hidden) hold the member's finished work cards, finished ok and finished failed, and defect (hidden) those that ended on a brief defect, counted in neither. done and ok% are the table's own formulas over the ok and failed cells, computed at render and never written: done is sum(ok+failed), ok% (the column okpct) is pct(ok/ok+failed), and the footer pools ok% over the members. ctl (hidden) holds the member's control card: its status and its width (width.go), which the width column shows beside working.

View Source
const (
	StreamWaiting = "waiting"
	StreamMerging = "merging"
	StreamStopped = "stopped"
	StreamLanded  = "landed"
)

Stream states (the merge table's state column).

View Source
const (
	Up   = "up"
	Down = "down"
)

Member status.

View Source
const (
	SeatCheckServer    = "server"
	SeatCheckStore     = "store"
	SeatCheckLoop      = "loop"
	SeatCheckFleet     = "fleet"
	SeatCheckFriends   = "friends"
	SeatCheckReaders   = "readers"
	SeatCheckDashboard = "dashboard"
	SeatCheckBus       = "bus"
	SeatCheckInbox     = "inbox"
	SeatCheckQueue     = "queue"
	SeatCheckVersions  = "versions"
	SeatCheckPush      = "push"
)

The check names in order of output.

View Source
const (
	// PropDealtMax is the work table's property: the dealt bound, a duration.
	PropDealtMax = "dealt_max"
	// PropFriendIdle is the work table's property: how long a friend holding cards may
	// show no session activity before it is an alarm, a duration.
	PropFriendIdle = "friend_idle"
	// PropFriendStallAfter is the work table's property: how long a friend holding cards
	// may show neither session activity nor card progress before she is stalled, a duration.
	PropFriendStallAfter = "friend_stall_after"
	// PropFriendStallStep is the work table's property: the duration of each rung of
	// the friend stall ladder.
	PropFriendStallStep = "friend_stall_step"
	// PropReadTier is the work table's property: the sprint's read tier.
	PropReadTier = "read_tier"
	// FieldReadTier is a stream's control card's field: the stream's read tier,
	// over the sprint's.
	FieldReadTier = "read_tier"
	// FieldRelease is a stream's control card's field: the release the stream
	// belongs to (e.g. "v1.2.0"), set by stream set --release (docs/SPEC-SPRINT.md section 11).
	FieldRelease = "release"
	// FieldProse is a stream's control card's field: the globs (PATHS globs, comma
	// separated) of the files whose backquotes are their own, which the lander does not
	// read for a code span (land_repair.go); set by stream set --prose.
	FieldProse = "prose"
	// PropFleet and PropFriends are the work table's properties: the switches of the
	// fleet's work and the friends' work (the owner, 2026-10-06: "We should be able to
	// enable/disable fleet, enable/disable friends. default enabled."), SwitchOn or
	// SwitchOff, on when absent. Off, the deal hands that side no work card; reads flow.
	PropFleet   = "fleet"
	PropFriends = "friends"
	// SwitchOn and SwitchOff are a switch's words.
	SwitchOn  = "on"
	SwitchOff = "off"
	// PropFleetTiers and PropFriendsTiers are the work table's properties: the tiers each
	// side may take (the owner, 2026-10-06: "a setting for friends, what tiers they may
	// take, default to all. Same setting for the fleet."), comma joined in the ladder's
	// order, or TiersAll, all when absent. The deal hands a side only cards whose tier is
	// in its set, on top of each row's own tiers, work cards and read cards alike; a card
	// pinned to a model is no exception (the set is the owner's switch), and a frontier card
	// waits for the coordinator whatever the sets.
	PropFleetTiers   = "fleet_tiers"
	PropFriendsTiers = "friends_tiers"
	// PropReadsNeeded is the work table's property: how many readers' ok reads at its
	// head every card in review needs, whatever its tier (nova-sprint set --reads): "0",
	// "1" or "2"; absent or default, each card's own rule (ReadsNeeded). 0 asks no read:
	// a primary whose work finished LAND at its head is accepted on its own work.
	PropReadsNeeded = "reads_needed"
	// PropReworkPriority controls priority on the next attempt: fix (default), high or keep.
	PropReworkPriority = "rework_priority"
	ReworkKeep         = "keep"
	// TiersAll is the word of a side that may take every tier, the default.
	TiersAll = "all"
	// ReadTierDefault is the word that takes a read tier off: a stream's back to
	// the sprint's, the sprint's back to each card's own tier.
	ReadTierDefault = "default"
)

The sprint's settings, the coordinator's (`set`, `stream set`; nova-tools#5096 items 22 and 27): the dealt bound, how long a work card may wait dealt and never taken before it is a judgment, and the read tier, the tier a primary's reads draw their route from when it is stronger than the card's own. The sprint's are the work table's properties, the stream's a field of its control card; a clear starts the next epoch with neither, as it starts every property.

View Source
const (
	TidyFriends = "friends"
	TidyFleet   = "fleet"
	TidyRoutes  = "routes"
	TidyStreams = "streams"
)

The kinds a tidy names (--friends, --fleet, --routes, --streams; --all is the four).

View Source
const (
	FieldBaseGateRefused = "base_gate_refused"
	FieldBaseGateBase    = "base_gate_base"
	FieldBaseGateFirst   = "base_gate_first"
)

The base-gate count on a stream's control card (docs/SPEC-SPRINT.md section 8, land-base-gate-stops-stream): how many landings in a row were refused on the base's tree gate, the base they were refused on, and when the first was. A pass that merges, any other stop, a stop on the base and a resume clear it.

View Source
const (
	FieldDeadBase = "dead_base"
	FieldBaseSet  = "base_set"
)

FieldDeadBase is the base a merging card names that the lander found not on origin, on the primary; FieldBaseSet is the last re-point of its BASE (CardBase): old -> new, when, by whom.

View Source
const (
	FieldDecideBounce = "decide_bounce"
	FieldDecideReview = "decide_review"
)

A decide read's fields on its read card: the sprint row's two bars on p(defect) it is routed by (docs/SPEC-SPRINT.md section 6, the decide read; internal/decide, Bars).

View Source
const (
	FieldDecideGateFlaky       = "decide_gate_flaky"
	FieldDecideGatePreexisting = "decide_gate_preexisting"
)

A work card's gate decision fields: the sprint row's two bars on a failed gate's decisions (docs/SPEC-SPRINT.md section 5, the gate verdict; internal/decide, GateBars).

View Source
const (
	PropIdentical    = "identical"
	FieldIdentical   = "identical"
	IdenticalDefault = 2
)

PropIdentical is the work table's property holding the sprint's identical-finding bound, FieldIdentical a stream's control card field holding the stream's, over the sprint's; IdenticalDefault is the bound when neither is set. A value under 2 is no setting: one finding is never a repeat.

View Source
const (
	FieldLandedP     = "landed_p"     // the top class's p, three places
	FieldLandedClass = "landed_class" // the top class
	FieldLandedOp    = "landed_op"    // the score decision's id in the lander's record
)

The landed score's fields on a landed card.

View Source
const (
	DeadlineUnfinished = 2 * time.Hour    // a work card taken and not finished (a card dealt and never taken: the dealt bound, settings.go)
	DeadlineUnbegun    = 30 * time.Minute // a read card asked and not begun
	DeadlineUnreported = 2 * time.Hour    // a read card begun and not reported
	DeadlineMergeIdle  = 30 * time.Minute // a stream with cards to merge and no merge step
	// DeadlineJudgment is how long a judgment stays open, in running time,
	// before the tick marks it overdue; a review time the coordinator set
	// (wait) is the judgment's own due time instead.
	DeadlineJudgment = 10 * time.Minute
)

Deadlines, each against running time: time the machine was STOPPED does not count.

View Source
const (
	FieldProviderError = "provider_error"
	FieldProviderTake  = "provider_take_" // + the take's number, redeals + 1 when it ended
)

A take the provider failed ends like any take that ended without a finish: the card is withdrawn with FieldTakeEnded and dealt again, never judged as failed work (docs/SPEC-SPRINT.md, the work card's redeals; tla/CardContract.tla, ProviderFailure; tla/DirtyTick.tla, RedealsAreEndedTakes). The work card keeps the last failure's line (FieldProviderError, for the bound's judgment, cleared when it is dealt again) and a record of every take the provider failed (FieldProviderTake, ProviderTake: the record of that take, which `card` prints and the route stats count).

View Source
const (
	NResumed    = "stream resumed: the card it needed landed"
	NCannotAsk  = "cannot ask"
	NNoMember   = "no fleet member is up"
	NInvariant  = "an invariant is broken"
	NWorkLate   = "a work card is past its deadline"
	NReadLate   = "a read card is past its deadline"
	NMergeLate  = "a stream has had no merge step past its deadline"
	NBound      = "a card reached its bound"
	NStarving   = "the fleet is starving"  // ready under twice the width while a wave is held (heldWave)
	NOverloaded = "a member is overloaded" // three timeouts within the window (overload.go)

	NMachineStarted = "the machine started"
	NMachineStopped = "the machine stopped"
)

The tick's own notification types.

View Source
const (
	PartLevel      = "level"
	PartLevelReads = "level reads"
)

PartLevel and PartLevelReads are the tick start's parts: the fleet's and the readers' rebalance.

View Source
const (
	DoneCause = "done"
	DoneHint  = "to continue: add work, then nova-sprint start"
)

DoneCause is the cause the machine's record carries when the done part stopped it, and DoneHint what the coordinator does to go on.

View Source
const (
	NStoppedAssignments        = "STOPPED with unresolved assignments"
	NStoppedAssignmentsCleared = "STOP assignment condition cleared"
)
View Source
const (
	// NStopMemberDown is a fleet machine down, or never beaten, or held adopting past
	// StopAdoptAfter, that the coordinator did not hold: its width idles.
	NStopMemberDown = "a fleet member is down and the coordinator did not hold it"
	// NStopPinWaits is a ready card hard-pinned to a friend who is not up: it, and every
	// card that needs it, waits for her alone.
	NStopPinWaits = "a card pinned to one friend waits while she is not up"
	// NFriendStalled is the stall ladder's third rung (friend_stall.go): two wakes
	// unanswered. Its own type, kept by the pass while her rung stands at 3 or above, so
	// the tick's check does not close it in the tick that raised it (as it did as NStalled,
	// whose findings never name a friend).
	NFriendStalled = "a friend stalled: two wakes unanswered"
)

The stop judgments of the coordinator's pass.

View Source
const (
	// StopMemberAfter is how long a member must have been down, in running time, before
	// the pass raises it: the status transitions' dwell, so a beat that lapses and comes
	// back raises nothing.
	StopMemberAfter = StatusDwell
	// StopAdoptAfter is how long a member may be held adopting (fleet_back.go) before the
	// hold is a stop: an adoption is a play of minutes.
	StopAdoptAfter = 15 * time.Minute
	// BehindEscalateEvery is the running time between two levels of the judgments late on
	// the coordinator: a new level is a new judgment, whatever quieted the one before.
	BehindEscalateEvery = 3 * PassEvery
)
View Source
const (
	StopKindMemberDown    = "member-down"
	StopKindMemberAdopt   = "member-adopting"
	StopKindPinWaits      = "pin-waits"
	StopKindFriendStalled = "friend-stalled"
	StopKindFriendDown    = "friend-stall-down"
	StopKindRouteRest     = "route-rest"
	StopKindProviderRest  = "provider-rest"
	StopKindStreamStopped = "stream-stopped"
)

The kinds of stop, as LiveStops names them.

View Source
const (
	// NStopsDigest is the digest of the automatic stops still holding.
	NStopsDigest = "automatic stops still hold"
	// NStopsDigestClock is the digest's clock: an acknowledgement, never a judgment.
	NStopsDigestClock = "the automatic stops' digest"
	// StopsDigestOldest is how many of the oldest stops the digest names.
	StopsDigestOldest = 5
)

The re-push of the stops is one digest (cold reader B, PR 5548: forty live stops were forty "still holds" lines every ten minutes). A stop's first raise is its own judgment, pushed; after it, every PassEvery of running time while any stop judgment has gone that long without a push, the pass writes one happened note to the coordinator, NStopsDigest: how many stops hold by kind, the StopsDigestOldest oldest with their undo verbs, and `nova-sprint doctor` for the full list. The clock is an acknowledgement, NStopsDigestClock, its At the last digest's, closed and written again with each digest (shown in no inbox, as the empty-row clock). A stop acknowledged, or waited to a review time not reached, is left out.

View Source
const (
	// StreamWorking is the control state of a stream reopened past its stop.
	StreamWorking = "working"
	// StreamClosed is what where and streams show for a landed stream that still
	// has a card open. The control card stays landed until the stream reopens.
	StreamClosed = "closed"
	// FieldPushedUnreported is the sha of a batch pushed and not reported, on the
	// work card and on the merge card (the merge card is written at once; a work
	// field waits for the pump while the machine runs).
	FieldPushedUnreported = "pushed_unreported"
	FieldPushedHead       = "pushed_head"
	FieldPushedAttempt    = "pushed_attempt"
)
View Source
const (
	PropDevSyncAt        = "dev_sync_at"
	PropDevSyncSha       = "dev_sync_sha"
	PropDevSyncBaseLacks = "dev_sync_base_lacks"
	PropDevSyncDevLacks  = "dev_sync_dev_lacks"
)

The merge table's properties of the dev sync: the last sync (when, and the base's sha after it) and the drift the last cycle measured.

View Source
const (
	UnitInstalled = units.UnitInstalled
	UnitMissing   = units.UnitMissing
	UnitDifferent = units.UnitDifferent
)
View Source
const (
	AdjTests    = "the same package's tests"
	AdjTestdata = "the same package's testdata"
	AdjLedger   = "a ledger"
	AdjDocs     = "docs a class test reads"
	AdjNamed    = "the HOLD names it with its reason"
)

What makes a file outside PATHS adjacent to the change (WidenAdjacent).

View Source
const (
	// FieldWidth is the control card's field, and the fleet table's column,
	// holding the member's width.
	FieldWidth = "width"
	// DefaultWidth is the width of a member whose control card names none.
	DefaultWidth = 64
	// MaxWidth is the widest a member may be: a width over it is refused
	// before anything is written.
	MaxWidth = 1024
	// TickMaxDeal is the most cards one deal moves (T3, R6). The deal is one
	// plan; the store's apply cuts it into parts under the table layer's
	// entry bounds, so the deal refuses nothing by size under this.
	TickMaxDeal = 2000
)

A member is a fleet machine, and its width is the machine's child cap: the most work cards it runs at once. It holds up to DealAhead times its width, ready and working together: its width working and as many again ready behind them, so the sprint feeds the fleet at width and keeps it working at that width until done. The width is a field of the member's control card, set by init --members <m>:<n> and by fleet up <m> --width <n>, and shown in the fleet table's width column. The deal fills every member up to DealAhead times its width in one step, round the fleet (T3, R6), and the level, once at the start of every tick, moves ready cards from a member that cannot start them to one with free lanes, never past DealAhead times its width (T4, R7). The model is tla/SprintEvents.tla: PlanDeal's room (its Cap), which counts the ready cards of a member; the room here counts ready and working.

View Source
const ActTwinWider = "twin with PATHS widened"

ActTwinWider is the read-broken rule's act on a finding outside PATHS: the card twinned with its PATHS widened.

View Source
const ActWiden = "widen PATHS in place"

ActWiden is the widen rule's act.

View Source
const AdapterFolder = "folder"

AdapterFolder is the adapter of a harness with no deliver command (Claude Code's, and every harness whose nova-friend adapter is passive): the push loop writes each check and each pushed message as one file into the target directory, and the session watches that directory with a Monitor (FolderWatch) and answers the check's file with seat pong (FolderProve).

View Source
const Adopting = "adopting"

Adopting is the status of a member back from down, held while it adopts the release the coordinator's machine runs.

View Source
const AttributionRefusal = "attribution is never a finding (docs/SPEC-SPRINT.md); read --ok, or name the defect in the work"

AttributionRefusal is the remedy a `read --broken` whose finding is only about attribution is refused with (docs/SPEC-SPRINT.md, reader-ignores-attribution).

View Source
const BalancePollEvery = 10 * time.Minute

BalancePollEvery is how often the run loop reads the providers' balances.

View Source
const CheckMergeQueueP90 = "merge-queue-p90"

CheckMergeQueueP90 is the merge queue's check name.

View Source
const CheckNoStuckFriend = "no-stuck-friend"

CheckNoStuckFriend is the name of the first check.

View Source
const CollectReportChars = 600

CollectReportChars is how much of a failed report rides on its finish, as the daemon's outbox pass carries it.

View Source
const CostGapFloor = 1.0

CostGapFloor is the least gap in dollars that opens the judgment: just after midnight UTC a day's figures are cents, and a cent's difference is no gap to judge.

View Source
const CostGapOver = 0.05

CostGapOver is the share of the provider's figure a gap must pass to open the judgment.

View Source
const CostReconcileEvery = time.Hour

CostReconcileEvery is how often the run loop is to reconcile the providers' usage.

View Source
const CriticalBehind = 10

CriticalBehind is the weight at and above which a card is critical.

View Source
const CriticalByWeight = "critical (by weight, not yet ordered)"

CriticalByWeight is the key and the words where and the dashboard show a computed critical under (CriticalBehind or more cards behind it, no level set): it is shown and orders nothing yet, owed with the reference model (a level ordered by weight made the slow differential tier disagree: the ask's stream round, seed 1004).

View Source
const CycleWindow = 24 * time.Hour

CycleWindow is how far back a landing counts.

View Source
const DaemonPong = "asleep"

DaemonPong is the observation word for a pong her daemon answered and her session did not. It is the daemon's, kept on the row for it, and shown as down: the table's words are up, held and down (the owner, 2026-10-04 11:42 AM ET: "anything but up is down"; "sleeping = down").

View Source
const DealAhead = 2

DealAhead is how many widths of cards a member may hold, ready and working together: its width working and as many again ready behind them, so a lane that frees takes its next card at once and never waits for a tick. The member itself runs at most its width (the fleet row's, internal/member); the rest wait in its ready column.

View Source
const DealtMaxDefault = 3 * DeadlineUnfinished

DealtMaxDefault is the dealt bound when the coordinator set none: three times the deadline a taken card is held to. A member holds at most DealAhead times its width, ready and working, so a card at the back of its ready queue is taken within two take deadlines of a member that works; the third is the margin.

View Source
const DecisionRecut = "re-cut the brief"

DecisionRecut is the decision a brief defect asks for: the card is dropped and its brief cut again from the stream's generator, with what the worker found, as a new card; a redeal of the same brief would hold the same way (docs/SPEC-SPRINT.md section 1, a brief defect).

View Source
const DefaultReadLease = 10 * time.Minute

DefaultReadLease is how long an in-flight read's lease stands without renewal (10m).

View Source
const DefaultRollbackWindow = 15 * time.Minute

DefaultRollbackWindow is how long server switch watches for a failed land before the switch is considered permanent (docs/SPEC-SPRINT.md section 14; item 14).

View Source
const DevBranch = "dev"

DevBranch is the development branch, which promotion alone reaches.

View Source
const DrainVerb = "tick drain"

DrainVerb is the verb of the pump's drain step.

View Source
const DrainWidth = "0"

DrainWidth is the width cell of a member that drains: fleet up <m> --width 0 writes it, and it is no member of the deal, the level or a take by count (every room is DealAhead times 0) while its working cards finish, unlike fleet down, which deals them again elsewhere (the comfort list of 2026-10-03, item 5).

View Source
const FieldBase = "base"

FieldBase is a stream's control card field: the bases its cards name, from each brief's BASE: line, at admission.

View Source
const FieldBehind = "behind"

FieldBehind is the primary's weight as the tick last wrote it.

View Source
const FieldBench = "bench"

FieldBench is a primary's bench as its brief's BENCH line names it: the members' names, comma-separated, written by add and brief with the brief; absent on a card with none.

View Source
const FieldBriefAttempt = "brief_attempt"

FieldBriefAttempt is the primary's attempt when its brief was last replaced (Brief); absent, the brief is the one add gave it, at attempt 0.

View Source
const FieldBriefDefects = "brief_defects"

FieldBriefDefect (rules.go, the field the brief-defect rule stamps) also carries, on a work card and its primary, the reason a worker's HOLD named; FieldBriefDefects is a stream's count of them, on its control card, bumped by one in the finish that records each (a Bump, so two in one step add up).

View Source
const FieldCIRunStatus = "ci_run_status"

FieldCIRunStatus is the status of the last CI run reported on a primary, for its current head or another.

View Source
const FieldCost = "cost"

FieldCost is a landed primary's total cost (its total's charged figure, written as it lands) and a stream's control card's sum over its landed primaries: an exact decimal in USD, absent when nothing of it was priced. The work table's cost column shows the control card's (Cost; SyncMirrors).

View Source
const FieldFinderRead = "finder"

FieldFinderRead marks a read card asked of the finder out of turn (finderFirst): placed on purpose, the level leaves it where it is (levelReads).

View Source
const FieldFindingAttempt = "finding_attempt"

FieldFindingAttempt is the attempt whose broken reads' finding the primary's `finding` carries (Rework writes both: the attempt it sends back and what its readers found). A primary with a finding and no attempt recorded (admitted before this field) was reworked from the attempt before its current one.

View Source
const FieldFindingKeys = "finding_keys"

FieldFindingKeys is the primary's list of each attempt's finding key (FindingKey), one line an attempt ("attempt <n>: <key>"), appended by Rework beside FieldFindings and cut the same way: what the identical-finding bound reads back past the attempt before.

View Source
const FieldFindingReader = "finding_reader"

FieldFindingReader is the primary's field naming the reader whose finding its last rework sent back (the first broken read's reader at that attempt, in reader row order; Rework): the next attempt's first read is asked of them (Ask, finderFirst). Absent when the rework was of failed work.

View Source
const FieldFindings = "findings"

FieldFindings is the primary's list of what each attempt sent back found, one line an attempt ("attempt <n>: <the finding's first sentence>"), appended by Rework and cut to MaxCardTextBytes from the front (the latest kept): what the cap's judgment lists, and kept by the card the cap's default answer deals to a friend.

View Source
const FieldFriendDeadline = "friend_deadline"

FieldFriendDeadline is a friend's work card's working deadline in seconds, set when it is placed on her row (friendDealPass, FriendLevel: friendDeadline), as #5300 sets a machine's card's when it is dealt: absent while she has no ok attempt, and DeadlineUnfinished holds.

View Source
const FieldFriendsLeft = "friends_left"

FieldFriendsLeft is the friends a friend's work card has left, comma joined: each the level moved it off (FriendLevel), and the one the coordinator took it back from (FieldTakenFrom) once it is dealt again. Neither the deal nor the level places it on any of them again (docs/SPEC-SPRINT.md section 1, friend-deal-idle-lanes-first.w1), with one exception: a card withdrawn off a friend held or down that no other friend up may take is dealt back to a friend the level moved it off (never the one it was withdrawn or taken back from), rather than stranded ready (friendDealPass, withdrawnFrom).

View Source
const FieldGateWall = "gate_wall"

FieldGateWall is the measurement a card admitted pro by its gate's wall carries: `<median> n=<takes> over <bound>`.

View Source
const FieldHeld = "held"

FieldHeld is the stamp of a primary admitted held.

View Source
const FieldLease = "lease"

FieldLease is a read card's lease expiration timestamp.

View Source
const FieldLeveled = "leveled"

FieldLeveled marks a read card the level moved: the level moves it no more, so a read is never shuttled between readers tick after tick and the level never sticks on one card.

View Source
const FieldNeedsSet = "needs_set"

FieldNeedsSet is a sentinel's record of its needs re-pointed (sentinel set): "<before> -> <after> <stamp> by <who>", the last set.

View Source
const FieldNote = "note"

FieldNote is a card's note: the last rule answer that moved it, in the rule's words.

View Source
const FieldPassedHead = "passed_head"

FieldPassedHead is the head of the attempt a rework sent back when a reader had passed it (an ok read at it): what a next attempt that finds nothing new returns to review at.

View Source
const FieldPathsProposed = "paths_proposed"

FieldPathsProposed is the proposal the paths rule last answered on a primary: "attempt <n>: <glob,...>".

View Source
const FieldPriority = "priority"

FieldPriority is a primary's priority as set (by its brief's PRIORITY line or its stream's default at admission, or by the verb priority); absent is normal, or critical by weight.

View Source
const FieldPriorityDefault = "priority_default"

FieldPriorityDefault is a stream's control card's field: the level a card added to the stream later is given when its brief names none; absent is normal.

View Source
const FieldReadCard = "read_card"

FieldReadCard marks a read card the deal cut (read_cards.go), "1": a friend's read asked before read cards has none (its inbox job is its card id: Packet.ReadJob).

View Source
const FieldReadTake = "read_take_"

FieldReadTake is the record of one run of a read card that ended without a verdict (read --return), keyed by the run's number, 1 for the first, kept on the read card beside its usage (the run that gave the verdict); the producer's record of each run is on the primary (FieldCostRecord), keyed by the same number.

View Source
const FieldReadTierReason = "read_tier_reason"

FieldReadTierReason is a stream's control card's field: why its read tier was last set (`stream set --read-tier <t> --reason <why>`), beside FieldReadTier.

View Source
const FieldReadsNeeded = "reads_needed"

FieldReadsNeeded is the primary's field the accept writes when it accepted the card on the sprint's count (set --reads) rather than its tier's rule (ReadsNeeded): that count, so a card past review is held to the count it was accepted on.

View Source
const FieldRebalancedFrom = "rebalanced_from"

FieldRebalancedFrom is the rows a work card was rebalanced off, comma joined: the rebalance never places it on one of them again.

View Source
const FieldRelinked = "relinked"

FieldRelinked is a card's record of its needs re-pointed to a twin: "<old,...> -> <new> <stamp> by <who>", the last relink.

View Source
const FieldReplaces = "replaces"

FieldReplaces is a twin's record of the ids it replaced (add --replaces, recut): its lineage, as the old card's reason "replaced by <new>" is the other end of it.

View Source
const FieldRepo = "repo"

FieldRepo is a stream's control card field: the repositories its cards name, in the order their briefs name them (docs/SPEC-SPRINT.md section 11, the streams verb).

View Source
const FieldReported = "reported"

FieldReported is when a work card's report was written, as the transport knew it (a friend's REPORT.md: FinishReq.Reported), no later than its finish.

View Source
const FieldReturned = "returned"

FieldReturned is the stamp on a read card handed back with no verdict, until the ask asks it again.

View Source
const FieldReturnedAttempt = "returned_attempt"

FieldReturnedAttempt is the primary's attempt when the coordinator last returned it to review (return): at that attempt the pump does not accept it, and the judgment "returned to review" decides it.

View Source
const FieldRules = "rules"

FieldRules is a primary's rules by reference (nova-tools#5174 rule 6): the base name of the held rules file (fleet/child-rules*.txt) the member injects into its brief at stage time, written by add (and brief) with the brief it was held to, absent when the brief carries its own rules. It is the card's, so no later add changes what an earlier card's child reads.

View Source
const FieldStagingTake = "staging_take_"

FieldStagingTake is the record of a launch its member refused at staging, keyed by the generation refused (ProviderTake's shape: the route, the member, when, the reason). A staging refusal spends none of the redeal bound: its own bound is the fleet, each member refusing an attempt's card at most once, the deal never placing it on a member that refused it (tla/CardContract.tla, StageRefused, Restage and StagingBound).

View Source
const FieldStaleReview = "stale_review"

FieldStaleReview is the stream control card's field wait sets on the stream's stale judgment: the inbox does not show the stream stale before it.

View Source
const FieldStarted = "started"

FieldStarted is the generation of a friend's work card she has started, set by her start receipt (friendStartSet) and by nothing else: a card working on her row whose FieldStarted is not its generation was moved there by no start of hers (her finish's next, a take-back's next, a take), and the tick puts it back ready (friendUnstartedWorking).

View Source
const FieldTakeEnded = "take_ended"

FieldTakeEnded is the work card's mark that a take of it ended without a finish and it was withdrawn (no member had room, or it is at its bound): the deal that places it again counts that take, and unsets the mark.

View Source
const FieldWaitingReader = "waiting_reader"

FieldWaitingReader is the primary's mark of the note: "<attempt> <since>", the attempt it waits at and when the tick first found it waiting. The ask that asks it clears it.

View Source
const FieldWho = "who"

FieldWho is a primary's worker as its brief's WHO line names it, written by add and brief with the brief: WhoFriend for any friend, FriendRow(<name>) for one; absent on a machine's card.

View Source
const FirstSeatGeneration uint64 = 1

FirstSeatGeneration is the generation of a seat no change has moved: the first init's coordinator holds it, with no seat record; the first accepted change takes 2, and so on. Nothing resets it but teardown.

View Source
const FlashGateBound = 15 * time.Minute

FlashGateBound is the longest measured gate wall a card is dealt flash with.

View Source
const FriendIdleDefault = 20 * time.Minute

FriendIdleDefault is how long a friend holding cards may show no file write under her working directory and outbox before it is an alarm (nova-sprint set --friend-idle).

View Source
const FriendLaneLive = 2 * time.Minute

FriendLaneLive is how old a friend's beat may be while the cards it names running are her live lanes: her daemon beats every FriendBeatEvery, so a beat this old is a daemon that stopped, not a lane.

View Source
const FriendLevelPerTick = 4

FriendLevelPerTick is the most cards the tick's level moves in one tick.

View Source
const FriendReadDeadline = 30 * time.Minute

FriendReadDeadline is how long the friend has, on the sprint's clock, to return the read: thirty minutes. It is not a wall clock.

View Source
const FriendReadyMax = 10 * time.Minute

FriendReadyMax is how long a work card may sit ready on a friend's row while she has a lane free before it is a judgment (a work card past its deadline, dealt and never taken): in batch mode the deal takes it into the lane, in one-shot mode her daemon or her session takes it (take --as friend.<name>), and a card neither took is no one's (tla/FriendReadyTake.tla, NeverStrandedSilently).

View Source
const FriendStallAfterDefault = 20 * time.Minute

FriendStallAfterDefault is how long a friend holding cards may show neither file write under her working directory nor card progress before the stall ladder begins.

View Source
const FriendStallStepDefault = 5 * time.Minute

FriendStallStepDefault is the duration between rungs of the friend stall ladder.

View Source
const FriendStartMaxDefault = 20 * time.Minute

FriendStartMaxDefault is the start bound when the coordinator set none.

View Source
const FriendSyncLabel = units.FriendSyncLabel

FriendSyncLabel is the friend sync loop's launchd label; its plist is FriendSyncLabel.plist.

View Source
const FriendSyncService = units.FriendSyncService

FriendSyncService is the friend sync loop's systemd user unit.

View Source
const Friends = "friends"

Friends is the friends table: one row per friend of nova-config's friend rows (the owner, 2026-10-02: "add a friends table, above fleet and below merge. friends | status for now. up/down/held"), with the fleet table's columns but load (the owner, 2026-10-02: "please give friends in the friends table the same ready, working, width, done, ok%, status that we have for machines, but no load, since they don't correspond to a machine (at the moment...)"). It is drawn by where from the friends' records (store/friends.go: the roster, each friend's job cards and her beat), never stored as a table: nothing in the four tables, the tick or an epoch holds it.

View Source
const FsckSeatAgreement = "seat-agreement"

FsckSeatAgreement is the check's name.

View Source
const FundsCause = "every provider is out of credit"

FundsCause is the cause the machine's record carries when the tick stopped it because every provider is out of credit, and the words the judgment, the machine line and a refused start say (the owner, 2026-10-03: "if all providers are out, then you stop the sprint.").

View Source
const GCEvery = time.Hour

GCEvery is how often gc runs on every machine.

View Source
const GCMaxAge = 48 * time.Hour

GCMaxAge is how old a bench directory, a lander worktree or a job no runner names is before gc removes it (--max-age): two days.

View Source
const GCProbeEvery = 5 * time.Minute

GCProbeEvery is how often the loop reads each machine's volume between its runs.

View Source
const GCProbeLine = `df -Pk "$HOME" "$HOME/nova-bench" "${NOVA_AI_ROOT:-$HOME/ai}" 2>/dev/null; true`

GCProbeLine is the remote line that reads a machine's volumes between its runs: df -P of the home, the bench root and the AI root (those that exist).

View Source
const GCReportGrace = time.Hour

GCReportGrace is how old a report or a read's result is before gc takes a job or a read whose lane no runner's log names: the daemon that wrote it records it in that time.

View Source
const GCVolumeAlarm = 80

GCVolumeAlarm is the use, in percent, of a machine's fullest volume at which gc runs on it before its hour is up.

View Source
const GCVolumeRetry = 10 * time.Minute

GCVolumeRetry is the least time between two runs a full volume starts.

View Source
const Held = "held"

Held is the status of a member the coordinator holds down.

View Source
const HeldByAdopt = "adopt"

HeldByAdopt is the hold mark (FieldHeldBy) of a member held adopting: the tick alone releases it, and a coordinator's hold or release takes it over.

View Source
const HowGiven = "given"

HowGiven is a load given on the command line rather than measured.

View Source
const LandRefusedFinding = "the landing refused its head: "

LandRefusedFinding begins the finding a landing refusal leaves on its card, the way of it after (RefusalWay): two refusals the same way are the same finding, and the brief's bound (AtBriefBound) stops the card at the second.

View Source
const LegacyPongGrace = time.Hour

LegacyPongGrace is how long after the sprint server starts a --pong that is a time (the beat of a daemon from before the nonces: her session's last answer as that daemon had it) still counts as it did before, the time itself her proof: the server is adopted first and every daemon within the grace, so the adoption puts no friend down at once. After it, a time is a beat with no proof.

View Source
const LineMove = "move"

LineMove is the kind of a card's change. A notification's line has the notification's kind (judgment, happened, decided, acknowledged); a note on a card, when there is one, will be a line of kind "note".

View Source
const LineQueued = "queued"

LineQueued is the kind of a change a step queued for the work table while the machine ran (queue.go): what it asked, which the next tick's pump applies and writes a move line of. A replay of the move lines passes it by.

View Source
const LoopSilence = 15 * time.Second

LoopSilence is how long the run loop goes unseen before DOWN (docs/SPEC-SPRINT.md).

View Source
const MachineActor = "machine"

MachineActor is who the tick's moves and notifications are recorded as.

View Source
const MaxCardTextBytes = 8 << 10

MaxCardTextBytes bounds each text field a card carries, the brief excepted (the store refuses a step that would write a longer one); a rework's own derived words (the finding, why and the fix it takes from a finding) are cut to it, never refused for it.

View Source
const MaxCause = 300

MaxCause is the longest cause a line carries: the cause is its own card's, and a step that moves many cards says so in a few words on each.

View Source
const MaxIDLen = 128

MaxIDLen is the longest identity ValidID takes.

View Source
const MaxListed = 50

MaxListed bounds the primaries a notification lists; Count carries the total.

View Source
const MaxLook = 5

MaxLook bounds the cards "look" lists; past it, the command that lists the whole group.

View Source
const MaxProviderErrorBytes = 200

MaxProviderErrorBytes bounds the line FieldProviderError keeps.

View Source
const MaxReadGen = 2

MaxReadGen is the most generations of one reader's read card at one attempt: the plain identity and .g1 to .g<MaxReadGen>, each a read the machine took back (spentBy). A reader whose read was taken back that often is not dealt it again at the attempt.

View Source
const MaxRecentLandings = 10000

MaxRecentLandings bounds the landings RecentLandings keeps: the newest. It is far above the landings of an hour at any width the fleet has; past it, the hour's count, and so the rate, reads low.

View Source
const MaxReconcileDays = 62

MaxReconcileDays bounds the days a provider's record keeps.

View Source
const MaxRedeals = 3

MaxRedeals is how many times one attempt's work card is dealt again after a take of it ended without a finish, its member down or away while the card was working (its redeals counter, which no take resets). A card that was ready, never taken, is dealt again and keeps its count: a card is retired for repeated failure at members, never for members flapping while it sat ready. A working card whose member goes down with its count at the bound stays withdrawn, and the bound's judgment names it (docs/SPEC-SPRINT.md section 2, the work card's redeals; tla/DirtyTick.tla RedealsAreEndedTakes and RedealBoundHolds).

View Source
const MaxTakes = 64

MaxTakes bounds the numbered records of one card a reader looks for.

View Source
const MaxTimerNote = 512

MaxTimerNote bounds the note text a timer carries.

View Source
const MemberDownAfter = 3 * 15 * time.Second

MemberDownAfter is how long a fleet member goes without a beat before DOWN.

View Source
const MergeQueueP90Default = 30 * time.Minute

MergeQueueP90Default is the bar on the merge queue's p90.

View Source
const MergeQueueWindowDefault = 24 * time.Hour

MergeQueueWindowDefault is how far back a merge spell counts: the last day, the same day the landings and the cycle-time breakdown read.

View Source
const NAllOutOfCredit = "every provider is out of credit"

NAllOutOfCredit is the tick's judgment when it stops the machine for FundsCause: one, while every enabled route rests for its provider's funds.

View Source
const NCostGap = "a provider's usage and the sprint's cost records disagree"

NCostGap is the judgment of a provider whose own count of a day's usage and the sprint's cost records of that day differ past the bound.

View Source
const NDeadBase = "a merging card names a base not on origin"

NDeadBase is the judgment of a merging card whose BASE is not on origin.

View Source
const NDevBehind = "dev is behind"

NDevBehind is the tick's judgment that dev is behind, one for the sprint.

View Source
const NFewReaders = "fewer than two readers up"

NFewReaders is the tick's judgment that fewer readers are up than a primary in review waiting to be asked needs (two for a pro card, one for a flash card; ReadsNeeded): the ask raises it once, and asks no absent reader.

View Source
const NFilesAlarm = "open files above the alarm"

NFilesAlarm is the judgment of a member whose open file descriptors are above its alarm bound.

View Source
const NFriendStall = "friend stall"

NFriendStall is the happened notification type for stall ladder climbing and clearing.

View Source
const NGivenBack = "a card taken back from a friend given back"

NGivenBack is the happened note of a card taken back from a friend given back to her.

View Source
const NNoRoute = "no route serves the tier"

NNoRoute is the tick's judgment of a tier no route serves, once per tier (its subject is the tier's, StreamSubject(TierSubject(tier))), closed when the tier is served or no card of it waits.

View Source
const NPathsWidened = "PATHS widened by rule"

NPathsWidened is the happened note, to the coordinator, naming the files a card's PATHS were widened by.

View Source
const NPrioritySet = "priority set"

NPrioritySet is the happened note that records a priority change on the card's timeline (log --card), with the actor and the reason.

View Source
const NProviderFunded = "a provider's routes serve again: its balance is back"

NProviderFunded is the happened note of a rest of a provider's funds the poll ended.

View Source
const NRaiseReadTier = "raise the read tier of the stream?"

NRaiseReadTier is the tick's judgment that a stream's read tier should rise, one per stream.

View Source
const NReadBranchMissing = "a read's branch is not on origin"

NReadBranchMissing is the judgment of a read whose branch origin does not hold when no branch of the work on origin holds its head either: written at the first such close, on the primary, naming the read card and the branch. While it is open at the primary's attempt the primary wants no read (ReadsWanted, readCardsWanted): the seat pushes the branch and acks it (the tick asks the read again), or reworks or drops the card.

View Source
const NReadMissingBranch = "a read named a branch not on origin"

NReadMissingBranch is the happened note of such a read, re-asked.

View Source
const NReadersBehind = "the readers are behind"

NReadersBehind is the tick's judgment that the readers are behind, one for the sprint.

View Source
const NReadyToMerge = "ready to merge"

NReadyToMerge is the notice the pump addresses to the coordinator once a tick in which it accepted primaries: a notice, not a decision ("accept is mechanical, but the merge step is not"), naming every primary accepted.

View Source
const NRebalanced = "a queued card rebalanced to an idle lane"

NRebalanced is the happened note of a queued card rebalanced to an idle lane.

View Source
const NRemindFailed = "a reminder could not be delivered"

NRemindFailed is the judgment written once for a person whose reminder cannot be delivered.

View Source
const NRuleAnswered = "answered by rule"

NRuleAnswered is the happened note of a move a rule made that no judgment's close says (a late card returned to be dealt again).

View Source
const NScoredLow = "landed work scored low"

NScoredLow is the judgment of a batch whose landed work scored at or above the bar.

View Source
const NStalled = "stalled"

NStalled is the judgment of a stall: something nothing holds.

View Source
const NStreamArchived = "streams archived"

NStreamArchived is the tick's word that it archived streams whose every card has landed (stream archive): information, each stream named once.

View Source
const NStreamPrioritySet = "stream priority set"

NStreamPrioritySet is the happened note that records a stream's default level changing, on the stream's timeline (log --stream; its control card's, log --card ctl-<s>), with the actor and the reason.

View Source
const NTickEnd = "tick end"

NTickEnd is the tick's end note: written once at the end of a tick that addressed the coordinator something, "judgments=N"; inbox --wait wakes on it, and the inbox does not list it.

View Source
const NTimer = "timer"

NTimer is the judgment a timer whose due time has come is raised as.

View Source
const NWaitingForReader = "waiting for a reader"

NWaitingForReader is the tick's note on a primary in review whose read it could not ask for want of a reader with room (a machine reader of its tier at its width, or a friend at or above its read tier at her room when no paid reader has room): a happened note, no decision, written once an attempt (FieldWaitingReader), and the read is asked the tick a reader frees. Review never holds a card with no read asked and no note: an ask refused for a reason the coordinator decides is a judgment (cannot ask, fewer than two readers up), and the rest wait with this note (docs/SPEC-SPRINT.md section 6, a card waiting for a reader).

View Source
const NoEligibleReader = "no eligible reader for "

NoEligibleReader opens the tick's one judgment for every primary of a tick the ask refused for want of readers (TickAsk): "no eligible reader for <ids>".

View Source
const NoProof = "beat with no proof"

NoProof is the word for a beat whose --pong proves nothing.

View Source
const NoReaderMayRead = "no reader up may read it"

NoReaderMayRead begins the wait of a primary no unit up may be dealt its read card: the read-card ask raises cannot ask on it (readCardsAskPart).

View Source
const NotMeasured = "not measured: the check ran in the server; run nova-sprint seat check"

NotMeasured is what the dashboard, bus and friend agents say when the check ran inside the server (Server.Self).

View Source
const NothingWaits = "nothing waits: the tick accepts every primary in review whose reads are all ok and tells the seat (ready to merge)"

NothingWaits is what accept --read-ok says when no primary in review has the ok reads it needs: the tick accepts them, so nothing waits on the verb.

View Source
const OverloadTimeouts = 3

OverloadTimeouts is how many timeouts within the window make a member overloaded.

View Source
const OverloadWindow = 15 * time.Minute

OverloadWindow is how far back the timeouts are counted.

View Source
const PartCapDeal = "cap deal"

PartCapDeal is the attempt cap's default answer, the pump's part before the deal (TickCapDeal, brief_bound.go): a card past its cap goes to a frontier or heavy friend with room before the deal could give it to a machine.

View Source
const PartDone = "done"

PartDone is the name of the tick's last part, the done part.

View Source
const PartDrain = "drain"

PartDrain is the name of the work pump's first part: the work table's queue applied in one update (Drain). It needs the queue, which the store reads with the part's step: it has no planner here.

View Source
const PartFriendStall = "friend-stall"

PartFriendStall is the friend stall ladder part (friend_stall.go).

View Source
const PartRebalance = "rebalance"

PartRebalance is the work table's part after the deal (TickTables).

View Source
const PartRetire = "retire gone streams"

PartRetire is the name of the tick's retirement part (TickRetireGone).

View Source
const PartRuleTwin = "rule twin"

PartRuleTwin is the tick part that twins the cards a rule answers ActTwinWider.

View Source
const PartRuleWiden = "rule widen"

PartRuleWiden is the tick part that widens the cards the widen rule answers.

View Source
const PreviewLen = 8

PreviewLen is how many ids a rendered list of ids shows before it is cut: the card, the inbox and the notices name the first eight and count the rest, as the inbox's group line does, so a card with a thousand needs is one short line and never every id.

View Source
const PrimaryField = "primary"

PrimaryField is the field of a card that names its primary: the read cards, the merge card and the work cards of the fleet's table carry it, and Table.Of finds them by it.

View Source
const PromoteAge = 30 * time.Minute

PromoteAge is how long the oldest landing since the last promotion may wait before dev is behind.

View Source
const PromoteCards = 25

PromoteCards is how many cards may land on the sprint branch before dev is behind.

View Source
const PropCostReconcilePrefix = "cost_reconcile_"

PropCostReconcilePrefix is the fleet table property prefix of a provider's reconciliation.

View Source
const PropFriendStartMax = "friend_start_max"

PropFriendStartMax is the work table's property: the start bound, how long a card dealt to a friend may wait ready on her row unstarted, while her beat names no job running, before the tick levels it to another friend, a duration.

View Source
const PropReadCards = "read_cards"

PropReadCards is the work table's property that turns read cards on: ReadCardsOnWord.

View Source
const PropReadsWindow = "reads_window"

PropReadsWindow is the table property holding the verdicts' ledger: one line a verdict, "<stamp>\t<reader>\t<verdict>\t<tier>\t<finding>", oldest first, at most MaxReadsWindowLines.

View Source
const PropStatusSeen = "status_seen"

PropStatusSeen is the fleet property that keeps every row's status as the transitions last saw it, one property for the whole fleet (a table holds at most ntable.LimitTableProps): for each row "<row>=<word>,<transition>,<daemon start>,<away since>,<flaps>,<flapping since>", times RFC3339 or "-", one after another with a blank between, in row order. Away since is when the row first left the recorded status (zero while it holds it); the flaps are the departures that came back inside the dwell since the last transition counted.

View Source
const PushCheckPrefix = "NOVA SPRINT PUSH CHECK "

PushCheckPrefix opens the check the push loop delivers: the session sees it as the first words of its turn.

View Source
const PushProofFilePrefix = "PROOF-"

PushProofFilePrefix names the file a check is written as by the folder adapter: <target>/PROOF-<nonce>.

View Source
const QuietPropPrefix = "quiet_"

QuietPropPrefix is the fleet table's property of a member's quiet: quiet_<member>.

View Source
const ReadCardDeadline = 60 * time.Minute

ReadCardDeadline is how long a read card is given from its start (its take; a friend's read dealt working, from its deal) before the deal retires it late, spending its reader, and deals the read to another. A read never started is never late: one left untouched in ready past the deal bound (DealtMax) is taken back spending no one (RetiredByUnstarted).

View Source
const ReadCardsOnWord = "on"

ReadCardsOnWord is the setting's on word; any other value is off.

View Source
const ReaderPrefix = "reader-"

ReaderPrefix names a reader for its machine: reader-<m> is the one reader on the fleet machine m, and it runs at m's width, the fleet row's, read with its queue every tick as the member on m reads its own (the owner, 2026-10-02: "The reader widths seem to be very ad-hoc, unlike the machine widths"; "why not just have as many readers as workers per-machine"). The readers table holds no width column: a reader's width is derived from its fleet row (ReaderWidth), `queue --as reader-<m>` carries m's fleet row's width, and a reader named for no row carries none and begins nothing.

View Source
const ReaderSpendWindow = time.Hour

ReaderSpendWindow is the recent window a reader's spend is also summed over: the last hour.

View Source
const ReaderTiers = "tiers"

ReaderTiers is the readers table's text column: the tiers that reader reads. An empty cell is the default: a fleet reader reads flash alone while the store holds routes (fleetReadsFlashOnly; the owner, 2026-10-06, "I'm ok with flash readers on fleet but not pro"), and a friend's or a bud's reader, which brings its own model, every tier. The ask counts a reader only for a primary whose read tier (readTierOf) it serves.

View Source
const ReaderTiersAll = "all"

ReaderTiersAll is the --tiers word for every tier, stored as the list of them.

View Source
const ReaderTiersDefault = "default"

ReaderTiersDefault is the word for an empty cell, as --tiers takes it and a view prints it.

View Source
const ReadersWindow = 10 * time.Minute

ReadersWindow is how long reads sit asked and not begun on readers up before the readers are behind.

View Source
const ReaskedMissingBranch = "re-asked: the read named a branch not on origin"

ReaskedMissingBranch begins the note's text and the card's reason.

View Source
const RedStreamPrefix = "promote-red-"

RedStreamPrefix is the stream a red promotion cuts its fix cards into, with the day: promote-red-<YYYY-MM-DD> (docs/SPEC-SPRINT.md section 11, promote).

View Source
const RedoFixText = "redo the same change on the current tip"

RedoFixText is the fix every redo applies to the conflicted attempt.

View Source
const RemindEvery = 5 * time.Minute

RemindEvery is the running time between two pushes to one person.

View Source
const RepeatDecision = "stop and look"

RepeatDecision is added to a judgment for a primary that came back a second time for the same cause.

View Source
const RepriceKey = "cost reprice"

RepriceKey is the key of the step's log lines, one per route.

View Source
const RetiredByCoordinator = "coordinator"

RetiredByCoordinator is a read card's retired_by when the coordinator took the read back and asked another reader instead (ask --instead).

View Source
const RetiredByHold = "hold"

RetiredByHold is a read card's retired_by when the coordinator's hold --return took it back from its reader.

View Source
const RetiredByLapsed = "lapsed"

RetiredByLapsed is a read card's retired_by when its lease lapsed and it was taken back on restart.

View Source
const RetiredByLevel = "level"

RetiredByLevel is a read card's retired_by when the tick's level moved its read, asked and not begun, to another reader (levelReads).

View Source
const RetiredByMissingBranch = "branch-missing"

RetiredByMissingBranch is the retired_by of a read whose broken verdict named a branch origin does not hold: retired with no verdict and asked again.

View Source
const RetiredByReconcile = "friend reconcile"

RetiredByReconcile is the retired_by of a friend's work card friend reconcile returned.

View Source
const RetiredPrefix = "retired with its card: "

RetiredPrefix opens the decided note of a judgment retired with its card.

View Source
const ReworkOnAHigherTier = "rework with a fix on a higher tier"

ReworkOnAHigherTier is the bound's rework when the attempt before also ended at its bound on the card's tier (failure.go, reworkAtTheSameBound): Rework takes it only with --tier naming a tier above (boundDecisions).

View Source
const RoleReader = "reader"

RoleReader is the role a friend's nova-config row names to be dealt read cards; a machine reads when its reader row (reader-<m>) is on the readers table, the machine's reader identity, whose tiers cell names the tiers it reads (reader set --tiers).

View Source
const RuleConflictFix = "redo the same change on the current tip"

RuleConflictFix is the conflict rule's fix: the attempt's change made again where the stream is now.

View Source
const RuleReadBroken = "read-broken"

RuleReadBroken is the read-broken rule's name. run --answer-rules=false turns it off with every rule; the sprint's answer_rules_off naming it turns it off alone (RuleOff), though RuleNames and nova-config's enum (config.AnswerRules) do not list it yet.

View Source
const RuleReadTier = "read-tier"

RuleReadTier is the read tier rule: a stream's read tier is kept unless two substantive findings disagree (a reader's ok and another's broken with a finding, on one attempt at the stream's read tier), when it is raised; the question is never asked. A sprint row that turns it off (answer_rules_off) asks it again.

View Source
const RuleWiden = "widen"

RuleWiden is the widen rule's name; the sprint's answer_rules_off naming it turns it off alone (RuleOff), and run --answer-rules=false with every rule.

View Source
const ScriptReadPrefix = member.ScriptReadPrefix

ScriptReadPrefix begins the finding of an ok read a script reader gave: the reader ran the card's SCRIPT program at the attempt's start commit and its diff was the head's, byte for byte (docs/SPEC-SPRINT.md, the script read; member.ScriptVerifier). It is the member's own constant, so the finding a reader writes is the one counted here.

View Source
const SeatCheckToken = "MACHINERY"

SeatCheckToken is the first word of every line.

View Source
const SeatLabel = units.SeatLabel

SeatLabel is the push loop's launchd label; its plist is SeatLabel.plist.

View Source
const SeatService = units.SeatService

SeatService is the push loop's systemd user unit.

View Source
const Sentinel = "sentinel"

Sentinel is the kind of a card that marks a point in a stream: the tick never moves it from waiting or ready.

View Source
const SpendWindow = time.Hour

SpendWindow is the window the spend an hour is measured over: the last hour.

View Source
const SprintSubject = "sprint:done"

SprintSubject is the subject of a judgment about the whole sprint; no primary or stream id has a colon.

View Source
const StuckWindow = 4 * time.Hour

StuckWindow is how far back no friend may have been stuck.

View Source
const (
	// TickMaxMoves bounds the units one part of a tick applies; the rest are
	// due, and the next tick moves them. It is the deal's bound, TickMaxDeal
	// (width.go): one table-layer write's member candidates, which the step
	// builder cuts into parts under the table layer's entry bounds, so a
	// part plans every row that needs it in the one tick and never lags its
	// own work (every row of every
	// table moves every tick, never a row at a time).
	TickMaxMoves = TickMaxDeal
)

The bounds of one tick, and the one queue length the dealing keeps.

View Source
const TidyAgainAfter = time.Minute

TidyAgainAfter is how soon a tidy may follow the last: a second within it, by the recorded time to the nanosecond, is refused.

View Source
const TidyViewWindow = 30 * time.Minute

TidyViewWindow is the coordinator view's recent window (cmd/nova-sprint view.go, viewWindow): its finished-in-the-last-30m counts read the newest finishes.

View Source
const TwinReturnedFirst = "returned first: a merging card is taken off the merge queue before it is twinned"

TwinReturnedFirst is what a twin of a merging card says: the step returned it to review (Return), and the twin is made by the same verb's next step (cmd/nova-sprint twin).

View Source
const VerdictWords = 3

VerdictWords is how many words of the child's line a verdict's class keeps (FailureClass).

View Source
const WhoFriend = "friend"

WhoFriend is the who of a card dealt to any friend.

View Source
const WhoNone = "none"

WhoNone is the Selector's Who for a card that names no friend.

View Source
const WhyGone = "is on neither the work nor the merge table (stream remove took it off), so nothing can act on this"

WhyGone is the retirement's reason the tick gives for a stream the work and merge tables lack.

View Source
const WidenBlocked = "outside PATHS and not adjacent: "

WidenBlocked prefixes the text of a judgment the widen rule leaves: the files outside PATHS that are not adjacent to the change.

View Source
const WordNeverTaken = "dealt, never taken"

WordNeverTaken is the words of a work card late past the dealt bound.

Variables

View Source
var (
	BrokenReadsDecisions  = []string{"look at the readers", "raise the read tier", "act"}
	ReaderBreaksDecisions = []string{"look at the reader", "act"}
)

BrokenReadsDecisions and ReaderBreaksDecisions are the two judgments' decisions.

AlarmTypes is the backlog alarms' judgment types, in the order the tick checks them.

View Source
var AliasRE = regexp.MustCompile(`^j[1-9][0-9]*$`)

AliasRE is the shape of a judgment's alias.

View Source
var AllOrder = []string{Work, Readers, Merge, Friends, Fleet}

AllOrder is the order where --all shows every table in: the four of the stored view, with friends after merge and before fleet.

View Source
var ApplyOrder = []string{Fleet, Readers, Merge, Work}

ApplyOrder is the fixed order a step that touches more than one table writes them in: the work table always last (docs/SPEC-SPRINT.md section 10).

View Source
var BaseClasses = []Class{
	{Name: "build", Run: []string{"go", "build", "./..."}},
	{Name: "gofmt", Run: []string{"gofmt", "-l", "."}},
	{Name: "vet", Run: []string{"go", "vet", "./..."}},

	{Name: "vet-functional", Run: []string{"go", "vet", "-tags", "functional", "./..."}},
	{Name: "staticcheck", Run: []string{"go", "test", "-tags", "functional", "-count=1", "-timeout", "600s", "-run", "^TestStaticcheckFindings$", "./internal/ci/"}, Test: "internal/ci TestStaticcheckFindings", Needs: []string{"internal/ci"}},
	{Name: "errcheck", Run: []string{"go", "test", "-tags", "functional", "-count=1", "-timeout", "600s", "-run", "^TestUncheckedErrors$", "./internal/ci/"}, Test: "internal/ci TestUncheckedErrors", Needs: []string{"internal/ci"}},
	{Name: "dead-code", Run: []string{"go", "test", "-tags", "functional", "-count=1", "-timeout", "600s", "-run", "^TestDeadCode$", "./internal/ci/"}, Test: "internal/ci TestDeadCode", Needs: []string{"internal/ci"}},
	{Name: "class-tests", Run: []string{"go", "test", "-count=1", "-timeout", "600s"}, Needs: []string{"internal/ci", "internal/docs"}},
}

BaseClasses includes the existing build and every class that guards a base. The whole-tree analyzers need the functional tag, but start no servers.

View Source
var BaseGateRetries = []time.Duration{2 * time.Minute, 5 * time.Minute}

BaseGateRetries is the base-gate rule's waits (cmd/nova-sprint, landgo.go): a base that fails its tree gate at its tip is gated again after the first, and again after the second; the failure after them is its third, and stops the stream (MergeReq.BaseRed, NBaseRed).

View Source
var BaseGateStops = len(BaseGateRetries) + 1

BaseGateStops is the refusals on one base that stop its stream: the first failure of its tree gate and one at each retry (BaseGateRetries).

View Source
var CostGapDecisions = []string{"ack", "wait"}

CostGapDecisions are NCostGap's decisions, the owner's: the cause is a cost not recorded, which no rework of a card fixes. They join Decisions, with the judgment's line in nova-sprint's help, in the change that starts the run loop's reconciliation (cmd/nova-sprint, owed: docs/SPEC-SPRINT.md, "What a card cost"); until then the judgment is opened only by `nova-sprint cost reconcile`, carrying these decisions itself.

View Source
var Decisions = map[string][]string{
	NReadyToAccept:     {"accept", "rework", "drop"},
	NReturned:          {"rework", "accept", "drop"},
	NWorkFailed:        {"rework with a fix", "drop"},
	NBriefDefect:       {DecisionRecut, "drop"},
	NReadBroken:        {"rework with the finding", "ask another reader", "drop"},
	NBriefWrong:        {"brief", "drop"},
	NConflict:          {"resolve and resume", "rework", "drop"},
	NRed:               {"take the suspect off and resume", "rework the suspect"},
	NCross:             {"rank that card first", "wait", "look at both", "return", "drop"},
	NRejected:          {"resume", "return", "drop"},
	NBaseRed:           {"resume", "wait"},
	NMissingBase:       {"rebase", "wait", "drop"},
	NBlocked:           {"drop", "ack"},
	NReadBranchMissing: {"ack", "rework with a fix", "drop"},
	NMissingNeed:       {"drop", "ack"},
	NCIRed:             {"rework with a fix", "return", "drop", "look", "ack"},
	NReadsExhausted:    {"ask another reader", "rework", "drop"},
	NStranded:          {"ask", "rework", "drop"},
	NRepairSkipped:     {"look at the card", "return", "drop", "rework", "ack"},
	NOpStuck:           {"check", "ack"},
	NOverdue:           {"act"},
	NStreamStale:       {"look", "wait"},
	NSprintDone:        {"clear", "add"},
	NSentinelReached:   {"release", "do more before going on", "drop"},
	NScoredLow:         {"add a repair card", "ack"},
	NTimer:             {"ack"},
	NStalled:           {"look at the card", "wait"},
}

Decisions open to each judgment type.

DriftTypes is the drift judgments' types, in the order the tick checks them.

View Source
var FriendSyncEnv = []string{"NOVA_PG_PASSWORD_ENV", "NOVA_SPRINT_REDIS_USER", "NOVA_SPRINT_REDIS_PASSWORD_ENV", "NOVA_BUS_REDIS", "NOVA_BUS_REDIS_USER", "NOVA_BUS_REDIS_PASSWORD_ENV"}

FriendSyncEnv is the environment a friend sync unit carries as it was typed: the names of the variables that hold the store's passwords and the bus's address and user, never a password (the unit is a file anyone on the machine may read). The passwords those names point at are the service's environment to give.

View Source
var HealthStates = []string{Up, DaemonPong, Down}

HealthStates are the words an observation carries; up alone shows as up.

View Source
var LaneKinds = []string{LaneGo}

LaneKinds is every lane kind there is.

View Source
var Moves = []Move{
	{Waiting, Ready, "resolve", Mechanical, "everything it needs has landed"},
	{Ready, Working, "deal", Mechanical, "a work card is cut and dealt"},
	{Working, Review, "finish", Mechanical, "its work card finished, ok or failed"},
	{Working, Ready, "fleet down", Mechanical, "its work card was withdrawn because no fleet member is up, or, still ready, because its route rests"},
	{Review, Merging, "accept", Coordinator, "the readers it needs said ok at this head (one for a flash card, two different for a pro card)"},
	{Review, Working, "rework", Coordinator, "rework with a fix: the next attempt is delegated at once to an up member"},
	{Review, Ready, "rework", Coordinator, "rework with a fix when no fleet member is up: start delegates it later"},
	{Merging, Review, "return", Coordinator, "the stream's CI went red and the coordinator sent it back, or return"},
	{Merging, Working, "redo", Coordinator, "redo a conflicted card with the tip's rework: delegated at once to an up member"},
	{Merging, Ready, "redo", Coordinator, "redo a conflicted card when no fleet member is up: start delegates it later"},
	{Merging, Landed, "merge", Mechanical, "its batch, green on the stream branch, merged to the development branch"},
	{Waiting, Landed, "release", Coordinator, "a sentinel reached, or with nothing before it, released by the coordinator (kind sentinel only)"},
	{Ready, Waiting, "add", Mechanical, "a sentinel inserted in front of it (only as the effect of inserting a sentinel)"},
}

Moves is the lifecycle: every legal move, and nothing else. Off the table (drop) is legal from every open state and is not a state.

View Source
var OpenUntil = time.Date(9999, 12, 31, 0, 0, 0, 0, time.UTC)

OpenUntil is the end of a rest that has no time: a provider resting for its funds rests until it is paid, a payment the balance poll sees (balance.go) or the coordinator's word that it was paid (funded), never until a clock (the owner, 2026-10-03: "exclude that provider moving forward"). The property holds it as `open`.

PassTypes are the pass's judgment types: its own and the automatic stops it keeps (StopTypes, stops.go). NFriendRowEmpty is the empty-row clock, not a judgment, and stays off this list.

PriorityLadder is the levels, highest first.

PrioritySettable is the levels a primary may be given (reader is a read card's alone).

View Source
var ProtectedBranches = []string{"dev", "main"}

ProtectedBranches is the branches of a repository the lander never lands on in an unmarked stream: dev, which promotion alone reaches, and main, the release branch (docs/SPEC-SPRINT.md section 7).

View Source
var RaiseReadTierDecisions = []string{"raise", "keep"}

RaiseReadTierDecisions are the judgment's decisions: raise, the default, and keep.

ReaderSpendCols are the spend columns in the order the readers table shows them.

View Source
var ReleaseChecks = []ReleaseCheck{
	{CheckNoStuckFriend, "no friend was stuck at any moment of the last " + StuckWindow.String(), NoStuckFriend},
	{CheckCardsSettled, "every card of the stream is landed or dropped with a reason: none is ready, waiting, working, review or merging", CardsSettled},
	{CheckBaseGateGreen, "the tree gate is green on the base at the stream's last landing: the unit class and the functional class of the packages the cards name, plus ./internal/docs and ./internal/ci", BaseGateGreen},
	{CheckTwoOKReads, "every landed card has the ok reads its tier needs at its final head, one for a flash card and two different readers for a heavier one, none accepted on the coordinator's word alone", TwoOKReads},
	{CheckProseTrue, "the stream's spec sections and help text are true to the code: nova-check links and nocode clean, present tense, no names of people or machines", ProseTrue},
	{CheckLandingsPromoted, "the stream's landings are in dev, or a promotion carrying them is queued since its last landing", LandingsPromoted},
	{CheckNoOpenJudgment, "no open judgment names the stream: no stale, no brief-defect, no conflict, no returned-to-review", NoOpenJudgment},
	{CheckMergeQueueP90, "the p90 of the time each card spent merging over the last " + MergeQueueWindowDefault.String() + " is under " + MergeQueueP90Default.String(), MergeQueueP90},
}

ReleaseChecks is the registry, in the order the verb runs them. A later card of stream sprint-v1-release adds its check here and its bar to the spec.

ReturnResolves is the judgments a return is a decision for: a red CI on the primary is discharged; a stream's red or rejected batch is answered and stays open while the stream is stopped.

ReworkResolves is the judgments a rework discharges on its primary.

View Source
var RowCardFields = []string{"blocker_working", "critical_working", "fix_working", "high_working", "reads_working", "normal_working", "low_working", "reads_ready"}

RowCardFields is the fields of a row's counts (RowCardCounts), highest level first.

RuleNames is every rule nova-config's answer_rules_off names, in name order.

View Source
var SelectorStates = []string{string(Ready), string(Waiting), "held", string(Merging)}

SelectorStates is the states a Selector's State names.

View Source
var ShownOrder = []string{Work, Friends, Fleet}

ShownOrder is the order where shows the tables in by default: work, friends, fleet. The readers and merge tables are hidden from the default frame (the owner, 2026-10-02: "I feel like reading and merging is something you can handle now. it seems to work, so please hide the reader and merge tables."); where --all draws them, in AllOrder, and where --json carries them always.

StageOrder is the stages in the order a card meets them.

States is every state, in the work table's column order.

StopTypes are the stop judgments, kept by the coordinator's pass as its own (PassTypes).

View Source
var TextFields = []string{"brief", "fix", "report", "finding", "reason", "return_reason", "did", "note", "ci_note", "why"}

TextFields are the fields whose words a move line carries in Text.

View Source
var TickDecisions = map[string][]string{
	NFriendSyncFailing: {"ack", "wait"},
	NBound:             {"rework with a fix", "drop", "wait"},
	NCannotAsk:         {"reader add", "rework", "drop", "wait"},
	NFewReaders:        {"reader up", "reader add", "wait"},
	NNoMember:          {"fleet beat", "fleet up", "wait"},
	NAdoptFailed:       {"fleet up <m>", "wait"},
	NStarving:          {"release", "wait"},
	NOverloaded:        {"fleet up <m> --width <half>", "wait 15m"},
	NReadersBehind:     {"reader up <r>", "restart <r>", "wait 10m"},
	NRaiseReadTier:     {"raise", "keep"},

	NBrokenReadsOutrun: {"look at the readers", "raise the read tier", "act"},
	NReaderBreaks:      {"look at the reader", "act"},
	NDevBehind:         {"promoted", "wait 30m"},
	NNoRoute:           {"route add", "look at the card", "drop", "wait"},

	NProviderFunds:  {"ack", "wait"},
	NProviderLow:    {"ack", "wait"},
	NProviderKey:    {"ack", "wait"},
	NAllOutOfCredit: {"ack", "wait"},
	NInvariant:      {"look at the card", "repair", "wait"},
	NWorkLate:       {"fleet level", "fleet down <member>", "wait", "drop"},
	NReadLate:       {"ask --another", "wait", "drop"},
	NMergeLate:      {"merge --stream <s>", "look", "wait"},
	NStalled:        {"look at the card", "wait"},

	NAlarmReview:  {"ack", "wait"},
	NAlarmMerging: {"ack", "wait"},
	NAlarmReady:   {"ack", "wait"},
	NAlarmFleet:   {"ack", "wait"},

	NFilesAlarm: {"fleet up <m> --width <half>", "fleet down <m>", "ack", "wait 15m"},

	NFriendDeaf:        {"ack", "wait"},
	NFriendIdle:        {"ack", "wait"},
	NCoordinatorBehind: {"act", "wait"},

	NDriftAhead:    {"act", "wait"},
	NDriftCardBase: {"act", "wait"},
	NDriftServer:   {"act", "wait"},
	NDriftBaseRed:  {"act", "wait"},
}

TickDecisions are the decisions open to the tick's judgments.

View Source
var TickEnd = []TickPartDef{
	{"check", TickCheck},
	{"deadlines", TickDeadlines},
	{"overdue", TickOverdue},
	{PartDone, TickDone},
}

TickEnd is the tick's end, once the tables are settled: what is always true held, the deadlines (with the backlog alarms, alarms.go), the overdue judgments (with the coordinator's pass, coordinator_pass.go), and the done part last. It writes notes, no table.

View Source
var TickParts = func() []TickPartDef {
	out := append([]TickPartDef(nil), TickStart...)
	for _, u := range TickTables {
		for _, p := range u.Parts {
			if p.Fn != nil {
				out = append(out, p)
			}
		}
	}
	return append(out, TickEnd...)
}()

TickParts is every part with a planner in the order a tick first runs them: the start, the four tables' updates, then the end.

TickRules is the rule parts, run at the tick's end before its checks.

TickStart is the tick's start, once, before any table's update: the fleet's level (ready cards from a member that cannot start them to one with free lanes, never past DealAhead times a width) and the readers' (asked reads from a reader with a backlog to one idle), each one batch. It runs once a tick: a table written again later in the tick is updated by its update, never levelled again.

View Source
var TickTables = []TableUpdate{
	{Work, []TickPartDef{{PartDrain, nil}, {"resolve", TickResolve}, {PartCapDeal, TickCapDeal}, {"deal", TickDeal}, {PartRebalance, TickRebalance}, {"accept", TickAccept}}},
	{Readers, []TickPartDef{{"ask", TickAsk}}},
	{Merge, []TickPartDef{{"resume", TickResume}}},
	{Fleet, []TickPartDef{{"presence", TickPresence}, {PartFriendStall, TickFriendStall}}},
}

TickTables is the tick's shape: each table gets one update in turn per tick, work streams, then readers, merge and fleet. The work table's update is the pump, run once a tick: its queue drained, then its cards advanced (a waiting card to ready, a ready card to working by the deal, a card queued behind lanes that all work to an idle lane of either side by the rebalance (Rebalance), a card in review with the ok reads it needs to merging); "no new work moves from waiting -> ready -> working except on the FIRST PASS on the work stream table, once per-tick". The readers', the merge's and the fleet's updates each write their own table, and queue their changes of the work table for the next tick's pump; a table another update wrote is updated again, at once, until none is ("the tick doesn't end until all dirty bits are cleared"). The model is tla/DirtyTick.tla.

TidyKinds is every kind, in the order the verb names them.

View Source
var UnitKinds = units.UnitKinds

UnitKinds is every unit a running sprint needs, in the order a machine is brought up.

View Source
var ViewOrder = []string{Work, Readers, Merge, Fleet}

ViewOrder is the order the stored view shows the four tables in.

Functions

func AcceptHeld

func AcceptHeld(c *Card) string

AcceptHeld is why the pump leaves a primary in review that has the ok reads it needs at its head for the coordinator, "" when it accepts it (R9's two holds, docs/SPEC-SPRINT.md section 6):

  • its CI is red at its head (CIRedAtHead): "ci red on a primary" is the coordinator's to decide (rework, return, drop, ack); the coordinator's accept still takes it;
  • it was returned to review at its attempt (ReturnedAtAttempt): the coordinator sent it back, and "returned to review" decides it (rework, accept, drop); its reads stand, but only a new attempt's own reads are the pump's to accept.

The holder of a primary in review (reviewAccepts) and reviewJudgment read the same holds, so no primary in review is silent. The model is tla/DirtyTick.tla Held and AcceptHolds.

func AddIDs

func AddIDs(s *Snapshot, r AddReq) []string

AddIDs is the ids an add admits: the named ones, or Count generated ones numbered after the highest the stream has.

func AdoptingHeld

func AdoptingHeld(ctl *Card) bool

AdoptingHeld says the member is held by the tick while it adopts.

func Alias

func Alias(n int) string

Alias is the alias of the n'th note written in the epoch, counted from 1.

func AllOutOfCredit

func AllOutOfCredit(routes []Route, rests map[string]RouteRest, now time.Time) string

AllOutOfCredit is the words of FundsCause when every enabled route of every tier rests at now because its provider is out of credit (RouteRest.Out: a take refused for credit, or a balance at or under zero), naming the providers; "" when a route serves, or rests for another cause (a provider low on funds included: it still has money), or there is no enabled route.

func AnyFriendUp

func AnyFriendUp(friends []FriendSeat) bool

AnyFriendUp says a friend on the roster is up with a width over zero.

func ArchivedStreams

func ArchivedStreams(s *Snapshot) []string

ArchivedStreams is the streams whose work row is archived, in row order.

func AtStagingBound

func AtStagingBound(s *Snapshot, pr *Card, up []string) (*Card, []ProviderTake)

AtStagingBound is the primary's withdrawn work card when every member up (up, at least one) refused it at staging, and the refusals: the deal has no member to place it on, and the tick deals it no more until a member that has not refused it is up, or the coordinator reworks or drops it. nil when it is not.

func AttemptLine

func AttemptLine(wc *Card) string

AttemptLine is one attempt's record as `card <id>` prints it: the work card's route, model and tier, its member, when it was dealt, taken and finished, how it ended, the head it pushed (head=, "-" when none) and what it spent.

func AttemptLines

func AttemptLines(wc *Card) []string

AttemptLines is the work card's lines as `card <id>` prints them: one for each take of it that ended with no work to judge (end=provider failure: the line, or end=no result: the line, with the route, model, member and usage of that take), one for each launch refused at staging (end=staging refused: the reason, with its generation and member), then the card's own (AttemptLine), the take it is on or ended.

func AttributionOnly

func AttributionOnly(finding string) bool

AttributionOnly reports whether every sentence of a reader's finding is about attribution: the commit trailer, the By: line, the model or harness named, or a request to amend them. A finding with any sentence about the work (or an empty one) is not attribution-only: a defect plus an attribution remark is kept. A worker names the model and harness it actually ran, which may differ from what a brief guessed; that is honesty, never a defect.

func BackupOf

func BackupOf(working, review, merging int) string

BackupOf is the backup state of the three counts of the work table (BackupNone, BackupReads, BackupMerges): merges when merging exceeds review plus working, reads when review exceeds working, else none.

func BaseGreenStreams

func BaseGreenStreams(s *Snapshot) []string

BaseGreenStreams are the streams stopped on a base's red that the lander found green again, in stream order: the base-gate rule's to resume.

func BaseRedStreams

func BaseRedStreams(s *Snapshot) []string

BaseRedStreams are the streams stopped on a base's red and not yet found green: the ones a land pass re-checks the base of.

func BehindLevel

func BehindLevel(s *Snapshot, r TickReq, since time.Time) int

BehindLevel is the escalation level of the judgments late on the coordinator: one level for every BehindEscalateEvery of running time since since, the overdue line of the oldest of them the pass counts (behindConds).

func Bench

func Bench(c *Card) []string

Bench is the primary's bench (FieldBench): the members its brief's BENCH line names, nil when it names none (docs/SPEC-SPRINT.md section 5, a card's BENCH line).

func BenchKnown

func BenchKnown(s *Snapshot, bench []string) []string

BenchKnown is the names of bench that are no fleet member of s (Snapshot.Members): what add refuses a brief for, so a card is never admitted waiting for a member the fleet has not got (docs/SPEC-SPRINT.md section 5, a card's BENCH line).

func BenchOfBrief

func BenchOfBrief(brief string) (bench []string, why string)

BenchOfBrief is the bench a brief gives its card (FieldBench), read from its header block (the `key: value` lines under line 1, as cardhdr.ReadWho reads WHO): nil and "" when the brief names no bench, else the members it names. why is "" or the one line naming what is wrong with the line and what to write (docs/SPEC-SPRINT.md section 5, a card's BENCH line).

func BenchRefused

func BenchRefused(s *Snapshot, bench, unknown []string) string

BenchRefused is add's refusal of a brief whose BENCH line names no fleet member, with the members there are and the remedy (docs/SPEC-SPRINT.md section 5, a card's BENCH line).

func BoundClass

func BoundClass(wc *Card) string

BoundClass is the class of the attempt whose withdrawn work card wc reached its redeal bound, the record's class (failureSet): the class of its last two takes when they ended the same way (identicalEnds), else the class of the take that ended last. A take the provider failed has no class inside an attempt (it is the provider's, and is redealt); across attempts it is `provider failure` with the provider's class word when its line has one (`provider failure: class=out-of-credit`), so an attempt the provider ended counts toward rule 2 as a take that left no result does, and is what lets the provider's return lift the bound (providerBack). "" when the last take kept no record (its member went down).

func BranchOf

func BranchOf(prefix string, epoch uint64, workCard string, gen int) string

BranchOf is the branch one launch of a work card's attempt is worked on: one per launch, named by the sprint (its prefix, the card), the launch's generation and its epoch, as the slot and job names are: sprint/<prefix><card>.g<gen>.e<epoch>. A card id comes back after a clear, and a branch named by the card alone holds the last epoch's push, so every push of the next would be refused non-fast-forward; and a card dealt again within one epoch (withdrawn from a member, or redealt after a staging or provider failure) is another generation, whose push would collide with the first launch's on a branch named by the epoch alone.

func BriefDefectOf

func BriefDefectOf(report string) string

BriefDefectOf is the brief defect a failed finish's report names: "" when it names none, else its reason (docs/SPEC-SPRINT.md section 1, a brief defect). Each of the four reasons alone names one, the earliest in the report winning: the base lacks a PATHS file ("the base lacks", "not on the base", "does not exist on the base"), a duplicate of landed work, a decision delivered, and PATHS do not hold what the brief names. That last one carries the worker's proposed PATHS when the report has them (PATHS-PROPOSED, else a PATHS: line), the one-line fix. The label "brief defect" with none of them names one in the worker's own words. A negated reason or label ("not a duplicate of landed work", "no brief defect", "not PATHS do not hold") names none, and a hyphenated token (a card id such as hold-is-a-brief-defect, or paths-do-not-hold) is no label. A report that only proposes PATHS, without those words, names none, so the paths rule can still widen it.

func BriefKind

func BriefKind(brief string) string

BriefKind reads the task kind from a card brief's typed header (the KIND: line the card lint reads): "" when it names none, and a KIND: line in the body grants nothing.

func BrokenReadsOutrun

func BrokenReadsOutrun(s *Snapshot, stopped func(from, to time.Time) time.Duration) (string, bool)

BrokenReadsOutrun is the "broken reads outrun ok reads" judgment's line, and whether it holds: over the window broken verdicts exceed ok ones, at least ReadsWindowMin in all.

func BuildMatch

func BuildMatch(a, b string) string

BuildMatch compares two builds' version lines: the same twelve hex of a revision when both carry one (buildinfo's vcs stamp, whatever else each says) is the same build, and two revisions that differ are different; a build with no revision that is unstamped ("devel", buildinfo's word for a build with no origin recorded) or empty is unknown, never the same, whatever the other is; else two release tags compare as text.

func CIRedAtHead

func CIRedAtHead(c *Card) bool

CIRedAtHead says the primary's last CI observation is red, for its current head (a red for an older head is not about the work in review).

func CardHolder

func CardHolder(s *Snapshot, c *Card) string

CardHolder is the member, or the friend, whose fleet row holds the primary c's working card; "" when none does.

func CardID

func CardID(stored string) string

CardID is the card's id of a stored id.

func CardPriority

func CardPriority(c *Card) (level, source string)

CardPriority is the card's level and where it comes from: reader for a read card ("read"; its inherited level, the higher of reader and its primary's, is ReadPriority); its own set level ("set"); critical by its weight ("computed"); else normal ("default").

func CardTier

func CardTier(c *Card) string

CardTier is the tier the dealer reads on the primary c: the tier its last deal drew (FieldTierNow), a pinned tier or model, else its brief's line 1 (flash when it names none).

func CardTiers

func CardTiers(c *Card) (now, ceiling string)

CardTiers is the tier the primary is on (cardTier) and its ceiling, as `card` prints them.

func CardsBy

func CardsBy(rows []CardRow, by string) (counts map[string]int, ok bool)

CardsBy is the rows counted by the field named: tier, stream, col or holder ("-" for no holder); ok is false for any other name.

func CheckRollbackOnLandFailure

func CheckRollbackOnLandFailure(target string, landErr error, now time.Time) (rolledBack bool, err error)

CheckRollbackOnLandFailure checks whether target binary was recently switched with rollback enabled, and if a land failed within the rollback window, rolls back to previous binary (docs/SPEC-SPRINT.md section 14; item 14).

func ClassGateWhy

func ClassGateWhy(dir, base, sha, why string) string

ClassGateWhy names the first red run with the repair card the generator stamps for it. The existing base-gate rule stores this on its one judgment. This is the metadata half of SPEC-SPRINT's base class gate, not another gate.

func CollectVerdict

func CollectVerdict(report string) (verdict, head string)

CollectVerdict is a report's verdict (the first word of its first Verdict: line, upper case, markdown and punctuation trimmed; "" for none) and its head (the first word of its first Head: line, lower case), as the daemon's outbox pass reads them.

func ComeBack

func ComeBack(ctl *Card, stream string) (*Card, PlaceAgain)

ComeBack is a removed stream's control card as the place that brings it back leaves it (on its merge row's control cell, its revision bumped, its fields as the removal left them), and that place: the add that names the stream adds its rows and places the record again before its manifests (Plan.Places), and says so, a NOTE line. A batch never places a removed member, so the record is placed by the table layer's cell add, as a fleet member's control card is when it rejoins (store.RejoinMembers). Stream archive is the verb that takes landed streams off the table and keeps their rows; stream remove takes off a stream that holds no card, and its name is free for an add at once.

func CompactTokens

func CompactTokens(n int64) string

CompactTokens is a token count as the friends table shows it: under a thousand as itself, else one decimal place, half up, with a 1000-based suffix (1.2M, 2M).

func CostWord

func CostWord(u cardcost.Usage) string

CostWord is the cost a COST line shows for a record: which of the dollar figures it holds (Usage.Present), or tokens for a subscription run.

func CriticalLine

func CriticalLine(cards []CriticalCard) string

CriticalLine is where's line under the summary: "critical: <id> <n> behind, <state>; ..."; "" when nothing is critical.

func CtlID

func CtlID(name string) string

CtlID is the identity of a stream's or a member's control card.

func DeadBaseHeld

func DeadBaseHeld(s *Snapshot, c *Card, base string) bool

DeadBaseHeld says the land pass skips the card: it is marked dead on the base it names now, and that judgment is open. A re-pointed base or an answered judgment arms it again.

func DeadBaseWhy

func DeadBaseWhy(id, base string) string

DeadBaseWhy is the one sentence of a dead base, the lander's refusal and the judgment's.

func Deadline

func Deadline(median float64, n int, own int) int

Deadline is the unified deadline function for both members and friends (docs/SPEC-SPRINT.md section 5, the deadline). It returns the larger of own and DeadlineK times the median run wall over the last n ok attempts, when n > 0; otherwise it returns own.

func DealtTier

func DealtTier(c, primary *Card) string

DealtTier is the tier a dealt card's packet names (Packet.Tier), never empty (dealt-packet-carries-the-tier.w1; on 2026-10-05 the audit cards were dealt with no tier in the packet, a flash friend's runner read "tier -" and handed back its own pinned cards): the tier the card's route was drawn from (FieldTier on the work or read card), else the tier its primary is on (cardTier: FieldTierNow, or the tier pinned, or its brief's line 1), else the stream's default, flash. It is the tier every friend deal gates on (friendTakes), so a friend's packet names a tier her class covers.

func DecideDue

func DecideDue(s *Snapshot) (grades []GradeAsk, outcomes []DecideOutcome)

DecideDue is the decide lane's work in the snapshot: every primary to grade (Gradable), and the outcome of every decision of a primary that landed or was dropped, read from the card (the attempt decisions it records, PrefixDecided, and its grade): a card landed at attempt n on tier t labels an attempt decided at n `landed` and one decided earlier `later-<t>`, and its grade t; a card dropped labels every decision `dropped` (decide.AttemptLabel, decide.GradeLabel). The lane attaches each once.

func DecidedWords

func DecidedWords(line string, used bool) string

DecidedWords is a work card's attempt decision as `card` prints it on its ATTEMPT line, " decided=<class>:<p>", with " decided_used=yes" when it routed the finish; "" when the card carries none.

func DocChanged

func DocChanged(diff string) map[string]DocLines

DocChanged is what a unified diff does to each file, by the new side's path: the lines it writes and the runs of lines it deletes, so that a deletion-only change is judged on the file it leaves as an addition is (E4 judges the result, not the added backquotes).

func DocFile

func DocFile(file string) bool

DocFile says file is a document the repairs read: a Markdown or text file.

func DocProse

func DocProse(globs []string, file string) bool

DocProse says file is under one of a stream's prose globs (PATHS globs, `**` across directories): a file whose backquotes are its own and are not checked at all.

func Dollars

func Dollars(v float64) string

Dollars is an amount as dollars and cents, rounded up to the cent, a negative one with its sign first (-$0.51).

func DoneWhat

func DoneWhat(landed, dropped int, now, started time.Time) string

DoneWhat is the words of "the sprint is done": the counts and, when the first start is known, how long the sprint took from it in wall time.

func DueNow

func DueNow(now, due, set time.Time, stopped func(from, to time.Time) time.Duration) bool

DueNow is the tree's one "is this due at now" test: the clock time due is reached at now when the running time from set to now has reached due's own distance from set, so the time the machine was STOPPED never counts (docs/SPEC-SPRINT.md, "Timers" and "Deadlines"). A timer is based at the time it was written and a judgment's review time at the time wait set it; a due with no base recorded is read against the wall clock. The timer tick (timers.go, DueTimers) and the judgment review time (steps_tick.go, JudgmentOverdue) both call this and there is no second clock comparison, so a later external wait operand (`after <time>`) calls the same function.

func EvidencePaths

func EvidencePaths(what string) []string

EvidencePaths is the paths a judgment's words name: a word with a slash in it, or ending in a file extension a report or a finding has (.md .json .txt .log), in the order named.

func FailingTests

func FailingTests(why string) []string

FailingTests are the tests a tree gate's finding names as failing, once each, in order.

func FailureClass

func FailureClass(line string) string

FailureClass is what a failed end is compared by: a take whose child left no result is the class `no result` whatever its line says; any other end is its reason, the first line up to the member's "; " (member.Judge puts its reason first and the child's report after it: `verdict not-done; <the child's line>`), trimmed and cut to MaxProviderErrorBytes. A verdict's reason is broad, so its class takes the first VerdictWords words of the child's line too (after the member's `pushed=<sha> to <branch>: `). A take the provider failed, a launch refused at staging or at launch, and a gate red only on failures the gate decision classed pre-existing (`pre-existing: <test>`) are the member's, the base's or the provider's, never the card's (docs/SPEC-SPRINT.md section 2), so they have no class, and an empty line (a take that ended with its member down) has none: an end with no class is never the same as another.

func FailureWhat

func FailureWhat(g Goal) string

FailureWhat is the words of the judgment for a person whose route fails.

func FilesAt

func FilesAt(b Beat, now time.Time) (hostload.Files, bool)

FilesAt is the member's open-files reading while its beat is fresh and the reading was taken within BeatDeadline of now: a beat that gave its load and could not count its descriptors carries none, and an older reading is no reading.

func FilesOutsidePaths

func FilesOutsidePaths(brief, finding string) []string

FilesOutsidePaths is every repository file the finding names that the brief's PATHS do not cover, each once, in the order named; nil when the brief names no PATHS. A file is a relative path with a directory and an extension of letters, read through backticks, brackets, quotes and a trailing line number; absolute paths, paths that climb with .., URLs and branch names are not files. PATHS cover a file by its name, a glob (hygiene.MatchGlob) or a directory ending in /, and every PATHS covers a file a change must touch to keep the tree green (cardgen.AlwaysInPaths): such a finding is a rework, never a twin.

func FilesText

func FilesText(b Beat, now time.Time) string

FilesText is the member's files word: the count and warn or alarm while a fresh reading is over its warn bound, else empty.

func FindingClass

func FindingClass(finding string) string

FindingClass is what two findings are compared by: the whole finding, its whitespace collapsed and its case folded (two findings that share a first sentence, or a first line, and differ after it are two findings); and a finding of files outside the card's PATHS, however it is worded ("files outside PATHS", "outside its PATHS"), is the one class `files outside paths`. "" for an empty finding.

func FindingKey

func FindingKey(reader, finding string) string

FindingKey is what makes two findings identical: the reader's class and the first file and line the finding names, "<reader> at <file>:<line>"; a finding that names no file and line is its whole-text class (FindingClass), whoever found it. The reader's class is its row of the readers table, case folded: one reader is one class of reader, and a friend's row (friend.<name>) is hers; a finding with no reader (the report of failed work) is the class "work". "" for an empty finding.

func FixBrief

func FixBrief(r RedTest, sp FixSpec) string

FixBrief is the fix card's brief for one failing test, the card's own text (the rules paragraph is the caller's): line 1 its id and the heavy tier, REPO and BASE, START the test and its failing line from the log, STOP the test green on the runner it failed on, PATHS the test file and the package, TEST the test. A job named functional runs the test under -tags functional.

func FixCardID

func FixCardID(test string) string

FixCardID is the fix card of a failing test: red-<TestName>.

func FixStateCounts

func FixStateCounts(s *Snapshot) map[string]map[string]int

FixStateCounts is the dashboard's repair state, partitioned by original column. Completed work waiting for a read remains review, even when its priority is fix. Counts are captured by the tick, so the dashboard never scans cards per refresh.

func FleetRowStatus

func FleetRowStatus(ctl *Card, b Beat, now time.Time) string

FleetRowStatus is a member's status cell in the fleet table at now: adopting while the tick holds it to adopt, its own status beside up, held and down, and never up whatever it beats; else MemberStatus.

func FleetWorking

func FleetWorking(s *Snapshot) (working, width int)

FleetWorking is the work cards working on the machines up, and their widths' sum.

func FolderProve

func FolderProve(name, nonce string) string

FolderProve is the command that answers the check written as PROOF-<nonce>, run from inside the session: the existing seat pong.

func FolderSteps

func FolderSteps(rec PushRecord) string

FolderSteps is the two commands a session on the folder adapter runs, on one line: the Monitor on the folder, and the answer to the last check written there. The placeholder is always literal: only the folder reveals the nonce.

func FolderWatch

func FolderWatch(dir string) string

FolderWatch is the native Monitor command (SPEC-SPRINT, "The push proof"). It prints complete file paths, one event per file, and writes nothing.

func FriendBootstrap

func FriendBootstrap(friend string) string

FriendBootstrap is the command that loads the friend's agent.

func FriendCard

func FriendCard(c *Card) (name string, ok bool)

FriendCard says the primary names a friend, and names that friend ("" for any friend). A hard pin (only.friend.<name>) names her too.

func FriendCardMoved

func FriendCardMoved(s *Snapshot, f string) time.Time

FriendCardMoved is the newest move of a card of hers that she or her daemon made: a progress stamp, or a take, on a card ready or working on her row; zero when none.

func FriendChargedFromCards

func FriendChargedFromCards(cards []*Card) string

FriendChargedFromCards is the dollars a friend's cards charged, exact: each card's usage record's actual cost where it reported one, else its predicted one, summed by cardcost.Total. "" when no card named a cost.

func FriendDownWhy

func FriendDownWhy(f FriendPresence, now time.Time) string

FriendDownWhy is why FriendStatus does not say up at now, in the words a take refused for her names (takeOne): held by the coordinator; her beat says down, until when and why; or the session evidence she lacks as FriendEvidence names it (her beat is never evidence). "" while she is up.

func FriendEvidence

func FriendEvidence(f FriendPresence, now time.Time) (string, string)

FriendEvidence is FriendStatus with the evidence it rests on, as her row names it: for up, the evidence and its age ("session pong 3m0s ago", "finish 12m0s ago"); for down, what is missing, each with the age of the last one seen, and the beat's age when she beats, so a row read down while her daemon beats says why; for a beat that says down, until when and why; for held, "held".

func FriendLabel

func FriendLabel(friend string) string

FriendLabel is the launchd label that beats the friend.

func FriendMedianWall

func FriendMedianWall(s *Snapshot, name string) (median float64, n int)

FriendMedianWall is the friend's median run wall in seconds over her last DeadlineSamples ok attempts (RunWall of the ok work cards on her row, newest finished first), and how many samples it is over; 0 and 0 with none. A stats tidy carries it through (PropCarriedMedian), as MemberMedianWall's.

func FriendOfRow

func FriendOfRow(row string) (string, bool)

FriendOfRow is the friend whose row it is; false for a machine's row.

func FriendQueueStrays

func FriendQueueStrays(queue map[string]string, held []string) []string

FriendQueueStrays is every id of her queue that names none of held (the ids and jobs of the cards working on her row), sorted: named by reconcile, never acted on.

func FriendQueueWorking

func FriendQueueWorking(a FriendAccount) int

FriendQueueWorking is how many tasks of her account say working.

func FriendReadBrief

func FriendReadBrief(name, primary, brief, branch, start, head string, attempt int, deadline time.Time) string

FriendReadBrief is the BRIEF.md of a friend's read: WHO, the attempt's branch, the commit it started from and the head under review, the deadline, and the primary's AS A READ section through the next heading (docs/SPEC-SPRINT.md, a read asked of any unit with room at or above the read tier).

func FriendReadOutboxLine

func FriendReadOutboxLine(row, id string, epoch uint64) string

FriendReadOutboxLine is how a read on a friend's row is returned: her outbox report, which friend sync reads (FriendReadClose), or the read verb her packet prints, which writes the same close (readCardVerb).

func FriendReconcileOf

func FriendReconcileOf(wc *Card, job string, reported bool, a FriendAccount) (action, why string)

FriendReconcileOf is what reconcile does with the work card wc, delivered as job, working on a friend's row (docs/SPEC-SPRINT.md section 1, friend reconcile): collect when her report is there (reported); else by her account's state for it (by the card's id, else by its job): keep while queued or working, return when done, and return when absent only if it was dealt before her account was last written: a card dealt since, or with no deal stamp to compare, is one she has not had the chance to account for, and is kept. A state it does not know is kept and said. why says it in a line.

func FriendRestrictionWhy

func FriendRestrictionWhy(streams, kinds []string, stream, kind string) string

FriendRestrictionWhy applies one friend's configured stream globs and KIND values to a card's stream and kind: "" when the card is within the restriction (either list empty is no restriction, Split reads the comma lists nova-config carries), else the sentence the add, the brief and the deal refuse or skip with (docs/SPEC-SPRINT.md section 1, a friend's card).

func FriendRow

func FriendRow(name string) string

FriendRow is the fleet row, and the member, a friend's cards are dealt to.

func FriendStatus

func FriendStatus(f FriendPresence, now time.Time) string

FriendStatus is the one rule of a friend's status at now: held while the coordinator holds her (friend down); else down while her last beat says so (SaysDown: her harness at its limit, until when and why; a beat can say down, never up); else up only on evidence from her own session within its window (FriendEvidence): a wake ping her session answered (the coordinator's friend health --state up, under the current seat generation) under FriendPongWindow old, or her session's answer to a check her daemon asked, proved on her beat (friend beat --check, then --pong naming its nonce; ProveBeat; Beat.Proof) under FriendProofLive old while her beat is fresh, or a card of hers finished under FriendFinishWindow old; else down. Her beat itself, whoever sends it, is never evidence: a daemon or a loop beating for her says an app is open, not that her session can work; only the session's answer it carries is. Releasing a hold (friend up) is no evidence either.

func FriendSyncUnitFile

func FriendSyncUnitFile(goos string) string

FriendSyncUnitFile is the unit's file name on goos, "" where there is no service manager the loop is installed under.

func FriendTokensCell

func FriendTokensCell(tokens int64, charged, billing string) string

FriendTokensCell is the friends table's tokens cell. A subscription friend (an empty or subscription billing word) shows the compact token count; a friend the row bills per call (api or metered) shows the charged dollars to the cent, rounded up. Until the billing field is set, every friend is a subscription.

func FriendTokensFromCards

func FriendTokensFromCards(cards []*Card) int64

FriendTokensFromCards is the token total of a friend's cards: each card's usage record (FieldUsage) summed over the classes the column counts, input, output, cache read and cache write, never reasoning. A card with no usage record adds nothing.

func FriendUsage

func FriendUsage(text string) (cardcost.Usage, bool)

FriendUsage reads a friend card's usage out of the report her session wrote: the first `usage:` line, whose in, out and cache words are cardcost's input, output and cache read, or a `tokens:` line, or the tokens segment of the friend machinery's `Cost:` line (intern/friend, lane_parity.go, PublishCost). ok is false when the text names none of the classes.

func FriendWorked

func FriendWorked(s *Snapshot, f string, w FriendWork) (time.Time, string)

FriendWorked is the newest evidence that friend f is at work, and what it is (docs/SPEC-SPRINT.md section friend-stall-ladder-r.w1): her session's writes, her beat naming running cards, her session's proof (a check answered, or a bus message of hers), her session's answer to the coordinator's wake ping, a finish of hers (the store's record, or a card done on her row), a report of hers (FieldReported on a card of her row), and the coordinator's view of her row ("active"). Card progress and takes are the cards', not hers (FriendCardMoved): they hold the stall ladder and never release her. Zero and "" when there is none. On 2026-10-06 one field, her daemon's walk of her working directory, read three days old while her outbox had reports that hour and her bus notes came every few minutes, and the ladder took two working cards back from her.

func FriendsDealtFleet

func FriendsDealtFleet(s *Snapshot) map[string]int

FriendsDealtFleet is each friend's count of the fleet's cards she holds (where --json dealt_fleet; docs/SPEC-SPRINT.md section 1, a friend's card): the work cards on her row, ready and working, whose primary carries no WHO line (a bare WHO: friend, a named and a hard pin are friends' cards). A friend with none is absent.

func FriendsDef

func FriendsDef() ntable.Table

FriendsDef is the friends table's shape: the fleet table's columns but load. ready and working count her job cards in those states; width is her width as text, summed; ok and failed (hidden) count her jobs done ok and done failed, and done and ok% are the table's formulas over them, the footer pooling ok% over the friends; status is text with no fold, and so is active, how long ago her session last wrote a file (her beat's Active; "-" when none was reported); tokens is her cards' usage summed (sprint.FriendTokensFromCards): a text cell with a subscription friend's compact count (1.2M), or an api-billed friend's charged dollars rounded up to the cent. The rows are the friends'; where draws them from store.FriendRows.

func GCAIRoot

func GCAIRoot(home, aiRoot string) string

GCAIRoot is the AI root a pass works under: aiRoot when it is a directory, else the one the home's <name>-working links name (resolved); "" none.

func GCLane

func GCLane(log, job string) string

GCLane is the state of a job's lane in a runner's log (`<time> START|RESUME|LIMIT|END <job> ...`, one event a line, as a bud's runner writes it; RunnerEnded reads the same).

func GCVolumeIn

func GCVolumeIn(out string) (use int, ok bool)

GCVolumeIn is the fullest use, in percent, that out says: a gc's summary line, else the Capacity column of df -P's lines (the probe GCProbeLine runs); ok is false when it says none.

func GCVolumeUse

func GCVolumeUse(path string) (int, error)

GCVolumeUse is the use, in percent, of the volume holding path, as df counts it: the blocks in use over those in use and those an unprivileged writer may still use, rounded up.

func GoneHolding

func GoneHolding(s *Snapshot, want []SyncMember, machines []string) []string

GoneHolding is a line for each member with no machine row in the inventory that cards keep on the fleet: it stays held, and a sync removes it once no card stays on it.

func Gradable

func Gradable(c *Card) bool

Gradable says the primary c is graded by the decide lane: a card with a brief, not a sentinel, never dealt (attempt 0), waiting or ready, and not graded yet.

func HarnessFault

func HarnessFault(report string) string

HarnessFault is the class of a failed report that is a harness fault, "" when it is none.

func HarnessFix

func HarnessFix(attempt, class, report string) string

HarnessFix is the fix of an attempt that ended on a harness fault: the fault, and the attempt done again from the staged tip, where its work may stand already.

func HasBefore

func HasBefore(s *Snapshot, c *Card) bool

HasBefore says a sentinel has something to be reached after: a need it names, or a primary of its stream that sorts before it.

func HeldBack

func HeldBack(s *Snapshot) int

HeldBack is how many primaries no tick moves on its own: every sentinel not released, every card admitted held, and every waiting card that waits, through a need or its place in line, on one of those. where shows them as held=N (nova-tools#5096 item 16), and its ETA counts every card not landed, held ones included (docs/SPEC-SPRINT.md section 1, 2026-10-02). Everything it counts is waiting, so a snapshot of the work table's waiting column is enough.

func HeldInInventory

func HeldInInventory(s *Snapshot, want []SyncMember) []string

HeldInInventory is the members of want the coordinator holds down (a hold the sync made is not one): a sync leaves their hold, and says so.

func HeldToFinish

func HeldToFinish(ctl *Card) bool

HeldToFinish says a member's hold lets its working cards finish (hold with no --return): no sweep moves them, and the no-stall rule counts the member as holding them while their deadline runs (docs/SPEC-SPRINT.md sections 5 and 11).

func HidePushNonces

func HidePushNonces(rec PushRecord, text string) string

HidePushNonces keeps delivery errors from exposing proof filenames through status (SPEC-SPRINT, "The push proof"), including failures stored by an older writer.

func HoldFindings

func HoldFindings(report string) bool

HoldFindings says a failed report is a HOLD that carries findings: the verdict HOLD, and a file and line it names.

func HoldTargets

func HoldTargets(s *Snapshot, r HoldReq) ([]HoldTarget, []Refusal)

HoldTargets is what each name names: a fleet member, a reader, a friend or a stream; a name that names none, or more than one, is refused naming every kind it matched.

func IDEpoch

func IDEpoch(id string) uint64

IDEpoch is the epoch an operation, notification or judgment id belongs to: the number after its last '~', 0 when it has none.

func InConflict

func InConflict(s *Snapshot, c *Card) bool

InConflict says whether a primary card is in a merge conflict: it is in Merging, its merge card is in Stuck, and its stream is stopped for conflict on this card.

func InstallFleetBack

func InstallFleetBack(a Adopter)

InstallFleetBack makes FleetBackPresence(a) the presence part the machine runs (TickTables and TickParts), as friend_read.go installs the friend ask: the binary that knows the release it runs installs it at its start, before any tick.

func IsAlias

func IsAlias(word string) bool

IsAlias says the word is a judgment's alias, j<n>.

func IsCritical

func IsCritical(c *Card) bool

IsCritical says the primary's weight, as the tick last wrote it, makes it critical.

func IsFriendRow

func IsFriendRow(row string) bool

IsFriendRow says the fleet row is a friend's.

func IsHeld

func IsHeld(c *Card) bool

IsHeld says the primary was admitted held (add --held): it stays waiting until the coordinator's release (nova-tools#5096 item 15).

func IsNoResult

func IsNoResult(report string) bool

IsNoResult says a failed finish's report names no result as the cause: it begins with the finish kind `no result` (cardhdr.EndNoResult), the member's word when its child ended by itself having written no result at all.

func IsNothingNew

func IsNothingNew(report string) bool

IsNothingNew says a failed finish's report is the member's word for no new work: its child found nothing to do (cardhdr.EndNothing) or committed nothing (cardhdr.EndNoCommit).

func IsOpen

func IsOpen(s State) bool

IsOpen says a primary in s has not landed: drop may take it off the table.

func IsPromotionStream

func IsPromotionStream(s *Snapshot, stream string) bool

IsPromotionStream says the stream is the promotion stream: its control card carries the mark FieldLandProtected, which only the coordinator's `nova-sprint stream set <s> --land-protected <owner/name,...|any>` writes (Set) and `--land-protected default` takes off (docs/SPEC-SPRINT.md section 7, the sprint branch).

func IsProviderFailure

func IsProviderFailure(report string) bool

IsProviderFailure says a failed finish's report names the provider as the cause: it begins with the finish kind `provider failure` (cardhdr.EndProvider), the member's word when its child's run ended on the provider's error (docs/SPEC-CARD-CONTRACT.md, section 4).

func IsRulePart

func IsRulePart(name string) bool

IsRulePart says the tick part is a rule part: it plans with the routes and the rules turned off (nova-config's sprint row).

func IsSentinel

func IsSentinel(c *Card) bool

IsSentinel says the primary is a sentinel.

func IsStagingRefusal

func IsStagingRefusal(report string) bool

IsStagingRefusal says a failed finish's report names its member's staging as the cause: it begins with the finish kind `staging refused` (cardhdr.EndStaging), the member's word when its machine refused the launch before any child ran.

func JudgmentOverdue

func JudgmentOverdue(s *Snapshot, r TickReq, n Note) bool

JudgmentOverdue says the judgment is past its due time in running time: its review time when the coordinator set one (wait), else DeadlineJudgment after it was written.

func LandOrder

func LandOrder(s *Snapshot, streams []string) []string

LandOrder is the streams in the order land takes their batches: by the highest level of any card in the stream's merging set (cardRank; never the stream's default, never its oldest card), highest first, then by the most cards behind any of them (FieldBehind), then the order given; inside a stream the batch stays as it is (the owner, 2026-10-06: "a normal stream with one critical card merging goes ahead of a high stream whose merging cards are all high").

func LandPause

func LandPause(ctx context.Context, w MergeWindow, now time.Time, q MergeQueue, repo, branch string) string

LandPause is why the lander does not land onto branch of repo at now, "" when it lands (docs/SPEC-SPRINT.md section 7, the lander's pause): the window open, first and asking no forge; then the branch's merge queue holding a group, or not read. A nil q asks no queue (a dry run reads the store only).

func LandRefusedFix

func LandRefusedFix(why string) string

LandRefusedFix is the fix of a card whose head the landing refused (landRefused): why, in the lander's words, and what the next attempt does about it.

func LandScope

func LandScope(paths []string, diff string, trackedBefore []string) (amended, refused []string)

LandScope is E12 as the lander reads one merge's diff (docs/SPEC-SPRINT.md section 7, the lander's checks): the files the diff changes outside the card's PATHS (diffcheck.Outside), less those inside every card's PATHS by rule (OutsideByRule), split into the scope amendments of the same change and the files refused (ScopeAmended). trackedBefore is diffcheck.Outside's.

func LandedTier

func LandedTier(c *Card) string

LandedTier is the tier a landed primary was on: script for a card of script steps alone (cardtree), else the tier it was on when it landed (cardTier).

func LandingRate

func LandingRate(landed []time.Time, total int64, spans []Span, first, now time.Time) float64

LandingRate is the cards landed per hour of running time (the clock's time less the STOPPED spans): the landings stamped in the last RateWindow of running time before now, over that time; with fewer than RateFloor there, the total landed over the running time since the first start. 0 when the machine has not started (first zero) or nothing has landed: no rate.

func LaneChecked

func LaneChecked(s *Snapshot, r TickReq, part string, p Plan) (Plan, []LaneQuiet)

LaneChecked is the part's plan with the judgments the lane check keeps from rising taken out, and those quiets: a lateness (NWorkLate) of a friend's card on a live lane (LiveLane), a friend's stall (NStalled on her) or "finishes none" (NFriendIdle) while a card of hers is on one, and a read tier question (NRaiseReadTier), which ReadTierRule answers instead; with part the ask, the readers behind it held (ReadersFull). Only a judgment raised is checked: one open already is the coordinator's, as before.

func LaneWidth

func LaneWidth(v string, set bool) int

LaneWidth is the lanes of a kind per machine from the work table's property value: a whole number from 1, else LaneWidthDefault (none set, default, or unreadable).

func LastDevSync

func LastDevSync(s *Snapshot) (at time.Time, sha string, ok bool)

LastDevSync is the last dev sync the merge table records: when, and the base's sha after it; ok false when none is recorded.

func LateStands

func LateStands(s *Snapshot, n Note) bool

LateStands says the cause of a lateness still stands: no move that resolves it has happened. Not finished stands while the attempt's work card is ready, working or withdrawn (a redeal or a return to ready does not finish it); never taken while the card is not taken (ready or withdrawn) and the clock it is measured by (WorkDeadline's field) started before the note: a friend's card dealt to her after the note was raised is measured from her own deal, so the lateness the note records, the clock before, stands no more and the note closes on her deal (her own bound raises its own judgment); not begun while the read is asked; not reported while it is asked or reading. While its cause stands a lateness stays raised, whether or not it is late at this moment: no judgment flaps closed and open again.

func Legal(from, to State) bool

Legal says from -> to is a move of the lifecycle.

func Lists

func Lists(n Note, verb string) bool

Lists says a judgment's decisions list the verb (a decision starts with it).

func LoadText

func LoadText(b Beat, now time.Time) string

LoadText is the load cell: the highest load of the last LoadWindow with one decimal and a percent sign while the beat is fresh, else empty; and beside it, while the machine's open file descriptors are over the member's warn bound, "fds <count> warn" (or alarm, fd.go FilesText), so the fleet table shows a machine running out of them before the alarm's judgment.

func LoadUnit

func LoadUnit(goos, op, path string) error

LoadUnit loads or unloads the unit at path. Under NOVA_TEST_NO_HOST it refuses: a test gives its own loader and loads nothing on the machine.

func MemberLoopRecord

func MemberLoopRecord(member string) string

MemberLoopRecord is the loop record that beats the member.

func MemberMedianWall

func MemberMedianWall(s *Snapshot, member string) (median float64, n int)

MemberMedianWall is the member's median run wall in seconds over its last DeadlineSamples ok attempts (the usage walls of its ok work cards, newest finished first), and how many samples it is over; 0 and 0 with none.

The deal asks it for every card it deals or moves, and a plan is run more than once a tick (the part's probe, then each attempt), so it is measured once a member for the done-ok cell the fleet table holds (medianWalls), never once a card: a deal costs the cards it deals, not those times the member's history (TestTickDealMeasuresEachDoneOKCellOnce).

A stats tidy carries the member's median through it (PropCarriedMedian): the carried median and count stand while the live sample is smaller than the carried count.

func MemberStatus

func MemberStatus(ctl *Card, b Beat, now time.Time) string

MemberStatus is a member's derived status at now: held while the coordinator holds it, else up while it has missed fewer than MissedBeatsDown beat windows, else down.

func MemberSubject

func MemberSubject(member string) string

MemberSubject is the stream word a member's judgment is filed under.

func MemberWidth

func MemberWidth(ctl *Card) int

MemberWidth is the width a member's control card names: DefaultWidth when it names none or one that is not a width; 0 is a member that drains (fleet up --width 0): no room for a deal or the level, its working cards finish.

func ModelPaths

func ModelPaths(paths []string) []string

ModelPaths is the entries of paths that can name a model: one whose last part is a .tla module or a glob of them (*.tla), anywhere; one under a tla/ directory whose last part is a config or matches a module or a config (*, **, MC*.cfg); and the tla/ directory itself. A bare glob outside tla/ (security/**) names no model.

func ModelTier

func ModelTier(brief string) (out, said, why string)

ModelTier is the brief add admits for a card whose PATHS name model work (ModelPaths): with tier: frontier on its line 1 when it names no tier, and said the words the add's unit carries; the brief as given, said "", when it names frontier or names no model work; why the refusal when line 1 names a lower tier. A brief whose model lines do not read is the model-lines check's to refuse, and is given back as it is.

func MoneyLess

func MoneyLess(now, was string) string

MoneyLess is the money figure now less the one at the mark, as the where view shows money (dollars and cents, "$0.25"): "" when that is nothing or below (never below zero: the figure's "-"), now unchanged when the mark names none or either does not read.

func MoneyText

func MoneyText(usd string) string

MoneyText is a cost as the work table's cost cell shows it: US dollars and cents, rounded up to the next cent ("$1.24" for 1.2345; nothing past the cent is shown), "-" when there is none. The card keeps the exact figure (FieldCost, FieldCostTotal); only what is shown is rounded.

func MovesDue

func MovesDue(s *Snapshot) int

MovesDue is how many moves the tick would make on the snapshot's work and fleet: primaries ready to deal, work cards withdrawn, waiting primaries whose needs have all landed (a sentinel is the coordinator's release), primaries in review to ask (as TickAsk picks them), and primaries in review with the ok reads they need that nothing holds (the pump accepts them, TickAccept): a STOPPED machine with any of these says so to the seat.

func NamedExtras

func NamedExtras(table string, ids []string) func(*Snapshot) map[string][]string

NamedExtras is the named cards a step must read as records when they are not on the table: a report against a retired card is refused naming the retirement.

func NamedStream

func NamedStream(n Note) string

NamedStream is the work stream a note names: its stream, when that is a stream's name and no other subject's (a member's, a provider's and a tier's subjects hold a colon, as no stream name does); "" when it names none.

func NamedWaits

func NamedWaits(s *Snapshot, c *Card, landing map[string]bool) []string

NamedWaits is what a primary waits for among the needs it names (stored on it): the part of WaitsFor that is not its place in line.

func NextLine

func NextLine(attempts []*Card) string

NextLine is the line `card <id>` prints after its attempts: where the attempt after starts (BaseOf), the attempt whose pushed head it continues or the card's base.

func NextReadTier

func NextReadTier(t string) string

NextReadTier is the read tier above t (readTiers), "" at the top.

func NextStopID

func NextStopID(s *Snapshot, stream string, extra []string) string

NextStopID is the next <stream>-stop-<n>. A bare <stream>-stop counts as 1. extra holds ids this add is already using, so the new stop does not take one.

func NoRouteRefusal

func NoRouteRefusal(reason string) bool

NoRouteRefusal says a refusal is for want of a route: the reader had no model, budget or deadline to run the read on.

func NoneSelected

func NoneSelected(q Selector) string

NoneSelected is why a selector that selects no card changes nothing.

func NotCoordinator

func NotCoordinator(coordinator, who, verb string) string

NotCoordinator is why who may not answer a judgment of a sprint whose coordinator is coordinator; "" is may.

func NotHealth

func NotHealth(holder string, generation uint64, now time.Time, r HealthReq) string

NotHealth is why the observation is refused, "" is accepted: the sender is the seat's holder, at the seat's generation, of a friend on the table, with a proof dated no later than now, the server's clock, and newer than the row's. It reads nothing but its arguments, so the step refuses on its own read of the seat and its own clock.

func NotPushTarget

func NotPushTarget(rec PushRecord) string

NotPushTarget is why a push record may not be written for name, "" is may: a name, a harness, and a target directory.

func NotSeat

func NotSeat(holder string, r SeatReq) string

NotSeat is why who may not move the seat to the request's name, "" is may: the holder or the owner gives it; the one taking it takes it, with the owner's name. It reads nothing but its arguments, so the command refuses before it writes, and the step refuses again on what it read.

func NotSeatRepair

func NotSeatRepair(key string, rec SeatChange, ok bool, r SeatRepairReq) string

NotSeatRepair is why who may not repair the key, "" is may: the record's holder or the owner, with a reason, while the key says someone else. ok is whether the seat has a record (rec its last change).

func OnlyFriend

func OnlyFriend(c *Card) bool

OnlyFriend is the hard pin (docs/SPEC-SPRINT.md, WHO preference): the explicit one, WHO: only friend <name>, and a WHO: friend <name> card come back by a rework, a return or a redo (ReworkPinned), whose next attempt is hers as its first was.

func OpFamily

func OpFamily(family string, epoch uint64) string

OpFamily is an operation's family of ids at an epoch: the family at epoch 0, the family and the epoch after it (as StoredID) at a later one. Every operation id, notification id and judgment id is built on it, so none is the same in two epochs; a caller's operation id holds no '~'.

func OpenKey

func OpenKey(noteID, subject string) string

OpenKey is the open-judgment key of a note on one subject.

func OtherEpoch

func OtherEpoch(id string, epoch, now uint64) string

OtherEpoch is the refusal of a judgment id of another epoch than the sprint's: it names the epoch the id belongs to.

func OutsideByRule

func OutsideByRule(files []diffcheck.File, outside []string) []string

OutsideByRule is outside, files a diff changes outside a card's PATHS, without those cardgen.AlwaysInPathsRule puts inside every card's PATHS: a test, a testdata file, a TLA+ ledger, the docs catalog or an AGENTS.md map (cardgen.AlwaysInPaths). files is the diff's (diffcheck.Parse); a rename is inside by rule only when both its sides are, so a source file moved to a test's name is still refused.

func PacketCards

func PacketCards(c *Card) (primary string, earlier []string, work string)

PacketCards is the ids a packet of the card reads besides the card: its primary, the work cards of every attempt before it (a work card), or the work card it reads (a read card).

func ParseAttempts

func ParseAttempts(text string) (int, error)

ParseAttempts is an attempt cap as the verbs take it: a whole number from 1 to AttemptsMax, or ReadTierDefault (0: the default).

func ParseDeadline

func ParseDeadline(text string) (seconds int, off bool, err error)

ParseDeadline is a pinned deadline as fleet up --deadline takes it: a duration above zero (45m, 2700s), in whole seconds, or ReadTierDefault to take the pin off (off).

func ParseFriendReadReport

func ParseFriendReadReport(report string) (verdict, finding, why string)

ParseFriendReadReport reads a friend's read report. LAND closes the read ok. HOLD closes it broken when a line names a file, a line or a rule (typedrec.NamesADefect, the rule a reader's broken read is held to). why is set when the report does not close the read.

func ParseReadCard

func ParseReadCard(id string) (primary string, attempt int, reader string, ok bool)

ParseReadCard splits a read card identity into its primary, attempt and reader.

func ParseReaderTiers

func ParseReaderTiers(raw string) (string, error)

ParseReaderTiers reads --tiers. Empty and default store "" (the default: flash on a fleet reader, every tier on a friend's); all stores every tier, named. Anything else is a comma list of routes, each once, stored in readerTierOrder with no spaces. A tier that is not a route, or a repeat, refuses the whole value.

func ParseRoute

func ParseRoute(route string) (kind, target string, err error)

ParseRoute splits a route into its kind and target: file:<absolute path> or bus:<bus directory>.

func ParseWidth

func ParseWidth(text string) (int, error)

ParseWidth is a width as the verbs take it: a whole number from 1 to MaxWidth.

func ParseWorkCard

func ParseWorkCard(id string) (primary string, attempt int, ok bool)

ParseWorkCard splits a work card identity into its primary and attempt.

func PathsAdmission

func PathsAdmission(brief string, tree AdmissionTree) []string

PathsAdmission is the miss lines of brief against tree, none when the brief passes or names no PATHS, or no REPO, or no BASE. One line per miss. A tree that was not handed over is one MISSING line.

func PathsTwinID

func PathsTwinID(s *Snapshot, c *Card) string

PathsTwinID is the first of PathsTwinIDs no card on the table or off it has, nor the card itself; "" when every one is taken.

func PathsTwinIDs

func PathsTwinIDs(c *Card) []string

PathsTwinIDs is the ids PathsTwinID chooses among: the id with -t after it, then -t2 to -t9; a twin the paths rule cut before (its id replacing the one it names, with the suffix) counts on from its own suffix, so p-t is followed by p-t2, never p-t-t.

func PathsWidened

func PathsWidened(brief string, files []string, carry string) string

PathsWidened is brief with files added to every PATHS: line, each once, the old first, and carry (when given) as its CARRY: line (member.CarryLine's shape), in place of one in its header or after line 1.

func PerLandedOf

func PerLandedOf(costCell string, landed int) string

PerLandedOf is a stream's dollars per landed card from the where view's cells alone (the cost cell, MoneyText, over the landed count): what the text table shows when the tick's record is not there; "-" with nothing landed or no cost.

func PerLandedSince

func PerLandedSince(cost string, landed int, base StreamBase) string

PerLandedSince is a stream's dollars per landed card since its tidy: the cost since over the cards landed since; "-" with none landed or nothing priced.

func PercentileNearestRank

func PercentileNearestRank(xs []time.Duration, q float64) (time.Duration, bool)

PercentileNearestRank is the nearest-rank percentile of xs: order the samples and take the one at rank ceil(q*n), one-based, so p90 of n samples is the value at or above 90% of them. q is a fraction (0.9 is the p90). ok is false when xs is empty: no sample has no percentile. xs is not reordered.

func PlanRows

func PlanRows(p Plan) map[string][]string

PlanRows is the rows of each table a plan changes: the row a card is moved from and the row it goes to, the row a card is created in, and the row of a card whose fields it sets, unsets or removes; a guard that changes nothing names no row. The tick's log names them by table: every row of every table moves every tick.

func PositionWaits

func PositionWaits(s *Snapshot, c *Card, landing map[string]bool) []string

PositionWaits is what a primary waits for by its place in line: for a sentinel, every primary of its stream before it that has not landed (a dropped one is off the line); for a waiting primary, the sentinel it waits behind. It is the one reading of position: the needs rule, resolve, reached, card and check all read it.

func PresenceStatus

func PresenceStatus(held bool, b Beat, now time.Time) string

PresenceStatus is the one rule of a fleet member's status at now: held while the coordinator holds it (fleet down), else up while it has missed fewer than MissedBeatsDown beat windows of BeatDeadline, else down (never beaten, or lapsed).

func Preview

func Preview(items []string, sep string) string

Preview is a list of items as a person reads it, joined by sep: all of them when there are PreviewLen or fewer, else the first PreviewLen and "... and k more".

func PriorityCounts

func PriorityCounts(s *Snapshot) map[string][]string

PriorityCounts is where's priority line's cards: every open primary whose level is not normal, by level, in work order.

func PriorityLine

func PriorityLine(counts map[string][]string, streams map[string]string) string

PriorityLine is where's line beside the critical list: "priority: blocker s1-4; low s2-1, s2-2 (+3)", the levels high to low, at most five cards a level; "" when every card is normal.

func PriorityOfBrief

func PriorityOfBrief(brief string) (level, why string)

PriorityOfBrief is the level the brief's header line `PRIORITY: <level>` names, "" when its header names none; why says a line that names no settable level, with the level found and the seven of the ladder (reader is a read card's alone). Add and Recut refuse a brief with why set, so a misspelled level is never admitted at normal or the stream's default.

func PromotedSha

func PromotedSha(given string) (string, string)

PromotedSha is the sha a promotion names, lower cased, or why it is not one.

func Promotion

func Promotion(s *Snapshot) (at time.Time, sha string, ok bool)

Promotion is the last promotion the store records: when and the sha; ok false when none.

func PromotionBaseWhy

func PromotionBaseWhy(s *Snapshot, stream, base, card string) string

PromotionBaseWhy is why add refuses card into stream, "" when it may: its BASE is a protected branch (ProtectedBranches, dev and main) and the stream is not the promotion stream (docs/SPEC-SPRINT.md section 7, protected-bases-pb-b.w2). A card cut on dev is refused as SprintBranchWhy says; one cut on main the same way, naming main. The remedy re-cuts the card on the sprint branch, or marks the stream: stream set <s> --promotion.

func PropCarriedMedian

func PropCarriedMedian(row string) string

PropCarriedMedian is the fleet table's property holding a row's median run wall as a tidy found it: "<seconds> <samples>". The deadline rules (MemberMedianWall, FriendMedianWall) use it while the row's live ok sample is smaller than its count, and drop it once the live sample is at least as large, so a tidy never changes a deadline.

func PropCostReconcile

func PropCostReconcile(provider string) string

PropCostReconcile is the fleet table property of a provider's reconciliation.

func PropFriendDisagree

func PropFriendDisagree(friend string) string

PropFriendDisagree is the fleet table's property of a friend's disagreement episode: when its note was pushed ("" or absent: none).

func PropFriendStallDown

func PropFriendStallDown(friend string) string

PropFriendStallDown is the fleet property recording when the friend was marked down for stall.

func PropFriendStallRung

func PropFriendStallRung(friend string) string

PropFriendStallRung is the fleet property recording the friend's current stall ladder rung (0..5). A property name is letters, digits, _ . and - (the table store refuses any other), so the friend's name follows a dot.

func PropProviderBalance

func PropProviderBalance(provider string) string

PropProviderBalance is the fleet table's property that holds a provider's last balance read (balance.go writes it).

func PropProviderRest

func PropProviderRest(provider string) string

PropProviderRest is the fleet table's property that holds a provider's last rest: ONE per provider, never a copy on each of its routes, so a provider's rest is one write and the table's properties (ntable.LimitTableProps) grow with the providers, not the routes.

func PropRouteIndex

func PropRouteIndex(tier string) string

PropRouteIndex is the fleet table's property that holds the tier's route index (route_index_flash, route_index_pro), beside deal_index: a uint64 counter read with the step's tables and written in its batch, guarded on the value read (round.go, roundWrites).

func PropRule3Rest

func PropRule3Rest(provider string) string

PropRule3Rest is the fleet table's property that holds one provider's rule-3 rests: one property per provider, one line per route that has rested, so the table's properties (ntable.LimitTableProps) grow with the providers and never with the routes.

func ProtectedLandWhy

func ProtectedLandWhy(s *Snapshot, stream, repo, base, card string) string

ProtectedLandWhy is why the lander refuses to land card on base, the card's stream and repository given, "" when it may (docs/SPEC-SPRINT.md section 7, the protected branches): base is a protected branch and the stream's mark names neither the repository nor LandProtectedAny. The remedy marks the stream; a card meant for the sprint branch is re-cut on it instead.

func ProviderBalances

func ProviderBalances(fleet *Table) map[string]ProviderBalance

ProviderBalances is the last balance the fleet table records for each provider polled.

func ProviderRests

func ProviderRests(fleet *Table) map[string]RouteRest

ProviderRests is the last rest the fleet table records for each provider that has one.

func ProviderSubject

func ProviderSubject(provider string) string

ProviderSubject is the stream word a provider's judgment is filed under: no stream id has a colon, so it is never a stream's.

func PushCheckText

func PushCheckText(nonce, reply string) string

PushCheckText is the check the push loop delivers: the nonce followed by the producer's routed command, identical for native and folder adapters.

func PushDown

func PushDown(name string, rec PushRecord, ok bool, now time.Time) string

PushDown is the one line every coordinator verb is refused with while name's seat has no live proof, "" when it has one: PUSH DOWN, why, and the setup command.

func PushDue

func PushDue(rec PushRecord, now time.Time) bool

PushDue says the push loop delivers a new check now: none delivered yet, the last one failed PushRetry ago, the last one unanswered past PushAnswerBound, or the proof PushProofEvery old.

func PushLive

func PushLive(rec PushRecord, ok bool, now time.Time) bool

PushLive says the record holds a pong no older than PushProofLive and the last delivery did not fail: a push that fails is down now, whatever it proved before.

func PushPongCommand

func PushPongCommand(name, nonce, redis, server string) string

PushPongCommand preserves the producer's route and the addressed actor. A direct store is explicit so an inherited server cannot intercept the reply; a forwarded source names its server without selecting a local store. Only addresses go into the command, never credentials.

func PushProofState

func PushProofState(rec PushRecord) string

PushProofState carries the scheduler's state without its secret (SPEC-SPRINT, "The push proof"). Proven means the current check was answered, not that it is live.

func PushSetup

func PushSetup(name string, rec PushRecord, ok bool) string

PushSetup is the command that records name's push target, installs the push loop and starts the proof: harness is the record's, else a placeholder.

func PushWhy

func PushWhy(name string, rec PushRecord, ok bool, now time.Time) string

PushWhy is why name's seat is not proven, "" when it is: no record, no check delivered, the last delivery failed, the check unanswered, or the proof older than PushProofLive.

func PushedBranch

func PushedBranch(prefix string, epoch uint64, work *Card) string

PushedBranch is the branch that holds a work card's pushed head, the branch a read of the attempt is handed (docs/SPEC-SPRINT.md section 6, a read names the branch the work pushed): when its head is the head a hold carried (FieldCarryHead: a later generation finished at the work an earlier one pushed, with no push of its own), the carried generation's branch; else the branch its finish recorded; else its own generation's, for a finish that named none. A generation bumped by a take-back or a hold after the push never renames the work's branch.

func PushedHead

func PushedHead(w *Card) string

PushedHead is the head an attempt's work card finished ok at, "" when it finished failed, in flight, or at no commit.

func PushedTip

func PushedTip(why string) string

PushedTip is the tip a started card's words name ("a push on its branch <branch> at <tip>"), "" when they name no push at a full sha (her beat names it running, or the tip could not be read): only a push read at its sha is carried.

func PushedUnreportedIDs

func PushedUnreportedIDs(s *Snapshot, stream string) []string

PushedUnreportedIDs are the stream's queued cards marked pushed and not reported, whose work card is missing or still merging.

func PushedUnreportedMark

func PushedUnreportedMark(sha string) string

PushedUnreportedMark is the timeline line of a push whose report did not land.

func PushedUnreportedMatches

func PushedUnreportedMatches(s *Snapshot, id string) bool

PushedUnreportedMatches fences recovery to the revision that was pushed.

func PushedUnreportedSHA

func PushedUnreportedSHA(s *Snapshot, id string) string

PushedUnreportedSHA is the sha marked on the card, the merge card first.

func QueueOf

func QueueOf(p Plan, verb, actor string) (Plan, []QueuedChange)

QueueOf splits a plan into what the step applies now and what it queues: every change and property of the work table goes to the queue, in the plan's order, and a guard-only entry of the work table is dropped (the fence's generation already holds the whole read, and only the pump writes the work table while the queue is used). A unit left with no change keeps its notes and closes.

func QueuePriority

func QueuePriority(c *Card) string

QueuePriority is the level a queue shows beside a card: a read card's reader, a work card's as its deal wrote it (priorityOnWork), else normal.

func QueuedCards

func QueuedCards(q []QueuedChange) map[string]bool

QueuedCards is the work cards the queue's changes name.

func QuietLines

func QuietLines(props map[string]string, now time.Time) []string

QuietLines is the QUIET line of every quiet in force at now: what view worker shows every member and friend.

func Reachable

func Reachable(s *Snapshot, c *Card, landing map[string]bool) bool

Reachable says a sentinel whose waits are met is reached now: something came before it (HasBefore), or, with nothing before it, no other work of the sprint is in flight (docs/SPEC-SPRINT.md section 16).

func ReadBranch

func ReadBranch(prefix string, epoch uint64, primary, work *Card) string

ReadBranch is the branch a read of the work card is handed: the primary's corrected branch when it was recorded for the work's head (FieldReadBranch), else PushedBranch.

func ReadCardAgrees

func ReadCardAgrees(c *Card) bool

ReadCardAgrees says a read card is where its identity says: the row it occupies, the reader its id names and its reader field are one reader. A card that disagrees counts for no reader; check reports it.

func ReadCardBrief

func ReadCardBrief(name, job string, p Packet, start string, deadline time.Time) string

ReadCardBrief is the BRIEF.md of a read card delivered to a friend's inbox (inbox/<job>/, the job a work card of hers would have: friend sync, friendJobOf), whole for a lane that has never seen the sprint (docs/SPEC-SPRINT.md section 6, "A read is a consumer card"): what a read is, the work under review (repository, branch, head, base, the attempt's start), how to read it, how to finish (outbox/<job>/REPORT.md whose first line is "Verdict: LAND" or "Verdict: HOLD", a HOLD naming each defect), and the card under review verbatim with the worker's report. A one-shot runner that runs inbox/<job>/BRIEF.md and publishes outbox/<job>/REPORT.md runs it unchanged; friend sync closes the read from that report (FriendReadClose).

func ReadCardExtras

func ReadCardExtras(s *Snapshot) []string

ReadCardExtras is the fleet table's read card ids a step that judges reads must read as records, placed or kept (a store's snapshot holds only the placed cards and the records a step names): every identity of a read card of each primary in review, at its attempt, of every reader the fleet table has a row for (a friend, by her name; a member with its reader row).

func ReadCardForAsk

func ReadCardForAsk(s *Snapshot, primary string, attempt int, reader string) (id string, ok bool)

ReadCardForAsk returns the read card ID to use when asking a reader of a primary at an attempt: plain identity if no card exists yet, or second identity if a card retired without a verdict (away, refused, returned, levelled, held, taken back) exists with the plain identity and no second card exists yet. ok is true if the reader is eligible to be asked.

func ReadCardGenIDs

func ReadCardGenIDs(primary string, attempt int, reader string) []string

ReadCardGenIDs is every identity one reader's read card of an attempt may have: the plain one and its generations (readCardIDFor).

func ReadCardID

func ReadCardID(primary string, attempt int, reader string) string

ReadCardID is the identity of one reader's read of a primary at one attempt.

func ReadCardIDs

func ReadCardIDs(primary string, attempt int, reader string) []string

ReadCardIDs returns both the plain identity and the second identity for a reader's read of a primary at an attempt.

func ReadCardSecondID

func ReadCardSecondID(primary string, attempt int, reader string) string

ReadCardSecondID is the second identity of one reader's read of a primary at one attempt, given to a re-asked read when a retired card with the plain identity exists (e.g. taken back by the away sweep).

func ReadCardsWhy

func ReadCardsWhy(s *Snapshot, seats []FriendSeat) []string

ReadCardsWhy is tick --shadow's account of the read-card ask (readCardsAsk): first the units it deals reads to, each with its half slots and idle lanes, and the reader friends it leaves out; then a line per primary that waits, its read tier, the reads it wants, why it waits and each unit not dealt it with the clause that refuses it (readRefusal), or half<=0 for one at its room as the ask reached the primary. Nothing with read cards off.

func ReadFriendQueue

func ReadFriendQueue(b []byte) (map[string]string, error)

ReadFriendQueue reads a friend's inbox/QUEUE.json into each task's state by its id, the state trimmed and in lower case; other keys are passed by. A file that is not JSON, has no tasks list, a task with no id, or an id twice is refused: reconcile never guesses at her account (docs/SPEC-SPRINT.md section 1, friend reconcile).

func ReadLeaseExpires

func ReadLeaseExpires(c *Card) time.Time

ReadLeaseExpires returns when an in-flight read's lease expires. Started by read --begin (begun + DefaultReadLease) and renewed by reader beat (FieldLease).

func ReadLeaseLive

func ReadLeaseLive(c *Card, now time.Time) bool

ReadLeaseLive reports whether the in-flight read's lease is live at now.

func ReadPriority

func ReadPriority(pr *Card) string

ReadPriority is the level of a read of the primary (readRank): reader, or its primary's when that is higher.

func ReadSpendLine

func ReadSpendLine(streams map[string]TierCosts) string

ReadSpendLine is the day's read spend per route over the streams' records, one line under the where view's summary: "reads today: pro-a $1.24 12 reads 3456789 tokens · subscription tokens 3 reads 120000 tokens", routes in name order, a priced route's dollars rounded up to the cent, a route with nothing priced "unpriced"; "" when no read ended today.

func ReadTierRule

func ReadTierRule(s *Snapshot, n Note) (raise *Unit, q LaneQuiet, ok bool)

ReadTierRule answers the read tier question n by the rule (RuleReadTier) and never asks it: kept unless two substantive findings disagree on one of the stream's cards in review, a reader's ok and another's broken with a finding on one attempt at the stream's read tier, when the unit that raises the read tier to n.Tier, its reason the rule's, is returned. ok is false when the rule is off or the stream has no control card: the question rises as before.

func ReadUsageMissing

func ReadUsageMissing(c *Card, usage string, verdict string) string

ReadUsageMissing is why a read's verdict on the read card c is refused for its usage: a routed read with no --usage at all, which leaves nothing to price it by; "" otherwise. A usage with no token count is taken, never refused: a verdict is never lost for its harness's accounting (readCostRecord records it unpriced=no-tokens). Its remedy is the verdict again with the harness's own token report.

func ReaderMachine

func ReaderMachine(reader string) (machine string, ok bool)

ReaderMachine is the machine a reader is named for: reader-<m> names m; a name of another shape names no machine.

func ReaderState

func ReaderState(away bool, b Beat, now time.Time) string

ReaderState is a reader's state at now, from the coordinator's hold and its last beat.

func ReaderSubject

func ReaderSubject(reader string) string

ReaderSubject is the subject of a judgment about one reader.

func ReaderTiersShown

func ReaderTiersShown(stored string) string

ReaderTiersShown is the word a view prints for a stored tiers cell: default for an empty one (flash on a fleet reader, every tier on a friend's), the list else.

func ReadersFull

func ReadersFull(s *Snapshot) (string, bool)

ReadersFull is why the readers are not behind though reads wait past the window: every reader up they wait on reads its whole width. ok is false when no read waits past the window on a reader up, or one waits on a reader with room (the readers are behind).

func ReadsNeeded

func ReadsNeeded(pr *Card) int

ReadsNeeded is the read rule of a card's tier: how many different readers' ok reads at its head make the primary acceptable, and so how many readers the ask asks at an attempt, while the sprint sets no count (ReadsNeededIn): one when the tier the card is on (cardTier) is flash, and two at any stronger tier (pro, or frontier). A friend whose class is at or above the read tier is asked first when she has room (friend_read.go); a machine read is drawn on a route of the card's read tier (readTierOf) only when no such friend has room (the owner, 2026-10-02, cost rule 4, nova-tools#5174: "Reads: one cold read per flash card on a flash route; two per pro card; readers still equal workers per machine"). The tier is the card's own, the tier it is on (cardTier: flash first, then the tier it escalated to, or the tier a rework recorded).

func ReadsNeededIn

func ReadsNeededIn(s *Snapshot, pr *Card) int

ReadsNeededIn is how many different readers' ok reads at its head the primary needs in the snapshot, the count every live caller uses. In review: the sprint's count while one is set (nova-sprint set --reads 0, 1 or 2, PropReadsNeeded; the owner, 2026-10-06: "I'd like to waive the second read for the moment"), whatever the card's tier, so a card with that many ok reads at its head is accepted on the next tick after the setting changes; else its tier's rule (ReadsNeeded). At 0 no read is asked, and a primary whose work finished LAND at its head is accepted on it (acceptable). A card in merging or landed is never judged again: it is held to the count it was accepted on, the accept's FieldReadsNeeded, else its tier's rule.

func ReadsSetting

func ReadsSetting(props map[string]string) (n int, ok bool)

ReadsSetting is the reads every card in review needs as the work table's properties hold them (PropReadsNeeded): 0, 1 or 2, and ok false while none is set (default: each card's own rule, ReadsNeeded).

func ReadsWaiting

func ReadsWaiting(s *Snapshot) int

ReadsWaiting is the count of reads waiting to be asked: the reads wanted now (ReadsWanted) over every primary in review whose work did not fail.

func ReadsWanted

func ReadsWanted(s *Snapshot, pr *Card) int

ReadsWanted is how many reads the ask places on the primary now, at its attempt. Under the interim rule of 2026-10-06 (docs/SPEC-SPRINT.md section 6; the owner, 6:02 PM ET: "send out multiple consumer cards in ||") a card's reads are asked together: the rest it needs (ReadsNeededIn), a read outstanding counted among those that stand; none once a read found it broken (the judgment stands and a rework follows). The sequential rule before it (2026-10-04) asked the first read alone and the rest once it came back ok. A read taken back from a reader away or handed back with no verdict (liveReadsAt) does not stand and is asked again whatever stands: it was wanted when it was placed (a pair's second read by --another too). Each read wanted goes to a reader with room (askPicks): how many are wanted is this rule, where they go is the readers' room. A friend's read of the attempt stands with them (friendReadLive): placed or ok, it counts toward ReadsNeeded; broken, no second read is asked (docs/SPEC-SPRINT.md, a read asked of any unit with room at or above the read tier).

func RecentLandings

func RecentLandings(landed []time.Time, spans []Span, first, now time.Time) []time.Time

RecentLandings is the landings LandingRate can count at now or at any later reading: the stamps from the start of the last RateWindow of running time before now, oldest first, at most MaxRecentLandings (the newest). The window only moves forward (running time never runs back), so what is before it now is before it at every later reading. None before the first start (first zero): no landing before it is ever counted.

func RecordedProvidersIn

func RecordedProvidersIn(s *Snapshot, from, to time.Time) []string

RecordedProvidersIn is the paid providers the store knows of over [from, to), in name order: every route's provider, and the provider of every priced record in the window. A provider here is one the release's spend check must read.

func RecordedSpendIn

func RecordedSpendIn(s *Snapshot, provider string, from, to time.Time) float64

RecordedSpendIn is the store's dollars of a provider over [from, to): every priced record of that provider (its route's, else the provider of the model it reported) that ended in the window.

func RecordedTokensIn

func RecordedTokensIn(s *Snapshot, from, to time.Time) map[string]int64

RecordedTokensIn is the store's tokens of each subscription friend over [from, to): every subscription record that ended in the window, its tokens under the member or reader that ran it ("-" for a record that names none).

func RedDir

func RedDir(pkg, module string) string

RedDir is the package's directory in the repository, from the path go test printed: the module's prefix cut, "." for the module's root.

func RedTestOf

func RedTestOf(brief string) string

RedTestOf is the test a card's brief names on its TEST line, "" for none.

func RefusalWay

func RefusalWay(kind, what string) string

RefusalWay is the way the lander refused a head, from the conflict fact it recorded (the stream's control card's conflict kind, and the stop's words): "" when the rule cannot place it (a conflict in a generated ledger, a head that is no commit or that origin does not hold, a conflict the lander did not place), which needs a mind.

func RefusedReturn

func RefusedReturn(reason string) bool

RefusedReturn says a return's reason is a launch refusal: the read never ran.

func ReleaseCheckNames

func ReleaseCheckNames() []string

ReleaseCheckNames is the registry's names, in order.

func RemovedStream

func RemovedStream(s *Snapshot, stream string) bool

RemovedStream says the stream was removed in this epoch (stream remove): its control card's record is kept unplaced. A removal is not a tombstone: a card added under the stream's name brings it back (ComeBack). The add step reads the record as an extra (store.AddStep).

func Render

func Render(l Line) string

Render is a log line in plain words, as `log` and a card's timeline print it: the one place a line becomes words. It does not print the time, the caller's clock format, or the words given with the change, which follow the line as paragraphs (RenderText).

func RenderText

func RenderText(l Line) []string

RenderText is the words given with a line (a report, a finding, a fix, a reason), each a paragraph, in a fixed order.

func ReopenLine

func ReopenLine(stream, id string) string

ReopenLine is the NOTE line of an add that reopens a stream.

func RepairNote

func RepairNote(fixes []DocFix) string

RepairNote is the landing note's words for fixes: "E4 repaired: N spans joined in <file>" for each file whose wrapped code spans were joined, then "the documents were repaired at the merge: <file>:<line> <what>; ..." for the rest, "" for none.

func Replay

func Replay(lines []Line) map[string]Place

Replay is every card's place and generation after the log's move lines, in order, from empty: keyed by table and card id. A card the log removed is absent.

func ReplayOnto

func ReplayOnto(out map[string]Place, l Line) map[string]Place

ReplayOnto is the places after one more line: a replay held as the log grows.

func RepoName

func RepoName(v string) string

repoName is a repository as the owner/name a --repo flag names: a URL or a clone path's last two path segments, without a .git suffix; a value already owner/name unchanged.

func ReportRefusedReason

func ReportRefusedReason(base, tip, why string) string

ReportRefusedReason is the land loop line when a push's report did not land: the store's reason, then the timeline mark when the push has a sha.

func RepriceOf

func RepriceOf(s *Snapshot, r RepriceReq) (Plan, RepriceReport)

RepriceOf is the reprice's plan and its account (see above).

func ResolveExtras

func ResolveExtras(s *Snapshot) []string

ResolveExtras is the needs a resolve must read as records: the ones not on the table, which may have been dropped.

func RetireJudgments

func RetireJudgments(s *Snapshot, p *Plan, who string)

RetireJudgments is the closes and the machine's answers of every open judgment whose cards have all left the table, skipping those the plan closes already: one decided note a judgment, naming every card's event.

func ReturnedAtAttempt

func ReturnedAtAttempt(c *Card) bool

ReturnedAtAttempt says the coordinator returned the primary to review at its current attempt.

func ReworkPinned

func ReworkPinned(c *Card) bool

ReworkPinned says the card names a friend (WHO: friend <name>) and has come back by a rework, a return or a redo (its reworks or returns counted): its next attempt waits for her alone, never another friend or a machine (the owner, 2026-10-05: a rework of a friend's own rating was dealt to another worker, who could not do it as her). A take-back alone (friend take) counts neither, so a preference taken back from her is offered on.

func RouteRests

func RouteRests(routes []Route, fleet *Table) map[string]RouteRest

RouteRests is the rest that decides each route of routes that has one: its own last rest (rule 3's) or its provider's, whichever ends later, the provider's on a tie, named for the route.

func RouteTable

func RouteTable(lines []Line, since time.Time) string

RouteTable is stats --routes (docs/SPEC-SPRINT.md, the verb stats): the route table from the log over a window, the program at route-score replaced by the verb. takes is the launches that ran (ok, failed, no-result). A provider take is the prov column unless its error is a no-result (IsNoResult), and a primary with more than fifty provider failures is a storm, counted once per route. landed is the latest ok take at or before the primary's accept (the verb accept or tick accept). 1stT is how many of those landings were the primary's first take on that tier. wrong is broken reviews over the ok takes a reader scored. Dollars per take and per landing count actual_usd whenever the usage writes it, and a finish that ran more than a minute with no price is imputed at the route's mean. The median wall is the upper median. A finish with no route is left out.

func RuleAnsweredWithin

func RuleAnsweredWithin(cards []*Card, now time.Time, window time.Duration) map[string]int

RuleAnsweredWithin is how many cards a rule answered in the window ending at now, by the FieldRuleAnswer each move writes ("<rule>: <act> at <time>"), per rule: the coordinator view's count of the answers it did not have to give. A card answered twice in the window counts once, by its last answer.

func RuleSaid

func RuleSaid(rule, said string) string

RuleSaid is the answer a rule records on a judgment: "answered by rule <name>: <what>".

func RunGit

func RunGit(ctx context.Context, dir string, args ...string) (string, error)

RunGit is git through the tree's runner (internal/subproc): bounded by git's budget, and its stderr in the error.

func RunWall

func RunWall(c *Card) string

RunWall is a work card's run wall as a duration's text: its usage's wall (what the member read from its child), else, for a friend's card, which reports no usage, her take to her report (FieldReported), so her report lag is her report to its finish; "" when neither is there.

func RunnerEnded

func RunnerEnded(log, job string) (end string, dead bool)

RunnerEnded reads a runner's log (one line per event: `<time> START|LIMIT|END <job> ...`, as a bud's runner writes it) for the job: dead is true when the job's last event is an END whose last word is report=no and no LIMIT came after the START before it (a run stopped at a usage limit is run again, never dead); end is that END line.

func SameFailure

func SameFailure(a, b string) bool

SameFailure says two failed ends are the same failure: each has a class and it is the same one (FailureClass).

func SameFinding

func SameFinding(a, b string) bool

SameFinding says two findings are the same finding: each has a class and it is the same one.

func ScopeAmended

func ScopeAmended(changed, outside []string) (amended, refused []string)

ScopeAmended splits outside, the files a card's diff changes that its PATHS do not name, into amended, each a test, fixture or doc of the same change, and refused, the rest, each in the order given. changed is every file the diff changes. A file is of the same change when the change also changes a file of its own (in PATHS, not in outside) and the file is one of:

  • a Go test file (_test.go) in the directory of one of those files: the package's test;
  • a file under the testdata directory of one of those directories: its fixture or golden;
  • a Markdown file under docs/, or in the directory of one of those files: its doc.

A file that is code, configuration or anything else is never amended.

func SeatDrift

func SeatDrift(key, record, server string) string

SeatDrift is how the key, the record's holder and the server's actor disagree, "" when they do not: the key names someone the record does not, or the server runs as a named actor who is not the holder. record is "" when the seat has no record (init's key is the record then); server is "" when no server is recorded, and MachineActor is the server acting as no one.

func SeatUnitFile

func SeatUnitFile(goos string) string

SeatUnitFile is the unit's file name on goos, "" where there is no service manager the push loop is installed under.

func SelftestLand

func SelftestLand(ctx context.Context, opts ...SelftestLandOption) error

SelftestLand lands a canned card on a scratch clone with binary (docs/SPEC-SPRINT.md section 14). Run by any install before switching: green on a good binary and red on a broken lander (item 14).

func ServerRollback

func ServerRollback(ctx context.Context, target string) error

ServerRollback restores the target binary from its previous backup (docs/SPEC-SPRINT.md section 14).

func ServerSwitch

func ServerSwitch(ctx context.Context, opts ServerSwitchOptions) error

ServerSwitch replaces the server binary with candidate binary, keeping previous binary for rollback (docs/SPEC-SPRINT.md section 14; item 14).

func SharedWidened

func SharedWidened(brief string, files []string) string

SharedWidened is brief with files added to every SHARED: line it has, each once, the old first; a brief with no SHARED: line is returned as it is.

func ShownStreamState

func ShownStreamState(fields map[string]string, open int) string

ShownStreamState is the state where and streams show. Landed with a card still open is closed; a stream that is actually finished stays landed. Held stays held, read the same way as StreamStateText.

func SideTiers

func SideTiers(props map[string]string, prop string) []string

SideTiers is a side's tiers as the work table's properties hold them (PropFleetTiers, PropFriendsTiers): nil for all, the default, else the tiers in the ladder's order.

func SortCards

func SortCards(cs []*Card)

SortCards orders cards by score, then by id: work order.

func SortedKeys

func SortedKeys(m map[string]int) []string

SortedKeys is the counts' keys in order.

func SpendLastHour

func SpendLastHour(s *Snapshot, provider string) float64

SpendLastHour is the provider's spend over the hour up to s.Now, in dollars, as the sprint's own cost records measure it: every consumer record (a work take, a read run) on the work table's primaries that ended in (s.Now-SpendWindow, s.Now], ran on the provider (its route's, else its model's), and carries actual_usd, each record counted once by its key whatever card holds a copy of it. It is a sum over a full hour, never a rate scaled up from a short gap between two reads (the 2026-10-10 rests: $234.82 an hour against a measured $25), and never the provider's running total.

func Split

func Split(s string) []string

Split is a comma list, without empty items.

func SprintBranchWhy

func SprintBranchWhy(s *Snapshot, stream, base, card string) string

SprintBranchWhy is why add refuses card into stream, "" when it may: its BASE is dev and the stream is not the promotion stream (docs/SPEC-SPRINT.md section 7, the sprint branch). The remedy re-cuts the card on the sprint branch, or marks the stream.

func SprintDoneCounts

func SprintDoneCounts(s *Snapshot) (landed, dropped int, done bool)

SprintDoneCounts is the sprint's landed primaries and its dropped ones (the streams' control cards' dropped counters), and whether the sprint is done: no primary waiting, ready, working, in review or merging, and at least one landed or dropped. A sprint that never had a card is not done.

func StagingRefusers

func StagingRefusers(wc *Card) []string

StagingRefusers is the members that refused the work card at staging, each once, in the order they refused: the deal places it on none of them.

func StaleGroupID

func StaleGroupID(stream string, epoch uint64) string

StaleGroupID is the id of a stalled stream's group: the stream and the sprint's epoch, as every judgment id carries it, so wait takes it at the epoch it is shown at.

func StaleStream

func StaleStream(id string) (string, bool)

StaleStream is the stream a stalled stream's group id names, and whether id is one.

func StatsRecords

func StatsRecords(s *Snapshot) map[string][]string

StatsRecords is the Load extras Stats wants: every work card and read card of every primary on the work table, each attempt's, placed or retired, so a read asked and moved to another reader is counted against the one first asked.

func StopArgs

func StopArgs(reason, until string, now time.Time) (time.Time, error)

StopArgs is a stop by hand's --reason and --until (docs/SPEC-SPRINT.md section 14): both are wanted, and one refusal names every one missing. --until is a duration from now (90m), a clock time (2:04 PM, 14:04: today's, or tomorrow's once today's has passed) or an RFC 3339 time; it returns the time, which must be after now.

func StopHasLanded

func StopHasLanded(s *Snapshot, stream string) bool

StopHasLanded says a sentinel of the stream has landed. That is the stop behind a closed stream; a landed stream with none still comes back waiting.

func StoppedBetween

func StoppedBetween(spans []Span, from, to time.Time) time.Duration

StoppedBetween is the time the spans were STOPPED between from and to: a deadline compares running time, which is the clock's time less this.

func StoppedText

func StoppedText(who, reason string, until, now time.Time) string

StoppedText is the machine line's state for a stop by hand (docs/SPEC-SPRINT.md section 14): "STOPPED by <who>: <reason>, back by <time>", the time on the clock's day as 2:04 PM, on another day with its date.

func StoredID

func StoredID(id string, epoch uint64) string

StoredID is a card's id as the table layer holds it at an epoch: the id at epoch 0, the id and the epoch after it at a later one. The table layer keeps a record of every id it held, bound to its epoch, so a card id is used again in a later epoch under another stored id.

func StreamBases

func StreamBases(s *Snapshot) map[string]StreamBase

StreamBases is every stream's base, from its control card and its landed cell.

func StreamBasesOf

func StreamBasesOf(s *Snapshot, stream string) []string

StreamBases is the bases a stream's cards name, as StreamRepos reads the repositories.

func StreamCostSince

func StreamCostSince(cost string, base StreamBase) string

StreamCostSince is a stream's landed cost since its tidy: the control card's exact cost less the base's, "" when that is nothing (the cell's "-"); the cost unchanged when the base names none or either does not read.

func StreamGone

func StreamGone(s *Snapshot, stream string) bool

StreamGone says the stream is a row of neither the work nor the merge table: stream remove took it off, and nothing the tick or the coordinator does can act on it in this epoch. An archived stream's rows are kept, hidden, and it is not gone.

func StreamHeld

func StreamHeld(s *Snapshot, stream string) bool

StreamHeld says the coordinator holds the stream (hold <stream>): none of its ready primaries is dealt, to a machine or a friend, until unhold (docs/SPEC-SPRINT.md section 11, hold).

func StreamOwesLanding

func StreamOwesLanding(s *Snapshot, stream string) bool

StreamOwesLanding says the stream has a queued merge card that is merging in work: a landing it dealt, which the merge step records even from landed.

func StreamPriorities

func StreamPriorities(s *Snapshot) map[string]string

StreamPriorities is each stream's default level that is not normal, by stream.

func StreamProse

func StreamProse(s *Snapshot, stream string) []string

StreamProse is a stream's prose globs (FieldProse, written by `stream set --prose`): the files whose backquotes are their own, nil when it names none.

func StreamRepos

func StreamRepos(s *Snapshot, stream string) []string

StreamRepos is the repositories a stream's cards name: the union of its control card's repo field (every add records there) and the cards placed in its row.

func StreamStateText

func StreamStateText(fields map[string]string) string

StreamStateText is a stream's state cell: held while the coordinator holds it and it is not stopped (a stop is the merge's, and says more), else its control card's state (docs/SPEC-SPRINT.md section 11, hold).

func StreamSubject

func StreamSubject(stream string) string

StreamSubject is the subject of a stream-level judgment.

func StreamTierCosts

func StreamTierCosts(s *Snapshot) map[string]TierCosts

StreamTierCosts is each stream's TierCosts, by stream, over the work table's rows.

func StreamTitle

func StreamTitle(brief string) string

StreamTitle is the first sentence of a brief's THE TASK: the text after `THE TASK.` or `THE TASK:` at the start of a line, to the first `. ` and without its final dot. "" when the brief names no task.

func StreamWorkTier

func StreamWorkTier(s *Snapshot, stream string) string

StreamWorkTier is the stream's work tier: the strongest tier its open cards' briefs name (TierWord; a frontier card works on pro's routes for reads), flash with none.

func SwitchWord

func SwitchWord(props map[string]string, prop string) string

SwitchWord is a switch's word as the work table's properties hold it: SwitchOff when set off, else SwitchOn (the default).

func TickEndCounts

func TickEndCounts(n Note) bool

TickEndCounts says a note is an item for the coordinator that a tick-end counts: a judgment, or a happened note addressed to someone (the sprint is done). The tick-end note itself is not.

func TickKept

func TickKept(typ string) bool

TickKept says the tick keeps the judgments of this type: it writes one while its condition holds and closes it when the condition clears.

func TidyDone

func TidyDone(s *Snapshot, kinds []string, stopped func(from, to time.Time) time.Duration) ([]TidyRow, Plan)

TidyDone is the tidy of the done cells of the fleet rows its kinds name (friends: the friends' rows, FriendRow; fleet: the machines'): each row with a finished card, in row order, and the plan that takes the history-only cards off (TidyKept), one unit each, their records kept, with each tidied row's median run wall carried (CarriedMedians).

func TidyKeepWindow

func TidyKeepWindow(s *Snapshot) time.Duration

TidyKeepWindow is how recent a finish a tidy keeps, in running time: the largest of the windows that read the newest finishes, the friend-finish window (the idle rule), OverloadWindow and TidyViewWindow.

func TidyKept

func TidyKept(s *Snapshot, stopped func(from, to time.Time) time.Duration) map[string]string

TidyKept is the finished cards a tidy leaves on their done cells, by id, with why; every other finished card is history only, which its record keeps:

  • the work card of a primary on the work table not landed (its review, its reads, its merge and its next attempt's base read every attempt of it);
  • a card finished within TidyKeepWindow of running time (stopped, the time the machine was STOPPED between two clock readings, as the idle rule measures it; nil is none): the idle rule, the overload window and the coordinator view read the newest finishes;
  • each row's newest RouteRestWindow finished cards, and the cards holding each route's newest RouteRestWindow ended takes, whatever their age: the rest rule's sample;
  • each provider's newest ok finish, whatever its age: a provider's return (providerBack) reads whether an ok card of the provider finished after a failure.

func TierCounts

func TierCounts(s *Snapshot) map[string]int

TierCounts counts every primary on the work table (sentinels left out) by tier (TierWord).

func TierRoutes

func TierRoutes(routes []Route) string

TierRoutes is how many enabled routes each tier has, as `where` shows it: "flash=1 pro=3", "" when the store has none.

func TierSubject

func TierSubject(tier string) string

TierSubject is the stream word a tier's judgment is filed under: no stream id has a colon, so it is never a stream's.

func TierWord

func TierWord(c *Card) string

TierWord is the tier a card's brief names on its line 1 (any word the brief carries), flash when it names none.

func TimeoutKind

func TimeoutKind(report string) string

TimeoutKind is the timeout a member's finish report names, "" for a report that is no timeout: `staging refused: stage-timeout` (or a staging take's own line, `stage-timeout`), `deadline: ...`, and `budget: unverifiable: the usage source stopped answering, ...`.

func TimerSubject

func TimerSubject(id string) string

TimerSubject is the subject a timer's judgment is open on: its own id, so one timer is one judgment and no card's judgment is it.

func TookText

func TookText(d time.Duration) string

TookText is a duration as the done note and the sprint line say it: to the second.

func TraceIdle

func TraceIdle(s *Snapshot, r TickReq) string

TraceIdle is the idle note's words: each waiting card's chain traced to its root (a drop-blocked or missing need, a held card, an unreleased sentinel, an in-flight card held by an open judgment, a stream stopped, a tier no route serves, or work in flight), the roots grouped and named by the cards behind them, the most first, at most IdleRoots. Every waiting card is traced once (memoized), so the counts are the table's.

func TwinBrief

func TwinBrief(brief, old string, paths []string, carry *TwinCarry, instruction string) string

TwinBrief is brief with every PATHS: line widened by paths (each glob once, in order), the carry's CARRY: line in its header, and THE TASK prefixed by the correction: the carried branch and head, then the instruction verbatim. A brief with no THE TASK paragraph gets one after its header (cardhdr.KeyValue lines up to the first other line).

func TwinBriefDir

func TwinBriefDir(s *Snapshot) (string, error)

TwinBriefDir is the directory the paths rule writes twins' briefs under: PropTwinBriefs, else EnvTwinBriefs, else <home>/nova-sprint/jobs.

func TwinBriefPath

func TwinBriefPath(s *Snapshot, card, twin string) (string, error)

TwinBriefPath is where the twin's brief of the card is written: <dir>/<card>/<twin>.md.

func TwinCommand

func TwinCommand(s *Snapshot, pr *Card, p PathsProposal) string

TwinCommand is the complete command a mind runs to replace the card by the twin of the proposal: add --replaces, with the card's stream, needs, place and hold, and the brief file the machine writes (TwinBriefPath).

func TwinID

func TwinID(s *Snapshot, c *Card) string

TwinID is the first of TwinIDs that no card on the table or off it has, "" when every one is taken.

func TwinIDs

func TwinIDs(c *Card) []string

TwinIDs is the ids TwinID chooses among for c's twin, in order: the old id with a letter after it, b to z, or, for a twin that replaced one card under the old id and one letter ("lint-pkg-cairn-tb" for "lint-pkg-cairn-t"), that id with the letters after the twin's.

func TwinNumberIDs

func TwinNumberIDs(id string) []string

TwinNumberIDs is the ids the twin of id chooses among, in order: id with its trailing number raised (cards3 -> cards4, cards4, ...), or with 2 after it when it ends in none.

func UnitDir

func UnitDir(goos, home string, getenv func(string) string) string

UnitDir is where a unit goes when no directory is named.

func UnitKindNames

func UnitKindNames(tool string) []string

UnitKindNames is every kind's word whose install verb is tool's, in UnitKinds' order.

func UnreconciledSpend

func UnreconciledSpend(s *Snapshot) float64

UnreconciledSpend is what the providers counted beyond the sprint's records, in dollars: over every provider's record, each day since the sprint's epoch began, the last read of the day's provider figure less the records', where it is more.

func ValidBase

func ValidBase(base string) bool

ValidBase says base is a branch name a lander could cut: the shape above and the component rules git adds (no "..", "//", a trailing "/", ".lock" or ".").

func ValidCardID

func ValidCardID(s string) bool

ValidCardID says a card's id is its parts joined by dots, each a ValidID word: a primary (p), a work card (p.w1), a read card (p.r1.reader, or p.r1.reader.g1 with generation suffix).

func ValidGoalName

func ValidGoalName(name string) error

ValidGoalName is nil for a name that is safe in a file name and a route: lower-case letters, digits, dot, dash and underscore, at most 64, starting with a letter or digit.

func ValidGoalText

func ValidGoalText(text string, max int) error

ValidGoalText is nil for text a reminder can carry: not blank, valid UTF-8, no more than max bytes.

func ValidID

func ValidID(s string) bool

ValidID says a primary id, a stream, a reader or a member name is one word of letters, digits, _ and -. A dot is refused: it separates the parts of a card's identity.

func ValidLaneWho

func ValidLaneWho(who string) bool

ValidLaneWho says who may hold or wait on a lane: a ValidID (a worker), or two joined by one / (a holder and its part: the lander's gate of a stream, lander/<stream>, or of the base re-check, lander/base; docs/SPEC-SPRINT.md section 7).

func ValidTimerNote

func ValidTimerNote(text string) error

ValidTimerNote is nil for text a timer can carry: not blank, valid UTF-8, no more than MaxTimerNote bytes.

func WaitsFor

func WaitsFor(s *Snapshot, c *Card, landing map[string]bool) []string

WaitsFor is what a primary still waits for: its needs that have not landed (before the step, or in it: landing) and that the coordinator did not waive.

func Weights

func Weights(s *Snapshot) map[string]int

Weights is each open primary's weight: how many cards on the table, not landed, wait on it through their needs, transitively. A card off the table or landed weighs nothing and counts for nothing, and a need the waiting card waived adds nothing to the need's weight.

func WhereReleasesCountCardsLeft

func WhereReleasesCountCardsLeft(clocks []StreamClock, streamCardsLeft map[string]int64) map[string]int64

WhereReleasesCountCardsLeft folds cards left per release from stream clocks and per-stream cards left counts (docs/SPEC-SPRINT.md section 11, where --release).

func WhoOfBrief

func WhoOfBrief(brief string) string

WhoOfBrief is the who a brief gives its card (FieldWho): "" when its header names no friend (or its WHO line does not read: add refuses that brief), else WhoFriend or FriendRow(<name>), with an only. prefix for a hard pin.

func WidenAdjacent

func WidenAdjacent(paths []string, f, text string, hold bool) string

WidenAdjacent is why file f is adjacent to a change inside paths: a test file of a package PATHS name, a file under that package's testdata, a ledger under internal/ci/testdata, a markdown file under docs/ or an AGENTS.md map (the docs the class tests read), or, in a HOLD, a file named with its reason (namedWithReason); "" when none holds.

func WidenBrief

func WidenBrief(brief string, globs []string, carry string) string

WidenBrief is brief with every PATHS: line widened by globs and, with carry, its CARRY: line (PathsWidened, the read-broken rule's), and a PATHS: line after line 1 holding just globs when it has none.

func WidthOfCores

func WidthOfCores(cores int) int

WidthOfCores is the default width of a machine with these logical cores, half of them (the owner, 2026-10-02: "default is CPUs/2"), at least 1 and at most MaxWidth; 0 when the cores are not known (no beat has reported them). It is what fleet sync writes for a machine row with no width (config.MachineWidth, Default).

func WidthText

func WidthText(ctl *Card) string

WidthText is the fleet table's width cell of a member's control card.

func WorkCardID

func WorkCardID(primary string, attempt int) string

WorkCardID is the identity of a primary's work card for one attempt.

func WorkDeadline

func WorkDeadline(s *Snapshot, c *Card) (field string, limit time.Duration, word, own string)

WorkDeadline is the deadline a work card is held to, by its state: a card not taken since its last deal (ready, or withdrawn again before a take) is late never taken past the dealt bound (s.DealtMax) from untaken_since, the first deal since its last take, which on a machine's row no later redeal or withdrawal rewrites: a card waiting in a member's ready queue is the machine's queue, so its own deadline starts at its take (nova-tools#5096 item 22). The exception is a friend's row: a friend takes her own ready cards, so a card dealt to her after a take-back (dealt later than untaken_since) is measured from her own deal, never from the take-back or the time it waited withdrawn; a card working, or withdrawn from a take, is late not finished 2 hours from first_taken, the attempt's first take. The tick's deadline part and the no-stall rule both call it, so they speak at the same moment. field is the stamp it counts from; own is the stamp of the current member's own deal or take, which says whether that member has had its whole deadline ("" when the card is withdrawn: no member holds it). The model is tla/SprintEvents.tla, the untaken timer of DealtMax units.

Types

type AcceptCard

type AcceptCard struct {
	ID, Stream, Col, Tier, Head string
}

AcceptCard is one primary of a stream as the acceptance checks read it.

type AcceptDrop

type AcceptDrop struct {
	ID, Stream, Reason string
}

AcceptDrop is one card dropped off the work table and its reason.

type AcceptGate

type AcceptGate struct {
	Base, Class string
	OK          bool
}

AcceptGate is one tree gate run at a base: the class it covered.

type AcceptJudgment

type AcceptJudgment struct {
	ID, Stream, Kind string
}

AcceptJudgment is one open judgment naming a stream.

type AcceptPromotion

type AcceptPromotion struct {
	Sha              string
	Queued           bool
	AfterLastLanding bool
}

AcceptPromotion is the promotion carrying a stream's landings to dev.

type AcceptProse

type AcceptProse struct {
	Path, Check string // links or nocode
	OK          bool
}

AcceptProse is one prose check's result on a path.

type AcceptRead

type AcceptRead struct {
	Primary, Stream, Head, Reader, Verdict string
}

AcceptRead is one reader's read of a primary at a head.

type AcceptReq

type AcceptReq struct {
	Sel
	Answers []string
	Who     string
	// Heavy records the coordinator's own heavy read (heavyRead): one ok read
	// toward the read rule, resting on the file at Evidence, whose sha256 is
	// EvidenceSHA, for Reason.
	Heavy                 bool
	Evidence, EvidenceSHA string
	Reason                string
	// ReadOK is accept --read-ok: every primary in review with the ok reads it
	// needs. The tick accepts those itself (TickAccept); the verb is for a stuck
	// case, and says so when nothing waits.
	ReadOK bool `json:",omitempty"`
}

AcceptReq is the coordinator accepting primaries in review.

type Acceptance

type Acceptance struct {
	Streams   []string         // the streams this release check named
	Cards     []AcceptCard     // the streams' primaries, placed or landed
	Reads     []AcceptRead     // the readers' reads of those primaries
	Gates     []AcceptGate     // the tree gate's runs at the stream's base
	Prose     []AcceptProse    // nova-check's prose results for the stream
	Promote   AcceptPromotion  // the promotion carrying the stream's landings
	Judgments []AcceptJudgment // the open judgments naming a stream
	Dropped   []AcceptDrop     // the stream's dropped cards and their reasons
}

Acceptance is the acceptance sentinel's snapshot: everything the six checks may read. Empty Streams is no stream being accepted, so every check passes and says so; a stream with a fact missing fails naming the fact.

func AcceptanceOf

func AcceptanceOf(s *Snapshot, lines []Line, glob string) Acceptance

AcceptanceOf is the acceptance sentinel's facts read from a snapshot, the log and the streams glob: the verb binds it; a test builds a twin of it.

type AckReq

type AckReq struct {
	Notes  []string
	Reason string
	Who    string
}

AckReq is the coordinator saying it looked at judgments and nothing is to be done.

type AddReq

type AddReq struct {
	Stream string
	IDs    []string
	Count  int // generate this many ids, <stream>-<n>
	Needs  []string
	Brief  string
	Rules  string // the held rules file of every card the add admits with Brief (FieldRules)
	// Base is the branch Brief names on its BASE: line, as CardAdd.Base.
	Base string
	// Repo is the repository Brief names on its REPO: line, as CardAdd.Repo.
	Repo string
	// Cards, when set, is the many-brief form: one card per entry, in order,
	// each with its own brief and needs (a need names a primary already on
	// the table or one of this add). IDs, Count, Brief and Needs are then
	// empty.
	Cards []CardAdd
	Score *float64 // the first primary's score; the rest follow it
	// Sentinel admits one sentinel (IDs names it): a stop in the stream that
	// the coordinator releases (docs/SPEC-SPRINT.md, sentinel cards).
	Sentinel bool
	// Before or After places the cards in line, in front of or after this
	// card of the stream: their scores lie between its and its neighbour's.
	Before, After string
	// Every, with Count, puts a sentinel <stream>-gate-<n> after every Every
	// cards, none after the last unless Last: a stream in stops, one step.
	Every int
	Last  bool
	// Held admits every card held (IsHeld): waiting, a sentinel never
	// reached, nothing dealt, until the coordinator's release.
	Held bool
	// BriefOps is each card's brief decision op id (FieldBriefOp), by card id, and
	// BriefRecord the record that holds them (FieldBriefRecord): empty when add asked
	// none.
	BriefOps    map[string]string
	BriefRecord string
	// Replaces names the cards the one card this add admits replaces (add --replaces, twins.go):
	// it takes over every edge where a waiting card needs one of them, and each still on the
	// table is dropped "replaced by <the new id>", in the same step, raising no blocked
	// judgment.
	Replaces []string `json:",omitempty"`
	Only     []string
	Who      string
}

AddReq admits primaries into a stream.

func FixCards

func FixCards(s *Snapshot, r AddReq) (add AddReq, dup []string)

FixCards is the add of a red run's fix cards against the table: a card whose test an open card already names (its TEST line, or its id) is left out and named in dup, an id a landed card holds takes the next free -<n>, and the cards are ranked first, every one scored below every card on the work table. An add with no cards left is r with no cards.

func (AddReq) IsGate

func (r AddReq) IsGate(id string) bool

IsGate says the id is a sentinel this add names by --sentinel-every.

type AdmissionTree

type AdmissionTree struct {
	Files   []string
	Hold    func(ident string) ([]string, error)
	Missing string
	At      string
}

AdmissionTree is the BASE tip the check reads. Files are the repo-relative paths at that tip. Hold is a plain grep: the files whose text contains ident, anywhere in the tree. Missing is why the tip could not be read, and then the check says so once and invents no path miss. At is how a refusal names the tip.

type Adopter

type Adopter interface {
	Target() string
	Start(machine, version, episode string) bool
	Adoption(machine, episode string) MachineAdoption
}

Adopter adopts a release onto one machine at a time. Target is the release the coordinator's own machine runs ("" is none known, and nothing is adopted); Start begins the adoption of version on the machine for the episode, and is false while one is in flight there (never two at once); Adoption is the episode's adoption, AdoptNone when it was never started. The tick calls it from inside a plan, so a call must be quick: the work runs beside the tick (cmd/nova-sprint/fleet_back.go, internal/release/adopt_one.go).

type AskReq

type AskReq struct {
	Sel
	Another bool // one more reader for a primary already asked
	Answers []string
	Who     string
	// Instead is the reader whose live read of the one primary named is taken
	// back (retired_by coordinator) and asked of one other reader in the same
	// step, chosen and routed as Another's (ask --instead)
	Instead string `json:",omitempty"`
}

AskReq deals primaries in review to readers.

type AskedCheck

type AskedCheck struct {
	Nonce string    `json:"nonce"`
	Run   string    `json:"run,omitempty"`
	At    time.Time `json:"at"`
}

AskedCheck is one session check her daemon said it asked: the nonce, the daemon's run that asked it (its generation: a restart is another run), and when the server recorded the ask.

func ProveBeat

func ProveBeat(asked []AskedCheck, w BeatWords, now time.Time) (next []AskedCheck, proved bool, why string)

ProveBeat is one beat's proof step at now, the server's clock, over the checks her record holds: the checks still answerable after it (an ask recorded, a stale one dropped, the answered one gone), whether the beat proved her session, and, when its --pong proves nothing, why ("beat with no proof: ..."). It reads nothing but its arguments.

type BalanceReq

type BalanceReq struct {
	Reads []ProviderRead
	Who   string
}

BalanceReq is the reads of one poll.

type Base

type Base struct {
	Attempt int    `json:"attempt"`
	Head    string `json:"head"`
}

Base is where a later attempt of a card starts: the attempt whose pushed head it is, and the head; the zero Base is the card's own base.

func BaseOf

func BaseOf(attempts []*Card) Base

BaseOf is the one place that decides where the attempt after starts (tla/CardContract.tla, RestagedAtLastPushedHead; docs/SPEC-CARD-CONTRACT.md layer 1): the head of the latest attempt of attempts that finished ok at a full sha, whatever happened to the attempts after it. The packet and `card` both read it, so the display is what the packet hands out.

type BaseCure

type BaseCure struct {
	CureHead
	Tip   string
	Tried []CureTry
}

BaseCure is what one search found: the head that cures the base (ID "" when none does) and the clone's HEAD, its merge onto the base, which passed the gate; and each head tried that was no cure, with why. With no cure HEAD is the base again.

func FindBaseCure

func FindBaseCure(ctx context.Context, req BaseCureReq) (BaseCure, error)

FindBaseCure tries each queued head, in order, merged onto the red base alone, through the base's own tree gate; the first green is the cure, the clone left at its merge. A head tried before on this base (Tried) is skipped. The error is a search that could not be decided: no gate, a git failure, a merge's env.

func (BaseCure) Found

func (c BaseCure) Found() bool

Found says a queued head cures the base.

func (BaseCure) Note

func (c BaseCure) Note(base, why string) string

Note is the cure's landing note, on its merge card's timeline: the head landed first as the base fix, the base it fixed and the finding it cured.

type BaseCureReq

type BaseCureReq struct {
	RepoDir string     // the land round's clone, HEAD at the red base
	Base    string     // the red base's tip commit: HEAD is reset to it before each try
	Heads   []CureHead // the queued heads, in queue order
	Env     []string   // git's whole environment, the land round's (nil inherits)
	// Merge merges one head onto HEAD: card is why the head itself does not merge (it is not
	// a cure; the search goes on), env a failure that is not the head's (the search stops).
	// nil is a plain `git merge --no-ff` of the head.
	Merge func(ctx context.Context, h CureHead) (card, env string)
	// Gate is the base's tree gate, run on each merged tree: "" green, else the finding.
	// Required: a search with no gate refuses.
	Gate func(ctx context.Context, dir string) string
	// Tried says a head was tried on this base before and was no cure: it is not gated again.
	Tried func(h CureHead) bool
}

BaseCureReq is one search for a base fix in the land round's clone.

type BaseGreenReq

type BaseGreenReq struct {
	Stream string
	Base   string
	Sha    string
	Who    string
}

BaseGreenReq is a land pass's re-check of a base that stopped streams: the base Base passes its tree gate at the commit Sha. Stream is the stream the pass re-checked it for.

type Beat

type Beat struct {
	At      time.Time      `json:"at"`
	Load    float64        `json:"load"`
	Cores   int            `json:"cores,omitempty"`
	How     string         `json:"how,omitempty"`
	Samples []LoadSample   `json:"samples,omitempty"`
	Meter   hostload.State `json:"meter"`
	// Friend is what a friend's beat reports of her work (friend beat); nil on a
	// machine's beat.
	Friend *FriendReport `json:"friend,omitempty"`
	// Proof is a friend's session's last proof as her beat carried it (friend beat
	// --pong: her session's answer to a SESSION CHECK, or its own bus message), zero
	// when her beat carried none; the friend beat record keeps it under "pong".
	Proof time.Time `json:"pong,omitzero"`
	// StopReturns is how many stop-returns a member's lanes still owe after the machine's
	// stop (fleet beat --stop-returns; docs/SPEC-SPRINT.md section 14, stop cancels jobs):
	// start waits for zero. A friend's count is her report's (FriendReport.StopReturns).
	StopReturns int `json:"stop_returns,omitempty"`
}

Beat is a member's presence record: its last beat, to the second, the highest load of its beats within LoadWindow of it, how the last one was measured, those beats' loads, the measuring state the next beat starts from, and the machine's logical cores, which a member with the default width takes half of (WidthOfCores; fleet sync).

func NextBeat

func NextBeat(prev Beat, now time.Time, pct float64, how string, meter hostload.State) Beat

NextBeat is the record after a beat at now with the load pct: the beat at the second, the samples of the last LoadWindow with this one in place of any of the same second, and their highest as the load. Two beats in the same second with the same load write the same record.

func (Beat) Alive

func (b Beat) Alive(now time.Time) bool

Alive says the member has beaten and has missed fewer than MissedBeatsDown beat windows in a row: the rule of the model's Lapse.

func (Beat) Beaten

func (b Beat) Beaten() bool

Beaten says the member has beaten at least once.

func (Beat) Fresh

func (b Beat) Fresh(now time.Time) bool

Fresh says the last beat is within BeatDeadline of now.

func (Beat) Missed

func (b Beat) Missed(now time.Time) int

Missed is how many beat windows of BeatDeadline went by after the last beat with no beat: 0 while it is fresh, 1 until two windows have passed, and so on; a member that never beat has missed none (it is down by never beating).

func (Beat) SaysDown

func (b Beat) SaysDown() bool

SaysDown says the beat is her daemon's word that she is down (FriendReport.Until): however fresh, it never makes her up.

type BeatWords

type BeatWords struct {
	Run, Check, Pong string
	// Legacy is a --pong that was a time, taken within LegacyPongGrace of the server's
	// start (the verb decides): the store keeps it as the proof, as before the nonces.
	Legacy time.Time
}

BeatWords are the proof words of one beat: the daemon's run, the check it asked (--check) and the check its session answered (--pong), each "" for none.

type BriefBound

type BriefBound struct {
	ID       string
	Attempts [2]int // the two attempts that failed the same way, in order
	Finding  string // the finding's first sentence, as the first of the two said it
	Since    int    // the attempts since the brief last changed, when that is the bound
	Cap      int    // the cap those attempts reached
	Spent    string
	Findings []string
}

BriefBound is why a primary's brief is wrong: two attempts since the brief last changed whose readers found the same thing (Attempts and Finding), or the cap's attempts since it changed (Since and Cap, with Finding ""): then Spent is what the card has cost (MoneyText, "" when nothing of it was priced) and Findings what each attempt found, in order.

func AtBriefBound

func AtBriefBound(c *Card, finding string, cap int) (BriefBound, bool)

AtBriefBound is whether the primary c is at its brief's bound, and why. finding is what its readers found at its current attempt, or the report of its failed work: the broken reads' findings the store holds (brokenFindings), or the one a read step is about to write; "" when none is known. cap is the attempts one brief may run (AttemptsCap). The finding before is the primary's own (`finding`, at FieldFindingAttempt), counted only when that attempt ran on the current brief. The count is the attempts since the brief last changed; a card never dealt is at no bound.

func (BriefBound) Remedy

func (b BriefBound) Remedy() string

Remedy is what changes the brief: corrected in place, the card's next attempt staged from its last pushed head, or the card dropped. A rework's --fix changes the brief not at all, so it is never offered.

func (BriefBound) String

func (b BriefBound) String() string

String is the bound said in one line: what repeated and where, or the cap, the spend and the findings, then the verdict.

func (BriefBound) Why

func (b BriefBound) Why() string

Why is the rework's refusal of a card at the bound: the line, and the remedy.

type BriefCard

type BriefCard struct {
	ID, Brief string
	Rules     string   // the held rules file the new brief is held to by reference (FieldRules), "" when it carries its own
	Needs     []string // the new brief's needs, as add reads its DEPENDS-ON: line (briefNeeds): a change to that line alone is taken in any state
}

BriefCard is one primary's new brief (brief <id>, or one file of brief --dir).

type BriefEdit

type BriefEdit struct {
	SetBase string `json:",omitempty"` // the BASE: line names this branch
	DropWho bool   `json:",omitempty"` // the WHO: line is taken out: no friend is named
}

BriefEdit is a brief transform (nova-sprint brief and recut by selector): instead of a whole new brief, each selected card's own brief changed by rule.

func (BriefEdit) Apply

func (e BriefEdit) Apply(brief string) string

Apply is brief with the transform made on its header block (the key: value lines under line 1, as cardhdr.ReadWho reads them): every WHO line taken out with DropWho, and with SetBase every BASE line's value replaced, or one BASE line put under line 1 when the header has none.

func (BriefEdit) Given

func (e BriefEdit) Given() bool

Given says the transform changes anything.

type BriefReq

type BriefReq struct {
	Cards          []BriefCard
	ID, Brief, Who string
	Rules          string   // the held rules file, when Cards is empty and Brief is set
	Needs          []string // the new brief's needs, when Cards is empty and Brief is set
	Answers        []string // the judgments the edit answers (--answers): each must be one it closes
	// Tier, with no Brief, re-tiers the card (nova-sprint brief --tier): the tier every
	// later deal of the card draws its route from, written on the primary as FieldTier
	// as rework --tier writes it; taken in any state, on a RUNNING machine and for a card
	// dealt (it applies to the next attempt).
	Tier string
}

BriefReq replaces the briefs of primaries that have not started: one card (brief <id>; Cards, or the ID and Brief fields) or one per file of a directory (brief --dir, Cards). Tier, with no brief, re-tiers the card ID names.

type BriefSelReq

type BriefSelReq struct {
	Sel  Selector
	Tier string    `json:",omitempty"`
	Edit BriefEdit `json:",omitempty"`
	Who  string
}

BriefSelReq is brief by selector: every selected card's own brief with Edit made, and with Tier re-tiered, in one step.

type Bump

type Bump struct {
	Table, ID, Field string
	Delta            int
}

Bump adds Delta to a counter field of a card that several units of one step share: the store binding sums the bumps of the units it applies together into one entry.

type BusM

type BusM struct {
	Addr string `json:"addr,omitempty"`
	Err  string `json:"err,omitempty"`
}

BusM is nova-bus2's store: address NOVA_BUS_REDIS names ("" is not configured) and error of a ping.

type CIReq

type CIReq struct {
	Sel
	Red    bool
	Head   string // the head the run tested; "" is the primary's current head
	Run    string // the run's identity: a retried report of one run is recorded once
	Source string
	Note   string
	Who    string
}

CIReq records a CI observation for primaries, in any state.

type Card

type Card struct {
	ID       string
	Row, Col string
	Score    float64
	Rev      uint64
	Fields   map[string]string
}

Card is one member of a table as observed: its place (empty when the record is kept but unplaced), score, member revision and fields.

func AtIdenticalFailure

func AtIdenticalFailure(s *Snapshot, pr *Card) *Card

AtIdenticalFailure is the primary's failed work card when its attempt failed the way the attempt before did (FieldIdenticalAt): it is in review, its work came back failed, and the bound's judgment holds it until a rework (a new attempt) or a drop. nil when not.

func AtRedealBound

func AtRedealBound(s *Snapshot, pr *Card) *Card

AtRedealBound is the primary's withdrawn work card when it is at its redeal bound at its ceiling: a take of it ended (FieldTakeEnded) with its count at MaxRedeals, so the deal that would place it again would pass the bound. The tick deals it no more. nil when it is not: a card withdrawn while ready keeps its count and is dealt again (tla/DirtyTick.tla AtRB), and a card below its ceiling (NextTier) is the deal's to escalate, no judgment raised (route.go, tierLadder).

func Behind

func Behind(s *Snapshot, st *Card) []*Card

Behind is the waiting primaries whose stop is the sentinel: what its release lets go.

func LandedSince

func LandedSince(s *Snapshot) (cards []*Card, branch string)

LandedSince is the primaries (sentinels aside) landed after the last promotion, oldest first by their landing stamp, and the branch the most of them name as their base.

func MergePriorityOrder

func MergePriorityOrder(s *Snapshot, cards []*Card) []*Card

MergePriorityOrder orders eligible merge cards by priority without passing their named or positional dependencies (docs/SPEC-SPRINT.md, Priority). Equal levels retain work order; cards with unresolved dependencies are not eligible.

func StopBefore

func StopBefore(s *Snapshot, stream string, score float64, landing map[string]bool) *Card

StopBefore is the sentinel a primary at score in the stream waits behind: the last one before it that has not landed (landing: this step lands it). nil when none.

func Unlanded

func Unlanded(s *Snapshot, stream string) []*Card

Unlanded is the cards of the stream that have not landed, in work order: its primaries and sentinels in any column of its work row but landed, and its merge cards queued or stuck.

func (*Card) F

func (c *Card) F(name string) string

F is a field, "" when absent.

func (*Card) Has

func (c *Card) Has(name string) bool

Has says the card has the field, set to any value, an empty one too.

func (*Card) Int

func (c *Card) Int(name string) int

Int is a counter field, 0 when absent or unreadable.

func (*Card) Placed

func (c *Card) Placed() bool

Placed says the card has a place in its table.

type CardAdd

type CardAdd struct {
	ID    string
	Brief string
	// Rules is the held rules file the member injects into this card at stage time
	// (FieldRules), "" when the brief carries its own.
	Rules string
	Needs []string
	File  string
	// Base is the branch the brief names on its BASE: line (swarm.ReadCardBase), "" for
	// none: add admits a card based on dev only into the promotion stream (SprintBranchWhy).
	Base string
	// Repo is the repository the brief names on its REPO: line (swarm.ReadCardBase),
	// recorded on its stream's control card as the stream's repository (FieldRepo).
	Repo string
	// Sentinel marks this card a sentinel (a stop), not a primary: the
	// many-brief form's --sentinel <id>, admitted after the brief cards.
	Sentinel bool
}

CardAdd is one card of the many-brief add form: its id, brief and needs. File names the brief file the card came from, for a refusal that names it.

type CardBaseReq

type CardBaseReq struct {
	ID, Base string
	OnOrigin bool
	Who      string
}

CardBaseReq re-points a merging card's BASE (nova-sprint card base). OnOrigin is the caller's fact, one git ls-remote, that the branch is on the card's origin.

type CardCostView

type CardCostView struct {
	Consumers []Consumer     `json:"consumers"`
	Total     cardcost.Total `json:"total"`
	Cut       int            `json:"cut,omitempty"`
}

CardCostView is a producer card's cost: each consumer that ended, the totals, and how many records past the bound the list leaves out (Cut; the totals hold them).

func CardCostOf

func CardCostOf(pr *Card) CardCostView

CardCostOf is the producer's cost as the primary carries it: its records, in the order they ended, and its total.

func (CardCostView) CostLines

func (v CardCostView) CostLines() []string

CostLines are the producer's cost as `card <id>` prints it, from the primary alone: one COST line per consumer and the COST TOTAL line (charged_usd: each consumer's actual cost where reported, else its predicted one, summed). A count or time not reported is "-", a cost not known is "-", never 0.

type CardRow

type CardRow struct {
	ID     string `json:"id"`
	Stream string `json:"stream"`
	Col    string `json:"col"`
	Tier   string `json:"tier"`
	Holder string `json:"holder,omitempty"` // the member or friend running it; "" when no one is
}

CardRow is one primary of the cards view.

func CardRows

func CardRows(s *Snapshot, f CardsFilter) []CardRow

CardRows lists the work table's primaries (sentinels left out) that the filter keeps, in stream, column and work order.

type CardScore

type CardScore struct {
	ID, Op, Class string
	P             float64
}

CardScore is one landed card's score: its top class, that class's p, and the id of the decision in the lander's record.

type CardWait

type CardWait struct {
	Card    string   `json:"card"`
	Operand string   `json:"operand"`
	On      []string `json:"on,omitempty"`
	Why     string   `json:"why"`
}

CardWait is one card's wait operand and why.

func WaitOf

func WaitOf(s *Snapshot, c *Card) CardWait

WaitOf is the one reading of why a card is not moving: release, its line, or the cards it names and its place in line.

type CardsFilter

type CardsFilter struct {
	Col, Stream, Holder string
}

CardsFilter keeps the primaries of a column, a stream and a holder; "" keeps all.

type Change

type Change struct {
	Table string // logical name
	Entry ntable.BatchMemberEntry
}

Change is one batch manifest entry for one table.

type Class

type Class struct {
	Name  string
	Run   []string
	Test  string
	Needs []string
}

Class is one run of the base's class suite (SPEC-SPRINT, the base's class gate). Needs are tree packages the clone must hold.

type CollectCard

type CollectCard struct {
	Friend, Card, Job string
}

CollectCard is a work card working on a friend's row: the friend, its card id and its job (the inbox/outbox name: StoredID at its epoch, .g<gen> from its second generation).

type CollectTree

type CollectTree struct {
	Friend  string
	Reports map[string]string
	Unread  map[string]string
	Runner  string
}

CollectTree is what one friend's working directory holds for the collect: her outbox's reports by job, the jobs her reports cannot be read for (and why), and her runner's log.

type Collected

type Collected struct {
	CollectCard
	From          string
	Verdict, Head string
	Failed, Dead  bool
	Report, Left  string
}

Collected is one card Collect finishes, or leaves. From is the friend whose outbox held the report ("" for a dead lane). Left, when not empty, says why the card is not finished this pass (a report with no Verdict line, or one that cannot be read): it is read again on the next.

func Collect

func Collect(cards []CollectCard, trees []CollectTree, deadLanes bool) []Collected

Collect is what the friends' trees finish of the cards working on their rows, a line each, in the order of cards: the card's own friend's report first, then the first tree that holds one; a card with no report anywhere is a dead lane when deadLanes is asked and its friend's runner ENDed the job with no report, and is not named otherwise.

type Command

type Command struct {
	Decision string   `json:"decision"`
	Lines    []string `json:"lines"`
}

Command is one decision open to the coordinator as the commands that make it, in order, one per line, ready to copy.

func NoteCommands

func NoteCommands(n Note, members []string) []Command

NoteCommands is one open judgment's decisions as commands, the members it names its subjects: as the inbox prints them for a group of one.

type ConfigCoordinator

type ConfigCoordinator func(context.Context) (string, error)

ConfigCoordinator reads the nova-config sprint row's coordinator: "" when the row names none. The command reads it with nova-config's library; a test passes a fake.

type Consumer

type Consumer struct {
	Kind    string         `json:"kind"` // work or read
	Card    string         `json:"card"`
	Attempt int            `json:"attempt"`
	Take    int            `json:"take,omitempty"` // a work card's take the provider failed, a read's run returned; 0 for the card's own
	Gen     int            `json:"gen,omitempty"`  // a work card's generation when it ended
	Who     string         `json:"who"`            // the member or the reader
	Route   string         `json:"route,omitempty"`
	Model   string         `json:"model,omitempty"` // provider/model
	Tier    string         `json:"tier,omitempty"`  // the tier its route was drawn from (flash first, pro on escalation)
	End     string         `json:"end"`
	At      string         `json:"at"`  // when it ended
	Key     string         `json:"key"` // the card and its run: one record per key, set once
	Usage   cardcost.Usage `json:"usage"`
	// Cap and Overrun are a capped take's lane cap and its wall past it (lane_cap.go), ""
	// for a take no cap ended.
	Cap     string `json:"cap,omitempty"`
	Overrun string `json:"overrun,omitempty"`
}

Consumer is one consumer of a producer card: a take of a work card or a run of a read card, who ran it (the member or the reader), on what route and model, how it ended, when, and its cost record.

type ControlLine

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

ControlLine is the server's line of control; its zero value is free. Lock, TryLock and Unlock are a batch's (and a lane's), TickLock is the run loop's.

func (*ControlLine) Lock

func (l *ControlLine) Lock()

Lock takes the line for a batch, in the order batches asked.

func (*ControlLine) TickLock

func (l *ControlLine) TickLock() time.Duration

TickLock takes the line for a tick and says how long the tick waited for it.

func (*ControlLine) TryLock

func (l *ControlLine) TryLock() bool

TryLock takes the line for a batch when it is free and nothing waits for it.

func (*ControlLine) Unlock

func (l *ControlLine) Unlock()

Unlock frees the line.

type CostReconcileRecord

type CostReconcileRecord struct {
	Provider string  `json:"provider"`
	At       string  `json:"at"`
	Known    bool    `json:"known"`
	Note     string  `json:"note,omitempty"`
	Day      string  `json:"day,omitempty"`
	Used     float64 `json:"used"`     // the provider's count of Day
	Internal float64 `json:"internal"` // the sprint's records of Day
	// InternalReads is the reads among Internal: the read share of the records.
	InternalReads float64           `json:"internal_reads"`
	Gap           float64           `json:"gap"`   // Used less Internal
	Share         float64           `json:"share"` // |Gap| over Used
	Days          map[string]DayGap `json:"days,omitempty"`
}

CostReconcileRecord is a provider's reconciliation as the fleet table keeps it.

func CostReconcileOf

func CostReconcileOf(fleet *Table, provider string) (CostReconcileRecord, bool)

CostReconcileOf reads a provider's record off the fleet table; false when there is none or it does not read.

func LatestReconciles

func LatestReconciles(s *Snapshot) []CostReconcileRecord

LatestReconciles is each provider's latest reconciliation off the fleet table, in provider order, without its kept days: what the where view shows per provider (where --json streams[<s>].reconciles, the sprint's, the same on every stream's record).

type CostReconcileReq

type CostReconcileReq struct {
	Reads []UsageRead
	Who   string
}

CostReconcileReq is the reads of one reconciliation.

type CriticalCard

type CriticalCard struct {
	ID     string `json:"id"`
	Behind int    `json:"behind"`
	State  string `json:"state"`
}

CriticalCard is one of where's critical lines: the primary, its weight and its state.

func Critical

func Critical(s *Snapshot, n int) []CriticalCard

Critical is the n heaviest open primaries with a weight above zero, heaviest first, by id among equals; nil when none has a weight.

type CureHead

type CureHead struct{ ID, Head string }

CureHead is one queued head the cure search tries: the card and its head.

type CureTry

type CureTry struct {
	CureHead
	Why string
}

CureTry is a head tried and refused as a cure: why (it did not merge, or its tree fails the gate).

type CycleFound

type CycleFound struct {
	Loop      []string
	Sentinels []string
	Stuck     int // cards that can never be reached
	// contains filtered or unexported fields
}

CycleFound is one cycle of needs on the table.

func Cycles

func Cycles(s *Snapshot) []CycleFound

Cycles is every cycle of needs on the table (a store written before add walked the sentinels' needs may hold one), each as its loop from its first card and the count of cards that can never be reached: the cards of the cycle and every waiting card that needs one of them, through any chain.

func (CycleFound) String

func (f CycleFound) String() string

type DashM

type DashM struct {
	Addr   string `json:"addr"`
	Status int    `json:"status"`
	Err    string `json:"err,omitempty"`
	Build  string `json:"build,omitempty"`
}

DashM is the local dashboard: address, HTTP status of GET /api/sprint (0 when request failed, Err says how) and build id the body carries.

type DayGap

type DayGap struct {
	Provider float64 `json:"provider"`
	Internal float64 `json:"internal"`
}

DayGap is one day's last reconciliation: the provider's count and the sprint's records.

type DealReq

type DealReq struct {
	Sel
	Who string
}

DealReq cuts and deals work cards for ready primaries.

type DecideOutcome

type DecideOutcome struct {
	Decision, Op, Label, Note string
}

DecideOutcome is one outcome the decide lane attaches: the decision's record (the attempt's or the grade's), its op id, the label and why.

type DevDrift

type DevDrift struct {
	BaseLacks int       `json:"base_lacks"` // commits dev has that the base lacks
	DevLacks  int       `json:"dev_lacks"`  // commits the base has that dev lacks
	Minutes   int       `json:"minutes"`    // since the last sync; 0 when none is recorded
	LastSync  time.Time `json:"last_sync,omitzero"`
	LastSha   string    `json:"last_sha,omitempty"`
}

DevDrift is the drift between the base and the development branch: the commits each side lacks, and the minutes since the last sync.

func DevDriftOf

func DevDriftOf(s *Snapshot) DevDrift

DevDriftOf is the drift the merge table records, the minutes counted to the snapshot's clock: what `where --json` and the dashboard show.

type DevLag

type DevLag struct {
	Count  int
	Branch string
	At     time.Time
	Sha    string
}

DevLag is dev behind: the cards landed since the last promotion, the branch they landed on (the base the most of them name, "the sprint branch" when none does), and the last promotion (zero and "" when none is recorded).

func DevBehind

func DevBehind(s *Snapshot) (DevLag, bool)

DevBehind is whether dev is behind, and the facts: PromoteCards or more cards landed since the last promotion, or the oldest of them landed PromoteAge or longer ago.

func (DevLag) Decisions

func (d DevLag) Decisions() []string

Decisions are the judgment's: the promotion recorded, or wait 30m.

func (DevLag) What

func (d DevLag) What() string

What is the judgment's line: the count, the branch, the last promotion, and the promotion to run.

type DocCut

type DocCut struct {
	At    int
	Lines []string
}

DocCut is one run of lines a change takes out of a document: At is the line of the file after it that now stands where they stood (the line after the cut, one past the last line at the end of the file), Lines is their text.

type DocFix

type DocFix struct {
	File string
	Line int
	What string
}

DocFix is one fault of a document: its file, the line (1-based, in the file as repaired), and what was done or, for a refusal, why there is no one repair.

func RepairDoc

func RepairDoc(file, text string, changed DocLines, prose bool) (fixed string, fixes, refused []DocFix)

RepairDoc repairs the faults of text, a document's content after a merge, that are the change's: the formatter's on the lines it writes (changed.Added, 1-based), a code span's in a paragraph it writes a backquote on or takes an odd count of backquotes from (changed.Deleted). prose skips the backquote check. fixed is text repaired; fixes is each repair made; refused is each fault with no one repair, which the lander refuses with its line. A file that is not a document is returned as it is.

func RepairMerge

func RepairMerge(dir string, git func(args ...string) (string, error), before string, prose []string) (note string, refused []DocFix, err error)

RepairMerge repairs the documents a merge commit at HEAD of the clone dir changes against before (the batch branch's tip before the merge), the lander's fix on the way in as the ledgers' regeneration is: each Markdown or text file the merge writes or deletes from is read from the tree, repaired on the merge's own lines (RepairDoc, its backquotes unread under a prose glob), written back, and the merge commit amended with the repair in its body, its parents and subject kept. note is the landing note (RepairNote), "" when nothing was repaired; refused is each fault with no one repair, and each case of an edited model without a current run record (recordsRefusals, land_records.go), and then nothing is written. A symlink is not written through. git runs git in dir and returns its trimmed stdout.

func (DocFix) String

func (f DocFix) String() string

type DocLines

type DocLines struct {
	Added   []int
	Deleted []DocCut
}

DocLines is what a change does to one document: the lines it writes (1-based, in the file after it) and each run of lines it takes out.

type Drift

type Drift struct {
	Member string
	Kind   string
	// From and To are a width change's widths; To is the width of an add.
	From, To int
}

Drift is one difference between the fleet table and the inventory: what a sync would write.

func FleetDrift

func FleetDrift(s *Snapshot, want []SyncMember, machines []string) []Drift

FleetDrift is what a sync of want would write on the snapshot: the members to add, the widths to set, the members to hold and the members to remove, by name; machines is every machine row of the inventory, a member or not. It is empty exactly when the plan of a sync is empty, so a check and a sync agree, and a sync after a sync has nothing to write. A member with no machine row that holds ready or working cards is a hold: the sync deals them away and removes it in the same step when none stays (downPlan, Remove).

func (Drift) Line

func (d Drift) Line() string

Line is the drift as a sentence.

type DriftAhead

type DriftAhead struct {
	Commits int
	Oldest  time.Time
	Tip     string
}

DriftAhead is the base against dev: the commits on the base and not on dev, the oldest of them by committer time (zero when none), and the base's tip.

type DriftFacts

type DriftFacts struct {
	Repo   string       // the repository, owner/name; a card naming another REPO: is not judged
	Base   string       // the sprint base, the branch every stream lands on
	Dev    string       // the development branch, DevBranch when ""
	Ahead  *DriftAhead  // the base against dev
	Server *DriftServer // the live server's build commit against the base
	Gate   *DriftGate   // the last gate run at the base, with its scope
}

DriftFacts is what the binding read of the repository for a tick (ReadDrift; the gate's record beside it). Base empty, or a fact nil, is no fact this tick: the judgments it would judge are neither raised nor closed.

type DriftGate

type DriftGate struct {
	Tip        string
	Whole      bool
	Functional bool
	Red        bool
	Failed     []string
}

DriftGate is one gate run at a tip of the base: its scope (the whole tree, and the functional class tests included), whether it was red, and what failed. Only a run of the whole tree with the functional class judges the base: the lander's narrow gate alone never does, green or red.

type DriftServer

type DriftServer struct {
	Commit string
	On     bool
	Why    string
}

DriftServer is the live server's build commit and whether it is an ancestor of the base's tip; Why says why not, when it is not.

type DropReq

type DropReq struct {
	Sel
	Reason  string
	Answers []string
	// Cascade drops, with the cards the selection names, every waiting
	// primary that needs one of them, and their dependants too. Without it a
	// card a waiting primary still needs is refused, naming the dependants
	// (docs/SPEC-SPRINT.md section 11).
	Cascade bool
	Who     string
}

DropReq is the coordinator taking primaries off the table.

type Finding

type Finding struct {
	Subject   string   `json:"subject"`
	Stream    string   `json:"stream,omitempty"`
	What      string   `json:"what"`
	Why       string   `json:"why"`
	Decisions []string `json:"decisions,omitempty"`
	Root      string   `json:"root,omitempty"`
}

Finding is one stall: its subject (a primary, or a stream's subject, or the sprint's for a pending operation), what it is and why nothing holds it, and the decisions open to the coordinator. Root, when set, is the stall it waits behind: the tick writes one judgment per root.

func Unheld

func Unheld(h HeldState, now time.Time) []Finding

Unheld is every stall, in a fixed order: the primaries (by id), then the judgments past due, the stopped streams, and the pending operation. While an operation is pending the tables are a partial state of it, and only the operation is judged: it is a stall past its grace when a tick since has not finished it.

func (Finding) String

func (f Finding) String() string

type FinishReq

type FinishReq struct {
	Sel
	As     string
	Gens   map[string]int // the generation held, per named card
	Failed bool
	Head   string
	Report string
	// Branch and Base are the branch the work is on and the one it started
	// from, as the worker reports them.
	Branch, Base string
	// Usage is what the run spent, as the member read it from its child (its
	// budget word and wall, the tokens by class, the harness's cost: cardcost.Usage):
	// kept on the work card, the attempt's record, timed and priced (cost.go).
	Usage string
	// Decided is the take's attempt decision, as its member asked it (decide.Decided:
	// `<class> p=<p> op=<op>`; decide.go): its op names the take's card and attempt, else the
	// finish is refused (decidedFor); kept on the work card and the primary, and a failed
	// finish whose class is no-result or nothing-to-do at or above that class's bar on the
	// card is routed by it (finishKind). A finish carrying one names one card.
	Decided string
	// Reported is when the worker wrote its report, when the transport knows it (a
	// friend's REPORT.md, friend sync): kept on the work card as FieldReported, no later
	// than the finish, so the stats time a friend's run from her take to her report and
	// her report lag from it to the finish (RunWall). Zero is unknown.
	Reported time.Time `json:",omitzero"`
	Who      string
	Friends  []FriendSeat
}

FinishReq is a worker finishing work cards, ok or failed. A finish always names, in Gens, the generation the worker holds for every card: one naming none is refused, and one whose generation is not the live one is refused as stale and changes nothing.

type FixSpec

type FixSpec struct {
	Repo, Base, Module, Stream, Where string
}

FixSpec is what every fix card of one red run shares: the repository, the branch the fix starts from (the sprint branch), the module the log's package paths are under, the stream, and where the run was red.

type FleetReq

type FleetReq struct {
	Op     string // up, down, level, hold, release, sync, quiet
	Member string
	Who    string
	// Fresh says the member is alive (Beat.Alive: fewer than MissedBeatsDown
	// beat windows missed): release brings it up at once.
	Fresh bool
	// Live, when set, is the other members up for this move: down deals to
	// them and up levels with them. nil is every member whose status is up.
	Live []string
	// Why is said in the happened notification of a change of status.
	Why string
	// Width, above zero, is the member's width set by up or release (the
	// machine's child cap, width.go); zero leaves the width as it is, unless
	// Drain says the member drains: its width is set to DrainWidth (0).
	Width int  `json:",omitempty"`
	Drain bool `json:",omitempty"`
	// Deadline, above zero, is the member's pinned deadline in seconds set by up or
	// release (deadline.go); DeadlineOff takes the pin off; neither leaves it as it is.
	Deadline    int  `json:",omitempty"`
	DeadlineOff bool `json:",omitempty"`
	// Sync, with Op sync, is every machine the inventory says is a member
	// and its width (fleet_sync.go); Member is empty.
	Sync []SyncMember `json:",omitempty"`
	// HeldBy, with hold, marks the hold as made by that mechanism (the sync's,
	// fleet_sync.go) and not the coordinator's: the control card's held_by.
	HeldBy string `json:",omitempty"`
	// Machines, with Op sync, is every machine row of the inventory, a member
	// or not (width 0): a fleet row it does not name has no machine row and
	// leaves the fleet once no card stays on it (fleet_sync.go).
	Machines []string `json:",omitempty"`
	// Remove, with hold, takes the member's control card off the fleet when no
	// card stays on it after the hold's redeal (memberKeeps): the sync's
	// removal of a member with no machine row.
	Remove bool `json:",omitempty"`
	// Reason, with hold, is the coordinator's reason, kept on the control card
	// (FieldHeldReason) beside its held status (hold.go).
	Reason string `json:",omitempty"`
	// Finish, with hold (and on a down move), lets the member's working cards finish:
	// only its ready cards, never begun, are dealt round the fleet, and the hold
	// is marked so (FieldHeldFinish) for the sweep to leave them (hold.go).
	Finish bool `json:",omitempty"`
	// Until, with quiet, is when the member's quiet ends, and End ends it now (fleet
	// quiet, fleet_quiet.go); Reason is its reason.
	Until time.Time `json:",omitzero"`
	End   bool      `json:",omitempty"`
	// contains filtered or unexported fields
}

FleetReq is a fleet move: a member up or down, or the ready queues levelled (the tick's moves, as a member's derived status changes), or the coordinator's hold on a member (hold) and its release (release), or the whole fleet made to match the inventory (sync).

type FriendAccount

type FriendAccount struct {
	Tasks   map[string]string
	Written time.Time
}

FriendAccount is a friend's own account of her cards: her QUEUE.json's tasks, each state by id (ReadFriendQueue), and when the file was last written.

type FriendCollectedReq

type FriendCollectedReq struct {
	Friend, Card, Primary, Stream, Who, Why string
}

FriendCollectedReq is one card the run loop's reconcile collected from a friend's outbox.

type FriendDisagreeReq

type FriendDisagreeReq struct {
	Friend, Who string
	Row, Queue  int
}

FriendDisagreeReq is a friend's row and her account after the run loop's pass: the cards working on her row, and the tasks her QUEUE.json says working.

type FriendGiveReq

type FriendGiveReq struct {
	Friend string
	IDs    []string
	Reason string
	Who    string
}

FriendGiveReq is friend give: the friend, the cards named (each a primary or its work card), and why.

type FriendHealth

type FriendHealth struct {
	State      string    `json:"state"`
	Seen       time.Time `json:"seen"`
	Generation uint64    `json:"generation"`
	Queue      int       `json:"queue,omitempty"`
	Working    int       `json:"working,omitempty"`
	Width      int       `json:"width,omitempty"`
	// Reason and Until are the daemon's word on a friend not up (her model
	// allowance ran out) and when it expects her back; shown on her row.
	Reason string    `json:"reason,omitempty"`
	Until  time.Time `json:"until,omitzero"`
}

FriendHealth is the coordinator's last accepted observation of a friend, as the friend-health record keeps it: the state word, the time of the proof it rests on (a session pong for up, a daemon pong for DaemonPong, the judgment for down; the daemon's clock), the seat generation it was observed under, and what the pong said of her queue, working and width.

func (FriendHealth) Observed

func (h FriendHealth) Observed() bool

Observed says the coordinator has observed the friend at least once.

type FriendHealthWrite

type FriendHealthWrite struct {
	Friend string       `json:"friend"`
	Health FriendHealth `json:"health"`
}

FriendHealthWrite is the record a step's commit writes: the friend's health.

type FriendLevelReq

type FriendLevelReq struct {
	Seats   []FriendSeat
	Started map[string]string
	Who     string
	Max     int
	// Taken is the tick's friend deal's units (friendDealPass): a ready card it moved into
	// working on her start this tick does not move.
	Taken []Unit `json:"-"`
	// Moved is the cards the tick moved already (friendUnstartedLevel): none moves twice.
	Moved map[string]bool `json:"-"`
}

FriendLevelReq is friend level: the friends as the deal sees them (FriendSeat, only those up level), the cards they have started as the caller read them (a push on the branch, a beat naming it running: those stay, as does every card friendStarted says started), who asks, and Max, the most cards moved (0: no bound; the tick's is FriendLevelPerTick).

type FriendM

type FriendM struct {
	Name   string        `json:"name"`
	Status string        `json:"status"`
	Beaten bool          `json:"beaten"`
	Age    time.Duration `json:"age_ns"`
}

FriendM is one friend: her status as the friends table shows it and her last beat's age.

type FriendPresence

type FriendPresence struct {
	Held       bool
	Beat       Beat
	Health     FriendHealth
	Generation uint64
	Finished   time.Time
}

FriendPresence is everything the friends' rule reads of one friend: the coordinator's hold, her own beat (shown, never evidence), the coordinator's observation of her, the seat's generation now, and when a card of hers last finished (working to done), zero for never.

type FriendReport

type FriendReport struct {
	Running []string `json:"running,omitempty"`
	Working *int     `json:"working,omitempty"`
	Queue   *int     `json:"queue,omitempty"`
	Width   *int     `json:"width,omitempty"`
	// StopReturns is how many stop-returns her lanes still owe after the machine's stop
	// (friend beat --stop-returns; docs/SPEC-SPRINT.md section 14, stop cancels jobs):
	// start waits for zero. Absent when not reported.
	StopReturns *int `json:"stop_returns,omitempty"`
	// Active is the newest write under her working directory and outbox as her daemon
	// last walked them (friend beat --active), zero when it reported none: the signal that
	// her session moves, which a daemon pong does not say (docs/SPEC-FRIEND.md, last
	// session activity).
	Active time.Time `json:"active,omitzero"`
	// Paced and Window are her lanes' effective width under her subscription windows' pacing
	// and those windows' use as her harness last reported it ("5h 62% 7d 31%"), as her daemon
	// last read them (docs/SPEC-FRIEND.md, subscription pacing); absent when it reported none.
	Paced  *int   `json:"paced,omitempty"`
	Window string `json:"window,omitempty"`
	// Until and Reason are her daemon's word that she is down until then and why (friend
	// beat --until --reason: her harness at its usage limit or out of credits,
	// docs/SPEC-FRIEND.md, limits-mean-down-w-r5.w1~15); zero and empty while she is up.
	Until  time.Time `json:"until,omitzero"`
	Reason string    `json:"reason,omitempty"`
	// Build, Started and Present are her daemon's own facts (friend beat --build --started
	// --present): the build it runs (its version line's build), when it started, which is its
	// generation, and when it sent her the present on its start (the note that snaps her to
	// now and skips what is old); each absent when it reported none. A start the status
	// transitions have not seen is a new generation of her daemon (StatusTransitions).
	Build   string    `json:"build,omitempty"`
	Started time.Time `json:"started,omitzero"`
	Present time.Time `json:"present,omitzero"`
}

FriendReport is what a friend's machinery reports with her beat, as a machine's beat reports its load (the beat's Load, given): the cards she is running (work card ids or her job names), which friend take and friend down leave with her (FriendTake), and her own counts as her daemon keeps them (working, queued, her width), each absent when not reported. They are her word, shown beside the table's counts, which stay the sprint's own (her row's cards) and her width the roster's; her last activity is the file system's.

type FriendReturnCard

type FriendReturnCard struct {
	ID  string
	Gen int
	Why string
}

FriendReturnCard is one card reconcile returns: the work card, the generation it read and why.

type FriendReturnReq

type FriendReturnReq struct {
	Friend string
	Who    string // who acts: the coordinator
	Cards  []FriendReturnCard
	// Push addresses each card's note to the coordinator, so inbox --push carries it: the
	// run loop's pass, which nobody watches as it acts (friend_reconcile_tick.go).
	Push bool
}

FriendReturnReq returns a friend's abandoned cards to ready.

type FriendSeat

type FriendSeat struct {
	Name   string
	Width  int
	Status string
	Class  string
	Mode   string
	Tiers  []string
	// Roles is her nova-config row's roles: a read card is dealt only to a friend whose
	// roles name reader (RoleReader, read_cards.go).
	Roles []string
	Dir   string
	// Streams and Kinds are her work restriction (her nova-config row's streams and
	// kinds, carried by friend sync): the stream globs and card KIND values the deal
	// may hand her; empty is no restriction (docs/SPEC-SPRINT.md section 1, a friend's
	// card).
	Streams []string
	Kinds   []string
	Running []string
	// Why is why her Status is not up, as FriendDownWhy says it (held, or the session
	// evidence she lacks), "" while she is up: the words a take refused for her names.
	Why string
	// Active is the newest write under her working directory as her daemon's last beat
	// found it (FriendReport.Active), zero when it said none: a friend who wrote within the
	// start bound is at work, and the tick moves none of her cards for want of a start
	// (friendUnstartedLevel).
	Active time.Time
	// Proof is her session's last proof as her beat carries it (Beat.Proof: a SESSION CHECK
	// it answered, or a bus message of its own), and Finished the store's record of her
	// last finish, working to done; each zero when there is none. The stall ladder reads
	// them as evidence of her work (FriendWorked).
	Proof    time.Time
	Finished time.Time
	// Answered is when her session last answered the coordinator's wake ping (her
	// FriendHealth observation, up), zero when it has not.
	Answered time.Time
	// ReadsFirst is the room her reads take before any work card in this deal (reads are a
	// card priority, reads_priority.go friendReadsFirst): set by the tick's deal on the
	// seats it deals work to, never read from her row; zero leaves her room as it is.
	ReadsFirst int
	// Beat, Evidence, DaemonOnly and Current are what the status transitions read
	// (StatusTransitions, judgments_status.go): her last beat (zero when she never beat),
	// what her status rests on (FriendEvidence), whether she is down while the coordinator's
	// last observation is her daemon's pong alone (DaemonPong: her daemon answers, her
	// session does not), and the build the server runs, which her daemon's
	// (Beat.Friend.Build) is compared with.
	Beat       Beat
	Evidence   string
	DaemonOnly bool
	Current    string
}

FriendSeat is one friend as the tick deals to her: her name, her width (the jobs she works at once, her friends row's), her status (FriendStatus: up, held or down), her class (the tiers her nova-config row says she can do, sorted and comma joined), her delivery mode (Mode: batch or one-shot, default batch), her tiers (config.friends tiers: flash, frontier, pro; when given, the deal and the level read them before her class: friendTiers), Dir, her working directory when the ask writes the read brief itself (empty: friend sync writes it), and Running, the cards her last beat names running (FriendReport.Running: work card ids, job names or primaries), which the tick's level never moves (friendStarted).

type FriendSession

type FriendSession struct {
	Pong time.Time
	Held bool
}

FriendSession is what the tick knows of a friend's session beside the tables: her session's last pong as her last beat carries it (zero: her beat carries none), and whether the coordinator holds her (friend down).

type FriendStartReq

type FriendStartReq struct {
	Friend string
	IDs    []string
	Gens   map[string]int
	Why    map[string]string
}

FriendStartReq is friend sync's start receipt: the friend, the cards on her row she has begun (by id, each at the generation sync read: Gens), and why sync reads each as begun.

type FriendSyncState

type FriendSyncState struct {
	Since  time.Time `json:"since"`
	Failed int       `json:"failed"`
	Exit   int       `json:"exit"`
	Said   string    `json:"said"`
}

FriendSyncState is the loop's standing failure as the property holds it.

type FriendSyncStateReq

type FriendSyncStateReq struct {
	Failing bool
	Since   time.Time
	Failed  int
	Exit    int
	Said    string
	Who     string
}

FriendSyncStateReq is the loop's record of its state: Failing with the failure's facts, or not failing (the first ok pass after a recorded failure).

type FriendSyncUnit

type FriendSyncUnit struct {
	OS, Exe, Redis, PG, Root, Log string
	Every                         time.Duration
	Env                           [][2]string
}

FriendSyncUnit is the friend sync loop as a service: the binary, the period, the sprint's store (Redis, an address: friend sync is never the server's), the config store (PG, a DSN with no password), the friends' root (Root, else the unit's HOME), the file its lines go to (launchd; systemd keeps them in its journal), and Env, FriendSyncEnv's variables as they were set where it was typed, in that order.

func (FriendSyncUnit) Args

func (u FriendSyncUnit) Args() []string

Args is the loop's command line, the binary first: friend sync --every <d> on the store and the config the unit names, and no --actor: each pass acts as the seat.

func (FriendSyncUnit) Text

func (u FriendSyncUnit) Text() (string, error)

Text is the unit's file: a launchd plist, or a systemd user unit.

type FriendTakeReq

type FriendTakeReq struct {
	Friend       string
	IDs          []string
	All          bool
	Hold         bool
	Begun        bool
	AllOrNothing bool
	Reason       string
	Started      map[string]string
	Who          string
	// Spends is a take the seat or her runner asked for (friend take): a read card it takes
	// spends its reader (retired_by returned, readSpent), as read --return does; the
	// machine's take-backs (a hold, a stall) spend nothing.
	Spends bool
}

FriendTakeReq is friend take (IDs or All) or the hold's withdrawal (Hold, All): the friend, the cards named (each a primary or its work card), every card of hers she has not started (All), why, and Started, the work cards she has started as the caller read them (a push on the card's branch, her beat naming it running), each with its why. AllOrNothing takes none of the cards named when any one is refused. Begun, with Hold and All, takes only the cards she has begun (working, or read as started), leaving her ready cards not begun on her row; a friend's hold no longer asks for it, since a held friend keeps no card at all (the owner, 2026-10-09).

type FriendWork

type FriendWork struct {
	// Active is the newest write under her working directory and outbox as her daemon's
	// last walk found it (FriendReport.Active). The walk is bounded in files and time, so
	// it can answer with an old file while her outbox holds new ones: never the only field.
	Active time.Time
	// Running is her beat's time while it names cards running (friend beat --running).
	Running time.Time
	// Proof is her session's last proof: a SESSION CHECK it answered, or a bus message of
	// its own (Beat.Proof, FriendSession.Pong).
	Proof time.Time
	// Finished is when a card of hers last finished, working to done (the store's
	// friend-finish record, FriendSeat.Finished), whatever row the card is on now.
	Finished time.Time
	// Answered is when her session last answered the coordinator's wake ping (her
	// FriendHealth observation, up), FriendSeat.Answered.
	Answered time.Time
}

FriendWork is the evidence of a friend's work the tables do not hold: what her daemon's beat carries and the store's record of her last finish. Each is zero when there is none.

type FundedReq

type FundedReq struct {
	Provider string
	Reason   string
	Who      string
}

FundedReq is the coordinator's word that a provider was paid (funded): every rest of its funds ends now, for a provider whose balance no poll can read (opencode) as for any.

type GCClass

type GCClass struct {
	Name                  string
	Count                 int
	Bytes                 int64
	Kept, Refused, Failed int
}

GCClass is what a pass did in one class: directories (or, for the cache, entries) removed and their bytes, kept for a reason, refused, failed.

type GCMachine

type GCMachine struct {
	Name   string
	Last   time.Time
	Volume int
}

GCMachine is what the loop knows of one machine: when gc last ran there (zero: never) and its fullest volume's use as last read (-1: not read).

type GCReq

type GCReq struct {
	Home, AIRoot, BenchRoot, LandRoot string
	MaxAge                            time.Duration
	Now                               time.Time
	Dry                               bool
	Dirty                             func(dir string) string
	Worktrees                         func(clone string) []string
	Volume                            func(path string) (int, error)
	Cache                             gocache.Bounds
}

GCReq is one pass. Dirty is why a clone holds work that is nowhere else ("" none); Worktrees lists a land clone's linked worktrees (nil: none); Volume is the use, in percent, of the volume holding a path. Cache bounds the caches' trim (zero: gocache's defaults).

type GCResult

type GCResult struct {
	Classes []GCClass
	Detail  []string
	Freed   int64
	Volume  int
	Failed  int
	Dry     bool
}

GCResult is a pass: each class, the detail lines (a removal, a keep, a refusal, a failure), what it freed, the fullest volume of its roots (-1 not read) and the failures.

func GC

func GC(r GCReq) GCResult

GC runs one pass: the rule is the comment at the top of this file.

func (GCResult) Lines

func (r GCResult) Lines() []string

Lines are the pass's output: the detail, one line per class, then the summary.

type GCRun

type GCRun struct {
	Machine, Why string
}

GCRun is one gc the loop owes: the machine and why.

func GCDue

func GCDue(ms []GCMachine, now time.Time) []GCRun

GCDue is each machine gc is due on at now, in the order given: never run, or its hour is up; or its volume is at the alarm and its last run is GCVolumeRetry old.

type GitRunner

type GitRunner func(ctx context.Context, dir string, args ...string) (string, error)

GitRunner runs git in a clone and returns its output, trimmed. RunGit is the tree's; a test gives its own, or RunGit on a twin repository (the drift reader, ReadDrift, takes one; it is the test's until the binding reads the drift, export_test.go).

type Goal

type Goal struct {
	Name  string `json:"name"`
	Text  string `json:"text"`
	Route string `json:"route"`
	// Last is the last push that arrived, Count how many have.
	Last  time.Time `json:"last"`
	Count int       `json:"count"`
	// Tried is the last delivery that failed; Fail is its error while the
	// route fails, and "" once a delivery arrives.
	Tried time.Time `json:"tried"`
	Fail  string    `json:"fail,omitempty"`
	// Pending says the goal or its route was just set: the next tick pushes
	// it, whatever the last push was.
	Pending bool `json:"pending,omitempty"`
}

Goal is one person's goal and where they stand: the text, the route, the last push and how many there have been, the last attempt and the error of the delivery that is failing now.

func (Goal) Attempt

func (g Goal) Attempt() time.Time

Attempt is the last time a push was tried, whether or not it arrived.

func (Goal) Due

func (g Goal) Due(now, since time.Time, stopped func(from, to time.Time) time.Duration) bool

Due says the person is to be pushed to now: just set; never pushed to; the last attempt was before this run of the machine began (since: the first tick after start pushes to everyone); or RemindEvery of running time has passed since it, time STOPPED not counting.

type Goals

type Goals struct {
	People []Goal            `json:"people,omitempty"`
	Noted  map[string]string `json:"noted,omitempty"`
}

Goals is the sprint's people, by name, and the judgments written for failing routes: person to the words of the judgment.

func (Goals) DueAt

func (g Goals) DueAt(now, since time.Time, stopped func(from, to time.Time) time.Duration) []Goal

DueAt is the people to be pushed to now, in the order the record keeps them: those Due says so, since the machine last started and with the time it was STOPPED not counted.

func (Goals) Failing

func (g Goals) Failing() map[string]string

Failing is the judgments the failing routes call for, person to words.

func (Goals) Find

func (g Goals) Find(name string) int

Find is the person's index, -1 when there is none.

func (Goals) NotesStale

func (g Goals) NotesStale() (want map[string]string, stale bool)

NotesStale says the judgments written for failing routes (Noted) are not the ones the failing routes call for now, and gives the ones they call for.

func (*Goals) Sort

func (g *Goals) Sort()

Sort keeps the people in name order.

type GradeAsk

type GradeAsk struct {
	Card, Brief string
}

GradeAsk is one card the decide lane grades: its id and its brief.

type GradeReq

type GradeReq struct {
	Grades map[string]decide.Decided
	Who    string
}

GradeReq is the decide lane's grades: each card's grade decision as it rides on the card.

type Group

type Group struct {
	ID string `json:"id"`
	// Alias is the group's judgment's alias, j<n> (Note.Alias); "" for a happened
	// group or a stale stream's.
	Alias     string   `json:"alias,omitempty"`
	Kind      string   `json:"kind"`
	Type      string   `json:"type"`
	Stream    string   `json:"stream,omitempty"`
	Count     int      `json:"count"`
	Size      int      `json:"size"` // the members a verb given --group acts on
	Primaries []string `json:"primaries,omitempty"`
	Notes     []string `json:"notes,omitempty"`
	Marked    bool     `json:"marked,omitempty"`
	Overdue   bool     `json:"overdue,omitempty"`
	// Quiet is a judgment group every note of which the coordinator set a review time on
	// (wait) that has not come: listed after every judgment that is not quiet.
	Quiet     bool          `json:"quiet,omitempty"`
	Oldest    time.Time     `json:"oldest"`
	Due       time.Time     `json:"due"`
	Waited    time.Duration `json:"waited_ns"`
	Decisions []string      `json:"decisions,omitempty"`
	What      string        `json:"what,omitempty"`
	Before    int           `json:"before,omitempty"`
	Behind    int           `json:"behind,omitempty"`   // the heaviest of its primaries' weights (weight.go)
	Suspects  []string      `json:"suspects,omitempty"` // a red branch: the suspects named
	// Commands is every decision open to the coordinator as the commands
	// that make it, filled in: the group's id, --expect and --answers.
	Commands []Command `json:"commands,omitempty"`
	// Members is every subject a verb given --group acts on: the open
	// subjects of its judgments (a stopped stream's: the cards it stopped
	// on), or the primaries of its notifications; sorted, unbounded.
	Members []string `json:"-"`
	// Needs is every need the group's blocked and missing-need judgments
	// name, in the order the notes name them, unbounded: what What
	// previews, listed whole by inbox --open.
	Needs []string `json:"-"`
	// To is who the group's notes are addressed to (Note.To): its happened
	// notes, and a timer's judgment, which the tick raises addressed to the
	// actor it wakes (docs/SPEC-SPRINT.md, "Timers"); Hint is what to do
	// next. A group addressed to someone is shown first, and the seat push
	// writes it to that actor's inbox.
	To   string `json:"to,omitempty"`
	Hint string `json:"hint,omitempty"`
}

Group is notifications of one kind, type and stream, as one line. Its ID is stable while the group is open: the id of its oldest notification (for a stalled stream, stale:<stream>), never its position in the list, so a verb given --group <id> acts on this group or is refused, never on another.

func FindGroup

func FindGroup(groups []Group, id string) (Group, bool)

FindGroup is the group of the id, if it is in the inbox.

func Inbox

func Inbox(r InboxReq) []Group

Inbox groups: what happened since the cursor addressed to someone first (the coordinator's "the sprint is done": no judgment waits on it, and it is the first thing the coordinator reads), then open judgments (marked ones, repeats and overdue, first of all, then the longest waiting), then streams that have not moved past their deadline, then what happened and what was decided since the cursor, in time order.

type HealthClearReq

type HealthClearReq struct {
	Friend, Who string
	Known       bool
}

HealthClearReq is the removal of a friend's observation (friend health --clear): who sends it (the seat's holder) and the friend (Known says the roster has her).

type HealthReq

type HealthReq struct {
	Friend, Who string
	Obs         FriendHealth
	Prev        FriendHealth
	Known       bool
}

HealthReq is one observation: who sends it (the seat's holder), the friend, the observation, and the row as it was read before the step (Prev; Known says the roster has her).

func (HealthReq) Replays

func (r HealthReq) Replays() bool

Replays says the observation is the row's again: the same proof under the same seat with the same word. It is answered as recorded and writes nothing, so a proof never earns a second ten seconds.

type HeldState

type HeldState struct {
	Snap    *Snapshot
	Running bool // the machine is RUNNING
	// Stopped is the time the machine was STOPPED between two clock readings:
	// deadlines count running time. nil is none.
	Stopped func(from, to time.Time) time.Duration
	// Pending is the operation the fence holds (nil none), Grace how long it
	// is taken as in flight, and LastTick when the machine last ticked.
	Pending  *PendingOp
	Grace    time.Duration
	LastTick time.Time
}

HeldState is what the no-stall rule reads: the four tables with the open judgments and the tick's acknowledged conditions (Snap), the machine's state, and the operation the fence holds.

type Hold

type Hold struct {
	ID    string `json:"id"`
	By    string `json:"by"`
	Place string `json:"place"`
	Why   string `json:"why"`
	Root  string `json:"root,omitempty"`
}

Hold is what holds one primary: the holder (HeldBy*, "" when nothing does: it is stalled), its place, and why. Root, for a stall, is the stalled card it waits on ("" when it is its own).

func Holder

func Holder(h HeldState, now time.Time, id string) Hold

Holder is what holds the primary id now.

func (Hold) Stalled

func (h Hold) Stalled() bool

Stalled says nothing holds it.

func (Hold) String

func (h Hold) String() string

type HoldReq

type HoldReq struct {
	Names []string
	// Release is unhold: each name's hold is cleared.
	Release bool
	// Return hands back what each name holds begun, now: a member's working cards dealt
	// round the fleet, a reader's reads begun asked of another, a friend's cards and a
	// stream's working cards withdrawn to ready. Without it they finish.
	Return bool
	// Kind, when set, is the one kind the names may name (the old verbs, fleet down,
	// reader away and friend down, alias hold for theirs): a name of another kind, or
	// of none, is refused in the old verb's words.
	Kind   string `json:",omitempty"`
	Reason string
	Who    string
	// Friends is the friend roster's names (nova-config's friend rows): the snapshot
	// holds no table of them.
	Friends []string `json:",omitempty"`
	// Alive, with Release, is the members whose beat is alive now: one comes up at once.
	Alive []string `json:",omitempty"`
	// Started is the work cards the friends held have started, as friend down reads them
	// (a push on the branch at its tip, her beat naming it running), each with its why: the
	// hold takes them too, and a push's head is carried (FriendTake). It is read state, so
	// no part of the step's arguments.
	Started map[string]string `json:"-"`
}

HoldReq is one hold or unhold of names, each a fleet member, a reader, a friend or a stream (docs/SPEC-SPRINT.md section 11).

type HoldTarget

type HoldTarget struct {
	Name string `json:"name"`
	Kind string `json:"kind"`
}

HoldTarget is a name of a hold and what it names.

type HoldView

type HoldView struct {
	Kind   string `json:"kind"`
	Name   string `json:"name"`
	Reason string `json:"reason,omitempty"`
	By     string `json:"by,omitempty"`
	At     string `json:"at,omitempty"`
	// Return says the hold handed back the work begun (--return); else that work
	// finishes.
	Return bool `json:"return,omitempty"`
}

HoldView is one hold in force, for where --json and handover: what is held, why, by whom and since when.

type IdenticalFindings

type IdenticalFindings struct {
	ID       string
	Key      string
	Attempts []int
	Findings []string
	Bound    int
}

IdenticalFindings is a primary stopped by the identical-finding bound: the attempts that came back with the one finding (Attempts, in order, Bound of them) and what each of them found (Findings, one an attempt, as said).

func AtIdenticalFindings

func AtIdenticalFindings(c *Card, reader, finding string, bound int) (IdenticalFindings, bool)

AtIdenticalFindings is whether the primary c, whose readers (reader, the first that found it broken; "" for failed work) found finding at its current attempt, has come back with that finding at bound attempts in a row since its brief last changed. The attempts before are read from the primary: its FieldFindingKeys, and for the attempt its `finding` carries (FieldFindingAttempt) with no key kept, the key of that finding and its reader (FieldFindingReader).

func (IdenticalFindings) String

func (b IdenticalFindings) String() string

String is the bound said in one line: the attempts, the key and every finding, then the verdict. A key of whole text at the default bound is said as the brief's bound has always said it (BriefBound): the first finding, the second the same class.

func (IdenticalFindings) Why

func (b IdenticalFindings) Why() string

Why is the rework's refusal of a card at the bound: the line, and the remedy.

type InboxM

type InboxM struct {
	Open   int           `json:"open"`
	Oldest time.Duration `json:"oldest_ns"`
}

InboxM is the coordinator's inbox: open judgments and oldest wait.

type InboxReq

type InboxReq struct {
	Now      time.Time
	Open     []Open
	Recent   []Note // since the cursor, oldest first
	Streams  []StreamClock
	Deadline time.Duration  // a judgment open longer, in running time, is overdue
	Stale    time.Duration  // a moving stream unchanged longer, in running time, needs a look
	Prefix   string         // the deployment's prefix (empty for none), for the commands that name it
	Epoch    uint64         // the sprint's epoch: the stale groups' ids carry it
	Weights  map[string]int // each open primary's weight (sprint.Weights): the heaviest judgments first
	// Stopped is the time the machine was STOPPED between two clock
	// readings: the deadlines count running time only, as the tick's do. nil
	// is none.
	Stopped func(from, to time.Time) time.Duration
}

InboxReq is what the inbox is computed from, at read time: the open judgments, the notifications since the cursor, the streams' clocks, and the clock reading of the read. Overdue is computed here, so a dead coordinator is visible to anyone who runs inbox.

type LandedPin

type LandedPin struct {
	ID     string
	Head   string
	InBase bool
}

LandedPin is one card of a record by name: its id, the head the caller pushed, and the caller's fact (one git merge-base --is-ancestor against a fetched tip, never run by the tick) that the head is an ancestor of the base branch's tip.

type LandedReq

type LandedReq struct {
	Pins   []LandedPin
	Sha    string
	Reason string
	Who    string
}

LandedReq is the coordinator's record of work found on the branch but not recorded landed (docs/SPEC-SPRINT.md section 7, land-record-unreported-push-bc.w2): a push that happened and was never reported, or work landed outside the deal by a pull request. Pins are the cards at the heads the caller read, InBase the caller's git facts (never a model's): each head is an ancestor of Sha, and Sha is on origin/<base> at its tip.

type LandedSeries

type LandedSeries struct {
	Generated      string         `json:"generated"`
	GeneratedEpoch int64          `json:"generatedEpoch"`
	BucketSeconds  int            `json:"bucketSeconds"`
	Start          int64          `json:"start"`
	Buckets        int            `json:"buckets"`
	Friends        []int          `json:"friends"`
	Fleet          []int          `json:"fleet"`
	Totals         SeriesTotals   `json:"totals"`
	LastHour       SeriesLastHour `json:"lastHour"`
	Workers        map[string]int `json:"workers"`
}

LandedSeries represents cards landed per 10-minute bucket over 24 hours, split between friends and fleet, for the Landings panel.

func LandedSeriesFrom

func LandedSeriesFrom(ctx context.Context, r LogReader, now time.Time) (LandedSeries, error)

LandedSeriesFrom computes the landed series from any log reader at now.

func LandedSeriesOf

func LandedSeriesOf(lines []Line, now time.Time) LandedSeries

LandedSeriesOf computes the landed series from log lines at reference time now.

type Lane

type Lane struct {
	Holders []LaneHold `json:"holders,omitempty"`
	Queue   []LaneWait `json:"queue,omitempty"`
}

Lane is one machine's lanes of one kind: its holders and its queue, oldest first.

type LaneAnswer

type LaneAnswer struct {
	Granted  bool     `json:"granted"`
	Place    int      `json:"place,omitempty"`
	Held     int      `json:"held"`
	Width    int      `json:"width"`
	Gave     bool     `json:"gave,omitempty"` // give: the asker held or waited, and does not now
	Released []string `json:"released,omitempty"`
}

LaneAnswer is a take's or a give's answer: whether the asker holds a lane, its place in the queue (1 is next) when it does not, the holders and the width after, and who the step released by the timeouts.

type LaneCap

type LaneCap struct {
	Cap, Overrun time.Duration
	Tier         string
}

LaneCap is a lane's cap as a failed finish's report names it: the cap, the tier it was the cap of, and the wall past it when the lane ended.

func ParseLaneCap

func ParseLaneCap(report string) (lc LaneCap, ok bool)

ParseLaneCap reads the cap off a failed finish's report (the friend daemon's CappedWords); ok is false when it names none.

type LaneHold

type LaneHold struct {
	Who     string    `json:"who"`
	Since   time.Time `json:"since"`
	Seen    time.Time `json:"seen"`
	Claimed bool      `json:"claimed,omitempty"`
}

LaneHold is one holder of a lane: who, when it was granted, when it last took it, and whether it has claimed the grant (a waiter granted at another's give has not, until it takes again).

type LaneQuiet

type LaneQuiet struct {
	Type    string `json:"type"`
	Subject string `json:"subject"`
	Why     string `json:"why"`
	Friend  string `json:"friend,omitempty"`
	Run     string `json:"run,omitempty"`
}

LaneQuiet is a judgment the tick kept from rising: its type, its subject and why; kept for a live lane, the friend and her run as her row says it (LaneRun.Row).

type LaneRow

type LaneRow struct {
	Kind    string    `json:"kind"`
	Machine string    `json:"machine"`
	Width   int       `json:"width"`
	Held    []string  `json:"held"`
	Waiting []string  `json:"waiting"`
	Since   time.Time `json:"since,omitzero"`
}

LaneRow is one machine's lanes of a kind as a reader sees them (lane list, where --json): the holders and waiters in order, with when the oldest holder was granted.

type LaneRun

type LaneRun struct {
	Friend string
	Card   string
	Ran    time.Duration
	Cap    time.Duration
	Why    string
}

LaneRun is a friend's card her lane is running: who, the card, how long it has run (running time from its first take, else its deal) and its cap, and what says it runs.

func LiveLane

func LiveLane(s *Snapshot, r TickReq, c *Card) (LaneRun, bool)

LiveLane is the friend's run of the work card when her lane is live on it: it is on her row, ready or working, her beat no older than FriendLaneLive names it running, or her seat (her daemon's lanes as the tick read them) does, with the same freshness check when it carries a stored beat, and it has run less than its cap.

func (LaneRun) Row

func (l LaneRun) Row() string

Row is the run as the friend's row says it: "running 32m of 90m".

type LaneWait

type LaneWait struct {
	Who   string    `json:"who"`
	Since time.Time `json:"since"`
	Seen  time.Time `json:"seen"`
}

LaneWait is one waiter: who, when it first asked, and when it last asked.

type Lanes

type Lanes map[string]Lane

Lanes is a kind's lanes by machine: the record the store keeps.

func (Lanes) Expire

func (ls Lanes) Expire(width int, now time.Time) Lanes

Expire is the lanes at now with the timeouts applied and the queues' heads granted, every machine at once: what a reader of the lanes sees.

func (Lanes) Give

func (ls Lanes) Give(machine, who string, width int, now time.Time) (Lanes, LaneAnswer)

Give is who's give of its lane, or of its place in the queue, on machine at now: the lanes after, with the queue's head granted into the room it made. Only who's own hold and own place go, found by its exact name: another holder's lane and another waiter's place are never given back by it (the parallel lander's forks hold under their own names, lander/<stream>, so the first fork to finish frees no sibling's bench).

func (Lanes) Rows

func (ls Lanes) Rows(kind string, width int, now time.Time) []LaneRow

Rows is the lanes of kind at now (Expire applied), one row a machine, by machine.

func (Lanes) Take

func (ls Lanes) Take(machine, who string, width int, now time.Time) (Lanes, LaneAnswer)

Take is who's take of a lane on machine at now, the width given: the lanes after and the answer (section 18). The timeouts are applied first, then a holder renews, a waiter keeps its place, a newcomer joins the back of the queue; then the queue's head is granted while there is room, so a take is granted only at the head.

type Line

type Line struct {
	Kind  string    `json:"kind"`
	At    time.Time `json:"at"`
	Epoch uint64    `json:"epoch"`
	Op    string    `json:"op,omitempty"` // the step that wrote it: one op, many lines
	// The card a move line is of, its primary and its stream. Cards, when
	// set, is every card of a set move: one line for the set (the same
	// place before and after, the same words), Card the first of them.
	Card    string   `json:"card,omitempty"`
	Cards   []string `json:"cards,omitempty"`
	Primary string   `json:"primary,omitempty"`
	Stream  string   `json:"stream,omitempty"`
	// Table is the logical table; From and To are member:column ("" From:
	// the step created it; Removed: the step took it off the table); Gen is
	// its generation after the step (0 when it has none).
	Table   string `json:"table,omitempty"`
	From    string `json:"from,omitempty"`
	To      string `json:"to,omitempty"`
	Removed bool   `json:"removed,omitempty"`
	Gen     int    `json:"gen,omitempty"`
	// Actor is who acted (the machine, or the named actor); Verb is the
	// step; Cause is why, in the step's own words.
	Actor string `json:"actor,omitempty"`
	Verb  string `json:"verb,omitempty"`
	Cause string `json:"cause,omitempty"`
	// Answers is the judgments the step answered on this card.
	Answers []string `json:"answers,omitempty"`
	// Text is the words given with the change, whole, by field: fix,
	// report, finding, reason, return_reason, did, note, ci_note, brief.
	Text map[string]string `json:"text,omitempty"`
	// Set is the other fields the change set (a stamp, a counter, a head).
	Set map[string]string `json:"set,omitempty"`
	// Note is a notification's line: the notification as written.
	Note *Note `json:"note,omitempty"`
}

Line is one line of the log.

func GroupSets

func GroupSets(lines []Line) []Line

GroupSets is a step's move lines with every set move one line: lines of the same table, place before and after, generation, verb, actor, words given and fields set (a score aside) become one line naming its cards. The log grows by the steps, not by the cards they move.

func NoteLine

func NoteLine(n Note, op string) Line

NoteLine is a notification's line of the log, written with the step that wrote the notification.

func ReleaseStreamLines

func ReleaseStreamLines(lines []Line, glob string) ([]Line, error)

ReleaseStreamLines is the log lines of the streams the glob names (path.Match over the stream's name; "" keeps every line). A card's stream is the first stream any of its lines names, so a line that names none (a fleet move) is kept with its card's.

func SplitCost

func SplitCost(l Line) (Line, []string)

SplitCost takes a change line's cost records out (FieldCostRecord, FieldCostTotal, FieldCostCut): the line without them, and one short line for each record, which the log's timeline prints in their place; `log --card <id>` and `log --json` keep the records whole (docs/SPEC-SPRINT.md section 17). A line with none is returned as it is.

func Timeline

func Timeline(lines []Line, id string) []Line

Timeline is a primary's lines as its story tells them: in the order written, a step's lines with the primary's own first, then its work, read and merge cards', then the notifications; a primary's line that only mirrors its work card's in the same step (dealt, finished, taken back) left to the work card's.

func (Line) About

func (l Line) About(id string) bool

About says the line is about the card: the card itself, or, for a primary, its work, read and merge cards (named <primary>.w<n>, <primary>.r<n>.<reader>, and the primary's own id in merge).

func (Line) Names

func (l Line) Names() []string

Names is the cards a line is about: a move line's card, or a notification's subjects and named cards.

type LoadSample

type LoadSample struct {
	At  time.Time `json:"at"`
	Pct float64   `json:"pct"`
}

LoadSample is one beat's load, a percent of all the machine's cores.

type LogReader

type LogReader interface {
	Log(ctx context.Context) ([]Line, error)
}

LogReader is any store or log source that can return the epoch's log lines.

type MachineAdoption

type MachineAdoption struct {
	State string
	From  string
	To    string
	Err   string
}

MachineAdoption is one machine's adoption of an episode: its state, the version it had installed before, the version read back after, and why it failed.

type MachineVersionM

type MachineVersionM struct {
	Machine string `json:"machine"`
	Version string `json:"version"`
}

MachineVersionM is one machine's installed version of nova-tools.

type Measure

type Measure struct {
	Median float64 `json:"median_s"`
	Max    float64 `json:"max_s"`
	N      int     `json:"n"`
}

Measure is the median, the max and the count of one measure's samples, in seconds; N 0 is no sample.

type MemberM

type MemberM struct {
	Name   string        `json:"name"`
	Status string        `json:"status"`
	Beaten bool          `json:"beaten"`
	Age    time.Duration `json:"age_ns"`
}

MemberM is one fleet member: its status as the fleet table shows it and its last beat's age (Beaten false: never).

type MemberSpec

type MemberSpec struct {
	Name  string
	Width int
}

MemberSpec is a member as init --members names it: <name>[:<width>], a bare name keeping the default (Width 0).

func ParseMembers

func ParseMembers(list string) ([]MemberSpec, error)

ParseMembers is init --members: a comma list of <name>[:<width>].

type MemberStat

type MemberStat struct {
	Member    string  `json:"member"`
	Cards     int     `json:"cards"`
	Failed    int     `json:"failed"`
	TakeWait  Measure `json:"take_wait"`
	RunWall   Measure `json:"run_wall"`
	ReportLag Measure `json:"report_lag"`
}

MemberStat is one member's work cards: how many, how many failed (ok=no), the take wait (dealt to taken), the run wall (the usage's wall) and the report lag (finished - taken - wall: what the member spent around its child).

type MergeQueue

type MergeQueue interface {
	HoldsGroup(ctx context.Context, repo, branch string) (bool, error)
}

MergeQueue is a forge's merge queue of a branch as the lander asks it: whether it holds a group (an entry queued or being checked) now. The lander's is the forge's API; a test gives a fake and asks no forge.

type MergeReq

type MergeReq struct {
	Stream string
	Batch  int
	// Cards, when given, is the batch by name: exactly these cards of the stream's
	// queue, wherever they stand in it, and Batch is not read. A landing reports the
	// cards it pushed, never "the first n": the tick's accepts put cards in the queue
	// by their order of work, often ahead of the ones a landing is building, and a
	// report by place would then record cards that were not pushed (nova-sprint land).
	Cards []string
	// Landed is the record by name and head (docs/SPEC-SPRINT.md section 8, merge --landed): each
	// card the lander pushed with the head it pushed, and the caller's fact that the head is an
	// ancestor of the base branch's tip. The step lands exactly these cards, and refuses all of
	// them, naming each card and why, and writes nothing, unless every one is merging in the
	// stream, at the head given, with that head in the base.
	Landed   []LandedPin `json:",omitempty"`
	Conflict string      // a card of the batch that did not merge
	// ConflictKind and ConflictPaths are what the lander knows of a conflict: "file" when the
	// paths that did not merge are files no generated ledger owns, "ledger" when one is, and
	// the paths; written on the stream's control card with the stop (FieldConflictKind,
	// FieldConflictPaths), which the conflict rule reads (rules.go). "" is not known.
	ConflictKind  string   `json:",omitempty"`
	ConflictPaths []string `json:",omitempty"`
	Cross         string   // "<card>=<other>": a card that needs a card of another stream first
	Red           bool     // the stream branch went red on the batch
	Suspects      []string // with Red: the cards of the batch the caller suspects
	Rejected      bool     // the merge queue rejected the batch
	// BaseRed is the lander's base-gate rule's stop (docs/SPEC-SPRINT.md section 8, answered by
	// rule): the base failed its tree gate at its tip three times, and this is the error. The
	// stream stops with the judgment NBaseRed; no card moves.
	BaseRed string `json:",omitempty"`
	// BaseRefused is a landing refused because the base failed its tree gate at its tip (the
	// lander ran the gate and it was red), this the finding, Base the base's branch: the
	// refusal is counted on the stream's control card per base (FieldBaseGateRefused), across
	// passes and processes, and the BaseGateStops-th stops the stream with the judgment NBaseRed
	// naming the base, the gate and the first refusal. No card moves.
	BaseRefused string `json:",omitempty"`
	Base        string `json:",omitempty"`
	// MissingBase is a land whose base branch is gone: the merge step raises one
	// judgment naming every unlanded card on that base and the rebase line that
	// fixes them (rebase.go). No card moves.
	MissingBase string `json:",omitempty"`
	// DeadBase is the base the batch's cards (Cards) name, which the lander's fetch found
	// not on origin (docs/SPEC-SPRINT.md section 7, a dead base): each card is marked
	// (FieldDeadBase) and one judgment NDeadBase is raised for it; the stream is not
	// stopped and no card moves.
	DeadBase string `json:",omitempty"`
	Note     string
	Who      string
	// Resolved is, by card, what its landing did beyond merging its head (docs/SPEC-SPRINT.md
	// section 7: the generated ledgers regenerated at the merge); written on its merge card
	// as it lands, its note on the card's timeline.
	Resolved map[string]string
}

MergeReq is one mechanical merge step for a stream, given its facts by the caller. The step never decides: what merged, what conflicted and the CI result are facts.

type MergeWindow

type MergeWindow struct {
	Until  time.Time
	Reason string
}

MergeWindow is a window the coordinator opened: landing pauses until Until, for Reason. The zero window is none.

type MergeWindowReq

type MergeWindowReq struct {
	For    string `json:",omitempty"`
	Reason string `json:",omitempty"`
	Who    string
}

MergeWindowReq is merge-window open: how long, why, and who asks.

type MissingBase

type MissingBase struct {
	Base  string
	Cards []MissingBaseCard
}

MissingBaseBase is the branch every card of a missing-base judgment is cut on, and the cards: the rebase line that fixes them names it.

type MissingBaseCard

type MissingBaseCard struct {
	ID     string
	Stream string
}

MissingBaseCard is one card cut on a base that is gone.

func MissingBaseCards

func MissingBaseCards(s *Snapshot, base string) []MissingBaseCard

MissingBaseCards is every unlanded card whose brief's BASE line names base, in id order: the cards a missing-base judgment names.

type MissingBranch

type MissingBranch struct {
	Named string `json:"named"`
	Holds string `json:"holds,omitempty"`
}

MissingBranch is the server's finding on one read's branch at its close: the branch the read named, which origin does not hold, and the branch origin holds the read's head on ("" when it found none).

type Move

type Move struct {
	From, To State
	Verb     string // the verb that makes it
	Class    string // Mechanical or Coordinator
	Cause    string
}

Move is one legal move of a primary.

type MoveReq

type MoveReq struct {
	IDs           []string
	Stream        string
	Score         *float64
	Before, After string
	Who           string
}

MoveReq moves primaries that have not started to another stream, placed as add places cards: Before, After or Score, else at the end of the line.

type Names

type Names struct{ Prefix string }

Names is where one deployment keeps its tables and keys: every name carries the prefix. The nova-sprint command never sets one (its tables are work, merge, readers and fleet, its view sprint); the store tests set one to keep their keys apart.

func (Names) Definitions

func (n Names) Definitions() []ntable.Table

Definitions are the four tables as init creates them.

func (Names) EpochKey

func (n Names) EpochKey() string

EpochKey is the sprint's epoch: one hash whose field n is the epoch every one of the four tables is bound to (the table layer's epoch key). clear advances it; its fields cleared and shape say when, and what to restore.

func (Names) Key

func (n Names) Key(name string) string

Key is a sprint key outside the tables (the inbox, the operation records).

func (Names) KeyAt

func (n Names) KeyAt(name string, epoch uint64) string

KeyAt is a sprint key of one epoch: the key itself at epoch 0, with the epoch after it at a later one. The sprint's own keys (the fence, the notifications, the judgments, the cursor, the operation records) are per epoch, so an epoch's inbox is its own and an earlier one stays readable.

func (Names) Logical

func (n Names) Logical(stored string) string

Logical maps a stored table name back to its logical name.

func (Names) MemberPrefix

func (n Names) MemberPrefix(logical string) string

MemberPrefix is the record namespace of a logical table. Each table has its own: a primary is a member of work and of merge, and the two records are separate.

func (Names) RecordKey

func (n Names) RecordKey(logical, id string) string

RecordKey is the store key of a card's record in a logical table: the table's record namespace (MemberPrefix, which its definition names) and the stored id, as the table layer composes it.

func (Names) Table

func (n Names) Table(logical string) string

Table is the stored name of a logical table.

func (Names) View

func (n Names) View() string

View is the stored name of the view.

func (Names) ViewDef

func (n Names) ViewDef() ntable.View

ViewDef is the view as init sets it: the four tables and the summary line counting landed primaries. Every table shows every row, empty or not.

type Need

type Need struct {
	Kind  string   `json:"kind"`
	ID    string   `json:"id"`              // the judgment's id, the sentinel's or card's id, the stream's name
	Alias string   `json:"alias,omitempty"` // a judgment's alias, j<n>
	Type  string   `json:"type,omitempty"`  // a judgment's type, a stream's cause, a sentinel's or card's stream
	Cards []string `json:"cards"`           // the cards the decision is about
	// Behind is the cards not landed that wait on those cards, through needs and stream
	// order, the cards themselves not counted.
	Behind int           `json:"behind"`
	Age    time.Duration `json:"age_ns"`
	Paths  []string      `json:"paths,omitempty"` // the evidence paths the judgment names: reports, findings
	What   string        `json:"what,omitempty"`
}

Need is one decision waiting on the coordinator.

func NeedsRank

func NeedsRank(s *Snapshot) []Need

NeedsRank is the ranked needs of the coordinator at s.Now.

func (Need) Evidence

func (n Need) Evidence() string

Evidence is the need's one line: its id, its cards and its evidence paths.

type NeedState

type NeedState struct {
	ID       string `json:"id"`
	State    string `json:"state"`
	Waived   bool   `json:"waived,omitempty"`
	WaivedBy string `json:"waived_by,omitempty"` // who waived the primary's needs last, and when
	WaivedAt string `json:"waived_at,omitempty"`
}

NeedState is one need of a primary as it stands: the need's state (its column, or off the table with its outcome), and whether it was waived.

func NeedsOf

func NeedsOf(s *Snapshot, id string) (needs []NeedState, neededBy []string)

NeedsOf is each need of the primary with its state, and the primaries on the table that need it (with the needs read as records into s).

type Note

type Note struct {
	ID string `json:"id"`
	// Alias is a judgment's or an acknowledgement's alias, j<n>, its place among
	// the epoch's in the order written: the store's commit numbers it (inbox.go,
	// Alias); "" on a happened or decided note.
	Alias     string    `json:"alias,omitempty"`
	Kind      string    `json:"kind"`
	Type      string    `json:"type"`
	Stream    string    `json:"stream,omitempty"`
	Primaries []string  `json:"primaries,omitempty"`
	Count     int       `json:"count"`
	What      string    `json:"what,omitempty"`
	Who       string    `json:"who,omitempty"`
	Attempt   int       `json:"attempt,omitempty"`
	Before    int       `json:"before,omitempty"` // how many times before, for this cause
	At        time.Time `json:"at"`
	Decisions []string  `json:"decisions,omitempty"`
	Marked    bool      `json:"marked,omitempty"`   // a repeat: sorts first
	Answers   string    `json:"answers,omitempty"`  // a decided note: the judgment it answers
	Suspects  []string  `json:"suspects,omitempty"` // a red branch: the cards of the batch the caller suspects
	// Card and Other name the cards a judgment is about by what they are,
	// for the commands the inbox prints: the card a stream stopped on (a
	// conflict, a cross stop) or the sentinel reached, and for a cross stop
	// the card it needs, of OtherStream. Primaries is a set: nothing reads a
	// card from its position there.
	Card        string `json:"card,omitempty"`
	Other       string `json:"other,omitempty"`
	Tier        string `json:"tier,omitempty"` // the tier a judgment proposes (NRaiseReadTier)
	OtherStream string `json:"other_stream,omitempty"`
	// StreamLevel says the judgment is about its stream as a whole (a stopped
	// stream): it stays open until the stream resumes.
	StreamLevel bool `json:"stream_level,omitempty"`
	// SprintLevel says the judgment is about the whole sprint (it is done):
	// its one subject is SprintSubject.
	SprintLevel bool `json:"sprint_level,omitempty"`
	// Needs is a blocked judgment's dropped needs: acknowledging it waives
	// these, and only these.
	Needs []string `json:"needs,omitempty"`
	// Review is the next review time the coordinator set with wait; the
	// judgment stays open and shown, and is due then.
	Review time.Time `json:"review,omitempty"`
	// ReviewSet is when wait set Review: the review time counts running time
	// from it, as every deadline does.
	ReviewSet time.Time `json:"review_set,omitempty"`
	// To is who a happened note is addressed to: the coordinator, for "the
	// sprint is done". The inbox shows a note
	// addressed to someone first, above the judgments; empty is no one.
	To string `json:"to,omitempty"`
	// Hint is what to do next, in words, for a note addressed to someone.
	Hint string `json:"hint,omitempty"`
}

Note is one notification.

func MergeNotes

func MergeNotes(notes []Note) []Note

Merge groups notes of one kind, type, stream and cause into one note with the primaries together; the input order is kept for the first of each. Judgment notes merge too: each primary stays an open subject of its own.

func MissingBaseJudgment

func MissingBaseJudgment(base string, cards []MissingBaseCard) Note

MissingBaseJudgment is the one judgment a land whose base branch is missing raises, naming every card on that base and the rebase line that fixes it (docs/SPEC-SPRINT.md, the rebase verb). cards is every unlanded card whose BASE is base, in id order.

func (Note) Bound

func (n Note) Bound() Note

Bound cuts the listed primaries to MaxListed; Count keeps the total.

func (Note) Due

func (n Note) Due(deadline time.Duration) time.Time

Due is when the judgment is overdue: its review time when one is set, else its time plus the deadline. The sprint is done has no due time (zero).

func (Note) Subjects

func (n Note) Subjects() []string

Subjects are the open keys' subjects a judgment note is open on.

type Open

type Open struct {
	Key  string // <note id>|<primary> or <note id>|stream:<stream>
	Note Note
}

Open is one open judgment on one of its subjects (a primary, or a whole stream). A judgment is open while any of its subjects is.

func SplitOpen

func SplitOpen(all []Open) (judgments, acked []Open)

SplitOpen is the open set as judgments and acknowledged conditions.

func (Open) Subject

func (o Open) Subject() string

Subject is the subject half of an open key.

type Overload

type Overload struct {
	Member   string
	Timeouts []Timeout
	Width    int
}

Overload is a member overloaded: its timeouts within the window and its width now.

func Overloaded

func Overloaded(s *Snapshot, member string) (Overload, bool)

Overloaded is whether the member is overloaded (OverloadTimeouts or more timeouts within OverloadWindow), and the facts.

func (Overload) Decisions

func (o Overload) Decisions() []string

Decisions are the judgment's: halve the member's width, or wait the window.

func (Overload) HalfWidth

func (o Overload) HalfWidth() int

HalfWidth is the width the judgment offers: half the member's, at least 1.

func (Overload) What

func (o Overload) What() string

What is the judgment's line: the member, the count, each card with its timeout kind.

type Packet

type Packet struct {
	Card    string `json:"card"`
	Kind    string `json:"kind"` // work or read
	As      string `json:"as"`   // the member or the reader it is handed to
	Primary string `json:"primary"`
	Stream  string `json:"stream"`
	Attempt int    `json:"attempt"`
	Gen     int    `json:"gen,omitempty"`
	Epoch   uint64 `json:"epoch"`
	Brief   string `json:"brief,omitempty"`
	// Rules is the held rules file the primary names (FieldRules, nova-tools#5174 rule 6):
	// the member appends its RULES paragraph to the brief at stage time
	// (swarm.StagedBrief); "" when the brief carries its own.
	Rules string `json:"rules,omitempty"`
	Fix   string `json:"fix,omitempty"`
	// A rework's: the words of the readers that found the attempt before broken, and how
	// that attempt ended (steps_review.go reworkGiven); the member's frame writes both
	// into JOB.md, so the child learns why its attempt exists.
	Finding string   `json:"finding,omitempty"`
	Why     string   `json:"why,omitempty"`
	Notes   []string `json:"notes"`
	Branch  string   `json:"branch,omitempty"`
	Base    string   `json:"base,omitempty"`
	// BaseHead is the commit a later attempt starts from: the last head any earlier attempt
	// finished ok at (pushed by its member), never a branch name that may not have reached
	// origin, and BaseAttempt the attempt it is the head of (BaseOf; docs/SPEC-CARD-CONTRACT.md
	// layer 1); both empty when no earlier attempt pushed: the base is staged.
	BaseHead    string `json:"base_head,omitempty"`
	BaseAttempt int    `json:"base_attempt,omitempty"`
	// A work card's route (route.go): the route drawn ("pin" for a pinned card),
	// the model id the member launches with (provider/model), its token budget
	// (a count or unmetered) and its deadline in seconds; empty when the store
	// has no route, and the member runs its own.
	Route    string `json:"route,omitempty"`
	Model    string `json:"model,omitempty"`
	Tokens   string `json:"tokens,omitempty"`
	USD      string `json:"usd,omitempty"`     // the dollar budget, a decimal; "" for none (#5094)
	Harness  string `json:"harness,omitempty"` // the harness the route names (internal/harness); "" is opencode
	Deadline int    `json:"deadline,omitempty"`
	// Tier is the tier the card's route is drawn from when the sprint decided it
	// and not the brief's line 1: a read's read tier (route.go, readTierOf), a work
	// card's tier from rework --tier; empty otherwise. JOB.md names it.
	Tier string `json:"tier,omitempty"`
	// A decide read's bars on p(defect), the read card's (steps_review.go,
	// decideFields): its reader asks nova-decide's read decision first and routes the
	// read by them (docs/SPEC-SPRINT.md section 6); empty for a strings read.
	DecideBounce string `json:"decide_bounce,omitempty"`
	DecideReview string `json:"decide_review,omitempty"`
	// A work card's gate decision bars, the deal's (steps_review.go, gateFields): its
	// member's native classifies a red gate's failures by them before the take is
	// reported (docs/SPEC-SPRINT.md section 5, the gate verdict); empty for none.
	DecideGateFlaky       string `json:"decide_gate_flaky,omitempty"`
	DecideGatePreexisting string `json:"decide_gate_preexisting,omitempty"`
	// A read's: the work it reads.
	Worker     string `json:"worker,omitempty"`
	Head       string `json:"head,omitempty"`
	WorkBranch string `json:"work_branch,omitempty"`
	WorkBase   string `json:"work_base,omitempty"`
	Report     string `json:"report,omitempty"`
	// ReadJob is the inbox job of a friend's read asked before read cards (a read card with
	// no read_deadline, read_cards.go): its card id at every epoch, the path it was delivered
	// at and is closed from; "" for a read card, whose job is a card's.
	ReadJob string `json:"read_job,omitempty"`
}

Packet is what a worker or a reader is handed with a card, so that no actor needs the coordinator's view to learn what it was asked: the card, its epoch and generation, the brief and this attempt's fix, the notes on it, and the branch to work on and the one to start from. A read's packet carries the work it reads: who did it, its head and branches, and the worker's report.

func PacketOf

func PacketOf(prefix string, epoch uint64, c, primary *Card, earlier []*Card, work *Card) Packet

PacketOf is a work or read card's packet: the primary gives the brief (and a read's fix), a work card its own fix, finding and why; a work card of a later attempt starts from the attempt before's branch (as reported, else as named) and at BaseOf its earlier attempts; a read card reads its attempt's work card (work, when it is known).

type PassStats

type PassStats struct {
	Epoch     uint64       `json:"epoch"`
	Since     time.Time    `json:"since,omitzero"`
	Primaries int          `json:"primaries"`
	Stages    Stages       `json:"stages"`
	Work      []MemberStat `json:"work"`
	Reads     []ReaderStat `json:"reads"`
	Routes    []RouteTakes `json:"routes"`
}

PassStats is the epoch's numbers, members, readers and routes in name order. Since, when set, is the last stats tidy (StatsSince): every sample ended at or after it.

func StatsSince

func StatsSince(s *Snapshot, since time.Time) PassStats

StatsSince is Stats from since on (the last stats tidy; zero is the whole epoch): a stage counts when it ended at or after since, a work card when its last stamp (finished, else taken, else dealt) is, a read card likewise (read, begun, asked), a route's take when its record's end is, and a primary when any of its samples counts.

type PathsProposal

type PathsProposal struct {
	Card    string   // the primary
	Attempt int      // the attempt that proposed
	Globs   []string // the proposal, as the report said it
	New     []string // the globs the card's PATHS do not hold already
	Head    string   // the attempt's pushed head, "" for none: the twin's CARRY:
	Shared  []string // "<glob> (<card>)" for each proposed glob another open card names
	Brief   string   // the twin's brief
	Twin    string   // the twin's id, "" when every one is taken
}

PathsProposal is a held attempt's proposal as the paths rule reads it.

func (PathsProposal) Line

func (p PathsProposal) Line() string

Line is the proposal as the log keeps it.

type Pending

type Pending struct {
	ID, Verb string
	Scores   map[string]float64
}

Pending is the operation the sprint's fence holds, as check judges it: a rank's new scores, by primary, from its own manifest.

type PendingOp

type PendingOp struct {
	ID, Verb string
	At       time.Time
}

PendingOp is the operation the sprint's fence holds, as the no-stall rule reads it.

type Place

type Place struct {
	Row, Col string
	Gen      int
}

Place is a card's place and generation, as the log replays it.

type PlaceAgain

type PlaceAgain struct {
	Table, Row, Col, ID string
	Score               float64
	Said                string
}

PlaceAgain is a record on no cell the step puts back into a cell before its manifests, as the table layer's cell add does: a batch never places a removed member (a stream's control card a stream remove took off comes back when a card is added under its name). It bumps the record's revision. Said is the NOTE line the step prints for it.

type Plan

type Plan struct {
	Rows []RowAdd
	// Places are the records the step puts back on a cell, after its rows and
	// before its manifests (PlaceAgain).
	Places  []PlaceAgain
	Units   []Unit
	Refused []Refusal
	// Notes the step writes with no unit (a fleet member going down with no
	// cards to deal); they are written with the first unit, or alone.
	Notes []Note
	// Closes are open judgments the step answers as a whole (--answers).
	Closes []Open
	// Said is what the step tells the coordinator beside its moves (a NOTE line
	// each): an --answers id the machine answered already.
	Said []string
	// Updates are open judgments the step rewrites in place with the latest
	// facts (a lateness while its attempt lives): same id, new text, each a
	// line of the log.
	Updates []Note
	// Props are the table properties the step writes, each with the guard on
	// the value its plan read.
	Props []PropWrite
	// Requeue is the queued changes a drain leaves for the next one (Drain):
	// its commit puts them back at the queue's tail.
	Requeue []QueuedChange
	// Seat is the seat's change (MoveSeat): the step's commit writes the
	// coordinator and the seat's record with its note.
	Seat *SeatChange
	// Health is a friend's health observed (ObserveFriend): the step's commit
	// writes it as her record.
	Health *FriendHealthWrite
	// HealthClear is the friends whose observation the step's commit removes (friend
	// health --clear, ClearFriendHealth; the stall ladder's release, TickFriendStall), so
	// her status is her session's evidence alone (FriendStatus).
	HealthClear []string
	// Timers is the timer record the step leaves (TimerNotes): the timers it
	// raised are closed in the same commit as their judgment.
	Timers *Timers
	// CloseTimers is the ids of the timers this step closes: its commit
	// deletes only these ids from the timer record, read inside the same commit,
	// so a timer set or cancelled while the step ran is not lost.
	CloseTimers []string
	// Stop is the cause the binding stops the machine with as the step commits: the
	// tick's deal when every provider is out of credit (FundsCause words); "" is none.
	Stop string
	// contains filtered or unexported fields
}

Plan is what a step does: its units, in order, and the cards it refused.

func Accept

func Accept(s *Snapshot, r AcceptReq) Plan

Accept moves review -> merging and places the primary in merge queued with its score. It is refused without ok reads from as many different readers at the primary's head as it needs (ReadsNeededIn: one for a flash card, two for a pro card, or the sprint's count, set --reads, recorded on it), whoever the readers; with Heavy, the coordinator's heavy read counts as one of them, recorded on the primary and never as a reader's (heavyRead; docs/SPEC-SPRINT.md section 6, accept-heavy-verdict-b.w1). The primary's read cards still asked or reading are retired in the same step, marked retired by accept, so no read is outstanding on a primary that is not in review. Named ids are all or nothing under one pre-state; a selection (a stream, the primaries with the ok reads they need, an inbox group) moves the eligible and lists the rest with the reason.

func Ack

func Ack(s *Snapshot, r AckReq) Plan

Ack closes the named judgments, every subject of each, and records the reason as their answer. It answers only a judgment whose own decisions list ack (information to be seen); any other is refused, with its decisions as commands. It is refused for the judgment of a stream that is stopped: that judgment stays open until the stream resumes. It is refused when it would leave a primary held by nobody. A primary in review whose last open judgment it closes, and that nothing then moves (reads exhausted, or stranded in review), is a judgment of its own.

func Add

func Add(s *Snapshot, r AddReq) Plan

Add admits primaries: waiting if they need something not landed, else ready. A need names a primary on the table (placed or kept) or one of this add. A stream's sentinels stop it by position: a card placed after an unlanded sentinel of its stream waits on the latest such sentinel, and a card placed in front of one is a need of it. A sentinel waits for every primary of its stream that sorts before it and has not landed; inserted in front of cards already in line, those waiting wait on it too, those ready go back to waiting, and those in flight are past the stop: it waits for them as well. It is one step: a cycle of needs refuses the whole add.

func AddEach

func AddEach(s *Snapshot, rs []AddReq) Plan

AddEach is one add of several streams, one step: each stream's add on the same pre-state, their plans as one.

func Applied

func Applied(s *Snapshot, p Plan) Plan

Applied is what the store applies of a step's plan: the plan held to the lifecycle (Lawful) and to one judgment per cause (OnePerCause), on the state the step read.

func Ask

func Ask(s *Snapshot, r AskReq) Plan

Ask deals every primary in review that wants a read (ReadsWanted) to as many different readers up as it wants now, in work order. A card's reads are asked together (the interim rule of 2026-10-06, ReadsWanted): the rest it needs (ReadsNeeded: one for a flash card, two for a pro card; readers.go), none once a read found it broken. Each read goes to a reader with room (askPicks): the finder first on a rework's next attempt (finderFirst: the reader whose finding the fix answers, when it is free and has room), and every other read to the reader with the greatest share of room, its free room as a part of its width (readerRooms, round.pickByRoom), that has no read card at the attempt, ties round the readers (round.go: from the rolling index, wrapping, the index moved past it: the readers table's ask_index, written with the ask; the finder's read is out of turn and moves it not at all); a reader at width is given nothing, and a read no reader has room for waits (TickAsk). Reworked work is asked by the same room: a read is a fresh child on a freshly drawn route, so the readers of an earlier attempt are not preferred, the finder's first read aside. A read its reader handed back with no verdict is not a read: it is asked of a reader free at the attempt, or of the same reader again when none is (tla/DirtyTick.tla, JudgedOnlyAfterTheBound). With Another, a primary already asked is dealt to one more reader, the next round the readers.

func AttemptCapDeal

func AttemptCapDeal(s *Snapshot, r TickReq) Plan

AttemptCapDeal is the attempt cap's default answer, the tick's part before the deal (TickCapDeal; the tier ladder settled 2026-10-04: escalation is by attempt cap): every machine's primary ready and past its stream's cap on the brief it carries (AtBriefBound with no finding, asked with AttemptsCap), in a stream not held, is dealt as a friend card (friend_deal.go) to the frontier or heavy-class friend up with room. Room is her free width, width less the cards she already holds, counted across this plan the way friendDealPass counts free: each deal decrements it and the next card is picked again, the most free first and the first by name among equals, so two capped cards cannot both land on one friend whose width is 1. The card keeps its work and findings; its brief gains the WHO line of the friend chosen by the fields the brief edit writes (FieldWho from WhoOfBrief, the brief's text, and FieldBriefAttempt at the attempt it is dealt, so the cap count resets as a replaced brief does); and its next attempt's work card is created on her row in working, closing a brief-defect judgment open on it. A card it does not deal (no such friend up with room) is the deal's as before: at its redeal bound the tick raises the cap's judgment, the findings of every attempt and the spend, decisions brief and drop.

func Balance

func Balance(s *Snapshot, r BalanceReq) Plan

Balance is the poll's step: each read written to its provider's property with the spend over the last hour, and a refused take's rest ended on a payment the poll sees, with a happened note to the coordinator. It writes no rest (see above).

func BaseGreen

func BaseGreen(s *Snapshot, r BaseGreenReq) Plan

BaseGreen records a green base: every stream stopped on the red of r.Base is marked with the commit, for the stop it is in (FieldBaseGatePassedStop), and the tick's base-gate rule resumes it; a stream stopped with no base named (a hand merge --base-red) is marked when it is r.Stream. No card moves; with nothing stopped on the base it is refused.

func Batch

func Batch(pre *Snapshot, steps []func(*Snapshot) Plan) Plan

Batch is one step of the plans steps makes, in order, each planned on the state the plans before it leave (applyPlan): a card re-cut after another sees that one's twin and re-pointed needs, so the twins of a chain need each other and a dependant of several follows every one. Their changes are folded into one entry per card (foldUnits), guarded on what the step read; the plan is all or none: a refusal of any plan refuses the whole. pre is the state the step read, against which the lifecycle judges the whole (Lawful).

func Brief

func Brief(s *Snapshot, r BriefReq) Plan

Brief replaces primaries' briefs in place (nova-sprint brief; docs/SPEC-SPRINT.md, the brief verb): each a primary waiting, ready or in review, on a RUNNING machine as on a STOPPED one; a card working, merging or landed keeps its brief. A running machine's pump holds a card a queued change names until the change drains (store.Step's Pump), so the brief is in place before the card can be dealt. The card keeps its id, stream, score and needs; one an attempt was dealt for opens its next attempt (briefInPlace): a brief correction is never a twin (the owner, 2026-10-06: "We gotta stop doing this twin shit. it's waste."). The command line holds the brief to the card lint, and the store to its bound, as add's. A card refused, or named twice, is named; the step applies all or none.

func BriefSel

func BriefSel(s *Snapshot, r BriefSelReq) Plan

BriefSel is brief by selector (docs/SPEC-SPRINT.md, "One selector, one step"): each selected card's brief replaced by its own with the transform made (Brief), and re-tiered (Brief with Tier), all or none in one step. A card the transform leaves as it was is passed over with a NOTE when a tier is named, and refused when none is.

func CardBase

func CardBase(s *Snapshot, r CardBaseReq) Plan

CardBase re-points a merging card's BASE: its brief's BASE: line names the new branch, its dead-base mark is cleared and its dead-base judgment answered, and one log line names the base before and after. The work, its head, its attempt and its reads are kept, and the card stays where it is in the merge queue: the next land pass tries it once against the new base. A branch not on origin is refused, nothing changed (docs/SPEC-SPRINT.md section 7, a dead base).

func ClearFriendHealth

func ClearFriendHealth(s *Snapshot, r HealthClearReq) Plan

ClearFriendHealth is the observation removed: the plan's HealthClear, which the step's commit applies by removing her record, so her status is her session's evidence alone (FriendStatus), or its refusal: the sender is the seat's holder, of a friend on the table. A friend with no observation is cleared all the same (nothing to remove).

func ClearObsoletePushedUnreported

func ClearObsoletePushedUnreported(s *Snapshot, stream string) Plan

ClearObsoletePushedUnreported removes receipts whose card revision changed.

func CostReconcile

func CostReconcile(s *Snapshot, r CostReconcileReq) Plan

CostReconcile is the reconciliation's step: each read written to its provider's record beside the sprint's records of the same day, and the provider's one judgment opened past the bound or closed within it (see above).

func Deal

func Deal(s *Snapshot, r DealReq) Plan

Deal moves ready -> working: for each primary, in work order, its work card is dealt to the next member round the fleet (round.go): the first from the rolling index, wrapping, that is up and holds fewer work cards, ready and working, than its width (width.go; tla/DirtyTick.tla, Room and WidthRespected); a card no up member has room for is refused, never dealt past a width; the index (the fleet table's deal_index, a counter) moves past the member dealt to, written with the deal. Every card of the selection is dealt in the one plan, one card at a time round the fleet. A card withdrawn because no member was up is the same card dealt again at a new generation, its attempt unchanged; otherwise the next attempt's card is cut.

func Drain

func Drain(s *Snapshot, q []QueuedChange, who string) Plan

Drain is the pump's first update: the whole queue applied to the work table in one plan. The changes of one card are one entry, composed in the order they were queued (a later field wins, a later move takes the card on from where the one before left it); a property takes its last value. Each queued change was planned on the work table with the changes queued before it (the store plans every step but the pump's on WithQueue), so each expects the card where the changes before it leave it; one that does not is refused, named, and consumed with the rest: nothing of the queue is applied twice or kept for a later pump.

func Drop

func Drop(s *Snapshot, r DropReq) Plan

Drop takes open primaries off the table with the reason: their record, outcome and reason are kept; their live work card, unread read cards and merge place go with them. A waiting primary that needs one is a dependant: without Cascade the drop is refused for that card, naming the dependants; with it the dependants and their dependants go too (docs/SPEC-SPRINT.md section 11).

func Finish

func Finish(s *Snapshot, r FinishReq) Plan

Finish moves work cards working -> done and their primaries working -> review. Fixed work that comes back ok is asked by the machine's ask, as any work is. A finish always names the generation it holds for every card it finishes: a card without one is refused, naming the live generation, and a finish by selection without --as is refused outright. As may name several members, comma separated: every card named is on one of them, each finished as its own member's, in the one plan.

func FleetStep

func FleetStep(s *Snapshot, r FleetReq) Plan

Fleet brings a member up (and levels the ready queues), takes one down (dealing its unfinished work cards to up members, or withdrawing them when none is up), or levels the ready queues. hold marks a member held and takes it down; release clears the hold, adding a member it does not know, and brings it up when its beat is fresh.

func ForTables

func ForTables(s *Snapshot, p Plan) Plan

ForTables is a tick part's plan with no judgment and no acknowledged condition raised or rewritten for a stream the tables lack (StreamGone) and the plan does not add a row for: its next step could only be refused.

func FriendCollected

func FriendCollected(s *Snapshot, r FriendCollectedReq) Plan

FriendCollected is the one note a collect by the run loop's reconcile pushes the coordinator, naming the card and why: the finish itself is friend sync's, its own notes its own.

func FriendDisagree

func FriendDisagree(s *Snapshot, r FriendDisagreeReq) Plan

FriendDisagree is a friend's disagreement episode: when her row's working count is not her QUEUE.json's and no note was pushed, one note to the coordinator and the episode marked said (PropFriendDisagree); when they agree again and one was, the mark is taken off and one note says so. Anything else plans nothing, so a lasting disagreement is one note, never one a tick.

func FriendGive

func FriendGive(s *Snapshot, r FriendGiveReq) Plan

FriendGive is the coordinator's undo of a take-back (friend take): on each card named, ready or waiting, its current attempt's work card loses the mark of the friend it was taken from (FieldTakenFrom), so the deal may deal it to her again; a pinned card taken from its friend waits for no one else and is dealt to her. A card not ready or waiting, or never taken back from her, is refused, one refusal each, and the rest are given.

func FriendLevel

func FriendLevel(s *Snapshot, r FriendLevelReq) Plan

FriendLevel evens the ready queues of the friends up, as level evens the members': a friend's backlog is the cards on her row, ready and working, less her width (her lanes); her room is DealAhead times her width (1 and 1 in one-shot mode, docs/SPEC-SPRINT.md section 1, "A friend's card"). A card that may move goes, newest first, from a friend with no idle lane to one with an idle lane, and otherwise from a larger backlog to one smaller by more than one; its friend is the one preferredFriend picks among those below their room that may take it, and the friends with no idle lane give first, the largest backlog first. A lane is idle while no card on her row holds it, and her oldest unstarted cards hold her free lanes and do not move here (the start bound moves them: friendUnstartedLevel). It goes at its next generation (its own branch and job), ready on her row until she starts it (docs/SPEC-SPRINT.md section 1, a friend's card is working once she starts it). Each move lowers the idle lanes, or keeps them and lowers the sum of squared backlogs, and a card moves at most once, so it ends. Each move is one line; the first unit's line also says where the cards went: "moved=N to <friend>(n),... from <friend>(n),...".

func FriendReadCloseChecked

func FriendReadCloseChecked(s *Snapshot, name, primary, card, report string, missing map[string]MissingBranch, generation ...int) Plan

FriendReadCloseChecked applies one friend's read report to the read card named (card, the packet's own key: a re-asked read is a later identity of the plain one, ReadCardGenIDs; "" is the one of her identities at the attempt that is placed), with the server's check of the read's branch at its close (missing, as ReadReq.Missing): a broken report on a read whose branch origin does not hold is retired with no verdict (read_missing.go). generation, when given, must be the read card's live one (a stale report is refused).

func FriendReturn

func FriendReturn(s *Snapshot, r FriendReturnReq) Plan

FriendReturn returns each card named from the friend's row (docs/SPEC-SPRINT.md section 1, friend reconcile): a work card working on her row at the generation read, its primary working on it, is retired off the table (its record kept, retired_by friend reconcile, its return_reason the why), as rework retires a bound card, and its primary moves working -> ready, as a member going down leaves one, with no failed-work judgment and no redeal spent (the take was never the card's); the tick's friendDealPass places it again at its next attempt. A friend's next attempt is a new work card, never this one redealt, so the card leaves the table rather than wait withdrawn. One move line and one happened note each, saying why. A card not working on her row, at another generation, whose primary is not working on it, or named twice is refused.

func FriendStart

func FriendStart(s *Snapshot, r FriendStartReq) Plan

FriendStart is friend sync's start receipt (docs/SPEC-SPRINT.md section 1, a friend's card is working once she starts it): each card named, ready on her row, goes to working, taken now, its deadline from now (friendStartSet); one working on her row with no start of hers (startedNow) is stamped started now, where it is. A card she started already changes nothing; one not on her row, not ready or working, or at another generation is refused, one refusal each. A start is her fact: her lanes and her status do not gate it.

func FriendSyncStateStep

func FriendSyncStateStep(s *Snapshot, r FriendSyncStateReq) Plan

FriendSyncStateStep records the loop's state: one property write guarded on the value read, and one happened note when the state is first recorded or cleared. A failing record over a recorded one updates the facts (the count, what it says) with no note; an ok record with nothing recorded is empty.

func FriendTake

func FriendTake(s *Snapshot, r FriendTakeReq) Plan

FriendTake takes back the friend's cards she has not started: each one withdrawn on her row, its primary ready for the friends' deal. A card named that is not dealt to her, or that she has started, is refused, one refusal each, and the rest are taken; with AllOrNothing one refusal takes none, each card that would have been taken refused too; with All a started card stays (the caller, which read Started, says so). A working card taken frees her lane: her oldest ready card not taken is taken into working in the same unit, as her finish takes it (friendNext).

func Funded

func Funded(s *Snapshot, r FundedReq) Plan

Funded ends the provider's rest of its funds holding at s.Now (out of credit or low), one write, with a happened note to the coordinator; refused when the provider does not rest for its funds, or no reason is given. The provider's judgment closes at the next tick, and a machine the tick stopped because every provider was out of credit is then the coordinator's to start.

func Grade

func Grade(s *Snapshot, r GradeReq) Plan

Grade writes each grade on its primary, when the card is still ungraded and never dealt (Gradable): a card dealt meanwhile, or graded by an earlier write, is skipped silently, since the lane grades what it read a moment before.

func HoldNames

func HoldNames(s *Snapshot, r HoldReq) Plan

HoldNames is hold and unhold as one step (docs/SPEC-SPRINT.md section 11): every name resolved first (HoldTargets), all or none; then each kind's part, and a happened note per name, the reason in it, so the log holds every hold and release.

func KeepUnits

func KeepUnits(p Plan, keep func(Unit) bool) Plan

KeepUnits is the plan with only the units keep holds. A unit left out is not refused, only not written by this step: the tick's ask writes its plan in small fenced steps, each a few of its primaries (store.askInSteps), and plans the rest again on a fresh read. A unit dropped places nothing, so the plan's rolling index writes are made again from the units kept.

func LandBaseRefused

func LandBaseRefused(s *Snapshot, r MergeReq) Plan

LandBaseRefused is the lander's refusal on a red base: the merge step's count (MergeReq.BaseRefused, BaseRed with Base), with the base's one judgment. A stream that meets a base whose red already stopped another stream is refused under that stream's judgment and never stopped; the stream that stops keeps the base on its control card, and its judgment names the failing tests and the rule that resumes it. A hand merge --base-red is the merge step's own and stops as it always did.

func Lawful

func Lawful(p Plan) Plan

Lawful holds a plan to the lifecycle: a primary is admitted waiting or ready, every unit that moves a primary in the work table moves it by a row of Moves, and a primary leaves the table only from an open state. A primary is admitted ready, or moves waiting -> ready, only when every one of its needs has landed (before the step or in it) or was waived, judged against the pre-state the plan was built on; a plan that carries none moves no primary into ready. A unit that does not is refused, naming the move; it is never applied. The store holds every plan to it before applying it, whatever step built it.

It judges in two passes: first the lifecycle on every unit, then the needs rule, against the landings of the units the lifecycle kept only: a landing the lifecycle refuses satisfies nothing. A move in the work table whose expectation names no place is judged from the place the pre-state holds the card at, and is refused when the pre-state does not hold it: no entry skips the lifecycle or the needs rule by leaving its place out.

func LeaveQueued

func LeaveQueued(p Plan, held map[string]bool) Plan

LeaveQueued is a pump part's plan less every unit that changes a work card a queued change names: the change was queued after the pump's drain, and "nothing advances the work stream table EXCEPT on the next tick", so the card waits for the next tick's pump, where the change finds it where it expects it. Each unit left is said, never silent.

func MarkPushedUnreported

func MarkPushedUnreported(s *Snapshot, stream, sha string, pins []PushedPin) Plan

MarkPushedUnreported sets pushed_unreported on the work card and the merge card and writes the timeline line. A card already marked with that sha is left as it is. The plan sets fields only, so it lands while the stream is landed.

func MergeStep

func MergeStep(s *Snapshot, r MergeReq) Plan

MergeStep merges eligible cards by priority, preserving dependencies, as one batch; or, given a fact that stops the stream, stops it and tells the coordinator why. A stopped stream moves only after resume. A conflict fact on the card's own head (RefusalWay) stops nothing: the card is reworked at the tip, or returned for the widen rule, and the stream goes on (landRefused).

func MergeWindowOpen

func MergeWindowOpen(s *Snapshot, r MergeWindowReq) Plan

MergeWindowOpen opens the merge window from the step's clock for r.For (docs/SPEC-SPRINT.md section 7, the lander's pause): its end and reason written as the merge table's properties, guarded on the values read, over any window open before. Refused whole, writing nothing, naming every problem: an actor who is not the coordinator, a duration that is none or not above zero, no reason, or one over the text bound.

func MoveCards

func MoveCards(s *Snapshot, r MoveReq) Plan

MoveCards takes primaries to another stream (nova-sprint move): on a STOPPED machine only, each a primary waiting or ready with no work card dealt and not of the stream already; all or none. The destination is placed exactly as add places cards (Add, on the snapshot without the moved cards): the stream made as add makes one when it is new, the cards in line by --before, --after or --score, else at the end, waiting or ready by their needs and the stream's sentinels, a reached sentinel behind them no longer reached, a cycle of needs refused; a ready card the destination would put behind a sentinel is refused by the lifecycle (Lawful: ready -> waiting is only the effect of inserting a sentinel). A moved card is the same card moved, not a new one: its id, brief, needs and admission stay, and a need naming it still holds.

func MoveSeat

func MoveSeat(s *Snapshot, r SeatReq) Plan

MoveSeat is the seat moved to r.To: a happened note, which is the log's line of it, and the change the commit writes. A take's note is addressed to the holder it was taken from, so they see it when they wake; a given seat's to the new holder.

func ObserveFriend

func ObserveFriend(s *Snapshot, r HealthReq) Plan

ObserveFriend is the observation written: the plan's Health, which the step's commit writes as the friend's record, or its refusal.

func OnePerCause

func OnePerCause(s *Snapshot, p Plan) Plan

OnePerCause keeps a judgment open once per card and cause: a note of a plan that would open a judgment of a type already open on a subject (and not closed by the plan) leaves that subject out; a note left with no subject is not written. A stream's and the sprint's judgments are as they are written.

func Progress

func Progress(s *Snapshot, r ProgressReq) Plan

Progress stamps FieldProgress, at the server's time, on each named work card its holder works (docs/SPEC-SPRINT.md section 8, the rules table's row late; tla/SprintRules.tla, Stamp): the late rule's sign that the card moves. Only the holder stamps: a card that is not working, one held by another row than As, and one named at a generation that is not its live one are refused, and nothing else of the card changes.

func Promoted(s *Snapshot, r PromotedReq) Plan

Promoted records the promotion (nova-sprint promoted --sha <merge sha>): the coordinator's alone; the sha is 7 to 40 hex digits. It writes the work table's PropPromotedAt and PropPromotedSha and closes the judgment "dev is behind"; the next tick counts landings from here.

func Rank

func Rank(s *Snapshot, r RankReq) Plan

Rank changes a primary's score, and every copy of it: its placed work cards, read cards and merge place. Only rank changes a score. A landed primary is final and is not ranked.

func Read

func Read(s *Snapshot, r ReadReq) Plan

Read moves a reader's read cards: asked -> reading, or asked|reading -> ok|broken with the finding (a report on a card still asked is the begin and the report in one step, begun stamped with it), or, with Return, hands a read it holds back: back in asked on its row, stamped returned, the reason in one happened note, and the next tick's ask asks it of another reader up at the same attempt, or of the same reader when none is free (tla/DirtyTick.tla, ReadReturn, JudgedOnlyAfterTheBound). A broken read is a judgment; the last ok read a primary needs at its head leaves it to the tick, which accepts it (TickAccept): no judgment, no hand step. As may name several readers, comma separated: every card named is one of theirs, each read as its own reader's, in the one plan; a read by selection names one reader.

func Rebalance

func Rebalance(s *Snapshot, seats []FriendSeat, who string) Plan

Rebalance moves each work card dealt and not started (ready on its row: a friend has not started it, friendStarted; a member has not taken it), queued on a unit whose lanes all work, to a unit with an idle lane that may take it, one move a card, at most the idle lanes. A card stays when it is a read, a sentinel's, of a held stream, a bench card, a hard pin (OnlyFriend), a pin honoured where it sits (its WHO names the friend it is on, or a model pin on a member; a WHO: friend card on a friend's row goes to no member), run by a lane (laneRunsIt), or its route rests. A friend may take it when she is dealable, her tiers and the friends' set hold its tier (friendTakes) and it has not left her (friendsLeft); a member up, while the fleet's work is on, when the fleet's set holds its tier, a route of the tier serves it (routeOf) and it did not refuse it at staging. Never a row it was rebalanced off (FieldRebalancedFrom). The cheapest unit first: the card's own tier (a member draws on its tier's routes, a friend whose highest tier is the card's), then one tier up as overflow, never more; then the most idle lanes, then the name. The card moves at its next generation, its attempt kept and nothing carried; to a member it draws a route of its tier, to a friend its route comes off.

func Rebase

func Rebase(s *Snapshot, r RebaseReq) Plan

Rebase moves every unlanded card whose brief's BASE line names From to To (docs/SPEC-SPRINT.md, the rebase verb): an undealt card's brief changes; a dealt or merging card keeps its head, and the new base must contain the old one (Contains, git merge-base --is-ancestor), so the head it holds still lands. A card landed, a sentinel and a card whose BASE is another branch are left alone. Every move is one line in the log, one line per card.

func RecordCI

func RecordCI(s *Snapshot, r CIReq) Plan

RecordCI records the observation on the primary: status, head, run and source. It always notifies (red is a judgment, green happened), and moves no card. A result for a head that is not the primary's current one is labelled as such; a report of a run already recorded with the same status is refused as a repeat and writes nothing. Green on the current head discharges a red judgment on the primary.

func RecordLanded

func RecordLanded(s *Snapshot, r LandedReq) Plan

RecordLanded lands exactly the pinned cards as merge's record by name lands them (merge --landed, section 8), all or none, each merge card's note naming the commit and the reason. Only a merging card is recorded: the lifecycle has no move review -> landed and no move from off the table, so a card in review is refused naming accept, and a dropped one naming that it stays dropped. The cards are of one stream, the record's one batch.

func RecordScores

func RecordScores(s *Snapshot, r ScoreReq) Plan

RecordScores writes each score on its landed card and raises one NScoredLow judgment listing the cards whose p meets the bar, the highest first. A card not landed is refused; a card already carrying the same decision id is recorded already and writes nothing, so a replay raises no second judgment. An empty bar (the row's "" or a store nova-config never applied) writes the scores and raises no judgment.

func Recut

func Recut(s *Snapshot, r RecutReq) Plan

Recut is a card re-cut for another tier or another scope (docs/SPEC-SPRINT.md section 2, "A card replaced by its twin"; tla/SprintRules.tla, Replace): add --replaces of the old card (Replace), the twin in the old card's stream in front of it, with its needs (those it waived left out) and the new brief's, held as it was, its brief and rules unless a brief is named, its pinned tier unless a tier is named, and its attempts from the first. Every waiting card that needed the old id needs the twin, the old card is dropped "replaced by <new>", no blocked judgment is raised, and the twin records the id it replaces (FieldReplaces), in one step. Refused whole, writing nothing, for no tier and no brief, a tier that is no class or the one the card is pinned to with no brief, a card not on the table, a sentinel or landed, a brief that pins a model with a tier, and any refusal of the replace.

func RecutSel

func RecutSel(s *Snapshot, r RecutSelReq) Plan

RecutSel is recut by selector (docs/SPEC-SPRINT.md, "One selector, one step"): the selection made on s (Selected), and each card's Recut planned on the state the recuts before it leave, all or none. A card the transform leaves as it was, with no tier named, is refused: its twin would change nothing.

func Redo

func Redo(s *Snapshot, r RedoReq) Plan

Redo atomically executes return, rework with fix "redo the same change on the current tip", and resumes the stopped stream in one step with one history line. Refused when the card is not in a conflict.

func Release

func Release(s *Snapshot, r ReleaseReq) Plan

Release is the coordinator resolving a wait whose operand is the release: a sentinel lands (waiting -> landed, the only step that may), a held card has its hold cleared and moves to ready when it waits for nothing else, and every waiting primary whose needs have now landed moves to ready in the same step. A sentinel with nothing before it (HasBefore), or whose waits are each under way (notUnderWay), is released past them, waived on it (nova-tools#5096 item c13).

func Relink(s *Snapshot, r RelinkReq) Plan

Relink re-points every waiting card's need of an old id to the twin New, and answers the blocked (or missing) judgments that named only those olds, "replaced by <new>": the repair of a drop and an add made apart. The coordinator's alone. Refused whole, writing nothing, for a twin not on the table or a sentinel, an old id that is the twin or landed, an old id nothing waits on, or a cycle the new edges would close.

func RemindNotes

func RemindNotes(s *Snapshot, g Goals, who string) Plan

RemindNotes is the plan that makes the open judgments the failing routes: one for each person whose route fails and has none open, each closed once its person is reached, or dropped. It writes nothing when they agree.

func RenewReaderLeases

func RenewReaderLeases(s *Snapshot, reader string) Plan

RenewReaderLeases renews the lease of every in-flight read on reader to now + DefaultReadLease.

func RepairSeat

func RepairSeat(s *Snapshot, rec SeatChange, r SeatRepairReq) Plan

RepairSeat is the key written from the record rec, read before the step: the commit writes the record back unchanged with its holder as the key, and a happened note, the log's line of it, says who and why. A seat that moved since rec was read (its generation is not rec's) is refused: the step reads again.

func Replace

func Replace(s *Snapshot, r AddReq) Plan

Replace is add --replaces: the one card r admits is the twin of every card r.Replaces names. In one step the twin is admitted (Add), every waiting card that needs an old id needs the twin instead, the blocked judgments that named only the old ids are answered "replaced by <new>", each old card still on the table is dropped with the reason "replaced by <new>" (Drop, on the state with its edges re-pointed, so no blocked judgment is raised), and the weights are written once for the state after. Refused whole, writing nothing, for an add of more or less than one card or of a sentinel, an old id that is the new one, is no card, landed or is a sentinel, a cycle, or any refusal of the add or the drop.

func Resolve

func Resolve(s *Snapshot, r ResolveReq) Plan

Resolve moves waiting -> ready where every need has landed. A need that was dropped or missing is a judgment for the coordinator, once.

func RestRoutes

func RestRoutes(s *Snapshot, r RouteRestReq) Plan

RestRoutes is routes rest: the provider's routes or the one route rest from s.Now, cause RestCoordinator, until r.Until (zero: until woken), refused with no reason, a target that names no route or provider, or a time not after now.

func RestartReads

func RestartReads(s *Snapshot) Plan

RestartReads is the server restart plan (the model is tla/ServerLanes.tla, Restart, LiveLeaseNeverTakenBack, EveryLapsedReadTakenBack): on server start, keep every in-flight read whose lease is live, and only take back reads whose lease has lapsed (retired_by lapsed).

func RestoreShape

func RestoreShape(s *Snapshot, sh Shape) Plan

RestoreShape is the plan that gives a new epoch its control cards: each stream waiting, each member with its status and no work counted. A control card the epoch has already is left as it is.

func Resume

func Resume(s *Snapshot, r ResumeReq) Plan

Resume moves a stopped stream's stuck cards whose cause is resolved back to queued at their unchanged scores and the stream to merging (waiting when nothing is queued). It is refused while a cause is unresolved, naming it: a stuck card that needs a card of another stream waits until that card has landed (ranking it is not landing it). The other causes (a conflict, a red branch, a rejected batch) are resolved by the coordinator, who says what was done; after a red branch saying it is required. It answers every judgment open on the stream.

func RetireStreams

func RetireStreams(s *Snapshot, streams []string, why string) Plan

RetireStreams is the plan that retires every open judgment and every acknowledged condition (an alarm held, an overdue hold, a stale stream's) that names one of the streams (NamedStream): each is closed, its decided note saying why, and the step says so, a NOTE line each, naming it by its alias and id. Its next step named a stream that is no longer there to act on (nova-sprint resume --stream refuses "no such stream"), so it would wait in the inbox and count against the coordinator for good.

func Return

func Return(s *Snapshot, r ReturnReq) Plan

Return moves merging -> review: off the merge queue (or stuck), into the merge table's hidden returned column, so a later accept moves it back. The primary is marked returned at its attempt (FieldReturnedAttempt): the coordinator decides it, by accept, rework or drop, and the pump accepts it again only at a new attempt with its own reads.

func Rework

func Rework(s *Snapshot, r ReworkReq) Plan

Rework delegates at once: the next work card attempt, carrying the fix, is cut into the next member round the fleet (round.go: from the deal's rolling index, the first up with room other than the member of the attempt's work card, that member only when no other has room; the index moved past it and written with the step) and the primary moves review -> working in the same step; its read cards are retired, and the fixed work is asked round the readers when it returns. With no member up, or none below its width (tla/DirtyTick.tla, WidthRespected), the primary moves review -> ready with the fix and the tick's deal cuts its card when a member has room.

A primary that takes no rework is refused with what to run instead, by its state (reworkWhy), as brief is (briefStarted).

func SelectIDs

func SelectIDs(s *Snapshot, verb string, q Selector, plan func(ids []string) Plan) Plan

SelectIDs is a step over named ids made a step over a selection: the selection made on s (Selected) and handed to plan as the ids it names, with the lines selected says; a selection of no card, or an --ids-file id it does not hold of, is refused.

func SentinelSet

func SentinelSet(s *Snapshot, r SentinelSetReq) Plan

SentinelSet replaces the needs of a waiting sentinel in one step (docs/SPEC-SPRINT.md section 16; 2026-10-04: the cards a release sentinel waited on were deferred, and the sentinel could only be dropped and added again, which lost its id, its place and its log). The sentinel keeps its id, stream, score and log; one line names its needs before and after. A sentinel the new needs leave waiting for nothing is marked reached, as the step that lands its last need marks it; one reached that waits again is reached no more, and its reached judgment is answered. The blocked or missing judgments on it that named only needs it no longer names are answered. The coordinator's alone. Refused whole, writing nothing, for no needs (a sentinel with nothing to wait on is released, not emptied), an id that is no sentinel waiting on the table, a need named twice, the sentinel itself, needs that are no card on the table (every one named at once), the needs it has already, and a cycle the new needs would close.

func ServerRestart

func ServerRestart(s *Snapshot) Plan

ServerRestart is an alias for RestartReads.

func Set

func Set(s *Snapshot, r SetReq) Plan

Set writes the settings: refused whole, writing nothing, for an actor who is not the coordinator, a read tier that is not flash, pro or default, a dealt bound that is not a positive duration, a mark that names no repository or is not a stream's, an alarm's threshold it does not take, a side's tiers that are not of the four tiers or all, nothing to set, or a stream that is not a stream (docs/SPEC-SPRINT.md section 11).

func SetPriority

func SetPriority(s *Snapshot, r PriorityReq) Plan

SetPriority sets the level on each primary named, or on every card of the stream on the table, whatever its column, and the stream's default for cards added later. Each change is a happened note on the card's timeline with the actor and the reason; a card at the level already is said, not changed. A read card is refused: its level is reader, so the remedy is its primary.

func StatusTransitions

func StatusTransitions(s *Snapshot, r TickReq) Plan

StatusTransitions is the plan of the status transitions at this tick (the comment above): for each row, its departure from the record started, counted as a flap when it came back inside the dwell, or counted as a transition once it outlasted it, raising the row's one judgment or replacing its text; a row with no record recorded silently; an open judgment whose steps are all done answered by rule once its push is StatusRuleAfter old. With no beats read it does nothing, as the presence part does.

func StopReturn

func StopReturn(s *Snapshot, r StopReturnReq) Plan

StopReturn releases acknowledged work and reads to their own row. The new generation fences an old child's finish (and a read's late verdict).

func StoppedAssignments

func StoppedAssignments(s *Snapshot) Plan

StoppedAssignments observes canonical leases, never native execution (SPEC-SPRINT, STOP assignment alerts). Its durable row episode follows SprintRules.tla AlarmOncePerEpisode and ClearFollowsAlarm. Running includes a paused machine: existing work during pause is not a STOP anomaly.

func StrangerNotes

func StrangerNotes(s *Snapshot, names []string) Plan

StrangerNotes is the plan that tells the coordinator of each unknown machine that beats and was not told of yet: one happened notification for each name, in name order, none for a machine that has a row in the fleet by now.

func Take

func Take(s *Snapshot, r TakeReq) Plan

Take moves the member's work cards fleet ready -> working. As may name several members, comma separated: each takes from its own ready queue, up to the limit, in the one plan (the world's workers move in one batch a tick, every member's row at once); a take by id names one member.

func TickAccept

func TickAccept(s *Snapshot, r TickReq) (Plan, int)

TickAccept is the machine's accept: accept is mechanical, but the merge step is the coordinator's. Every primary in review with the ok reads it needs at its head (ReadsNeeded), whoever read it (a reader on the readers table, a friend on her fleet row: okReaders), moves to merging and into its stream's merge queue, in stream turns from the accept's index, in the pump's one plan (Accept, the move accept --read-ok makes, the readers named in the record). It is never a judgment and never a hand step: the seat is told once a tick, one "ready to merge" notice naming every primary the tick accepted and the land command of each stream; nothing in it asks for an answer.

A primary a change queued after the drain names (s.Held) is not eligible: it waits for the next tick's pump, where the change finds it where it expects it (docs/SPEC-SPRINT.md's accept row: review -> merging only on the ok reads it needs at the head, and the work table advances only at a tick's pump). It is dropped here, before the plan, so the stream's state change and the notice are planned for the cards accepted and for no others.

func TickAsk

func TickAsk(s *Snapshot, r TickReq) (Plan, int)

T2. TickAsk asks the reads wanted now (ReadsWanted: the first read alone, then the rest it needs once the first came back ok; ReadsNeeded: one for a flash card, two for a pro card; cost rule 4) of every primary in review whose work did not fail, readers up with room only (each read to the free reader with the greatest share of room, the finder's first; Ask, askPicks): a primary whose reads wanted now find too few free readers with room waits, due for the next tick, with no judgment; a returned read is asked again in place and needs no room. A read asked of a reader that is not up is taken back, and its primary is asked again, in the same step. The primaries that cannot be asked, for want of as many different readers as they still need whatever their room, are one judgment per tick (N1, NCannotAsk: "no eligible reader for <ids>", cannotAskCond), each closed when its primary is asked; a primary that needs more readers than are up is not asked, and one judgment says so (NFewReaders, the sprint's, once per tick-end): with one reader up the flash cards are asked and the pro cards wait. The primaries go in stream turns from the ask's stream index on the work table (streamTurns, as the deal's; Ask moves the index), so the readers serve every stream alike and no stream's backlog waits behind another's.

func TickCapDeal

func TickCapDeal(s *Snapshot, r TickReq) (Plan, int)

TickCapDeal is the attempt cap's default answer as a part of the tick (AttemptCapDeal).

func TickCheck

func TickCheck(s *Snapshot, r TickReq) (Plan, int)

T6. TickCheck holds the state to what is always true (section 9): each violation is one judgment (N8), with the rule and the cards, closed by the tick when the rule holds again. Its duty is the no-stall rule too: each stall nothing holds is one judgment "stalled", with the decisions open to it, not written again while it stays and closed when it clears; a stall that waits behind another is told by the other's. And a judgment whose every card has left the table retires here, answered by the machine with the card's event (judgments_retire.go): the tick that sees the card gone closes it.

func TickCoordinatorPass

func TickCoordinatorPass(s *Snapshot, r TickReq) (Plan, int)

TickCoordinatorPass is the pass, run by the overdue part (TickOverdue): the conditions raised, raised again and closed (the comment above).

func TickDeadlines

func TickDeadlines(s *Snapshot, r TickReq) (Plan, int)

TickDeadlines writes one judgment for each card or stream past its deadline, in running time (N4, N5, N6), and closes it when the card or the stream moves. It keeps the backlog alarms too (tickAlarms, docs/SPEC-SPRINT.md section 8, "Backlog alarms").

func TickDeal

func TickDeal(s *Snapshot, r TickReq) (Plan, int)

T3. TickDeal deals ready primaries in stream turns (streamTurns: one from each stream in turn from the deal's stream index on the work table, a stream with no ready card skipped, each stream's oldest first by score; Deal moves the index past the stream of the last card dealt), each to the next up member round the fleet with room (Deal: the rolling index of round.go), every member filled up to its width, its ready and working cards together (width.go): every ready card the fleet has room for goes in the one plan, one step, up to TickMaxDeal; a withdrawn card is dealt again at a new generation. With no member up and primaries waiting to be dealt, the coordinator is told once (N3), and the judgment closes when a member is up.

func TickDone

func TickDone(s *Snapshot, r TickReq) (Plan, int)

TickDone is the sprint's done part: the sprint done (SprintDoneCounts) is no judgment that waits on the coordinator. The part writes one happened note, "the sprint is done", addressed to the coordinator, with the counts, the time from the first start and the hint; the binding stops the machine as the part's step commits, its record STOPPED with the cause DoneCause, so no part and no tick runs after it. It is the tick's last part: a tick of a RUNNING machine that finds the sprint done ends there. It writes nothing on a sprint that is not done, and it runs only while the machine is RUNNING, so it says it once for each run that finishes the sprint. The reference model's tick stops the same way (refmodel.Tick); tla/SprintEvents.tla does not model R15.

func TickDrift

func TickDrift(s *Snapshot, r TickReq, f *DriftFacts) (Plan, int)

TickDrift is the tick's drift alarms, planned in the deadlines part on the facts the binding read (TickReq.Drift; docs/SPEC-SPRINT.md section 8, "Drift alarms"): a judgment for each drift that starts, the open one raised again every PassEvery of running time while it holds, and closed when it stops. A type the facts say nothing of keeps its open judgment, and the coordinator's wait on it, as they are: no fact is never a clear.

func TickFriendStall

func TickFriendStall(s *Snapshot, r TickReq) (Plan, int)

TickFriendStall is the friend stall part of the tick (PartFriendStall): it runs in the fleet update pass, checks each friend holding cards against the stall bounds, climbs the ladder when stalled, takes back unstarted cards at rung 4, marks her down at rung 5, and releases her to up at her first activity after going down.

func TickIdle

func TickIdle(s *Snapshot, r TickReq) (Plan, int)

TickIdle is the idle alarm, the tick's part after the overdue judgments (TickReq.IdleAlarm, run --idle-alarm): the episode begins when the fleet works under half its width while a card waits, and is written on the fleet table (PropIdleSince); past IdleWindow of running time, one note to the coordinator says the fleet's working and width and the roots (TraceIdle), and the episode is marked said (PropIdleSaid); when the fleet works at half its width again, or no card waits, the episode ends, and a note says so when one was pushed.

func TickLevel

func TickLevel(s *Snapshot, r TickReq) (Plan, int)

T4. TickLevel is the fleet's rebalance, once at the start of every tick (TickStart): the up members' backlogs evened when two differ by more than one, the newest ready cards of the largest going round the fleet from the deal's index to a member below DealAhead times its width (level, round.levelTo).

func TickLevelReads

func TickLevelReads(s *Snapshot, _ TickReq) (Plan, int)

TickLevelReads is the readers' rebalance, once at the start of every tick, before any other part: levelReads, in one plan.

func TickOverdue

func TickOverdue(s *Snapshot, r TickReq) (Plan, int)

TickOverdue marks each open judgment overdue once, when it passes its due time in running time (DeadlineJudgment after it was written, or the review time the coordinator set with wait): one overdue line (a happened note of NOverdue naming the judgment), and a hold on the judgment's open subjects (an acknowledged-kind record of NOverdue, never a judgment and shown in no inbox) that stops the tick marking it again. The tick closes the hold when the judgment closes or is no longer overdue (a wait moved its review time on), so a judgment overdue again is marked again. A coordinator who is silent is visible: every judgment waiting on them is named, once, as overdue. The coordinator's pass (TickCoordinatorPass) runs in this part too, after the overdue lines: it reminds the coordinator, every PassEvery, of the judgments still late and of the friends deaf or idle.

func TickPresence

func TickPresence(s *Snapshot, r TickReq) (Plan, int)

TickPresence applies the changes of the members' derived status (T0), every member whose status changes in the one plan (the design's R1 and R2, v2.1 section 2.3: each member seen or down is its own key, none waits behind another's; the owner's rule: every row of every table moves every tick, never a row at a time). Every member that should be down and is up goes down, its unfinished work cards dealt round the members up after the plan (downPlan: the loads and the rolling index shared across every down member, so the cards of all of them go round the fleet together) or withdrawn when none is; every member that should be up and is not comes up, up to TickMaxMoves of them. With no member going down, the first up levels the ready queues once over every member up after the plan; with downs, the level part of the same tick evens the queues after the deal. So a fleet that beats before start is up, whole, at the first tick, and a fleet that loses several machines at once redeals all their cards in that tick. The binding gives it the beats; with none given it does nothing. Each status that changed, a member's or a friend's, raises its one judgment in the same plan (StatusTransitions, judgments_status.go).

func TickRebalance

func TickRebalance(s *Snapshot, r TickReq) (Plan, int)

TickRebalance is the rebalance as a part of the tick (Rebalance).

func TickResolve

func TickResolve(s *Snapshot, r TickReq) (Plan, int)

T1. TickResolve scans every stream's waiting set in score order, from the state, whenever the tick reads the whole sprint: a primary whose every need has landed moves to ready; a dropped or missing need is a blocked judgment, once. A sentinel is never moved: when everything it needs has landed, resolve marks it reached and opens its judgment, and what waits behind it stays waiting until the coordinator releases it. No flag says a scan is due: what is due is read from the state, so a tick that did not finish leaves it due for the next.

The waiting primaries go in stream turns (dealTurns: one from each stream in turn, within a stream by work order), so a bound that cuts the plan cuts every stream alike.

func TickResume

func TickResume(s *Snapshot, r TickReq) (Plan, int)

T7. TickResume resumes a stream stopped only because a card needed another stream's card, once that card has landed: the stuck cards back to queued, the stream merging, its judgment closed, and a happened note.

func TickRetireGone

func TickRetireGone(s *Snapshot, r TickReq) (Plan, int)

TickRetireGone is the tick's retirement of what names a stream the tables lack (StreamGone): every open judgment and acknowledged condition naming one is closed, with a note (RetireStreams). Stream remove and stream archive retire their own as they take the stream off; this part retires what was open before they did, and anything left behind by a remove whose own retirement did not finish.

func TickRuleAsk

func TickRuleAsk(s *Snapshot, r TickReq) (Plan, int)

TickRuleAsk asks another reader for the first late read the read-late rule answers: one a tick, as the ask's round index is written with each ask; the next tick asks the next.

func TickRuleBrief

func TickRuleBrief(s *Snapshot, r TickReq) (Plan, int)

TickRuleBrief marks the brief defects: the card's mark, and the judgment's text.

func TickRuleLate

func TickRuleLate(s *Snapshot, r TickReq) (Plan, int)

TickRuleLate answers the late work cards: a wait, a hold until the holder's own deadline, or the card returned and dealt again; each closes the judgment and keeps a hold on its condition until the time it names, so the tick raises it again then if it still holds.

func TickRuleNeed

func TickRuleNeed(s *Snapshot, r TickReq) (Plan, int)

TickRuleNeed records, once an attempt, the card a HOLD waits for: FieldRuleNeed on the primary, the judgment's text "waiting on <card> by rule hold-need: ...", and one log line. The judgment stays open: a primary in review has no move to waiting (Moves), and the rework part reworks it by this rule once the card lands.

func TickRulePaths

func TickRulePaths(s *Snapshot, r TickReq) (Plan, int)

TickRulePaths answers the held cards the paths rule answers: each whose proposal shares a file has its brief file written and its judgment's text made the complete command, once; and the first whose proposal shares none is replaced by its twin (Recut, twins inherit), its judgment answered with the proposal logged. One twin a tick: each replace plans on the table the one before it leaves, so the next is the next tick's.

func TickRuleResume

func TickRuleResume(s *Snapshot, r TickReq) (Plan, int)

TickRuleResume resumes the streams whose conflict card the conflict rule took out, and every stream stopped on a base's red that a land pass found green again (the base-gate rule): the one with the judgment answers it, and the ones stopped under it resume with it.

func TickRuleReturn

func TickRuleReturn(s *Snapshot, r TickReq) (Plan, int)

TickRuleReturn returns the conflict cards the conflict rule answers, each marked with the refusal it was returned on (FieldRuleRefused, FieldRuleRefusal) and its next attempt's tier, flash (FieldTierNow).

func TickRuleRework

func TickRuleRework(s *Snapshot, r TickReq) (Plan, int)

TickRuleRework reworks every card a rule answers with a new attempt, each its own way, in one step.

func TickRuleReworkUnwidened

func TickRuleReworkUnwidened(s *Snapshot, r TickReq) (Plan, int)

TickRuleReworkUnwidened is the rule rework part with the judgments the widen rule leaves taken out of the open set: a HOLD for a file outside PATHS that is not adjacent is the coordinator's, and no failed or bound rule redeals it.

func TickRuleTake

func TickRuleTake(s *Snapshot, r TickReq) (Plan, int)

TickRuleTake takes back the friends' cards the friend-take rule answers, each closing its late judgment with the rule's decided note; the next tick's deal places each again, never on the friend it was taken from.

func TickRuleTwin

func TickRuleTwin(s *Snapshot, r TickReq) (Plan, int)

TickRuleTwin twins the first card a rule answers ActTwinWider: Recut with its PATHS widened by the files its finding names and a CARRY: line at the broken attempt's head when it pushed one, the twin carrying the finding as its fix and the rule's note, the old card dropped "replaced by <twin>" with its judgments closed by the decided note. One card a tick: each twin's step re-weighs the stream, so two planned on one read would write one card's weight twice; the next tick twins the next. A recut refused leaves the judgment open, the coordinator's.

func TickRuleWiden

func TickRuleWiden(s *Snapshot, r TickReq) (Plan, int)

TickRuleWiden is the widen rule's part (docs/SPEC-SPRINT.md section 8, the row widen): the first card it widens, by Brief in place with PATHS and SHARED widened by exactly the files and a CARRY: line at the finished head (the same id, review -> ready, its next attempt from that head and its brief's bound counted from it), its fix naming the head to start from and the files, its judgments closed by the decided note, and one note to the coordinator naming the files; one card a tick. Every card it leaves has its judgments' text prefixed with WidenBlocked and the files, once. A brief edit refused leaves the judgment open, the coordinator's.

func TickStoppedAssignments

func TickStoppedAssignments(s *Snapshot, _ TickReq) (Plan, int)

TickStoppedAssignments clears an ended STOP episode in the existing tick part machinery; an empty observation is passed over (SPEC-SPRINT, STOP assignment alerts; tla/DirtyTickRead.tla PassOver).

func TimerNotes

func TimerNotes(s *Snapshot, t Timers, due []Timer, who string) Plan

TimerNotes is the plan that raises the timers due names as judgments of kind NTimer, each addressed to its actor, and leaves the record with them closed: one timer, one judgment, once, in the step that writes it (docs/SPEC-SPRINT.md, "Timers"; tla/Timer.tla, Tick). who is recorded with each judgment.

func Twin

func Twin(s *Snapshot, r TwinReq) Plan

Twin twins a card in one step (docs/SPEC-SPRINT.md section 2, "A card replaced by its twin"; tla/SprintRules.tla, Replace): the twin's id is the card's with its trailing number raised (TwinNumberIDs), its brief the card's with PATHS widened and THE TASK prefixed by the correction (TwinBrief), its needs the card's (less those it waived) and r.Needs, held if it was held, pinned to r.Tier or the card's pin, in the card's stream in front of it or of r.Before, from its first attempt, as a fresh card is admitted. It is add --replaces of the card (Replace): every waiting card that needs the card needs the twin, in the same place, and the card is dropped "twinned as <id>", raising no blocked judgment; every open judgment on the card is answered "twinned as <id>". A merging card is returned first (Return), after the twin is checked on the card as returned: this step is then the return alone, and says TwinReturnedFirst. Refused whole, writing nothing, for a card not on the table, a sentinel or landed, a tier that is no class, a glob that climbs out, every twin id taken, and any refusal of the replace, a cycle among them, naming its edges.

func Unpin

func Unpin(s *Snapshot, r UnpinReq) Plan

Unpin removes the stored WHO value without editing the brief, including on a running machine (docs/SPEC-SPRINT.md, WHO preference). Each refusal is local to its card; each successful change and its audit note commit together.

func Wait

func Wait(s *Snapshot, r WaitReq) Plan

Wait is the step of WaitReq; it is refused for a judgment the tick does not keep (its review time is set instead) and for one not open.

func WakeRoutes

func WakeRoutes(s *Snapshot, r RouteWakeReq) Plan

WakeRoutes is routes wake: the rest holding the provider (its one property, any cause) and its routes' own rests, or the one route's own rest, ends at s.Now with the reason on its words; refused with no reason, a target that names no route or provider, nothing resting, or a route whose provider's rest holds it (wake the provider).

func WithFriendFinish

func WithFriendFinish(p Plan, s *Snapshot, v string) Plan

WithFriendFinish is the set step's plan with the friend-finish window written too: a duration above zero, or default. An empty value, or a plan refused for any reason but that it had nothing else to set, is returned as it is.

func (Plan) Empty

func (p Plan) Empty() bool

Empty says a plan writes nothing.

func (Plan) Tables

func (p Plan) Tables() []string

Tables is the logical tables the plan writes, in ApplyOrder.

type PriorityReq

type PriorityReq struct {
	IDs                        []string
	Stream, Level, Reason, Who string
}

PriorityReq is the verb priority's request: the cards named, or every card of the stream on the table and the stream's default, set to the level, with the reason.

type ProgressReq

type ProgressReq struct {
	Sel
	As   string
	Gens map[string]int
	Who  string
}

ProgressReq is a holder stamping progress on the work cards it works (the `progress` verb, sent by the member and the friend daemon every ProgressEvery while the child or the turn prints): As is the fleet row that holds them, Gens the generation held, where the card is named at one.

type PromotedReq

type PromotedReq struct {
	Sha     string
	Answers []string // the judgments it answers (answered): one naming no open judgment refuses the whole step
	Who     string
	// Returned is the landed cards dev or an audit returned with the promotion: each is
	// marked (readtier.go, FieldReturnedByDev) and the tick asks to raise its stream's
	// read tier.
	Returned []string `json:",omitempty"`
}

PromotedReq is the coordinator's word that the sprint branch was promoted into dev: the merge sha.

type PropWrite

type PropWrite struct {
	Table, Name, Value string
	Was                string
	WasAbsent          bool
}

PropWrite is a table property a step writes (docs/SPEC-NOVA-TABLE.md, table properties): the table (logical name), the property and its new value, guarded on the value the plan read (Was, or WasAbsent when it read none), applied in the same atomic batch as the step's changes of that table.

type ProviderBalance

type ProviderBalance struct {
	Provider  string
	Known     bool
	Balance   float64
	At        time.Time
	SpendHour float64
	HasUsed   bool
	Used      float64
	Note      string
}

ProviderBalance is a provider's balance as the poll last read it: the dollars left (Known false when the provider has no balance the poll can read, Note saying why), when it was read, the provider's own count of dollars used (HasUsed false when it keeps none), and the spend in dollars an hour measured from that count (or the balance) between two reads.

func (ProviderBalance) HoursLeft

func (b ProviderBalance) HoursLeft() (float64, bool)

HoursLeft is how long the balance lasts at the spend an hour; ok is false with no spend measured (or no balance known).

func (ProviderBalance) Low

func (b ProviderBalance) Low() bool

Low says a balance calls for the coordinator's judgment: at or under zero, or not over one hour of the spend. It rests nothing (providerConds).

func (ProviderBalance) Said

func (b ProviderBalance) Said() string

Said is the balance as a line says it: dollars and cents, rounded up, and when it was read; "unknown" and why when the poll could not read it, or has not.

type ProviderRead

type ProviderRead struct {
	Provider string
	Known    bool
	Balance  float64
	HasUsed  bool
	Used     float64
	Note     string
}

ProviderRead is one balance the poll read: the provider, the dollars left (Known false with Note saying why when there is none to read), and its count of dollars used (HasUsed false when it keeps none).

type ProviderRow

type ProviderRow struct {
	Name      string  `json:"name"`
	Balance   string  `json:"balance"` // dollars and cents rounded up, or "unknown"
	BalanceAt string  `json:"balance_at,omitempty"`
	SpendHour float64 `json:"spend_hour"`
	State     string  `json:"state"`
	Note      string  `json:"note,omitempty"` // why the balance is unknown
}

ProviderRow is one row of the providers table (where --json): the provider, its balance as the poll last read it, the spend over the last hour, and its state: serving, or resting until a time and why.

func ProviderRows

func ProviderRows(routes []Route, fleet *Table, now time.Time) []ProviderRow

ProviderRows is the providers table: a row for each provider the routes name, in name order, its balance from the fleet table's properties and its state from its routes' rests at now: resting when every route of it rests, serving with the resting ones named when some do, else serving; the latest end and the first cause said.

type ProviderTake

type ProviderTake struct{ Route, Model, Member, Finished, Usage, Error, Taken string }

ProviderTake is the record of one take of a work card the provider failed, kept on the card beside the takes after it (FieldProviderTake plus the take's number, the card's redeals when it ended plus one): the route and model it ran on, the member, when it ended, what it spent and the error line. `card <id>` prints one ATTEMPT line for each, and the route stats count it against its route. Taken is when the member took the card for the take, its child launched ("" in a record written before it was kept): a provider's refusal is read against the rest window its launch fell in (provider_funds.go).

func ProviderTakes

func ProviderTakes(wc *Card) (takes []ProviderTake, numbers []int)

ProviderTakes is the takes of the work card the provider failed, in the order they ended, each with its number.

func StagingTakes

func StagingTakes(wc *Card) (takes []ProviderTake, gens []int)

StagingTakes is the work card's launches refused at staging, in the order of their generations (FieldStagingTake).

func (ProviderTake) String

func (t ProviderTake) String() string

String is the take as the card's field holds it: tab separated, the line, whose tabs are blanks, before the launch's time, so a record written before Taken reads as it did.

type PushM

type PushM struct {
	Measured bool       `json:"measured,omitempty"`
	Holder   string     `json:"holder,omitempty"`
	Record   PushRecord `json:"record,omitzero"`
	Recorded bool       `json:"recorded,omitempty"`
}

PushM is the seat's push proof (pushproof.go): the holder and its push record, as read; Measured false is a check that did not read it, which says no line.

type PushRecord

type PushRecord struct {
	Name    string    `json:"name"`
	Harness string    `json:"harness"`
	Adapter string    `json:"adapter,omitempty"`
	Target  string    `json:"target"`
	Session string    `json:"session,omitempty"`
	Nonce   string    `json:"nonce,omitempty"`
	Sent    time.Time `json:"sent,omitzero"`
	Failed  string    `json:"failed,omitempty"`
	Proven  time.Time `json:"proven,omitzero"`
	PongOf  string    `json:"pong_of,omitempty"`
}

PushRecord is one name's push record: the harness, the adapter the push loop delivers through (AdapterFolder, or "" for the harness's own deliver command) and its deliver target (a directory, and a session where the harness names one), the check last delivered (its nonce and when), the last delivery failure, and the last pong that carried a delivered nonce.

func PublicPushRecord

func PublicPushRecord(rec PushRecord) PushRecord

PublicPushRecord is status without the verification secret (SPEC-SPRINT, "The push proof"). The persisted record remains the verifier's truth.

func PushPong

func PushPong(rec PushRecord, ok bool, nonce string, now time.Time) (PushRecord, string)

PushPong is the record after a pong carrying nonce, "" why when it counts: it must carry the last check delivered, and only once.

func PushSent

func PushSent(rec PushRecord, nonce, why string, now time.Time) PushRecord

PushSent is the record after a check with nonce was delivered at now (why ""), or failed to be (why the adapter's reason): a failure puts the seat down until a check is delivered and answered.

func (PushRecord) AdapterName

func (r PushRecord) AdapterName() string

AdapterName is the adapter the push loop delivers through: the record's adapter, else the harness's own ("-" when there is neither).

type PushedPin

type PushedPin struct{ ID, Head, Attempt string }

PushedPin identifies the exact card revision contained in a pushed batch.

type QueueM

type QueueM struct {
	Measured  bool     `json:"measured,omitempty"`
	Entries   []string `json:"entries,omitempty"`
	ThrownOut []string `json:"thrown_out,omitempty"`
	Green     int      `json:"green,omitempty"`
}

QueueM is the merge queue: entries, thrown out pull requests, and green PR count.

type QueuedChange

type QueuedChange struct {
	Entry *ntable.BatchMemberEntry `json:"entry,omitempty"`
	Prop  *PropWrite               `json:"prop,omitempty"`
	Verb  string                   `json:"verb"`
	Actor string                   `json:"actor,omitempty"`
	Moved string                   `json:"moved,omitempty"`
}

QueuedChange is one work-table change a step queued for the pump: the entry as the step planned it (its id the card's, not the stored one), or a property write of the work table; with the step's verb, actor and words, which the pump's line of the change carries.

type Quiet

type Quiet struct {
	Member  string    `json:"-"`
	Until   time.Time `json:"until"`
	Reason  string    `json:"reason"`
	By      string    `json:"by,omitempty"`
	At      time.Time `json:"at"`
	Ended   time.Time `json:"ended,omitzero"`
	EndedBy string    `json:"ended_by,omitempty"`
}

Quiet is one member's quiet as its property holds it: until when, why, who set it and when; Ended is when it ended (its time, or --end) and the log has said so.

func Quiets

func Quiets(props map[string]string) []Quiet

Quiets is every member's quiet the fleet table's properties hold, by member name; a property that does not read is no quiet.

func (Quiet) Active

func (q Quiet) Active(now time.Time) bool

Active says the quiet holds the member out of the deal at now: not ended, and before its time.

func (Quiet) Line

func (q Quiet) Line() string

Line is the QUIET line every worker's view carries while the quiet holds.

type RankReq

type RankReq struct {
	IDs     []string
	Score   *float64 // the new score of the first; the rest follow it
	First   bool     // ahead of every primary of its stream
	Before  string   // in line in front of this primary of the cards' own stream, in the order named
	Answers []string
	Who     string
	Only    []string
}

RankReq is the coordinator changing scores.

type ReadCardCounts

type ReadCardCounts struct {
	Ready   int `json:"ready"`
	Working int `json:"working"`
	Done    int `json:"done"`
}

ReadCardCounts is the epoch's read cards on the fleet table: ready, working, and done (ok or failed), where --json's read_cards.

func RowCardCounts

func RowCardCounts(s *Snapshot) (rows map[string]map[string]int, all ReadCardCounts)

RowCardCounts is each fleet row's cards as the dashboard's segmented bar draws them, highest on the left: its working cards by level, a read card as reads whatever level it inherits and a work card at the level its deal wrote (QueuePriority), the fields <level>_working summing to its working (RowCardFields); and reads_ready, the read cards among its ready. A row with none is absent. all is the epoch's read cards.

type ReadDay

type ReadDay struct {
	USD    string `json:"usd,omitempty"`
	Tokens int64  `json:"tokens,omitempty"`
	Reads  int    `json:"reads"`
}

ReadDay is one route's reads of a UTC day: the exact dollars charged (each read's actual cost where reported, else its predicted one; "" when none was priced), the tokens, and how many reads.

type ReadReq

type ReadReq struct {
	Sel
	As      string
	Gens    map[string]int // named begin and post-STOP verdicts guard the live read lease
	Begin   bool           // asked -> reading
	Verdict string         // ok or broken
	Finding string
	Who     string
	// Missing is the server's check at the close of a broken read, by read card: the
	// branch the read named is not on origin (read_missing.go). Such a verdict is no
	// verdict: the read is retired and asked again, the card not reworked.
	Missing map[string]MissingBranch `json:",omitempty"`
	// Return hands the named read back, with the reason: no verdict, no
	// finding against the work, not a read; the tick asks it again.
	Return bool   `json:",omitempty"`
	Reason string `json:",omitempty"`
	// Usage is what the read spent, as the reader read it from its child
	// (cardcost.Usage): kept on the read card, timed and priced (cost.go).
	Usage string `json:",omitempty"`
}

ReadReq is a reader moving its own read cards.

type ReadTierRaise

type ReadTierRaise struct {
	Stream string
	Next   string
	Why    string
}

ReadTierRaise is why a stream's read tier should rise: the stream, the tier to raise it to and the cause.

func RaiseReadTier

func RaiseReadTier(s *Snapshot, stream string) (ReadTierRaise, bool)

RaiseReadTier is whether the stream's read tier should rise, and why: the first cause found among its cards, in work order. A cause holds while the stream's read tier for the card is the tier it was found at: a raise ends it, and a keep (ack) holds it quiet.

func (ReadTierRaise) What

func (r ReadTierRaise) What() string

What is the judgment's line.

type ReadVerdict

type ReadVerdict struct {
	At      time.Time
	Reader  string
	Verdict string // ok or broken
	Tier    string
	Finding string // its class: the first FindingClassLen characters
}

ReadVerdict is one verdict on the ledger.

type ReaderBreaking

type ReaderBreaking struct {
	Reader       string
	Holds        []string // the names its rows are held by (holdName), the judgment's decisions
	Last         tally
	Other        string
	OtherTally   tally
	FindingsTop3 []string
}

ReaderBreaking is a reader that breaks nearly everything: its last ReaderWindowLen verdicts, and the reader it is set beside, by that reader's own last ReaderWindowLen.

func ReadersBreaking

func ReadersBreaking(s *Snapshot) []ReaderBreaking

ReadersBreaking is every reader whose last ReaderWindowLen verdicts are ReaderBreaksBar or more broken while another reader's own last ReaderWindowLen (at least ReaderOtherMin of them) are under ReaderOtherBar broken, ok against broken by reader, in reader order.

func (ReaderBreaking) What

func (b ReaderBreaking) What() string

What is the judgment's line.

type ReaderLoad

type ReaderLoad struct {
	Reader  string
	Reading int
	Late    int
	Width   int
	State   string
}

ReaderLoad is one reader's reads: reading now, asked and not begun past the window (a read asked in the step being planned is never past it, so the fact holds across the step), its width (Snapshot.ReaderWidth; 0 when its name is no machine's or the machine has no row), and its state.

func (ReaderLoad) Lags

func (l ReaderLoad) Lags() bool

Lags says the reader's loop lags its width: reads wait on it past the window, up, while it reads below its width.

func (ReaderLoad) Room

func (l ReaderLoad) Room() bool

Room says the reader had room for a read it did not begin: it reads under its width, or its width is not known (0: no machine row bounds it).

type ReaderSpend

type ReaderSpend struct {
	Reads      int    `json:"reads"`
	Priced     int    `json:"priced,omitempty"`
	USD        string `json:"usd,omitempty"`
	HourPriced int    `json:"hour_priced,omitempty"`
	HourUSD    string `json:"hour_usd,omitempty"`
	Tokens     int64  `json:"tokens,omitempty"`
}

ReaderSpend is one reader's reads summed: how many were recorded, how many carried a dollar figure, the exact dollars all time and in the last hour (each read's actual cost where reported, else its predicted one; "" when none was priced), and a subscription reader's tokens (WhySubscription), the reads whose cost is their tokens.

func (ReaderSpend) Cells

func (r ReaderSpend) Cells() map[string]string

Cells are the reader's spend as the readers table's cells (ReaderSpendCols): text, as every cell of the where view is.

func (ReaderSpend) PerRead

func (r ReaderSpend) PerRead() string

PerRead is what one priced read cost on average, dollars and cents rounded up (MoneyText); "-" when none was priced.

type ReaderStat

type ReaderStat struct {
	Reader    string  `json:"reader"`
	Cards     int     `json:"cards"`
	BeginWait Measure `json:"begin_wait"`
	RunWall   Measure `json:"run_wall"`
	ReportLag Measure `json:"report_lag"`
}

ReaderStat is one reader's read cards, asked of it (retired ones too): the begin wait (asked to begun), the run wall and the report lag (read - begun - wall).

type ReadersLag

type ReadersLag struct {
	Review  int
	Readers []ReaderLoad
}

ReadersLag is the readers behind: review's count and every reader that holds reads.

func ReadersBehind

func ReadersBehind(s *Snapshot) (ReadersLag, bool)

ReadersBehind is whether the readers are behind, and the facts: a read has sat asked and not begun for ReadersWindow or longer on a reader up with room for it (ReaderLoad.Room). A reader that is not up is taken back by the ask, so its reads never count toward the window; it is named when it holds reads, for reader up. A reader reading its whole width is busy, not behind: reads waiting on it raise nothing (ReadersFull; on the night of 2026-10-05 "the readers are behind" rose while every reader was busy).

func (ReadersLag) Decisions

func (b ReadersLag) Decisions() []string

Decisions are the judgment's: reader up for each reader not up that holds reads, a restart for each that reads under its width, and wait 10m.

func (ReadersLag) What

func (b ReadersLag) What() string

What is the judgment's line: review, the readers' reading beside their widths, and what each needs.

type ReadersM

type ReadersM struct {
	Total   int `json:"total"`
	Up      int `json:"up"`
	Reading int `json:"reading"`
}

ReadersM is the readers table: how many readers, how many up, and how many reads are being read now.

type ReadsWindowView

type ReadsWindowView struct {
	OK     int       `json:"ok"`
	Broken int       `json:"broken"`
	Since  time.Time `json:"since"`
}

ReadsWindowView is the window's counts, as where --json's reads_window carries them: the ok and broken verdicts over the last ReadsWindowSpan of running time, and when the window began by the clock.

func ReadsWindowOf

func ReadsWindowOf(s *Snapshot, stopped func(from, to time.Time) time.Duration) ReadsWindowView

ReadsWindowOf is the window's counts on the snapshot (where --json's reads_window).

type RebaseReq

type RebaseReq struct {
	From, To string
	Who      string
	Contains func(from, to string) error `json:"-"`
}

RebaseReq moves every unlanded card whose BASE is From to To. Contains, when set, is the git merge-base --is-ancestor check that To holds From; a non-nil error refuses the whole rebase and names it. It is not part of the request's arguments, so a retry under one --op is held to the branches alone.

type RecutReq

type RecutReq struct {
	ID    string // the card re-cut
	New   string // the twin's id; "" names it by TwinID
	Tier  string // the tier the twin is pinned to (FieldTier); "" keeps the old card's pin
	Brief string // the twin's brief; "" keeps the old card's brief and its rules
	Rules string // with Brief: the held rules file the brief is held to (FieldRules)
	// Needs, with Brief: the needs the new brief names on its DEPENDS-ON: line (briefNeeds),
	// taken with the old card's.
	Needs []string `json:",omitempty"`
	Who   string
}

RecutReq re-cuts a card as its twin (nova-sprint recut): the same card for another tier or another scope, under a new id.

type RecutSelReq

type RecutSelReq struct {
	Sel  Selector
	Tier string    `json:",omitempty"`
	Edit BriefEdit `json:",omitempty"`
	Who  string
}

RecutSelReq is recut by selector: every selected card re-cut as its twin (Recut), its tier Tier and its brief its own with Edit made, in one step (Batch).

type RedTest

type RedTest struct {
	Test, Pkg, Job, File, Line, Run string
}

RedTest is one failing test read from a CI run's failed log (RedTests): its name, its package as go test printed it, the job (the runner) it failed on, its test file and its failing line, and the run (its caller's, not the log's).

func RedTests

func RedTests(log string) []RedTest

RedTests reads `gh run view --log-failed` into its failing tests, one per distinct test name, in the order the log names them: each line is `<job>\t<step>\t<time> <text>`, each job's text is go test's output (decide.ParseGateOutput), and a test failing on two jobs is the first job's. A package that failed with no test named (a build failure) is no test, and a log with no go test output has none.

type RedoReq

type RedoReq struct {
	Sel     Sel
	Answers []string
	Who     string
}

RedoReq is the request for redo.

type Refusal

type Refusal struct {
	Key string `json:"id"`
	Why string `json:"why"`
}

Refusal is a card the step did not move, and why.

func PromotionRefusals

func PromotionRefusals(s *Snapshot, rs []AddReq) []Refusal

PromotionRefusals is every card of the adds whose BASE is a protected branch outside the promotion stream (PromotionBaseWhy), none when each may be admitted: the add refuses whole, writing nothing, when any is.

func Rejudge

func Rejudge(pre *Snapshot, verb string, changes []Change) []Refusal

Rejudge holds entries a repair is about to apply one by one to the lifecycle, together, against a fresh read (pre): each entry is its own unit, and an entry left out (one that will be skipped) counts as not happening, so a landing that is skipped satisfies no need. verb is the operation's verb: release may land a sentinel, add may move a primary ready -> waiting. It returns the entries refused, by card id, with why.

func Selected

func Selected(s *Snapshot, q Selector) (ids []string, refused []Refusal)

Selected is the ids of the cards q selects on s, in work order (stream, then score, then id), and a refusal for each id of q.IDs that is no placed card or that the rest of the selector does not hold of.

func StreamArchive

func StreamArchive(s *Snapshot, streams []string) []Refusal

StreamArchive is the rule of stream archive: why each named stream may not be archived, none when every one may. Archiving hides a stream's rows of the work and merge tables (the table layer's row hide) and moves no card: its landed cards stay placed in its landed cell, with their costs and landings, and every fold counts them as before; the headline (where's summary line and drawn footers) counts only the streams on the table, and where --json carries the archived ones' cards beside it (archived_cards, archived_landed). A stream is archived only when it is a row of the work or merge table and every card it holds has landed: no primary or sentinel in any column of its work row but landed, no merge card queued or stuck in its merge row. The machine may be RUNNING. Archiving an archived stream changes nothing. The verb names several and applies all or none.

func StreamRemove

func StreamRemove(s *Snapshot, running bool, streams []string) []Refusal

StreamRemove is the rule of stream remove: why each named stream may not leave the work and merge tables, none when every one may. A stream may leave only while the machine is STOPPED, only when it is a row of the work or the merge table, and only when it holds no card: no primary or sentinel placed in any column of its work row, no merge card in its merge row (its control card, which the row takes with it, is no card it holds). The verb names several and applies all or none: one refused refuses every other with it.

func StreamUnarchive

func StreamUnarchive(s *Snapshot, streams []string) []Refusal

StreamUnarchive is the rule of stream unarchive: a stream comes back only when it is a row of the work or merge table and is archived.

func SyncProblems

func SyncProblems(want []SyncMember) []Refusal

SyncProblems is each member of want a sync cannot write, with why: a name or a width the fleet refuses, or a name twice. nil is none.

type ReleaseCheck

type ReleaseCheck struct {
	Name string
	Bar  string
	Run  func(ReleaseFacts) ReleaseResult
}

ReleaseCheck is one entry of the registry: its name, the bar it holds (stated in docs/SPEC-RELEASE.md, "release check") and the pure function.

type ReleaseFacts

type ReleaseFacts interface {
	Now() time.Time
	Log() []Line
	DealtMax() time.Duration
	Acceptance() Acceptance
	// MergeWindow and MergeP90 are the merge queue's own bars, bound by the
	// verb's --window and --merge-p90 (releasecheck_p90.go).
	MergeWindow() time.Duration
	MergeP90() time.Duration
}

ReleaseFacts is everything a check may read: the clock, the store's log and the sprint's dealt bound, and the acceptance sentinel's facts (releasecheck_acceptance.go). The unit tests fake it with a struct, and the verb binds it to the store.

type ReleaseReport

type ReleaseReport struct {
	Results []ReleaseResult `json:"results"`
	Checks  int             `json:"checks"`
	Failed  int             `json:"failed"`
	Ready   bool            `json:"ready"`
	Summary string          `json:"summary"`
}

ReleaseReport is the verb's result value: the lines are rendered from it and --json is the same value.

func RunReleaseChecks

func RunReleaseChecks(f ReleaseFacts, names []string) (ReleaseReport, error)

RunReleaseChecks runs the named checks (every check when names is empty), in registry order, and summarises: RELEASE OK checks=<n> when all pass, RELEASE NOT READY failed=<n> otherwise. A name that is no check is an error naming the checks there are, and nothing runs.

func (ReleaseReport) ExitCode

func (r ReleaseReport) ExitCode() int

ExitCode is 0 when every check passed and 1 when one failed; a refusal of the arguments is the verb's exit 2.

type ReleaseReq

type ReleaseReq struct {
	IDs         []string
	Reason      string
	Coordinator string
	Answers     []string
	Who         string
}

ReleaseReq is the coordinator releasing reached sentinels, with what it looked at and found. Coordinator is the sprint's coordinator: release is refused for any other actor.

type ReleaseResult

type ReleaseResult struct {
	Name     string `json:"name"`
	OK       bool   `json:"ok"`
	Evidence string `json:"evidence"`
}

ReleaseResult is one check's answer.

func BaseGateGreen

func BaseGateGreen(f ReleaseFacts) ReleaseResult

BaseGateGreen (check 2): the tree gate is green on the base at the stream's last landing, covering the unit and the functional class and the docs and ci packages.

func CardsSettled

func CardsSettled(f ReleaseFacts) ReleaseResult

CardsSettled (check 1): every card of the stream is landed or dropped with a reason, so none is ready, waiting, working, review or merging.

func LandingsPromoted

func LandingsPromoted(f ReleaseFacts) ReleaseResult

LandingsPromoted (check 5): the landings are in dev, or a promotion carrying them is queued since the stream's last landing.

func MergeQueueP90

func MergeQueueP90(f ReleaseFacts) ReleaseResult

MergeQueueP90: over the last MergeWindow, the p90 (nearest rank) of the time each card spent in merging, from the log's work-table moves: entering merging to landing or to leaving the column. A card still merging at now counts with its age now. A card counts when any of its merging overlapped the window, and its age is the whole time it spent merging, so a card left in the queue before the window and still there is not hidden by the window. Above the bar the evidence prints the p90, the count of cards and the oldest card still merging; with no merge in the window it is ok and says n=0.

func NoOpenJudgment

func NoOpenJudgment(f ReleaseFacts) ReleaseResult

NoOpenJudgment (check 6): no open judgment names the stream: no stale, no brief-defect, no conflict, no returned-to-review.

func NoStuckFriend

func NoStuckFriend(f ReleaseFacts) ReleaseResult

NoStuckFriend: no friend was stuck at any moment of the last StuckWindow. Stuck is the deadline rule's own lateness (WorkDeadline, docs/SPEC-SPRINT.md section 1, a friend's card's deadline; the tick's N4 judgment): a friend held a working card past its deadline (FieldFriendDeadline, else DeadlineUnfinished, counted from the card's first take, a take-back counting), or was dealt a card and did not take it past the dealt bound (ReleaseFacts.DealtMax). A friend held down has the unstarted cards taken back (FriendTake), so a ready card on the friend's row is a card of a friend who is up. The spells are replayed from the log's fleet moves alone, so a spell that has ended still counts while it overlaps the window.

func ProseTrue

func ProseTrue(f ReleaseFacts) ReleaseResult

ProseTrue (check 4): the stream's spec sections and help text are true to the code: nova-check links and nocode clean, present tense, no names of people or machines.

func TwoOKReads

func TwoOKReads(f ReleaseFacts) ReleaseResult

TwoOKReads (check 3): every landed card has the ok reads its tier needs at its final head, one for a flash card and two different readers for a heavier one, none accepted on the coordinator's word alone.

func (ReleaseResult) Line

func (r ReleaseResult) Line() string

Line is the check's one printed line: RELEASE CHECK <name> ok|fail <evidence>.

type RelinkReq

type RelinkReq struct {
	Old    []string
	New    string
	Reason string `json:",omitempty"`
	Who    string
}

RelinkReq re-points every waiting card's need of an old id to its twin.

type RepriceReport

type RepriceReport struct {
	Routes       []RepriceRoute `json:"routes"`
	NoTokens     int            `json:"no_tokens"`
	Subscription int            `json:"subscription,omitempty"`
	NoRoute      int            `json:"no_route,omitempty"`
	// RouteGone is the records whose route is no longer in the store, by its name.
	RouteGone map[string]int `json:"route_gone,omitempty"`
	// Cut is the records past their cards' list bound (FieldCostCut): in the totals, with
	// no tokens kept to price them by.
	Cut     int `json:"cut,omitempty"`
	Cards   int `json:"cards"`   // primaries rewritten
	Streams int `json:"streams"` // control cards rewritten
}

RepriceReport is the reprice's account: each route's, by name, and the records it left.

type RepriceReq

type RepriceReq struct {
	Routes []string `json:"routes,omitempty"`
	Since  string   `json:"since,omitempty"`
	Who    string   `json:"who,omitempty"`
}

RepriceReq is one reprice: the routes (none is every route) and the earliest end (RFC3339, "" for every record).

type RepriceRoute

type RepriceRoute struct {
	Route        string `json:"route"`
	AsOf         string `json:"price_as_of"`
	Records      int    `json:"records"`
	Changed      int    `json:"changed"`
	OldPredicted string `json:"old_predicted_usd"`
	NewPredicted string `json:"new_predicted_usd"`
	OldCharged   string `json:"old_usd"`
	NewCharged   string `json:"new_usd"`
	// HeldByActual counts the records whose charged figure is the harness's own cost.
	HeldByActual int `json:"held_by_actual,omitempty"`
}

RepriceRoute is what the reprice did to the records one route priced: the sheet's price_as_of it used, the records it read and the ones whose prediction moved, and the sums before and after, predicted and charged (each record's actual where reported, else its predicted), exact decimals, "0" for none.

func (RepriceRoute) Line

func (rr RepriceRoute) Line() string

Line is the route's log line: the price_as_of it used, the records, and the sums.

type ResetMark

type ResetMark struct {
	At        time.Time              `json:"at"`
	Epoch     uint64                 `json:"epoch"`
	By        string                 `json:"by,omitempty"`
	Reason    string                 `json:"reason"`
	Rows      map[string]ResetRow    `json:"rows,omitempty"`
	Streams   map[string]ResetStream `json:"streams,omitempty"`
	TotalCost string                 `json:"total_cost,omitempty"`
	// Op is the caller's operation id the mark was written under (--op): the same id again
	// returns this mark and writes nothing.
	Op string `json:"op,omitempty"`
}

ResetMark is a stats reset: when, by whom and why, in which epoch, and the counters at the mark: each fleet row's (machines' and friends' rows alike, FriendRow), each stream's, and the epoch's total cost (every stream's TotalCost summed).

func ResetMarkOf

func ResetMarkOf(s *Snapshot, at time.Time, by, reason string) ResetMark

ResetMarkOf is the mark of the sprint s at at: every fleet row's done cells, every stream's landed cost and count (StreamBases) and its spend (StreamTierCosts, the figures the tick counts for the where view), and the epoch's total.

func (*ResetMark) FleetSince

func (m *ResetMark) FleetSince(t ntable.Table) ntable.Table

FleetSince is the fleet table as the where view draws it since the mark: each row the mark knows has its ok and failed cells less the mark's, never below zero, so the table's done (ok+failed) and ok% (ok over ok+failed) formulas count the cards since the mark; a row the mark does not know reads as before. Nothing is written: the cells are the view's.

func (*ResetMark) LandedSince

func (m *ResetMark) LandedSince(t ntable.Table, in func(ntable.Row) bool) int64

LandedSince is the cards landed since the mark over the work table's rows that in says to count: each stream's landed count less the mark's, never below zero; a stream the mark does not know counts every landed card (it had none at the mark).

func (*ResetMark) LandedSinceBy

func (m *ResetMark) LandedSinceBy(t ntable.Table, in func(ntable.Row) bool) map[string]int64

LandedSinceBy is LandedSince stream by stream: every row in says to count, by its key.

func (*ResetMark) Later

func (m *ResetMark) Later(t time.Time) bool

Later is whether the mark is later than t: a reset after the last tidy of a kind is where that kind's figures count from, and a tidy after the reset is.

func (*ResetMark) Rebase

func (m *ResetMark) Rebase(rows []TidyRow)

Rebase is the mark after a tidy took cards off the done cells of rows it knows (the tidy's rows, sprint.TidyDone): each row's ok and failed at the mark less the moved cards of that cell that finished before the mark (TidyCard.Finished; a card with no stamp is history, before it), never below zero. A moved card that finished after the mark is not in the mark's counters: it leaves the row's done since the mark, as the tidy, later, says. A tidy does not move the oldest cards first (TidyKept keeps a card whose primary has not landed, whatever its age), so the rule is by each card's stamp, never by count. The row's done since the mark is then the cards finished since the mark still on the row. tla/StatsReset.tla, TidyMove and TidyEnd.

type ResetRow

type ResetRow struct {
	OK     int `json:"ok"`
	Failed int `json:"failed"`
}

ResetRow is one fleet row's done cells at the mark: its ok and failed counts.

func (ResetRow) Done

func (r ResetRow) Done() int

Done is the row's done at the mark, ok and failed together (the table's done formula).

type ResetStream

type ResetStream struct {
	Cost       string            `json:"cost,omitempty"`
	Landed     int               `json:"landed"`
	TotalCost  string            `json:"total_cost,omitempty"`
	WorkCost   string            `json:"work_cost,omitempty"`
	ReadCost   string            `json:"read_cost,omitempty"`
	CostByTier map[string]string `json:"cost_by_tier,omitempty"`
}

ResetStream is one stream's figures at the mark: the control card's exact landed cost and the landed count (the work table's cost cell and per landed count from them, as a tidy's StreamBase), and its spend as the where view showed it (TierCosts: the total, the work and the reads, and by tier, dollars and cents).

func (ResetStream) Base

func (r ResetStream) Base() StreamBase

Base is the stream's landed cost and count at the mark, as a tidy's base names them.

type ResolveReq

type ResolveReq struct {
	Sel
	Who string
}

ResolveReq moves waiting primaries whose needs have landed.

type ResumeReq

type ResumeReq struct {
	Stream  string
	Did     string // what the coordinator did
	Answers []string
	Who     string
}

ResumeReq moves a stopped stream again.

type ReturnReq

type ReturnReq struct {
	Sel
	Reason  string
	Answers []string
	Who     string
	// Rule, when set, is the rule that returns the cards (rules.go, the conflict rule): each
	// is marked to be redone on the tip (FieldRuleRedo, at its attempt), and the stopped
	// stream's judgment records the answer.
	Rule string `json:",omitempty"`
}

ReturnReq is the coordinator sending merging primaries back to review.

type ReworkCard

type ReworkCard struct {
	Fix, Tier  string            `json:",omitempty"`
	Friend     bool              `json:",omitempty"`
	Set        map[string]string `json:",omitempty"`
	Rule, Said string            `json:",omitempty"`
}

ReworkCard is one card's own rework (ReworkReq.PerCard): its fix and tier, Friend to make it a friend's card (FieldWho, WhoFriend: the tick deals it to a friend), the fields Set writes on the primary, and the Rule that answers, with what it Said.

type ReworkReq

type ReworkReq struct {
	Sel
	Fix     string
	Answers []string
	Who     string
	// Tier, when set, is the tier every later deal of the card draws its route from
	// (route.go, cardTier): written on the primary as FieldTier, over its brief's line 1.
	Tier string `json:",omitempty"`
	// PerCard is each card's own fix, tier and fields, over Fix and Tier: the tick's rule
	// answers rework many cards in one step, each its own way (rules.go). A card that names
	// a Rule records every judgment the rework closes on it as answered by that rule.
	PerCard map[string]ReworkCard `json:",omitempty"`
}

ReworkReq is the coordinator sending primaries back with a fix. With no fix, each primary's fix is its own: the finding of its broken read, or the report of its failed work; a primary with neither is refused by name.

type Route

type Route struct {
	Name     string `json:"name"`
	Tier     string `json:"tier"`
	Provider string `json:"provider"`
	Model    string `json:"model"`
	// Harness is the harness a card on it runs under (internal/harness: opencode, the
	// default, or a headless program of the heavy tier); the member launches by it.
	Harness string `json:"harness,omitempty"`
	Tokens  int    `json:"tokens"` // 0 is unmetered
	// USD is the route's dollar budget per card, a canonical decimal ("0.5"), "" for none:
	// the harness's reported cost at which native stops the card (nova-tools #5094).
	USD      string `json:"usd,omitempty"`
	Deadline int    `json:"deadline"` // seconds
	Enabled  bool   `json:"enabled"`
	// First is the route's first field. A route with it set is drawn before the
	// others of its tier (preferFirst; docs/SPEC-SPRINT.md, the deal).
	First bool `json:"first"`
	// Prices is the route's price sheet (cardcost.PricesOf), what a card that ran on it
	// is priced by (cost.go); every price "" when the route has none.
	Prices cardcost.Prices `json:"prices"`
}

Route is one route of a model tier as the store holds it (config.RouteKey).

type RouteRest

type RouteRest struct {
	Route      string
	Provider   string
	At, Until  time.Time
	Cards      []string
	Cause      string
	Balance    float64
	HasBalance bool
	Why        string
}

RouteRest is a rest: rule 3's of a route (Route, one line of PropRule3Rest) or a provider's (Provider, PropProviderRest; read through RouteRests it names each route of the provider too): when it began, when it ends (for a rest that has ended, when it ended), the cards whose takes rested it, and why: the cause (RestNoResult, rule 3's; RestCredit, RestAuth and RestBalance, the provider's, provider_funds.go) and, for the provider's, its words. A provider's rest a refused take began keeps the balance the poll last read then (Balance, HasBalance false when there was none known), the mark a payment is seen against (balance.go).

func RestsDue

func RestsDue(s *Snapshot) []RouteRest

RestsDue is the rests the rule writes now: each route of the store not resting at s.Now whose window (its last RouteRestWindow ended takes after its last rest began, in the order they ended) holds RouteRestAfter or more the provider failed transiently, rested from s.Now for RouteRestFor, naming those takes' cards (a take that left no result never counts: tla/RouteRest.tla); and each provider a refusal rests (providerRestsDue: one rest, Route "", over rule 3's on its routes); the providers' first, then the routes', in name order.

func (RouteRest) Funds

func (r RouteRest) Funds() bool

Funds says the rest is the provider's want of funds: a take it refused for credit.

func (RouteRest) Mark

func (r RouteRest) Mark() time.Time

Mark is the moment the rules count ends after: the rest's end, or for a retired rule's rest with no time (a balance poll's, open), when it began: no take was dealt on it while it held, and a take launched after it began is the provider's to judge again (TestARetiredRestKeepsItsMark: an old 402 never rests the provider again on deploy).

func (RouteRest) Open

func (r RouteRest) Open() bool

Open says the rest has no time: it holds until the provider is paid.

func (RouteRest) Out

func (r RouteRest) Out() bool

Out says the provider is out of credit (RestCredit): the one rest that counts toward stopping the sprint (AllOutOfCredit). A provider low on funds still has money, and the sprint never stops while one does.

func (RouteRest) Refused

func (r RouteRest) Refused() bool

Refused says the provider is out of credit because it refused a take (the rest names the take's card), not because a balance read at or under zero: OpenRouter refuses a request whose estimated cost the balance cannot cover, so a provider that refuses can still read a small balance over zero, and only a payment seen or funded ends this rest (balance.go).

func (RouteRest) Resting

func (r RouteRest) Resting(now time.Time) bool

Resting says the rest holds at now. A retired rule's rest never holds (Retired), though it stays the history mark the rules count after (Mark).

func (RouteRest) Retired

func (r RouteRest) Retired() bool

Retired says the rest was written by a rule the machine no longer keeps, so it holds no route: rule 3's (no result), a balance poll's (low on funds, or out of credit read off a balance at or under zero, which names no refused card). Only a provider-typed failure or the coordinator rests a route (tla/RouteRest.tla, RestOnlyByProviderOrCoordinator).

func (RouteRest) Said

func (r RouteRest) Said() string

Said is the rest's reason as a line says it: its words, else its cause.

func (RouteRest) UntilSaid

func (r RouteRest) UntilSaid() string

UntilSaid is when the rest ends as a line says it: its time, until the provider is paid, or, for the coordinator's rest with no time, until woken (routes wake).

type RouteRestReq

type RouteRestReq struct {
	Target string
	Reason string
	Until  time.Time
	Who    string
}

RouteRestReq is the coordinator's rest of a provider's routes or of one route: Target names a provider (as the routes name it) or a route; Until is zero for a rest until woken.

type RouteStat

type RouteStat struct {
	Route    Route  `json:"route"`
	Pinned   bool   `json:"pinned,omitempty"`
	Attempts int    `json:"attempts"`
	OK       int    `json:"ok"`
	Failed   int    `json:"failed"`
	Provider int    `json:"provider_failures"`
	MeanWall string `json:"mean_wall"` // taken to finished, over the finished; "-" when none
	// RestedUntil is when the route's rest ends while it rests (rule 3, route_rest.go):
	// RFC3339, "" when it does not rest; `routes` fills it at its clock.
	RestedUntil string `json:"rested_until,omitempty"`
	// RestedFor is why it rests (RouteRest.Cause and its words), and Balance and
	// BalanceAt its provider's balance as the balance poll last read it (balance.go):
	// dollars and cents rounded up, or "unknown"; "" before any read.
	RestedFor string `json:"rested_for,omitempty"`
	Balance   string `json:"balance,omitempty"`
	BalanceAt string `json:"balance_at,omitempty"`
}

RouteStat is one route's record over the work cards dealt on it. A pinned model is a row of its own, Pinned, named pin:<model>.

func RouteStats

func RouteStats(routes []Route, fleet *Table) []RouteStat

RouteStats is every route's record over the fleet table's work cards, the routes in name order, then each pinned model (pin:<model>) and each route the store no longer holds, as the cards name them, in the order first met.

type RouteTakes

type RouteTakes struct {
	Route    string  `json:"route"`
	Takes    int     `json:"takes"`
	OK       int     `json:"ok"`
	Failed   int     `json:"failed"`
	Provider int     `json:"provider_failures"`
	RunWall  Measure `json:"run_wall"`
}

RouteTakes is one route's takes, work and read, as the primaries' cost records hold them (CardCostOf): OK came back with its answer (a work take finished ok, a read with its verdict, ok or broken), Provider ended with no work by the provider or the child (provider failure, no result), Failed every other end (a work take finished failed, a read returned unread). A launch refused at staging ran nothing on the route and is not a take of it; a take whose record names no route (a read returned unpriced) counts on its card's route. RunWall is over the takes' usage walls.

type RouteWakeReq

type RouteWakeReq struct {
	Target string
	Reason string
	Who    string
}

RouteWakeReq is the coordinator's end of the rest that holds a provider or a route.

type RowAdd

type RowAdd struct{ Table, Row string }

RowAdd is a row the step needs before its manifests: rows are declared by the table layer's row verb, not by a batch.

type RuleAnswer

type RuleAnswer struct {
	Judgment string `json:"judgment"`
	Type     string `json:"type"`
	Subject  string `json:"subject"`
	Card     string `json:"card,omitempty"`
	Rule     string `json:"rule,omitempty"`
	Act      string `json:"act"`
	Why      string `json:"why"`
	Tier     string `json:"tier,omitempty"`
	Friend   bool   `json:"friend,omitempty"`
	// Waited is how long the judgment has been open.
	Waited string `json:"waited"`
	// contains filtered or unexported fields
}

RuleAnswer is what the rules do with one open judgment on one subject.

func RuleAnswers

func RuleAnswers(s *Snapshot, r TickReq) []RuleAnswer

RuleAnswers is what the rules do with every open judgment, one line per judgment and subject, in the order they are open: the rule and its act, or left (it needs a mind) or off (its rule is turned off), with why. It is pure: the tick's rule parts apply it (TickRules) and `rules` prints it.

func (RuleAnswer) Answers

func (a RuleAnswer) Answers() bool

Answers says the answer acts: a rule answers it and the rule is on.

type ScoreReq

type ScoreReq struct {
	Stream string
	Scores []CardScore
	Who    string
}

ScoreReq is a batch's scores, as land reports them after the batch landed.

type SeatAgreement

type SeatAgreement struct {
	Check  string `json:"check"`
	Key    string `json:"key"`
	Record string `json:"record"`
	Server string `json:"server"`
	Config string `json:"config"`
	Holder string `json:"holder"`
	Drift  string `json:"drift,omitempty"`
}

SeatAgreement is the check's finding: the four values, the seat's holder they are held to (the record's, else the key's while the seat has no record), and Drift, how they disagree, each with its fix ("" when they agree). Record is "" with no record, Server "" with no fresh server's record, Config "" when the row names no coordinator: a value that names no one is not a disagreement.

func CheckSeatAgreement

func CheckSeatAgreement(key, record, server, config string) SeatAgreement

CheckSeatAgreement is the finding on the four values: the key, the record and the server as SeatDrift holds them (seat --repair for the key, the server's NOVA_SPRINT_ACTOR line for the server), and the config row against the holder (the nova-config sprint set line for the row).

func FsckSeat

func FsckSeat(ctx context.Context, key, record, server string, read ConfigCoordinator) (SeatAgreement, error)

FsckSeat is the check with the config row read by read; key, record and server are as store.SeatCheck reads them.

func (SeatAgreement) Line

func (f SeatAgreement) Line() string

Line is the finding as fsck prints it: OK or DRIFT, the check and the four values, and how they disagree when they do.

type SeatChange

type SeatChange struct {
	Holder     string    `json:"holder"`
	Generation uint64    `json:"generation"`
	From       string    `json:"from"`
	At         time.Time `json:"at"`
	By         string    `json:"by"`
	Taken      bool      `json:"taken,omitempty"`
	ApprovedBy string    `json:"approved_by,omitempty"`
	Reason     string    `json:"reason"`
}

SeatChange is one change of the seat, as the seat's record keeps it. Generation is the seat's generation after the change (FirstSeatGeneration is the seat no change has moved; every accepted change takes the next): the fence of the coordinator's observations of the friends (ObserveFriend).

type SeatCheckLine

type SeatCheckLine struct {
	Thing  string   `json:"thing"`
	Up     bool     `json:"up"`
	Facts  []string `json:"facts"`
	Remedy string   `json:"remedy,omitempty"`
}

SeatCheckLine is one line of the check: the thing, up or DOWN, its facts in order, and the remedy, a command, on a DOWN line.

func (SeatCheckLine) String

func (l SeatCheckLine) String() string

String is the line as printed: MACHINERY <thing> OK|DOWN fact... [remedy="<command>"].

type SeatCheckMeasures

type SeatCheckMeasures struct {
	Server    ServerM           `json:"server"`
	Store     StoreM            `json:"store"`
	Fleet     []MemberM         `json:"fleet"`
	Friends   []FriendM         `json:"friends"`
	Readers   ReadersM          `json:"readers"`
	Dashboard DashM             `json:"dashboard"`
	Bus       BusM              `json:"bus"`
	Inbox     InboxM            `json:"inbox"`
	Queue     QueueM            `json:"queue,omitempty"`
	Versions  VersionsM         `json:"versions,omitempty"`
	Push      PushM             `json:"push,omitzero"`
	Host      string            `json:"host"`
	Errs      map[string]string `json:"errs,omitempty"`
}

SeatCheckMeasures is everything the probes measured, in one struct so a test or command can evaluate any state of the machinery.

type SeatCheckReport

type SeatCheckReport struct {
	At       time.Time         `json:"at"`
	Lines    []SeatCheckLine   `json:"lines"`
	Down     int               `json:"down"`
	ExitCode int               `json:"exit_code"`
	Measures SeatCheckMeasures `json:"measures"`
}

SeatCheckReport is the check report: the lines in order, how many are DOWN, and the process exit code (0 all up, 1 on any DOWN line).

func JudgeSeatCheck

func JudgeSeatCheck(m SeatCheckMeasures, now time.Time) SeatCheckReport

JudgeSeatCheck turns the measures into a SeatCheckReport according to docs/SPEC-SPRINT.md.

func (SeatCheckReport) JSON

func (r SeatCheckReport) JSON() string

JSON is the report as --json prints it.

func (SeatCheckReport) Summary

func (r SeatCheckReport) Summary() string

Summary is the last line: MACHINERY OK n=<lines> or MACHINERY DOWN n=<down> of=<lines>.

func (SeatCheckReport) Text

func (r SeatCheckReport) Text() string

Text is the report as printed: one line per check, then the summary line.

type SeatInstaller

type SeatInstaller struct {
	Dir          string
	Load, Unload func(path string) error
}

SeatInstaller writes units into Dir; Load loads (or loads again) the unit at a path and Unload unloads it.

func (SeatInstaller) Install

func (in SeatInstaller) Install(u SeatUnit) (SeatResult, error)

Install writes the unit into the installer's directory (whole, beside it first, then renamed into place) unless the file there is already this text, and loads it either way, so an install after the unit was unloaded by hand starts the loop again. A unit whose load fails stays written; the error says the load.

func (SeatInstaller) InstallFriendSync

func (in SeatInstaller) InstallFriendSync(u FriendSyncUnit) (SeatResult, error)

InstallFriendSync writes the friend sync loop's unit into the installer's directory (whole, beside it first, then renamed into place) unless the file there is already this text, and loads it either way, as Install does the push loop's.

func (SeatInstaller) InstallUnit

func (in SeatInstaller) InstallUnit(u ServiceUnit) (SeatResult, error)

InstallUnit writes the unit and loads it, as Install does the push loop's.

func (SeatInstaller) Uninstall

func (in SeatInstaller) Uninstall(goos string) (SeatResult, error)

Uninstall unloads the unit and removes its file; with no file there it does nothing, and says so by Changed false.

func (SeatInstaller) UninstallFriendSync

func (in SeatInstaller) UninstallFriendSync(goos string) (SeatResult, error)

UninstallFriendSync unloads the friend sync loop's unit and removes its file; with no file there it does nothing, and says so by Changed false.

func (SeatInstaller) UninstallUnit

func (in SeatInstaller) UninstallUnit(k UnitKind, goos string) (SeatResult, error)

UninstallUnit unloads the kind's unit and removes its file.

type SeatRepairReq

type SeatRepairReq struct {
	Who, Reason, Owner string
}

SeatRepairReq asks for the coordinator key to be written from the seat's record. Owner is the sprint's owner ("" when it names none).

type SeatReq

type SeatReq struct {
	To, Who, Reason   string
	Take              bool
	ApprovedBy, Owner string
}

SeatReq asks for the seat to move to To. Owner is the sprint's owner ("" when it names none); Take with ApprovedBy is a take, else the seat is given.

type SeatResult

type SeatResult struct {
	Path    string `json:"path"`
	Changed bool   `json:"changed"`
}

SeatResult is what install or uninstall did: the unit's path, and whether the file there was written or removed.

type SeatUnit

type SeatUnit struct {
	OS, Exe, Redis, Server, Log string
}

SeatUnit is the push loop as a service: the binary, the store it reads (Redis, an address; else Server, the sprint's server), and the file its lines go to (launchd; systemd keeps them in its journal).

func (SeatUnit) Args

func (u SeatUnit) Args() []string

Args is the push loop's command line, the binary first: inbox --wait --push seat, on the store the unit names (docs/SPEC-SPRINT.md, "Handing over the seat").

func (SeatUnit) Text

func (u SeatUnit) Text() (string, error)

Text is the unit's file: a launchd plist, or a systemd user unit.

type SeatWaits

type SeatWaits struct {
	Judgments  int       `json:"judgments"`
	Overdue    int       `json:"overdue"`
	OldestID   string    `json:"oldest_id,omitempty"`
	OldestType string    `json:"oldest_type,omitempty"`
	OldestAt   time.Time `json:"oldest_at,omitzero"`
	Level      int       `json:"level"`
}

SeatWaits is what waits on the seat: the open judgments (the sprint is done has no due time and is not counted), those past their due time, and the oldest, with its age; and the level the pass escalated the judgments late on the coordinator to (BehindLevel, on its open NCoordinatorBehind).

func SeatWaitsOf

func SeatWaitsOf(s *Snapshot, r TickReq) SeatWaits

SeatWaitsOf is the judgments waiting on the seat at s.Now.

func (SeatWaits) Line

func (w SeatWaits) Line(now time.Time) string

Line is the seat's waits as one line.

type Sel

type Sel struct {
	IDs    []string
	Stream string
	Col    string // a column of the verb's table: only cards placed there
	Limit  int
	Only   []string
}

Sel is the set a verb acts on: ids, or a stream, or the first n, in work order. Only restricts the step to the keys an earlier attempt of the same invocation chose, so a step retried on fresh state never picks new cards.

type Selector

type Selector struct {
	Stream string `json:",omitempty"` // its stream
	// Who is the worker its WHO line names (FieldWho, a hard pin's only. prefix ignored):
	// friend.<name> (or the name alone) for one friend, friend for any friend's card, none
	// for a card that names no friend.
	Who string `json:",omitempty"`
	// State is ready, waiting (not held), held (IsHeld) or merging.
	State string `json:",omitempty"`
	// IDs is the cards an --ids-file names; one that is no placed card is refused.
	IDs []string `json:",omitempty"`
	// Sentinels takes a stream's sentinels with its primaries (release).
	Sentinels bool `json:",omitempty"`
}

Selector is the cards a batch verb acts on: every placed primary of the work table that each field given holds of, landed cards never.

func (Selector) Check

func (q Selector) Check() string

Check is why the selector does not read, "" when it does.

func (Selector) Given

func (q Selector) Given() bool

Given says the selector names anything: a batch verb with none is refused.

func (Selector) Selects

func (q Selector) Selects(c *Card) bool

Selects says the selector holds of c.

func (Selector) Words

func (q Selector) Words() string

Words is the selector as the command line gives it, for the step's lines.

type SelftestLandOption

type SelftestLandOption func(*selftestLandConfig)

SelftestLandOption configures SelftestLand.

func WithSelftestBinary

func WithSelftestBinary(bin string) SelftestLandOption

WithSelftestBinary sets the binary to test with selftest land.

func WithSelftestOutput

func WithSelftestOutput(stdout, stderr io.Writer) SelftestLandOption

WithSelftestOutput sets the stdout and stderr destinations.

func WithSelftestScratch

func WithSelftestScratch(dir string) SelftestLandOption

WithSelftestScratch sets the scratch directory for selftest land.

type SentinelSetReq

type SentinelSetReq struct {
	ID    string
	Needs []string
	Who   string
}

SentinelSetReq replaces a sentinel's needs (sentinel set <id> --needs a,b).

type SeriesLastHour

type SeriesLastHour struct {
	Friends int `json:"friends"`
	Fleet   int `json:"fleet"`
}

type SeriesTotals

type SeriesTotals struct {
	Friends int `json:"friends"`
	Fleet   int `json:"fleet"`
	Unknown int `json:"unknown"`
}

type ServerM

type ServerM struct {
	Addr   string `json:"addr"`
	Self   bool   `json:"self,omitempty"`
	Err    string `json:"err,omitempty"`
	Millis int64  `json:"ms"`
	PID    int    `json:"pid,omitempty"`
}

ServerM is the sprint's server as measured: the address the environment names (NOVA_SPRINT_SERVER), Self when the measure ran in the server's own process, the error of one verb round trip, its time, and the pid of a listener on the address when local (0 unknown).

type ServerSwitchOptions

type ServerSwitchOptions struct {
	Binary   string        // path to candidate binary
	Target   string        // path to target binary (default: os.Executable() or NOVA_SPRINT_SERVER_BIN)
	Rollback bool          // keep previous binary and roll back on land failure in window
	Window   time.Duration // rollback window duration (default DefaultRollbackWindow)
	Now      func() time.Time
	Stdout   io.Writer
	Stderr   io.Writer
}

ServerSwitchOptions configures ServerSwitch.

type ServiceUnit

type ServiceUnit = units.ServiceUnit

type SetReq

type SetReq struct {
	ReworkPriority   string   `json:",omitempty"`
	Streams          []string `json:",omitempty"`
	ReadTier         string   `json:",omitempty"`
	DealtMax         string   `json:",omitempty"`
	Attempts         string   `json:",omitempty"`
	FriendIdle       string   `json:",omitempty"`
	FriendStallAfter string   `json:",omitempty"`
	FriendStallStep  string   `json:",omitempty"`
	// Reason, with Streams and ReadTier, is why the read tier is set, recorded on the
	// stream's control card (FieldReadTierReason); Answers the judgments this answers.
	Reason  string   `json:",omitempty"`
	Answers []string `json:",omitempty"`
	// LandProtected is the streams' mark: the repositories whose protected branches
	// they land on (FieldLandProtected, docs/SPEC-SPRINT.md section 7).
	LandProtected string `json:",omitempty"`
	Release       string `json:",omitempty"`
	// Prose is the streams' prose globs (FieldProse): comma separated, default or none
	// takes them off.
	Prose string `json:",omitempty"`
	// The backlog alarms' thresholds (alarms.go): a count, a percent, on, or off.
	AlarmReview  string `json:",omitempty"`
	AlarmMerging string `json:",omitempty"`
	AlarmFleet   string `json:",omitempty"`
	AlarmReady   string `json:",omitempty"`
	GoLanes      string `json:",omitempty"` // the Go lanes of every machine (PropGoLanes, section 18)
	// The drift alarm's thresholds of the base ahead of dev (drift.go): commits and hours,
	// whole numbers from 1, or default.
	DriftCommits string `json:",omitempty"`
	DriftHours   string `json:",omitempty"`
	// Fleet and Friends are the work switches (PropFleet, PropFriends): on or off.
	Fleet   string `json:",omitempty"`
	Friends string `json:",omitempty"`
	// FleetTiers and FriendsTiers are the tiers each side may take (PropFleetTiers,
	// PropFriendsTiers): tiers comma separated, or all.
	FleetTiers   string `json:",omitempty"`
	FriendsTiers string `json:",omitempty"`
	// ReadCards turns read cards on or off (PropReadCards, read_cards.go): on, off, or
	// default (off).
	ReadCards string `json:",omitempty"`
	// Reads is the reads every card in review needs (PropReadsNeeded): 0, 1, 2, or
	// default (each card's own rule, ReadsNeeded).
	Reads string `json:",omitempty"`
	// Base, with Streams, re-points the stream's cards that are not yet dealt and
	// those queued to merge to another base branch (stream set --base).
	Base string `json:",omitempty"`
	// BaseChecked is the cards Base re-points, as the verb read and checked them
	// at the base (StreamSetBaseChecks): Set re-points exactly these and refuses
	// whole, nothing written, when the snapshot it reads holds other cards or
	// briefs, so no brief is rewritten without its PATHS held to the base. It is
	// no part of the verb's arguments (its value changes as the stream does): the
	// store's operation id digests the caller's words alone.
	BaseChecked []StreamSetBaseCheck `json:"-"`
	Who         string
}

SetReq is the coordinator's settings: with Streams, each stream's read tier, attempt cap, release, or protected-branch mark; without, the sprint's dealt bound, read tier and attempt cap (brief_bound.go, AttemptsCap). An empty value leaves that setting as it is; ReadTierDefault takes one off.

type Shape

type Shape struct {
	Streams []string          `json:"streams"`
	Readers []string          `json:"readers"`
	Members []string          `json:"members"`
	Status  map[string]string `json:"status"` // member -> up or down
	Held    []string          `json:"held,omitempty"`
	// HeldBy is who made a member's hold when it was not the coordinator
	// (held_by, fleet_sync.go).
	HeldBy map[string]string `json:"held_by,omitempty"`
	// Width is each member's width its control card names (width.go); a
	// member with the default is not in it.
	Width map[string]string `json:"width,omitempty"`
}

Shape is what a sprint keeps across a clear: its streams, its readers, and its fleet members with their status and the coordinator's holds. The tables, their columns and the view are the table layer's and carry across by themselves.

func ShapeOf

func ShapeOf(s *Snapshot) Shape

ShapeOf is a snapshot's shape.

type Snapshot

type Snapshot struct {
	Now   time.Time
	Epoch uint64 // the sprint's epoch the tables were read at
	// Prefix is the deployment's prefix the tables were read under (Names.Prefix): a branch
	// a step names (BranchOf) carries it. "" for a snapshot built by hand.
	Prefix  string
	Cleared time.Time // when that epoch began (the last clear); zero for the first
	// Coordinator is the sprint's coordinator: judgments are theirs to
	// answer. Actor is who runs the step (a request's Who, when it names
	// none).
	Coordinator, Actor string
	// SeatGeneration is the seat's generation as read with the coordinator
	// (seat.go): FirstSeatGeneration until the seat first moves.
	SeatGeneration              uint64
	Work, Readers, Merge, Fleet *Table
	Open                        []Open
	// Answered is who answered each judgment the step names in --answers that
	// is no longer open (the store's record, read for the ids the step asks
	// about; absent for an id never a judgment or still open): one the machine
	// answered is a note, not a refusal (answered).
	Answered map[string]string
	// Acked is the tick's conditions the coordinator acknowledged, held
	// while they hold (Acknowledged).
	Acked []Open
	// QueueLen is the length of the work table's queue as the step read it
	// (queue.go): changes steps planned while the machine ran, which the next
	// tick's pump applies. Queue is the queue itself, read only by the pump
	// that drains it.
	QueueLen int
	Queue    []QueuedChange
	// Held is the work cards a change queued after the pump's drain names,
	// read with a pump part's step: the part leaves them for the next tick's
	// pump (LeaveQueued), and a part that plans a card's move reads it to
	// plan none for them (TickAccept), so its notes and its stream's state
	// are planned for the cards it moves only. nil is none.
	Held map[string]bool
	// Routes are the model tiers' routes nova-config applied to the store,
	// read by a step that deals (route.go); nil is none.
	Routes []Route
	// Tiers are the tiers' route arrays nova-config applied (the tier kind), by
	// tier, read with the routes; a tier with none deals from its enabled routes
	// in name order (tierArray).
	Tiers map[string][]string
	// DecideBounce and DecideReview are the sprint row's bars on a decide read's
	// p(defect) as nova-config applied them (sprint:decide_bounce,
	// sprint:decide_review), read with the routes; both "" is no decide read
	// (steps_review.go, decideFields; docs/SPEC-SPRINT.md section 6).
	DecideBounce, DecideReview string
	// DecideScoreBar is the sprint row's bar on a landed diff's score
	// (sprint:decide_score_bar), read with the routes: a batch whose cards' top class
	// meets it raises a scored-low judgment (steps_score.go; docs/SPEC-SPRINT.md section
	// 7, the landed score); "" (the row's default) records the scores and raises none.
	DecideScoreBar string
	// DecideAttemptNoResult, DecideAttemptNothingToDo and DecideGrade are the sprint row's
	// bars of nova-decide's layer 2 (sprint:decide_attempt_no_result,
	// sprint:decide_attempt_nothing_to_do, sprint:decide_grade), read with the routes: the
	// deal writes the two attempt bars on each work card it cuts (decide.go), and starts a
	// card graded pro at or above the grade bar on pro; "" is no bar (docs/SPEC-SPRINT.md
	// sections 2 and 5).
	DecideAttemptNoResult, DecideAttemptNothingToDo, DecideGrade string
	// DecideGateFlaky and DecideGatePreexisting are the sprint row's bars on a failed
	// gate's decisions (sprint:decide_gate_flaky, sprint:decide_gate_preexisting), read
	// with the routes; the deal writes them on every work card (gateFields), and both ""
	// is no gate decision (docs/SPEC-SPRINT.md section 5, the gate verdict).
	DecideGateFlaky, DecideGatePreexisting string
	// RulesOff is the rules the machine does not answer judgments by (nova-config's sprint
	// row, answer_rules_off), read with the routes (docs/SPEC-SPRINT.md section 8, answered by
	// rule; rules.go).
	RulesOff []string
	// ReaderStates is each reader's state as the store derives it (ReaderState:
	// up, away or down), read by a step that asks (docs/SPEC-SPRINT.md section
	// 6); nil is none read, and every reader is held up.
	ReaderStates map[string]string
	// Friends is each friend the deal may give a friend's card to, or whose delivery
	// mode is consulted by friendNext (FriendSeat); nil is none.
	Friends []FriendSeat
	// Running says the machine was RUNNING as the step read the sprint: its
	// pump accepts a primary with the ok reads it needs, so no step opens a "ready to
	// accept" judgment for it ("accept is mechanical").
	Running bool
	// contains filtered or unexported fields
}

Snapshot is the observed pre-state of a step: the clock reading the step runs at (given, never read), the tables it loaded, and the open judgment notifications. A table the step did not load is nil.

func WithQueue

func WithQueue(s *Snapshot, q []QueuedChange) *Snapshot

WithQueue is the snapshot as the pump will leave its work table once it has drained q: every change applied in memory, in the queue's order, the cards and the properties. The snapshot's other tables are shared, not copied. A change the drain would refuse is left out, as the drain leaves it out.

func (*Snapshot) AttemptsCap

func (s *Snapshot) AttemptsCap(stream string) int

AttemptsCap is how many attempts one brief may run in the stream: the stream's setting, else the sprint's, else AttemptsDefault.

func (*Snapshot) DealTier

func (s *Snapshot) DealTier(c *Card) string

DealTier is the one tier resolution of a card every friend decision reads (docs/SPEC-SPRINT.md section 1, "One tier for every friend decision", friend-deal-one-tier-bb.w2): the friends' deal, the level, the take back of a re-tiered card (retierTakeBacks) and the packet's tier (DealtTier, through the primary's tier field) all call it, so no two of them can disagree about a card. It is the tier a deal draws (dealTierOf), and the dealer's default, flash, when there is no primary.

func (*Snapshot) DealtMax

func (s *Snapshot) DealtMax() time.Duration

DealtMax is the dealt bound the tick holds a work card dealt and never taken to: the sprint's setting, else DealtMaxDefault.

func (*Snapshot) DriftCommits

func (s *Snapshot) DriftCommits() int

DriftCommits and DriftHours are the base-ahead thresholds: the sprint's settings (set --drift-commits, --drift-hours), else the defaults.

func (*Snapshot) DriftHours

func (s *Snapshot) DriftHours() int

DriftHours is the hours threshold (DriftCommits).

func (*Snapshot) FleetOff

func (s *Snapshot) FleetOff() bool

FleetOff says the fleet's work is switched off (nova-sprint set --fleet off): the deal hands no work card to a machine, and the fleet's idle alarms are not raised; the fleet's readers still read.

func (*Snapshot) FleetTakes

func (s *Snapshot) FleetTakes(tier string) bool

FleetTakes says the deal may hand the fleet a card of the tier (set --fleet-tiers): a machine's work card's tier, or a member's read card's read tier, is in the fleet's set.

func (*Snapshot) FriendFinishAfter

func (s *Snapshot) FriendFinishAfter() time.Duration

FriendFinishAfter is the friend-finish window: the sprint's setting, else FriendFinishDefault.

func (*Snapshot) FriendIdleAfter

func (s *Snapshot) FriendIdleAfter() time.Duration

FriendIdleAfter is that bound: the sprint's setting, else FriendIdleDefault.

func (*Snapshot) FriendMode

func (s *Snapshot) FriendMode(name string) string

FriendMode returns the friend's delivery mode (config.FriendModeBatch or config.FriendModeOneShot), defaulting to config.FriendModeBatch if unset or unknown.

func (*Snapshot) FriendStallAfter

func (s *Snapshot) FriendStallAfter() time.Duration

FriendStallAfter is that bound: the sprint's setting, else FriendStallAfterDefault.

func (*Snapshot) FriendStallStep

func (s *Snapshot) FriendStallStep() time.Duration

FriendStallStep is that step: the sprint's setting, else FriendStallStepDefault.

func (*Snapshot) FriendStartMax

func (s *Snapshot) FriendStartMax() time.Duration

FriendStartMax is the start bound: the sprint's setting, else FriendStartMaxDefault.

func (*Snapshot) FriendsOff

func (s *Snapshot) FriendsOff() bool

FriendsOff says the friends' work is switched off (nova-sprint set --friends off): the deal hands no work card to a friend (friendDealable), and her empty row is no alarm; her reads still flow.

func (*Snapshot) FriendsTake

func (s *Snapshot) FriendsTake(tier string) bool

FriendsTake says the deal may hand a friend a card of the tier (set --friends-tiers), as FleetTakes says it of the fleet; her row's own tiers still bound what she takes.

func (*Snapshot) IdenticalBound

func (s *Snapshot) IdenticalBound(stream string) int

IdenticalBound is how many identical findings in a row on one brief stop a card in the stream: the stream's setting, else the sprint's, else IdenticalDefault.

func (*Snapshot) MemberCtl

func (s *Snapshot) MemberCtl(member string) *Card

MemberCtl is a fleet member's control card.

func (*Snapshot) Members

func (s *Snapshot) Members() []string

Members is the fleet's machines: its rows but the friends' (FriendRow), in row order.

func (*Snapshot) MergeWindow

func (s *Snapshot) MergeWindow() (MergeWindow, error)

MergeWindow is the merge window the merge table's properties hold, the zero window when none was opened; an end that cannot be read is an error, never no window.

func (*Snapshot) NextTier

func (s *Snapshot) NextTier(c *Card) string

NextTier is the tier the primary c escalates to when it reaches its bound: the next tier of the ladder above the one it is on, up to its ceiling; "" at its ceiling (a pinned model or tier is on its ceiling, cardTier), for brief lines that cannot be read, and in a store with no route (a twin: its member runs its own model whatever the tier). One function decides it for every bound that escalates: the redeal bound (Deal) and the failure bounds.

func (*Snapshot) OutOfCredit

func (s *Snapshot) OutOfCredit() string

OutOfCredit is AllOutOfCredit of the snapshot's routes and the fleet table's rests.

func (*Snapshot) Primary

func (s *Snapshot) Primary(id string) *Card

Primary is the primary's record in the work table (placed or kept).

func (*Snapshot) ReadCardsOn

func (s *Snapshot) ReadCardsOn() bool

ReadCardsOn says the sprint asks its reads as read cards (PropReadCards).

func (*Snapshot) ReaderIsUp

func (s *Snapshot) ReaderIsUp(reader string) bool

ReaderIsUp says a reader may be asked: it is up, or the snapshot carries no reader states (a core test's, which holds every reader up).

func (*Snapshot) ReaderWidth

func (s *Snapshot) ReaderWidth(reader string) int

ReaderWidth is a reader's width, the most reads it runs at once: its machine's fleet row's (ReaderPrefix: reader-<m> runs at m's width, the width the reader itself reads with its queue every tick), so the ask and the level know it too (the owner, 2026-10-03: with widths 4/8/16/16/24 the count-levelled reads queued seven deep on the two narrow machines while 31 reader slots sat idle). A reader named for no fleet row, or read with no fleet table, keeps the unbounded room it had: math.MaxInt, so it is never at width and its room is ordered by its load alone.

func (*Snapshot) RuleOff

func (s *Snapshot) RuleOff(rule string) bool

RuleOff says nova-config's sprint row turns the rule off.

func (*Snapshot) StateOf

func (s *Snapshot) StateOf(id string) State

StateOf is the primary's state, "" when it is not on the table.

func (*Snapshot) StreamCtl

func (s *Snapshot) StreamCtl(stream string) *Card

StreamCtl is a stream's control card in the merge table.

func (*Snapshot) StreamPriority

func (s *Snapshot) StreamPriority(stream string) string

StreamPriority is the stream's default level for cards added later: its control card's field, else normal.

func (*Snapshot) Streams

func (s *Snapshot) Streams() []string

Streams is the work table's streams, in row order.

func (*Snapshot) T

func (s *Snapshot) T(name string) *Table

T is the loaded table by logical name.

func (*Snapshot) UpMembers

func (s *Snapshot) UpMembers() []string

UpMembers is the fleet members whose status is up, in row order.

func (*Snapshot) UpReaders

func (s *Snapshot) UpReaders() []string

UpReaders is the readers whose state is up, in row order.

func (*Snapshot) Width

func (s *Snapshot) Width(member string) int

Width is the member's width.

type Span

type Span struct {
	From time.Time `json:"from"`
	To   time.Time `json:"to,omitempty"`
}

Span is one time the machine was STOPPED; To is zero while it still is.

type StageStat

type StageStat struct {
	Median float64 `json:"median_s"`
	P90    float64 `json:"p90_s"`
	N      int     `json:"n"`
}

StageStat is one stage's median and p90, in seconds, over N cards.

type StageTimes

type StageTimes struct {
	All     map[string]StageStat            `json:"all"`
	Streams map[string]map[string]StageStat `json:"streams"`
}

StageTimes is the stage stats over every stream and per stream; a stage no card has a span for is absent.

func CycleTimes

func CycleTimes(s *Snapshot, now time.Time) StageTimes

CycleTimes is the stage times of the primaries landed in the CycleWindow before now.

type Stages

type Stages struct {
	DealWait      Measure `json:"deal_wait"`
	FinishToReads Measure `json:"finish_to_2reads"`
	AcceptToLand  Measure `json:"accept_to_land"`
	Total         Measure `json:"total"`
}

Stages are the primary's stages: deal wait (admitted to its first work card's first deal), finish to two reads (its last ok take finished to accepted), accept to land (accepted to landed) and total (admitted to landed).

type State

type State = string

State is a primary's state: its column in the work table.

const (
	Waiting State = "waiting"
	Ready   State = "ready"
	Working State = "working"
	Review  State = "review"
	Merging State = "merging"
	Landed  State = "landed"
)

The six states. Landed is final.

type Stop

type Stop struct {
	Kind    string    `json:"kind"`
	Subject string    `json:"subject"`
	Since   time.Time `json:"since,omitzero"`
	What    string    `json:"what"`
	Effect  string    `json:"effect"`
	Undo    string    `json:"undo"`
	Signal  string    `json:"signal"`
	// contains filtered or unexported fields
}

Stop is one automatic stop that holds: its kind (a word), what it stops (its subject), since when, what it says (the evidence), its effect, the verb that undoes it, and the signal that carries it to the seat (a judgment type, or the note the part writes).

func LiveStops

func LiveStops(s *Snapshot, r TickReq) []Stop

LiveStops is every automatic stop that holds at s.Now, in kind and subject order: the pass's own (memberStops, pinStops, friendStallStops) and those another part signals (the rests, a stream stopped by the lander), listed so the seat sees each with its age.

func (Stop) Age

func (x Stop) Age(now time.Time) time.Duration

Age is how long the stop has held at now, to the second; zero when its start is not known.

func (Stop) Line

func (x Stop) Line(now time.Time) string

Line is the stop as one line: kind, subject, age, what, effect and the undo verb.

type StopReturnReq

type StopReturnReq struct {
	As     string
	IDs    []string
	Gens   map[string]int
	Reason string
}

StopReturnReq is an owner's receipt that the named children have stopped. It is deliberately separate from STOP: the table must not say ready while a child is still running. The owner keeps the same card and branch for resume.

type StoreM

type StoreM struct {
	Addr    string `json:"addr"`
	Err     string `json:"err,omitempty"`
	DBSize  int64  `json:"dbsize"`
	Machine string `json:"machine"`
	Epoch   uint64 `json:"epoch"`
	Tick    TickM  `json:"tick"`
}

StoreM is the store as measured: the Redis the server uses, the error of a ping, DBSize (-1 when none, the mem twin), the machine's state word, the epoch and the last tick.

type StreamBase

type StreamBase struct {
	Cost   string `json:"cost,omitempty"` // the control card's exact landed cost (FieldCost), "" for none
	Landed int    `json:"landed"`
}

StreamBase is a stream's landed cost and count at a tidy: the cost cell and per landed count from it (StreamCostSince, PerLandedSince).

type StreamCard

type StreamCard struct {
	ID    string   `json:"id"`
	State string   `json:"state"`
	Tier  string   `json:"tier,omitempty"`
	Title string   `json:"title,omitempty"`
	Needs []string `json:"needs"`
}

StreamCard is one card of a stream in a streams listing: its state, tier, the first sentence of its THE TASK, and the ids it needs.

type StreamClock

type StreamClock struct {
	Stream   string
	Release  string `json:",omitempty"`
	State    string
	Since    time.Time
	Progress time.Time
	// Empty says nothing of the stream is on the table: never stale.
	Empty bool `json:",omitempty"`
	// Held says every card of the stream on the table and not landed waits (on a
	// sentinel, or a need): it is held by what it waits on, never stale; or the
	// coordinator holds it (hold <stream>, hold.go), the reason in Reason.
	Held   bool   `json:",omitempty"`
	Reason string `json:",omitempty"`
	// Quiet is the time wait set on the stream's stale judgment (FieldStaleReview):
	// not shown stale before it.
	Quiet time.Time `json:",omitzero"`
	// Promotion is the stream's protected-branch mark from its control card
	// (FieldLandProtected): LandProtectedAny for the promotion stream, else the
	// repositories it lands dev and main of; empty for a plain stream
	// (docs/SPEC-SPRINT.md section 7, protected-bases-pb-b.w2).
	Promotion string `json:",omitempty"`
}

StreamClock is a stream's state, since (the last change of its state) and progress (the last change of its state or of any of its counts).

func (StreamClock) Stalled

func (c StreamClock) Stalled(now time.Time, stale time.Duration) bool

Stalled says a stream that has not landed has made no progress for longer than stale. It is pull visibility: nothing here detects a dead process.

type StreamRow

type StreamRow struct {
	Stream  string       `json:"stream"`
	Repos   []string     `json:"repos"`
	Bases   []string     `json:"bases"`
	Release string       `json:"release,omitempty"`
	State   string       `json:"state,omitempty"`
	Open    int          `json:"open"`
	Landed  int          `json:"landed"`
	Cards   []StreamCard `json:"cards,omitempty"`
}

StreamRow is one stream in a streams listing: the repositories and bases its cards record, its release, the state it shows, its open and landed counts, and its cards when asked.

type StreamSetBaseCheck

type StreamSetBaseCheck struct {
	Stream string
	ID     string
	Was    string
	Brief  string
}

StreamSetBaseCheck is one card stream set --base re-points: the stream, its id, the brief the card carried when the check read it (Was) and the brief the rewrite would carry (Brief), which is what the check add runs held to the new base. It is the candidate the write is bound to (baseChecksHeld): the plan applies the rewrite only over the cards the check read, so a card added, dealt or revised between the two reads refuses the step instead of being rewritten with its PATHS unchecked.

func StreamSetBaseChecks

func StreamSetBaseChecks(s *Snapshot, streams []string, base string) []StreamSetBaseCheck

StreamSetBaseChecks is the brief each card stream set --base re-points would carry (streamSetBaseCards), in work order, for the check add runs: the cards not yet dealt and those queued to merge. A dealt and working card is not in it: its base is kept.

type StreamsReq

type StreamsReq struct {
	Repos   []string
	Release string
	Cards   bool
}

StreamsReq is what a streams listing shows: only the streams recording a repository, only the streams of a release, and every card of each stream when Cards.

type StreamsView

type StreamsView struct {
	Streams []StreamRow `json:"streams"`
	Mixed   []string    `json:"mixed,omitempty"`
}

StreamsView is the whole listing: one row per stream, and the streams whose cards name more than one repository (the finding the verb prints).

func StreamsOf

func StreamsOf(s *Snapshot, r StreamsReq) StreamsView

StreamsOf is the streams listing: every stream row, with the repositories and bases its cards record, its release, its open and landed counts and, with Cards, every card in work order (a state at a time). Only keeps the streams a repository in Repos records (any of them) and, with Release set, the streams of that release. Mixed names every stream whose cards name more than one repository.

type Suppressed

type Suppressed struct {
	Epoch   uint64 `json:"epoch"`
	N       int    `json:"n"`
	Lane    int    `json:"lane"`
	Readers int    `json:"readers"`
	Tier    int    `json:"tier"`
}

Suppressed is the count of the judgments the lane check kept from rising in one epoch of the sprint, the coordinator's count: N, and beside it its three causes, a friend's lane live inside its cap (a lateness, a stall, finishes none), readers busy (readers behind), a read tier question the rule answered.

func (Suppressed) Counted

func (c Suppressed) Counted(epoch uint64, prev, now []LaneQuiet) Suppressed

Counted is the count with a tick's quiets added: each quiet now that the tick before kept quiet too (prev, the same type and subject) is the same judgment still kept from rising and is not counted again. A tick of another epoch (a clear) starts the count from none.

type SwitchState

type SwitchState struct {
	Target      string    `json:"target"`
	Previous    string    `json:"previous"`
	SwitchedAt  time.Time `json:"switched_at"`
	WindowNanos int64     `json:"window_nanos"`
	Rollback    bool      `json:"rollback"`
}

SwitchState is recorded at <target>.switch.json when rollback protection is enabled.

type SyncMember

type SyncMember struct {
	Name  string
	Width int
}

SyncMember is a machine the inventory names a member, at its width.

type Table

type Table struct {
	Name     string // logical name
	Epoch    uint64
	Revision uint64
	Texts    map[string]map[string]string // row -> text column -> value
	// contains filtered or unexported fields
}

Table is one table as observed: its revision, its rows in order, its text cells, and its cards (placed, and any unplaced records the step asked for), which are read by Card and Cards.

func NewTable

func NewTable(name string) *Table

NewTable is an empty observed table.

func (*Table) AnyWithPrefix

func (t *Table) AnyWithPrefix(prefix string) bool

AnyWithPrefix says the table holds a card, placed or kept, whose id begins with prefix: WithPrefix not empty, with nothing gathered.

func (*Table) Card

func (t *Table) Card(id string) *Card

Card is the card with the id, nil when the table has none.

func (*Table) Cards

func (t *Table) Cards() []*Card

Cards is every card the table holds, placed or kept, in id order: a copy of the list, of the same cards. Safe for concurrent readers (docs/SPEC-SPRINT.md section 1, the tables).

func (*Table) Cell

func (t *Table) Cell(row, col string) []*Card

Cell is the cards placed at row and column, in score order (then id).

func (*Table) Clone

func (t *Table) Clone() *Table

Clone is a copy of the table as it is now: Frozen.

func (*Table) Column

func (t *Table) Column(cols ...string) []*Card

Column is the cards placed in the column on any row, in score order.

func (*Table) Count

func (t *Table) Count(row, col string) int

Count is the number of cards at row and column.

func (*Table) Drop

func (t *Table) Drop(id string)

Drop takes a card out of the table's cards: a record the table no longer holds as a read would find it (store's twin, twin.go).

func (*Table) Frozen

func (t *Table) Frozen() *Table

Frozen is a copy of the table as it is now that later changes to the table leave as it was: its own map of the same cards (a card is replaced whole, never changed in place, by the store's twin), rows, texts and properties. The tick's first read keeps one while the twin it was read from moves on.

func (*Table) HasRow

func (t *Table) HasRow(row string) bool

HasRow says the table declares the row.

func (*Table) Hidden

func (t *Table) Hidden(row string) bool

Hidden says the row is kept in the table and its folds and not drawn (the table layer's row hide): on the work and merge tables, an archived stream.

func (*Table) Of

func (t *Table) Of(p string) []*Card

Of is the placed cards whose primary field names p, in score order.

func (*Table) Placed

func (t *Table) Placed(id string) *Card

Placed is the card with the id if it has a place.

func (*Table) Prop

func (t *Table) Prop(name string) (string, bool)

Prop is the table's property name and whether it is present.

func (*Table) Props

func (t *Table) Props() map[string]string

Props is the table's properties: a copy.

func (*Table) Put

func (t *Table) Put(c *Card)

Put adds or replaces a card.

func (*Table) Rows

func (t *Table) Rows() []string

Rows are the table's rows in order, not to be changed.

func (*Table) SetHidden

func (t *Table) SetHidden(row string)

SetHidden marks the row hidden, as read.

func (*Table) SetProp

func (t *Table) SetProp(name, value string)

SetProp sets one of the table's properties as a write left it (a batch's receipt): the rest are kept.

func (*Table) SetProps

func (t *Table) SetProps(p map[string]string)

SetProps sets the table's properties as read (a copy).

func (*Table) SetRows

func (t *Table) SetRows(rows []string)

SetRows sets the table's rows, in order.

func (*Table) WithPrefix

func (t *Table) WithPrefix(prefix string) []*Card

WithPrefix is the cards, placed or kept, whose id begins with prefix, in id order: Cards filtered by the prefix, without walking the rest of the table.

type TableUpdate

type TableUpdate struct {
	Table string
	Parts []TickPartDef
}

TableUpdate is one table's update in a tick: its parts, each an existing planner over every row of the table that needs it, run in order.

type TakeReq

type TakeReq struct {
	Sel
	As   string
	Gens map[string]int
	Who  string
}

TakeReq is a worker taking its work cards. Gens names the generation the worker holds for a named card; a take by id names one for every card, and a card whose live generation differs has been dealt again, so the take is refused as stale. A take by selection takes the member's oldest ready cards and reports each one's generation.

type TickM

type TickM struct {
	Ticked   bool          `json:"ticked"`
	Age      time.Duration `json:"age_ns"`
	Ticks    int64         `json:"ticks"`
	Failures int           `json:"failures,omitempty"`
	Error    string        `json:"error,omitempty"`
}

TickM is the run loop's own report of its last tick, the heartbeat record it writes: whether it ever ticked, how long since it was last seen, how many ticks, and the last failure.

type TickPartDef

type TickPartDef struct {
	Name string
	Fn   TickPartFn
}

TickPartDef is a part of the tick by name, with its planner.

func TickEndWith

func TickEndWith(rules, idle bool) []TickPartDef

TickEndWith is the tick's end with the machine's own answers (run's defaults): with rules (TickReq.AnswerRules, run --answer-rules), the rule parts (TickRules) after the deadlines, so a judgment the end raises is answered in its own tick, and before the overdue part, each a step that may write any table, as a coordinator's verb does, its work-table changes queued for the next pump; with idle (TickReq.IdleAlarm, run --idle-alarm), the idle alarm (TickIdle) after the overdue part, before the done part. With neither the end is TickEnd's alone, as before them. The widen rule's part (widen.go) runs before the rule rework, which reworks nothing the widen rule leaves to a mind.

func TickEndWithStoppedAssignments

func TickEndWithStoppedAssignments(s *Snapshot, rules, idle bool) []TickPartDef

TickEndWithStoppedAssignments gives real and shadow ticks the same observational recovery part (SPEC-SPRINT, STOP assignment alerts).

type TickPartFn

type TickPartFn func(*Snapshot, TickReq) (plan Plan, due int)

TickPartFn is one part of the tick over an observed state: its plan, held to the part's bounds, and how many moves and judgments are due past them.

func FleetBackPresence

func FleetBackPresence(a Adopter) TickPartFn

FleetBackPresence is the presence part with members back from down held to adopt the latest through a. With a nil a or no target it is TickPresence.

type TickReq

type TickReq struct {
	Who string // recorded with every move; "" is MachineActor
	// Stopped is the time the machine was STOPPED between two clock readings:
	// a deadline compares running time only. nil is none.
	Stopped func(from, to time.Time) time.Duration
	// Beats is each fleet member's last beat, read by the binding with the
	// tick: the presence part applies the status it derives. nil is none
	// read, and the presence part does nothing.
	Beats map[string]Beat
	// Started is the machine's first start of the sprint's epoch, the time
	// the done part's note counts from; zero is not known.
	Started time.Time
	// Friends is each friend the deal offers ready work first, read by the binding
	// with every tick while the roster has a friend (friendDealPass, before the residual
	// fleet deal), with what her beat names running (FriendSeat.Running): the tick
	// levels them after its deal (FriendLevel). nil is none: every card is the fleet's
	// but a hard pin, which waits ready, and no friend is levelled.
	Friends []FriendSeat
	// AnswerRules says the tick answers the mechanical judgments by rule (rules.go; run
	// --answer-rules); false leaves every judgment to the coordinator.
	AnswerRules bool
	// IdleAlarm says the tick watches for an idle fleet and tells the coordinator why
	// (idle.go; run --idle-alarm).
	IdleAlarm bool
	// WakeFriend wakes a friend by bus message during the stall ladder (cmd/nova-sprint/friendcards.go).
	WakeFriend func(friend string, rung int, d time.Duration) error
	// Sessions is each friend's session as her last beat carries it, and whether the
	// coordinator holds her, read by the binding with every tick (coordinator_pass.go);
	// nil is none read, and no friend is deaf.
	Sessions map[string]FriendSession
	// Drift is the repository's drift facts, read by the binding (ReadDrift, with the last
	// whole-tree gate at the base; drift.go, docs/SPEC-SPRINT.md section 8, "Drift alarms"):
	// the deadlines part keeps a judgment for each drift. nil is none read, and no drift
	// judgment is raised or closed.
	Drift *DriftFacts
}

TickReq is what a tick is given beside the snapshot.

type TidyCard

type TidyCard struct {
	ID   string `json:"id"`
	Cell string `json:"cell"`
	Why  string `json:"why,omitempty"`
	// Finished is the card's finish stamp: a stats reset's mark is rebased by the moved
	// cards that finished before it alone (ResetMark.Rebase).
	Finished time.Time `json:"finished,omitzero"`
}

TidyCard is one finished card a tidy took off, or kept: its id, the cell it was on (ok or failed) and, for one kept, why.

type TidyRow

type TidyRow struct {
	Row    string     `json:"row"`
	OK     int        `json:"ok"`
	Failed int        `json:"failed"`
	Moved  []TidyCard `json:"moved,omitempty"`
	Kept   []TidyCard `json:"kept,omitempty"`
}

TidyRow is one fleet row's done cells as a tidy found them: its ok and failed counts before (the counters the archive keeps), the cards it takes off, and the cards it leaves because the work or a rule still reads them.

type TierCosts

type TierCosts struct {
	// Tiers counts the stream's cards by the tier their briefs name (TierWord).
	Tiers map[string]int `json:"tiers,omitempty"`
	// PerLanded is the stream's landed cards' cost per landed card, dollars and cents
	// rounded up (MoneyText); "-" with nothing landed or nothing priced.
	PerLanded string `json:"per_landed"`
	// CostByTier is the stream's spend by the tier each attempt and read ran on, dollars
	// and cents allocated from the rounded-up total, over every card of the stream, every dollar of TotalCost in one
	// tier: a record with no tier takes its route's (runTier), and a card's records past
	// the list's bound (in its total, not its list) take the card's; "no tier" only when
	// none of these names one.
	CostByTier map[string]string `json:"cost_by_tier,omitempty"`
	// TotalCost is the stream's complete recorded spend: every take and read of every card
	// of it in any column, landed or not, at each record's charged figure (the harness's
	// cost, else its tokens at the route's prices), dollars and cents rounded up; "" when
	// nothing of it was priced.
	TotalCost string `json:"total_cost,omitempty"`
	// WorkCost and ReadCost split TotalCost by kind: every take's charged figure and every
	// read's, dollars and cents rounded up; "" when nothing of that kind was priced. The
	// dashboard shows the reads as their own number beside the work.
	WorkCost string `json:"work_cost,omitempty"`
	ReadCost string `json:"read_cost,omitempty"`
	// ReadTokens is the tokens of the stream's subscription reads (WhySubscription), the
	// reads whose cost is their tokens; 0 when none.
	ReadTokens int64 `json:"read_tokens,omitempty"`
	// ReadsToday is the stream's reads that ended on the tick's UTC day, by the route that
	// priced them (WhySubscription for a subscription reader's, "-" for none): the exact
	// dollars, the tokens and the count, which ReadSpendLine sums over the streams.
	ReadsToday map[string]ReadDay `json:"reads_today,omitempty"`
	// UnpricedRuns counts the stream's records that carry no cost at all: runs whose usage
	// never reached the sprint (cardcost.WhyNoTokens), which the total cannot hold.
	UnpricedRuns int `json:"unpriced_runs,omitempty"`
	// ReadsNoTokens counts the stream's reads whose verdict was kept with a usage that
	// reported no token (cardcost.WhyNoTokens): one of UnpricedRuns each, counted apart
	// so a reader whose harness stops reporting is seen.
	ReadsNoTokens int `json:"reads_no_tokens,omitempty"`
	// Readers is each reader's spend on the stream's cards, by the reader that ran the read
	// (readers_spend.go): ReaderSpendsOf sums it over the streams for the readers table.
	Readers map[string]ReaderSpend `json:"readers,omitempty"`
	// Unreconciled is the SPRINT's, the same on every stream's record: what the providers
	// counted beyond the sprint's records since the epoch began (UnreconciledSpend,
	// cost_reconcile.go), dollars and cents rounded up; "" when nothing is.
	Unreconciled string `json:"unreconciled,omitempty"`
	// Reconciles is the SPRINT's too: each provider's latest reconciliation, its day, its
	// own figure, the records' and the gap (LatestReconciles, cost_reconcile.go).
	Reconciles []CostReconcileRecord `json:"reconciles,omitempty"`
}

TierCosts is one stream's tiers and spend as the where view carries them.

func TierCostsSince

func TierCostsSince(tc TierCosts, m ResetStream) TierCosts

TierCostsSince is the stream's spend since the mark: its total, work and read costs and each tier's less the mark's, never below zero, a tier with nothing since left out (the pie leaves a tier at $0 out). Every other figure (the cards by tier, per landed, the reads of the day, the readers' spend, the unpriced runs, the reconciliation) is as it was: per landed is counted from the mark's base by the caller (PerLandedSince).

type Timeout

type Timeout struct {
	Card string
	Kind string
	At   time.Time
}

Timeout is one card of a member that ended on a timeout: the work card, the kind, and when.

func MemberTimeouts

func MemberTimeouts(s *Snapshot, member string) []Timeout

MemberTimeouts is the member's cards that ended on a timeout within the window ending at s.Now, oldest first: its staging refusals on stage-timeout (the work cards' staging takes, whichever row they sit on now) and its failed finishes whose report names a timeout.

type Timer

type Timer struct {
	ID   string    `json:"id"`
	For  string    `json:"for"`
	Due  time.Time `json:"due"`
	Note string    `json:"note"`
	By   string    `json:"by"`
	// Set is when the timer was written: the base its due time counts running
	// time from, as a judgment's review time counts from when wait set it.
	Set time.Time `json:"set"`
}

Timer is one timer: the actor it wakes, the time it is due at, the note it carries and who set it.

func DueTimers

func DueTimers(t Timers, now time.Time, stopped func(from, to time.Time) time.Duration) []Timer

DueTimers is the timers whose due time the clock has reached at now, in the order the record keeps them: the one due test the tree has, DueNow, so a timer counts running time exactly as a judgment's review time does (docs/SPEC-SPRINT.md, "Timers").

type Timers

type Timers struct {
	Open []Timer `json:"open,omitempty"`
}

Timers is the sprint's open timers, the record `remind` writes and the tick reads.

func (Timers) Find

func (t Timers) Find(id string) int

Find is the timer's index, -1 when there is none.

func (*Timers) Sort

func (t *Timers) Sort()

Sort keeps the timers in due order, then in id order.

type TwinCarry

type TwinCarry struct {
	Attempt      int
	Branch, Head string
	Line         string
}

TwinCarry is the attempt a twin carries (twin --carry): its number, the branch and head it pushed, and its CARRY: header line (member.CarryLine), where the twin's first attempt starts.

type TwinReq

type TwinReq struct {
	ID          string
	Paths       []string // globs joined to every PATHS: line of the brief
	Needs       []string // needs of the twin besides the card's own
	Before      string   // the card the twin stands in front of; "" is the card twinned
	Tier        string   // the twin's pinned tier; "" keeps the card's pin
	Instruction string   // written verbatim at the head of THE TASK
	Carry       *TwinCarry
	Who         string
}

TwinReq twins a card (nova-sprint twin): one step that admits the twin and drops the card.

type Unit

type Unit struct {
	Key     string // the primary or card the unit is about
	Stream  string // the stream whose progress it is
	Changes []Change
	Bumps   []Bump
	Notes   []Note
	Closes  []Open // open judgments this unit answers: recorded as decided
	Moved   string // what moved, one line
}

Unit is one card's part of a step: the changes that must apply together, the notifications the move causes, and the open judgments it answers.

type UnitKind

type UnitKind = units.UnitKind

func UnitKindOf

func UnitKindOf(k string) (UnitKind, bool)

UnitKindOf is the kind named k.

type UnitState

type UnitState = units.UnitState

func CheckUnits

func CheckUnits(dir, goos string, kinds []UnitKind) ([]UnitState, error)

CheckUnits looks for every kind's unit in dir. It reads files only.

type UnpinReq

type UnpinReq struct {
	IDs                 []string
	Stream, Reason, Who string
}

UnpinReq selects unstarted cards whose stored WHO preference is removed.

type UsageRead

type UsageRead struct {
	Provider string
	Known    bool
	Day      string // the UTC day the count is of, 2006-01-02
	Used     float64
	Note     string
}

UsageRead is one provider's own count of a UTC day's usage as the run loop read it: Known false with Note saying why when there was none to read.

type VersionsM

type VersionsM struct {
	Measured bool              `json:"measured,omitempty"`
	Dev      string            `json:"dev,omitempty"`
	Machines []MachineVersionM `json:"machines,omitempty"`
}

VersionsM is each machine's installed version against dev's tip.

type Violation

type Violation struct {
	Rule   int    `json:"rule"` // 1..9, 11 and 12 (a stall), or 10 for a cut step
	Detail string `json:"detail"`
}

Violation is one broken rule of docs/SPEC-SPRINT.md section 9, or a step cut short (section 10).

func Check

func Check(s *Snapshot, pending *Pending) []Violation

Check is what is always true, over an observed state with all four tables loaded (docs/SPEC-SPRINT.md section 9). Sets of primaries are compared exactly, member by member, never by their counts. pending is the operation the sprint's fence holds, if any: rules 2, 3, 4, 5 and 9 hold whenever no operation is pending, and are not judged while one is; 1, 6, 7 and 8 always, the score rule judged against a pending rank's own new scores.

func CheckHeld

func CheckHeld(h HeldState, now time.Time) []Violation

CheckHeld is the no-stall rule as a rule of check: each stall is one violation.

func LogViolations

func LogViolations(s *Snapshot, lines []Line) []Violation

LogViolations checks an observed state and its epoch's log: the log replays to every card's place and generation (the control cards, which hold a row's state and no card, aside). Judged only when no operation is pending.

func PlaceViolations

func PlaceViolations(s *Snapshot, placed map[string]Place) []Violation

PlaceViolations checks an observed state and the places its log replays to.

func StreamViolations

func StreamViolations(lines []Line, inbox []Note) []Violation

StreamViolations checks the epoch's log and its inbox stream: every notification is written to both, so each notification line of the log (an update aside, which rewrites an open judgment in place and is the log's alone) has its entry in the inbox with the same id, kind, type and text, and each inbox entry its line in the log.

func (Violation) String

func (v Violation) String() string

type WaitReq

type WaitReq struct {
	Note  string
	Until time.Time
	Who   string
}

WaitReq holds a condition the tick keeps until a time: the judgment is closed and a hold kept on its condition; when the time has passed in running time and the condition still holds, the tick raises it again.

type WidenFile

type WidenFile struct {
	File     string `json:"file"`
	Adjacent string `json:"adjacent,omitempty"`
}

WidenFile is one file outside a brief's PATHS and why it is adjacent to the change; Adjacent is "" when it is not.

func WidenFiles

func WidenFiles(brief, text string, hold bool) []WidenFile

WidenFiles is every file text names outside the brief's PATHS (FilesOutsidePaths), each classified by WidenAdjacent; hold says text is the worker's HOLD, whose reasons count.

Source Files

Directories

Path Synopsis
Package driver plays the world outside the sprint table, on a tick: workers taking and finishing work cards, readers reporting read cards, each stream's merge step with its facts, and fleet members going down and up.
Package driver plays the world outside the sprint table, on a tick: workers taking and finishing work cards, readers reporting read cards, each stream's merge step with its facts, and fleet members going down and up.
Package refmodel is a reference model of nova-sprint's sprint table, written from the TLA+ module tla/SprintTables.tla (its sprint-tables-model branch, at 4bf919875) and docs/SPEC-SPRINT.md, and not from the engine.
Package refmodel is a reference model of nova-sprint's sprint table, written from the TLA+ module tla/SprintTables.tla (its sprint-tables-model branch, at 4bf919875) and docs/SPEC-SPRINT.md, and not from the engine.
Package store binds the sprint core (internal/sprint) to the table layer (internal/ntable): one set read of the tables a step needs, then batch applies, chunked under the table layer's bounds, with an operation record for every step that touches more than one table or writes notifications, and the notifications written by the same step as the move that causes them.
Package store binds the sprint core (internal/sprint) to the table layer (internal/ntable): one set read of the tables a step needs, then batch applies, chunked under the table layer's bounds, with an operation record for every step that touches more than one table or writes notifications, and the notifications written by the same step as the move that causes them.
storetest
Package storetest is what the tests of the sprint store and of its callers share: the twin's check (TwinDiff, a test's Store.CheckTwin).
Package storetest is what the tests of the sprint store and of its callers share: the twin's check (TwinDiff, a test's Store.CheckTwin).

Jump to

Keyboard shortcuts

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