pub struct Goal {
pub schema: String,
pub id: String,
pub objective: String,
pub context: Vec<PathBuf>,
pub posture: String,
pub invariants: Vec<String>,
pub phases: Vec<Phase>,
pub verify: String,
pub created_ms: i64,
pub updated_ms: i64,
}Expand description
A durable, resumable objective.
Fields§
§schema: String§id: StringStable across resumes. The thing a log line can point at.
objective: StringOne outcome. Not a list — a goal that wants three things is three goals, and the single objective is what makes “what was this run for?” answerable months later.
context: Vec<PathBuf>Paths to read, not their contents. See the module docs.
posture: StringHow to work: cautious, exploratory, ship-it. Free text, because the useful values differ per team and an enum would just be ignored.
invariants: Vec<String>What must not change. Stated separately from the objective because the model reads the objective as an instruction and these as a boundary.
phases: Vec<Phase>§verify: StringHow completion is checked, in words. The executable form is an
crate::Acceptance; this is what a human reads to know what that
check is supposed to be enforcing.
created_ms: i64§updated_ms: i64Implementations§
Source§impl Goal
impl Goal
pub fn new( id: impl Into<String>, objective: impl Into<String>, now_ms: i64, ) -> Self
pub fn with_context<I, P>(self, paths: I) -> Self
pub fn with_posture(self, p: impl Into<String>) -> Self
pub fn with_invariants<I, S>(self, items: I) -> Self
pub fn with_phases<I, S>(self, titles: I) -> Self
pub fn with_verify(self, v: impl Into<String>) -> Self
Sourcepub fn current(&self) -> Option<(usize, &Phase)>
pub fn current(&self) -> Option<(usize, &Phase)>
The phase to work on: the one running, else the first not yet done.
A Failed phase is returned again rather than skipped — the run stopped
there for a reason and resuming past it would quietly abandon work the
goal still claims to want.
Sourcepub fn complete(&self) -> bool
pub fn complete(&self) -> bool
Every phase is Done. A goal with no phases is never complete: it has
not been broken down, so there is nothing to have finished.
Sourcepub fn start_current(&mut self, now_ms: i64) -> Option<usize>
pub fn start_current(&mut self, now_ms: i64) -> Option<usize>
Mark the current phase as in flight.