view

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2026 License: MIT Imports: 12 Imported by: 0 modules, 0 packages

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

Documentation

Overview

Package view is the dashboard's model: one account's row, and every cell a human table renders it into.

It exists so that a renderer outside package cli can exist at all. Package cli exports nine identifiers and none of them is a row, so a second renderer would have had to spell every percentage, every reset span and every "could not be read" a second time — and the two spellings would agree until the day one of them changed. That `ccdad status`, `ccdad list` and the terminal dashboard can never disagree is a property of there being ONE of each of these, not of three of them being written carefully.

Nothing here reads the clock, the filesystem or the environment. A Row is built from documents somebody else read.

Index

Constants

View Source
const NoQuantity = "-"

NoQuantity is what a cell renders when the quantity does not exist here, as against Unreadable's "somebody tried to read it and could not". The two are different verdicts and both appear in one rendered row: an account with no cached reading has an unknown percentage and no window to name, so its USED cell is "?" and its WINDOW cell is "-". Collapsing them would tell a reader that a quantity which cannot exist merely went unread, and send them looking for the reading.

View Source
const Unreadable = "?"

Unreadable is what a value that could not be read renders as. Never "0%" -- unknown is never read as zero, and cswap's version of that bug parked its engine on the account that reset last, because one expired token made every account look empty.

Variables

This section is empty.

Functions

func DaemonLine

func DaemonLine(report daemon.Report, now time.Time) string

DaemonLine is the liveness line `ccdad status` prints at the top of the dashboard. It is one of TWO wordings this repository ships, and the other is DescribeRunning below. They are not merged: this one leads a nine-column label field that the Active: and Mode: lines below it line up with, and the other is a fragment that reads as the tail of a sentence.

The default arm is DaemonUnknown and every future value. "Cannot tell" is never folded into "no": a supervisor gating on that folding respawns forever on a filesystem where locks do not work.

func DescribeRunning

func DescribeRunning(report daemon.Report, now time.Time) string

DescribeRunning is the one-line human form of a live daemon. now is a parameter rather than a call because nothing in this package reads a clock; package cli passes timeNow(), which is what the old body called.

func HoverLine added in v0.7.0

func HoverLine() string

HoverLine is the dashboard's one line about the fully automatic mode, and it is printed only when hover is ON.

Absence is unambiguous here, which is what separates it from ModeLine: hover off is the default and the configured numbers are then the ones in force, whereas a missing Mode would have been defaulted to "headroom" -- a plausible answer nobody computed. What it must not be is silent while hover IS on. The Mode line reads "headroom" under hover because hover forced headroom, so a reader who configured consume-first would otherwise see a mode they never asked for with no reason for it anywhere on the page.

It names 'ccdad hover status' rather than printing a number, because there is no single number to print: hover derives one per account and per window. The label column is nine characters wide, matching the Daemon:, Active: and Mode: lines it stacks with.

func HumanDuration

func HumanDuration(d time.Duration) string

HumanDuration renders a span at the scale a reader cares about. A reset already behind us is "due" rather than a negative number: the endpoint has not rolled the window over yet, which is a real state and not a clock error.

func ModeLine

func ModeLine(m strategy.Mode) string

ModeLine is the ranking mode with the question it is asking. Recovery is the one a user needs told: the columns are identical to the ordinary case, so nothing else on the dashboard distinguishes "the engine is ranking by soonest reset because everything is spent" from "the engine has nothing to do".

The label column is nine characters wide, matching the Daemon: and Active: lines above it. No branch may contain the substring "exhaust": the human table keeps the projection to --json, and a mode line that used the word would put it back on the page the projection was kept off.

TestNoModeLineBranchSaysExhausted is what makes that red. It asks the question twice -- by rendering every mode this binary declares plus one it has never heard of, and by reading the branches below as source, so a case written for a mode nothing yet passes in is covered too -- and it pins the branch count, because a line added to a block without the test that covers the block growing with it is how this rule came to be held by prose.

func RunwayAccounts added in v0.7.0

func RunwayAccounts(f forecast.Fleet) string

RunwayAccounts is the seat-count line under the axis block: how many accounts the run had to work with, how many it would take to survive the horizon at the measured rate, and the difference between the two.

It answers the axis block's question from the other end. The rows above say how much is left and when it runs out; this says how many seats it would take for it not to. Both come from the same runs, so a reader can never be told "runs dry" and "you have enough accounts" on adjacent lines.

The parenthetical is the actionable half and is present exactly when there is something to act on: a fleet already sitting on the smallest count that holds gets the count and nothing after it. The gap before it is two spaces, matching the dry moments in the block above, which a reader scans down the same column.

An unmeasured count is Unreadable and never NoQuantity. Every fleet has a smallest size that holds -- supply is linear in the seat count and burn is not a function of the fleet -- so the number exists and what failed was the measuring. NoQuantity would say there is no such number and stop a reader looking for the history that produces it.

A fleet with no usable accounts gets no line at all. "0 usable, ? needed" is a sentence about a fleet the rotation cannot reach, and the basis line above it already carries how many accounts there are and why none of them counted.

func RunwayBurn added in v0.7.0

func RunwayBurn(b forecast.Band) string

RunwayBurn is a measured consumption rate, in percentage points per hour.

Low is what is printed and High is not: the upper bound is what a claim of "holds" had to survive, so it belongs to the verdict cell rather than to this one, and printing an interval in a column that is meant to be added up would make the column unaddable.

A band that cleared no gate is Unreadable and never 0.0. A measured zero, on the other hand, IS a reading -- the account was up, was polled, and did not burn -- and one live login at a time means most per-account rows carry one.

func RunwayCreditBurn added in v0.7.0

func RunwayCreditBurn(c forecast.CreditFleet) string

RunwayCreditBurn is the fleet's paid spend, in the currency's major unit per hour with the code beside it. Two decimals, because the unit is money; the code, because amounts in two currencies do not add and a bare figure invites a reader to add them anyway.

A figure that could not be assembled is Unreadable, never zero. Every way it can fail -- mixed currencies, an uncapped account that is spending, no measured spend at all -- is a reason to say nothing rather than to report a fleet spending nothing, which would lengthen a runway made of money.

func RunwayCreditReplenish added in v0.7.0

func RunwayCreditReplenish() string

RunwayCreditReplenish is the credit row's replenishment cell, and it is a function taking nothing because the answer never varies: the endpoint reports no renewal boundary for paid usage, so there is no quantity here to read. That is NoQuantity and not Unreadable -- a reader told "?" would go looking for a renewal rate that does not exist.

func RunwayCreditVerdict added in v0.7.0

func RunwayCreditVerdict(c forecast.CreditFleet, now time.Time, loc *time.Location) string

RunwayCreditVerdict is when the fleet's paid balance reaches zero, or Unreadable when the figure was refused.

It means something different from the two window rows above it and the command says so in prose beside the block: those ask whether resets replenish faster than the fleet spends, and this is a balance divided by a rate with nothing coming back.

func RunwayEmpty added in v0.7.0

func RunwayEmpty(r forecast.AccountRow, now time.Time, loc *time.Location) string

RunwayEmpty is when the simulation first found one account out.

"now" comes first, ahead of any recorded moment, because it is a fact about this minute rather than a projection: an account that is out already must not be rendered as a date the reader could decide to wait for.

An account the run never found out is Unreadable. The run declining to empty an account is not the run promising it survives -- the axis may simply have held, or the band may have decided nothing.

func RunwayLeft added in v0.7.0

func RunwayLeft(pct float64) string

RunwayLeft is how much of an account's binding window is left, in percentage points and bare. No percent sign: the column is headed LEFT, it is summed into the fleet's points on the line above the table, and a percentage there would be read against the wrong window -- the one the account is REPORTED on elsewhere is not always this one.

func RunwayLine added in v0.7.0

func RunwayLine(f forecast.Fleet, now time.Time, loc *time.Location) string

RunwayLine is the one-line summary `ccdad status`, `ccdad list` and the dashboard share, so one wording is spelled once rather than three times.

It returns "" when there is nothing to say, and that empty string is load bearing: it is how all three callers know not to print a line at all, which is what keeps the dashboard's byte-compared golden fixtures from moving on a machine with no history behind it. A fleet with no basis gets no line, not a line saying it holds -- a promise resting on no reading is the one output this whole measurement exists to refuse.

The line carries VERDICTS, not rates. A rate is per axis, two of them do not fit a line that also has to carry the answer, and the number a dashboard owes a reader is when rather than how fast. It also carries no percentage, which is not a style choice: `ccdad status`'s human output is asserted to contain no "0%", "20%", "30m", "ahead" or "five_hour" anywhere, because each is a figure belonging to a window its table is not reporting.

The fleet run -- both axes burning at once -- appears only when it CONTRADICTS the two axes, which it can: it burns more windows and has more ways to end, so it can run dry, or run out of agreement between its two bands, while each axis alone holds. Printing it on every line would put a third verdict on a summary that already carries two and that agrees with them on every ordinary fleet; leaving it out when it disagrees would let "holds on both axes" stand over a fleet the arithmetic says empties.

A fleet that cannot hold also carries how many accounts would -- see RunwayNeedSegment for why only that fleet does.

func RunwayNeedSegment added in v0.7.0

func RunwayNeedSegment(f forecast.Fleet) string

RunwayNeedSegment is the seat count as one clause of RunwayLine, and it is carried only by a fleet that is SHORT.

A fleet that holds already has its answer in the word "holds", and the slack it has on top of that is a block-level figure rather than a dashboard one: the summary line is read at a glance beside Daemon:, Active: and Mode:, and a clause spent on good news is a clause the short case needed. The full form, spare count and all, is in RunwayAccounts.

The parenthetical here is one space, not the two RunwayAccounts uses. The clauses of this line are already held apart by their own separator, and a second wide gap inside one of them would read as a third clause.

RunwayLine's both-axes-hold branch does not call this, and it does not need to: a fleet whose runs all hold was answered by a search counting downward, so its count is at most its usable seats. A fleet that claimed both -- holding and short -- would be a contradiction the run cannot produce, and printing both halves of it on one line is not an improvement on printing one.

func RunwayReplenish added in v0.7.0

func RunwayReplenish(perHour float64) string

RunwayReplenish is what an axis gives back, in percentage points per hour. It always exists for a window axis: an axis with no accounts replenishes at zero, which is a true statement about an empty fleet rather than a reading nobody could take.

func RunwayRowCells added in v0.7.0

func RunwayRowCells(r forecast.AccountRow) (window, left, burn string)

RunwayRowCells is one account row's three weekly cells -- the window its points are counted on, the room left in it, and this account's own measured burn -- rendered together because they stand or fall together.

An account whose response carried no weekly window at all gets NoQuantity in all three and not Unreadable. Nothing failed to be read: the account was read, and this quantity does not exist for it. Borrowing its five-hour window instead would put a five-hour room and a five-hour rate into a column that is summed into the weekly axis above it, and those are two different quantities.

func RunwayVerdict added in v0.7.0

func RunwayVerdict(a forecast.Axis, now time.Time, loc *time.Location) string

RunwayVerdict is an axis's answer as a cell: whether the fleet holds at the measured rate, and when it does not, the moment it empties.

An undecided axis renders Unreadable rather than either answer. The two runs of the band disagreeing means the evidence does not carry a claim, and both "holds" and a date would be claims.

func RunwayWrap added in v0.8.0

func RunwayWrap(label, line string, width int) string

RunwayWrap folds the runway line onto width display columns, breaking only at its own separators and hanging every line after the first under the first clause.

A width of zero means the caller does not know one -- a pipe, a redirect, the buffer a test renders into -- and returns the line exactly as it was joined, byte for byte. That is the case every non-terminal writer takes, and it is what keeps this function out of the way of everything that reads the output as data.

The width arrives as a PARAMETER for the reason the zone does: nothing in this package may read the environment, and the terminal is environment. The caller nearest the reader measures it.

Clauses are atomic. A clause wider than the room gets its own line and is allowed to overflow rather than be cut, because this line ends in an absolute moment and a span: `2026-08-26 08:1` reads as a shorter date, not as a line that did not fit. The dashboard cuts because a page has a right edge it cannot spend; a scrollback has one it can. That is the whole of why these two renderers of one wording answer this differently, and it is not drift.

Every width here is a display column count. The separator is U+00B7 -- one column, two bytes -- so a byte count is wrong by the number of separators on the line, which is the number that grows as the line gets longer.

func ThresholdsFor

func ThresholdsFor(cfg config.Config, now time.Time, plan strategy.Plan, planErr error) (
	resolve func(uuid string) strategy.Thresholds, notices []string)

ThresholdsFor is internal/cli's thresholdsFrom with its notices RETURNED rather than written to a cobra command, so a caller with no command can use it. Package cli's own wrapper prints them and is otherwise unchanged.

The plan is read only when hover is on; with hover off it is ignored entirely, including its error.

func Timestamp added in v0.7.0

func Timestamp(t time.Time, loc *time.Location) string

Timestamp is the one absolute-time rendering in this repository, and the zone is always in it. The two human-facing absolute formats that came before it carry neither a date nor a zone: internal/cli/hover.go's clock is "15:04", and internal/switcher/evaluate.go's Explain uses time.Kitchen. Both are fine for a moment inside the hour and useless for a runway that names one days out. Every remaining .Format in the tree is RFC 3339 or the daemon log's millisecond variant of it, which are machine formats and not an answer here. It lives in internal/view so the runway command, status, list and the dashboard spell one layout once rather than four times.

The zone is not optional, and it is not read here. The arithmetic that produces these moments must not touch the environment, so the location arrives as a parameter. A nil location falls back to UTC rather than to time.Local: a caller that passed none has not told us its zone, and time.Local would print a confidently wrong hour on any machine whose TZ is not the reader's -- including CI, where nothing sets it.

func UpdateLine added in v0.9.0

func UpdateLine(report daemon.Report, running string) (string, bool)

UpdateLine is the release line `ccdad status` prints under the daemon line and the terminal dashboard prints under its liveness block.

The daemon publishes what it SAW -- a version string -- and never a verdict, so the comparison happens here, against the version of the binary doing the reading. That is not a preference: upgrading replaces the binary while the old daemon keeps publishing, so a boolean computed by a 0.6.1 daemon would tell a 0.7.0 CLI to upgrade to what it is already running.

It is SILENT -- ok false -- for every reading it cannot turn into that sentence: no published document, nothing recorded, a recorded release that does not parse, a running version that does not parse (every `dev` build, so every build a developer makes), or a release that is not newer. A line that says nothing useful under a dashboard people read every day is worse than no line.

func WrapLabeled added in v0.8.0

func WrapLabeled(line string, width int) string

WrapLabeled folds one line of the labelled block -- Daemon:, Active:, Hover:, Mode: -- onto width display columns, breaking at spaces and hanging every line after the first under the value.

Measured on an 80-column terminal against a live fleet: Mode: is 124 display columns in recovery and Hover: is 100 whenever hover is on, so the terminal folded both wherever its own right edge fell -- mid-word, mid-clause, sometimes inside a quoted command a reader was meant to type.

It is a SEPARATE function from RunwayWrap, and the difference is not duplication. These lines are prose and break at spaces; the runway line is a row of values whose spaces are inside them, and a break at the one in `2026-08-26 08:19 KST` would produce a date that is not a date. Each knows where its own line may be cut, and neither may be pointed at the other's. What they share is the hanging alignment, which is `hang` below.

The label is found rather than passed, because these lines arrive with it already spelled: the block's contract is a name, a colon, and padding to nine columns, and that is what this looks for. A line with no colon has no label and no indent, which is the honest rendering of a line this block did not produce.

A width of zero -- every writer that is not a terminal -- returns the line exactly as its builder spelled it, and so does a terminal too narrow to hold the label, where there is no room to hang anything in.

Types

type Exec

type Exec func(argv []string) (code int, stdout, stderr string)

Exec runs one ccdad command through a FRESH cobra root and reports what it wrote and what it exited with. It is a function value declared in this leaf package because internal/cli must import internal/tui to register a command, so internal/tui must never import internal/cli. internal/mcpsrv takes the identical seam.

type Row

type Row struct {
	Account  store.Account
	Active   bool
	Entry    usage.Entry
	HasEntry bool
	Headroom strategy.Headroom
	Pace     map[usage.WindowName]usage.Pace
	Engine   daemon.AccountStatus
}

Row is one account with everything the dashboard knows about it, from each field's one authoritative source.

func Rows

func Rows(accounts []store.Account, cache *usage.Cache, active store.Account,
	hasActive bool, now time.Time, thresholds func(uuid string) strategy.Thresholds) []Row

Rows pairs every account with its cached reading.

`list` builds its rows through this too, and that is what "`ccdad list` and `ccdad status --json` can never disagree" actually rests on: one cache, read one way, into one shape. Two commands each deriving headroom for themselves would agree until the day one of them was changed.

Engine state is deliberately NOT filled in here. It comes from status.json, which is the daemon's own document and no part of what `list` reports.

func (Row) AgeLabel

func (r Row) AgeLabel(now time.Time) string

AgeLabel is how old this account's reading is.

func (Row) Empty added in v0.8.0

func (r Row) Empty() (empty, known bool)

Empty is whether some window this account carries has nothing left in it at all, and whether that could be established.

It is an ACCOUNT-level question and deliberately not a question about the window this row happens to report. A blown FIVE-HOUR window can never be a floor -- strategy admits a floor only for a window usage.IsWeekly answers for -- so when a weekly binds on slack the reported window is that weekly and the empty five-hour window is invisible to anything that only looks at what the bar draws. The live shape: five_hour at 100% used and 95% elapsed beside seven_day at 40% used and 30% elapsed. The weekly binds, there is no floor, the bar reads 40%, and every window-level test on the reported window calls the account healthy while it cannot serve a single prompt.

It DELEGATES rather than restating the predicate, because "nothing left" is not "past the number it was given": under hover a threshold is a pace target and runs above 100 late in a window, so an empty window reports positive slack. That distinction has exactly one implementation, in strategy.OutOfQuota, and the daemon's own empty() delegates to it for the same reason -- a second spelling is the copy that drifts, and this one would drift where a user is looking.

Three-valued for the reason the whole package is: an account nobody could read is not an empty one, and folding that into a bare bool is the bug that parked cswap's engine on the account that reset last.

func (Row) LeftLabel

func (r Row) LeftLabel() string

LeftLabel is how much of the binding window is LEFT, which is the column `ccdad list` carries.

It is the complement of status's USED column and deliberately so: `list` is where an account is chosen, and headroom is the quantity that choice is made on — it is what the engine itself ranks by. The two columns are labelled, so a reader is never asked to guess which way round a bare percentage runs.

It stays on the ORDERING window while RESETS IN beside it names the reported one, so on an account with a tripped weekly cap the two describe different windows. That is the intended trade: LEFT has to keep meaning "how much of the tightest window is left" or it stops being the figure the ranking used, and RESETS IN has to name the cap that actually holds the account back or it tells a user to wait ten minutes for an account that is gone until Friday.

Never "0%" for an account that could not be read.

func (Row) ListLabel

func (r Row) ListLabel() string

ListLabel is both the address and the handle, which is NOT Account.Label(): that one returns the alias alone, and a listing is where a user learns which alias belongs to which address.

func (Row) Marker

func (r Row) Marker() string

Marker is the active-row marker: the character `status` and `list` both already print in front of the IDX column.

func (Row) PaceLabel

func (r Row) PaceLabel() string

PaceLabel is the pace reading's human half: how the reported window's consumption compares with the time elapsed in it.

It reports the REPORTED window's pace and no other, so the column describes the same window the two columns beside it do. Every window's pace is in --json.

The projection is deliberately absent: projectedExhaustionAt and willLastToReset stay out of every human view, because a straight line through bursty real usage is too rough to present as fact — and the way that sticks is that nothing here can reach them: they are behind usage.Pace.Projection.

func (Row) Reported

func (r Row) Reported() (usage.NamedWindow, bool)

Reported resolves ReportedName to the window itself, together with when it rolls over. It is what the USED, WINDOW, RESETS IN and PACE columns all read, so they always describe the same window.

The Known check is redundant TODAY and is kept deliberately: with no window reporting a utilization, strategy leaves both names as the empty WindowName and the loop below matches nothing anyway. A mutation removing it survives for exactly that reason. It stays because the alternative is for this function's correctness to rest on an invariant of another package's zero value.

func (Row) ReportedName

func (r Row) ReportedName() usage.WindowName

ReportedName is the window this account is REPORTED against, which is not always the one it is ordered on.

A tripped WEEKLY cap wins, because it is the one that will not come back for days: an account whose five-hour window rolls over in eight minutes is still unusable until Friday, and naming the five-hour window would tell the user to wait eight minutes for it. Ordering still runs on Headroom.Slack, which is the tightest window whichever family it belongs to, so this rule moves no account in the ordinary order. It is not inert in RECOVERY order: what an account has to wait out is the weekly floor, so the same field decides whether it counts as returning inside the horizon.

func (Row) ReportedSlack added in v0.8.0

func (r Row) ReportedSlack() (slack, threshold float64, ok bool)

ReportedSlack is the slack and the threshold of the window Reported() resolves: the FLOOR pair when there is a floor, the BINDING pair otherwise. It mirrors ReportedName exactly, and that is the whole of its job.

It exists because Headroom.Slack and Headroom.Threshold are assigned off the binding window in one statement, while ReportedName answers the floor when there is one -- so a caller pairing the two is describing two windows and saying it is describing one. The bar a dashboard draws is filled from Reported(); colouring it from Headroom.Slack paints a weekly with nothing left in it as roomy, on the strength of a five-hour window that happened to bind three points under its own pace target.

Nothing is derived a second time here. Both pairs were computed by strategy.HeadroomFor in one pass over one window set, and this only chooses between them: recomputing slack from a utilization and a threshold read back out of the snapshot would be a second implementation of the ranking's own arithmetic, living in the package whose entire reason for existing is that there is ONE of each of these.

ok mirrors Reported()'s ok rather than Headroom.Known, and the two can differ: headroom is perfectly well known for an account whose reported name is missing from AllWindows. A row rendering "?" for its window while showing a slack figure beside it invites a reader to trust a number about a window that is not on the screen.

func (Row) ResetsLabel

func (r Row) ResetsLabel(now time.Time) string

ResetsLabel is when the reported window rolls over, as a span. Both tables render it from here so the two can never describe one reset two ways.

func (Row) StatusFlags

func (r Row) StatusFlags() string

StatusFlags is the suffix `ccdad status` prints after the age column. It is NOT `ccdad list`'s: that one joins primary and disabled, because a listing is where an account is chosen and an account can carry both flags at once.

func (Row) StatusLabel

func (r Row) StatusLabel() string

func (Row) TierLabel

func (r Row) TierLabel() string

func (Row) TypeLabel

func (r Row) TypeLabel() string

TypeLabel has no caller inside package cli today, and never will: both `status`'s renderStatus and `list` pass r.Account.Kind straight to a `%s` verb and let Stringer run, since that produces the identical bytes with one less method call in the diff. It exists for a renderer that cannot lean on Stringer -- a terminal UI measuring a column's width needs an actual string to measure, not a value it can only format and then measure the result of.

func (Row) UsedLabel

func (r Row) UsedLabel() string

UsedLabel is how much of the reported window is SPENT, which is the column `ccdad status` carries. Never "0%" for an account that could not be read: there are two absences here and both render Unreadable. Reported() is false with no cache entry, unknown headroom, or a name AllWindows does not carry; Percent() is false when the window is present and reported no utilization.

func (Row) WindowLabel

func (r Row) WindowLabel() string

WindowLabel names the reported window, or "-" when there is no reading. It is deliberately separate from UsedLabel even though both come out of one Reported() call: the old inline form left windowName set and used unset when Percent() was false, and that combination is real -- a window that is present and reported no number.

type Snapshot

type Snapshot struct {
	Now         time.Time
	Rows        []Row
	Report      daemon.Report
	ActiveLabel string // "work@example.com (work)", or "none of the managed accounts"
	Strategy    string // config.Config.Strategy.String(), as CONFIGURED -- see StrategyLabel
	Hover       bool   // config.Config.Hover
	Mode        strategy.Mode
	HasMode     bool
	Version     string   // buildinfo.String()'s first field, or a test constant
	Notices     []string // everything cli would have written to stderr

	// Forecast is the measured burn and what it implies, and HasForecast is
	// whether one could be produced at all.
	//
	// The pair is a tri-state and not a nilable pointer, for the reason the
	// fields above it are: a dashboard reads this struct and must never be able
	// to dereference its way into a panic on a machine that has been recording
	// for ten minutes. HasForecast false is "no measurement", never "a fleet
	// burning nothing" -- the zero Fleet's verdicts are all VerdictUnknown, so
	// a renderer that ignored the flag would still print no promise.
	//
	// Package cli computes it, as it computes everything else here, so the same
	// value reaches the dashboard and the command line and no number is derived
	// in two places.
	Forecast    forecast.Fleet
	HasForecast bool
}

Snapshot is one complete read of the documents a dashboard renders. Package cli builds it — it owns the attribution probe and the notice stream — and package tui only reads it, so no number is derived in two places.

func (Snapshot) StrategyLabel added in v0.7.0

func (s Snapshot) StrategyLabel() string

StrategyLabel is the strategy in FORCE, which under hover is not the one in the file.

Hover derives its own: strategy.Options' withHover pass overrides the key with headroom, because a window close to its reset already carries a high threshold and ordering by reset instant on top of that would rank on a quantity none of hover's numbers came from. config.HoverOverrides answers true for the key and `ccdad config list` marks it, so a header naming the file's value was the one surface left spelling a setting nothing applies -- which reads to a user as hover not being on at all.

Strategy itself keeps the configured value rather than being overwritten, because the terminal dashboard's strategy picker marks its current entry from it. Setting the key while hover is on is a legitimate "for later"; it is only naming it as the one in force that is false.

Jump to

Keyboard shortcuts

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