pub struct Timeline { /* private fields */ }Expand description
Execution events and derived completion times of every work item at one clock reading.
This is the single evaluator of relation gates: task readiness and lifecycle commands, milestone and package completion, progress and the remaining schedule all read edge releases from here, so they cannot disagree. It is derived from authoritative facts and never persisted.
Implementations§
Source§impl Timeline
impl Timeline
Sourcepub fn start_edge(&self, plan: &Plan, edge: &Dependency) -> StartRelease
pub fn start_edge(&self, plan: &Plan, edge: &Dependency) -> StartRelease
Evaluate an edge for the successor’s claim or start.
A provisional edge releases on the predecessor’s current attempt’s submission plus positive
lag until its verified finish releases it, so verifying that attempt never pushes an
elapsing start gate later. Every other evaluation, including the successor’s verification
and milestone reach, uses Timeline::edge, so a submission never counts as a finish
there. A legacy submission without an attempt record has nothing a basis could reference,
so its edge waits for verification.
Sourcepub fn next_release(&self, plan: &Plan) -> Option<DateTime<Utc>>
pub fn next_release(&self, plan: &Plan) -> Option<DateTime<Utc>>
The earliest instant after this timeline’s clock reading at which a pending gate opens with no change to the plan: an elapsing dependency lag (including a provisional start lag) or a decision gate released with elapsing lag.
Time passing is the only change, so an adapter that evaluated at Timeline::now knows
when to evaluate again. The instant is the exact opening boundary: a reading strictly
before it still sees the gate elapsing, a reading at it sees it released. A fact recorded
with a future time is not reported as elapsing, so it is not included.
Source§impl Timeline
impl Timeline
Sourcepub fn at(plan: &Plan, now: DateTime<Utc>) -> Self
pub fn at(plan: &Plan, now: DateTime<Utc>) -> Self
Derive completion from a validated plan and an adapter-supplied clock reading.
Tasks complete when verified and their conditions are selected. A milestone is reached when it is applicable and every unwaived incoming edge and every decision gating it or its containers is released; its time is the latest of those releases and of the choices that selected it or skipped its branches. A work package completes when every child that a choice did not exclude is complete, and at least one is, at the latest child, choice or gate time; a package whose children were all excluded or cannot proceed is not applicable, so it is never complete.
Sourcepub fn incoming<'a>(
&'a self,
plan: &'a Plan,
work: WorkItemId,
) -> impl Iterator<Item = &'a Dependency>
pub fn incoming<'a>( &'a self, plan: &'a Plan, work: WorkItemId, ) -> impl Iterator<Item = &'a Dependency>
Enforced incoming edges in source order, for the same immutable plan used by this timeline.
Sourcepub fn completed_at(&self, work: WorkItemId) -> Option<EventTime>
pub fn completed_at(&self, work: WorkItemId) -> Option<EventTime>
Completion time of verified tasks, reached milestones and completed packages.
Sourcepub fn completed(&self) -> BTreeSet<WorkItemId>
pub fn completed(&self) -> BTreeSet<WorkItemId>
Identities of all completed work.
Sourcepub fn event(
&self,
plan: &Plan,
work: WorkItemId,
endpoint: Endpoint,
) -> Option<EventTime>
pub fn event( &self, plan: &Plan, work: WorkItemId, endpoint: Endpoint, ) -> Option<EventTime>
Time of a work item’s start or finish event, if it has occurred.
Sourcepub fn applicability(&self, work: WorkItemId) -> &Applicability
pub fn applicability(&self, work: WorkItemId) -> &Applicability
Whether work belongs to the active graph, and if not, why.
Sourcepub fn edge(&self, plan: &Plan, edge: &Dependency) -> Release
pub fn edge(&self, plan: &Plan, edge: &Dependency) -> Release
Whether an edge’s required predecessor event plus positive lag has elapsed.
A constraint from not-selected work is a skipped branch, released once the choice has been made, only into an active-branch join; into any other successor it never releases.
Sourcepub fn decisions<'a>(
&self,
plan: &'a Plan,
work: WorkItemId,
) -> Vec<(&'a Decision, Release)>
pub fn decisions<'a>( &self, plan: &'a Plan, work: WorkItemId, ) -> Vec<(&'a Decision, Release)>
Decisions naming this work or a containing package as blocked, with their release state.
Sourcepub fn selecting_choices<'a>(
&self,
plan: &'a Plan,
work: WorkItemId,
) -> Vec<(&'a Decision, EventTime)>
pub fn selecting_choices<'a>( &self, plan: &'a Plan, work: WorkItemId, ) -> Vec<(&'a Decision, EventTime)>
Decisions whose standing outcomes select applicable work through its own or its containers’ conditions, each with the time that outcome has held; empty for work that is not applicable.
Work cannot have taken a transition before the choice that put it in the plan was made.