pub struct ApprovalManager;Expand description
Manages approval gates and phase transitions for spec writing sessions
Implementations§
Source§impl ApprovalManager
impl ApprovalManager
Sourcepub fn initialize_gates() -> Vec<ApprovalGate>
pub fn initialize_gates() -> Vec<ApprovalGate>
Initializes approval gates for all phases in a new session
Creates approval gates for each phase in sequential order. All gates start in unapproved state.
Sourcepub fn approve_phase(
session: &mut SpecWritingSession,
approver: &str,
feedback: Option<String>,
) -> Result<(), SpecError>
pub fn approve_phase( session: &mut SpecWritingSession, approver: &str, feedback: Option<String>, ) -> Result<(), SpecError>
Approves the current phase in a session
Records approval with timestamp and approver information. Returns error if phase is already approved or if session is invalid.
§Arguments
session- The spec writing session to approveapprover- Name of the person approvingfeedback- Optional feedback on the phase
§Returns
Updated session with approval recorded, or error if approval fails
Sourcepub fn transition_to_next_phase(
session: &mut SpecWritingSession,
) -> Result<(), SpecError>
pub fn transition_to_next_phase( session: &mut SpecWritingSession, ) -> Result<(), SpecError>
Transitions to the next phase if current phase is approved
Enforces sequential phase progression. Only allows transition to the next phase if the current phase has been explicitly approved.
§Arguments
session- The spec writing session
§Returns
Updated session with new phase, or error if transition is not allowed
Sourcepub fn can_transition(session: &SpecWritingSession) -> bool
pub fn can_transition(session: &SpecWritingSession) -> bool
Checks if a phase transition is allowed
Returns true if the current phase is approved and the next phase exists.
Sourcepub fn get_phase_approval(
session: &SpecWritingSession,
phase: SpecPhase,
) -> Option<&ApprovalGate>
pub fn get_phase_approval( session: &SpecWritingSession, phase: SpecPhase, ) -> Option<&ApprovalGate>
Gets the approval status for a specific phase
Returns the approval gate for the given phase, or None if not found.
Sourcepub fn get_all_approvals(session: &SpecWritingSession) -> &[ApprovalGate]
pub fn get_all_approvals(session: &SpecWritingSession) -> &[ApprovalGate]
Gets all approval gates for a session
Sourcepub fn are_phases_approved_up_to(
session: &SpecWritingSession,
target_phase: SpecPhase,
) -> bool
pub fn are_phases_approved_up_to( session: &SpecWritingSession, target_phase: SpecPhase, ) -> bool
Checks if all phases up to and including the given phase are approved
Useful for validating that a session has completed all required phases.
Trait Implementations§
Source§impl Clone for ApprovalManager
impl Clone for ApprovalManager
Source§fn clone(&self) -> ApprovalManager
fn clone(&self) -> ApprovalManager
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more