pub struct PlanCard {
pub text: String,
pub steps: usize,
pub done: usize,
pub finished_steps: Vec<usize>,
pub settled: bool,
}Expand description
A plan as the card shows it: its own rendering, how many steps it has
and how many of them are done. The step count, not the text, decides how
the card ends; the counts, with the card’s run records, decide its
header (PlanCard::header_with_runs).
Fields§
§text: String§steps: usize§done: usizeIts steps done.
finished_steps: Vec<usize>The steps (zero-based) whose latest outcome is finished: done, or
set aside as not needed. A run that ended short on steps all listed
here was superseded by the turn (superseded_runs).
settled: boolIts records say how it ended: no step is left for its turn to do (each is done, set aside, failed, or handed to a run). Only a settled plan’s header is a verdict the card’s runs could contradict; one still being worked through keeps its own (“Working · step 2 of 4”).
Implementations§
Source§impl PlanCard
impl PlanCard
Sourcepub fn header_with_runs(&self, runs: &[RunPhase]) -> Option<String>
pub fn header_with_runs(&self, runs: &[RunPhase]) -> Option<String>
The header the card shows above this plan’s steps, from the plan’s
own state and the phases of the runs on the same card together, so
the header never says something the runs’ lines (or the card’s total)
contradict. While any run on the card still runs, the work goes on:
“continuing in the background”, whatever the plan’s own steps read
(live 2026-11-13: “Stopped short · 2 of 4 done” above two helpers that
were still working, then finished). Once all ended, a plan whose
steps all read done on a card where a run failed or stopped says how
that run ended. Otherwise the plan’s own header. None: the plan’s
own header stands (a one-step plan has none).