pub struct MilestoneTracker { /* private fields */ }Expand description
Tracks milestone contract progress and owns its phase-cursor transitions;
LoopStateMachine::handle_milestone_result drives it via advance/record_block.
Implementations§
Source§impl MilestoneTracker
impl MilestoneTracker
Sourcepub fn load_contract(&mut self, contract: MilestoneContract)
pub fn load_contract(&mut self, contract: MilestoneContract)
Load a milestone contract. Must be called before the run starts.
Sourcepub fn current_phase(&self) -> Option<&MilestonePhase>
pub fn current_phase(&self) -> Option<&MilestonePhase>
The full current (not-yet-passed) phase, or None when no contract is
loaded or all phases are complete. Callers read verifier/criteria/unlocks/
rollback_policy from here instead of re-deriving from raw indices.
Sourcepub fn current_phase_id(&self) -> Option<&str>
pub fn current_phase_id(&self) -> Option<&str>
Returns the ID of the current (not-yet-passed) phase, or None when
no contract is loaded or all phases are complete.
Sourcepub fn current_criteria(&self) -> &[String]
pub fn current_criteria(&self) -> &[String]
Returns the acceptance criteria of the current phase as a slice.
Sourcepub fn advance(&mut self)
pub fn advance(&mut self)
A phase passed: move the cursor to the next phase and reset the block counter.
Sourcepub fn record_block(&mut self) -> usize
pub fn record_block(&mut self) -> usize
The current phase was blocked; returns the updated consecutive-block count.
Sourcepub fn is_complete(&self) -> bool
pub fn is_complete(&self) -> bool
Returns true when there is no contract or all phases have passed.