pub struct AttemptTracker {
pub schema: String,
pub version: String,
pub updated_at: DateTime<Utc>,
pub attempts: HashMap<String, TrackedAttempt>,
pub checkpoints: HashMap<String, TrackedCheckpoint>,
pub history: Vec<AttemptHistoryEntry>,
}Expand description
Tracks all attempts across the project
Fields§
§schema: StringJSON Schema URL for validation
version: StringVersion
updated_at: DateTime<Utc>When last updated
attempts: HashMap<String, TrackedAttempt>Active attempts by ID
checkpoints: HashMap<String, TrackedCheckpoint>Checkpoints by name
history: Vec<AttemptHistoryEntry>Attempt history (completed/reverted)
Implementations§
Source§impl AttemptTracker
impl AttemptTracker
Sourcepub fn load_or_create() -> Self
pub fn load_or_create() -> Self
Load or create tracker
Sourcepub fn start_attempt(
&mut self,
id: &str,
for_issue: Option<&str>,
description: Option<&str>,
) -> &mut TrackedAttempt
pub fn start_attempt( &mut self, id: &str, for_issue: Option<&str>, description: Option<&str>, ) -> &mut TrackedAttempt
Start a new attempt
Sourcepub fn record_modification(
&mut self,
attempt_id: &str,
file_path: &str,
original_content: &str,
new_content: &str,
) -> Result<()>
pub fn record_modification( &mut self, attempt_id: &str, file_path: &str, original_content: &str, new_content: &str, ) -> Result<()>
Record a file modification in an attempt
Sourcepub fn fail_attempt(&mut self, id: &str, reason: Option<&str>) -> Result<()>
pub fn fail_attempt(&mut self, id: &str, reason: Option<&str>) -> Result<()>
Mark attempt as failed
Sourcepub fn verify_attempt(&mut self, id: &str) -> Result<()>
pub fn verify_attempt(&mut self, id: &str) -> Result<()>
Mark attempt as verified/successful
Sourcepub fn revert_attempt(&mut self, id: &str) -> Result<Vec<RevertAction>>
pub fn revert_attempt(&mut self, id: &str) -> Result<Vec<RevertAction>>
Revert an attempt
Sourcepub fn create_checkpoint(
&mut self,
name: &str,
files: &[&str],
description: Option<&str>,
) -> Result<()>
pub fn create_checkpoint( &mut self, name: &str, files: &[&str], description: Option<&str>, ) -> Result<()>
Create a checkpoint
Sourcepub fn restore_checkpoint(&mut self, name: &str) -> Result<Vec<RevertAction>>
pub fn restore_checkpoint(&mut self, name: &str) -> Result<Vec<RevertAction>>
Restore to a checkpoint
Sourcepub fn active_attempts(&self) -> Vec<&TrackedAttempt>
pub fn active_attempts(&self) -> Vec<&TrackedAttempt>
Get all active attempts
Sourcepub fn failed_attempts(&self) -> Vec<&TrackedAttempt>
pub fn failed_attempts(&self) -> Vec<&TrackedAttempt>
Get failed attempts
Sourcepub fn cleanup_failed(&mut self) -> Result<Vec<RevertAction>>
pub fn cleanup_failed(&mut self) -> Result<Vec<RevertAction>>
Clean up failed attempts (revert all)
Trait Implementations§
Source§impl Clone for AttemptTracker
impl Clone for AttemptTracker
Source§fn clone(&self) -> AttemptTracker
fn clone(&self) -> AttemptTracker
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for AttemptTracker
impl Debug for AttemptTracker
Source§impl<'de> Deserialize<'de> for AttemptTracker
impl<'de> Deserialize<'de> for AttemptTracker
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for AttemptTracker
impl RefUnwindSafe for AttemptTracker
impl Send for AttemptTracker
impl Sync for AttemptTracker
impl Unpin for AttemptTracker
impl UnwindSafe for AttemptTracker
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more